query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
1948427652473749dc8303e0aba5b5a8
|
Analize SDC data remove unexpected line (Tcl sentence) operate separating each attribute
|
[
{
"docid": "050ef676f2e691d0372b54201e8ba5c5",
"score": "0.49336335",
"text": "def analize\n \n printf(\"@I:analize sdc file\\n\")\n @SDC_DATA.each{|line|\n\n next if line == nil\n const_each = ConstEach.new\n line = line.strip\n if /^if/ =~ line || /^\\} else/ =~ line || /^\\}/ =~ line \n #\n # !!Caution!! Now, not support!!\n #\n elsif /^#/ =~ line || line == \"\"\n elsif /define_scope_collection/ =~ line\n #\n # !!Caution!! Now, not support!!\n #\n elsif /define_clock/ =~ line\n /^define_clock\\s*\\{\\s*(\\S+)\\s*\\}\\s*-name\\s*\\{\\s*(\\S+)\\s*\\}\\s*-([a-zA-Z]*)\\s*(\\S+)\\s*.*/ =~ line\n if $1 == nil || $2 == nil || $3 == nil \n printf(\"@Internal error. (file:%s,line:%s)\\n\",__FILE__,__LINE__)\n exit\n else\n const_each.SDC = line\n const_each.SDCAttribute = \"define_clock\"\n const_each.Signal_mod = name_reverse($1)\n const_each.ClockName = $2\n const_each.Period = $4 if $3 == \"period\" \n const_each.Freq = $4 if $3 == \"freq\"\n @SDC_DB.define_clock[\"#{line}\"] = const_each\n end\n\n elsif /^define_attribute/ =~ line \n /^define_attribute\\s+\\{\\s*(\\S*)\\s*\\}\\s*\\{([a-zA-Z_]*)\\}\\s+\\{\\s*(\\d*)\\s*\\}\\s*/ =~ line\n const_each.SDC = line\n p line\n if $1 == nil\n printf(\"@Internal error. (file:%s,line:%s)\\n\",__FILE__,__LINE__)\n exit\n end\n const_each.Pin_mod = name_reverse($1)\n const_each.SDCAttribute = $2 \n case const_each.SDCAttribute\n when \"xc_pulldown\" then\n @SDC_DB.xc_pulldown[\"#{line}\"] = const_each\n when \"xc_pullup\" then\n @SDC_DB.xc_pullup[\"#{line}\"] = const_each\n when \"xc_pulldown\" then\n @SDC_DB.xc_pulldown[\"#{line}\"] = const_each\n when \"syn_keep\" then\n @SDC_DB.syn_keep[\"#{line}\"] = const_each\n when \"syn_noclockbuf\" then\n @SDC_DB.syn_noclockbuf[\"#{line}\"] = const_each\n else\n printf(\"@Internal error. (file:%s,line:%s)\\n\",__FILE__,__LINE__)\n exit\n end\n\n elsif /^define_attribute/ =~ line \n /^define_attribute\\s+\\{\\s*(\\S*)\\s*\\}\\s*([a-zA-Z_]*)\\s+\\{\\s*(\\d*)\\s*\\}\\s*/ =~ line\n const_each.SDC = line\n const_each.Pin_mod = name_reverse($1)\n const_each.SDCAttribute = $2 \n case const_each.SDCAttribute\n when \"xc_pulldown\" then\n @SDC_DB.xc_pulldown[\"#{line}\"] = const_each\n when \"xc_pullup\" then\n @SDC_DB.xc_pullup[\"#{line}\"] = const_each\n when \"xc_pulldown\" then\n @SDC_DB.xc_pulldown[\"#{line}\"] = const_each\n when \"syn_keep\" then\n @SDC_DB.syn_keep[\"#{line}\"] = const_each\n when \"syn_noclockbuf\" then\n @SDC_DB.syn_noclockbuf[\"#{line}\"] = const_each\n else\n printf(\"@Internal error. (file:%s,line:%s)\\n\",__FILE__,__LINE__)\n exit\n end\n elsif /^define_multicycle_path/ =~ line \n const_each.SDC = line\n if(( /^define_multicycle_path\\s*#{SDCCtrl::THROUGH}#{SDCCtrl::THROUGH}#{SDCCtrl::NUM}/=~ line ) != nil)\n const_each.Through1_mod = name_reverse($1)\n const_each.Through2_mod = name_reverse($2)\n const_each.Period = $3\n @SDC_DB.define_multicycle_path[\"#{line}\"] = const_each\n elsif(( /^define_multicycle_path\\s*#{SDCCtrl::FROM}#{SDCCtrl::TO}#{SDCCtrl::NUM}/=~ line ) != nil)\n const_each.From_mod = name_reverse($1)\n const_each.To_mod = name_reverse($2)\n const_each.Period = $3\n @SDC_DB.define_multicycle_path[\"#{line}\"] = const_each\n else\n printf(\"@Internal error. (file:%s,line:%s)\\n\",__FILE__,__LINE__)\n exit\n end\n elsif /^define_false_path/ =~ line\n const_each.SDC = line\n if(( /^define_false_path\\s*#{SDCCtrl::FROM}#{SDCCtrl::THROUGH}#{SDCCtrl::TO}/=~ line ) != nil)\n const_each.From_mod = name_reverse($1)\n const_each.Through1_mod = name_reverse($2)\n const_each.To_mod = name_reverse($3)\n @SDC_DB.define_false_path[\"#{line}\"] = const_each\n elsif(( /^define_false_path\\s*#{SDCCtrl::MTHROUGH}#{SDCCtrl::MTHROUGH}/=~ line ) != nil)\n const_each.Through1_mod = name_reverse($1.split[0])\n const_each.Through1_mod = name_reverse($2.split[0])\n @SDC_DB.define_false_path[\"#{line}\"] = const_each\n elsif(( /^define_false_path\\s*#{SDCCtrl::FROM}#{SDCCtrl::TO}/=~ line ) != nil)\n const_each.From_mod = name_reverse($1)\n const_each.To_mod = name_reverse($2)\n @SDC_DB.define_false_path[\"#{line}\"] = const_each\n elsif(( /^define_false_path\\s*#{SDCCtrl::THROUGH}#{SDCCtrl::TO}/=~ line ) != nil)\n const_each.Through1_mod = name_reverse($1)\n const_each.To_mod = name_reverse($2)\n @SDC_DB.define_false_path[\"#{line}\"] = const_each\n elsif(( /^define_false_path\\s*#{SDCCtrl::THROUGH}/=~ line ) != nil)\n const_each.Through1_mod = name_reverse($1)\n @SDC_DB.define_false_path[\"#{line}\"] = const_each\n elsif(( /^define_false_path\\s*#{SDCCtrl::FROM}/=~ line ) != nil)\n const_each.From_mod = name_reverse($1)\n @SDC_DB.define_false_path[\"#{line}\"] = const_each\n elsif(( /^define_false_path\\s*#{SDCCtrl::TO}/=~ line ) != nil)\n const_each.To_mod = name_reverse($1)\n @SDC_DB.define_false_path[\"#{line}\"] = const_each\n elsif(( /^define_false_path\\s*#{SDCCtrl::MFROM}/=~ line ) != nil)\n const_each.From_mod = name_reverse($1.split[0])\n @SDC_DB.define_false_path[\"#{line}\"] = const_each\n else\n p line\n printf(\"@Internal error. (file:%s,line:%s)\\n\",__FILE__,__LINE__)\n exit\n end\n elsif /^define_global_attribute/ =~ line\n const_each.SDC = line\n if(( /^define_global_attribute\\s+(\\S+)\\s+\\{\\d+\\}/=~ line ) != nil)\n const_each.SDCAttribute = $1\n @SDC_DB.define_global_attribute[\"#{line}\"] = const_each\n else\n printf(\"@Internal error. (file:%s,line:%s)\\n\",__FILE__,__LINE__)\n exit\n end\n else\n p line\n printf(\"@Internal error. (file:%s,line:%s)\\n\",__FILE__,__LINE__)\n exit\n end\n get_MacroName(const_each) # make Macro Name from signal\n }\n printf(\"@I:analize sdc file Done\\n\")\n\n # make each size\n make_size\n\n end",
"title": ""
}
] |
[
{
"docid": "f79dbd6295b4d272d12b689afe6f3548",
"score": "0.59053147",
"text": "def tidy(data); end",
"title": ""
},
{
"docid": "cb2612dee6ea12d5c7f5d51c0f9b34e1",
"score": "0.5865112",
"text": "def compare_scr\n line = Array.new\n @attribute_all.each_value{|const|\n const[1].each{|line,data|\n data.SDC.each{|sdc|\n sdc_tmp = sdc.gsub(\"\\*\",\"\").split[2].slice(2..1000)\n @RPT_ERR.each{|key,err|\n sig_tmp = err.SignalName.gsub(\"\\*\",\"\")\n if err.AttributeName == sdc.split[0] && sig_tmp == sdc_tmp\n data.ConstCheckFlag = 0\n data.SynthesisReport = err.Message\n noapply = Array.new\n noapply << line\n noapply << data.SDC\n noapply << err.Message\n @RPT_ErrorList << noapply\n end\n }\n }if data.SDC != nil\n }\n }\n end",
"title": ""
},
{
"docid": "3b26f440a988236f5ac5f38411d4602e",
"score": "0.5694309",
"text": "def pre_operation\n reportICE_tmp = Array.new\n printf(\"@I:Pre-Operation\\n\")\n # line operation\n line_s = Array.new\n @Report_Data.each do |line|\n if /^\\|/ =~ line # for \"1\" \n line = line.sub(\"\\n\",\"\") # erase \"\\n\"\n line_s = line.split(/\\|/) # sub \"|\" charactor\n line_s.delete_at(0)\n reportICE_tmp << line_s\n end\n end\n\n # word operation for each line\n # - modify structrure for multi line description\n size = reportICE_tmp.size-1 \n while( size >= 0 )\n reportICE_tmp[size][@PinNo] = reportICE_tmp[size][@PinNo].gsub(\" \",\"\") # delete space char for 1-st column\n reportICE_tmp[size][@PinName] = reportICE_tmp[size][@PinName].gsub(\" \",\"\") # delete space char for 2-nd column\n reportICE_tmp[size][@ConnectionList] = reportICE_tmp[size][@ConnectionList].gsub(\" \",\"\") # delete space char for 3-rd column\n reportICE_tmp[size][@Attribute] = \"\" # for attribute\n if ( reportICE_tmp[size][@PinNo] == \"\" )\n reportICE_tmp[size-1][@ConnectionList] = reportICE_tmp[size-1][@ConnectionList] + reportICE_tmp[size][@ConnectionList] # combile multi lines\n reportICE_tmp.delete_at(size) \n end\n size -= 1\n end\n\n #\n # modify each data\n #\n if $VERBOSE == true; printf(\"@I:Print Attribute\\n\"); end;\n reportICE_tmp.each do |word|\n pininfo = ReportPinInfo.new\n word[@ConnectionList] = word[@ConnectionList].sub(\"\\[out\\/ioshort\\]\",\"\") # delete unsuported comment\n #\n # PULLDOWN\n #\n if /\\[pulldown\\]/ =~ word[@ConnectionList]\n# if $VERBOSE == true; puts word[@PinNo] + \":\" + word[@PinName] + \" is Pull Down signal\"; end;\n word[@Attribute] = \"pulldown\"\n word[@ConnectionList] = word[@ConnectionList].sub(\"\\[pulldown\\]\",\"\")\n\n # make data\n pininfo.No,pininfo.NetName,pininfo.Attribute,pininfo.PIN = make_pininfo(word)\n \n # connection list\n pininfo.ConnectInfo, @PullDown, pininfo.Type = make_connection_data(word[@ConnectionList],pininfo)\n @List[\"#{pininfo.No}\"] = pininfo\n \n @ConnectList[\"#{pininfo.No}\"] = pininfo\n @NetNameList[\"#{pininfo.NetName}\"] = pininfo\n\n #\n # PULLUP\n #\n elsif /\\[pullup\\]/ =~ word[@ConnectionList]\n# if $VERBOSE == true; puts word[@PinNo] + \":\" + word[@PinName] + \" is Pull Up signal\"; end;\n word[@Attribute] = \"pullup\"\n word[@ConnectionList] = word[@ConnectionList].sub(\"\\[pullup\\]\",\"\")\n \n # make data\n pininfo.No,pininfo.NetName,pininfo.Attribute,pininfo.PIN = make_pininfo(word)\n\n # connection list\n pininfo.ConnectInfo, @PullUp, pininfo.Type = make_connection_data(word[@ConnectionList],pininfo)\n @List[\"#{pininfo.No}\"] = pininfo\n\n @ConnectList[\"#{pininfo.No}\"] = pininfo\n @NetNameList[\"#{pininfo.NetName}\"] = pininfo\n\n elsif /\\[opennet\\]/ =~ word[@ConnectionList]\n# if $VERBOSE == true; puts word[@PinNo] + \":\" + word[@PinName] + \" is Open Net signal\"; end;\n word[@Attribute] = \"opennet\"\n word[@ConnectionList] = word[@ConnectionList].sub(\"\\[opennet\\]\",\"\")\n # make data\n pininfo.No,pininfo.NetName,pininfo.Attribute,pininfo.PIN = make_pininfo(word)\n\n # connection list\n pininfo.ConnectInfo, @OpenNet, pininfo.Type = make_connection_data(word[@ConnectionList],pininfo)\n @OpenNetList[\"#{pininfo.NetName}\"] = pininfo\n @List[\"#{pininfo.No}\"] = pininfo\n\n @ConnectList[\"#{pininfo.No}\"] = pininfo\n @NetNameList[\"#{pininfo.NetName}\"] = pininfo\n \n\n elsif /\\[nofanin\\]/ =~ word[@ConnectionList]\n# if $VERBOSE == true; puts word[@PinNo] + \":\" + word[@PinName] + \" is No Fanin signal\"; end;\n word[@Attribute] = \"nofanin\"\n word[@ConnectionList] = word[@ConnectionList].sub(\"\\[nofanin\\]\",\"\")\n # make data\n pininfo.No,pininfo.NetName,pininfo.Attribute,pininfo.PIN = make_pininfo(word)\n\n # connection list\n pininfo.ConnectInfo, @NoFanin, pininfo.Type = make_connection_data(word[@ConnectionList],pininfo)\n @NoFaninList[\"#{pininfo.NetName}\"] = pininfo\n @List[\"#{pininfo.No}\"] = pininfo\n\n @ConnectList[\"#{pininfo.No}\"] = pininfo\n @NetNameList[\"#{pininfo.NetName}\"] = pininfo\n elsif /\\[out\\/ioshort\\]/ =~ word[@ConnectionList]\n word[@Attribute] = \"ioshort\"\n word[@ConnectionList] = word[@ConnectionList].sub(\"\\[out\\/ioshort\\]\",\"\")\n # make data\n pininfo.No,pininfo.NetName,pininfo.Attribute,pininfo.PIN = make_pininfo(word)\n\n # connection list\n pininfo.ConnectInfo, @NoFanin, pininfo.Type = make_connection_data(word[@ConnectionList],pininfo)\n @IOShortList[\"#{pininfo.NetName}\"] = pininfo\n @List[\"#{pininfo.No}\"] = pininfo\n\n @ConnectList[\"#{pininfo.No}\"] = pininfo\n @NetNameList[\"#{pininfo.NetName}\"] = pininfo\n else\n # make data\n pininfo.No,pininfo.NetName,pininfo.Attribute,pininfo.PIN = make_pininfo(word)\n\n # connection list\n pininfo.ConnectInfo, @Other, pininfo.Type = make_connection_data(word[@ConnectionList],pininfo)\n\n @ConnectList[\"#{pininfo.No}\"] = pininfo\n @List[\"#{pininfo.No}\"] = pininfo\n @NetNameList[\"#{pininfo.NetName}\"] = pininfo\n \n end\n end\n # Update Original-Data Structure\n @Report_Data = reportICE_tmp\n \n printf(\"@I:Pre-Operation Done\\n\")\n end",
"title": ""
},
{
"docid": "d0ea0a922d049ea340289907b8c6571e",
"score": "0.5653522",
"text": "def clean(data)\n data.map{|line|\n Hash[line.map{ |col| \n col[1] = BOOL_MAP[col[1]] || col[1].to_s.strip.gsub(/^\\s+|\\s+$/, '').gsub(/\\n|\\r/,' ')\n col\n }]\n }\n end",
"title": ""
},
{
"docid": "1ef2424d06973a44da2a123668cf90b4",
"score": "0.5575424",
"text": "def clean_lines_asociated\n if self.line.present?\n line = self.line_id\n devs = Device.where(line_id: line)\n devs.each do |dev|\n unless dev.id == self.id\n dev.line_id = nil\n dev.save\n end\n end\n end\n end",
"title": ""
},
{
"docid": "4ca6668f9e48b7717a0ae35b6e989d11",
"score": "0.532802",
"text": "def process_line line\n if line.include?(\"@\") && @add_tags_to_main\n @nd[:main_tags] << line \n elsif line.include?(\"Feature:\")\n @nd[:feature] = line.sub(\"Feature:\",\"\")\n @add_tags_to_main = false\n elsif line.include?(\"Scenario:\")\n @nd[:scenarios].push({:name => line.sub(\"Scenario:\",\"\"), :steps => []})\n @add_to_s = true\n elsif\n begin\n @nd[:scenarios].last[:steps].push(line) if @add_to_s\n @add_to_s = true \n rescue\n end\n end\n end",
"title": ""
},
{
"docid": "b5bdc102a9669e0bc93d078a09e5c000",
"score": "0.53167766",
"text": "def display_attributes\n puts\n puts @str.tr(NULL, \"!\")\n bit = 1\n 16.times do |bno|\n line = \"\"\n @str.length.times do |i|\n if (@attrs[i] & bit) == 0\n line << \" \"\n else\n if bno.zero?\n line << \"S\"\n else\n line << (\"%d\" % (bno+1))\n end\n end\n end\n puts(line) unless line =~ /^ *$/\n bit <<= 1\n end\n end",
"title": ""
},
{
"docid": "564659f304098a7593e6b1097288eede",
"score": "0.53021836",
"text": "def remove_initial_and_format_change(info) # removes middle initial for space_names and pipe_names AND puts comma_names into nested arrays\n if !info[0].include?(\"|\") && !info[0].include?(\",\")\n info.map! {|element| element.split(\" \")}\n info.each {|element| element.slice!(-4)} \n info\n elsif info[0].include?(\"|\")\n info.map! {|element| element.split(\" | \")}\n info.each {|element| element.slice!(-4)} \n info\n else\n info.map! {|element| element.split(\", \" )} \n end\nend",
"title": ""
},
{
"docid": "bcf854eaf3bc558ddc83c18cb345170b",
"score": "0.52546746",
"text": "def normal_line(text)\n end",
"title": ""
},
{
"docid": "f40924a99e824101285cf8fb26ee9a74",
"score": "0.5224593",
"text": "def lsvob_fill_tag_and_description(line, hvob)\n# the second position is the VOB's tag\n hvob[:tag] = '\\\\' + line.scan(/\\w+/)[1]\n# check for the description\n if line.index('\"')\n _description = line\n# get rid of the leading and trailing '\"' and white spaces\n _description = _description.sub(/Tag: \\\\\\w+./,'').lstrip\n _description = (_description.gsub(/\\\"/,'').rstrip).lstrip\n hvob[:description] = _description \n end\nend",
"title": ""
},
{
"docid": "1380fed4d92d119ff3c785d9fee3b967",
"score": "0.5206512",
"text": "def remove_data_line(which = 1)\n remove_line(\"data_line_#{which}\")\n end",
"title": ""
},
{
"docid": "6afa5d65cbe72c1f84d77320898ec432",
"score": "0.5206483",
"text": "def remove_inserts\n\n currseq = \"\"\n currname = \"\"\n # TODO: extract this from all methods to a helper class \n @content.each do |line|\n # if name anchor is found start a new bin\n if (line =~ /^>(.*)/)\n # check if we found next bin\n if (currseq.length > 0)\n # push name and sequence to containers\n @names << currname\n @seqs << currseq\n end\n # name is found next to anchor\n currname = $1\n # no sequence data yet\n currseq = \"\"\n else\n # append sequence data\n currseq += line\n end \n end \n # collect the data from the last bin\n if (currseq.length > 0)\n @names << currname\n @seqs << currseq\n end\n \n match_cols = []\n \n # Determine which columns have a gap in first sequence (match_cols = false)\n residues = @seqs[0].unpack(\"C*\")\n residues.each_index do |num|\n if (residues[num] == 45 || residues[num] == 46)\n match_cols[num] = false\n else\n match_cols[num] = true\n end\n end\n \n # Delete insert columns\n @names.each_index do |i|\n # Unpack C : 8-bit unsigned integer , push -> Array\n residues = @seqs[i].unpack(\"C*\")\n seq = \"\"\n # traverse over Integer Representation\n residues.each_index do |num|\n # If the base Sequence has no gap then check current sequence \n if (match_cols[num])\n if (residues[num] == 45 || residues[num] == 46)\n # Add gap to Sequence\n seq += \"-\"\n else\n # Add the Residue to Sequence\n seq += residues[num].chr\n end \n end \n end\n # Remove anchoring String Characters\n seq.tr!('^a-zA-Z-','')\n # Push an Upper Case representation to the @seqs array\n @seqs[i] = seq.upcase\n # Check whether all sequences have same length as parent\n if (@seqs[i].length != @seqs[0].length)\n logger.debug \"ERROR! Sequences in alignment do not all have equal length!\"\n end\n end\n end",
"title": ""
},
{
"docid": "444dfc1bfa8ac23a9c7496c7876731e1",
"score": "0.5205546",
"text": "def gen_raw_line\n return nil unless self.valid?\n line = ''\n data = []\n SUB_STR_ATTRIBUTES.each do |field,field_regex|\n val = self.raw_getter field\n data.push val if val.nil? == false\n end\n unless data.empty?\n line = \"#{data.join ' ,'}\"\n end\n\n data = []\n BOOL_ATTRIBUTES.each do |field|\n val = self.raw_getter field\n data.push val if val.nil? == false\n end\n unless data.empty?\n if line == ''\n line += \"#{data.join ','} \"\n else\n line += \",#{data.join ','} \"\n end\n end\n\n data = []\n ARR_STR_ATTRIBUTES.each do |field|\n val = self.raw_getter field\n data.push val if val.nil? == false\n end\n unless data.empty?\n if line == ''\n line += \"#{data.join ','} \"\n else\n line += \", #{data.join ','} \"\n end\n end\n\n data = []\n STR_ATTRIBUTES.each do |field|\n val = self.raw_getter field\n data.push val if val.nil? == false\n end\n line += data.join ' '\n return line\n end",
"title": ""
},
{
"docid": "f76b4f48ff70932f87412d22c93e4ffc",
"score": "0.5176832",
"text": "def normalizes_line_endings\n attributes.fetch(:normalizesLineEndings)\n end",
"title": ""
},
{
"docid": "01c04589f5340686cbe8d45f76e5ea1a",
"score": "0.5156107",
"text": "def cleanup_newlines\n [:description, :use].each do |field|\n self[field].gsub!(/\\r\\n/, \"\\n\") if self[field]\n end\n end",
"title": ""
},
{
"docid": "b546b8a7012eeaa22e080f4f411be3af",
"score": "0.51554865",
"text": "def modify_line_logic\n f = open($BACK_UCF,\"r\")\n new = open($ORG_UCF,\"w\")\n mode = false\n match = false\n cont = false\n i = 0, j = 0\n target_word = \"\"\n\n while line = f.gets\n\n if/_rt/ =~ line\n if /^#/ =~ line\n else\n line = \"#\" + line\n end\n end\n\n if cont == true\n if /^#/ =~ line\n else\n line = \"#\" + line\n end\n if /}\\\";$/ =~ line\n cont = false\n end\n end \n \n $remove_list_bld.each do |net|\n error_net = net.gsub(\"\\/\",\"\\\\/\")\n error_net = error_net.gsub(\"\\[\",\"\\\\[\")\n net = error_net.gsub(\"\\]\",\"\\\\]\")\n if /#{net}/ =~ line\n if /^#/ =~ line\n elsif /\\AINST/ =~ line\n line = \"#\" + line\n if $VERBOSE == true\n printf(\"match [%4d]:%s\", i, line)\n i += 1\n end\n break\n elsif /\\ANET/ =~ line\n cont = true\n line = \"#\" + line\n if $VERBOSE == true\n printf(\"match [%04d]:%s\", i, line)\n i += 1\n end\n break\n else\n printf(\"[E] %s\", line)\n exit\n end\n end\n end\n if (j / 100) == 0\n printf(\".\")\n end\n j += 1\n new.write(line)\n end\n f.close\n printf(\"\\n\")\nend",
"title": ""
},
{
"docid": "27fe3f1d7dec4c2f96bcb1839ac378f5",
"score": "0.5153878",
"text": "def filter(str)\n str = str.gsub(/^line.*trimming empty.*\\n/, '') # the messages about empty are overzealous, and not invalid\n str = str.gsub(/^line.*proprietary.*\\n/, '') if options[:ignore_proprietary] # if you use IE only attributes like wrap, or spellcheck or things not in standard\n str = str.gsub(/^line.*(?:Error|Warning):.*<\\/?(?:#{options[:ignored_tag_errors].join('|')})>.*\\n/, '') if options[:ignored_tag_errors] && options[:ignored_tag_errors].any?\n str = str.gsub(/^line.*(?:Error|Warning):.* attribute \\\"(?:#{options[:ignored_attribute_errors].join('|')})\\\".*\\n/, '') if options[:ignored_attribute_errors] && options[:ignored_attribute_errors].any?\n if options[:ignored_errors] && options[:ignored_errors].any? && str.gsub(/^line.*(?:Error|Warning):/, '') =~ ignored_errors_regex\n str = str.gsub(Regexp.new(/^line.*(?:Error|Warning):/.source + '.*' + ignored_errors_regex.source + '.*' + /\\n/.source), '')\n end\n str.gsub(/line [0-9]+ column [0-9]+ -/, '')\n # /line [0-9]+ column [0-9]+ - / + =~ \"line 1 column 1 - Warning: missing <!DOCTYPE> declaration\"\n end",
"title": ""
},
{
"docid": "3f4a66a312b129081b73498855d6f2b8",
"score": "0.5146968",
"text": "def discard_a(event)\n @content << %Q|<tr><td>#{old_line}. </td><td><pre class=\"only_a\">#{event.old_element}</pre></td><td></td><td></td></tr>\\n|\n @old_line += 1\n end",
"title": ""
},
{
"docid": "f02aa07b04ab76dc55080faabcf65d07",
"score": "0.5142184",
"text": "def setup_abst_info(record)\n text = []\n record.find_all{|f| f.tag === \"520\" }.each do |field|\n textstr = ''\n field.each do |sf|\n textstr << sf.value + ' ' unless [\"c\", \"2\",\"3\",\"6\"].include?(sf.code)\n end\n text << textstr\n end\n Rails.logger.debug \"********es287_dev #{__FILE__} #{__LINE__} #{__method__} #{text[0]}\"\n text\n end",
"title": ""
},
{
"docid": "15d53fdb69f2eb0ea6d6b5f443d38714",
"score": "0.51421106",
"text": "def tidy(data)\n indent = 0\n data.split(/\\n/).map do |line|\n line.gsub!(/^\\s*/, '')\n next if line.empty?\n indent -= 1 if line =~ /^\\s*\\}\\s*$/\n line = (' ' * (indent * 2)) + line\n indent += 1 if line =~ /\\{\\s*$/\n line\n end.compact.join(\"\\n\") + \"\\n\"\n end",
"title": ""
},
{
"docid": "16b308d3bbcee2ec634cee48283c98aa",
"score": "0.5131903",
"text": "def consolidate_classes(original_line, list_of_classes)\n record = {\n :original_ocr => original_line,\n :attributes_parsed => {\n :subject =>\n [\n #{:value => \"Curran Sarah\", :type => \"primary\", :occupation => \"widowed\"},\n #{:value => \"Richard\", :type => \"widower of primary\"}\n ],\n :location =>\n [\n #{:value => \"7 Sixth\", :position => \"rear\", :type => \"home\"}\n ]\n }\n }\n\n list_of_classes.each_with_index do |classed_token, index|\n parsed_class = classed_token[1][0]\n value = classed_token[0]\n if index == 0 && parsed_class == :name_component\n record[:attributes_parsed][:subject] << {:value => value, :type => 'primary'}\n end\n if index > 0\n case parsed_class\n when :job_component\n unless record[:attributes_parsed][:subject].count < 1\n record[:attributes_parsed][:subject][0][:occupation] = value\n end\n when :predicate\n case value\n when \"wid\"\n unless record[:attributes_parsed][:subject].count < 1\n record[:attributes_parsed][:subject][0][:occupation] = 'widow'\n end\n deceased_name = look_for_name_of_deceased(list_of_classes,index)\n unless deceased_name.nil?\n record[:attributes_parsed][:subject] << {:value => deceased_name, :type => 'deceased spouse of primary'}\n end\n #attach_to_next(list_of_classes, index, :name_component, [{:type => 'deceased spouse of primary'}])\n when \"h\"\n attach_to_next(list_of_classes, index, :address_component, [{:type => 'home'}])\n when \"r\"\n attach_to_next(list_of_classes, index, :address_component, [{:position => 'rear'}])\n else\n end\n ## inner case\n when :address_component\n loc = {:value => value}\n classed_token[2..-1].each do |xtra_attr| ## add in any additional attributes from predicates\n xtra_attr.each do |k, v|\n loc[k] = v\n end\n end\n unless merge_if_directly_subsequent_is_alike(list_of_classes, index, classed_token)\n record[:attributes_parsed][:location] << loc\n end\n else\n end\n end ## indices after 0\n end ## loop of classes\n\n return record\nend",
"title": ""
},
{
"docid": "b08cd171924718e395fc4d967f40cb24",
"score": "0.5127562",
"text": "def process_data(data)\n puts '=' * 100\n puts data.class\n hash = {}\n data.split('&').each do |kv|\n key, value = kv.split('=')\n hash[key] = value\n end\n puts hash\n puts hash['glass'].chars.each_slice(10).to_a.reverse.map(&:join).join(\"\\n\")\n puts '-' * 100\n puts empty = hash['glass'].index(' ')\n puts hash['glass'][hash['x'].to_i+1]\n if hash['y'].to_i == 17\n @result = 'drop'\n return\n end\n if hash['figure'] = 'I'\n if hash['x'].to_i == empty\n @result = 'drop'\n else\n @result = \"left=#{hash['x'].to_i-empty}\"\n end\n else\n if (hash['x'].to_i == empty) && (hash['glass'][hash['x'].to_i + 1] == ' ')\n @result = 'drop'\n else\n @result = \"left=#{hash['x'].to_i-empty}\"\n end\n end\n\n # @result = 'drop'\n end",
"title": ""
},
{
"docid": "470cee0d631e82d18987250b3b9658ea",
"score": "0.5124797",
"text": "def process_data(data)\n print_headline\n tmp = data.dup\n\n # TELNETコマンドを抽出しダンプする.\n tmp.gsub!(/#{IAC}(\n [#{DONT}#{DO}#{WONT}#{WILL}].|\n #{SB}.(#{IAC}#{IAC}|[^#{IAC}])*#{IAC}#{SE}|\n [#{NOP}-#{GA}#{0.chr}-#{239.chr}]\n )/xon){\n case $1[0].chr\n when DONT; print \"> IAC DONT #{$1[1]}\\n\"\n when DO ; print \"> IAC DO #{$1[1]}\\n\"\n when WONT; print \"> IAC WONT #{$1[1]}\\n\"\n when WILL; print \"> IAC WILL #{$1[1]}\\n\"\n when SB ; print \"> IAC SB #{$1[1]} #{$1[2..-3].dump} IAC SE\\n\"\n else ; print \"> IAC #{$1[1]}\\n\"\n end\n }\n\n # 残りの部分を出力.\n tmp.each { |line| print line.dump, \"\\n\" } if tmp.size > 0\n end",
"title": ""
},
{
"docid": "9acb40a2e017036472605871f23f6ec2",
"score": "0.5115061",
"text": "def remove_custom_chronology_value\n @record.xpath('./datafield[@tag=\"650\"]/subfield[@code=\"a\"]').each do |subfield|\n subfield.parent.remove if subfield.text.start_with?('CHR ')\n end\n end",
"title": ""
},
{
"docid": "9d69be8a528b4ae1fd67422a369d0242",
"score": "0.50949657",
"text": "def ti_delete_line\n\ttictl(\"dl\")\n end",
"title": ""
},
{
"docid": "247232d7f957bf989b7e757e07cb60e1",
"score": "0.5092105",
"text": "def remove_extra_whitespace\n attributes.each do |key, val|\n next unless val.present? && val.is_a?(String)\n\n self[key] = val.strip.squeeze(' ')\n end\n end",
"title": ""
},
{
"docid": "37d5c3843f6d3b6aa53d003248eff88e",
"score": "0.5063047",
"text": "def clean2\n content = text.split(\"\\n\")\n \n # First, find and mark songs\n in_song = false\n new_content = []\n content.each do |line|\n if line=~/\\*{5}/ .. line=~END_OF_SONG\n new_content << \"SONG:\" unless in_song\n if line =~ END_OF_SONG\n new_content << line\n in_song = false\n else\n new_content << \" #{line}\"\n in_song = true\n end\n else\n if in_song\n new_content << \"END OF SONG\"\n end\n in_song = false\n new_content << line\n end\n end\n \n # Now, fix line endings and merge lines\n old_content = new_content\n new_content = []\n preserve_breaks = false\n last_line = \"\"\n old_content.each do |line|\n new_content << \"\" if preserve_breaks ||\n last_line =~ END_OF_SONG || \n new_content.size == 0 ||\n line =~ /^.[LS]-\\d+(?:\\]|$|.\\s*\\()/ ||\n line =~ /^\\([A-Z]/ ||\n line =~ /^[A-Z][A-Z, \\.-]+:\\s/ ||\n line =~ /^Scene\\s+\\?\\s+-\\s+\\?/ ||\n line =~ START_OF_SONG ||\n line =~ /^#/\n case line\n when START_OF_SONG\n preserve_breaks = true\n when END_OF_SONG\n preserve_breaks = false\n end\n new_content[-1] += ' ' unless new_content[-1] =~ /^$|\\s$/\n new_content[-1] += line\n last_line = line\n end\n \n # Now, insert extra empty lines\n old_content = new_content\n new_content = []\n extra_space = true\n in_cast = false\n in_song = false\n \n old_content.each do |line|\n if line =~ /^#/\n extra_space = false if in_cast\n else\n in_cast = false\n extra_space = true unless in_song\n end\n new_content << \"\" if extra_space && new_content.size > 0\n new_content << line\n case line\n when /^#CAST FOR SCENE/\n in_cast = true\n when START_OF_SONG\n extra_space = false\n in_song = true\n when END_OF_SONG\n extra_space = true\n in_song = false\n end\n end\n \n # Finally, fix songs\n old_content = new_content\n new_content = []\n i = 0\n while i<old_content.size\n line = old_content[i]\n case line\n when START_OF_SONG\n # Find lines with stars in them\n j = i+1\n while j<old_content.size && old_content[j] !~ END_OF_SONG\n j += 1\n end\n # At this point lines i...j are the song; back up and look for the last \"*****\"\n while j>i && old_content[j] !~ /\\*{5}/\n j -= 1\n end\n # Now lines (i+1)...j are the song information block\n song_information = old_content[(i+1)...j].join\n song_name = song_information[/^[\\s\\*]*([^\\*]+)/,1].strip\n tune = song_information[/([^\\*]+)[\\s\\*]*$/,1].strip\n new_content += [\" SONG: #{song_name}\", \" (To the tune of: #{tune})\"]\n i = j+1\n when END_OF_SONG\n i += 1 # Discard end of song markers; we don't need them anymore\n else\n new_content << line\n i += 1\n end\n end\n \n # Save the results\n text = new_content.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "f59ef0738e8aef49144fb4b00a476503",
"score": "0.5045786",
"text": "def clean_digit_lines(separated_digit_lines)\n separated_digit_lines.each do |chunk|\n chunk.delete_at(3)\n if chunk[0].length == 0\n chunk[0] = \" \"\n end\n end\nend",
"title": ""
},
{
"docid": "aaab98e21394912b5d74fdfcc354c5e8",
"score": "0.504469",
"text": "def clean_attrs\n data = node.to_hash\n %w(run_list recipes roles).each { |k| data.delete(k) }\n data\n end",
"title": ""
},
{
"docid": "7f6cd17a92233be00b6cf768b2f3da74",
"score": "0.50443435",
"text": "def compare_sdc\n @attribute_all.each{|attribute_name,attribute_data|\n case attribute_name\n when \"define_clock\"\n attribute_data[0].each_value{|each|\n sdc_signal = \"chiptop.chip.\" + each.Signal_mod.gsub(\"/\",\".\")\n @RPT_ERR.each{|key,err|\n if err.AttributeName == attribute_name && err.SignalName == sdc_signal\n each.ConstCheckFlag = 0\n each.SynthesisReport = err.Message\n end\n }\n }\n when \"xc_pulldown\", \"xc_pullup\"\n attribute_data[0].each_value{|each|\n sdc_signal = \"chiptop.chip.\" + each.Pin_mod.gsub(\"/\",\".\")\n @RPT_ERR.each{|key,err|\n if err.AttributeName == \"define_attribute\" && err.SignalName == sdc_signal\n each.ConstCheckFlag = 0\n each.SynthesisReport = err.Message\n end\n }\n }\n when \"syn_keep\"\n attribute_data[0].each_value{|each|\n sdc_signal = \"chiptop.chip.\" + each.Pin_mod.gsub(\"/\",\".\")\n @RPT_ERR.each{|key,err|\n if err.AttributeName == \"define_attribute\" && err.SignalName == sdc_signal\n each.ConstCheckFlag = 0\n each.SynthesisReport = err.Message\n end\n }\n }\n end\n }\n end",
"title": ""
},
{
"docid": "f22b4aaafbfd45e61a1bd9f86a16b473",
"score": "0.5028194",
"text": "def clean dirty_atts\n clean_atts = cartridge_cleaning_code(dirty_atts, 'Ink Grabber', false)\n clean_atts['mpn'] = clean_atts['item_number'] if clean_atts['real'] == false \n clean_atts['yield'] = parse_yield(clean_atts['title']) if clean_atts['yield'].nil?\n clean_atts['toolow'] = false\n clean_atts['retailer_id'] = 18 \n clean_atts['instock'] = clean_atts['stock'] = case dirty_atts['availability'] \n when \"/stock.gif\"\n true\n when \"/oostock.gif\" \n false\n end\n clean_atts['availability'] = nil\n \n return clean_atts\n end",
"title": ""
},
{
"docid": "69850911d536feccfda769b96244389d",
"score": "0.5020799",
"text": "def extract_attrs(line, attrs)\n attrs.each do |key,value|\n if value.class == Array\n if key =~ /^belongs_to/ # belongs_to: [arg1, arg2]\n value.each do |thing|\n line << \" #{thing}_id:integer\"\n end\n end\n else\n line << \" #{key}:#{value}\"\n end \n end\n line\nend",
"title": ""
},
{
"docid": "d1f96a2e895375a0c7ad02f8fc5621fd",
"score": "0.50201404",
"text": "def process_labels\n line_add = 0\n out = []\n @file.each do |line| # if line is psudeocommand, add label to hashtable\n if line[0] == '('\n @st[line[1..-2].to_sym] = line_add\n else\n out.push(line) # only retain true commands\n line_add += 1\n end\n end\n out # file with all psuedocommands removed\n end",
"title": ""
},
{
"docid": "5d7081ce1dbcc51e96dabda0386c2eaa",
"score": "0.49983272",
"text": "def cleanup_characters(attrs, new_monograph)\n attrs_out = {}\n attrs.each do |key, value|\n # At this point the cardinality is as required by ActiveFedora, ready to be set. Store it for later.\n is_array = value.kind_of?(Array)\n # Array wrap for uniform processing.\n cleaned_value = clean_values(Array(value), new_monograph)\n # back to expected AF cardinality\n attrs_out[key] = is_array ? cleaned_value : cleaned_value.first\n end\n attrs_out\n end",
"title": ""
},
{
"docid": "a2492e8c38e7b05b0806b22635b70986",
"score": "0.4992459",
"text": "def strip() end",
"title": ""
},
{
"docid": "5d669fcdfcf0cf27d33462a1cdc567cd",
"score": "0.49870947",
"text": "def on_empty_node_line_segment(attributes, buf, ctx)\n a1 = attributes[:region1].to_i\n b1 = attributes[:area1].to_i\n ab1 = (a1 << 16) | b1\n a2 = attributes[:region2].to_i\n b2 = attributes[:area2].to_i\n ab2 = (a2 << 16) | b2\n v1 = attributes[:v1].to_i\n v2 = attributes[:v2].to_i\n data = [v1, v2, ab1, ab2].pack(\"l*\")\n @stack[-1][3][:data] << data\n end",
"title": ""
},
{
"docid": "6fd9336ef4b412b826450e906930fb0d",
"score": "0.49716085",
"text": "def irrelevant_line(source_line); end",
"title": ""
},
{
"docid": "9ca90c7cdb0a3888225fad49d72a3842",
"score": "0.4969816",
"text": "def process_attributes(rest_of_line)\n @tag_attributes = []\n while rest_of_line != \"\" do\n # If '=' doesn't exist, empty attribute string and break from loop\n if rest_of_line.index('=') == nil\n break\n elsif rest_of_line.index('=') != nil and rest_of_line.index('<') != nil and rest_of_line.index('<') < rest_of_line.index('=')\n break\n end\n \n first_equals_index = rest_of_line.index '='\n embedded_attribute = false\n \n if rest_of_line[first_equals_index+1..first_equals_index+2] == '{{'\n embedded_attribute = true\n close_index = rest_of_line.index '}}'\n if close_index == nil\n raise CompilerException, \"Unmatched '{{' found in line #{@line_number}\"\n end\n elsif rest_of_line[first_equals_index+1..first_equals_index+2] == '<%'\n embedded_attribute = true\n close_index = rest_of_line.index '%>'\n if close_index == nil\n raise CompilerException, \"Unmatched '<%' found in line #{@line_number}\"\n end\n end\n \n if embedded_attribute\n current_attribute = rest_of_line[0..close_index+1]\n if rest_of_line.length == close_index + 2\n rest_of_line = \"\"\n else\n rest_of_line = rest_of_line[close_index+2..-1]\n end\n \n elsif rest_of_line.length == first_equals_index\n current_attribute = rest_of_line.strip\n rest_of_line = \"\"\n \n elsif rest_of_line[first_equals_index + 1..-1].index('=') == nil\n open_inner_text_index = rest_of_line.index('<')\n if open_inner_text_index != nil\n current_attribute = rest_of_line[0..open_inner_text_index-1].strip\n rest_of_line = rest_of_line[open_inner_text_index..-1]\n else\n current_attribute = rest_of_line * 1\n rest_of_line = \"\"\n end\n \n else\n second_equals_index = rest_of_line[first_equals_index + 1..-1].index '='\n reversed_letters_between_equals = rest_of_line[first_equals_index+1..first_equals_index + 1 + second_equals_index - 1].split(\"\").reverse\n \n whitespace_index = nil\n i = 0\n for char in reversed_letters_between_equals do\n if \" \\t\".index(char) != nil\n whitespace_index = first_equals_index + 1 + second_equals_index - i\n break\n end\n i += 1\n end\n \n if whitespace_index == nil\n # TODO: Do some error reporting here\n break\n end\n \n current_attribute = rest_of_line[0..whitespace_index-1].strip\n rest_of_line = rest_of_line[whitespace_index..-1]\n end\n \n if current_attribute != nil\n equals_index = current_attribute.index '='\n @tag_attributes << ' ' + current_attribute[0..equals_index-1] + '=\"' + current_attribute[equals_index+1..-1] + '\"'\n end\n end\n \n rest_of_line.strip\n end",
"title": ""
},
{
"docid": "ab47718f275e8fad618591b1a055780a",
"score": "0.4964592",
"text": "def strip_lines(value)\n value.to_s.gsub(/\\n\\s*/, ' ')\n end",
"title": ""
},
{
"docid": "b5944637d42df647e15e34b3bd134d35",
"score": "0.49642503",
"text": "def extract_id_line model_attributes, line,item,dtypes\n #look if id is mapped to another field\n id_keys = model_attributes.to_hash.keys\n #hotfix..bad performance\n id_keys.map!{|k| k.to_s }\n id_key= id_keys.select{|k| k =~/^(ID|id|iD|Id)$/ }\n if id_key.empty?\n line[:id] = item.id\n else\n line[:id] = eval(\"item.#{model_attributes[id_key[0].to_sym]}\")\n #set the correct datatype for it\n dtypes[\"id\"]= dtypes[id_key[0]]\n #remove the id line\n line.delete id_key[0]\n end\n end",
"title": ""
},
{
"docid": "1b86b38309513956fa41806b0049d2a1",
"score": "0.49604997",
"text": "def strip_annotations(content); end",
"title": ""
},
{
"docid": "4537b6d29e558ceac99775fd0367a96c",
"score": "0.49584636",
"text": "def compile_line(aRawLine)\n line_rep = aRawLine.map { |couple| compile_couple(couple) }\n \n # Apply the rule: when a line just consist of spaces \n # and a section element, then remove all the spaces from that line.\n line_to_squeeze = line_rep.all? do |item|\n if item.kind_of?(StaticText)\n item.source =~ /\\s+/\n else\n false\n end\n end\n line_rep_ending(line_rep) unless line_to_squeeze\n \n return line_rep\n end",
"title": ""
},
{
"docid": "548481afa15d72c12d3e96c0ad312aa3",
"score": "0.4951023",
"text": "def unmask_protected_sequences\n @str.gsub!(/(.)#{PROTECT_ATTR}/, \"\\\\1\\000\")\n end",
"title": ""
},
{
"docid": "c300a80c6a3c278a6757e1b404eaba5a",
"score": "0.49402973",
"text": "def original_line; end",
"title": ""
},
{
"docid": "340eb08bbd38b8dadbaeded0d2f8162a",
"score": "0.49340218",
"text": "def replace_carriage_returns\n %i(anamnesis diagnosis findings evaluation procedure).each do |attr|\n self[attr].gsub!(\"\\r\", \"\\n\") if self[attr].present?\n end\n end",
"title": ""
},
{
"docid": "232b0d1a4994d74c047c3ead5bf24e31",
"score": "0.4925223",
"text": "def split_attr(at)\n if @data.nil?\n return []\n end\n \n y = @data[at]\n if !y.nil?\n if y.is_a? Array\n return y\n else\n return y.split(\" \")\n end\n end\n return []\n end",
"title": ""
},
{
"docid": "bdf1c0e349c40d5f33a8723c603c6256",
"score": "0.49245265",
"text": "def split_into_flow\n res = []\n current_attr = 0\n\n str_len = @str.length\n\n # skip leading invisible text\n i = 0\n i += 1 while i < str_len and @str[i].chr == \"\\0\"\n start_pos = i\n\n # then scan the string, chunking it on attribute changes\n while i < str_len\n new_attr = @attrs[i]\n if new_attr != current_attr\n if i > start_pos\n res << copy_string(start_pos, i)\n start_pos = i\n end\n\n res << change_attribute(current_attr, new_attr)\n current_attr = new_attr\n\n if (current_attr & @attributes.regexp_handling) != 0 then\n i += 1 while\n i < str_len and (@attrs[i] & @attributes.regexp_handling) != 0\n\n res << RDoc::Markup::RegexpHandling.new(current_attr,\n copy_string(start_pos, i))\n start_pos = i\n next\n end\n end\n\n # move on, skipping any invisible characters\n begin\n i += 1\n end while i < str_len and @str[i].chr == \"\\0\"\n end\n\n # tidy up trailing text\n if start_pos < str_len\n res << copy_string(start_pos, str_len)\n end\n\n # and reset to all attributes off\n res << change_attribute(current_attr, 0) if current_attr != 0\n\n res\n end",
"title": ""
},
{
"docid": "57a270fb0ca1dbbdef886a727910aa64",
"score": "0.49160415",
"text": "def diagonalize\n text_lines = @text_lines ; @text_lines = [ ]\n sltn_lines = @sltn_lines ; @sltn_lines = [ ]\n text_lines.each_with_index do |line, i|\n line.split('').each_with_index do |char, j|\n (@text_lines[i+j] ||= '') << char\n (@sltn_lines[i+j] ||= '') << sltn_lines[i][j]\n end\n end\n end",
"title": ""
},
{
"docid": "18d7f083d43a33957f79a568812d0226",
"score": "0.49142256",
"text": "def filter(data)\n data.delete_if { |key, value| value.nil? }\n %w(plot tagline overview).each do |key|\n if data[key].respond_to?('first')\n data[key] = data[key].first\n end\n data[key] = data[key].gsub(FILTER_HTML, '') unless data[key].blank?\n end\n data\n end",
"title": ""
},
{
"docid": "e3b8bc801559214b7a64fb5236acd6bb",
"score": "0.49088037",
"text": "def strip_attributes(doc)\n attrs = %w[data-tralics-id data-label data-number data-chapter\n role aria-readonly target]\n doc.tap do\n attrs.each do |attr|\n doc.xpath(\"//@#{attr}\").remove\n end\n end\n end",
"title": ""
},
{
"docid": "4aa6afad494a0a33d44abfffe727cebe",
"score": "0.49019447",
"text": "def _strip seq\n seq.shift while (tok = seq.first) && tok.type == :endline\n end",
"title": ""
},
{
"docid": "dbd016dbc06bbaf4778da16d336ce5cd",
"score": "0.489299",
"text": "def remove_characters\n @data = @data.gsub(/\\n/, ' ').gsub(/\\f/, ' ').gsub(/\\s+/, ' ')\n @data = @data.split(' ')\n end",
"title": ""
},
{
"docid": "80de315a6829a11b3cdf072d7f2e5d8e",
"score": "0.48878604",
"text": "def remove_initial_and_format_change \n @reformated_array = []\n array_of_parse_files.each do |info|\n if !info[0].include?(\"|\") && !info[0].include?(\",\")\n info.map! {|element| element.split(\" \")}\n info.each {|element| element.slice!(-4)} \n @reformated_array << info\n elsif info[0].include?(\"|\")\n info.map! {|element| element.split(\" | \")}\n info.each {|element| element.slice!(-4)} \n @reformated_array << info\n else\n @reformated_array << info\n end\n end\nend",
"title": ""
},
{
"docid": "12cd1f9e3ae7ed0e0c96368aa825be54",
"score": "0.4884675",
"text": "def populated_win_lines\n WINNING_LINES.select do |line|\n squares[line[0]].marker != ' ' &&\n squares[line[1]].marker != ' ' &&\n squares[line[2]].marker != ' '\n end\n end",
"title": ""
},
{
"docid": "9223d43c0ff5e287d82819fcb34f0358",
"score": "0.4884315",
"text": "def parse_std_line(line)\n a = line.scan(/[ ]*([^()]*) \\(/)[0]\n a << line.scan( /(?:\\()([^()]*)(?:\\))/)\n a.flatten\nend",
"title": ""
},
{
"docid": "601140cbfd819cbb84accfd57b796d21",
"score": "0.48842576",
"text": "def process_line(original_line, jobs, ld_cache)\n consolidate_classes(original_line, classify_decisions(category_parsing(parse_line_elements(original_line), jobs, ld_cache)))\nend",
"title": ""
},
{
"docid": "23f0f656b332f2b3b879f7b4edd429b3",
"score": "0.48840782",
"text": "def filter_out(str)\n return \"\" if str.nil? || str.empty?\n if @pstack.color_on\n str.gsub!(/\\[COLOR\\s+(\\w+)\\s+ON\\s+(\\w+)\\]/mi) do |m|\n if ColorTable[$1] && ColorTable[$2]\n ColorTable[$1][2]+ColorTable[$2][3]\n else\n ''\n end\n end\n str.gsub!(/\\[COLOR\\s+(\\w+)\\]/mi) do |m|\n if ColorTable[$1]\n ColorTable[$1][2]\n else\n ''\n end\n end\n str.gsub!(/\\[\\/COLOR\\]/mi) do |m|\n ANSICODE['reset']\n end\n str.gsub!(/\\[[BI]\\]/mi) do |m|\n ANSICODE['bold']\n end\n str.gsub!(/\\[U\\]/mi) do |m|\n ANSICODE['underline']\n end\n str.gsub!(/\\[\\/[BUI]\\]/mi) do |m|\n ANSICODE['reset']\n end\n else\n str.gsub!(/\\[COLOR\\s+(\\w+)\\s+ON\\s+(\\w+)\\]/mi,'')\n str.gsub!(/\\[COLOR\\s+(\\w+)\\]|\\[\\/COLOR\\]/mi, '')\n str.gsub!(/\\[SIZE .*?\\]|\\[\\/SIZE\\]/mi, '')\n str.gsub!(/\\[FONT .*?\\]|\\[\\/FONT\\]/mi, '')\n str.gsub!(/\\[[BUI]\\]|\\[\\/[BUI]\\]/mi, '')\n end\n str\n end",
"title": ""
},
{
"docid": "159781c4721d1303add90a88ebcb6688",
"score": "0.4882811",
"text": "def internal_space_old(line)\n arr = []\n single_quote = line.count('\"')\n # This method won't work when there is two consecutive double quote\n # so we must replace them else they will get removed.\n line.gsub!('\"\"', '☠')\n line.split('\"').each_with_index do |item, i|\n # if odd number of double quote we are in a string else we are out\n # process only if out of a string\n item.gsub!(/ +/, ' ') if i.even?\n arr.push(item)\n end\n output = arr.join('\"')\n output.gsub!('☠', '\"\"')\n output += '\"' unless single_quote == output.count('\"')\n return output\n end",
"title": ""
},
{
"docid": "c80228cb8781fe938d28fce0048b0df4",
"score": "0.48750234",
"text": "def normalize\n @height = @text_lines.size\n @width = 0\n @sltn_lines = [ ]\n @text_lines.each do |line|\n len = line.length\n @width = len if (len > @width)\n @sltn_lines << '+' * len\n end\n (0...@text_lines.size).each do |i|\n no_pad_chars = @width - @text_lines[i].length\n 1.upto(no_pad_chars) do\n @text_lines[i] << '+'\n @sltn_lines[i] << '+'\n end\n end\n end",
"title": ""
},
{
"docid": "d5ff5f731b1b937ac1890dfee8b259df",
"score": "0.4874884",
"text": "def preprocess_line line\n line.split(/,/).collect { |l| l.strip }\n end",
"title": ""
},
{
"docid": "c154bbc184a476458a1f202d405ff2c6",
"score": "0.4860086",
"text": "def scrub_attributes(node)\n node.attribute_nodes.each do |attr_node|\n attr_name = if attr_node.namespace\n \"#{attr_node.namespace.prefix}:#{attr_node.node_name}\"\n else\n attr_node.node_name\n end\n\n if DATA_ATTRIBUTE_NAME.match?(attr_name)\n next\n end\n\n unless SafeList::ALLOWED_ATTRIBUTES.include?(attr_name)\n attr_node.remove\n next\n end\n\n if SafeList::ATTR_VAL_IS_URI.include?(attr_name)\n next if scrub_uri_attribute(attr_node)\n end\n\n if SafeList::SVG_ATTR_VAL_ALLOWS_REF.include?(attr_name)\n scrub_attribute_that_allows_local_ref(attr_node)\n end\n\n next unless SafeList::SVG_ALLOW_LOCAL_HREF.include?(node.name) &&\n attr_name == \"xlink:href\" &&\n attr_node.value =~ /^\\s*[^#\\s].*/m\n\n attr_node.remove\n next\n end\n\n scrub_css_attribute(node)\n\n node.attribute_nodes.each do |attr_node|\n if attr_node.value !~ /[^[:space:]]/ && attr_node.name !~ DATA_ATTRIBUTE_NAME\n node.remove_attribute(attr_node.name)\n end\n end\n\n force_correct_attribute_escaping!(node)\n end",
"title": ""
},
{
"docid": "c9549aacecdb8b17d600b5b12717795d",
"score": "0.4845041",
"text": "def line_clean_up(x)\n\t\tx=x.lstrip\n\t\tx=x.gsub(/[a-zA-Z\\]\\'\\\"{\\d]+=[a-zA-Z\\[\\'\\\"{\\d]+/){|x| x.split(\"=\").join(\" = \")}\n\t\t#or equal is failing to work in the same way\n\t\t#x=x.gsub(/[a-zA-Z\\]\\'\\\"{\\d]+=[a-zA-Z\\[\\'\\\"{\\d]+/){|x| x.split(\"||=\").join(\" ||= \")}\n\t\treturn x\n\tend",
"title": ""
},
{
"docid": "baae1f819b4f484afb1e3d3f1d2c535e",
"score": "0.4844607",
"text": "def aetiology_processor(line)\n\t\tline.strip.scan(/^(Aetiology and immunopathogenesis|Aetiology)$/) do |match|\n\t\t\treturn [\"on\",line.strip]\n\t\tend\n\t\treturn [\"off\",line.strip]\n\tend",
"title": ""
},
{
"docid": "07b248f0a1931f66449a9a90fb8e8e67",
"score": "0.48414892",
"text": "def clean_up()\n @lines.each { |line| line.delete!(' ') }\n @lines.delete_if { |line| line.start_with?(\"//\") }\n @lines.each { | line| line.chomp! }\n @lines.delete_if { |line| line.empty? }\n @lines = @lines.map { |line| line.split(\"//\")[0] }\n end",
"title": ""
},
{
"docid": "fdee100dad5569645f8811cad20cf93a",
"score": "0.4838929",
"text": "def removed_attributes\n operand.header - header\n end",
"title": ""
},
{
"docid": "0b0f458f3f157a1ac2a0d6addf049db7",
"score": "0.48369813",
"text": "def set_trimmed ( *attributes )\n attributes.each do |a|\n define_method \"#{ a.to_s }=\" do |t|\n tt = t.blank? ? nil : t.strip.squeeze(' ')\n write_attribute( a, tt )\n end\n end\n end",
"title": ""
},
{
"docid": "d6fc10dcae1b6a7c141edbfda17a22fa",
"score": "0.48262528",
"text": "def compact_sentence (sentence, important)\n\tremove_interrupts(sentence)\n\tremove_duplicates(sentence, important)\nend",
"title": ""
},
{
"docid": "d96dec78d6b9b9a04cc124b806ea3c53",
"score": "0.48190543",
"text": "def no_good_data_xml\r\n\"<record>\r\n <leader>01828cjm a2200409 a 4500</leader>\r\n <controlfield tag=\\\"001\\\">a4768316</controlfield>\r\n <controlfield tag=\\\"003\\\">SIRSI</controlfield>\r\n <controlfield tag=\\\"007\\\">sd fungnnmmned</controlfield>\r\n <controlfield tag=\\\"008\\\">020117p20011990xxuzz h d</controlfield>\r\n \r\n <datafield tag=\\\"024\\\" ind1=\\\"1\\\" ind2=\\\" \\\">\r\n <subfield code=\\\"a\\\">713746703721</subfield>\r\n </datafield>\r\n\r\n <datafield tag=\\\"028\\\" ind1=\\\"0\\\" ind2=\\\"0\\\">\r\n <subfield code=\\\"a\\\">HCX 3957037</subfield>\r\n <subfield code=\\\"b\\\">Harmonia Mundi USA</subfield>\r\n </datafield>\r\n\r\n <datafield tag=\\\"033\\\" ind1=\\\"2\\\" ind2=\\\"0\\\">\r\n <subfield code=\\\"a\\\">19901203</subfield>\r\n <subfield code=\\\"a\\\">19901206</subfield>\r\n </datafield>\r\n\r\n <datafield tag=\\\"035\\\" ind1=\\\" \\\" ind2=\\\" \\\">\r\n <subfield code=\\\"a\\\">(OCoLC-M)48807235</subfield>\r\n </datafield>\r\n\r\n <datafield tag=\\\"040\\\" ind1=\\\" \\\" ind2=\\\" \\\">\r\n <subfield code=\\\"a\\\">WC4</subfield>\r\n <subfield code=\\\"c\\\">WC4</subfield>\r\n <subfield code=\\\"d\\\">CSt</subfield>\r\n </datafield>\r\n\r\n <datafield tag=\\\"041\\\" ind1=\\\"0\\\" ind2=\\\" \\\">\r\n <subfield code=\\\"g\\\">engfre</subfield>\r\n </datafield>\r\n</record>\"\r\nend",
"title": ""
},
{
"docid": "227869611c774caa4a01b59093564ee5",
"score": "0.48150066",
"text": "def __extract_pd_expression__(source_line)\n source_line.to_s.strip\n end",
"title": ""
},
{
"docid": "9f1573cda5213c48293ebb82b6e9f82e",
"score": "0.48123652",
"text": "def remove_lines!\n self << \"for(var i = 0; i < map_lines.length; i++){\"\n self.remove_overlay 'map_lines[i]'\n self << \"}\"\n end",
"title": ""
},
{
"docid": "a19ed0a3984d364a3b5ed3a5e2f5b988",
"score": "0.4810268",
"text": "def no_good_data_xml\n\"<record>\n <leader>01828cjm a2200409 a 4500</leader>\n <controlfield tag=\\\"001\\\">a4768316</controlfield>\n <controlfield tag=\\\"003\\\">SIRSI</controlfield>\n <controlfield tag=\\\"007\\\">sd fungnnmmned</controlfield>\n <controlfield tag=\\\"008\\\">020117p20011990xxuzz h d</controlfield>\n \n <datafield tag=\\\"024\\\" ind1=\\\"1\\\" ind2=\\\" \\\">\n <subfield code=\\\"a\\\">713746703721</subfield>\n </datafield>\n\n <datafield tag=\\\"028\\\" ind1=\\\"0\\\" ind2=\\\"0\\\">\n <subfield code=\\\"a\\\">HCX 3957037</subfield>\n <subfield code=\\\"b\\\">Harmonia Mundi USA</subfield>\n </datafield>\n\n <datafield tag=\\\"033\\\" ind1=\\\"2\\\" ind2=\\\"0\\\">\n <subfield code=\\\"a\\\">19901203</subfield>\n <subfield code=\\\"a\\\">19901206</subfield>\n </datafield>\n\n <datafield tag=\\\"035\\\" ind1=\\\" \\\" ind2=\\\" \\\">\n <subfield code=\\\"a\\\">(OCoLC-M)48807235</subfield>\n </datafield>\n\n <datafield tag=\\\"040\\\" ind1=\\\" \\\" ind2=\\\" \\\">\n <subfield code=\\\"a\\\">WC4</subfield>\n <subfield code=\\\"c\\\">WC4</subfield>\n <subfield code=\\\"d\\\">CSt</subfield>\n </datafield>\n\n <datafield tag=\\\"041\\\" ind1=\\\"0\\\" ind2=\\\" \\\">\n <subfield code=\\\"g\\\">engfre</subfield>\n </datafield>\n</record>\"\nend",
"title": ""
},
{
"docid": "8f34d422ffe7774738f4b4dadd79a731",
"score": "0.4803897",
"text": "def normalize_spacing(string_sequence)\n string_sequence.gsub(/,[^\\S\\n]*\\n\\s*/, \",\\n\")\n end",
"title": ""
},
{
"docid": "6c2030577164801a0aad602a723bec70",
"score": "0.4802604",
"text": "def dividing_line; end",
"title": ""
},
{
"docid": "e92781654164690569145eeae5a93925",
"score": "0.48025867",
"text": "def clean(incoming_line)\n @current_line = incoming_line.split(\" \")\n end",
"title": ""
},
{
"docid": "df9038def05be8a54b0388db9b272ebe",
"score": "0.48017338",
"text": "def teardown_to_oneline(line, length = 60)\n lines = []\n line.split(\" \").each {|line|\n if !lines.empty? && lines[-1].size + line.size + 1 <= length\n lines[-1].concat(\" \" + line)\n else\n lines << line\n end\n }\n return lines\n end",
"title": ""
},
{
"docid": "560511e4538baf1c44568cd2d554fe16",
"score": "0.47975597",
"text": "def process(dfstr)\n tracelog {\"process(commands, input).\"}\n #\"\"\"Filesystem Size Used Avail Use%\n # /dev/grid/node-x0-y0 92T 73T 19T 79%\"\"\"\n linect = 0\n nodes = {}\n dfstr.each_line do |line|\n linect += 1\n line = line.chomp.chomp\n tracelog { \"read-line #{linect}: #{line}\" }\n if md = (/^\\/dev\\/grid\\/node\\-x(\\d+)\\-y(\\d+) +(\\d+)T +(\\d+)T +(\\d+)T +(\\d+)%$/.match line) #md = (/^\\/dev\\/grid\\/node\\-x(\\d+)\\-y(\\d+) +(\\d+) +(\\d+) +(\\d+) +(\\d+)%$/.match line)\n x = md[1].to_i\n y = md[2].to_i\n siz = md[3].to_i\n usd = md[4].to_i\n ava = md[5].to_i\n prc = md[6].to_i\n key = \"#{x},#{y}\"\n nodes[key] = {:size=>siz, :used=>usd, :avail=>ava, :useperc=>prc}\n tracelog {\"node[#{key}]=#{nodes[key]}\"}\n else\n deblog {\" skipped line ##{linect} #{line}.\"}\n end\n end\n deblog {\"#nodes=#{nodes.size} of #lines=#{linect}\"}\n \n viabpairnum = 0\n nodes.each do |a_key, a_vals|\n nodes.each do |b_key, b_vals|\n #next if a_key == b_key\n if a_vals[:used] > 0 && a_key != b_key && a_vals[:used] <= b_vals[:avail]\n tracelog {\"viable pair: A=#{a_key}, used=#{a_vals[:used]}; B=#{b_key}, avail=#{b_vals[:avail]}\"}\n viabpairnum += 1\n end\n end\n end\n viabpairnum\nend",
"title": ""
},
{
"docid": "b8eb03138e326718f3bf215618d53fe7",
"score": "0.47964266",
"text": "def discard_b(event)\n @content << %Q|<tr><td></td><td></td><td><pre class=\"only_b\">#{event.new_element}</pre></td><td>#{new_line}. </td></tr>\\n|\n @new_line += 1\n end",
"title": ""
},
{
"docid": "1f43b8fba92795aa5676ab4c102c3d2c",
"score": "0.4789192",
"text": "def line_codes_affected\n @attrs['LinesAffected'].split(\";\").reject {|s| s.empty? || s.nil?}\n end",
"title": ""
},
{
"docid": "74eaf29e8e879bc780c1197a4131f88d",
"score": "0.47864097",
"text": "def no_good_data_xml\n\"<record>\n <leader>01828cjm a2200409 a 4500</leader>\n <controlfield tag=\\\"001\\\">a4768316</controlfield>\n <controlfield tag=\\\"003\\\">SIRSI</controlfield>\n <controlfield tag=\\\"007\\\">sd fungnnmmned</controlfield>\n <controlfield tag=\\\"008\\\">020117p20011990xxuzz h d</controlfield>\n\n <datafield tag=\\\"024\\\" ind1=\\\"1\\\" ind2=\\\" \\\">\n <subfield code=\\\"a\\\">713746703721</subfield>\n </datafield>\n\n <datafield tag=\\\"028\\\" ind1=\\\"0\\\" ind2=\\\"0\\\">\n <subfield code=\\\"a\\\">HCX 3957037</subfield>\n <subfield code=\\\"b\\\">Harmonia Mundi USA</subfield>\n </datafield>\n\n <datafield tag=\\\"033\\\" ind1=\\\"2\\\" ind2=\\\"0\\\">\n <subfield code=\\\"a\\\">19901203</subfield>\n <subfield code=\\\"a\\\">19901206</subfield>\n </datafield>\n\n <datafield tag=\\\"035\\\" ind1=\\\" \\\" ind2=\\\" \\\">\n <subfield code=\\\"a\\\">(OCoLC-M)48807235</subfield>\n </datafield>\n\n <datafield tag=\\\"040\\\" ind1=\\\" \\\" ind2=\\\" \\\">\n <subfield code=\\\"a\\\">WC4</subfield>\n <subfield code=\\\"c\\\">WC4</subfield>\n <subfield code=\\\"d\\\">CSt</subfield>\n </datafield>\n\n <datafield tag=\\\"041\\\" ind1=\\\"0\\\" ind2=\\\" \\\">\n <subfield code=\\\"g\\\">engfre</subfield>\n </datafield>\n</record>\"\nend",
"title": ""
},
{
"docid": "a46356eae2618ff524cd10b6ddff4465",
"score": "0.47863233",
"text": "def transform_in_line(linha_strans)\n line_hash = {}\n linha_strans.instance_variables.each do |var|\n attr_name = var.to_s.delete('@')\n attr_name = @@line_attrs[attr_name]\n line_hash[attr_name] = linha_strans.instance_variable_get(var) if attr_name\n end\n line_hash = line_hash.except('veiculos')\n line_hash = line_hash.except('paradas')\n Line.new(line_hash)\n end",
"title": ""
},
{
"docid": "74550114df5d1c31b9f31ceab820347a",
"score": "0.4782977",
"text": "def missed_lines; end",
"title": ""
},
{
"docid": "74550114df5d1c31b9f31ceab820347a",
"score": "0.4782977",
"text": "def missed_lines; end",
"title": ""
},
{
"docid": "271e391c0905ea42ce3ea3e845e41fba",
"score": "0.47827905",
"text": "def parry\n\t new_text = @text.split(\"\").to_a\n\t \n\t # Find their arm markers\n\t\tmarker1 = @text.index(\"@\")\n\t\tmarker2 = @text[marker1 + 1..@text.size].index(\"@\") + @text[1..marker1 + 1].size\n\t\t# 'Move' their arms\n\t\tnew_text[marker1 + 1] = change [\"/\",\"|\",\"_\"], @text[marker1 + 1]\n\t\tnew_text[marker2 + 1] = change [\"\\\\\",\"|\",\"_\"], @text[marker2 + 1]\n \n # Find their leg markers\n\t\tmarker1 = @text.index(\"$\")\n\t\tmarker2 = @text[marker1 + 1..@text.size].index(\"$\") + @text[1..marker1 + 1].size\n\t\tmarker3 = @text[marker2 + 1..@text.size].index(\"$\") + @text[1..marker2 + 1].size\n marker4 = @text[marker3 + 1..@text.size].index(\"$\") + @text[1..marker3 + 1].size\n # 'Move' their legs\n new_text[marker1 + 1] = change [\"/\",\"|\"], @text[marker1 + 1]\n new_text[marker2 + 1] = change [\"\\\\\",\"|\"], @text[marker2 + 1]\n new_text[marker3 + 1] = change [\"/\",\"|\"], @text[marker3 + 1]\n new_text[marker4 + 1] = change [\"\\\\\",\"|\"], @text[marker4 + 1]\n \n\t\t@text = new_text.join\n\tend",
"title": ""
},
{
"docid": "790e768705be53e6e3f75af51fd503db",
"score": "0.47723356",
"text": "def rm_cddts_outof_blk\n axes = [@ref_rows, @ref_cols]\n axes.each{|axis|\n axis.each{|ref|\n intrsct_cddts = []\n (self.to_a.flatten & ref).each{|elm|\n intrsct_cddts.push(elm.cddts).flatten!.uniq!\n }\n six_cells_cddts = []\n (self.to_a.flatten - ref).each{|elm|\n six_cells_cddts.push(elm.cddts).flatten!.uniq!\n }\n intrsct_cddts.each{|cddt|\n unless six_cells_cddts.include?(cddt)\n (ref - self.to_a.flatten).each{|elm|\n elm.cddts.delete(cddt)\n# if ProgramConfig[:debug]\n# if elm.fixed == false and elm.cddts.length == 1\n# print \"DEBUG: [#{elm.i}, #{elm.j}] = #{elm.cddts.first}\\n\"\n# end\n# end\n elm.fixed = true if(elm.cddts.length == 1)\n }\n end\n }\n }\n }\n end",
"title": ""
},
{
"docid": "4c01c1395cc5566d2c90429c321a6671",
"score": "0.47678775",
"text": "def strip!() end",
"title": ""
},
{
"docid": "2733651a85f6844764180f0ac787045d",
"score": "0.47656795",
"text": "def before_process(text_line)\n nil\n end",
"title": ""
},
{
"docid": "5b0b2fb8e7c6df3b1dd24cce46ab1866",
"score": "0.47626084",
"text": "def remove_colors(data)\n data.gsub(/\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/, \"\")\n end",
"title": ""
},
{
"docid": "ca584246bff7fbf2a17ff083e6465aed",
"score": "0.47570285",
"text": "def line_content(line)\n\t\tline = line.split(\" \")\n\t\tline.delete_at(0)\n\t\treturn line\n\tend",
"title": ""
},
{
"docid": "6d37d05d1d135824ff16b1a79281cafe",
"score": "0.47490034",
"text": "def handle_notes(notes)\n\n notes.each do |note|\n\n prefix = case note['type']\n when 'dimensions'; \"Dimensions\"\n when 'physdesc'; \"Physical Description note\"\n when 'materialspec'; \"Material Specific Details\"\n when 'physloc'; \"Location of resource\"\n when 'phystech'; \"Physical Characteristics / Technical Requirements\"\n when 'physfacet'; \"Physical Facet\"\n #when 'processinfo'; \"Processing Information\"\n when 'separatedmaterial'; \"Materials Separated from the Resource\"\n else; nil\n end\n\n marc_args = case note['type']\n\n when 'arrangement', 'fileplan'\n ['351', 'a']\n # Remove processinfo from 500\n when 'odd', 'dimensions', 'physdesc', 'materialspec', 'physloc', 'phystech', 'physfacet', 'separatedmaterial'\n ['500','a']\n # we would prefer that information from both the note and subnote appear in subfields of a 506 element, like this:\n # <datafield ind1=\"1\" ind2=\" \" tag=\"506\">\n # <subfield code=\"a\">Restricted until 2020</subfield> <!-- from the subnote/text/content field -->\n # <subfield code=\"f\">Available</subfield> <!-- from the category list -->\n # </datafield>\n when 'accessrestrict'\n ind1 = note['publish'] ? '1' : '0'\n if note['publish'] || @include_unpublished\n if note['rights_restriction']\n result = note['rights_restriction']['local_access_restriction_type']\n if result != []\n result.each do |lart|\n df('506', ind1).with_sfs(['a', note['subnotes'][0]['content']], ['f', lart])\n end\n else\n df('506', ind1).with_sfs(['a', note['subnotes'][0]['content']])\n end\n else\n ['506', ind1 ,'', 'a']\n end\n end\n when 'scopecontent'\n ['520', '2', ' ', 'a']\n when 'abstract'\n ['520', '3', ' ', 'a']\n when 'prefercite'\n ['524', ' ', ' ', 'a']\n when 'acqinfo'\n ind1 = note['publish'] ? '1' : '0'\n ['541', ind1, ' ', 'a']\n when 'relatedmaterial'\n ['544','d']\n when 'bioghist'\n ['545','a']\n when 'custodhist'\n ind1 = note['publish'] ? '1' : '0'\n ['561', ind1, ' ', 'a']\n # Add processinfo to 583\n when 'appraisal', 'processinfo'\n ind1 = note['publish'] ? '1' : '0'\n ['583', ind1, ' ', 'a']\n when 'accruals'\n ['584', 'a']\n when 'altformavail'\n ['535', '2', ' ', 'a']\n when 'originalsloc'\n ['535', '1', ' ', 'a']\n when 'userestrict', 'legalstatus'\n ['540', 'a']\n when 'langmaterial'\n ['546', 'a']\n else\n nil\n end\n\n unless marc_args.nil?\n text = prefix ? \"#{prefix}: \" : \"\"\n text += ASpaceExport::Utils.extract_note_text(note, @include_unpublished)\n\n # only create a tag if there is text to show (e.g., marked published or exporting unpublished) and if there are not multiple local access restriction types (if there are, that's already handled above)\n unless note['type'] == 'accessrestrict' && note['rights_restriction']\n if text.length > 0\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\n end\n end\n end\n\n end\n end",
"title": ""
},
{
"docid": "df034c7bb9d1b2d138918fea6c4359f9",
"score": "0.4748761",
"text": "def uniqeErrorLines data\n\tset = Set.new\n\tfor row in data do\n\t\tset.add row[\"Line\"].to_s\n\tend\n\t@lines = \"\";\n\tfor e in set do\n\t\t@lines += e + \",\"\n\tend\n\treturn @lines[0..-2]\nend",
"title": ""
},
{
"docid": "1fe25c93bdb5f251ca6dcee79d6969a2",
"score": "0.4739122",
"text": "def strip_content(content)\n lines = ''\n enter_normal_state\n content.each_line { |line|\n line.gsub!(\"\\t\", INDENT)\n if is_private_keyword? line\n enter_ignore_state(get_private_end line)\n end\n\n if is_exit_token? line\n enter_normal_state\n end\n\n lines += process_line(line)\n\n if not in_ignore_state? and is_method? line\n enter_ignore_state(get_method_end line)\n end\n }\n\n lines\n end",
"title": ""
},
{
"docid": "ad0447e1f5cba530454c6faa427ddd7f",
"score": "0.4733238",
"text": "def remove_text_label\n\t\t$tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.p.className(create_ats_regex_string(\"ats-removetxtlbl\")), format_method(__method__))\n\tend",
"title": ""
},
{
"docid": "e24093c80fe57319014ac1ef2987b5c1",
"score": "0.47297382",
"text": "def process_line(line)\n line_arr = line.split(\" \")\n line_arr.each do |word|\n if word.delete(\"-/:;,()\\\"\").empty?\n next\n end\n process_word(word.delete(\"/:;,()<>{}|[]\\\"\"))\n end\n end",
"title": ""
},
{
"docid": "357f922a5d33fcf4f0a29f0207402df4",
"score": "0.47264716",
"text": "def truncated_diff_lines\n prev_lines = []\n\n highlighted_diff_lines.each do |line|\n if line.meta?\n prev_lines.clear\n else\n prev_lines << line\n\n break if for_line?(line)\n\n prev_lines.shift if prev_lines.length >= NUMBER_OF_TRUNCATED_DIFF_LINES\n end\n end\n\n prev_lines\n end",
"title": ""
},
{
"docid": "c13f586e0820d3da0dcdeddf031a558a",
"score": "0.47255942",
"text": "def parse\n @lines.each do |line|\n if m = line.match(R_ATTRIBUTE)\n @attrs << {:name => m[1].strip, :type => m[2].strip, :desc => m[4].strip}\n elsif m = line.match(R_ATTRIBUTE_NEXT_LINE)\n @attrs[-1][:desc] += \" #{m[1].strip}\"\n end\n end\n end",
"title": ""
},
{
"docid": "88b48f59f7671c48c2eb55cac11c4471",
"score": "0.4724757",
"text": "def clean_attributes(attributes)\n attributes[:license] = Array(attributes[:license]) if attributes.key? :license\n attributes[:rights_statement] = Array(attributes[:rights_statement]) if attributes.key? :rights_statement\n remove_blank_attributes!(attributes)\n end",
"title": ""
},
{
"docid": "3d71feff4e62cfd1b81aadc0ae5e6fca",
"score": "0.47246912",
"text": "def norm_text(text)\n text.to_s.strip.gsub(/\\s+/,' ').\n gsub(/(RuntimeException|RelationShip|ValueObject|OperationNotSupportedException)/, '`\\1`')\nend",
"title": ""
},
{
"docid": "99dd3abd42cd59d4096d1ce4d66e8b55",
"score": "0.47147605",
"text": "def normalise(ics)\n\tics.gsub(/\\n[ \\t]/,'').gsub(/;+\\n/, \"\\n\").gsub(/(\\\\;)+\\\\n/, \"\\\\n\").upcase.gsub(/;TYPE=([^;,\\n]+);TYPE=([^;,\\n]+);TYPE=([^;,\\n]+):/, \";TYPE=\\\\1,\\\\2,\\\\3:\").gsub(/;TYPE=([^,;\\n]+);TYPE=([^,;\\n]+):/, \";TYPE=\\\\1,\\\\2:\").gsub(/;TYPE=\"([^\"]+)\"/, \";TYPE=\\\\1\").split(\"\\n\").sort.join(\"\\n\")\nend",
"title": ""
},
{
"docid": "1c43caa1ab6a5803c5b23f3f9b8de85a",
"score": "0.47146165",
"text": "def line=(_); end",
"title": ""
},
{
"docid": "1c43caa1ab6a5803c5b23f3f9b8de85a",
"score": "0.47146165",
"text": "def line=(_); end",
"title": ""
}
] |
3501fb22a0290b29ab8169bb87c6ee6b
|
Generates an array of strings that represent possible I18n.translate invocations
|
[
{
"docid": "5c4727529da2ccf9e9f5619c28f0cc54",
"score": "0.5365949",
"text": "def t_call_variations(key, options=nil)\n invocations = ['I18n.t', 'I18n::t', 't', 'I18n.translate', 'I18n::translate', 'translate']\n parentheses = [['(',')'], [' ','']]\n quotes = [['\"', '\"'], ['\\'', '\\''], ['%{', '}'], ['%(', ')']]\n quotes = [['', '']] if key.is_a?(Symbol)\n key = key.inspect if key.is_a?(Symbol)\n [].tap do |variations|\n invocations.each do |i|\n parentheses.each do |p|\n quotes.each do |q|\n variations.push(*invocation_for_params(i, p, q, key, options))\n end\n end\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "335961c358398912a0fb0cb91e9b31b1",
"score": "0.66763806",
"text": "def translations; end",
"title": ""
},
{
"docid": "21c651249a2c1c6fe0288c4870e44b02",
"score": "0.65324104",
"text": "def translations_for route\n available_locales.map do |locale|\n translate_route(route, locale.dup) #we duplicate the locale string to ensure it's not frozen\n end\n end",
"title": ""
},
{
"docid": "d570207eaf97d680fb4349748106db36",
"score": "0.6528251",
"text": "def translations_for_select\n Alchemy::I18n.available_locales.map do |locale|\n [_t(locale, :scope => :translations), locale]\n end\n end",
"title": ""
},
{
"docid": "4f7323cc0316c521e8f6103209612141",
"score": "0.65104276",
"text": "def get_translations\n I18n.translate(:foo) # Need to do this to force I18n init\n I18n.backend.send(:translations)\n end",
"title": ""
},
{
"docid": "a0ebb787c3fb361cb8d34f1c9aa18ede",
"score": "0.6373885",
"text": "def translatable\n self._translatable[base_name] ||= []\n end",
"title": ""
},
{
"docid": "08ef3266d97707e323229b526ddc8a0e",
"score": "0.62885046",
"text": "def translate(*args, **opts); end",
"title": ""
},
{
"docid": "256547c717551d6a6ddab55fd256a0c1",
"score": "0.6232847",
"text": "def translated_text(args = {})\n objects = args[:locale].nil? ? translations : for_language(args[:locale])\n objects.collect(&:text)\n end",
"title": ""
},
{
"docid": "3a329a798b1dfd81f2e16f942e90c959",
"score": "0.6214947",
"text": "def texts_translated\n @texts_translated ||= tokens_translated.map do |group|\n group.map { |value, type| type == :text ? value : fix_ascii(value) }.join\n end\n end",
"title": ""
},
{
"docid": "5db1ec2be0c15c19aafc203b4f62afd9",
"score": "0.6177624",
"text": "def l(*args); I18n.l(*args) end",
"title": ""
},
{
"docid": "1e6a732c159aceb36e92627fbb79b973",
"score": "0.61576974",
"text": "def translate\n words\n words_array = []\n pig_latin_words_array = []\n @words_array.each do |word|\n if starts_with_vowel?(word)\n word += 'way'\n elsif !starts_with_vowel?(word[1..-1])\n word = word[2..-1] + word[0] + word[1] + 'ay'\n else\n word = word[1..-1] + word[0] + 'ay'\n end\n pig_latin_words_array << word\n end\n return pig_latin_words_array\n end",
"title": ""
},
{
"docid": "056d2dc6e8f75b2d48db136fb1dbc66e",
"score": "0.61236995",
"text": "def translate_all(keys)\n translator = I27r::Translator.new locale_name.sub(/\\-.*/, '')\n\n ActiveSupport::OrderedHash.new.tap do |oh|\n # fix the order first(for multi thread translating)\n keys.each do |key|\n if key.to_s.include? '.'\n key_prefix, key_suffix = key.to_s.split('.')[0...-1], key.to_s.split('.')[-1]\n key_prefix.inject(oh) {|h, k| h[k] ||= ActiveSupport::OrderedHash.new}[key_suffix] = nil\n else\n oh[key] = nil\n end\n end\n threads = []\n keys.each do |key|\n threads << Thread.new do\n Rails.logger.debug \"translating #{key} ...\"\n Thread.pass\n if key.to_s.include? '.'\n key_prefix, key_suffix = key.to_s.split('.')[0...-1], key.to_s.split('.')[-1]\n existing_translation = I18n.backend.send(:lookup, locale_name, key_suffix, key_prefix)\n key_prefix.inject(oh) {|h, k| h[k]}[key_suffix] = existing_translation ? existing_translation : translator.translate(key_suffix)\n else\n existing_translation = I18n.backend.send(:lookup, locale_name, key)\n oh[key] = existing_translation ? existing_translation : translator.translate(key)\n end\n end\n end\n threads.each {|t| t.join}\n end\n end",
"title": ""
},
{
"docid": "9f177f11336d6f48cdef06d1422b8979",
"score": "0.61064893",
"text": "def t(*values)\n self.class::translate(self) % values\n end",
"title": ""
},
{
"docid": "8903e79ab9fbd5efc90a5f22988b2d79",
"score": "0.6094822",
"text": "def translate_list_language_names project_id:, language_code: \"en\"\n # [START translate_list_language_names]\n # project_id = \"Your Google Cloud project ID\"\n\n # To receive the names of the supported languages, provide the code\n # for the language in which you wish to receive the names\n # language_code = \"en\"\n\n require \"google/cloud/translate\"\n\n translate = Google::Cloud::Translate.translation_v2_service project_id: project_id\n languages = translate.languages language_code\n\n puts \"Supported languages:\"\n languages.each do |language|\n puts \"#{language.code} #{language.name}\"\n end\n # [END translate_list_language_names]\nend",
"title": ""
},
{
"docid": "c8c267017284d3f7aabb8004f31edd95",
"score": "0.6067423",
"text": "def available_translations\n {\n 'en' => 'English',\n 'es' => 'Español',\n 'pt-BR' => 'Português do Brasil'\n }\n end",
"title": ""
},
{
"docid": "fea93f479a7a4c19f4a032ba5dafebcd",
"score": "0.6026584",
"text": "def translations_for_select\n configuration(:translations).collect{ |translation|\n [translation[:language], translation[:language_code]]\n }\n end",
"title": ""
},
{
"docid": "d1ebe7be1f93e76a662d5e005ded3d08",
"score": "0.60028356",
"text": "def translate_plugin_names; end",
"title": ""
},
{
"docid": "892bf57415eb51bf46b82db2b09b0969",
"score": "0.59906274",
"text": "def translate_methods(translator)\n method_compilers.collect do |compiler|\n #log.debug \"Translate method #{compiler.method.name}\"\n translate_method(compiler , translator)\n end.flatten\n end",
"title": ""
},
{
"docid": "f18331dc5ee948803eda269e377d3d15",
"score": "0.5980055",
"text": "def t(*args); I18n.t(*args) end",
"title": ""
},
{
"docid": "6a7ff1cf4bb3f30fadcfc5050b0d77ce",
"score": "0.59710175",
"text": "def translations\n OneclickRefernet::Translation.where(key: self.code)\n end",
"title": ""
},
{
"docid": "d10a7b50ffa920085b45f29de5a5000e",
"score": "0.59409565",
"text": "def translated_legs(locale=I18n.default_locale)\n OTPTranslator.new(locale).translate_legs(legs)\n end",
"title": ""
},
{
"docid": "e9540ac147f697278d4f944490cb94d2",
"score": "0.59165627",
"text": "def translate\n @actions.each do |a|\n self.send(:\"parse_#{a['type'].gsub('-','_')}\", a)\n end\n @output = @output.split(\"\\n\").collect {|l| l.strip}.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "7def453986e254783d096e7515de9a84",
"score": "0.591466",
"text": "def translate()\n\nend",
"title": ""
},
{
"docid": "7def453986e254783d096e7515de9a84",
"score": "0.591466",
"text": "def translate()\n\nend",
"title": ""
},
{
"docid": "7def453986e254783d096e7515de9a84",
"score": "0.591466",
"text": "def translate()\n\nend",
"title": ""
},
{
"docid": "7def453986e254783d096e7515de9a84",
"score": "0.591466",
"text": "def translate()\n\nend",
"title": ""
},
{
"docid": "7def453986e254783d096e7515de9a84",
"score": "0.591466",
"text": "def translate()\n\nend",
"title": ""
},
{
"docid": "7def453986e254783d096e7515de9a84",
"score": "0.591466",
"text": "def translate()\n\nend",
"title": ""
},
{
"docid": "7def453986e254783d096e7515de9a84",
"score": "0.591466",
"text": "def translate()\n\nend",
"title": ""
},
{
"docid": "7def453986e254783d096e7515de9a84",
"score": "0.591466",
"text": "def translate()\n\nend",
"title": ""
},
{
"docid": "9c6fd1b11e469bf6abedfa08fed43993",
"score": "0.591088",
"text": "def translatable_items_links\n AvailableLocale.translatables.map do |t|\n translatable_links(t)\n end.join.html_safe\n end",
"title": ""
},
{
"docid": "4c013f66c0f2aec399becd0047e4b2e5",
"score": "0.58887607",
"text": "def translations\n translated_locales = @bindings[:object].translated_locales\n available_locales.collect do |locale|\n translated_locales.include?(locale) ? @bindings[:object].translation_for(locale) : @bindings[:object].translations.new({ locale: locale })\n end\n end",
"title": ""
},
{
"docid": "830343fa47a1c7f0c1e2d6812f72b279",
"score": "0.5878628",
"text": "def translate q, target=@target_lang, source=@source_lang\n return \"[#{source}->#{target}]#{q.to_s}\"\n end",
"title": ""
},
{
"docid": "87bd454f07722dd1580f1f890ee3b3b7",
"score": "0.58786136",
"text": "def words\n words = @phrase.split(\" \")\n words.each do |word|\n translate(word)\n end\n end",
"title": ""
},
{
"docid": "dcacc3e1fe1abe113b9132f5f77c4e01",
"score": "0.5865156",
"text": "def translate(string)\n output = Array.new \n\n # turn our string into an array\n words = string.split(' ')\n\n # run each element in the array through our single-world translator method\n words.each do |single_word|\n output << translate_single_word(single_word)\n end\n\n return output.join(\" \")\nend",
"title": ""
},
{
"docid": "4c24fb63bc207cc0b407fbca549a60f2",
"score": "0.5842886",
"text": "def languages\n translations.map(&:language)\n end",
"title": ""
},
{
"docid": "597e855dfe7c7163bc05320347141b3e",
"score": "0.5838698",
"text": "def models_to_translate\n Utility.models_to_translate\n end",
"title": ""
},
{
"docid": "4dfd2d7de8053dd56bb76642610dfd4e",
"score": "0.5832629",
"text": "def localized_names\n @localized_names ||= []\n end",
"title": ""
},
{
"docid": "a4eac74d8a55db022d8c6c1bd7d53ccd",
"score": "0.58116263",
"text": "def inspect\n \"#<Translations (#{backend}) @names=#{names.join(\", \")}>\"\n end",
"title": ""
},
{
"docid": "3b67c04402f8afb30fb69bf45d5de85a",
"score": "0.5811508",
"text": "def translated_locales\n self.i18n.keys\n end",
"title": ""
},
{
"docid": "e9376f54a608598eb282fe56905da21a",
"score": "0.57983917",
"text": "def translations\n\t\t\tvalues(\"http://scta.info/property/hasTranslation\")\n\t\tend",
"title": ""
},
{
"docid": "7e3c427e56734f21d5274056f582beaf",
"score": "0.57982665",
"text": "def get_text(to_translate)\n return send(*to_translate) if to_translate.is_a?(Array)\n return to_translate\n end",
"title": ""
},
{
"docid": "c50560ecd5fadaa29ee9eddd17602c7e",
"score": "0.57955515",
"text": "def translatable\n self._translatable[base_name]\n end",
"title": ""
},
{
"docid": "4f13b729bd363f4d371c91203d0fb6b5",
"score": "0.5790535",
"text": "def translate\n @new_phrase = []\n words\n @phrase.each do |word|\n @new_phrase << changer(word)\n end\n end",
"title": ""
},
{
"docid": "415806bae51131eb698348ff2dd38fc2",
"score": "0.5779037",
"text": "def translations\n ::I18n.backend.instance_eval do\n init_translations unless initialized?\n translations\n end\n end",
"title": ""
},
{
"docid": "18f6d5784d44bc7d5c9968e77a2162f0",
"score": "0.5759011",
"text": "def translations\n if self.sentence_axis\n sentence_axis.sentences.to_a - [self]\n else\n []\n end\n end",
"title": ""
},
{
"docid": "6d5c05bd078bbd7788981bd413d1da34",
"score": "0.57566446",
"text": "def translate(lang_from = @lang_from, lang_to = @lang_to, words)\n return [] if words.size == 0\n all_translated = [] #array of all translated words\n words.each_slice(800) do |slice| #slice into 1000 words doing >1000 runs into problems\n words_string = slice.join(\"&text=\")\n uri = \"https://translate.yandex.net/api/v1.5/tr.json/translate?key=APIkey&lang=FROM-TO&text=WORD\"\n uri = uri.sub(\"WORD\",words_string).sub(\"FROM\", lang_from).sub(\"TO\", lang_to).sub(\"APIkey\", @key)\n uri = URI.escape(uri) #escape unsafe characters in uri\n begin\n #puts uri\n #puts '****************************'\n json = open(uri).read #open uri of yandex translation\n rescue => e\n puts e.message\n end\n translated = JSON.parse(json)[\"text\"]\n #should probably check to make sure translated != nil\n if translated.nil?\n puts \"PROBLEM TRANSLATING - returned nil (URI may be too long)\"\n else\n all_translated += translated\n end\n end\n all_translated #return array of all translations\n end",
"title": ""
},
{
"docid": "06f899e1ad8ad9bf03f19160d1342682",
"score": "0.5717984",
"text": "def init_translations; end",
"title": ""
},
{
"docid": "1020ab08f04c145aea389ccff897d44f",
"score": "0.5670415",
"text": "def load_translations(*filenames); end",
"title": ""
},
{
"docid": "1020ab08f04c145aea389ccff897d44f",
"score": "0.5670415",
"text": "def load_translations(*filenames); end",
"title": ""
},
{
"docid": "d7010ce849d73bbce13b44ad9c5084a3",
"score": "0.566168",
"text": "def translate_all(keys)\n returning ActiveSupport::OrderedHash.new do |oh|\n # fix the order first(for multi thread translating)\n keys.each do |key|\n if key.to_s.include? '.'\n key_prefix, key_suffix = key.to_s.split('.')[0...-1], key.to_s.split('.')[-1]\n key_prefix.inject(oh) {|h, k| h[k] ||= ActiveSupport::OrderedHash.new}[key_suffix] = nil\n else\n oh[key] = nil\n end\n end\n threads = []\n keys.each do |key|\n threads << Thread.new do\n logger.debug \"translating #{key} ...\"\n Thread.pass\n if key.to_s.include? '.'\n key_prefix, key_suffix = key.to_s.split('.')[0...-1], key.to_s.split('.')[-1]\n existing_translation = I18n.t(key, :default => key_suffix, :locale => locale_name)\n key_prefix.inject(oh) {|h, k| h[k]}[key_suffix] = existing_translation != key_suffix ? existing_translation : translator.translate(key_suffix)\n else\n existing_translation = I18n.t(key, :default => key, :locale => locale_name)\n oh[key] = existing_translation != key ? existing_translation : translator.translate(key)\n end\n end\n end\n threads.each {|t| t.join}\n end\n end",
"title": ""
},
{
"docid": "7df0805686e7417adcf5135c4d878516",
"score": "0.56564105",
"text": "def make_command_list\n @list = SES::ExternalText::Languages\n end",
"title": ""
},
{
"docid": "1717b092a366dec232064c59d7b915d3",
"score": "0.56557447",
"text": "def translate(*args)\n # Fall back to the default translate behavior if the :force_default_behavior is true\n force_current_locale = args.last.is_a?(Hash) ? args.pop.delete(:force_default_behavior) : false\n return original_translate(*args) if force_current_locale\n\n translations = []\n\n available_locales.each do |locale|\n args_copy = args.dup\n\n if args_copy.last.is_a?(Hash)\n args_copy.last.merge!(locale: locale)\n else\n args_copy << {locale: locale}\n end\n\n translations << original_translate(*args_copy)\n end\n\n translations.max\n end",
"title": ""
},
{
"docid": "46dd3225842620c571acfcf9f51c5e8b",
"score": "0.56333655",
"text": "def translations_hash; end",
"title": ""
},
{
"docid": "e023c94ac2b2fa157c23894b1bd04d4e",
"score": "0.5624772",
"text": "def t(*values)\n self.class::translate(self) % values.collect! do |value|\n value.frozen? ? value : self.class::translate(value.to_s)\n end\n end",
"title": ""
},
{
"docid": "157ecc7cd56a0dc2517589dd3d88df02",
"score": "0.56224734",
"text": "def command_translate\n command :translate do |c|\n c.syntax = 'budik translate [options]'\n c.summary = @str_translate.summary\n c.description = @str_translate.description\n c.action { |args, _opts| Command.new(:translate, args) }\n end\n end",
"title": ""
},
{
"docid": "9197cf8688a9c15721d00017cb31a036",
"score": "0.561453",
"text": "def translations\n @translations ||= {}\n end",
"title": ""
},
{
"docid": "444bda41e97100bc320ebf035dfbac95",
"score": "0.56134486",
"text": "def translated_words\n translated_words_list = []\n\n words.each do |word|\n translation_for_this_word = TranslatedWord.find_by_word_id(word.id)\n\n if translation_for_this_word.nil?\n translated_words_list << word.text # the original word text\n else\n translated_words_list << translation_for_this_word.translation\n end\n end\n\n translated_words_list\n end",
"title": ""
},
{
"docid": "d5811123dd72e4c908cb54d85fd634bb",
"score": "0.56036943",
"text": "def translated_locales\r\n all.distinct(\"locale\").sort{ |x,y| x.to_s <=> y.to_s }.map(&:to_sym)\r\n end",
"title": ""
},
{
"docid": "688a40264863a735495270eef98bcc76",
"score": "0.56015885",
"text": "def translate code, translation = \"\"\n\n # recursion base case:\n #\n # return an array containing the translation if the code has\n # a size of 0\n return [translation.downcase] if code.size.zero?\n\n words = []\n\n # check all possible matches to the code\n LETTERS.each do |letter|\n if code[letter.pattern]\n\n # recurse on untranslated portion of the code\n # and new translation\n # add results to our array at this level of recursion\n words += translate code.sub(letter.pattern,''),translation+letter.letter\n end\n end\n\n return words\n\nend",
"title": ""
},
{
"docid": "c6361a8ab7cf0ec933708049b1426683",
"score": "0.5596239",
"text": "def request_translations(texts, options = T.unsafe(nil), http_options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "e76b5072e241907c9cd668a38de33919",
"score": "0.5593289",
"text": "def t(key)\n I18n.translate(key).html_safe\n end",
"title": ""
},
{
"docid": "6effbb3dd3a9b76542504d712724013a",
"score": "0.55842537",
"text": "def translations\n raise \"i18n has no load_path(s)\" if ::I18n.load_path.empty?\n ::I18n.backend.instance_eval do\n init_translations unless initialized?\n translations\n end\n end",
"title": ""
},
{
"docid": "0a7be5895a8bd6ef625a53a506a72397",
"score": "0.5573989",
"text": "def t(...)\n I18n.t(...)\nend",
"title": ""
},
{
"docid": "990368ddb4831978485cc05a1962c5a2",
"score": "0.5568723",
"text": "def files_to_translate\n folders = [\n \"app\",\n \"lib\",\n \"config\",\n locale_path\n ].join(\",\")\n\n exts = [\n \"rb\",\n \"erb\",\n \"haml\",\n \"slim\",\n \"rhtml\",\n \"js\",\n \"jsx\",\n \"vue\",\n \"coffee\",\n \"handlebars\",\n \"hbs\",\n \"mustache\"\n ].join(\",\")\n\n Dir.glob(\n \"{#{folders}}/**/*.{#{exts}}\"\n )\n end",
"title": ""
},
{
"docid": "783dfd8645e275269e10bb74d19ad7fc",
"score": "0.5560737",
"text": "def inline_translations_for(language)\n translations_for(language, -50)\n end",
"title": ""
},
{
"docid": "0176507490b42451a2327c33cf6d1e30",
"score": "0.5559296",
"text": "def translate(*args)\n key = args.shift\n if xlated = @map[key]\n if xlated.is_a?(String)\n args.empty? ? xlated : sprintf(xlated, *args)\n else\n xlated.call(*args)\n end\n else\n return key\n end\n end",
"title": ""
},
{
"docid": "6ab245a309eab2cc9c31ad53bd5c4af5",
"score": "0.55469567",
"text": "def translate!(text, *languages)\n languages = Translations.keys unless languages.any?\n languages = languages.flatten.map!(&:to_sym)\n languages.delete :en # remove :en translation from everywhere\n languages.push :en # to push it as the last one\n languages.each do |lang|\n Translations[lang] && Translations[lang].call(text)\n end\n text\n end",
"title": ""
},
{
"docid": "001cd0119ca6aea0c91bbc9ee0aaaead",
"score": "0.55245376",
"text": "def use_i18n; end",
"title": ""
},
{
"docid": "6f0795b9089799a7e6ed5086972ab840",
"score": "0.5515033",
"text": "def translated\n find_all do |entry|\n entry.translated?\n end\n end",
"title": ""
},
{
"docid": "c08249beae98412f17f78e682ecb535c",
"score": "0.55141157",
"text": "def translate(settings); end",
"title": ""
},
{
"docid": "093dca6cfc2d7e19d4e0e3cba92e55e4",
"score": "0.5513905",
"text": "def translate(args)\n Config.instance.translate(args.first)\n end",
"title": ""
},
{
"docid": "bb256d1dd3709e6c357bf71a8476d932",
"score": "0.55003446",
"text": "def available_translations\n missing_locales = Gallifreyian::Configuration.available_locales - translations.map(&:language)\n missing_locales.each do |locale|\n self.translations << Gallifreyian::Translation::I18nKey.new(language: locale)\n end\n self.translations.order_by({:language => :asc})\n end",
"title": ""
},
{
"docid": "3963d41635ec488c51a9bb338308ac1c",
"score": "0.5492157",
"text": "def t(*args)\n I18n.t(*args)\n end",
"title": ""
},
{
"docid": "eff7191df751936c8de70377f75e3ad6",
"score": "0.54912084",
"text": "def translate text\n split_arr = text.split(\" \")\n split_arr_trans = split_arr.map { |word| \n (@@found_dict.key? word) ? @@found_dict[word] : (@@found_dict[word]=process_word(word); @@found_dict[word])\n }\n return split_arr_trans.join(\" \")\n end",
"title": ""
},
{
"docid": "d960b4cfa8750a3841fa6964bd3ef138",
"score": "0.5485793",
"text": "def translation(string, attributes)\n string\n end",
"title": ""
},
{
"docid": "674d3de9e743e66b9750c96b4010df99",
"score": "0.5482624",
"text": "def says\n\t\tself.current_state.sayings.map do |phrase|\n\t\t\tif phrase.is_a?(String) \n\t\t\t\tphrase.match(/^ivr/) ? I18n.t(phrase) : phrase\n\t\t\telsif phrase.is_a?(Symbol)\n\t\t\t\tself.send(phrase)\n\t\t\tend\n\t\tend.flatten || []\n\tend",
"title": ""
},
{
"docid": "e4a0801b577b02c5fdf340dc0ead0eef",
"score": "0.54760885",
"text": "def list_lang\n call! :list_lang\n end",
"title": ""
},
{
"docid": "16973d58915c8465da32efac4f3edc60",
"score": "0.5463213",
"text": "def translate_options(keys, scope)\n keys.map{|k| [t(k, :scope => scope), k]}\n end",
"title": ""
},
{
"docid": "157829fd0653d9bdefa52ebbef45f6db",
"score": "0.54609257",
"text": "def descriptions\n I18n.available_locales.map {|l| [l, description(l)] }.to_h\n end",
"title": ""
},
{
"docid": "a399ada5d969fea157fba24b7331a712",
"score": "0.5452735",
"text": "def create_translations\n end",
"title": ""
},
{
"docid": "d36e0e6d2065dee89706b60dbb001263",
"score": "0.54485226",
"text": "def select_languages_localized\n available_languages.map{ |x| known_languages.assoc(x)}.map{ |y| [y[2],y[0]]}.sort!\n end",
"title": ""
},
{
"docid": "84af979535cb860e425b8252c264300c",
"score": "0.54431367",
"text": "def lex_en_interp_words; end",
"title": ""
},
{
"docid": "84af979535cb860e425b8252c264300c",
"score": "0.54431367",
"text": "def lex_en_interp_words; end",
"title": ""
},
{
"docid": "84af979535cb860e425b8252c264300c",
"score": "0.54431367",
"text": "def lex_en_interp_words; end",
"title": ""
},
{
"docid": "3545bfdee3a4eba91f6f50d64c15ffa3",
"score": "0.54395944",
"text": "def translate(text,dictonary)\nend",
"title": ""
},
{
"docid": "2dfd2935bf91e980ebf6a32008f66535",
"score": "0.54388404",
"text": "def get_all_category_words\n rows = Category.find_by(name: self.chosen_category_name).translations\n rows.map {|row| \"#{row.english} => #{row.send(self.chosen_language_name.downcase)}\"}\n end",
"title": ""
},
{
"docid": "d3ab4f11518ff6b708957c4fabc484de",
"score": "0.5436222",
"text": "def translate(key, **options)\n return key.map { |k| translate(k, **options) } if key.is_a?(Array)\n key = key&.to_s unless key.is_a?(Symbol)\n\n alternatives = if options.key?(:default)\n options[:default].is_a?(Array) ? options.delete(:default).compact : [options.delete(:default)]\n end\n\n options[:raise] = true if options[:raise].nil? && TranslationHelper.raise_on_missing_translations\n default = MISSING_TRANSLATION\n\n translation = while key || alternatives.present?\n if alternatives.blank? && !options[:raise].nil?\n default = NO_DEFAULT # let I18n handle missing translation\n end\n\n key = scope_key_by_partial(key)\n\n translated = ActiveSupport::HtmlSafeTranslation.translate(key, **options, default: default)\n\n break translated unless translated == MISSING_TRANSLATION\n\n if alternatives.present? && !alternatives.first.is_a?(Symbol)\n break alternatives.first && I18n.translate(nil, **options, default: alternatives)\n end\n\n first_key ||= key\n key = alternatives&.shift\n end\n\n if key.nil? && !first_key.nil?\n translation = missing_translation(first_key, options)\n key = first_key\n end\n\n block_given? ? yield(translation, key) : translation\n end",
"title": ""
},
{
"docid": "ab8f1e4476907ca5419bcdb5ffb645ec",
"score": "0.5418817",
"text": "def lookup_chain = locale(true).lookup",
"title": ""
},
{
"docid": "e3598f0cd2b09b386197928889f62fe9",
"score": "0.541536",
"text": "def enums_to_translated_options_array(klass, enum)\n klass.classify.safe_constantize.send(enum.pluralize).map {\n |key, value| \n [I18n.t(\"activerecord.enums.#{klass.underscore}.#{enum}.#{key}\", default: key.humanize), key]\n }\n end",
"title": ""
},
{
"docid": "cd9f2e2dd312ab13fb64f2e3535386fe",
"score": "0.53925496",
"text": "def translate(response)\n end",
"title": ""
},
{
"docid": "5d87d0c1f307dd7e340100408addda6f",
"score": "0.5385107",
"text": "def translate(sentence)\n\twordsArray = sentence.split(' ')\n\treturnArray = []\n\n\twordsArray.each do |e| \n\t\twhile true\n\t\t\tif e[0].match(/[aeiou]/)\n\t\t\t\te = e + 'ay'\n\t\t\t\treturnArray.push(e)\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\tif e[0..1].match(/qu/)\n\t\t\t\t\te = e + e[0..1]\n\t\t\t\t\te[0..1] = ''\n\t\t\t\telse\n\t\t\t\t\te = e + e[0]\n\t\t\t\t\te[0] = ''\n\t\t\t\tend\n\t\t\t\t#if e[0..2].match(/sch/)\n\t\t\t\t#puts e\n\t\t\tend\n\t\tend\n\tend\n\n\n\t#puts returnArray\n\treturn returnArray.join(' ')\nend",
"title": ""
},
{
"docid": "b5d76dcb8da2c63e6db8ce3e00a99f44",
"score": "0.53840923",
"text": "def translate words\n\tarray = words.split \n\ti = 0\n\ttotal = \"\"\n\twhile i < array.length\n\t\tstring = array[i]\n\t\tif string[0] =~ /[aeiou]/\n\t\t\tresult = string + \"ay\"\n\t\telse\n\t\t\tletters = \"\"\n\t\t\tcounter = 0\n\t\t\tnumberConsanants = 0\n\t\t\twhile counter < string.length\n\t\t\t\tif string[counter] =~ /[aeiou]/\n\t\t\t\t\tbreak\n\t\t\t\telse\n\t\t\t\t\tletters = letters + string[counter]\n\t\t\t\t\tif string[counter] == 'q' && string[counter+1] == 'u'\n\t\t\t\t\t\tletters = letters + 'u'\n\t\t\t\t\t\tnumberConsanants = numberConsanants + 1\n\t\t\t\t\tend\n\t\t\t\t\tnumberConsanants = numberConsanants + 1\n\t\t\t\tend\n\t\t\t\tcounter = counter + 1\n\t\t\tend\n\t\t\tresult = string.slice(numberConsanants, string.length) + letters + \"ay\"\n\t\tend\n\t\ttotal = total + result\n\t\tif i != array.length - 1\n\t\t\ttotal = total + \" \"\n\t\tend\n\t\ti = i + 1\n\tend\n\ttotal\nend",
"title": ""
},
{
"docid": "ed7a5c84f6e07e69527c160f6d150505",
"score": "0.53331715",
"text": "def languages_as_uri\n languages.pluck(:name).map do |language|\n CONTROLLED_VOCABULARIES[:language].send(language)\n end\n end",
"title": ""
},
{
"docid": "91f10257a3a1796ce85824f2983fcfe6",
"score": "0.5326174",
"text": "def aba_array(arr)\n arr.map{|str| aba_translate(str)}\nend",
"title": ""
},
{
"docid": "31137edbe03ede4f488af705b07edb60",
"score": "0.53117776",
"text": "def find_javascript_translations\n javascripts_to_translate = Dir.glob(\"public/javascripts/**/*.js\")\n js_messages = []\n\n Dir.glob(javascripts_to_translate) do |file|\n code = File.read(file)\n code.scan(/GetText.[sn]?_ *\\([\"'](.*?)[\"'](?: *, *[\"'](.*?)[\"'] *, *.*)?(?: *, *\\{.*\\})? *\\)/).each do |msgs|\n unless msgs[0].empty?\n if msgs[1].nil?\n js_messages.push(msgs[0])\n else\n js_messages.push(\"id:#{msgs[0]}:plural:#{msgs[1]}\")\n end\n end\n end\n end\n return js_messages\n end",
"title": ""
},
{
"docid": "4e8233a0ba024286f008967c87c1eca8",
"score": "0.531087",
"text": "def addl_languages_names\n self.dig_for_array(\"addlLanguageNames\")\n end",
"title": ""
},
{
"docid": "3541075dcdd1c90c0d2611b638c02b63",
"score": "0.53021866",
"text": "def array_translate(array)\n translated = \"\"\n i = 0\n while i < array.length\n \tarray[i+1].times do\n \ttranslated += array[i]\n end\n i += 2\n end\n return translated\nend",
"title": ""
},
{
"docid": "a54e95dea16f3f42d96105b207e07781",
"score": "0.5295023",
"text": "def translate(str)\n\n words = str.split(\" \")\n\n translated_words = words.collect do |word|\n if (\"aeiou\").include?(word[0]) then\n word + \"ay\"\n elsif (word[0..1]).include?(\"qu\") then\n word[2..-1] + word[0..1] + \"ay\"\n elsif (word[0..2]).include?(\"qu\") then\n word[3..-1] + word[0..2] + \"ay\"\n else\n n = word.index(/[aeiou]/)\n word[n..-1] + word[0..n-1] + \"ay\"\n end\n end\n\n translated_words.join(\" \")\nend",
"title": ""
},
{
"docid": "2f444df3c475bcf8ec71ec028bbaaf3a",
"score": "0.52912515",
"text": "def translate_v3_get_supported_languages_for_target\n # [START translate_v3_get_supported_languages_for_target]\n require \"google/cloud/translate\"\n\n client = Google::Cloud::Translate.new\n\n project_id = \"[Google Cloud Project ID]\"\n location_id = \"[LOCATION ID]\"\n language_code = \"en\"\n\n parent = client.class.location_path project_id, location_id\n\n response = client.get_supported_languages parent, display_language_code: language_code\n\n # List language codes of supported languages\n response.languages.each do |language|\n puts \"Language Code: #{language.language_code}\"\n puts \"Display Name: #{language.display_name}\"\n end\n # [END translate_v3_get_supported_languages_for_target]\nend",
"title": ""
},
{
"docid": "93d9ee6227e6d6b26c8afc72f2a9c2cd",
"score": "0.52906865",
"text": "def generate\n I18n.backend.load_translations\n translations = wrap(source_translations)\n I18n.backend.store_translations(destination_locale, translations)\n I18n.available_locales += [destination_locale]\n end",
"title": ""
}
] |
d1e6566cf30ab02cf7731fc5b838dfbc
|
PATCH/PUT /suenos/1 PATCH/PUT /suenos/1.json
|
[
{
"docid": "6694a0223aa319fd127f206e2010c1ba",
"score": "0.5933054",
"text": "def update\n respond_to do |format|\n if @sueno.update(sueno_params)\n format.html { redirect_to @sueno, notice: 'Sueno was successfully updated.' }\n format.json { render :show, status: :ok, location: @sueno }\n else\n format.html { render :edit }\n format.json { render json: @sueno.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.63799053",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.6315499",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "c867af4ca2c09f9990cd96d519ccba2d",
"score": "0.6309515",
"text": "def update\n @os = Os.find(params[:id])\n\n respond_to do |format|\n if @os.update_attributes(params[:os])\n format.html { redirect_to @os, notice: 'Ordem de Serviço atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @os.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d91fe8ffe79c0ce9f854a7339dc24d6",
"score": "0.62515265",
"text": "def update\n #response.headers['Content-Type'] = 'application/json'\n\n if Usuario.exists?(params[:id])\n usuario = Usuario.find(params[:id])\n n_param = JSON.parse(request.body.read)\n\n #request.request_parameters\n if n_param[\"id\"]\n render json: {\"error\": \"id no es modificable\"}, status: 400\n elsif n_param.size > 1\n render json: {\"error\": \"La modificación ha fallado, solo puedes ingresar un parametro para modificar\"}, status: 500\n elsif usuario.update(usuario_params) && n_param.size == 1\n if [\"usuario\", \"nombre\", \"apellido\", \"twitter\"].include?(n_param.keys[0])\n render json: usuario, status: 200\n else\n render json: {\"error\": \"La modificación ha fallado, el atributo entregado no es válido\"}, status: 500\n end\n else\n render json: {\"error\": \"La modificación ha fallado\"}, status: 500\n end\n else\n render json: {\"error\": \"Usuario no encontrado\"}, status: 404\n end\n end",
"title": ""
},
{
"docid": "b852338b5c18fd44cbfc6d870d7961e7",
"score": "0.62480927",
"text": "def update\n respond_to do |format|\n if @productos_json.update(productos_json_params)\n format.html { redirect_to @productos_json, notice: 'Productos json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @productos_json.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f0686f191a0def3b6c3ad6edfbcf2f03",
"score": "0.6204887",
"text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n )\n end",
"title": ""
},
{
"docid": "0fa4095d013435c483c98dcf834e0b9f",
"score": "0.61740065",
"text": "def update\n @objeto = Objeto.find(params[:id])\n\n respond_to do |format|\n if @objeto.update_attributes(params[:objeto])\n format.html { redirect_to @objeto, notice: 'Objeto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4fbe2bb4554c75214ec612a847f458e",
"score": "0.6171085",
"text": "def update_tenant_circle(args = {}) \n id = args['id']\n temp_path = \"/tenantcircles.json/{circleId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantcircleId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.61634934",
"text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.6139749",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "8cf5582be869fc5b155331c1d0f7a490",
"score": "0.613639",
"text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to @oferta, :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cbbddc73e7fbb152fae713f712777b3",
"score": "0.6127987",
"text": "def update\n update_resource(@tomato)\n end",
"title": ""
},
{
"docid": "23938c68ef9abf0f7f952b2be1a5b0e8",
"score": "0.61203474",
"text": "def update\n @pelicula = Pelicula.find(params[:id])\n @pelicula.update(update_params)\n render json: @pelicula, status: :ok\n end",
"title": ""
},
{
"docid": "aa0b87a16ede7353758305dbbaf57c22",
"score": "0.6116918",
"text": "def put(*a) route 'PUT', *a end",
"title": ""
},
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.61133164",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "57d009bb8775104a4aa805c98e4af16a",
"score": "0.608828",
"text": "def update\n respond_to do |format|\n if @sintoma.update(sintoma_params)\n format.html { redirect_to @sintoma, notice: 'Sintoma was successfully updated.' }\n format.json { render :show, status: :ok, location: @sintoma }\n else\n format.html { render :edit }\n format.json { render json: @sintoma.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d12d3d3de7f4f0577ee3c9f487b087b",
"score": "0.60621643",
"text": "def update\n respond_to do |format|\n if @resto.update(resto_params)\n format.html { redirect_to @resto, notice: 'Resto was successfully updated.' }\n format.json { render :show, status: :ok, location: @resto }\n else\n format.html { render :edit }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9a8722d1d20859b862bb13ae36de08b",
"score": "0.6058999",
"text": "def update\n respond_to do |format|\n if @usuario_especie.update(usuario_especie_params)\n format.html { redirect_to @usuario_especie, notice: 'Usuario especie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @usuario_especie.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b96fff625d278f3de0432ef5785d7c3",
"score": "0.60563195",
"text": "def update(*args)\n respond_to do |format|\n if @object.update_attributes(params[@model_path.gsub('-', '_')]) #NOTE may be use just write on id without find before?\n format.html { redirect_to ooorest.index_path, notice: \"successfully update\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @object.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b3105fa4589fa77af9d897358d95e38",
"score": "0.60431755",
"text": "def update\n @osoba = Osoba.find(params[:id])\n\n respond_to do |format|\n if @osoba.update_attributes(params[:osoba])\n format.html { redirect_to @osoba, notice: t(:updated_notice, :model=>t('activerecord.models.osoba')) }\n #format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n #format.json { render json: @osoba.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af9aedd4f428a2c26c3fd57798526020",
"score": "0.6035414",
"text": "def put(path, data = {}, header = {})\n _send(json_request(Net::HTTP::Patch, path, data, header))\n end",
"title": ""
},
{
"docid": "48c7b5eace91f5912ac47aafbcaeade7",
"score": "0.6020575",
"text": "def update\r\n respond_to do |format|\r\n if @estudo.update(estudo_params)\r\n format.html { redirect_to @estudo, notice: 'Estudo 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: @estudo.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "673de619f803a42e4d39d5c7f35182af",
"score": "0.6014137",
"text": "def update\n @testudo = Testudo.find(params[:id])\n\n respond_to do |format|\n if @testudo.update_attributes(params[:testudo])\n format.html { redirect_to @testudo, notice: 'Testudo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @testudo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8ed6fc412cd9f9bd48d45b0bb2976a8",
"score": "0.6007234",
"text": "def update\n @otu = Otu.find(params[:id])\n\n respond_to do |format|\n if @otu.update_attributes(params[:otu])\n format.html { redirect_to @otu, notice: 'Otu was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @otu.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3088d873e78046bb8db8c81ed3956055",
"score": "0.5993311",
"text": "def do_modify(json, e)\n jstring = json\n unless json.is_a? String\n jstring = JSON.generate json\n end\n msg jstring, Logger::DEBUG\n uri = URI.parse(\"https://#{@host}\")\n escaped = URI.escape(\"#{@docroot}#{e}\")\n msg \"Put: #{uri}#{escaped}\", Logger::DEBUG\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n http.start do |http|\n req = Net::HTTP::Put.new(\"#{escaped}\",initheader = {\"User-Agent\" => @username, 'Content-Type' => 'application/json; charset=utf-8'})\n req.body = jstring\n response = http_request(http, req)\n end\n msg response, Logger::DEBUG\n return response\n end",
"title": ""
},
{
"docid": "b5edb8a9b2cad14c7874c5f42c5809e9",
"score": "0.59792733",
"text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end",
"title": ""
},
{
"docid": "2a41597b305420a2f45ef28124f492bb",
"score": "0.59695125",
"text": "def update\n respond_to do |format|\n if @osoba.update(osoba_params)\n format.html { redirect_to @osoba, notice: 'Osoba was successfully updated.' }\n format.json { render :show, status: :ok, location: @osoba }\n else\n format.html { render :edit }\n format.json { render json: @osoba.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bae0f686c05a01d9320a7cce21fab5e",
"score": "0.5961704",
"text": "def update\n respond_to do |format|\n if @pessoa.update(pessoa_params)\n format.html { redirect_to admin_pessoas_path, notice: 'Pessoa foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n get_dependencies\n format.html { render action: 'edit' }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9d77e2c47861f36636dfcd4c24bc489",
"score": "0.59579855",
"text": "def update\n @clientetipo = Clientetipo.find(params[:id])\n\n respond_to do |format|\n if @clientetipo.update_attributes(params[:clientetipo])\n format.html { redirect_to @clientetipo, notice: 'Clientetipo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clientetipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d212a8a912069418b404c2704de42f2",
"score": "0.5957751",
"text": "def update\n @apodos_usuario = ApodosUsuario.find(params[:id])\n\n respond_to do |format|\n if @apodos_usuario.update_attributes(params[:apodos_usuario])\n format.html { redirect_to @apodos_usuario, notice: 'Apodos usuario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @apodos_usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.59542173",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "cf63ca6298156736dc3c695cfe8dae1d",
"score": "0.5952914",
"text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to admin_pessoa_servicos_path(@pessoa), notice: 'Serviço foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n get_dependencies\n format.html { render action: 'edit' }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5adfab8b284d5fbe4bcdc307687d2aa3",
"score": "0.59511983",
"text": "def update\n @opcion = Opcion.find(params[:id])\n\n if @opcion.update(params[:opcion])\n head :no_content\n else\n render json: @opcion.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "76f960461b6d6a94049476d4040e9ddd",
"score": "0.59507334",
"text": "def update\n respond_to do |format|\n if @otu.update(otu_params)\n format.html { redirect_to @otu, notice: 'Otu was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @otu.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bb37b07f1c7142c7f0be68285f6b1bf",
"score": "0.5943013",
"text": "def update\n if @pessoa.update(pessoa_params)\n render json: @pessoa\n else\n render json: @pessoa.errors, status: :unprocessable_entity \n end\n end",
"title": ""
},
{
"docid": "2beb9c36d1483cf9f9f858e4023cd4f0",
"score": "0.5942363",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2beb9c36d1483cf9f9f858e4023cd4f0",
"score": "0.5942363",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "736862b37b16e16bbac25037312aabc6",
"score": "0.5937186",
"text": "def update\n @sueldo = Sueldo.find(params[:id])\n\n respond_to do |format|\n if @sueldo.update_attributes(params[:sueldo])\n format.html { redirect_to @sueldo, notice: 'Sueldo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sueldo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8aa174acf4eed6060f8981e151e8c9fd",
"score": "0.59313655",
"text": "def update\n respond_to do |format|\n if @ato.update(ato_params)\n format.html { redirect_to @ato, notice: 'Ato was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ato.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47abb2cddfa1a665018f717cdaaa4164",
"score": "0.5926134",
"text": "def update!(params)\n res = @client.put(path, {}, params, \"Content-Type\" => \"application/json\")\n\n @attributes = res.json if res.status == 201\n end",
"title": ""
},
{
"docid": "e8cfdce5b0eeeba4fc38e063721573ed",
"score": "0.5924321",
"text": "def update\n @jogo = Jogo.find(params[:id])\n \n respond_to do |format|\n if (@jogo.update_attributes(params[:jogo]))\n \n # format.json { render :json => { :success => true, :jogo_id => @jogo.id, :perguntas => new_perguntas, :respostas => new_respostas }, :status => :created, :location => @jogo }\n\n format.html { redirect_to @jogo, :notice => 'Jogo was successfully updated.' }\n else\n render :edit\n end\n end\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.59234464",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.59234464",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "69f86731a57edcfeedb844300522ec05",
"score": "0.59228146",
"text": "def update\n @secao = Secao.find(params[:id])\n\n respond_to do |format|\n if @secao.update_attributes(params[:secao])\n format.html { redirect_to @secao, notice: 'Secao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @secao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a1fcbdae3046e2102f533f681b61c66",
"score": "0.5921698",
"text": "def update_contact\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts/3'\n ).to_s\n\n puts RestClient.patch(\n url, {contact: {name: \"Josh\", email: \"josh@gmail.com\"}} )\nend",
"title": ""
},
{
"docid": "1b43604bd409d8c4644421c395d71320",
"score": "0.591993",
"text": "def update\n\t\t\t\trender json: {}, status: 405\n\t\t\tend",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.5919026",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.5919026",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "77ce27989a6eb1263af612ecffa00850",
"score": "0.5917313",
"text": "def update\n update! do |success, failure|\n success.json { render :json => resource }\n end\n end",
"title": ""
},
{
"docid": "4d458a06e6937ae62a2279615daf1a2c",
"score": "0.5908274",
"text": "def update\n respond_to do |format|\n if @simposio.update(simposio_params)\n format.html { redirect_to @simposio, notice: 'Simposio was successfully updated.' }\n format.json { render :show, status: :ok, location: @simposio }\n else\n format.html { render :edit }\n format.json { render json: @simposio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dbb70a1b371376624dd6d1c4cf0b85f0",
"score": "0.5907182",
"text": "def update\n respond_to do |format|\n if @ovo.update(ovo_params)\n format.html { redirect_to @ovo, notice: 'Ovo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ovo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "be7fe1230105566090061f057834ec47",
"score": "0.5905958",
"text": "def update\n @termo_uso = TermoUso.find(params[:id])\n\n respond_to do |format|\n if @termo_uso.update_attributes(params[:termo_uso])\n format.html { redirect_to @termo_uso, notice: 'Termo uso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @termo_uso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f68180bf0d7649068b38217e005ff8ca",
"score": "0.59058124",
"text": "def put?; request_method == \"PUT\" end",
"title": ""
},
{
"docid": "295f805b9b3449166c6bb1f43130422b",
"score": "0.5904021",
"text": "def update\n @tipo_seguro = TipoSeguro.find(params[:id])\n\n respond_to do |format|\n if @tipo_seguro.update_attributes(params[:tipo_seguro])\n format.html { redirect_to @tipo_seguro, notice: 'Tipo seguro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_seguro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "add3d5747c86c0b6670c923ca551c50e",
"score": "0.59028226",
"text": "def update\n\n excursao = Excursao.find params[:id]\n \n if excursao.save excursaos_params\n render status: :no_content, json: {}\n else\n render status: :bad_request, json: excursao.errors.messages\n end\n end",
"title": ""
},
{
"docid": "ae352232ff6771879ecf081683b67db9",
"score": "0.5901647",
"text": "def update\n @soon = Soon.find(params[:id])\n\n respond_to do |format|\n if @soon.update_attributes(params[:soon])\n format.html { redirect_to @soon, notice: 'Soon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @soon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ea0b2aafc89c92703fa8a1f788b8a78",
"score": "0.5893434",
"text": "def update(request, options = {})\n\n end",
"title": ""
},
{
"docid": "f04d59227a8528c801c095dda0482811",
"score": "0.58822566",
"text": "def update\n @torneotipo = Torneotipo.find(params[:id])\n\n respond_to do |format|\n if @torneotipo.update_attributes(params[:torneotipo])\n format.html { redirect_to @torneotipo, notice: 'Torneotipo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @torneotipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb9916e7fa41fe0fbfc709b1f8cce400",
"score": "0.58780295",
"text": "def update\n @ethos = Ethos.find(params[:id])\n\n respond_to do |format|\n if @ethos.update_attributes(params[:ethos])\n format.html { redirect_to admin_ethoses_url, notice: 'Ethos was succesesfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ethos.errors, status: :unprocesesable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f16f7267c6fc47bd9ef10391430ab857",
"score": "0.5875952",
"text": "def update_leido\n consulta=set_subsidiary\n \tif consulta.update_attributes(leido: params[:leido])\n \t\trespond_to do |format|\n \t\tformat.json { head :no_content}\n \t\tend\n \tend\n\tend",
"title": ""
},
{
"docid": "f9e3330f700971f0ddd5f30f2bef9683",
"score": "0.5875229",
"text": "def update\n respond_to do |format|\n if @oui.update(oui_params)\n format.html { redirect_to @oui, notice: 'Oui was successfully updated.' }\n format.json { render :show, status: :ok, location: @oui }\n else\n format.html { render :edit }\n format.json { render json: @oui.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "07cb25f42024ec84a4e613758ac08291",
"score": "0.58728814",
"text": "def update!(**args)\n @api_methods = args[:api_methods] unless args[:api_methods].nil?\n @resources = args[:resources] unless args[:resources].nil?\n end",
"title": ""
},
{
"docid": "29c085006d82a12845002816b590925b",
"score": "0.587265",
"text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to @oferta, notice: 'Oferta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @oferta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e1999864bfb64a1110bc269e4a471164",
"score": "0.5870375",
"text": "def update\n\n @nombre_empresa = params[:nombre_empresa]\n @descripcion = params[:descripcion]\n @latitud = params[:latitud]\n @longitud = params[:longitud]\n @precio_promedio = params[:precio_promedio]\n @imagen = params[:imagen]\n @version = params[:version]\n @aprobado = params[:aprobado]\nputs \"****************************************************************************8\"\nputs @aprobado\n @negocio_o.update(:nombre_empresa => @nombre_empresa,:descripcion => @descripcion,:aprobado=> @aprobado)\n if @negocio_o.aprobado == 1\n @negocio_soli = Negocio.where(\"id=?\", @negocio_o.negocio_id)\n @negocio_soli.each do |soli|\n puts soli.id\n puts \"Entro al update\"\n soli.update(:nombre_empresa => @nombre_empresa, :imagen => @imagen, :descripcion => @descripcion )\n end\n else\n puts \"Nego el update\"\n end\n\n\n\n respond_to do |format|\n format.html { redirect_to version_negocios_url, notice: 'Updated' }\n format.json { head :no_content }\n end\nend",
"title": ""
},
{
"docid": "47070383ae7748f05dcfde8487530343",
"score": "0.58697915",
"text": "def update\n respond_to do |format|\n if @tokopuyo.update(tokopuyo_params)\n format.html { redirect_to @tokopuyo, notice: 'Tokopuyo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tokopuyo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "289e54a931fadb30622e879bc789310a",
"score": "0.5866709",
"text": "def update!(**args)\n @api_methods = args[:api_methods] if args.key?(:api_methods)\n @resources = args[:resources] if args.key?(:resources)\n end",
"title": ""
},
{
"docid": "47b02eae668e38a5bcfc0695b237a1e6",
"score": "0.58622146",
"text": "def update\n\t\n if params[:todos]\n\tparams[:notificacao][:ginasio_id] = nil\n end\n\n @notificacao = Notificacao.find(params[:id])\n\n respond_to do |format|\n if @notificacao.update_attributes(params[:notificacao])\n format.html { redirect_to @notificacao, :flash => { :success => \"Notificacao alterada com sucesso.\" } }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @notificacao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81422b4cfd87370622171dcc1030bde4",
"score": "0.5857066",
"text": "def update\n respond_to do |format|\n if @pessoa.update(pessoa_params)\n format.html { redirect_to @pessoa, notice: 'Pessoa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a565cef00d6874eb6d07052cd70dfab",
"score": "0.5852358",
"text": "def update(json_resource)\n jsonapi_request(:patch, \"#{@route}/#{json_resource['id']}\", \"data\"=> json_resource)\n end",
"title": ""
},
{
"docid": "ad628f1fbccc9ec84489acc4f44a2ff1",
"score": "0.58520675",
"text": "def patch_update\n user = @company.public_send(ScimRails.config.scim_users_scope).find(params[:id])\n update_status(user)\n json_scim_response(object: user)\n end",
"title": ""
},
{
"docid": "1fff951206b7a0adbde5b3b9a929570d",
"score": "0.58489025",
"text": "def update\n @seminario = Seminario.find(params[:id])\n\n respond_to do |format|\n if @seminario.update_attributes(params[:seminario])\n format.html { redirect_to @seminario, notice: 'Seminario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @seminario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36425ac5f583abed249c631a73bc491e",
"score": "0.5848445",
"text": "def update\n respond_to do |format|\n if @veiculo.update(veiculo_params)\n format.html { redirect_to @veiculo, notice: 'Veiculo was successfully updated.' }\n format.json { render :show, status: :ok, location: @veiculo }\n else\n format.html { render :edit }\n format.json { render json: @veiculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36425ac5f583abed249c631a73bc491e",
"score": "0.5848445",
"text": "def update\n respond_to do |format|\n if @veiculo.update(veiculo_params)\n format.html { redirect_to @veiculo, notice: 'Veiculo was successfully updated.' }\n format.json { render :show, status: :ok, location: @veiculo }\n else\n format.html { render :edit }\n format.json { render json: @veiculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "355ec70bebd843ceed08c36854441e35",
"score": "0.5848057",
"text": "def update\n @shuoshuo = Shuoshuo.find(params[:id])\n\n respond_to do |format|\n if @shuoshuo.update_attributes(params[:shuoshuo])\n format.html { redirect_to @shuoshuo, notice: 'Shuoshuo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shuoshuo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff8eb38ce26d3cb859350cc071bba930",
"score": "0.5846793",
"text": "def update\n @outro = Outro.find(params[:id])\n\n respond_to do |format|\n if @outro.update_attributes(params[:outro])\n format.html { redirect_to @outro, notice: 'Outro actualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @outro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba4875ee7394f3d0a2d4e56fb674e12e",
"score": "0.58454156",
"text": "def update\n respond_to do |format|\n if @objeto.update(opcion_params)\n format.html { redirect_to @objeto, notice: 'Opcion was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f258199f9a01a7f2ffb3045648ccbc1b",
"score": "0.58453435",
"text": "def update\n @su = Sus.find(params[:id])\n\n respond_to do |format|\n if @su.update_attributes(params[:su])\n format.html { redirect_to @su, notice: 'Sus was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @su.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9f5b47603da522f004ac2af4d0bcd237",
"score": "0.58382505",
"text": "def update\r\n respond_to do |format|\r\n if @sivic_licao.update(sivic_licao_params)\r\n format.html { redirect_to @sivic_licao, notice: 'Sivic licao 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: @sivic_licao.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "b9ef5fdb20b4511ab1e54e1efe9b5626",
"score": "0.583818",
"text": "def update\n respond_to do |format|\n if @servico_cruzeiro.update(servico_cruzeiro_params)\n format.html { redirect_to @servico_cruzeiro, notice: 'Cruzeiro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_cruzeiro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1326bf4a921a2c1a7718ad3815ab546a",
"score": "0.5837874",
"text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to @servico, notice: 'Serviço alterado com sucesso!' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f5b2fddcbb574753018179bcfafb8f7e",
"score": "0.58378094",
"text": "def update\n @telefone = Telefone.find(params[:id])\n\n respond_to do |format|\n if @telefone.update_attributes(params[:telefone])\n if @telefone.telefonavel_type == 'Usuario'\n format.html { redirect_to [:admin, Usuario.find(@telefone.telefonavel_id)], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { redirect_to [:admin, Cliente.find(@telefone.telefonavel_id)], :notice => 'Exemplo was successfully created.' }\n format.json { render :json => @telefone, :status => :created, :location => @telefone }\n end\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @telefone.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9eb75dd05dde41b770ace54b001a8d3b",
"score": "0.58365226",
"text": "def update\n prepara_form\n respond_to do |format|\n if @veiculo.update(veiculo_params)\n format.html { redirect_to @veiculo, notice: 'Veiculo was successfully updated.' }\n format.json { render :show, status: :ok, location: @veiculo }\n else\n format.html { render :edit }\n format.json { render json: @veiculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e410b08331dc40fde29f992ebdd48d61",
"score": "0.5831274",
"text": "def update\n respond_to do |format|\n if @servico_passeio.update(servico_passeio_params)\n format.html { redirect_to @servico_passeio, notice: 'Passeio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_passeio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8030b6a3a618d66537d0f1f7e1a4175e",
"score": "0.58295125",
"text": "def update\n @oficio = Oficio.find(params[:id])\n\n respond_to do |format|\n if @oficio.update_attributes(params[:oficio])\n format.html { redirect_to @oficio, notice: 'Oficio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @oficio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f267b60d628b7329078cf6589da6ef2",
"score": "0.5827159",
"text": "def update\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to [:admin, @usuario], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5cf5a6f5f2546681d28983d5573b806",
"score": "0.58245707",
"text": "def update\n @aprova = Aprova.find(params[:id])\n\n respond_to do |format|\n if @aprova.update_attributes(params[:aprova])\n format.html { redirect_to @aprova, notice: 'Aprova was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aprova.errors, status: :unprocessable_entity }\n end\n end\n if @aprova.tipo == 'Sim'\n @teste=Usuario.find(:first,:conditions=>{:tipo=>'Secretaria0',:id=>@aprova.aluno_id})\n @teste.update_attributes(:tipo=>'Secretaria')\n end\n end",
"title": ""
},
{
"docid": "f6c9c9a6a53c4b3de4c0c462112d1c8e",
"score": "0.5824",
"text": "def activo_update\n respond_to do |format|\n activo = params[:sustancium][:activo]\n id = params[:id]\n Sustancium.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"title": ""
},
{
"docid": "9939d104cc69ee0603b44e21eac25e30",
"score": "0.58208275",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico foi atualiazado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04494d0e2a07a21615ec0829de981c1a",
"score": "0.5819734",
"text": "def update\n @hola = Hola.find(params[:id])\n\n respond_to do |format|\n if @hola.update_attributes(params[:hola])\n format.html { redirect_to @hola, notice: 'Hola was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hola.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ecc68f77020b2f9e83a4cd39b17bb84",
"score": "0.58185047",
"text": "def update\n respond_to do |format|\n if @sudo.update(name: params[:name], description: params[:description],sudo_rule: params[:sudo_rule])\n format.json { render json: @sudo }\n end\n end\n end",
"title": ""
},
{
"docid": "4971fd8e40d96a4a24e576c600c8df3b",
"score": "0.5817236",
"text": "def update\n @aula = Aula.find(params[:id])\n\n respond_to do |format|\n if @aula.update_attributes(params[:aula])\n format.html { redirect_to @aula, notice: 'Aula alterada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aula.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e85d3153f9836aba7c9e95586fb7a8e",
"score": "0.5816214",
"text": "def update\n respond_to do |format|\n if @cli_sistema.update(cli_sistema_params)\n format.html { redirect_to @cli_sistema, notice: 'Cli sistema was successfully updated.' }\n format.json { render :show, status: :ok, location: @cli_sistema }\n else\n format.html { render :edit }\n format.json { render json: @cli_sistema.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a",
"score": "0.5812652",
"text": "def put(*args)\n request :put, *args\n end",
"title": ""
},
{
"docid": "d2e0ce7caa38c97f5ff3f3a148d995b0",
"score": "0.5810126",
"text": "def put_update(options = {})\n options[:id] ||= @note.id\n options[:note] = @attributes\n put :update,options\n end",
"title": ""
},
{
"docid": "97cbfc4428849476b89b3c4388613b13",
"score": "0.58070767",
"text": "def update\n respond_to do |format|\n if @osoba_kont.update(osoba_kont_params)\n format.html { redirect_to @osoba_kont, notice: 'Osoba kont was successfully updated.' }\n format.json { render :show, status: :ok, location: @osoba_kont }\n else\n format.html { render :edit }\n format.json { render json: @osoba_kont.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b2d5fc83a907f25e5176864fa6beb3d0",
"score": "0.5806861",
"text": "def put_rest(path, json) \n run_request(:PUT, create_url(path), json)\n end",
"title": ""
},
{
"docid": "345d07a57911e50836407751fff05dca",
"score": "0.5805282",
"text": "def update\n respond_to do |format|\n if @viajero.update(viajero_params)\n format.html { redirect_to @viajero, notice: 'Viajero was successfully updated.' }\n format.json { render :show, status: :ok, location: @viajero }\n else\n format.html { render :edit }\n format.json { render json: @viajero.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b89f7321e47bba4cc92fd02231b19c6c",
"score": "0.5802456",
"text": "def update\n @estudiante = Estudiante.find(params[:id])\n\n if @estudiante.update(params[:estudiante])\n head :no_content\n else\n render json: @estudiante.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3551a93e8829fecafd58bf691a860eeb",
"score": "0.5802427",
"text": "def update_object(path, id, info)\n json_parse_reply(*json_put(@target, \"#{path}/#{URI.encode(id)}\", info,\n @auth_header, if_match: info[:meta][:version]))\n end",
"title": ""
},
{
"docid": "92c1039b592350b77d5564afccd660bd",
"score": "0.58017313",
"text": "def update\n @esclerosi = Esclerosi.find(params[:id])\n\n respond_to do |format|\n if @esclerosi.update_attributes(params[:esclerosi])\n format.html { redirect_to @esclerosi, notice: 'Esclerosi was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @esclerosi.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
9dc4ebe93ced2abde9ae0f3caa4a26a2
|
DELETE /users/1 or /users/1.json
|
[
{
"docid": "355b272de30d1bbb2b812bef2ffa5de3",
"score": "0.0",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: \"User was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "8e69eb3ff3374e0db6fa9eb17958df65",
"score": "0.7684552",
"text": "def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end",
"title": ""
},
{
"docid": "95f7909f2d660a9b4f3be6031cc3886e",
"score": "0.7499508",
"text": "def delete(id)\n request(:delete, \"/users/#{id}.json\")\n end",
"title": ""
},
{
"docid": "6f74a32c6fdb67babd4a903e37b5baa4",
"score": "0.7451846",
"text": "def delete\n render json: User.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "b587b4c6cfd1bb2ea92c1c749bacb0e4",
"score": "0.73396",
"text": "def delete\n @user.destroy\n respond_to do |format|\n format.html { redirect_to v1_resources_users_all_path, notice: 'User was deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6de33a50410e4ade40ca04e0e009403c",
"score": "0.7308096",
"text": "def destroy\n @user = User.find_by_id_or_username params[:id]\n @user.destroy\n render api_delete @user\n end",
"title": ""
},
{
"docid": "8412d693fd475cb8f222f90b6a98bbae",
"score": "0.7288328",
"text": "def delete\n render json: Users.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "2d6bc54e947da5bc24a844fd1ee9689c",
"score": "0.7177641",
"text": "def destroy\n @user = V1::User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(v1_users_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bf42b70221760e3241fc7950c0291794",
"score": "0.71761024",
"text": "def destroy\n \"\"\"\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n \"\"\"\n end",
"title": ""
},
{
"docid": "349eb25668e562bf08fd309263ebaeb0",
"score": "0.71565485",
"text": "def destroy\n # not_found unless @user\n # @user = User.get(params[:id]) || not_found\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d88a6500f0566d646d55067066d95712",
"score": "0.71370035",
"text": "def destroy\n @user = user.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a9f0a8fb661670e030d3bd4827af550d",
"score": "0.7129719",
"text": "def destroy\n user = User.find(params[:id]) # from url, nothing to do with table\n user.destroy\n render json: user\n end",
"title": ""
},
{
"docid": "b5420294215c15c88c3281c38bee1de4",
"score": "0.71023536",
"text": "def delete user_id, options={}, headers={}\n @connection.delete \"users/#{user_id}.json\", options, headers\n end",
"title": ""
},
{
"docid": "695ca22e7f3e376e77c06f37efd41cd3",
"score": "0.7096058",
"text": "def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "937b3827665cd2943db1d179b82cce0c",
"score": "0.7094694",
"text": "def delete_user\n @user = User.find(params[:id])\n if @user.destroy\n render :json => @user\n else\n render :json => @user.errors.full_messages\n end\n end",
"title": ""
},
{
"docid": "79e59ef0bc50aa13d2d93079a4d78f16",
"score": "0.70906115",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c8df2b44984db4d0d2d01fa6e3a65d62",
"score": "0.70897716",
"text": "def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c8df2b44984db4d0d2d01fa6e3a65d62",
"score": "0.70897716",
"text": "def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6420c61a8f44adb55dac7052ccd00aa4",
"score": "0.7088685",
"text": "def destroy\n @user = User.find(params[:id])\n\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5afe9026a6587696b06b7f81fd2d6c99",
"score": "0.7088437",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.7087755",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ccef367f08990fca2ee686c16260da8",
"score": "0.708767",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
e9d4257984846fb0b0ab47251e427dc1
|
POST /image_types POST /image_types.json
|
[
{
"docid": "bbfb801c2dd89ad74a3459eb5858ad4e",
"score": "0.67892957",
"text": "def create\n @image_type = ImageType.new(params[:image_type])\n \n respond_to do |format|\n if @image_type.save\n format.html { redirect_to @image_type, notice: 'Image type was successfully created.' }\n format.json { render json: @image_type, status: :created, location: @image_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @image_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "2bac395d2093721073771b94444c049e",
"score": "0.6695854",
"text": "def create\n @image_type = ImageType.new(image_type_params)\n\n respond_to do |format|\n if @image_type.save\n format.html { redirect_to @image_type, notice: 'Image type was successfully created.' }\n format.json { render :show, status: :created, location: @image_type }\n else\n format.html { render :new }\n format.json { render json: @image_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d8a39a8ee3ff09f10aa83ec55c38b69",
"score": "0.66406554",
"text": "def save_image_types type_of_image,image\n @image = ImageType.new\n @image.image_type = type_of_image\n @image.images_for_job_id = image.id\n @image.image_page_number = image.image_number\n @image.save\n end",
"title": ""
},
{
"docid": "a5bc8ca1f8e9c474bfc1499c712a9347",
"score": "0.66352254",
"text": "def image_type_params\n params.require(:image_type).permit(:name)\n end",
"title": ""
},
{
"docid": "a5bc8ca1f8e9c474bfc1499c712a9347",
"score": "0.66352254",
"text": "def image_type_params\n params.require(:image_type).permit(:name)\n end",
"title": ""
},
{
"docid": "c422fe9c3846a14e972bd1959b22350c",
"score": "0.64847064",
"text": "def save_image_types type_of_image, job_image\n @image_type = ImageType.new\n @image_type.image_type = type_of_image\n @image_type.images_for_job_id = job_image.id\n @image_type.image_page_number = job_image.image_number\n @image_type.save\n end",
"title": ""
},
{
"docid": "4a8e0d404b13aac04fdc9c7300c99d76",
"score": "0.6410476",
"text": "def add_image_types\n @workbook.image_types.each_key do |type|\n add_default(type, \"image/#{type}\")\n end\n end",
"title": ""
},
{
"docid": "dfdfa6bd6f3aae7b0ce1cb9342794ff5",
"score": "0.6302894",
"text": "def add_image_type(value)\n @children['image-type'][:value] << value\n end",
"title": ""
},
{
"docid": "1b8ec42ab1a37b0d062dc58faa0a19f8",
"score": "0.612196",
"text": "def set_type\n if IMAGE_CONTENT_TYPES.include?(file_content_type)\n update_attribute(:type, 'SubmissionImage')\n end\n end",
"title": ""
},
{
"docid": "128b86b861602cbfa6cb43edbbda1cc9",
"score": "0.6089981",
"text": "def create\n @image_type = ImageType.new(image_type_params)\n\n respond_to do |format|\n if @image_type.save\n flash[:notice] = 'ImageType was successfully created.'\n format.html { redirect_to image_types_path }\n format.xml { render :xml => @image_type, :status => :created, :location => @image_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @image_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6ff95bad5579050ee5c7914b481a9ab",
"score": "0.59955376",
"text": "def create\n model = params[:type].constantize\n @image = model.new(params[:image])\n @image.save!\n redirect_to :back, :notice => t(\"notice.successfully_created\")\n end",
"title": ""
},
{
"docid": "505ff89f15691e2f986592731e4ff744",
"score": "0.5966057",
"text": "def index\n @image_types = ImageType.all\n end",
"title": ""
},
{
"docid": "4a334f82d14c1b92b61dbba11c23d58d",
"score": "0.5948287",
"text": "def img_types\n unless @img_types\n @img_types = []\n \n @img_types << :img if images.length > 0\n @img_types << :pic if pics.length > 0\n end\n \n @img_types\n end",
"title": ""
},
{
"docid": "8b19be207b1664fed3b5753a59f01046",
"score": "0.58986485",
"text": "def set_ImageType(value)\n set_input(\"ImageType\", value)\n end",
"title": ""
},
{
"docid": "f5ae089a4e930fb051d08b813064ef48",
"score": "0.5886505",
"text": "def create\n type = Type.create!(type_params)\n json_response(type, :created)\n end",
"title": ""
},
{
"docid": "52a9a465ab3a08cc4d20a1f0e3c5e700",
"score": "0.588057",
"text": "def new\n @image_type = ImageType.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image_type }\n end\n end",
"title": ""
},
{
"docid": "ed7f5e5960731003289ff4abbb8e5171",
"score": "0.58495957",
"text": "def pb_areatype_params\r\n params.require(:pb_areatype).permit(:image, :image_2, :image_3, :image_4)\r\n end",
"title": ""
},
{
"docid": "ca8c714c0efab250e4fed7c9d1092902",
"score": "0.5840736",
"text": "def create\n @type = Type.new(type_params)\n if @type.save\n render json: @type, status: :created\n else\n render json: @type.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "be2837a6f304374a42758ebd1e699ad0",
"score": "0.58276623",
"text": "def set_image_type\n @image_type = ImageType.find(params[:id])\n end",
"title": ""
},
{
"docid": "be2837a6f304374a42758ebd1e699ad0",
"score": "0.58276623",
"text": "def set_image_type\n @image_type = ImageType.find(params[:id])\n end",
"title": ""
},
{
"docid": "4a839960cfbecd83a2a6eb12386500d3",
"score": "0.58259344",
"text": "def image_types\n web_safe_image_types + other_image_types\n end",
"title": ""
},
{
"docid": "1afcdf9e3c6ff84580f999d797e4de34",
"score": "0.58257085",
"text": "def create\n # byebug\n @image = Image.create(image_params)\n render json: @image\n end",
"title": ""
},
{
"docid": "2627206ad5b362b322e4a06c8fa451b1",
"score": "0.58129126",
"text": "def create_types\n\t[]\nend",
"title": ""
},
{
"docid": "5870c8e9b7bc7ecf4c9e2c45c83f136c",
"score": "0.5800736",
"text": "def normalize_create_types(params)\n type_ids = []\n\n params[:types].split(/\\s*,\\s*/).uniq.each{ |type_name|\n nf = Type.i18n_name_field\n tn = ActiveRecord::Base.connection.quote(ActionController::Base.helpers.sanitize(type_name))\n t = Type.where(\"(COALESCE(#{nf}, name) || CASE WHEN scientific_name IS NULL THEN '' ELSE ' ['||scientific_name||']' END)=#{tn}\")\n\n # if it's not found, make it a pending type\n if t.nil? or t.empty?\n t = Type.new\n t.name = type_name\n t.pending = true # this is database default, but setting here just in case\n t.category_mask = params[:c].blank? ? array_to_mask([\"forager\"],Type::Categories) :\n array_to_mask(params[:c].split(/,/),Type::Categories)\n t.save\n else\n t = t.first\n end\n type_ids.push t.id\n } if params[:types].present?\n\n logger.debug params[:location][:type_ids]\n\n if params[:location].present? and params[:location][:type_ids].present?\n v = []\n if params[:location][:type_ids].kind_of? Hash\n v = params[:location][:type_ids].values.map{ |x| x.to_i }\n elsif params[:location][:type_ids].kind_of? Array\n v = params[:location][:type_ids].map{ |x| x.to_i }\n else\n # if we couldn't get it in a reasonable format, delete it\n params[:location].delete(:type_ids)\n end\n logger.debug Type.ids\n logger.debug v\n type_ids += (v & Type.ids) if v.length > 0\n end\n\n logger.debug \"TYPES!\"\n logger.debug type_ids\n type_ids\n end",
"title": ""
},
{
"docid": "13c89ddd36e94e529a73850fee859774",
"score": "0.57944846",
"text": "def processedimagesfiletype_params\n params.require(:processedimagesfiletype).permit(:file_type,:image_linkage_type)\n end",
"title": ""
},
{
"docid": "4edd19c42e7b32aaf30aa50f261f5af2",
"score": "0.57933",
"text": "def create_types\n\t\t[]\n\tend",
"title": ""
},
{
"docid": "9f97eecc0e76b5b21d8702a10c1e6453",
"score": "0.5780807",
"text": "def create\n unless params.has_key?(\"type_name\")\n render json: {\n :error => \"Missing params\"\n }, :status => :bad_request\n return\n end\n\n # Create the new type\n @type = Type.new(\n type_name: params[:type_name]\n )\n\n @type.save!\n render json: @type, :status => :ok\n\n end",
"title": ""
},
{
"docid": "f5835b33c8422848563c98b69b6d72c8",
"score": "0.5761596",
"text": "def users_types\n call_path = \"users/types\"\n request = \"\"\n data = build_post_data(request)\n perform_post(build_url(call_path), data)\n end",
"title": ""
},
{
"docid": "79a92ef3481fc524656333499e1ce07e",
"score": "0.57540315",
"text": "def create\n files = validate_create!\n single = false\n unless files.is_a? Array\n single = true\n files = [files]\n end\n\n images = ImageService.upload_images(files)\n images = images.first if single\n render status: 201, json: images.as_json(with_secret: true)\n end",
"title": ""
},
{
"docid": "dd38ec2b448fc01e27a276005273287f",
"score": "0.57428724",
"text": "def upload_floor_plan(args = {}) \n post(\"/files.json/floorplan/images\", args)\nend",
"title": ""
},
{
"docid": "16993b441d6919eee1191e12a0b5a579",
"score": "0.5738623",
"text": "def photo_type_params\r\n params.require(:photo_type).permit(:photo_type)\r\n end",
"title": ""
},
{
"docid": "54c36cd2289455b9388313228456ccae",
"score": "0.57282746",
"text": "def im_type_list_params\n params.require(:im_type_list).permit(:uuid, :name)\n end",
"title": ""
},
{
"docid": "5f65e736c52df04b1ff07fb7fcc4e25a",
"score": "0.5708588",
"text": "def image_type=(v)\n @image_type = validate_set_inclusion(v.to_s.upcase, IMAGE_TYPE, __method__)\n end",
"title": ""
},
{
"docid": "56dcc20570085ad6abf758a3556c9dbd",
"score": "0.5705558",
"text": "def types(filter = {})\n request('types', filter).map { |ent| Type.create(ent) }\n end",
"title": ""
},
{
"docid": "457f589782dd14d0823d6e5557b2563d",
"score": "0.56464297",
"text": "def upload_image_file(args = {}) \n post(\"/files.json/captiveportal/images\", args)\nend",
"title": ""
},
{
"docid": "8a50f7d61f724f1a60430e6ece2ffaf4",
"score": "0.56342876",
"text": "def upload\n images = []\n params[:files].each do |file|\n images << Image.create(:file => file, :build_id => @build.id, :upload_method_id => UploadMethod::DIRECT)\n end\n #render :json => image.attributes.merge(additional_image_attributes(image)), :content_type => 'text/javascript'\n render :json => images.collect { |i| i.attributes.merge(additional_image_attributes(i)) }, :content_type => 'text/javascript'\n end",
"title": ""
},
{
"docid": "82e2f86796b6df951ec55734ce1b2e10",
"score": "0.5630776",
"text": "def add_mime_type(key,transform_method, values,new_response_headers = {})\n raise ArgumentError unless key.is_a?(Symbol) && values.is_a?(Array)\n ResponderMixin::Rest::TYPES.update(key => values)\n add_response_headers!(key, new_response_headers) \n ResponderMixin::Rest::TRANSFORM_METHODS.merge!(key => transform_method)\n end",
"title": ""
},
{
"docid": "cfc200386cd26d9f6d2373b3e20cba18",
"score": "0.5628772",
"text": "def image_content_types\n result = [] + [content_type(\"test.gif\")] + [content_type(\"test.png\")] +\n [content_type(\"test.jpg\")] + [content_type(\"test.jpeg\")]\n result.flatten.uniq\n end",
"title": ""
},
{
"docid": "cfc200386cd26d9f6d2373b3e20cba18",
"score": "0.5628772",
"text": "def image_content_types\n result = [] + [content_type(\"test.gif\")] + [content_type(\"test.png\")] +\n [content_type(\"test.jpg\")] + [content_type(\"test.jpeg\")]\n result.flatten.uniq\n end",
"title": ""
},
{
"docid": "b6e2ab45c45cf41646964678a073e159",
"score": "0.56162786",
"text": "def create_types\n @@types.each do |type|\n create_type(type) unless Type.where(name: type['name']).first\n end\n end",
"title": ""
},
{
"docid": "c194ed35c4f68d3676dfb392f821aa99",
"score": "0.55932814",
"text": "def create\n images = JSON.parse(params[:diary][:images]) rescue []\n @diary = Diary.new(params[:diary].permit(:date, :title, :text))\n\n respond_to do |format|\n if @diary.save\n images.each do |image|\n unless image == \"0\"\n ImageMapping.create({\n diary_id: @diary.id,\n image_id: image\n })\n end\n end\n format.html { redirect_to @diary, notice: 'Diary was successfully created.' }\n format.json { render json: @diary, status: :created, location: @diary }\n else\n format.html { render action: \"new\" }\n format.json { render json: @diary.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fd3316d31901b863fbd14378b5aa40d",
"score": "0.5582919",
"text": "def create\r\n @photo_type = PhotoType.new(photo_type_params)\r\n\r\n respond_to do |format|\r\n if @photo_type.save\r\n format.html { redirect_to @photo_type, notice: 'Photo type was successfully created.' }\r\n format.json { render :show, status: :created, location: @photo_type }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @photo_type.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "3dc520ef5299b9b57f7a678f8379e69c",
"score": "0.557944",
"text": "def create\n @product = Product.new(params[:product])\n @images = Image.where(:product_token => params[:product][:token])\n respond_to do |format|\n if @product.save\n @images.each do |image|\n image.update_attributes(imageable_id: @product.id, imageable_type: @product.class.name)\n end\n format.html { redirect_to webmaster_product_path(@product), notice: 'Product was successfully created.' }\n #format.json { render json: @webmaster_category, status: :created, location: @webmaster_category }\n else\n format.html { render action: \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "76b90d9c090cf14da6bde744671d1cc0",
"score": "0.55771023",
"text": "def create\n imageParams = {\n user_id: current_user.id,\n image_able_id: nil,\n image_able_type: nil,\n image: params[:image]\n }\n @image = Image.new(imageParams)\n if @image.save\n render json: @image, status: :created, location: @image\n else\n render json: @image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0e6eee171c26d95d834648fed4cb7121",
"score": "0.5575529",
"text": "def create\n respond_to do |format|\n begin\n params[:profile_image]['image'].each do |image|\n @profile_image = current_user.profile_images.create!(:image => image)\n end\n format.html { redirect_to main_app.user_path(current_user), notice: 'Profile image is successfully added.' }\n format.json { render :show, status: :created, location: @profile_image }\n rescue \n format.html { redirect_to main_app.user_path(current_user), notice: @profile_image ? @profile_image.errors.full_messages.join(\" ,\") : \"Please select a image\" }\n format.json { render json: @profile_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ccddf07318d016a9f331db782a085e6c",
"score": "0.5560033",
"text": "def create\n\n ## Creating the image object\n image_type = params[:image_type] || \"Image::Base\"\n\n resource = params[:imageable_type].constantize.find params[:imageable_id]\n @image = image_type.constantize.new\n\n puts \"image_type: #{image_type}\".red\n puts \"@image: #{@image.to_yaml}\".red\n\n @image.imageable = resource\n\n @image.image = params[:image][:image]\n\n ## Setting redirect url\n @redirect_url = params[:redirect_url] || root_url\n\n ## Validating the data\n @image.valid?\n\n respond_to do |format|\n if @image.errors.blank?\n\n # Saving the admin object\n @image.save\n\n # Setting the flash message\n message = translate(\"forms.created_successfully\", :item => \"Image\")\n store_flash_message(message, :success)\n\n format.html {\n redirect_to @redirect_url, notice: message\n }\n format.json { render json: @image, status: :created, location: @admin }\n format.js {}\n else\n\n # Setting the flash message\n message = @image.errors.full_messages.to_sentence\n store_flash_message(message, :alert)\n\n format.html { render action: \"new\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n format.js {}\n end\n end\n end",
"title": ""
},
{
"docid": "55bba0fd33673b0ec724ffeef8c72d34",
"score": "0.55490136",
"text": "def set_type\n # Read content_type\n self.content_type = @image.content_type.chomp\n\n end",
"title": ""
},
{
"docid": "56b05cc0eb1a63f3879663fdc05298b0",
"score": "0.55455077",
"text": "def photo_id_type_params\n params.require(:photo_id_type).permit(:name)\n end",
"title": ""
},
{
"docid": "faed93dd30a8dd9799cdba439a692725",
"score": "0.55137354",
"text": "def create_entity_type(entity_type_id, request)\n start.uri('/api/entity/type')\n .url_segment(entity_type_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "110985cdd7c6912124dd19f1b50df960",
"score": "0.5509358",
"text": "def image_params\n params.require(:image).permit(images:[] )\n end",
"title": ""
},
{
"docid": "035ad255c384f691f13835127d437038",
"score": "0.54923606",
"text": "def recognition_type_params\n params.require(:recognition_type).permit(:code, :name, :description, :status)\n end",
"title": ""
},
{
"docid": "2399fd19a907e61539596aea75735250",
"score": "0.5484663",
"text": "def add(*types)\n types.each do |mime_type|\n if @type_variants.include?(mime_type.simplified)\n if @type_variants[mime_type.simplified].include?(mime_type)\n warn \"Type #{mime_type} already registered as a variant of #{mime_type.simplified}.\"\n end\n end\n add_type_variant(mime_type)\n index_extensions(mime_type)\n end\n end",
"title": ""
},
{
"docid": "d64cfdb32496b4e20a77201750a5838b",
"score": "0.5477293",
"text": "def index\n @image_types = ImageType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @image_types }\n end\n end",
"title": ""
},
{
"docid": "4b7ee9013d6dcdbda0cd3fb69fe051c5",
"score": "0.5472807",
"text": "def test_mime_types\n assert_kind_of(DataTypes::ImageData, @test_records[7])\n assert_kind_of(DataTypes::ImageData, @test_records[8])\n assert_kind_of(DataTypes::ImageData, @test_records[9])\n assert_kind_of(DataTypes::ImageData, @test_records[10])\n assert_kind_of(DataTypes::ImageData, @test_records[11])\n assert_kind_of(DataTypes::ImageData, @test_records[12])\n assert_equal(\"image/bmp\", @test_records[7].mime_type)\n assert_equal(\"image/fits\", @test_records[8].mime_type)\n assert_equal(\"image/gif\", @test_records[9].mime_type)\n assert_equal(\"image/jpeg\", @test_records[10].mime_type)\n assert_equal(\"image/png\", @test_records[11].mime_type)\n assert_equal(\"image/tiff\", @test_records[12].mime_type)\n end",
"title": ""
},
{
"docid": "619c404cd5208de43d283a94f8035262",
"score": "0.5471392",
"text": "def create\n brand = Brand.new brand_params\n\n if params[:brand][:images].present?\n params[:brand][:images].each do |image|\n req = Cloudinary::Uploader.upload image\n brand.images << req[\"public_id\"]\n end\n end\n\n brand.save\n redirect_to brand_path\n end",
"title": ""
},
{
"docid": "e635cc8eabcaf3eb69d028afbd4a3a8e",
"score": "0.5462341",
"text": "def create\n @image = Image.new(tl_params)\n\n if @image.save\n render json: @image, status: :created\n else\n render json: @image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a298315fe26d8b583688c81d0cf260ac",
"score": "0.54603004",
"text": "def image_type_collection\n image_types.collect{|k,v| v}.sort{|a, b| a.id <=> b.id}\n end",
"title": ""
},
{
"docid": "e9c5fd1afeceae3be6b8ced908023a02",
"score": "0.5447188",
"text": "def create\n @item = Item.new(item_params)\n @item.owner_id = current_user.id\n images = params[:images]\n \n if images.present?\n images['image'].each do |a|\n item_image = @item.images.new(:image => a)\n end\n end\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",
"title": ""
},
{
"docid": "85a1b8105792146565e25fe0db17885a",
"score": "0.5444651",
"text": "def create\n @im_type_list = @im.ImTypeList.build(im_type_list_params)\n\n respond_to do |format|\n if @im_type_list.save\n format.html { redirect_to @im_type_list, notice: 'Im type list was successfully created.' }\n format.json { render :show, status: :created, location: @im_type_list }\n else\n format.html { render :new }\n format.json { render json: @im_type_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "095aef3367de8351da8844756defc6a4",
"score": "0.54361504",
"text": "def create\n json = JSON.parse(params[:json])\n isPublic = \"True\"\n if json[\"public\"] != \"true\"\n isPublic = \"False\"\n end\n\n json_respond( \n image().upload_image_from_file(\n json[\"name\"], json[\"disk_format\"],\n json[\"container_format\"], json[\"minDisk\"],\n json[\"minRam\"], isPublic, params[:image]\n )\n )\n end",
"title": ""
},
{
"docid": "de352fa1bf334112a1aef0f51a390abd",
"score": "0.5436076",
"text": "def add_image\n if request.post? == false\n render :json => { :message => \"Error\" }\n return\n end\n\n # Add an image to a collection\n collection = Collection.new\n collection.byId( params[ :collection_id ] )\n image = Image.new\n image.byId( params[ :image_id ] )\n collection.add( :images, image.urn )\n render :json => { \n :message => \"Success\", \n :collection => collection.all \n }\n end",
"title": ""
},
{
"docid": "09c15d63f41626d146dcf2b67079a206",
"score": "0.54240483",
"text": "def create\n @processedimagesfiletype = Processedimagesfiletype.new(processedimagesfiletype_params)\n\n respond_to do |format|\n if @processedimagesfiletype.save\n format.html { redirect_to @processedimagesfiletype, notice: 'Processedimagesfiletype was successfully created.' }\n format.json { render :show, status: :created, location: @processedimagesfiletype }\n else\n format.html { render :new }\n format.json { render json: @processedimagesfiletype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8fe55923ccdf466e2b5e47e01fcd7bed",
"score": "0.54224527",
"text": "def create\n params[:image] = {} if params[:image].nil?\n params[:image][:image_type] = Image::SUBMITTED\n @image = Image.new(image_params)\n\n respond_to do |format|\n if @image.save\n format.html { redirect_to (@image.project ? community_project_path(@image.project.community, @image.project) : @image.user), notice: 'Image was successfully created.' }\n format.json { render :show, status: :created, location: @image }\n else\n format.html { render :new }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d83c08f38d3e155a8797fdcb78c561cb",
"score": "0.54138505",
"text": "def types\n if !@api_key.nil? and @api_key.api_type == \"muni\"\n params[:c] = \"forager\"\n end\n\n if params[:c].blank?\n cat_mask = array_to_mask([\"forager\",\"freegan\"],Type::Categories)\n else\n cat_mask = array_to_mask(params[:c].split(/,/),Type::Categories)\n end\n\n cfilter = \"(category_mask & #{cat_mask})>0 AND NOT pending\"\n\n @types = Type\n .where(cfilter)\n .collect { |t| { :name => t.full_name, :id => t.id } }\n .sort{ |x, y| x[:name] <=> y[:name] }\n\n log_api_request(\"api/locations/types\", @types.length)\n\n respond_to do |format|\n format.json { render json: @types }\n end\n end",
"title": ""
},
{
"docid": "19c16ab481a95fce7db4588e5f60a250",
"score": "0.54129463",
"text": "def create\n @oplung = current_user.oplungs.new(oplung_params)\n\n respond_to do |format|\n if @oplung.save\n params[:image_attachments]['image'].each do |a|\n @image_attachment = @oplung.image_attachments.create!(:image => a)\n end\n format.html { redirect_to @oplung, notice: 'oplung was successfully created.' }\n format.json { render :show, status: :created, location: @oplung }\n else\n format.html { render :new }\n format.json { render json: @oplung.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d11626e962effe765e47a9bd10c462a0",
"score": "0.54095614",
"text": "def content_type_whitelist\n /image\\//\n end",
"title": ""
},
{
"docid": "d11626e962effe765e47a9bd10c462a0",
"score": "0.54095614",
"text": "def content_type_whitelist\n /image\\//\n end",
"title": ""
},
{
"docid": "d11626e962effe765e47a9bd10c462a0",
"score": "0.54095614",
"text": "def content_type_whitelist\n /image\\//\n end",
"title": ""
},
{
"docid": "470adc785560d0599caad0780f86e7b0",
"score": "0.54045403",
"text": "def image_type\n data.image_type\n end",
"title": ""
},
{
"docid": "7efe4f051756902ca577f152743e1834",
"score": "0.53979135",
"text": "def new\n ## Intitializing the image object\n\n image_type = params[:image_type] || \"Image::Base\"\n @image = image_type.constantize.new\n\n respond_to do |format|\n format.html { get_collections and render :index }\n format.json { render json: @image }\n format.js {}\n end\n end",
"title": ""
},
{
"docid": "b1f1590f4cc583798a3d392f22a8f0a9",
"score": "0.53959054",
"text": "def createForText\n #takes the :id for the text and converts it to text_id for image\n if params[\"id\"]\n params[\"image\"][\"text_id\"] = params[\"id\"].to_i\n end\n render json: Image.create(params[\"image\"])\n end",
"title": ""
},
{
"docid": "7b5b169eb9e5d74436f432beb42aa5d6",
"score": "0.5392857",
"text": "def create\n @image = Image.new(params[:image])\n\n if @image.save\n respond_to do |format|\n format.html {\n render :json => [@image.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json {\n render :json => [@image.to_jq_upload].to_json\n }\n end\n else\n render :json => [{:error => \"custom_failure\"}], :status => 304\n end\n end",
"title": ""
},
{
"docid": "04bc03092d2095eda7939f08cf991c6d",
"score": "0.53886133",
"text": "def type_params\n params.require(:type).permit(:type)\n end",
"title": ""
},
{
"docid": "670579632ec14acf5889941ee4064722",
"score": "0.53884476",
"text": "def create\n @user_type = UserType.new(user_type_params)\n\n if @user_type.save\n render json: @user_type\n else\n render json: @user_type.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "679f3ffb799c2a2bd0bc2d5b35bd8309",
"score": "0.53883415",
"text": "def create\n begin\n @guitar = Guitar.new(guitar_params)\n\n respond_to do |format|\n if @guitar.save\n\n params[:images]['location'].each do |a|\n @post_attachment = @guitar.images.create!(:location => a,:imageable_id => @guitar.id, :imageable_type => @guitar.class.to_s)\n end\n\n\n format.html { redirect_to @guitar, notice: 'Guitar was successfully created.' }\n format.json { render :show, status: :created, location: @guitar }\n else\n format.html { render :new }\n format.json { render json: @guitar.errors, status: :unprocessable_entity }\n end\n end\n rescue\n @guitar.destroy!\n redirect_to guitars_path, notice: 'Guitar couldnot be created as you uploaded a jpeg instead of jpg'\n end\n end",
"title": ""
},
{
"docid": "3d332ebc0a93a4f49c44ceaef4e68793",
"score": "0.5372053",
"text": "def mime_type_params\n params.require(:mime_type).permit(:name, :description)\n end",
"title": ""
},
{
"docid": "f5c21f5425889a6dcea32e2713ed6b1d",
"score": "0.53708506",
"text": "def image_params\n params.require(:image).permit(:imageable_id, :imageable_type, :image)\n end",
"title": ""
},
{
"docid": "5fa4e60fef993ed85cf4b05393381bac",
"score": "0.53701234",
"text": "def image_create # rubocop:disable Metrics/AbcSize\n attrcheck = {\n 'REST end point' => @options[:rest_endpoint],\n 'Create JSON' => @options[:create_json]\n }\n @validate.attrvalidate(@options, attrcheck)\n file = File.read(@options[:create_json])\n create_data = JSON.parse(file)\n instanceconfig = ImageList.new(@options[:id_domain], @options[:user_name], @options[:passwd], @options[:rest_endpoint])\n instanceconfig = instanceconfig.create(create_data)\n # error checking response\n @util.response_handler(instanceconfig)\n return JSON.pretty_generate(JSON.parse(instanceconfig.body))\n end",
"title": ""
},
{
"docid": "cd099e3889cb3649244d4bdfd90916c6",
"score": "0.5367025",
"text": "def meta_types\n request('meta_types').map { |ent| MetaType.create(ent) }\n end",
"title": ""
},
{
"docid": "403a3db004fcb07dd94404244f33176d",
"score": "0.5365361",
"text": "def image_params\n params.require(:images).map do |u|\n ActionController::Parameters.new(u.to_h).permit(:image)\n end\n end",
"title": ""
},
{
"docid": "29336107dd6fe7b56714300cef30869f",
"score": "0.5364754",
"text": "def create\n @image = Image.new(image_params)\n\n respond_to :json\n\n if @image.save\n #format.html { redirect_to @image, notice: \"Image was successfully created.\" }\n render json:@image, status: :ok\n else\n #format.html { render :new, status: :unprocessable_entity }\n ender json: {error: @images.errors.messages }\n \n end\n end",
"title": ""
},
{
"docid": "bc5554776deebbf7a08b17fdbd5fa4ac",
"score": "0.5350463",
"text": "def dance_type_params\n params.require(:dance_type).permit(:name, :color, :image)\n end",
"title": ""
},
{
"docid": "61caea032d9758890e92eb054fa662e4",
"score": "0.5350132",
"text": "def new\n @type_is = params[:type_is]\n @post = Post.new\n @post.attachments.build\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "2056959832fd318192e100b772bc1c17",
"score": "0.5343583",
"text": "def create\n @type = Type.new(params[:type])\n\n respond_to do |format|\n if @type.save\n format.html { redirect_to admin_types_path, notice: 'Type was successfully created.' }\n format.json { render json: @type, status: :created, location: @type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f45cec72d9b73fe7c33271abdd766e28",
"score": "0.53379625",
"text": "def create\n @file_type = FileType.new(file_type_params)\n\n respond_to do |format|\n if @file_type.save\n format.html { redirect_to @file_type, notice: 'File type was successfully created.' }\n format.json { render :show, status: :created, location: @file_type }\n else\n format.html { render :new }\n format.json { render json: @file_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0662a6a7baa246296aaa2b5d1ddf167e",
"score": "0.53376955",
"text": "def convert_types(api)\n each_shape(api) do |shape_name, shape|\n case shape_name\n when /date/i then shape.type = 'iso8601_timestamp'\n when :limit, :part_size, :archive_size then shape.type = 'integer'\n end\n end\n end",
"title": ""
},
{
"docid": "9b5bdb5fba46cad6f76947a24427d8fb",
"score": "0.5337",
"text": "def request_with_type_and_filename(type, filename)\n Google::Apis::VisionV1::BatchAnnotateImagesRequest.new(\n requests: [\n {\n image:{\n content: File.read(filename)\n },\n features: [\n {\n type: \"#{type}\",\n maxResults: 1\n }\n ]\n }\n ]\n )\nend",
"title": ""
},
{
"docid": "7544e6c9566741230d9cd2e3db5d8266",
"score": "0.53342474",
"text": "def create\n @file_type = FileType.new(params[:file_type])\n\n respond_to do |format|\n if @file_type.save\n format.html { redirect_to @file_type, notice: 'File type was successfully created.' }\n format.json { render json: @file_type, status: :created, location: @file_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @file_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27255476ff19cbb87a162bed59a0df78",
"score": "0.5330405",
"text": "def match_types(type_uris); end",
"title": ""
},
{
"docid": "ca26af47cbc44c247647ad5b037b7654",
"score": "0.5328729",
"text": "def create\n @area = Area.find params[:area_id]\n @image = Image.new({\n :public_id => params[\"response\"][\"public_id\"],\n :url => params[\"response\"][\"secure_url\"]\n })\n\n if @image.save\n @area.images << @image\n current_user.images << @image\n @response = @image.to_json(:include => :user)\n render json: @response\n else\n render json: @image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c03c41e03144ebe376907b58647c3855",
"score": "0.5325935",
"text": "def add(*types)\n types.each do |mime_type|\n if TYPE_VARIANTS.include?(mime_type.simplified)\n if TYPE_VARIANTS[mime_type.simplified].include?(mime_type)\n warn \"Type #{mime_type} already registered as a variant of #{mime_type.simplified}.\"\n end\n end\n MIME::Types.add_type_variant(mime_type)\n MIME::Types.index_extensions(mime_type)\n end\n end",
"title": ""
},
{
"docid": "6286849f011920ab9fdae3b6829cdcb3",
"score": "0.53256977",
"text": "def create\n @type_resource = TypeResource.new(type_resource_params)\n\n respond_to do |format|\n if @type_resource.save\n format.html { redirect_to @type_resource, notice: 'EL tipo de recurso fue cread éxitosamente.' }\n format.json { render :show, status: :created, location: @type_resource }\n else\n format.html { render :new }\n format.json { render json: @type_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93519c7a99824d1bacf35ee7b14fdfb8",
"score": "0.53237236",
"text": "def resource_type\n return 'Images'\n end",
"title": ""
},
{
"docid": "7a784753845bcbc4d613849ad3ac9817",
"score": "0.5322788",
"text": "def reptile_params\n params.require(:reptile).permit( {images: []}, :type1, :type2, :type_name, :morph, :sex, :age, :size, :weight, :description, :price, :sales_status, :arrival_day, :shop_name )\n end",
"title": ""
},
{
"docid": "98a96d30d24cd7afd4f35d2cee59997f",
"score": "0.53130996",
"text": "def create\n @admin_social_media_type = Admin::SocialMediaType.new(params[:admin_social_media_type])\n\n respond_to do |format|\n if @admin_social_media_type.save\n format.html { redirect_to admin_social_media_types_url }\n format.json { render json: @admin_social_media_type, status: :created, location: @admin_social_media_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_social_media_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e23a2bf3e5403a42e4e3725a579ad3b5",
"score": "0.5306997",
"text": "def images\n @images = @event.uploads.where(:upload_content_type => [\"image/png\", \"image/gif\", \"image/jpe\", \"image/jpeg\"])\n\n respond_to do |format|\n format.json { render json: @images.map{|image| image.to_redactor_img } }\n end\n\n end",
"title": ""
},
{
"docid": "84e290994ed45104dcf1a32595952306",
"score": "0.53009975",
"text": "def create\n @rental_item = RentalItem.new(rental_item_params)\n\n respond_to do |format|\n if @rental_item.save\n params[:rental_item_images]['item_image'].each do |a|\n @rental_item.rental_item_images.create!(:item_image => a)\n end\n format.html { redirect_to @rental_item, notice: 'Rental item was successfully created.' }\n format.json { render :show, status: :created, location: @rental_item }\n else\n format.html { render :new }\n format.json { render json: @rental_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a75192d16a82eb5927086b3704a6253",
"score": "0.529609",
"text": "def add_type(type)\n end",
"title": ""
},
{
"docid": "9a75192d16a82eb5927086b3704a6253",
"score": "0.529609",
"text": "def add_type(type)\n end",
"title": ""
},
{
"docid": "e2ef1c8112889e6005b41f23272b00c3",
"score": "0.5289567",
"text": "def post_params\n params.require(:post).permit(:title, :content , :status, images: [])\nend",
"title": ""
},
{
"docid": "902c0d5a846b1827defc850b9259d672",
"score": "0.52864367",
"text": "def create\n @animal = Animal.new(animal_params)\n @animal.breed_id = if animal_params[:animal_type] == \"1\"\n params[:dog_breed_id]\n else\n params[:cat_breed_id]\n end\n @animal.name.capitalize!\n respond_to do |format|\n if @animal.save\n if params[:animal_images]\n params[:animal_images][:image].each do |img|\n @animal_image = @animal.animal_images.create(image: img, animal: @animal)\n end\n end\n format.html { redirect_to show_animal_employees_path(@animal), notice: \"Animal was successfully created.\" }\n format.json { render :show, status: :created, location: @animal }\n else\n format.html { render :new }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
db0b18f926b76a1dcf00d25405af5eb1
|
Launch at a specific datetime. Use a ruby Datetime object here
|
[
{
"docid": "c858047812463cb447fabc335b930916",
"score": "0.0",
"text": "def execute\n raise ::GDO::Core::Exception.new(t(:err_cronjob_stub_method))\n end",
"title": ""
}
] |
[
{
"docid": "885f370103ae3e2b331d00e26c63d4a9",
"score": "0.62596697",
"text": "def start_at=(time)\n super(time.to_date)\n end",
"title": ""
},
{
"docid": "ab0930746c25a68f7c996200a2d4c87a",
"score": "0.61853015",
"text": "def at_midnight; end",
"title": ""
},
{
"docid": "ab0930746c25a68f7c996200a2d4c87a",
"score": "0.61853015",
"text": "def at_midnight; end",
"title": ""
},
{
"docid": "ab0930746c25a68f7c996200a2d4c87a",
"score": "0.61853015",
"text": "def at_midnight; end",
"title": ""
},
{
"docid": "ab0930746c25a68f7c996200a2d4c87a",
"score": "0.61853015",
"text": "def at_midnight; end",
"title": ""
},
{
"docid": "ab0930746c25a68f7c996200a2d4c87a",
"score": "0.61853015",
"text": "def at_midnight; end",
"title": ""
},
{
"docid": "ab0930746c25a68f7c996200a2d4c87a",
"score": "0.61853015",
"text": "def at_midnight; end",
"title": ""
},
{
"docid": "ab0930746c25a68f7c996200a2d4c87a",
"score": "0.61853015",
"text": "def at_midnight; end",
"title": ""
},
{
"docid": "fc112ba5613154174d2c78082784c37f",
"score": "0.6175916",
"text": "def launch_datetime; nil; end",
"title": ""
},
{
"docid": "8552ebf7a3bff680620363354430b31e",
"score": "0.6139889",
"text": "def scheduled_at=(_arg0); end",
"title": ""
},
{
"docid": "2933a26f35c238899fb07f3cde300306",
"score": "0.60498416",
"text": "def perform_at(time_at, *args)\n schedule(args: args, time_at: time_at)\n end",
"title": ""
},
{
"docid": "bbe2e16a6dd701c5e2843c4bf583655f",
"score": "0.601907",
"text": "def launched_on=(launched_on)\n @launched_on = formatted_date_time(launched_on || Time.current)\n end",
"title": ""
},
{
"docid": "bbe2e16a6dd701c5e2843c4bf583655f",
"score": "0.601907",
"text": "def launched_on=(launched_on)\n @launched_on = formatted_date_time(launched_on || Time.current)\n end",
"title": ""
},
{
"docid": "585c2bc7c160cb7350f5039fbfe7923c",
"score": "0.60154307",
"text": "def setup_start_at\n return unless start_at.blank?\n \n if crontab.blank?\n self.start_at = Time.now\n else\n self.start_at = Cron.find_next_time(Time.now, crontab)\n end\n end",
"title": ""
},
{
"docid": "aa9782ddb1ad165406156eeff7fae003",
"score": "0.60077304",
"text": "def at(*args) = Time.at(*args, in: self)",
"title": ""
},
{
"docid": "d3f6aa097cd7c7ec94468abb6d8608d6",
"score": "0.58507603",
"text": "def schedule(time)\n @schedule_at = time\n end",
"title": ""
},
{
"docid": "cb655f6e06d79e5e6ae54b057a55861a",
"score": "0.58266973",
"text": "def set_datetime\n @datetime = Datetime.find(params[:id])\n end",
"title": ""
},
{
"docid": "afad8f86de3c76faf6a83f61e76db59b",
"score": "0.58238024",
"text": "def run_at\n run_interval.from_now\n end",
"title": ""
},
{
"docid": "ee538bc6f3ca249463a946b4abbd9877",
"score": "0.5813442",
"text": "def set_datetime(clock)\n\t\t\t# Extract the time zone\n\t\t\tthrow \"invalid parameter value\" unless clock.is_a?(Foscam::Model::Clock)\n\t\t\tresponse = @connection.get(\"set_datetime.cgi?#{clock.to_query}\")\n\t\t\tresponse.success?\n\t\tend",
"title": ""
},
{
"docid": "9e969bcc32d7b8e6ac1ea5b54b82a82f",
"score": "0.5809534",
"text": "def immidiate(*args)\n at(time.now,*args)\n end",
"title": ""
},
{
"docid": "57d3f02f83ceaf695fe398f66b6e73c5",
"score": "0.57952857",
"text": "def run\r\n time = DateTime.Parse(Time.now.to_s);\r\n root.Run.begin\r\n root.Run.seek time.time_of_day\r\n root.DateNumber.Text = time.day.to_s\r\n root.Day.begin\r\nend",
"title": ""
},
{
"docid": "a16adf146c2c01aef37fe2edfaab887c",
"score": "0.57830715",
"text": "def at time, &action\n time = Time.at(time) if time.kind_of? Numeric\n super time do\n begin\n action.call\n rescue => ex\n @client.log.error \"error in action scheduled for #{time}:\" +\n \" #{ex.class}: #{ex}\\n #{ex.backtrace.join(\"\\n \")}\"\n end\n end\n end",
"title": ""
},
{
"docid": "a16adf146c2c01aef37fe2edfaab887c",
"score": "0.5782632",
"text": "def at time, &action\n time = Time.at(time) if time.kind_of? Numeric\n super time do\n begin\n action.call\n rescue => ex\n @client.log.error \"error in action scheduled for #{time}:\" +\n \" #{ex.class}: #{ex}\\n #{ex.backtrace.join(\"\\n \")}\"\n end\n end\n end",
"title": ""
},
{
"docid": "def072109f1baced80737180e11aa9ff",
"score": "0.5782243",
"text": "def start_time=(datetime)\n @start_time = Time.strptime(datetime, DATE_FORMAT)\n end",
"title": ""
},
{
"docid": "fe18bc05539a924d47588fe33d422328",
"score": "0.5779954",
"text": "def setup_start_at\n return unless start_at.blank?\n \n self.start_at = Time.now\n end",
"title": ""
},
{
"docid": "874573228bfa70c6d403358d465f4664",
"score": "0.57763505",
"text": "def set_current_date\n time = Time.new\n ut = time.getutc\n date = ut.strftime(\"%m/%d/%Y\")\n command(\"#:SC #{date}#\")\n blah = read_GTO900\n return read_GTO900\n end",
"title": ""
},
{
"docid": "bdb271fa3582ac6e53ca93b8bd88f76a",
"score": "0.57620245",
"text": "def execute_at_time_option(parser)\n parser.on('-t', '--time [TIME]', Time, 'Begin execution at given time') do |time|\n self.time = time\n end\n end",
"title": ""
},
{
"docid": "1b9325797468bdf7a90e6ec36dc40dd2",
"score": "0.5754802",
"text": "def initialize(timeOrDateTime); end",
"title": ""
},
{
"docid": "de696973f4b6c44d383fbe040a9fe445",
"score": "0.57450324",
"text": "def at(options={})\n validate_hours_or_minutes!(options)\n \n if hour = (options[:hour] || options[:hours])\n cron_entry.set_hours(hour)\n end\n \n if minute = (options[:minute] || options[:minutes])\n cron_entry.set_minutes(minute)\n end\n end",
"title": ""
},
{
"docid": "1c2fed21fc7f750efbc469202a7d7706",
"score": "0.57435894",
"text": "def set_schedule_today(date1, date2)\r\n\t\tarr = date1.to_a\r\n\t\tarr2 = date2.to_a\r\n\t\tTime.new(arr[5], arr[4], arr[3], arr2[2], arr2[1], arr2[0], \"+03:00\")\r\n\tend",
"title": ""
},
{
"docid": "0e4fab98c824ea768ae081d7f26c1b58",
"score": "0.5742973",
"text": "def started_at() ; info_time(:started_datetime) ; end",
"title": ""
},
{
"docid": "0e4fab98c824ea768ae081d7f26c1b58",
"score": "0.5742973",
"text": "def started_at() ; info_time(:started_datetime) ; end",
"title": ""
},
{
"docid": "f9b8733975440035e674dffa0263227e",
"score": "0.57256246",
"text": "def set_schedule_today(date1, date2)\n\t\tarr = date1.to_a\n\t\tarr2 = date2.to_a\n\t\tTime.new(arr[5], arr[4], arr[3], arr2[2], arr2[1], arr2[0], \"+03:00\")\n\tend",
"title": ""
},
{
"docid": "edd032d36518f87e99b881702cd9afc8",
"score": "0.5705592",
"text": "def startup_date_time=(value)\n @startup_date_time = value\n end",
"title": ""
},
{
"docid": "c449a7a41c5ed796a24452ce26d1be55",
"score": "0.56967294",
"text": "def simulate_test_running_on_different_days\n travel_to Time.parse(ENV['SPEC_DATE'] || \"#{rand(1..5)}-11-2019 14:33:20'\")\n end",
"title": ""
},
{
"docid": "c449a7a41c5ed796a24452ce26d1be55",
"score": "0.56967294",
"text": "def simulate_test_running_on_different_days\n travel_to Time.parse(ENV['SPEC_DATE'] || \"#{rand(1..5)}-11-2019 14:33:20'\")\n end",
"title": ""
},
{
"docid": "fc7119ee8f761f83f96c1a7bfad3a9a3",
"score": "0.5692286",
"text": "def execute_on_match(datetime)\n self.execute if cron_entry.matches?(datetime)\n end",
"title": ""
},
{
"docid": "cc0e2a54221df9554468cdd4826f6f04",
"score": "0.5681282",
"text": "def started_at=(_arg0); end",
"title": ""
},
{
"docid": "cc0e2a54221df9554468cdd4826f6f04",
"score": "0.5681282",
"text": "def started_at=(_arg0); end",
"title": ""
},
{
"docid": "a6291f8017e40210a0ac616362dd7442",
"score": "0.5676143",
"text": "def at_beginning_of_minute; end",
"title": ""
},
{
"docid": "a6291f8017e40210a0ac616362dd7442",
"score": "0.5676143",
"text": "def at_beginning_of_minute; end",
"title": ""
},
{
"docid": "a6291f8017e40210a0ac616362dd7442",
"score": "0.5676143",
"text": "def at_beginning_of_minute; end",
"title": ""
},
{
"docid": "a6291f8017e40210a0ac616362dd7442",
"score": "0.5676143",
"text": "def at_beginning_of_minute; end",
"title": ""
},
{
"docid": "a6291f8017e40210a0ac616362dd7442",
"score": "0.5676143",
"text": "def at_beginning_of_minute; end",
"title": ""
},
{
"docid": "e7f4609ef9c90e0cd2faa0399656ed7d",
"score": "0.56754684",
"text": "def at_beginning_of_day; end",
"title": ""
},
{
"docid": "e7f4609ef9c90e0cd2faa0399656ed7d",
"score": "0.56754684",
"text": "def at_beginning_of_day; end",
"title": ""
},
{
"docid": "e7f4609ef9c90e0cd2faa0399656ed7d",
"score": "0.56754684",
"text": "def at_beginning_of_day; end",
"title": ""
},
{
"docid": "e7f4609ef9c90e0cd2faa0399656ed7d",
"score": "0.56754684",
"text": "def at_beginning_of_day; end",
"title": ""
},
{
"docid": "e7f4609ef9c90e0cd2faa0399656ed7d",
"score": "0.56754684",
"text": "def at_beginning_of_day; end",
"title": ""
},
{
"docid": "e7f4609ef9c90e0cd2faa0399656ed7d",
"score": "0.56754684",
"text": "def at_beginning_of_day; end",
"title": ""
},
{
"docid": "e7f4609ef9c90e0cd2faa0399656ed7d",
"score": "0.56754684",
"text": "def at_beginning_of_day; end",
"title": ""
},
{
"docid": "f1aac881f95e07b6d0038c213abe4c83",
"score": "0.56638944",
"text": "def start=(time)\n @now = time\n end",
"title": ""
},
{
"docid": "f1aac881f95e07b6d0038c213abe4c83",
"score": "0.56638944",
"text": "def start=(time)\n @now = time\n end",
"title": ""
},
{
"docid": "f58d076c93a5c82555adb6645b544ff8",
"score": "0.5662148",
"text": "def run(time)\n\t @schedule = time\n\t end",
"title": ""
},
{
"docid": "869cf907c7d7efd65b01e420f673a507",
"score": "0.5652766",
"text": "def simulate_test_running_on_different_days\n travel_to Time.parse(ENV['SPEC_DATE'] || \"26-#{rand(9..12)}-2019 14:33:20'\")\n end",
"title": ""
},
{
"docid": "069feac0c05aff85b787f8a47c7b894b",
"score": "0.5644955",
"text": "def start\n Time.at(start_at)\n end",
"title": ""
},
{
"docid": "d71307f1769cc72dde6595521ad9d35a",
"score": "0.5644768",
"text": "def at(time)\n if time.respond_to? :getutc\n t = time.getutc\n self.utc(t.year, t.mon, t.mday, t.hour, t.min, t.sec).localtime\n else\n self.new(time)\n end\n end",
"title": ""
},
{
"docid": "dc531f9a227bc81a3e8b783bad9f178d",
"score": "0.56251466",
"text": "def set_run_at\n if data['run_at'].nil? || (data['run_at'] == '')\n self.run_at = self.class.db_time_now\n end\n end",
"title": ""
},
{
"docid": "e925a8ffa5d6263eb248c326741a44ac",
"score": "0.5575943",
"text": "def time(st=nil)\n self.start(st)\n end",
"title": ""
},
{
"docid": "bdda8ccf4dbb7f2247f5faa73bf32eff",
"score": "0.5566952",
"text": "def set_date_time(api_time)\n DateTime.strptime(\"#{api_time}-05:00\", '%Y-%m-%dT%H:%M:%S.%L%z')\n end",
"title": ""
},
{
"docid": "cd3bd674068ac758f5a11b21101ecfb4",
"score": "0.55662054",
"text": "def set_date\n time_zone_name = Time.zone.name\n time_now = Time.now.in_time_zone(time_zone_name)\n @today = Date.new(time_now.year, time_now.month, time_now.day)\n @today_datetime = DateTime.new(time_now.year, time_now.month, time_now.day, time_now.hour)\n # Food logging only permitted back to Monday of current week\n # Unless its before 11pm on Monday of the current week\n # Then lower_date_bounds is Monday of the previous week\n if(time_now.send(FatCompetition::GRACE_PERIOD_DAY + '?') && time_now.hour < FatCompetition::GRACE_PERIOD_HOUR)\n @lower_date_bounds = @today.beginning_of_week - 7\n else\n @lower_date_bounds = @today - @today.cwday + 1\n end\n\n if params[:fat_day]\n @date = Date.strptime(params[:fat_day][:date], \"%Y-%m-%d\")\n elsif params[:year].present?\n year = params[:year].to_i\n month = params[:month].to_i\n day = params[:day].to_i\n\n @date = Date.new(year, month, day)\n \n # check date is within bounds\n # Lower bounds: M of current week\n # Upper bounds: Su of current week. Su is last day of week\n if(@date < @lower_date_bounds)\n @date = @lower_date_bounds\n #check upper bounds \n elsif(@date > @today)\n @date = @today\n end\n @date_str = (@today - 1 == @date) ? 'Yesterday' : ( (@date == @today) ? 'Today' : @date.strftime(\"%A\") )\n else\n @date = @today\n @date_str = \"Today\"\n end\n\n @prev_date = @date - 1\n @next_date = @date + 1\n end",
"title": ""
},
{
"docid": "298d90b7059ca213c6892a09869e2699",
"score": "0.5550238",
"text": "def test_at_start_of_day\n d = LocalDate.now(FakeClock.new(1514757599000))\n dt = d.at_start_of_day\n assert_equal(2017, dt.year)\n assert_equal(12, dt.month)\n assert_equal(31, dt.day)\n assert_equal(0, dt.hour)\n assert_equal(0, dt.minute)\n assert_equal(0, dt.second)\n assert_equal(0, dt.millis)\n end",
"title": ""
},
{
"docid": "dd273ed0173229547869a13e5ae07000",
"score": "0.55481416",
"text": "def at ts\n spawn :@trange, time_to_long(ts)\n end",
"title": ""
},
{
"docid": "5a862b48a24c9ba0e487d3af4a167f71",
"score": "0.55292445",
"text": "def at(time)\n unless time.is_a?(Integer)\n time = case time.to_s\n when /^\\d+:00$/\n time[/^\\d+/].to_i\n when /^\\d+:\\d{2}$/\n @min_at = time.split(/:/)[1].to_i\n time.split(/:/)[0].to_i\n when /^(noon|afternoon|midnight|morning)$/\n DAY_PERIODS[time.to_s]\n else\n time.to_i\n end\n end\n \n @at = time\n return self\n end",
"title": ""
},
{
"docid": "020eb1a2f656df13d0d6e1fb59ac06dd",
"score": "0.55247784",
"text": "def start_at\n today = Time.now\n Time.new(today.year, today.month, today.day, 13,0,0)\n end",
"title": ""
},
{
"docid": "ae2a50ecec50713235a5d390623dfe9b",
"score": "0.55180943",
"text": "def in(t,*args)\n at(time.now+t,*args)\n end",
"title": ""
},
{
"docid": "87457bb57b73e7d13a9338ced65e6c86",
"score": "0.55160326",
"text": "def single_day\n\t$TOGGL_API.create_time_entry({\n\t\t'pid' => '12822555',\n\t\t'duration' => 28800,\n\t\t'start' => $TOGGL_API.iso8601(DateTime.new($YEAR,$MONTH,$DAY,15,30,0)),\n\t\t'created_with' => 'Toggl Time Entry Script'\n\t})\nend",
"title": ""
},
{
"docid": "5449d8922aa6c042e4e7db1436d5caf4",
"score": "0.55145735",
"text": "def atime=(_arg0); end",
"title": ""
},
{
"docid": "5449d8922aa6c042e4e7db1436d5caf4",
"score": "0.55145735",
"text": "def atime=(_arg0); end",
"title": ""
},
{
"docid": "5449d8922aa6c042e4e7db1436d5caf4",
"score": "0.55145735",
"text": "def atime=(_arg0); end",
"title": ""
},
{
"docid": "4ff5ce726754f8f5d9160c1c7f48a6fb",
"score": "0.5502671",
"text": "def at_beginning_of_hour; end",
"title": ""
},
{
"docid": "4ff5ce726754f8f5d9160c1c7f48a6fb",
"score": "0.5502671",
"text": "def at_beginning_of_hour; end",
"title": ""
},
{
"docid": "4ff5ce726754f8f5d9160c1c7f48a6fb",
"score": "0.5502671",
"text": "def at_beginning_of_hour; end",
"title": ""
},
{
"docid": "4ff5ce726754f8f5d9160c1c7f48a6fb",
"score": "0.5502671",
"text": "def at_beginning_of_hour; end",
"title": ""
},
{
"docid": "4ff5ce726754f8f5d9160c1c7f48a6fb",
"score": "0.5502671",
"text": "def at_beginning_of_hour; end",
"title": ""
},
{
"docid": "50aadba54362925c30f4871fe33c395e",
"score": "0.55022776",
"text": "def setTime\n\n\tend",
"title": ""
},
{
"docid": "0e3876617ca0f3e3a5896cbbcdc84a4f",
"score": "0.54731536",
"text": "def seed_date_maker()\n year = (DateTime.now.year-2..DateTime.now.year+2).to_a.sample\n hour = (9..20).to_a.sample\n minute = [00, 30].sample\n month = (1..12).to_a.sample\n if month == 2\n day = (1..28).to_a.sample\n elsif [1,3,5,7,8,10,12].include?(month)\n day = (1..31).to_a.sample\n else\n day = (1..30).to_a.sample\n end\n self.appt_date_time = DateTime.new(year, month, day, hour, minute)\n end",
"title": ""
},
{
"docid": "36dbf641296c021259b732fe3c0245cf",
"score": "0.5462592",
"text": "def begin_at\n Time.new(year, month, day, begin_hour, begin_minute, 0, '+00:00')\n end",
"title": ""
},
{
"docid": "3e2ef5c421a35daa6d71e12b9fd914e4",
"score": "0.546097",
"text": "def scheduled_at; end",
"title": ""
},
{
"docid": "b14fd688a9d323406166e03dff11e11d",
"score": "0.5455217",
"text": "def start_date\n params_list = params[:activity]\n year = params_list[\"started(1i)\"].to_i\n month = params_list[\"started(2i)\"].to_i\n day = params_list[\"started(3i)\"].to_i\n hour = params_list[\"started(4i)\"].to_i\n minute = params_list[\"started(5i)\"].to_i\n DateTime.new(year,month,day,hour,minute)\n end",
"title": ""
},
{
"docid": "1ef270eec4f7f8a56f702b5b11ad6b11",
"score": "0.545246",
"text": "def set_date(date)\n time = @datetime_list[0].text.split(/[:\\+]/).first(3).map(&:to_i)\n @datetime = DateTime.new(date.year, date.month, date.day, *time) rescue DateTime.now\n @datetime += 1 if @datetime_list[0].operation == 'yesterday'\n end",
"title": ""
},
{
"docid": "22f927392601c41768072fd9acb2e088",
"score": "0.54498625",
"text": "def initialize(start_datetime, &block)\n @thread_started = false\n if start_datetime.class == DateTime\n @start_datetime = start_datetime\n else\n raise ArgumentError.new(\"must have a DateTime object\")\n end\n if block\n @action = block\n elsif block_given?\n @action = lambda { yield }\n else \n raise ArgumentError.new(\"missing a block\")\n end\n end",
"title": ""
},
{
"docid": "ba2d2f8747280f8bcd2249dce25f2c39",
"score": "0.5447684",
"text": "def test_initialize_datetime_with_datetime()\n time = DateTime.new(2017, 11, 7, 17, 30, 10)\n datetime = @dfp.datetime(time, 'America/New_York')\n assert_equal(2017, datetime.year)\n assert_equal(11, datetime.month)\n assert_equal(7, datetime.day)\n assert_equal(17, datetime.hour)\n assert_equal(30, datetime.min)\n assert_equal(10, datetime.sec)\n assert_equal('America/New_York', datetime.timezone.identifier)\n assert_equal(-18000, datetime.utc_offset)\n end",
"title": ""
},
{
"docid": "97f06d54bbf9ee4330c3cd6bb19f5fd0",
"score": "0.5433913",
"text": "def date(time_or_date, options = {})\n time(time_or_date.to_date, options)\n end",
"title": ""
},
{
"docid": "029e88580cabf7a8d52005c989649098",
"score": "0.5426645",
"text": "def test_initialize_datetime_with_time()\n time = Time.new(2017, 11, 7, 17, 30, 10)\n datetime = @dfp.datetime(time, 'America/New_York')\n assert_equal(2017, datetime.year)\n assert_equal(11, datetime.month)\n assert_equal(7, datetime.day)\n assert_equal(17, datetime.hour)\n assert_equal(30, datetime.min)\n assert_equal(10, datetime.sec)\n assert_equal('America/New_York', datetime.timezone.identifier)\n assert_equal(-18000, datetime.utc_offset)\n end",
"title": ""
},
{
"docid": "fa309f6cbb06519d37d8ec5538985fc2",
"score": "0.5420246",
"text": "def setDateTime(time)\n @dateTime = time\n if time\n begin\n DType::DateTime.new(time)\n rescue ex\n raise AccessError.new \"dateTime failed for reason: #{ex}\"\n end \n end\n self \n end",
"title": ""
},
{
"docid": "821a9eb95be0b091f55bf06be06b499f",
"score": "0.54171824",
"text": "def after_midnight(time)\n\nend",
"title": ""
},
{
"docid": "3ac8fd321a3aeea7468960f42c13099d",
"score": "0.5407161",
"text": "def run_at=(value)\n value = Time.parse(value.to_s) unless value.nil? || value.is_a?(Time)\n doc['run_at'] = value.nil? ? nil : value.utc\n end",
"title": ""
},
{
"docid": "e73fb1a4678658b8d6bb4b5b859a5e6d",
"score": "0.5405354",
"text": "def schedule(time)\n raise \"Time in the past.\" if time <= DateTime.now\n @scheduler.at time.to_s, overlap: false do\n yield\n end\nrescue\n connect_and_error(@access_conf, \"Error scheduling time. Waiting at console.\")\n binding.pry\nend",
"title": ""
},
{
"docid": "acb503c0051fb51a8b94eadad7e2398e",
"score": "0.5394909",
"text": "def custom\n @start_time = @start_time.to_time.beginning_of_day\n @end_time = @end_time.to_time.end_of_day\n end",
"title": ""
},
{
"docid": "acb503c0051fb51a8b94eadad7e2398e",
"score": "0.5394909",
"text": "def custom\n @start_time = @start_time.to_time.beginning_of_day\n @end_time = @end_time.to_time.end_of_day\n end",
"title": ""
},
{
"docid": "32131edb10da8094a0aded7fd42d797b",
"score": "0.5390346",
"text": "def test_initialize_datetime_without_timezone()\n assert_raise(RuntimeError) do\n datetime = @dfp.datetime(2017, 11, 7, 17, 30, 10)\n end\n end",
"title": ""
},
{
"docid": "70d6848e5ed20245deb96a3772478106",
"score": "0.53809005",
"text": "def next_run_at\n DateTime.new(next_year, next_month, next_day, next_hour, next_minute)\n end",
"title": ""
},
{
"docid": "3ffc10bad4cfb34713798b4950a84f59",
"score": "0.53685266",
"text": "def start_time=(time)\n self.starts_at = to_database_time time\n end",
"title": ""
},
{
"docid": "bb571ee03cd60cea0958a90614fb2c19",
"score": "0.5367033",
"text": "def midnight; end",
"title": ""
},
{
"docid": "bb571ee03cd60cea0958a90614fb2c19",
"score": "0.5367033",
"text": "def midnight; end",
"title": ""
},
{
"docid": "bb571ee03cd60cea0958a90614fb2c19",
"score": "0.5367033",
"text": "def midnight; end",
"title": ""
},
{
"docid": "bb571ee03cd60cea0958a90614fb2c19",
"score": "0.5367033",
"text": "def midnight; end",
"title": ""
},
{
"docid": "bb571ee03cd60cea0958a90614fb2c19",
"score": "0.5367033",
"text": "def midnight; end",
"title": ""
},
{
"docid": "bb571ee03cd60cea0958a90614fb2c19",
"score": "0.5367033",
"text": "def midnight; end",
"title": ""
},
{
"docid": "bb571ee03cd60cea0958a90614fb2c19",
"score": "0.5367033",
"text": "def midnight; end",
"title": ""
}
] |
7fe04c9794f66f83a60e58f529197a31
|
PUT /event_posts/1 PUT /event_posts/1.json
|
[
{
"docid": "58be208b2830eaaff395d7c76295f0f3",
"score": "0.61114264",
"text": "def update\n @event_post = @event.event_posts.find(params[:id])\n\n respond_to do |format|\n if @event_post.update_attributes(params[:event_post])\n \n if @event_post.home_flag\n if !@event_post.home_post\n theHomeTailgate = Tailgate.where(official:true).find_by_team_id(@event.home_team.id)\n @event_post.home_post = theHomeTailgate.posts.new(params[:post])\n @event_post.home_post.user = current_user\n else\n @event_post.home_post.update_attributes(params[:post])\n end\n elsif @event_post.home_post\n @event_post.home_post.destroy\n end\n \n if @event_post.visiting_flag\n if !@event_post.visiting_post\n theVisitingTailgate = Tailgate.where(official:true).find_by_team_id(@event.visiting_team.id)\n @event_post.visiting_post = theVisitingTailgate.posts.new(params[:post])\n @event_post.visiting_post.user = current_user\n else\n @event_post.visiting_post.update_attributes(params[:post])\n end\n elsif @event_post.visiting_post\n @event_post.visiting_post.destroy\n end\n \n @event_post.save\n\n format.html { redirect_to @event, notice: 'Event post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "e5460b656a1d4534f93100e444b24240",
"score": "0.6905179",
"text": "def update\n event = current_user.events.find(params[:id])\n if event.update(post_params)\n render json: event\n else\n render json: {error: 'could not update'}, status: 401\n end\n end",
"title": ""
},
{
"docid": "c5d192614a2e5d5fed65e1476664df98",
"score": "0.68437314",
"text": "def put_event(args)\n\t\t\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}/events/#{args[:event_type]}\"\n\t\t\tdo_the_put_call( url: api_url, json: args[:json] )\n\t\tend",
"title": ""
},
{
"docid": "c1e91edfe4a0b5c098fb83a06d3cccfc",
"score": "0.6649536",
"text": "def update\n @event.update(event_params)\n head :no_content\n end",
"title": ""
},
{
"docid": "0050f781a1e526879347940817ef65b8",
"score": "0.6631518",
"text": "def update\n #TODO params -> strong_params\n if @event.update(params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6c1e334145a99139541ed6d4fe4f8a55",
"score": "0.6624659",
"text": "def update\n #1st you retrieve the event thanks to params[:event_id]\n event = Event.find(params[:event_id])\n #2nd you retrieve the post thanks to params[:id]\n @post = event.posts.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(post_params)\n #1st argument of redirect_to is an array, in order to build the correct route to the nested resource post\n format.html { redirect_to([@post.event, @post], :notice => 'Post was successfully updated.') }\n format.xml { head :ok }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "de04757f39fd1fb259531f6fefd81e4d",
"score": "0.6539458",
"text": "def update\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8396105d9c600765bff7559abf0f7b3f",
"score": "0.6521131",
"text": "def update\n\t\t@event = Event.find(params[:id])\n\n\t\tif @event.update_attributes(params[:event])\n\t\t\thead :no_content\n\t\telse\n\t\t\trender json: @event.errors, status: :unprocessable_entity\n\t\tend\n\tend",
"title": ""
},
{
"docid": "19ff8656c452438018ca7549e3c998f7",
"score": "0.6515423",
"text": "def update\n respond_to do |format|\n if @eventpost.update(eventpost_params)\n format.html { redirect_to @eventpost, notice: 'Eventpost was successfully updated.' }\n format.json { render :show, status: :ok, location: @eventpost }\n else\n format.html { render :edit }\n format.json { render json: @eventpost.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc4ff2adcbcefec9118bdd7e8716ad75",
"score": "0.6486186",
"text": "def update\n event = event.find(params[\"id\"]) \n event.update_attributes(event_params) \n respond_with event, json: event\n end",
"title": ""
},
{
"docid": "0ee8fcfa321abca1c8a254f293929bba",
"score": "0.6415651",
"text": "def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0ee8fcfa321abca1c8a254f293929bba",
"score": "0.6415651",
"text": "def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e53ac6aaed698a8f60ef0ffd649d7a37",
"score": "0.64056236",
"text": "def update\n @event = Event.find(params[:id])\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.json { head :ok }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce5ec604f96dac2452bf80d63d407246",
"score": "0.64010155",
"text": "def update\n @event = Event.find(params[:id])\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5415dd71b3b7941d4591b6418720b8db",
"score": "0.63682026",
"text": "def update\n event = Event.find(params[:id])\n if event.update(event_params)\n render json: event\n else\n render json: { error: '' }, status: 403\n end\n end",
"title": ""
},
{
"docid": "f8df991b07ce1ccb21665df10b8a9346",
"score": "0.6315708",
"text": "def update\n if !params[\"event\"][\"payload\"].is_a?(String)\n @event.payload = params[\"event\"][\"payload\"].to_json\n end\n\n if params[\"event\"][\"timestamp\"]\n @event.timestamp = Time.at(params[\"event\"][\"timestamp\"].to_f)\n end\n\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25c70818308792c1eeb416d6f7873983",
"score": "0.63107044",
"text": "def update\n @event = Event.find(params[:event_id])\n respond_to do |format|\n if @event.update(event_params)\n format.json { render json: @event, status: :ok }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a29b26d0bd365434c592cf3e22fec741",
"score": "0.6296448",
"text": "def update\n if @event.update(event_params)\n head :ok\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fef606243741752603cf8b7a9b458009",
"score": "0.6271881",
"text": "def update\n user = User.find_by({token: env['HTTP_TOKEN']})\n post = user.posts.find(params[:id])\n post.update(post_params)\n render json: post\n\n end",
"title": ""
},
{
"docid": "158cc85c267c341d95fec85c61eca325",
"score": "0.6262079",
"text": "def update\n if @event.update(event_params)\n render json: @event.to_json, status: :ok\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "557b7dee79ad9c6676f191d5695796dc",
"score": "0.62364084",
"text": "def update\n @event.update!(event_params)\n if @event.save\n #if saved then output saved data to JSON\n render json: @event.to_json, status: 201\n else\n #if failed send bad request error\n render json: {message: \"Failed to update event\"}, status: 400\n end\n end",
"title": ""
},
{
"docid": "69631969c3255f2f77ccb590786681d2",
"score": "0.62310815",
"text": "def update\n\t\tevent_id = params[:id]\n\t\tif event_id.present? && params[:event].present?\n\t\t\tevent_params = params[:event]\n\t\t\t@event = Com::Nbos::Events::Event.where(:id => event_id).first\n\t\t\tif @event.present? \n\t\t\t\t@event.update(event_params.permit!)\n\t\t\t\tif @event.save\n\t\t\t\t\trender :json => @event\n\t\t\t\telse\n\t\t\t\t\trender :json => {status: 500, message: @event.errors.messages}, status: 500\n\t\t\t\tend\n\t\t\telse\n\t\t\t\trender :json => {status: 404, message: \"Event Not Found\"}, status: 404\n\t\t\tend\n\t\telse\n\t\t\trender :json => {status: 400, message: \"Bad Request\"}, status: 400\n\t\tend\n\tend",
"title": ""
},
{
"docid": "05a7d2e173a66f6c17d882feac6f0ac8",
"score": "0.6202198",
"text": "def set_eventpost\n @eventpost = Eventpost.find(params[:id])\n end",
"title": ""
},
{
"docid": "584799e893c973e4b7ef23fb5cba14bc",
"score": "0.619708",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n @event.tags.delete_all\n @event.tags << @tags\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2827d845ba442028d80242de02c60173",
"score": "0.61823946",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { head :no_content, status: :ok }\n format.xml { head :no_content, status: :ok }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n format.xml { render xml: @event.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "923b504c84eb16dd093f5461615425ad",
"score": "0.61352086",
"text": "def update\n @event = Event.find(params[:id])\n\n # Link up the event format\n if params.has_key?(\"eventformat\")\n @event.eventformats = []\n @event.eventformats << Eventformat.find(params['eventformat'])\n end\n\n # Link up the topics that will be covered at this event\n if params.has_key?(\"eventtopic\")\n @event.eventtopics = []\n params['eventtopic'].each do |topic|\n @event.eventtopics << Eventtopic.find(topic)\n end\n end\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff13892cc987facfe256433aec09dc17",
"score": "0.6130919",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { render html: '200', status: :ok }\n format.json { render 'event', status: :ok, event: @event }\n else\n format.html { render html: '500', status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "779a91b90c7e731678971b5689ec9b70",
"score": "0.6124662",
"text": "def update\n @post = Post.find(params[:id])\n @post.update(post_params)\n render json: @post \n end",
"title": ""
},
{
"docid": "49d38487712349de37855d7601fdfa81",
"score": "0.6124196",
"text": "def update\n respond_with(@event)\n end",
"title": ""
},
{
"docid": "6057d92b0704aa37b9cfaa5dd5be8f36",
"score": "0.61223143",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6057d92b0704aa37b9cfaa5dd5be8f36",
"score": "0.61223143",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6057d92b0704aa37b9cfaa5dd5be8f36",
"score": "0.61223143",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ebbe82e59ec6b7cad2273ea268b0849",
"score": "0.6110247",
"text": "def update\n @event.update(event_params)\n end",
"title": ""
},
{
"docid": "f8e7224492feea7ac1a8d8de37112164",
"score": "0.60660547",
"text": "def update\n @event.assign_attributes(event_params)\n @event.slug = @event.title.parameterize\n respond_to do |format|\n if @event.save\n format.html { redirect_to admin_events_url, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "960133fdc0379a5882642465eb6ac552",
"score": "0.6065465",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n save_tags\n format.html {redirect_to @event, notice: 'Event was successfully updated.'}\n format.json {render :show, status: :ok, location: @event}\n else\n format.html {render :edit}\n format.json {render json: @event.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "32a87162afe9140a07c1e917817498f8",
"score": "0.6061656",
"text": "def update\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32a87162afe9140a07c1e917817498f8",
"score": "0.6061656",
"text": "def update\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "268a8837ab76129f50aa6c9a2c5e73c3",
"score": "0.6049626",
"text": "def update\n @post.update!(post_params)\n render json: {status: :ok}\n end",
"title": ""
},
{
"docid": "994f8eb201b9ce4d1c9d7567873ed20d",
"score": "0.60477453",
"text": "def update\n @event = Event.find(@params['id'])\n @event.update_attributes(@params['event'])\n redirect :action => :index\n end",
"title": ""
},
{
"docid": "9fd898688f0867887f732f6b9a38ad37",
"score": "0.6045334",
"text": "def update\n @event.update(title: params[:title], description: params[:description], start_time: params[:start_time], end_time: params[:end_time])\n @allEvents = Event.all\n render json: @allEvents\n end",
"title": ""
},
{
"docid": "4753c440a8d7706c55dbf95eab9771e8",
"score": "0.6044943",
"text": "def put_event(collection, key, event_type, timestamp, ordinal, body, ref=nil)\n timestamp = API::Helpers.timestamp(timestamp)\n path = [collection, key, 'events', event_type, timestamp, ordinal]\n headers = {}\n headers['If-Match'] = API::Helpers.format_ref(ref) if ref\n send_request :put, path, { body: body, headers: headers, response: API::ItemResponse }\n end",
"title": ""
},
{
"docid": "7599b6acda033b21082c7a67a2516d88",
"score": "0.6042969",
"text": "def update\n json_update_and_sanitize(post,post_params, Post)\n end",
"title": ""
},
{
"docid": "87ec81bc694c30bf0bb41652b8b316f5",
"score": "0.6042086",
"text": "def update\n @event = Event.find_by_slug(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to(@event, :notice => 'Event was successfully updated.') }\n format.xml { head :ok }\n format.json { render :nothing => true }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n format.json { render :nothing => true }\n end\n end\n end",
"title": ""
},
{
"docid": "4587bd5f3f89335a2cd301f695531a39",
"score": "0.6040488",
"text": "def update\n @event = Event.find(params[:id])\n @event.update_attributes(params[:event])\n respond_with @event\n end",
"title": ""
},
{
"docid": "e18519c93c1b49c8ae0c57059fe9460a",
"score": "0.6036995",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Newswas successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8dc8b50c1ad4c4bb1b2ea9ab69ff747",
"score": "0.60322046",
"text": "def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n respond_with @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "de2c55d956ebbb4e392396ea6163cc38",
"score": "0.60167766",
"text": "def update\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34c10c4557f689baa30ce671828a8692",
"score": "0.6006117",
"text": "def update\n @api_v1_post = Post.find(params[:id])\n params[:post].delete :created_at\n params[:post].delete :updated_at\n respond_to do |format|\n if @api_v1_post.update_attributes(params[:post])\n format.html { redirect_to @api_v1_post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_v1_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dcf0e2d221c4230634f608d7d00af266",
"score": "0.6005123",
"text": "def update\n @post = Post.find(params[:id])\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.json { render :json => @post }\n else\n format.json { render :json => @post.errors, :status => :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "aba45afd84b14069046e3a685f7e3498",
"score": "0.59978384",
"text": "def update\n if @event.update(event_params)\n render :show, status: :ok\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "aba45afd84b14069046e3a685f7e3498",
"score": "0.59978384",
"text": "def update\n if @event.update(event_params)\n render :show, status: :ok\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ac9a028123fc75cafd9f051ff8620e43",
"score": "0.5993229",
"text": "def new\n @event_post = @event.event_posts.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event_post }\n end\n end",
"title": ""
},
{
"docid": "583edc49a5b6d87c4dadba5ada09dfaf",
"score": "0.599211",
"text": "def update \n\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b09b640943d827806df82d032fe141df",
"score": "0.5986475",
"text": "def update\n @event = Event.find(params[:id])\n\n @event.assign_attributes(params[:event])\n\n if @event.save\n head :no_content\n else\n respond_with @event, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "93a3d30cd144eb5bdb908d4ebfe49137",
"score": "0.59846854",
"text": "def update\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to edit_event_path(@event), notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6bf25ae1651d0f580b13ce9837d3a9d3",
"score": "0.5980833",
"text": "def update\n # @event has been prepared in check_user\n\n # Avoid mass assignment for security\n\n @event.title = params[:event][:title]\n @event.introduction = params[:event][:introduction]\n @event.instruction = params[:event][:instruction]\n\n # Mountpoints\n @event.category_ids = params[:event][:category_ids]\n @event.tag_list = params[:event][:tag_list]\n\n if @event.save\n redirect_to(event_path(@event))\n else\n content_add_breadcrumb(@event)\n add_breadcrumb(t('common.edit'))\n render(:action => 'edit')\n end\n end",
"title": ""
},
{
"docid": "0ed2baaefdac44fec0bd7d84da054850",
"score": "0.59805465",
"text": "def update\n @event = current_user.events.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n if params[:twitter] == 'yes'\n current_user.twitter.update(@event.title[0..80] + \" ... \" + url_for(controller: \"events\",action: \"show\", id: @event))\n end\n if params[:facebook] == 'yes'\n current_user.facebook.feed!(\n message: @event.title,\n description: @event.description,\n link: url_for(controller: \"events\",action: \"show\", id: @event)\n )\n end\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "126b51ffe038cd20a27f8fd6e1f33fe2",
"score": "0.59741104",
"text": "def test_should_update_blog_post_via_API_JSON\r\n get \"/logout\"\r\n put \"/blog_posts/1.json\", :api_key => 'testapikey',\r\n :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "2471b6601fb428abef82abf36c53ff66",
"score": "0.59716177",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n byebug\n format.html { redirect_to lot_event_path(@lot), notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bbba4952593a15b119f257ae0c2bb797",
"score": "0.59679735",
"text": "def update\n @event = Event.find_by_slug(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n @event.update_attribute('published_at', Time.now) if params[:commit] == 'Publish'\n @event.update_attribute('published_at', nil) if params[:commit] == 'Unpublish'\n\n if params[:commit] == 'Publish'\n format.html { redirect_to @event, notice: 'Event was successfully published.' }\n else\n format.html { redirect_to edit_event_path(@event), notice: 'Event was successfully updated.' }\n end\n\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b55c90bc72532f587b41b7972c69b6a8",
"score": "0.59649074",
"text": "def update\n respond_with( @event ) do |format|\n if @event.update_attributes( params[ :event ] )\n flash[ :notice ] = \"Event was successfully updated.\"\n format.html { redirect_to @event }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae598b2155b01a423c628a5fcccdb754",
"score": "0.5964784",
"text": "def update\n @event.update_attributes event_params\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb6206e90d5d022a8ab79c015d156c71",
"score": "0.5961853",
"text": "def update_event(event)\n event_id = get_id_for(event)\n url = Util::Config.get('endpoints.base_url') +\n sprintf(Util::Config.get('endpoints.event'), event_id)\n url = build_url(url)\n payload = event.to_json\n response = RestClient.put(url, payload, get_headers())\n Components::Event.create(JSON.parse(response.body))\n end",
"title": ""
},
{
"docid": "cbdd694a0ed126dda2c488880ff033ab",
"score": "0.59607816",
"text": "def post_params\n params.require(:post).permit(:title, :body, :event_id)\n end",
"title": ""
},
{
"docid": "cc7f236f87547ec1114e61d78932e190",
"score": "0.5955186",
"text": "def update\n @event = Event.find(params[:id])\n\n #respond_to do |format|\n if @event.update_attributes(params[:event])\n #format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n #format.json { head :no_content }\n\tredirect_to '/events'\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n #end\n end",
"title": ""
},
{
"docid": "621bb38f509573309f30e4105e40e5e5",
"score": "0.59528923",
"text": "def publish_event(event)\n event_id = get_id_for(event)\n url = Util::Config.get('endpoints.base_url') +\n sprintf(Util::Config.get('endpoints.event'), event_id)\n url = build_url(url)\n payload = [{:op => \"REPLACE\", :path => \"#/status\", :value => \"ACTIVE\"}].to_json\n response = RestClient.patch(url, payload, get_headers())\n Components::Event.create(JSON.parse(response.body))\n end",
"title": ""
},
{
"docid": "8cc56cef02522a3c9af612c74329363b",
"score": "0.59505504",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n add_images\n format.html { redirect_to admin_event_path(@event), notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96a05b34a5f958c31888bbdc7834f734",
"score": "0.5945249",
"text": "def update\n @event = Event.find(params[:id])\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa1a8a994e0cc33251b851b7b4081777",
"score": "0.5943362",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "438bfb800a681490193c0b150dc83369",
"score": "0.5940274",
"text": "def update\n\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9514e4c5ab0c56f77fcc5227a984cf25",
"score": "0.5939865",
"text": "def update\n respond_to do |format|\n if @hashtag_event.update(hashtag_event_params)\n format.html { redirect_to @hashtag_event, notice: 'Hashtag event was successfully updated.' }\n format.json { render :show, status: :ok, location: @hashtag_event }\n else\n format.html { render :edit }\n format.json { render json: @hashtag_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5227fd477a80d50e1f1d0da025f49cc8",
"score": "0.59382844",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5227fd477a80d50e1f1d0da025f49cc8",
"score": "0.59382844",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2f4c464da5fbe99c15fbce88b53b476",
"score": "0.5937749",
"text": "def update\n \n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to event_path }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f86bb6893253a259a886907999d0e363",
"score": "0.5930482",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n @events = Event.event_list\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "49a83e79eafe216f3bfbcf217788c6c3",
"score": "0.592945",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to host_event_path(current_host.id, @event.id), notice: \"Event was successfully updated.\" }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.5929423",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.5929423",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.5929423",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.5929423",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.5929423",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.5929423",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.5929423",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.5929423",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa5a2dc012270e7e0e76a4d988f4fde8",
"score": "0.59284633",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42af8cad338d1a0fb6a141a290d5c02d",
"score": "0.59228164",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to \"/events\", :notice => 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29aec7fa4944a6d95794f1a012be75ff",
"score": "0.5921499",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event}\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29aec7fa4944a6d95794f1a012be75ff",
"score": "0.5921499",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event}\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c62ac3138d49f99a5a8e1317a5d09115",
"score": "0.5921486",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: t('events.update_success.') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "248bd87e1d19021d8624efcda2373ffd",
"score": "0.59203905",
"text": "def update\n \t\n \tif @post.update_attributes(post_params)\n \t\trender json: @post\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n \n end",
"title": ""
},
{
"docid": "1c522d393f2acb36d4e2d8421240ab6f",
"score": "0.59193516",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a726e122c8039fa5cc7048e89925751f",
"score": "0.5912181",
"text": "def update\n if @post.update(post_params)\n render json: @post\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "682879677069b4d842171409a74dbfcd",
"score": "0.59067523",
"text": "def update\n respond_to do |format|\n if @push_event.update(push_event_params)\n format.html { redirect_to @push_event, notice: 'Push event was successfully updated.' }\n format.json { render :show, status: :ok, location: @push_event }\n else\n format.html { render :edit }\n format.json { render json: @push_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "97d2c5b9c4e3c71627a27f59daaf548b",
"score": "0.5906673",
"text": "def update\n @event_document = EventDocument.find(params[:id])\n\n respond_to do |format|\n if @event_document.update_attributes(params[:event_document])\n @event_document.event.touch\n format.html { redirect_to @event_document, notice: 'Event document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6078a73848655e3b0832f5c76640f96a",
"score": "0.5901278",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to root_path, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { redirect_to :back }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4a72dc666e1f382d71bfc05fedbb2c7",
"score": "0.5899835",
"text": "def update\n if @event.update_attributes(params[:event])\n @event\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "b7da086372d0b508e016cbc77c5cc073",
"score": "0.58982575",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.', share: 'sharing_time' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e877cac0684728687cb69ba89a9bce69",
"score": "0.58951825",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to events_path}\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3dcb85e50a745d4930fd9058f06bd9c6",
"score": "0.58945954",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :json => @event }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66ceb4adf993224337e7f0250c392766",
"score": "0.58909976",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52e9e72b37ddfcd52aaf63494e820a52",
"score": "0.5889966",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
5f622f3a5f3faf2beba07bf722b0cff0
|
QUOTING ================================================== Override to return the quoted table name if the database needs it
|
[
{
"docid": "dce6ab3f7ee5dae25c468877069042ff",
"score": "0.7748096",
"text": "def quote_table_name(name)\n name\n end",
"title": ""
}
] |
[
{
"docid": "4bc4004946e6880ea11da5a8f5148785",
"score": "0.8266345",
"text": "def quoted_table_name\n @quoted_table_name ||= \"`#{table_name}`\"\n end",
"title": ""
},
{
"docid": "1feb6f1ccc9025ce4c8b25c024e3af68",
"score": "0.8034182",
"text": "def quoted_table_name\n @_quoted_table_name ||= acts_as_list_class.quoted_table_name\n end",
"title": ""
},
{
"docid": "2f6899cd012e1b9d2533df8a1081924e",
"score": "0.76831836",
"text": "def quote_table_name(name)\n if self.class.valid_table_name?(name)\n name\n else\n \"\\\"#{name}\\\"\"\n end\n end",
"title": ""
},
{
"docid": "6e63b8e743fb6cf515fa0b0f343a52c4",
"score": "0.76546454",
"text": "def quoted_table_name\n case self.connection.adapter_name\n when 'PostgreSQL'\n original_quoted_table_name.downcase\n else\n original_quoted_table_name\n end\n end",
"title": ""
},
{
"docid": "41b38f99b77e31475788fc56d57c639f",
"score": "0.75760174",
"text": "def quote_table_name(table_name)\n relation_class.connection.quote_table_name(table_name)\n end",
"title": ""
},
{
"docid": "6fe7c3ba69ef3e358e9e596c8f32e2ce",
"score": "0.72964114",
"text": "def quote_table_name(name)\n quote_column_name(name)\n end",
"title": ""
},
{
"docid": "032f91dc79791ebdee25f7b58520fe43",
"score": "0.72285",
"text": "def quote_table_name(str)\n str.to_s\n end",
"title": ""
},
{
"docid": "8f486e050a56ddb6eed4307951a0603a",
"score": "0.71726245",
"text": "def quote_table_name(name)\n '[' + name.to_s + ']'\n end",
"title": ""
},
{
"docid": "d3a8c192ff61944f4836d44dd1bef653",
"score": "0.7151237",
"text": "def quote_table_name(table_name)\n quote_column_name(table_name)\n end",
"title": ""
},
{
"docid": "3341ff1bd6ad447739b7aacf47e5b189",
"score": "0.66745096",
"text": "def quote_table_name(name)\n schema, name_part = extract_vertica_identifier_from_name(name.to_s)\n\n unless name_part\n quote_column_name(schema)\n else\n table_name, name_part = extract_vertica_identifier_from_name(name_part)\n \"#{quote_column_name(schema)}.#{quote_column_name(table_name)}\"\n end\n end",
"title": ""
},
{
"docid": "f9e7111bd9a81bf43bb907ce9ab9f7f4",
"score": "0.6673051",
"text": "def table_name=(value)\n @original_table_name = @table_name if defined?(@table_name)\n @table_name = value && value.to_s\n @quoted_table_name = nil\n end",
"title": ""
},
{
"docid": "26a3ef3b9339da4ddbd85a4e8eb45a80",
"score": "0.6611409",
"text": "def qualified(table_name, context:)\n return table_name if table_name['.'].present?\n return table_name if context['.'].blank?\n\n \"#{context.sub(%r{[^.]*$}, '')}#{table_name}\"\n end",
"title": ""
},
{
"docid": "8863de4baec3b4f6c055670ec5c7d2a7",
"score": "0.6598068",
"text": "def quote_schema_table(table)\n schema_utility_dataset.quote_schema_table(table)\n end",
"title": ""
},
{
"docid": "8863de4baec3b4f6c055670ec5c7d2a7",
"score": "0.6598068",
"text": "def quote_schema_table(table)\n schema_utility_dataset.quote_schema_table(table)\n end",
"title": ""
},
{
"docid": "bbdd3321c57dc9aef5273add6ad9cfd5",
"score": "0.6591476",
"text": "def table_name\n if qualified? && meta[:qualified].is_a?(Symbol)\n meta[:qualified]\n else\n source.dataset\n end\n end",
"title": ""
},
{
"docid": "d14c3f90c176e6db2b94912302c13ff0",
"score": "0.6532133",
"text": "def pg_table_name\n table_name\n end",
"title": ""
},
{
"docid": "db1857d3ef89211f19a03db076ef28ff",
"score": "0.6428719",
"text": "def quoted_schema\n Squirm.quote_ident schema\n end",
"title": ""
},
{
"docid": "6f12c35ddb8f04f84c8fe3c4b10cc96b",
"score": "0.64085466",
"text": "def namespaced_table_name\n [self.class.table_namespace, table_name].reject {|s| s.nil? || s.empty?}.join('-')\n end",
"title": ""
},
{
"docid": "68524474f9d4a06ef3bbe795c9155b14",
"score": "0.63870263",
"text": "def _table_name\n self.class.table_name\n end",
"title": ""
},
{
"docid": "de61553758fae391ff82b1f555604c14",
"score": "0.63455987",
"text": "def pgt_mangled_table_name(table)\n quote_schema_table(table).gsub('\"', '').gsub(/[^A-Za-z0-9]/, '_').gsub(/_+/, '_')\n end",
"title": ""
},
{
"docid": "28ad198ecc858c77a6adad39fd01926c",
"score": "0.63288105",
"text": "def table_name\n @table_name ||= begin\n schema = self.class.schema_name\n table = self.sqltablename.blank? ? \"PS_#{self.recname}\" : self.sqltablename\n [schema, table].compact.join(\".\")\n end\n end",
"title": ""
},
{
"docid": "08a2282eb5d41ecc0fdb0c5fd7911877",
"score": "0.6300522",
"text": "def table_name\n must_be_defined_in_derived_class\n end",
"title": ""
},
{
"docid": "a3ad7994cfeb8579669cbdadcf4e10d9",
"score": "0.6278223",
"text": "def get_table_name\n self.class.table_name\n end",
"title": ""
},
{
"docid": "76838db8a10aa6dc3c945e6e2bdd322d",
"score": "0.6263184",
"text": "def quote_table_or_view(name, options)\n schema = options[:schema]\n if schema\n \"\\\"#{schema}\\\".\\\"#{name}\\\"\"\n else\n \"\\\"#{name}\\\"\"\n end\n end",
"title": ""
},
{
"docid": "9a40069aedd665c15571067af1386fa9",
"score": "0.6233345",
"text": "def real_table_name\n packageid.gsub('.', '_')\n end",
"title": ""
},
{
"docid": "cf82fc6759ab2a7ef5a6a0e8e2dfbc6e",
"score": "0.62317115",
"text": "def quoted_name\n Squirm.quote_ident name\n end",
"title": ""
},
{
"docid": "ce16cd8f21ae7c5a456df50472b1cd4f",
"score": "0.6224864",
"text": "def table_name\n self.class.table_name\n end",
"title": ""
},
{
"docid": "a2f96311fbcf26a138d3f6c886246af3",
"score": "0.6140442",
"text": "def undecorated_table_name(class_name = base_class.name)\n table_name = class_name.to_s.demodulize.underscore\n table_name = table_name.pluralize if pluralize_table_names\n table_name\n end",
"title": ""
},
{
"docid": "6f60ddd3f8d8b6a6cb0395d91aca13cc",
"score": "0.6114429",
"text": "def xas table_name\n if table_name.present?\n as table_name\n else\n self\n end\n end",
"title": ""
},
{
"docid": "0d416f37f934e4d2c5472e2fd7f674b2",
"score": "0.6078738",
"text": "def scoped_table(name)\n table(name).as(\"#{property.name}_#{name}\")\n end",
"title": ""
},
{
"docid": "08c802b58eafa3bb49e2c9f13cad2f11",
"score": "0.6062207",
"text": "def table_name\n @table_name ||= self.class.const_get(class_name).table_name\n end",
"title": ""
},
{
"docid": "0e12dc4b0bedccb29d6ffd0d0321a83e",
"score": "0.60517555",
"text": "def table_name(table_name = nil)\n if table_name\n @table_name = table_name\n else\n @table_name\n end\n end",
"title": ""
},
{
"docid": "ff6852154a2739c86aa25695a3ed9e61",
"score": "0.6043182",
"text": "def table_name\n\t\tself.table_name\n\tend",
"title": ""
},
{
"docid": "a7188b6f6affb9598c90f79e32a802fc",
"score": "0.6002085",
"text": "def table_name(class_name = nil)\n if class_name.nil?\n class_name = class_name_of_active_record_descendant(self)\n table_name_prefix + undecorated_table_name(class_name) + table_name_suffix\n else\n table_name_prefix + undecorated_table_name(class_name) + table_name_suffix\n end\n end",
"title": ""
},
{
"docid": "1a25d03d777aa4d691ff4991c79e8890",
"score": "0.5986005",
"text": "def table_name\n self.class.table_name\n end",
"title": ""
},
{
"docid": "0361f9ed5788646d7c4db35a1e19e0ea",
"score": "0.5978065",
"text": "def compute_table_name\n \"#{full_table_name_prefix}#{undecorated_table_name(name)}#{table_name_suffix}\"\n end",
"title": ""
},
{
"docid": "b86c044adfde94cbf41229bfcd037393",
"score": "0.59667885",
"text": "def tablename; datastore['TABLENAME']; end",
"title": ""
},
{
"docid": "beec572b53c371cc83fcbb94aa196a82",
"score": "0.5949536",
"text": "def table_name\n self.name.split('::').last\n end",
"title": ""
},
{
"docid": "6e58ca54202449e741ae167780056d50",
"score": "0.59441596",
"text": "def from_table_name\r\n owning_class.table_name\r\n end",
"title": ""
},
{
"docid": "965693b9b29b03478b6b831e7a128d87",
"score": "0.5941175",
"text": "def quoted_string; end",
"title": ""
},
{
"docid": "9ec7931383a28db3ffb4924fb32bb62a",
"score": "0.59119844",
"text": "def roomer_set_table_name_prefix\n self.table_name_prefix = begin\n case @roomer_scope\n when :shared\n roomer_full_table_name_prefix(Roomer.shared_schema_name)\n when :tenanted\n roomer_full_table_name_prefix(Roomer.current_tenant.try(Roomer.tenant_schema_name_column))\n else\n \"\"\n end\n end\n end",
"title": ""
},
{
"docid": "09f09b9f61b3ceddc6989476951d8c94",
"score": "0.5885344",
"text": "def table_name\n @table_name ||= (superclass == SmallRecord::Base) ? default_table_name : superclass.table_name\n end",
"title": ""
},
{
"docid": "b2d5328681522999d28bfde14ee794c0",
"score": "0.58792865",
"text": "def qualified(object_name)\n \"#{@database}.#{@owner}.#{object_name}\"\n end",
"title": ""
},
{
"docid": "83dc7f9d452d1e4ff6d5b8a241f8b344",
"score": "0.5870865",
"text": "def unqualified(table_name)\n table_name.split('.').last\n end",
"title": ""
},
{
"docid": "a8bc5c0da7bd8921418436bc3aef10b0",
"score": "0.5857508",
"text": "def table_name_prefix; end",
"title": ""
},
{
"docid": "60bad7ff51d5f7f030195de02fd28eab",
"score": "0.5852389",
"text": "def table_name\n self.class.name.demodulize.tableize\n end",
"title": ""
},
{
"docid": "b08d38be179136c976f0750510014507",
"score": "0.5845012",
"text": "def undecorated_table_name(class_name = class_name_of_active_record_descendant(self))\n table_name = Inflector.underscore(Inflector.demodulize(class_name))\n table_name = Inflector.pluralize(table_name) if pluralize_table_names\n return table_name\n end",
"title": ""
},
{
"docid": "b70057c171a0644558fa00c245312435",
"score": "0.58406943",
"text": "def undecorated_table_name(class_name = base_class.name)\n table_name = Inflector.underscore(Inflector.demodulize(class_name))\n table_name = Inflector.pluralize(table_name) if pluralize_table_names\n table_name\n end",
"title": ""
},
{
"docid": "c786e72252bb0cb067c434a9da593603",
"score": "0.5831014",
"text": "def table_name\n cti_tables ? cti_tables.last : super\n end",
"title": ""
},
{
"docid": "53978cb2a1af5ad4793fa1d91f561c08",
"score": "0.58249307",
"text": "def quote_identifier_append(sql, name)\n name = (table_mappings[name.to_sym] || name) if name.respond_to?(:to_sym)\n super(sql, name)\n end",
"title": ""
},
{
"docid": "d032cab09eda0ada19240f636436002c",
"score": "0.5820908",
"text": "def table_name_prefix(model)\n return model::Base.table_name_prefix rescue \"\"\n end",
"title": ""
},
{
"docid": "fd72f2ee706eef47961cb553cb519ac4",
"score": "0.5810185",
"text": "def quoted_scope(name = nil, type: nil)\n schema, name = extract_schema_qualified_name(name)\n type =\n case type # rubocop:disable Style/HashLikeCase\n when \"BASE TABLE\"\n \"'r','p'\"\n when \"VIEW\"\n \"'v','m'\"\n when \"FOREIGN TABLE\"\n \"'f'\"\n end\n scope = {}\n scope[:schema] = quote(schema || shard.name)\n scope[:name] = quote(name) if name\n scope[:type] = type if type\n scope\n end",
"title": ""
},
{
"docid": "f2387b1ec131503f538ec7be364f63d7",
"score": "0.58028626",
"text": "def quoted\n with_opts(:quoted=>true)\n end",
"title": ""
},
{
"docid": "97f3e4f9c1e97f83834dd69b65e6f464",
"score": "0.579428",
"text": "def quoted(value)\n sql _scope.connection.quote(value)\n end",
"title": ""
},
{
"docid": "97f3e4f9c1e97f83834dd69b65e6f464",
"score": "0.579428",
"text": "def quoted(value)\n sql _scope.connection.quote(value)\n end",
"title": ""
},
{
"docid": "25f7ae0ab49a17263ed5de5a9b86f32b",
"score": "0.57843846",
"text": "def table_alias\r\n @table_alias || from_table_name\r\n end",
"title": ""
},
{
"docid": "ee93569c9e0febccbd197d45d42b409c",
"score": "0.5779702",
"text": "def full_name\n \"#{@table_alias}#{name}\"\n end",
"title": ""
},
{
"docid": "8edc5f6e5b91d25ff207c76141b793dd",
"score": "0.57743925",
"text": "def table\n self.class.table_name\n end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.5772075",
"text": "def quote; end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "9d2c53d51adb2f1bfc2e50bddac43a03",
"score": "0.0",
"text": "def digital_product_params\n params.require(:digital_product).permit(:product_id, :image)\n end",
"title": ""
}
] |
[
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.67419964",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.674013",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6734356",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6591046",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.6502396",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.6496313",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.6480641",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.64565",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.6438387",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.63791263",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.63740575",
"text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"title": ""
},
{
"docid": "9735bbaa391eab421b71a4c1436d109e",
"score": "0.6364131",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.63192815",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.62991166",
"text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.62978333",
"text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.6292148",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6290449",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.6290076",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.62894756",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.6283177",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "1dfca9e0e667b83a9e2312940f7dc40c",
"score": "0.6242471",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.62382483",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6217549",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.6214457",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "b074031c75c664c39575ac306e13028f",
"score": "0.6209053",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.6193042",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.6177802",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.6174604",
"text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"title": ""
},
{
"docid": "7b7196fbaee9e8777af48e4efcaca764",
"score": "0.61714715",
"text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"title": ""
},
{
"docid": "9d589006a5ea3bb58e5649f404ab60fb",
"score": "0.6161512",
"text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"title": ""
},
{
"docid": "d578c7096a9ab2d0edfc431732f63e7f",
"score": "0.6151757",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.6150663",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.61461",
"text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"title": ""
},
{
"docid": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.61213595",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6106206",
"text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.6105114",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6089039",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6081015",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.6071004",
"text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.6019971",
"text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"title": ""
},
{
"docid": "5eaf08f3ad47cc781c4c1a5453555b9c",
"score": "0.601788",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.6011056",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.6010898",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "74c092f6d50c271d51256cf52450605f",
"score": "0.6001556",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.6001049",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.59943926",
"text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "65fa57add93316c7c8c6d8a0b4083d0e",
"score": "0.5992201",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "865a5fdd77ce5687a127e85fc77cd0e7",
"score": "0.59909594",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.5990628",
"text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"title": ""
},
{
"docid": "423b4bad23126b332e80a303c3518a1e",
"score": "0.5980841",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.59669393",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.59589154",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.5958826",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.5957911",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.5957385",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.5953072",
"text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"title": ""
},
{
"docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a",
"score": "0.59526145",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.5943361",
"text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.59386164",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59375334",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59375334",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.5933856",
"text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"title": ""
},
{
"docid": "7fa620eeb32e576da67f175eea6e6fa0",
"score": "0.59292704",
"text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"title": ""
},
{
"docid": "d9483565c400cd4cb1096081599a7afc",
"score": "0.59254247",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.5924164",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.59167904",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.59088355",
"text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.5907542",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.59064597",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.5906243",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.5898226",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.589687",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.5896091",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.5894501",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.5894289",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.5891739",
"text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"title": ""
},
{
"docid": "b85a12ab41643078cb8da859e342acd5",
"score": "0.58860534",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.5882406",
"text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"title": ""
},
{
"docid": "abca6170eec412a7337563085a3a4af2",
"score": "0.587974",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.58738774",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.5869024",
"text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"title": ""
},
{
"docid": "7b7ecfcd484357c3ae3897515fd2931d",
"score": "0.58679986",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.5867561",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.5865932",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.5864461",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.58639693",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.58617616",
"text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"title": ""
},
{
"docid": "e4a29797f9bdada732853b2ce3c1d12a",
"score": "0.5861436",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.5860451",
"text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"title": ""
},
{
"docid": "46cb58d8f18fe71db8662f81ed404ed8",
"score": "0.58602303",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.5854586",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.58537364",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.5850427",
"text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.5850199",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
}
] |
e0ac92721f69dca0e66b4ebf91e5a4b0
|
matches image name with game board value and returns that image name for display purposes
|
[
{
"docid": "a880765a9f087e9fc7f27d449cf68624",
"score": "0.6707001",
"text": "def return_image(tictactoe, num)\n return \"blank.jpg\" if tictactoe.squares[num].value == \"\" || tictactoe.squares[num].value == nil\n return \"x.jpg\" if tictactoe.squares[num].value == \"X\"\n return \"o.jpg\" if tictactoe.squares[num].value == \"O\"\n end",
"title": ""
}
] |
[
{
"docid": "4f5795f18f720fbbbe928727915fe20a",
"score": "0.680581",
"text": "def image_filename_for_match(match)\n sane_name(match.image_filename)\n end",
"title": ""
},
{
"docid": "78ad7e26d7bf941871c1e1e05da58afd",
"score": "0.65978014",
"text": "def image( name )\n @images[name]\n end",
"title": ""
},
{
"docid": "4bd5b972e5c34239ba831cb60f122858",
"score": "0.65942764",
"text": "def images_hadouken player_name\n images = {\n \"helen\"=> 'hadouken_game/media/hadouken/helen_hadouken.png',\n \"mateus\"=> 'hadouken_game/media/hadouken/mateus_hadouken.png',\n \"marisa\"=> 'hadouken_game/media/Hadouken/marisa_hadouken.png',\n \"italo\"=> 'hadouken_game/media/hadouken/italo_hadouken.png',\n \"luciano\"=> 'hadouken_game/media/hadouken/luciano_hadouken.png',\n \"eduardo\"=> 'hadouken_game/media/hadouken/eduardo_hadouken.png',\n \"debora\"=> 'hadouken_game/media/hadouken/debora_hadouken.png',\n \"wendel\"=> 'hadouken_game/media/hadouken/wendell_hadouken.png',\n \"julian\"=> 'hadouken_game/media/julian.jpg',\n \"arisson\"=> 'hadouken_game/media/arisson.png',\n }\n images[player_name]\n end",
"title": ""
},
{
"docid": "4814ec911b18eb33d92a288d5ebf392d",
"score": "0.6542209",
"text": "def image_name\n path = \"sets/#{set}/#{dimension}_#{polarity}_#{verbal}\"\n # Rails.application.assets.find_asset(path).nil? ? 'placeholder' : path\n path\n end",
"title": ""
},
{
"docid": "85971f52e9775e09adb34a4fecf8a525",
"score": "0.65128475",
"text": "def imageName()\n if (@imageName.nil?)\n if (File.exists?(IMAGE_NAME_FILE))\n File.open(IMAGE_NAME_FILE) { |f|\n @imageName = f.read.chomp\n }\n else\n @imageName = 'unknown'\n MObject.warn(\"Can't find '#{IMAGE_NAME_FILE}'\")\n end\n end\n @imageName\n end",
"title": ""
},
{
"docid": "ac48728e0f84b024e8c02d30a0ae0364",
"score": "0.64817756",
"text": "def image\n if File.exists?(self.image_jpg_path)\n \"/assets/game_images/%s.jpg\" %[self.name.dehumanize]\n elsif File.exists?(self.image_png_path)\n \"/assets/game_images/%s.png\" %[self.name.dehumanize]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "9f1f6b6e8e03315f8685692f447bfaa5",
"score": "0.642137",
"text": "def card_image(card_hash)\n \"cards/#{card_hash[0][:name]}_of_#{card_hash[0][:suit]}\"\n end",
"title": ""
},
{
"docid": "c2bc99b0b24a7d25f42799ea39191e22",
"score": "0.63964146",
"text": "def display (card)\n image_name = \"/images/cards/\" + card[0] + \"_\" + card[1] + \".jpg\"\n image_name\n end",
"title": ""
},
{
"docid": "ff5e18307e265d0be85a8cd9a1c778ad",
"score": "0.63831884",
"text": "def get_image_name(index)\n index_string = format('%03d', index)\n image_name = DRAW_LINE_FILE_NAME_PREFIX + index_string + JPG_FILE_SUFFIX\n image_name\n end",
"title": ""
},
{
"docid": "03cb066ee5db244717c82b0c94e78865",
"score": "0.63634783",
"text": "def get_card_image_of(lbl)\r\n index = get_card_index(lbl) \r\n return @cards[index]\r\n end",
"title": ""
},
{
"docid": "499ce9be0c1b3007dc0108263886ea95",
"score": "0.63424563",
"text": "def image_name(extension = true)\n if @image_name.nil? and self.type == LAYER_NORMAL\n name = \"#{self.uid}.png\"\n else\n name = @image_name\n end\n\n if extension\n name\n else\n name.sub(\".png\", \"\")\n end\n end",
"title": ""
},
{
"docid": "8030a6c86130f2ae5b8be71bb17e4a62",
"score": "0.63415694",
"text": "def hangman_image(game_data)\n case game_data.guesses_remaining\n when 5\n 'images/5_remaining.png'\n when 4\n 'images/4_remaining.png'\n when 3\n 'images/3_remaining.png'\n when 2\n 'images/2_remaining.png'\n when 1\n 'images/1_remaining.png'\n end\n end",
"title": ""
},
{
"docid": "3b4c75b09344c418a4c84b2f8e19c966",
"score": "0.6321909",
"text": "def img_name\n \"#{@function}_#{@side.to_s[0,1]}\"\n end",
"title": ""
},
{
"docid": "9f281a64e6799ed3e25285775987a97d",
"score": "0.63186336",
"text": "def image_names(arr)\narr.map{|x|case when x[0]==\"H\" then \"hearts_\"+x[1..2]+\".jpg\"\nwhen x[0]==\"S\" then \"spades_\"+x[1..2]+\".jpg\"\nwhen x[0]==\"C\" then \"clubs_\"+x[1..2]+\".jpg\"\nwhen x[0]==\"D\" then \"diamonds_\"+x[1..2]+\".jpg\"\nend}\nend",
"title": ""
},
{
"docid": "cbe6c2a79021eb2b5955f30b216d2fbc",
"score": "0.6313845",
"text": "def board_id\n dtag = @discriminator ? @discriminator.to_s[0,1]+'_':''\n \"#{dtag}#{self.img_name}\"\n end",
"title": ""
},
{
"docid": "c621c1d28fc8146e9938043ba79c9ea0",
"score": "0.63035953",
"text": "def imageNamed(name)\n sugarcube568_imageNamed(name) || imageNamed_old(name)\n end",
"title": ""
},
{
"docid": "f2927bff3ff0584a27387928e25dfd8a",
"score": "0.6279542",
"text": "def image_name\n image.try(:name)\n end",
"title": ""
},
{
"docid": "43f61679a08610a9ce3e4e2eb7e542d6",
"score": "0.6194012",
"text": "def get_cardfname_of(lbl)\r\n card_info = @deck_information.get_card_info(lbl)\r\n unless card_info \r\n @log.error \"Card filename not found on #{lbl}\"\r\n return\r\n end\r\n position = card_info[:pos] \r\n seed = card_info[:seed_ix]\r\n res = \"%02d_#{@nomi_semi[seed]}.png\" % position\r\n return res\r\n end",
"title": ""
},
{
"docid": "dc236f727488e1f513478e48d76b2e4f",
"score": "0.6192461",
"text": "def named_image(name)\n card = named(name)\n return card['image_uris']['normal']\n end",
"title": ""
},
{
"docid": "91f42ae615b668536534894cfa10896d",
"score": "0.6165007",
"text": "def image_name\n File.basename(image.path || image.filename) if image\n end",
"title": ""
},
{
"docid": "3068549fb7a60260c949d07625b5063e",
"score": "0.61444145",
"text": "def image_name\n setting.data[\"image\"]\n end",
"title": ""
},
{
"docid": "1c0b66f782e9c934abc7f34e42699dfe",
"score": "0.6140633",
"text": "def matchfile\n if search_image\n name_parts = search_image.filename.split('.')\n ext = name_parts.pop\n name = name_parts.join('.')\n return \"#{name}_match.#{ext}\"\n else\n return \"no_search_image.png\"\n end\n end",
"title": ""
},
{
"docid": "2a785c97a1bfe88f6bbf15a7b9807d4c",
"score": "0.6101348",
"text": "def pbBitmapName(x)\n ret = pbResolveBitmap(x)\n return (ret) ? ret : x\nend",
"title": ""
},
{
"docid": "da967f595635af49bcedddda225ab0b2",
"score": "0.60910213",
"text": "def card_images(card)\n suit = case card[0]\n when \"Clubs\" then 'clubs'\n when \"Diamonds\" then 'diamonds'\n when \"Spades\" then 'spades'\n when \"Hearts\" then 'hearts'\n end\n # Values\n value = card[1]\n if ['J', 'Q', 'K', 'A'].include?(value)\n value = case card[1]\n when \"J\" then 'jack'\n when \"Q\" then 'queen'\n when \"K\" then 'king'\n when \"A\" then 'ace'\n end #ends if\n end #ends value\n \"<img src='/images/cards/#{suit}_#{value}.jpg' class='card_display'>\"\n end",
"title": ""
},
{
"docid": "943403f8f3fd7f4010fe77e1d5669b54",
"score": "0.6069538",
"text": "def get_summoner_image(name)\n begin\n query_string = \"SELECT id FROM summoners WHERE name = '#{name}'\"\n query = @@db.query(query_string)\n link = []\n img = query.first['id'].to_s + \".png\"\n return img\n end\n end",
"title": ""
},
{
"docid": "4e3e43a5170886fa7ff2cf0be4a616de",
"score": "0.60647935",
"text": "def show(name)\n @current_image = @files.detect do |path|\n path.basename.to_s.\n sub(/^\\d+-/, '').\n sub(/\\.(?:png|jpg)$/, '') == name.to_s\n end\n end",
"title": ""
},
{
"docid": "28c2f8eec4fcad5872aa60f6e91a1731",
"score": "0.6062731",
"text": "def image_name\n (tarball && @image_name)\n end",
"title": ""
},
{
"docid": "087ce56627e82e373d094921faf036ba",
"score": "0.60258555",
"text": "def pbBitmapName(x)\n ret=pbResolveBitmap(x)\n return (ret) ? ret : x\nend",
"title": ""
},
{
"docid": "5494354bbabbb9ce08214c4d1d5fee33",
"score": "0.6025792",
"text": "def imageNameFromUrl(url,idx)\n ImageFinder.nameForImageFromUrl(url,@start_idx,idx)\n end",
"title": ""
},
{
"docid": "4cd2a3ac4a4d8bbc41c8b3706f64a1f2",
"score": "0.6022139",
"text": "def name_or_filename\n name.blank? ? image_name : name\n end",
"title": ""
},
{
"docid": "526d936fab65cd2e99c4be82668958bc",
"score": "0.601615",
"text": "def find_normal_image\n return \"Pictures/pcn%04d.png\" % (80 + id)\n end",
"title": ""
},
{
"docid": "a217885096acf1cee7c30dcb8e725bc5",
"score": "0.6000902",
"text": "def current_image_filename\n \"#{name.downcase.gsub(' ', '')}certification.png\"\n end",
"title": ""
},
{
"docid": "49c721031dac67f56a3e5a6e78c94c19",
"score": "0.5986029",
"text": "def hangman(count)\n case count\n when 0 then image = \"/images/wrong_0.png\"\n when 1 then image = \"/images/wrong_1.png\"\n when 2 then image = \"/images/wrong_2.png\"\n when 3 then image = \"/images/wrong_3.png\"\n when 4 then image = \"/images/wrong_4.png\"\n when 5 then image = \"/images/wrong_5.png\"\n when 6 then image = \"/images/wrong_6.png\"\n when 7 then image = \"/images/wrong_7.png\"\n when 8 then image = \"/images/wrong_8.png\"\n when 9 then image = \"/images/wrong_9.png\"\n when 10 then image = \"/images/loser.gif\"\n when 11 then image = \"/images/winner.gif\"\n end\nend",
"title": ""
},
{
"docid": "9af7a030f52ba95739a40030c1c1cf6b",
"score": "0.5981352",
"text": "def get_actor_image(id, leader)\n leader = false\n image_filename = leader ? \"Lead\" : \"\"\n \timage_filename += \"Char_\" + id.to_s\n \tCache.UI(image_filename) rescue nil\n end",
"title": ""
},
{
"docid": "bdffbc27835ee8e29ae3a59f3f22b3f3",
"score": "0.59441304",
"text": "def imageNamed(name)\n imageNamed568(name) || imageNamed_old(name)\n end",
"title": ""
},
{
"docid": "1adb1805b1ac73cc5407360d46aee47f",
"score": "0.5901947",
"text": "def find_home_image\n return \"Pictures/pct%04d.png\" % (80 + id)\n end",
"title": ""
},
{
"docid": "9f5e5ae44bef984bfe409a38fa3a3d07",
"score": "0.58886343",
"text": "def file_name\n \"images/#{@name}.msf\"\n end",
"title": ""
},
{
"docid": "970eb14fa75d6ef73f2185e7e4fc8d88",
"score": "0.5885539",
"text": "def image(hash={})\n\t\tif hash['id'] =~ /nsys|Hand|Arm|Leg|Eye|back|abdomen|chest|head|neck/o\n\t\t\tStatus.sf_update(hash['id'], hash['name'])\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9210ce4ebe11194fb2c883c0604776ee",
"score": "0.5873516",
"text": "def name\n (self.title.match(/^(IMG[\\s\\-\\_])?[\\d]+/i) ? \"#{self.photo_collection.name} ##{self.position.to_s}\" : self.title).gsub(/[\\-_]+/,' ').split(/\\s+/).each(&:capitalize!).join(' ')\n end",
"title": ""
},
{
"docid": "a9a966a37de9194e292cb3a7ddabc1ac",
"score": "0.58638406",
"text": "def get_icon\n if @team == \"white\"\n white_icon\n else\n black_icon\n end\n end",
"title": ""
},
{
"docid": "17b63fe20c9ba83aa2df6960cbeb9c28",
"score": "0.585325",
"text": "def image_source_of( piece )\n \"/images/sets/default/#{piece.img_name}.gif\"\n session[:set] ||= 'default'\n path = \"/images/sets/#{session[:set]}/\"\n extension = gif_file_exists?(piece, path) ? \".gif\" : \".png\"\n path + piece.img_name + extension\n end",
"title": ""
},
{
"docid": "b9f7a7c5d19b7c349969908400539433",
"score": "0.5844804",
"text": "def image_name_with_specified_version(version)\n @registry.nil? ? \"#{@name}:#{version}\" : \"#{@registry}/#{@name}:#{version}\"\n end",
"title": ""
},
{
"docid": "ebbf3b74b9e04c2433a2bd1b3468ef19",
"score": "0.5834683",
"text": "def ball_sprite\n return GameData::Item[@captured_with].ball_data&.img || 'ball_1'\n end",
"title": ""
},
{
"docid": "805b7c4be9d7b8367b3c3816c334fa0b",
"score": "0.5798649",
"text": "def choose_image\n \"banners/#{ rand(35) + 1 }.jpg\"\n end",
"title": ""
},
{
"docid": "83772bc2ee067797de45b91422d67f1f",
"score": "0.5791578",
"text": "def pbPokemonBitmapFile(species,shiny,back=false) # Unused\n if shiny\n # Load shiny bitmap\n ret = sprintf(\"Graphics/Battlers/%ss%s\",getConstantName(PBSpecies,species),back ? \"b\" : \"\") rescue nil\n if !pbResolveBitmap(ret)\n ret = sprintf(\"Graphics/Battlers/%03ds%s\",species,(back) ? \"b\" : \"\")\n end\n return ret\n else\n # Load normal bitmap\n ret = sprintf(\"Graphics/Battlers/%s%s\",getConstantName(PBSpecies,species),back ? \"b\" : \"\") rescue nil\n if !pbResolveBitmap(ret)\n ret = sprintf(\"Graphics/Battlers/%03d%s\",species,(back) ? \"b\" : \"\")\n end\n return ret\n end\nend",
"title": ""
},
{
"docid": "4a75ae46f8fe910ae7c83c2bd11409ba",
"score": "0.5784357",
"text": "def name\n @name ||= File.basename(relative_file, '.png')\n end",
"title": ""
},
{
"docid": "654f1e6d48244ce48a45d26c8bf5d9fa",
"score": "0.5783047",
"text": "def image_name\n @image_name || image_bundle.image_name\n end",
"title": ""
},
{
"docid": "f2b68940cfc2dbeeb0a857c65c1de603",
"score": "0.57765573",
"text": "def img_file\n return \"map_\" + symbol.to_s + \"_full\"\n end",
"title": ""
},
{
"docid": "848b7e09aadc33e04d2bfd2096202014",
"score": "0.57660806",
"text": "def get_gif_ref(word)\n word = word.gsub(/[\\^\\:']/,'')\n test_word = word.gsub(/[,.]/, '').downcase\n \"<img src='/images/stats/#{test_word}.gif' style='max-width: 30px;'></img>\"\nend",
"title": ""
},
{
"docid": "cf89e68c002ab15d9f216c2f806b4998",
"score": "0.5763943",
"text": "def default_image\n if instance.platform.name =~ /^(.*)-([^-]*)$/\n \"#{$1}:#{$2}\"\n else\n instance.platform.name\n end\n end",
"title": ""
},
{
"docid": "f4edffad88d5890a4b4afda293b68eb1",
"score": "0.5759449",
"text": "def image(n)\n\t\tif n < 5\n\t\t\treturn 'p'+n.to_s+'.jpg'\n\t\telse\n\t\t\tself.image(n-5)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cf6240f733764eff9541d4c638841498",
"score": "0.5731384",
"text": "def choose_bitmap_in_terms_of_movement\n if @character_name != \"\" && !@character.moving? then\n @character_bitmap_name = @character_name + \"_STATIC\"\n Cache.character(@character_name + \"_STATIC\")\n else\n @character_bitmap_name = @character_name\n Cache.character(@character_name)\n end\n end",
"title": ""
},
{
"docid": "cae2d65077c200fceab794fceb86b13c",
"score": "0.5716224",
"text": "def get_image_name(user_hash)\n image_name = user_hash[\"image\"][:filename]\nend",
"title": ""
},
{
"docid": "ab0d50ee276b04fe6397d78f8b1d9939",
"score": "0.57059807",
"text": "def image_board(color_board) ; @board = color_board ; end",
"title": ""
},
{
"docid": "ab0d50ee276b04fe6397d78f8b1d9939",
"score": "0.57059807",
"text": "def image_board(color_board) ; @board = color_board ; end",
"title": ""
},
{
"docid": "9bf56a83e072de2376105e20f2334abf",
"score": "0.56761605",
"text": "def image_png\r\ndirectory = File.expand_path File.dirname(__FILE__)\r\nspecific_filename = directory + \"/\" + \"Media/shop.png\"\r\nend",
"title": ""
},
{
"docid": "6f73791033e596ad2a55478b15878f93",
"score": "0.567034",
"text": "def get_image(image_name)\n image_res = find_match(@compute.images, image_name)\n image_to_use = (image_res != nil) ? image_res.id : nil\n if image_to_use.nil?\n Puppet.crit \"The image is not found on cloud account!, image_name => #{image_name}\"\n raise Puppet::Error, \"The image is not found on cloud account!, image_name => #{image_name}\"\n else\n Puppet.notice \"Image '#{image_name}' found : '#{image_to_use}'\"\n end\n return image_to_use\n end",
"title": ""
},
{
"docid": "6eb7cef8f5ef287f6ce6a445a42952d0",
"score": "0.5666159",
"text": "def pbTrainerSpriteFile(type)\n return nil if !type\n bitmapFileName = sprintf(\"Graphics/Characters/trainer%s\",getConstantName(PBTrainers,type)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Characters/trainer%03d\",type)\n end\n return bitmapFileName\nend",
"title": ""
},
{
"docid": "14668c89a722c9d47c61eca882fdbe0b",
"score": "0.5665124",
"text": "def show_image\n temp_floor_tile = Image.new('tiles\\tile_floor_1.png')\n hex_width = temp_floor_tile.width - 6\n hex_height = temp_floor_tile.width - 4\n temp_floor_tile.remove\n @hexArray.each_with_index do | line, x |\n bottom_y = hex_height * 11\n y_start = bottom_y - (11 - line.size) * (hex_height / 2)\n line.each_with_index do | hex, y |\n cur_x = x * hex_width\n cur_y = y_start - y * hex_height\n\n case hex.type\n when Hex::FLOOR_TYPE\n Image.new('tiles\\tile_floor_1.png', x:cur_x, y:cur_y)\n when Hex::LAVA_TYPE\n Image.new('tiles\\tile_liquid_1.png', x:cur_x, y:cur_y)\n when Hex::EXIT_TYPE\n Image.new('tiles\\tile_base.png', x:cur_x, y:cur_y)\n Image.new('tiles\\dung_ladderdown.png', x:cur_x, y:cur_y)\n else\n Image.new('tiles\\tile_base.png', x:cur_x, y:cur_y)\n end\n if hex.contained_object != nil && hex.contained_object.type == MovingObject::PLAYER_TYPE\n Image.new('tiles\\player.png', x:cur_x, y:cur_y)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0375cf6899c4d71a59879459d74c73be",
"score": "0.5659999",
"text": "def coin_image_title(filename)\n if /R/.match?(filename)\n \"Reverse\"\n elsif /O/.match?(filename)\n \"Obverse\"\n else\n filename\n end\n end",
"title": ""
},
{
"docid": "18b7b815742b15028d1ad66c37605868",
"score": "0.5658982",
"text": "def image_name(server)\r\n name = instance.platform.name\r\n return name unless server\r\n\r\n # 1:\r\n if server.downcase.start_with? \"https://cloud-images.ubuntu.com\"\r\n info \"Using cloud-image '#{name}'\"\r\n return name.downcase.sub(/^ubuntu-/, \"\")\r\n end\r\n # 2:\r\n if server.downcase.start_with? \"https://images.linuxcontainers.org\"\r\n name = name.downcase.split(\"-\")\r\n # 'core' parses out in this method as the 'version' so just use 'ubuntu-core' in the kitchen.yml\r\n if UBUNTU_RELEASES.key?(name[1]) && name[0] == \"ubuntu\"\r\n name[1] = UBUNTU_RELEASES[name[1]]\r\n name[0] = \"ubuntu-core\" if name[1] == \"16\" # Logic patch for the edge case. We'll do something different if this gets complicated\r\n end\r\n name = name.join(\"/\")\r\n info \"Using standard image #{name}\"\r\n end\r\n name\r\n end",
"title": ""
},
{
"docid": "32d5d98eb38f570213c9c99c919ee32e",
"score": "0.5647208",
"text": "def league_icon(league)\n image = case league\n when \"Bronze\" then \"league_bronze_icon.png\"\n when \"Silver\" then \"league_silver_icon.png\"\n when \"Gold\" then \"league_gold_icon.png\"\n when \"Platinum\" then \"league_platinum_icon.png\"\n when \"Diamond\" then \"league_diamond_icon.png\"\n when \"Master\" then \"league_masters_icon.png\"\n\n # else raise ArgumentError, \"Invalid race\"\n end\n\n image_tag image, class: \"user_league_icon\" if image\n end",
"title": ""
},
{
"docid": "86bfd68121352c388747d93d9629dadb",
"score": "0.5646516",
"text": "def images\n [\n 'crow',\n 'cow',\n 'deer',\n 'monkey',\n 'fish',\n 'frog',\n 'horse',\n 'spider',\n ]\n end",
"title": ""
},
{
"docid": "0e58d8376876844c3e0fe3bd69c6084f",
"score": "0.5643586",
"text": "def image_name=(name)\n self.image = Image.find_by(name: name)\n end",
"title": ""
},
{
"docid": "90b153d7755c38a28ea7507adbd09d16",
"score": "0.56371856",
"text": "def default_name\n \tself.name ||= File.basename(self.image.filename, '.*').titleize if self.image_url\n end",
"title": ""
},
{
"docid": "33e1b7f712a9efb66b64d71c66a9a6c7",
"score": "0.562453",
"text": "def game(name)\n\t\t\traise ArgumentError, 'BGGPlays::game Argument is not string' unless name.is_a? String \n\t\t\t#validates string\n\t\t\tname.to_s\n\t\t\tselect(:bg_name, name)\n\t\tend",
"title": ""
},
{
"docid": "9c45fb0f8162570a301bfaee92ab8f44",
"score": "0.5604833",
"text": "def getFromPixel(color)\n key = Gosu::Image.new(\"Assets/key.png\")\n #Red pixel, therefore it is a block.\n if key.get_pixel(0, 0) == color\n return \"block\"\n end\n #Green pixel, therefore it is a turret.\n if key.get_pixel(0, 1) == color\n return \"turret\"\n end\n #Cyan pixel, therefore it is a wall enemy.\n if key.get_pixel(0, 2) == color\n return \"wall\"\n end\n #Pink pixel, therefore it is a spike enemy.\n if key.get_pixel(0, 3) == color\n return \"spike\"\n end\n #Yellow pixel, therefore it is a xshooter enemy.\n if key.get_pixel(0, 4) == color\n return \"xshooter\"\n end\n #Maroon pixel, therefore it is a charger enemy.\n if key.get_pixel(1, 0) == color\n return \"charger\"\n end\n #Dark Green pixel, therefore it is a missile launcher enemy.\n if key.get_pixel(1, 1) == color\n return \"missile launcher\"\n end\n #Light gray pixel, therefore it is a respawn point.\n if key.get_pixel(4, 2) == color\n return \"exitdoor\"\n end\n #Gray pixel, therefore it is a respawn point.\n if key.get_pixel(4, 3) == color\n return \"respawn\"\n end\n #White pixel, therefore it is a player spawn.\n if key.get_pixel(4, 4) == color\n return \"player\"\n end\n\n return \"none\"\n end",
"title": ""
},
{
"docid": "e75b4aedab26a3f566f4fa318cbedede",
"score": "0.5588307",
"text": "def square_name\n \"#{file}#{rank}\".to_sym\n end",
"title": ""
},
{
"docid": "0c90673192f9d16c197bc59e62677265",
"score": "0.55877215",
"text": "def image_png_path\n \"%s/app/assets/images/game_images/%s.png\" %[Rails.root, self.name.dehumanize]\n end",
"title": ""
},
{
"docid": "558da8217e1fde4a2545011cf0daf393",
"score": "0.55862784",
"text": "def image_filename\n self['image'] || cached_remote_image_url.to_s.split('/').last\n end",
"title": ""
},
{
"docid": "b42ad1f2f17d417c34eb440462f4a93a",
"score": "0.5578343",
"text": "def image_filename\n File.join Img_Store, \"#{id}.#{extension}\"\n end",
"title": ""
},
{
"docid": "64a2f3e9bdc0269ef2dbd4054ba3b335",
"score": "0.5570792",
"text": "def filename\n #\"#{original_filename.split('.').first}.png\" if original_filename\n \"img.#{original_filename.split('.').last}\" if original_filename\n #original_filename if original_filename\n end",
"title": ""
},
{
"docid": "bf2ed04349b5b0e1a8b14414a5c5bf59",
"score": "0.55284435",
"text": "def image_alt(src)\n File.basename(src, '.*').sub(/-[[:xdigit:]]{32,64}\\z/, '').tr('-_', ' ').capitalize\n end",
"title": ""
},
{
"docid": "c2baa52a962c7dbcbd8f9496effed750",
"score": "0.552648",
"text": "def set_normal_image\n self.image_normal = 'pets/' + name.downcase + '.png'\n end",
"title": ""
},
{
"docid": "4fa460a12f7be0d53efce75579b946a6",
"score": "0.55261314",
"text": "def image_file_name\n if job.images_for_jobs.first.is_splitted_image == true\n job.images_for_jobs.first.exact_file_name rescue nil\n else\n job.images_for_jobs.first.filename rescue nil\n end\n end",
"title": ""
},
{
"docid": "3105abdeb8304b6bf3022d34bfbe6015",
"score": "0.5521181",
"text": "def image_gel gel, image_name\n show do\n title \"Image gel #{gel}\"\n check \"Clean the transilluminator with ethanol.\"\n check \"Put the gel #{gel} on the transilluminator.\"\n check \"Turn off the room lights before turning on the transilluminator.\"\n check \"Put the camera hood on, turn on the transilluminator and take a picture using the camera control interface on computer.\"\n check \"Check to see if the picture matches the gel before uploading.\"\n check \"Rename the picture you just took exactly as <b>#{image_name}</b>.\"\n end\n end",
"title": ""
},
{
"docid": "d20f4794b04466d34aebdff339163442",
"score": "0.5520416",
"text": "def image_names\n images.map { |i| i.name }.join(\"|\")\n end",
"title": ""
},
{
"docid": "4c45a5c0db13617d6a9d44e35ce06ec2",
"score": "0.5516298",
"text": "def square_path\n \"s_#{image_path}\"\n end",
"title": ""
},
{
"docid": "205c6685f475789420671ee155593cdf",
"score": "0.55158955",
"text": "def image()\n\t\tActionController::Base.helpers.image_tag(\"holes/Hunter_H%02d\" % self.number + \".jpg\" \\\n\t\t\t, :alt => 'Hole ' % self.number \\\n\t\t\t, :class => 'holeImage'\n\t\t\t)\n\tend",
"title": ""
},
{
"docid": "e081680e1ab09782ac06f95052872d70",
"score": "0.5514023",
"text": "def image_filename(ext)\n return @skin + '/' + ext\n end",
"title": ""
},
{
"docid": "8aea4bf73b8d66d8b3f219c676b0bef7",
"score": "0.5513354",
"text": "def pbTrainerHeadFile(type)\n return nil if !type\n bitmapFileName = sprintf(\"Graphics/Pictures/mapPlayer%s\",getConstantName(PBTrainers,type)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Pictures/mapPlayer%03d\",type)\n end\n return bitmapFileName\nend",
"title": ""
},
{
"docid": "8aea4bf73b8d66d8b3f219c676b0bef7",
"score": "0.5513354",
"text": "def pbTrainerHeadFile(type)\n return nil if !type\n bitmapFileName = sprintf(\"Graphics/Pictures/mapPlayer%s\",getConstantName(PBTrainers,type)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Pictures/mapPlayer%03d\",type)\n end\n return bitmapFileName\nend",
"title": ""
},
{
"docid": "00e81d342448d8bb3c6e4b3d78364e69",
"score": "0.5510075",
"text": "def get_cardsymbolimage_of(lbl)\r\n index = 0\r\n index = SYMBIMAGE_CARD[lbl][:ix] if SYMBIMAGE_CARD[lbl]\r\n return @symbols_card[index]\r\n end",
"title": ""
},
{
"docid": "a453285dd5c9effe7ffcdd4038958948",
"score": "0.55090034",
"text": "def pull_image(value)\n user_hash = pull_records(value)\n id = user_hash[0][\"id\"]\n image_name = user_hash[0][\"image\"]\n image = \"images/uploads/#{id}/#{image_name}\"\nend",
"title": ""
},
{
"docid": "23c7fe24e4333859f6d3d672f606f5fc",
"score": "0.5500309",
"text": "def grid_image\n s = ''\n s << \" %s %s %s \\n\" % [own(256), own(128), own(64)]\n s << \" %s %s %s \\n\" % [own(32), own(16), own(8)]\n s << \" %s %s %s \\n\" % [own(4), own(2), own(1)]\n s\n end",
"title": ""
},
{
"docid": "d69204796e0aea616736f427a0c38992",
"score": "0.54955745",
"text": "def name\n @page = @item/6\n # clean bitmap\n bmp = pbBitmap(@path + @nameImg)\n bitmap = @sprites[\"name\"].bitmap\n bitmap.clear\n bitmap.blt(0, 0, bmp, Rect.new(0,0,320,44))\n # draw text\n text = [\n [@pname, bmp.width/2, -5, 2, Color.white, nil],\n [\"#{@page+1}/#{@pages}\", bmp.width, -5, 0, Color.white, nil]\n ]\n pbDrawTextPositions(bitmap, text)\n bmp.dispose\n end",
"title": ""
},
{
"docid": "a33b4f47d25e6e78bc8b88313f6126ad",
"score": "0.5487055",
"text": "def image_name\n boot_disk = disks.first\n unless boot_disk.is_a?(Disk)\n source = boot_disk[:source]\n match = source.match(%r{/zones/(.*)/disks/(.*)$})\n boot_disk = service.disks.get(match[2], match[1])\n end\n boot_disk.source_image.nil? ? nil : boot_disk.source_image\n end",
"title": ""
},
{
"docid": "aa78fe03800b1a20f0e686e9d18f6829",
"score": "0.5461201",
"text": "def bmp_filename\n 'hall_of_fame/type_window'\n end",
"title": ""
},
{
"docid": "aa78fe03800b1a20f0e686e9d18f6829",
"score": "0.5461201",
"text": "def bmp_filename\n 'hall_of_fame/type_window'\n end",
"title": ""
},
{
"docid": "d5ec2dc053f99bc459129b12939c90e6",
"score": "0.54597944",
"text": "def get_image_fname(spec, img_idx)\n if spec.use_original_filenames\n fname = @bridge.get_image_filename(img_idx).dup\n fname << \".jpg\" unless fname =~ /\\.(jpe|jpg|jpeg)$/i\n else\n fname = \"IMG_#{img_idx}.jpg\"\n end\n fname = append_fname_suffix(fname, \"@2x\") if spec.highDPI\n\n fname\n end",
"title": ""
},
{
"docid": "d5ec2dc053f99bc459129b12939c90e6",
"score": "0.54597944",
"text": "def get_image_fname(spec, img_idx)\n if spec.use_original_filenames\n fname = @bridge.get_image_filename(img_idx).dup\n fname << \".jpg\" unless fname =~ /\\.(jpe|jpg|jpeg)$/i\n else\n fname = \"IMG_#{img_idx}.jpg\"\n end\n fname = append_fname_suffix(fname, \"@2x\") if spec.highDPI\n\n fname\n end",
"title": ""
},
{
"docid": "db5c102bc2b1b971ad4ecfa7aaa099d2",
"score": "0.5455584",
"text": "def image i\n @logger.debug \"OpenStack: Looking up image '#{i}'\"\n @compute_client.images.find { |x| x.name == i } || raise(\"Couldn't find image: #{i}\")\n end",
"title": ""
},
{
"docid": "6d448ff0e2853bd983166a5e480e1e54",
"score": "0.5455525",
"text": "def image_jpg_path\n \"%s/app/assets/images/game_images/%s.jpg\" %[Rails.root, self.name.dehumanize]\n end",
"title": ""
},
{
"docid": "156d0a8fa1d9138c31ec42ce6bfa6177",
"score": "0.5454589",
"text": "def image(icon_name, opts={})\n icon_name = icon_name.to_s if icon_name.is_a? Symbol\n icon_name = icon_name.gsub(\"_\",\"-\")\n icon_name = icon_name.gsub(\"ios-\", \"ios7-\") if icon_name[0..3] == \"ios-\"\n color = opts[:color].nil? ? :black.uicolor : opts[:color]\n color = color_from_string(color) if color.is_a? String\n return \"512/#{icon_name}.png\".uiimage.overlay(color)\n end",
"title": ""
},
{
"docid": "4ce8c1884dbf14a404cf5bf0f831e2b4",
"score": "0.54405516",
"text": "def smart_map_image_url map\n if url_responsive? map.image\n map.image\n else\n url = \"http://image.www.gametracker.com/images/maps/160x120/tf2/#{map.name}.jpg\"\n if url_responsive? url\n url\n else\n \"unkown_image.jpg\"\n end\n end\n end",
"title": ""
},
{
"docid": "85f83e84009756e40f32dbb85f2c6150",
"score": "0.543998",
"text": "def image_board\n\t\t(0...@width).map do |i|\n\t\t\t(0...@height).map do |j|\n\t\t\t\t# ([1]*3+[0]*7)[rand 10]\n\t\t\t\trand 2\n\n\n\t\t\t\t# rand 2\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "de89b19b350dc61f3698433d91710de0",
"score": "0.5436755",
"text": "def pbTrainerSpriteFile(type)\n return nil if !type\n bitmapFileName = sprintf(\"Graphics/Trainers/trainer%s\",\n getConstantName(PBTrainers,type)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Trainers/trainer%03d\",type)\n end\n return bitmapFileName\nend",
"title": ""
},
{
"docid": "c2758ff85399517123193684be22517c",
"score": "0.5434899",
"text": "def main()\n \n for i in 0...$enemy_info.length do\n \n EditImage(\n $enemy_info[i][0],\n $enemy_info[i][2][0],\n $enemy_info[i][2][1],\n $enemy_info[i][2][2],\n $enemy_info[i][2][3],\n $enemy_info[i][3]\n )\n \n end \n\n\nend",
"title": ""
},
{
"docid": "186dc8d67edf14bcfd71af00ea8c11c4",
"score": "0.5434644",
"text": "def filename\n \"vehicle.png\" if original_filename\n end",
"title": ""
},
{
"docid": "7655973436e2cc55743cf98b4e1b2332",
"score": "0.5422582",
"text": "def map_image(map = nil)\n map ? image_tag(\"maps/#{map}_thumb.jpg\") : image_tag('maps/unknown.jpg')\n end",
"title": ""
}
] |
40336a0a760be2a5346b33fcb6f9a563
|
apps:create [NAME] create a new app addons ADDONS a commadelimited list of addons to install b, buildpack BUILDPACK a buildpack url to use for this app n, noremote don't create a git remote r, remote REMOTE the git remote to create, default "pebbles" sshgit Use SSH git protocol httpgit HIDDEN: Use HTTP git protocol Examples: $ pebbles apps:create Creating floatingdragon42... done, stack is cedar | specify a name $ pebbles apps:create example Creating example... done, stack is cedar | create a staging app $ pebbles apps:create examplestaging remote staging
|
[
{
"docid": "1b370177ccc7edf288cca841f06f0564",
"score": "0.778766",
"text": "def create\n name = shift_argument || options[:app] || ENV['PEBBLES_APP']\n validate_arguments!\n\n params = {\n \"name\" => name,\n }\n\n info = api.post_app(params).body\n\n begin\n action(\"Creating #{info['name']}\") do\n if info['create_status'] == 'creating'\n Timeout::timeout(options[:timeout].to_i) do\n loop do\n break if api.get_app(info['name']).body['create_status'] == 'complete'\n sleep 1\n end\n end\n end\n end\n\n # (options[:addons] || \"\").split(\",\").each do |addon|\n # addon.strip!\n # action(\"Adding #{addon} to #{info[\"name\"]}\") do\n # api.post_addon(info[\"name\"], addon)\n # end\n # end\n\n if buildpack = options[:buildpack]\n api.put_config_vars(info[\"name\"], \"BUILDPACK_URL\" => buildpack)\n display(\"BUILDPACK_URL=#{buildpack}\")\n end\n\n hputs([ info[\"web_url\"], git_url(info['name']) ].join(\" | \"))\n rescue Timeout::Error\n hputs(\"Timed Out! Run `pebbles status` to check for known platform issues.\")\n end\n\n unless options[:no_remote].is_a? FalseClass\n create_git_remote(options[:remote] || \"pebbles\", git_url(info['name']))\n end\n end",
"title": ""
}
] |
[
{
"docid": "777a5542c43819f8ef2b8603be802e4d",
"score": "0.7444335",
"text": "def create\n remote = extract_option('--remote', 'heroku')\n stack = extract_option('--stack', 'aspen-mri-1.8.6')\n timeout = extract_option('--timeout', 30).to_i\n name = shift_argument\n validate_arguments!\n\n info = api.post_app({ \"name\" => name, \"stack\" => stack }).body\n hprint(\"Creating #{info[\"name\"]}...\")\n begin\n if info[\"create_status\"] == \"creating\"\n Timeout::timeout(timeout) do\n loop do\n break if heroku.create_complete?(info[\"name\"])\n hprint(\".\")\n sleep 1\n end\n end\n end\n hputs(\" done, stack is #{info[\"stack\"]}\")\n\n (options[:addons] || \"\").split(\",\").each do |addon|\n addon.strip!\n action(\"Adding #{addon} to #{info[\"name\"]}\") do\n api.post_addon(name, addon)\n end\n end\n\n if buildpack = options[:buildpack]\n api.put_config_vars(name, \"BUILDPACK_URL\" => buildpack)\n display(\"BUILDPACK_URL=#{buildpack}\")\n end\n\n hputs([ info[\"web_url\"], info[\"git_url\"] ].join(\" | \"))\n rescue Timeout::Error\n hputs(\"Timed Out! Check heroku status for known issues.\")\n end\n\n create_git_remote(remote || \"heroku\", info[\"git_url\"])\n end",
"title": ""
},
{
"docid": "defc4b02fbc681463d63a704aff7c717",
"score": "0.7310896",
"text": "def create\n name = shift_argument || options[:app] || ENV['HEROKU_APP']\n no_remote = !options[:no_remote].nil?\n remote = options[:remote]\n remote = \"heroku\" if remote == nil\n addons = options[:addons]\n password = options[:password]\n password = newpass if password == nil\n opts = \"\"\n if no_remote\n opts = opts + \"--no-remote \"\n else\n opts = opts + \"--remote #{remote}\"\n end\n opts = opts + \"--addons #{addons}\" unless addons.nil?\n system \"heroku apps:create #{name} #{opts} --stack cedar --buildpack http://github.com/heathprovost/openbd-heroku.git\"\n system \"heroku config:set OPENBD_PASSWORD=#{password} --app #{name}\"\n system \"heroku labs:enable user-env-compile --app #{name}\"\n end",
"title": ""
},
{
"docid": "96e56c32920944c7967e3a9cdcfd2db0",
"score": "0.71051854",
"text": "def create\n addon = args.shift\n raise CommandFailed.new(\"Missing add-on name\") if addon.nil? || %w{--fork --follow --rollback}.include?(addon)\n config = parse_options(args)\n\n addon = api.request(\n :body => json_encode({\n \"attachment\" => { \"name\" => options[:as] },\n \"config\" => config,\n \"name\" => options[:name],\n \"confirm\" => options[:confirm],\n \"plan\" => { \"name\" => addon }\n }),\n :expects => 201,\n :headers => { \"Accept\" => \"application/vnd.heroku+json; version=edge\" },\n :method => :post,\n :path => \"/apps/#{app}/addons\"\n ).body\n\n action(\"Creating #{addon['name'].downcase}\") {}\n action(\"Adding #{addon['name'].downcase} to #{app}\") {}\n action(\"Setting #{addon['config_vars'].join(', ')} and restarting #{app}\") do\n @status = api.get_release(app, 'current').body['name']\n end\n\n #display resource['provider_data']['message'] unless resource['provider_data']['message'].strip == \"\"\n\n display(\"Use `heroku addons:docs #{addon['plan']['name'].split(':').first}` to view documentation.\")\n end",
"title": ""
},
{
"docid": "25d5cc67e217799a42de4377ee90fa58",
"score": "0.6856607",
"text": "def create\n if current_command == \"addons:add\"\n deprecate(\"`heroku #{current_command}` has been deprecated. Please use `heroku addons:create` instead.\")\n end\n\n requires_preauth\n\n service_plan = expand_hpg_shorthand(args.shift)\n\n raise CommandFailed.new(\"Missing requested service or plan\") if service_plan.nil? || %w{--fork --follow --rollback}.include?(service_plan)\n\n config = parse_options(args)\n raise CommandFailed.new(\"Unexpected arguments: #{args.join(' ')}\") unless args.empty?\n\n addon = request(\n :body => json_encode({\n \"attachment\" => { \"name\" => options[:as] },\n \"config\" => config,\n \"name\" => options[:name],\n \"confirm\" => options[:confirm],\n \"plan\" => { \"name\" => service_plan }\n }),\n :headers => {\n # Temporary hack for getting provider messages while a cleaner\n # endpoint is designed to communicate this data.\n #\n # WARNING: Do not depend on this having any effect permanently.\n \"Accept-Expansion\" => \"plan\",\n \"X-Heroku-Legacy-Provider-Messages\" => \"true\"\n },\n :expects => 201,\n :method => :post,\n :path => \"/apps/#{app}/addons\"\n )\n @status = \"(#{format_price addon['plan']['price']})\" if addon['plan'].has_key?('price')\n\n action(\"Creating #{addon['name'].downcase}\") {}\n action(\"Adding #{addon['name'].downcase} to #{app}\") {}\n\n if addon['config_vars'].any?\n action(\"Setting #{addon['config_vars'].join(', ')} and restarting #{app}\") do\n @status = api.get_release(app, 'current').body['name']\n end\n end\n\n display addon['provision_message'] unless addon['provision_message'].to_s.strip == \"\"\n\n display(\"Use `heroku addons:docs #{addon['addon_service']['name']}` to view documentation.\")\n end",
"title": ""
},
{
"docid": "8c1aeaea208fda537ee4557819eb6a25",
"score": "0.68408734",
"text": "def create\n server = Chaos::Server.new \"ssh://#{options[:server]}\"\n server.ask_user_password unless server.password?\n\n name = options[:name] || File.basename(Dir.pwd)\n app = Chaos::App.new name, server\n\n display_ \"Create app '#{app}' on '#{app.server}'...\", :topic\n app.create\n\n display_ \"Done.\", :topic\n if File.basename(Dir.pwd) == app.name\n if Dir.exist?('.git') && !app.server.host.nil? && !app.git.nil?\n if system \"git remote add #{app.server} git@#{app.server}:#{app}.git > /dev/null 2>&1\"\n display_ \"Git remote added to the current directory ('git push #{app.server} master' to deploy)\"\n end\n end\n end\n display_ \"* Git : #{app.git}\"\n display_ \"* Url : #{app.http}\"\n end",
"title": ""
},
{
"docid": "9fbe10031fc6558a1eca79390eea0577",
"score": "0.6653878",
"text": "def create\n name = shift_argument || options[:app] || ENV['HEROKU_APP']\n validate_arguments!\n options[:ignore_no_org] = true\n validate_space_xor_org!\n\n params = {\n \"name\" => name,\n \"region\" => options[:region],\n \"space\" => options[:space],\n \"stack\" => Heroku::Command::Stack::Codex.in(options[:stack]),\n \"kernel\" => options[:kernel],\n \"locked\" => options[:locked]\n }\n\n info = if options[:space]\n api.post_organizations_app_v3(params).body\n elsif org\n org_api.post_app(params, org).body\n else\n api.post_app(params).body\n end\n\n begin\n action(\"Creating #{info['name']}\", app_in_msg_opts) do\n if info['create_status'] == 'creating'\n Timeout::timeout(options[:timeout].to_i) do\n loop do\n break if api.get_app(info['name']).body['create_status'] == 'complete'\n sleep 1\n end\n end\n end\n if options[:region]\n status(\"region is #{region_from_app(info)}\")\n else\n stack = (info['stack'].is_a?(Hash) ? info['stack'][\"name\"] : info['stack'])\n status(\"stack is #{Heroku::Command::Stack::Codex.out(stack)}\")\n end\n end\n\n (options[:addons] || \"\").split(\",\").each do |addon|\n addon.strip!\n action(\"Adding #{addon} to #{info[\"name\"]}\") do\n api.post_addon(info[\"name\"], addon)\n end\n end\n\n if buildpack = options[:buildpack]\n api.put_app_buildpacks_v3(info['name'], {:updates => [{:buildpack => buildpack}]})\n display \"Buildpack set. Next release on #{info['name']} will use #{buildpack}.\"\n end\n\n hputs([ info[\"web_url\"], git_url(info['name']) ].join(\" | \"))\n rescue Timeout::Error\n hputs(\"Timed Out! Run `heroku status` to check for known platform issues.\")\n end\n\n unless options[:no_remote].is_a? FalseClass\n create_git_remote(options[:remote] || \"heroku\", git_url(info['name']))\n end\n end",
"title": ""
},
{
"docid": "aadeae0a77e69b2bbd68b31d3e4ad631",
"score": "0.6550336",
"text": "def create(app_id_or_app_name, body = {})\n @client.addon.create(app_id_or_app_name, body)\n end",
"title": ""
},
{
"docid": "947a787d1199fbe984b79726fbf175c9",
"score": "0.65392935",
"text": "def create_repo\n builder.run \"hub create #{organization}/#{app_name}\"\n end",
"title": ""
},
{
"docid": "17f036d34b187937c408829e77e737ea",
"score": "0.6452642",
"text": "def create(app_id_or_app_name, body)\n @client.addon.create(app_id_or_app_name, body)\n end",
"title": ""
},
{
"docid": "7ed9a9fce6a1bb9b03d93ea5084cba38",
"score": "0.6444345",
"text": "def setup\n create.each do |(app, name)|\n create_git_remote(name, \"git@heroku.com:#{app}.git\")\n end\n end",
"title": ""
},
{
"docid": "c04861d9d38f4e0af2def09e9cb658ea",
"score": "0.6407391",
"text": "def provision\n base_name = args.shift\n\n unless base_name\n error('Do you need help finding a cabbage name? https://en.wikipedia.org/wiki/Cruciferous_vegetables#List_of_cruciferous_vegetables')\n end\n\n http_hook = options[:hook]\n continue_on_error = options[:continue_on_error]\n\n message = []\n n = 0\n message << 'This action will:'\n message << ''\n message << \"#{n += 1}. Install heroku-pipelines addon\" unless pipelines_installed?\n message << \"#{n += 1}. Create the Heroku apps #{app_names_to_create(base_name)} in pipeline #{base_name}\"\n message << \"#{n += 1}. Add email deploy hook for #{DEPLOY_EMAIL_RECIPIENTS}\"\n message << \"#{n += 1}. Add http deploy hook #{http_hook}\" if http_hook\n message << \"#{n += 1}. Set the config value for DEPLOY_ENV\"\n message << ''\n message << 'Are you sure you want to continue? (y/n)'\n return unless confirm(message.join(\"\\n\"))\n\n install_pipelines\n\n KAPOST_ENVS.each.with_index do |env, index|\n heroku_name = \"#{base_name}-#{env[:name]}c\"\n\n begin\n create_heroku_app(heroku_name)\n create_heroku_hooks(base_name, heroku_name, env[:name], http_hook)\n create_heroku_default_config(heroku_name, env[:config])\n add_app_to_pipeline(base_name, heroku_name, env[:pipeline_stage], index == 0)\n rescue Heroku::Command::CommandFailed => ex\n if continue_on_error\n puts ex.message\n puts \"Continuing to next env...\"\n else\n raise ex\n end\n end\n end\n end",
"title": ""
},
{
"docid": "57fe43141c9952c90690c7503fc39c97",
"score": "0.6260116",
"text": "def add\n action \"Modifying buildpacks for #{app}\" do\n buildpack_url = buildpack_url_for(shift_argument)\n system \"heroku buildpacks:add #{buildpack_url} -a #{app}\"\n end\n end",
"title": ""
},
{
"docid": "2453466b6f6f2ec62758b0fe6734762f",
"score": "0.6166336",
"text": "def create_app name\n data = {\n 'name' => name,\n 'owner_name' => username,\n }.to_json\n\n try_json post('/app', data)\n end",
"title": ""
},
{
"docid": "2143f091b7172f9682a905750d3f3413",
"score": "0.6155714",
"text": "def add\n unless addon = args.shift\n error(\"Usage: heroku addons:add ADDON\\nMust specify ADDON to add.\")\n end\n addon = addon.dup.sub('@', '')\n\n msg = options[:name] ?\n \"Adding #{addon} as #{options[:name]} to #{app}\" :\n \"Adding #{addon} to #{app}\"\n\n display(\"#{msg}... \", false)\n\n response = api.request(\n :body => json_encode({\n \"app\" => {\"name\" => app},\n \"addon\" => {\"name\" => addon},\n \"confirm\" => options[:confirm],\n \"name\" => options[:name]\n }),\n :expects => [201, 422],\n :headers => { \"Accept\" => \"application/vnd.heroku+json; version=edge\" },\n :method => :post,\n :path => \"/addon-attachments\"\n )\n\n case response.status\n when 201\n display(\"done\")\n action(\"Setting #{response.body[\"name\"]} vars and restarting #{app}\") do\n @status = api.get_release(app, 'current').body['name']\n end\n when 422 # add-on resource not found, should probably be 404\n display(\"failed\")\n output_with_bang(\"Add-on resource `#{addon}` not found.\")\n output_with_bang(\"List available resources with `heroku addons`.\")\n output_with_bang(\"Provision a new add-on resource with `heroku addons:create #{options[:name]}`.\")\n end\n end",
"title": ""
},
{
"docid": "752d11ee25b03ef0b401bea4b1099b48",
"score": "0.6145481",
"text": "def create_app\n post_app('name' => app_name)\n end",
"title": ""
},
{
"docid": "730864ebfaec0e36ba266bd0ab33748a",
"score": "0.6130355",
"text": "def create(name, cartridges)\n cartridge = check_cartridges(cartridges).first\n\n options.default \\\n :dns => true,\n :git => true\n\n header \"Creating application '#{name}'\"\n paragraph do\n table({\"Namespace:\" => options.namespace,\n \"Cartridge:\" => cartridge,\n \"Gear Size:\" => options.gear_size || \"default\",\n \"Scaling:\" => options.scaling ? \"yes\" : \"no\",\n }\n ).each { |s| say \" #{s}\" }\n end\n\n raise RHC::DomainNotFoundException.new(\"No domains found. Please create a domain with 'rhc domain create <namespace>' before creating applications.\") if rest_client.domains.empty?\n\n rest_domain = rest_client.find_domain(options.namespace)\n\n # check to make sure the right options are set for enabling jenkins\n jenkins_rest_app = check_jenkins(name, rest_domain) if enable_jenkins?\n\n # create the main app\n rest_app = create_app(name, cartridge, rest_domain,\n options.gear_size, options.scaling)\n\n # create a jenkins app if not available\n # don't error out if there are issues, setup warnings instead\n begin\n jenkins_rest_app = setup_jenkins_app(rest_domain) if enable_jenkins? and jenkins_rest_app.nil?\n rescue Exception => e\n add_issue(\"Jenkins failed to install - #{e}\",\n \"Installing jenkins and jenkins-client\",\n \"rhc app create jenkins\",\n \"rhc cartridge add jenkins-client -a #{rest_app.name}\")\n end\n\n if jenkins_rest_app\n success, attempts, exit_code, exit_message = false, 1, 157, nil\n while (!success && exit_code == 157 && attempts < MAX_RETRIES)\n begin\n setup_jenkins_client(rest_app)\n success = true\n rescue RHC::Rest::ServerErrorException => e\n if (e.code == 157)\n # error downloading Jenkins /jnlpJars/jenkins-cli.jar\n attempts += 1\n debug \"Jenkins server could not be contacted, sleep and then retry: attempt #{attempts}\\n #{e.message}\"\n Kernel.sleep(10)\n end\n exit_code = e.code\n exit_message = e.message\n rescue Exception => e\n # timeout and other exceptions\n exit_code = 1\n exit_message = e.message\n end\n end\n add_issue(\"Jenkins client failed to install - #{exit_message}\",\n \"Install the jenkins client\",\n \"rhc cartridge add jenkins-client -a #{rest_app.name}\") if !success\n end\n\n if options.dns\n say \"Your application's domain name is being propagated worldwide (this might take a minute)...\"\n unless dns_propagated? rest_app.host\n add_issue(\"We were unable to lookup your hostname (#{rest_app.host}) in a reasonable amount of time and can not clone your application.\",\n \"Clone your git repo\",\n \"rhc app git-clone #{rest_app.name}\")\n\n output_issues(rest_app)\n return 0\n end\n\n if options.git\n begin\n run_git_clone(rest_app)\n rescue RHC::GitException => e\n warn \"#{e}\"\n unless RHC::Helpers.windows? and windows_nslookup_bug?(rest_app)\n add_issue(\"We were unable to clone your application's git repo - #{e}\",\n \"Clone your git repo\",\n \"rhc app git-clone #{rest_app.name}\")\n end\n end\n end\n end\n\n display_app(rest_app, rest_app.cartridges, rest_app.scalable_carts.first)\n\n if issues?\n output_issues(rest_app)\n else\n results { \n rest_app.messages.each { |msg| say msg } \n jenkins_rest_app.messages.each { |msg| say msg } if enable_jenkins? and jenkins_rest_app\n }\n end\n\n 0\n end",
"title": ""
},
{
"docid": "09fbc94c33a51f8123b1a1aee29d7d79",
"score": "0.6033724",
"text": "def create(url)\n CCProcess.start(\"sdk-manage --tooling --install '#{@name}' '#{url}'\", (_ :adding_tooling) + \" #{@name}\", 60*60, 1)\n end",
"title": ""
},
{
"docid": "b76d987b01a46866065af0c6030156bd",
"score": "0.601066",
"text": "def addApplication(appName, appURL, appPorts) \n # - - - - - - - - - - - - - - - - - - - - - - - -\n # Check for errors:\n if appName.nil?\n @put.error \"Define a name to create this application\"\n exit\n end\n if appURL.nil?\n @put.error \"Define an URL to create this application\"\n exit\n end\n if appPorts.nil?\n appPorts = 1\n end\n unless @apps[appName].nil?\n @put.error \"There is already an app with this name\"\n exit\n end\n # - - - - - - - - - - - - - - - - - - - - - - - -\n print \"\\n#{@cya}Creating application '#{appName}'\\n\"\n puts \"-\" * (appName.length + 21)\n # - - - - - - - - - - - - - - - - - - - - - - - -\n # Create empty application:\n @apps[appName] = Hash.new\n @apps[appName][\"name\"] = appName\n @apps[appName][\"directory\"] = appName\n @apps[appName][\"url\"] = appURL # application dns - Test with an array\n @apps[appName][\"ports\"] = [] # thin ports\n @apps[appName][\"repository\"] = false # repository created\n @apps[appName][\"thin\"] = false # thin configuration\n @apps[appName][\"available\"] = false # nginx available config\n @apps[appName][\"enabled\"] = false # nginx enabled config\n @apps[appName][\"db\"] = false # existing database\n @apps[appName][\"dbname\"] = nil # database name\n @apps[appName][\"adapter\"] = nil # database adapter\n @apps[appName][\"backup\"] = nil # database last backup date\n @apps[appName][\"online\"] = false # online\n @apps[appName][\"update\"] = true # must update thin and nginx files\n # - - - - - - - - - - - - - - - - - - - - - - - -\n # Set git repository for deployment:\n appPorts.to_i.times { @apps[appName][\"ports\"].push(0) }\n setNewApplicationsPorts\n\n success = @git.createRepository(appName)\n unless success == 1\n @apps[appName][\"repository\"] = true\n saveData\n else\n exit\n end\n success = @git.cloneRepository(appName)\n if success == 1\n exit\n end\n @put.green \"Your application's repository is ready.\"\n showGitRemote(appName)\n print \"\\n\"\n end",
"title": ""
},
{
"docid": "fc2a57b96aa48019311baf5d7aff5cf2",
"score": "0.6005008",
"text": "def create_app name, template\n\t\t\tdata = {\n\t\t\t\t'name' => name,\n\t\t\t\t'template' => template,\n\n\t\t\t\t'token' => auth_token,\n\t\t\t}.to_json\n\n\t\t\tJSON.parse(post('/apps.json', data).body) rescue nil\n\t\tend",
"title": ""
},
{
"docid": "7f1108d03348fd16ced93048e3d81511",
"score": "0.59948593",
"text": "def create_app(app_name, db_plan)\n @heroku.app.create(name: app_name, region: { name: \"eu\" })\n @heroku.addon.create(app_name, \"plan\" => \"heroku-postgresql:#{db_plan}\")\n end",
"title": ""
},
{
"docid": "00a75ef1ad57b45ebb4c26b29b9b657b",
"score": "0.5980326",
"text": "def create(args = [])\n app_name = args[0] ? args[0].strip.to_s.downcase : File.basename(current_path)\n symlink_path = \"#{POWPATH}/#{app_name}\"\n unless File.exist?(symlink_path)\n FileUtils.ln_s(current_path, symlink_path)\n $stdout.puts \"Successfully created pow app #{app_name}!\"\n else\n $stdout.puts \"App `#{app_name}` already exists.\"\n $stdout.puts \"Powify skipped to create symlink.\"\n end\n $stdout.puts \"Type `powify browse #{app_name}` to open the application in your browser.\"\n end",
"title": ""
},
{
"docid": "b09d5939d0a400289676cdb2287f246b",
"score": "0.59711444",
"text": "def create_pliveo_app()\n info = {\n \"answer_url\" => build_url(account_id,\"answer\"),\n \"app_name\" => account_id,\n \"hangup_url\" => build_url(account_id,\"hangup\"),\n \"fallback_url\" => build_url(account_id,\"fallback\"),\n \"message_url\" => build_url(account_id,\"message\")\n } \n # plivo call \n c = Plivo::RestAPI.new(AUTH_ID, AUTH_TOKEN)\n r = c.create_application(info)\n logger.info \"APPLICATION CREATE RESPONSE IS #{r.inspect}\"\n\n if r[0] = 201\n # app is created successfully save to database \n logger.info \"created app!\"\n prepare_for_save(info)\n end\n end",
"title": ""
},
{
"docid": "98f87d988b254d3fbed01ade4df94897",
"score": "0.5961326",
"text": "def add\n name = shift_argument || error(\"Must specify a buildpack name\")\n action(\"Adding #{name} to your kit\") do\n begin\n server[\"/user/buildpacks\"].post(:name => name)\n rescue RestClient::ResourceNotFound\n error \"No such buildpack: #{name}\"\n rescue RestClient::Forbidden\n error \"The #{name} buildpack is already in your kit\"\n end\n end\n end",
"title": ""
},
{
"docid": "eb1a4c02d144070dbc69b7cbb98c730a",
"score": "0.59512883",
"text": "def create_app(options)\r\n path = '/apps.json'\r\n data = {}\r\n data[:subdomain] = options[:subdomain]\r\n data[:label] = options[:label]\r\n post(path, data)\r\n end",
"title": ""
},
{
"docid": "0eafb0cb4da1a9de49e009df02c5a62c",
"score": "0.59197927",
"text": "def create_addon(params)\n\t\t\tnew_addon = addons[:new]\n\t\t\tnew_addon[:params].merge!(params)\n\t\t\tpost(new_addon)\n\t\tend",
"title": ""
},
{
"docid": "8507263d1f2f0ac335b6d07c14df2c0b",
"score": "0.5904121",
"text": "def create\n chef_server_rest.post_rest(\"packs\", self)\n self\n end",
"title": ""
},
{
"docid": "c0fecb18a08f0615a2cf0e50f69c8fb1",
"score": "0.5889698",
"text": "def create!(space_guid, name, instances, memory, domain_name, host_name, path, app_services, stack = nil, buildpack, app_id)\n info_ln(\"Pushing app '#{name}' ...\")\n\n app_file_size_MB = (File.size(path) / (1024.0 * 1024)).round(2)\n client_token = @client.base.token\n client_target = @client.base.target\n\n space = @client.space(space_guid)\n\n new_app = @client.app\n new_app.space = space\n new_app.name = name\n new_app.total_instances = instances\n new_app.memory = memory\n new_app.stack = @client.stack_by_name(stack) if stack\n new_app.buildpack = buildpack\n\n if new_app.buildpack\n info(\"Using buildpack <b><a href='#{new_app.buildpack}' target='_blank'>#{new_app.buildpack}</a></b>\")\n end\n\n info(\"Creating app '#{name}' with #{memory}MB memory and #{instances} instances...\")\n\n if new_app.create!\n new_app_guid = new_app.guid\n\n if app_id != \"asp_net_sql_sample\"\n info(\"Uploading bits (#{ app_file_size_MB }MB)...\")\n new_app.upload path\n ok_ln(\"OK\")\n end\n\n info_ln(\"Setting up services ...\")\n\n service_instances = ServiceInstances.new(client_token, client_target)\n\n app_services.each do |service|\n service_name = service[:name]\n\n info(\" Creating service '#{service_name}'.\")\n\n begin\n service_create = service_instances.create_service_by_names(service_name, space_guid, service[:plan] || 'free', service[:type])\n if service_create != false\n if app_id == \"asp_net_sql_sample\"\n value = write_app_config(path, service_create.name)\n\n #write and save the app config file\n File.open(path + \"/Web.config\", \"w\"){ |file| file.write(value.to_s) }\n ok(\"OK\")\n\n info_ln(\"\")\n info_ln(\"Uploading bits (#{ app_file_size_MB }MB)...\")\n new_app.upload path\n end\n\n ok_ln(\"Done\")\n else\n error_ln(\"Failed\")\n warning_ln(\" The service type does not exist.\")\n end\n rescue => ex\n error_ln(\"Failed\")\n warning_ln(\" #{ex.message}\")\n end\n\n\n app = @client.app(new_app_guid)\n\n info(\" Binding service '#{service_name}'.\")\n\n begin\n if service_create != false\n service_bind = service_instances.get_service_by_name(service_name, space_guid)\n app.bind(service_bind)\n ok_ln(\"Done\")\n else\n error_ln(\"Failed\")\n warning_ln(\" The service does not exist\")\n end\n rescue => ex\n error_ln(\"Failed\")\n warning_ln(\" #{ex.message}\")\n end\n end\n\n domain = @client.domains.find { |domain|\n domain.name == domain_name\n }\n\n begin\n info(\"Setting up application route '#{name}.#{domain_name}'...\")\n Library::Routes.new(client_token, client_target).create(new_app_guid, space_guid, domain.guid, host_name)\n ok_ln(\"Done\")\n rescue => ex\n error_ln(\"Failed\")\n warning_ln(\" #{ex.message}\")\n end\n begin\n info_ln(\"Starting the application...\")\n new_app.start! do |response|\n new_app.stream_update_log(response) do |log_entry|\n info_ln(\" #{log_entry.gsub(/\\r/, '').gsub(/\\n/, '<br/>')}\")\n end\n end\n rescue => ex\n error_ln(\"Failed\")\n warning_ln(\" #{ex.message}\")\n end\n end\n ok_ln(\"Complete!\")\n rescue => ex\n error_ln(ex.message)\n end",
"title": ""
},
{
"docid": "af8ecaa1980bb7df3f07ddba700c34d7",
"score": "0.58867633",
"text": "def new_app\n require_gem\n\n color = Thor::Shell::Color.new\n shell = Thor::Shell::Basic.new\n shell.padding = 1\n\n shell.say(\"\\n\")\n\n question = color.set_color('Please enter the name of app you want to create:', :yellow, true)\n \n if application_name = shell.ask(question)\n Playmo::Cookbook.instance.cook_recipes!(application_name, options)\n end\n\n shell.say(\"\\n\")\n\n system \"cd #{application_name} && bundle install\" unless options['dry-run']\n\n Event.events.fire :create_database\n Event.events.fire :install\n Event.events.fire :migrate_database\n Event.events.fire :seed_database\n Event.events.fire :before_exit\n end",
"title": ""
},
{
"docid": "44197956059d910e101dad68b1f4a392",
"score": "0.57755595",
"text": "def create_remote(name, url = 'url')\n `git remote add #{name} #{url}`\nend",
"title": ""
},
{
"docid": "16a56b21f5a78e2acaea0a7242fdeffb",
"score": "0.57680005",
"text": "def create_project(user, project_name, project_desc)\n hub(user, \"create-project #{project_name}\")\n hub(user, \"set-description #{project_name} #{project_desc}\")\nend",
"title": ""
},
{
"docid": "7d2e48f5ac14b413462dd48cbd5c99af",
"score": "0.5765885",
"text": "def create(args)\n # validate arguments\n\n # got arguments\n unless args.empty?\n # TODO: parse_args method\n required_args = ['sitename', 'type']\n # loop given arguments\n used_args = []\n args_hash = Hash.new\n args.each { |argument|\n arg = argument.split('=')\n if arg.length == 2\n # every argument has value, check for required args\n\n # split argument to key value pair\n key = arg[0]\n val = arg[1]\n\n # remove all dashes from beginning of key\n key.sub! /\\A-+/, ''\n # check for duplicate arguments\n if used_args.include?(key)\n puts \"Duplicate arguments\"\n puts CREATE_HELP\n exit\n else\n # keep track of used arguments\n used_args.push(key)\n \n # TODO: validate sitename (only lowercase chars, dashes or numbers)\n\n # set key and value to hash\n args_hash[key]=val\n end\n\n if required_args.include?(key)\n required_args.delete(key)\n end\n\n else\n # argument value missing, exit script and show help\n puts 'Argument '+arg[0]+' needs value'\n puts CREATE_HELP\n exit\n end\n }\n\n if required_args.length == 0\n # all required arguments given, proceed\n else\n # required arguments missing, exit script and show help\n puts \"Arguments required:\"\n puts required_args\n puts CREATE_HELP\n exit\n end\n\n # start creating project\n create_app(args_hash)\n\n else\n # no arguments given, start wizard\n create_wizard()\n\n end\n\n end",
"title": ""
},
{
"docid": "3b8e14e739ba8d11b80cf610a83d51f8",
"score": "0.5762162",
"text": "def create(args)\n # validate arguments\n\n # got arguments\n unless args.empty?\n # TODO: parse_args method\n required_args = ['sitename', 'type']\n # loop given arguments\n used_args = []\n args_hash = Hash.new\n args.each { |argument|\n arg = argument.split('=')\n if arg.length == 2\n # every argument has value, check for required args\n\n # split argument to key value pair\n key = arg[0]\n val = arg[1]\n\n # remove all dashes from beginning of key\n key.sub! /\\A-+/, ''\n # check for duplicate arguments\n if used_args.include?(key)\n puts \"Duplicate arguments\"\n puts CREATE_HELP\n exit\n else\n # keep track of used arguments\n used_args.push(key)\n\n # TODO: validate sitename (only lowercase chars, dashes or numbers)\n\n # set key and value to hash\n args_hash[key]=val\n end\n\n if required_args.include?(key)\n required_args.delete(key)\n end\n\n else\n # argument value missing, exit script and show help\n puts 'Argument '+arg[0]+' needs value'\n puts CREATE_HELP\n exit\n end\n }\n\n if required_args.length == 0\n # all required arguments given, proceed\n else\n # required arguments missing, exit script and show help\n puts \"Arguments required:\"\n puts required_args\n puts CREATE_HELP\n exit\n end\n\n # start creating project\n create_app(args_hash)\n\n else\n # no arguments given, start wizard\n create_wizard()\n\n end\n\n end",
"title": ""
},
{
"docid": "dfea37749ed00fccfd0081913c92db70",
"score": "0.57562995",
"text": "def create!(*args)\n repo, desc, homepage, public = extract args, :repo, :desc, :homepage, :public\n API.ensure_auth\n instantiate post(\"/create\", 'name' => repo, 'description' => desc,\n 'homepage' => homepage, 'public' => (public ? 1 : 0))\n end",
"title": ""
},
{
"docid": "a84b09bc6c12fa9ea0dff6bede7d4b53",
"score": "0.57380766",
"text": "def create_android\n `android create project -t 5 -k #{ @pkg } -a #{ @name } -n #{ @name } -p #{ @path }`\n end",
"title": ""
},
{
"docid": "cf26a824b869f02536161bde52d05156",
"score": "0.57077414",
"text": "def setup\n action \"Modifying BUILDPACK_URL for #{app}\" do\n buildpack_url = buildkit_host + \"/buildkit/#{auth.password}.git\"\n api.put_config_vars app, \"BUILDPACK_URL\" => buildpack_url\n end\n end",
"title": ""
},
{
"docid": "6443f665227f97c6d7adca88716e09d6",
"score": "0.5663668",
"text": "def create\n appctrl_create( 'Project' )\n end",
"title": ""
},
{
"docid": "cc3b1224bf35231268ed3b4767801ab8",
"score": "0.5639261",
"text": "def create\n megam_rest.post_addons(to_hash)\n end",
"title": ""
},
{
"docid": "3ce8762c8b1f130bc4aa934545224b78",
"score": "0.5567241",
"text": "def create(addon_id_or_addon_name, body = {})\n @client.addon_webhook.create(addon_id_or_addon_name, body)\n end",
"title": ""
},
{
"docid": "1b100c8470cd614ff1c7a3e60941778f",
"score": "0.5557206",
"text": "def create!(bundle_id: nil, name: nil, mac: false, enable_services: {})\n if bundle_id.end_with?('*')\n type = :wildcard\n else\n type = :explicit\n end\n\n new_app = client.create_app!(type, name, bundle_id, mac: mac, enable_services: enable_services)\n self.new(new_app)\n end",
"title": ""
},
{
"docid": "1253896019946f307aacd736527dec4b",
"score": "0.55297476",
"text": "def create_android\n target_id = 5\n `android create project -t #{ target_id } -k #{ @pkg } -a #{ @name } -n #{ @name.gsub(' ','') } -p #{ @path }`\n end",
"title": ""
},
{
"docid": "f41343f3b892bdd280eb60838cea2898",
"score": "0.5529063",
"text": "def setup\n original = shift_argument || File.basename(Dir.pwd).tr('_', '-').split('.').first\n apps = []\n basename = [original, original.gsub(/-/, '')].detect do |b|\n apps = get_apps.select {|a| a['name'] =~ /^#{b}(-|$)/}\n apps.any?\n end\n if apps.empty?\n error(\"Couldn't find any apps named #{original} or #{original}-*.\")\n end\n apps.each do |app|\n remote =\n if options[:remote] && app['name'] == basename\n options[:remote]\n elsif options[:full]\n app['name']\n else\n app['name'][basename.length+1..-1] || 'heroku'\n end\n if git('remote').split(\"\\n\").include?(remote)\n display \"Git remote #{remote} already exists\"\n else\n create_git_remote(remote, app['git_url'])\n end\n end\n end",
"title": ""
},
{
"docid": "a02778103c2bfc7a089d9560b302cd73",
"score": "0.5482158",
"text": "def create_api_app(opts)\n HelloSign::Resource::ApiApp.new post('/api_app', :body => opts)\n end",
"title": ""
},
{
"docid": "e6db8de8bdb847b572607e111affaf3e",
"score": "0.5462983",
"text": "def create(*args)\n arguments(args, :required => [:user, :repo]) do\n sift VALID_DEPLOYMENTS_OPTIONS\n assert_required %w[ ref ]\n end\n\n params = arguments.params\n params['accept'] ||= PREVIEW_MEDIA\n\n post_request(\"repos/#{user}/#{repo}/deployments\", params)\n end",
"title": ""
},
{
"docid": "de8347a432582f649cb15667cc7c8075",
"score": "0.54456025",
"text": "def setup!\n return self if @heroku_id\n puts \"Hatchet setup: #{name.inspect} for #{repo_name.inspect}\"\n create_app\n set_labs!\n buildpack_list = @buildpacks.map { |pack| { buildpack: pack } }\n api_rate_limit.call.buildpack_installation.update(name, updates: buildpack_list)\n set_config @app_config\n\n self\n end",
"title": ""
},
{
"docid": "c99d599bd0434cd76e705d3e1a6c77ce",
"score": "0.54327375",
"text": "def create_git\n branchs = ['develop', 'hotfixes', 'release']\n gitlabapi = Apiexternal::Gitlabapi.new\n\n begin\n self.gitlab_id = gitlabapi.create_project(name, gitpath)\n create_rootfolder\n branchs.each {|branch| gitlabapi.create_branch(gitlab_id, branch, 'master')}\n gitlabapi.unprotect_branch(gitlab_id, 'master')\n users.each {|user| gitlabapi.add_user_to_project(gitlab_id, user.gitlab_id, user.access_level)}\n rescue Exceptions::NextDeployException => me\n me.log\n end\n end",
"title": ""
},
{
"docid": "e07b4e498ae302fc07e68fc6ad182fb1",
"score": "0.54292506",
"text": "def create_app(args)\n puts \"Creating application: #{ARGV[1]}\\n\\n\"\n FileUtils.cp_r \"#{BASE}/template/skeleton\", 'miso-skeleton'\n FileUtils.mv 'miso-skeleton', ARGV[1]\n\n # Create web.xml\n web_xml = load_template('web.xml')\n web_xml.gsub!('[[AppName]]', ARGV[1].capitalize).gsub!('[[AppNameLowercase]]', ARGV[1].downcase)\n File.open(\"#{ARGV[1]}/web.xml\", 'w') {|f| f.write(web_xml) }\n \n # Update DB Config\n puts \"Please type the MySQL username to use:\"\n username = STDIN.gets.chomp\n\n puts \"Please type the MySQL password for this user:\"\n password = STDIN.gets.chomp\n \n model = load_file(\"#{ARGV[1]}/app/miso/Model.java\")\n model.gsub!('localhost/miso', \"localhost/#{ARGV[1].downcase}\")\n model.gsub!('url, \"root\", \"\"', 'url, \"'+ username + '\", \"' + password + '\"')\n File.open(\"#{ARGV[1]}/app/miso/Model.java\", 'w') {|f| f.write(model) }\n\n # Update Header Template Paths\n header = load_file(\"#{ARGV[1]}/app/views/includes/header.html\")\n header.gsub!('[[APPNAME]]', \"#{ARGV[1].downcase}\")\n File.open(\"#{ARGV[1]}/app/views/includes/header.html\", 'w') {|f| f.write(header) }\n\n # Generate scripts\n %w(build restart start stop).each { |script| generate_script(script, ARGV[1].downcase) }\n \n puts \"== Hello Miso! Your app is ready.\"\n puts \"Type 'cd #{ARGV[1]}', then 'miso-java' to start building your app!\\n\\n\"\n \n end",
"title": ""
},
{
"docid": "06a329e3daa49026bf61553f67e98773",
"score": "0.5427149",
"text": "def create_project(name, type='cattle')\n swarm = false\n kubernetes = false\n\n case type\n when 'kubernetes'\n kubernetes = true\n when 'swarm'\n swarm = true\n end\n\n data = {\n 'name' => name,\n 'swarm' => swarm,\n 'kubernetes' => kubernetes,\n 'publicDns' => false,\n 'members' => []\n }\n return self.api '/v1/project/', 'POST', nil, data\n end",
"title": ""
},
{
"docid": "a6a1ecc959a69a57047e2f5a25b6ab9b",
"score": "0.5422087",
"text": "def create\n # Workaround an issue in which the example, empty production Puppet\n # environment that is installed by the puppet-agent RPM causes the\n # OmniEnvController#create to fail.\n if Dir.exist?(env_info[:puppet_env_dir])\n back_up_puppet_environment(env_info[:puppet_env_dir])\n end\n\n #TODO read much of this config in from a config file\n omni_options = Simp::Cli::Utils.default_simp_env_config\n omni_options[:types][:puppet].merge! ({\n strategy: :skeleton,\n puppetfile_generate: true,\n puppetfile_install: true,\n })\n omni_options[:types][:secondary][:strategy] = :skeleton\n omni_options[:types][:writable][:strategy] = :skeleton # noop\n\n #TODO make sure it matches latest OmniEnvController code\n omni_controller = Simp::Cli::Environment::OmniEnvController.new(omni_options, @env_name)\n omni_controller.create\n\n # update @env_info to reflect the actual Puppet environment, as some\n # configuration may have changed (e.g., module path)\n @env_info = get_current_env_info\n @env_info\n end",
"title": ""
},
{
"docid": "f06a8695ad642397570e91c39e7b5faa",
"score": "0.5420039",
"text": "def create!\n @client.create_version(@repo_name, @package_name, @version_name)\n end",
"title": ""
},
{
"docid": "a44d0c6f375fb4c3747f338da81b1e4f",
"score": "0.5410875",
"text": "def create(app_id_or_app_name, body = {})\n @client.slug.create(app_id_or_app_name, body)\n end",
"title": ""
},
{
"docid": "2fcbb16b16c4a36e14ab807b65eae3f8",
"score": "0.5372138",
"text": "def setup_apps\n authorize unless @heroku\n\n # get a list of all my current apps on Heroku (so we don't create dupes)\n @my_apps = @heroku.list.map{|a| a.first}\n\n each_heroku_app do |heroku_env, app_name, repo|\n next if @my_apps.include?(app_name)\n\n options = { :remote => app_name, :stack => @config.stack(heroku_env) }\n\n @heroku.create(app_name, options)\n end\n end",
"title": ""
},
{
"docid": "ebc62ae17a8acf4e882edf7ae368884d",
"score": "0.5368223",
"text": "def create(body = {})\n @client.app_setup.create(body)\n end",
"title": ""
},
{
"docid": "e5731f59ecc9b3cedb04535ac031fe73",
"score": "0.53522897",
"text": "def create\n eparams = params.require(:extension).permit(:name, :description, :github_url, :github_url_short, :tmp_source_file, :tag_tokens, :version, compatible_platforms: [])\n create_extension = CreateExtension.new(eparams, current_user)\n @extension = create_extension.process!\n\n if @extension.errors.none?\n redirect_to owner_scoped_extension_url(@extension), notice: t(\"extension.created\")\n else\n @repo_names = current_user.octokit.repos.map { |r| r.to_h.slice(:full_name, :name, :description) } rescue []\n render :new\n end\n end",
"title": ""
},
{
"docid": "51bbba4e9523e0bf39735aee0a417e9d",
"score": "0.5348912",
"text": "def build_and_deploy\n builder =\n case service[:name]\n when 'ManagementGateway'\n 'MG'\n when 'FutureAdvisor'\n 'FA'\n when 'fa_front_end'\n 'FE'\n else\n raise StandardError.new('Unknown service')\n end\n if builder == 'FE'\n # Go do something else here\n build_and_deploy_subtask('FA-FrontEnd-Deployer')\n build_and_deploy_subtask('Partner-FrontEnd-Deployer')\n else\n build_and_deploy_subtask(builder)\n end\n end",
"title": ""
},
{
"docid": "85ba781ce166ad0be6a2037abef57b04",
"score": "0.53467864",
"text": "def create_app(application_name)\n\t\tDir.chdir \"#{@project_path}/#{@project_name}\"\n\t\tcreate_code = system(\"cf push #{application_name} --no-start\")\n\t\tif create_code == true\n\t\t\tputs \"Successfully created Application.\".green\n\t\telse\n\t\t\tabort(\"There is a problem in Creation of Application.\".red)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9351961ec26296db3cc57b6c2564d954",
"score": "0.53443944",
"text": "def create\n @server.connect do\n\n display_ \"Create app user and home directory\" do\n exit_status, stdout = @server.exec \"grep \\\"^#{@name}:\\\" /etc/passwd\"\n if exit_status == 0\n 'already created'\n else\n @server.script! template(\"create_user_and_home.sh\", binding), sudo: true, error_msg: \"Cannot create the user and home directory\"\n @server.exec! \"mkdir -p #{@home}/cache #{@home}/config #{@home}/packages #{@home}/domains\", as: @name, error_msg: \"Cannot create directory in the application folder\"\n @server.exec! \"touch #{@home}/config/env\", as: @name, error_msg: \"Cannot create the env file (~/config/env)\"\n @server.exec! \"chown #{@name}:deploy #{@home}/cache && chmod 775 #{@home}/cache\", as: @name, error_msg: \"Cannot change owner or permissions on '~/cache' folder\"\n @server.exec! \"chown #{@name}:deploy #{@home}/packages && chmod 775 #{@home}/packages\", as: @name, error_msg: \"Cannot change owner or permissions on '~/packages' folder\"\n @server.exec! \"chown #{@name}:deploy #{@home}/config && chmod 775 #{@home}/config\", as: @name, error_msg: \"Cannot change owner or permissions on '~/config' folder\"\n @server.exec! \"chown #{@name}:deploy #{@home}/domains && chmod 775 #{@home}/domains\", as: @name, error_msg: \"Cannot change owner or permissions on '~/domains' folder\"\n 'done'\n end\n end \n\n display_ \"Patch app profile to load running environment on new shell\" do\n exit_status, stdout = @server.exec \"cat #{@home}/.profile | grep 'If a package is running, load the app environment'\"\n if exit_status == 0\n 'already patched'\n else\n @server.script! template(\"patch_profile.sh\", binding), sudo: true, error_msg: \"Cannot patch the app profile file\"\n 'done'\n end\n end\n\n domain_name = \"#{@name}.#{@server.host}\"\n display_ \"Generate a domain name for the app\" do\n @server.exec! \"echo #{domain_name} > ~/.domain\", as: @name, error_msg: \"Cannot write the domain name configuration file\"\n \"#{domain_name}\"\n end\n\n display_ \"Create an HTTP route for #{domain_name} -> #{@name}\" do\n exit_status, stdout = @server.exec \"ls #{VHOST_DIR}/#{@name}\"\n if exit_status == 0\n 'already declared'\n else\n @server.script! template(\"create_route.sh\", binding), as: ROUTER_USER, error_msg: \"Cannot write the route config file\"\n 'done'\n end\n @http = \"http://#{domain_name}\"\n 'done'\n end\n\n display_ \"Create a git repository for the app\" do\n @git = \"#{DEPLOY_USER}@#{@server.host}:#{@name}.git\"\n exit_status, stdout = @server.exec \"grep \\\"^repo #{@name}\\\" #{GITOLITE_ADMIN_DIR}/conf/gitolite.conf\"\n if exit_status == 0\n 'already exist'\n else\n @server.script! template(\"create_repo.sh\", binding), as: GITOLITE_USER, error_msg: \"Cannot create a repository for this app ('#{@name}')\"\n 'done'\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a62bae3a95834fc71ad85e165b2bbd04",
"score": "0.53430116",
"text": "def set\n action \"Modifying buildpacks for #{app}\" do\n buildpack_url = buildpack_url_for(shift_argument)\n system \"heroku buildpacks:clear -a #{app}\"\n system \"heroku buildpacks:set #{buildpack_url} -a #{app}\"\n end\n end",
"title": ""
},
{
"docid": "f3081f67f9385a542aefd24e2ae1e3fb",
"score": "0.5316193",
"text": "def add\n create_git_remote(shift_argument || app, git_url)\n end",
"title": ""
},
{
"docid": "3b6996135a3f6fea315d7dc0cd155794",
"score": "0.5307726",
"text": "def create_remote(name, url)\n return false if remote?(name)\n\n command = \"git remote add '#{name}' '#{url}'\"\n command_success?(command)\n end",
"title": ""
},
{
"docid": "145b9b0033b05d016a30e2363421dd23",
"score": "0.5306578",
"text": "def install_servicepack(name, provider_host)\n pub_key=\"\"\n connect do\n display_ \"Get the deployment account public key\" do\n pub_key = exec! \"cat #{DEPLOY_USER_HOME}/.ssh/id_rsa.pub\", as: DEPLOY_USER, error_msg: 'Cannot read public key'\n 'done'\n end\n end\n \n provider = Chaos::Server.new \"ssh://#{provider_host}\"\n if provider_host == @host\n provider.password = @password\n else\n provider.ask_user_password\n end\n\n provider.connect do\n display_ \"Register the public key on the service provider\" do\n exit_status, stdout = provider.exec \"cat #{SERVICEPACKS_USER_HOME}/.ssh/authorized_keys | grep \\\"#{pub_key.chomp}\\\"\", as: SERVICEPACKS_USER\n if exit_status == 0\n 'already registered'\n else\n provider.exec! \"echo \\\"#{pub_key}\\\" >> #{SERVICEPACKS_USER_HOME}/.ssh/authorized_keys\", as: SERVICEPACKS_USER, error_msg: \"Cannot register this key\"\n 'done'\n end\n end\n end\n\n connect do\n display_ \"Import addon detect files on '#{@host}'\" do\n exec! \"mkdir ~/addons/#{name}; scp #{SERVICEPACKS_USER}@#{provider}:/#{SERVICEPACKS_DIR}/#{name}/bin/detect #{ADDONS_DIR}/#{name}/detect\", as: DEPLOY_USER\n 'done'\n end\n\n display_ \"Build the ssh gateway to service provider\" do\n script! template(\"build_ssh_gateway.sh\", binding), as: DEPLOY_USER, error_msg: \"Cannot build the ssh gateway\"\n 'done'\n end\n end\n end",
"title": ""
},
{
"docid": "4f270b34a4eb8918ed3253dd46f330b5",
"score": "0.52975225",
"text": "def setup_addons\n authorize unless @heroku\n each_heroku_app do |heroku_env, app_name, repo|\n addons_in_config = @config.addons(heroku_env)\n\n addons_on_heroku = {}\n (@heroku.installed_addons(app_name) || []).each do |installed_addon|\n name, slug = installed_addon['name'].split(':')\n addons_on_heroku[name] = slug\n end\n\n addons_on_heroku.each do |name, slug|\n if addons_in_config.include?(name)\n unless addons_in_config[name] == slug\n upgrade_command \"heroku addons:upgrade #{addon_full_name(name,addons_in_config[name])} --app #{app_name} --confirm #{app_name}\"\n end\n else\n destroy_command \"heroku addons:remove #{addon_full_name(name,slug)} --app #{app_name} --confirm #{app_name}\"\n end\n end\n\n addons_in_config.each do |name, slug|\n unless addons_on_heroku.include?(name)\n creation_command \"heroku addons:add #{addon_full_name(name,slug)} --app #{app_name}\"\n end\n end\n\n output_upgrade_commands(app_name)\n output_destroy_commands(app_name)\n end\n end",
"title": ""
},
{
"docid": "2ce19dc6607ff007fbc12f433319a8d5",
"score": "0.5295552",
"text": "def create\n STDOUT.puts '### Running prepd'\n # configure\n # setup_git\n clone_submodules\n copy_developer_yml\n generate_credentials\n encrypt_vault_files\n # commit_git\n end",
"title": ""
},
{
"docid": "37839aa0ca972bf62316c5b56786eeda",
"score": "0.5285465",
"text": "def create\n commands = []\n commands += proxy_args(@resource[:proxy]) if @resource[:proxy]\n commands << 'install'\n commands << '--batch'\n commands += install_args\n debug(\"Commands: #{commands.inspect}\")\n\n retry_count = 3\n retry_times = 0\n begin\n with_environment do\n plugin(commands)\n end\n rescue Puppet::ExecutionFailure => e\n retry_times += 1\n debug(\"Failed to install plugin. Retrying... #{retry_times} of #{retry_count}\")\n sleep 2\n retry if retry_times < retry_count\n raise \"Failed to install plugin. Received error: #{e.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "f26ff719a2dac6cb9679ba5db16bd703",
"score": "0.5281113",
"text": "def create\n commands = fetch_commands\n Puppet.debug(\"Commands: #{commands}\")\n\n commands.each do |message, command|\n bringUp(message, command)\n end\n end",
"title": ""
},
{
"docid": "db02e6029e59cf8a559babeed58e7ccb",
"score": "0.52794397",
"text": "def new(app_name)\n\t\t\tsay \"instaling rails app\", set_color(:magenta)\n\t\t\trun \"rails new #{app_name} --skip-bundle\"\n\t\t\tsay \"Copying Gemfile\", set_color(:magenta)\n\t\t\tcopy_file 'new/Gemfile', \"#{app_name}/Gemfile\"\n\t\t\tsay \"Copying applicaion.rb\", set_color(:magenta)\n\t\t\tcopy_file 'new/application.rb', \"#{app_name}/config/application.rb\"\n\t\t\trun \"cd #{app_name} && bundle install --without production\"\n\t\t\trun \"cd #{app_name} && ember new frontend --skip-git\"\n\t\t\trun \"cd #{app_name} && rails generate ember:init\"\n\t\t\trun \"cd #{app_name}/frontend && ember install ember-cli-rails-addon\"\n\t\t\trun \"cd #{app_name}/frontend && ember g adapter application\"\n\t\t\tsay \"changing adapter\", set_color(:magenta)\n\t\t\tcopy_file 'new/application.js', \"#{app_name}/frontend/app/adapters/application.js\"\n\t\t\tsay \"creating routes.rb\", set_color(:magenta)\n\t\t\tcopy_file 'new/routes.rb', \"#{app_name}/config/routes.rb\"\n\t\t\trun \"cd #{app_name} && rake ember:install\"\n\t\t\trun \"cd #{app_name} && git init\"\n\t\t\tsay \"including node modules in git ignore\", set_color(:magenta)\n\t\t\trun \"cd #{app_name} && git add --all\"\n\t\t\trun \"cd #{app_name} && git commit -m 'new ember rails app'\"\n\t\t\tsay Draw::Lenny, set_color(:green)\n\t\tend",
"title": ""
},
{
"docid": "242722b89972cf15be9df225c8efe81c",
"score": "0.5274754",
"text": "def create(label, name, summary, arch, parent)\n ret = nil\n begin\n ret = @connection.call(\"channel.software.create\", @sid, label, name, summary, arch, parent)\n rescue Exception => ex\n puts \"Something went wrong: \" + ex\n ensure\n return ret\n end\n end",
"title": ""
},
{
"docid": "8f69c8cde9419a55fd0858144e115a59",
"score": "0.52734417",
"text": "def create_app\n self.destination_root = options[:root]\n underscore_name = name.gsub(/\\W/, '_')\n @app_folder = underscore_name.underscore\n @app_name = underscore_name.camelize\n if in_app_root?\n @project_name = options[:namespace].underscore.camelize\n @project_name = fetch_project_name(@app_folder) if @project_name.empty?\n\n if options[:destroy]\n self.behavior = :revoke\n else\n unless options[:force]\n say \"#{@app_name} already exists.\"\n say \"Please, change the name.\"\n return\n end\n end if already_exists?(@app_name, @project_name)\n\n lowercase_app_folder = @app_folder.downcase\n app_skeleton(lowercase_app_folder, options[:tiny])\n empty_directory destination_root(\"public/#{lowercase_app_folder}\")\n\n mount_command = \"\\nPadrino.mount('#{@project_name}::#{@app_name}', :app_file => Padrino.root('#{lowercase_app_folder}/app.rb')).to('/#{lowercase_app_folder}')\\n\"\n if File.read(destination_root('config/apps.rb')).match(/^Padrino.mount.*\\.to\\('\\/'\\)$/)\n inject_into_file destination_root('config/apps.rb'), mount_command, :before => /^Padrino.mount.*\\.to\\('\\/'\\)$/\n else\n append_file destination_root('config/apps.rb'), mount_command\n end\n\n return if self.behavior == :revoke\n say\n say '=' * 65, :green\n say \"Your #{@app_name} application has been installed.\"\n say '=' * 65, :green\n say \"This application has been mounted to /#{@app_name.downcase}\"\n say \"You can configure a different path by editing 'config/apps.rb'\"\n else\n say 'You are not at the root of a Padrino application! (config/boot.rb not found)'\n end\n end",
"title": ""
},
{
"docid": "5e4231599e16163bde796b2874c47e15",
"score": "0.52728105",
"text": "def create_repo\n cli.inside(app_path) { cli.run \"git init\" }\n end",
"title": ""
},
{
"docid": "41e4e87bcb7b1869dba171a6ca491c63",
"score": "0.52693033",
"text": "def add_contributor_to_app\n user = options[:user]\n org = options[:org]\n\n if user.nil?\n raise Heroku::Command::CommandFailed, \"No user specified.\\nSpecify which user to add with --user <user email>.\\n\"\n end\n\n if org.nil?\n raise Heroku::Command::CommandFailed, \"No organization specified.\\nSpecify which organization the app is in with --org <org name>.\\n\"\n end\n\n if app.nil?\n raise Heroku::Command::CommandFailed, \"No app specified.\\n\"\n end\n\n print_and_flush(\"Adding #{user} to #{app}... \")\n\n begin\n response = RestClient.post(\"https://:#{api_key}@#{MANAGER_HOST}/v1/organization/#{org}/app/#{app}/developer\", json_encode({ \"email\" => user }), :content_type => :json)\n\n if response.code == 201\n print_and_flush(\" done\\n\")\n else\n print_and_flush(\"failed\\nAn error occurred: #{response.code}\\n#{response}\\n\")\n end\n rescue => e\n if e.response\n errorText = json_decode(e.response.body)\n print_and_flush(\"failed\\nAn error occurred: #{errorText[\"error_message\"]}\\n\")\n else\n print_and_flush(\"failed\\nAn error occurred: #{e.message}\\n\")\n end\n end\n\n end",
"title": ""
},
{
"docid": "41e4e87bcb7b1869dba171a6ca491c63",
"score": "0.52693033",
"text": "def add_contributor_to_app\n user = options[:user]\n org = options[:org]\n\n if user.nil?\n raise Heroku::Command::CommandFailed, \"No user specified.\\nSpecify which user to add with --user <user email>.\\n\"\n end\n\n if org.nil?\n raise Heroku::Command::CommandFailed, \"No organization specified.\\nSpecify which organization the app is in with --org <org name>.\\n\"\n end\n\n if app.nil?\n raise Heroku::Command::CommandFailed, \"No app specified.\\n\"\n end\n\n print_and_flush(\"Adding #{user} to #{app}... \")\n\n begin\n response = RestClient.post(\"https://:#{api_key}@#{MANAGER_HOST}/v1/organization/#{org}/app/#{app}/developer\", json_encode({ \"email\" => user }), :content_type => :json)\n\n if response.code == 201\n print_and_flush(\" done\\n\")\n else\n print_and_flush(\"failed\\nAn error occurred: #{response.code}\\n#{response}\\n\")\n end\n rescue => e\n if e.response\n errorText = json_decode(e.response.body)\n print_and_flush(\"failed\\nAn error occurred: #{errorText[\"error_message\"]}\\n\")\n else\n print_and_flush(\"failed\\nAn error occurred: #{e.message}\\n\")\n end\n end\n\n end",
"title": ""
},
{
"docid": "1514f755c70f34ce8f92364e8bb8b67a",
"score": "0.5256185",
"text": "def create\n appctrl_create( 'Task' )\n end",
"title": ""
},
{
"docid": "75bfa71ae012c6ab9a7c78925ff73829",
"score": "0.5255321",
"text": "def create_or_update_project\n Chef::Log.debug(\"creating or updating project : #{project}, users: #{new_resource.users}, comment: #{new_resource.comment}\")\n\n command = []\n command << (project_exists? ? 'projmod' : 'projadd')\n command << \"-c \\\"#{new_resource.comment}\\\"\"\n command << \"-U \\\"#{Array(new_resource.users).join(',')}\\\"\" if new_resource.users\n command << project\n\n Chef::Log.debug(\"executing command: #{command.join(' ')}\")\n\n cmd = Mixlib::ShellOut.new(command.join(' '))\n cmd.run_command\n cmd.error!\nend",
"title": ""
},
{
"docid": "e81d2f085dd1818166fd5412b7bb862b",
"score": "0.5254218",
"text": "def publish\n name = shift_argument || error(\"Must specify a buildpack name\")\n\n action \"Publishing #{name} buildpack\" do\n Dir.mktmpdir do |dir|\n %x{ tar czf #{dir}/buildpack.tgz * }\n\n begin\n server[\"/buildpacks\"].post :name => name\n rescue RestClient::Forbidden\n error \"The name '#{name}' is already taken.\"\n end\n\n server[\"/buildpacks/#{name}/publish\"].post :buildpack => File.open(\"#{dir}/buildpack.tgz\", \"rb\")\n end\n end\n end",
"title": ""
},
{
"docid": "5d0ce69bd85611d97a78d41e5c2ce6b6",
"score": "0.5242608",
"text": "def create(body)\n @client.app_setup.create(body)\n end",
"title": ""
},
{
"docid": "a8c9c7d6ab0aa7b493d9e7c5d1cdf9df",
"score": "0.5240261",
"text": "def create_remote\n set_state \"gl:started\"\n begin\n raise \"repo exists #{name}\" if GitlabAPI.project_set.include? name\n GitlabAPI.create_project(name, \"Full SVN dump of #{name}\")\n rescue => ex\n bannerize \"Create remote #{name} failed with #{ex}\"\n end\n end",
"title": ""
},
{
"docid": "de1be303e76a27bb51e9d07c47ee8dee",
"score": "0.52378803",
"text": "def add\n unless buildpack_url = shift_argument\n error(\"Usage: heroku buildpacks:add BUILDPACK_URL.\\nMust specify target buildpack URL.\")\n end\n\n index = get_index\n\n mutate_buildpacks_constructive(buildpack_url, index, \"added\") do |existing_url, ordinal|\n if ordinal == index\n [buildpack_url, existing_url]\n else\n existing_url\n end\n end\n end",
"title": ""
},
{
"docid": "0da5a46fd7f0048334f5e23037a8a2a7",
"score": "0.52267444",
"text": "def init(args)\n params, payload = {}, {}\n options = {}\n optparse = Morpheus::Cli::OptionParser.new do|opts|\n #opts.banner = subcommand_usage()\n opts.banner = usage\n build_standard_add_options(opts, options, [:quiet, :auto_confirm])\n opts.on('--hubmode MODE','--hubmode MODE', \"Choose an option for hub registration possible values are login, register, skip.\") do |val|\n options[:hubmode] = val.to_s.downcase\n end\n opts.on('--force','--force', \"Force setup, make api request even if setup is unavailable.\") do\n options[:force] = true\n end\n # todo: need all the other options here hub-username/password, account-name, username, password, email, etc.\n opts.footer = <<-EOT\nSetup a fresh remote appliance, initializing it.\nFirst, this checks if setup is available, and returns an error if not.\nThen it prompts to create the master tenant and admin user.\nIf Morpheus Hub registration is enabled, you may login or register to retrieve a license key,\nor you can pass `--hubmode skip`.\nThis is only available on a new, freshly installed remote appliance,\nand it may only be executed successfully one time.\nEOT\n end\n optparse.parse!(args)\n verify_args!(args:args, count:0, optparse:optparse)\n connect(options)\n exit_code, err = 0, nil\n # construct payload\n if options[:payload]\n payload = options[:payload]\n payload.deep_merge!(parse_passed_options(options))\n else\n payload.deep_merge!(parse_passed_options(options))\n\n # JD: This should just do a Remote.check_appliance() first... needs to work with --remote-url though.\n appliance_status_json = nil\n begin\n appliance_status_json = @setup_interface.get()\n rescue RestClient::SSLCertificateNotVerified => e\n @remote_appliance[:status] = 'ssl-error'\n @remote_appliance[:last_check] ||= {}\n @remote_appliance[:last_check][:error] = e.message\n rescue RestClient::Exception => e\n # pre 4.2.1 api would return HTTP 400 here, but with setupNeeded=false\n # so fallback to the old /api/setup/check\n # this could be in the interface itself..\n if e.response && (e.response.code == 400 || e.response.code == 404 || e.response.code == 401)\n Morpheus::Logging::DarkPrinter.puts \"HTTP 400 from /api/setup, falling back to older /api/setup/check\" if Morpheus::Logging.debug?\n begin\n appliance_status_json = @setup_interface.check()\n rescue RestClient::Exception => e2\n # err = e2.message || \"Bad Request\"\n begin\n appliance_status_json = JSON.parse(e2.response.to_s)\n rescue TypeError, JSON::ParserError => ex\n #puts \"Failed to parse error response as json: #{ex}\"\n end\n end\n end\n if appliance_status_json.nil?\n @remote_appliance[:status] = 'http-error'\n @remote_appliance[:last_check] ||= {}\n @remote_appliance[:last_check][:error] = e.message\n end\n end\n\n # my_terminal.execute(\"setup needed?\")\n # theres a bug here with --remote-url :status == \"unknown\"\n # but hey, we got json back, so set status to \"ready\"\n if appliance_status_json\n @remote_appliance[:status] == 'ready'\n end\n remote_status_string = format_appliance_status(@remote_appliance, cyan)\n if appliance_status_json && appliance_status_json['setupNeeded'] == true\n # ok, setupNeeded\n # print_error cyan,\"Setup is needed, status is #{remote_status_string}\",reset,\"\\n\"\n else\n if @remote_appliance[:status] == 'ssl-error'\n print_error cyan,\"Setup unavailable, status is #{remote_status_string}\",\"\\n\"\n print_error \"Try passing the --insecure option.\",reset,\"\\n\"\n return 1, \"setup unavailable\"\n end\n if options[:force] != true\n print_error cyan,\"Setup unavailable, status is #{remote_status_string}\",reset,\"\\n\"\n #print_error red, \"#{appliance_status_json['msg']}\\n\", reset\n return 1, \"setup unavailable\"\n end\n end\n\n # retrieved hub.enabled and hub.url \n hub_settings = appliance_status_json['hubSettings'] || appliance_status_json['hub'] || {}\n\n # store login/registration info in here, for prompt default values\n hub_info = nil\n print cyan\n print_h2 \"Remote Setup | #{display_appliance(@appliance_name, @appliance_url)}\"\n \n print cyan\n puts \"It looks like you are the first one here, so let's begin.\"\n print reset, \"\\n\"\n # print \"\\n\"\n unless Morpheus::Cli::OptionTypes.confirm(\"Would you like to setup and initialize the remote appliance now?\", options) \n return 9, \"aborted command\"\n end\n print \"\\n\"\n hubmode = nil\n hub_init_payload = nil # gets included as payload for hub scoped like hub.email\n if hub_settings['enabled']\n\n # Hub Registration\n hub_action_dropdown = [\n {'name' => 'Login to existing hub account', 'value' => 'login', 'isDefault' => true}, \n {'name' => 'Register a new hub account', 'value' => 'register'}, \n {'name' => 'Skip this step and manually install a license later.', 'value' => 'skip'},\n {'name' => 'Abort', 'value' => 'abort'}\n ]\n \n\n print cyan\n puts \"Morpheus Hub registration is enabled for your appliance.\"\n puts \"This step will connect to the Morpheus Hub at #{hub_settings['url']}\"\n puts \"This is done to retrieve and install the license key for your appliance.\"\n puts \"You have several options for how to proceed:\"\n hub_action_dropdown.each_with_index do |hub_action, idx|\n puts \"* #{hub_action['name']} [#{hub_action['value']}]\"\n end\n print \"\\n\", reset\n\n while hubmode == nil do\n \n options[:options]['hubmode'] = options[:hubmode] if options.key?(:hubmode)\n v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'hubmode', 'fieldLabel' => 'Choose Hub Mode', 'type' => 'select', 'selectOptions' => hub_action_dropdown, 'required' => true, 'defaultValue' => 'login'}], options[:options])\n hubmode = v_prompt['hubmode']\n\n if hubmode == 'login'\n\n # print cyan\n # puts \"MORPHEUS HUB #{hub_settings['url']}\"\n # puts \"The Command Center for DevOps\"\n # print reset\n\n # Hub Login\n print_h2 \"Morpheus Hub Login @ #{hub_settings['url']}\", options\n hub_login_option_types = [\n {'fieldContext' => 'hub', 'fieldName' => 'email', 'fieldLabel' => 'Email', 'type' => 'text', 'required' => true, 'description' => 'Email Address of existing Morpheus Hub user to link with.'},\n {'fieldContext' => 'hub', 'fieldName' => 'password', 'fieldLabel' => 'Password', 'type' => 'password', 'required' => true, 'description' => 'Password of existing Morpheus Hub user.'},\n ]\n v_prompt = Morpheus::Cli::OptionTypes.prompt(hub_login_option_types, options[:options])\n hub_login_payload = v_prompt['hub']\n hub_login_response = nil\n begin\n hub_login_response = @setup_interface.hub_login(hub_login_payload)\n hub_init_payload = hub_login_payload\n hub_info = {'email' => hub_login_payload['email'], 'password' => hub_login_payload['password'] }\n hub_info.deep_merge!(hub_login_response['data']['info']) if (hub_login_response['data'] && hub_login_response['data']['info'])\n hub_info.deep_merge!(hub_login_response['hub']) if hub_login_response['hub'].is_a?(Hash)\n print_green_success \"Logged into Morpheus Hub as #{hub_info['email']}\"\n rescue RestClient::Exception => e\n hub_login_response = parse_rest_exception(e)\n error_msg = hub_login_response[\"msg\"] || \"Hub login failed.\"\n print_error red,error_msg,reset,\"\\n\"\n hubmode = nil\n #print_rest_exception(e, options)\n #exit 1\n end\n \n # DEBUG\n if options[:debug] && hub_login_response\n print_h2 \"JSON response for hub login\"\n Morpheus::Logging::DarkPrinter.puts as_json(hub_login_response)\n end\n\n elsif hubmode == 'register'\n # Hub Registration\n print_h2 \"Morpheus Hub Registration\", options\n hub_register_option_types = [\n {'fieldContext' => 'hub', 'fieldName' => 'companyName', 'fieldLabel' => 'Company Name', 'type' => 'text', 'required' => true, 'description' => 'Company Name of new Morpheus Hub account to be created.'},\n {'fieldContext' => 'hub', 'fieldName' => 'firstName', 'fieldLabel' => 'First Name', 'type' => 'text', 'required' => true, 'description' => 'First Name of new Morpheus Hub user.'},\n {'fieldContext' => 'hub', 'fieldName' => 'lastName', 'fieldLabel' => 'Last Name', 'type' => 'text', 'required' => true, 'description' => 'Last Name of new Morpheus Hub user.'},\n {'fieldContext' => 'hub', 'fieldName' => 'email', 'fieldLabel' => 'Email', 'type' => 'text', 'required' => true, 'description' => 'Email Address of new Morpheus Hub user.'}\n ]\n v_prompt = Morpheus::Cli::OptionTypes.prompt(hub_register_option_types, options[:options])\n hub_register_payload = v_prompt['hub']\n\n # Password prompt with re-prompting if no match\n need_password = true\n if options[:no_prompt]\n if options[:options]['hub'] && options[:options]['hub']['password']\n options[:options]['hub']['confirmPassword'] = options[:options]['hub']['password']\n end\n end\n while need_password do\n password_option_types = [\n {'fieldContext' => 'hub', 'fieldName' => 'password', 'fieldLabel' => 'Create Password', 'type' => 'password', 'required' => true, 'description' => 'Confirm password of new Morpheus Hub user.'},\n {'fieldContext' => 'hub', 'fieldName' => 'confirmPassword', 'fieldLabel' => 'Confirm Password', 'type' => 'password', 'required' => true, 'description' => 'Confirm password of new Morpheus Hub user.'}\n ]\n v_prompt = Morpheus::Cli::OptionTypes.prompt(password_option_types, options[:options])\n if v_prompt['hub']['password'] == v_prompt['hub']['confirmPassword']\n hub_register_payload.deep_merge!(v_prompt['hub'])\n need_password = false\n else\n print_error red, \"Password confirmation does not match. Re-enter your new password.\", reset, \"\\n\"\n end\n end\n\n begin\n hub_register_response = @setup_interface.hub_register(hub_register_payload)\n hub_init_payload = hub_register_payload\n hub_info = {'email' => hub_register_payload['email'], 'password' => hub_register_payload['password'] }\n hub_info.deep_merge!(hub_register_payload)\n hub_info.deep_merge!(hub_register_response['data']['info']) if (hub_register_response['data'] && hub_register_response['data']['info'])\n hub_info.deep_merge!(hub_register_response['hub']) if hub_register_response['hub'].is_a?(Hash)\n print_green_success \"Registered with Morpheus Hub as #{hub_info['email']}\"\n # uh ok so that means the init() request can use login\n # this avoid duplicate email error\n # but it can also just omit hubMode from the init() payload to achieve the same thing.\n # hubmode = nil\n rescue RestClient::Exception => e\n hub_register_response = parse_rest_exception(e)\n error_msg = hub_register_response[\"msg\"] || \"Hub Registration failed.\"\n print_error red,error_msg,reset,\"\\n\"\n hubmode = nil\n #print_rest_exception(e, options)\n #exit 1\n end\n \n # DEBUG\n if options[:debug] && hub_register_response\n print_h2 \"JSON response for hub registration\"\n Morpheus::Logging::DarkPrinter.puts as_json(hub_register_response)\n end\n \n elsif hubmode == 'skip'\n print cyan,\"Skipping hub registraton for now...\",reset,\"\\n\"\n # puts \"You may enter a license key later.\"\n elsif hubmode == 'abort'\n return 9, \"aborted command\"\n else\n hubmode = nil\n end\n end\n end\n\n # ok, we're done with the hub.\n # now build the payload for POST /api/setup/init\n\n payload = {}\n # payload.deep_merge!(params)\n\n # print cyan\n #print_h1 \"Morpheus Appliance Setup\", [], options\n #print cyan\n #puts \"Initializing remote appliance at URL: #{@appliance_url}\"\n\n # Master Tenant\n print_h2 \"Create Master Tenant\", options\n account_option_types = [\n {'fieldName' => 'accountName', 'fieldLabel' => 'Master Tenant Name', 'type' => 'text', 'required' => true, 'defaultValue' => (hub_info ? hub_info['companyName'] : nil), 'description' => 'A unique name for the Master Tenant (account).'},\n ]\n v_prompt = Morpheus::Cli::OptionTypes.prompt(account_option_types, options[:options])\n payload.merge!(v_prompt)\n\n # Master User\n print_h2 \"Create Master User\", options\n user_option_types = [\n {'fieldName' => 'firstName', 'fieldLabel' => 'First Name', 'type' => 'text', 'required' => false, 'defaultValue' => (hub_info ? hub_info['firstName'] : nil), 'description' => 'First name of the user.'},\n {'fieldName' => 'lastName', 'fieldLabel' => 'Last Name', 'type' => 'text', 'required' => false, 'defaultValue' => (hub_info ? hub_info['lastName'] : nil), 'description' => 'Last name of the user.'},\n {'fieldName' => 'email', 'fieldLabel' => 'Email', 'type' => 'text', 'required' => true, 'defaultValue' => (hub_info ? hub_info['email'] : nil), 'description' => 'A unique email address for the user.'},\n {'fieldName' => 'username', 'fieldLabel' => 'Username', 'type' => 'text', 'required' => true, 'description' => 'A unique username for the master user.'}\n ]\n v_prompt = Morpheus::Cli::OptionTypes.prompt(user_option_types, options[:options])\n payload.merge!(v_prompt)\n\n # Password prompt with re-prompting if no match\n need_password = true\n if options[:no_prompt]\n options[:options]['confirmPassword'] = payload['password']\n payload['confirmPassword'] = payload['password'] if payload['password']\n end\n while need_password do\n password_option_types = [\n {'fieldName' => 'password', 'fieldLabel' => 'Create Password', 'type' => 'password', 'required' => true, 'description' => 'Create a new password for the user.'},\n {'fieldName' => 'confirmPassword', 'fieldLabel' => 'Confirm Password', 'type' => 'password', 'required' => true, 'description' => 'Confirm the new password for the user.'},\n ]\n password_prompt = Morpheus::Cli::OptionTypes.prompt(password_option_types, options[:options])\n if password_prompt['password'] == password_prompt['confirmPassword']\n payload['password'] = password_prompt['password']\n need_password = false\n else\n print_error red, \"Password confirmation does not match. Re-enter your new password.\", reset, \"\\n\"\n end\n end\n\n # Appliance Settings\n default_appliance_url = appliance_status_json['applianceUrl']\n if default_appliance_url && default_appliance_url.include?('10.0.2.2:8080') # ignore this default value.\n default_appliance_url = @appliance_url\n end\n default_appliance_name = appliance_status_json['applianceName']\n if default_appliance_name.nil?\n default_appliance_name = @appliance_name\n end\n print_h2 \"Appliance Settings\", options\n extra_option_types = [\n {'fieldName' => 'applianceName', 'fieldLabel' => 'Appliance Name', 'type' => 'text', 'required' => true, 'defaultValue' => default_appliance_name, 'description' => 'A name for identifying your morpheus appliance.'},\n {'fieldName' => 'applianceUrl', 'fieldLabel' => 'Appliance URL', 'type' => 'text', 'required' => true, 'defaultValue' => default_appliance_url, 'description' => 'Appliance URL. Can be used for integrations and callbacks.'},\n {'fieldName' => 'backups', 'fieldLabel' => 'Enable Backups', 'type' => 'checkbox', 'required' => false, 'defaultValue' => 'off', 'description' => 'Backups. Default is off. This means backups are created automatically during provisioning.'},\n {'fieldName' => 'monitoring', 'fieldLabel' => 'Enable Monitoring', 'type' => 'checkbox', 'required' => false, 'defaultValue' => 'on', 'description' => 'Enable Monitoring. This means checks are created automatically during provisioning.'},\n {'fieldName' => 'logs', 'fieldLabel' => 'Enable Logs', 'type' => 'checkbox', 'required' => false, 'defaultValue' => 'on', 'description' => 'Enable Logs. This means container logs are collected.'}\n ]\n v_prompt = Morpheus::Cli::OptionTypes.prompt(extra_option_types, options[:options])\n payload.merge!(v_prompt)\n \n # include hubmode and hub params for login or registration\n # actually we remove hubMode because it has already been setup, probably just now,\n # and the init() request will just used the same creds instead of \n # reauthenticated/registering with the hub\n if hubmode\n payload['hubMode'] = hubmode\n end\n if hub_init_payload\n payload['hub'] = hub_init_payload\n end\n if hubmode == 'register' || hubmode == 'login'\n payload.delete('hubMode')\n payload.delete('hub')\n end\n\n end\n \n # ok, make the api request\n @setup_interface.setopts(options)\n if options[:dry_run]\n print_dry_run @setup_interface.dry.init(payload)\n return\n end\n\n json_response = @setup_interface.init(payload)\n\n render_result = render_with_format(json_response, options)\n return 0 if render_result\n\n if options[:json]\n print JSON.pretty_generate(json_response)\n print \"\\n\"\n return\n end\n print \"\\n\"\n print green,\"Setup complete for remote #{display_appliance(@appliance_name, @appliance_url)}\",reset,\"\\n\"\n #print cyan, \"You may now login with the command `login`.\\n\"\n # uh, just use Credentials.login(username, password, {save: true})\n cmd_res = Morpheus::Cli::Login.new.login(['--username', payload['username'], '--password', payload['password'], '-q'] + (options[:remote] ? [\"-r\",options[:remote]] : []))\n # print \"\\n\"\n print cyan, \"You are now logged in as the System Admin #{payload['username']}.\\n\"\n print reset\n #print \"\\n\"\n\n if hubmode == 'skip'\n if ::Morpheus::Cli::OptionTypes::confirm(\"Would you like to install your License Key now?\", options.merge({:default => true}))\n cmd_res = Morpheus::Cli::License.new.apply([] + (options[:remote] ? [\"-r\",options[:remote]] : []))\n # license_is_valid = cmd_res != false\n end\n end\n\n if ::Morpheus::Cli::OptionTypes::confirm(\"Would you like to create the first group now?\", options.merge({:default => true}))\n cmd_res = Morpheus::Cli::Groups.new.add(['--use'] + (options[:remote] ? [\"-r\",options[:remote]] : []))\n\n #print \"\\n\"\n\n # if cmd_res !=\n if ::Morpheus::Cli::OptionTypes::confirm(\"Would you like to create the first cloud now?\", options.merge({:default => true}))\n cmd_res = Morpheus::Cli::Clouds.new.add([] + (options[:remote] ? [\"-r\",options[:remote]] : []))\n #print \"\\n\"\n end\n # end\n end\n print \"\\n\",reset\n return exit_code, err\n end",
"title": ""
},
{
"docid": "5a2ab76ebb8e8c2cd7ed477f76cf85b8",
"score": "0.5226302",
"text": "def setup(name, git_url)\n server = Chaos::Server.new \"ssh://#{options[:provider]}\"\n server.ask_user_password unless server.password?\n\n display_ \"Setup servicepack '#{name}' on '#{server}'...\", :topic\n server.setup_servicepack name, git_url\n\n display_ \"Rebuild service configuration using chef...\", :topic\n server.run_chef\n\n if server.app_server?\n display_ \"Install servicepack '#{name}'...\", :topic\n server.install_servicepack name, options[:provider]\n end\n end",
"title": ""
},
{
"docid": "1ee62d30f0ce8210dfb656452ecf2ba1",
"score": "0.52186394",
"text": "def create(app_id_or_app_name, body)\n @client.slug.create(app_id_or_app_name, body)\n end",
"title": ""
},
{
"docid": "f2333f9e42ace92f40d9358e32e1d7c3",
"score": "0.52089286",
"text": "def create_arguments_handling\n @app_name = arguments.shift\n @environment = arguments.shift\n\n raise ArgumentError, '`create` expects an app name: noveku create APPNAME ENV [addons...]' unless @app_name\n raise ArgumentError, '`create` expects an env name: noveku create APPNAME ENV [addons...]' unless @environment\n end",
"title": ""
},
{
"docid": "466ca097f621d82bd233a6560a2396d5",
"score": "0.51997596",
"text": "def create_confirmed(build_url)\n new_card = NewCard.new(trello_client, config.list_id, config.id_labels, build_url).create_new_card\n response = \"#{new_card.name}, #{new_card.url}\"\n robot.send_message(target, response)\n end",
"title": ""
},
{
"docid": "c2b68881b28adafbc7dd439d244f19a6",
"score": "0.5198523",
"text": "def action_create\n if application_exists?\n Chef::Log.debug(\"#{@new_resource} uWSGI application exists - nothing to do.\")\n else\n converge_by(\"Creating uWSGI application: #{@new_resource}\") do\n file application_file do\n owner 'root'\n group 'root'\n mode 0755\n content ::File.open(@new_resource.source).read\n action :create\n end\n Chef::Log.info(\"#{@new_resource} application created.\")\n end\n end\n end",
"title": ""
},
{
"docid": "05cbae96cfdee4fb9d9c067964f732d4",
"score": "0.51981306",
"text": "def gen\n clean\n %x( bash -lic _heroku_commands )\n %x( bash -lic _heroku_apps )\n end",
"title": ""
},
{
"docid": "db432d872f422383f8c1830e9659afab",
"score": "0.5194767",
"text": "def build_rails_new_command\n [\"rails\"].tap do |ar|\n # new command\n ar << \"new\"\n ar << \"--no-rc\"\n # use desired database\n ar << \"--database=#{config[:database][:key]}\" if config[:database][:in_rails_new] && !config[:database][:is_default]\n # ignore test if not minitest\n ar << \"--skip-test\" if config[:test_runner][:key] != \"minitest\"\n # use desired js framework\n ar << \"--webpack=#{config[:java_script_framework][:key]}\" if config[:java_script_framework][:in_rails_new]\n # ar << \"--skip-javascript\"\n # ar << \"--minimal\"\n # add app name\n ar << config[:app_name]\n end.join(\" \")\n end",
"title": ""
},
{
"docid": "6c87b9b13dfd6f57e51bed8f5a6c48cd",
"score": "0.51877135",
"text": "def create_app_environment\n \n \n end",
"title": ""
},
{
"docid": "ace55dc81837376bc6747ca19c80579a",
"score": "0.51877064",
"text": "def create_package\n #TODO: Deal with fpm output\n create_dependencies if @dependencies\n FPM::Program.new.run params(\"agent\") if @agent\n FPM::Program.new.run params(\"client\") if @application\n end",
"title": ""
},
{
"docid": "856cee30c825a55fb259dc7b90454413",
"score": "0.51855755",
"text": "def run\n begin\n @description = nil if @description && @description.strip.empty?\n create_params = {}\n {\n :application_id => @appname,\n :host => Socket.gethostname,\n :description => @description,\n :user => @user,\n :revision => @revision,\n :changelog => @changelog\n }.each do |k, v|\n create_params[\"deployment[#{k}]\"] = v unless v.nil? || v == ''\n end\n http = ::NewRelic::Agent::NewRelicService.new(nil, control.api_server).http_connection\n\n uri = \"/deployments.xml\"\n\n if @license_key.nil? || @license_key.empty?\n raise \"license_key was not set in newrelic.yml for #{control.env}\"\n end\n request = Net::HTTP::Post.new(uri, {'x-license-key' => @license_key})\n request.content_type = \"application/octet-stream\"\n\n request.set_form_data(create_params)\n\n response = http.request(request)\n\n if response.is_a? Net::HTTPSuccess\n info \"Recorded deployment to '#{@appname}' (#{@description || Time.now })\"\n else\n err_string = REXML::Document.new(response.body).elements['errors/error'].map(&:to_s).join(\"; \") rescue response.message\n raise NewRelic::Cli::Command::CommandFailure, \"Deployment not recorded: #{err_string}\"\n end\n rescue SystemCallError, SocketError => e\n # These include Errno connection errors\n err_string = \"Transient error attempting to connect to #{control.api_server} (#{e})\"\n raise NewRelic::Cli::Command::CommandFailure.new(err_string)\n rescue NewRelic::Cli::Command::CommandFailure\n raise\n rescue => e\n err \"Unexpected error attempting to connect to #{control.api_server}\"\n info \"#{e}: #{e.backtrace.join(\"\\n \")}\"\n raise NewRelic::Cli::Command::CommandFailure.new(e.to_s)\n end\n end",
"title": ""
},
{
"docid": "f9b48e98484d5a8fc32c4a60ca574454",
"score": "0.51828325",
"text": "def add(args = {})\n @cookbook.create(args)\n end",
"title": ""
},
{
"docid": "959f39b485a6f1b86de0e41ca96fac34",
"score": "0.51752925",
"text": "def create_app(name, manifest = {})\n require_login\n raise CloudFoundry::Client::Exception::BadParams, \"Name cannot be blank\" if name.nil? || name.empty?\n raise CloudFoundry::Client::Exception::BadParams, \"Manifest cannot be blank\" if manifest.nil? || manifest.empty?\n app = manifest.dup\n app[:name] = name\n app[:instances] ||= 1\n post(CloudFoundry::Client::APPS_PATH, app)\n true\n end",
"title": ""
},
{
"docid": "828103732921dee11cefd71760fa34e3",
"score": "0.5171718",
"text": "def index\n branch = shift_argument || 'master'\n validate_arguments!\n\n Heroku::Auth.check\n\n unless remotes = git_remotes\n error('No Heroku remotes detected.')\n end\n\n unless remote = remotes.key(app)\n error(\"Remote for #{app} was not found.\")\n end\n\n begin\n pack = Pack.detect.new(app, remote)\n pack.deploy!(branch)\n display(\"\\e[92mDeployment successful.\\e[0m\")\n rescue CommandExecutionFailure\n error(\"\\e[91m\\e[5mDeployment aborted.\\e[0m\")\n end\n end",
"title": ""
},
{
"docid": "d73c2d0928c9216c93cff28ab9f75a3a",
"score": "0.5169995",
"text": "def create\n display(\"Creating route... \", false)\n proto = nil\n case args.shift\n when \"--proto\"\n proto = args.shift\n end\n route = heroku.routes_create(app, proto)\n display(\"done\")\n display(route[\"url\"])\n end",
"title": ""
},
{
"docid": "9ce57fa8aa659502b3ae3861f7c9f69d",
"score": "0.5164837",
"text": "def setup_servicepack(name, git_url)\n connect do\n display_ \"Setup servicepack from '#{git_url}'\" do\n script! template(\"setup_servicepack.sh\", binding), sudo: true, error_msg: \"Cannot install this servicepack\"\n end\n end\n end",
"title": ""
},
{
"docid": "d4a1d0cb523852a821f7632d47b315f3",
"score": "0.5154548",
"text": "def create\n @addon = Addon.new(params[:addon])\n\n respond_to do |format|\n if @addon.save\n format.html { redirect_to addons_path, notice: 'Addon was successfully created.' }\n format.json { render json: addons_path, status: :created, location: @addon }\n else\n format.html { render action: \"new\" }\n format.json { render json: @addon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5105a2ce3031df8b560abb48d71f54a2",
"score": "0.5144655",
"text": "def deploy_setup\n FileUtils.chdir(PROJECT_ROOT)\n `git checkout master`\n `git fetch origin \"+refs/heads/*:refs/remotes/origin/*\"`\n `git remote add repo git@github.com:sensu-plugins/#{ define_plugin }.git`\n `git config --global user.email #{ DEPLOY_EMAIL }`\n `git config --global user.name #{ DEPLOY_USER }`\nend",
"title": ""
},
{
"docid": "91640cb6161baee1c53698aa3dd445f7",
"score": "0.513546",
"text": "def production_create(params = {})\n params = params.dup\n\n description = search_hash!(params, :description, :production_description)\n\n params['name'] = search_hash!(params, :name, :production_name)\n params['description'] = description if description\n http_post_json('content/ea/git/productions.v1.json', params)\n end",
"title": ""
},
{
"docid": "889d76810afc1e909f6a1de5f5388118",
"score": "0.51265717",
"text": "def create(app_id_or_app_name, body = {})\n @client.dyno.create(app_id_or_app_name, body)\n end",
"title": ""
},
{
"docid": "5632fbf12ac5a864624cee6922e5f3b5",
"score": "0.512249",
"text": "def cmd(app_name, args)\n execute \"heroku #{args} --app #{Shellwords.escape app_name}\"\n end",
"title": ""
},
{
"docid": "95e42d5253c55416483f047ee6409b48",
"score": "0.5117377",
"text": "def create_deployment(repo, ref, options = {})\n options[:ref] = ref\n post(\"#{Repository.path repo}/deployments\", options)\n end",
"title": ""
},
{
"docid": "314208f2bcdc60093406252320eb2f25",
"score": "0.5110927",
"text": "def setup\n @app = App.where({\n name: 'My App',\n description: 'My first App',\n author: 'John Doe',\n ports: '3001:3000',\n image: 'hello-world',\n virtual_host: 'my-app.test.com'\n }).first_or_create!\n @compose_file = @app.compose_app_file(@app.slug)\n end",
"title": ""
},
{
"docid": "65fda8f2e5dca963924541a546aa7dac",
"score": "0.5108258",
"text": "def deploy_app name, version = nil\n v = version ? \"&version=#{version}\" : ''\n try_json post(\"/app/#{name}?mode=deploy#{v}\")\n end",
"title": ""
}
] |
0f0591d67e0ff2551b44c4b8f62c1407
|
Parse and run the given Brainfuck code.
|
[
{
"docid": "b4e1a20305a6be811c689b02cf48ce18",
"score": "0.6125772",
"text": "def run(code, options={})\n parse(code).run(options)\n end",
"title": ""
}
] |
[
{
"docid": "3498a30233ea5d78f43aeb631f4ef617",
"score": "0.7306875",
"text": "def run(code)\n\t\t\t@code += code.delete \"^[]<>.,+-\"\n\t\t\tif check_for_matching_braces\n\t\t\t\tcatch :quit do\n\t\t\t\t\tevaluate_code\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "90a73e0e617636bf9a1247295873cc33",
"score": "0.632056",
"text": "def parse\n RKelly::Parser.new.parse(@code)\n end",
"title": ""
},
{
"docid": "0ce761e906c4da573e624c228a1062ed",
"score": "0.6237714",
"text": "def evaluate(code)\n brackets = 0\n loop_code = ''\n \n code.split(//).each_with_index do |char, i|\n # Skip any unknown characters...\n next unless ['>', '<', '+', '-', '.', ',', '[', ']'].include? char\n \n # Do we need to grab contents for looping?\n if brackets > 0 and char != ']'\n loop_code << char\n next\n end\n \n # Normal BF parsing\n case char\n when '>' then @pointer += 1\n when '<' then @pointer -= 1\n when '+' then @buffer[@pointer] += 1\n when '-' then @buffer[@pointer] -= 1\n when '.' then putchar\n when ',' then getchar\n when '[' then brackets += 1\n when ']'\n brackets -= 1\n evaluate(loop_code) until current.zero? if brackets.zero?\n loop_code = ''\n end\n end\n end",
"title": ""
},
{
"docid": "37761f6cd53ca6117755f5d1b0bed9db",
"score": "0.5932272",
"text": "def parse_code (parser, code)\n result = parser.parse(code)\n return result\n end",
"title": ""
},
{
"docid": "0cc05dea7d2cc79b69a9f5706f5cac99",
"score": "0.5915525",
"text": "def for_code(code); end",
"title": ""
},
{
"docid": "e91389820170c33f9de25ea6630ec211",
"score": "0.5852491",
"text": "def run(code)\n\t\t\t@code += code.delete \"^01\"\n\t\t\tcatch :quit do\n\t\t\t\tevaluate_code\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "98783edc3a12e05a13261372de2df14f",
"score": "0.58356434",
"text": "def parse_block (tokens, stops = [])\n\tcode = []\n\twhile tokens[0]\n\t break if stops.include? tokens[0][0]\n\n\t token = tokens.shift# Consume the current token\n\t case token[0]\n\t when :string, :ext_string, :number\t# string and numeric literals\n\t\tcode.push token[1]\n\t when :name\t\t# variable\n\t\tcode.push factory(:variable, token[1])\n\t when :lbrack\t# variable element subscripts\n\t\tsubs = parse_subscripts tokens\n\t\tcode.push factory(:subscript, code.pop, subs) if code[0]\n\t when :dot\t\t# method call w/ or w/out parameters\n\t\tcase tokens[0][0]\n\t\twhen :name, :method, :string\n\t\t method = tokens.shift\n\t\t if tokens[0] and tokens[0][0] == :lparen\n\t\t\ttokens.shift\t# Consume (\n\t\t\tparams = parse_parameters tokens\n\t\t else\n\t\t\tparams = factory :parameters\n\t\t end\n\t\t code.push factory(:call, code.pop, method[1], params) if\n\t\t code[0]\n\t\tend if tokens[0]\n\t when :method\t# punctuated method call\n\t\t# Insert the implied dot and re-parse\n\t\ttokens.unshift [ :dot ], token\n\t when :lparen\t# call\n\t\tparams = parse_parameters tokens\n\t\tcode.push factory(:call, code.pop, 'call', params) if code[0]\n\t when :lbrace\t# explicit code block\n\t\tcode.push factory(:code_block,\n\t\t parse_block(tokens, [ :rbrace ]))\n\t\ttokens.shift if tokens[0]\t# Consume }\n\t end\n\tend\n\n\t(code.size == 1) ? code[0] : factory(:code_seq, code)\n end",
"title": ""
},
{
"docid": "c9d5d0584fdcf5f9037f33a3c5db8f6b",
"score": "0.57841665",
"text": "def parse(rubycode)\n\n self.class.parse(rubycode)\n end",
"title": ""
},
{
"docid": "c63cc683eaad1ad468bb7313561a1d7a",
"score": "0.5606693",
"text": "def parse_codeblocks(html); end",
"title": ""
},
{
"docid": "0b269f20416dd1c9ccbea6fe68661860",
"score": "0.5598257",
"text": "def parse(code, version=1.8, scope=nil)\n PARSER.parse \"<code>\", source(code), config(version, scope)\n end",
"title": ""
},
{
"docid": "ba0068bb4a469e27b96cc435bdce8359",
"score": "0.55779326",
"text": "def parse( spec )\n# print \"parsing #{spec}\\n\"\n case spec\n when \"B\": # contents of box, which is also a leaf of parse tree, so stop recursion\n return spec\n when /^(\\[.+?\\]|\\(.+?\\)|\\{.+?\\})((\\[.+?\\]|\\(.+?\\)|\\{.+?\\})+)$/ # two boxes, parse each\n return parse( $1 ) + parse( $2 )\n when /^(\\[)(.+?)(\\])$/, /^(\\()(.+?)(\\))$/, /^(\\{)(.+?)(\\})$/ # just one box, parse contents\n return $1 + parse($2) + $3\n when /^(\\[|\\(|\\{)(\\[.+?\\]$|\\(.+?\\)$|\\{.+?\\}$|B$)/ # extra opening bracket\n open, rest = $1, $2\n if ( rest =~ /^(\\[.+?\\]|\\(.+?\\)|\\{.+?\\})((\\[.+?\\]|\\(.+?\\)|\\{.+?\\})+)$/ )\n # can't correct if there are more than two possible boxes, so signal error and show possible closures\n raise UncorrectableError.new( open, rest, @spec )\n else\n # there's only one place the missing bracket can go, so put it there and keep parsing\n return open + parse( rest ) + (open == \"[\"? \"]\": open == \"(\"? \")\": \"}\")\n end\n when /^(\\[.+?\\]|\\(.+?\\)|\\{.+?\\}|B)(\\]|\\)|\\})$/ # extra closing bracket\n rest, close = $1, $2\n if ( rest =~ /^(\\[.+?\\]|\\(.+?\\)|\\{.+?\\})((\\[.+?\\]|\\(.+?\\)|\\{.+?\\})+)$/ )\n # can't correct if there are more than two possible boxes, so signal error and show possible closures\n raise UncorrectableError.new( close, rest, @spec )\n else\n # there's only one place the missing bracket can go, so put it there and keep parsing\n return (close == \"]\"? \"[\": close == \")\"? \"(\": \"{\") + parse( rest ) + close\n end\n else\n # no clue, give up\n raise UncorrectableError.new( nil, nil, @spec )\n end\n end",
"title": ""
},
{
"docid": "aec4fdaa6319a47ccfc2ace5fa343e8c",
"score": "0.55711365",
"text": "def brain_luck(code, input = 255.chr)\n output = ''\n memory = [0]\n mp = 0 # memory_pointer (points to current location in memory)\n cp = 0 # code_pointer (points to current code operator)\n ip = 0 # input_pointer (points to current input character)\n\n # manipulate memory or pointer according to the case statement\n # received from the code at the input pointer\n while cp < code.length\n case code[cp]\n\n # '<' and '>' shifts memory pointer to the designated position\n when '<'\n mp -= 1\n if mp < 0\n mp = 0\n memory.unshift(0)\n end\n when '>'\n mp += 1\n memory << 0 if mp >= memory.length\n\n # '+' and '-' increments or decrements memory value at the pointer location\n when '+'\n increment(memory, mp)\n when '-'\n decrement(memory, mp)\n\n # The '[' marks the beginning of a while loop. Because it is simply a marker\n # and doesn't affect the code in any way, I've left it out of the cases.\n # ']' marks the end of a while-loop if the bracket_count = 0 at this marker,\n # the while-loop will end and the input_pointer will move to the next block,\n # if bracket_count != 0, the code_pointer will move back to the previous '['\n # marker and restart the loop.\n when ']'\n if memory[mp] != 0\n bracket_count = 0\n while cp > 0\n cp -= 1\n if code[cp] == ']'\n bracket_count += 1\n elsif code[cp] == '['\n break if bracket_count.zero?\n\n bracket_count -= 1\n end\n end\n end\n\n # a ',' marker will read the value at the current input marker and place\n # that ascii value into the memory array at the memory pointer.\n when ','\n memory[mp] = read_byte(input, ip, memory, mp)\n ip += 1\n\n # a '.' marker will write the data at the current memory location out to\n # the console using the character obtained from the ascii value.\n when '.'\n write_to_output(output, memory, mp)\n end\n cp += 1\n end\n output\nend",
"title": ""
},
{
"docid": "519ed40532a6735ced07a9105cd77a4a",
"score": "0.5567301",
"text": "def do_it(code)\n eval(code)\nrescue SyntaxError #this block would not be called if rescue not qualified with syntax error.\n puts \"Cannot do it!\"\nend",
"title": ""
},
{
"docid": "ee2de028f8cec347f0e8c3eb6e938015",
"score": "0.5554427",
"text": "def parse(code)\n ast = @parser.parse(code)\n\n raise SyntaxError, \"syntax error at : #{@parser.index}\" if !ast\n\n ast\n end",
"title": ""
},
{
"docid": "d12dee4d778456542e4d8e6cc91a1348",
"score": "0.54960406",
"text": "def parse_code_blocks(input,opts={})\n Snippet.reset_themes_used\n doc = Hpricot(input)\n doc.search('code').each do |code|\n code.swap((Snippet.new(code.to_html, opts )).to_html)\n end\n doc.to_html\n end",
"title": ""
},
{
"docid": "a81fe76fd73061486e92a05408b4b5ef",
"score": "0.54737103",
"text": "def parse(scanner)\n raise \"This method hasn't been compiled yet.\"\n end",
"title": ""
},
{
"docid": "39ed7fec59e7e90b15f76fbf50a31cd2",
"score": "0.54656404",
"text": "def parse_code\n @src.pos += @src.matched_size\n @tree.children << Element.new(:code, @src[1])\n end",
"title": ""
},
{
"docid": "39ed7fec59e7e90b15f76fbf50a31cd2",
"score": "0.54656404",
"text": "def parse_code\n @src.pos += @src.matched_size\n @tree.children << Element.new(:code, @src[1])\n end",
"title": ""
},
{
"docid": "1db668b48238f77a7b18e6d384276645",
"score": "0.54548186",
"text": "def interpreter(program)\n skip = Array.new\n program.chars.each_with_index do |char, index|\n next if skip.include?(index)\n case char\n when '>'\n @pointer += 1\n when '<'\n @pointer -= 1 unless @pointer == 0\n when '+'\n @tape[@pointer] += 1\n when '-'\n @tape[@pointer] -= 1\n when '.'\n print @tape[@pointer].chr\n when ','\n @tape[@pointer] = STDIN.getch.ord\n when '['\n program_loop = program[index+1 .. -1]\n until @tape[@pointer] == 0\n stop = interpreter(program_loop)\n end\n skip += (index+1 .. index+1+stop).to_a\n when ']'\n return index\n when '!'\n next unless @debug\n puts \"Code Near Breakpoint\"\n puts program[index-20..index+20] if index > 20\n puts program[0..index+20] if index <= 20\n puts \"BrainFuck Debugger, type help\"\n loop do\n command = STDIN.gets.chomp\n case command\n when \"exit\"\n break\n when \"tape\"\n puts @tape.to_s\n when \"pointer\"\n puts @pointer\n when \"cell\"\n puts @tape[@pointer]\n when \"byebug\"\n byebug\n when \"help\"\n puts \"Commands\"\n puts \"exit - Stops debugger and continues execution\"\n puts \"tape - Display contents of memory tape (all cells)\"\n puts \"pointer - Display the index of the cell currenly selected\"\n puts \"cell - Display contets of cell currently selected\"\n puts \"byebug - Start byebug ruby debugger (debug interpreter)\"\n puts \"\"\n puts \"Type any command, or brainfuck code to execute\"\n else\n interpreter(command)\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "917d672de4bf1c10d1165123c978bbc7",
"score": "0.5454687",
"text": "def interpret(code)\n @parser.parse(code).eval(Runtime)\n end",
"title": ""
},
{
"docid": "4fe9d2e4bd12b69dcb2323d8968eb450",
"score": "0.5418758",
"text": "def run(code)\n\t\t\t@interpreter.run(code)\n\t\tend",
"title": ""
},
{
"docid": "64b5b007dee9cfde9506bffa8183ca4f",
"score": "0.5368111",
"text": "def zephyrum(code)\n #instantiating objects for compiler class\n ruby2ruby = Ruby2Ruby.new\n parser = RubyParser.new\n sexp = parser.process(\"# encoding: utf-8\\n#{code}\")\n ruby_code = ruby2ruby.process(sexp)\n\n \"#{STARTING_CODE}#{ruby_code}\"\n end",
"title": ""
},
{
"docid": "612bd30939d810e5a13f6579078cdce0",
"score": "0.5364089",
"text": "def minilang(program)\n stack = []\n register = 0\n tokens = program.split\n\n tokens.each do |token|\n return puts \"ERROR: #{token} is not a valid token\" unless valid_token?(token)\n return puts \"ERROR: Empty stack\" if stack.empty? && %w(ADD SUB MULT DIV MOD POP).include?(token)\n\n stack, register = execute_command(token, stack, register)\n end\n nil\nend",
"title": ""
},
{
"docid": "f32b1a7d68a938ba7dd19e5040301b71",
"score": "0.53383297",
"text": "def parse_incoming(gcode)\n inputs.execute(gcode)\n end",
"title": ""
},
{
"docid": "aadfc14d08e81fb60bbe9b43ee021e3c",
"score": "0.53262377",
"text": "def deconstruct = [code]",
"title": ""
},
{
"docid": "79310ef3e34861d4aef1129da4660ac6",
"score": "0.52962303",
"text": "def eval_code(eb, check, args, kwargs, code)\n eval(code)\n end",
"title": ""
},
{
"docid": "6429375974dd0f71d57f76e11e2a1705",
"score": "0.52827203",
"text": "def parse(code)\n replace [CommentBlock.new]\n\n code.lines.each do |line|\n case\n when line.strip.start_with?('# ')\n add_comment line.strip[2..-1]\n\n when line.strip.start_with?('#!')\n add_code line\n\n when line.strip.start_with?('#')\n add_comment line.strip[1..-1]\n\n else\n add_code line\n end\n end\n\n end",
"title": ""
},
{
"docid": "7dfcaad0732da54a4dc634df1a95b243",
"score": "0.5276871",
"text": "def run_code(code)\n begin\n return eval(code)\n rescue\n return \"Error: Code doesn't run!\"\n end\n end",
"title": ""
},
{
"docid": "3351db31f6f1ad7104ac26050ca1ab6d",
"score": "0.5272476",
"text": "def optimize\n if @raw_code.nil? || @raw_code.length == 0\n abort(\"Bad code.\")\n end\n \n #bf commands that can be optimized\n opt_comms = ['<', '>', '+', '-']\n \n #special command for the bf nil operator. '[-]' will always zero out the value\n #at the pointer, so shortcut it\n @raw_code = @raw_code.gsub(/\\[-\\]/, '=')\n \n #tranform the bf script into an optimized array, ie\n # \"++++++++++[>+++++++>++++++++++>+++>+<<<<-][-]\" becomes\n # [ '+', 10, '[', X, '>', 1, '+', 7, '>', 1, '+', 10, '>', 1, '+', 3, '>', 1, '+',1, '<', 4, '-', 1,']', X, '=', 0 ]\n i = 0\n while i < @raw_code.length do\n c, t = @raw_code[i, 1], @raw_code[i + 1, 1]\n j = 0\n \n if !(opt_comms.index(c).nil?) && t == c\n while t == c do\n j += 1\n i += 1\n t = @raw_code[i, 1]\n end\n i -= 1\n else\n j += 1\n end\n \n @opt_code.push(c).push(j)\n \n i += 1\n end\n \n stop = false\n i, j, l = 0, 0, 0\n \n #optimize bf loops, find the corresponding ']' to '[', so we can immediately\n #jump to that point instead of constantly having to look it up during run-time\n while i < @opt_code.length do\n l = i\n if @opt_code[i] == '['\n stop, j = false, 0\n until stop do\n i += 2\n case @opt_code[i]\n when ']'\n stop = (j == 0)\n j -= 1\n when '['\n j += 1\n end\n end\n \n @opt_code[l + 1], @opt_code[i + 1] = i, l\n end\n \n i = l\n i += 2\n end\n end",
"title": ""
},
{
"docid": "c20a49153a4d2a6168eb57a5aaff67a3",
"score": "0.52690566",
"text": "def process_code_blocks\n @html.scan(%r{<pre><code.*?>.*?</code></pre>}m).each do |codeblock|\n content = codeblock.match(%r{<pre><code.*?>(.*?)</code></pre>}m)[1]\n lang = codeblock.match(/code class=\"(.*)\"/)\n lang = if lang.nil?\n 'none'\n else\n lang[1].sub('puppet', 'ruby')\n end\n\n confluence_code = <<~HTML\n <ac:structured-macro ac:name=\"code\">\n <ac:parameter ac:name=\"theme\">RDark</ac:parameter>\n <ac:parameter ac:name=\"linenumbers\">true</ac:parameter>\n <ac:parameter ac:name=\"language\">#{lang}</ac:parameter>\n <ac:plain-text-body><![CDATA[#{CGI.unescape_html content}]]></ac:plain-text-body>\n </ac:structured-macro>\n HTML\n\n @html.sub! codeblock, confluence_code\n end\n end",
"title": ""
},
{
"docid": "e96bbad5c2bfcff8fbb76ce10f4738f7",
"score": "0.52648103",
"text": "def parse_code code\n row_code = code[0, 7]\n column_code = code[7, 3]\n\n parse_row_code row_code\n parse_colum_code column_code\n end",
"title": ""
},
{
"docid": "ac1aad4ea13439dc05b7c8bef2395d10",
"score": "0.52636606",
"text": "def brain_luck(code, input)\n output = ''\n cp = 0 # code pointer\n dp = 0 # data pointer\n ip = 0 # input pointer\n data = Array.new(10, 0)\n while cp < code.length\n case code[cp]\n when '>'\n dp += 1\n if dp == data.length\n data.push(0)\n end\n when '<'\n dp -= 1\n if dp == -1\n dp = 0\n data.unshift(0)\n end\n when '+'\n data[dp] = (data[dp].ord+1)%256\n when '-'\n data[dp] = (data[dp].ord-1)%256\n when '.'\n output += data[dp].chr\n when ','\n data[dp] = input[ip].ord\n ip += 1\n when '['\n if data[dp] == 0\n nest_count = 1\n while nest_count > 0\n case code[cp += 1]\n when '[' then nest_count += 1\n when ']' then nest_count -= 1\n end\n end\n end\n when ']'\n if data[dp] != 0\n nest_count = 1\n while nest_count > 0\n case code[cp -= 1]\n when ']' then nest_count += 1\n when '[' then nest_count -= 1\n end\n end\n end\n end\n cp += 1\n end\n output\nend",
"title": ""
},
{
"docid": "91ecf3f9794441dadd8d070369823d79",
"score": "0.5263034",
"text": "def rubyme(code)\n\t\tbegin\n\t\t\tprint_line(\"#{eval(\"#{code}\")}\")\n\t\trescue NoMethodError => e\n\t\t\tprint_error(\"#{e}\")\n\t\trescue NameError => e\n\t\t\tprint_error(\"#{e}\")\n\t\trescue SyntaxError => e\n\t\t\tprint_error(\"#{e}\")\n\t\trescue TypeError => e\n\t\t\tprint_error(\"#{e}\")\n\t\tend\n\tend",
"title": ""
},
{
"docid": "275d844113178230828b4b5da3cfaee8",
"score": "0.5260159",
"text": "def parse(code)\n parser = Puppet::Pops::Parser::Parser.new()\n parser.parse_string(code)\n end",
"title": ""
},
{
"docid": "2ba9c10e65e160c69343c4b4767fc7c6",
"score": "0.5251347",
"text": "def usage()\n print \"* * * Brainfuck Interpreter in Ruby * * *\\n\"\n print \"Kuba 'kubar3k' Porębski proudly presents to you.\\n\"\n print \"Usage: brainfuck.rb [options]\\n\"\n print \"Options are:\\n\"\n print \"-m\\tmemory size\\n\"\n print \"-f\\tinput file with Brainfuck source code\\n\"\n print \"-i\\tinput Brainfuck source code\\n\"\n print \"-om\\toutput memory\\n\"\n print \"-oi\\toutput memory index\\n\"\n\n print \"\\n\"\nend",
"title": ""
},
{
"docid": "a4eec4203570ba93a13d6da3fd6bf12e",
"score": "0.5243397",
"text": "def try_code\n result = eval(params[:code])\n render_result(result)\n end",
"title": ""
},
{
"docid": "8ef11d988c22229d337b4c3495d47f66",
"score": "0.5223588",
"text": "def parse(source_buffer); end",
"title": ""
},
{
"docid": "1023299d572aea8b01e091d1bbafa1fe",
"score": "0.52199864",
"text": "def initialize(code = '', input = '')\n Preprocessor.check code\n Preprocessor.sanitize! code\n @parser = Parser.new code\n @tape = Array.new SIZE, 0\n @cell = 0\n end",
"title": ""
},
{
"docid": "10fe35e779b99ba5e10600e68bf522de",
"score": "0.52143073",
"text": "def parse_codeblocks(html)\n html.gsub(%r{<pre((?:\\s+\\w+=\"(?:.+?)\")*)\\s*>(?:\\s*<code((?:\\s+\\w+=\"(?:.+?)\")*)\\s*>)?(.+?)(?:</code>\\s*)?</pre>}m) do\n string = $3\n\n # handle !!!LANG prefix to send to html_syntax_highlight_LANG\n language, = parse_lang_for_codeblock(string)\n language ||= detect_lang_in_codeblock_attributes($1, $2)\n language ||= object.source_type\n\n if options.highlight\n string = html_syntax_highlight(CGI.unescapeHTML(string), language)\n end\n classes = ['code', language].compact.join(' ')\n %(<pre class=\"#{classes}\"><code class=\"#{language}\">#{string}</code></pre>)\n end\n end",
"title": ""
},
{
"docid": "542ecf7cf122c781239fa81ba9124763",
"score": "0.52099884",
"text": "def parse_code\n write_attribute(:parsed_code, Marshal::dump(Liquid::Template.parse(self.code)))\n end",
"title": ""
},
{
"docid": "d6d5ebad12ea6bcec05d99632ee398b4",
"score": "0.5202079",
"text": "def run\n show_result @parser_class.parse!(ARGF.read)\n rescue Rattler::Runtime::SyntaxError => e\n puts e\n end",
"title": ""
},
{
"docid": "5a72addf828eb2c393a4313c2bb84ade",
"score": "0.51966864",
"text": "def parse_lines\n\t\t\t#\"TOKENIZE\" THE PROGRAM (HAHA)\n\t\t\t@program = params[:post][:code].split(\"\\r\\n\")\n\t\t\tmem_method(program)\n\t\tend",
"title": ""
},
{
"docid": "66e3870fbcae2ce4424589337d5551fd",
"score": "0.5193959",
"text": "def extractCodeblock( *args )\r\n rval = scanCodeblock( *args ) or return nil\r\n return rval[:match]\r\n end",
"title": ""
},
{
"docid": "05aa7f9953abe67304eae2b70c6f6861",
"score": "0.517557",
"text": "def handle_code_b(data)\n indata = data.dup\n outdata = CODEB.dup #We know this is going to start with Code B\n while char = indata.slice!(0)\n if control_character?(char) #Found a control character (Code A)\n if control_before_lowercase?(indata) #There is another control character before any lowercase, so\n outdata << handle_code_a(char+indata) #switch over to Code A.\n break\n else\n outdata << SHIFT << char #Can use a shift to only encode this char as Code A\n end\n else\n outdata << char\n end\n end#while\n\n outdata\n end",
"title": ""
},
{
"docid": "45aedd9dc7f30ae8eb2beb551ed103d6",
"score": "0.51666754",
"text": "def blanky_code_block!(input)\n input.gsub!(REGEX_CODE_BLOCK) do\n data = $LAST_MATCH_INFO\n ticks = b(:ticks, data: data)\n lang = b(:lang, data: data)\n\n if strip_code_blocks?\n prettify? ? \"\" : ticks + lang + \"\\n\" + b(:code, data: data) + \"\\n\" + ticks\n else\n ticks + lang + \"\\n\" + m(:code, data: data) + \"\\n\" + ticks\n end\n end\n end",
"title": ""
},
{
"docid": "5c300c782060c289a7933bb53f763dd6",
"score": "0.5163311",
"text": "def run(code)\r\n # create copy of the room\r\n copy = code.clone\r\n # execute the code\r\n do_instruction_list(copy, true)\r\n end",
"title": ""
},
{
"docid": "478942d63e7b686dd3c08446f0eb28f9",
"score": "0.5162884",
"text": "def parse(code)\n md5 = Digest::MD5.new\n md5 << code\n\n codeHASH = md5.hexdigest\n \n if @@parse_code_cache[codeHASH]\n return @@parse_code_cache[codeHASH]\n end\n\n # puts \"parse #{codeHASH}\"\n\n # gets info from the code: variables, constants, funcitons etc.\n # we might include data from the AST here ...\n filter_data = Filter.filters.reduce({}) { |info, filter|\n info.merge(filter.parse(code))\n }\n\n _code = \"#{code}\"\n import_lines = extractImports! _code\n\n beforeTemplate = ERB.new(beforeERB)\n beforeCode = beforeTemplate.result(binding)\n\n _code = \"#{import_lines}\\n#{beforeCode}\\n#{code}\"\n\n # puts \"&\" * 50\n # puts code\n # puts \"&\" * 50\n\n ast = get_ast _code\n\n variables = variables_from(ast)\n\n filter_data[:variables] = variables\n\n filter_data[:functions] = functions_from(ast)\n\n filter_data[:missingFunctions] = missingFunctions(ast)\n\n filter_data[:wrongFunctionDeclarations] = wrongFunctionDeclarations(ast)\n\n filter_data[:missingFunctionCalls] = missingFunctionCalls(ast)\n\n filter_data[:invalidFunctionCallCounts] = invalidFunctionCallCounts(ast)\n\n filter_data[:invalidTypeCounts] = invalidTypeCounts(ast)\n\n if includeFunctionCall\n filter_data[:functionCall] = get_function_call(_code)\n end\n\n nonRecursiveFunctions = \n expectedFunctions.select { |definition, options|\n if options[:recursive] == true\n fname = definition.split(\"(\").first\n is_function_recursive(fname, ast) == false\n else\n false\n end\n }.map { |definition, options|\n definition.split(\"(\").first\n }\n\n filter_data[:nonRecursiveFunctions] = nonRecursiveFunctions\n\n foundEnums = enums_from(ast)\n\n filter_data[:enums] = foundEnums\n\n filter_data[:missingEnums] = missingEnums(foundEnums)\n \n filter_data[:expectedDeclarations] = (expectedDeclarations + expectedDeclationValues).map { |x, y| x } \n filter_data[:substitutedDeclarations] = declarations\n filter_data[:expectsOutput] = requiresOutput\n\n filter_data[:expectedDeclarationValues] = expectedDeclationValues\n \n\n if expectedOutput != nil\n filter_data[:expectedOutput] = expectedOutput\n end\n\n filter_data.merge!({\n # include missing variables in the parse info\n missingDeclarations: missingOutputDeclarations(ast).map { |variable, message|\n variables.each do |var, type|\n if is_typo variable, var\n message = \"You have a typo: #{var} -> #{variable}\"\n end\n end\n [variable, message]\n }\n })\n\n parseInfo = filter_data\n\n # puts JSON.pretty_generate(filter_data)\n # puts JSON.pretty_generate(ast)\n\n # exit\n\n @@parse_code_cache[codeHASH] = parseInfo\n\n parseInfo\n end",
"title": ""
},
{
"docid": "b69de8794eaa9b1275d96040ecc1ffb5",
"score": "0.5145738",
"text": "def evaluate( code_ = nil )\n if code_.nil?\n if buffer_current.changing_selection\n selected_text = buffer_current.copy_selection[ 0 ]\n end\n code = get_user_input(\n \"Ruby code: \",\n history: @rlh_general,\n initial_text: selected_text || \"\",\n completion_array: ::Diakonos::Functions.public_instance_methods.map { |m| m.to_s }\n )\n else\n code = code_\n end\n\n if code\n begin\n eval code\n rescue Exception => e\n show_exception(\n e,\n [\n \"The code given to evaluate has a syntax error.\",\n \"The code given to evaluate refers to a Diakonos command which does not exist, or is misspelled.\",\n \"The code given to evaluate refers to a Diakonos command with missing arguments.\",\n \"The code given to evaluate refers to a variable or method which does not exist.\",\n ]\n )\n end\n end\n end",
"title": ""
},
{
"docid": "bc6fb1c9d8b45744f168375150236eb6",
"score": "0.5141968",
"text": "def execute(parser)\r\n # Make sure we are in :Execute mode.\r\n check_mode([:Execute])\r\n \r\n #Set up compiler control data\r\n save_parser = @parser\r\n @parser, @level, @quotes, @buffer = parser, @level+1, 0, nil\r\n\r\n #Begin the real work of executing code!\r\n begin\r\n loop do\r\n next_word = @parser.get_word \r\n break if parser.source.eof?\r\n\r\n begin\r\n process_string(next_word) if next_word[-1] == '\"'\r\n process = process_word?(next_word) || process_numeric?(next_word)\r\n abort(\"?#{next_word}?\") unless process\r\n rescue XfOOrthError => e\r\n abort(\"Error detected: #{e}\")\r\n rescue ZeroDivisionError => z\r\n abort(\"Division by Zero detected.\") \r\n rescue TypeError => t\r\n abort(\"Type conversion error detected. #{t}\") \r\n end\r\n end\r\n end\r\n \r\n #Restore compiler settings.\r\n @parser, @level, @quotes, @buffer = save_parser, @level-1, 0, nil\r\n end",
"title": ""
},
{
"docid": "132e0d587de2c601ae1a444fcc4c974d",
"score": "0.51407856",
"text": "def process_coderay!\n processed_content.gsub!(CODE_REGEXP) do\n code = ($~[:code] || '').strip\n lang = $~[:lang]\n \"<notextile>#{CodeRay.scan(code, lang).html.div(:css => :class)}</notextile>\"\n end\n end",
"title": ""
},
{
"docid": "6d3cc7390c5a0cf832b8e211b1dd7955",
"score": "0.5127927",
"text": "def parse_ruby_code(outer_delimiters, allow_multiline: false)\n code = String.new\n end_re = if outer_delimiters.is_a?(Regexp)\n outer_delimiters\n else\n /\\A\\s*[#{Regexp.escape outer_delimiters.to_s}]/\n end\n\n delimiters = []\n string_start_quote_char = nil\n\n loop do\n break if !allow_multiline && @line.empty?\n break if allow_multiline && @line.empty? && (@lines && @lines.empty?)\n break if delimiters.empty? && @line =~ end_re\n\n if @line.empty? && allow_multiline && !(@lines && @lines.empty?)\n next_line\n code << \"\\n\"\n end\n\n char = @line[0]\n\n # backslash escaped delimiter\n if char == '\\\\' && RUBY_ALL_DELIMITERS.include?(@line[1])\n code << @line.slice!(0, 2)\n next\n end\n\n case char\n when RUBY_START_DELIMITERS_RE\n if RUBY_NOT_NESTABLE_DELIMITERS.include?(char) && delimiters.last == char\n # end char of not nestable delimiter\n delimiters.pop\n string_start_quote_char = nil\n else\n # diving into nestable delimiters\n delimiters << char if string_start_quote_char.nil?\n\n # mark start char of the not nestable delimiters, for example strings\n if RUBY_NOT_NESTABLE_DELIMITERS.include?(char) && string_start_quote_char.nil?\n string_start_quote_char = char\n end\n end\n\n when RUBY_END_DELIMITERS_RE\n # rising\n delimiters.pop if char == RUBY_DELIMITERS_REVERSE[delimiters.last]\n end\n\n code << @line.slice!(0)\n end\n\n syntax_error('Unexpected end of ruby code') unless delimiters.empty?\n\n code.strip\n end",
"title": ""
},
{
"docid": "bc6e2e30398b2b789446af2bacf87cde",
"score": "0.5125838",
"text": "def run(s)\n out = s\n out.scan(/\\[code lang=(.+?)\\](.+?)\\[\\/code\\]/m).each do |lang, parse|\n out = out.gsub(\"[code lang=#{lang}]#{parse}[/code]\", parse(lang, parse))\n end\n return out\n end",
"title": ""
},
{
"docid": "efda5b767f6b71806fb151c4bf033c0c",
"score": "0.5118766",
"text": "def run_code(_code = nil)\n #This is a stub, used for indexing\nend",
"title": ""
},
{
"docid": "19ad43d63ec16fe86fb3e378829d6508",
"score": "0.5116575",
"text": "def block_code(code, language)\n language ||= :plaintext\n CodeRay.scan(code, language).div\n end",
"title": ""
},
{
"docid": "e1eea5603fd0c1f069ec1aa81a0c7c87",
"score": "0.5106862",
"text": "def set_code(input)\n @code = input.split(\"\")\n end",
"title": ""
},
{
"docid": "0f8597846dabbc602302732f1b6ea547",
"score": "0.51057446",
"text": "def call_chunk(code_chunk)\n code_chunk.call\nend",
"title": ""
},
{
"docid": "4efa3b28a8f87afef29538b2d8c7d3f3",
"score": "0.5088342",
"text": "def rbrack!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 42 )\n\n\n\n type = RBRACK\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 84:9: ']'\n match( 0x5d )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 42 )\n\n\n end",
"title": ""
},
{
"docid": "51651c1f2b3b080d4c44bd52afed7571",
"score": "0.50811887",
"text": "def parse(source); end",
"title": ""
},
{
"docid": "51651c1f2b3b080d4c44bd52afed7571",
"score": "0.50811887",
"text": "def parse(source); end",
"title": ""
},
{
"docid": "51651c1f2b3b080d4c44bd52afed7571",
"score": "0.50811887",
"text": "def parse(source); end",
"title": ""
},
{
"docid": "51651c1f2b3b080d4c44bd52afed7571",
"score": "0.50811887",
"text": "def parse(source); end",
"title": ""
},
{
"docid": "51651c1f2b3b080d4c44bd52afed7571",
"score": "0.50811887",
"text": "def parse(source); end",
"title": ""
},
{
"docid": "51651c1f2b3b080d4c44bd52afed7571",
"score": "0.50811887",
"text": "def parse(source); end",
"title": ""
},
{
"docid": "8f33d9c588dcc185e12cfe015dfc6677",
"score": "0.50811005",
"text": "def rbrack!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 110 )\n\n\n\n type = RBRACK\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 270:10: ']'\n match( 0x5d )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 110 )\n\n\n end",
"title": ""
},
{
"docid": "bd72610a5e7a15643ab4da6a7b680afe",
"score": "0.5079728",
"text": "def check_for_matching_braces\n\t\t\tbrace_counter = 0\n\t\t\t@code.each_char do |char|\n\t\t\t\tif char == \"[\"\n\t\t\t\t\tbrace_counter += 1\n\t\t\t\telsif char == \"]\"\n\t\t\t\t\tbrace_counter -= 1\n\t\t\t\t\tif brace_counter < 0\n\t\t\t\t\t\t@output_stream.puts \"Unmatched ]\"\n\t\t\t\t\t\treturn false\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\tif brace_counter > 0\n\t\t\t\t@output_stream.puts \"Unmatched [\"\n\t\t\t\treturn false\n\t\t\tend\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "b6007f8f7026d366f53f683d3455975f",
"score": "0.50763506",
"text": "def block_code(code, language)\n debug \"~~BLOCK CODE~~\"\n code.chomp\n end",
"title": ""
},
{
"docid": "6a7045cd5ad04317c02da3be427a5dcb",
"score": "0.50704575",
"text": "def bbparse(text, safe=:safe)\n #workaround: since the new version, everything is passed through the sanitizer gem\n #as result, '<' and '>' are not escaped anymore, if they appear to be part of a tag\n #so escape them right here:\n text = text.gsub(/</, \"<\").gsub(/>/, \">\")\n\t#parse the bbcode\n bbparser = RbbCode.new\n htmlcode = bbparser.convert(text)\n return htmlcode.html_safe if safe == :safe\n return htmlcode\nend",
"title": ""
},
{
"docid": "698d30473cea4ea5822ce85f1d0a41be",
"score": "0.5067073",
"text": "def parse(buffer)\n instance_exec(buffer, &parser)\n end",
"title": ""
},
{
"docid": "cba82b4e0e4ae7229b7ebe284305b6b1",
"score": "0.50613225",
"text": "def run_code!\n run_code.each { |c| c.call }\n end",
"title": ""
},
{
"docid": "8941c75fcbdca59721d1797dcb1df028",
"score": "0.5053924",
"text": "def parse_code(line)\n line.gsub(\"```\", \"\")\n end",
"title": ""
},
{
"docid": "2e078fd6a8e663b95efbb6dca66f53a1",
"score": "0.5044355",
"text": "def parse_lang_for_codeblock(source); end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.5043022",
"text": "def code; end",
"title": ""
},
{
"docid": "1186c04767166919a8f8a27bb65370a0",
"score": "0.5029318",
"text": "def execute(parser)\r\n # Make sure we are in :Execute mode.\r\n check_mode([:Execute])\r\n \r\n #Set up compiler control data\r\n save_parser = @context[:parser]\r\n @context[:parser] = parser\r\n @context[:level] += 1\r\n @context[:quotes] = 0\r\n\r\n #Begin the real work of executing code!\r\n begin\r\n loop do\r\n next_word = @parser.get_word \r\n break if parser.source.eof?\r\n\r\n begin\r\n process_string(next_word) if next_word[-1] == '\"'\r\n process = process_word?(next_word) || process_numeric?(next_word)\r\n abort(\"?#{next_word}?\") unless process\r\n rescue XfOOrthError => e\r\n abort(\"Error detected: #{e}\")\r\n rescue ZeroDivisionError => z\r\n abort(\"Division by Zero detected.\") \r\n rescue TypeError => t\r\n abort(\"Type conversion error detected. #{t}\") \r\n end\r\n end\r\n end\r\n \r\n #Restore compiler settings.\r\n @context[:parser] = save_parser\r\n @context[:level] -= 1\r\n @context[:quotes] = 0\r\n end",
"title": ""
},
{
"docid": "9aede94cbac9ec92289957450e15fc3f",
"score": "0.5018188",
"text": "def code(s)\n # your code\nend",
"title": ""
},
{
"docid": "3737f54900b12fee220508cfce560bb2",
"score": "0.5017525",
"text": "def parse(tokens, tree=[])\n token = tokens.shift\n case token\n when \"(\"; parse_block(tokens, tree)\n else; parse_token(token)\n end\n end",
"title": ""
},
{
"docid": "3cfb7bfbb51323f39d4fb80fb705fd39",
"score": "0.50037545",
"text": "def scan(code, lang, options = T.unsafe(nil), &block); end",
"title": ""
},
{
"docid": "7bc2b50a81746c2491c4336fc68c15bc",
"score": "0.5003424",
"text": "def do_run\n return unless @output\n\n @output_buffer = []\n @output.value = ''\n @editor.focus\n source = @editor.value.strip\n return unless source\n\n # Add additional code if available\n if @loaded && @current_item && @current_item.load_code\n source = \"#{@current_item.load_code}\\n#{source}\"\n end\n\n # Run\n eval_code source\n end",
"title": ""
},
{
"docid": "0f759e10ebd6a528379a1ad4f6c7ff6b",
"score": "0.50022537",
"text": "def run(code,file=nil,line=nil)\n @runner.run(code,file,line)\n end",
"title": ""
},
{
"docid": "678b188c5e3df01b5594d3456fb314d4",
"score": "0.5001069",
"text": "def parse!; end",
"title": ""
},
{
"docid": "2f0a0fb2a1a1545be4cb3ee24a19b0ec",
"score": "0.49970645",
"text": "def run(memory)\n pointer = 0\n\n loop do\n raw_code = memory[pointer]\n break if raw_code == HALT\n\n opcode, modes = args_parser(raw_code)\n\n command = INSTRUCTIONS[opcode]\n parameters = memory.slice((pointer + 1)..(pointer + command.arity - 3))\n\n shift = command.call(pointer, modes, memory, *parameters)\n\n pointer = shift\n end\n\n memory\nend",
"title": ""
}
] |
b176f7d0fb20360fae4d919b7906f69c
|
Features (part of gene: CDS, mRNA, misc_RNA, precursor_RNA, ncRNA, tRNA, rRNA)
|
[
{
"docid": "b6a7e590a0d2d0eaa4c4f362df309f49",
"score": "0.63212633",
"text": "def parse_features\n features = @features.select {|x| x.feature != \"gene\" }\n\n features.each do |feat|\n feature_id = new_uuid\n hash = feat.to_hash\n\n feature = feat.feature\n @feature_count[feature] += 1\n\n case feature\n when \"CDS\"\n puts triple(feature_id, \"rdf:type\", \"obo:SO_0000316\") + \" # SO:CDS\"\n when \"mRNA\"\n puts triple(feature_id, \"rdf:type\", \"obo:SO_0000234\") + \" # SO:mRNA\"\n when \"misc_RNA\"\n puts triple(feature_id, \"rdf:type\", \"obo:SO_0000673\") + \" # SO:transcript\"\n when \"precursor_RNA\"\n puts triple(feature_id, \"rdf:type\", \"obo:SO_0000185\") + \" # SO:primary_transcript\"\n when \"ncRNA\"\n puts triple(feature_id, \"rdf:type\", \"obo:SO_0000655\") + \" # SO:ncRNA\"\n when \"tRNA\"\n puts triple(feature_id, \"rdf:type\", \"obo:SO_0000253\") + \" # SO:tRNA\"\n when \"rRNA\"\n puts triple(feature_id, \"rdf:type\", \"obo:SO_0000252\") + \" # SO:rRNA\"\n else\n if so_id = @ft_so.so_id(feature)\n if so_id != \"undefined\"\n so = so_id.sub(':', '_')\n puts triple(feature_id, \"rdf:type\", \"obo:#{so}\") + \" # SO:#{@ft_so.so_term(feature)}\"\n else\n puts triple(feature_id, \"rdf:type\", \"obo:SO_0000110\") + \" # SO:sequence_feature\"\n end\n end\n end\n\n gene_id = locus_tag = gene = nil\n if hash[\"locus_tag\"]\n if locus_tag = hash[\"locus_tag\"].first\n gene_id = @gene[locus_tag]\n end\n elsif hash[\"gene\"]\n if gene = hash[\"gene\"].first\n gene_id = @gene[gene]\n end\n end\n\n puts triple(feature_id, \"rdfs:label\", quote(locus_tag || gene || feature))\n puts triple(feature_id, \"obo:so_part_of\", gene_id || @sequence_id)\n\n if gene_id\n subpart_type = { :id => \"obo:SO_0000147\", :term => \"SO:exon\" }\n else\n subpart_type = { :id => \"obo:SO_0000001\", :term => \"SO:region\" }\n end\n\n loc_id, subparts = new_location(feat.position, subpart_type)\n puts triple(feature_id, \"faldo:location\", loc_id)\n unless subparts.empty?\n puts triple(feature_id, \"obo:so_has_part\", \"(#{subparts.join(' ')})\") # rdf:List\n end\n\n parse_qualifiers(feature_id, hash)\n end\n $stderr.puts \"Features: #{@feature_count.to_json}\"\n end",
"title": ""
}
] |
[
{
"docid": "88fcea362cbf4b690a3294e285aa104a",
"score": "0.7073551",
"text": "def features; end",
"title": ""
},
{
"docid": "88fcea362cbf4b690a3294e285aa104a",
"score": "0.7073551",
"text": "def features; end",
"title": ""
},
{
"docid": "0cc7621c219288c0ce73117797fa974c",
"score": "0.69077784",
"text": "def features\n end",
"title": ""
},
{
"docid": "e2fb15a9d03eb0cbaea606e0cf5ed73d",
"score": "0.6584802",
"text": "def add_features(biosequence, gene_id, plus_target_positions, minus_target_positions)\n chr_num = biosequence.definition.match(/chromosome\\s(\\d)/)[1]\n chr_init_pos = biosequence.definition.match(/(\\d+)\\.\\.\\d+/)[1].to_i \n for target in plus_target_positions\n feature = Bio::Feature.new(\"targeting_vector\",\"#{target[0]}..#{target[1]}\")\n feature.append(Bio::Feature::Qualifier.new(\"seqid\", gene_id))\n feature.append(Bio::Feature::Qualifier.new(\"strand\", \"+\"))\n feature.append(Bio::Feature::Qualifier.new(\"chromosome\", chr_num))\n feature.append(Bio::Feature::Qualifier.new(\"chromosome_position\", chr_init_pos))\n biosequence.features << feature\n end\n for target in minus_target_positions\n feature = Bio::Feature.new(\"targeting_vector\",\"complement(#{target[0]}..#{target[1]})\")\n feature.append(Bio::Feature::Qualifier.new(\"seqid\", gene_id))\n feature.append(Bio::Feature::Qualifier.new(\"strand\", \"-\"))\n feature.append(Bio::Feature::Qualifier.new(\"chromosome\", chr_num))\n feature.append(Bio::Feature::Qualifier.new(\"chromosome_position\", chr_init_pos))\n biosequence.features << feature\n end \n return biosequence\nend",
"title": ""
},
{
"docid": "50ee230ffd7635e8600ddb1a108ea025",
"score": "0.63802075",
"text": "def features\r\n\t\t@features.map{|feature| feature}\r\n\tend",
"title": ""
},
{
"docid": "7d4b398d766bfe8ed893f0047886f01f",
"score": "0.63501114",
"text": "def features\n FEATURES\n end",
"title": ""
},
{
"docid": "2177334b3b6f693f765eec9e3c1c8665",
"score": "0.634972",
"text": "def feature; end",
"title": ""
},
{
"docid": "4572b48f2de8fb38e839737b3730bffa",
"score": "0.63490754",
"text": "def features\n [2]\n end",
"title": ""
},
{
"docid": "761cbbcf9fed0f7195d06676f0c6ca54",
"score": "0.631037",
"text": "def clinical_features_processor(line)\n\t\tline.strip.scan(/Clinical Features/) do |match|\n\t\t\treturn [\"on\",line.strip]\n\t\tend\n\t\treturn [\"off\",line.strip]\n\tend",
"title": ""
},
{
"docid": "b8b42de83ed90de5237291956ccb28b2",
"score": "0.6239673",
"text": "def chromosome_features (gene_id, seq)\r\n\r\n #We take the information of genes that is in primary_accession separate for \":\"\r\n chrom_array = seq.primary_accession.split(\":\")\r\n\r\n\r\n $chromosomes_gff3.puts \"#{chrom_array[2]}\\t.\\tgene\\t#{chrom_array[3]}\\t#{chrom_array[4]}\\t.\\t+\\t.\\tID=#{gene_id}\"\r\n\r\n return [chrom_array[2], chrom_array[3], chrom_array[4]]\r\n\r\nend",
"title": ""
},
{
"docid": "4b9ff833d6bc8c2d4b2294b10881b0e4",
"score": "0.61481327",
"text": "def __features__\n @__features__\n end",
"title": ""
},
{
"docid": "70cae13e9b5efa638137235323f5193d",
"score": "0.614491",
"text": "def features=(_arg0); end",
"title": ""
},
{
"docid": "01c12b799e5a40cbd0d8dda012dec11a",
"score": "0.6129366",
"text": "def loaded_features; end",
"title": ""
},
{
"docid": "a10ffe3c7ccee19f8954f50327fe3c23",
"score": "0.6116685",
"text": "def features\n @features ||= []\n end",
"title": ""
},
{
"docid": "a10ffe3c7ccee19f8954f50327fe3c23",
"score": "0.6116685",
"text": "def features\n @features ||= []\n end",
"title": ""
},
{
"docid": "00b1d60aa37e2d4bba5480b3ce5e8773",
"score": "0.61014503",
"text": "def features\n if @features then\n return @features\n end\n\n @features = (0...@nFeatureEntries).map do |i|\n start = 16 + i * 12\n featureType, featureSetting, enableFlags, disableFlags = @bytes[start, 8].unpack('nnnn')\n\n Feature.new(\n featureType: featureType,\n featureSetting: featureSetting,\n enableFlags: enableFlags,\n disableFlags: disableFlags,\n )\n end\n end",
"title": ""
},
{
"docid": "7fc2c77b1128c0b68dce87a2ce8878b5",
"score": "0.6074185",
"text": "def getFtsRNA\n output = \"Accessiont\\tSeqBeg\\tSeqEnd\\tStrand\\tPartial\\tProtID\\tLocusTag\\tGene\\tProt-Product\\n\"\n @genbanks.each_entry do |gb|\n gb.features do |ft|\n next if ! ft.feature.to_s.include? \"RNA\"\n ftH = ft.to_hash\n loc = ft.locations\n seqBeg = loc[0].from.to_s\n seqEnd = loc[0].to.to_s\n strand = loc[0].strand.to_s\n partial = 0\n if loc[0].gt or loc[0].lt\n partial = 1\n end\n gene = []\n product = []\n protId = \"\"\n gene = ftH[\"gene\"] if !ftH[\"gene\"].nil?\n product = ftH[\"product\"] if !ftH[\"product\"].nil?\n protId = ftH[\"protein_id\"].join(\",\") if !ftH[\"protein_id\"].nil?\n locustag = ftH[\"locus_tag\"][0] if !ftH[\"locus_tag\"].nil?\n output += \"#{gb.accession}\\t#{seqBeg}\\t#{seqEnd}\\t#{strand}\\t#{partial}\\t#{protId}\\t#{locustag}\\t#{gene[0]}\\t#{product[0]}\\n\"\n end\n end\n return output\n end",
"title": ""
},
{
"docid": "bbe375251b7a4b06bed80fc42e322181",
"score": "0.60557294",
"text": "def features\n C.get_target_machine_feature_string(self)\n end",
"title": ""
},
{
"docid": "74e64e1bd5eab128c1f20edd3296eea3",
"score": "0.6055538",
"text": "def features\n read_feature_keys\n end",
"title": ""
},
{
"docid": "f89baacd9fc2a791e5605d9ac230a036",
"score": "0.6046244",
"text": "def create_bio_feature(gene, annotations, merge_contigs)\n if merge_contigs\n cds = Bio::Feature.new('CDS', gene.location)\n else\n cds = Bio::Feature.new('CDS', gene.relative_location)\n end\n unless annotations.empty?\n annotations.each do |annotation|\n cds.append(Bio::Feature::Qualifier.new(\"#{annotation.qualifier}\", \"#{annotation.value}\"))\n end\n end\n cds.append(Bio::Feature::Qualifier.new(\"note\", \"gene number: #{gene.name}\"))\n return cds\n end",
"title": ""
},
{
"docid": "dafdc91475faef58b307ba15ddc4826b",
"score": "0.603782",
"text": "def item_features(item, code)\n item.features.select {|ft| ft.code == code && feature_condition_met?(ft)}\n end",
"title": ""
},
{
"docid": "09f2526a2a329ae647914cf7c461204a",
"score": "0.6024815",
"text": "def write_features(biosequences)\n gene_lines = []\n chr_lines = []\n for biosequence in biosequences\n for feature in biosequence.features\n if feature.feature == \"targeting_vector\"\n start_gene = feature.position.match(/(\\d+)\\.\\./)[1].to_i\n finish_gene = feature.position.match(/\\.\\.(\\d+)/)[1].to_i\n start_chr = feature.assoc[\"chromosome_position\"] + start_gene - 1\n finish_chr = feature.assoc[\"chromosome_position\"] + finish_gene - 1\n gene_line = \"Chr#{feature.assoc[\"chromosome\"]}\\t.\\t#{feature.feature}\\t#{start_gene}\\t#{finish_gene}\\t.\\t#{feature.assoc[\"strand\"]}\\t.\\tID=#{feature.assoc[\"seqid\"]}\"\n chr_line = \"Chr#{feature.assoc[\"chromosome\"]}\\t.\\t#{feature.feature}\\t#{start_chr}\\t#{finish_chr}\\t.\\t#{feature.assoc[\"strand\"]}\\t.\\tID=#{feature.assoc[\"seqid\"]}\"\n gene_lines << gene_line\n chr_lines << chr_line\n end\n end\n end\n return gene_lines, chr_lines\nend",
"title": ""
},
{
"docid": "616bb9b1da286b4a0cade06587a80d9b",
"score": "0.60221165",
"text": "def features\n features = []\n\n object.features.each do |feature|\n features << [feature.name, feature.long_description]\n end\n\n return features\n end",
"title": ""
},
{
"docid": "d44d3f33884a4ac6dff8343741ba0e1a",
"score": "0.5994642",
"text": "def features=(value)\n @features = value\n end",
"title": ""
},
{
"docid": "7d7ae043e37ace3889f666e3af2a7edf",
"score": "0.59943783",
"text": "def add_features_embl(gene_id, hash_features, seq)\r\n\r\n exon_features = []\r\n\r\n hash_features.each do |position, exonid_strand| ####BUENO\r\n\r\n features = Bio::Feature.new(\"#{$match.upcase}_in_exon\", \"#{position[0]}..#{position[1]}\")\r\n\r\n features.append(Bio::Feature::Qualifier.new('nucleotide motif', \"#{$match.upcase}_in_#{exonid_strand[0]}\"))\r\n\r\n features.append(Bio::Feature::Qualifier.new('strand', exonid_strand[1]))\r\n\r\n $genes_gff3.puts \"#{gene_id}\\t.\\t#{features.feature}\\t#{position[0]}\\t#{position[1]}\\t.\\t#{exonid_strand[1]}\\t.\\tID=#{exonid_strand[0]}\"\r\n\r\n exon_features << features\r\n end\r\n\r\n seq.features.concat(exon_features)\r\nend",
"title": ""
},
{
"docid": "13ab332b7661b441ac567d45b2c028d8",
"score": "0.5992579",
"text": "def processor_features\n data[:processor_features]\n end",
"title": ""
},
{
"docid": "6faf2f88aca42927c656899cb5826645",
"score": "0.594757",
"text": "def features\n if @features.nil?\n if ! embedded['features'].nil?\n @features = embedded['features'].map do |f|\n Lionactor::Feature.new(f)\n end\n end\n end\n\n @features\n end",
"title": ""
},
{
"docid": "93394f7e6085dcffdf92a513f9d15bff",
"score": "0.59191555",
"text": "def features\n {\n ignores_supplied_ids:false,\n is_persistent:false,\n is_rdf_model:false,\n is_wrapper:false,\n supports_boolean_property:true,\n supports_double_property:true,\n supports_duplicate_edges:true,\n supports_edge_index:false,\n supports_edge_iteration:true,\n supports_edge_key_index:false,\n supports_float_property:true,\n supports_indices:false,\n supports_integer_property:true,\n supports_key_indices:false,\n supports_long_property:true,\n supports_map_property:true,\n supports_mixed_list_property:true,\n supports_primitive_array_property:true,\n supports_self_loops:true,\n supports_serializable_object_property:true,\n supports_string_property:true,\n supports_threded_transactions:false,\n supports_transactions:false,\n supports_uniform_list_property:true,\n supports_vertex_index:false,\n supports_vertex_iteration:true,\n supports_vertex_key_index:false\n }\n end",
"title": ""
},
{
"docid": "da94e2c8944d808205460f27f18b4ca2",
"score": "0.585981",
"text": "def tasks\n Feature.all(:type => 'gene')\n end",
"title": ""
},
{
"docid": "bc656e642f3e09889b8d6541e55286dc",
"score": "0.58244115",
"text": "def add_motif_feature(records, motif_coord_in_exon, motif)\n records.each do |gene, entry|\n bioseq = entry.to_biosequence\n motif_coord_in_exon.each do |exon, coords|\n next if exon.match(/#{gene}/i).nil? # to avoid exons be added in wrong gene\n\n coords.flatten.each do |coord|\n f1 = Bio::Feature.new('repeat_region', coord.to_s)\n f1.append(Bio::Feature::Qualifier.new('exon_id', exon))\n f1.append(Bio::Feature::Qualifier.new('rpt_type', 'dispersed'))\n f1.append(Bio::Feature::Qualifier.new('function', 'target for insertions'))\n f1.append(Bio::Feature::Qualifier.new('rpt_unit_seq', motif.to_s))\n if coord.to_s.match('complement')\n f1.append(Bio::Feature::Qualifier.new('strand', '-'))\n else\n f1.append(Bio::Feature::Qualifier.new('strand', '+'))\n end\n bioseq.features << f1\n end\n end\n end\n puts 'Features added'\n end",
"title": ""
},
{
"docid": "8666b87a305540b5bbcb30599e1b64c0",
"score": "0.5818805",
"text": "def passive_features\n return @passive_features if @passive_features\n @passive_features = []\n self.note.split(/[\\r\\n]+/).each do |line|\n case line\n when /feature\\[(\\w+)\\]/i\n @passive_features.push(RVKD::Passives::FEATURES[$1.to_sym])\n end\n end\n @passive_features\n end",
"title": ""
},
{
"docid": "fdd9d3841a4103638e8a2957e12648d4",
"score": "0.5793242",
"text": "def features\n features_environment + features_rollout\n end",
"title": ""
},
{
"docid": "17b06f48730f3cb2567be2b748655ede",
"score": "0.5788172",
"text": "def features\n read_multiple build_path \"#{FeaturesKey}/features\"\n end",
"title": ""
},
{
"docid": "b40fb4da257924a4d36293aeda19c41a",
"score": "0.5785442",
"text": "def featurize(name, brand, first_ingredient, ingredients = nil, description = nil, *unused)\n # extract percentage from name\n pct = name.match(/[-+]?\\d+([,.]\\d+)?%/).to_s\n if pct != ''\n name = name.sub(pct, '')\n pct = pct.sub(',', '.')\n end\n # then normalize text\n brand = normalize_text(brand)\n name = normalize_text(name).sub(/^#{brand}\\s+/, '')\n first_ingredient = normalize_ingredient(first_ingredient)\n #ingredients = normalize_ingredient(ingredients)\n description = normalize_text(strip_html(description)).sub(/#{brand}\\s+/, '')\n\n ## extract features\n tokenizer = Tokkens::Tokenizer.new(@tokens, stop_words: STOP_WORDS)\n words = []\n words += tokenizer.get(name)\n words += tokenizer.get(first_ingredient, prefix: 'ING:')\n #words += tokenizer.get(ingredients, prefix: 'INH:')\n #words += tokenizer.get(description, prefix: 'DSC:')\n words << tokenizer.tokens.get(brand, prefix: 'BRN:')\n words.compact!\n words.sort! # may be important for libsvm\n\n #puts \"#{name} | #{pct} | #{brand} | #{first_ingredient} -> #{words.inspect}\"\n \n # make sure to increase offset in {@tokens} when adding new features\n features = {}\n features[1] = pct.to_f / 100.0 unless pct.nil? || pct == ''\n features.merge! Hash[words.zip([1] * words.length)]\n\n Libsvm::Node.features(features)\nend",
"title": ""
},
{
"docid": "540a377973aa4a6fbaa6923153484928",
"score": "0.57602847",
"text": "def add_features(features)\n features.each { |feature|\n add_feature(feature)\n }\n end",
"title": ""
},
{
"docid": "439fcdf920b9d19263d66afede0d06f2",
"score": "0.57602334",
"text": "def features\n adapter.features.map { |name| feature(name) }.to_set\n end",
"title": ""
},
{
"docid": "7ecc63114a9e24969dd2f3d3531567c9",
"score": "0.57511735",
"text": "def essential_features\n # We're using @see feature to list an essential feature.\n references\n end",
"title": ""
},
{
"docid": "4ee7c596654cf3600ed5a189c0f371a0",
"score": "0.57411253",
"text": "def provides_features\n []\n end",
"title": ""
},
{
"docid": "e575a8201b3316ff85165baeb25fcb37",
"score": "0.57351536",
"text": "def features\n return @features\n end",
"title": ""
},
{
"docid": "b14bdecaffb0739347b04234f172d586",
"score": "0.5721363",
"text": "def all_features\n @all_features\n end",
"title": ""
},
{
"docid": "30d94e8850833fa92f3b6f69b9c6ba5c",
"score": "0.57148397",
"text": "def features\n @features ||= ActiveRecordModel.find(:all).inject({}) do |ret,feature|\n name = feature.feature.to_sym\n ret[name]||=Feature.new(name)\n ret[name].percentage ||= feature.percentage\n ret[name].users[feature.user_id]=true if feature.user_id\n ret\n end\n end",
"title": ""
},
{
"docid": "9a09d3e4bf5e514d5528cf380295c099",
"score": "0.5713415",
"text": "def get_features(code)\n features.select {|ft| ft.code == code }\n end",
"title": ""
},
{
"docid": "5542be96a41f1b3bdf2cefb5ba1f1555",
"score": "0.5703351",
"text": "def search_gene\n @genedefinition = [ 'Refseq','Ensembl','UCSC/Known']\n @exonicFunction =[ 'All','Exonic','Splicing','Intronic','UTR3','UTR5','Downstream','Upstream','Intergenic','ncRNA_exonic','ncRNA_splicing','ncRNA_intronic','ncRNA_UTR3','ncRNA_UTR5']\n @variantFunction = ['All','Nonsynonymous','Synonymous','Stopgain','Stoploss'] \n end",
"title": ""
},
{
"docid": "5c7b4d21d91c5393a66fbe4510847eab",
"score": "0.5698937",
"text": "def features\n @_features ||= Features.new(self)\n end",
"title": ""
},
{
"docid": "921407e773cc91f284819f1b79449794",
"score": "0.56974125",
"text": "def add_feature(feature_set, line)\n line.chomp!\n chrom, pos, id, ref, alt, qual, filter, info, format, samples = line.split(\"\\t\")\n\n # Replace an unknown ID by nil, so that feature coordinates are used during serialization:\n id = nil\n\n #\n # Split composite fields\n #\n\n # Alternative alleles:\n alt = alt.split(',')\n\n # Filters:\n filter = filter.split(';')\n\n # Feature information:\n info = info.split(';')\n info = info.map { |key_value_pair| key, values = key_value_pair.split('=', 2) }\n info = Hash[info]\n info = Hash[info.map { |key, value|\n if value then\n [ key, value.split(',') ]\n else\n [ key, true ]\n end\n }]\n\n # Format for following sample columns:\n format = format.split(':')\n\n # Sample columns (need to be further split in the writer -- depends on format):\n samples = samples.split(\"\\t\").map { |value|\n # Dot: not data provided for the sample\n if value == '.' then\n {}\n else\n values = value.split(':')\n Hash[format.zip(values)]\n end\n }\n\n feature_set.add(BioInterchange::Genomics::VCFFeature.new(chrom, pos, id, ref, alt, qual, filter, info, samples))\n end",
"title": ""
},
{
"docid": "2bdf68b210e6f27754ba0ad614c027f7",
"score": "0.56846243",
"text": "def features\n res = []\n each_element('feature') { |feature|\n res.push(feature.var)\n }\n res\n end",
"title": ""
},
{
"docid": "4dd62c193236db52c99d6cc77eed006e",
"score": "0.568431",
"text": "def features\n @tropo_client.get(\"features\")\n end",
"title": ""
},
{
"docid": "e6704bcb7563d988e983fea03f6eb184",
"score": "0.5662651",
"text": "def features\n @features ||= @connection['features']\n end",
"title": ""
},
{
"docid": "da34d8512cc9ce107f8ba0c8a6e22f69",
"score": "0.5659212",
"text": "def read_and_compaire_features\n @unmatched_features = []\n @feature_files.each do |file|\n lines = File.open(file, \"r\"){|f| f.readlines}\n last_type = \"\"\n lines.each_with_index do |line, index| \n line.gsub!(\" \",\"\") #remove tab spacing (from line start) - bit iffy :(\n next unless line.match(/^Given|^When|^Then|^And/) \n step, type = find_step_which_matches line\n last_type = type unless type.eql?(\"And\") #last_type is used to assign meaning to 'And'\n line_inf = {:line => line, :type => last_type, :file => file, :line_number => index + 1} #type is last_type \n if step.nil?\n @unmatched_features << line_inf\n else\n step[:features] ||= []\n step[:features] << line_inf #Add the line_inf to an array on the step. So each step has many :features.\n end\n end\n end\n end",
"title": ""
},
{
"docid": "72cadd8f79de8774a6a334be2e94d436",
"score": "0.56533426",
"text": "def get_features(item)\n @get_features_func.call(item)\n end",
"title": ""
},
{
"docid": "861dddfe514952a11d5d8e4ee4f910ef",
"score": "0.5644648",
"text": "def build_features(options)\n options['features'].map do |f|\n Feature.new(f['name'], f)\n end\n end",
"title": ""
},
{
"docid": "5a70206c161960a5d16d9f92ddd396b8",
"score": "0.5639043",
"text": "def get_reads(features)\n result = {}\n result[:watson] = features.select{|f| f.strand == '+' }.collect{|e| e.to_read}\n result[:crick] = features.select{|f| f.strand == '-' }.collect{|e| e.to_read}\n return result\n end",
"title": ""
},
{
"docid": "e81faade921b6cb1f0b5367df5307aa3",
"score": "0.56380606",
"text": "def suggest_features \n sel_features = Array.new\n \n File.open(@directory + \"/train\", \"w\") do |f| f.puts @fv_train.to_libSVM end\n \n Dir.chdir('./rsvm/bin/tools') do\n output = `python fselect.py #{@directory}/train`\n \n puts output if (@verbose)\n \n x = File.read(\"train.select\")\n sel_f_ids = x[1..-2].split(\", \")\n sel_f_ids.each do |f|\n s_f = @features.term(f.to_i)\n if s_f.instance_of? String then\n s_f = s_f.split(\"||\")\n s_f[0] = s_f[0].to_sym\n end\n sel_features.push(s_f)\n end\n \n #Remove temporary files\n File.delete(\"train.select\") if File.exist?(\"train.select\")\n File.delete(\"train.fscore\") if File.exist?(\"train.fscore\")\n File.delete(\"train.tr.out\") if File.exist?(\"train.tr.out\")\n end\n \n return sel_features\n end",
"title": ""
},
{
"docid": "5d759f7c36d466956cdebcce363ebfb8",
"score": "0.56287676",
"text": "def create_feature(hits)\n # Initialize the entry\n query, subject = hits.first.query, hits.first.subject\n\n # Determine the orientation based on the query start/end positions\n feature.strand = hits.first.query_start < hits.first.query_end ? '+' : '-'\n \n # Convert the hit to a feature\n \n # Add each of the hits to the entry\n hits.map do |hit|\n feature = IO::GFF::Feature.new(seqid: query, source: 'BLASTP', type: :match, attributes: { 'Name' => subject })\n feature.regions.create(start: hit.query_start, \n end: hit.query_end, \n score: hit.bit_score, \n attributes: { 'EValue' => hit.e_value, 'Target' => \"#{subject} #{hit.subject_start} #{hit.subject_end}\" })\n \n feature \n end\n \n \n feature\n end",
"title": ""
},
{
"docid": "2575a8a9af89946e9ba58b602066f840",
"score": "0.5622312",
"text": "def get_features\n\t\t\t\t\t@features ||= Pugin::BANDIERA_CLIENT.get_features_for_group('parliament')\n\t\t\t\tend",
"title": ""
},
{
"docid": "d6ab300c267361fe82f13be06d497519",
"score": "0.5619881",
"text": "def features_human\n Array.wrap(features).map { |f| FEATURES[f] }\n end",
"title": ""
},
{
"docid": "f971a6d80e8921c846f35753e7161253",
"score": "0.56153524",
"text": "def loaded_features_index; end",
"title": ""
},
{
"docid": "f971a6d80e8921c846f35753e7161253",
"score": "0.56153524",
"text": "def loaded_features_index; end",
"title": ""
},
{
"docid": "1871e8bc1c5b68141631c328748e3f46",
"score": "0.56091624",
"text": "def search_gene\n @platform = ['Illumina','Solid']\n @genedefinition = [ 'Refseq','Ensembl','UCSC/Known']\n @exonicFunction =[ 'All','Exonic','Splicing','Intronic','UTR3','UTR5','Downstream','Upstream','Intergenic','ncRNA_exonic','ncRNA_splicing','ncRNA_intronic','ncRNA_UTR3','ncRNA_UTR5']\n @variantFunction = ['All','Nonsynonymous SNV','Synonymous SNV','Stopgain SNV','Stoploss SNV','Frameshift insertion','Frameshift deletion','Frameshift substitution','Nonframeshift insertion','Nonframeshift deletion','Nonframeshift substitution'] \n @vartype = ['SNP','INDEL']\n @subgrp = ['All','spanish'] \n end",
"title": ""
},
{
"docid": "3004a31eba79931a48899f27f9badc63",
"score": "0.55894536",
"text": "def features\n df = self.data_file\n if df.nil?\n {}\n else\n feats = Hash.new\n df.concentrations.each do |c|\n if c.metabolite.present?\n feats[c.metabolite.name] = c.concentration_value\n end\n end\n feats\n end\n end",
"title": ""
},
{
"docid": "740c27491ea56ea25257dd519bfc929f",
"score": "0.55804914",
"text": "def features\n df = self.data_file\n if df.nil?\n return Hash.new\n else\n feats = Hash.new\n df.concentrations.each do |c|\n if !c.metabolite.nil?\n feats[c.metabolite.name] = c.concentration_value\n end\n end\n return feats\n end\n end",
"title": ""
},
{
"docid": "ba5579e6e24e64b75dcdffaef609ab33",
"score": "0.5568882",
"text": "def get_features(dsn, segments = [], categorize = false, feature_ids = [], group_ids = [])\n # arguments 'type' and 'category' are deprecated\n gff = GFF.new\n\n dsn = dsn.source if dsn.instance_of?(DSN)\n segments = [segments] if segments.instance_of?(SEGMENT)\n\n opts = []\n segments.each do |s|\n opts << \"segment=#{s.entry_id}:#{s.start},#{s.stop}\"\n end\n if categorize\n opts << \"categorize=yes\"\t# default is 'no'\n end\n feature_ids.each do |fid|\n opts << \"feature_id=#{fid}\"\n end\n group_ids.each do |gid|\n opts << \"group_id=#{gid}\"\n end\n query = opts.join(';')\n\n result, = @server.get(@prefix + '/das/' + dsn + '/features?' + query)\n doc = REXML::Document.new(result.body)\n doc.elements.each('/descendant::GFF') do |e|\n gff.version = e.attributes['version']\n gff.href = e.attributes['href']\n e.elements.each('SEGMENT') do |e|\n segment = SEGMENT.new\n segment.entry_id = e.attributes['id']\n segment.start = e.attributes['start']\n segment.stop = e.attributes['stop']\n segment.version = e.attributes['version']\n segment.label = e.attributes['label']\n e.elements.each do |e|\n feature = FEATURE.new\n feature.entry_id = e.attributes['id']\n feature.label = e.attributes['label']\n e.elements.each do |e|\n case e.name\n when 'TYPE'\n type = TYPE.new\n type.entry_id = e.attributes['id']\n type.category = e.attributes['category']\n type.reference = e.attributes['referrence']\n type.label = e.text\n feature.types << type\n when 'METHOD'\n feature.method_id = e.attributes['id']\n feature.method = e.text\n when 'START'\n feature.start = e.text\n when 'STOP', 'END'\n feature.stop = e.text\n when 'SCORE'\n feature.score = e.text\n when 'ORIENTATION'\n feature.orientation = e.text\n when 'PHASE'\n feature.phase = e.text\n when 'NOTE'\n feature.notes << e.text\n when 'LINK'\n link = LINK.new\n link.href = e.attributes['href']\n link.text = e.text\n feature.links << link\n when 'TARGET'\n target = TARGET.new\n target.entry_id = e.attributes['id']\n target.start = e.attributes['start']\n target.stop = e.attributes['stop']\n target.name = e.text\n feature.targets << target\n when 'GROUP'\n group = GROUP.new\n group.entry_id = e.attributes['id']\n group.label = e.attributes['label']\n group.type = e.attributes['type']\n e.elements.each do |e|\n case e.name\n when 'NOTE'\t\t# in GROUP\n group.notes << e.text\n when 'LINK'\t\t# in GROUP\n link = LINK.new\n link.href = e.attributes['href']\n link.text = e.text\n group.links << link\n when 'TARGET'\t\t# in GROUP\n target = TARGET.new\n target.entry_id = e.attributes['id']\n target.start = e.attributes['start']\n target.stop = e.attributes['stop']\n target.name = e.text\n group.targets << target\n end\n end\n feature.groups << group\n end\n end\n segment.features << feature\n end\n gff.segments << segment\n end\n end\n gff\n end",
"title": ""
},
{
"docid": "818bedacf32f910a3fae6dfa5344a9a0",
"score": "0.5566033",
"text": "def with_features(features)\n @exp_features |= Array(features)\n self\n end",
"title": ""
},
{
"docid": "4dbcd90e660509800d8b3b85554e844c",
"score": "0.5540987",
"text": "def features\n self.boat_features_set.attributes.select { |k, v| k if v == true }.keys\n end",
"title": ""
},
{
"docid": "e8bbf3942b0464cf8399ea60998f92ca",
"score": "0.5523377",
"text": "def visit_Feature(node)\n @feature.name = node.name\n @feature.description = node.description\n\n node.background.accept(self) if node.background\n\n @current_tag_set = @feature\n node.tags.each { |tag| tag.accept(self) }\n @current_tag_set = nil\n\n node.scenarios.each { |scenario| scenario.accept(self) }\n end",
"title": ""
},
{
"docid": "f9ab7aa38e5df6e86020342a21f49fc3",
"score": "0.5522912",
"text": "def feature_map\n @features ||= {}\n end",
"title": ""
},
{
"docid": "c7e51fca7fb6d2898bb2669573bcf633",
"score": "0.55204916",
"text": "def features\n features = equips + states\n return features.compact\n end",
"title": ""
},
{
"docid": "0e5d559f17bfb72a3fe44b693e1ee386",
"score": "0.5518005",
"text": "def getFts\n output = \"Feature\\tAccessiont\\tSeqBeg\\tSeqEnd\\tStrand\\tPartial\\tPseudo\\tProtID\\tLocusTag\\tGene\\tProt-Product\\n\"\n @genbanks.each_entry do |gb|\n gb.features do |ft|\n next if ft.feature == \"gene\"\n ftH = ft.to_hash\n loc = ft.locations\n seqBeg = loc[0].from.to_s\n seqEnd = loc[0].to.to_s\n strand = loc[0].strand.to_s\n partial = 0\n if loc[0].gt or loc[0].lt\n partial = 1\n end\n pseudo = 0\n pseudo = 1 if !ftH[\"pseudo\"].nil?\n gene = []\n product = []\n protId = \"\"\n gene = ftH[\"gene\"] if !ftH[\"gene\"].nil?\n product = ftH[\"product\"] if !ftH[\"product\"].nil?\n protId = ftH[\"protein_id\"].join(\",\") if !ftH[\"protein_id\"].nil?\n locustag = ftH[\"locus_tag\"][0] if !ftH[\"locus_tag\"].nil?\n output += \"#{ft.feature}\\t#{gb.accession}\\t#{seqBeg}\\t#{seqEnd}\\t#{strand}\\t#{partial}\\t#{pseudo}\\t#{protId}\\t#{locustag}\\t#{gene[0]}\\t#{product[0]}\\n\"\n end\n end\n return output\n end",
"title": ""
},
{
"docid": "54235f2cda5cfef1cab68c324c157320",
"score": "0.5517818",
"text": "def features\n entrypoint.to_xml.root.xpath('link/feature').inject(Hash.new(Array.new)) do |result, feature|\n result[feature.parent['rel']] += [feature['name']]\n result\n end\n end",
"title": ""
},
{
"docid": "c0d64d1c3e3d2d87e3556608e47a642c",
"score": "0.55106854",
"text": "def before_features(*args);end",
"title": ""
},
{
"docid": "8560852ceee344128e981b967daac3c4",
"score": "0.5498998",
"text": "def getFtsGenes\n output = \"Accessiont\\tSeqBeg\\tSeqEnd\\tStrand\\tPartial\\tProtID\\tLocusTag\\tGene\\tProt-Product\\n\"\n @genbanks.each_entry do |gb|\n gb.features do |ft|\n next if ft.feature != \"gene\"\n begin\n ftH = ft.to_hash\n loc = ft.locations\n seqBeg = loc[0].from.to_s\n seqEnd = loc[0].to.to_s\n strand = loc[0].strand.to_s\n gene = []\n product = []\n protId = \"\"\n gene = ftH[\"gene\"] if !ftH[\"gene\"].nil?\n product = ftH[\"product\"] if !ftH[\"product\"].nil?\n protId = ftH[\"protein_id\"].join(\",\") if !ftH[\"protein_id\"].nil?\n locustag = ftH[\"locus_tag\"][0] if !ftH[\"locus_tag\"].nil?\n output += \"#{gb.accession}\\t#{seqBeg}\\t#{seqEnd}\\t#{strand}\\t#{protId}\\t#{locustag}\\t#{gene[0]}\\t#{product[0]}\\n\"\n rescue\n puts \"error\"\n end\n end\n end\n return output\n end",
"title": ""
},
{
"docid": "024233a9702dca4d1cac65613be67ad3",
"score": "0.54691184",
"text": "def add_loaded_features(loaded_features); end",
"title": ""
},
{
"docid": "a499d71092c73d9718fbd5d25b3f069d",
"score": "0.5462149",
"text": "def features\n @features ||= begin\n header, *manners = ChartData.lines\n\n _, *positions = header.chomp.split(' | ')\n positions.map(&:strip!)\n\n # Remove any trailing blank lines\n manners.pop while manners.last.to_s.strip.empty?\n\n position_indexes = Hash[*positions.each_with_index.to_a.flatten]\n\n @position_count = positions.size\n\n manners.each_with_object({}) do |row, phonemes|\n manner, *columns = row.chomp.split(' | ')\n manner.strip!\n positions.zip(columns).each do |position, phoneme_text|\n data = {\n position: position,\n position_index: position_indexes[position],\n manner: manner,\n }\n # If there is a character in the first byte then this articulation\n # has a voiceless phoneme. The symbol may use additional characters\n # as part of the phoneme symbol.\n unless phoneme_text[0] == ' '\n # Take the first non-blank character string\n symbol = phoneme_text.chars.take_while { |char| char != ' ' }.join\n phoneme_text = phoneme_text[symbol.chars.size..-1]\n\n phonemes[symbol] = data.merge(voiced: false)\n end\n # If there's a character anywhere left in the string then this\n # articulation has a voiced phoneme\n unless phoneme_text.strip.empty?\n symbol = phoneme_text.strip\n phonemes[symbol] = data.merge(voiced: true)\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7f3162181e33bbdc593ba062162d487a",
"score": "0.5461872",
"text": "def parse!\n fasta = []\n reading_fasta = false\n CSV.foreach(file, :col_sep => \"\\t\") do |row|\n # skip empty lines\n next if row.empty?\n\n # FASTA\n if !reading_fasta && row.first =~ /^##FASTA/\n reading_fasta = true\n next\n end\n\n # skip other directives\n next if row.first =~ /^##/\n\n if reading_fasta\n fasta << row.first\n else # parsing rows\n feature, attributes = row[0..7], row[8]\n\n # parse attributes (9th) column\n #\n # \"ID=exon00002;Parent=mRNA00001,mRNA00002\"\n # -> [\"ID=exon00002\", \"Parent=mRNA00001,mRNA00002\"]\n attributes = attributes.split(';')\n\n # [\"ID=exon00002\", \"Parent=mRNA00001,mRNA00002\"]\n # -> [[\"id\", \"exon00002\"], [\"parent\", [\"mRNA00001\", \"mRNA00002\"]]]\n attributes = attributes.map do |kv|\n # \"ID=exon00002\"\n # -> [\"ID\", \"exon00002\"]\n # \"Parent=mRNA00001,mRNA00002\"\n # -> [\"Parent\", \"mRNA00001,mRNA00002\"]\n k, v = kv.split('=')\n\n # \"ID\" -> :id\n # \"Parent\" -> :parent\n k.downcase!\n k = k.to_sym\n\n # \"mRNA00001,mRNA00002\" -> [\"mRNA00001\", \"mRNA00002\"]\n if Feature.array_attributes.include? k\n v = v.split(',')\n end\n\n # [\"id\", \"exon00002\"]\n # [\"parent\", [\"mRNA00001\", \"mRNA00002\"]]\n [k, v]\n end\n\n # [\"id\", \"exon00002\"]\n # [\"parent\", [\"mRNA00001\", \"mRNA00002\"]]\n # -> {\"id\" => \"exon00002\",\n # \"parent\" => [\"mRNA00001\", \"mRNA00002\"]}\n attributes = Hash[attributes]\n\n feature = Feature.new(*feature, attributes)\n add_feature feature\n end\n end\n\n # fasta[0] is fasta header: >seq_id\n unless fasta.empty?\n add_sequence fasta[0][1..-1], fasta[1..-1].join\n end\n end",
"title": ""
},
{
"docid": "66556c519edbd4132541f94cfbfe3813",
"score": "0.54610497",
"text": "def taumaturgic?; has_feature?(:taumaturgic); end",
"title": ""
},
{
"docid": "97ce34e75d57a595abd6d4f8a62bb9eb",
"score": "0.54602",
"text": "def featured_at\n features.map { |f| f.name }\n end",
"title": ""
},
{
"docid": "4b2c20727b0aefe4d31e1b4e394bdc4e",
"score": "0.5451308",
"text": "def match_features(type)\n match_attrs(type, @exp_features, :feature)\n end",
"title": ""
},
{
"docid": "a74d2ee15dd8d9e1b0f61176c6a4cc59",
"score": "0.5440693",
"text": "def features?\n definition.features?\n end",
"title": ""
},
{
"docid": "e982363fa031f193692f9d0f2b123d55",
"score": "0.5438364",
"text": "def classic_features=(new_features)\n new = new_features.map{|x| x.split(\", \").reject{|x| x =~ /^0x/}}.flatten.sort.uniq\n current = JSON.parse(self.classic_features || '[]')\n self[:classic_features] = JSON.generate((new + current).uniq)\n end",
"title": ""
},
{
"docid": "392c02eb49337c63e326807ff3d5d010",
"score": "0.5435942",
"text": "def get_feature_hash(features)\n feat_hash = {}\n # use parseFeatures.rb to split feature entries\n parse_features(features).each do |feat|\n # get name of feature and range of feature\n # no match checking neccessary (matches verified in parse_features)\n match = feat.match(/^ {5}(\\S+)\\s+(\\S+)/)\n name = match[1]\n range = match[2]\n feat_hash[name] = {name => range}\n # get and split the feature entries\n feat.scan(/^ {21}(\\S+)=(.+)\\n/).each do |left, right|\n # remove \"\n feat_hash[name][left] = right.gsub(/\\\"/,\"\")\n end\n end\n return feat_hash\nend",
"title": ""
},
{
"docid": "93b6100665e4122857c12c5c12377d16",
"score": "0.5430064",
"text": "def features(options = {})\n features = []\n each(options) { |feature| features << feature }\n \n features\n end",
"title": ""
},
{
"docid": "212b2e7b786d4dd17235e653d19cbb91",
"score": "0.54254633",
"text": "def contains\n @features\n end",
"title": ""
},
{
"docid": "a54fc0e68d593ef5429457a30d0a9c9c",
"score": "0.542209",
"text": "def generate_features(contents = @contents, purpose_contents = @purpose_contents)\n return [] unless rand() < $configuration.fetch('feature_chance', 0)\n contents[:features] = Array.new if contents[:features].nil?\n feature_set = FeatureSet.new()\n random_yaml_element('features')['contents'].each_pair { |table, count|\n feature_set.concat Array.new(random_count(count)) { random_yaml_element(\"features/#{table}\", :none) }.collect { |f| Feature.new(table, f) }\n }\n log \"Adding features: #{feature_set.join(\", \")}\"\n feature_set.concat generate_purpose_features(purpose_contents)\n return [feature_set]\n end",
"title": ""
},
{
"docid": "b73c6845794ca7f7cd52d654068a0f42",
"score": "0.54185206",
"text": "def features\n\t\t\tif @features.nil?\n\t\t\t\ttr = (traininfo_response_doc / 'table.remarks tr').find {|tr| (tr % 'th').inner_text == 'Comments:'}\n\t\t\t\tif tr\n\t\t\t\t\t@features = (tr / 'td strong').collect {|elem| elem.inner_text}.uniq\n\t\t\t\telse\n\t\t\t\t\t@features = []\n\t\t\t\tend\n\t\t\tend\n\t\t\t@features\n\t\tend",
"title": ""
},
{
"docid": "3048b80f6b3a29edf9950ec99afa936d",
"score": "0.5416947",
"text": "def extract_features(line)\n\n sentences = line.split(/[\\.;]/)\n num_sentences = 0\n sentences.each do |s|\n num_sentences += 1 if not s.strip.empty?\n end\n\n case\n when num_sentences <= 1\n return [Feature.new(\"sentence_count_1\")]\n when num_sentences <= 3\n return [Feature.new(\"sentence_count_3\")]\n when num_sentences <= 5\n return [Feature.new(\"sentence_count_5\")]\n else\n return [Feature.new(\"sentence_count_>5\")]\n end\n end",
"title": ""
},
{
"docid": "574d7e96c9da2a0d2d194a792e315f53",
"score": "0.5410441",
"text": "def features\n query.find('//ns:feature', :ns => self.class.registered_ns).map do |f|\n Feature.new f\n end\n end",
"title": ""
},
{
"docid": "ae999bc85c9330e31021652e5d1543bb",
"score": "0.54098576",
"text": "def build_feature_set(distance = 0)\n genetox = GenetoxInterface.new()\n ccris = CcrisInterface.new()\n \n \n g = genetox.chemicals.collect {|solution| solution[:cas]}\n c = ccris.chemicals.collect {|solution| solution[:cas]}\n chemicals = g & c\n \n classes = find_classes(distance)\n \n \n chemicals.each do |chemical|\n vector = []\n classes.each do |cls|\n \n instances = get_individuals(cls)\n experiments = (genetox.get_experiments(cas) - instances)\n \n atr_value = genetox.calc_attr_value(experiments)\n \n vector << atr_value\n end\n \n vector << ccris.active?(chemical[:cas])\n \n puts vector.join(\",\")\n end\n \n end",
"title": ""
},
{
"docid": "f2c18ca3f5b6626a1c85fe3c7af41d21",
"score": "0.54093015",
"text": "def features\n {\n supported_renderers: feature_renderers,\n file_transfer_support: feature_file_transfer?\n }\n end",
"title": ""
},
{
"docid": "e1b6427d17bf8648ea64b5c7582dc5b4",
"score": "0.5396104",
"text": "def features\n @inventory.features(self).to_a\n end",
"title": ""
},
{
"docid": "6ecb6a339846eb9e563e471b78c602d8",
"score": "0.5390086",
"text": "def get_feature_subset \n inst_cnt = get_instance_count \n j0 = get_IR_by_count(inst_cnt)\n \n feats = get_features\n subset = lvf(inst_cnt, feats, j0)\n \n subset\n end",
"title": ""
},
{
"docid": "c12a93a503fd5b143890e4b4a29d040e",
"score": "0.53899676",
"text": "def features\n features = query.find('feature')\n features = query.find('query_ns:feature', :query_ns => self.class.ns) if features.empty?\n features.map { |i| Feature.new i }\n end",
"title": ""
},
{
"docid": "85998f1a43d62703a2a07681922d86bd",
"score": "0.5382656",
"text": "def feature_list\n features.try(:split, \",\") || []\n end",
"title": ""
},
{
"docid": "0713f4cfb9abed27dfdb72524a8ee37c",
"score": "0.5380012",
"text": "def get_required_features(features)\n features.merge(@features) unless @features.nil?\n end",
"title": ""
},
{
"docid": "95650ac8e5e49a44d8f2a76574ab9fc7",
"score": "0.5373799",
"text": "def features\n by_collection = Hash.new { |hash, key| hash[key] = [] }\n PublicEarth::Db::Place.many.features.each do |feature|\n by_collection[feature['collection']] << feature['feature']\n end\n by_collection\n end",
"title": ""
},
{
"docid": "1fd080ead430448d20f423dc58956127",
"score": "0.5371013",
"text": "def extract_features(filename, text)\n @section = nil\n in_literal_text = false\n literal_text = ''\n tags = []\n text.each do |line|\n s = line.strip\n #$stderr.puts \"DEBUG: LINE='#{s}'\"\n if s == '\"\"\"'\n if in_literal_text\n @section.add(literal_text + \"\\n\\\"\\\"\\\"\") unless @section == nil\n in_literal_text = false\n else\n literal_text = \"\\\"\\\"\\\"\\n\"\n in_literal_text = true\n end\n else\n if in_literal_text\n literal_text << line\n else\n case s\n when /^\\@.*/i\n tags = s.split(' ')\n when /^Feature:.*/i\n @section.finish unless @section == nil\n @section = FeatureSection.new(@builder, line, filename)\n @section.set_tags tags\n tags.clear\n when /^Background:.*/i\n @section.finish unless @section == nil\n @section = BackgroundSection.new(@builder, line)\n @section.set_tags tags\n tags.clear\n when /^(Scenario|Scenario Outline):.*/i\n @section.finish unless @section == nil\n @section = ScenarioSection.new(@builder, line)\n @section.set_tags tags\n tags.clear\n else\n @section.add(line) unless @section == nil\n end\n end\n end\n end\n @section.finish unless @section == nil\n end",
"title": ""
},
{
"docid": "c5ff65055afcfb749dc0f579161a8922",
"score": "0.53689295",
"text": "def chromosome_transform(gene, hash_features, chr)\r\n\r\n hash_features.each do |positions, exonid_strand|\r\n pos_ini_chr = chr[1].to_i + positions[0].to_i\r\n pos_end_chr = chr[1].to_i + positions[1].to_i\r\n\r\n $chromosomes_gff3.puts \"#{chr[0]}\\t.\\tnucleotide_motif\\t#{pos_ini_chr}\\t#{pos_end_chr}\\t.\\t#{exonid_strand[1]}\\t.\\tID=#{exonid_strand[0]};parent=#{gene}\"\r\n end\r\n\r\n\r\nend",
"title": ""
},
{
"docid": "b3546fd223816664d33a8eed283fb01c",
"score": "0.5368325",
"text": "def featurize\n puts \"== Generating features for #{ title }\"\n\n features_data.each do |feature|\n puts \" -- #{ feature.title }\"\n\n begin\n generate_feature(feature.title) if feature.title\n rescue => e\n puts \"Error generating feature: #{ feature.title } #{ e.message }\".red\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "a331d3d7790fe7ee03a1835800f4187e",
"score": "0.53656536",
"text": "def features()\n log.debug \"features called on group #{self.inspect}\"\n feature_objs.map{|f| f.name}\n end",
"title": ""
},
{
"docid": "f7e4450f620d2fbc45b5a9c2d8d03fef",
"score": "0.5360747",
"text": "def features\n self.object.features.map do |f|\n FeatureSerializer.new(f)\n end\n end",
"title": ""
},
{
"docid": "c7ec2c3df713781ba375695dcdacabbd",
"score": "0.5356979",
"text": "def features\n rows = select(FeaturesKey)\n rows.map { |row| row['field'] }.to_set\n end",
"title": ""
}
] |
13d9f53673102746808376db657ab045
|
Set the value of the ShareTypes input for this Choreo.
|
[
{
"docid": "de118b7148cf34556e9048da93b8fdf8",
"score": "0.775425",
"text": "def set_ShareTypes(value)\n set_input(\"ShareTypes\", value)\n end",
"title": ""
}
] |
[
{
"docid": "d779da033959dad0d2b553b507590dc4",
"score": "0.58845305",
"text": "def sharing_type=(value)\n @sharing_type = value\n end",
"title": ""
},
{
"docid": "421781b2d122dc2cdf86a63991701603",
"score": "0.54736173",
"text": "def set_types(*_types)\n _types.flatten!\n _types.each { |x|\n @types << x if @alloy_types.include? x\n }\n @types.uniq!\n self\n end",
"title": ""
},
{
"docid": "555bd950a76435d35337ce08661355aa",
"score": "0.5156642",
"text": "def zza_send_socials(socials, share_event)\n socials.each do |social_type|\n zza.track_event(\"#{share_event}.share.#{social_type}\")\n end\n end",
"title": ""
},
{
"docid": "f29a096a71fa099ab98f4a230274f115",
"score": "0.51042235",
"text": "def set_Types(value)\n set_input(\"Types\", value)\n end",
"title": ""
},
{
"docid": "f29a096a71fa099ab98f4a230274f115",
"score": "0.51042235",
"text": "def set_Types(value)\n set_input(\"Types\", value)\n end",
"title": ""
},
{
"docid": "f29a096a71fa099ab98f4a230274f115",
"score": "0.51042235",
"text": "def set_Types(value)\n set_input(\"Types\", value)\n end",
"title": ""
},
{
"docid": "f29a096a71fa099ab98f4a230274f115",
"score": "0.51042235",
"text": "def set_Types(value)\n set_input(\"Types\", value)\n end",
"title": ""
},
{
"docid": "05e1447ef219f31451211b4ad86d0900",
"score": "0.5047791",
"text": "def share_types\n unique_categorizations(:share_type)\n end",
"title": ""
},
{
"docid": "cbafb9289fc0920c77049e81f03b1167",
"score": "0.5028756",
"text": "def list_shares_post(list_shares_param, opts = {})\n data, _status_code, _headers = list_shares_post_with_http_info(list_shares_param, opts)\n return data\n end",
"title": ""
},
{
"docid": "048f91e2f8b37602f220f558830dba31",
"score": "0.5017422",
"text": "def types(*types)\n @types = types\n self\n end",
"title": ""
},
{
"docid": "4acab9fbb29ffa8e1ed6638cb1de5776",
"score": "0.5015784",
"text": "def set_share\n @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "4acab9fbb29ffa8e1ed6638cb1de5776",
"score": "0.5015784",
"text": "def set_share\n @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "4acab9fbb29ffa8e1ed6638cb1de5776",
"score": "0.5015784",
"text": "def set_share\n @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "4acab9fbb29ffa8e1ed6638cb1de5776",
"score": "0.5015784",
"text": "def set_share\n @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "4acab9fbb29ffa8e1ed6638cb1de5776",
"score": "0.5015784",
"text": "def set_share\n @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "4acab9fbb29ffa8e1ed6638cb1de5776",
"score": "0.5015784",
"text": "def set_share\n @share = Share.find(params[:id])\n end",
"title": ""
},
{
"docid": "d20a24f3811bb6d38c5121824cc916ab",
"score": "0.5012158",
"text": "def set_type(types)\n Array(types).each do | type |\n @statements << RDF::Statement.new(@uri, RDF.type, type)\n end\n end",
"title": ""
},
{
"docid": "f57961137ef1e4f920c625239e15a5f2",
"score": "0.5000606",
"text": "def share_params\n params.permit(:shareable_id, :shareable_type, :user_id)\n end",
"title": ""
},
{
"docid": "abcb35ab0ae12e60cbd7d5db4399895a",
"score": "0.4964178",
"text": "def post_contentmanagement_shares(body, opts = {})\n data, _status_code, _headers = post_contentmanagement_shares_with_http_info(body, opts)\n return data\n end",
"title": ""
},
{
"docid": "7593407bd6350c5d301c410c3e6134ca",
"score": "0.4927093",
"text": "def set_share\n @share = @post.shares.find(params[:id])\n end",
"title": ""
},
{
"docid": "d940fa4e5d884401543093dc234aeb1f",
"score": "0.49160114",
"text": "def modify_types(types)\n types\n end",
"title": ""
},
{
"docid": "d940fa4e5d884401543093dc234aeb1f",
"score": "0.49160114",
"text": "def modify_types(types)\n types\n end",
"title": ""
},
{
"docid": "0c9ba09f93ec0313d839e4c38d3e4f1d",
"score": "0.4896751",
"text": "def share_id=(value)\n @share_id = value\n end",
"title": ""
},
{
"docid": "e76c05c3039f8ddd65485b9561186fd2",
"score": "0.48810127",
"text": "def share_params\n params.require(:share).permit(:post_id, :shared_id, :user_id => [])\n end",
"title": ""
},
{
"docid": "63b44929c08452854e3d3cac4eab18be",
"score": "0.48703587",
"text": "def set_share_category\n @share_category = ShareCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "0f47aa750d755af97d775a13f96f9fd0",
"score": "0.48262212",
"text": "def content_types=(value)\n @content_types = value\n end",
"title": ""
},
{
"docid": "0f47aa750d755af97d775a13f96f9fd0",
"score": "0.48262212",
"text": "def content_types=(value)\n @content_types = value\n end",
"title": ""
},
{
"docid": "ea4fcdb1ba2de1b59d1ca30b21bd8d07",
"score": "0.48138857",
"text": "def set_share\n @share = Share.find(params[:id])\n authorize @share\n end",
"title": ""
},
{
"docid": "dd4e8045c43c79a6563d1583c579bae7",
"score": "0.48041353",
"text": "def set_ShareWithThesePeople(value)\n set_input(\"ShareWithThesePeople\", value)\n end",
"title": ""
},
{
"docid": "ae07ad41326bc9fec9ade0a6c291af46",
"score": "0.47743744",
"text": "def set_shareable\n @shareable = ShareModel.find(params[:id])\n end",
"title": ""
},
{
"docid": "f90cf9d6faa3f061bf52731a8a8756fb",
"score": "0.47538525",
"text": "def set_ShareWithTheseCircles(value)\n set_input(\"ShareWithTheseCircles\", value)\n end",
"title": ""
},
{
"docid": "19e8cb58820cc61b697f9bd417c6b4ef",
"score": "0.47382367",
"text": "def set_ShareWithMyCircles(value)\n set_input(\"ShareWithMyCircles\", value)\n end",
"title": ""
},
{
"docid": "cf90f7e424c04cae52d2a78ea33a07b7",
"score": "0.47244507",
"text": "def media_types=(media_types)\n add_check(:media_type, media_types)\n end",
"title": ""
},
{
"docid": "92e5943fc18923e8fbcaeb9abdb22e0b",
"score": "0.4715031",
"text": "def get_contentmanagement_shares(opts = {})\n data, _status_code, _headers = get_contentmanagement_shares_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "2ad3299fe6eba1289542a2d3590cde17",
"score": "0.4711794",
"text": "def set_share_on_twitter\n @share_on_twitter = ShareOnTwitter.find(params[:id])\n end",
"title": ""
},
{
"docid": "9ae2596f8dc56445bc24ee92fa1f244f",
"score": "0.4692657",
"text": "def share(options={})\n post(\"/shares\", options)\n end",
"title": ""
},
{
"docid": "9e5acf622929947a999e181e89b057e4",
"score": "0.46886674",
"text": "def allowed_content_types=(value)\n @allowed_content_types = value\n end",
"title": ""
},
{
"docid": "c5e6aeb4697e1bef3e5132c38745baa0",
"score": "0.46297666",
"text": "def sharepoint_ids=(value)\n @sharepoint_ids = value\n end",
"title": ""
},
{
"docid": "c5e6aeb4697e1bef3e5132c38745baa0",
"score": "0.46297038",
"text": "def sharepoint_ids=(value)\n @sharepoint_ids = value\n end",
"title": ""
},
{
"docid": "c5e6aeb4697e1bef3e5132c38745baa0",
"score": "0.46289554",
"text": "def sharepoint_ids=(value)\n @sharepoint_ids = value\n end",
"title": ""
},
{
"docid": "c5e6aeb4697e1bef3e5132c38745baa0",
"score": "0.46289554",
"text": "def sharepoint_ids=(value)\n @sharepoint_ids = value\n end",
"title": ""
},
{
"docid": "c5e6aeb4697e1bef3e5132c38745baa0",
"score": "0.46289554",
"text": "def sharepoint_ids=(value)\n @sharepoint_ids = value\n end",
"title": ""
},
{
"docid": "36edc0768ae80a4813e8ee9101829361",
"score": "0.4625229",
"text": "def update_shares(add, remove)\n @caldav_backend.update_shares(@calendar_info['id'], add, remove)\n end",
"title": ""
},
{
"docid": "48f9cfcae680632ec5df0f7656f275a4",
"score": "0.4617283",
"text": "def set_FeedTypeList(value)\n set_input(\"FeedTypeList\", value)\n end",
"title": ""
},
{
"docid": "aff386ea6a9dd6af54bbe12a9e6bb20f",
"score": "0.46108145",
"text": "def create\n Todoapp::Share.manage_share(params)\n @shares = Todoapp::User.user_join_shares(params[:id])\n end",
"title": ""
},
{
"docid": "5388a6eb17eb8fb414c7064b7df25311",
"score": "0.45906973",
"text": "def all_shares\n response = get(\"#{@config['url']}/api/2.1/rest/shares\", {accept: :json, :cookies => cookies})\n JSON.parse(response, :symbolize_names => true)[:shares][:share]\n end",
"title": ""
},
{
"docid": "a90adc24778e057fa461a45790bfe2ea",
"score": "0.45877492",
"text": "def add_company_share(company_id, share)\n path = \"/companies/#{company_id}/shares\"\n defaults = { visibility: { code: 'anyone' } }\n post(path, MultiJson.dump(defaults.merge(share)), \"Content-Type\" => \"application/json\")\n end",
"title": ""
},
{
"docid": "a3347bb1bed94912591ba54f4099c141",
"score": "0.45786592",
"text": "def set_ShareWithDomain(value)\n set_input(\"ShareWithDomain\", value)\n end",
"title": ""
},
{
"docid": "1b7e3a56cc99a62af0b99b410959167b",
"score": "0.45777687",
"text": "def shareable=(value)\n @shareable = value\n end",
"title": ""
},
{
"docid": "1b7e3a56cc99a62af0b99b410959167b",
"score": "0.45777687",
"text": "def shareable=(value)\n @shareable = value\n end",
"title": ""
},
{
"docid": "04a1120f73cdc79bc444ac4abd609af5",
"score": "0.4575432",
"text": "def share_params\n params.require(:share).permit(:team_id, :user_id)\n end",
"title": ""
},
{
"docid": "35ba5d11a30a583cfe45017e7cfa50d4",
"score": "0.45730767",
"text": "def share_params\n params.require(:share).permit(:content_url, :header_url, :header_content, :header_background_color, :header_text_color)\n end",
"title": ""
},
{
"docid": "9f00ff38e9aefd98460feb7e3a984c10",
"score": "0.45653555",
"text": "def handles(*types)\n @handled_types = [types].flatten.map { |t| t.to_sym }\n end",
"title": ""
},
{
"docid": "f1d5fea93aa69b74700062b1c20a9b43",
"score": "0.4564115",
"text": "def social_share_buttons\n return nil if return_nil_for_social_share? || @asocial\n element = element_by_action\n return nil if element.nil?\n t = element.try(:menu_title).nil? ? element.title : element.menu_title\n\n awesome_share_buttons(title_seo_structure(t),\n desc: html_escape_once(element.referencement_description),\n image: image_for_object(element),\n via: @setting.try(:twitter_username),\n popup: true)\n end",
"title": ""
},
{
"docid": "676958618f3e90239df6e242197411d1",
"score": "0.45608312",
"text": "def set_share_link\n @share_link = ShareLink.find(params[:id])\n end",
"title": ""
},
{
"docid": "716951ef47f8602123eb05971fefe73a",
"score": "0.45562294",
"text": "def <<(share)\n\t\t\t# convert from string if needed\n\t\t\tif share.class != SecretSharing::Shamir::Share then\n\t\t\t\tif share.class == String then\n\t\t\t\t\tshare = SecretSharing::Shamir::Share.from_string(share)\n\t\t\t\telse\n\t\t\t\t\traise ArgumentError 'SecretSharing::Shamir::Share ' \\\n\t\t\t\t\t + 'or String needed'\n\t\t\t\tend\n\t\t\tend\n\t\t\tif @received_shares.include? share then\n\t\t\t\traise 'share has already been added'\n\t\t\tend\n\t\t\tif @received_shares.length == @k then\n\t\t\t\traise 'we already have enough shares, no need to add more'\n\t\t\tend\n\t\t\t@received_shares << share\n\t\t\tif @received_shares.length == @k then\n\t\t\t\trecover_secret\n\t\t\t\treturn true\n\t\t\tend\n\t\t\tfalse\n\t\tend",
"title": ""
},
{
"docid": "212a63a86242aab6da956253d3608464",
"score": "0.45556805",
"text": "def set_share_index\n @share_index = ShareIndex.find(params[:id])\n end",
"title": ""
},
{
"docid": "e56105031c1a11f420803f64456cf23b",
"score": "0.4506626",
"text": "def set_ShareWithPublic(value)\n set_input(\"ShareWithPublic\", value)\n end",
"title": ""
},
{
"docid": "2ec545bf139f216d88f80a92704e8a53",
"score": "0.4503098",
"text": "def share_params\n params.require(:share).permit(:flagged)\n end",
"title": ""
},
{
"docid": "614a854e5f162ba5ce9e093d63fd4b0b",
"score": "0.44713974",
"text": "def share_params\n params.require(:share).permit(:code, :company, :exchange)\n end",
"title": ""
},
{
"docid": "801a5decf746b737bfd4ce981cc0861c",
"score": "0.4464234",
"text": "def update_permissions\n # revoke any users that had something, but now has nothing\n revoke_user_permissions(users_to_revoke) unless users_to_revoke.empty?\n\n # set permissions for each of the permission types\n %w{full read change}.each do |perm_type|\n # set permissions for a brand new share OR\n # update permissions if the current state and desired state differ\n next unless permissions_need_update?(perm_type)\n\n grant_command = \"Grant-SmbShareAccess -Name '#{new_resource.share_name}' -AccountName \\\"#{new_resource.send(\"#{perm_type}_users\").join('\",\"')}\\\" -Force -AccessRight #{perm_type}\"\n\n Chef::Log.debug(\"Running '#{grant_command}' to update the share permissions\")\n powershell_exec!(grant_command)\n end\n end",
"title": ""
},
{
"docid": "fcd2d7d5811508a0b124b17b9f6460e2",
"score": "0.4441828",
"text": "def update_permissions(shareid, permissions)\n update(shareid, \"permissions\", permissions)\n end",
"title": ""
},
{
"docid": "b5784eb25bf2dde1c744a506c86919de",
"score": "0.44346392",
"text": "def share_link_params\n params.require(:share_link).permit(:url, :clicks, :shares, :creatrix_id, :description, :image)\n end",
"title": ""
},
{
"docid": "6db136d445c9d2a0d00633f53465b0d7",
"score": "0.44242573",
"text": "def use_process_types(*process_types)\n @process_types = process_types.flatten\n end",
"title": ""
},
{
"docid": "53bc7a6bc61a944257c361e3df81b9a6",
"score": "0.44171053",
"text": "def set_share_acl(name, options = {})\n # Query\n query = { \"comp\" => \"acl\" }\n query[\"timeout\"] = options[:timeout].to_s if options[:timeout]\n\n # Scheme + path\n uri = share_uri(name, query)\n\n # Headers + body\n headers = StorageService.common_headers\n\n signed_identifiers = options[:signed_identifiers] ? options[:signed_identifiers] : nil\n body = signed_identifiers ? Serialization.signed_identifiers_to_xml(signed_identifiers) : nil\n\n # Call\n response = call(:put, uri, body, headers, options)\n\n # Result\n share = Serialization.share_from_headers(response.headers)\n share.name = name\n\n return share, signed_identifiers || []\n end",
"title": ""
},
{
"docid": "3e92da19c1330a240f41a96e2f57e359",
"score": "0.44150764",
"text": "def enum_conf_shares()\n if sysinfo[\"OS\"] =~ /Windows 7|Vista|2008/\n shares_key = \"HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\services\\\\LanmanServer\\\\Shares\"\n else\n shares_key = \"HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\services\\\\lanmanserver\\\\Shares\"\n end\n share_names = registry_enumvals(shares_key)\n\n if share_names.length > 0\n shares = []\n print_status(\"The following shares were found:\")\n share_names.each do |sname|\n info = registry_getvaldata(shares_key,sname)\n next if info.nil?\n share_info = info.split(\"\\000\")\n print_status(\"\\tName: #{sname}\")\n stype = remark = path = nil\n share_info.each do |e|\n name,val = e.split(\"=\")\n case name\n when \"Path\"\n print_status \"\\tPath: #{val}\"\n path = val\n when \"Type\"\n print_status \"\\tType: #{val}\"\n stype = share_type(val.to_i)\n when \"Remark\"\n remark = val\n end\n end\n # Match the format used by auxiliary/scanner/smb/smb_enumshares\n # with an added field for path\n shares << [ sname, stype, remark, path ]\n print_status()\n end\n report_note(\n :host => session,\n :type => 'smb.shares',\n :data => { :shares => shares },\n :update => :unique_data\n )\n else\n print_status(\"No shares were found\")\n end\n end",
"title": ""
},
{
"docid": "9aecc56d791cedc2d36412e2975f4979",
"score": "0.44035465",
"text": "def set_types(response)\n board_id = response.args.last\n board = trello_client.find(:boards, board_id)\n response.reply(\"Starting Set Types session for board: #{board.name}\")\n response.reply(\"Note: You have #{RESPONSE_TIMEOUT} seconds between questions to reply\")\n select_next_typeless_card_from_board(response, board)\n end",
"title": ""
},
{
"docid": "7452ce645c6122af20bd2cfeb8c0222a",
"score": "0.43987024",
"text": "def share_params\n if params[:share] # if params[:share] fix the case when user click update button without selecting new file\n params.require(:share).permit(:file, :original_filename, :public, :tag_list)\n end\n end",
"title": ""
},
{
"docid": "9dda3a0be46d96715f0ba6cf24aebbf3",
"score": "0.438679",
"text": "def publish_shares\n self.shares.where(:status => 'publishing').each do |share|\n share.status = 'active'\n share.expire_cached_json\n share.feed_post_create\n end\n end",
"title": ""
},
{
"docid": "b2c5f7b89e34ac9c630b7b882f4f2d4e",
"score": "0.43864378",
"text": "def set_share\n @share = user_shares.find_by(params.permit(:id))\n end",
"title": ""
},
{
"docid": "90647598502b5edbb9bc1f77a66ff9ac",
"score": "0.43801814",
"text": "def _set_provided_formats(*formats)\n if @_content_type\n raise ContentTypeAlreadySet, \"Cannot modify provided_formats because content_type has already been set\"\n end\n @_provided_formats = []\n provides(*formats)\n end",
"title": ""
},
{
"docid": "2ad735ee510b73de67d1101e277eaf0e",
"score": "0.43795398",
"text": "def add_company_share(company_id, share)\n path = \"/companies/#{company_id}/shares\"\n defaults = {:visibility => {:code => \"anyone\"}}\n post(path, render(:company_share, defaults.merge(share)), 'x-li-format' => 'xml', \"Content-Type\" => \"application/xml\")\n end",
"title": ""
},
{
"docid": "270d4362003c9c3f2154a38ae00a942b",
"score": "0.43790314",
"text": "def set_sharelink\n @sharelink = Sharelink.find(params[:id])\n end",
"title": ""
},
{
"docid": "0cc8686ab2e46a21af984dda207da982",
"score": "0.43766615",
"text": "def share\n share_on_facebook if @user.share_facebook\n end",
"title": ""
},
{
"docid": "ad915637223184711fb81c78b9f25eab",
"score": "0.43581492",
"text": "def sites=(sites)\n validator = EnumAttributeValidator.new('String', [\"Discard\", \"Merge\"])\n unless validator.valid?(sites)\n fail ArgumentError, \"invalid value for 'sites', must be one of #{validator.allowable_values}.\"\n end\n @sites = sites\n end",
"title": ""
},
{
"docid": "9588ec5833a7a9a96dd228def5a152bb",
"score": "0.43554273",
"text": "def share_params\n params.require(:share).permit(:title, :description, :category, :school_id, :user_id, :date, :icon)\n end",
"title": ""
},
{
"docid": "cc6e7c4d66612be698bca71a3a871e6f",
"score": "0.435181",
"text": "def share\n ShareFacebookService.new(@user, @stream).run if @user.valid_fb_token? && share_facebook?\n ShareTwitterService.new(@user, @stream).run if @user.valid_tw_token? && share_twitter?\n end",
"title": ""
},
{
"docid": "17c24250aa56fdccf44472ec04970646",
"score": "0.43515605",
"text": "def share_recording=(share_recording)\n validator = EnumAttributeValidator.new('String', ['publicly', 'internally', 'none'])\n unless validator.valid?(share_recording)\n fail ArgumentError, 'invalid value for \"share_recording\", must be one of #{validator.allowable_values}.'\n end\n @share_recording = share_recording\n end",
"title": ""
},
{
"docid": "3a0315b0d2026eae11d28f05a2970923",
"score": "0.43477392",
"text": "def machine_shares(machine)\n @config['shares'].each do |src, dst|\n machine.vm.synced_folder(\n src,\n dst,\n create: true,\n type: share_type,\n SharedFoldersEnableSymlinksCreate: false\n )\n end\n end",
"title": ""
},
{
"docid": "d95b04f68b8fea14d908a20897b257f5",
"score": "0.4342098",
"text": "def share_params\n params.require(:share).permit(:name, :code, :share_type, :units, :purchase_price, :purchase_date, :last_price, :sell_price, :sell_date, :brokerage_account_id, :no_cash_transaction)\n end",
"title": ""
},
{
"docid": "19f13df4bcdeee60b174feaf45d3b82a",
"score": "0.43407506",
"text": "def set_ShareWithExtendedCircles(value)\n set_input(\"ShareWithExtendedCircles\", value)\n end",
"title": ""
},
{
"docid": "4f99921f2bb110987aa7b3a3b3036154",
"score": "0.43236533",
"text": "def shares\n @caldav_backend.shares(@calendar_info['id'])\n end",
"title": ""
},
{
"docid": "ce814a91baf26d8fa989070162d9c8f1",
"score": "0.43229216",
"text": "def sharing_type\n return @sharing_type\n end",
"title": ""
},
{
"docid": "daec2999cc1b5aa86e5b1286ef2eeb8d",
"score": "0.43204573",
"text": "def share_params\n params.require(:share).permit(:id, :bill_type_id, :grouping_id, :percent)\n end",
"title": ""
},
{
"docid": "d3e7cfcd9589cd6f6cf82a4d53136e72",
"score": "0.43178853",
"text": "def set_ctypes(types)\n @ctypes = types\n @offset = Array.new(types.length, 0)\n @size = self.class.size types\n end",
"title": ""
},
{
"docid": "d3e7cfcd9589cd6f6cf82a4d53136e72",
"score": "0.43178853",
"text": "def set_ctypes(types)\n @ctypes = types\n @offset = Array.new(types.length, 0)\n @size = self.class.size types\n end",
"title": ""
},
{
"docid": "90399fced8bd5613267db234b900acba",
"score": "0.43154866",
"text": "def set_TypeIDs(value)\n set_input(\"TypeIDs\", value)\n end",
"title": ""
},
{
"docid": "9803f377efb2159f1d38eb21e8fc9cda",
"score": "0.43138736",
"text": "def share_params\n params.require(:share).permit(:content, :category_id)\n end",
"title": ""
},
{
"docid": "7a06579765df767d632a0cba88687710",
"score": "0.43096882",
"text": "def sharing_message_actions=(value)\n @sharing_message_actions = value\n end",
"title": ""
},
{
"docid": "b5af6b08cd07a7810af40ece148bec0c",
"score": "0.43074962",
"text": "def share_on_twitter_params\n params.require(:share_on_twitter).permit!\n end",
"title": ""
},
{
"docid": "64fe575348a8a10ce7850fd0b5185498",
"score": "0.42921478",
"text": "def share(model)\n model.before_shared_by(self) if model.respond_to?('before_shared_by')\n shares << model.shares.create!(sharer: self)\n model.inc(:shares_count, 1)\n model.after_shared_by(self) if model.respond_to?('after_shared_by')\n self.before_share(model) if self.respond_to?('before_share')\n self.after_share(model) if self.respond_to?('after_share')\n end",
"title": ""
},
{
"docid": "78428c13df3f19f418a67bb445770189",
"score": "0.427147",
"text": "def set_Shared(value)\n set_input(\"Shared\", value)\n end",
"title": ""
},
{
"docid": "a5dca117731c6228d4313ce396c442b3",
"score": "0.42685226",
"text": "def serialize_share(checkin_id=nil, facebook_id=nil, place_id=nil, message=nil)\n\n s = Share.find_or_initialize_by_place_id(place_id)\n s.facebook_id = facebook_id\n s.place_id = place_id\n s.message = message\n s.shared_at = Time.now\n s.save\n\n # Temporarily disabling map share for specific user target sharing and notification systems\n # create_new_share_map = []\n # share_facebook_id_array.each do |share_facebook_id|\n # create_new_share_map << [checkin_id, share_facebook_id]\n # end\n # \n # share_maps_columns = [:checkin_id, :facebook_id]\n # SharesMap.import share_maps_columns, create_new_share_map\n # \n # self.serialize_notification(sharer_facebook_id, share_facebook_id_array, checkin_id, \"checkin\", nil)\n\nend",
"title": ""
},
{
"docid": "8ad5aaf09e06b76ea8570a3d6802a2a0",
"score": "0.4264045",
"text": "def share_params\n params.require(:share).permit(:active, :name, :isin, :financial, :size, :stock_exchange, :currency, :stock_index_id)\n end",
"title": ""
},
{
"docid": "7bd653241fca5322f60fde76d58301fe",
"score": "0.42427793",
"text": "def set_types(user_data_types)\n @@data_types = user_data_types\n end",
"title": ""
},
{
"docid": "2e14200612254dc67834185f43ea19bf",
"score": "0.4232426",
"text": "def shared_with_accounts= (account_id_list)\n already_sharing_with = self.shared_with_accounts\n\n accounts_to_add = account_id_list.select { |account_id| !already_sharing_with.include?(account_id) }\n\n # Note, using the network API, it is possible to \"unshare\" an image template\n # with the account that owns it, however, this leads to a rather odd state\n # where the image has allocated resources (that the account may be charged for)\n # but no way to delete those resources. For that reason this model\n # always includes the account ID that owns the image in the list of\n # accounts the image will be shared with.\n my_account_id = self['accountId']\n accounts_to_add.push(my_account_id) if !already_sharing_with.include?(my_account_id) && !accounts_to_add.include?(my_account_id)\n\n accounts_to_remove = already_sharing_with.select { |account_id| (account_id != my_account_id) && !account_id_list.include?(account_id) }\n\n accounts_to_add.each {|account_id| self.service.permitSharingAccess account_id }\n accounts_to_remove.each {|account_id| self.service.denySharingAccess account_id }\n end",
"title": ""
},
{
"docid": "7c41bf7b02f81a83935f913d1148b631",
"score": "0.42322946",
"text": "def set_FeedType(value)\n set_input(\"FeedType\", value)\n end",
"title": ""
},
{
"docid": "7c41bf7b02f81a83935f913d1148b631",
"score": "0.42322946",
"text": "def set_FeedType(value)\n set_input(\"FeedType\", value)\n end",
"title": ""
},
{
"docid": "7c41bf7b02f81a83935f913d1148b631",
"score": "0.42322946",
"text": "def set_FeedType(value)\n set_input(\"FeedType\", value)\n end",
"title": ""
}
] |
f48d9e87ed0ced4f0f873d3eeb305047
|
Makes thumbnails if ImageMagick is available and we have local storage
|
[
{
"docid": "c7b4b46fd029b9db2062b4fe602b2fc5",
"score": "0.85688114",
"text": "def make_thumbnails\n return true unless defined?(IMAGEMAGICK_CONVERT) && is_local?\n system(\"#{IMAGEMAGICK_CONVERT} -resize #{THUMBNAIL_SIZE} #{filename} #{filename('s')}\")\n true\n end",
"title": ""
}
] |
[
{
"docid": "2cf0fafcba508c75e7d8093ddd4fcac8",
"score": "0.73397434",
"text": "def resize\n if size.max > 1024\n res = %x( #{magick_bin_name(\"convert\")} -auto-orient -resize 1024x768 #{Shellwords.shellescape path} #{Shellwords.shellescape path})\n Rails.logger.info res\n end\n unless has_thumbnail?\n unless File.exists? path.gsub(/(.+)\\/.+/, '\\1/thumbs')\n Dir.mkdir path.gsub(/(.+)\\/.+/, '\\1/thumbs')\n end\n ## that's a bit broken on windows - why?\n res = %x( #{magick_bin_name(\"convert\")} -verbose -auto-orient -strip -thumbnail 300x160 #{Shellwords.shellescape path} #{Shellwords.shellescape path.gsub(/(.+)\\/(.+)/, '\\1/thumbs/\\2')})\n Rails.logger.info res\n end\n end",
"title": ""
},
{
"docid": "cab8a6e2aef6c1020964a23257fd744b",
"score": "0.6840179",
"text": "def create_thumbnail(image)\n thumb = ( image.gsub /^#{@dirname}/, \"#{@thumbs}\" ) + @thumbext\n system(\"convert #{image} -thumbnail '#{@size}>' -#{@action} '#{@size}' -background white -quality 60 -gravity center -extent #{@size} #{thumb}\")\n end",
"title": ""
},
{
"docid": "f7d97f0a55265a099a4d19f326e4ee52",
"score": "0.68124825",
"text": "def on_demand(width, height)\n dims = \"#{width}x#{height}\"\n\n public_path = self.public_path(dims)\n output_path = self.output_path(dims)\n\n if File.exists?(output_path)\n logger.info \"[iphoto library] Thumbnail hit at #{public_path}\"\n else\n FileUtils.mkdir_p(File.dirname(output_path))\n\n unless defined? MiniMagick\n logger.debug \"[iphoto library] Requiring MiniMagick\"\n require 'mini_magick'\n end\n\n image = MiniMagick::Image.from_file(image_path(true))\n image.resize dims\n image.write(output_path)\n FileUtils.chmod 0755, output_path\n\n logger.info \"[iphoto library] Created thumbnail at #{output_path}\"\n end\n\n public_path\n end",
"title": ""
},
{
"docid": "c008b35d76a51997eb3f7bc903768266",
"score": "0.6812263",
"text": "def create_thumbnail(image)\n #FIXME - make the path consistent with working tree files.\n # the current proess relies on Glimage paths which we don't have.\n geo = Rails.application.config.thumbnail_geometry.nil? ? \"100\" : Rails.application.config.thumbnail_geometry\n cmd = Escape.shell_command [\"convert\", image.filepath, '-thumbnail', geo, image.thumbnail('filepath')]\n logger.debug \"Command: #{cmd}\"\n output = `#{cmd}`\n logger.debug \"output #{output}\"\n logger.debug \"result #{$?.success?}\"\n end",
"title": ""
},
{
"docid": "a9d6cb0c3a40f6c02332571f5e2c02db",
"score": "0.6730484",
"text": "def host\n self.image_path = Base64.encode64(\n SecureRandom.hex(10) + \n Time.now.to_i.to_s).chomp + \".jpg\"\n\n tempfile = Tempfile.new(image_path)\n file_path = tempfile.path\n\n system(\"wget --no-check-certificate \"\\\n \"-U '#{CONFIG[:user_agent]}' '#{orig_image_url}' \"\\\n \"-T 30 -t 3 \"\\\n \"--output-document '#{file_path}'\")\n\n\n if File.exists? file_path\n\n # Store original image\n #\n FileSystem.store(\n image_path,\n open(file_path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n # Create tiny thumbnail\n #\n #image = MiniMagick::Image.open(file_path)\n\n #ImageUtilities.reduce_to_with_image(\n # image,\n # {:width => 180,:height => 180})\n\n #FileSystem.store(\n # thumbnail_path,\n # open(image.path),\n # \"Content-Type\" => \"image/jpeg\",\n # \"Expires\" => 1.year.from_now.\n # strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n # Create square thumbnail\n #\n base = MiniMagick::Image.open(File.join(\n RAILS_ROOT,\n IMAGES[:white_200x200]))\n image = MiniMagick::Image.open(file_path)\n\n base = base.composite(image) do |canvas|\n canvas.gravity \"Center\"\n canvas.geometry \"200x200+0+0\"\n end\n\n FileSystem.store(\n square_path,\n open(base.path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n # Create blurred thumbnail\n #\n image = MiniMagick::Image.open(base.path)\n\n image.combine_options do |canvas|\n canvas.blur \"2.5x2.5\"\n end\n\n FileSystem.store(\n blur_path,\n open(image.path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n # Create giant thumbnail\n #\n image = MiniMagick::Image.open(file_path)\n\n ImageUtilities.reduce_to_with_image(\n image,\n {:width => 520,:height => 390})\n\n FileSystem.store(\n giant_path,\n open(image.path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n\n # Create unit.\n #\n base = MiniMagick::Image.open(File.join(\n RAILS_ROOT,\n IMAGES[:fb_unit_base]))\n overlay = MiniMagick::Image.open(File.join(\n RAILS_ROOT,\n IMAGES[:fb_unit_overlay]))\n image = MiniMagick::Image.open(file_path)\n\n base = base.composite(image) do |canvas|\n canvas.quality \"100\"\n canvas.gravity \"Center\"\n canvas.geometry \"407x407+0+0\"\n end\n\n base = base.composite(overlay) do |canvas|\n canvas.quality \"100\"\n canvas.gravity \"NorthWest\"\n canvas.geometry \"54x54+447+19\"\n end\n\n FileSystem.store(\n unit_path,\n open(base.path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n self.is_processed = true\n self.save!\n end\n\n rescue MiniMagick::Invalid => ex\n LoggedException.add(__FILE__,__method__,ex)\n end",
"title": ""
},
{
"docid": "d1672a18a4518d7a8533cdea211cb675",
"score": "0.6706176",
"text": "def process_image(path)\n picture_name = File.basename(path)\n thumbnail_dir = File.join(File.dirname(path), \"thumbnails\")\n thumbnail_path = File.join(thumbnail_dir, \"#{File.basename(picture_name, File.extname(picture_name))}.jpg\")\n Dir.mkdir(thumbnail_dir) unless File.exist?(thumbnail_dir)\n\n image_optim = ImageOptim.new\n\n image = MiniMagick::Image.open(path)\n image_prop = {\n \"name\" => picture_name,\n \"thumb\" => \"thumbnails/#{picture_name}\",\n \"height\" => image.height,\n \"width\" => image.width\n }\n\n return image_prop if File.exist?(thumbnail_path)\n\n# -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB\n\n image.format \"jpeg\" unless File.extname(picture_name) == \"jpg\"\n image.combine_options do |b|\n b.resize \"#{MAX_DIMENSION}>\"\n b.sampling_factor \"4:2:0\"\n b.strip\n b.interlace \"JPEG\"\n b.colorspace \"RGB\"\n b.quality 85\n end\n image.write thumbnail_path\n\n image_optim.optimize_image!(path)\n image_optim.optimize_image!(thumbnail_path)\n\n image_prop\nend",
"title": ""
},
{
"docid": "158b7fa45a7e5ff2a2c7d9d5670f9adb",
"score": "0.66231674",
"text": "def create_thumbnails\n typescript = self.typescript\n preview = self.preview_image\n return false if preview.nil?\n full_filename = typescript.full_filename\n pos = full_filename.rindex('.')\n main_full_beginning = full_filename[0...pos]\n filename = typescript.filename\n pos = filename.rindex('.')\n main_beginning = filename[0...pos]\n preview_full_filename = preview.full_filename\n (Medium::COMMON_SIZES.keys - [Document::PREVIEW_TYPE]).each do |type|\n thumbnail = Magick::Image.read(preview_full_filename).first\n quality = ImageUtils::resize_image(thumbnail, Medium::COMMON_SIZES[type])\n # write file\n filename_ending = \"_#{type.to_s}.jpg\"\n full_path = main_full_beginning + filename_ending\n thumbnail.write(full_path) do\n self.quality = quality if !quality.nil?\n self.format = 'JPG'\n end\n # create db record\n attributes = { :size => File.size(full_path), :width => thumbnail.columns, :height => thumbnail.rows, :content_type => 'image/jpeg', :filename => main_beginning + filename_ending }\n derivative = typescript.children.find_by(thumbnail: type.to_s)\n if derivative.nil?\n Typescript.create attributes.merge(:parent_id => typescript.id, :thumbnail => type.to_s)\n else\n derivative.update_attributes attributes\n end\n end\n end",
"title": ""
},
{
"docid": "ab62f51eb2236e20c25f5917533b4360",
"score": "0.65811855",
"text": "def thumbnail(options = {})\n return if !readable? || !thumbnailable?\n\n size = options[:size].to_i\n if size > 0\n # Limit the number of thumbnails per image\n size = (size / 50.0).ceil * 50\n # Maximum thumbnail size\n size = 800 if size > 800\n else\n size = Setting.thumbnails_size.to_i\n end\n size = 100 unless size > 0\n target = thumbnail_path(size)\n\n diskfile_s3 = diskfile\n begin\n Redmine::Thumbnail.generate(diskfile_s3, target, size, is_pdf?)\n rescue => e\n Rails.logger.error \"An error occured while generating thumbnail for #{diskfile_s3} to #{target}\\nException was: #{e.message}\"\n return\n end\n end",
"title": ""
},
{
"docid": "1e8ae4ca206c38f3fb6fab2c15147c9b",
"score": "0.657198",
"text": "def thumbnail!\n image.recreate_versions! if thumbnail_coordinates_changed?\n end",
"title": ""
},
{
"docid": "0bdd60c4c8dfa4ae8877991820b07777",
"score": "0.65285426",
"text": "def imagemagick?; end",
"title": ""
},
{
"docid": "17ed9f0890ed77d505290e6140c17f45",
"score": "0.65218",
"text": "def host\n self.image_path = Base64.encode64(\n SecureRandom.hex(10) + \n Time.now.to_i.to_s).chomp + \".jpg\"\n\n tempfile = Tempfile.new(image_path)\n file_path = tempfile.path\n\n system(\"wget --no-check-certificate \"\\\n \"-U '#{CONFIG[:user_agent]}' '#{orig_image_url}' \"\\\n \"-T 30 -t 3 \"\\\n \"--output-document '#{file_path}'\")\n\n\n if File.exists? file_path\n\n # Store original image\n #\n FileSystem.store(\n image_path,\n open(file_path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n # Create thumbnail\n #\n image = MiniMagick::Image.open(file_path)\n\n ImageUtilities.reduce_to_with_image(\n image,\n {:width => 180,:height => 180})\n\n FileSystem.store(\n thumbnail_path,\n open(image.path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n self.is_processed = true\n self.save!\n end\n\n rescue MiniMagick::Invalid => ex\n LoggedException.add(__FILE__,__method__,ex)\n end",
"title": ""
},
{
"docid": "b68fe78082aad9a05024bc7db03a9155",
"score": "0.6485065",
"text": "def upload_thumb\n path = \"#{Rails.root}/tmp/#{id}_#{Process.pid}.png\"\n `convert #{@file.tempfile.path}[0] -scale 128x128 #{path}`\n\n if File.exists? path\n file_s3_obj_thumb.write(file: path, content_type: 'image/png')\n File.delete(path)\n end\n end",
"title": ""
},
{
"docid": "280898c87b249fbc90612ab525e86d51",
"score": "0.647323",
"text": "def has_thumbnail?\n File.exists? path.gsub(/(.+)\\/(.+)/, '\\1/thumbs/\\2')\n end",
"title": ""
},
{
"docid": "1f62e4342d09719e8aa4dab26b31a2c2",
"score": "0.6424549",
"text": "def thumbnail(size); end",
"title": ""
},
{
"docid": "6677aaf3cdc36053fced90f8c3c1e849",
"score": "0.632146",
"text": "def create_thumbnail\n #create the subfolder if it doesn't exist\n return false if !subdir_is_writable?\n \n if File.exists?(thumbnail_path)\n logger.warn(\"Not creating thumbnail for movie #{self} because it already exists\")\n return\n end\n \n #generate a thumbnail and put it inside that subfolder\n thumbnail_command = \"#{RmedialSetting.default.path_to_ffmpeg} -i \\\"#{file_name}\\\" -s #{THUMBNAIL_W}x#{THUMBNAIL_H} -an -ss 3 -t 00:00:03 -f mjpeg -y \\\"#{thumbnail_path}\\\"\"\n if !system(thumbnail_command)\n logger.error(\"Unable to create thumbnail for #{self}: #{$!}. Ran command: #{thumbnail_command}\")\n else\n logger.debug(\"Created thumbnail fine for #{self}\")\n end\n end",
"title": ""
},
{
"docid": "4f7e41cb0a357dbcb5062807616e9345",
"score": "0.63116074",
"text": "def create_thumbnails()\n # {{{\n begin\n @@logger.log('IMAGE UP | Importing image')\n image_renderer = @@image_renderer.new(@media_asset)\n \n id = @media_asset.media_asset_id\n ext = @media_asset.extension.dup.downcase\n path = Aurita.project_path(:public, :assets, \"asset_#{id}.#{ext}\")\n \n @@logger.log(\"IMAGE UP | Path is #{path}\")\n # Every image needs a jpeg base image (esp. needed for PDF): \n STDERR.puts \"Importing #{path} using #{image_renderer.class.inspect}\"\n image_renderer.import(path)\n image_renderer.create_image_variants(@@variants)\n\n if ext == 'pdf' then\n image_renderer.create_pdf_preview()\n elsif @media_asset.is_video? then\n dest = Aurita.project_path(:public, :assets, \"asset_#{id}.jpg\")\n # File.open(source, 'w')\n # system \"ffmpeg -i #{path} -ar 22050 -ab 32 -acodec mp3\n # -s 480x360 -vcodec flv -r 25 -qscale 8 -f flv -y #{ dest }\"\n system(\"ffmpeg -i '#{path}' -ss 00:00:10 -vframes 1 -f image2 -vcodec mjpeg '#{dest}'\")\n ext = 'jpg'\n end\n rescue ::Exception => e\n STDERR.puts('Error when trying to create image versions: ' << e.message)\n e.backtrace.each { |m| \n STDERR.puts(m)\n }\n end\n end",
"title": ""
},
{
"docid": "e244239221f9bae1b5015f67a95e571d",
"score": "0.630635",
"text": "def generate_thumbnail(image_path, commit_id)\n thumb_size = Glitter::Application.config.thumbnail_geometry\n image = Magick::Image.read(\n \"#{satellitedir}/#{image_path}\"\n ).first\n image.scale(\n thumb_size[0],\n thumb_size[1]\n ).write thumbnail_for(commit_id, true)\n end",
"title": ""
},
{
"docid": "82f114fe98d0a0169b08c4885bb595ce",
"score": "0.6299904",
"text": "def create_thumbnail\n return unless self.content.has_content?\n\n if video?\n create_video_thumbnail\n elsif pdf?\n create_pdf_thumbnail\n else\n create_derivatives\n end\n self.save\n end",
"title": ""
},
{
"docid": "b9c1041624455481f1d39843261884d0",
"score": "0.6240197",
"text": "def generate_thumb(tmp_file_path)\n %x(convert #{tmp_file_path}.pdf[0-#{@num_thumb_pages}] -thumbnail x640 #{tmp_file_path}.png)\n stripped_file_names = (0...@num_thumb_pages).to_a.map { |i| \"#{tmp_file_path}-#{i}.png\" }.join(\" \")\n output_path = \"#{tmp_file_path}_merged.jpg\"\n %x(montage #{stripped_file_names} -mode concatenate -quality 80 -tile x1 #{output_path})\n\n output_path\n end",
"title": ""
},
{
"docid": "63a3335538507c3dc9758b8de92759c6",
"score": "0.6205414",
"text": "def imagemagick7?; end",
"title": ""
},
{
"docid": "969ccef4a8c4185820863a25da29a4f9",
"score": "0.6203547",
"text": "def convert(filename)\n\n uuid = UUID.timestamp_create().to_s22\n\n source_file = Rails.root.join(DIRECTORY, \"#{uuid}_#{filename}\")\n full_size_image_file = Rails.root.join(DIRECTORY, \"#{uuid}_full_image.jpg\")\n large_thumbnail_file = Rails.root.join(DIRECTORY, \"#{uuid}_large_thumb_image.jpg\")\n small_thumbnail_file = Rails.root.join(DIRECTORY, \"#{uuid}_small_thumb_image.jpg\")\n\n # Write the source file to directory.\n f = File.new(source_file, \"wb\")\n f.write(self.raw_data)\n f.close\n\n # Use RMagick to resize the source file to the size defined by FULL_IMAGE_SIZE\n # and write the result to full_size_image_file\n full_size = Magick::Image.read(source_file).first\n full_size.change_geometry(FULL_IMAGE_SIZE) { |cols, rows, img|\n img.resize!(cols, rows)\n }\n full_size.write(full_size_image_file)\n\n # Use RMagick to resize the source file to the size defined by LARGE_THUMB_SIZE\n # and write the result to large_thumbnail_file\n large_thumb = Magick::Image.read(source_file).first\n large_thumb.change_geometry(LARGE_THUMB_SIZE) { |cols, rows, img|\n img.resize!(cols, rows)\n }\n large_thumb.write(large_thumbnail_file)\n\n # Make a thumbnail using RMagick. Thumbnail is created by cutting as big as possible\n # square-shaped piece from the center of the image and then resizing it to 50x50px.\n small_thumb = Magick::Image.read(source_file).first\n small_thumb.crop_resized!(SMALL_THUMB_WIDTH, SMALL_THUMB_HEIGHT, Magick::NorthGravity)\n small_thumb.write(small_thumbnail_file)\n\n # All conversions must succeed, else it's an error, probably because image file\n # is somehow corrupted.\n unless File.exists?(full_size_image_file) and File.exists?(large_thumbnail_file) and File.exists?(small_thumbnail_file)\n errors.add(:base, \"File upload failed. Image file is probably corrupted.\")\n return false\n end\n\n # Write new images to database and then delete image files.\n self.data = File.open(full_size_image_file,'rb').read\n File.delete(full_size_image_file)\n self.large_thumb = File.open(large_thumbnail_file,'rb').read\n File.delete(large_thumbnail_file)\n self.small_thumb = File.open(small_thumbnail_file,'rb').read\n File.delete(small_thumbnail_file)\n\n # Delete source file if it exists.\n File.delete(source_file)\n\n return true\n end",
"title": ""
},
{
"docid": "9bf4f2329eda1cf68a17a8675e3212e8",
"score": "0.61564857",
"text": "def install_images(object)\n generated_name = Storage.generated_file_name(object)\n install_main_image(object.has_image_id, generated_name)\n generate_thumbnails(object.has_image_id, generated_name) if thumbnails_needed?\n return generated_name\n ensure \n @temp_file.close! if !@temp_file.closed?\n @temp_file = nil\n end",
"title": ""
},
{
"docid": "be5b483ebd86366d9371fda1be8f2554",
"score": "0.6134684",
"text": "def thumbnails\n ImageCollection.by_make_model(make, model)\n end",
"title": ""
},
{
"docid": "cb359998101d70cd7478806d0daf6527",
"score": "0.61236537",
"text": "def resize(path, image, size)\n Rails.logger.warn \"resize method\"\n return false if size.split('x').count!=2\n Rails.logger.warn \"before File.exists? check: #{size.split('x').count}\"\n return false if !File.exists?(File.join(path))\n\n Rails.logger.warn \"before mkdir: #{path}/#{id}\"\n FileUtils.mkdir_p \"#{path}/thumbnails/#{id}\" if !File.exists?(File.join(path, 'thumbnails', id.to_s))\n\n image_original_path = \"#{path}/#{image}\"\n image_resized_path = \"#{path}/thumbnails/#{id}/#{size}_#{image}\"\n\n width = size.split('x')[0]\n height = size.split('x')[1]\n\n Rails.logger.warn \"Magick::Image.read(#{image_original_path})\"\n begin\n i = Magick::Image.read(image_original_path).first\n Rails.logger.warn \"before i.resize_to_fit\"\n i.resize_to_fit(width.to_i,height.to_i).write(image_resized_path)\n rescue Exception => e\n Rails.logger.error e\n end\n\n true\n end",
"title": ""
},
{
"docid": "44c54d3ffe1960ee55b124646df8f76e",
"score": "0.61136276",
"text": "def thumb(w_x_h, quality: 90, immediate: false)\n fail_for_non_images\n return thumb_in_test_env(w_x_h, quality: quality) if Rails.env.test?\n\n if thumbnail_sizes[w_x_h] && thumbnail_sizes[w_x_h][:uid]\n ret = OpenStruct.new(thumbnail_sizes[w_x_h])\n ret.url = Dragonfly.app.remote_url_for(ret.uid)\n ret\n else\n if svg?\n url = file.remote_url\n width = file_width\n height = file_height\n else\n if immediate || self.class.immediate_thumbnails\n image = Folio::GenerateThumbnailJob.perform_now(self, w_x_h, quality)\n ret = OpenStruct.new(image.thumbnail_sizes[w_x_h])\n ret.url = Dragonfly.app.remote_url_for(ret.uid)\n return ret\n else\n Folio::GenerateThumbnailJob.perform_later(self, w_x_h, quality)\n url = temporary_url(w_x_h)\n end\n width, height = w_x_h.split('x').map(&:to_i)\n end\n OpenStruct.new(\n uid: nil,\n signature: nil,\n url: url,\n width: width,\n height: height,\n quality: quality\n )\n end\n end",
"title": ""
},
{
"docid": "4aba3d759580730aaca0a55fff9e1474",
"score": "0.6096275",
"text": "def create_thumbnail(image, mime_type, temp_file)\n return if self.content.content.nil?\n if [\"application/pdf\"].include? mime_type\n nil # create_pdf_thumbnail\n elsif [\"image/png\",\"image/jpeg\", \"image/gif\", \"image/tif\", \"image/jp2\"].include? mime_type\n create_scaled_image(image, 200, temp_file)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "345f42adb41b18d839b9d7e468340f61",
"score": "0.6090683",
"text": "def create_thumbnail\n ImageGeneratingService.new(self, 'Thumbnail.png', 'image/png').generate_resized(120)\n end",
"title": ""
},
{
"docid": "78db938f7b9bac7b3a3befbc0972ecf1",
"score": "0.60827506",
"text": "def generate_thumbnail path, img\n img = img.resize_to_fit 200,200\n img.write path\n end",
"title": ""
},
{
"docid": "33bb111048a9cae8c178e6a9fac523a2",
"score": "0.6061897",
"text": "def resize_photos_helper(photo)\n return nil if photo.blank?\n image = MiniMagick::Image.open(self.photo.url)\n [[:height,300], [:width, 600]].each do |param, num|\n if image.send(param) > num \n scaling_percent = (num / image.send(param).to_f)*100\n image.sample(scaling_percent.to_s + \"%\")\n end\n end\n return image\n end",
"title": ""
},
{
"docid": "db1f78edcb6f17a7681322ad35246c31",
"score": "0.6038066",
"text": "def normalize_album(albid)\n require 'fileutils'\n FileUtils.mkdir_p(_(albid, 'thumbs'))\n FileUtils.mkdir_p(_(albid, 'trash'))\n all_images(albid).each{|tuple|\n source, target = _(tuple[:path]), _(tuple[:thumb])\n unless File.exists?(target)\n IMagick.create_thumbnail(source, target)\n end\n }\n end",
"title": ""
},
{
"docid": "046a486a9e0d799114a32afb06f89860",
"score": "0.6036202",
"text": "def should_create_thumbs?(file)\n file.nil? || !!HasImageExtension.match(file.path)\n end",
"title": ""
},
{
"docid": "d6e76da7b6c126174714c815043ca230",
"score": "0.6030307",
"text": "def via_files(filename, thumbnail_width)\n thumb = Vips::Image.thumbnail filename, thumbnail_width, crop: \"centre\"\n\n thumb.write_to_buffer \".jpg\"\nend",
"title": ""
},
{
"docid": "916415a314b4598285eb27d130665ed8",
"score": "0.60136914",
"text": "def set_thumbnail\n dir_name = File.dirname(@path)\n\n if File.exists?(dir_name + '/thumbnails/' + @file_name)\n @thumbnail = dir_name + '/thumbnails/' + @file_name\n @relative_thumbnail_path = @thumbnail.sub(Home::CONTENT_ROOT_DIRECTORY_REGEXP, '')\n else\n @thumbnail = @path\n @relative_thumbnail_path = @relative_path\n end\n end",
"title": ""
},
{
"docid": "6d4bf1e1022da5a4c2ce98de5e995471",
"score": "0.59993786",
"text": "def getthumbnail\n @trek = Trek.find params[:id]\n if @trek.nil?\n redirect_to treks_path, :alert => \"Trek not found.\"\n end\n fname = params[\"name\"]+\".\"+params[\"format\"]\n thumb_path = @trek.get_thumbnail(fname)\n if thumb_path.nil?\n img = Magick::Image.read(@trek.get_img_path(fname)).first\n thumb = img.resize_to_fill(75, 75)\n thumb.write(@trek.get_processed_path + \"/\" + fname)\n send_data thumb.to_blob, :type => \"image/jpeg\", :disposition => \"inline\"\n else\n send_file thumb_path, :type => \"image/jpeg\", :disposition => \"inline\"\n end\n end",
"title": ""
},
{
"docid": "6ddfbbaf94c8c5e987ba243ff40f3c14",
"score": "0.59917146",
"text": "def process_images(dir)\n pattern = File.join(\"**\", dir, \"*.png\")\n files = Dir.glob(pattern)\n files.each do |f|\n unless f.include?(IMG_THUMB) || f.include?(IMG_FINAL)\n puts \"Converting image #{f}\"\n f2 = f.gsub /.png/, ''\n # thumbs\n system \"convert #{f} -resize #{IMG_THUMB_SIZE}^ -extent #{IMG_THUMB_SIZE} #{f2}#{IMG_THUMB}.png\" unless File.exists?(\"#{f2}#{IMG_THUMB}.png\")\n # final\n system \"convert #{f} -resize #{IMG_SIZE} #{f2}#{IMG_FINAL}.png\" unless File.exists?(\"#{f2}#{IMG_FINAL}.png\") \n end\n end\nend",
"title": ""
},
{
"docid": "45072d18a7ba4aa9b31395d08e393609",
"score": "0.5988462",
"text": "def thumbnail_image\n end",
"title": ""
},
{
"docid": "e7cb93e0cf9603a24a444b0dad716dd0",
"score": "0.5987833",
"text": "def thumbnail(input = 0)\n return self.uploads[input].variant(resize: '1000x1000').processed\n end",
"title": ""
},
{
"docid": "10407256678f8161b733e80fd2718aee",
"score": "0.5975426",
"text": "def create_thumbnail\n return create_resized_pic(THUMBNAIL_HEIGHT, THUMBNAIL_WIDTH, SIZE_THUMBNAIL)\n end",
"title": ""
},
{
"docid": "23839ec6777b385ac8f24494d3205ebd",
"score": "0.59751934",
"text": "def thumbnail(command)\n path = '/' + clean_up(command[1])\n dst = command[2]\n out, metadata = @client.files.thumbnail(path)\n pp metadata\n open(dest, 'w') { |f| f.puts out }\n puts \"wrote thumbnail #{ dst }.\"\n end",
"title": ""
},
{
"docid": "f974f1aadcf9eb010fb119a61223f5e7",
"score": "0.5963367",
"text": "def get_thumbnail(image)\n if File.exist? ( ( image.gsub /^#{@dirname}/, \"#{@thumbs}\" ) + @thumbext)\n image = ( image.gsub /^#{@dirname}/, \"#{@thumbslocal}\" ) + @thumbext\n else\n image = '../images/bigicons/image.jpg'\n end\n image\n end",
"title": ""
},
{
"docid": "129d21e6b06869976c7c40cb3c45791a",
"score": "0.5952243",
"text": "def fake_thumbnail(commit_id)\n src = File.join(Rails.public_path, 'mini_dir.png')\n FileUtils.ln_s src, image_for(commit_id, 'thumbnails')\n end",
"title": ""
},
{
"docid": "55b000603c5b69ec6785ee1296a53100",
"score": "0.5940246",
"text": "def generate_video_thumbnail file\n FileUtils.rm(\"tmp/thumb.jpg\") if File.exists?(\"tmp/thumb.jpg\")\n begin\n `ffmpegthumbnailer -i #{file} -o tmp/thumb.jpg /dev/null 2>&1`\n File.new(\"tmp/thumb.jpg\").size > 0 ? true : false\n rescue => e\n logger.info e.inspect\n return false\n end\n end",
"title": ""
},
{
"docid": "026c5fabfed0196786c6941be564586d",
"score": "0.59192765",
"text": "def set_preview()\n temporal = get_random_dir()\n FileUtils::mkdir_p \"./temp/#{temporal}\"\n\n File.open(\"./temp/#{temporal}/#{@name}\", 'wb') do |f|\n f.write(Base64.decode64(@data))\n f.close\n end\n\n img = ImageList.new(\"./temp/#{temporal}/#{@name}\")\n width, height = 150, 150\n thumb = img.resize_to_fit(width, height)\n thumb.write(\"./temp/#{temporal}/thumb_#{@name}\")\n img.destroy!\n thumb.destroy!\n GC.start\n\n f_thumb = File.open(\"./temp/#{temporal}/thumb_#{@name}\", 'rb')\n thumb_s = f_thumb.read\n encoded_string = Base64.strict_encode64(thumb_s)\n f_thumb.close\n\n @preview = encoded_string\n\n FileUtils.rm_rf(Dir.glob('./temp/#{temporal}/*'))\n FileUtils.rm_rf('./temp/#{temporal}/')\n true\n end",
"title": ""
},
{
"docid": "888035d643debf2c880b22c76f7e09b1",
"score": "0.59147036",
"text": "def thumbnails\n\n @thumbnails ||= ThumbnailSet.new(self, {\n :small => { :dimensions => { :width => '40', \n :height => '40' }, :crop => true },\n :medium => { :dimensions => { :width => '150',\n :height => '150' }},\n :large => { :dimensions => { :width => '800',\n :height => '800'}, :format => :jpg }\n })\n\n end",
"title": ""
},
{
"docid": "aa6d92facfee07bc6df174ada4f6a466",
"score": "0.5907427",
"text": "def create_thumbnail(source, target)\n command_exec(:create_thumbnail, [quote(source), quote(target)])\n end",
"title": ""
},
{
"docid": "adb002ac839b447e031795d7e09778bf",
"score": "0.58926654",
"text": "def rmagick_img\n return @rmagick_img unless @rmagick_img.blank?\n if self.class.st_config[:blob].present?\n @rmagick_img ||= Magick::ImageList.new.from_blob(\n self.send(self.class.st_config[:blob])\n ).first\n elsif self.class.st_config[:file].present?\n @rmagick_img ||= Magick::ImageList.new.from_blob(\n File.read(self.send(self.class.st_config[:file]))\n ).first\n else\n raise \"No thumb source defined. You have to define neither :blob or :file\"\n end\n \n if self.class.st_config[:before_resize].present? && self.respond_to?(self.class.st_config[:before_resize].to_sym)\n self.send(self.class.st_config[:before_resize].to_sym)\n end\n @rmagick_img\n \n end",
"title": ""
},
{
"docid": "6ccea1d0ca5a1b9793ee4642a7d6e379",
"score": "0.58864987",
"text": "def thumbnail input\n return self.images[input].variant(resize: '300x300').processed\n end",
"title": ""
},
{
"docid": "3c79546efc04625a83086e1a345f8cce",
"score": "0.5879061",
"text": "def check_our_images!\n self.gsub!(/!image (\\w+\\/)?(\\d+)!/) do\n size, id = $1, $2\n size ||= 'thumb/'\n '\"!%s/%s%d.jpg!\":%s/image/show_image/%d' %\n [IMAGE_DOMAIN, size, id, HTTP_DOMAIN, id]\n end\n end",
"title": ""
},
{
"docid": "3c79546efc04625a83086e1a345f8cce",
"score": "0.5879061",
"text": "def check_our_images!\n self.gsub!(/!image (\\w+\\/)?(\\d+)!/) do\n size, id = $1, $2\n size ||= 'thumb/'\n '\"!%s/%s%d.jpg!\":%s/image/show_image/%d' %\n [IMAGE_DOMAIN, size, id, HTTP_DOMAIN, id]\n end\n end",
"title": ""
},
{
"docid": "32e7828377b2c0e3321b8647485105e2",
"score": "0.58770305",
"text": "def create_thumbnail\n image = Image.from_blob(self.photo_image).first\n thumbnail = image.resize_to_fill(320,240, gravity=CenterGravity)\n thumbnail.to_blob\n end",
"title": ""
},
{
"docid": "e279041f0fa9f0f6d6830d85acca07ec",
"score": "0.58753556",
"text": "def do_resize(height = THUMBNAIL_HEIGHT, width = THUMBNAIL_WIDTH)\n #MES- Only do thumbnailing if the Image Magick library can be loaded.\n # This is to make setup easier for other developers- they are not\n # required to have Image Magick.\n # More information on Image Magick is available at \n # http://studio.imagemagick.org/RMagick/doc/usage.html\n if RMAGICK_SUPPORTED\n #MES- Turn the blob into an ImageMagick object\n img = Magick::Image.from_blob(data).first\n if img.nil?\n logger.info \"Failed to resize image #{self.name}- unable to create RMagick wrapper for image\"\n return nil\n end\n \n #MES- Shrink the image\n return img.crop_resized(width, height)\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "ff2274e3ddc65923a5e5796c812ca68d",
"score": "0.587228",
"text": "def resize_picture picture_owner, path, filename_extension\n\n # if filename_extension == 'jpg'\n resize_factor = \"PICTURE_#{picture_owner.upcase}_PREVIEW_SIZE\".constantize.first # e.g. *PICTURE_COACH_PREVIEW_SIZE*\n system \"convert #{path}/original.#{filename_extension} -resize '#{resize_factor}' #{path}/preview.#{filename_extension}\"\n\n resize_factor = \"PICTURE_#{picture_owner.upcase}_VIEW_SIZE\".constantize.first # e.g. *PICTURE_COACH_VIEW_SIZE*\n system \"convert #{path}/original.#{filename_extension} -resize '#{resize_factor}' #{path}/view.#{filename_extension}\"\n # else\n # # for logo file: just symbol links to original one (nothing to resize)\n # system \"ln -s #{path}/original.#{filename_extension} #{path}/preview.#{filename_extension}\"\n # system \"ln -s #{path}/original.#{filename_extension} #{path}/view.#{filename_extension}\"\n # end\n # Thumb is and in Africa thumb\n resize_factor = \"PICTURE_#{picture_owner.upcase}_THUMB_SIZE\".constantize.first # e.g. *PICTURE_COACH_THUMB_SIZE*\n system \"convert #{path}/original.#{filename_extension} -resize '#{resize_factor}' #{path}/thumb.#{filename_extension}\"\n\n end",
"title": ""
},
{
"docid": "db205703d3556ab2c710fac4bcdccc42",
"score": "0.58599997",
"text": "def modify(options)\n Rails.logger.debug \" Modifying #{options.inspect}\"\n \n if options[:size]\n tempfile = Tempfile.new(['watchmemake','.jpg'])\n ImageScience.with_image(@file.path) { |i| i.thumbnail(options[:size]) { |t| t.save tempfile.path }}\n else\n tempfile = @file\n end\n \n return tempfile\n end",
"title": ""
},
{
"docid": "a9cf922ee10fb4a32ef47fad7d95defb",
"score": "0.5854601",
"text": "def check_thumbnail\n picurl = nil if picurl.blank?\n if picurl.nil? || picurl =~ /^data:/\n # Shouldn't have a thumbnail\n self.thumbnail = nil\n elsif picdata =~ /^data:/\n # The current thumbnail is valid\n elsif picurl && (self.thumbnail = Thumbnail.acquire( url, picurl )) && !thumbnail.thumbdata\n Delayed::Job.enqueue self # Update the thumbnail image in background\n end\n true\n end",
"title": ""
},
{
"docid": "e3b0d3b33a85c76acaf1a97a0f02171a",
"score": "0.5849443",
"text": "def convert(filename)\n\n uuid = UUID.timestamp_create().to_s22\n\n source_file = File.join(\"#{RAILS_ROOT}/#{DIRECTORY}\", \"#{uuid}_#{filename}\")\n full_size_image_file = File.join(\"#{RAILS_ROOT}/#{DIRECTORY}\", \"#{uuid}_full_image.jpg\")\n large_thumbnail_file = File.join(\"#{RAILS_ROOT}/#{DIRECTORY}\", \"#{uuid}_large_thumb_image.jpg\")\n small_thumbnail_file = File.join(\"#{RAILS_ROOT}/#{DIRECTORY}\", \"#{uuid}_small_thumb_image.jpg\")\n\n # Write the source file to directory.\n f = File.new(source_file, \"wb\")\n f.write(self.raw_data)\n f.close\n\n # Then resize the source file to the size defined by full_image_size parameter\n # and convert it to .jpg file. Resize uses ImageMagick directly from command line.\n img = system(\"#{'convert'} '#{source_file}' -resize #{FULL_IMAGE_SIZE} '#{full_size_image_file}' > #{RAILS_ROOT}/log/convert.log\")\n large_thumb = system(\"#{'convert'} '#{source_file}' -resize #{LARGE_THUMB_SIZE} '#{large_thumbnail_file}' > #{RAILS_ROOT}/log/convert.log\")\n\n # If new file exists, it means that the original file is a valid image file. If so,\n # make a thumbnail using RMagick. Thumbnail is created by cutting as big as possible\n # square-shaped piece from the center of the image and then resizing it to 50x50px.\n if img\n small_thumb = Magick::Image.read(source_file).first\n small_thumb.crop_resized!(SMALL_THUMB_WIDTH, SMALL_THUMB_HEIGHT, Magick::NorthGravity)\n small_thumb.write(small_thumbnail_file)\n end\n\n # Delete source file if it exists.\n File.delete(source_file) if File.exists?(source_file)\n\n # Both conversions must succeed, else it's an error, probably because image file\n # is somehow corrupted.\n unless img and large_thumb and small_thumb\n errors.add_to_base(\"File upload failed. Image file is probably corrupted.\")\n return false\n end\n\n # Write new images to database and then delete image files.\n self.data = File.open(full_size_image_file,'rb').read\n File.delete(full_size_image_file) if File.exists?(full_size_image_file)\n self.large_thumb = File.open(large_thumbnail_file,'rb').read\n File.delete(large_thumbnail_file) if File.exists?(large_thumbnail_file)\n self.small_thumb = File.open(small_thumbnail_file,'rb').read\n File.delete(small_thumbnail_file) if File.exists?(small_thumbnail_file)\n return true\n end",
"title": ""
},
{
"docid": "082ae084863c94817a3f782fe3b501c7",
"score": "0.58444273",
"text": "def choose_processors\n [:thumbnail]\n end",
"title": ""
},
{
"docid": "dc2cf627f1ed7f9d5dfc7094f41a266e",
"score": "0.5836615",
"text": "def perform\n unless thumbdata && (thumbdata =~ /^data:/)\n logger.info \">>>>>>>>>>>>>>>>>>>>>>>>>>>>> Acquiring Thumbnail data on url '#{url}' >>>>>>>>>>>>>>>>>>>>>>>>>\"\n self.thumbdata = nil\n if fetchable(false) && response_body = fetch # Attempt to get data at the other end of the URL\n begin\n img = Magick::Image::from_blob(response_body).first\n if img.columns > 200\n scalefactor = 200.0/img.columns\n thumb = img.scale(scalefactor)\n else\n thumb = img\n end\n thumb.format = \"JPEG\"\n quality = 20\n thumb.write(\"thumb#{id.to_s}-M#{quality.to_s}.jpg\") { self.quality = quality } unless true # Rails.env.production?\n self.thumbdata = \"data:image/jpeg;base64,\" + Base64.encode64(thumb.to_blob{self.quality = quality })\n rescue Exception => e\n self.status = -2 # Bad data\n end\n end\n save # Save the status code, if nothing else\n end\n self\n end",
"title": ""
},
{
"docid": "60317e672269e1ccd04d3e2b749dc759",
"score": "0.5834679",
"text": "def resize_image uri, options = { }\n\n\t# parse id, mime type from image uri\n\tformat = uri.split('/').last.match(/\\.(.+)$/)[1]\n\tid = uri.split('/').last.sub(/\\..+$/, '').slugify\n\n\t# resize image and save to /tmp\n\timage = Image.read(uri)[0]\n\t\n\t# calculate width/height based on percentage of \n\t# difference of width from absolute value of 150\n\tif options[:width]\n\t\twidth = options[:width]\n\t\tscale = (image.page.width - width) / image.page.width.to_f\n\t\theight = image.page.height - (image.page.height * scale)\n\n\t\timage = image.thumbnail(width, height)\n\t\timage.write(\n\t\t\tpath = \"/tmp/#{id}-constrainedw.#{format}\"\n\t\t)\t\t\n\n\telsif options[:height]\n\t\theight = options[:height]\n\t\tscale = (image.page.height - height) / image.page.height.to_f\n\t\twidth = image.page.width - (image.page.width * scale)\n\n\t\timage = image.thumbnail(width, height)\n\t\timage.write(\n\t\t\tpath = \"/tmp/#{id}-thumbh.#{format}\"\n\t\t)\n\n\telse\n\t\twidth = 150\n\t\tscale = (image.page.width - width) / image.page.width.to_f\n\t\theight = image.page.height - (image.page.height * scale)\n\n\t\timage = image.thumbnail(width, height)\n\t\timage.write(\n\t\t\tpath = \"/tmp/#{id}-thumb.#{format}\"\n\t\t)\n\n\tend\n\n path\nend",
"title": ""
},
{
"docid": "acbe85ee9a5e39e1926b0d8daa02c229",
"score": "0.5830218",
"text": "def is_small_imageable?\n return true\n end",
"title": ""
},
{
"docid": "d0284bdb5d36b66f8dbcb3f649ae9656",
"score": "0.58265585",
"text": "def create_frame_and_thumbnail\n if (File.extname(self.image_sequence) == \".mha\")\n file_path = Rails.root.join(dir_path, self.image_sequence)\n result = system(Rails.root.join('scripts','mha_to_png','bin',\"MhaToPng #{file_path} 1\").to_s)\n base_name = File.basename(file_path, \".mha\")\n image = MiniMagick::Image.open(\"#{dir_path}/#{base_name}_frame.png\")\n image.resize \"200x200\"\n image.format \"png\"\n image.write \"#{dir_path}/#{base_name}_thumbnail.png\"\n File.chmod(0644, \"#{dir_path}/#{base_name}_thumbnail.png\")\n self.thumbnail = \"#{base_name}_thumbnail.png\"\n self.frame = \"#{base_name}_frame.png\"\n end\n end",
"title": ""
},
{
"docid": "e9564db49b0b467e5ae960562bf69152",
"score": "0.5815209",
"text": "def generate_thumbnail(image_path, commit_id)\n Gg::ImageProcessing.new(\"#{satellitedir}/#{image_path}\")\n .generate(image_for(commit_id, 'thumbnails'), 'thumbnail')\n end",
"title": ""
},
{
"docid": "a8663052f34c2abd6ac8ac0cb3becb78",
"score": "0.5799916",
"text": "def create_thumb(filename, height = 130)\n convert_cmd = `which convert`.strip\n \n output_filename = filename.gsub(\".png\", \"\") + \"-thumb-height-#{height}.png\"\n \n if !system(\"#{convert_cmd} -resize 'x#{height}' \\\"#{filename}\\\" \\\"#{output_filename}\\\" 2>&1\")\n @convert_errors.push(\"Errors during running convert utility (thumbnailing) on file '#{filename}'\")\n end\n \n output_filename\n end",
"title": ""
},
{
"docid": "ec0ceb4cf7d378366a9bef106c4e9ae4",
"score": "0.57970977",
"text": "def thumbnailable?\n false\n end",
"title": ""
},
{
"docid": "b7f1b3b207f67f5184ac4fbf8993fbee",
"score": "0.57967514",
"text": "def thumbnails\n ImageCollection.by_make_top(make, 10)\n end",
"title": ""
},
{
"docid": "2d8f4799bf82f2f3b82b3cfd92a31f25",
"score": "0.5790227",
"text": "def resizeImages\n # For each of the 9 images\n for counter in (1..9)\n pngName = \"./images/\" + counter.to_s() + \".png\"\n image = Magick::Image.read(pngName).first\n # Make the new image 25% larger\n thumb = image.scale(1.25)\n thumb.write(pngName)\n end\n end",
"title": ""
},
{
"docid": "02c0efb2aba42e608200f200d24d72d8",
"score": "0.57871693",
"text": "def thumbnail_path\n \"t_\" + image_path\n end",
"title": ""
},
{
"docid": "7703b2e71fb367eb11cbc426c2254a90",
"score": "0.57850504",
"text": "def store_image_dimensions_for_cropping\n save_attached_files # make sure Paperclip stores the files before this callback is executed\n if file.exists?\n img = ThumbMagick::Image.new(file.path('tocrop'))\n w,h = img.dimensions\n self.resize = 1\n self.crop_w = w\n self.crop_h = h\n self.crop_x = self.crop_y = 0\n save_without_versioning\n latest_version.update_attributes(:resize => resize, :crop_w => crop_w, :crop_h => crop_h, :crop_x => 0, :crop_y => 0)\n end\n end",
"title": ""
},
{
"docid": "74b72bb8df60ddbe4afd336a49ebda8b",
"score": "0.57791203",
"text": "def fake_thumbnail(commit_id)\n src = File.join(Rails.public_path, 'mini_dir.png')\n FileUtils.ln_s src, thumbnail_for(commit_id)\n end",
"title": ""
},
{
"docid": "203e98d250fa9f84fcd20838466634cf",
"score": "0.576325",
"text": "def successful_conversion?\n source = File.join(\"tmp\", \"#{@user.screen_name}_full_size\")\n full_size = File.join(DIRECTORY, filename)\n thumbnail = File.join(DIRECTORY, thumbnail_name)\n File.open(source, \"wb\") { |f| f.write(@image.read) }\n img = system(\"#{convert} #{source} -resize #{IMG_SIZE} #{full_size}\")\n thumb = system(\"#{convert} #{source} -resize #{THUMB_SIZE} #{thumbnail}\")\n File.delete(source) if File.exists?(source)\n unless img and thumb\n errors.add_to_base(\"File upload failed: Try a different image\")\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "259e583d4e25d627ce51f7f33af33f44",
"score": "0.57620054",
"text": "def thumbnail_image(size = :medium)\n if !remote_image.blank?\n return \"http://fffff.at/tempt1/photos/data/eyetags/thumb/#{self.attributes['remote_image'].gsub('gml','png')}\"\n # elsif Rails.env == 'development' && !File.exist?(self.image_path(size)) #don't do image 404s in development\n # return \"/images/defaults/tag_#{size.to_s}.jpg\"\n else\n return self.image(size)\n end\n end",
"title": ""
},
{
"docid": "6b6a297bdc51e5d14ad0ddb88ad8a6c2",
"score": "0.5759789",
"text": "def createThumbnail(blob, contenttype, device )\n\n\n thumb_path = \"public/thumbnails/#{device.id}/\"\n \n thumb_name = blob.blob_hash.to_s+\".png\"\n\n if contenttype == \"image/jpeg\" or contenttype == \"image/png\" or contenttype == \"image/gif\"\n data = getBlobById(blob.blob_hash)\n createIcon(data, thumb_name, thumb_path)\n blob.update_attribute(:thumbnail_name, thumb_name)\n return thumb_name\n \n elsif contenttype == \"video/x-msvideo\" or contenttype == \"video/msvideo\"\n format = blob.devfile.name.split(\".\").last\n if format == 'avi'\n vR_default_thumbnail_file = \"vR_avi.png\"\n elsif format == 'mov'\n vR_default_thumbnail_file = \"vR_mov.png\"\n end\n \n elsif contenttype == \"application/mswordapplication/x-mswordapplication/x-wordapplication/wordtext/plain\"\n vR_default_thumbnail_file = \"vR_doc.png\"\n elsif contenttype == \"application/x-ruby\"\n vR_default_thumbnail_file = \"vR_ruby.png\"\n elsif contenttype == \"text/plain\"\n vR_default_thumbnail_file = \"vR_txt.png\"\n else\n puts \"Unknown Filetype: #{contenttype.to_s}\".background(:red)\n vR_default_thumbnail_file = \"vR_unknown.png\"\n end\n \n # create dir if it does not exist\n if not (File.exists?(thumb_path) && File.directory?(thumb_path))\n FileUtils.mkdir_p(thumb_path)\n end\n \n # Copy default thumbnail to file\n from = \"public/thumbnails/vR_default_thumbnails/\" + vR_default_thumbnail_file\n to = thumb_path+thumb_name\n # ftools (ruby 1.8.7)\n #File.copy(from, to )\n \n # fileutils (ruby 1.9.2)\n FileUtils.cp(from, to )\n \n \n blob.update_attribute(:thumbnail_name, thumb_name)\n return thumb_name\n end",
"title": ""
},
{
"docid": "58791025d23bbfd11ae3a22cf07512bb",
"score": "0.575548",
"text": "def make\n src = @file\n dst = Tempfile.new([@basename, @format].compact.join(\".\"))\n dst.binmode\n\n command = <<-end_command\n #{ Paperclip.path_for_command('convert') }\n \"#{ File.expand_path(src.path) }\"\n #{ transformation_command }\n \"#{ File.expand_path(dst.path) }\"\n end_command\n success = system(command.gsub(/\\s+/, \" \"))\n\n if success && $?.exitstatus != 0 && @whiny_thumbnails\n raise PaperclipError, \"There was an error processing this thumbnail\"\n end\n\n dst\n end",
"title": ""
},
{
"docid": "0488e5bd0144c9e3bdecb0c735081901",
"score": "0.57550484",
"text": "def resize_thumb(sizestr)\n ret = nil\n if THUMB_SIZES.has_key?(sizestr)\n sw, sh = size(sizestr)\n img = Magick::Image.from_blob(data)[0]\n tw, th = size(thumb_l)\n img.crop!(thumb_x, thumb_y, tw, th)\n img.resize!(sw, sh)\n ret = img.to_blob\n else\n ret = data\n end\n GC.start\n ret\n end",
"title": ""
},
{
"docid": "491b71cafa9cfd93efea31f437ec51c7",
"score": "0.5744699",
"text": "def generate_image_sizes()\n\tKernel.system \"mkdir -p #{DESTINATION_DIRECTORY_NAME}\"\n\tSIZES.each do |size|\n\t\timagemagick_command = \"find . -maxdepth 1 -type f \\\\( -name '*.tif' -o -name '*.png' \\\\) | xargs -I@ #{IMAGEMAGICK_COMMAND} @ -resize #{size[:max_width]} -quality #{JPEG_QUALITY} -set filename:name '%t' '#{DESTINATION_DIRECTORY_NAME}/%[filename:name]-#{size[:name]}.#{OUTPUT_FILE_EXTENSION}'\"\n\t\tputs imagemagick_command\n\t\tKernel.system imagemagick_command\n\tend\nend",
"title": ""
},
{
"docid": "d08605b1170191b06cb8a59ac6488e67",
"score": "0.5736566",
"text": "def create_resized_image\n create_image do |xfrm|\n if size\n MiniMagick::Tool::Convert.new do |cmd|\n cmd << xfrm.path # input\n cmd.flatten\n cmd.resize(size)\n cmd << xfrm.path # output\n end\n end\n end\n end",
"title": ""
},
{
"docid": "28899d93975a6b43831cf3820f1afa68",
"score": "0.57245535",
"text": "def thumbnail_url\n is_processed ? \n FileSystem.url(thumbnail_path) :\n orig_image_url\n end",
"title": ""
},
{
"docid": "1a230884afc01b396c4bcaa42f871115",
"score": "0.57204604",
"text": "def via_memory(filename, thumbnail_width)\n data = IO.binread(filename)\n\n thumb = Vips::Image.thumbnail_buffer data, thumbnail_width, crop: \"centre\"\n\n thumb.write_to_buffer \".jpg\"\nend",
"title": ""
},
{
"docid": "9877de52e5fdf89d3cef1ce7aa102bae",
"score": "0.5720397",
"text": "def thumb\n return if collection?\n\n encoded_thumb if %w[book image manuscript map webarchive-seed].include?(dor_content_type)\n end",
"title": ""
},
{
"docid": "f0203efeacb2a957a217614169aaa78a",
"score": "0.57146245",
"text": "def create_attachment_thumbnails\n attachment_options[:thumbnails].each { |suffix, size| create_thumbnail(suffix, size) } unless attachment_options[:thumbnails].blank? || parent_id\n end",
"title": ""
},
{
"docid": "c16746bbdafaccef5d34a446c202ed32",
"score": "0.5694807",
"text": "def convert_to_cache(size)\n image_cache_file = \"#{Image::IMAGE_CACHES_DIR}/#{self.id}_#{size}\"\n meta = self.meta\n unless File.exists?(image_cache_file)\n image_data = \"#{Image::IMAGE_DATA_DIR}/#{self.id}\"\n unless File.exists?(image_data)\n save_to_file\n end\n ico = if(meta =~ /icon/); 'ico:' ;else '' ;end\n if system(\"/usr/local/bin/convert #{ico}#{image_data}'[#{size}x#{size}]' #{image_cache_file}\") == false\n logger.error(\"image convert error. cmd: 'convert #{image_data}'[#{size}x#{size}]' #{image_cache_file}'\")\n false\n else\n true\n end\n else\n false\n end\n end",
"title": ""
},
{
"docid": "bb5200f6bd72232ee9fed59b661bc3d7",
"score": "0.5688572",
"text": "def image_magick(image)\n Open3.capture3(\n \"convert\", image.cached, # What to convert?\n \"-resize\", \"#{image.width}x#{image.height}^\", # resizing\n \"-gravity\", \"center\", \"-crop\", \"#{image.width}x#{image.height}+0+0\", # cropping\n \"-background\", \"#ffffff\", # background color in case image was transparent\n \"+repage\", \"-flatten\", # Discard canvas size and squash into single layer\n image.resized # Target path of output\n )\n end",
"title": ""
},
{
"docid": "fa7b271e973df28a834f19e98216322b",
"score": "0.56847984",
"text": "def uploadoriginal(file,path)\n\text = File.extname(file)\n \tif ext.upcase == \".JPG\"\n \t\textfinal = \".jpg\"\n \telsif ext.upcase == \".JPEG\"\n \t\textfinal = \".jpg\"\n \telsif ext.upcase == \".GIF\"\n \t\textfinal = \".gif\"\n \telsif ext.upcase == \".PNG\"\n \t\textfinal = \".png\"\n \tend\t\n\t\t\n\t\t\n \t#nombre original de la imagen\n \tfilename_orig = File.basename(file, '.*')\n\n \t#remove white space in image name\n \tfilename_orig = filename_orig.gsub(\" \",\"-\")\n\n \twidth = 800\n\n \timage = Magick::Image.read(file).first\n\n \twidthimage = image.columns\n \theightimage = image.rows\n \theight = (width * heightimage) / widthimage\n \tthumbnail = image.thumbnail(width, height)\n\n\n \tfinalname = path + \"800-\" + filename_orig + extfinal\n \tq=99\n \tthumbnail.write(finalname){ self.quality = q }\n return filename_orig + extfinal\n \nend",
"title": ""
},
{
"docid": "77aea6e470636602c2b5c21abe4374f3",
"score": "0.56811047",
"text": "def thumbnail_image_exists?\n image.present? and image.thumbnail.file.exists?\n end",
"title": ""
},
{
"docid": "16904acaa0dd029d312fb9438c753f41",
"score": "0.5678791",
"text": "def thumbnail(sid, opts={})\r\n\r\n maxwidth\t= (opts[:maxwidth] || 128).to_f\r\n maxheight\t= (opts[:maxheight] || 128).to_f\r\n aspectratio\t= maxwidth / maxheight\r\n path\t\t= nil\r\n dest_path\t= nil\r\n pic\t\t= nil\r\n case sid.to_sym\r\n when :photo\r\n path\t\t= self.photo__path\r\n dest_path\t= self.photo__thumb_path\r\n end\r\n pic\t = path ? Magick::Image.read(path).first : Magick::Image.from_blob(pic).first\r\n imgwidth = pic.columns\r\n imgheight = pic.rows\r\n imgratio = imgwidth.to_f / imgheight.to_f\r\n scaleratio= imgratio > aspectratio ? maxwidth / imgwidth : maxheight / imgheight\r\n thumb\t = pic.thumbnail(scaleratio)\r\n thumb.write(dest_path) if dest_path\r\n return thumb.to_blob\r\n end",
"title": ""
},
{
"docid": "336e5877ce74aab3cd08e11f200eb924",
"score": "0.56563395",
"text": "def thumb\n File.join folder, 'thumbs', file_path\n end",
"title": ""
},
{
"docid": "336e5877ce74aab3cd08e11f200eb924",
"score": "0.56563395",
"text": "def thumb\n File.join folder, 'thumbs', file_path\n end",
"title": ""
},
{
"docid": "0090f2dbcf03ee061ab864d73848b368",
"score": "0.5637962",
"text": "def process\n large_file = Pathname.new(Rails.root.join('public', 'assets', 'jobs', id.to_s, 'screenshot.png'))\n if screenshot.present?\n img = ::Magick::Image.read(Pathname.new(Rails.root.join('public' + screenshot))).first\n img.resize!(1024.to_f / img.columns) if img.columns > 1024\n img.write(large_file)\n else\n response = create_screenshot(large_file)\n img = ::Magick::Image.read(large_file).first\n self.title = response['title']\n end\n\n # Create thumbnail\n thumb_file = Pathname.new(Rails.root.join('public', 'assets', 'jobs', id.to_s, 'thumbnail.png'))\n img.resize_to_fill(160 * 2, 120 * 2, Magick::NorthGravity).write(thumb_file)\n\n self.processed = true\n self.width = img.columns\n self.height = img.rows\n self.thumbnail = upload_to_cdn(thumb_file, \"thumbnail_#{id}_#{SecureRandom.hex}.png\")\n self.screenshot = upload_to_cdn(large_file, \"screenshot_#{id}_#{SecureRandom.hex}.png\")\n\n FileUtils.rm_rf(thumb_file.parent)\n\n project.reload\n if project.pages.size == 1\n project.title = title\n project.thumbnail = thumbnail\n project.save\n end\n\n save\n rescue => e\n logger.error e.message\n logger.error e.backtrace.join(\"\\n\")\n self.processed = true\n save\n end",
"title": ""
},
{
"docid": "b446183a554d8c49f6eb21f548e6c3bf",
"score": "0.56337893",
"text": "def set_original\n if keep_original\n if size_o.blank?\n image = MiniMagick::Image.open(name)\n self.size_o = \"#{image.width}x#{image.height}\"\n end\n else\n self.size_o = ''\n end\nend",
"title": ""
},
{
"docid": "9207baa224da3150b26fee35ee603214",
"score": "0.56293243",
"text": "def thumbnail_path\n \"t_#{image_path}\"\n end",
"title": ""
},
{
"docid": "c3d9fd2517121d613bd4dbfa7924911b",
"score": "0.562595",
"text": "def make\n Paperclip.log(\"*********** Label Thumbnail Processor...\")\n dst = Tempfile.new([@basename, @format].compact.join(\".\"))\n dst.binmode\n\n # first create the name text image\n nameImg = createText(name, \"72\", \"\")\n\n # next create the description text image\n descImg = createText(description, \"36\", \"800x\")\n\n # next create the blend text image\n blendImg = createText(blend, \"72\", \"\")\n\n # now composite name text onto comp\n comp = compositeFiles(nameImg, @file, \"820x100!+40+40\")\n\n # now composite blend text onto comp\n comp2 = compositeFiles(blendImg, comp, \"810x50!+50+1050\")\n\n #now composite the description onto the dst\n dst = compositeFiles(descImg, comp2, \"820x300+50+865\")\n\n if generate_tin_image\n dst = compositeFiles(dst, tin_path, \"332x436!+234+139\")\n dst = compositeFiles(tin_fade_path, dst, \"800x800!+0+0\")\n end\n \n dst\n end",
"title": ""
},
{
"docid": "50b544e631ed8d805247938923466541",
"score": "0.56227434",
"text": "def test_thumbnail_creation\n\t\tdoc = nil\n\t\tassert_difference(Document, :count, 2) do\n\t\t\tfile_data = fixture_file_upload('/files/upload.jpg','image/jpeg')\n\t\t\tdoc = DocImage.new({:uploaded_data=>file_data, :site_select=>sites(:arusha).id})\n\t\t\tdoc.user = users(:login)\n\t\t\tassert doc.save\n\t\tend\n\t\t# check that pic was stored as expected\n\t\tpic = Document.find_by_filename('upload.jpg')\n\t\tassert_equal doc, pic\n\t\tassert pic.is_a?(DocImage)\n\t\tassert_equal 448, pic.width\n\t\tassert_equal 604, pic.height\n\t\tassert_equal 128303, pic.size\n\t\tassert_equal users(:login), pic.user\n\t\t# check that thumbnail was generated as expected\n\t\tthumb = pic.thumbnails.find_by_thumbnail('thumb')\n\t\tassert thumb.is_a?(DocImage)\n\t\tassert_equal 74, thumb.width\n\t\tassert_equal 100, thumb.height\n\t\t#assert_equal 'upload_t.jpg', thumb.filename\n\t\tassert_equal sites(:arusha), thumb.site\n\t\tassert_equal users(:login), thumb.user\n\t\tassert(thumb.size > 0)\n\t\tassert(thumb.content.size > 0)\n\t\t# remove the document and it's thumb\n\t\tassert_difference(Document, :count, -2) do\n\t\t\tassert pic.destroy.frozen?\n\t\tend\n\t\t\n\t\t# test with image smaller than scaling\n\t\tdoc = nil\n\t\tassert_difference(Document, :count, 2) do\n\t\t\tfile_data = fixture_file_upload('/files/upload64.jpg','image/jpeg')\n\t\t\tdoc = DocImage.new({:uploaded_data=>file_data, :site_select=>sites(:arusha).id})\n\t\t\tdoc.user = users(:login)\n\t\t\tassert doc.save\n\t\tend\n\t\t# check that pic was stored as expected\n\t\tpic = Document.find_by_filename('upload64.jpg')\n\t\tassert_equal doc, pic\n\t\tassert pic.is_a?(DocImage)\n\t\tassert_equal 64, pic.width\n\t\tassert_equal 64, pic.height\n\t\tassert_equal 7261, pic.size\n\t\tassert_equal users(:login), pic.user\n\t\t# check that thumbnail was generated as expected\n\t\tthumb = pic.thumbnails.find_by_thumbnail('thumb')\n\t\tassert thumb.is_a?(DocImage)\n\t\tassert_equal 64, thumb.width\n\t\tassert_equal 64, thumb.height\n\t\t#assert_equal 'upload64_t.jpg', thumb.filename\n\t\tassert_equal sites(:arusha), thumb.site\n\t\tassert_equal users(:login), thumb.user\n\t\tassert(thumb.size > 0)\n\t\tassert(thumb.content.size > 0)\n\t\t# remove the document and it's thumb\n\t\tassert_difference(Document, :count, -2) do\n\t\t\tassert pic.destroy.frozen?\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1697f31437c8b6b481fa4c2e05d35b87",
"score": "0.5613521",
"text": "def create_preview_and_thumbnails\n typescript = self.typescript\n return false if typescript.nil? || typescript.content_type != 'application/pdf'\n preview = self.preview_image\n return false if !preview.nil?\n self.create_or_update_preview\n self.create_thumbnails\n return true\n end",
"title": ""
},
{
"docid": "4de48659ee16c9ed1cbd89709775fc02",
"score": "0.56095666",
"text": "def thumbnail(pathtype)\n filename = file.delete \".\"\n path = File.dirname(send(pathtype))\n File.join path, \"#{filename}_thumb.png\"\n end",
"title": ""
},
{
"docid": "8271410e54f0894514b40da63bc9bc39",
"score": "0.56083316",
"text": "def test_should_handle_files\n lightsabers_image = fixture_file_upload(\"/files/lightsabers.jpg\", 'image/jpeg')\n\n an_image = Image.new\n an_image.uploaded_data = lightsabers_image\n assert an_image.save\n \n # Assert that the files exists.\n assert File.exist?(an_image.full_filename)\n for thumb in an_image.thumbnails\n assert File.exist?(thumb.full_filename)\n end\n \n # We must erase the record and its files by hand, just calling destroy.\n assert an_image.destroy\n # See if the files really was erased.\n for thumb in an_image.thumbnails\n assert !File.exist?(thumb.full_filename)\n end\n assert !File.exist?(an_image.full_filename)\n end",
"title": ""
},
{
"docid": "5b15ff481ae9bd98e919af82d0befc84",
"score": "0.5608101",
"text": "def process_image(tmp)\n random = 2 + rand(10**24-10)+10\n path =\"public/data/\"\n file = File.join(path, random.to_s + \"-\" + params[:image][:filename].original_filename)\n\t\n\t#check extencion\n\t\text = File.extname(file)\n \tif ext.upcase == \".JPG\"\n \t\textfinal = \".jpg\"\n \t\timagevalid = true\n \telsif ext.upcase == \".JPEG\"\n \t\textfinal = \".jpg\"\n \t\timagevalid = true\n \telsif ext.upcase == \".GIF\"\n \t\textfinal = \".gif\"\n \t\timagevalid = true\n \telsif ext.upcase == \".PNG\"\n \t\textfinal = \".png\"\n \t\timagevalid = true\n \tend\t\n \t\n if imagevalid == true \n\t\n #Subo la imagen original recibida\n FileUtils.cp tmp.path, file\n\t\n\tarchivo_final = uploadoriginal(file,path)\n\t\n\t#utilizo su nombre\n\tfilenamethumb = random.to_s + \"-\" + params[:image][:filename].original_filename\n\t#width desired / ancho deseado\n\tw = 150\n\t#function call / llamada a la funcion\n\thubermann_thumbnail(path, filenamethumb,w,square=true, bw=true, q=99)\n\thubermann_thumbnail(path, filenamethumb,w,square=true, bw=false, q=99)\n\t\n\t\n\tFileUtils.rm file\n\t\n\t\n\t@image.filename = archivo_final\n\t#end unless valid image\n\telse\n\t@image.filename = nil\n\n\tend\nend",
"title": ""
},
{
"docid": "4612c58f65c670aa4e6058d192662195",
"score": "0.5607445",
"text": "def perform\n unless thumbdata && (thumbdata =~ /^data:/)\n logger.info \">>>>>>>>>>>>>>>>>>>>>>>>>>>>> Acquiring Thumbnail data on url '#{url}' >>>>>>>>>>>>>>>>>>>>>>>>>\"\n self.status = self.thumbdata = nil\n # self.picAR = nil\n begin\n uri = URI.parse(url)\n if uri.host && \n uri.port &&\n (http = Net::HTTP.new(uri.host, uri.port)) &&\n (request = Net::HTTP::Get.new(uri.request_uri))\n response = http.request(request) \n self.status = response.code\n else # Invalid URL\n self.status = 400\n end\n rescue Exception => e\n # If the server doesn't want to talk, we assume that the URL is okay, at least\n case e\n when Errno::ECONNRESET\n self.status = 401\n else\n self.status = -1\n end\n end\n \n if status == 200 # Success! Write the thumbdata if poss.\n begin\n img = Magick::Image::from_blob(response.body).first\n if img.columns > thumbsize\n scalefactor = thumbsize.to_f/img.columns\n thumb = img.scale(scalefactor)\n else\n thumb = img\n end\n thumb.format = \"JPEG\"\n quality = 20\n thumb.write(\"thumb#{id.to_s}-M#{quality.to_s}.jpg\") { self.quality = quality } unless true # Rails.env.production?\n self.thumbdata = \"data:image/jpeg;base64,\" + Base64.encode64(thumb.to_blob{self.quality = quality })\n save\n end\n end\n end\n self\n end",
"title": ""
},
{
"docid": "3a249d066c82374d8c9dccd43afe329d",
"score": "0.56060714",
"text": "def generate_thumbnails(id, name)\n ensure_directory_exists!(id)\n options[:thumbnails].keys.each { |thumb_name| generate_thumbnail(id, name, thumb_name) }\n end",
"title": ""
},
{
"docid": "1621da32e3e198e45278fcec897afb3f",
"score": "0.5601396",
"text": "def prepare_upload\n require 'tmpdir'\n thumbs = nil\n\n Dir::mktmpdir { |path|\n thumb_dir = path+'/thumbnails'\n if !Dir.mkdir(thumb_dir, 0700)\n raise CarrierWave.ProcessingError.new(\"could not create temp file at #{path}\")\n end\n zip_files_count = 0\n zip_file_index = 0\n # 1. checks that there is only one pdf file\n Zip::Archive.open(current_path) { |ar|\n n = ar.num_files\n\n n.times do |i|\n\n entry_name = ar.get_name(i)\n if entry_name =~ /.\\.pdf$/i\n zip_files_count += 1\n zip_file_index = i\n end\n end\n\n\n if zip_files_count > 1\n raise CarrierWave::ProcessingError.new('there\\'s more than one pdf file in your zip')\n else\n if zip_files_count <1\n raise CarrierWave::ProcessingError.new('unable to find pdf file in your zip')\n end\n end\n\n\n # 2. extracts and renames pdf file to tmp dir according to naming convention (product_id)\n extracted_pdf_path = \"#{path}/#{model.product_id}.pdf\"\n\n File.open(extracted_pdf_path, 'wb') { |pdf|\n\n ar.fopen(zip_file_index) do |f|\n pdf << f.read\n\n\n end\n\n }\n\n\n # 3. creates thumbnails of the pdf file\n thumbs = PdfProcessor.thumbs(extracted_pdf_path, {:width => 175, :height => 131}, 'PNG')\n\n thumbs[:thumbs].each_with_index do |t, index|\n t.write(\"#{thumb_dir}/#{index.to_s}.png\")\n\n end\n thumbs[:thumbs2x].each_with_index do |t, index|\n t.write(\"#{thumb_dir}/#{index.to_s}@2x.png\")\n\n end\n\n # 4. adds thumbnails to zip file\n\n ar.add_dir('thumbnails')\n\n Dir.glob(thumb_dir+'/*.png').each do |f|\n if File.directory?(f)\n raise CarrierWave::ProcessingError.new('An error occurred during thumbnail zipping process')\n else\n\n file_name = File.basename(f)\n ar.add_file(\"thumbnails/#{file_name}\", f)\n\n end\n\n\n end\n\n # 5. updates pdf filename in zip\n if ar.get_name(zip_file_index).eql?(\"#{model.product_id}.pdf\") == false\n File.open(extracted_pdf_path) do |f|\n ar.replace_io(zip_file_index, f)\n end\n end\n\n }\n # 6. uploads the thumbnails dir to public S3 dir\n #credentials = {:threads => 2}.merge(CarrierWave::Uploader::Base.fog_credentials)\n #\n #\n #credentials[:public]= true\n #base_directory = CarrierWave::Uploader::Base.fog_directory\n #directory = \"/public/#{model.publication.product_code}/#{model.product_id}/thumbnails\"\n #credentials[:destination_dir] = directory\n #S3Uploader.upload_directory(thumb_dir, base_directory, credentials)\n\n }\n\n #model.pdf_length = thumbs[:thumbs].count\n #model.save!\n end",
"title": ""
},
{
"docid": "5cb105bcd7660dc86738f9aa76559e6e",
"score": "0.5585588",
"text": "def is_thumbnable?(new_file)\n return model.is_thumbnable unless model.is_thumbnable.nil?\n model.is_thumbnable = \\\n begin\n new_file.content_type.start_with? 'image' or new_file.content_type == 'application/pdf'\n end\n return model.is_thumbnable\n end",
"title": ""
},
{
"docid": "0ec4fe08b9797a75fbbbbbf2d93f9844",
"score": "0.55765855",
"text": "def create_homepage_thumbnail\n image = Image.from_blob(self.photo_image).first\n thumbnail = image.resize_to_fill(320,240, gravity=CenterGravity)\n thumbnail.to_blob\n end",
"title": ""
}
] |
7a9578b1ab838515c9b6d05a725ceb15
|
Create a resource object, associate it with a client, and set its properties.
|
[
{
"docid": "f772e71f03e1785d64eab791f78220cd",
"score": "0.0",
"text": "def initialize(client, params = {}, api_ver = nil)\n super\n # Default values:\n @data['enclosureType'] ||= 'C7000'\n @data['state'] ||= 'Active'\n @data['uplinkSets'] ||= []\n @data['type'] ||= 'logical-interconnect-groupV3'\n @data['interconnectMapTemplate'] ||= {}\n @data['interconnectMapTemplate']['interconnectMapEntryTemplates'] ||= []\n\n # User friendly values:\n @bay_count = 8\n\n # Create all entries if empty\n parse_interconnect_map_template if @data['interconnectMapTemplate']['interconnectMapEntryTemplates'] == []\n end",
"title": ""
}
] |
[
{
"docid": "0f1a423666b4eb00dd66665cc0f10e38",
"score": "0.7475301",
"text": "def create\n @_resource = Client.new(client_params)\n resource.save\n respond_with resource\n end",
"title": ""
},
{
"docid": "15fbdfdaa0a422e85e89ce76ff5a5fa9",
"score": "0.7200885",
"text": "def create(params={})\n raise \"Can't create a resource without a REST Client\" unless @client\n end",
"title": ""
},
{
"docid": "1e2156a73a02b72649933fb6e034fb7d",
"score": "0.6886916",
"text": "def create(body = {})\n @client.resource.create(body)\n end",
"title": ""
},
{
"docid": "f17d463364895d970f29b90e647a64ae",
"score": "0.68102646",
"text": "def create(params={})\n raise \"Can't create a resource without a REST Client\" unless @client\n response = @client.post @path, params\n @instance_class.new \"#{@path}/#{response[@instance_id_key]}\", @client,\n response\n end",
"title": ""
},
{
"docid": "b57b6cd89c19df0536064273b85d70c0",
"score": "0.67900604",
"text": "def create(params = {})\n raise \"Can't create a resource without a REST Client\" unless @client\n response = @client.post @uri, params\n @instance_class.new \"#{@uri}/#{response['sid']}\", @client, response\n end",
"title": ""
},
{
"docid": "69e441a150856dd7101e50ba29150e09",
"score": "0.6787854",
"text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @client.resources << @resource\n flash[:notice] = 'Resource was successfully created.'\n format.html { redirect_to client_resource_url(@client, @resource) }\n format.xml { render :xml => @resource, :status => :created, :location => [@client, @resource] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79b03825742864ba57ab8fa7e638969f",
"score": "0.6759964",
"text": "def resource\n @resource_resource ||= Resource.new(@client)\n end",
"title": ""
},
{
"docid": "f1bbd987847a2f5f51a680441a51e39b",
"score": "0.6699988",
"text": "def create_resource(object)\n\n run_create_callbacks object do\n\n save_resource(object)\n\n end\n\n end",
"title": ""
},
{
"docid": "da4088d4f27d296b36f9d844c38d901f",
"score": "0.6659819",
"text": "def create_resource(object)\n run_create_callbacks object do\n save_resource(object)\n end\n end",
"title": ""
},
{
"docid": "e01655de21a92bfe839f854d5a213bd4",
"score": "0.66347796",
"text": "def create\n begin\n # The JSON library will generate a JSON document from a hash that we give it.\n # Instead of trying to template a JSON document, we can just programmatically\n # populate a hash and convert it safely in one shot.\n json_document_hash = {}\n json_document_hash['name'] = @resource['name']\n json_document_hash['attributes'] = @resource['attributes'] if @resource['attributes']\n\n # POST the JSON document to create the resource.\n response = self.class.rest_post('/', JSON.generate(json_document_hash))\n rescue Exception\n raise Puppet::Error, \"Failed to create entity #{@resource[:name]}: #{$!}\"\n end\n end",
"title": ""
},
{
"docid": "1facf54eee5829d662a806c9cd05172b",
"score": "0.6630748",
"text": "def create_resource\n build_resource\n resource.save\n end",
"title": ""
},
{
"docid": "8b7a6d0841a37b7381f5ccdcd16ac0c3",
"score": "0.6628986",
"text": "def set_resource_variable(resource)\n instance_variable_set(instance_variable_name(resource), resource_class(resource).new(client: self))\n end",
"title": ""
},
{
"docid": "b58545bc87eaa85d85c7da72281e99e8",
"score": "0.6626058",
"text": "def create_resource_manager\n @logger.info('Creating resource manager')\n #todo - give this a real client id instead of a fake one\n @resource_manager = @resource_manager.new(@base_store_key, @resource_store, '123456')\n end",
"title": ""
},
{
"docid": "404c17301c0e61a496f364ecd7eb0334",
"score": "0.66150016",
"text": "def create_resource(object)\n object.save\n end",
"title": ""
},
{
"docid": "004171d34793c7a1b939a4c047c589cf",
"score": "0.6610296",
"text": "def new\n ResourceInstance.new(@client, @api, self, action: @actions[:create], persistent: false)\n end",
"title": ""
},
{
"docid": "ba2660223d1d87dccc8c8418eacfdc67",
"score": "0.6514585",
"text": "def create\n @property_hash = {\n name: @resource[:name],\n ensure: :present,\n primitive: @resource[:primitive],\n group: @resource[:group],\n clone_max: @resource[:clone_max],\n clone_node_max: @resource[:clone_node_max],\n notify_clones: @resource[:notify_clones],\n globally_unique: @resource[:globally_unique],\n ordered: @resource[:ordered],\n interleave: @resource[:interleave]\n }\n end",
"title": ""
},
{
"docid": "7d9f0f3b9e3d17bfc6380ffa94857dc5",
"score": "0.6486104",
"text": "def create_client\n @networking.create_client\n end",
"title": ""
},
{
"docid": "dc487edc526247921a80e3aa87346b7e",
"score": "0.6472004",
"text": "def create\n @property_hash = {\n name: @resource[:name],\n ensure: :present,\n primitives: Array(@resource[:primitives]),\n new: true\n }\n @property_hash[:cib] = @resource[:cib] unless @resource[:cib].nil?\n end",
"title": ""
},
{
"docid": "5acc42678035c3a2c2c22872461d13a0",
"score": "0.6469421",
"text": "def create_resource(uri, options)\n JSON.parse(options[:json]) rescue (return status_422)\n resource = CloudKit::Resource.create(uri, options[:json], options[:remote_user])\n json_meta_response(201, resource.uri.string, resource.etag, resource.last_modified)\n end",
"title": ""
},
{
"docid": "19b2690f5951af1de3ef75bb281892b9",
"score": "0.64461935",
"text": "def create(attributes, opts = {})\n client = opts.fetch(:client)\n\n path = \"/#{resource_name}\"\n\n body = {\n data: {\n attributes: attributes,\n type: resource_name\n }\n }\n\n response = client.post(path, body: body)\n resource_data = JSON.parse(response.body)[\"data\"]\n\n return self.new(client: client, params: resource_data)\n end",
"title": ""
},
{
"docid": "3e73f3c214803f7ea5ac665234725664",
"score": "0.6417335",
"text": "def create\n @property_hash = {\n name: @resource[:name],\n ensure: :present,\n primitives: @resource[:primitives],\n score: @resource[:score],\n cib: @resource[:cib]\n }\n end",
"title": ""
},
{
"docid": "9efc7626cabedaad95a3d1f64a81b037",
"score": "0.6407277",
"text": "def create_resource_object(type, address, owner)\n #puts \"type #{type} add #{address}\"\n id = @res_obj.create_new(type, address, owner)\n return id\n rescue => e\n raise e\n end",
"title": ""
},
{
"docid": "ba1e934230ac0c9a84003373cb511453",
"score": "0.63689107",
"text": "def client_create(client)\n hash = call_api_json_service(\"/api/client/create\", to_hash(client))\n\n Authlete::Model::Client.new(hash)\n end",
"title": ""
},
{
"docid": "c7df22f4152e8d82f056a4814b986a5c",
"score": "0.6345067",
"text": "def create(client)\n super(client)\n end",
"title": ""
},
{
"docid": "9565a8b76a16ad599444e0ca1720bc0b",
"score": "0.6341961",
"text": "def setup_resource\n @resource = resource_class.new(\n request.unescaped_path_info, request, response, @options\n )\n end",
"title": ""
},
{
"docid": "1fd2b5b0fb2ccf28a22f56a7636381ab",
"score": "0.6333629",
"text": "def create_client\n @security.create_client\n end",
"title": ""
},
{
"docid": "40758e5408122a6c0858a35f944697b7",
"score": "0.6327229",
"text": "def resource\n @resource ||= RestClient::Resource.new(self.url, {\n :user => self.access_key,\n :password => self.secret_key\n })\n end",
"title": ""
},
{
"docid": "8b16710bc2e4597e41e41b43fa2d857b",
"score": "0.6320911",
"text": "def client_create(client)\n if client.kind_of?(Hash) == false\n if client.respond_to?('to_hash')\n client = client.to_hash\n end\n end\n\n hash = call_api_json_service(\"/api/client/create\", client)\n\n Authlete::Model::Client.new(hash)\n end",
"title": ""
},
{
"docid": "89901f6f684c397eaebe7f0071359da4",
"score": "0.63174987",
"text": "def create_resource_on_octopus\n Octopus.create_resource(self)\n end",
"title": ""
},
{
"docid": "b9eec964fa42a0c64b38ad86614dbb29",
"score": "0.6316366",
"text": "def create_resource_for(resource_name); end",
"title": ""
},
{
"docid": "934726d48e94f2971446bddf888c5f5f",
"score": "0.63080895",
"text": "def initialize(client, resource_type, href, hash={})\n if INCONSISTENT_RESOURCE_TYPES.has_key?(resource_type)\n resource_type = INCONSISTENT_RESOURCE_TYPES[resource_type]\n end\n # For the inspect function:\n @client = client\n @resource_type = resource_type\n @hash = hash\n @href = href\n\n # Add destroy method to relevant resources\n define_instance_method('destroy') do |*args|\n client.do_delete(href, *args)\n end\n\n # Add update method to relevant resources\n define_instance_method('update') do |*args|\n client.do_put(href, *args)\n end\n\n # Add show method to relevant resources\n define_instance_method('show') do |*args|\n RightApi::ResourceDetail.new(client, *client.do_get(href, *args))\n end\n end",
"title": ""
},
{
"docid": "3fe0d5d5582709bdfcf09991bc547937",
"score": "0.62964404",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n self.resource.is_owner = true\n self.resource.is_admin = true\n end",
"title": ""
},
{
"docid": "9eaa35c64aed6b34324c0a93b5884568",
"score": "0.62818104",
"text": "def create_resource(uri, options)\n data = JSON.parse(options[:json]) rescue (return status_422)\n etag = UUID.generate\n last_modified = timestamp\n @db[CLOUDKIT_STORE].insert(\n :uri => uri,\n :collection_reference => collection_uri_fragment(uri),\n :resource_reference => uri,\n :etag => etag,\n :last_modified => last_modified,\n :remote_user => options[:remote_user],\n :content => options[:json])\n map(uri, data)\n json_meta_response(201, uri, etag, last_modified)\n end",
"title": ""
},
{
"docid": "39a23f23d5e4ba0bbe3bae0f27216546",
"score": "0.62726927",
"text": "def create\n mkfs\n @property_hash[:ensure] = :present\n @property_hash[:uuid] = uuid\n resource\n end",
"title": ""
},
{
"docid": "51b1860dafc8ebaed5061ba141122d80",
"score": "0.6272497",
"text": "def create(attributes = {})\n new_with_client(attributes).save\n end",
"title": ""
},
{
"docid": "03374bb8e9ce553be702e2864966ef34",
"score": "0.6268528",
"text": "def new_resource(definition, loaded = false, client = @_client)\n self.class.new(client, definition, loaded)\n end",
"title": ""
},
{
"docid": "41edbe1efe00525957ad1e4dd2aebe81",
"score": "0.6254288",
"text": "def set_resource(resource = nil)\n resource ||= params[:id] ? resource_class.find(params[:id]) : resource_class.new(apique_create_params)\n unless resource\n raise Apique::RecordNotFound, \"could not find a record of type #{resource_class} with id = #{params[:id]}\"\n end\n \n instance_variable_set(resource_variable_name, resource)\n end",
"title": ""
},
{
"docid": "dc687f0cb88c6c0e83b4e3ba35d9ec90",
"score": "0.62526184",
"text": "def load_with_properties\n item = load_resource\n set_resource(item, OneviewSDK::ServerHardwareType, server_hardware_type, :set_server_hardware_type)\n set_resource(item, OneviewSDK::EnclosureGroup, enclosure_group, :set_enclosure_group)\n set_resource(item, OneviewSDK::FirmwareDriver, firmware_driver, :set_firmware_driver)\n set_connections(item, OneviewSDK::EthernetNetwork, ethernet_network_connections)\n set_connections(item, OneviewSDK::FCNetwork, fc_network_connections)\n set_connections(item, OneviewSDK::NetworkSet, network_set_connections)\n end",
"title": ""
},
{
"docid": "ba1c6b92c92090644eea19cf8e447b50",
"score": "0.6250122",
"text": "def initialize(client, resource_type, href, hash={})\n if INCONSISTENT_RESOURCE_TYPES.has_key?(resource_type)\n resource_type = INCONSISTENT_RESOURCE_TYPES[resource_type]\n end\n # For the inspect function:\n @client = client\n @resource_type = resource_type\n @hash = hash\n @href = href\n\n # Add destroy method to relevant resources\n define_instance_method('destroy') do |*args|\n client.send(:do_delete, href, *args)\n end\n\n # Add update method to relevant resources\n define_instance_method('update') do |*args|\n client.send(:do_put, href, *args)\n end\n\n # Add show method to relevant resources\n define_instance_method('show') do |*args|\n RightApi::ResourceDetail.new(client, *client.send(:do_get, href, *args))\n end\n end",
"title": ""
},
{
"docid": "042dc7470f5dc039eda31500607a4d43",
"score": "0.62495476",
"text": "def create\n @property_hash = {\n :name => @resource[:name],\n :ensure => :present,\n :first => @resource[:first],\n :second => @resource[:second],\n :score => @resource[:score],\n :symmetrical => @resource[:symmetrical],\n :cib => @resource[:cib],\n :new => true,\n }\n end",
"title": ""
},
{
"docid": "2d9f95b3b33d60b3c51cdbf7759fe85c",
"score": "0.62446666",
"text": "def create\n @property_hash = {\n name: @resource[:name],\n ensure: :present,\n primitive_class: @resource[:primitive_class],\n provided_by: @resource[:provided_by],\n primitive_type: @resource[:primitive_type],\n existing_resource: :false\n }\n @property_hash[:parameters] = @resource[:parameters] unless @resource[:parameters].nil?\n @property_hash[:operations] = @resource[:operations] unless @resource[:operations].nil?\n @property_hash[:utilization] = @resource[:utilization] unless @resource[:utilization].nil?\n @property_hash[:metadata] = @resource[:metadata] unless @resource[:metadata].nil?\n @property_hash[:existing_metadata] = {}\n end",
"title": ""
},
{
"docid": "8b1df57fba41c29443fcb0590453fb00",
"score": "0.62310535",
"text": "def create(attributes = {})\n model = new(attributes)\n model.create(@_resource)\n model\n end",
"title": ""
},
{
"docid": "524d8c729e5884e5ad2a691288421bdd",
"score": "0.62294066",
"text": "def create(resource, params, authorizer)\n save __callee__, resource, params, authorizer\n end",
"title": ""
},
{
"docid": "cae2bf57202037289ea3e0a7a7c02c35",
"score": "0.62287354",
"text": "def create_resource attributes={}\n resource_class.new(attributes.update(known_attributes)).tap do |resource|\n resource.prefix_options = query_params\n resource.save\n end\n end",
"title": ""
},
{
"docid": "1b5f0a22356f2ed28a3f910b1f735fbb",
"score": "0.6225275",
"text": "def new_resource(auto_migrate = true, &block)\n resource = Class.new do\n include DataMapper::Resource\n\n storage_names[:default] = 'foo'\n def self.name; 'DataMapperTest::Foo'; end\n\n property :id, DataMapper::Types::Serial\n property :state, String\n\n auto_migrate! if auto_migrate\n end\n resource.class_eval(&block) if block_given?\n resource\n end",
"title": ""
},
{
"docid": "bb4152024a54110ad9a6914e99e7509b",
"score": "0.6220905",
"text": "def create_client\n return unless @client_creation_needed\n\n client = Client.new(\n status: GlobalConstant::Client.active_status\n )\n client.save!\n\n @client_id = client.id\n end",
"title": ""
},
{
"docid": "41819ab3e2cee483033cdf188250c23b",
"score": "0.6220132",
"text": "def create(options)\n @_client.post(resource_root, options)\n end",
"title": ""
},
{
"docid": "8e2496809941349c17b6bfa6603cd68e",
"score": "0.6213898",
"text": "def save( client )\n uri = end_point\n $log.debug( \"end_point = #{uri}\")\n payload = instance_to_payload\n if payload.key?(:resource_id)\n $log.debug('PUT');\n response = client.put( sprintf(\"%s/%s\", uri, self.get_id ), { 'format' => 'json' }, payload )\n else\n $log.debug('POST');\n response = client.post( \"#{uri}\", { 'format' => 'json' }, payload )\n end\n response_to_instance( response )\n end",
"title": ""
},
{
"docid": "4b02586154719d62930340b9d3503f9f",
"score": "0.6176002",
"text": "def create_client\n\t\t\n\n\t\t##we want to create a new client, provided that there is no client for this user id.\n\t\t##if a client already exists, then we dont want to do anything.\n\t\t##when we create the client we want to be sure that \n\t\t##provided that there is no client with this user id.\n\t\t#puts \"called create client.\"\n\n\t\t##first find out if there is already a client for this user id.\n\t\tc = Auth::Client.new(:api_key => SecureRandom.hex(32), :resource_id => self.id)\n\n\t\tputs \"Came to create a client.\"\n\n\t\tc.versioned_create({:resource_id => self.id})\n\t\top_count = 10\n\n\t\tputs \"-------CREATED A CLIENT AS FOLLOWS:-----------\"\n\t\tputs c.attributes.to_s\n\n\t\twhile(true)\n\t\t\t\n\t\t\tif c.op_success?\n\t\t\t\t#puts \"the op was a success\"\n\t\t\t\tbreak\n\t\t\telsif op_count == 0\n\t\t\t\t#puts \"op count was 0\"\n\t\t\t\tbreak\n\t\t\telsif (Auth::Client.where(:resource_id => self.id).count == 0)\n\t\t\t\t#puts \"tried to create here.\"\n\t\t\t\tc.api_key = SecureRandom.hex(32)\n\t\t\t\tc.versioned_create({:resource_id => self.id})\n\t\t\t\top_count-=1\n\t\t\telse\n\t\t\t\t#puts \"finally broke.\"\n\t\t\t\tbreak\n\t\t\tend\n\n\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "10686a6632d6ce715b394196e15588a0",
"score": "0.61645186",
"text": "def create(attributes = {})\n resource = allocate\n resource.send(:initialize_with_attributes, attributes)\n resource.save\n resource\n end",
"title": ""
},
{
"docid": "10686a6632d6ce715b394196e15588a0",
"score": "0.61645186",
"text": "def create(attributes = {})\n resource = allocate\n resource.send(:initialize_with_attributes, attributes)\n resource.save\n resource\n end",
"title": ""
},
{
"docid": "fd64a261d6034f47cfa01547693a4fa9",
"score": "0.61583245",
"text": "def create_resource(resource_chain, attributes, options = {})\n context = options.slice!(:context) if options.key?(:context)\n respond_to_resource(resource_chain, :save, context, options) do |model|\n\tmodel.assign_attributes(attributes)\n end\n end",
"title": ""
},
{
"docid": "28d17b37404f4ab021cd50fa7db3aa49",
"score": "0.61578786",
"text": "def initialize(client, resource_type, href, hash={})\n if INCONSISTENT_RESOURCE_TYPES.has_key?(resource_type)\n resource_type = INCONSISTENT_RESOURCE_TYPES[resource_type]\n end\n # For the inspect function:\n @resource_type = resource_type\n @hash = hash\n\n # Add destroy method to relevant resources\n if RESOURCE_ACTIONS[:destroy].include?(resource_type)\n define_instance_method('destroy') do\n client.do_delete(href)\n end\n end\n\n # Add update method to relevant resources\n if RESOURCE_ACTIONS[:update].include?(resource_type)\n define_instance_method('update') do |*args|\n client.do_put(href, *args)\n end\n end\n\n # Add show method to relevant resources\n if !RESOURCE_ACTIONS[:no_show].include?(resource_type)\n define_instance_method('show') do |*args|\n RightApi::ResourceDetail.new(client, *client.do_get(href, *args))\n end\n end\n end",
"title": ""
},
{
"docid": "abf9c8a47f4bdcd8df9a23ee8f046c0d",
"score": "0.61552036",
"text": "def create\n if provider?\n instance.add_resource_consumer(params[:service], params[:realm])\n render(:json => {:resource => JSON.generate(instance.resourceable_hash)})\n else\n if instance\n instance.update_resource_attributes(params[:resource])\n else\n attributes = {:resource_uuid => params[:uuid], :resource_attributes => JSON.parse(params[:resource])}\n attributes[:realm_uuid] = params[:realm] if klass_with_realm?\n klass.create!(attributes)\n end\n render(:nothing => true, :status => :no_content)\n end\n end",
"title": ""
},
{
"docid": "f781f9fb597c42f8de414d9962907799",
"score": "0.6153553",
"text": "def create\n @property_hash = {\n name: @resource[:name],\n ensure: :present,\n primitive_class: @resource[:primitive_class],\n provided_by: @resource[:provided_by],\n primitive_type: @resource[:primitive_type],\n }\n @property_hash[:parameters] = @resource[:parameters] unless @resource[:parameters].nil?\n @property_hash[:operations] = @resource[:operations] unless @resource[:operations].nil?\n @property_hash[:utilization] = @resource[:utilization] unless @resource[:utilization].nil?\n @property_hash[:metadata] = @resource[:metadata] unless @resource[:metadata].nil?\n @property_hash[:cib] = @resource[:cib] unless @resource[:cib].nil?\n end",
"title": ""
},
{
"docid": "248b19edd500f5ce58c4f9ca161d3ce3",
"score": "0.6147165",
"text": "def create_resource(object)\n parent.managed_repository {\n object.save\n }\n end",
"title": ""
},
{
"docid": "3ac42e754a65ee344e8edfaedf87dd47",
"score": "0.61430204",
"text": "def create\n @resource ||= resource_class.new()\n @resource.assign_attributes(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: \"#{resource_class.to_s} was successfully created.\" }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08807b11bfd9d747930305a3a45548a6",
"score": "0.61305964",
"text": "def create\n @property_hash = {\n name: @resource[:name],\n ensure: :present,\n primitive_class: @resource[:primitive_class],\n provided_by: @resource[:provided_by],\n primitive_type: @resource[:primitive_type],\n promotable: @resource[:promotable],\n existing_resource: :false\n }\n @property_hash[:parameters] = @resource[:parameters] unless @resource[:parameters].nil?\n @property_hash[:operations] = @resource[:operations] unless @resource[:operations].nil?\n @property_hash[:utilization] = @resource[:utilization] unless @resource[:utilization].nil?\n @property_hash[:metadata] = @resource[:metadata] unless @resource[:metadata].nil?\n @property_hash[:ms_metadata] = @resource[:ms_metadata] unless @resource[:ms_metadata].nil?\n @property_hash[:existing_metadata] = {}\n end",
"title": ""
},
{
"docid": "9a4bde9024b3fb30b12767bc2899bf16",
"score": "0.6127718",
"text": "def create\n set_attributes(JSON.parse(Rackspace::Connection.post(self.class.resource_url, {self.class.resource.singularize => JSON.parse(self.to_json)}))[self.class.resource.singularize])\n true\n end",
"title": ""
},
{
"docid": "f1e69ff12c76a8af194569bfa4a77846",
"score": "0.61203986",
"text": "def create\n @property_hash = {\n :name => @resource[:name],\n :ensure => :present,\n :primitive => @resource[:primitive],\n :node_name => @resource[:node_name],\n :score => @resource[:score],\n :cib => @resource[:cib],\n }\n end",
"title": ""
},
{
"docid": "c351aaa168a9cd6c8f342dc49922875a",
"score": "0.61155",
"text": "def create\n @property_hash = {\n :name => @resource[:name],\n :ensure => :present,\n :primitive => @resource[:primitive],\n :node_name => @resource[:node_name],\n :score => @resource[:score],\n :cib => @resource[:cib]\n }\n end",
"title": ""
},
{
"docid": "e6b0db2696c20fe63c05194150606a04",
"score": "0.61123765",
"text": "def create_for(client, resource_owner, scopes = nil)\n create(\n client_id: client.id,\n resource_owner_id: resource_owner.id,\n scopes: scopes\n )\n end",
"title": ""
},
{
"docid": "e6b0db2696c20fe63c05194150606a04",
"score": "0.61123765",
"text": "def create_for(client, resource_owner, scopes = nil)\n create(\n client_id: client.id,\n resource_owner_id: resource_owner.id,\n scopes: scopes\n )\n end",
"title": ""
},
{
"docid": "af57a5b05076f40c65f248d3b85f4014",
"score": "0.61066884",
"text": "def create\n @property_hash = {\n name: @resource[:name],\n ensure: :present,\n primitive: @resource[:primitive],\n node_name: @resource[:node_name],\n score: @resource[:score],\n rules: @resource[:rules],\n resource_discovery: @resource[:resource_discovery]\n }\n end",
"title": ""
},
{
"docid": "cb3ed9e9cfdbb030fdd9284786a19c48",
"score": "0.6105351",
"text": "def create_resource(res_uuid)\n @comm.publish(@urn, Message.create { |v| v.property('uuid', res_uuid) }, @uri.host)\n end",
"title": ""
},
{
"docid": "47aa634e6ce0a63f5ea25d03c97c6e2b",
"score": "0.6103454",
"text": "def create\n @property_hash = {\n :name => @resource[:name],\n :ensure => :present,\n :primitive_class => @resource[:primitive_class],\n :provided_by => @resource[:provided_by],\n :primitive_type => @resource[:primitive_type],\n :promotable => @resource[:promotable],\n :existing_resource => :false\n }\n @property_hash[:parameters] = @resource[:parameters] if ! @resource[:parameters].nil?\n @property_hash[:operations] = @resource[:operations] if ! @resource[:operations].nil?\n @property_hash[:utilization] = @resource[:utilization] if ! @resource[:utilization].nil?\n @property_hash[:metadata] = @resource[:metadata] if ! @resource[:metadata].nil?\n @property_hash[:ms_metadata] = @resource[:ms_metadata] if ! @resource[:ms_metadata].nil?\n @property_hash[:cib] = @resource[:cib] if ! @resource[:cib].nil?\n end",
"title": ""
},
{
"docid": "6088f46536c32900946a8f2fd6133c5a",
"score": "0.6102993",
"text": "def initialize(azure)\n @client = Azure::ARM::Resources::ResourceManagementClient.new(azure.connection)\n client.subscription_id = azure.subscription_id\n end",
"title": ""
},
{
"docid": "2c31decf782144f3ca8614cbed847768",
"score": "0.60884845",
"text": "def create(client, attributes = {}, &block)\n create!(client, attributes, &block)\n rescue FreshdeskAPI::Error::ClientError\n nil\n end",
"title": ""
},
{
"docid": "5c9a795365b1b6fdca4c5a4046623b7d",
"score": "0.60663784",
"text": "def create(path, options)\n spire_class = class_from_path(path)\n spire_class.save options do |data|\n data.client = self\n end\n end",
"title": ""
},
{
"docid": "f058448210ed8510432476b1b4b4d09b",
"score": "0.60631394",
"text": "def create\n @property_hash = {\n :name => @resource[:name],\n :ensure => :present,\n :primitive_type => @resource[:primitive_type],\n :existing_resource => :false\n }\n @property_hash[:device_options] = @resource[:device_options] if ! @resource[:device_options].nil?\n @property_hash[:operations] = @resource[:operations] if ! @resource[:operations].nil?\n end",
"title": ""
},
{
"docid": "9dea16d451784b09b6447eabc05e8c92",
"score": "0.6062642",
"text": "def create_resource(collection_identity, body)\n @client.resource.create_resource(collection_identity, body)\n end",
"title": ""
},
{
"docid": "fd310e09212ab496f6f53b4ee7ef8e7b",
"score": "0.60616016",
"text": "def create(client, path, params)\n response = post path, client, params\n\n object_from response, params\n end",
"title": ""
},
{
"docid": "cc1c1fb08528c3787f896d9705a512f9",
"score": "0.60599667",
"text": "def load_resource\n load_sdk\n c = build_client(client)\n if defined?(type) # For generic resource\n klass = get_resource_named(type)\n else # Determine type from resource\n klass_name = resource_name.to_s.split('_').map(&:capitalize).join\n klass_name.gsub!(/^Oneview/, '')\n klass = get_resource_named(klass_name)\n end\n new_data = JSON.parse(data.to_json) rescue data\n item = klass.new(c, new_data)\n item['name'] ||= name\n item\n end",
"title": ""
},
{
"docid": "9231badb89d854f50daa88266a21dc98",
"score": "0.6058805",
"text": "def another_resource\n @another_resource_resource ||= AnotherResource.new(@client)\n end",
"title": ""
},
{
"docid": "b273ca14755e388090bbd8899b3fc097",
"score": "0.60572714",
"text": "def create_resource_for(resource_name)\n resource = Class.new(ActiveResource::Base)\n resource.prefix = self.class.prefix\n resource.site = self.class.site\n self.class.const_set(resource_name, resource)\n\n resource\n end",
"title": ""
},
{
"docid": "705777ee84d9114ce767a4d197ba5288",
"score": "0.6047936",
"text": "def initialize(client, address)\n self.client = client\n self.address = address\n ObjectFactory.instance.register self\n end",
"title": ""
},
{
"docid": "ab1602f7b523165fc9c02a0297753df9",
"score": "0.6046506",
"text": "def add_resource\n ResourceBuilder.new(model: model, builder: builder).append\n end",
"title": ""
},
{
"docid": "ee06df2f09239beb4468e6502b0da8af",
"score": "0.60408384",
"text": "def create\n @property_hash = {\n :name => @resource[:primitive]+'-clone',\n :ensure => :present,\n :primitive => @resource[:primitive],\n :clone_max => @resource[:clone_max],\n :clone_node_max => @resource[:clone_node_max],\n :notify_clones => @resource[:notify_clones],\n :globally_unique => @resource[:globally_unique],\n :ordered => @resource[:ordered],\n :interleave => @resource[:interleave],\n :cib => @resource[:cib],\n :existing_resource => :false,\n }\n end",
"title": ""
},
{
"docid": "1511cacb0219c9eefeb6a5a1cb2854e5",
"score": "0.6017175",
"text": "def create(attributes = {})\n resource = new(attributes)\n resource.save\n resource\n end",
"title": ""
},
{
"docid": "fd32f871b8cb2a3f8925d9c6be4e855f",
"score": "0.6012135",
"text": "def create\n Puppet.debug(self.class.to_s.split('::').last + ': Calling create method :')\n\n response, status_code, headers = Puppet::Provider::Cudawaf.post('Server', @resource[:service_name], message(resource, 'POST'), {})\n @property_hash.clear\n [response, status_code, headers]\n end",
"title": ""
},
{
"docid": "b1f04107e35cf0be6a05197263203e06",
"score": "0.600728",
"text": "def add_resource_consumer\n response = register_resource_consumer\n self.resource_attributes = JSON.parse(response['resource'])\n set_resource_attributes(true)\n true # ensure true!\n end",
"title": ""
},
{
"docid": "75828962bb6a63b52a0c2858329c2acd",
"score": "0.60064626",
"text": "def create\n resource_set resource_klass.new(resource_params)\n\n respond_to do |wants|\n result = resource_get.save\n call_hook :after_save, result\n if result\n flash[:notice] = t 'messages.record_created', model: t(\"models.#{resource_name}\")\n wants.html { redirect_to(resource_get) }\n wants.json { render :json => resource_get, :status => :created, :location => resource }\n else\n wants.html { render :action => \"new\" }\n wants.json { render :json => resource_get.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f67865fcea737d02f00404c0054359f",
"score": "0.5991291",
"text": "def createResource(id, type ='XMLResource')\n resource = @obj.createResource(id, type)\n return XMLDB::Base::Resource.getInstance(resource)\n end",
"title": ""
},
{
"docid": "7409f41e8fa2d307bf72f5799e357007",
"score": "0.59876144",
"text": "def create(attributes = {})\n resource = build(attributes)\n @owner.attributes[@name] = resource if resource.save\n resource\n end",
"title": ""
},
{
"docid": "1ee6630be809bc930e532658bfa7e889",
"score": "0.59859985",
"text": "def create(attributes)\n resource_class.create(client, attributes.merge(scope_parameters))\n end",
"title": ""
},
{
"docid": "463c7897bc343b5c33ded0eb3d7c38a8",
"score": "0.5983937",
"text": "def create\n http_api.post(\"clients\", self)\n end",
"title": ""
},
{
"docid": "62f7aad827757fa552b5dc563c9e57ab",
"score": "0.5974559",
"text": "def initialize(cluster_config, properties, client)\n @client = client\n @properties = properties\n\n @config = cluster_config\n @mob = properties[:obj]\n @resource_pool = ResourcePool.new(@client, cluster_config, properties['resourcePool'])\n end",
"title": ""
},
{
"docid": "68016c759b3255e4c4939b48eef0a923",
"score": "0.59652305",
"text": "def create\n @property_flush = @resource\n @property_hash[:ensure] ||= :present\n command = build_from_type(:on_create)\n command.execute\n @property_flush = {}\n end",
"title": ""
},
{
"docid": "252375b87d69acc0e659fa5346afee33",
"score": "0.59631264",
"text": "def set_resource\n\t\tend",
"title": ""
},
{
"docid": "6c6a74e71fbbf473337ebbc4a6286bc9",
"score": "0.59432274",
"text": "def build_resource(hash = {})\n self.resource = resource_class.new_with_session(hash, session)\n end",
"title": ""
},
{
"docid": "6c6a74e71fbbf473337ebbc4a6286bc9",
"score": "0.59432274",
"text": "def build_resource(hash = {})\n self.resource = resource_class.new_with_session(hash, session)\n end",
"title": ""
},
{
"docid": "8ca42330a2a3f3f1ba3c75f36395eb0b",
"score": "0.5939237",
"text": "def create_resource\n raise NotImplementedError, \"#{self.class}#create_resource is not implemented\"\n end",
"title": ""
},
{
"docid": "4de6f760ef25fabf1eea90398e6b9e02",
"score": "0.593244",
"text": "def initialize(context)\n @sdk_base_module = OneviewSDK\n @context = context\n @new_resource = context.new_resource\n @resource_name = context.new_resource.resource_name\n @name = context.new_resource.name\n klass = parse_namespace\n client_api_version = if context.property_is_set?(:client)\n if context.new_resource.client.is_a?(Hash)\n convert_keys(context.new_resource.client, :to_sym)[:api_version]\n elsif context.new_resource.client.is_a?(OneviewSDK::Client) # It works for both Image Streamer and OneView\n context.new_resource.client.api_version\n end\n end\n # If client.api_verion is not set, it sets appliance's max api version\n @new_resource.client.delete(:api_version) unless client_api_version\n c = if @sdk_base_module == OneviewSDK::ImageStreamer\n OneviewCookbook::Helper.build_image_streamer_client(@new_resource.client)\n else\n OneviewCookbook::Helper.build_client(@new_resource.client)\n end\n new_data = JSON.parse(@new_resource.data.to_json) rescue @new_resource.data\n @item = context.property_is_set?(:api_header_version) ? klass.new(c, new_data, @new_resource.api_header_version) : klass.new(c, new_data)\n Chef::Log.info(\"API Version #{@item.api_version}\")\n @item['name'] ||= @new_resource.name\n end",
"title": ""
},
{
"docid": "162406e1791afeeb9d54eaebfd71b1fc",
"score": "0.59262055",
"text": "def create(options={}, &block)\n object = build_resource\n\n if create_resource(object)\n #FIXME asset_assignment do not have edit method so generation of edit_utl failed\n unless options[:location].present?\n if respond_to?(:edit)\n options[:location] = edit_resource_url(:cl => @resource_locale) rescue nil\n end\n end\n end\n respond_with_dual_blocks(object, options, &block)\n \n #create!{edit_resource_url(:cl => @resource_locale)}\n end",
"title": ""
},
{
"docid": "03602537a676fbdba068b87425de03bb",
"score": "0.59217304",
"text": "def create(params = {})\n resource.create_by_api service_scoped(params)\n end",
"title": ""
},
{
"docid": "fb8b83f9386bff10a4ed01b48466ba5d",
"score": "0.5916791",
"text": "def create_client\n\n client = Client.new\n\n client.send(\"set_#{GlobalConstant::Client.sandbox_whitelisted_status}\")\n client.send(\"unset_#{GlobalConstant::Client.mainnet_whitelisted_status}\")\n client.save!\n\n @client_id = client.id\n\n @client = client.formatted_cache_data\n\n success\n end",
"title": ""
},
{
"docid": "b755f3faf55561f0b1576cc54e118d70",
"score": "0.5914729",
"text": "def create(_resource, _params, _authorizer)\n raise NotImplemented\n end",
"title": ""
},
{
"docid": "c1113f3aab61a29b4f4bbea51258b238",
"score": "0.5910495",
"text": "def add_resource( resource_attributes = {})\n resource = Resource.new( resource_attributes )\n self.resources << resource\n resource\n end",
"title": ""
},
{
"docid": "c2b9351554f5f66191de072341340592",
"score": "0.5905977",
"text": "def build_resource(hash=nil)\r\n self.resource = resource_class.new_with_session(hash || {}, session)\r\n end",
"title": ""
},
{
"docid": "a5a77d46b5f1b76cd08b89dfc509675c",
"score": "0.5905841",
"text": "def jsonapi_create\n _persist do\n jsonapi_resource.persist_with_relationships \\\n deserialized_params.meta,\n deserialized_params.attributes,\n deserialized_params.relationships\n end\n end",
"title": ""
},
{
"docid": "e18ad7a2dc6c5ab51abdd1e6504e6b16",
"score": "0.5900711",
"text": "def create\n\tputs \"create\"\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
25598873327eb3ee3637d751323f82d5
|
filter that responds with :not_acceptable if request rdf for non rdf capable resource
|
[
{
"docid": "1a0ed56c28ac3110cb3648c46cea9232",
"score": "0.65941924",
"text": "def rdf_enabled?\n return unless request.format.rdf?\n unless Seek::Util.rdf_capable_types.include?(controller_model)\n respond_to do |format|\n format.rdf { render plain: 'This resource does not support RDF', status: :not_acceptable, content_type: 'text/plain' }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "85d485c79c6440ec390d4f91a9da7230",
"score": "0.636041",
"text": "def rdf_supported?\n false\n end",
"title": ""
},
{
"docid": "4de4fb6442be8ae4bd526b8c1530610a",
"score": "0.59026444",
"text": "def status_not_acceptable\n respond_to do |format|\n format.any { head :not_acceptable }\n end\n end",
"title": ""
},
{
"docid": "5fc646b5f22cd8351eeb2fcc3bf76d3b",
"score": "0.58537364",
"text": "def make_not_acceptable_body( response )\n\t\t# :TODO: Unless it was a HEAD request, the response SHOULD include\n\t\t# an entity containing a list of available entity characteristics and\n\t\t# location(s) from which the user or user agent can choose the one\n\t\t# most appropriate. The entity format is specified by the media type\n\t\t# given in the Content-Type header field. Depending upon the format\n\t\t# and the capabilities of the user agent, selection of the most\n\t\t# appropriate choice MAY be performed automatically. However, this\n\t\t# specification does not define any standard for such automatic\n\t\t# selection. [RFC2616]\n\t\treturn \"No way to respond given the requested acceptance criteria.\"\n\tend",
"title": ""
},
{
"docid": "616b8843787a2fcc69ff534cb0b7471e",
"score": "0.56039315",
"text": "def check_resource_semantics!; end",
"title": ""
},
{
"docid": "abf96ad26dafe60f6a3c83a00a083b62",
"score": "0.5548741",
"text": "def not_acceptable\n return app_not_acceptable unless core.request?\n render_core_exception :not_acceptable\n end",
"title": ""
},
{
"docid": "35e924ad20d1883a560a78fa741c4493",
"score": "0.54516894",
"text": "def allow_only_standard_requests\n if params[:format] && ([\"html\", \"js\", \"json\", \"xml\", \"rss\"].exclude?(params[:format]))\n raise ActionController::RoutingError.new('No route matches \"'+request.url+'\"')\n end\n end",
"title": ""
},
{
"docid": "628b1a0b878968f2fe3547ec52e097a0",
"score": "0.53564245",
"text": "def forbidden\n respond_with 403\n end",
"title": ""
},
{
"docid": "43757266b61827c162aa0f35304cc822",
"score": "0.5355997",
"text": "def status\n\t\t:not_acceptable\n\tend",
"title": ""
},
{
"docid": "43757266b61827c162aa0f35304cc822",
"score": "0.5355997",
"text": "def status\n\t\t:not_acceptable\n\tend",
"title": ""
},
{
"docid": "40cfc535843e842b8ef0d78ac0eb5bcf",
"score": "0.5333699",
"text": "def create_non_rdf(new_resource_uri, content)\n # TODO: Add support for non-text data\n uri = build_uri_for_resource new_resource_uri \n log \"create_non_rdf at uri #{uri}\"\n response = Net::HTTP.start(uri.hostname, uri.port) {|http|\n request = Net::HTTP::Put.new(uri.path)\n request[\"Content-Type\"] = \"text/plain\"\n request.body = content\n log request.body\n http.request(request)\n } \n doc = FedoraDoc.new(response) \n if doc.status == HTTP_CREATED || doc.status == HTTP_NO_CONTENT\n log \"Non-RDF source created. Content available at #{doc.location}\"\n enable_versioning new_resource_uri\n else\n log \"Non-RDF source not created. HTTP status was #{doc.status}\"\n end\n doc\n end",
"title": ""
},
{
"docid": "94035e90bc4a97cf8ee3bb5c810f4e4b",
"score": "0.52783114",
"text": "def not_acceptable\n render :format => :html\n end",
"title": ""
},
{
"docid": "94035e90bc4a97cf8ee3bb5c810f4e4b",
"score": "0.52783114",
"text": "def not_acceptable\n render :format => :html\n end",
"title": ""
},
{
"docid": "94035e90bc4a97cf8ee3bb5c810f4e4b",
"score": "0.52783114",
"text": "def not_acceptable\n render :format => :html\n end",
"title": ""
},
{
"docid": "94035e90bc4a97cf8ee3bb5c810f4e4b",
"score": "0.52783114",
"text": "def not_acceptable\n render :format => :html\n end",
"title": ""
},
{
"docid": "94035e90bc4a97cf8ee3bb5c810f4e4b",
"score": "0.52783114",
"text": "def not_acceptable\n render :format => :html\n end",
"title": ""
},
{
"docid": "442d1d7cf6847e66a579e16dfb6dda77",
"score": "0.52666247",
"text": "def nontrivial_resource_pattern?\n false\n end",
"title": ""
},
{
"docid": "442d1d7cf6847e66a579e16dfb6dda77",
"score": "0.52666247",
"text": "def nontrivial_resource_pattern?\n false\n end",
"title": ""
},
{
"docid": "28a6a16a603fc8dfcdda1666da3fa985",
"score": "0.5260432",
"text": "def consume_bad_url; end",
"title": ""
},
{
"docid": "0b9831c1906f4f59e2723d36fcaf5722",
"score": "0.5247968",
"text": "def resource_allowed?(scan_result)\n logger.debug scan_result\n (scan_result['response_code'] < 1) || !contains_in_bases?(scan_result)\n end",
"title": ""
},
{
"docid": "14653e313ca7d9383c447f9649a312a3",
"score": "0.52454907",
"text": "def check_mixed_resources\n end",
"title": ""
},
{
"docid": "2618e3618f93d010ed9e307da0f7b56e",
"score": "0.52416575",
"text": "def strict_filters; end",
"title": ""
},
{
"docid": "a22609e4c3bcace565afc7ff1102c91d",
"score": "0.523547",
"text": "def accepted?\n false\n end",
"title": ""
},
{
"docid": "6eb6e69a9c1b89255a20dda202d5c13a",
"score": "0.52222157",
"text": "def filter(sparql)\n raise \"Must be overridden\"\n end",
"title": ""
},
{
"docid": "56262583e1deaf9f76f172efcb660258",
"score": "0.52058434",
"text": "def forbidden\n respond_with 403\n end",
"title": ""
},
{
"docid": "18f9acf46c14e66ccbb45d12a654fe28",
"score": "0.51873386",
"text": "def invalid_resource?(resource)\n !!resource.match(rejected_characters_regexp)\n end",
"title": ""
},
{
"docid": "ed744a6b5c669fa6384f3cb9f1a9c94a",
"score": "0.5120407",
"text": "def allowed?; true end",
"title": ""
},
{
"docid": "45c730748b5dda07c76b8a351045c92c",
"score": "0.5107718",
"text": "def validate_resource\n begin \n # Below line will skip extra processing of fiter \n # in subsequent action execution in request chain.\n @resource ||= params[:resource_type].constantize.find(params[:resource_id]) \n rescue\n flash[ :notice ] => \"Invalid #{params[:resource_type] }\"\n end\n end",
"title": ""
},
{
"docid": "3d5e6243450372b634285a10510221f6",
"score": "0.5101426",
"text": "def _filter r, options\n return r if params[:f].blank?\n return resource_class.filter r, params[:f], options if resource_class.respond_to? :filter\n r\n end",
"title": ""
},
{
"docid": "0ff20080cd8560133805f4c8fc42d155",
"score": "0.50972396",
"text": "def good_resource?(url)\n if rx_url\n !(url.to_s !~ rx_url)\n else\n true\n end\n end",
"title": ""
},
{
"docid": "bcd98ef956dfb1e46c678de5fce8ebbf",
"score": "0.50813496",
"text": "def _convertRDF() \n raise \"Unimplemented.\"\n\t#\tfrom rdflib import Graph\n#\t\tretval = Graph()\n#\t\t# this is a strange hack. If the publicID is not set, rdflib (or the underlying xml parser) makes a funny \n#\t\t#(and, as far as I could see, meaningless) error message...\n#\t\tretval.load(self.response,publicID=' ')\n#\t\treturn retval\n\tend",
"title": ""
},
{
"docid": "05e95f5b6e27be050bd703d06c3e1a74",
"score": "0.50706655",
"text": "def accept_helper\n content_type = MediaType.parse(request.content_type || 'application/octet-stream')\n acceptable = resource.content_types_accepted.find {|ct, _| content_type.match?(ct) }\n if acceptable\n resource.send(acceptable.last)\n else\n 415\n end\n end",
"title": ""
},
{
"docid": "3f8f0b7b4e48c78ccaf62782874e6b32",
"score": "0.5039164",
"text": "def not_acceptable(message = nil)\n http_error(406, message, VARY)\n end",
"title": ""
},
{
"docid": "f224958ed5b92d9cac35552c290b5c53",
"score": "0.50357765",
"text": "def validate_filter\n ensure_filter_only_attributes\n ensure_no_unsupported_filters\n end",
"title": ""
},
{
"docid": "890ee7706cdde5bcd14f1f7eac70e22f",
"score": "0.5026053",
"text": "def validate_rdf\n raise InvalidNode, \"Triple has illegal RDF subject #{subject.inspect}\" unless subject.is_a?(URIRef) || subject.is_a?(BNode)\n raise InvalidPredicate, \"Triple has illegal RDF predicate #{predicate.inspect}\" unless predicate.is_a?(URIRef)\n end",
"title": ""
},
{
"docid": "54c20abc03f9f0297cc5db1435e30008",
"score": "0.5020126",
"text": "def has_no_accepted_response?\n !self.has_accepted_response?\n end",
"title": ""
},
{
"docid": "dafde1b29b4f247706a4105daae2c072",
"score": "0.5019125",
"text": "def valid?\n RDF::URI::IRI.match?(to_s) || false\n end",
"title": ""
},
{
"docid": "ed84b2d385549fac773df622f08c0ce2",
"score": "0.5016017",
"text": "def catch_bad_format_param\n if ['json', 'rss'].include? params[:format]\n render plain: \"Invalid parameter: we do not provide search results in #{params[:format]} format.\", status: 406\n end\n end",
"title": ""
},
{
"docid": "6eb7ea5aab931fc51415429554943ea6",
"score": "0.49807957",
"text": "def reject!\n super { |r| yield(r) && orphan_resource(r) }\n end",
"title": ""
},
{
"docid": "d24b7e4208eb19460c3b6d95044f964f",
"score": "0.49493834",
"text": "def filter_self\n if @user && !current_user.can_edit?(@user)\n respond_to do |format|\n format.html {\n render :nothing => true, :status => 403\n }\n format.json {\n render :json => {:status => 'failure'}, :status => 403\n }\n end\n end\n end",
"title": ""
},
{
"docid": "1ccf6a173053b39733455bd355a83fdd",
"score": "0.49432245",
"text": "def expect_forbidden_status\n is_expected.to respond_with 403\n end",
"title": ""
},
{
"docid": "eee7895a77f652aa2f6c1f9cd161119e",
"score": "0.49415365",
"text": "def show\n respond_to do |format|\n format.html {}\n format.json {}\n format.rdf { render rdf: @paper }\n end\n end",
"title": ""
},
{
"docid": "a200e8759474674eb334b8a49e11157b",
"score": "0.49362418",
"text": "def publishing_format\n :rdf\n end",
"title": ""
},
{
"docid": "06419e5bbc7f5df8bc20e7dff1fee8f2",
"score": "0.49334484",
"text": "def allow_matcher; end",
"title": ""
},
{
"docid": "34fd74d88037d9e3ded9aca3b70559d3",
"score": "0.4918388",
"text": "def status_forbidden\n respond_to do |format|\n format.any { head :forbidden }\n end\n end",
"title": ""
},
{
"docid": "b4720208b359b8defe4ec7be030eaed3",
"score": "0.48995432",
"text": "def resource_pattern?\n false\n end",
"title": ""
},
{
"docid": "9d2e035d94cf8674b32d8bfae1c09757",
"score": "0.48991403",
"text": "def fixup_response( response )\n\t\tresponse = super\n\n\t\t# Ensure the response is acceptable; if it isn't respond with the appropriate\n\t\t# status.\n\t\tunless response.acceptable?\n\t\t\tbody = self.make_not_acceptable_body( response )\n\t\t\tfinish_with( HTTP::NOT_ACCEPTABLE, body ) # throw\n\t\tend\n\n\t\treturn response\n\tend",
"title": ""
},
{
"docid": "27bef576913ea4fffe6578b1875ce0ec",
"score": "0.48850873",
"text": "def forbidden\n head :forbidden\n end",
"title": ""
},
{
"docid": "cc189bfe45ca52abe6270caaa43a241b",
"score": "0.48791856",
"text": "def yadis_request?(request)\n (request.env['HTTP_ACCEPT'] && request.env['HTTP_ACCEPT'].include?('application/xrds+xml'))\n end",
"title": ""
},
{
"docid": "9bbb83083a9a394ee098288d5d819349",
"score": "0.4860871",
"text": "def should_send_raw?\n request.headers[\"HTTP_ACCEPT\"].include?(\"*/*\") &&\n controller.params[:format].nil? &&\n resource.respond_to?(:content_type) &&\n resource.content_type != 'text/x-markdown'\n end",
"title": ""
},
{
"docid": "8107696433a9570e39a27f749c0888b8",
"score": "0.48598805",
"text": "def test_rdf_fail\n assert_raise(ArgumentError) { @valid_source.test_predicate(\"foo\") }\n end",
"title": ""
},
{
"docid": "6c90309914857142af915ad21b2e80e1",
"score": "0.48561314",
"text": "def filter_user_is_admin\n # We aren't going to redirect on this one. Since it's an admin interface it's pretty sensitive so \n # we're going to give a \"not found\" response (security through obscurity anyone?)\n unless( user_is_admin)\n respond_to do |wants|\n wants.atom { head 404}\n wants.atomsvc { head 404}\n wants.html do\n render :file => \"#{RAILS_ROOT}/public/404.html\", :status => 404\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5c951b3bfa1b5fd1e723bf2ec316a177",
"score": "0.484907",
"text": "def acceptable? *args\n true\n end",
"title": ""
},
{
"docid": "cb387a84e4f42b73e64c712ef32d8604",
"score": "0.4844833",
"text": "def __accepted__\n defined?(accepted) ? accepted : false\n end",
"title": ""
},
{
"docid": "5b3d8ff619be0a4fe93b591446fcaf0d",
"score": "0.48423856",
"text": "def iiif\n @embed_request.validate! url_scheme: false, format: false\n end",
"title": ""
},
{
"docid": "58df95652936e24de6b41449d77b3b8e",
"score": "0.48225763",
"text": "def validate(resource, &block); end",
"title": ""
},
{
"docid": "33620d6b4f205d6ce8ab16026963aa12",
"score": "0.48024383",
"text": "def respond_bad_request; make_response(nil, false, 400, \"Bad Request\") end",
"title": ""
},
{
"docid": "2a50b835c4b99b5bd5571a3746e65e4d",
"score": "0.47975573",
"text": "def accept_url url\n accept_attribute :url, self.class.standardized_url(url) if url.present? && acceptable_url?(url)\n # self.write_attribute :url, url\n end",
"title": ""
},
{
"docid": "b33df91a6a10659e1b0fc89ecb48aa5c",
"score": "0.47774866",
"text": "def reject_embedded(rel, ignore: [], &blk)\n blk ||= ->(_target){true}\n\n (embedded, links) = repr\n .all_links\n .partition(&:embedded?)\n\n (candidates, safe)= embedded\n .partition{|link| link.rel?(rel) }\n\n selected = candidates.reject(&link_checker(blk, ignore))\n\n new_repr = Representation.new(repr.href,\n repr.properties,\n links+safe+selected,\n repr.hal_client)\n\n self.class.new(new_repr, orig_repr)\n\n end",
"title": ""
},
{
"docid": "86c1abb7867bc879a1c099650754cb36",
"score": "0.4772551",
"text": "def test_uri_validator\n # invalid\n assert !RDF::valid_uri?(\"use`quote\")\n # assert !RDF::valid_uri?(\"use%7quote\")\n\n # valid\n assert RDF::valid_uri?(\"use%07quote\")\n\n end",
"title": ""
},
{
"docid": "7c8ff55620f5c237c973949f79ffb79c",
"score": "0.47598407",
"text": "def blacklist_mime_type_pattern; end",
"title": ""
},
{
"docid": "7d3d660023772d8ec4e6db4c47c5793c",
"score": "0.47553965",
"text": "def ignore_resource_type(type)\n @ignore_rules[type] = \"*\"\n end",
"title": ""
},
{
"docid": "36478254a2ff0861a66c633914d2d8f4",
"score": "0.47532433",
"text": "def freeze_io!(**filter_opts)\n before_action :serializer_freeze_io_internal, **filter_opts\n\n output_error MediaTypes::Serialization::NoInputReceivedError do |p, _error|\n p.title 'Providing input is mandatory. Please set a Content-Type', lang: 'en'\n\n p.status_code :bad_request\n end\n end",
"title": ""
},
{
"docid": "6e7541166d118b2f335f88b523eea81a",
"score": "0.47481483",
"text": "def check_rule_support_type(filter, term, h_filters)\n\n # Initialize vars\n ruletype = :normal\n rules = Set.new\n filterref = String.new\n\n h_filters[filter][term][:source].each do |object, objtype|\n if objtype == :'forwarding-class' || objtype == :'tcp-established' || objtype == :filter\n rules << objtype\n end\n\n # If the type is :filter, this is a link to another entire filter (aka nested filter), we must pass back the name\n # of the referenced/nested filter and recurse that filter to get the details for this rule.\n filterref = object if objtype == :filter\n\n end\n\n ## Had to do the below manually instead of automated to establish precedence because we need to ensure that if\n ## it containts tcp-established we return that and skip despite any other types.\n if rules.include?(:'tcp-established')\n ruletype = :'tcp-established'\n return ruletype, filterref\n end\n\n if rules.include?(:'forwarding-class')\n ruletype = :'forwarding-class'\n return ruletype, filterref\n end\n\n if rules.include?(:filter)\n ruletype = :filter\n return ruletype, filterref\n end\n\n return ruletype, filterref\nend",
"title": ""
},
{
"docid": "c69efe2924e88a1f5881459904819224",
"score": "0.47466794",
"text": "def requires_prolog?\n !patterns.all? {|p| p.kind_of?(RDF::Query::Pattern) }\n end",
"title": ""
},
{
"docid": "890de66bbbe6aa1e6e1a6ce0034dfb16",
"score": "0.47457224",
"text": "def convert() \n raise \"Unimplemented.\"\n\n#\t\tct = self.response.info()[\"content-type\"]\n#\t\tif True in [ct.find(q) != -1 for q in _SPARQL_XML] :\n#\t\t\treturn self._convertXML()\n#\t\telif True in [ct.find(q) != -1 for q in _SPARQL_JSON] :\n#\t\t\treturn self._convertJSON()\n#\t\telif True in [ct.find(q) != -1 for q in _RDF_XML] :\n#\t\t\treturn self._convertRDF()\n#\t\telif True in [ct.find(q) != -1 for q in _RDF_N3] :\n#\t\t\treturn self._convertN3()\n#\t\telse :\n#\t\t\t# this should cover, well, the rest of the cases...\n#\t\t\treturn self.response\n#\n end",
"title": ""
},
{
"docid": "a0b74151f87d644aab1e863a4d2d24af",
"score": "0.47429743",
"text": "def reject_related(rel, ignore: [], &blk)\n reject_embedded(rel, ignore: ignore, &blk).reject_links(rel, ignore: ignore, &blk)\n end",
"title": ""
},
{
"docid": "2c4d1db0e85fee5ac3ea5005a86b2d20",
"score": "0.47419062",
"text": "def exclude_name(name)\n @rest_call.append_headers(\"X-Nuage-FilterType\", \"predicate\")\n @rest_call.append_headers(\"X-Nuage-Filter\", \"name ISNOT '#{name}'\")\n end",
"title": ""
},
{
"docid": "9c9907deec56a0d4246751813f2064e3",
"score": "0.47412878",
"text": "def not\n require_relative './not'\n \n NRSER::Types.not self\n end",
"title": ""
},
{
"docid": "a98cfae43cd4c0bc90f3eb4654389a26",
"score": "0.47394127",
"text": "def deny_access\n respond_to do |format|\n format.json {\n # Some schools of thought advocate the use of 404 (:not_found). See\n # http://www.bennadel.com/blog/2400-handling-forbidden-restful-requests-401-vs-403-vs-404.htm\n render json: {}, status: :unauthorized\n }\n end\n end",
"title": ""
},
{
"docid": "ddc4acb239d96e2a31358e947f9bc864",
"score": "0.47370622",
"text": "def test_default_filterchain\n chain = UrlFilters::FilterChain.new(RDig.filter_chain[:http])\n assert_nil chain.apply(Document.create(\"http://www.example.com/affe.htm\"))\n assert_not_nil chain.apply(Document.create(\"http://localhost:3000/affe.html\"))\n assert_nil chain.apply(Document.create(\"http://localhost.com/affe.html\"))\n end",
"title": ""
},
{
"docid": "7c9106bea0bd7f3bd8adee8e419e02fc",
"score": "0.47348046",
"text": "def status_bad_request\n respond_to do |format|\n format.any { head :bad_request }\n end\n end",
"title": ""
},
{
"docid": "b1cb4b378ef7c49e62526bece1c48e84",
"score": "0.4726627",
"text": "def not_applicable\n @not_applicable ||= all.select { |rule| rule.status == \"NA\" }\n end",
"title": ""
},
{
"docid": "02a96795cd961ff95d07d2807276222b",
"score": "0.47252935",
"text": "def check_format\n # This allows us to support content negotiation\n if request.headers['HTTP_ACCEPT'].nil? || request.format == '*/*'\n request.format = 'xml'\n end\n\n request_format = request.format.symbol\n if request_format != :xml && request_format != :json\n # 406 is the default status code when the format is not support\n head :not_acceptable\n end\n end",
"title": ""
},
{
"docid": "e77ca2d2572964d2ffe99fbe241f0660",
"score": "0.4723416",
"text": "def blacklisted?(request)\n false\n end",
"title": ""
},
{
"docid": "d10bdb54d46cf8eb50b91ec902c81e00",
"score": "0.47186288",
"text": "def is_valid?(resource,representation='Resource')\n if representation.downcase=='resource'\n if !is_fhir_class?(resource.class.to_s)\n @errors << \"Not a FHIR Resource: #{resource.class.to_s}\"\n return false\n end\n is_valid_xml? resource.to_xml\n elsif representation.downcase=='xml'\n is_valid_xml? resource\n else\n raise Exception.new \"is_valid? unhandled representation: #{representation}\"\n end\n end",
"title": ""
},
{
"docid": "b8c633903507201f78b9ca70f8877d92",
"score": "0.4716445",
"text": "def irregular?\n false\n end",
"title": ""
},
{
"docid": "feea68cf9c76babaef54779c551124a0",
"score": "0.4698976",
"text": "def filterable?; @filterable; end",
"title": ""
},
{
"docid": "ee5294a38f3d485f227607634c5e82e5",
"score": "0.46959585",
"text": "def unauthorized_request user:current_user,filter:nil\n\t\t\tputs \"\\n\\nNo filter matches the given http method, controller, or controller method, rerouting...\" if filter.blank?\n\t\t\tputs \"\\n\\nUser #{user.email} is not authorized to #{filter.http_method.upcase}::>#{filter.controller || 'all'}.#{filter.action_name || 'all'}, rerouting...\\n\\n\" unless filter.blank?\n\t\t\trender json: \"Unauthorized Request\"\n\t\tend",
"title": ""
},
{
"docid": "de945803c39f60301e72c065f92dd0da",
"score": "0.46913207",
"text": "def respond_resource_not_found(path)\n log(\"#{path} Not Found\")\n make_response(nil, false, 404, \"Not Found\")\n end",
"title": ""
},
{
"docid": "76d8a860040e1fd4b72872b291b9912a",
"score": "0.46886462",
"text": "def reject_interests\n respond_with get_tags_for_contexts([\"interests\",\"reject_interests\"], params[:exclude_tags])\n end",
"title": ""
},
{
"docid": "3229bf03f644dc6962ca4f2bc54a0c75",
"score": "0.46809128",
"text": "def contains_bad_protocols?(attr_name, value)\n uri_attributes.include?(attr_name) &&\n (value =~ /(^[^\\/:]*):|(�*58)|(p)|(%|%)3A/ && !(allowed_protocols.include?(value.split(protocol_separator).first) ||\n allowed_protocols.include?(CGI::unescapeHTML(value.split(protocol_separator).first))))\n end",
"title": ""
},
{
"docid": "53d99d7939b0c58e0dd3d7d479c39841",
"score": "0.4679321",
"text": "def forbidden\n\n render_error( :forbidden )\n\n end",
"title": ""
},
{
"docid": "40a1ca9604c728e100411f384363e6c8",
"score": "0.46725592",
"text": "def acceptable?\n status.to_sym.in? [StatusReponded]\n end",
"title": ""
},
{
"docid": "9c08231e24aabff5043028f4ed08906a",
"score": "0.46718532",
"text": "def test_misfortune\n # find a usable canary URI (one that returns an acceptable status code already)\n if canary = find_canary\n canary_value, canary_code = canary\n vprint_status(\"#{peer} found canary URI #{canary_value} with code #{canary_code}\")\n else\n vprint_error(\"#{peer} Unable to find a suitable canary URI\")\n return Exploit::CheckCode::Unknown\n end\n\n canary_cookie_name = 'C107373883'\n canary_cookie = canary_cookie_name + \"=#{canary_value};\"\n\n # Make a request containing a specific canary cookie name with the value set\n # from the suitable canary value found above.\n res = send_request_raw(\n 'uri' => normalize_uri(target_uri.path.to_s),\n 'method' => 'GET',\n 'headers' => headers.merge('Cookie' => canary_cookie)\n )\n\n unless res\n vprint_error(\"#{full_uri} no response\")\n return Exploit::CheckCode::Unknown\n end\n\n unless res.code.to_s =~ @status_codes_regex\n vprint_status(\"#{full_uri} unexpected HTTP code #{res.code} response\")\n return check_response_fingerprint(res, Exploit::CheckCode::Detected)\n end\n\n unless res.body\n vprint_status(\"#{full_uri} HTTP code #{res.code} had no body\")\n return check_response_fingerprint(res, Exploit::CheckCode::Detected)\n end\n\n # If that canary *value* shows up in the *body*, then there are two possibilities:\n #\n # 1) If the canary cookie *name* is also in the *body*, it is likely that\n # the endpoint is puppeting back our request to some extent and therefore\n # it is expected that the canary cookie *value* would also be there.\n # return Exploit::CheckCode::Detected\n #\n # 2) If the canary cookie *name* is *not* in the *body*, return\n # Exploit::CheckCode::Vulnerable\n if res.body.include?(canary_value)\n if res.body.include?(canary_cookie_name)\n vprint_status(\"#{full_uri} HTTP code #{res.code} response contained canary cookie name #{canary_cookie_name}\")\n return check_response_fingerprint(res, Exploit::CheckCode::Detected)\n else\n vprint_good(\"#{full_uri} HTTP code #{res.code} response contained canary cookie value #{canary_value} as URI\")\n report_vuln(\n host: rhost,\n port: rport,\n name: name,\n refs: references\n )\n return Exploit::CheckCode::Vulnerable\n end\n end\n\n vprint_status(\"#{full_uri} HTTP code #{res.code} response did not contain canary cookie value #{canary_value} as URI\")\n check_response_fingerprint(res, Exploit::CheckCode::Safe)\n end",
"title": ""
},
{
"docid": "c258a78c311240263e8ce09d4acc542d",
"score": "0.46676868",
"text": "def unrecognizedResponse( text )\n end",
"title": ""
},
{
"docid": "02115ac1be4f42f8f3cdca498ce12328",
"score": "0.46653846",
"text": "def check_resource! resource \n resources.include?(resource.to_s) ? resource_parsed(resource) : raise(\"resource should be in [tags, posts, bundles]\") \n end",
"title": ""
},
{
"docid": "c0ffc1ae039bf9c716ec7c2590214650",
"score": "0.4655711",
"text": "def deny!\n body = %(This is an unauthorised request. Your IP address has been logged and will be reported.)\n response_headers = { 'Content-Type' => 'text/plain' }\n response = Rack::Response.new(body, 400, response_headers)\n custom! response.finish\n end",
"title": ""
},
{
"docid": "880c319383ac17374c4a6d7446558dc9",
"score": "0.46522415",
"text": "def verify_requested_format!\n mimes = collect_mimes_from_class_level\n collector = ActionController::MimeResponds::Collector.new(mimes, request.variant)\n\n unless collector.negotiate_format(request)\n raise ActionController::UnknownFormat\n end\n end",
"title": ""
},
{
"docid": "0aa7281c876954d8de5c2033e343dd1c",
"score": "0.46461415",
"text": "def test_filter_by_unknown_host_like_known_host\n filter = Galaxy::Filter.new :host => \"fo\" #don't match with \"foo\"\n\n assert_equal [ ], @agents.select(&filter)\n end",
"title": ""
},
{
"docid": "2a22dc01e29cd0fbea0d0819f50df762",
"score": "0.46440986",
"text": "def unevaluated_resources\n # The order of these is significant for speed due to short-circuiting\n resources.reject { |resource| resource.evaluated? or resource.virtual? or resource.builtin_type? }\n end",
"title": ""
},
{
"docid": "44f424e7ec7b6c9dd00e6aa6d820f625",
"score": "0.4639747",
"text": "def option_accept_invalid_http_request\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"option accept-invalid-http-request \" + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end",
"title": ""
},
{
"docid": "09c2bb7b322e3d2c37620c6bf35f228f",
"score": "0.46387222",
"text": "def match?(_request)\n fail NotImplementedError\n end",
"title": ""
},
{
"docid": "a213c334d8293a3d887b9ee42bcc9361",
"score": "0.463811",
"text": "def filter_response(response, request)\n # nothing to do\n end",
"title": ""
},
{
"docid": "eb8b95e76df7ddc30c2ef06df747961e",
"score": "0.46312472",
"text": "def nsfw_filter\n if self.class == AnswersController\n answer = Answer.find_by(id: params[:id])\n if answer.question.nsfw_flag\n filter = true\n end\n elsif self.class == QuestionsController\n category= Category.find_by_slug(params[:id])\n if category.name.include?(\"nsfw\")\n filter = true\n end\n end\n if filter && (current_user.dob && current_user.dob >= 18.years.ago)\n flash[:age_message] = \"You must be 18 or older to view this.\"\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "c5ac0aeab4a5a2759d710ac657cc6765",
"score": "0.46182156",
"text": "def SHOULD_NOT(matcher)\n ::Spectus::Requirement::Recommended.new(\n isolate: false,\n negate: true,\n matcher: matcher\n )\n end",
"title": ""
},
{
"docid": "7506e8d269bb22b48bc478a16ba72098",
"score": "0.46150982",
"text": "def forbidden?\n @forbidden\n end",
"title": ""
},
{
"docid": "6283a37a90391722138b5b24a72642d8",
"score": "0.46137553",
"text": "def should_block_access\n should_respond_with :missing\n should_render_template \"404\"\n should_not_set_the_flash\n end",
"title": ""
},
{
"docid": "ac69b353d6d6acd570217feeb251a964",
"score": "0.4610773",
"text": "def is_unavailable?\n \tself.kind == \"NotAvailable\"\n end",
"title": ""
},
{
"docid": "c5c30f10a45911c73087cdffdc830702",
"score": "0.461025",
"text": "def rule_exists?\n # To Action From\n # -- ------ ----\n # 22 ALLOW Anywhere\n # 192.168.0.1 25/tcp DENY 10.0.0.0/8\n shell_out!(\"ufw status\").stdout =~ \n/^(#{@new_resource.destination}\\s)?#{port_and_proto}\\s.*(#{@new_resource.action.to_s})\\s.*#{@new_resource.source || 'Anywhere'}$/i\n end",
"title": ""
},
{
"docid": "b79dd9aa92f5b67ab3114c5e24a2e519",
"score": "0.4608961",
"text": "def treat_as_standard_html_request?\n !request.format.json? and !request.format.print? and !request.format.video?\n end",
"title": ""
}
] |
a791dba914b7ebc96a09096b3044dbef
|
Appends the specified float to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written. Returns a reference to this so multiple operations can be appended together.
|
[
{
"docid": "53e95de61c4564b7612ac6269e97cfb1",
"score": "0.75912696",
"text": "def append_float(f=nil)\n if f.class == Float && !block_given?\n @j_del.java_method(:appendFloat, [Java::float.java_class]).call(::Vertx::Util::Utils.to_float(f))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_float(f)\"\n end",
"title": ""
}
] |
[
{
"docid": "ceec9bfff92cb28c613bd32382af6f66",
"score": "0.640298",
"text": "def add_item value\n\n @queue << value.to_f\n @queue.shift if @buffer.size > @period\n\n @buffer << @queue.sum / @queue.size # @queue.sum is always a float. \n\n current # return the last buffer value\n end",
"title": ""
},
{
"docid": "c203cc9bbc16317084956afb2bb1baa2",
"score": "0.5836609",
"text": "def float64(val)\n raise ArgumentError, \"float64() requires a Numeric argument\" \\\n unless val.is_a?(Numeric)\n\n @io.write([val].pack(\"G\"))\n\n self\n end",
"title": ""
},
{
"docid": "f55164c3163667afb4b28a07fc5e8924",
"score": "0.5822043",
"text": "def put_float(*floats)\n floats.each do |f|\n t1 = [f.to_f].pack('f') # machine order\n t2 = t1.unpack('L*').first # int in machine order\n @request << [t2].pack('N')\n end\n self\n end",
"title": ""
},
{
"docid": "757acc211adca929c8971ee9610fd52c",
"score": "0.5779971",
"text": "def set_float(pos=nil,f=nil)\n if pos.class == Fixnum && f.class == Float && !block_given?\n @j_del.java_method(:setFloat, [Java::int.java_class,Java::float.java_class]).call(pos,::Vertx::Util::Utils.to_float(f))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling set_float(pos,f)\"\n end",
"title": ""
},
{
"docid": "0c3d4d379bde9755e4e7bbc08eb12d98",
"score": "0.5634468",
"text": "def add_item value\n @queue << value\n @queue.shift if @queue.size > @period\n if @buffer.empty?\n @buffer=[value.to_f]\n else\n prev_ema = @buffer.last\n current_value = value.to_f\n # this is the incremential approach\n # @buffer << (current_value * @smooth_constant ) + prev_ema * (1 - @smooth_constant)\n # it is identical to\n @buffer << (current_value - prev_ema) * @smooth_constant + prev_ema\n # which is much easier to compute\n end\n current # return the last buffer value\n end",
"title": ""
},
{
"docid": "5ebb8442033cfa7a7985e9ad3ccbec91",
"score": "0.55088335",
"text": "def float\n r = little? ? @data.byteslice(@pos, 4).unpack('e')[0] : @data.byteslice(@pos, 4).unpack('g')[0]\n @pos += 4\n r\n end",
"title": ""
},
{
"docid": "307590681e894bd86ad6e60160c44b1f",
"score": "0.5471334",
"text": "def float32(val)\n raise ArgumentError, \"float32() requires a Numeric argument\" \\\n unless val.is_a?(Numeric)\n\n @io.write([val].pack(\"g\"))\n\n self\n end",
"title": ""
},
{
"docid": "23ab101556b7326edc26725e1486806c",
"score": "0.5375434",
"text": "def Float(p0) end",
"title": ""
},
{
"docid": "f6b0406a6e312f427f0c46d1c2b10fc2",
"score": "0.5258682",
"text": "def process_incrbyfloat(command)\n key = command.first\n add_value = command[1]\n\n @connection.execute_udf(as_key(key), REDIS_UDF, 'incrbyfloat',\n [::Aerospike::StringValue.new(@bin),\n ::Aerospike::StringValue.new(add_value.to_s)\n ]).to_s\n end",
"title": ""
},
{
"docid": "7c761b6bd64a641caa57067cb7403be6",
"score": "0.5109913",
"text": "def append_double(d=nil)\n if d.class == Float && !block_given?\n @j_del.java_method(:appendDouble, [Java::double.java_class]).call(::Vertx::Util::Utils.to_double(d))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_double(d)\"\n end",
"title": ""
},
{
"docid": "d1733fc3964cd39163734f253b4a7e70",
"score": "0.5106436",
"text": "def on_float(token)\n log \"FLOAT: '#{token}'\"\n super(token)\n end",
"title": ""
},
{
"docid": "1d5d26f50b3929ec5de12f794b54e56e",
"score": "0.5075484",
"text": "def put_f32(arg)\n @data += [arg].pack(\"g\")\n self\n end",
"title": ""
},
{
"docid": "d28f5f2295be2d4cf6783b125c91a4cc",
"score": "0.5072209",
"text": "def put_f64(arg)\n @data += [arg].pack(\"G\")\n self\n end",
"title": ""
},
{
"docid": "3adf4e49ff7d8e72c45877bfcf605139",
"score": "0.5039682",
"text": "def write(val)\n if val != nil\n raise BufferFullException if @buffer.all? { |val| val != nil }\n @youngest = increment_youngest(@buffer.size)\n @buffer[@youngest] = val\n end\n end",
"title": ""
},
{
"docid": "b8f3bea2d349230c6a06ae0cca3ae6bf",
"score": "0.5034002",
"text": "def add_to_buffer( event )\n str = event.instance_of?(::Logging::LogEvent) ?\n layout.format(event) : event.to_s\n return if str.empty?\n\n buffer << str\n flush if buffer.length >= auto_flushing || immediate?(event)\n\n self\n end",
"title": ""
},
{
"docid": "5ce8882138921bee1e9d956517ce5ede",
"score": "0.49964428",
"text": "def encode_packed(buffer, values)\n with_packing(buffer, values) { |value, buff| buff.write_float(value) }\n end",
"title": ""
},
{
"docid": "0f4f98bf331b1ec63048b0e109822d5c",
"score": "0.49770087",
"text": "def <<(blob)\n @buf << blob\n buf_flush if @buf.size > BUFFER_SIZE\n self\n end",
"title": ""
},
{
"docid": "fc79890d11e9738a11e1bba60c8f1997",
"score": "0.49621004",
"text": "def _ff(buffer, pad, progress)\r\n buffer[-1] << \"#{self.class_family}\"\r\n vars = self.instance_variables.sort\r\n new_pad = pad + progress[:inc]\r\n\r\n if vars.empty?\r\n buffer << \"#{new_pad}Value = #{self.inspect}\"\r\n else\r\n buffer << \"#{new_pad}Variables:\"\r\n\r\n vars.each do | name |\r\n buffer << \"#{new_pad}#{name.to_s} is \"\r\n instance_variable_get(name)._ff(buffer, new_pad, progress)\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "765d27692d9657477bf1e94a1ebac52e",
"score": "0.4953645",
"text": "def +(other)\n convert_to(to_f + other.to_f)\n end",
"title": ""
},
{
"docid": "14f200888b10683dd8bbaf797337c8ae",
"score": "0.49494416",
"text": "def incrbyfloat(key, increment)\n send_command([:incrbyfloat, key, Float(increment)], &Floatify)\n end",
"title": ""
},
{
"docid": "1fc7dcd6a53408fb6698cd4a2054c909",
"score": "0.48768634",
"text": "def append_buffer(buff=nil,offset=nil,len=nil)\n if buff.class.method_defined?(:j_del) && !block_given? && offset == nil && len == nil\n @j_del.java_method(:appendBuffer, [Java::IoVertxCoreBuffer::Buffer.java_class]).call(buff.j_del)\n return self\n elsif buff.class.method_defined?(:j_del) && offset.class == Fixnum && len.class == Fixnum && !block_given?\n @j_del.java_method(:appendBuffer, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::int.java_class,Java::int.java_class]).call(buff.j_del,offset,len)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_buffer(buff,offset,len)\"\n end",
"title": ""
},
{
"docid": "02ae94697a28f1d7afd57c600412eb81",
"score": "0.48701784",
"text": "def float\n Util.from_bytes :float, value\n end",
"title": ""
},
{
"docid": "6d20a29e2e684f0b88c205fe8b5d39a4",
"score": "0.4859762",
"text": "def float(number, direction = :push)\n number.to_f\n end",
"title": ""
},
{
"docid": "2706a6ef0e235e5efd4d5d7f542517cd",
"score": "0.48518765",
"text": "def get_float\n raise EOFError if @position + 4 > @size\n uval = @response[@position, 4].unpack('N*').first;\n @position += 4\n return ([uval].pack('L')).unpack('f*').first\n end",
"title": ""
},
{
"docid": "05403e7ead9e272ad66dfc713a3349f3",
"score": "0.48416123",
"text": "def <<(buf)\n Polyphony.backend_write(self, buf)\n self\n end",
"title": ""
},
{
"docid": "fd15933f943cb27e7e1a683fadab34bc",
"score": "0.4839827",
"text": "def float_attr name, options = {}\n add_attribute(FloatAttribute.new(name, options))\n end",
"title": ""
},
{
"docid": "331e031f5c30477de72f00bb67c4c6ff",
"score": "0.48299634",
"text": "def get_float(key=nil)\n if key.class == String && block_given?\n @j_del.java_method(:getFloat, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(key,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling get_float(#{key})\"\n end",
"title": ""
},
{
"docid": "e14793a60a32cd9a8a47e23f6cca8fe8",
"score": "0.4826402",
"text": "def set_obj_float(obj, float, setter)\n check_error(setter[obj, [float].pack('f').unpack('i')[0]])\n float\n end",
"title": ""
},
{
"docid": "e14793a60a32cd9a8a47e23f6cca8fe8",
"score": "0.4826402",
"text": "def set_obj_float(obj, float, setter)\n check_error(setter[obj, [float].pack('f').unpack('i')[0]])\n float\n end",
"title": ""
},
{
"docid": "9e0bb5b646a6ab6b16172f6ede5cef91",
"score": "0.47956264",
"text": "def append!(buffer)\n @str << buffer.to_s\n self\n end",
"title": ""
},
{
"docid": "9e0bb5b646a6ab6b16172f6ede5cef91",
"score": "0.47956264",
"text": "def append!(buffer)\n @str << buffer.to_s\n self\n end",
"title": ""
},
{
"docid": "0334c3d4abef565c301eca1932938dd5",
"score": "0.47781146",
"text": "def buffer(_distance_)\n raise Error::UnsupportedOperation, \"Method Geometry#buffer not defined.\"\n end",
"title": ""
},
{
"docid": "1393678594123f1d8eda5e961ac76e63",
"score": "0.47766566",
"text": "def <<(item)\n @buffer << item\n trim_buffer\n self\n end",
"title": ""
},
{
"docid": "04c44eeb5eb8646db8b4c5d3fd1e398a",
"score": "0.47757715",
"text": "def update!(**args)\n @float_data = args[:float_data] if args.key?(:float_data)\n end",
"title": ""
},
{
"docid": "582f494dcededbd5fef45ce462689a98",
"score": "0.47692794",
"text": "def hincrbyfloat(key, field, increment)\n send_command([:hincrbyfloat, key, field, Float(increment)], &Floatify)\n end",
"title": ""
},
{
"docid": "43c213d58f8b09fdf6206eb85bf9274b",
"score": "0.47547007",
"text": "def post_process_float( val )\n\t\t\treturn Float( val.to_s )\n\t\tend",
"title": ""
},
{
"docid": "46572abd9130a2736fb11c6a28cfb195",
"score": "0.47367138",
"text": "def incrbyfloat(by=1.0, &block)\n allow_expiration do\n val = redis.incrbyfloat(key, by).to_f\n block_given? ? rewindable_block(:decrbyfloat, by, val, &block) : val\n end\n end",
"title": ""
},
{
"docid": "6548dbb13fb6c2acc5f04d62be81aab0",
"score": "0.47363222",
"text": "def add(data)\n case data\n when Buffer\n @data.concat(data.data)\n else\n data = data.to_s.dup\n return if data.empty?\n\n @data << data\n end\n @size += data.size\n self\n end",
"title": ""
},
{
"docid": "44ec57a33c4b427133b32b55bc094512",
"score": "0.4734136",
"text": "def to_float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n\n type = TO_FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 313:11: 'float:'\n match( \"float:\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 11 )\n\n end",
"title": ""
},
{
"docid": "a2734db926dfa85f377a43996a3b403d",
"score": "0.47273037",
"text": "def to_f\n if isFloat? then\n value = exp.to_f\n return value\n elsif exp == \"Infinity\" then return @@MAX_VALUE\n elsif exp == \"-Infinity\" then return @@MIN_VALUE\n else\n raise \"Non-float conversion in expression: \" + exp\n end\n end",
"title": ""
},
{
"docid": "4ce90e4fd4dd8fdc0ea413ad0f726208",
"score": "0.47164464",
"text": "def <<(n)\n @input.push n.to_f\n end",
"title": ""
},
{
"docid": "e52e090c73e3d543d7311d2e58ddb278",
"score": "0.47158378",
"text": "def *(float)\n\t\treturn FuzzyVariable.new(@value*float.to_f, @domain)\n\tend",
"title": ""
},
{
"docid": "9d8b445bf11c5aedef2109e314bb8ddd",
"score": "0.46876135",
"text": "def float_significant_dec(x)\n Numerals::Format[:free].write(x)\nend",
"title": ""
},
{
"docid": "d1d0ad63750bb85c4922d73a7afc8fdb",
"score": "0.4685656",
"text": "def []=(i, x)\n @elem[i] = Float(x)\n end",
"title": ""
},
{
"docid": "5ad5c5614970671c67f24040caf5a459",
"score": "0.46739244",
"text": "def flush\n @input << @tail\n buffer = @input.join\n @input.clear\n @tail = \"\" # @tail.clear is slightly faster, but not supported on 1.8.7\n buffer\n end",
"title": ""
},
{
"docid": "0ce24787d3fa5c7ec2d8fb62c59ae2f3",
"score": "0.46722162",
"text": "def float(*floats)\n format = ( little_endian? ? 'E*' : 'G*')\n return string(singles.pack(format))\n end",
"title": ""
},
{
"docid": "7985ffaf3db77b1b8e6fcd133d708f1a",
"score": "0.46304536",
"text": "def *(other)\n if other.is_a?(Value)\n other = other.to_f\n end\n if other.is_a?(Numeric)\n to_f * other\n else\n raise \"Unexpected argument (#{other.inspect})\"\n end\n end",
"title": ""
},
{
"docid": "ae344f6be4ee2177431d81cf97ef15cf",
"score": "0.46213543",
"text": "def parse_float\n float = @tokens.next\n\n [object_ref, float]\n end",
"title": ""
},
{
"docid": "1be00b62b0963148e0fed47c8c6d0c32",
"score": "0.46185547",
"text": "def incrbyfloat(key, increment)\n node_for(key).incrbyfloat(key, increment)\n end",
"title": ""
},
{
"docid": "214d0e7a3ba940f93bdd2969317f7609",
"score": "0.46023127",
"text": "def +(a)\n if self == 0\n return a\n elsif a == 0\n return self\n else\n case a\n when Numeric\n if @sqrt_part == 1\n return @front_part + a\n else\n return self.to_f + a.to_f\n end\n when Sqrt\n if @sqrt_part == a.sqrt_part\n return Sqrt.new(@sqrt_part, @front_part + a.front_part)\n else\n return self.to_f + a.to_f\n end\n else\n return self.to_f + a.to_f\n end\n end\n end",
"title": ""
},
{
"docid": "ce465b7d10e8b20c44812ba365240af0",
"score": "0.4596675",
"text": "def Add(val)\n self.value += val\n end",
"title": ""
},
{
"docid": "2a297b82d62d5fe5b1aa245ff298b285",
"score": "0.45953646",
"text": "def flush\n return if @current_line.nil?\n\n @stream << @current_line\n @current_line = nil\n end",
"title": ""
},
{
"docid": "28ced7f5f18d123d1265c03f3f766202",
"score": "0.4590749",
"text": "def queue message\n @buffer_semaphore.synchronize do\n @buffer += message\n end\n end",
"title": ""
},
{
"docid": "a8f3bda31806da8a3be1575f01d53f2c",
"score": "0.45824027",
"text": "def x=(value); self[X] = Float(value); end",
"title": ""
},
{
"docid": "a8f3bda31806da8a3be1575f01d53f2c",
"score": "0.45824027",
"text": "def x=(value); self[X] = Float(value); end",
"title": ""
},
{
"docid": "25d3c0af1345766498a55e7f7c14e4ab",
"score": "0.45777002",
"text": "def flush\n return unless @buffer.size > 0\n @log.write(@buffer.slice!(0..-1).join)\n end",
"title": ""
},
{
"docid": "842b30eb9b925bc2c89a63e608e8b5d7",
"score": "0.45758674",
"text": "def float\n little? ? read(4).unpack1('e') : read(4).unpack1('g')\n end",
"title": ""
},
{
"docid": "5c349b76690c972927bd2a9c0b83d080",
"score": "0.4538566",
"text": "def hincrbyfloat(key, field, increment)\n node_for(key).hincrbyfloat(key, field, increment)\n end",
"title": ""
},
{
"docid": "bf61c6f2a05c1f65dc475f239303706a",
"score": "0.4537325",
"text": "def to_f(aNum)\r\n# - - - - - - - - - - - - - - - - - -\r\n return 0.0 + aNum\r\nend",
"title": ""
},
{
"docid": "5533594906c1f1c6b97a25a805d17bde",
"score": "0.45367494",
"text": "def increment(key, val)\n self[key] += _floatify(val)\n end",
"title": ""
},
{
"docid": "18e4e64c8a0b5ae9ab0fc99165a3e155",
"score": "0.4535342",
"text": "def flush_buffer\r\n data = @buffer.clone\r\n clear_buffer\r\n @uploader.queue(data) \r\n end",
"title": ""
},
{
"docid": "a044d10d55c557b70c822236dd98cb32",
"score": "0.45323268",
"text": "def flush\n @swordfish_doc.append(@buffer) if @buffer\n @buffer = nil\n end",
"title": ""
},
{
"docid": "f7f09d82a086c1d6b1a4d437277674a2",
"score": "0.45287943",
"text": "def float?\n !!Float(self)\n rescue ArgumentError, TypeError\n false\n end",
"title": ""
},
{
"docid": "b5ed4422bd6860e84a8ac9f79d00c2df",
"score": "0.45199358",
"text": "def buffer_concat(txt)\n @_out_buf << txt if buffer?\n end",
"title": ""
},
{
"docid": "a3713888e4ff9bc6361a238e3ae3182f",
"score": "0.45152542",
"text": "def convertf args\n if SHOW_FFI \n MemoryPointer.new(:float, 4).put_array_of_float(0,args ) \n else\n args\n end\nend",
"title": ""
},
{
"docid": "d7fe52d632795d5b14a0b46c3633bf1e",
"score": "0.4507397",
"text": "def to_f\n case @kind\n when :float_lit, :float_exp_lit,\n :integer_lit, :integer_exp_lit,\n :single_string_lit, :double_string_lit\n @value.to_f\n else\n self.to_i.to_f\n end\n end",
"title": ""
},
{
"docid": "f208dda23237fa98e4ffa5102c000cba",
"score": "0.44979733",
"text": "def +(other)\n if other.is_a?(Value)\n lcm_div = @div.lcm(other.div)\n Value.new((@val * (lcm_div / @div)) + (other.val * (lcm_div / other.div)), lcm_div)\n elsif other.is_a?(Numeric)\n to_f + other\n else\n raise \"Unexpected argument\"\n end\n end",
"title": ""
},
{
"docid": "dd0d16782b79f4098e5f2cd35aa39817",
"score": "0.4492761",
"text": "def []=(i, x)\n\t\t\t@elements[i] = Float(x)\n\t\tend",
"title": ""
},
{
"docid": "763d280552ea66a0470a50c98131e083",
"score": "0.44893768",
"text": "def to_f\n self.class.new(@value.to_f)\n end",
"title": ""
},
{
"docid": "97ffe2bdbd7c68ebb7e488421f411f6a",
"score": "0.44818786",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\n end",
"title": ""
},
{
"docid": "1e2068b285d8577778e38b6cd8509798",
"score": "0.44771412",
"text": "def +(obj)\n case obj\n when Numeric\n self.class.new(@val + obj)\n when self.class\n self.class.new(@val + obj.val)\n else\n raise TypeError, \"#{self.class} cannot be added to #{obj.class}\"\n end\n end",
"title": ""
},
{
"docid": "7c5592cb3ca58b75c24f915f16f0fd42",
"score": "0.4473176",
"text": "def float_dec(x)\n Numerals::Format[:free, :exact_input].write(x)\nend",
"title": ""
},
{
"docid": "f318c7974e4b09e5736738a08b2ce2f2",
"score": "0.44725898",
"text": "def flush\n tmp = nil\n @buffer_semaphore.synchronize do\n tmp = @buffer.clone\n @buffer.clear\n end\n tmp\n end",
"title": ""
},
{
"docid": "535328a2dd113373e328011bbcea9d9d",
"score": "0.44649753",
"text": "def append_byte(b=nil)\n if b.class == Fixnum && !block_given?\n @j_del.java_method(:appendByte, [Java::byte.java_class]).call(::Vertx::Util::Utils.to_byte(b))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_byte(b)\"\n end",
"title": ""
},
{
"docid": "566e6166359286f89a5bceab46a00837",
"score": "0.44624475",
"text": "def append_queue\n if free_space > 0 \n free_blocks.times { \n if already_read < current_track.file.size\n buffer_block current_track\n else\n # We've finished this track, on to the next one\n load_next_track\n return\n end\n }\n else\n #puts \"Buffer full\" \n end\n end",
"title": ""
},
{
"docid": "216d9e694ad21d7a8271fe8f5597db21",
"score": "0.4452565",
"text": "def concat(data)\n @output_buffer << data\n end",
"title": ""
},
{
"docid": "5a8b30d00ebdabb94826dfd356ad3c90",
"score": "0.44494823",
"text": "def next(val)\n @q.shift if @q.count >= @size\n @q.push(val)\n @q.reduce(:+) / @q.count.to_f\n end",
"title": ""
},
{
"docid": "df7e58f20e38f6c78ef1833dc422a719",
"score": "0.44428012",
"text": "def flush\n return unless @buffer.size > 0\n @log.write_method(@buffer.slice!(0..-1).join)\n end",
"title": ""
},
{
"docid": "8bc80a7ce72579e28dfd0e5608841dea",
"score": "0.4441633",
"text": "def incrbyfloat(key, increment); end",
"title": ""
},
{
"docid": "8bc80a7ce72579e28dfd0e5608841dea",
"score": "0.4441633",
"text": "def incrbyfloat(key, increment); end",
"title": ""
},
{
"docid": "4ea6c8fd6fb0769519583d3be9086fc9",
"score": "0.44200006",
"text": "def +(d)\n case d\n when Float\n d, f = d.to_f.divmod(1)\n f = fract + f\n m, f = f.divmod(1)\n self.class.jd_fract(jd+d+m, f, @offset)\n when Integer\n new_jd(jd+d)\n else\n raise(TypeError, \"d must be a Float or Integer\")\n end\n end",
"title": ""
},
{
"docid": "bb88914a3fc6b532d046a40c7de0f673",
"score": "0.44176537",
"text": "def float(name, options={})\n param(:float, name, options)\n end",
"title": ""
},
{
"docid": "8bacd3d9d862be2eef57fa2960754aae",
"score": "0.44118538",
"text": "def append_newline\n buffer << \"\\n\"\n @current_line_length = 0\n end",
"title": ""
},
{
"docid": "691a3dc0b42344962486248b9d8c63ab",
"score": "0.44078195",
"text": "def logf(f)\n typedecl f: Float, foreign: Float\n Math.log(f)\n end",
"title": ""
},
{
"docid": "1930d2dd394e6c323331b892a2e97f5a",
"score": "0.4401935",
"text": "def get_float(pos=nil)\n if pos.class == Fixnum && !block_given?\n return @j_del.java_method(:getFloat, [Java::int.java_class]).call(pos)\n end\n raise ArgumentError, \"Invalid arguments when calling get_float(pos)\"\n end",
"title": ""
},
{
"docid": "4bca822d85e38e015c0e3d02038f6234",
"score": "0.43921587",
"text": "def to_f\n (self.v || self.d).to_f\n end",
"title": ""
},
{
"docid": "90ec21ef3c3ebd6be123bcf70135e830",
"score": "0.43836662",
"text": "def append!\n self.operation = :append\n end",
"title": ""
},
{
"docid": "26ac10247b92f23c7d0f8907782de89e",
"score": "0.43653405",
"text": "def ret_f\n result = 0.0\n func = get_func(Fiddle::TYPE_FLOAT)\n if func\n result = func.call(*@args).to_f\n end\n result\n end",
"title": ""
},
{
"docid": "6b95cd7bd2bc3e1cede773c4a31f930a",
"score": "0.4360813",
"text": "def update(value)\n update_buffer(value)\n\n self\n end",
"title": ""
},
{
"docid": "5c31ec311bb901be9d1d603e4f4892f6",
"score": "0.43555033",
"text": "def number_f=(value)\n @number_f = value\n end",
"title": ""
},
{
"docid": "f4685f02775b44a89a5be828a5004ab6",
"score": "0.43461987",
"text": "def numeric?; float?; end",
"title": ""
},
{
"docid": "b4df2b1bff83819cf4d7fd3101b168da",
"score": "0.43423736",
"text": "def on_float(ast_node, context)\n return ast_node.children[0]\n end",
"title": ""
},
{
"docid": "1baecc217d1119918400458af5ac0f1c",
"score": "0.43388528",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element # Mutates the caller \n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "ea17dd0ee54386c94564b4a83a91c39c",
"score": "0.43361735",
"text": "def << data\n buffer << data if data\n parse_loop!\n end",
"title": ""
},
{
"docid": "6d53b407b59c29023cb25c986f707949",
"score": "0.43317714",
"text": "def buffer &writes\n begin\n buffer_on!\n writes.call\n ensure\n buffer_off!\n end\n flush_buffer!\n end",
"title": ""
},
{
"docid": "9a51ffdff4092fb18cb2961ca66d81cd",
"score": "0.43259916",
"text": "def <<(chunk, last_chunk = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "9a51ffdff4092fb18cb2961ca66d81cd",
"score": "0.43259916",
"text": "def <<(chunk, last_chunk = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "9a51ffdff4092fb18cb2961ca66d81cd",
"score": "0.43259916",
"text": "def <<(chunk, last_chunk = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "9a51ffdff4092fb18cb2961ca66d81cd",
"score": "0.43259916",
"text": "def <<(chunk, last_chunk = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "d30d165ead5dbf0743d5d63dce9adf97",
"score": "0.43256134",
"text": "def encode_pair(buffer, value)\n buffer.write_varint(key).write_float(value)\n end",
"title": ""
}
] |
c6e4781703bb9474bffb52b66bb63cde
|
Returns the history of the status changes for a specific task id, or for a specific device id in that task. Returns the history of the status changes for a specific task id, or for a specific device id in that task.
|
[
{
"docid": "5194dad897ae744ddd0b7d4a0b1c07a6",
"score": "0.66803366",
"text": "def get_statuses_history_with_http_info(tid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DevicesManagementApi.get_statuses_history ...\"\n end\n # verify the required parameter 'tid' is set\n fail ArgumentError, \"Missing the required parameter 'tid' when calling DevicesManagementApi.get_statuses_history\" if tid.nil?\n # resource path\n local_var_path = \"/devicemgmt/tasks/{tid}/statuses/history\".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'did'] = opts[:'did'] if !opts[:'did'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['artikcloud_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 => 'TaskStatusesHistoryEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesManagementApi#get_statuses_history\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] |
[
{
"docid": "19c89f527250e40fb8805261fdb8eda8",
"score": "0.65547264",
"text": "def audit_history\n return [] if id.blank?\n return Audit.where( work_id: id ).order( created_at: :desc )\n end",
"title": ""
},
{
"docid": "e0139120c8dc26573f4459d7c4064dd5",
"score": "0.60994345",
"text": "def history(id)\n http.get(\"/nfse/#{id}/history\") do |response|\n respond_with_collection(response, Entities::NfseStatusTransition)\n end\n end",
"title": ""
},
{
"docid": "e143595a6c70f2d54e599c43f2125d07",
"score": "0.6015664",
"text": "def get_history(type, id)\n api_call_with_type(type, id, \"#{type}/#{id}/history\")\n end",
"title": ""
},
{
"docid": "b3565b3dc47537805b533b3bf390807f",
"score": "0.5803486",
"text": "def get_statuses_history(tid, opts = {})\n data, _status_code, _headers = get_statuses_history_with_http_info(tid, opts)\n return data\n end",
"title": ""
},
{
"docid": "9324d8231f51bc907be07ef92abdb176",
"score": "0.57004005",
"text": "def history(id_or_state = 'master', &block)\n return to_enum(:history, id_or_state) unless block_given?\n\n revision = revisions[id_or_state]\n\n while(revision)\n yield revision\n\n revision = revision.previous\n end\n end",
"title": ""
},
{
"docid": "baa72ef811985d686e8407aa8a5f1f2d",
"score": "0.5489633",
"text": "def history(task, p_begin=nil, p_end=nil)\n @db[:tasks][task].sort{|x,y| x[:start] <=> y[:start]}.collect {|p|\n Period.new(task,p[:start],p[:stop],p[:notes])\n } unless !@db[:tasks].include? task\n end",
"title": ""
},
{
"docid": "e627126ce14d2d1706f5b7ea68e8f332",
"score": "0.5478676",
"text": "def history(options={})\n param = { :uniq_id => @uniq_id }.merge options\n Storm::Base::SODServer.remote_list '/Server/history', param do |i|\n notification = Notification.new\n notification.from_hash i\n notification\n end\n end",
"title": ""
},
{
"docid": "7b7f7a84dcc4d432d3d6e7ba50d834f4",
"score": "0.54462117",
"text": "def get_call_history(app_id)\n JSON.parse((@cloudvox_api[\"/applications/\" + app_id + \"/call_detail_records.json\"].get).body)\n end",
"title": ""
},
{
"docid": "57bedb1b1cef3a499b5d1262ce582837",
"score": "0.54189646",
"text": "def history_update\n return if !saved_changes?\n\n # return if it's no update\n return if new_record?\n\n # new record also triggers update, so ignore new records\n changes = saved_changes\n history_changes_last_done&.each do |key, value|\n if changes.key?(key) && changes[key] == value\n changes.delete(key)\n end\n end\n self.history_changes_last_done = changes\n #logger.info 'updated ' + self.changes.inspect\n\n return if changes['id'] && !changes['id'][0]\n\n ignored_attributes = self.class.instance_variable_get(:@history_attributes_ignored) || []\n ignored_attributes += %i[created_at updated_at]\n\n changes.each do |key, value|\n\n next if ignored_attributes.include?(key.to_sym)\n\n # get attribute name\n attribute_name = key.to_s\n if attribute_name[-3, 3] == '_id'\n attribute_name = attribute_name[ 0, attribute_name.length - 3 ]\n end\n\n value_id = []\n value_str = [ value[0], value[1] ]\n if key.to_s[-3, 3] == '_id'\n value_id[0] = value[0]\n value_id[1] = value[1]\n\n if respond_to?(attribute_name) && send(attribute_name)\n relation_class = send(attribute_name).class\n if relation_class && value_id[0]\n relation_model = relation_class.lookup(id: value_id[0])\n if relation_model\n if relation_model['name']\n value_str[0] = relation_model['name']\n elsif relation_model.respond_to?('fullname')\n value_str[0] = relation_model.send('fullname')\n end\n end\n end\n if relation_class && value_id[1]\n relation_model = relation_class.lookup(id: value_id[1])\n if relation_model\n if relation_model['name']\n value_str[1] = relation_model['name']\n elsif relation_model.respond_to?('fullname')\n value_str[1] = relation_model.send('fullname')\n end\n end\n end\n end\n end\n data = {\n history_attribute: attribute_name,\n value_from: value_str[0].to_s,\n value_to: value_str[1].to_s,\n id_from: value_id[0],\n id_to: value_id[1],\n }\n #logger.info \"HIST NEW #{self.class.to_s}.find(#{self.id}) #{data.inspect}\"\n history_log('updated', data)\n end\n end",
"title": ""
},
{
"docid": "3ba6055e4e5d4c1c217864d4e7aa2b5a",
"score": "0.5369016",
"text": "def task_state(task_id)\n api.get_task_state(task_id)\n end",
"title": ""
},
{
"docid": "1f32324a66fca863c05d4417dc8085e3",
"score": "0.5365455",
"text": "def history\n # Should be paginatable.\n # Oh, it's belongs as a separate resource, paginateable.\n self.edits.where(state: 'applied').order(:date)\n end",
"title": ""
},
{
"docid": "be47a8d5c7eced5e93645b74a1ede2c4",
"score": "0.53203094",
"text": "def arrayOfChanges\n #we could also use Ruby/Git here, but that feels like an overkill right #now.\n gitChanges = `git diff #{@args[:taskpaper_file]} | grep '^\\+' | grep -i '\\@done'`\n return gitChanges.split(\"\\n\").collect{ |line| Task.new(line.gsub(/^\\+\\ ?/, \"\"))}\n end",
"title": ""
},
{
"docid": "2a4024c3e48d98c02f38573a6e5c5eec",
"score": "0.5318404",
"text": "def history\n @history ||= @repository.log(30, nil, path)\n end",
"title": ""
},
{
"docid": "7398d8352438effdb3990b4702665acc",
"score": "0.5257724",
"text": "def history\n @history ||= PublicEarth::Db::History.many.descriptive_changes_by_user(self.id)\n end",
"title": ""
},
{
"docid": "06c296c58376e95faa0628b699b9d6e6",
"score": "0.52463305",
"text": "def get_task_status(taskID, request_options = {})\n client.get_task_status(name, taskID, request_options)\n end",
"title": ""
},
{
"docid": "031948a68dfab23fa7ba86f0af546a30",
"score": "0.5232941",
"text": "def list_history(data)\n table = CLIHelper::ShowTable.new(self.class.table_conf, self) do\n column :VID, \"Virtual Machine ID\", :size=>4 do |d|\n d[\"OID\"]\n end\n\n column :SEQ, \"History record sequence number\", :size=>3 do |d|\n d[\"SEQ\"]\n end\n\n column :HOSTNAME, \"Host name\", :left, :size=>15 do |d|\n d[\"HOSTNAME\"]\n end\n\n column :REASON, \"VM state change reason\", :left, :size=>4 do |d|\n VirtualMachine.get_reason d[\"REASON\"]\n end\n\n column :START_TIME, \"Start time\", :size=>14 do |d|\n OpenNebulaHelper.time_to_str(d['STIME'])\n end\n\n column :END_TIME, \"End time\", :size=>14 do |d|\n OpenNebulaHelper.time_to_str(d['ETIME'])\n end\n\n column :MEMORY, \"Assigned memory\", :size=>6 do |d|\n OpenNebulaHelper.unit_to_str(d[\"VM/TEMPLATE/MEMORY\"].to_i, {}, 'M')\n end\n\n column :CPU, \"Number of CPUs\", :size=>3 do |d|\n d[\"VM/TEMPLATE/CPU\"]\n end\n\n column :NET_RX, \"Data received from the network\", :size=>6 do |d|\n # NET is measured in bytes, unit_to_str expects KBytes\n OpenNebulaHelper.unit_to_str(d[\"VM/NET_RX\"].to_i / 1024.0, {})\n end\n\n column :NET_TX, \"Data sent to the network\", :size=>6 do |d|\n # NET is measured in bytes, unit_to_str expects KBytes\n OpenNebulaHelper.unit_to_str(d[\"VM/NET_TX\"].to_i / 1024.0, {})\n end\n\n default :VID, :HOSTNAME, :REASON, :START_TIME, :END_TIME, :MEMORY, :CPU, :NET_RX, :NET_TX\n end\n\n table.show(data)\n end",
"title": ""
},
{
"docid": "60bdee45425bd5a77320bbeea30e6f54",
"score": "0.5231955",
"text": "def history\n PaperTrail::Version.where('whodunnit = (?) OR whodunnit like (?)', id.to_s, \"#{id} %\")\n end",
"title": ""
},
{
"docid": "90b9f1dd88230aedfbcdc3190b0fdaa6",
"score": "0.5215012",
"text": "def history\n @history ||= @repo.log.path(path).to_a\n end",
"title": ""
},
{
"docid": "6e28fcb0dfc5b38cacacf2160e5d5227",
"score": "0.5202029",
"text": "def history\r\n []\r\n end",
"title": ""
},
{
"docid": "adc8ea505e362bb4cae8129dec04c762",
"score": "0.5167254",
"text": "def bt_history(vtparams=AllTime, ttparams=nil)\n if ttparams\n bt_versions.vt_intersect(vtparams).tt_intersect(ttparams).order(:vtstart_at)\n else\n bt_versions.vt_intersect(vtparams).tt_forever.order(:vtstart_at)\n end\n end",
"title": ""
},
{
"docid": "f6de6e484cf0d377b57833f71ef02570",
"score": "0.51653695",
"text": "def get_history\n @request_history = Request.history_request\n end",
"title": ""
},
{
"docid": "23adfad49e779edfdfc6277be0752c67",
"score": "0.51639485",
"text": "def history\n @vcs.history\n end",
"title": ""
},
{
"docid": "c3474b8dc0fc6ac1e4e253c0e2b76bbd",
"score": "0.5162456",
"text": "def audithelp_changes( record )\n type = record.auditable_type\n changes = record.audited_changes\n\n if ( changes.blank? )\n if ( type == 'Timesheet' )\n return 'Added or removed rows, or edited hours within rows'\n else\n return 'No other details available'\n end\n end\n\n output = '<table class=\"list audit_changes\">'\n output << '<tr><th class=\"audit_changes_field\">Field</th><th class=\"audit_changes_from\">From</th><th class=\"audit_changes_to\">To</th></tr>'\n\n changes.keys.each do | key |\n cdata = changes[ key ]\n\n if ( cdata.instance_of?( Array ) )\n cfrom = to_descriptive_s( cdata[ 0 ] )\n cto = to_descriptive_s( cdata[ 1 ] )\n else\n cfrom = '–'.html_safe()\n cto = cdata.to_s()\n end\n\n # Try to get clever :-) and see if we have \"[foo_]id\" in a string. If\n # so, extract \"foo\" and see if the item can be found.\n\n array = key.split( '_' )\n\n if ( array.size > 1 )\n check = array.pop()\n\n if ( check == 'id' )\n type = array[ 0 ].capitalize\n\n if ( type == 'User' or type == 'Project' or type == 'Customer' or type == 'Task' )\n field = ( type == 'User' ) ? 'name' : 'title'\n\n begin\n const = type.constantize\n\n if ( cfrom.to_i.to_s == cfrom )\n item = const.find_by_id( cfrom )\n cfrom = \"#{ cfrom } (#{ item[ field ] })\" unless ( item.nil? )\n end\n\n if ( cto.to_i.to_s == cto )\n item = const.find_by_id( cto )\n cto = \"#{ cto } (#{ item[ field ] })\" unless ( item.nil? )\n end\n rescue\n # Do nothing - just ignore errors\n end\n end\n end\n end\n\n output << \"<tr><td>#{ h( key ) }</td><td>#{ h( cfrom ) }</td><td>#{ h( cto ) }</td></tr>\"\n end\n\n return ( output << '</table>' ).html_safe\n end",
"title": ""
},
{
"docid": "f4b66cd095d7a2f28a3cff2cfee8afd7",
"score": "0.5162449",
"text": "def to_history\n history = History.new\n values.each do |value|\n value[:time].each do |t|\n history << Command.new(value[:cmd], t.to_i)\n end\n end\n return history\n end",
"title": ""
},
{
"docid": "c9534e6cd53efd2d7db72d32d77f52fa",
"score": "0.51386094",
"text": "def tasks_info\n all_tasks = Set.new\n all_job_info = {}\n history.each_key do |cycle_index|\n tasks, job_info = tasks_info_of_snapshot(cycle_index)\n all_tasks.merge(tasks)\n all_job_info.merge!(job_info)\n end\n [all_tasks, all_job_info]\n end",
"title": ""
},
{
"docid": "5b4afc3eb0c78bf249cbbc6dde4057ee",
"score": "0.51314825",
"text": "def describe(id, version = nil)\n wf_event_id?(id)\n wf_version?(version) if version\n fragments = [id]\n fragments += ['history', version] if version\n api.get(fragments.uri_concat)\n end",
"title": ""
},
{
"docid": "a7b24305c9bf3a8a1a56c24decdc28af",
"score": "0.5128104",
"text": "def getEntityChangelog( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"get\",\"/entity/changelog\",params)\n end",
"title": ""
},
{
"docid": "cb5fa5c29f5519f70422d5a0f9a3a6b7",
"score": "0.51211214",
"text": "def history\n @step = Step.find(params[:id])\n @activities = @step.step_activities.order(\"created_at desc\").all\n end",
"title": ""
},
{
"docid": "cbcbff21e12ac08dc3c397600dd9e48d",
"score": "0.51033735",
"text": "def history_timestamps\n self.class.history.timestamps do |query|\n query.where(:id => self)\n end\n end",
"title": ""
},
{
"docid": "ba7abf1f34746579033f79999d7c8391",
"score": "0.50900906",
"text": "def one_history\n history = History.find(@id)\n history\n end",
"title": ""
},
{
"docid": "5fb29dcd192b1634fe7a70332f9c65e8",
"score": "0.50654614",
"text": "def history_trackable_changes\n send(history_trackable_options[:changes_method]).stringify_keys\n end",
"title": ""
},
{
"docid": "5e6b57afbe0f47f10ad9b7885380e86d",
"score": "0.5058628",
"text": "def history\n History\n end",
"title": ""
},
{
"docid": "1d7c71e1785cffb4ddc949a4d4188b14",
"score": "0.50583416",
"text": "def history\n transition_data = lambda do |state_transition|\n data = {}\n [ :record_id, :record_type, :to_state, :from_state, :created_at ].each do |attr|\n data[attr] = state_transition[attr]\n end\n if state_transition.user_id\n user = User.find_by(id: state_transition.user_id)\n if user\n data[:user] = {}\n [ :id, :email, :last_name, :first_name, :display_name ].each { |a| data[:user][a] = user[a] }\n end\n end\n if state_transition.record_type == 'Item'\n item = Item.find_by(id: state_transition.record_id)\n if item\n data[:item] = {}\n [ :id, :resource_title, :resource_identifier, :container ].each { |a| data[:item][a] = item[a] }\n end\n end\n return data\n end\n\n h = state_transitions.map { |st| transition_data.call(st) }\n item_transitions = StateTransition.where(record_type: 'Item', order_id: self.id)\n h += item_transitions.map { |st| transition_data.call(st) }\n h.sort! { |x,y| x[:created_at] <=> y[:created_at] }\n h\n end",
"title": ""
},
{
"docid": "e0ffa4a5ca1b8ed544fdc0450c64fb3d",
"score": "0.5056997",
"text": "def get_status_revisions status_entry\n # the printing revision in svn (svn diff -r20) are confusing, but this\n # is what it looks like:\n\n # if a file is modified,\n # if the file existed at fromrev\n # it is compared with fromrev\n # else\n # it is compared to BASE\n\n info \"status_entry.status: #{status_entry.status}\".color('#2c2cdd')\n\n action = SVNx::Action.new status_entry.status\n info \"action: #{action}\".color('#2c2cdd')\n case\n when action.added?\n info \"added\"\n [ 0, 0 ]\n when action.deleted?\n info \"deleted\"\n [ @revision.from, :working_copy ]\n when action.modified?\n info \"modified\"\n [ status_entry.status_revision, :working_copy ]\n end\n end",
"title": ""
},
{
"docid": "fea5c2122afb25b2eaf7b7b5428b42c2",
"score": "0.5055575",
"text": "def list_notify_history(project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:pattern] = '/projects/[ProjectName]/notify_history'\n\t\targs[:query]['Action'] = 'ListNotifyHistory'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :alert_name\n\t\t\targs[:query]['AlertName'] = optional[:alert_name]\n\t\tend\n\t\tif optional.key? :dimensions\n\t\t\targs[:query]['Dimensions'] = optional[:dimensions]\n\t\tend\n\t\tif optional.key? :end_time\n\t\t\targs[:query]['EndTime'] = optional[:end_time]\n\t\tend\n\t\tif optional.key? :page\n\t\t\targs[:query]['Page'] = optional[:page]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tif optional.key? :start_time\n\t\t\targs[:query]['StartTime'] = optional[:start_time]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "c8ed0f9b58646452de9addcf436ea6db",
"score": "0.50542766",
"text": "def get_history\n events = []\n # Get the first page of the workflow history\n page = get_history_page\n page[\"events\"].each { |x| events << x }\n\n # Get the remaining pages of the workflow history\n until page[\"nextPageToken\"].nil?\n page = get_history_page(page[\"nextPageToken\"])\n page[\"events\"].each { |x| events << x }\n end\n events\n end",
"title": ""
},
{
"docid": "2aac7c5599f036dd12478bf010c3b0f3",
"score": "0.50432473",
"text": "def history\n return @history\n end",
"title": ""
},
{
"docid": "2aac7c5599f036dd12478bf010c3b0f3",
"score": "0.50432473",
"text": "def history\n return @history\n end",
"title": ""
},
{
"docid": "073c088bd8ba393869eb06d3aec973e4",
"score": "0.50324625",
"text": "def get_changes(opts = {})\n data, _status_code, _headers = get_changes_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "aa7be25010bc2ac2c9ff6d1761db172e",
"score": "0.4996967",
"text": "def getHistories\n account = current_user.account\n if account.nil?\n render status: 400, json: {error: \"Invalid User\"}\n else\n devices = Device.find_all_by_user_id(current_user.id)\n device_ids = []\n devices.each do |d|\n device_ids << d.id\n end\n rewards = RewardHistory.where(:account_id => account.id)\n achievements = AchievementHistory.where(:device_id => device_ids)\n offers = OfferHistory.where(:device_id => device_ids)\n promos = PromoCodeHistory.where(:account_id => account.id)\n referrals = ReferralCodeHistory.where(:account_id => account.id)\n referrees = ReferralCodeHistory.where(:referrer_id => account.id)\n\n returnUserHistories = []\n\n rewards.each do |r|\n history = UserHistory.new\n description_string = \"\"\n if r.processed == false\n description_string = \"Pending reward\"\n else\n description_string = \"Reward redeemed!\"\n end\n history.populate(r.reward.name, description_string, \"#{r.reward.image.url}\", r.amount, r.created_at)\n returnUserHistories << history\n end\n\n achievements.each do |a|\n history = UserHistory.new\n history.populate(a.achievement.name, \"Achievement Complete!\", \"#{a.achievement.app.image.url}\", a.achievement.cost,\n a.created_at)\n returnUserHistories << history\n end\n\n offers.each do |o|\n history = UserHistory.new\n history.name = o.company\n history.description = \"Offer completed from: \" + o.company + \"!\"\n history.amount = o.amount\n history.date = o.created_at\n returnUserHistories << history\n end\n\n promos.each do |p|\n history = UserHistory.new\n history.name = \"Promotional Code\"\n history.description = \"Promotional Code #{p.promo_code.name} redeemed!\"\n history.amount = p.value\n history.date = p.created_at\n returnUserHistories << history\n end\n\n referrals.each do |r|\n history = UserHistory.new\n history.name = \"Referrer Install Bonus\"\n history.description = \"Referral code entered!\"\n history.amount = r.referree_value\n history.date = r.created_at\n returnUserHistories << history\n end\n\n referrees.each do |r|\n history = UserHistory.new\n history.name = \"Referral Bonus\"\n history.description = \"#{r.account.user.username} entered your referral code!\"\n history.amount = r.referrer_value\n history.date = r.created_at\n returnUserHistories << history\n end\n\n returnUserHistories = returnUserHistories.sort_by(&:date).reverse\n\n render status: 200, json: returnUserHistories\n end\n end",
"title": ""
},
{
"docid": "e35e2d74249f48b3a1478e6c4472fd99",
"score": "0.49948382",
"text": "def task_schedule_status(task)\n\t\tstatus = []\n\tend",
"title": ""
},
{
"docid": "3d14802ccf84aa631de098fde23a5c4f",
"score": "0.49925363",
"text": "def history\n return nil unless tracked?\n @history ||= $repo.log.path(@name)\n end",
"title": ""
},
{
"docid": "d02dad48ac2328a5c4e6f75fe961e9d6",
"score": "0.49862236",
"text": "def resource_instance_history_as_of(klass, id, last_update)\n history(resource: klass, id: id, history: { since: last_update })\n end",
"title": ""
},
{
"docid": "c5782dd035f39aced8119d28a59ed1ea",
"score": "0.49797922",
"text": "def history\n @story = Story.find(params[:id])\n @versions = @story.activity\n end",
"title": ""
},
{
"docid": "5abc4a099eec2193ffdb9701c0ace810",
"score": "0.49710596",
"text": "def history\n rest.get stats_path(:history) do |response|\n response_handler response\n end\n end",
"title": ""
},
{
"docid": "b5149189b417007f22702fd97863bfea",
"score": "0.49425265",
"text": "def get_withdrawal_history\n # body = {\n # cmd: \"get_withdrawal_history\"\n # }\n\n end",
"title": ""
},
{
"docid": "881e2e48c94d4590defe093f9b71ea70",
"score": "0.4931459",
"text": "def identity_history(identity_uuid, historical_version=nil)\n scope 'default'\n get(\"identity/#{identity_uuid}/history\" + (historical_version ? \"/#{historical_version}\" : ''))\n end",
"title": ""
},
{
"docid": "294be00578919dce5d514bd4f9181047",
"score": "0.4927879",
"text": "def account_history\n get('account/history')\n end",
"title": ""
},
{
"docid": "135a1736757d6d123b769edec9c2fc77",
"score": "0.49037793",
"text": "def history\n from = @from.to_i\n limit = @to.to_i - from\n # Excecute the find of comparations\n histories = @to ? History.offset(from).limit(limit) : History.all\n histories\n end",
"title": ""
},
{
"docid": "3bdbf9d52b7f8a81da0ebb2f56136227",
"score": "0.48657414",
"text": "def all_history\n history(history: {})\n end",
"title": ""
},
{
"docid": "907decf73e71df1934e5e2651b97ac2c",
"score": "0.4841784",
"text": "def changes\n if @changes\n @changes.dup\n else\n []\n end\n end",
"title": ""
},
{
"docid": "17cdf0d646938a3838dbdcdbd5d9d3ee",
"score": "0.48343855",
"text": "def history\n self.class.history.chronological.of(self)\n end",
"title": ""
},
{
"docid": "7222af34cf49edef47916f467a844c2a",
"score": "0.4826684",
"text": "def history\r\n\r\n end",
"title": ""
},
{
"docid": "40f734ee6b4640a654a7ca806b31c009",
"score": "0.48202118",
"text": "def changes\n poll = @watch.objects.find { |obj| obj.name == \"pollChanges\" }\n\n poll.invoke.objects.find do |object|\n object.name == \"values\"\n end.objects\n end",
"title": ""
},
{
"docid": "2844e4c11cc09e8624c8e7618a54212c",
"score": "0.48198554",
"text": "def get_service_history\n with_monitoring do\n edipi_present!\n response = perform(:post, identity_path, VAProfile::Models::ServiceHistory.in_json)\n\n ServiceHistoryResponse.from(@current_user, response)\n end\n rescue Common::Client::Errors::ClientError => e\n if e.status == 404\n log_exception_to_sentry(\n e,\n { edipi: @user.edipi },\n { va_profile: :service_history_not_found },\n :warning\n )\n\n return ServiceHistoryResponse.new(404, episodes: nil)\n elsif e.status >= 400 && e.status < 500\n return ServiceHistoryResponse.new(e.status, episodes: nil)\n end\n\n handle_error(e)\n rescue => e\n handle_error(e)\n end",
"title": ""
},
{
"docid": "83a1fc1f99097f541aeb28b855f85d1b",
"score": "0.4818733",
"text": "def history_ids(amount, before_id = nil, after_id = nil, around_id = nil)\n logs = API::Channel.messages(@bot.token, @id, amount, before_id, after_id, around_id)\n JSON.parse(logs).map { |message| message['id'].to_i }\n end",
"title": ""
},
{
"docid": "b9abcad26407311a35b48aef55afb646",
"score": "0.48183745",
"text": "def get_changes_for(changeable, opts = {})\n limit = opts.delete(:limit)\n my_id = changeable.id\n return self.send(\"find_all_by_#{self.changeable_fk}\", my_id, {:order => 'updated_at'}) unless limit\n self.send(\"find_all_by_#{self.changeable_fk}\", my_id, {:order => 'updated_at', :limit => limit})\n end",
"title": ""
},
{
"docid": "619195433557d70600f697f0595b57a7",
"score": "0.4817115",
"text": "def all_history_as_of(last_update)\n history(history: { since: last_update })\n end",
"title": ""
},
{
"docid": "f6d70948e3bb4c8a07410ce202dbdcac",
"score": "0.48158836",
"text": "def job_history\n history = []\n record = nil\n\n command('llist jobs').split(\"\\n\").each do |line|\n next unless line.index ': '\n key, value = line.split(': ', 2)\n key.strip!\n value.chomp!\n\n if key == 'JobId'\n record = { key => value }\n history << record\n elsif record\n record[key] = value\n end\n end\n\n history\n end",
"title": ""
},
{
"docid": "8d31e82542e057e17ec1585568cae1b3",
"score": "0.4812513",
"text": "def active_set_history\n ash = []\n end",
"title": ""
},
{
"docid": "86cbe6b0199c86454c9765059c9bfe99",
"score": "0.4806458",
"text": "def workflow_histories(starttime, endtime)\n histories = []\n json_data = get(url: \"#{@url}workflows/history/#{starttime}/#{endtime}\")\n json_data.each do |wf|\n # Initialize WorkflowHistory elements\n workflow_steps = []\n state_histories = []\n\n # Create a new WorkflowHistory with the details we already know\n workflow_history = Eso::Workflow::History.new(id: wf[:id],\n name: wf[:name],\n timeCreated: wf[:timeCreated],\n state: wf[:state],\n message: wf[:message],\n steps: workflow_steps,\n history: state_histories\n )\n\n # Parse the steps out of the response to be returned with the WorkflowHistory\n wf[:steps].each do |step|\n workflow_steps << Step.new(uuid: step[:uuid],\n service_name: step[:serviceName],\n workflow: workflow_history,\n type_name: step[:stepConfiguration][:typeName],\n previous_type_name: step[:stepConfiguration][:previousTypeName],\n configuration_params: step[:stepConfiguration][:configurationParams])\n end\n workflow_history.steps = workflow_steps\n\n # Parse the histories out of the response, to be returned with the WorkflowHistory. For some reason.\n # this failed with named parameters. For now I returned it to positional.\n wf[:history].each do |history|\n state_histories << Eso::Workflow::StateHistory.new(history[:message],\n history[:state],\n history[:startTime])\n end\n workflow_history.state_histories = state_histories\n\n # Add the Workflow History we just built to the list to be returned.\n histories << workflow_history\n end\n histories\n end",
"title": ""
},
{
"docid": "e55aea666349894cd730e3eac4c3710e",
"score": "0.48045015",
"text": "def changes_against(ref)\n self.class.attribute_names_for_history_changes.inject({}) do |changes, attr|\n old, new = ref.public_send(attr), self.public_send(attr)\n\n changes.tap do |c|\n changed = old.respond_to?(:history_eql?) ?\n !old.history_eql?(new) : old != new\n\n c[attr] = [old, new] if changed\n end\n end\n end",
"title": ""
},
{
"docid": "e55aea666349894cd730e3eac4c3710e",
"score": "0.48045015",
"text": "def changes_against(ref)\n self.class.attribute_names_for_history_changes.inject({}) do |changes, attr|\n old, new = ref.public_send(attr), self.public_send(attr)\n\n changes.tap do |c|\n changed = old.respond_to?(:history_eql?) ?\n !old.history_eql?(new) : old != new\n\n c[attr] = [old, new] if changed\n end\n end\n end",
"title": ""
},
{
"docid": "035e924423810d807250e9f90d64b492",
"score": "0.48038545",
"text": "def history(tag, start_time, end_time, opts = {\n limit: 1000, outsiders: 0, history_format: 0, retrieval_type: 0\n })\n parse_rest(\n rest_request(\n 'History',\n history_query_body(tag, start_time, end_time, opts)\n )\n )\n end",
"title": ""
},
{
"docid": "3cf79ba75015c953ebb9f407aeae28dd",
"score": "0.4797313",
"text": "def task_completion_status(task_id, force_update = false)\n save if task_completion_status_cache.nil? || force_update\n task_completion_status_cache[task_id]\n end",
"title": ""
},
{
"docid": "9b07ff45da021b3417ce0876d7afb187",
"score": "0.4796976",
"text": "def history\n command = AccountHistory.call(@current_user)\n if command.success?\n @history = command.result\n render 'history.json.jbuilder', status: :ok\n else\n render json: {error: command.errors}, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "c6dedc53d2a3ae7779fa32d3448c6bb5",
"score": "0.47885683",
"text": "def check_for_state_change\n\n stored_task = ModelTask.find(self.id) if self.id\n\n if stored_task \n if !stored_task.completed? && self.completed?\n self.completed_at = Time.now\n state_change = 'Task Completed'\n elsif !stored_task.closed? && self.closed?\n self.closed_at = Time.now\n state_change = 'Task Closed'\n elsif stored_task.closed? && !self.closed?\n state_change = 'Task Reopened'\n elsif stored_task.completed? && !self.completed?\n state_change = 'Task Incomplete - Needs more work/input'\n end\n\n if state_change\n self.model_comments << ModelComment.new( :user_id => self.get_user.id, \n :comment => 'STATUS CHANGE: ' + state_change)\n end\n end\n \n end",
"title": ""
},
{
"docid": "ddd20f8485f27b7c71616332e755acd0",
"score": "0.47766572",
"text": "def get_flow_history_history_id_with_http_info(flow_id, history_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ArchitectApi.get_flow_history_history_id ...\"\n end\n \n \n # verify the required parameter 'flow_id' is set\n fail ArgumentError, \"Missing the required parameter 'flow_id' when calling ArchitectApi.get_flow_history_history_id\" if flow_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'history_id' is set\n fail ArgumentError, \"Missing the required parameter 'history_id' when calling ArchitectApi.get_flow_history_history_id\" if history_id.nil?\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_by'] && !['action', 'timestamp', 'user'].include?(opts[:'sort_by'])\n fail ArgumentError, 'invalid value for \"sort_by\", must be one of action, timestamp, user'\n end\n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/flows/{flowId}/history/{historyId}\".sub('{format}','json').sub('{' + 'flowId' + '}', flow_id.to_s).sub('{' + 'historyId' + '}', history_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']\n query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']\n query_params[:'action'] = @api_client.build_collection_param(opts[:'action'], :multi) if opts[:'action']\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 Auth']\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 => 'HistoryListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ArchitectApi#get_flow_history_history_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "f5dcc349db0488ce5173c7d746692efc",
"score": "0.47766572",
"text": "def get_flow_history_history_id_with_http_info(flow_id, history_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ArchitectApi.get_flow_history_history_id ...\"\n end\n \n \n # verify the required parameter 'flow_id' is set\n fail ArgumentError, \"Missing the required parameter 'flow_id' when calling ArchitectApi.get_flow_history_history_id\" if flow_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'history_id' is set\n fail ArgumentError, \"Missing the required parameter 'history_id' when calling ArchitectApi.get_flow_history_history_id\" if history_id.nil?\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_by'] && !['action', 'timestamp', 'user'].include?(opts[:'sort_by'])\n fail ArgumentError, 'invalid value for \"sort_by\", must be one of action, timestamp, user'\n end\n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/flows/{flowId}/history/{historyId}\".sub('{format}','json').sub('{' + 'flowId' + '}', flow_id.to_s).sub('{' + 'historyId' + '}', history_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']\n query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']\n query_params[:'action'] = @api_client.build_collection_param(opts[:'action'], :multi) if opts[:'action']\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 => 'HistoryListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ArchitectApi#get_flow_history_history_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "16ab438d7e9b1ca27f04d1dd7ab2e975",
"score": "0.4766539",
"text": "def history(session_name = nil)\n query_params = session_name ? build_params(session: get_session_id(session_name)) : ''\n response = get(\"#{admin_url}/history?#{query_params}\")\n body = parse_body(response)\n\n raise body[:message] unless body.is_a?(Array)\n\n body.map do |entry|\n HistoryResponse.new(entry)\n end\n end",
"title": ""
},
{
"docid": "cf349d591e89a22a317308ffbcdf617f",
"score": "0.47622317",
"text": "def set_transaction_history\n @transaction_history = TransactionHistory.find(params[:id])\n end",
"title": ""
},
{
"docid": "03dd0229160cac69f31a495449ded684",
"score": "0.47591496",
"text": "def get_task_state(token_id)\n data = { 'id' => token_id }\n return query_api \"/task/progress?id=\" + token_id, data, \"POST\"\n end",
"title": ""
},
{
"docid": "0cbc1657c9e92cc6ece11a1644bfbc79",
"score": "0.47371748",
"text": "def get_history_from_api(api=Rosemary::API.new)\n api.get_history(type, self.id.to_i)\n end",
"title": ""
},
{
"docid": "149122a1b30b39eeeef88f26a5d9564a",
"score": "0.47335547",
"text": "def get_statuses_with_http_info(tid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DevicesManagementApi.get_statuses ...\"\n end\n # verify the required parameter 'tid' is set\n fail ArgumentError, \"Missing the required parameter 'tid' when calling DevicesManagementApi.get_statuses\" if tid.nil?\n # resource path\n local_var_path = \"/devicemgmt/tasks/{tid}/statuses\".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'dids'] = opts[:'dids'] if !opts[:'dids'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['artikcloud_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 => 'TaskStatusesEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesManagementApi#get_statuses\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b5fce3b1f2dfaaaeefbd18af2f29f15d",
"score": "0.47301248",
"text": "def delta(line_status_id_before, line_status_id_after, statuses=nil)\n return if lines <= 0\n\n statuses ||= TranscriptLineStatus.allCached\n\n # initialize stats\n changed = false\n new_lines_completed = lines_completed\n new_lines_edited = lines_edited\n new_lines_reviewing = lines_reviewing\n new_percent_completed = percent_completed\n new_percent_edited = percent_edited\n new_percent_reviewing = percent_reviewing\n\n # retrieve statuses\n before_status = statuses.find{|s| s[:id]==line_status_id_before}\n after_status = statuses.find{|s| s[:id]==line_status_id_after}\n\n # Case: initialized before, something else after, increment lines edited\n if (!before_status || before_status.name!=\"editing\") && after_status && after_status.name==\"editing\"\n new_lines_edited += 1\n changed = true\n\n # Case: edited before, not edited after\n elsif before_status && before_status.name==\"editing\" && (!after_status || after_status.name!=\"editing\")\n new_lines_edited -= 1\n changed = true\n end\n\n # Case: not completed before, completed after\n if (!before_status || before_status.name!=\"completed\") && after_status && after_status.name==\"completed\"\n new_lines_completed += 1\n changed = true\n\n # Case: completed before, not completed after\n elsif before_status && before_status.name==\"completed\" && (!after_status || after_status.name!=\"completed\")\n new_lines_completed -= 1\n changed = true\n end\n\n # Case: not reviewing before, reviewing after\n if (!before_status || before_status.name!=\"reviewing\") && after_status && after_status.name==\"reviewing\"\n new_lines_reviewing += 1\n changed = true\n\n # Case: reviewing before, not reviewing after\n elsif before_status && before_status.name==\"reviewing\" && (!after_status || after_status.name!=\"reviewing\")\n new_lines_reviewing -= 1\n changed = true\n end\n\n # Update\n if changed\n new_percent_edited = (1.0 * new_lines_edited / lines * 100).round.to_i\n new_percent_completed = (1.0 * new_lines_completed / lines * 100).round.to_i\n new_percent_reviewing = (1.0 * new_lines_reviewing / lines * 100).round.to_i\n\n update_attributes(lines_edited: new_lines_edited, lines_completed: new_lines_completed, lines_reviewing: new_lines_reviewing, percent_edited: new_percent_edited, percent_completed: new_percent_completed, percent_reviewing: new_percent_reviewing)\n end\n end",
"title": ""
},
{
"docid": "25db4f062bc156957d5190fd67513aeb",
"score": "0.47252914",
"text": "def get_status_changed_at\n return @m_status_changed_at\n end",
"title": ""
},
{
"docid": "561158fe35dde438500e0d49b241424c",
"score": "0.472513",
"text": "def sync_changes(task)\n tasks_in_sync = Task.all(:original => task.id)\n solutions_saved = ''\n \n if rebuild_cache(Kuni.find_by_id(task.kuni_id))\n if !tasks_in_sync.nil?\n tasks_in_sync.each do |task_sinc|\n task_sinc.is_done = task.in_sync ? Task.find_by_id(task.original).is_done : task.is_done\n kuni = Kuni.find_by_id(task_sinc.kuni_id)\n if task_sinc.save and rebuild_cache(kuni)\n logg(kuni,6)\n solutions_saved << ''\n else\n solutions_saved << 'f'\n end\n end\n end\n end\n solutions_saved\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.47249618",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.47249618",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.47249618",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "623f2c7d5bbd9c553c6eaaac17dcd1bc",
"score": "0.47137263",
"text": "def history_items\n return @history_items\n end",
"title": ""
},
{
"docid": "88958f9ff02419e0cd94388423f1880f",
"score": "0.47115475",
"text": "def history\n @payments = Payment.all.where(host: current_user).order(\"created_at DESC\")\n#just added, you need to show history and add a new colmn, wheter they were a host or player and show ALL history\n @payments = Payment.all.where(player: current_user).order(\"created_at DESC\")\n\n \n end",
"title": ""
},
{
"docid": "e679d2562d31c0fb30f1c415fc5a3af6",
"score": "0.47110856",
"text": "def get_task(taskid)\n params = {\n 'method' => :get,\n 'command' => \"/task/#{taskid}\"\n }\n\n response, headers = send_request(params)\n\n task = response.css('Task').first\n status = task['status']\n start_time = task['startTime']\n end_time = task['endTime']\n\n { :status => status, :start_time => start_time, :end_time => end_time, :response => response }\n end",
"title": ""
},
{
"docid": "174d40e92bbd8ca6642babb5ed4248df",
"score": "0.4706634",
"text": "def get_task(taskid)\n params = {\n 'method' => :get,\n 'command' => \"/task/#{taskid}\"\n }\n\n response, headers = send_request(params)\n\n task = response.css('Task').first\n status = task['status']\n start_time = task['startTime']\n end_time = task['endTime']\n\n { :status => status, :start_time => start_time, :end_time => end_time, :response => response }\n end",
"title": ""
},
{
"docid": "174d40e92bbd8ca6642babb5ed4248df",
"score": "0.4706634",
"text": "def get_task(taskid)\n params = {\n 'method' => :get,\n 'command' => \"/task/#{taskid}\"\n }\n\n response, headers = send_request(params)\n\n task = response.css('Task').first\n status = task['status']\n start_time = task['startTime']\n end_time = task['endTime']\n\n { :status => status, :start_time => start_time, :end_time => end_time, :response => response }\n end",
"title": ""
},
{
"docid": "00bd15c3f6c60874a10b7fb8ce264f56",
"score": "0.47035033",
"text": "def history_definitions\n return @history_definitions\n end",
"title": ""
},
{
"docid": "591e8a349c36b42cf909e28dc1e17d1e",
"score": "0.47034326",
"text": "def get_tasks_with_http_info(dtid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DevicesManagementApi.get_tasks ...\"\n end\n # verify the required parameter 'dtid' is set\n fail ArgumentError, \"Missing the required parameter 'dtid' when calling DevicesManagementApi.get_tasks\" if dtid.nil?\n # resource path\n local_var_path = \"/devicemgmt/tasks\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'dtid'] = dtid\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['artikcloud_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 => 'TaskListEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesManagementApi#get_tasks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "625590714673dbfebaeab9394fc0c78e",
"score": "0.47027624",
"text": "def get_date_for_status_change(from_status, to_status)\n selected_version = self.versions.select {|x| YAML.load(x.object_changes)[\"status\"] == [from_status, to_status] }\n !selected_version.empty? ? selected_version.last.created_at : 0\n end",
"title": ""
},
{
"docid": "d1b14daf972f835f1238a94ad2a07290",
"score": "0.46995",
"text": "def changed to, data\n if (current = self.get_status)\n current_status = ::JSON.parse(current)['status']\n return current_status if current_status != to\n to\n else\n NOCH.create_object(to, data)\n end\n end",
"title": ""
},
{
"docid": "00ad0b72ec78142176d3a5a54a59fe7f",
"score": "0.46839717",
"text": "def changes\n poll(\"Changes\")\n end",
"title": ""
},
{
"docid": "ec40ca2f425d654fbf051765c55fe7ed",
"score": "0.46805897",
"text": "def changes\n @changes ||= Set.new\n end",
"title": ""
},
{
"docid": "ec40ca2f425d654fbf051765c55fe7ed",
"score": "0.46805897",
"text": "def changes\n @changes ||= Set.new\n end",
"title": ""
},
{
"docid": "fd01760936b0bb197b9e47110790ff64",
"score": "0.4679642",
"text": "def burndown_line\n\n task_search = TaskSearch.get_search(current_user, params)\n\n #Status counts as of right now...\n @task_statuses = TaskStatus.all\n @task_statuses = @task_statuses.where(id: params[:task_status_ids]) if params[:task_status_ids]\n status_counts = task_search.search(current_user)\n status_counts = status_counts.where(task_status_id: params[:task_status_ids]) if params[:task_status_ids]\n status_counts = status_counts.group(:status_id).count\n @task_statuses.each do |task_status|\n status_counts[task_status.id] = 0 unless status_counts[task_status.id]\n end\n\n #We get all ids that correspond to this too...\n task_ids = task_search.search(current_user).select(:id).map(&:id)\n\n @start_date = params[:start_date] ? DateTime.parse(params[:start_date]) : DateTime.now - 7.days\n @end_date = params[:end_date] ? DateTime.parse(params[:end_date]) : DateTime.now\n\n #build a range of values for the graph based on the status counts for right now...\n @chart_dates = (@start_date..@end_date).map do |date|\n {\n date: date,\n values: status_counts.clone\n }\n end\n\n #Work backwards from today...\n ActivityLog.where('created_at >= ?', @start_date).where(model_type: 'Task', model_id: task_ids).each do |activity_log|\n deltas = deltas(activity_log)\n next unless deltas\n @chart_dates.each do |chart_date|\n next if chart_date[:date] >= activity_log.created_at\n values = char_date[:values]\n deltas.each do |k,v|\n values[k] -= v unless values[k].nil?\n end\n end\n end\n\n #get a min and max\n @min = 0 #min(@chart_dates)\n @max = max(@chart_dates)\n\n x_values(@chart_dates, @start_date)\n y_values(@chart_dates, @min, @max)\n\n end",
"title": ""
},
{
"docid": "f96f5af37b97a6be29c28c21db90b2f7",
"score": "0.4674578",
"text": "def history(params = {})\n params.select! { |key, _value| @api.history_config[:allowed_params].include? key }\n\n response = self.class.get(@api.history_config[:url],\n :query => { :auth_token => @token }.merge(params),\n :headers => @api.headers\n )\n\n ErrorHandler.response_code_to_exception_for :user, user_id, response\n response.body\n end",
"title": ""
},
{
"docid": "8f0ea47317e73fd889be3fef5ad3f54a",
"score": "0.46732616",
"text": "def version_history\n res = []\n event = 'create'\n author = user\n versions.each do |version|\n # some old entries still include create actions\n # TODO remove next line\n next if version.event == 'create'\n res << {\n obj: version.reify,\n event: event,\n author: author\n }\n event = version.event\n author = User.find_by_id(version.whodunnit.to_i)\n end\n res << {\n obj: self,\n event: event,\n author: author\n }\n end",
"title": ""
},
{
"docid": "f97de2eccf57e4b0015d30bafff21feb",
"score": "0.46732607",
"text": "def remote_call_for_history(entity, options = {})\n remote_call_for_action(:history, entity, options)\n end",
"title": ""
},
{
"docid": "71869cf78fe7d864ab57e563316ec161",
"score": "0.46713394",
"text": "def get_history\n data = { :ConfigItemID => self.id, 'XMLDataGet' => 1 }\n params = { :object => 'ConfigItemObjectCustom', :method => 'VersionList', :data => data }\n a = OTRS.connect(params).flatten\n b = self.class.superclass::Relation.new\n a.each do |c|\n b << self.class.object_preprocessor(c)\n end\n return b\n end",
"title": ""
},
{
"docid": "c76a38601e980b64e21850fac11e9e59",
"score": "0.46676406",
"text": "def changes(start_ref, end_ref)\n check_refs(start_ref, end_ref)\n s = Mixlib::ShellOut.new(\n \"#{@bin} diff -r #{start_ref}:#{end_ref} --summarize #{@repo_path}\")\n s.run_command.error!\n @logger.info(\"Diff between #{start_ref} and #{end_ref}\")\n s.stdout.lines.map do |line|\n m = line.match(/^(\\w)\\w?\\s+(\\S+)$/)\n fail \"Could not parse line: #{line}\" unless m\n\n {\n :status => m[1] == 'D' ? :deleted : :modified,\n :path => m[2].sub(\"#{@repo_path}/\", '')\n }\n end\n end",
"title": ""
},
{
"docid": "2fc708edc140cadcb795e0254b87de51",
"score": "0.46672451",
"text": "def all\n requires :zone\n\n data = service.list_changes(zone.identity).to_h[:changes] || []\n load(data)\n rescue ::Google::Apis::ClientError => e\n raise e unless e.status_code == 404\n []\n end",
"title": ""
},
{
"docid": "187c8043e1305adcfe7d261248e7b657",
"score": "0.46635836",
"text": "def history\n credit_lines = credits.map do |transfer|\n { date: transfer.created_at, counterparty: transfer.sender&.email, amount: transfer.amount, note: transfer.note }\n end\n debit_lines = debits.map do |transfer|\n { date: transfer.created_at, counterparty: transfer.receiver&.email, amount: -transfer.amount, note: transfer.note }\n end\n credit_lines.concat(debit_lines).sort_by { |line| line[:date] }.reverse\n end",
"title": ""
}
] |
d4c406fbdac4b002472ce3becbb70290
|
Publish a message and don't wait for a response. Is not threadsafe; you need to synchronize with the lock before calling.
|
[
{
"docid": "400b3f1d057f943753f00bfa658cf232",
"score": "0.5786685",
"text": "def publish(msg)\n #@indents ||= []\n #puts \"#{@indents.join(\"\")}#{Process.pid} publish(#{msg.inspect})\"\n msg.from(@address)\n @connections[msg.to].write(Yaram.encoder.dump(msg) + \"]]>]]>\")\n end",
"title": ""
}
] |
[
{
"docid": "28c0adcf7cc39962c5c0e3fa897579a9",
"score": "0.6794996",
"text": "def publish(message)\n @broker.publish message\n end",
"title": ""
},
{
"docid": "f0c8f0b6132be7d7a3f1e3005f1d1737",
"score": "0.6767667",
"text": "def send_request(message)\n @response_wait_list.wait_for(message).tap do\n publish_message(message)\n end\n end",
"title": ""
},
{
"docid": "fbac0581fe1b31d8be9e8d5114242616",
"score": "0.6754434",
"text": "def send_msg(msg, metadata, &on_publish)\n @amqp_lock.synchronize {\n #raise RJR::Errors::ConnectionError.new(\"client unreachable\") if @disconnected\n routing_key = metadata[:routing_key]\n reply_to = metadata[:reply_to]\n @exchange.publish msg,\n :routing_key => routing_key,\n :reply_to => reply_to do |*cargs|\n on_publish.call unless on_publish.nil?\n end\n }\n nil\n end",
"title": ""
},
{
"docid": "87824b4b65d17367835854410034e8f6",
"score": "0.67337537",
"text": "def publish( message )\n @client.set( @name, message ) # do not expire the message\n end",
"title": ""
},
{
"docid": "0f8cd8e591c7f3a0c27096e897517a8f",
"score": "0.6594967",
"text": "def publish(message)\n @queue.publish(message.to_json, presistent: true)\n end",
"title": ""
},
{
"docid": "3b7b28d3d08654d7ded380abfe1bf3ec",
"score": "0.6580501",
"text": "def sender_publishes_msg; sender.publish({ :ok => 1 }, {}) end",
"title": ""
},
{
"docid": "a9fbba017dd3bfc3faac16fa5406d583",
"score": "0.65530264",
"text": "def publish(msg)\n logger.debug \"Sending msg: #{msg.to_s}\"\n logger.debug \"To client: #{@client.id}\" if @client\n send_data(msg.to_s + CR)\n end",
"title": ""
},
{
"docid": "bb2e7e1382017046d18582794eca63c3",
"score": "0.654493",
"text": "def publish(exchange_name, message, headers = {})\n EM::Synchrony.sync(apublish(exchange_name, message, headers))\n end",
"title": ""
},
{
"docid": "6d83014587e003bdaa98d3b90f682f2a",
"score": "0.65229917",
"text": "def publish message\n raise NotImplementedError.new\n end",
"title": ""
},
{
"docid": "f1e44302187f66e947a513e75284ef72",
"score": "0.6517359",
"text": "def broadcast(msg, options = {})\n # Threadsafe publish\n @mutex.synchronize do\n error_retry_count = 0\n begin\n # Channel verification\n ensure_channel!\n\n # Check for targeted exchange, otherwise use the default\n exchange = options[:exchange] ? channel.exchange(options[:exchange], options[:exchange_options]) : channel.default_exchange\n\n # Establish route\n to_queue = options.delete(:to_queue)\n options[:routing_key] ||= to_queue\n\n # Log the message being published with some context\n ::SNT::Core::MQ.logger.info \"SNT::Publisher#publish on tid #{Thread.current.object_id} <#{msg}>\" \\\n \" to [#{exchange.name}, #{options[:routing_key]}]\"\n\n times = 0\n while times <= 3 do\n # Publish to RabbitMQ\n exchange.publish(msg, options)\n\n # Block until message is confirmed. If it fails, retry up to 3 times.\n break if channel.wait_for_confirms\n\n times += 1\n\n channel.nacked_set.each do |n|\n ::SNT::Core::MQ.logger.error \"publishing message with id #{n} to #{options[:routing_key]} was nacked by broker time(s) #{times}\"\n end\n end\n # Catching RuntimeError to handle below exception been thrown from bunny create_channel method\n # \"RuntimeError: this connection is not open. Was Bunny::Session#start invoked? Is automatic recovery enabled?\"\n rescue ::Bunny::Exception, ::Timeout::Error, ::RuntimeError => e\n error_retry_count += 1\n connection_closed_error_handler(e, error_retry_count)\n retry\n end\n end\n\n # Void the return\n nil\n end",
"title": ""
},
{
"docid": "93352c57b50640a2203bf0536c2fb003",
"score": "0.6496307",
"text": "def publish!\n PubSubModelSync::MessagePublisher.publish!(self)\n end",
"title": ""
},
{
"docid": "e7a4aced8b0c9a54d0423504cfdea4e9",
"score": "0.648683",
"text": "def publish( message )\n @topic.publish( message )\n end",
"title": ""
},
{
"docid": "26577f1912aa921585f280b2243aad26",
"score": "0.6463517",
"text": "def publish_message(message)\n message.from ||= @listener\n @publish_socket.send_message(message)\n end",
"title": ""
},
{
"docid": "95da10227f2977c95ae7d66b7d7f5c53",
"score": "0.6429536",
"text": "def publish\n PubSubModelSync::MessagePublisher.publish(self)\n end",
"title": ""
},
{
"docid": "c04ac1b895eacdd99facc9fc4c04c116",
"score": "0.64104426",
"text": "def publish\n\t\t\tAggregator.message_publish( self )\n\t\tend",
"title": ""
},
{
"docid": "133484cf9004f798905e749888013f1b",
"score": "0.6407609",
"text": "def publish!(msg, options = {})\n if defined?(::OpenTracing) && ::OpenTracing.current_trace_object\n msg = JSON.parse(msg).merge(headers: ::OpenTracing.current_trace_object).to_json\n end\n broadcast(msg, options)\n\n # We must rescue all exceptions, so an issue with queuing system does not degrade the rest of the app\n rescue ::StandardError => e\n ::SNT::Core::MQ.logger.error \"#{e.class}: #{e.message}\\n#{e.backtrace.join(\"\\n\")}\"\n raise ::SNT::Core::MQ::ConnectionError, \"#{e.class}: #{e.message}\\n#{e.backtrace.join(\"\\n\")}\"\n end",
"title": ""
},
{
"docid": "9ff3d9dbaec7a9c36fc9a429e5f19306",
"score": "0.6402551",
"text": "def publish(channel, message); end",
"title": ""
},
{
"docid": "9ff3d9dbaec7a9c36fc9a429e5f19306",
"score": "0.6402551",
"text": "def publish(channel, message); end",
"title": ""
},
{
"docid": "f547dc32d78f67dea034fdae3e0ad07d",
"score": "0.63840616",
"text": "def publish_message\n # Publish message to pub/sub and attach created\n # message to publisher\n self.message = PubSubClient.publish(\n topic(*msg_args),\n payload(*msg_args),\n metadata(*msg_args)\n )\n end",
"title": ""
},
{
"docid": "d8b6288fd4a9d232b5dd4221785a8bed",
"score": "0.6374471",
"text": "def republish(msg, &k)\n guard_public(k)\n raise 'Only messages from a work queue can be republished' unless msg.work_queue_name\n raise 'A message can only be republished by the mercury instance that received it' unless msg.mercury_instance == self\n raise \"This message was already #{msg.action_taken}ed\" if msg.action_taken\n headers = Mercury.increment_republish_count(msg).merge(ORIGINAL_TAG_HEADER => msg.tag)\n publish_internal(@channel.default_exchange, msg.content, msg.work_queue_name, headers) do\n msg.ack\n k.call\n end\n end",
"title": ""
},
{
"docid": "357a9dfcb762cd34a903f0c31fe21488",
"score": "0.6362041",
"text": "def send_message_expecting_response\n message = RabbitRPC::Message.new('User.create')\n sync_connection.stub(:wait_for_response?).and_return(false)\n sync_connection.publish! message\n end",
"title": ""
},
{
"docid": "9a3b2cfc964ac2d7430ad72d0a297308",
"score": "0.6337538",
"text": "def publish(msg, opts = {})\n # Duplicate @publish_opts because `Bunny::Exchange#publish` method uses\n # delete to get values\n exchange.publish(msg, @publish_opts.merge(opts))\n Lynr.metrics.add(\"queue.publish:#{name}\" => 1)\n self.disconnect\n end",
"title": ""
},
{
"docid": "e896738de6cbfc82268350936bc61f12",
"score": "0.6321181",
"text": "def publish(msg, options = {})\n if defined?(::OpenTracing) && ::OpenTracing.current_trace_object\n msg = JSON.parse(msg).merge(headers: ::OpenTracing.current_trace_object).to_json\n end\n broadcast(msg, options)\n\n true\n # We must rescue all exceptions, so an issue with queuing system does not degrade the rest of the app\n rescue ::StandardError => e\n ::SNT::Core::MQ.logger.error \"#{e.class}: #{e.message}\\n#{e.backtrace.join(\"\\n\")}\"\n\n false\n end",
"title": ""
},
{
"docid": "a4fb2436d196d0caa705f34a9e4161ed",
"score": "0.63128394",
"text": "def publish( message )\n @client.set( @name, message )\n end",
"title": ""
},
{
"docid": "7cf5a28e329a14e3b9fa01ed801c9e01",
"score": "0.63014513",
"text": "def _process_PUBLISHED(msg)\n\n # Remove the pending publish and alert the callback\n p = self._requests[:publish].delete(msg.publish_request)\n if p\n\n details = {}\n details[:topic] = p[:t]\n details[:type] = 'publish'\n details[:publication] = msg.publication\n details[:session] = self\n\n c = p[:c]\n c.call(p, nil, details) if c\n end\n\n end",
"title": ""
},
{
"docid": "1f41486541677e6dc99861ceb58d0cc9",
"score": "0.62794554",
"text": "def publish( message )\n subscribers.each do |name, sub|\n sub.produce( message )\n end\n end",
"title": ""
},
{
"docid": "52cc7c20273ea4a8224c66aefa81622e",
"score": "0.62682104",
"text": "def publish(channel, message)\n synchronize do\n id = call(:publish, channel, message)\n id && id.to_i\n end\n end",
"title": ""
},
{
"docid": "6066fae551558b2b737606fb585c3095",
"score": "0.62665164",
"text": "def publish(event)\n if @is_synchronous\n dispatch_event(event)\n return\n end\n\n @queue_mutex.synchronize do\n @event_queue << event\n end\n end",
"title": ""
},
{
"docid": "3c3b7cf2ea2c670def76c8f22139116f",
"score": "0.6252113",
"text": "def publish(channel, data, options = {})\n ::WebSocket::Driver.validate_options(options, [:attempts, :deadline])\n\n publication = Publication.new\n connect {\n info('Client ? queueing published message to ?: ?', @dispatcher.client_id, channel, data)\n\n send_message({\n 'channel' => channel,\n 'data' => data,\n 'clientId' => @dispatcher.client_id\n\n }, options) do |response|\n if response['successful']\n publication.set_deferred_status(:succeeded)\n else\n publication.set_deferred_status(:failed, Error.parse(response['error']))\n end\n end\n }\n publication\n end",
"title": ""
},
{
"docid": "8f145b1e84401430bae0161455440e06",
"score": "0.621161",
"text": "def publish message, &block\n @app.request(\"publish?channel=direct:#{@id}\").post(message.to_s, &block)\n end",
"title": ""
},
{
"docid": "93d031da749068569495c25114845d40",
"score": "0.6205398",
"text": "def publish( message )\n @subscribers.values.each do |subscriber|\n subscriber.produce message\n end\n end",
"title": ""
},
{
"docid": "b8cfa4c08c5c23c5ee947118f6b22728",
"score": "0.6203319",
"text": "def publish(message, options)\n Jackhammer.client_middleware.call(message, Jackhammer.publish_options(options)) do |msg, opts|\n topic.publish msg, opts\n end\n end",
"title": ""
},
{
"docid": "548d72ec043e6f714615dc9c16b9dd7f",
"score": "0.6195092",
"text": "def publish(channel, data)\n connect {\n validate_channels([channel])\n \n enqueue({\n 'channel' => channel,\n 'data' => data,\n 'clientId' => @client_id\n })\n \n return if @timeout\n \n @timeout = add_timer(Connection::MAX_DELAY) do\n @timeout = nil\n flush!\n end\n }\n end",
"title": ""
},
{
"docid": "8917c91c2cbb6f8cbaa3800bce0c4196",
"score": "0.61855847",
"text": "def publish(event, message)\n adapter.publish(event, message)\n end",
"title": ""
},
{
"docid": "6a5f46b69bbdf4ac6db63b82f84e9cb9",
"score": "0.6144004",
"text": "def publish(*message)\n message.each do |m|\n @message_queue.push m\n end\n end",
"title": ""
},
{
"docid": "ebfb6861714b1a33726946d7a15d45a0",
"score": "0.6142091",
"text": "def publish(message, options = {})\n wait_for_destination(options[:startup_timeout]) do\n with_session(options) do |session|\n session.publish self, message, normalize_options(options)\n end\n end\n end",
"title": ""
},
{
"docid": "9df9aca89f5a0be886a3121532f57b67",
"score": "0.61077344",
"text": "def republish\n # This variable is needed to avoid triggering a double publish when republishing\n @republishing = true\n add_to_publisher_queue(publish_message('republish'))\n end",
"title": ""
},
{
"docid": "3ee5fda76e4e15b3a56e35e927589606",
"score": "0.6102431",
"text": "def publish\n # Format and publish message\n resp = execute_middleware_chain\n\n # Log job completion and return result\n logger.info(\"Published message in #{publishing_duration}s\") { { duration: publishing_duration } }\n resp\n rescue StandardError => e\n logger.info(\"Publishing failed after #{publishing_duration}s\") { { duration: publishing_duration } }\n raise(e)\n end",
"title": ""
},
{
"docid": "4846d66d0711704a437f9cc796718edb",
"score": "0.6091839",
"text": "def send_message(msg)\n @semaphore.synchronize {\n @sp.print(msg)\n @sp.flush()\n }\n end",
"title": ""
},
{
"docid": "c2edcadb83dde317d87325eb33bc5e6a",
"score": "0.6090607",
"text": "def publishing_activity\n loop do\n @queue.flush { |data| @publisher.post data } if @queue.count >= Config.get[:min_buffer_size]\n sleep Config.get[:publish_interval_ms] / 1000\n end\n end",
"title": ""
},
{
"docid": "847b6af0032851a5e38e2365cefe6581",
"score": "0.60873795",
"text": "def publish(message)\n validate!(message)\n\n publish_config = conf['publish']\n @exchange.publish(message.to_json, **publish_config)\n end",
"title": ""
},
{
"docid": "f74bd6c7ee0f4f64401e87e03e6db50d",
"score": "0.60813403",
"text": "def publish(channel_name, message)\n MessageBusTasks.publish(channel_name, message)\n end",
"title": ""
},
{
"docid": "c5ceec9b5d289123b233306066e5c572",
"score": "0.6078695",
"text": "def publish(channel_name, message)\n raise \"Not implemented\"\n end",
"title": ""
},
{
"docid": "83fd33c76e7869e943eaf40558713c64",
"score": "0.6074851",
"text": "def publish; pubsub.publish(self); end",
"title": ""
},
{
"docid": "d34e287ced2a2b9c14b4a049abb6a3c2",
"score": "0.60716355",
"text": "def publish_message(user, message)\n queue = @channel.queue(\"\")\n data = JSON.generate(user: user, message: message)\n @exchange.publish(data)\n end",
"title": ""
},
{
"docid": "ce32ce8b26d801b23e62236170ed472b",
"score": "0.6068968",
"text": "def apublish(exchange_name, message, headers = {})\n deferrable = EM::DefaultDeferrable.new\n with_fanout_exchange(exchange_name) do |exchange|\n exchange.publish(MultiJson.encode(message), :headers => headers) do\n deferrable.set_deferred_status :succeeded\n end\n end\n deferrable\n end",
"title": ""
},
{
"docid": "21bca5ce03bafa70b7164a55686a4db7",
"score": "0.6063018",
"text": "def publish(message, destination, opts = {}, code=nil, &blk)\n if @multi_process\n if block_given?\n GLogger.error \"Publish callback not supported in forked responder. Ignoring!\"\n end\n call_parent_backend_method('publish', message, destination, opts, code)\n# method = opts[:method] || 'publish'\n# msg = JSON.generate([method, [message, destination, opts, code]])\n# @write_command_pipe.write(msg+\"\\n\")\n# @write_command_pipe.flush\n elsif block_given?\n @backend.publish(message, destination, opts, &blk)\n else\n @backend.publish(message, destination, opts)\n end\n end",
"title": ""
},
{
"docid": "f2f4e38c03b594f0540ce71986d482c1",
"score": "0.60515124",
"text": "def retry_publish!\n PubSubModelSync::MessagePublisher.connector_publish(self)\n end",
"title": ""
},
{
"docid": "55582d60a2d85f6c1345ac299f767999",
"score": "0.60501754",
"text": "def publish_and_receive(message, options={})\n result = nil\n with_session do |session|\n result = session.publish_and_receive(self, message,\n normalize_options(options))\n end\n result\n end",
"title": ""
},
{
"docid": "b164d7c701fcfe919d67ada60986fb71",
"score": "0.6019546",
"text": "def write(*message)\n if(connection.alive?)\n if(message.size > 1)\n debug 'Multiple message publish'\n connection.transmit(\n Command::Mpub.new(\n :topic_name => topic,\n :messages => message\n )\n )\n else\n debug 'Single message publish'\n connection.transmit(\n Command::Pub.new(\n :message => message.first,\n :topic_name => topic\n )\n )\n end\n else\n abort Error.new 'Remote connection is unavailable!'\n end\n end",
"title": ""
},
{
"docid": "1364d7a84611a5ed147dba33489ad754",
"score": "0.5999443",
"text": "def publish(message)\n log log_name, :publish, message\n\n @broker.publish :results, message.to_json\n end",
"title": ""
},
{
"docid": "b17eba285c48c75a3aec96b132ff3576",
"score": "0.59773636",
"text": "def produce(message)\n # We pre-validate the message payload, so topic is ensured to be present\n @topics[message.fetch(:topic)] << message\n @messages << message\n SyncResponse.new\n end",
"title": ""
},
{
"docid": "76ed369292e63e1f37b60f0ded80f315",
"score": "0.59704804",
"text": "def publish(message, xchg_name, opts = {})\n with_channel do |channel|\n xchg = channel.fanout xchg_name, durable: true\n xchg.publish message.to_json, opts\n end\n end",
"title": ""
},
{
"docid": "22518c18fe3b846ad90853e566d3015a",
"score": "0.5964399",
"text": "def publish(stream, message)\n @publisher.publish(stream, message)\n end",
"title": ""
},
{
"docid": "bd814150c58e804b7b646f6d9497c89d",
"score": "0.5961313",
"text": "def publish_msg(socket, msg)\n data = write_msg(socket, msg)\n @last_published_msg = msg\n # for getBusStats\n @byte_sent += data.length\n @num_sent += 1\n end",
"title": ""
},
{
"docid": "04b4f29e664d6805517880fb8b22179e",
"score": "0.59596354",
"text": "def publish_msg(msg)\n raise TypeError, \"nats: expected NATS::Msg, got #{msg.class.name}\" unless msg.is_a?(Msg)\n raise NATS::IO::BadSubject if !msg.subject or msg.subject.empty?\n\n msg.reply ||= ''\n msg.data ||= ''\n msg_size = msg.data.bytesize\n\n # Accounting\n @stats[:out_msgs] += 1\n @stats[:out_bytes] += msg_size\n\n if msg.header\n hdr = ''\n hdr << NATS_HDR_LINE\n msg.header.each do |k, v|\n hdr << \"#{k}: #{v}#{CR_LF}\"\n end\n hdr << CR_LF\n hdr_len = hdr.bytesize\n total_size = msg_size + hdr_len\n send_command(\"HPUB #{msg.subject} #{msg.reply} #{hdr_len} #{total_size}\\r\\n#{hdr}#{msg.data}\\r\\n\")\n else\n send_command(\"PUB #{msg.subject} #{msg.reply} #{msg_size}\\r\\n#{msg.data}\\r\\n\")\n end\n\n @flush_queue << :pub if @flush_queue.empty?\n end",
"title": ""
},
{
"docid": "9e54668fd27d719dc2551b932ddb0f23",
"score": "0.5951291",
"text": "def publish(event, message, props: {})\n if options[:publisher][:session_pool]\n session_pool.with { |session| session.publish(event, message, props) }\n else\n session.publish(event, message, props)\n end\n disconnect unless options[:publisher][:persistent]\n end",
"title": ""
},
{
"docid": "2f8a47efb88d4ac0e81b90beeb5fe0de",
"score": "0.5943732",
"text": "def publish msg\n rc = Samwise.samwise_publish @sam, msg.pub_t\n rc == 0? true: false\n end",
"title": ""
},
{
"docid": "c224a3508091e4965c3db37f628c4526",
"score": "0.5942051",
"text": "def publish(msg)\n m = msg.is_a?(Message) ? msg : Message.new(msg)\n super(m.to(@outbox.address))\n end",
"title": ""
},
{
"docid": "7dd562391ae281b574dbc14c74b20ef0",
"score": "0.59366196",
"text": "def publish(topic, message, host, &block)\n pubsub.publish(topic, message, prefix_host(host), &callback_logging(__method__, topic, message.operation, &block))\n end",
"title": ""
},
{
"docid": "cc19269878155f4942cda8cad90bb0a8",
"score": "0.5926997",
"text": "def publish(topic, message, &block)\n raise StandardError, \"Invalid message\" unless message.valid?\n\n new_block = proc do |stanza|\n published_messages << OpenSSL::Digest::SHA1.new(message.to_s)\n block.call(stanza) if block\n end\n\n pubsub.publish(topic, message, default_host, &callback_logging(__method__, topic, &new_block))\n MPPublished.inject(Time.now.to_f, jid, topic, message.to_s.gsub(\"\\n\",'')) if OmfCommon::Measure.enabled?\n end",
"title": ""
},
{
"docid": "c96bef75431979d67798bdef9ceb98b5",
"score": "0.59258735",
"text": "def publish(msg, options = {})\n topic = ensure_valid_publish_topic(options)\n begin\n connect\n @exchange.publish(msg, DEFAULT_PUBLISH_OPTIONS.merge(:key => topic))\n retmsg = @bunny.returned_message\n raise \"Invalid return payload: #{retmsg[:payload]}\" unless retmsg[:payload] == :no_return\n true\n rescue Exception => e\n Marconi.log(e)\n if Marconi.backup_queue_class && !options[:recovering]\n Marconi.backup_queue_class.create!(:exchange_name => exchange_name,\n :topic => topic,\n :body => msg)\n end\n false\n end\n end",
"title": ""
},
{
"docid": "e575f3bc9eb362d2dc16d97205d2b9ed",
"score": "0.5920741",
"text": "def publish(payload, opts={}, &blk)\n if @reply_queue_completion\n @reply_queue_completion.completion do |reply_queue|\n message_id = random\n logger.verbose { \"message_id: #{message_id}\" }\n\n #### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ####\n #### TODO if there is a timeout delete ####\n #### the proc from the @reply_container. ####\n #### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ####\n @reply_container[message_id] = {:reply_proc => @reply_proc, :timeout => @timeout.clone.tap {|t| t.set_timeout(message_id) }}\n _publish(payload, @options.publish(opts, {:reply_to => reply_queue.queue_name, :message_id => message_id}), &blk)\n end\n else\n _publish(payload, @options.publish(opts), &blk)\n end\n end",
"title": ""
},
{
"docid": "422fa7f5c55d32da3f3f6c327ef3db57",
"score": "0.59192765",
"text": "def publish_message(user, message)\n data = JSON.generate(user: user, message: message)\n @exchange.publish(data)\n end",
"title": ""
},
{
"docid": "307dd4f4890d250e120d74a7981058a7",
"score": "0.59182066",
"text": "def publish(message, priority = nil)\n @channel.open unless @channel.open?\n @queue.publish(message, opts_with_priority(priority))\n end",
"title": ""
},
{
"docid": "5cbb27e0aebf6324bb280a0467d94f31",
"score": "0.59175575",
"text": "def publish(message)\n\t\t\tresponse = _publish({:content => message}.to_json)\n\t\t\traise \"Error publishing a message: (#{response.status}) #{response.body}\" if response.status != 201\n\t\t\tJSON.parse(response.body)\n\t\tend",
"title": ""
},
{
"docid": "1127087f6b7e7f513d7277cbb8f3dbab",
"score": "0.5914726",
"text": "def publish(topic, message, pubsub_host = default_host, &block)\n raise StandardError, \"Invalid message\" unless message.valid?\n\n message = message.marshall[1] unless message.kind_of? String\n if message.nil?\n debug \"Cannot publish empty message, using authentication and not providing a proper cert?\"\n return nil\n end\n\n new_block = proc do |stanza|\n published_messages << OpenSSL::Digest::SHA1.new(message.to_s)\n block.call(stanza) if block\n end\n\n pubsub.publish(topic, message, pubsub_host, &callback_logging(__method__, topic, &new_block))\n OmfCommon::DSL::Xmpp::MPPublished.inject(Time.now.to_f, jid, topic, message.to_s[/mid=\"(.{36})/, 1]) if OmfCommon::Measure.enabled?\n end",
"title": ""
},
{
"docid": "26148f1910eda6ae8db7cdbb544999eb",
"score": "0.5908609",
"text": "def publish_message(options)\n Queue.publish(self, options)\n end",
"title": ""
},
{
"docid": "37fd2ffc5270f0f384184ad99e041cc4",
"score": "0.5906992",
"text": "def publish_and_receive(destination, message, options = {})\n options[:timeout] ||= 10000 # 10s\n decode = options.fetch(:decode, false)\n options[:properties] ||= {}\n options[:properties][\"synchronous\"] = \"true\"\n wrapped_message = { :timeout => options[:timeout], :message => message }\n jms_message = publish(destination, wrapped_message, options)\n commit if transacted?\n\n options[:selector] = \"JMSCorrelationID='#{jms_message.jms_message_id}'\"\n response = receive(destination, options)\n commit if transacted?\n\n if response\n decode ? response.decode : response\n end\n end",
"title": ""
},
{
"docid": "be50d59598600faa9995ea1de0d28b94",
"score": "0.5899802",
"text": "def reply_with(msg = {})\n yield(msg) if block_given?\n\n props = {\n routing_key: reply_to,\n correlation_id: correlation_id,\n timestamp: Time.now.to_i\n }\n\n self.queue.exchange.publish(\n msg.to_json,\n props\n )\n end",
"title": ""
},
{
"docid": "9175b693b6422d1c2dbf7b6825c2af54",
"score": "0.58933246",
"text": "def publish(channel, message, options = {})\n end",
"title": ""
},
{
"docid": "12af3d2898d7c3c06b265332488d51c9",
"score": "0.5875348",
"text": "def push msg\n put_in_queue :push, msg\n end",
"title": ""
},
{
"docid": "70564e32b75eb49968e3794227b8a61b",
"score": "0.58638656",
"text": "def push(message)\n @lock.synchronize do\n @messages << message\n unless @waiting.empty? # Notify waiting senders\n # NOTE: the call to self.send_to is added to the sender's work_queue,\n # and will be executed in the sender's thread\n @waiting.each { |s| s.work_queue.add { self.send_to(s); } }\n @waiting.clear\n end\n end\n end",
"title": ""
},
{
"docid": "e821882972dcadfee669161c693ed233",
"score": "0.58619976",
"text": "def process!\n publisher = PubSubModelSync::MessageProcessor.new(self)\n publisher.process!\n end",
"title": ""
},
{
"docid": "446ea34a1d376663e70ad9b303e2e27d",
"score": "0.58604467",
"text": "def produce( message )\n @queue.produce( message )\n end",
"title": ""
},
{
"docid": "593d712bf3d14de6a2cd4f4cb653059f",
"score": "0.5852712",
"text": "def <<(message)\n @mutex.lock\n begin\n target = next_subscriber\n send_message(target, message) if target\n ensure\n @mutex.unlock rescue nil\n end\n end",
"title": ""
},
{
"docid": "84986194048b417c07fdacd61dcddf56",
"score": "0.5851719",
"text": "def <<(message)\n # make non-blocking ? \n remote_pump.deliver(message) \n end",
"title": ""
},
{
"docid": "592eadb7b91ac3afc79298cee858e142",
"score": "0.5841097",
"text": "def publish(destination, message, headers = {})\n headers = headers.symbolize_keys\n raise Stomp::Error::DestinationRequired unless destination\n if block_given?\n headers = headers.merge(:receipt => register_receipt_listener(lambda {|r| yield r}))\n end\n @connection.publish(destination, message, headers)\n end",
"title": ""
},
{
"docid": "e5af8c8c2ccaa56d27d34c192b70f0b3",
"score": "0.58380705",
"text": "def publish\n raise 'Event already published' if published\n\n begin\n ::SNT::Core::MQ.publisher.publish(event_data.to_json, exchange: 'pms.actions', exchange_options: { type: :direct, durable: true },\n routing_key: action_type.to_s.downcase)\n\n self.published = true\n rescue => e\n logger.error \"Could not publish service event to RabbitMQ: #{e.message}\"\n logger.error e.backtrace\n end\n end",
"title": ""
},
{
"docid": "54aedeab7bb94cdda6bffa43a3a6a032",
"score": "0.5829173",
"text": "def publish\n set_publish_state(Event::PUBLISHED_STATE)\n end",
"title": ""
},
{
"docid": "4a3fc0d3fce770f2f0f2f081cb04307b",
"score": "0.5817757",
"text": "def publish(*args, &blk)\n (@client ||= connect).publish(*args, &blk)\n end",
"title": ""
},
{
"docid": "b60dcffec0000b6a3a90c7939073638d",
"score": "0.58118415",
"text": "def publish_message(user, message)\n # Create ordered data to be easily processed\n data = JSON.generate({ user: user, message: message })\n # Publish message to the exchange channel\n @exchange.publish(data)\n end",
"title": ""
},
{
"docid": "851ff50b3adccaf16b8f3a547fff2ded",
"score": "0.58115786",
"text": "def publish_to_pubsub_async(model, action)\n publish(model, action, true)\n end",
"title": ""
},
{
"docid": "909d766e923cf77d1e5c1d460349d1c6",
"score": "0.5807446",
"text": "def publish_message(action)\n return if ENV['RACK_ENV'] == 'test' || ENV['RAILS_ENV'] == 'test'\n publish_to_pubsub(self, action)\n end",
"title": ""
},
{
"docid": "7adf4c3df9f09a81ed9e643d8a7032d6",
"score": "0.5787703",
"text": "def publish(msg)\n EM.run do\n # connect to the amqp server\n connection = AMQP.connect(:host => 'localhost', :logging => false)\n \n # open a channel on the AMQP connection\n channel = MQ.new(connection)\n\n # declare a queue on the channel\n queue = MQ::Queue.new(channel, 'exceptions')\n\n # create a fanout exchange\n exchange = MQ::Exchange.new(channel, :fanout, 'all queues')\n\n # bind the queue to the exchange\n queue.bind(exchange)\n\n # publish a message to the exchange\n exchange.publish(msg.to_s)\n \n connection.close{ EM.stop_event_loop }\n end\n end",
"title": ""
},
{
"docid": "3e3bc78ee029317e472b54daac762bc3",
"score": "0.5784356",
"text": "def publish(topic, message, &block)\n raise StandardError, \"Invalid message\" unless message.valid?\n\n message = message.xml unless message.kind_of? String\n\n new_block = proc do |stanza|\n published_messages << OpenSSL::Digest::SHA1.new(message.to_s)\n block.call(stanza) if block\n end\n\n pubsub.publish(topic, message, default_host, &callback_logging(__method__, topic, &new_block))\n MPPublished.inject(Time.now.to_f, jid, topic, message.to_s.gsub(\"\\n\",'')) if OmfCommon::Measure.enabled?\n end",
"title": ""
},
{
"docid": "14463a6798a460bc52324f0fa81a417b",
"score": "0.57811314",
"text": "def publish_socialq(msg)\n @socialq.publish(msg)\n @dumpq.publish(msg) if @dumpq\n end",
"title": ""
},
{
"docid": "23efbb19bb8649a18e156c7a2381cfd0",
"score": "0.5778899",
"text": "def publish(channel_name, message)\n @redis.publish(channel_name.to_sym, message)\n end",
"title": ""
},
{
"docid": "fcf05991e3ad065993cea2a45a5b76cf",
"score": "0.5778152",
"text": "def publish channel, message\n raise ArgumentError, \"Message must respond to `to_h`\" unless message.respond_to? :to_h\n @client.publish channel, message\n end",
"title": ""
},
{
"docid": "983857bef2df4652c7d058f6b81e1866",
"score": "0.5777295",
"text": "def publish(msg, no_publish: false, attributes: [], merge: {})\n payload = {\n t: Time.now,\n msg: msg,\n pub_id: publish_id\n }\n\n [*attributes].reduce(payload) { |acc, cur| acc[cur] = self[cur]; acc }\n\n payload.merge!(merge) if merge\n\n if self.class.instance_variable_defined? :@redis_websocket_bridge_callbacks\n # if any of the callbacks return falsey, halt the chain\n continue_chain = self.class.instance_variable_get(:@redis_websocket_bridge_callbacks).all? do |callback|\n !!callback.call(self, payload)\n end\n\n return unless continue_chain\n end\n\n unless no_publish\n redis_channel = \"rwb://#{payload[:pub_id]}\"\n Publishable.get_redis.publish(redis_channel, payload.to_json)\n end\n\n payload\n end",
"title": ""
},
{
"docid": "9798ad416d3e45c54e3672f7894dfbe3",
"score": "0.5775216",
"text": "def publish(channel, data)\n send_action('publish', channel, data)\n end",
"title": ""
},
{
"docid": "686bf3226cae073267e40f13b87fcd98",
"score": "0.5767724",
"text": "def publish(options)\n\t\traise 'NoChannelProvided' unless options[:channel]\n\t\traise 'NoMessageProvided' unless options[:message]\n\t\tmessaging_client.publish(options[:channel], options[:message])\n\tend",
"title": ""
},
{
"docid": "5a0234f7ea4620c0cdde3d081733b66e",
"score": "0.5756626",
"text": "def publish(message, message_id:, **opts)\n super(message, opts.merge(message_id: message_id, routing_key: queue.name))\n end",
"title": ""
},
{
"docid": "fdbfa14823bc47859b3365934e255182",
"score": "0.57525",
"text": "def synchronize(&block)\n @publishing_mutex.synchronize(&block)\n end",
"title": ""
},
{
"docid": "055245daae71143c37d36fe319f77b40",
"score": "0.5749934",
"text": "def publish(message = {})\n Hightops::Publisher.new(worker_class: self).publish(default_event_tag, message)\n end",
"title": ""
},
{
"docid": "df274c15dd46d93f73a6815c97590d89",
"score": "0.57484776",
"text": "def publish(options={})\n\t\traise 'No Channel Provided' if !options[:channel]\n\t\traise 'No Message Provided' if !options[:message]\n\t\tself.messaging_server.get_client.publish(options[:channel], options[:message])\n\tend",
"title": ""
},
{
"docid": "2a28bbc5117a6c50452f120d03469c7a",
"score": "0.5741263",
"text": "def process\n publisher = PubSubModelSync::MessageProcessor.new(self)\n publisher.process\n end",
"title": ""
},
{
"docid": "77ccf0de556bd83379a16cb88bc172cd",
"score": "0.5741012",
"text": "def receive(msg)\n # Receiving a published message!\n end",
"title": ""
},
{
"docid": "1cc2383373612e790c5f0c32708d74d2",
"score": "0.5740118",
"text": "def publish_thread\n Thread.new do\n loop { publish_next }\n end\n end",
"title": ""
},
{
"docid": "34038c1d0ff225983604d1e42a713d99",
"score": "0.5722731",
"text": "def publish message = nil, attributes = {}\n ensure_connection!\n batch = Batch.new message, attributes\n yield batch if block_given?\n return nil if batch.messages.count.zero?\n publish_batch_messages batch\n rescue Gcloud::Pubsub::NotFoundError => e\n retry if lazily_create_topic!\n raise e\n end",
"title": ""
}
] |
9000627eded68bfce93b661d910486b8
|
create jekyll post file
|
[
{
"docid": "46389560a376e211743fd88068602d72",
"score": "0.6516329",
"text": "def build_file(filepath, title, link, timestamp)\n File.open(filepath, 'w') do |f|\n f << \"---\\n\"\n f << \"layout: post\\n\"\n f << \"title: \\\"#{title}\\\"\\n\"\n f << \"date: #{timestamp || Time.now.strftime('%Y-%m-%d')}\\n\"\n f << \"tags: ['New-Post', 'Tag']\\n\"\n f << \"---\\n\"\n f << \"\\n\"\n f << \"[see more details](#{link})\\n\\n#{DEFAULT_TEXT}\\n\"\n end\n puts \"Created: #{filepath}\"\nend",
"title": ""
}
] |
[
{
"docid": "0384dd894b3ee7df787ea9c51d81106d",
"score": "0.7570096",
"text": "def create_new_post(params) \n post_title = params['post']['title']\n post_date = (Time.now).strftime(\"%Y-%m-%d\")\n\n content = yaml_data(post_title).to_yaml + \"---\\n\" + params[:post][:content]\n post_file = (post_date + \" \" + post_title).to_url + '.md'\n file = File.join(jekyll_site.source, *%w[_posts], post_file)\n File.open(file, 'w') { |file| file.write(content)}\n post_file\n end",
"title": ""
},
{
"docid": "07e88c70a4792bdc834745a389517cbd",
"score": "0.7453136",
"text": "def jekyll_post(post_file)\n Jekyll::Post.new(jekyll_site, jekyll_site.source, '', post_file)\n end",
"title": ""
},
{
"docid": "de0d4c8f3d721a2eba28883241b4366c",
"score": "0.73678434",
"text": "def create\n \n slug = escape(params[:headers][:title])\n timestamp = Date.strptime(params[:date], \"%d/%m/%Y\").strftime(\"%Y-%m-%d\")\n filepath = File.join(Jadmin::Application.config.jekyll_folder, '_posts', \"#{timestamp}-#{slug}.markdown\")\n \n unless File.exists? filepath\n File.open(filepath, 'w') do |file|\n file.puts \"---\"\n params[:headers].each do |key, value|\n file.puts \"#{key}: #{value}\"\n end\n file.puts \"---\"\n file.puts params[:content]\n end\n \n g = Git.open(Jadmin::Application.config.jekyll_folder)\n g.add(\"/_posts/#{timestamp}-#{slug}.markdown\")\n g.commit(\"Add '#{slug}' post\")\n g.pull\n g.push\n end\n\n respond_to do |format|\n format.html { redirect_to(\"/posts/#{timestamp}-#{slug}/edit\", :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n end\n end",
"title": ""
},
{
"docid": "eb1584d698d7ded698dbb3f0d25156a3",
"score": "0.7324827",
"text": "def new_post()\n title = \"\"\n date = DateTime.now\n puts \"enter a title for the post\"\n title = STDIN.gets.chomp\n uri = '_posts/' + date.strftime('%Y-%m-%d') + '-' + title.gsub(/[^A-Za-z0-9]/, '_') + '.markdown'\n File.open(uri, 'w') do |post|\n post.write(post_template(title, date))\n end\n return uri\n end",
"title": ""
},
{
"docid": "74d67d665a76475168f783b6c5b67f40",
"score": "0.71824294",
"text": "def post(file)\n metadata = self.meta(file)\n \n f = File.new \"#{@dir}/_posts/#{metadata['date'].to_s}-#{file_name_to_page_name file}.html\", 'w+'\n f.puts YAML.dump metadata\n f.close\n end",
"title": ""
},
{
"docid": "ec78b3f72cc200f581e2780f8853dd53",
"score": "0.7108629",
"text": "def create_posts (cached_docs, posts_dir)\n cached_docs.each do |old_name, contents|\n new_name = postify(old_name)\n puts \"write '#{posts_dir}/#{new_name}'\"\n file = File.new(\"#{posts_dir}/#{new_name}\", \"w\")\n file << add_front_matter(contents)\n file.close()\n end\nend",
"title": ""
},
{
"docid": "8c1b3422cb3d2fde0f05d12f3f2242d9",
"score": "0.7092371",
"text": "def new_post(p,title)\n ext=File.extname(p)[1..-1]\n if ! (Data::Post.supported_ext_names.include? ext)\n ext=Data::Post.supported_ext_names[0]\n end\n\n name=File.basename p,File.extname(p)\n name=\"#{Date.today}-#{name}\" unless Data::Post::DATE_NAME_RE=~name\n name= \"#{name}.#{ext}\"\n\n if p['/']\n path=File.join @posts_path,(File.dirname p)\n FileUtils.mkdir_p path\n else\n path=@posts_path\n end\n path=\"#{path}/#{name}\"\n File.open(path,'wb') do |f|\n f.write \"---\\ntitle: #{title}\\n---\\n\\n#{title}\"\n end\n path\n end",
"title": ""
},
{
"docid": "c0423c534d5fe7f199d3d2127a1b6b10",
"score": "0.70505095",
"text": "def make_post(dir)\n puts \"make a post for #{dir} at #{Time.now}\"\n\n # Load\n config = YAML.load_file(\"#{dir}/config.yaml\")\n internal = YAML.load_file(\"#{dir}/internal.yaml\")\n once = YAML.load_file(\"#{dir}/once.yaml\")\n once_used = YAML.load_file(\"#{dir}/once-used.yaml\")\n posts = YAML.load_file(\"#{dir}/posts.yaml\")\n format = File.read(\"#{dir}/format.md\")\n\n # find an appropriate post, if available\n post = pop_appropriate_post(once, internal[\"counter\"])\n if post # if we found one, move it to posts/once-used, as appropriate\n post[\"last-used-on\"] = Time.now.to_s\n if posts[\"again\"] # if we're using it again, just put it back where we found it\n once.push post\n else\n # clear out the settings\n post.delete(\"before-date\")\n post.delete(\"after-date\")\n post.delete(\"on-counter\")\n if post[\"keep\"] # onward to posts.yaml\n posts.push post\n posts.delete(\"keep\")\n File.open(\"#{dir}/posts.yaml\", \"w\") { |f| f.write posts.to_yaml }\n else #onward to once-used.yaml\n poasts.delete(\"keep\")\n once_used.push post\n File.open(\"#{dir}/once-used.yaml\", \"w\") { |f| f.write once_used.to_yaml }\n end\n end\n File.open(\"#{dir}/once.yaml\", \"w\") { |f| f.write once.to_yaml }\n else # if we didn't find one, grab one from posts\n if posts.empty?\n post = {\"variables\"=> {}}\n else\n # take the first element and move it to the end, save the change\n post = posts.shift\n post[\"last-used-on\"] = Time.now.to_s\n posts.push post\n File.open(\"#{dir}/posts.yaml\", \"w\") { |f| f.write posts.to_yaml }\n end\n end\n\n # generate variables\n tagline = \"\"\n tagline = \" - \" + post[\"variables\"][\"tagline\"] if post[\"variables\"][\"tagline\"]\n variables = config[\"variables\"].merge(post[\"variables\"]).merge(internal)\n variables[\"tagline\"] = tagline\n variables[\"today\"] = DateTime.now.strftime(\"%Y-%m-%d\")\n\n #symbolize the hash\n variables = variables.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}\n title = config[\"title\"] % variables\n text = format % variables\n\n # increment internal counter and save\n internal[\"counter\"] += 1;\n File.open(\"#{dir}/internal.yaml\", \"w\") { |f| f.write internal.to_yaml }\n\n connect_and_post(@access_conf, title, text, config[\"flair\"], config[\"daily\"])\n\n # save the changes to the git\n `git pull`\n `git add /threads*`\n `git commit -m \"Post updates\"`\n `git push`\n\n # reschedule\n @scheduler.in( ((2 * config[\"time-variance\"].to_i + 10).to_s + 'm'), overlap: false )do\n register_dir(dir)\n end\nrescue\n connect_and_error(@access_conf, \"Error posting from #{dir}. Waiting at console.\")\n binding.pry\nend",
"title": ""
},
{
"docid": "3bdb296761825d61746943de5b481030",
"score": "0.699057",
"text": "def new_post spec, title\n title = title.gsub(/[\\n\\t]+/, '').strip\n\n today = DateTime.now\n\n titleslug = title.gsub(/[^_\\w\\s]/, '').strip.gsub(/\\s+/, '_').downcase\n timeslug = today.strftime '%Y-%m-%d'\n\n file = \"#{spec.sources_root}#{timeslug}_#{titleslug}.md\"\n\n head = <<HEADSTR\ntitle: #{title}\ntime: #{today.strftime '%Y-%m-%d %H:%M:%S %z'}\n----\n\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor\nincididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis\nnostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu\nfugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in\nculpa qui officia deserunt mollit anim id est laborum.\nHEADSTR\n\n IO.write file, head\n\n return file\nend",
"title": ""
},
{
"docid": "f9bb89ce72e0a69af94c748a219ed278",
"score": "0.6858669",
"text": "def publish_post record\n # Git Repo and commit variables\n client = Octokit::Client.new(:access_token => \"3d07581ff92626f9ccea67ecb00c9f1e6266cd90\")\n repo = \"jekyllpub/jekyllpub.github.io\"\n message = \"Commit #{record.title}\"\n # Define post variables\n # Define post content for creation\n content = format_post date: now,\n author: record.author.capitalize,\n excerpt: record.excerpt,\n thumbnail: \"/assets/img/posts/#{record.thumbnail_file_name}\",\n category: record.category,\n layout: record.layout,\n body: record.content,\n video: record.video,\n published: record.published?\n post_path = \"/_posts/#{today}-#{hyphenize(record.title).downcase}.markdown\"\n # Define image variables\n image_path = \"/assets/img/posts/#{record.thumbnail_file_name}\"\n image = File.open(\"#{record.thumbnail.path(:medium)}\",\"r\").read\n # Create post using Octokit.rb\n client.create_contents repo, post_path, message, content\n # Create Image using Octokit.rb\n client.create_contents repo, image_path, message, image\n end",
"title": ""
},
{
"docid": "cb44cff4ca4d75333ce987e9c910af4f",
"score": "0.6771251",
"text": "def write_post(post, use_markdown, add_highlights)\n content = post[:content]\n return unless content\n\n if use_markdown\n content = html_to_markdown content\n if add_highlights\n tumblr_url = URI.parse(post[:slug]).path\n redirect_dir = tumblr_url.sub(%r!\\/!, \"\") + \"/\"\n FileUtils.mkdir_p redirect_dir\n content = add_syntax_highlights(content, redirect_dir)\n end\n end\n\n File.open(\"_posts/tumblr/#{post[:name]}\", \"w\") do |f|\n f.puts post[:header].to_yaml + \"---\\n\" + content\n end\n end",
"title": ""
},
{
"docid": "b6e3a0969ba56e377be254330d60d59a",
"score": "0.6629988",
"text": "def push_content\n temp_dir = File.join(\"templates\")\n\n # Create the post directory if it doesn't exist\n destination = File.join(@config[:site][:root], @config[:site][:posts])\n Dir.mkdir(destination) if !Dir.exists?(destination)\n\n # Render and save each post to the post directory\n template = Template.new(temp_dir, 'post.html')\n @posts.each do |post|\n post_file = File.join(destination, post[:id])\n File.open(post_file, 'w') do |f|\n f.print(template.render(post))\n end\n end\n\n # Create the page directory if it doesn't exist\n destination = File.join(@config[:site][:root], @config[:site][:pages])\n Dir.mkdir(destination) if !Dir.exists?(destination)\n\n # Render and save each page to the page directory\n template = Template.new(temp_dir, 'page.html')\n @pages.each do |page|\n page_file = File.join(destination, page[:id])\n File.open(page_file, 'w') do |f|\n f.print(template.render(page))\n end\n end\n\n end",
"title": ""
},
{
"docid": "97911f3504f73645f0002c1401488df5",
"score": "0.66092557",
"text": "def generate(site)\n site_srcroot = Pathname.new site.source\n posts_src_dir = site_srcroot + \"_posts\"\n drafts_src_dir = site_srcroot + \"_drafts\"\n\n # Jekyll.logger.warn(\"[PostFiles]\", \"_posts: #{posts_src_dir}\")\n # Jekyll.logger.warn(\"[PostFiles]\", \"docs: #{site.posts.docs.map(&:path)}\")\n\n docs_with_dirs = site.posts.docs\n .reject do |doc|\n Pathname.new(doc.path).dirname.instance_eval do |dirname|\n [posts_src_dir, drafts_src_dir].reduce(false) do |acc, dir|\n acc || dirname.eql?(dir)\n end\n end\n end\n\n # Jekyll.logger.warn(\"[PostFiles]\", \"postdirs: #{docs_with_dirs.map{|doc| Pathname.new(doc.path).dirname}}\")\n\n assets = docs_with_dirs.map do |doc|\n dest_dir = Pathname.new(doc.destination(\"\")).dirname\n Pathname.new(doc.path).dirname.instance_eval do |postdir|\n Dir[postdir + \"**/*\"]\n .reject { |fname| fname =~ FIXED_DATE_FILENAME_MATCHER }\n .reject { |fname| File.directory? fname }\n .map do |fname|\n asset_abspath = Pathname.new fname\n srcroot_to_asset = asset_abspath.relative_path_from(site_srcroot)\n srcroot_to_assetdir = srcroot_to_asset.dirname\n asset_basename = srcroot_to_asset.basename\n\n assetdir_abs = site_srcroot + srcroot_to_assetdir\n postdir_to_assetdir = assetdir_abs.relative_path_from(postdir)\n PostFile.new(site, site_srcroot, srcroot_to_assetdir.to_path, asset_basename, (dest_dir + postdir_to_assetdir).to_path)\n end\n end\n end.flatten\n\n site.static_files.concat(assets)\n end",
"title": ""
},
{
"docid": "4ab3bfe410bbec9cf1b5c53e4de1ba5f",
"score": "0.66091764",
"text": "def generate(site)\n site.posts.docs.each do |post|\n copy_post_files(post)\n end\n end",
"title": ""
},
{
"docid": "4ab3bfe410bbec9cf1b5c53e4de1ba5f",
"score": "0.66091764",
"text": "def generate(site)\n site.posts.docs.each do |post|\n copy_post_files(post)\n end\n end",
"title": ""
},
{
"docid": "a197b4fa579790733726f10c70d928e3",
"score": "0.6588844",
"text": "def write_file(path, content = \"---\\n---\\n\\n# test\")\n path = in_source_dir(path)\n delete_file path\n FileUtils.mkdir_p File.dirname(path)\n File.write path, content\n JekyllAdmin.site.process\n path\nend",
"title": ""
},
{
"docid": "574f5a0189290da223725535f4a4b011",
"score": "0.6560146",
"text": "def post_create(dirPost)\n\n abort(\"rake aborted: '#{CONFIG[dirPost]}' directory not found.\") unless FileTest.directory?(CONFIG[dirPost])\n\n begin\n\n enter_parameters(\"Post header creation\", \"title\", \"category\", true)\n\n title = @value1\n category = @value2\n\n slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\\w-]/, '')\n begin\n date_hour = (ENV['date'] ? Time.parse(ENV['date']) : Time.now).strftime('%Y-%m-%d %R:%S')\n date = (ENV['date'] ? Time.parse(ENV['date']) : Time.now).strftime('%Y-%m-%d')\n rescue => e\n puts \"✖ Error - date format must be YYYY-MM-DD, please check you typed it correctly!\".red\n exit -1\n end\n filepath = File.join(\"#{date}-#{slug}.#{CONFIG['markdown_ext']}\")\n filename = File.join(CONFIG[dirPost], \"#{date}-#{slug}.#{CONFIG['markdown_ext']}\")\n\n if File.exist?(filename)\n abort(\"rake aborted!\") if ask(\"#{filename} already exists. Do you want to overwrite?\", ['y', 'n']) == 'n'\n end\n\n puts \"⚠ Creating new file in: #{filename}\".yellow\n\n if dirPost == 'postsDirBlog'\n create_header_post(filename, title, date_hour, category)\n end\n\n rescue Interrupt => e\n puts\n puts \"⚠ Operation aborted!\".yellow\n end\n\n end",
"title": ""
},
{
"docid": "3970f86ea9bab0e60e2782bce9658c35",
"score": "0.6530446",
"text": "def jekyll\n\tfile_name_map = prepare_jekyll\n\tcreate_help_script(file_name_map)\n\trun_jekyll\nend",
"title": ""
},
{
"docid": "8c1dc97d5c997222b8cb13653cc318d3",
"score": "0.65277684",
"text": "def publish_draft(params) \n post_title = params['post']['title']\n post_date = (Time.now).strftime(\"%Y-%m-%d\")\n\n content = yaml_data(post_title).to_yaml + \"---\\n\" + params[:post][:content]\n post_file = (post_date + \" \" + post_title).to_url + '.md'\n file = File.join(jekyll_site.source, *%w[_drafts], post_file)\n File.open(file, 'w') { |file| file.write(content)}\n post_file\n end",
"title": ""
},
{
"docid": "a36c6b926d37246c714630128f998761",
"score": "0.65178174",
"text": "def get_jekyll_filename(input_file)\n # find dates \n # dates: use yaml front-matter, if it exists\n date=nil\n slug=nil\n layout=nil\n additional_copy_to=nil # \n is_a_post=true # true=post, false=page\n \n # page_or_post_path=JEKYLL_POST_DIR #by default, goes to \"_posts\"\n filename_prefix=\"\"\n\n date = $front_matter[\"date\"]\n # slug= front_matter[\"permalink\"] #currently, this is ignored.\n # title= front_matter[\"title\"] \n layout = $front_matter[\"layout\"] #used to determine if page or post\n\n\n basename=File.basename(input_file,\".*\").downcase.gsub(BLOG_TAG,\"\").strip\n basename.gsub!(\" \",\"-\") #replace filename's space with dash to match URL\n\n dd_if layout, \"layout found: #{layout}\"\n\n if layout && layout.downcase == \"page\" # this txt is page, not post\n dd \"##### PAGE #########\"\n # page_or_post_path=JEKYLL_PAGE_DIR \n is_a_post=false\n filename=File.join($jekyll_path,JEKYLL_PAGE_DIR,\"#{basename}.md\")\n else\n dd \"##### POST #########\"\n # choose the first match\n existing_filename=Dir[File.join($jekyll_path,JEKYLL_POST_DIR,\"*#{basename}.md\")][0]\n if existing_filename \n # found a matching filename.\n filename=existing_filename\n date_str=\"\"\n else\n # no matching file, thus need to generate filename using date of article\n # dates: use file creation date as last resort\n date=File.mtime(input_file) unless date\n begin \n date_str = date.strftime(\"%Y-%m-%d\").to_s\n rescue\n puts \"ERROR in Date format in front-matter: #{input_file}\"\n end\n filename=File.join($jekyll_path,JEKYLL_POST_DIR,\"#{date_str}-#{basename}.md\")\n end\n end\n # dd \"filename\", filename\n filename\nend",
"title": ""
},
{
"docid": "52d55649e11d6fca742d7f0618a83902",
"score": "0.6492638",
"text": "def template\n<<-FILE\n---\nlayout: post\ntitle: {{{title}}}\nexcerpt: ''\ndate: {{{datetime}}}\nmodified: {{{datetime}}}\ntags: []\ncomments: false\nshare: false\nauthor: LeFnord\n---\nFILE\nend",
"title": ""
},
{
"docid": "beac1af383d8097b5922bf87b115a753",
"score": "0.6477052",
"text": "def generate(site)\n #site.posts << SoundCloudPost.new(site, site.source, dir, name, title)\n end",
"title": ""
},
{
"docid": "2f9221e3f5c9fbd033111689429ebbd4",
"score": "0.64766145",
"text": "def create_post(filename, title)\n if File.exist?(filename)\n abort(\"post with title still exists\")\n end\n\n puts \"* Creating a new post: #{filename}\"\n open(filename, 'w') do |post|\n post.puts \"---\"\n post.puts \"layout: post\"\n post.puts \"title: #{title}\"\n post.puts \"date: #{Time.now.strftime('%Y-%m-%d')}\"\n post.puts \"category: \"\n post.puts \"tags: [,]\"\n post.puts \"---\"\n end\nend",
"title": ""
},
{
"docid": "c16494ae86090ebeb65247d92ed1123e",
"score": "0.6417383",
"text": "def convert_for_web(post_name)\n post_name.match(/^(\\d+)(_.+)$/)\n scriptogram_post = \"#{ POSTS_PATH }/#{ post_name }.md\"\n post_ru = File.join('articles', post_name, \"ru#{ $2 }.md\")\n post_en = File.join('articles', post_name, 'en', \"en#{ $2 }.md\")\n\n FileUtils.cp(post_ru, scriptogram_post)\n\n title_ru = File.open(post_ru) { |f| f.readline.chomp }\n title_en = File.open(post_en) { |f| f.readline }\n\n scriptogram_header =<<-TEXT\n---\nDate: #{ $1 }\nTitle: #{ title_ru }\nSlug: #{ $1 }-#{ urlify title_en }\n---\n\n TEXT\n\n File.open(scriptogram_post, 'w') do |sp|\n code = false\n sp.puts scriptogram_header\n File.foreach(post_ru).to_a[3..-1].each do |ru|\n if ru =~ /^```/\n code = code ? false : true\n elsif code\n sp.puts ' ' + ru\n else\n sp.puts ru\n end\n end\n end\n end",
"title": ""
},
{
"docid": "316bd72f682d17c270c5dafb521e2df2",
"score": "0.64157057",
"text": "def publish_content(source_path, destination_path)\n\n image_filetypes = ['.jpg','.png','.gif','.svg']\n markdown_filetypes = ['.md','.markdown']\n\n if image_filetypes.include? File.extname(source_path)\n\n destination_path = File.join destination_path, File.dirname(source_path)\n FileUtils.cp source_path, destination_path\n\n elsif markdown_filetypes.include? File.extname(source_path)\n\n destination_path = File.join destination_path, File.dirname(source_path)\n\n markdown_filename = File.basename( source_path, File.extname(source_path) )\n markdown_file = ''\n\n File.open(source_path, 'r').each { |line| markdown_file << line }\n\n yaml_content = YAML.load( markdown_file.match(/\\A(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m).to_s ) # RegEx by Derek Worthen (Middleman implementation)\n html_content = Nokogiri::HTML.parse( Kramdown::Document.new(markdown_file.lines.to_a[0..-1].join, :auto_id_prefix => \"toc-\", :coderay_css => :class, :coderay_line_numbers => nil, :coderay_wrap => nil).to_html )\n\n anchors = []\n\n html_content.css('h1, h2, h3, h4, h5, h6').each do |heading|\n next unless heading.attribute('id')\n anchors.push({ 'tag' => heading.name, 'text' => heading.text, 'anchor' => heading.attribute('id').value })\n end\n\n json_content = {\n :body => html_content.css('body').inner_html,\n :slug => markdown_filename,\n :anchors => anchors\n }\n\n json_content.merge( yaml_content ) if yaml_content\n\n File.open(destination_path + '/' + markdown_filename + '.html', 'w') do |file|\n file.write html_content.css('body').inner_html\n file.close\n end\n\n File.open(destination_path + '/' + markdown_filename + '.json', 'w') do |file|\n file.write Hash[json_content.to_a.reverse].to_json\n file.close\n end\n\n end\nend",
"title": ""
},
{
"docid": "8fd5c20f4e65ab8503c94e9afb9bcc12",
"score": "0.63764113",
"text": "def transform_and_save(target_directory)\n chapter_date = @post_date\n @book.chapters.each do |chapter|\n post = Octopress.front_matter\n post.sub!('##LAYOUT##', @post_layout)\n post.sub!('##POST_TITLE##', chapter.title)\n post.sub!('##DATE##', chapter_date.strftime(\"%Y-%m-%d %H:%M\"))\n post.sub!('##COMMENTS##', @comments.to_s)\n \n content = PubdownProcessor.transform_pubdown_octo(chapter.content)\n content.each_line do |line|\n line.rstrip!\n if '' == line\n post << \"\\n\"\n next\n end\n\n if line[0] == \"\\t\"\n # Line begins with tab\n line.lstrip!\n line_new = '<p>' + line + '</p>'\n else\n line_new = '<br/><p>' + line + '</p>'\n end\n post << \"#{line_new}\\n\"\n end\n \n post_filename = octopressify_filename(chapter.title, chapter_date)\n \n post_path = File.join(target_directory, post_filename)\n f = File.new(post_path, 'w')\n f.write(post)\n f.close\n \n if @reverse_chronological\n chapter_date = chapter_date - 60 # Subtract 60 seconds (1 Minute) from the post date\n else\n chapter_date = chapter_date + 60 # Add 60 seconds (1 Minute) to each post date\n end\n end\n \n end",
"title": ""
},
{
"docid": "897985b7e4fef261bba400d08ec5a975",
"score": "0.635879",
"text": "def generate(site)\n site.posts.each do |post|\n base = post.instance_variable_get(:@base)\n name = post.instance_variable_get(:@name)\n post.data.merge!({\n 'dir_name' => '_posts',\n 'file_name' => name, \n 'full_path' => File.join(base, name),\n })\n end\n site.pages.each do |page|\n base = page.instance_variable_get(:@base)\n dir = page.instance_variable_get(:@dir)\n name = page.instance_variable_get(:@name)\n page.data.merge!({\n 'dir_name' => dir,\n 'file_name' => name, \n 'full_path' => File.join(base, dir, name)})\n end\n end",
"title": ""
},
{
"docid": "2f6fc9e62beaf78777706ece0fb0ad29",
"score": "0.6350833",
"text": "def prepare_file file\n\treturn \"\" if file == \"topics.yml\"\n\tfile_lines = File.readlines(DOC_DIR + \"/\" + file)\n\tnew_file_name = \"\"\n\tresulting_file_name = \"\"\n\tnew_file_content = \"\"\n\treturn if file_lines.empty? || !file_lines[0].start_with?(\"#\")\n\ttitle = file_lines[0].chomp.slice(1..-1)\n\tfile_content = file_lines.join\n\tif file == \"index.md\"\n\t\tresulting_file_name = \"index.html\"\n\t\tnew_file_name = BASE_DIR + \"/index.md\"\n\t\tnew_file_content = \"---\nlayout: page \ntitle: #{title}\n---\n\n#{file_content}\"\n\telsif file.include? \"-\"\n\t\tcategory = file.split(\"-\")[-1].split(\".\")[0]\n\t\torder = 0\n\t\tif category.include? \":\"\n\t\t\tarr = category.split \":\"\n\t\t\tcategory = arr[0]\n\t\t\torder = arr[1].to_i\n\t\tend\n\t\tresulting_file_name = \"#{category}/#{file.sub(/[^.]+\\z/, \"html\")}\"\n\t\tnew_file_name = \"#{POSTS_DIR}/#{DATE_STR}-#{file}\"\n\t\tnew_file_content = \"---\nlayout: default\ntitle: #{title}\ndate: #{DATE_STR_W_TIME}\ncategory: #{category}\norder: #{order}\n---\n\n#{file_content}\"\n\tend\n\tif !new_file_content.empty? && !new_file_name.empty?\n\t\tputs \"Create file '#{File.basename(new_file_name)}...'\"\n\t\tFile.open(new_file_name, \"w\") do |f|\n\t\t\tf.write new_file_content\n\t\tend\n\t\treturn resulting_file_name\n\tend\n\treturn \"\"\nend",
"title": ""
},
{
"docid": "426bdb193113e34d44b5db7f4199496c",
"score": "0.6314598",
"text": "def generate(site)\n site.posts.each do |post|\n post.data['path'] = post.name\n end\n \n end",
"title": ""
},
{
"docid": "4309b531fb04a925bc6faef65977d545",
"score": "0.630501",
"text": "def generate(site)\n site.posts.docs.each do |post|\n post.data['path'] = \"#{site.config['blog_index_dir']}#{post.data['slug']}\"\n end\n\n end",
"title": ""
},
{
"docid": "f568b6121f8855c757226d7c177cec74",
"score": "0.62873644",
"text": "def update\n slug = escape(params[:headers][:title])\n timestamp = Date.strptime(params[:date], \"%d/%m/%Y\").strftime(\"%Y-%m-%d\")\n filepath = File.join(Jadmin::Application.config.jekyll_folder, '_posts', \"#{timestamp}-#{slug}.markdown\")\n \n if File.exists? filepath\n File.open(filepath, 'w') do |file|\n file.puts \"---\"\n params[:headers].each do |key, value|\n file.puts \"#{key}: #{value}\"\n end\n file.puts \"---\"\n file.puts params[:content]\n end\n \n g = Git.open(Jadmin::Application.config.jekyll_folder)\n g.add(\"/_posts/#{timestamp}-#{slug}.markdown\")\n g.commit(\"Update '#{slug}' post\")\n g.pull\n g.push\n end\n\n respond_to do |format|\n format.html { redirect_to(\"/posts/#{timestamp}-#{slug}/edit\", :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n end\n end",
"title": ""
},
{
"docid": "10016635683982f86e6cf657acfb1d76",
"score": "0.6277282",
"text": "def post_filename\n \"en/news/_posts/#{post_date_string}-#{post_title}.md\"\n end",
"title": ""
},
{
"docid": "94351135caadaff28fa628eda0196b65",
"score": "0.6271876",
"text": "def create_markdown(file)\r\n\t\t\tfilename = file.split(\"/\").last.gsub(\".md\", \".html\")\r\n\t\t\tfilepath = File.join(basedir, site, filename)\r\n\t\t\tcontent = markdown(file)\r\n\r\n\t\t\tf = File.open(filepath, \"w\") \r\n\t\t\tf << content\r\n\t\t\tf.close\r\n\r\n\t\t\tfilepath\r\n\t\tend",
"title": ""
},
{
"docid": "3572d9888e9e3fa3df57b6b1fcfea8ab",
"score": "0.6243214",
"text": "def create_body(posts)\n\n archive = Element.new \"archive\"\n\n if not posts.nil?\n for i in 0...posts.length\n post = archive.add_element \"post\"\n content = post.add_element \"content\"\n content.text = \"text/html; charset=UTF8\"\n affinity = post.add_element \"affinity\"\n affinity.text = posts[i].affinity\n article = Document.new posts[i].body\n body = post.add_element article\n end\n end\n \n return archive.to_s\n end",
"title": ""
},
{
"docid": "254aaf57851a957bb87c4ffb2fa2decd",
"score": "0.62260747",
"text": "def create_post(post_contents, file_path, ref) \n return create_post_model(post_contents, file_path, ref) if !post_contents.nil? && post_contents.is_a?(String)\n end",
"title": ""
},
{
"docid": "ea76bc3bd9bead4f701ca35373dd6185",
"score": "0.6213509",
"text": "def import_post(fpath:, jekyll_posts_dir:)\n add_task(fpath, jekyll_posts_dir)\n run_tasks\n end",
"title": ""
},
{
"docid": "b5d74d859598f42fce55afac58e59401",
"score": "0.6164826",
"text": "def generate\n %{---\nlayout: post\ntitle: \"#{@title}\"\ndate: #{published_date}\ncomments: false\nauthor: #{@author}\ncategories: [#{@tags.join(',')}]\n---\n#{@content}}\n end",
"title": ""
},
{
"docid": "2a1c41cd1eed1a9cc46c0cf2e1344a0b",
"score": "0.6162282",
"text": "def content_for_file(file_path)\n file = PageWithoutAFile.new(@site, File.dirname(__FILE__), \"\", file_path)\n\n config = Jekyll.configuration({})\n uri = config['url'] + config['baseurl']\n\n data = {\n :version => \"https://jsonfeed.org/version/1\",\n :title => config['title'],\n :home_page_url => uri,\n :feed_url => uri + \"/feed.json\",\n :items => []\n }\n\n @site.posts.docs.each do |page|\n next if page.data['draft']\n\n page.data['author'] ||= ''\n page.data['excerpt'] ||= ''\n page.data['featured'] ||= false\n page.data['image'] ||= 'https://dummyimage.com/800x800/000/fff.jpg&text=' + CGI.escape(page.data['title'])\n page.data['image_h'] ||= 800\n page.data['image_w'] ||= 800\n page.data['thumb'] ||= 'https://dummyimage.com/80x80/000/fff.jpg&text=' + CGI.escape(page.data['title'])\n page.data['thumb_h'] ||= 80\n page.data['thumb_w'] ||= 80\n\n # Check for relative URLs and add news domain.\n unless page.data['image'].include?('http')\n page.data['image'] = 'https://stockle.com/news' + page.data['image']\n end\n unless page.data['thumb'].include?('http')\n page.data['thumb'] = 'https://stockle.com/news' + page.data['thumb']\n end\n\n data[:items].push({\n :id => page.id,\n :url => uri + page.url,\n :title => page.data['title'],\n :summary => page.data['excerpt'],\n :date_published => DateTime.parse(page.data['date'].to_s).rfc3339,\n :author => page.data['author'],\n :tags => page.data['categories'], # TODO: CSV the array?\n :featured => page.data['featured'],\n :image => page.data['image'],\n :image_h => page.data['image_h'],\n :image_w => page.data['image_w'],\n :thumb => page.data['thumb'],\n :thumb_h => page.data['thumb_h'],\n :thumb_w => page.data['thumb_w']\n })\n end\n\n file.content = JSON.generate(data)\n file.data[\"layout\"] = nil\n file.data[\"sitemap\"] = false\n #file.data[\"xsl\"] = file_exists?(\"feed.xslt.xml\")\n file.output\n\n return file\n end",
"title": ""
},
{
"docid": "778925dfd4761a3ee8b6c58b0f340ca2",
"score": "0.61365205",
"text": "def save(permalink, content)\n\t\t# FIXME - if the file exists, this should bail out\n\n\t\t# always strip leading / from filename\n\t\tpermalink.slice!(0) if permalink.start_with?( '/' )\n\n\n # create file path recursively\n\t\tpath = Pathname.new( permalink ).dirname\n\t\tself.file_system.mkdir(path)\n\n\t\t# write the contents into the file\n\t\tself.file_system.new_file(permalink+'.md', content)\n\t\t\n\t\t# return the new file\n\t\treturn page(permalink)\n\tend",
"title": ""
},
{
"docid": "7b450185bfd55ef5ef4f772acd8c00f9",
"score": "0.61362535",
"text": "def generate_blog!\n raise GenerateError, \"no blog posts found in ./content/posts/\" unless posts && posts.count > 0\n\n generate_monthly_archives\n generate_yearly_archives\n generate_tag_archives\n end",
"title": ""
},
{
"docid": "1e81c78e0889ea77b8bda0dd81e1c272",
"score": "0.6120246",
"text": "def prepare_jekyll\n\tFile.delete BASE_DIR + \"/index.html\" if File.exists?(BASE_DIR + \"/index.html\")\n\tFileUtils.rm_rf \"#{BASE_DIR}/_posts/\" if File.exists?(\"#{BASE_DIR}/_posts\")\n\tFileUtils.rm_rf \"#{BASE_DIR}/tut/\" if File.exists?(\"#{BASE_DIR}/tut\")\n\tFileUtils.rm_rf \"#{BASE_DIR}/ref/\" if File.exists?(\"#{BASE_DIR}/ref\")\t\n\tFileUtils.mkdir \"#{BASE_DIR}/_posts\"\n\tfile_name_map = {}\n\tDir.new(DOC_DIR).entries.each do |file_name|\n\t\tnext if [\".\", \"..\"].include? file_name\n\t\tfull_name = DOC_DIR + \"/\" + file_name\n\t\tif File.directory? full_name\n\t\t\tprint \"Copy dir '#{file_name}'...\"\n\t\t\tdest_dir = \"#{BASE_DIR}/#{file_name}\"\n\t\t\tsystem \"rm #{dest_dir} -fr\"\n\t\t\tcopy_dir full_name, dest_dir\n\t\t\tputs \" done...\"\n\t\telse\n\t\t\tputs \"Preparing doc file '#{file_name}'...\"\n\t\t\tres_fn = prepare_file(file_name)\n\t\t\tfile_name_map[file_name] = res_fn if res_fn != \"\"\n\t\tend\n\tend\n\treturn file_name_map\nend",
"title": ""
},
{
"docid": "f2efdb52fc40b2665a8b2214584d54c0",
"score": "0.6092082",
"text": "def export\n download_attachments\n change_self_ref_urls\n fix_image_tags\n @content = strip_html\n to_path = \"#{Exporter.post_path}/#{published_date}-#{@filename}\"\n File.open(to_path, 'w') { |f| f.write generate }\n end",
"title": ""
},
{
"docid": "3bd081b0de38b47b0a4f946350d36027",
"score": "0.6075687",
"text": "def build\n new_dir = \"#{@category}/#{@slug}\"\n empty_directory(new_dir)\n template('lesson.json.erb', File.join(new_dir, '.lesson.json'))\n template('etignore.erb', File.join(new_dir, '.etignore'))\n template(\"#{@category}.md.erb\", File.join(new_dir, \"#{@slug}.md\"))\n end",
"title": ""
},
{
"docid": "cfeaa743da4654551e7a138805441798",
"score": "0.60557187",
"text": "def create_post() \r\n puts `clear`\r\n puts(\"-----------------------\".white.on_black)\r\n puts(\"------CREATE POST------\".white.on_black)\r\n puts(\"-----------------------\".white.on_black)\r\n puts\r\n @prompt = TTY::Prompt.new\r\n assign_post_id()\r\n add_title()\r\n add_author(user_id)\r\n add_date()\r\n add_text()\r\n \r\n # appends post to csv\r\n append_to_csv()\r\n end",
"title": ""
},
{
"docid": "425bab6adbb5bf481e1e6550897a843f",
"score": "0.6051512",
"text": "def create_post(post_markdown, post_title)\n # This ref_name variable represents the branch name\n # for creating a post. At the end we strip out all of the whitespace in \n # the post_title to create a valid branch name\n branch_name = \"createPost#{post_title.gsub(/\\s+/, '')}\"\n ref_name = \"heads/#{branch_name}\"\n\n master_head_sha = @github_service.get_master_head_sha\n sha_base_tree = @github_service.get_base_tree_for_branch(master_head_sha)\n\n @github_service.create_ref_if_necessary(ref_name, master_head_sha)\n \n new_post_path = create_new_filepath_for_post(post_title)\n new_tree_sha = create_new_tree(post_markdown, post_title, new_post_path, sha_base_tree)\n \n @github_service.commit_and_push_to_repo(\"Created post #{post_title}\", \n new_tree_sha, master_head_sha, ref_name)\n @github_service.create_pull_request(branch_name, 'master', \"Created Post #{post_title}\", \n Rails.configuration.pull_request_body, \n [Rails.configuration.webmaster_github_username])\n \n PostImageManager.instance.clear\n end",
"title": ""
},
{
"docid": "56ae54849489f36d003e321bbbebde79",
"score": "0.6048068",
"text": "def create\n post = params[:post]\n post[:body] = post[:raw_body]\n @post = Post.new(post)\n @post.remove_html_tag\n @post.wiki_syntax_to_html\n @post.remove_break_return_and_add_br_tag\n\n #Tag.add(@post.id, params[:tag])\n\n @post.save\n redirect_to \"/\"\n end",
"title": ""
},
{
"docid": "521d06e550675537062707734278fe93",
"score": "0.60237235",
"text": "def jekyll_new(config)\n site = Jekyll::Site.new(config)\n\n # Patched version of `write` that will push to Algolia instead of writing\n # on disk\n def site.write\n items = []\n is_verbose = config['verbose']\n each_site_file do |file|\n next unless AlgoliaSearchJekyllPush.indexable?(file)\n Jekyll.logger.info \"Extracting data from #{file.path}\" if is_verbose\n new_items = AlgoliaSearchRecordExtractor.new(file).extract\n next if new_items.nil?\n ap new_items if is_verbose\n\n items += new_items\n end\n AlgoliaSearchJekyllPush.push(items)\n end\n\n site\n end",
"title": ""
},
{
"docid": "bc2076270b35ee1fb7c67b1c44ccf233",
"score": "0.6022263",
"text": "def write_post_extract_file\n render_template(resource_path('post_extract.sh.erb'),\n destination: File.join(staging_dir, 'post_extract.sh'),\n mode: 0755,\n variables: {\n name: project.name,\n friendly_name: project.friendly_name,\n install_dir: project.install_dir,\n }\n )\n end",
"title": ""
},
{
"docid": "74a5cc48f59c262a167f4ee62c3fd0a7",
"score": "0.60140103",
"text": "def create_yaml(filename, yaml_url, md_url)\n yaml = {}\n yaml[\"yaml_url\"] = yaml_url\n yaml[\"md_url\"] = md_url\n yaml[\"Title\"] = \"Cheat Sheet title\"\n File.open(filename, \"w\") { |f| YAML.dump(yaml, f) }\n\n content = File.read(filename)\n Gist.gist(content,\n :filename => filename,\n :update => yaml_url)\n\n yaml_url = filename\n Chgen::Markdown.parse_file(yaml_url)\n end",
"title": ""
},
{
"docid": "52769cb28d74b5d39fcc39c7ef6a6272",
"score": "0.6012628",
"text": "def create_post(options={})\n @connection.post(\"/blog/#{name}/post\", options).response\n end",
"title": ""
},
{
"docid": "62a9d22a530a3c97a279f2c5de49703e",
"score": "0.60113466",
"text": "def generate(site)\n return Jekyll.logger.warn \"\\tJekyll Version Doc: The basic structure for the plugin's operation was not found\" if !File.directory?(\"#{Dir.pwd}/_docs/\")\n \n @site = site\n\n path = \"#{Dir.pwd}/_docs/*\"\n Dir[path].each do |filename|\n Jekyll.logger.info \"\\tSource: #{filename}\"\n\n version = self.getFileVersion(filename)\n summaryFile = \"#{filename}/Summary.md\"\n summaryList = []\n\n if File.exists? summaryFile\n summaryList = self.extractInformation(summaryFile, version)\n else\n summaryList = self.extractInformationDir(filename, version)\n end\n\n filePath = \"#{Dir.pwd}/_site/docs/#{version}\"\n FileUtils.mkpath(filePath) unless File.exists?(filePath)\n\n\n summary_json = PageWithoutAFile.new(site, site.source, \"/docs/#{version}\", \"summary.json\")\n summary_json.content = summaryList.to_json\n site.pages << summary_json\n \n page = Jekyll::PageBuildDocs.new(site, site.source, \"/docs/#{version}/\", \"#{summaryList[0].values[1]}.md\", version)\n page.data[\"sitemap\"] = false\n site.pages << page\n end\n end",
"title": ""
},
{
"docid": "9ad801081a5f43e535f726ea0c286067",
"score": "0.6007326",
"text": "def fetch_posts\n posts = []\n disqus = JSON.parse(File.read('auto/data/disqus.json'))\n files = Dir.entries('auto/data/posts').keep_if { |a| a.end_with? '.yml' }\n blog_img_dir = 'assets/images/blog'\n Dir.mkdir(blog_img_dir) unless Dir.exist? blog_img_dir\n files.each do |file|\n data = {}\n data = YAML.safe_load(File.read(\"auto/data/posts/#{file}\"))\n # File.open(\"auto/data/posts/#{file}\", \"w\") { |file| file.write(JSON.pretty_generate([initialize_empty_fields(data)])) }\n data['filename'] = file.gsub('.yml','').gsub(' ','_')\n posts.push(data)\n data['disqus_identifier'] = disqus[data['filename']]\n data['date'] = data['datetime_index'][6..7] + '/' + data['datetime_index'][4..5] + '/' + data['datetime_index'][0..3]\n data['time'] = if data['datetime_index'][8..9].to_i > 12\n (data['datetime_index'][8..9].to_i - 12).to_s + ':' + data['datetime_index'][10..11] + ' PM'\n else\n data['datetime_index'][8..9] + ':' + data['datetime_index'][10..11] + ' AM'\n end\n data['tag_data'] = []\n data['x_minutes_read'] = data['html_content'].count(' ')/READING_SPEED + 1\n image_dir = \"assets/images/blog/#{data['filename']}\"\n if Dir.exist? image_dir\n data['image_preview'] = '' unless File.exist? \"#{image_dir}/#{data['image_preview']}\"\n else\n Dir.mkdir(\"assets/images/blog/#{data['filename']}\")\n end\n data['html_content'] = Redcarpet::Markdown.new(\n Redcarpet::Render::HTML.new(\n no_intra_emphasis: true,\n tables: true,\n autolink: true,\n strikethrough: true,\n with_toc_data: true\n )\n ).render(data['html_content'])\n data['html_content'] = data['html_content']\n .gsub('<a',\"<a target='_blank'\")\n .gsub('<img src=\"',\"<img src='#{$lazy_load_img}' class='ui centered image' data-src=\\\"../../../assets/images/blog/#{data['filename']}/\")\n .gsub('<ul>',\"<h4> <ul class='ui list'>\")\n .gsub('</ul>','</ul> </h4>')\n .gsub('<code',\"<code class='language-ruby' style='background-color : #fff;'\")\n .gsub('</code>','</code></pre>')\n i = 1\n first = data['html_content'].split('<p>')[i][0]\n while first == '<'\n i += 1\n first = data['html_content'].split('<p>')[i][0]\n end\n data['html_content'] = data['html_content'].sub(\"<p>#{first}\",\"<p><span style='display:block; float:left; font-size: 200%; color:#ffffff; margin-top:5px; margin-right:8px; padding: 10px 20px 10px 20px; text-align:center; background-color: #000;'>#{first}</span>\")\n str = data['html_content']\n rep_i = 0\n while str.include? '---'\n text_inbetween = str.split('---')[1]\n\n if rep_i.zero?\n str.sub!('---', \"<br><div class='ui horizontal divider' id='#{text_inbetween}'>\")\n else\n str.sub!('---', '</div>')\n end\n rep_i = rep_i == 1 ? 0 : 1\n end\n data['html_content'] = str\n $tags.each do |t|\n data['tag_data'].push(t) if data['tags'].include? t['index']\n end\n end\n posts = posts.sort_by { |row| row['datetime_index'].to_i }\n posts = posts.reverse\n puts 'Reading and manipulating all posts from json format.'\n posts\nend",
"title": ""
},
{
"docid": "a19f93593daa972e71fdd85544484306",
"score": "0.59996057",
"text": "def generate(site)\n site.posts.each do |post|\n post.data['path'] = post.name\n end\n site.pages.each do |post|\n post.data['path'] = post.name\n end\n end",
"title": ""
},
{
"docid": "199d416ece0cb05415fa5b598d800038",
"score": "0.5966609",
"text": "def generate_site_files(path, posts)\n slim = Slim::Template.new(path).render(Object.new, content: 'this is the content')\n\n [path.split('/').pop.gsub(/\\.slim/, '.html'), slim]\n end",
"title": ""
},
{
"docid": "1a9f4ef6bbaa829696f7aea1113ba8d7",
"score": "0.59530085",
"text": "def render_posts\n @posts.each do |post|\n postpath = \"#{@sitepath}/#{File.dirname(post.permalink)}\"\n folder_check postpath\n html_out = File.open \"#{@sitepath}/#{post.permalink}\",\"w\"\n layout_engine = Haml::Engine.new(\n File.read(\"#{@basepath}/_layouts/#{post.layout}\"))\n payload = layout_engine.render(Object.new,:post=>post) { post.content }\n html_out.write payload\n html_out.close\n end\n end",
"title": ""
},
{
"docid": "ad307c415edfaebae60cf6577cb9de32",
"score": "0.59401566",
"text": "def initialize(root)\n @root = File.expand_path(root)\n\n Dir.chdir(@root + '/posts') do\n @meta = YAML.load(File.read('blog.yml'))\n\n @posts = []\n @pages = []\n\n for path in Dir['**/*.md']\n post = Post.new(self, path.chomp('.md'), File.read(path))\n if post.date\n if post.guid.nil?\n post.generate_guid\n File.open(post.path + '.md', 'w') do |io|\n post.write(io)\n end\n end\n @posts << post\n else\n @pages << post\n end\n end\n\n @posts = @posts.sort_by { |post| post.date }.reverse\n end\n\n @templates = {}\n end",
"title": ""
},
{
"docid": "e900f9af275ab8e53b5c6f03b1b385c1",
"score": "0.5922853",
"text": "def generate_data\n data = { posts: read_posts }\n write_data(data, 'data')\n end",
"title": ""
},
{
"docid": "9f3ac1df9780ecfe2185cc2f95df6ee0",
"score": "0.59080446",
"text": "def generate_tagpage(tagname)\n begin\n File.open(\"../tag/\" + tagname + \".md\", \"w\") do |file|\n tagpage_formatter = TAGPAGE_TEMPLATE.gsub(/###/, tagname)\n file.puts(tagpage_formatter)\n end\n rescue\n end\n puts \"generated a tag page for \\\"%s\\\"\" % [tagname]\nend",
"title": ""
},
{
"docid": "ccb5dcf79bbbc5dd710eb225cae237bf",
"score": "0.5894141",
"text": "def generate_content(site)\n result = ''\n\n # First, try to find any stand-alone pages.\n site.pages.each { |page|\n path = page.subfolder + '/' + page.name\n\n # Skip files that don't exist yet (e.g. paginator pages)\n next unless FileTest.exist?(path)\n\n mod_date = File.mtime(site.source + path)\n\n # Use the user-specified permalink if one is given.\n if page.permalink\n path = page.permalink\n else\n # Be smart about the output filename.\n path.gsub!(/.md$/, '.html')\n end\n\n # Ignore SASS, SCSS, and CSS files\n next if path =~ /.(sass|scss|css)$/\n\n # Remove the trailing 'index.html' if there is one, and just output the folder name.\n path = path[0..-11] if path =~ /\\/index.html$/\n\n result += entry(path, mod_date, get_attrs(page), site) unless path =~ /error/\n }\n\n # Next, find all the posts.\n posts = site.site_payload['site']['posts']\n for post in posts do\n url = post.url\n url = '/' + url unless url =~ /^\\//\n url = url[0..-11] if url=~/\\/index.html$/\n result += entry(url, post.date, get_attrs(post), site)\n end\n\n result\n end",
"title": ""
},
{
"docid": "1405f4a22663262653e31f74714f9753",
"score": "0.5892001",
"text": "def generate_blog!\n raise GenerateError, \"no blog posts found in ./content/posts/\" unless posts && posts.count > 0\n\n generate_blog_archive\n generate_monthly_archives\n generate_author_archives\n generate_tag_archives\n end",
"title": ""
},
{
"docid": "1864dab0688aee45dc3fb90fb9c8cabe",
"score": "0.58756113",
"text": "def publish(blog_posts)\n\t\tblog_posts.each do |key, value|\n\t\tputs (\"\\n Title: #{value[1]} \\n Created at: #{key} \\n Created by: #{value[0]} \\n Content: #{value[2]} \\n }\")\n\tend\n\tend",
"title": ""
},
{
"docid": "e84db635ed210910184c984bd6d5aa6a",
"score": "0.5856355",
"text": "def convert(content)\n\n\t\t\t# Save contents to a temporary file, and run txt2tags on it.\n\t\t\t# Note: added a leading blank line to mean \"Empty Headers\".\n\t\t\t# http://txt2tags.org/userguide/HeaderArea.html\n\n\t\t\ttemp_file = '/tmp/jekyll.t2t'\n\t\t\tFile.open(temp_file, 'w') { |f| f.write(\"\\n\" + content) }\n\n\t\t\t# Customize the txt2tags command line options as you wish.\n\t\t\t# You can also use %!options on pages/posts.\n\t\t\t`txt2tags -t html --no-headers --css-sugar -i #{temp_file} -o -`\n\t\tend",
"title": ""
},
{
"docid": "365d8d86fad3f27ffd429f7ec9029fac",
"score": "0.5854858",
"text": "def create_post(atts)\n post = Post.new(atts)\n transaction \"create '#{post.title}'\" do\n store[post.path] = post\n end\n end",
"title": ""
},
{
"docid": "d2c0e5f9c81dd85951941b3f52057ebc",
"score": "0.58357966",
"text": "def process_markdown()\n docx_2_markdown(@options[:file])\n cleanup_content_markdown()\n create_ref_style_links() if @options[:ref_style_links]\n add_frontmatter() if @options[:jekyll]\n end",
"title": ""
},
{
"docid": "f7c113152834793e8edb193e838326d5",
"score": "0.5830232",
"text": "def render_jekyll(version, is_default)\n if is_default\n `mkdir -p #{$gen_docs_dir}/#{version}`\n system \"cp -R #{$source_dir}/ #{$gen_docs_dir}/#{version}/\"\n system \"rm -rf #{$gen_docs_dir}/#{version}/vendor\"\n else\n system \"JEKYLL_ENV=production BUNDLE_GEMFILE=./#{$source_dir}/Gemfile bundle exec jekyll build -s ./#{$source_dir} -d ./#{$gen_docs_dir}/#{version} -b #{version}\"\n system \"rm -rf #{$source_dir}/docs\"\n end\n\n system \"ls -la #{$gen_docs_dir}/#{version}\"\nend",
"title": ""
},
{
"docid": "2e722c69602a0f54a07e020d05936c41",
"score": "0.58173245",
"text": "def page title, story\n page = {'title' => title, 'story' => story, 'journal' => [create(title)]}\n File.open(\"../pages/#{slug(title)}\", 'w') do |file| \n file.write JSON.pretty_generate(page)\n end\nend",
"title": ""
},
{
"docid": "4652f24eaa6d87efdcba1f2d56992966",
"score": "0.5792522",
"text": "def given_a_post_with_markdown\n post_1.update! title: \"Highly *emphatic*\", body: '## Headonistic'\n end",
"title": ""
},
{
"docid": "053cb1c1ae602cf78cf209af8293b27c",
"score": "0.5790131",
"text": "def write\n File.open(NANOC_POSTS_PATH + '/' + filename, 'w') {|f| f << metadata + content}\n end",
"title": ""
},
{
"docid": "23bc6f798a838f9764154cc5aa1e84ad",
"score": "0.578377",
"text": "def create_post(oauth_token, post_markdown, post_title)\n # This ref_name variable represents the branch name\n # for creating a post. At the end we strip out all of the whitespace in \n # the post_title to create a valid branch name\n branch_name = \"createPost#{post_title.gsub(/\\s+/, '')}\"\n ref_name = \"heads/#{branch_name}\"\n\n master_head_sha = GithubService.get_master_head_sha(oauth_token)\n sha_base_tree = GithubService.get_base_tree_for_branch(oauth_token, master_head_sha)\n\n GithubService.create_ref_if_necessary(oauth_token, ref_name, master_head_sha)\n \n new_post_path = create_new_filepath_for_post(post_title)\n new_tree_sha = create_new_tree(oauth_token, post_markdown, post_title, new_post_path, sha_base_tree)\n \n GithubService.commit_and_push_to_repo(oauth_token, \"Created post #{post_title}\", \n new_tree_sha, master_head_sha, ref_name)\n GithubService.create_pull_request(oauth_token, branch_name, 'master', \"Created Post #{post_title}\", \n PULL_REQUEST_BODY, [Rails.configuration.webmaster_github_username])\n \n PostImageManager.instance.clear\n end",
"title": ""
},
{
"docid": "f1b9baedb88d505c8f2342ff34ce81be",
"score": "0.57780343",
"text": "def read_posts\n post_filenames = Dir['posts/*'].sort.reverse.map do |filename|\n chars = filename.split('')\n chars.shift(6)\n chars.join('')\n end\n post_filenames.map do |filename|\n Post.new(filename)\n end\n end",
"title": ""
},
{
"docid": "98d3edea02f8f40f1680e027277e24b7",
"score": "0.57750964",
"text": "def post_feed_template\n one_line_story_template \"{*actor*} made a new {*title*} on Blavel.\"\n end",
"title": ""
},
{
"docid": "e2aa0f0c7cd1354659e4e938bb9528f3",
"score": "0.57691205",
"text": "def generate(site)\n require 'nokogiri'\n\n config_file = File.join(site.source, site.config['opml']['source'])\n all_blogs = read_blogs_from_config(config_file)\n categories = all_blogs.group_by { |blog| blog['categories'] }\n\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.opml(version: '1.1') {\n xml.head {\n xml.title site.config['opml']['title']\n }\n xml.body {\n xml.outline(text: site.config['opml']['outline']['text'], title: site.config['opml']['outline']['title']) {\n categories.each do |name, blogs|\n xml.outline(text: name, title: name) {\n blogs.each do |blog|\n xml.outline(\n htmlUrl: blog['url'],\n text: \"#{blog['author']} - #{blog['title']}\",\n title: \"#{blog['author']} - #{blog['title']}\",\n type: 'rss',\n version: 'RSS',\n xmlUrl: blog['feed']\n )\n end\n }\n end\n }\n }\n }\n end\n\n opml_path = site.config['opml']['path'] || '/'\n opml_name = site.config['opml']['name'] || 'feed.opml'\n full_path = File.join(site.dest, opml_path)\n ensure_directory(full_path)\n File.open(\"#{full_path}#{opml_name}\", 'w') { |f| f.write(builder.to_xml) }\n\n site.pages << Jekyll::OPMLFeed.new(site, site.dest, opml_path, opml_name)\n end",
"title": ""
},
{
"docid": "54005b7609565695afa07d3ba8529660",
"score": "0.5763761",
"text": "def read_post_content\n if @options['date']\n # remove date if it exists\n content = read.sub(/date:.*$\\n/, \"\")\n \n # Insert date after title\n content.sub(/(title:.+$)/i, '\\1'+\"\\ndate: #{@options['date']}\")\n else\n read\n end\n end",
"title": ""
},
{
"docid": "c2ff311936473635dabd599ee7b3d413",
"score": "0.57614124",
"text": "def create_readme\n template 'lib/templates/README.md.tt', 'README.md', force: true\nend",
"title": ""
},
{
"docid": "bd39179c2647da5d7c06a05d4b0f4969",
"score": "0.5753973",
"text": "def post_path(post_file)\n File.join(jekyll_site.source, *%w[_posts], post_file)\n end",
"title": ""
},
{
"docid": "03f6ff2d924f85ebb3219f83952dc5b8",
"score": "0.5751837",
"text": "def post_read\n#\t\t\tputs path\n\t\t\trv = _post_read()\n\t\t\tlang = (basename.split '.')[1]\n\t\t\tif lang == 'mul' or I18n.available_locales.include? lang.intern\n\t\t\t\tdata['lang'] = lang\n\t\t\telse\n\t\t\t\tdata['lang'] = 'und' if not self.is_a? Jekyll::Layout\n\t\t\tend\n\t\t\t# Add the language as a tag.\n\t\t\tdata['tags'] ||= []\n\t\t\tdata['tags'] << data['lang']\n#\t\t\tputs lang\n\t\t\trv\n\t\tend",
"title": ""
},
{
"docid": "6f7bfe8b0422e87fa606b9268a59789c",
"score": "0.5750153",
"text": "def process_header post,yaml\n post.title = yaml[:title]\n post.content = yaml[:content]\n post.layout = yaml[:layout]\n post.publish = yaml[:publish]\n post.date = yaml[:date]\n post.category = yaml[:category]\n post.permalink = \"#{post.date.year}/#{post.date.strftime(\"%m\")}/#{post.slug}.html\"\n end",
"title": ""
},
{
"docid": "8e33a988db09060a42893db76d088272",
"score": "0.5748657",
"text": "def mknode(name, node)\n mkplugin_node_maybe(name, node) do |pcontents|\n if pcontents\n yield lambda{ build(&pcontents) }\n else\n ps = @params.merge( :tree => self, :target => name )\n\n posts = tlog.posts.filter(ps)\n \n if @params[:archive]\n posts = posts + tlog.archive.filter(ps)\n end\n posts = posts.by_date!.reverse\n\n if node[:items] and not @params[:nolimit]\n posts.limit!(node[:items][:max], node[:items][:min])\n end\n\n posts.with_export!(:html, @params.merge(ps))\n posts.each do |post|\n tag = node[:tag] or :div\n pyr = lambda{\n build(&post.to_html(name))\n }\n yield pyr\n end\n end\n end\n end",
"title": ""
},
{
"docid": "37f4c426a8633392d387c1ac930824f0",
"score": "0.5747895",
"text": "def create_project_file\n template = TemplatePage.new(RDoc::Page::HPP_FILE)\n values = { \"title\" => @options.title, \"opname\" => @op_name }\n files = []\n @files.each do |f|\n\tfiles << { \"html_file_name\" => f.path }\n end\n\n values['all_html_files'] = files\n \n File.open(@project_name, \"w\") do |f|\n template.write_html_on(f, values)\n end\n end",
"title": ""
},
{
"docid": "74eefd74ccfbab13099901d4f7d507b5",
"score": "0.5744933",
"text": "def write_comment(post)\n # for rescue\n begin\n \n #comment_reg_ex = /Comment\\s+@(\\w+)/\n comments_path = \"#{path}/_comments\"\n logger.info(\"Writing Comment #{post.file_name.gsub(/\\?/, \"\")} to #{comments_path}\")\n \n #puts \"Comment File name\" + post.file_name.gsub(/\\?/, \"\") \n Turqlom::Util.write_template(\n File.join(path, '_comment.md.erb'),\n File.join(path, \"_posts/_comments\", post.file_name.gsub(/\\?/, \"\")) \n ) do | erb |\n base_url = post.base_url\n\tcategory = 'articles'\n \t# Msg id of comment\n msgid = post.msgid \n \n # Map msgid of the post to post_id of comment\n # Jekyll::Post::id is path of the blog post by default, category/title\n post_id = \"/#{category}/\"+ post.subject.match($comment_reg_ex)[2]\n description = post.body[0..320] + (( post.body.size > 320 ) ? '...' : '' )\n address = post.address \n received_at = post.received_at \n erb.result(binding)\n \n end # end erb.result(binding)\n \n rescue Exception => e # why here erb.binding?\n logger.error(e.message)\n logger.error(e.backtrace)\n end \n end",
"title": ""
},
{
"docid": "99ba8d4ccc64b157c31d5a47ee55ff9d",
"score": "0.5742818",
"text": "def make_post(content)\n click_on \"Home\"\n click_on \"New Post Button\"\n fill_in \"post_content\", with: content\n click_on \"Save Post\"\n assert_text content\n end",
"title": ""
},
{
"docid": "7e4f86ff8a1b92ffc3cd29f6e821a7a8",
"score": "0.5737929",
"text": "def single_markdown_file(path)\n frontmatter = Post.get_frontmatter(path)\n return if frontmatter.nil?\n\n @post_minimal_metadata.push(\n 'path' => path,\n 'dateCreated' => frontmatter['dateCreated']\n )\n\n @categories.concat(frontmatter['categories'])\n end",
"title": ""
},
{
"docid": "e934a78fc584c7e6a1f6c62cb78a6f47",
"score": "0.5735783",
"text": "def post(title, body)\n\tpost = path + \"/posts/\" + CGI.escape(title)\n\tif title == \"\" then\n\t\treturn \"User: Huh? You forgot the title for your submission.\"\n\telsif User.fetch_article(@pseudonym, CGI.escape(title))['exists?'] then\n\t\treturn \"User: Submission named \\\"#{title}\\\" already exists. Damnit!\"\n\telsif body == \"\" then\n\t\treturn \"User: No text in your submission. Well...!\"\n\telsif body.length > 1000000 then \n\t\treturn \"User: Submission exceeds a million characters. OHMY.\"\n\telsif User.count_submissions(@pseudonym) >= 5 then\n\t\treturn \"User: You've already submitted five times. Wait for your work to be featured - or delete some. Your call...\"\n\tend\n\n\tDir.mkdir(post)\n\tFile.open(post + \"/#{CGI.escape(@pseudonym)}\", \"w\") do |file|\n\t\tfile.write(CGI.escapeHTML(body))\n\tend\n\n\t\"Success! \\\"#{title}\\\" was uploaded.\"\nend",
"title": ""
},
{
"docid": "bd0e25e879c00b1e081000fa44828758",
"score": "0.5734725",
"text": "def index\n @posts = []\n \n Dir.glob(File.join(Jadmin::Application.config.jekyll_folder, '_posts', '*.markdown')).each do |post|\n @posts << File.basename(post, '.markdown')\n end\n \n @posts.sort! do |post_a, post_b|\n Date.strptime(post_b, \"%Y-%m-%d\") <=> Date.strptime(post_a, \"%Y-%m-%d\")\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "8ad0ab6b28b05809c74740ada0e52aa5",
"score": "0.5734112",
"text": "def create_entry(title, body)\n x = Builder::XmlMarkup.new :indent => 2\n x.entry 'xmlns' => 'http://www.w3.org/2005/Atom' do\n x.title title, 'type' => 'text'\n x.content 'type' => 'xhtml' do\n x.div body, 'xmlns' => 'http://www.w3.org/1999/xhtml'\n end\n end\n \n @entry ||= x.target!\n path = \"/feeds/#{@blog_id}/posts/default\"\n post(path, @entry)\n end",
"title": ""
},
{
"docid": "89af2ed40650ad2b84c05d0d5cb3d5c2",
"score": "0.57331216",
"text": "def process_pres\n @pres.each do |pre|\n p = Post.new\n current_file_content = File.read pre\n if current_file_content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n p.content = $POSTMATCH\n process_header p,YAML.load($1)\n end\n @posts.push p\n end\n @posts.delete_if { |p| p.publish == false }\n end",
"title": ""
},
{
"docid": "bd198b9da6529c7f0555273ce3ffd9ec",
"score": "0.5720458",
"text": "def update_post record\n # Git Repo and commit variables\n client = Octokit::Client.new(:access_token => \"3d07581ff92626f9ccea67ecb00c9f1e6266cd90\")\n repo = \"jekyllpub/jekyllpub.github.io\"\n message = \"Update #{record.title}\"\n # Define post variables\n post_path = \"/_posts#{record.created_at.strftime(\"/%Y-%m-%d\")}-#{hyphenize(record.title).downcase}.markdown\"\n post_get = client.contents repo, path: post_path\n # Define post content for update\n content = format_post date: now,\n author: record.author.capitalize,\n excerpt: record.excerpt,\n thumbnail: \"/assets/img/posts/#{record.thumbnail_file_name}\",\n category: record.category,\n layout: record.layout,\n body: record.content,\n video: record.video,\n published: record.published?\n # Update post using Octokit.rb\n client.update_contents repo, post_path, message, post_get[:sha], content\n end",
"title": ""
},
{
"docid": "7bd9e050c7e6bca524e30e98ffb86a16",
"score": "0.57052565",
"text": "def prepare_content\n @posts = []\n @pages = []\n\n # Create a Post for each file in the posts directory\n Dir.entries('posts').each do |f|\n entry = File.join('posts', f)\n if File.file?(entry)\n @posts << Post.new(entry)\n end\n end\n\n # Create a Page for each file in the pages directory\n Dir.entries('pages').each do |f|\n entry = File.join('pages', f)\n if File.file?(entry)\n @pages << Page.new(entry)\n end\n end\n\n save_metadata\n\n # Sort the posts by date, with most recent first\n @posts.sort_by! { |post| post[:date] }\n @posts.reverse!\n end",
"title": ""
},
{
"docid": "73910a1f290d8b6ee5aef1583fe6fef9",
"score": "0.5697509",
"text": "def single_post(post, options = {})\n options.reverse_merge!( :comments => true, \n :comment_form => true,\n :heading => :h2, \n :metadata => true, \n :excerpt => false,\n :more_text => 'Read the rest …',\n :title_link => :blog_post)\n \n output = []\n \n if options[:title_link]\n output << content_tag(options[:heading], link_to(post.title, eval(\"#{options[:title_link]}_url(post)\"), :title => \"Read #{post.title} (with comments)\"), :class => 'title')\n else\n output << content_tag(options[:heading], post.title, :class => 'title')\n end\n \n output << show_metadata(post) if options[:metadata]\n \n # Perform the excerpting\n if options[:excerpt]\n link = link_to(options[:more_text], blog_post_path(post), :title => \"Read the rest of #{post.title}\", :class => 'more' )\n post.content =~ /(.*)<!--\\s?more\\s?-->(.*)/m\n if $2\n post.content = $1 + link\n else\n post.content = post.summary + \"\\r\\n\\r\\n#{link}\"\n end\n end\n\n body = Hpricot(post.content.gsub(/<!--(.*?)-->/m, ''))\n\n # Convert any \"pre\" segments to code\n ['xml', 'yaml', 'ruby'].each do |code|\n convertor = Syntax::Convertors::HTML.for_syntax code\n body.search(\"pre.#{code}\") do |e|\n e.innerHTML = convertor.convert( e.innerHTML ).gsub(/<\\/?pre>/,'')\n end\n end\n\n # Simple format & auto-link the body\n body = simple_format(auto_link(sanitize(body.to_html, :tags => %w(pre ol ul blockquote h1 h2 h3 h4 div p object param embed a img), :attributes => %w(allowscriptaccess allowfullscreen alt class height href name src style title type width value))))\n body = Hpricot(body)\n body.search(\"pre p\"){|e| e.swap(e.inner_html)}\n body.search(\"pre br\").remove # Remove <br /> tags inside <pre> tags -- the simple_format method incorrectly inserts them\n body.search(\"ol>br\").remove\n body.search(\"ul>br\").remove\n \n output << body.to_html\n\n if options[:comments]\n output << content_tag(:h2, 'Conversation in progress…', :class => 'comments') unless post.comments.blank?\n index = 0\n output << content_tag(:ol, post.comments.collect{|comment| index += 1; single_comment(comment, :class => cycle('odd', 'even') + (index == 1 ? ' first' : ''), :index => index) }.join(\"\\n\\n\"), :class => 'comments')\n new_comment = Comment.new(params[:comment])\n new_comment.post = post\n output << controller.instance_eval{render_to_string(:partial => 'comments/form')} if options[:comment_form]\n end\n \n # Return the output wrapped in a <div class=\"post\">\n content_tag(:div, output.join(\"\\n\\n\\t\\t\"), :class => 'post')\n end",
"title": ""
},
{
"docid": "5165cf9e86d8018622ece240457ecac7",
"score": "0.5664724",
"text": "def make_page(file_path, collection: \"posts\", category: nil, tags: nil)\n PageWithoutAFile.new(@site, __dir__, \"\", file_path).tap do |file|\n file.content = feed_template\n file.data.merge!(\n \"layout\" => nil,\n \"sitemap\" => false,\n \"xsl\" => file_exists?(\"feed.xslt.xml\"),\n \"collection\" => collection,\n \"category\" => category,\n \"tags\" => tags\n )\n file.output\n end\n end",
"title": ""
},
{
"docid": "4cc689f6e4ef5531d85fbdb78752a2e5",
"score": "0.5657052",
"text": "def create_index(path, title, collection)\n txt = <<TXT\n---\ntitle: \"#{title}\"\nindex: true\n---\n\n{% include dir_quotes.html collection=\"#{collection}\" %}\nTXT\n File.open(path, \"w\") {|f| f.write(txt) }\n end",
"title": ""
},
{
"docid": "21b20a725cd1081e11e25b676c17acfb",
"score": "0.56501275",
"text": "def generate(site)\n @site = site\n entries.each do |e|\n @site.pages << content_for_file(e[\"feed_output_path\"], feed_source_path(e[\"feed_source_path\"]))\n end\n end",
"title": ""
},
{
"docid": "a170b1f81508faddebb96004556152b8",
"score": "0.5649321",
"text": "def show\n \n if File.exists? File.join(Jadmin::Application.config.jekyll_folder, \"_posts\", \"#{params[:id]}.markdown\")\n @post = parse_post(params[:id])\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "50c035a1059bd1adc393ec2a9b228f1b",
"score": "0.5646903",
"text": "def publish(blog_posts)\n\n\t\tblog_posts.each do |key, value|\n\n\t\tputs (\"\\n Blog post title: #{value[0]} \\n Created at: #{key} \\n Content: #{value[1]} \\n Author: #{value[2]}\")\n\n\tend\n\n\tend",
"title": ""
},
{
"docid": "c93f3083e8c3f555dcbcc631cec4167a",
"score": "0.5644741",
"text": "def post(doc)\n tumblr_post = if doc.is_a?(Tumblr::Post)\n doc.to_h\n elsif doc.respond_to?(:keys)\n doc\n else\n Tumblr.parse(doc).to_h\n end\n tumblr_post.has_key?(:'post-id') ? writer.edit(tumblr_post) : writer.write(tumblr_post)\n end",
"title": ""
},
{
"docid": "312eb9962a861e896cdc5870ceede9ca",
"score": "0.56438947",
"text": "def read_file\n\n # Load the Jekyll post or page\n self.content = File.read(@filename)\n\n begin\n\n # define a regular expression to find the YAML header \n if /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m.match(self.content)\n\n # Use the back reference to load the metadata and the postmatch \n # to load the content\n self.metadata = YAML.load($1)\n self.content = $'\n\n end\n rescue => e\n puts \"YAML Exception reading #{filename}: #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "ab3ef1ddf9a4787099fa381426e32fd8",
"score": "0.5638053",
"text": "def create_wiki_doc(*args)\n\n # default set in args\n begin\n\n args= Hash[*args]\n args.dup.each do |key,value|\n if key.class != Symbol\n args[key.to_s.to_sym]= value\n args.delete key\n end\n end\n\n if args[:path].nil?\n raise ArgumentError,\"You must set a file path with a file name in order to create documentation for grape!\"\n end\n\n args[:desc_files] ||= Array.new\n\n [:desc,:desc_file,:extra_desc_file].each do |one_key|\n\n args[:desc_files] += args[(one_key.to_s+\"s\").to_sym] if args[(one_key.to_s+\"s\").to_sym].class == Array\n args[:desc_files].push(args[one_key]) if args[one_key].class == String\n\n end\n\n args[:type] ||= args[:doc_type]\n args[:type] ||= 'wiki'\n\n #args[:path],\n #args[:extra_desc_file]\n #args[:target_class]\n #args[:type]\n\n end\n\n\n # defaults\n begin\n\n uni_tab= \"\"\n case args[:type].to_s.downcase\n\n when \"redmine\",\"redmine_wiki\",\"redmine-wiki\",\"redminewiki\"\n begin\n\n mid_tab= \" \"*3\n\n bsym= \"*\"\n isym= \"_\"\n\n htsym= \"* \"\n mtsym= htsym[0]*2 +\" \"\n stsym= htsym[0]*3 +\" \"\n\n hheader= \"h3. \"\n mheader= \"h4. \"\n sheader= \"h5. \"\n\n container_markup_begin= \"<pre><code class=\\\"\"\n container_markup_end= \"\\\">\"\n container_markup_close= \"</code></pre>\"\n\n toc_mark= \"\\n{{>toc}}\\n\"\n\n end\n\n when \"github\",\"wiki\",\"md\"\n begin\n\n mid_tab= \" \"*3\n\n bsym= \"*\"\n isym= \"_\"\n\n htsym= \"* \"\n mtsym= \" * \"\n stsym= \" * \"\n\n hheader= \"## \"\n mheader= \"### \"\n sheader= \"#### \"\n\n container_markup_begin= \"```\"\n container_markup_end= \"\"\n container_markup_close= \"```\"\n toc_mark= \"\"\n\n end\n\n else\n raise ArgumentError, \"invalid :type has been set, try github or redmine\"\n\n end\n\n end\n\n # site name\n begin\n write_out_array = Array.new\n write_out_array.push \"#{hheader}#{$0} REST Interface Documentation\\n\\n\"\n end\n\n # description\n begin\n args[:desc_files].each do |extra_desc_file_path|\n\n write_out_array.push \"#{sheader}#{extra_desc_file_path.split(File::Separator).last.split('.')[0].camelcase}\\n\"\n write_out_array.push \" \"+File.open(extra_desc_file_path,\"r\").read+\"\\n\"\n\n end\n end\n\n # table of contents\n begin\n write_out_array.push toc_mark\n end\n\n # classes array\n begin\n rest_models= Array.new\n end\n if args[:target_class].nil?\n Grape::API.each_subclass do |one_class|\n rest_models.push(one_class)\n end\n else\n if args[:target_class].class != Class && args[:target_class] != nil\n raise ArgumentError, \"invalid input :target_class is not a Class obj\"\n end\n rest_models.push(args[:target_class])\n end\n\n rest_models.each do |rest_api_model|\n next if Grape::API == rest_api_model\n rest_api_model.routes.map do |route|\n\n\n method_name= \"#{hheader}Request: #{route.route_path} call: #{route.route_method.to_s.downcase} part\"\n\n # check that does the method already in the documentation\n unless write_out_array.include?(method_name)\n\n # create call name\n begin\n write_out_array.push method_name\n end\n\n # request\n begin\n\n # create request description\n begin\n write_out_array.push(\"\\n\"+(uni_tab*1)+\"#{mheader}Request description\")\n case true\n\n when route.route_description.class <= String\n route.route_description.each_line do |one_line|\n write_out_array.push((uni_tab*2)+htsym+one_line.chomp)\n end\n\n when route.route_description.class <= Hash\n begin\n\n description_msg = nil\n\n [:d,:desc,:description].each do |sym|\n description_msg ||= route.route_description[sym]\n end\n\n description_msg ||= \"No description available for this path\"\n description_msg= [*description_msg]\n\n description_msg.dup.each do |element|\n next unless element.include?(\"\\n\")\n\n index_n= description_msg.index(element)\n description_msg.delete(element)\n new_elements= element.split(\"\\n\")\n new_elements.size.times do |counter_n|\n description_msg.insert(index_n + counter_n - 1, new_elements[counter_n - 1] )\n end\n\n end\n\n description_msg.each do |one_line|\n write_out_array.push((uni_tab*2)+htsym+one_line.chomp)\n end\n\n end\n\n\n end\n end\n\n # pre request\n begin\n write_out_array.push(\"\\n#{mheader}request\\n\")\n end\n\n # create route method\n begin\n write_out_array.push((uni_tab*2)+\"#{htsym}#{bsym}method:#{bsym}#{mid_tab} #{route.route_method}\")\n end\n\n # create route path\n begin\n write_out_array.push((uni_tab*2)+\"#{htsym}#{bsym}path:#{bsym}#{mid_tab} #{route.route_path}\")\n end\n\n # create route content_type\n begin\n write_out_array.push((uni_tab*2)+\"#{htsym}#{bsym}headers:#{bsym}#{mid_tab}\")\n rest_api_model.content_types.each do |one_format_type,one_format_header|\n write_out_array.push \"#{mtsym}#{uni_tab*2}#{one_format_header}\"\n end\n\n write_out_array.push \"\"\n end\n\n # parameters\n begin\n new_docs_element= Array.new\n if route.route_params.count == 0\n new_docs_element.push \" No specified or special params\"\n else\n new_docs_element.push \"\"\n new_docs_element.push \"#{htsym}#{isym}#{bsym}Parameters#{bsym}#{isym}\"\n route.route_params.each do |key,value|\n new_docs_element.push \"#{mtsym}#{isym}#{key}#{isym}\"\n value.each do |value_key,value_value|\n new_docs_element.push \"#{stsym}#{value_key}: #{value_value}\"\n end\n end\n new_docs_element.push \"\\n\"\n end\n refactored_element= Array.new\n new_docs_element.each do |one_element|\n refactored_element.push((uni_tab*2)+one_element)\n end\n write_out_array.push refactored_element.join(\"\\n\")\n end\n\n end\n\n # response\n begin\n\n # pre response\n begin\n write_out_array.push(\"\\n#{mheader}response\\n\")\n end\n\n #> TODO make better implementation for others to use\n #create route content_type\n begin\n if !Grape::Endpoint.config_obj.nil?\n\n write_out_array.push((uni_tab*2)+\"#{sheader}Extra headers:\")\n\n Grape::Endpoint.header_config_obj.each do |header_key,header_value|\n write_out_array.push \"#{htsym}#{header_key}: #{header_value.join(', ')}\"\n end\n\n write_out_array.push \"\"\n\n end\n end if Grape::Endpoint.respond_to?(:config_obj) && Grape::Endpoint.respond_to?(:header_config_obj)\n\n # create response bodies\n begin\n #TODO check out why not working normaly with evry path!\n write_out_array.push((uni_tab*2)+\"#{sheader}*body:*\")\n wiki_body(route,container_markup_begin,container_markup_end,container_markup_close ).each do |one_element|\n write_out_array.push one_element\n end\n write_out_array.push \"\"\n end\n\n end\n\n # error resp\n begin\n\n # pre error\n begin\n write_out_array.push(\"\\n#{mheader}response in case of failure\\n\")\n end\n\n # create error response headers\n begin\n\n end\n\n # create error response bodies\n begin\n #write_out_array.push((uni_tab*2)+\"*body:*\")\n write_out_array.push((uni_tab*2)+\"#{htsym}*Internal Server Error:500*\")\n end\n\n end\n\n # after space\n begin\n write_out_array.push \"\\n----\\n\"\n end\n\n end\n\n end\n end\n\n File.new(args[:path],\"w\").write write_out_array.join(\"\\n\")\n\n return nil\n end",
"title": ""
},
{
"docid": "d4390d40c9a7e941af7fe08dda013682",
"score": "0.5633456",
"text": "def process\n site = Jekyll::Site.new(@config)\n\n def site.write\n items = []\n\n # Index collections\n collections.values.each do |collection|\n collection.docs.each do |doc|\n next unless AlgoliaSearchJekyllPush.indexable?(doc)\n new_items = AlgoliaSearchRecordExtractor.new(doc).extract\n\n next if new_items.nil?\n items += new_items\n end\n end\n\n # Index posts\n each_site_file do |file|\n next unless AlgoliaSearchJekyllPush.indexable?(file)\n\n new_items = AlgoliaSearchRecordExtractor.new(file).extract\n next if new_items.nil?\n\n items += new_items\n end\n AlgoliaSearchJekyllPush.push(items)\n end\n\n # This will call the build command by default, which will in turn call our\n # custom .write method\n site.process\n end",
"title": ""
},
{
"docid": "11052fb802d5250caf6167f0c1024d35",
"score": "0.5633369",
"text": "def write_file(content, title, directory, permalink, filename)\n parsed_content = \"#{content.sub(\"title:\", \"title: \\\"#{title}\\\"\")}\"\n parsed_content2 = \"#{parsed_content.sub(\"date:\", \"date: \\\"#{POSTDATE}\\\"\")}\"\n parsed_content3= \"#{parsed_content2.sub(\"permalink:\", \"permalink: \\\"#{permalink}\\\"\")}\"\n File.write(\"#{directory}/#{filename}\", parsed_content3)\n puts \"#{filename} was created in '#{directory}'.\"\nend",
"title": ""
},
{
"docid": "e80538327ba399c8cf7861f047b60a04",
"score": "0.5633087",
"text": "def static(output_path: \"docs\")\n\trequire 'rackula/command'\n\t\n\tconfig_path = File.expand_path(\"../../template/config.ru\", __dir__)\n\tpublic_path = File.expand_path(\"../../public\", __dir__)\n\t\n\tRackula::Command::Top[\"generate\", \"--force\",\n\t\t\"--config\", config_path,\n\t\t\"--public\", public_path,\n\t\t\"--output-path\", output_path\n\t].call\n\t\n\tFileUtils.touch File.expand_path(\".nojekyll\", output_path)\nend",
"title": ""
}
] |
6dadb66e3b8db9c95766fb823c915701
|
Runs the callback as long as the transition context matches the branch requirements configured for this callback. If a block is provided, it will be called when the last method has run. If a terminator has been configured and it matches the result from the evaluated method, then the callback chain should be halted.
|
[
{
"docid": "c62823cc7b350efc2ea12274986c157c",
"score": "0.5311536",
"text": "def call(object, context = {}, *args, &block)\n if @branch.matches?(object, context)\n run_methods(object, context, 0, *args, &block)\n true\n else\n false\n end\n end",
"title": ""
}
] |
[
{
"docid": "18139399fa05832c4403b4a5512fa536",
"score": "0.5782362",
"text": "def callback(&blk)\n @blk=blk\n end",
"title": ""
},
{
"docid": "652e83ae488cce38082048fcce8b10ea",
"score": "0.5596699",
"text": "def condition &block\n return unless block\n\n case @deferred_status\n when :succeeded, :failed\n SetCallbackFailed.new\n else\n @conditions ||= []\n @conditions.unshift block\n end\n end",
"title": ""
},
{
"docid": "31fc93c2d079fe376b583a9e602b73d9",
"score": "0.54877806",
"text": "def call(target)\n @matchers.each { |guard_block_matcher|\n next unless guard_block_matcher.match?(target)\n return guard_block_matcher.match(target)\n }\n\n return @else.call(target) if @else\n\n nil\n end",
"title": ""
},
{
"docid": "5a1922223278806092fd95312ae4ce25",
"score": "0.5412189",
"text": "def pass_control_on_condition\n puts \"Inside the method\"\n yield if block_given?\n puts \"Back inside the method\"\nend",
"title": ""
},
{
"docid": "fb47af48a24773f84717ef1ee94f8cf0",
"score": "0.53998756",
"text": "def answer result, &block\n callchain.each do |c|\n c.instance_exec @current_state do |cs|\n @previous_states << @current_state\n @current_state = cs\n end\n end\n # next time, control will be passed to our calling block or our block\n if block_given?\n @previous_command_blocks << @command_block if @command_block\n @command_block = block \n else\n @command_block = @previous_command_blocks.pop\n end\n set_executed_command_chain\n \n # unwind to the command block \n pause = PauseProcessing.new\n pause.value = result\n raise pause\n end",
"title": ""
},
{
"docid": "c072caaf785a26d6827b196b81427542",
"score": "0.53993875",
"text": "def block_method\nputs \"called outside block in block_method\"\n#add method, to check if there is a block on this method\nyield if block_given? #predicate method, it have question mark on end\nputs \"now we are returning again to block\"\nend",
"title": ""
},
{
"docid": "2408f3ae6d36619cbb18d9ee4d90872b",
"score": "0.5384983",
"text": "def run\n if @block.arity >= 1\n @block.call self\n else\n @block.call\n end\n end",
"title": ""
},
{
"docid": "2acfe20ee61ffac40c66fe834a5d1061",
"score": "0.5366239",
"text": "def callback &block\n @callback = block\n if @callback_args\n @callback.call *@callback_args\n end\n self\n end",
"title": ""
},
{
"docid": "fa946a83b9d9235329cbcf6cadff7af4",
"score": "0.535586",
"text": "def conditional_callback(kind, guard)\n return yield if guard\n run_callbacks(kind) { yield }\n end",
"title": ""
},
{
"docid": "ba684928d98e5dcf0f95bb0793a38a05",
"score": "0.5343422",
"text": "def pass_control_on_condition\n puts \"Inside the method\"\n\n if block_given?\n yield\n end\n\n puts \"Back inside the method\"\nend",
"title": ""
},
{
"docid": "a90ac9b5e5ef03cf4d5e5ee3fb98e6ec",
"score": "0.5283759",
"text": "def invoke(args, block)\n \n handle_order_constraint\n\n begin\n Kernel::raise @exception_to_raise.new unless @exception_to_raise.nil?\n Kernel::throw @symbol_to_throw unless @symbol_to_throw.nil?\n\n if !@method_block.nil?\n return invoke_method_block(args)\n elsif !@args_to_yield.nil?\n return invoke_with_yield(block)\n else\n return invoke_return_block(args, block)\n end\n ensure\n @received_count += 1\n end\n end",
"title": ""
},
{
"docid": "436fcff5d75d28d61066733be995491e",
"score": "0.52773035",
"text": "def will_run_block\n # when you use yield, you'll call the block\n yield\n puts 'End'\nend",
"title": ""
},
{
"docid": "d11b94dad1bf7008865d713b3684478d",
"score": "0.5276018",
"text": "def run_when(&blk)\n raise(\"A block is needed to evaluate for run_when\") unless block_given?\n @run_condition = blk\n end",
"title": ""
},
{
"docid": "f4bbe559bebb0463284db2d983628139",
"score": "0.52379024",
"text": "def execute(&block)\n block.call\n puts \"End of block\"\nend",
"title": ""
},
{
"docid": "5a40dc3c84d29e819df3d18a3c5eac9e",
"score": "0.5210927",
"text": "def next_block_will_be_binary\n @block_arity = 2\n end",
"title": ""
},
{
"docid": "14989b870042c7ffda5978b8ab1e9f89",
"score": "0.5209277",
"text": "def run(&blk)\n raise(\"A block is needed to run\") unless block_given?\n @run_logic = blk\n end",
"title": ""
},
{
"docid": "38932a4146543d93fb32fa36e3d779be",
"score": "0.5203775",
"text": "def finish(*args,&ruby_block)\n # Gain access to the finisher as local variable.\n finisher_proc = @finisher_proc\n # # The context is the one of the finisher.\n # Execute the code generating the finisher in context.\n HDLRuby::High.space_push(@namespace)\n HDLRuby::High.cur_block.open do\n instance_exec(ruby_block,*args,&finisher_proc)\n end\n HDLRuby::High.space_pop\n end",
"title": ""
},
{
"docid": "45d6ef7923ccde3e9b98c6411da7ad5a",
"score": "0.5171194",
"text": "def bb_unconditional_branch\n @file.puts \" @current_block.left = arg1.basic_block\"\n @file.puts \" @current_block.close\"\n @file.puts \" @current_block = new_basic_block\"\n end",
"title": ""
},
{
"docid": "9aae28bdf4c6bbcd495d0ceeae3f845f",
"score": "0.51686436",
"text": "def perform(&block)\n reset\n\n if valid?\n if use_event_attributes? && !block_given?\n each do |transition|\n transition.transient = true\n transition.machine.write(object, :event_transition, transition)\n end\n\n run_actions\n else\n within_transaction do\n catch(:halt) { run_callbacks(&block) }\n rollback unless success?\n end\n end\n end\n\n if actions.length == 1 && results.include?(actions.first)\n results[actions.first]\n else\n success?\n end\n end",
"title": ""
},
{
"docid": "c98ab6de4affc7637455e077257e5550",
"score": "0.5166365",
"text": "def run\n @ctx.call(self,&@blk) if @blk\n end",
"title": ""
},
{
"docid": "9985704ceb8eb6899d0191a4ff5c50e3",
"score": "0.5163689",
"text": "def accept(evaluator)\n evaluator.begin_end(self)\n end",
"title": ""
},
{
"docid": "06460283a486088f4d5a1be0490b7f23",
"score": "0.51626503",
"text": "def block(node, in_sentence=false)\n body = node.array\n body.each_with_index do |node, index|\n if body.length == index + 1 # last element\n if @in_method\n emit \"Finally we return \"\n end\n visit node, true\n emit \".\"\n else\n visit node, in_sentence\n emit '. '\n end\n end\n end",
"title": ""
},
{
"docid": "9c24531e2cdf653588b79c4d92c59dc0",
"score": "0.5148391",
"text": "def on_worktree(branch, &block)\n zombie_check \n yield checkout(branch) \n end",
"title": ""
},
{
"docid": "d1d07e051143606f1c34666b7832b0cd",
"score": "0.513446",
"text": "def pass_control_on_condition\n puts \"Inside the method\"\n yield if block_given? #only if the block present the yield will be executed\n # or yield\n # end\n puts \"Back inside the method\"\nend",
"title": ""
},
{
"docid": "9bf1b8d95cf5057b1784eeb15cd0518e",
"score": "0.51322037",
"text": "def run_callbacks(index = 0, &block)\n if transition = self[index]\n throw :halt unless transition.run_callbacks(after: !skip_after) do\n run_callbacks(index + 1, &block)\n {result: results[transition.action], success: success?}\n end\n else\n persist\n run_actions(&block)\n end\n end",
"title": ""
},
{
"docid": "fae3dea97d94a6d05c5c7a85a7c8b28c",
"score": "0.51307243",
"text": "def accept(evaluator)\n evaluator.block(self)\n end",
"title": ""
},
{
"docid": "20cbbefb3e728d0ed70331227f7ded9a",
"score": "0.512827",
"text": "def each_callback(&block)\n visit_node_for_callbacks(root, block)\n end",
"title": ""
},
{
"docid": "48ac1c31bfddf3539fcadead4c053e38",
"score": "0.5103919",
"text": "def callback(&block)\n @callbacks ||= []\n @callbacks << block\n end",
"title": ""
},
{
"docid": "17bd5db584ca46c1788e72c11403022b",
"score": "0.5100354",
"text": "def block_checker(param) \n [ param , block_given? ]\nend",
"title": ""
},
{
"docid": "11791f7895b9ebc25128770a325098ed",
"score": "0.5098765",
"text": "def traverse_balanced(other, callbacks = nil, &block)\n traverse_balanced(self, other, callbacks ||\n Diff::LCS.YieldingCallbacks, &block)\n end",
"title": ""
},
{
"docid": "95886832b7bbdfd7910132f7af22ad50",
"score": "0.50906295",
"text": "def call_block\n puts \"start\"\n yield \"foobar\" if block_given?\n puts \"end\"\nend",
"title": ""
},
{
"docid": "011d376e1ff598f8b1f01f1e37899602",
"score": "0.5082958",
"text": "def block_and_forth_forever(&block)\nend",
"title": ""
},
{
"docid": "011d376e1ff598f8b1f01f1e37899602",
"score": "0.5082958",
"text": "def block_and_forth_forever(&block)\nend",
"title": ""
},
{
"docid": "011d376e1ff598f8b1f01f1e37899602",
"score": "0.5082958",
"text": "def block_and_forth_forever(&block)\nend",
"title": ""
},
{
"docid": "f72fffad7cf9eae66d723cd39e0c1941",
"score": "0.5064759",
"text": "def speak_the_truth\n yield \"Boris\" if block_given?\nend",
"title": ""
},
{
"docid": "79aad94c674cd165164003b8920df65a",
"score": "0.5055328",
"text": "def after_block_boundary?; end",
"title": ""
},
{
"docid": "3698df6c61a54008db8320850922e393",
"score": "0.50529",
"text": "def on_finish(path, &block)\n rules.add(path, Sawtooth::Rules::CallRule.new(:finish => block)) if block_given?\n end",
"title": ""
},
{
"docid": "9e172bd0691f6553a9024930d612996d",
"score": "0.5052373",
"text": "def run_block\n if @block\n _block = @block\n @block = nil\n instance_eval &_block\n true\n end\n end",
"title": ""
},
{
"docid": "ad167a824a1a57aeb7a917d1a24f472b",
"score": "0.504226",
"text": "def block?; end",
"title": ""
},
{
"docid": "b42fb776190bfc22af5f6976c8657785",
"score": "0.50394773",
"text": "def block_given?() end",
"title": ""
},
{
"docid": "43a0342361ee7a9d71d423c6dd28de7a",
"score": "0.5036444",
"text": "def run_around_hook(name, *args, &block)\n raise ArgumentError.new(\"block is mandatory\") unless block\n if callbacks = hooks[name.to_sym]\n callbacks.reverse.inject(block) do |blk, callback|\n proc do\n callback.call *args do\n blk.call\n end\n end\n end.call\n else\n yield\n end\n end",
"title": ""
},
{
"docid": "43328f5b15a362ac4cd1905b8a1da714",
"score": "0.503049",
"text": "def run_callbacks(kind, *args, &block)\n run_cascading_callbacks(cascadable_children(kind), kind, *args) {}\n super(kind, *args, &block)\n end",
"title": ""
},
{
"docid": "5f6d3dc32e00b6f496b4ba4f8c2161b3",
"score": "0.50302833",
"text": "def apply(&blk)\n Rubylude.new ->() {\n while value = @generator.resume\n Fiber.yield blk.call(value)\n end\n }\n end",
"title": ""
},
{
"docid": "1e2eda5cc4cef1d8bf2e2de815e1ea1e",
"score": "0.50287396",
"text": "def execute_block(block)\n case\n when block.is_a?(Symbol)\n send(block)\n when block.respond_to?(:call) && (block.arity == 1 || block.arity == -1)\n block.call(self)\n else\n block\n end \n end",
"title": ""
},
{
"docid": "8704aa172169b473166d32461ac8e76b",
"score": "0.5017526",
"text": "def callback(&block)\n return yield if closed?\n @callbacks << block\n end",
"title": ""
},
{
"docid": "5c20a082785be3b2ddb68e00a76474df",
"score": "0.5000978",
"text": "def test3\n\tputs \"Entering test method\"\n\tl = ->{ puts \"Entering lambda\"; break; puts \"Exiting lambda\" }\n\tl.call\n\tputs \"Exiting test method\"\nend",
"title": ""
},
{
"docid": "214a9d17165f9c652269ecc62929e38a",
"score": "0.4989182",
"text": "def test(&block)\n puts \"inside test -- calling block\"\n block.call\n puts \"inside test -- after calling block\"\n yield\nend",
"title": ""
},
{
"docid": "ae6bebc4bcc9fd9347b43a1281d2b5d5",
"score": "0.4988389",
"text": "def test_early_exit_needed_in_contexts_with_method_return_value_set\n method_context = @manager.enter_method_scope(@test_self)\n method_context.return_type = Constants[\"Boolean\"]\n flow_context = @manager.enter_flow_control_block_scope()\n flow_context.set_return(Constants[\"true\"])\n assert_true flow_context.need_early_exit\n @manager.leave_scope(flow_context)\n assert_true method_context.need_early_exit\n @manager.leave_scope(method_context)\n end",
"title": ""
},
{
"docid": "3259a63a5b83e54a4d30c79a81e5294c",
"score": "0.4988038",
"text": "def callback(&block)\n @callbacks << block\n end",
"title": ""
},
{
"docid": "b0d5074f5878ba252570927dc83e7bc1",
"score": "0.49825487",
"text": "def method3(&block)\n if block\n \"The block evaluates to #{block.call}\"\n else\n \"No block.\"\n end\nend",
"title": ""
},
{
"docid": "b0d5074f5878ba252570927dc83e7bc1",
"score": "0.49825487",
"text": "def method3(&block)\n if block\n \"The block evaluates to #{block.call}\"\n else\n \"No block.\"\n end\nend",
"title": ""
},
{
"docid": "79078fecc9461fde1b1085dc1d5f2784",
"score": "0.49768108",
"text": "def run_cascading_callbacks(children, kind, *args, &block)\n if child = children.pop\n run_cascading_callbacks(children, kind, *args) do\n child.run_callbacks(child_callback_type(kind, child), *args) do\n block.call\n end\n end\n else\n block.call\n end\n end",
"title": ""
},
{
"docid": "b57cb98d75b1fa47452aaebced04469e",
"score": "0.49743629",
"text": "def yield\n wait\n callback\n end",
"title": ""
},
{
"docid": "9ea2c4bb891ded7a4d1b6bff775ec479",
"score": "0.49614263",
"text": "def call_block\n @_block.call(self) if @_block\n end",
"title": ""
},
{
"docid": "8df7436b7c3f72364b619c4151ed18db",
"score": "0.4959615",
"text": "def g(&b)\n c = self\n return lambda { \n break false if !c.probe\n b.call(c.rcv)\n break true \n }\n end",
"title": ""
},
{
"docid": "d4510e807db69b531c69dffa6ec7ef28",
"score": "0.49517715",
"text": "def call(*args)\n block.call(*args) if block\n end",
"title": ""
},
{
"docid": "3d7b287914674f6cd5aa9b21e61c2e6e",
"score": "0.49445003",
"text": "def my_method\n puts \"reached the top\"\n yield\n puts \"reached the bottom\"\nend",
"title": ""
},
{
"docid": "6a4a66ab4c96724e2f5b722573d6c741",
"score": "0.49376073",
"text": "def callback(&block)\n super do |*args|\n safe_deferrable_block(*args, &block)\n end\n end",
"title": ""
},
{
"docid": "9e84374107da8bcd2e73626568d9858d",
"score": "0.49376068",
"text": "def block_test\n\n puts \"We're in the method!\"\n puts \"Yielding to the block...\"\n yield #this expression allows the method to receive and execute a block\n puts \"We're back in the method!\"\nend",
"title": ""
},
{
"docid": "6d46e66a2e198da5be16f491c31e8ab7",
"score": "0.4936792",
"text": "def execute\n [lambda, block].each do |aProc|\n next unless aProc\n aProc.call\n end\n end",
"title": ""
},
{
"docid": "6d46e66a2e198da5be16f491c31e8ab7",
"score": "0.4936792",
"text": "def execute\n [lambda, block].each do |aProc|\n next unless aProc\n aProc.call\n end\n end",
"title": ""
},
{
"docid": "f61b25ba1c4dd5fa11b9d6b379f68453",
"score": "0.49332094",
"text": "def perform_transition(transition, *args)\n state_machine.perform_transition(transition) do |callback, around_transition|\n around_args = [around_transition, transition, *args]\n evaluate_around_transition(:before, *around_args)\n evaluate(callback, *args)\n evaluate_around_transition(:after, *around_args)\n end\n end",
"title": ""
},
{
"docid": "61f19dfcc01d71bf50ea078fe1ffc989",
"score": "0.4926562",
"text": "def callback_with(params)\n Botfly.logger.debug(\"RSP: Launching callback with params: #{params.inspect}\")\n\n context = callback_context(params)\n if @matcher_chain.all? {|matcher| matcher.match(params) }\n Botfly.logger.debug(\"RSP: All matchers passed\")\n cb = @callback # Ruby makes it difficult to apply & to an instance variable\n context.instance_eval &cb\n end\n end",
"title": ""
},
{
"docid": "7524cc933c776ea9f74b1df0b9e02378",
"score": "0.4918473",
"text": "def my_method(&my_block)\n\tputs \"We're in the method, about to invoke your block!\"\n\tmy_block.call\n\tputs \"We're back in the method!\"\nend",
"title": ""
},
{
"docid": "817321adbff3ab418a9ed4a690dd5cca",
"score": "0.49182504",
"text": "def accept(evaluator)\n evaluator.break_out(self)\n end",
"title": ""
},
{
"docid": "ac86cb2bf7641e9ccfd538fef3ccaa46",
"score": "0.4909472",
"text": "def call_block(block,stdout,stderr,exitstatus)\n # blocks that take no arguments have arity -1. Or 0. Ugh.\n if block.arity > 0\n case block.arity\n when 1 \n block.call(stdout)\n when 2\n block.call(stdout,stderr)\n else\n # Let it fail for lambdas\n block.call(stdout,stderr,exitstatus)\n end\n else\n block.call\n end\n end",
"title": ""
},
{
"docid": "6cdf7ea876b984ae0c393b0b285e3362",
"score": "0.4908137",
"text": "def commit_hook( &block ) # :yields:\n SQLite::API.commit_hook( @handler, block )\n end",
"title": ""
},
{
"docid": "f03f58d005f39e6f099d66ac5e787326",
"score": "0.4907922",
"text": "def runner(&blk); end",
"title": ""
},
{
"docid": "f03f58d005f39e6f099d66ac5e787326",
"score": "0.4907922",
"text": "def runner(&blk); end",
"title": ""
},
{
"docid": "0debe7740c5ce0d643fa2c4fc04d2be6",
"score": "0.49019003",
"text": "def abc(x, y, &b)\n puts x \n y.call \n binding.pry # break point here\n b.call if block_given?\nend",
"title": ""
},
{
"docid": "08454b5c9fe9c316b2ad9e44dbe460ca",
"score": "0.48894846",
"text": "def evaluate(block, *args)\n return if block.nil?\n if block.is_a? Symbol\n instance_exec(self, *args, &block)\n else\n instance_exec(*args, &block)\n end\n end",
"title": ""
},
{
"docid": "1c06ba362015e7dd9299a283233ffff6",
"score": "0.4888033",
"text": "def proceed\n hook = hooks[@hook_index]\n # -- If no more hook was found, calls target procedure and return\n hook or return self.returned = target_proc.call(*args, &block)\n # -- Set hook pointer to next, then call next hook\n @hook_index += 1\n begin\n self.returned = hook.call(self)\n ensure\n @hook_index -= 1\n end\n end",
"title": ""
},
{
"docid": "4243a60d8f6303f041d1db1914eba4a7",
"score": "0.48868838",
"text": "def each_callback_reverse(&block)\n fetch_or_create_callbacks.each_reverse(&block)\n parent.each_callback_reverse(&block)\n end",
"title": ""
},
{
"docid": "af70e30bdd73971dade1f185093b262f",
"score": "0.4880877",
"text": "def run(context, *args)\n @chain.each do |callback|\n callback.call(context, *args)\n end\n end",
"title": ""
},
{
"docid": "8948f24db5aa6cbc86a51e0763d3d664",
"score": "0.48800373",
"text": "def block_node_followed_by_fluent_method\n each_backward_chained_node(node, :child_as_second_arg) do |chained_node, child_node|\n next unless chained_node.send_type?\n return child_node if child_node.block_type?\n end\n end",
"title": ""
},
{
"docid": "c24338047be7289e35c411b5390c495a",
"score": "0.48737562",
"text": "def method_that_takes_a_block(&blk)\n p blk.call(\"hello\")\n p blk.call(\"World!\")\nend",
"title": ""
},
{
"docid": "c35ce6d476e4e3eb6d05183694b77c3b",
"score": "0.48718196",
"text": "def my_method\n puts \"Reached the top\"\n yield\n puts \"Reached the bottom\"\nend",
"title": ""
},
{
"docid": "81f6b0cc4b5dc3b2efeaf450a143b7a8",
"score": "0.48672128",
"text": "def use_blocker\n blocker do\n # next\n # break\n # return\n \"HA!\"\n # next\n # break\n # return\n end\n puts \"DONE!\"\nend",
"title": ""
},
{
"docid": "cff94a41fdae6d6e1da6adbf90f120a7",
"score": "0.48589945",
"text": "def compare(str, &block)\n puts \"Before: #{str}\"\n\n block_result = block.call(str)\n puts \"After: #{block_result}\"\nend",
"title": ""
},
{
"docid": "98be9536003e5a96f467cf2227b3a665",
"score": "0.48557645",
"text": "def my_method\n \n puts \"before proc\"\n\n my_proc = lambda{\n puts \"Inside proc\"\n #return\n #break\n }\n\n my_proc.call\n puts \"after proc\"\n\nend",
"title": ""
},
{
"docid": "96dc8f5d6e0a4d66586404bb46bb6ec2",
"score": "0.48544198",
"text": "def call_block\r\n puts \"Start of method\"\r\n yield\r\n yield\r\n puts \"End of method\"\r\nend",
"title": ""
},
{
"docid": "72279f018b12e529c776b21b21b46946",
"score": "0.48539883",
"text": "def traverse(&block); end",
"title": ""
},
{
"docid": "72279f018b12e529c776b21b21b46946",
"score": "0.48539883",
"text": "def traverse(&block); end",
"title": ""
},
{
"docid": "26287020fe769abdaebb5ec0999b5c0a",
"score": "0.48533228",
"text": "def accept(evaluator)\n evaluator.loop(self)\n end",
"title": ""
},
{
"docid": "fd4660d505a69a70d36908ef8af60141",
"score": "0.48523906",
"text": "def br(block)\n return if @finished\n @builder.br(block.is_a?(Generator) ? block.start_block : block.to_ptr)\n self.finish\n end",
"title": ""
},
{
"docid": "118322521c9ea2225e9bf5eb1acf10ed",
"score": "0.4848409",
"text": "def check_block\n finished = @finishable.nil? or @finishable.is_finished?\n puts finished\n if finished\n @finishable, @blocked = nil, false\n return @blocked\n end\n \n @blocked = !finished\n end",
"title": ""
},
{
"docid": "ee4d518df20ae33866a31ee51a73bf49",
"score": "0.48446974",
"text": "def work( payload, metadata )\n\t\tkey = metadata[:delivery_info].routing_key\n\t\tself.log.debug \"Routing a %s message...\" % [ key ]\n\n\t\tblocks = self.find_matching_blocks( key )\n\n\t\tself.log.debug \" calling %d block/s\" % [ blocks.length ]\n\t\treturn blocks.all? do |block|\n\t\t\tblock.bind( self ).call( payload, metadata )\n\t\tend\n\tend",
"title": ""
},
{
"docid": "338673a279ba65f8e2058b49bb0b57ce",
"score": "0.48439917",
"text": "def call_block\n puts 'Start'\n yield\n yield\n puts 'End'\nend",
"title": ""
},
{
"docid": "1e41821b4e09d874dbc3a2f1b5696ada",
"score": "0.48436052",
"text": "def each_statement(&block)\n @callback = block\n\n parse(START.to_sym)\n end",
"title": ""
},
{
"docid": "8f7ad514651fa9ec60e941e9f9712da8",
"score": "0.48434424",
"text": "def on_quorumchg(&block)\n\t\t@quorumchg_callback = block\n\tend",
"title": ""
},
{
"docid": "e7a4f64826ac6bc8dec322d7e722a75c",
"score": "0.4832126",
"text": "def actions\n response = nil\n\n lambda do |reason, data|\n puts \"Execute block code with reason : #{reason}\"\n break response = data\n end\n\n response\n end",
"title": ""
},
{
"docid": "f49a9a79f4b5cced3502508c8131a9bd",
"score": "0.48302564",
"text": "def call_block\n\tputs \"Start of method\"\n\tyield\n\tyield\n\tputs \"End of method\"\nend",
"title": ""
},
{
"docid": "90e491f4269fa8c7020c56a754843bbd",
"score": "0.48301816",
"text": "def my_method(&my_block)\n puts 'from my_method : before calling call method on my_block'\n my_block.call # call method calls the block\n puts 'from my_method : after calling call method on my_block'\n my_block.call\nend",
"title": ""
},
{
"docid": "2fb086f6574d6440b613dbba27fb2bf0",
"score": "0.4826529",
"text": "def run_proc_or_lambda(blockblock)\n puts \"station 1 of 3\"\n blockblock.call\n puts \"station 3 of 3\"\nend",
"title": ""
},
{
"docid": "87e3971434674298ffa612b4aa565cf0",
"score": "0.4822954",
"text": "def run_proc_or_lambda_2(blockblock)\n puts \"station 1 of 3\"\n blockblock.call\n puts \"station 3 of 3\"\nend",
"title": ""
},
{
"docid": "87e3971434674298ffa612b4aa565cf0",
"score": "0.4822954",
"text": "def run_proc_or_lambda_2(blockblock)\n puts \"station 1 of 3\"\n blockblock.call\n puts \"station 3 of 3\"\nend",
"title": ""
},
{
"docid": "7046f9388612e573c749609a1d1b3b69",
"score": "0.4820193",
"text": "def invoke_callbacks(record, type, from_state)\n # Transition callback\n kind = \"#{type}_transition_#{machine.attribute}\"\n \n result = if record.class.respond_to?(\"#{kind}_callback_chain\")\n record.class.send(\"#{kind}_callback_chain\").all? do |callback|\n # false indicates that the remaining callbacks should be skipped\n !matches?(from_state, callback.options) || callback.call(record) != false\n end\n else\n # No callbacks defined for attribute: always successful\n true\n end\n \n # Notify observers\n notify(\"#{type}_#{event.name}\", record, from_state, @options[:to])\n notify(\"#{type}_transition\", record, machine.attribute, event.name, from_state, @options[:to])\n \n result\n end",
"title": ""
},
{
"docid": "802d927c99787891c4ab2928dc1ad9ac",
"score": "0.4817744",
"text": "def some_damn_method\n\tputs \"Enterng method\"\n\t1.times { puts \"Entering block!\"; return }\n\tputs \"Exiting method\" # Never gets executed!\nend",
"title": ""
},
{
"docid": "8df01a08a16585ad02f6b52afe20b8d4",
"score": "0.48091143",
"text": "def execute_last &decision\n return execute_line @test_lines[-1], &decision\n end",
"title": ""
},
{
"docid": "79fd616c2f1557f1c01813638e5cdf82",
"score": "0.48070693",
"text": "def on_finished\n @flow_lock.synchronize do\n return unless finished?\n return if @on_finished_invoked\n\n @on_finished_invoked = true\n\n yield(@first_message, @last_message)\n end\n end",
"title": ""
}
] |
8086a66676c6908ee8dc02297fce9b92
|
POST /students POST /students.json
|
[
{
"docid": "1f17dae11e04b96eed58a94509398857",
"score": "0.7030532",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "b9fc48e0487439541cd53042b4f0ea70",
"score": "0.7277433",
"text": "def create\n @student = Student.new(student_params)\n\n if @student.save\n render json: @student, status: :created\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "70c8dce2f61b7cdf77b9f818fc304a0a",
"score": "0.7134142",
"text": "def create\n @student = current_user.students.create(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Registro Exitoso.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4dc262e1fc05a2d16efa395d9de2d22d",
"score": "0.7110679",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, :notice => 'Student was successfully created.' }\n format.json { render :json => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4dc262e1fc05a2d16efa395d9de2d22d",
"score": "0.7110679",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, :notice => 'Student was successfully created.' }\n format.json { render :json => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3dcd9607747f738b8b7312305fbc95f",
"score": "0.7036171",
"text": "def create\n @student = current_user.students.build(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to root_url, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0f65111ade326c2686f9c5cd98a7dec",
"score": "0.6978406",
"text": "def create\n\t\tp = params[:student]\n\t\thash = { :original_name => p['original_name'], :sort_name => Student.make_sort_name(p['original_name']), :other_name => p['other_name'],\n\t\t\t:gender => p['gender'] == 'Male' ? 'M' : 'F', :born => VagueDate.factory(p['born']).to_s, :died => VagueDate.factory(p['died']).to_s,\n\t\t\t:home_town => p['home_town']['town'], :home_state => p['home_town']['state'], :home_country => p['home_town']['country'],\n\t\t\t:biographical_notes => p['biographical_notes'], :quotes => p['quotes'], :additional_notes => p['additional_notes'], :private_notes => p['private_notes'], :is_stub => 0\n\t\t}\n\n\t\t@student = Student.new(hash)\n\t\t@student.generate_unique_name()\n\n\t\trespond_to do |format|\n\t\t\tif @student.save\n\t\t\t\tmarriages = parse_array(p['marriage'])\n\t\t\t\tmarriages.each {|marriage|\n\t\t\t\t\tif !marriage['name'].blank?\n\t\t\t\t\t\tMarriage.create_marriage(@student, { :name => marriage['name'] }, marriage['date'])\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\t\tresidences = parse_array(p['residence'])\n\t\t\t\tresidences.each {|residence|\n\t\t\t\t\tif !residence.blank?\n\t\t\t\t\t\tStudentResidence.create_residence(@student, residence)\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\t\tBrowse.student_changed(@student, nil)\n\t\t\t\tsolr().add_object(@student.to_solr())\n\n\t\t\t\tformat.html { redirect_to(@student, :notice => 'The student was successfully created.') }\n\t\t\telse\n\t\t\t\tformat.html {\n\t\t\t\t\t@page_title = 'Student'\n\t\t\t\t\tnew_setup()\n\t\t\t\t\trender :action => \"new\"\n\t\t\t\t}\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "89239240596e470b6096ef5b05278438",
"score": "0.6973629",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: \"Student was successfully created.\" }\n format.json { render json :show, status: :created, location: @student }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd2674f24e0b76827b9d53cea72ff335",
"score": "0.6951477",
"text": "def create\n @student = Student.new(student_params)\n\n if @student.save\n render :show, status: :created, location: @student\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.69502467",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949104",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949104",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949104",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949104",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949104",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949104",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949104",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949104",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949104",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949104",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656",
"score": "0.6949104",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4632fa31d127ba14d92a33a86b60a592",
"score": "0.69401443",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student,\n notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors,\n status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "825a96d10a5c685217de0dcd1bb72f66",
"score": "0.6930886",
"text": "def create\n @people_student = People::Student.new(people_student_params)\n\n respond_to do |format|\n if @people_student.save\n format.html { redirect_to @people_student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @people_student }\n else\n format.html { render :new }\n format.json { render json: @people_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d1c10d0e3cdcd4f33016b60f60920db",
"score": "0.6917391",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to root_path, notice: 'Student details were successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9778141972d70908f75a7da8c59c842c",
"score": "0.6891688",
"text": "def create\n # @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "856301593632350ffa84113387f2f712",
"score": "0.6883143",
"text": "def create\n validate_student(student_params)\n begin\n student = Student.create!(student_params)\n\n render json: {status: 'SUCCESS', message:\"Student registered Successfully with name #{student.name}\", data:student.reload}, status: :ok\n rescue => error\n render json: {message: error}\n end\n end",
"title": ""
},
{
"docid": "41e61e84224b1475da2de8de7fc3cd6c",
"score": "0.68819445",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41e61e84224b1475da2de8de7fc3cd6c",
"score": "0.6881521",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "454ef99e7f2a8f70c3a8415a4293b034",
"score": "0.6832057",
"text": "def create\n @student = @school.students.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to manage_school_school_path(@school), notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "39105d8762fba7f2f5abf1266ece2318",
"score": "0.6809308",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "14b21ad987729b9cafd208f5b75bb195",
"score": "0.6716124",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student Info was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "18dbd3d88d595a152df0ae92b004b43b",
"score": "0.6667074",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: '生徒情報が追加されました' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ccd404de8f50c65cd061bd1232cf7ba6",
"score": "0.6652385",
"text": "def create\n @student = Student.new(student_params)\n @student.user_id = current_user.id\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Estudiante ha sido satisfactoriamente creado.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8257015e8b29a0cf825dea7c7fee202a",
"score": "0.66407675",
"text": "def create\n @studentgrade = Studentgrade.new(params[:student])\n\n respond_to do |format|\n if @studentgrade.save\n format.html { redirect_to @studentgrade, notice: 'Student was successfully created.' }\n format.json { render json: @studentgrade, status: :created, location: @studentgrade }\n else\n format.html { render action: \"new\" }\n format.json { render json: @studentgrade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f14a99b7c318132bd188e2c3e287e3ec",
"score": "0.6639961",
"text": "def create\n @student = current_user.students.build(student_params)\n @student.status = 'imcomplete'\n respond_to do |format|\n if @student.save\n format.html { redirect_to students_url, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ba490e6e7fae39296ed54b4ffbebe65",
"score": "0.66389406",
"text": "def create\n @student_entity = StudentEntity.new(student_entity_params)\n\n respond_to do |format|\n if @student_entity.save\n format.json { render :show, status: :created, location: @student_entity }\n else\n format.json { render json: @student_entity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c46bb9a0cc66cd9d9749e596615f5711",
"score": "0.6632816",
"text": "def create\n @manage_student = Manage::Student.new(manage_student_params)\n\n respond_to do |format|\n if @manage_student.save\n format.html { redirect_to @manage_student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @manage_student }\n else\n format.html { render :new }\n format.json { render json: @manage_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c2195aae64ff785b008e1c923bdd0dd",
"score": "0.66266274",
"text": "def create\n @student = current_user.students.build(student_params)\n # @student = Student.new(student_params)\n # @student.user_id = current_user.id\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to admissions_url, success: 'Student record was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "00ef0cc8043f3834436f7059aa600387",
"score": "0.6610452",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to [:admin, @student], notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2ab281aad7d783f5270a484d019b1b0",
"score": "0.660684",
"text": "def create\n @student = @current_lop.students.build(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to lop_students_url, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65efceb8dcdf4274a5450ca0a1bdce19",
"score": "0.6579629",
"text": "def create\n @admin_student = Admin::Student.new(admin_student_params)\n\n respond_to do |format|\n if @admin_student.save\n format.html { redirect_to @admin_student, notice: \"Student was successfully created.\" }\n format.json { render :show, status: :created, location: @admin_student }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @admin_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e170e3fbe87338dac13c80d883b6d6b",
"score": "0.6561154",
"text": "def create\n @student = Student.new(admin_student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "98d58654bcfb0bf6e48528320d7e3c2c",
"score": "0.65421844",
"text": "def create\n @enrolled_student = EnrolledStudent.new(params[:enrolled_student])\n\n respond_to do |format|\n if @enrolled_student.save\n format.html { redirect_to @enrolled_student, notice: 'Enrolled student was successfully created.' }\n format.json { render json: @enrolled_student, status: :created, location: @enrolled_student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @enrolled_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf7a9892db9ca682f6b781a93a6a7488",
"score": "0.6533912",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n @schools_students = SchoolsStudent.new\n @schools_students.student_id = @student.id\n @schools_students.school_id = params[:school_id]\n @schools_students.save!\n\n @contract = Contract.new\n @contract.student_id = @student.id\n @contract.save!\n\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa61617e06b585652776ed6770ed1356",
"score": "0.6500559",
"text": "def create\n @student_test = StudentTest.new(params[:student_test])\n\n respond_to do |format|\n if @student_test.save\n format.html { redirect_to @student_test, notice: 'Student test was successfully created.' }\n format.json { render json: @student_test, status: :created, location: @student_test }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student_test.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9ca32c54ecfc1d8cee11a7ca1d811da",
"score": "0.6499561",
"text": "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n student_ids = params[:student_ids].to_a\n student_ids.each_with_index do |student_id|\n student = Student.where(id: student_id.to_i).first\n @team.students << student\n end\n end",
"title": ""
},
{
"docid": "5fdd938fa17e2e5d4a8c9a4630313a87",
"score": "0.649691",
"text": "def create\n @student = Student.new(params[:student])\n @student.save\n end",
"title": ""
},
{
"docid": "73fea7bafc18e60e7f2ba59560f687c4",
"score": "0.64919007",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to students_url, notice: 'Student was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "b123151e777dffa5774fdfad6571b190",
"score": "0.6485255",
"text": "def create\n @dojo_student = DojoStudent.new(params[:dojo_student])\n\n respond_to do |format|\n if @dojo_student.save\n format.html { redirect_to @dojo_student, notice: 'Dojo student was successfully created.' }\n format.json { render json: @dojo_student, status: :created, location: @dojo_student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dojo_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "867c64b50878442f3ac55f32b6037ff2",
"score": "0.6463496",
"text": "def create\n @studen = Studen.new(studen_params)\n\n respond_to do |format|\n if @studen.save\n format.html { redirect_to @studen, notice: 'Studen was successfully created.' }\n format.json { render :show, status: :created, location: @studen }\n else\n format.html { render :new }\n format.json { render json: @studen.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "206f7095ad49b44a6a1a2fe53769d596",
"score": "0.6461638",
"text": "def create\n @student_type = StudentType.new(student_type_params)\n\n if @student_type.save\n render json: @student_type, status: :created, location: @student_type\n else\n render json: @student_type.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5d58a83012d8856461c1985e29ffc831",
"score": "0.6459504",
"text": "def create\n @student_interest = StudentInterest.new(student_interest_params)\n\n respond_to do |format|\n if @student_interest.save\n format.html { redirect_to @student_interest, notice: 'Student interest was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student_interest }\n else\n format.html { render action: 'new' }\n format.json { render json: @student_interest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "35981c7afde3729b19041cdffea7f970",
"score": "0.6456268",
"text": "def create\n @student = Student.find(params[:student_id])\n @grade = @student.grades.new(grade_params)\n respond_to do |format|\n if @grade.save\n format.html { redirect_to student_grades_path, notice: 'Grade was successfully created.' }\n format.json { render :show, status: :created, location: @grade }\n else\n format.html { render :new }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9d16bd82d6d881e6831a6df7899cb73",
"score": "0.64547473",
"text": "def create\n @map_student = MapStudent.new(map_student_params)\n\n respond_to do |format|\n if @map_student.save\n format.html { redirect_to @map_student, notice: 'Map student was successfully created.' }\n format.json { render :show, status: :created, location: @map_student }\n else\n format.html { render :new }\n format.json { render json: @map_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "705dbe3660dfe55c898e030ac27252e6",
"score": "0.64474314",
"text": "def student\n\n\t\tif(params[:student_user_id].eql?('null') || params[:classroom_id].eql?('null') )\n\t\t\trender json: {status: \"error\", error: \"invalid-student-user-or-classroom\"}\n\t\telse\n\t\t\tstudent = StudentUser.joins(:classrooms)\n\t\t\t\t.joins(\"inner join teacher_users t on classrooms.teacher_user_id = t.id\")\n\t\t\t\t.where(\"t.id = ?\", @current_teacher_user.id)\n\t\t\t\t.where(\"classrooms.id = ?\", params[:classroom_id])\n\t\t\t\t.where(\"student_users.id = ?\" , params[:student_user_id])\n\t\t\t\t.first\n\n\t\t\tif(!student.nil?)\n\t\t\t\tstudent = student.as_json\n\t\t\t\tstudent.delete(\"salt\")\n\t\t student.delete(\"password_digest\")\n\t\t student.delete(\"oauth_expires_at\")\n\t\t student.delete(\"oauth_token\")\n\t\t student.delete(\"updated_at\")\n\t\t student.delete(\"create_at\")\n\n\t\t\t\trender json: {status: \"success\", student: student}\n\t\t\t\n\t\t\telse\n\n\t\t\t\trender json: {status: \"error\", error: \"invalid-student-user-or-classroom\"}\n\n\t\t\tend\n\t\tend\n\t\t\n\t\t\n\tend",
"title": ""
},
{
"docid": "d7b2bc77efb3f6f69174ea267be28c01",
"score": "0.64364517",
"text": "def create\n # binding.pry\n @student_id = StudentId.new(student_id_params)\n\n respond_to do |format|\n if @student_id.save\n if @enrolment\n format.html { redirect_to enrolment_student_ids_path(@enrolment), notice: 'Student was successfully created.' }\n else\n format.html { redirect_to student_ids_url, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student_id }\n end\n else\n format.html { render :new }\n format.json { render json: @student_id.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd3125e36a468967fb0435b830b58663",
"score": "0.64035356",
"text": "def create\n @student = Student.find(params[:student_id])\n @inschool = @student.inschools.create(params[:inschool])\n\n respond_to do |format|\n if @inschool.save\n StudentMailer.mailer_inschool(@student, @inschool).deliver\n format.html { redirect_to :back, notice: 'Inschool was successfully created and an email sent was sent to the teacher.' }\n format.json { render json: @inschool, status: :created, location: @inschool }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inschool.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b7f59957643e032579ffaac65af83208",
"score": "0.6380813",
"text": "def create\n\n @student_instrument = StudentInstrument.new(params[:student_instrument])\n\n @student = Student.find(params[:student_instrument][:student_id])\n\n respond_to do |format|\n if @student_instrument.save\n format.html { redirect_to @student, notice: 'Instrument was successfully added.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c5e98e865440e0e09db13144d4ff54f",
"score": "0.6373513",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n relate_with_courses\n format.html { redirect_to admin_student_path(@student), notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f739c71f74455f13fbaa0f2950442511",
"score": "0.63727856",
"text": "def create\n unless current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n # create team\n team = Team.create(name: params[:team_name], course: $selected_course)\n\n # add students to teams\n student_ids = params[:student_ids]\n student_ids.each do |student_id|\n StudentTeam.create(student_id: student_id, team: team)\n end\n\n render json: { success: true }\n end",
"title": ""
},
{
"docid": "924addb295bc6a49ed575c4aaa5f4ef1",
"score": "0.63546926",
"text": "def create\n hash = params[:post]\n student_id = hash[:student_id].to_i\n\n # check if student already has request submitted\n if Request.where(student_id: student_id).size > 0\n respond_to do |format|\n format.html { redirect_to Request.where(student_id: student_id).take, notice: 'You already have this request:' }\n format.json { render :show, status: 400 }\n end\n # check that student is registered\n elsif Student.where(id_num: student_id).size == 0\n respond_to do |format|\n format.html { redirect_to requests_path, notice: \"Invalid ID number: #{student_id}\" }\n format.json { render :show, status: 400 }\n end\n # create request\n else\n @request = Request.new(request_params)\n @request.student_id = student_id\n\n respond_to do |format|\n if @request.save\n format.html { redirect_to '/requests', notice: 'Request was successfully created.' }\n format.json { render :show, status: :created, location: @request }\n else\n format.html { render :new }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "160054dec5b8fa4df4affde76d574c8d",
"score": "0.6354462",
"text": "def create\n @studenttest = Studenttest.new(studenttest_params)\n\n respond_to do |format|\n if @studenttest.save\n format.html { redirect_to @studenttest, notice: 'Studenttest was successfully created.' }\n format.json { render :show, status: :created, location: @studenttest }\n else\n format.html { render :new }\n format.json { render json: @studenttest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5bf17851d9c2588df694acd7243484a",
"score": "0.63458616",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: '学生资料创建成功.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "544bed28b84c0c3eb8ba03b24011735c",
"score": "0.6342021",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n flash[:notice] = 'Student was successfully created.'\n format.html { redirect_to(students_url) }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2340d55ae9ca068c6c9fc41e3edc5063",
"score": "0.6321569",
"text": "def index\n @students = Student.all\n render json: @students\n end",
"title": ""
},
{
"docid": "3f85ce7b8ce0f605aec22da21cdfc197",
"score": "0.63190824",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n add_model_error_to_flash @student\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a87f5d257064b7f9bb5ad1c4c209540",
"score": "0.6318418",
"text": "def create\n @student = Student.new(student_params)\n @user = User.find_by_id(params[:user])\n @student.user = @user\n @department = Department.find_by_id(params[:department])\n @student.department = @department\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e485c5c1a4fe2fa3707abf588c277df",
"score": "0.6313066",
"text": "def create\n @student = Student.new(student_params)\n @student.kundenstatus = 1\n @student.percentage = 1\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7da9966404759007900e7967b6b6142a",
"score": "0.62969863",
"text": "def create\n @student_major = StudentMajor.new(student_major_params)\n\n respond_to do |format|\n if @student_major.save\n format.html { redirect_to @student_major, notice: 'Student major was successfully created.' }\n format.json { render json: @student_major, status: :created, location: @student_major }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student_major.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "747cde3d455c8b985b6aaaa797d19e59",
"score": "0.6291859",
"text": "def create\n @find_student = FindStudent.new(find_student_params)\n\n respond_to do |format|\n if @find_student.save\n format.html { redirect_to @find_student, notice: 'Find student was successfully created.' }\n format.json { render :show, status: :created, location: @find_student }\n else\n format.html { render :new }\n format.json { render json: @find_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2954eae41d2d32e29b47d2de7b77f8a1",
"score": "0.6291515",
"text": "def create\n @group_student = GroupStudent.new(group_student_params)\n\n respond_to do |format|\n if @group_student.save\n format.html { redirect_to @group_student, notice: 'Group student was successfully created.' }\n format.json { render :show, status: :created, location: @group_student }\n else\n format.html { render :new }\n format.json { render json: @group_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fca6e72733d0d3d42f4950361b829ea8",
"score": "0.6288522",
"text": "def create_new_student(student_name)\n object = controller_create(:student)\n fail format(\"Student '%s' not created.\", student_name) if object.nil?\n\n PrcLib.info(format(\"'student': '%s' created with id %s\",\n student_name,\n object[:id]))\n object\n end",
"title": ""
},
{
"docid": "6d9d488f846befe3f1dc1db2a6aa7264",
"score": "0.62874895",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n # Add the course just created to this student's courses, better use the drop down list \n if params[:course] != nil then\n @student.courses << Course.find(params[:course][:id])\n end\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22cd69c32113b7e185ae791e6d40c350",
"score": "0.6264566",
"text": "def create\n @student = Student.new(student_params)\n \n respond_to do |format|\n if @student.save\n format.html { redirect_to convert_path(@student) }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"title": ""
},
{
"docid": "24897aa772894fe97e7ee350cb18d13d",
"score": "0.62528604",
"text": "def create\n @student = Student.new(student_params)\n @teachers = Teacher.all\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: \"Student was successfully created.\" }\n else\n format.html { render :new, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9994165590a49278c1634db6aa50cc94",
"score": "0.6250481",
"text": "def index\n puts render json: @user.students, each_serializer: UserSerializer\n end",
"title": ""
},
{
"docid": "e812cdbe892507d0276390059b474cd8",
"score": "0.6246894",
"text": "def create\n @student_availability = StudentAvailability.new(params[:student_availability])\n\n @student = Student.find(params[:student_availability][:student_id])\n\n respond_to do |format|\n if @student_availability.save\n format.html { redirect_to @student, notice: 'Student availability was successfully created.' }\n format.json { render json: @student_availability, status: :created, location: @student_availability }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student_availability.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8eaac11f4ead4bb99be8672a510f4de7",
"score": "0.6245584",
"text": "def create\n\tif session[:user].nil?\n\t\tredirect_to('/login/login')\n\tend\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to(@student, :notice => 'Student was successfully created.') }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c0748958dfafa8a5e91439ed7385a7b",
"score": "0.6238355",
"text": "def create\n\t\t#for each student, create student params\n\t\t@student = Student.create!(student_params)\n\t\t#once created, go back to students path\n\t\tredirect_to students_path\n\t#wrap up \"create\" action\n\tend",
"title": ""
},
{
"docid": "a86e93bd9fa545849876314d09bbb13f",
"score": "0.6208379",
"text": "def create\n @ststu = Ststu.new(ststu_params)\n\n respond_to do |format|\n if @ststu.save\n format.html { redirect_to @ststu, notice: 'Ststu was successfully created.' }\n format.json { render :show, status: :created, location: @ststu }\n else\n format.html { render :new }\n format.json { render json: @ststu.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1284f61edc6dea3b14703101f62944a",
"score": "0.62067956",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n\n #-CONNECT THE SCHOOL AND THE STUDENT IF @school IS PRESENT\n @student.schools << @school if @school\n\n format.html { redirect_to school_student_path(@student.school,@student), notice: 'Student creation successful.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56ebc9ea62255534fc641471987b2add",
"score": "0.6204302",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n flash[:success] = t('student.created')\n format.html { redirect_to(students_path) }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n flash[:error] = t('default_error_message')\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db9c93daeb519f153ea43bef4ab92884",
"score": "0.62038535",
"text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to(@student, :notice => 'Student was successfully created.') }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e668af36a24c1261d41361896c01e77",
"score": "0.62027335",
"text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end",
"title": ""
},
{
"docid": "4e668af36a24c1261d41361896c01e77",
"score": "0.62027335",
"text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end",
"title": ""
},
{
"docid": "4e668af36a24c1261d41361896c01e77",
"score": "0.62027335",
"text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end",
"title": ""
},
{
"docid": "4e668af36a24c1261d41361896c01e77",
"score": "0.62027335",
"text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end",
"title": ""
},
{
"docid": "4e668af36a24c1261d41361896c01e77",
"score": "0.62027335",
"text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end",
"title": ""
},
{
"docid": "4e668af36a24c1261d41361896c01e77",
"score": "0.62027335",
"text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end",
"title": ""
},
{
"docid": "4e668af36a24c1261d41361896c01e77",
"score": "0.62027335",
"text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end",
"title": ""
},
{
"docid": "4e668af36a24c1261d41361896c01e77",
"score": "0.62027335",
"text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end",
"title": ""
},
{
"docid": "4e668af36a24c1261d41361896c01e77",
"score": "0.62027335",
"text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end",
"title": ""
},
{
"docid": "4e668af36a24c1261d41361896c01e77",
"score": "0.62027335",
"text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end",
"title": ""
},
{
"docid": "4e668af36a24c1261d41361896c01e77",
"score": "0.62027335",
"text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end",
"title": ""
},
{
"docid": "73bdf8b105684efe0da41e0b3f71486b",
"score": "0.6197424",
"text": "def create\n @student = @group.students.new(student_params)\n respond_to do |format|\n if @student.save\n format.html { redirect_to group_students_path(@group), notice: 'Student was successfully created.' }\n else\n format.html { redirect_to group_students_path(@group), notice: \"Student couldn't be created\" }\n end\n end\n end",
"title": ""
}
] |
6d18357a2cbd2b705132b4b545d43ff1
|
O(n 2) == time O(1) == space
|
[
{
"docid": "61b6582951fe194de8769bbe70b95da3",
"score": "0.0",
"text": "def okay_two_sum?(array, target)\n array = array.sort\n i = 0\n j = array.length - 1\n while i < j\n if ((array[i] + array[j]) <=> target) == 0\n return true\n elsif ((array[i] + array[j]) <=> target) == -1\n i += 1\n else\n j -= 1\n end\n end\n false\nend",
"title": ""
}
] |
[
{
"docid": "27f29666484272c0d973e8400c4c357c",
"score": "0.669435",
"text": "def hash_two_sum?(arr, num)\n hash = Hash.new(0) #O(1) work\n arr.each do |ele| # N times\n return true if hash.has_key?(num - ele) # O(1) work\n hash[ele]+= 1 # O(1) work\n end\n false\nend",
"title": ""
},
{
"docid": "9bfaea331eedce3072d8464bb5cccee1",
"score": "0.66519535",
"text": "def fast_two_sum?(arr)\n # O(n) in time and space\n result = []\n complements = {}\n\n arr.each_with_index do |el, i|\n if complements[el]\n result.push([complements[el], i])\n else\n complements[-el] = i\n end\n end\n result\n #result.sort\nend",
"title": ""
},
{
"docid": "239f4a4623ff9a2dc517cbbef43d4f3d",
"score": "0.65187144",
"text": "def optimize_for_space(arr)\n arr[0...-1].each_with_index do |el, idx|\n arr[idx + 1..-1].each do |el2|\n return el if el == el2\n end\n end\n \"No Duplicates\"\nend",
"title": ""
},
{
"docid": "0efc7a02b62549839a88810fbfd32865",
"score": "0.6484452",
"text": "def largest_contiguous_subsum_two(list)\n\n largest_sum = list.first # O(1)\n current_sum = list.first # O(1)\n\n list[1..-1].each do |ele| # O(n)\n if current_sum < 0 # O(1)\n current_sum = 0 # O(1)\n end\n current_sum += ele # O(1)\n if current_sum > largest_sum # O(1)\n largest_sum = current_sum # O(1)\n end\n end\n largest_sum # O(1)\nend",
"title": ""
},
{
"docid": "83415dea3d7100c1aaecd6d3d6b40414",
"score": "0.64240897",
"text": "def largest_contiguous_subsum(list) #O(n^2)\n sub_arrs = [] #O(1)\n num = list.first #O(1)\n (0...list.length).each do |i| #O(n)\n (i...list.length).each do |j| #O(n)\n sub_arrs << list[i..j] #??? O(1)\n #sub_arrs.shift O(n)\n #the length of sub_arrs\n end\n end \n p sub_arrs #O(1)\n sub_arrs.each do |sub| #O(n)\n if sub.sum > num #O(1)\n num = sub.sum #O(1)\n end \n end \n num #O(1)\nend",
"title": ""
},
{
"docid": "5faa084714c4a46eb2c34115a33416f7",
"score": "0.6398995",
"text": "def second_anagram?(str1, str2) #=> FINAL RUN TIME O(n * m)\n\n arr1 = str1.chars #> O(n)\n arr2 = str2.chars #> O(m)\n\n arr1.each do |char| #> O(n)\n # debugger\n index = arr2.find_index(char) #> O(m)\n #at this point its O(n * m)\n return false if index.nil? #> constant\n arr2.delete_at(index) #> O(m)\n end\n #at this point its O(n * 2m)\n \n # debugger\n arr2.empty? #> constant\nend",
"title": ""
},
{
"docid": "c11c0362d3fc52907ab88c5759edd215",
"score": "0.6363901",
"text": "def okay_two_sum?(arr, target)\n merge_sort(arr) #==> time nlogn space nlogn\n\n\nend",
"title": ""
},
{
"docid": "776e1e575ed5bf61222252f083ea2762",
"score": "0.63164896",
"text": "def my_min_two(arr)\n\n min = arr.first # O(1)\n (1...arr.length).each do |idx| # O(n)\n ele = arr[idx] # O(1)\n if ele < min # O(1)\n min = ele # O(1)\n end\n end\n min #O(1)\nend",
"title": ""
},
{
"docid": "935543033b8f39002c5f47c08c759ee6",
"score": "0.624579",
"text": "def two_sum?(arr, target_sum) # O(n + n)\n hash = Hash.new(0)\n arr.each do |ele|\n return true if hash.has_value?(ele)\n hash[ele] = target_sum - ele\n end\n false\nend",
"title": ""
},
{
"docid": "fd65d1f145815f32f434c3a3931d3c93",
"score": "0.618684",
"text": "def solution(a)\n a1 = []\n a2 = []\n len = a.length\n count = 0\n \n a.each_with_index do |el, i|\n a1 << i-el\n a2 << i+el\n end\n \n a1.sort\n a2.sort\n \n (len-1).downto(0) do |i|\n position = a2.find_index(a1[i])\n if position && position >= 0\n while ((position < len) && (a2[position] == a1[i])) do\n position += 1\n end\n count += position \n else\n insertion_point = -(position+1)\n count += insertion_point\n end\n end\n \n sub = len*((len+1)/2)\n \n return -1 if (count > 10000000)\n \n count\nend",
"title": ""
},
{
"docid": "493b5a14181948ed7023ef25a7072f0c",
"score": "0.61858356",
"text": "def largest_contiguous_subsum2(list)\n largest = list.first #O(1)\n current = list.first #O(1)\n\n (1...list.length).each do |idx| #O(n)\n current = 0 if current < 0 #O(1)\n current += list[idx] #O(1)\n largest = current if current > largest #O(1)\n end\n largest #O(1)\nend",
"title": ""
},
{
"docid": "0cd0dca9f402460a97da29bda7381e87",
"score": "0.61773956",
"text": "def hash_two_sum?(arr, target) # O(n)\n hash = Hash.new(false)\n arr.each do |el|\n return true if hash[el]\n\n hash[target - el] = true\n\n end\n false\n\nend",
"title": ""
},
{
"docid": "31355426dbb55bf18ba7aad5f3fe3519",
"score": "0.6143605",
"text": "def my_min2(list) #Time complexity is O(n)\r\n list.inject {|acc, ele| ele < acc ? ele : acc}\r\nend",
"title": ""
},
{
"docid": "317ad69d7d130de107e1067b86648abd",
"score": "0.6127679",
"text": "def two_sum?(arr, target_sum) #O(n)\n my_hash = Hash.new()\n arr.each do |el|\n return true if my_hash[target_sum - el]\n my_hash[el] = true\n end\nend",
"title": ""
},
{
"docid": "35c1fdbbf3eca5625d8610e7e62d07e9",
"score": "0.61272997",
"text": "def best_two_sum?(arr, target_sum) # O(n)\n hash = Hash.new\n arr.each_with_index do |u, i|\n return true if hash.has_key?(target_sum - u) \n hash[u] = i unless hash.has_key?(u) \n end \n false \nend",
"title": ""
},
{
"docid": "70e4778e3c82d210e8e4db513ad99f11",
"score": "0.6110615",
"text": "def two_sum?(arr, target_sum) #! O(n) \n h = Hash.new()\n arr.each do |ele|\n return true if !h[target_sum - ele].nil?\n h[ele] = true #{0=>true, 1=>true }\n end\n false\nend",
"title": ""
},
{
"docid": "3e34ded6668b4b9f9b5ab1abffa42cc2",
"score": "0.6096442",
"text": "def two_sum?(arr,target_sum) #O(n)\n hash = Hash.new#(false)\n\n arr.each do |el| \n hash[el] = true\n return true if hash[target_sum-el] \n # arr.each do |el| \n # if el*2 != target_sum\n # return true if hash[(target_sum-el)] > 0 \n # else \n # return true if hash[(target_sum-el)] > 1\n # end\n end\n false\nend",
"title": ""
},
{
"docid": "57a6a85e87398ed3158dc08d4affa40d",
"score": "0.6085042",
"text": "def contiguous_2(arr) # Time complexity = 0(n)\r\n # return arr.max if arr.all? {|el| el < 0}\r\n max = arr.first\r\n temp = arr.first\r\n\r\n (1...arr.length).each do |i|\r\n temp = 0 if temp < 0\r\n temp += arr[i]\r\n max = temp if temp > max\r\n end\r\n\r\n max\r\nend",
"title": ""
},
{
"docid": "7b04dd65acad56caf34a9411ae237578",
"score": "0.60817444",
"text": "def perfect_two_sum?(arr, target_sum)\n complements = {}\n arr.each_with_index do |el, i| # O(N)\n complement, _ = complements[target_sum - el] # O(1)\n return true if complement # O(1)\n complements[el] = [el, i] # O(1)\n end\n false\nend",
"title": ""
},
{
"docid": "4a508141929402755c08c3a7697315dd",
"score": "0.6074441",
"text": "def two_sum?(arr, target) # O(n)\n hash = Hash.new(0)\n arr.each { |num| hash[num] += 1}\n arr.each do |num|\n diff = target - num\n hash[num] -= 1\n return true if hash[diff] > 0\n end\n\nend",
"title": ""
},
{
"docid": "a9dc25cf4af7567e1a64bd10e1bd8ec2",
"score": "0.60495627",
"text": "def okay_two_sum?(arr, target) # O(nlogn)\n new_arr = arr.sort\n #hardcode lol\n return false if target < new_arr.first || target > new_arr.last\n new_arr.each_with_index do |el, idx| # O(n)\n new_arr.delete_at(idx)\n # times O(log(n)) == O(nlog(n))\n return true if new_arr.binary_search(target - el)\n end\n false\nend",
"title": ""
},
{
"docid": "d40fb1372be302f457e9d2d28c4b115f",
"score": "0.60451365",
"text": "def largest_contiguous_subsum(list)\n new_list = []\n i = 0\n while i < list.length # O(n)\n j = i\n while j < list.length # O(n)\n sub = list[i..j] # O(n)\n new_list << sub\n j += 1\n end\n i += 1\n end\n largest_sub_sum = new_list[0].sum #O(n)\n \n new_list.each do |sub| # O(n)\n sub_sum = sub.sum # O(n)\n largest_sub_sum = sub_sum if largest_sub_sum < sub_sum\n end\n\n p new_list\n return largest_sub_sum\nend",
"title": ""
},
{
"docid": "a31a2f6b441fe09b0bbc829d05e75aaa",
"score": "0.6034998",
"text": "def okay_two_sum?(arr, target)\n arr.sort! # O(n*log(n))\n arr.each_with_index do |ele, i| #O(n)\n new_target = target - ele #O(1)\n # new_array = arr[0...i]+ arr[i+1..-1] #O(n)\n \n found? = bsearch(arr, new_target) \n return true if found?\n end\n false\nend",
"title": ""
},
{
"docid": "38b7f8e747fa0f6234e08538bec69b36",
"score": "0.6032571",
"text": "def two_sum_2?(array, target) #O(nlogn)\n array = array.sort\n\n sum_binary_search(array, target)\nend",
"title": ""
},
{
"docid": "c978c895d39f4228b0e144beeaf88f7c",
"score": "0.60258234",
"text": "def removNb_inefficient(n)\n sigma = n*(n+1)/2 # First find the sum of the first n numbers\n (1..n).each do |i| # Start one iteration from 1 to n, call that i\n (i+1..n).each do |j| # Start an inner iteration fron i+1 to n\n product = i*j \n gap_sum = sigma - i - j\n if product == gap_sum # if it meets our conditions then we're done\n return [[i,j],[j,i]]\n end\n end\n end\n return [] # if we have gotten this far then we have no solution\nend",
"title": ""
},
{
"docid": "803ddb77c208610ac4827e994b451008",
"score": "0.60193086",
"text": "def better_two_sum(arr, target)\n sorted = arr.sort #n log n\n sorted.each do |ele|\n dif = target - ele\n return true if sorted.bsearch{|x| x == dif}\n end\n false\nend",
"title": ""
},
{
"docid": "876b1577ae1ba612137db52a7a2ae711",
"score": "0.5987495",
"text": "def dec2FactString(nb)\n facts = []\n current = 1\n while nb > (fact = fact(current)) do # QUESTION: is this O(logn) or O(n)?\n facts << fact\n current += 1\n end\n\n result = []\n facts.reverse_each do |factorial|\n multiple = (nb/factorial).floor\n nb -= multiple*factorial\n result << code(multiple)\n end\n result.push(0).join\nend",
"title": ""
},
{
"docid": "41268aff6b061336cdc9037c85f3e61e",
"score": "0.59819883",
"text": "def largest_contiguous_subsum2(arr)\n global = arr.first\n\n (0...arr.length).each do |i| # O(n)\n global = arr[i] if arr[i] > global #O(1)\n cur = arr[i..-1].sum #O(n)!!!\n global = cur if cur > global #O(1)\n if i > 0 #0(1)\n cur = arr[0..-i].sum\n global = cur if cur > global #O(1)\n end\n end\n\n global\nend",
"title": ""
},
{
"docid": "9f058d080f26f609192ec4bbdb27a792",
"score": "0.59808356",
"text": "def two_sum_time(arr, sum)\n hash = {}\n arr.each do |n|\n hash[n] ? hash[n] += 1 : hash[n] = 1\n end\n\n result = []\n arr.each do |n|\n if hash[sum - n] && hash[sum - n] > 0\n hash[sum - n] -= 1\n hash[n] -= 1\n result.push([n, sum - n])\n end\n end\n result\nend",
"title": ""
},
{
"docid": "93130c8daa8400765b524e600c975aeb",
"score": "0.5975096",
"text": "def okay_two_sum?(arr, target)\n sorted = arr.sort # O(nlog(n))\n i = 0 # O(1)\n k = arr.length - 1 # O(1)\n while i < k # O(n)\n if target > arr[i] + arr[k] # O(1)\n i += 1 # O(1)\n elsif target < arr[i] + arr[k] # O(1)\n k -= 1 # O(1)\n else\n return true # O(1)\n end\n end\n return false # O(1)\nend",
"title": ""
},
{
"docid": "b610d2c664f8f0d4a183485fcb45a142",
"score": "0.5968555",
"text": "def better_two_sum?(arr, target)\n arr = arr.sort #nlogn\n arr.each_with_index do |ele , i |\n newarr=arr[0...i] + arr[i+1..-1]\n return true if newarr.bsearch_index{|ele2| target <=> ele2+ele }\n end\n false\nend",
"title": ""
},
{
"docid": "369faf5bab4f52230e0f993b5e42ce07",
"score": "0.59420925",
"text": "def find_duplicate(nums)\n slow = nums.size\n fast = nums.size\n \n begin\n slow = nums[slow - 1]\n fast = nums[nums[fast - 1] - 1]\n end while slow != fast\n \n slow = nums.size\n \n while slow != fast\n slow = nums[slow - 1]\n fast = nums[fast - 1]\n end \n \n slow\nend",
"title": ""
},
{
"docid": "192bcf9450a22572062e7fbfe23813f8",
"score": "0.5941696",
"text": "def two_sum?(arr, target_sum) #O(n)\n complements = {}\n\n arr.each do |el|\n return true if complements[target_sum - el]\n complements[el] = true\n end\n\n false\nend",
"title": ""
},
{
"docid": "8ed9e1c4bbd46f60310713b392cc7706",
"score": "0.5939667",
"text": "def okay_two_sum?(array, target)\n sorted = array.sort #O(nlogn)\n # sorted.each do | |\n i = 0\n j = array.length - 1\n while i < j #O(n) or O(2n)\n case array[i] + array[j] <=> target\n when 0\n return true\n when -1\n i += 1\n when 1\n j -= 1\n end\n end\n false\nend",
"title": ""
},
{
"docid": "94b952c4eec254dafeaf15d164f67032",
"score": "0.5934134",
"text": "def slow_solution(m, a)\n n = a.size\n return 1 if n == 1\n distinct = 0\n n.times do |back|\n (back..n - 1).each do |front|\n if a[back..front] == a[back..front].uniq\n distinct += 1\n else\n break\n end\n end\n end\n distinct\nend",
"title": ""
},
{
"docid": "b8b7d7fb43e0a5b4979a1606497cab28",
"score": "0.58920586",
"text": "def better_subsum(list)\r\n largest_sum = nil # O(1)\r\n current_sum = nil # O(1)\r\n list.each_with_index do |ele, i| # O(n)\r\n if current_sum == nil\r\n current_sum = ele\r\n largest_sum = current_sum if largest_sum == nil\r\n else\r\n current_sum += ele\r\n end\r\n\r\n if current_sum >= largest_sum\r\n largest_sum = current_sum\r\n end\r\n\r\n if ele > current_sum\r\n largest_sum = ele if ele > largest_sum\r\n current_sum = ele\r\n end\r\n end\r\n largest_sum # O(1)\r\nend",
"title": ""
},
{
"docid": "1f26f0e986d493418768645c08c1d530",
"score": "0.58857447",
"text": "def my_min(array) \n min = array.first # O(1)\n array.each do |ele| #O(n)\n if ele < min #O(1)\n min = ele #O(1)\n end\n end\n min #O(1) \nend",
"title": ""
},
{
"docid": "13080714a25d11a8ff3932a231d9887a",
"score": "0.5883458",
"text": "def method_12478687(arr, i)\n # Simple first answer\n # Linear or O(n) behavior\n #arr.sort.each { |n| return n if n > i }\n\n # Logarithmic or O(log n) behavior\n # Divide-and-counquer algorithm\n #high, low = arr.partition { |n| n > i }\n #high.sort!\n #while high.first <= i\n # high, low = high.partition { |n| n > i }\n #end\n #high.first\n\n # Sort and select greater in the one iteration\n greater = 0\n arr.each do |n|\n next if n <= i\n if greater == 0 || n < greater\n greater = n\n end\n end\n greater\nend",
"title": ""
},
{
"docid": "58e1fa8bcd6897d0c0d2f244ac3d723b",
"score": "0.5869618",
"text": "def subsum(list) \r\n subs = []\r\n list.each_with_index do |el, i| #O(n)\r\n list.each_with_index do |el2, j| #O(n)\r\n subs << list[i..j] if j >= i #O(n)\r\n end\r\n end # => O(n^3)\r\n # O(n^2)\r\n subs.map{|sub| sub.sum}.max # => O(n)\r\nend",
"title": ""
},
{
"docid": "2a2ebe1a1fd9954758a8da36e30eb649",
"score": "0.5852441",
"text": "def two_sum?(arr, target_sum) #O(n)\n hash = {}\n arr.each do |n| #O(n)\n diff = target_sum - n\n return true if hash.has_key?(diff)\n hash[n] = :true\n end\n false\nend",
"title": ""
},
{
"docid": "452c6fdfa90d8f0c5139fe842a603452",
"score": "0.58318913",
"text": "def okay_two_sum?(arr, target_sum) #O(nlogn)\n sorted = arr.sort #O(nlogn)\n arr.each_with_index do |n, i| #O(n)\n search_space = arr.take(i) + arr.drop(1 + i) #O(1)\n return true if search_space.bsearch { |x| x + n == target_sum } #O(logn)\n end\n false\nend",
"title": ""
},
{
"docid": "930f889cd7f4a11f856b11aec3732ae8",
"score": "0.5827477",
"text": "def best_two_sum?(arr,target_value)\n #O(n)\n hashm=arr.inject(Hash.new {0}) {|acc,ele| acc[ele]+=1;acc}\n #O(n)# because has_key? is O(1) as get methods are and looping through each key\n hashm.any? {|k,v|hashm.has_key?(target_value-k) && target_value-k!=k || target_value-k==k && v>1}\n\nend",
"title": ""
},
{
"docid": "0d56c612a8a29b3bb1ff5b1962f8d274",
"score": "0.58232105",
"text": "def run_benchmark(n)\n puts \"Scale of #{n}\"\n Benchmark.bm(14) do |x|\n if n > 2\n puts \"O(n!) --- ommited for sake of brevity ---\"\n else\n x.report(\"O(n!):\"){ first_anagram?(\"elvis\" * n, \"lives\" * n) }\n end\n x.report(\"O(n^2):\"){ second_anagram?(\"elvis\" * n, \"lives\" * n) }\n x.report(\"O(n*long(n)):\"){ third_anagram?(\"elvis\" * n, \"lives\" * n) }\n x.report(\"O(n):\"){ fourth_anagram?(\"elvis\" * n, \"lives\" * n) }\n end\n puts \"\\n\\n\"\nend",
"title": ""
},
{
"docid": "c33a262c078fba27a9a84e7bbd69b546",
"score": "0.5817829",
"text": "def reordered_power_of2(n) #O(29logN)\n return true if n == 1\n n = digit_count(n)\n get_potentials.each { |p| return true if p == n }\n return false\nend",
"title": ""
},
{
"docid": "017bc001d930ec7de9d0a2e7ba32b85c",
"score": "0.58081776",
"text": "def merge_arrays(my_array, alices_array) \n\t# This answer gives us O(n lg n)\n\tnew_array = my_array + alices_array\n\treturn new_array.sort\n\nend",
"title": ""
},
{
"docid": "f2ed3d566a2141c44894258397e2c392",
"score": "0.57847923",
"text": "def okay_two_sum?(arr, target_sum)\n arr.sort! # O(n log n)\n arr.each.with_index do |ele,i| # O(n log n)\n target = target_sum - ele \n res = b_search(arr[0...i] + arr[i+1..-1], target) # exclude the current ele\n return true unless res.nil?\n end\n false \nend",
"title": ""
},
{
"docid": "24d201a78947761217e749797d11e670",
"score": "0.57828903",
"text": "def two_sum?(arr, target) # O(n) time complexity\n numbers = Hash.new(0)\n arr.each{ |num| numbers[num] += 1 }\n numbers.each do |k, v|\n new_target = target - k\n numbers[k] -= 1\n return true if numbers.has_key?(new_target) && numbers[new_target] > 0\n numbers[k] += 1\n end\n return false\nend",
"title": ""
},
{
"docid": "91c0866057b09aafebdc7ac091a60e17",
"score": "0.5775438",
"text": "def okay_two_sum?(arr, target) #(Onlogn ~ n^2) + n\n helper = arr.sort\n okay_helper(helper,target) \nend",
"title": ""
},
{
"docid": "855a55b7301e7286dd66d3d26709d17e",
"score": "0.57675153",
"text": "def problem_94\n py = lambda do |m,n|\n [m*m-n*n,2*n*m,m*m+n*n]\n end\n\n m,n,used = 2,1,0\n t,tt,r = 0,0,nil\n loop do\n r = py.call(m,n).sort\n if (r[2] - r[0]*2).abs == 1\n tt = r[2]*2 + r[0]*2\n puts \"#{m} #{n} #{r.inspect} circ=#{tt}\"\n used += 1\n if used == 2\n n = m\n used = 0\n end\n t += tt\n return(t-tt) if t > 1_000_000_000\n end\n m += 1\n end\nend",
"title": ""
},
{
"docid": "c4965a1ca289cd15ddbb0bec74d3b72a",
"score": "0.574827",
"text": "def big_O_N_squared_duplicates(unsorted_numbers)\n\n unsorted_numbers.each.with_index do |x, iX|\n unsorted_numbers.each.with_index do |y, iY|\n # Don't check the same indexes against each other\n unless iX == iY\n if x == y\n # Return True we found a match\n return true\n end\n end\n end\n end\n # No Matches\n false\nend",
"title": ""
},
{
"docid": "89caa527547cc17a2a97b3087a427bb4",
"score": "0.5725039",
"text": "def sort_two_sum?(arr, target_sum)\n # sorted_arr = [0,1,5,7] # O(n*logn)\n # iterating through the sorted_arr once = O(n)\n # final complexity = (n*logn + n)\n # simplified to just n*logn if using merge_sort logic\n arr.sort! #nlogn\n i1 = 0\n i2 = arr.length-1\n\n until i1 == i2 #n-1\n sum = arr[i1]+arr[i2]\n return true if sum == target_sum\n if sum > target_sum\n i2 -= 1\n else\n i1 += 1\n end\n end\n false\nend",
"title": ""
},
{
"docid": "136a29e54b559da66ff92b5c59aca492",
"score": "0.5721415",
"text": "def my_min_one(arr)\n\n # best case = O(n)\n # worse case = O(n^2)\n \n arr.each do |ele1| # O(n) \n if arr.all? { |ele2| ele1 <= ele2 } # O(n)\n return ele1 # O(1)\n end\n end\n false\nend",
"title": ""
},
{
"docid": "ba1958a12d523bd63f8d13a97f2ed084",
"score": "0.57207793",
"text": "def fibSeq(n)\n\ta=[0]\t\t\t\t\t\t# O(1)\n\tn.times do |index|\t\t\t\t# O(n)\n\t\tif index==0\t\t\t\t# O(1)\n\t\t\ta[index]=0\t\t\t# O(1)\n\t\telsif index==1\n\t\t\ta[index]=1\n\t\telse\n\t\t\ta[index] = a[index-1] + a[index-2] # O(n+n) \n\t\tend\n\tend\n\n\tputs \"Complete Array: #{a}\"\n\tevens = []\n\ta.each do |n|\n\t\tif n % 2 == 0\n\t\t\tevens.push(n)\n\t\tend\n\tend\n\tputs \"Evens: #{evens}\"\n\tsum = 0\n\tevens.each do |num| sum += num end\n\tputs \"Total: #{sum}\"\n\n\nend",
"title": ""
},
{
"docid": "ab4e79c7e14a2e995c2093c807f432c7",
"score": "0.57150227",
"text": "def removeDuplicates(nums)\n if nums.nil? then\n 0\n elsif nums.size<2 then\n nums.size\n else\n slow = fast = 1\n while fast<nums.size do\n if not nums[fast]==nums[fast-1] then\n nums[slow] = nums[fast]\n slow += 1\n end\n fast += 1\n end\n slow\n end\nend",
"title": ""
},
{
"docid": "c18b9d69d4ad89e9305b9d5ddec0d264",
"score": "0.57090795",
"text": "def third_anagram?(str1, str2) #> O(nlogn + mlogm)\n sorted1 = str1.chars.sort #> O(n) + O(nlogn) => O(nlogn)\n sorted2 = str2.chars.sort #> O(m) + O(mlogm) => O(mlogm)\n\n sorted1 == sorted2 #>O(n + m)\n\nend",
"title": ""
},
{
"docid": "012ea99e138983a5e645a3a718adddf8",
"score": "0.5708561",
"text": "def best_two_sum?(arr,target)#O(n)\n helper = Hash.new(0)\n arr.each do |k|\n helper[k] += 1\n end\n \n helper.each do |k,v|\n \n #puts \"#{k} #{helper.key?(target-k)}\"\n if helper.key?(target-k) && target != 2*k\n return true \n elsif v == 2 && target == 2*k\n return true \n end \n end \n return false \nend",
"title": ""
},
{
"docid": "cbae4c1508d3e608a257c7786afdfa1e",
"score": "0.5707792",
"text": "def z_algorithm(s)\n n = s.size\n return [] if n == 0\n \n z = [0]*n\n z[0] = n\n i, j = 1, 0\n while i < n\n j += 1 while i+j<n && s[j]==s[i+j]\n z[i] = j\n if j == 0 then\n i += 1\n next\n end\n k = 1\n while i+k<n && k+z[k]<j\n z[i+k] = z[k]\n k += 1\n end\n i += k\n j -= k\n end\n return z\nend",
"title": ""
},
{
"docid": "e617b7073527f445ebb2e838c9fd8ac1",
"score": "0.57055503",
"text": "def nlogn_search(array)\n #sorting from the longest to the shortest\n prc ||= Proc.new {|x, y| y.length <=> x.length}\n #return the first eleemtn\n array.merge_sort(&prc)[0]\nend",
"title": ""
},
{
"docid": "e1eaf9164fde5ff965529dfe5b458475",
"score": "0.5704519",
"text": "def reverse(s)\n if s.length == 1 #basecase\n return s \n else\n return reverse(s[1..-1]) + s[0]\nend\n\n\n# Time complexity: O(n)\n# Space complexity: O(n)\ndef reverse_inplace(s)\n if count == 0\n return false\n elsif s.even?\n s.reverse + s(count -1)\n else\n s + s(count - 1)\n end\nend\n\n# Time complexity: ?\n# Space complexity: ?\ndef bunny(n)\n raise NotImplementedError, \"Method not implemented\"\nend\n\n# Time complexity: ?\n# Space complexity: ?\ndef nested(s)\n raise NotImplementedError, \"Method not implemented\"\nend\n\n# Time complexity: ?\n# Space complexity: ?\ndef search(array, value)\n raise NotImplementedError, \"Method not implemented\"\nend\n\n# Time complexity: ?\n# Space complexity: ?\ndef is_palindrome(s)\n raise NotImplementedError, \"Method not implemented\"\nend\n\n# Time complexity: ?\n# Space complexity: ?\ndef digit_match(n, m)\n raise NotImplementedError, \"Method not implemented\"\nend",
"title": ""
},
{
"docid": "d19dab385e61f4b83b4bc0f3a0b2ac24",
"score": "0.57031167",
"text": "def big_O_1_first_item(numbers)\n # Same operation regardless of size of numbers\n numbers[0]\nend",
"title": ""
},
{
"docid": "3782cd4d63a13c9023cfe1294a685e47",
"score": "0.57015824",
"text": "def second_anagram?(word1, word2)\n word1.chars.each_with_index do |char, i1| # O(n)\n idx2 = word2.index(char) # O(n)\n # debugger\n return false if idx2.nil? # O(1)\n word2 = word2[0...idx2] + word2[idx2 + 1..-1] # either O(n) or 0(1)\n end\n return false unless word2 == \"\" # O(1)\n true # O(1)\nend",
"title": ""
},
{
"docid": "0b6a72ad4a47a17e51d4da3046627e7d",
"score": "0.5691673",
"text": "def max_pair_fast(size, n)\n max_1 = -max_2 = -1\n\n for i in (0..size-1)\n max_1 = i if n[i] > n[max_1] || max_1 == -1\n end\n\n for i in (0..size-1)\n max_2 = i if i != max_1 && ((max_2 == -1) || (n[i] > n[max_2] ))\n end\n\n n[max_1] * n[max_2]\nend",
"title": ""
},
{
"docid": "a2ba808e6ff0401483e3cb8c3d9eac49",
"score": "0.5690742",
"text": "def my_min_phase2(list)\n min = list.first \n list.each do |el1| #O(n)\n if el1 < min\n min = el1\n end\n end\n min\nend",
"title": ""
},
{
"docid": "2515a311ba13d219cf876dac5434645c",
"score": "0.5690027",
"text": "def threesome_adv(input_array)\r\n\tarr = input_array\r\n\tlen = arr.length\r\n\tsum_hash = Hash.new\r\n\r\n\t(0..len-1).each do |index1| # first for loop\r\n\t\t(index1+1..len-1).each do |index2| # second for loop\r\n\t\t\tsumTwoElem = arr[index1] + arr[index2] # sum of 2 array values will be key in hash\r\n\t\t\tif not sum_hash.keys.include?(sumTwoElem) # check for duplicates in hash keys\r\n\t\t\t\tsum_hash[sumTwoElem] = [] # create the key\r\n\t\t\tend\r\n\t\t\tsum_hash[sumTwoElem] << [index1, index2] # append indices\r\n\t\tend\r\n\tend\r\n\r\n\t(0..arr.length-1).each do |index|\r\n\t\tarr_val = arr[index]\r\n\t\t# first if: check if hash contains key that's negative complement of array value\r\n\t\t# second if: check if indices are the same to avoid double use of array value\r\n\t\tif sum_hash.keys.include?(-arr_val) and not sum_hash[-arr_val].include?(index)\r\n\t\t\tputs true\r\n\t\t\treturn\r\n\t\tend\r\n\tend\r\n\tputs false\r\nend",
"title": ""
},
{
"docid": "c4ec4f915c0e19cb3d63d09d109965d7",
"score": "0.5679421",
"text": "def two_sum?(arr, target_sum) \n # hash = Hash.new \n # # arr.each {|el| hash[el]}\n # min = arr.min #O(n)\n # max = arr.max #O(n)\n # (min..max).each {|el| hash[el] = false }\n # arr.each {|el| hash[el] = true } \n # sorted = hash.select {|k,v| v == true} \n # sorted = sorted.keys \n\n # i1 = 0 \n # i2 = sorted.length - 1 \n # sum = sorted.first + sorted.last \n\n # while sum != target_sum \n # if sum > target_sum \n # i2 -= 1 \n # else \n # i1 += 1 \n # end\n # sum = sorted[i1] + sorted[i2]\n # return false if i1 == i2 \n # end\n\n # return true \n\nend",
"title": ""
},
{
"docid": "9cc23a8c8612e83fd90fc104ca2343be",
"score": "0.5678292",
"text": "def largest_contiguous_subsum2(arr)\n largest = arr.first \n current = arr.first\n\n # commented this out because it seems utterly unnecessary, yes, same big O\n # return arr.max if arr.all? { |num| num < 0 }\n\n arr.drop(1).each do |num|\n current = 0 if current < 0\n current += num\n largest = current if current > largest\n end\n\n largest\nend",
"title": ""
},
{
"docid": "49d02aa578fe813dc00be051c742ffb6",
"score": "0.5676774",
"text": "def okay_two_sum?(arr,target_sum)\n arr.sort! # O(n log(n)) || O(n^2)\n\n # O(n log(n))\n arr.each_with_index do |num, i| # O(n)\n compliment = target_sum - num\n\n bser = arr.drop(i+1).bsearch { |el| compliment-el } # O(log(n))\n return true if bser\n end\n\n false\nend",
"title": ""
},
{
"docid": "d2d4f1836714444e0ff3e74721dd503c",
"score": "0.5676421",
"text": "def bad_two_sum?(arr, target_sum)\n (0...arr.length - 1).each do |i| # O(n)\n (i+1...arr.length).each do |j| #nested O(n)\n return true if arr[i] + arr[j] == target_sum\n end\n end\n false\nend",
"title": ""
},
{
"docid": "e074cc89f39364348a3a6d14bb3013cd",
"score": "0.5668436",
"text": "def solution(m, a)\n tail, count, q = 0, 0, 0\n used = [-1] * (m + 1)\n a.each_with_index do |n, head|\n if used[n] == -1\n used[n] = head\n else\n new_tail = used[n] + 1\n q = head - tail\n r = head - new_tail\n count += q*(q+1)/2 - r*(r+1)/2\n i = tail\n used[a[i]] = -1 while i += 1 and i < new_tail\n used[n] = head\n tail = new_tail\n # puts \"used: #{used}, q: #{q}, r: #{r}\"\n end\n end\n q = a.length - tail\n count += q*(q+1)/2\n [count, 1000000000].min\nend",
"title": ""
},
{
"docid": "adbdc47e2dcf4a950a3ec7a7ea1a2ade",
"score": "0.5666977",
"text": "def sluggish(arr) #O(n^2)\n arr.each do |word|\n return word if arr.all? { |other_word| word.length >= other_word.length }\n end\nend",
"title": ""
},
{
"docid": "acdd54c774673e7bdb3ba24ff6d6940c",
"score": "0.566541",
"text": "def fun2(n)\n\tm = 0\n\ti = 0\n\twhile i < n\n\t\tj = 0\n\t\twhile j < n\n\t\t\tm += 1\n\t\t\tj += 1\n\t\tend\n\t\ti += 1\n\tend\n\treturn m\nend",
"title": ""
},
{
"docid": "71717adc8c5eda00481e2b235e910283",
"score": "0.5663508",
"text": "def intersection(array1, array2)\n if array1 == nil || array2 == nil\n intersection_array = []\n else\n if array1.length < array2.length\n smaller_array = array1\n larger_array = array2\n else\n smaller_array = array2\n larger_array = array1\n end\n\n intersection_array = [] # s.c = O(n)\n small_hash = Hash.new() # s.c = O(n)\n\n # t.c. = O(n)\n smaller_array.each do |num|\n small_hash[num] = 1\n end\n\n # t.c. = O(m)\n larger_array.each do |num|\n if small_hash.include? num\n intersection_array << num\n end\n end\n\n return intersection_array\n end\nend",
"title": ""
},
{
"docid": "bfc40413fb864f3812040d39bc6ab746",
"score": "0.5659778",
"text": "def my_min(list) # O(n^2)\n min = list.first # 1\n list.each_with_index do |ele_1, i| # n\n list.each_with_index do |ele_2, j| # n\n min = ele_2 if ele_2 < min && j > i # 1\n end\n end\n return min # 1\nend",
"title": ""
},
{
"docid": "521a5a09db3805729fdb81f5be21c732",
"score": "0.5656516",
"text": "def second_anagram?(word1, word2)\n word1_arr = word1.split(\"\") #w1 m \n word2_arr = word2.split(\"\") #w2 n\n\n word1_arr.each do |char| #w1 m\n idx_char = word2_arr.find_index(char) #n\n if !idx_char.nil? # 1\n word2_arr.delete_at(idx_char) #w2 1\n end\n end\n word2_arr.length == 0\n\n # m + n + mn\n # O(mn)\n\nend",
"title": ""
},
{
"docid": "8c1042cc2f2c43a3d6636007e1dbb357",
"score": "0.56562775",
"text": "def okay_two_sum?(arr, target_sum) #O(nlog(n))\n sorted = arr.sort\n search_sum(sorted, target_sum)\nend",
"title": ""
},
{
"docid": "3213354fc7b3a88a9146b3558a888799",
"score": "0.56550074",
"text": "def big_O_N_linear_search(unsorted_numbers, number)\n\n unsorted_numbers.each do |n|\n # Return True if n is our number\n return true if n == number\n end\n\n # Return False as we didnt' find number\n false\nend",
"title": ""
},
{
"docid": "10a4441b25ed3a2cbeb805c95bca2e50",
"score": "0.5651185",
"text": "def largest_contiguous_subsum_two(array)\n #O(n)\n max_sum = array.first #2\n sum = max_sum #2\n array.drop(1).each do |ele| #7\n if ele > max_sum\n max_sum = ele #7\n sum = ele #7\n else\n sum += ele #8\n end\n max_sum = sum if sum > max_sum #8\n end\n max_sum\nend",
"title": ""
},
{
"docid": "c901d23aa672311f3eae61660035a77c",
"score": "0.5644312",
"text": "def bad_two_sum?(arr, target) # O(n**2)\r\n new_arr = []\r\n arr.each_with_index do |ele1, idx1|\r\n (idx1+1...arr.length).each do |idx2|\r\n new_arr << [ele1, arr[idx2]]\r\n end\r\n end\r\n new_arr.any? { |pair| pair[0]+pair[1] == target }\r\nend",
"title": ""
},
{
"docid": "9eff65814391c7285afc2f2f87a89d08",
"score": "0.5644116",
"text": "def sub_sum_1(list) # time complexity is O(n^3)\n sub_arr = []\n (0...list.length - 1).each do |i|\n (i...list.length).each do |j|\n sub_arr << list[i..j]\n end\n end\n sub_arr.inject { |arr1, arr2| arr2.sum > arr1.sum ? arr1 = arr2 : arr1 }.sum\nend",
"title": ""
},
{
"docid": "8ef6244693c6fbfc90e6f577f979c50f",
"score": "0.5642934",
"text": "def largest_contiguous_subsum_one(list)\n arr = []\n\n list.each_with_index do |ele, idx| # O(n)\n (idx...list.length).each do |idx2| # O(n)\n arr << list[idx..idx2] # O(1)\n end\n end\n\n largest_subsum = 0 # O(1)\n arr.each do |subarr| # O(n^2)\n sub_sum = subarr.sum # O(1)\n if sub_sum > largest_subsum # O(1)\n largest_subsum = sub_sum # O(1)\n end\n end\n largest_subsum # O(1)\nend",
"title": ""
},
{
"docid": "f4d134a9ea7a3f6422eefb08f04390bc",
"score": "0.5642237",
"text": "def clever_octopus(fish)\n # Only a single dominant loop which make the algorithm O (n)\n big_fish = fish[0]\n (1...fish.length).each do |idx|\n if big_fish.length < fish[idx].length\n big_fish = fish[idx]\n end\n end\n big_fish\nend",
"title": ""
},
{
"docid": "2772658162a09bdb98fe66f619c8adde",
"score": "0.56400937",
"text": "def largest_contiguous_subsum(list) \n max_sum = nil #O(1)\n sub_arr_holder = [] #O(1)\n (0...list.length - 1).each do |i| #O(n)\n (i...list.length).each do |j| #O(n)\n subarr = list[i..j] #O(n) \n sub_arr_holder << subarr #O(1) ?????? \n end\n end\n\n sub_arr_holder.inject do |acc, arr| #O(n) + #O(1) + #O(1)\n if acc.sum > arr.sum #O(n) + #O(n) + #O(1)\n acc #O(1)\n else\n arr #O(1)\n end \n end.sum #O(n)\n\nend",
"title": ""
},
{
"docid": "ed12568f1bc21c236ecde87f756577dc",
"score": "0.56356585",
"text": "def fourth_anagram(first, second) # time complexity O(n) | # space complexity O(1)\r\n hash = Hash.new { |h, k| h[k] = 0 }\r\n \r\n first.each_char do |c1|\r\n hash[c1] += 1\r\n end\r\n\r\n second.each_char do |c1|\r\n hash[c1] -= 1\r\n end\r\n\r\n hash.values.all? {|val| val == 0}\r\nend",
"title": ""
},
{
"docid": "b5af980b927b85b04312524521ebca26",
"score": "0.56314284",
"text": "def largest_contiguous_subsum1(list)\n # space & time n^3\n sub_sums = [] # space N^3\n [1 2 3]\n (0...list.length).each do |i|\n sub_sums << [list[i]]\n (i+1...list.length).each do |j|\n sub_sums << list[i..j] # O(n)\n end\n end\n # debugger\n (1...sub_sums.length).inject(sub_sums[0].sum) { |acc, el| sub_sums[el].sum > acc ? sub_sums[el].sum : acc } # n^3\nend",
"title": ""
},
{
"docid": "de8322da4e659c3c94e5bd585b52903b",
"score": "0.5628129",
"text": "def fourth_anagram?(str1, str2) \n hash = Hash.new(0) #O(1)\n str1.each_char {|char| hash[char] += 1} #O(n)\n hash2 = Hash.new(0) #O(1)\n str2.each_char {|char| hash[char] += 1} #O(n)\n hash == hash2 #O(n)\n\nend",
"title": ""
},
{
"docid": "9dac20eaf57cc9c6147d5249d20e9532",
"score": "0.56219566",
"text": "def lis(array)\n cache = Array.new(array.size) { [] }\n\n array.each_with_index do |current_element, current_index|\n 0.upto(current_index - 1) do |a_previous_index|\n current_gt_a_previous = array[a_previous_index] < current_element\n\n # NOTE: covers case leetcode_array3\n decreasing = cache[current_index].size < (cache[a_previous_index].size+1)\n\n if current_gt_a_previous && decreasing\n cache[current_index] = cache[a_previous_index].dup\n end\n end\n\n # p cache\n cache[current_index] << current_element\n end\n\n cache.max_by(&:size)\nend",
"title": ""
},
{
"docid": "e66dd7cf3d73b2b132fede1296afdf3d",
"score": "0.5612906",
"text": "def my_min(list) # O(n)\n min = list.first # 1\n list.each do |ele| # n \n min = ele if ele < min # 1 \n end\n min # 1\nend",
"title": ""
},
{
"docid": "4338146aa6c77270e702624ddd54d63d",
"score": "0.5609431",
"text": "def okay_two_sum?(arr,target_sum)#sort is time complexity O(nlogn)\n arr.sort!\n=begin \n#binary search will say if the arr mid element can be summed\nwith any other element to get the target_sum\nwe want to find this out for each element by starting \n=end\narr.drop(1).any? {|ele| target_sum ==arr.first+ele } || (1...arr.length-1).any? {|index| #(O(n)+O(nlogn)+O(n)=O(nlogn)\nbinary_search(arr,target_sum,index)\n\n} || arr.take(arr.length-1).any? {|ele| target_sum==arr.last+ele}\n \nend",
"title": ""
},
{
"docid": "79fdde445c7a493cfe3afe2b20030632",
"score": "0.56093836",
"text": "def two_sum_more_improved(nums, target)\n nums_hsh = Hash.new\n nums.each_with_index do |n, i|\n nums_hsh[n] = i\n end\n for i in (0...nums.length)\n first = nums[i]\n second = target - first\n if nums_hsh.include?(second) && nums.index(second) != i\n j = nums.index(second)\n return [i, j]\n end\n # nums_hsh[first] = i \n end\n return [0, 0]\nend",
"title": ""
},
{
"docid": "0f495c46864b6aa5859c43dd1c56687b",
"score": "0.56055844",
"text": "def fourth_anagram?(str1,str2) # O(n)\n\n hash1 = Hash.new(0) # O(1)\n hash2 = Hash.new(0) # O(1)\n\n str1.each_char { |char| hash1[char] += 1 } # O(n)\n str2.each_char { |char| hash2[char] += 1 } # O(n)\n\n hash1 == hash2 # O(n)\n\nend",
"title": ""
},
{
"docid": "00ee2a773f8c3653a5307eecd31539c8",
"score": "0.56040466",
"text": "def solution(a)\n check_array = a.group_by{|n| n }\n (1..100001).each do |idx|\n return idx unless check_array[idx]\n end\nend",
"title": ""
},
{
"docid": "1b46f9e46d230cc0f1dfb7236b181031",
"score": "0.5602434",
"text": "def find_unique(n)\n n = n.sort\n return n[0] if n[0] != n[1]\n n.map.with_index { |_, ind| return n[ind + 1] if n[ind] != n[ind + 1] && n[ind + 1] != n[ind + 2] }\nend",
"title": ""
},
{
"docid": "89658e6179940a05a92ba4fa083c891e",
"score": "0.5599044",
"text": "def my_min_2(list) #O(n)\n min = list[0]\n list[1..-1].each do |ele|\n min = ele if ele < min\n end\n min\nend",
"title": ""
},
{
"docid": "55518050fa0f65d68dff5606a7790baa",
"score": "0.55944526",
"text": "def good_two_sum?(arr, target)\r\n hash = Hash.new() #make a new hash check with TA if we want a value\r\n arr.each_with_index do |num, idx| # O(n)\r\n if hash.has_key?(target-num) #check if the hash contains the target number minus the current number return true\r\n return hash[target-num]\r\n else\r\n hash[num] = true #if it doesnt have that number add current number to the keys of the hash and add 1\r\n end\r\n end\r\n false\r\nend",
"title": ""
},
{
"docid": "1a0b12712962266ef825f6ccc8edd7bd",
"score": "0.5592972",
"text": "def my_min2(array) #O(n)\n min = array.first\n array.each do |num|\n min = num if num < min\n end\n min\nend",
"title": ""
},
{
"docid": "56e2f4c229d68e9d667cf5f5fe1d2177",
"score": "0.5592008",
"text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n #a[0] = 1 [-1..1]\r\n #a[1] = 5 [-4..6]\r\n #a[2] = 2 [0..4]\r\n #a[3] = 1 [2..4]\r\n #a[4] = 4 [0..8]\r\n #a[5] = 0 [0]\r\n\r\n i=0\r\n arr=[]\r\n while(i<a.count) do\r\n \r\n arr[i] = (i-a[i].. i+a[i]).to_a\r\n i+=1 \r\n end\r\n \r\n \r\n \r\n l=arr.count\r\n i=0\r\n n=0\r\n while(i<l) do\r\n \r\n \r\n j=i+1\r\n while(j<l) do\r\n if(arr[i] != arr[j])\r\n \r\n if((arr[i] & arr[j]).empty? == false)\r\n n+=1\r\n end\r\n end\r\n j+=1\r\n end \r\n i+=1\r\n end\r\n n\r\nend",
"title": ""
},
{
"docid": "b5ae54886228d5e3f7bc459b1aa6e50d",
"score": "0.55912477",
"text": "def second_anagram?(str_1, str_2) #O(n^2) : quadratic\n return false if str_1.length != str_2.length \n arr_2 = str_2.split(\"\")\n str_1.each_char do |char|\n idx2 = arr_2.find_index(char) #another iteration, searching through arr, n \n unless idx2.nil?\n arr_2.delete_at(idx2) #another iteration, * 2\n end \n end\n arr_2.length == 0 \nend",
"title": ""
},
{
"docid": "6df12de21cc9c7fbc52327208a522d0a",
"score": "0.5586739",
"text": "def my_min_2(list)\n # min = list.first # constant O(1)\n # list.each {|num| min = num if num < min } # O(n)\n # min \n list.min\n end",
"title": ""
},
{
"docid": "34bb22d67172d67e9efc8d66197faba4",
"score": "0.55867314",
"text": "def largest_contiguous_subsum_2(arr)\n largest_sum = arr.first\n largest_index = 0\n arr.each_with_index do |el,i| #O(n)\n if el > largest_sum\n largest_sum = el \n largest_index = i\n end\n end\n new_arr = arr[0...largest_index] + arr[largest_index+1..-1] #O(2n)or#O(n)\n \n new_arr.each do |el| #O(n)\n temp_sum = el + largest_sum\n largest_sum = temp_sum if temp_sum > largest_sum\n end\n largest_sum\nend",
"title": ""
},
{
"docid": "fb936a26f7f0c2c4f880611976ad590d",
"score": "0.55838645",
"text": "def bad_two_sum?(arr, target_sum)\n\n arr.each_with_index do |el1, i1|\n arr.each_with_index do |el2, i2|\n return true if ((i2 > i1) && (el1 + el2 == target_sum)) #time complexity = n^2\n end\n end\n false\nend",
"title": ""
},
{
"docid": "46e17ecde8d6a6b1b4024784c8399859",
"score": "0.55817276",
"text": "def two_sum?(arr, target)\n hash = {} #0(1)\n\n arr.each do |ele| #0(n)\n return true if hash[target - ele] #0(1)\n hash[ele] = true #0(1)\n end\n\n false#0(1)\nend",
"title": ""
}
] |
271ae659de851fd5e3baba798e3a194f
|
Returns whether this is a DIME response.
|
[
{
"docid": "6bd57f1a8feb52124bef763bfda1485a",
"score": "0.8265461",
"text": "def dime_response?\n headers[\"Content-Type\"] == \"application/dime\"\n end",
"title": ""
}
] |
[
{
"docid": "9fa79b3d790339e097b82412099fa8d5",
"score": "0.74531645",
"text": "def response?\n (self.type == PACKET_TYPE_RESPONSE || self.type == PACKET_TYPE_PLAIN_RESPONSE)\n end",
"title": ""
},
{
"docid": "0a9ccab19118e9e8e43815624483b3d2",
"score": "0.7396534",
"text": "def response?\n @bytes[2] == Message::RESPONSE\n end",
"title": ""
},
{
"docid": "3707cc5e367bde4fc59bbe703a9c156b",
"score": "0.71729785",
"text": "def response?\n code == CODES['Response']\n end",
"title": ""
},
{
"docid": "3126d58b0f003b7bbb2902d71b4f1ff4",
"score": "0.68912846",
"text": "def response?\n !response.nil?\n end",
"title": ""
},
{
"docid": "3126d58b0f003b7bbb2902d71b4f1ff4",
"score": "0.68912846",
"text": "def response?\n !response.nil?\n end",
"title": ""
},
{
"docid": "600a54bd771d3572906bed5b944b3e39",
"score": "0.68199736",
"text": "def responded?\n self.req.response_parts.any? || self.req.error\n end",
"title": ""
},
{
"docid": "5b550fb3f21768d5e8ebbf2e34427aca",
"score": "0.6541819",
"text": "def responding?\n !responding.nil?\n end",
"title": ""
},
{
"docid": "0a1c738ea8e191867ddd079dc2ac0aaf",
"score": "0.6442086",
"text": "def valid_response?\n @current_response.is_a?(Net::HTTPSuccess)\n end",
"title": ""
},
{
"docid": "ac98358c5fcfd5486f8725a42f5b6586",
"score": "0.6408196",
"text": "def parse_response?\n parse_response\n end",
"title": ""
},
{
"docid": "b3390d8397481c53af8eeb4b793e8477",
"score": "0.63910556",
"text": "def response?\n false\n end",
"title": ""
},
{
"docid": "b1bebe8c9197f2088ff2f36801e2c62a",
"score": "0.63561803",
"text": "def seperate?(response)\n r = response\n r.tt == :ack && r.payload.empty? && r.mcode == [0, 0]\n end",
"title": ""
},
{
"docid": "1762539cd145387cbfc07a64bbc0090d",
"score": "0.63276595",
"text": "def response_received?\n return !self.response_received_at.nil?\n end",
"title": ""
},
{
"docid": "8a94d2ecd891d1ecb69812166106d745",
"score": "0.63163203",
"text": "def is_reply?\n @is_reply\n end",
"title": ""
},
{
"docid": "a9cca4ced3be4eac206624928dfc5201",
"score": "0.6315314",
"text": "def fully_responded_to?\n ::Responder::TYPES.each do |type|\n return false unless full_response_for_type?(type)\n end\n\n true\n end",
"title": ""
},
{
"docid": "12562ebfa5b19c79a904d29242e8d10c",
"score": "0.63045335",
"text": "def response_header?\n response_header = params.fetch(:response_header, 'false')\n response_header.casecmp?('true')\n end",
"title": ""
},
{
"docid": "c7000b4750a587b086b035ace068af40",
"score": "0.628063",
"text": "def response?\n !query?\n end",
"title": ""
},
{
"docid": "a836c47bdedde9c3162d86f887adcd71",
"score": "0.62414634",
"text": "def response?\n done? ? @grpc_op.result == :response : false\n end",
"title": ""
},
{
"docid": "415d24f81dc0da5b7764bfb13d5af473",
"score": "0.6228935",
"text": "def response?()\n if @msg_len > 600\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "3fb088af37868bac5fc2759d268c4575",
"score": "0.6190973",
"text": "def RESPOND?(message)\n respond_to? message\n end",
"title": ""
},
{
"docid": "46e0a1488c776a0971273f0abcb3d602",
"score": "0.6184771",
"text": "def rich?\n is_a?(OEmbed::Response::Rich)\n end",
"title": ""
},
{
"docid": "8d6c4d29df2546e82968df796d9db677",
"score": "0.61760104",
"text": "def respond_to_performed?\n (response && response.content_type) ? true : false\n end",
"title": ""
},
{
"docid": "c802aacb63c7a6eb39931d89648aeede",
"score": "0.6157094",
"text": "def error?\n @data['response'] == ERROR\n end",
"title": ""
},
{
"docid": "08ae02ae0b78c69f5bebfdf6a3181b49",
"score": "0.6155124",
"text": "def response?\n done? ? @grpc_op.result == :response : false\n end",
"title": ""
},
{
"docid": "a1c428767e92b891c0a2b16314ee25bf",
"score": "0.6138388",
"text": "def success?\n @response['ResponseCode'] == '00'\n end",
"title": ""
},
{
"docid": "51e0979d76920819b61e9f2684d4ca29",
"score": "0.61320937",
"text": "def unknown?\n @spam_response == Unknown\n end",
"title": ""
},
{
"docid": "fe76da1a1087534aff6f331bdb52f686",
"score": "0.61184996",
"text": "def authorization_response?\n return true if (self.kind_of?(AuthorizationResponse))\n return false\n end",
"title": ""
},
{
"docid": "6a275d6964e68e6dd448a8cc165024f2",
"score": "0.61005735",
"text": "def kml_response?\n @response.headers['Content-Type'] == 'application/vnd.google-earth.kml+xml'\n end",
"title": ""
},
{
"docid": "f295480a95b5fbdf29f07777d5f10a8b",
"score": "0.60466963",
"text": "def response_incomplete?\n parser.response_incomplete?\n end",
"title": ""
},
{
"docid": "60a33ec587dbaad5b452a7f813eca0d7",
"score": "0.60420847",
"text": "def valid_response?(message)\n \n if message.kind_of?(IRC::Messages::PongMessage)\n return first_server == message.daemons[0] && second_server == message.daemons[1]\n \n elsif message.kind_of?(IRC::Messages::ErrorNoOriginMessage) || message.kind_of?(IRC::Messages::ErrorNoSuchServerMessage)\n return true\n \n end \n \n return false\n \n end",
"title": ""
},
{
"docid": "2cff3fc00140dcf711c088c992c4d36d",
"score": "0.603524",
"text": "def response_indicates_valid?(response)\n REXML::Document.new(response.body).root.get_elements('//m:validity').first.text == 'true'\n end",
"title": ""
},
{
"docid": "281e79d779aa2aa406d1743ebaeb51dd",
"score": "0.60216177",
"text": "def reply?\n self.message_kind.to_s == REPLY\n end",
"title": ""
},
{
"docid": "05f149ea5484bd2b42c4230c95f77bdd",
"score": "0.60149944",
"text": "def valid_response?(data)\n return false unless data.is_a?(Hash)\n return false if data['jsonrpc'] != JSON_RPC_VERSION\n return false unless data.has_key?('id')\n return false if data.has_key?('error') && data.has_key?('result')\n\n if data.has_key?('error')\n if !data['error'].is_a?(Hash) || !data['error'].has_key?('code') || !data['error'].has_key?('message')\n return false\n end\n\n if !data['error']['code'].is_a?(Fixnum) || !data['error']['message'].is_a?(String)\n return false\n end\n end\n\n return true\n rescue\n return false\n end",
"title": ""
},
{
"docid": "335ce29bd8fb6d58fdd5479c87367b69",
"score": "0.6009708",
"text": "def decoded?\n\t\t\t\t@decoded\n\t\t\tend",
"title": ""
},
{
"docid": "ae7e5112e866d3a19420468ef1b81b0d",
"score": "0.5992632",
"text": "def error?\n @response.is_a?(Hash) ? @response.has_key?(:error) || @response.has_key?(:errors) : false\n end",
"title": ""
},
{
"docid": "5f6987804a7d568d1d29a0092b36a681",
"score": "0.59810746",
"text": "def impedence?\n return false unless @content.is_a?(BitString)\n return @content.raw_content.include?(2)\n end",
"title": ""
},
{
"docid": "1455d78931a6824eb7e0d715145d1a30",
"score": "0.59763193",
"text": "def call_response?\n true\n end",
"title": ""
},
{
"docid": "4c25dc04ae3a7c73ff83a034b795787c",
"score": "0.5954112",
"text": "def extended_reply?\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "c61c15dbbab152c53e88ad0744b014a0",
"score": "0.5951454",
"text": "def declined?\n @data['response'] == DECLINED\n end",
"title": ""
},
{
"docid": "591912151ca004a77d40dbacadf63cd5",
"score": "0.5940395",
"text": "def incomplete_response?\n content_for_scanner.strip == \"\"\n end",
"title": ""
},
{
"docid": "fcfe99adceae29db40bbe94409641c20",
"score": "0.5938601",
"text": "def ssdp_response?(resp)\n (resp[:server] || \"\")\n .split(/[,\\s]+/)\n .find { |token| token =~ %r{\\AIpBridge/\\d+(\\.\\d+)*\\z} }\n end",
"title": ""
},
{
"docid": "fcfe99adceae29db40bbe94409641c20",
"score": "0.5938601",
"text": "def ssdp_response?(resp)\n (resp[:server] || \"\")\n .split(/[,\\s]+/)\n .find { |token| token =~ %r{\\AIpBridge/\\d+(\\.\\d+)*\\z} }\n end",
"title": ""
},
{
"docid": "ed0b089df68e7cc6fae7936deebcbc9e",
"score": "0.5926219",
"text": "def errors?\n if @response[\"response\"][\"error\"]\n return true\n end\n end",
"title": ""
},
{
"docid": "75d4518b0b64b64371d3aeccfb5d8fdb",
"score": "0.59260464",
"text": "def informational?\n response.status.between? 100, 199\n end",
"title": ""
},
{
"docid": "d77d449a739cc832313e96ea53ebb6c6",
"score": "0.592536",
"text": "def data?\n content_type != CONTENTS_CODE\n end",
"title": ""
},
{
"docid": "3b6d824ab679a09d484a74d7923c2f9a",
"score": "0.59187084",
"text": "def numeric_reply?\n @numeric_reply ||= !!@command.match(/^\\d\\d\\d$/)\n end",
"title": ""
},
{
"docid": "40b14da59ac4b0339c1a3a059595bd6a",
"score": "0.59049076",
"text": "def success?\n @parsed_response.xpath('//cdr/text()').to_s.to_i > 0\n end",
"title": ""
},
{
"docid": "5cdd24b0fc92d49d3b091798eee97ce6",
"score": "0.58994293",
"text": "def is_successful?\n self.response == \"1\" ? true : false\n end",
"title": ""
},
{
"docid": "d061034422625bacdaabb4260c93d7bd",
"score": "0.5888599",
"text": "def closed?\n return true if /close/i =~ @response['connection']\n\n return false unless @response.class.body_permitted?\n\n if transfer_encoding = @response['transfer-encoding'] then\n return false if /chunked\\z/i =~ transfer_encoding\n return true\n end\n\n if content_lengths = @response.to_hash['content-length'] then\n return true if content_lengths.length > 1\n return /\\A\\d+\\z/ !~ content_lengths.first\n end\n\n true\n end",
"title": ""
},
{
"docid": "faf18543e9a7487b41feac49fe4309be",
"score": "0.58828014",
"text": "def extended_reply?\n\t\treturn @extended_reply_filter ? true : false\n\tend",
"title": ""
},
{
"docid": "cc6e921d671c2611721921e34f0f7a98",
"score": "0.58784777",
"text": "def boolean_from_response(method, path, options = {})\n request(method, path, options)\n @last_response.status == 204\n rescue PagerDuty::NotFound\n false\n end",
"title": ""
},
{
"docid": "faffe6bdf7f665a256a1612f622e3640",
"score": "0.5874493",
"text": "def response_unavailable?\n parser.response_unavailable?\n end",
"title": ""
},
{
"docid": "066430c66fb759cc92e58d591a0c55e1",
"score": "0.5863023",
"text": "def respond?\n @respond ||= options.present?\n end",
"title": ""
},
{
"docid": "95f6d98a69fbfcc839666f85a9f09f05",
"score": "0.58620054",
"text": "def boolean_from_response(method, path, options = {})\n request(method, path, options)\n @last_response.status == 204\n rescue Nearmiss::NotFound\n false\n end",
"title": ""
},
{
"docid": "8be98382423642f764c2caffa1f143af",
"score": "0.5861984",
"text": "def has_reply?\n @has_reply\n end",
"title": ""
},
{
"docid": "8f3032c7ab8a4a8e1d0527f527acc294",
"score": "0.58609",
"text": "def response_incomplete?\n any_is?(parsers, :response_incomplete?)\n end",
"title": ""
},
{
"docid": "c70823af30068545f27a6d9407f61131",
"score": "0.5840506",
"text": "def responds_with_json?\n response.content_type == mime_type(:json)\n end",
"title": ""
},
{
"docid": "1dd84ff026d0e92e6fc744c21b8c4273",
"score": "0.5839905",
"text": "def valid_response?(response)\n (response.is_a? Enumerable and response.first and response.first.is_a? FbGraph::Post)\n end",
"title": ""
},
{
"docid": "18ee9462a40ab74ac71ea5fb71f89fd8",
"score": "0.583563",
"text": "def error?\n (self.body/'rsp').attr('stat') != 'ok'\n end",
"title": ""
},
{
"docid": "96a55d9d9c1ea41b2a192e1a761b657a",
"score": "0.58334965",
"text": "def complete?\n params[\"x_response_code\"] == '1'\n end",
"title": ""
},
{
"docid": "8cd3d69deed32f35362e5baab4b0c140",
"score": "0.5831243",
"text": "def error?\n @parsed_response['Erro'] != nil\n end",
"title": ""
},
{
"docid": "7a3a8430dc0492028e2f44a5037c0b20",
"score": "0.5824375",
"text": "def passed_imc?\n imc_check = question_objects_with_respondent_data.detect{|q| q[:question_type] == :imc_check}\n return nil if imc_check.nil?\n imc_check[:responses] == 'pass' #the only way to pass is to have \"pass\" as the response\n end",
"title": ""
},
{
"docid": "1b93075f397acc9a743e0b51121f4a26",
"score": "0.5816173",
"text": "def command?\n response.text =~ command_regex\n end",
"title": ""
},
{
"docid": "e89830d67a8f9d1390e656c954d229f8",
"score": "0.5816006",
"text": "def response_in_target?\n responded? && business_unit_responded_in_time?\n end",
"title": ""
},
{
"docid": "e89830d67a8f9d1390e656c954d229f8",
"score": "0.5816006",
"text": "def response_in_target?\n responded? && business_unit_responded_in_time?\n end",
"title": ""
},
{
"docid": "64e6157ca6c214ec55eedbb3cc020bae",
"score": "0.5815845",
"text": "def is_complete?\n return (response_value != EMPTY_RESPONSE_VALUE)\n end",
"title": ""
},
{
"docid": "c2fb13ba7bef0a8dd7b3769aa318609b",
"score": "0.5815588",
"text": "def body_decodable?\n return true if @body.nil?\n return true if decoded_body\n rescue HeaderCharsetInvalid, NonRepresentableBody\n false\n end",
"title": ""
},
{
"docid": "a59058c5ba115bd8d22312c1cfcfd6c4",
"score": "0.58151734",
"text": "def dmi_error?\n dmi_status == 'error'\n end",
"title": ""
},
{
"docid": "983d4f4266cf2b19939aa2104f4adc8d",
"score": "0.5813564",
"text": "def parse?\n self.magic == DHCP_MAGIC\n end",
"title": ""
},
{
"docid": "6e68fa325fffd5f0d6a0ede4d69a85a1",
"score": "0.5801739",
"text": "def respond?\n @respond ||= meaningful_options.present? && meaningful_options[:types].include?(type.to_s)\n end",
"title": ""
},
{
"docid": "116089a780e98361e9437073f8629334",
"score": "0.5800781",
"text": "def full_message_received?(response)\n content_length = response[\"content-length\"] || \"\"\n (content_length == \"\") ? true : content_length.to_i == response.body.length\n end",
"title": ""
},
{
"docid": "28172c5b6c62ebd8e8f689ed61a7a2b0",
"score": "0.5799778",
"text": "def valid? clas\n clas == Reply\n end",
"title": ""
},
{
"docid": "2370d566856cad0cab57c23db22cb394",
"score": "0.57982254",
"text": "def validate_response\n return false if !@response.present?\n valid_responses = get_valid_responses(@current_form, @current_question)\n if valid_responses == :any\n return true\n elsif valid_responses == :any_number\n return @response.scan(/[a-zA-Z]/).length == 0\n elsif valid_responses == :any_letters\n return @response[/[a-zA-Z\\s]+/] == @response\n elsif valid_responses == :any_year\n res = @response.to_i\n return res > 1950 && res < 2015\n elsif valid_responses == :unique_id_number\n return !(Farmer.where(national_id_number: @response).exists?)\n elsif valid_responses == :valid_pin\n return valid_pin(@response)\n elsif valid_responses == :authenticate_national_id\n return get_farmer.national_id_number == @response\n elsif valid_responses == :authenticate_pin\n return get_farmer.pin == @response\n elsif valid_responses.is_a? Array\n return valid_responses.include? @response\n elsif valid_responses.is_a? Symbol\n return self.send(valid_responses)\n else\n return false\n end\n return false\n end",
"title": ""
},
{
"docid": "536a1c7ddcc5f3a019a742a42a586ff9",
"score": "0.57935905",
"text": "def device_responds?\n begin\n # send plain AT command\n meta(nil,:at)\n rescue DeviceNotFoundException\n false\n end\n end",
"title": ""
},
{
"docid": "a16aa4773c4ebe1408f43989d9b247a6",
"score": "0.5777365",
"text": "def valid?\n response_code == 'Valid'\n end",
"title": ""
},
{
"docid": "b34490cf4bc947ffbc54e84d61a36362",
"score": "0.57767856",
"text": "def where_is_yadis?(resp); end",
"title": ""
},
{
"docid": "be2da2d316161b13b8e6a74f25faf65f",
"score": "0.57745403",
"text": "def is_positive?\n return POSITIVE_RESPONSES.include?(self)\n end",
"title": ""
},
{
"docid": "e291b556b7afdfd398189bdab1d69fd9",
"score": "0.5774007",
"text": "def failed_response?\n ERROR_KEY.hash_value(@data, '/') == ERROR_VALUE\n end",
"title": ""
},
{
"docid": "dffff35e469d36b62140179df1bb425d",
"score": "0.5760975",
"text": "def response_has_body?\n net_http_request_klass::RESPONSE_HAS_BODY\n end",
"title": ""
},
{
"docid": "bc3f341d30af8f7cd749b8efa566feb2",
"score": "0.5751803",
"text": "def applies_to?(response)\n status, header, body = response\n\n # Some stati don't have to be processed\n return false if [301, 302, 303, 307].include?(status)\n\n # Check mime type\n return false if @mime_types.all? do |type|\n !header['Content-Type'].to_s.include?(type)\n end\n\n # Find ESI tags\n response[2] = [body = join_body(body)]\n body.include?('<esi:')\n end",
"title": ""
},
{
"docid": "784c2a7a4b8fc8bb2c75ced9c7215718",
"score": "0.57487625",
"text": "def boolean_from_response(method, path, options = {})\n request(method, path, options)\n @last_response.status == 204\n rescue Bettery::NotFound\n false\n end",
"title": ""
},
{
"docid": "e749f1aea49a1b60d0d58b7c37f9c642",
"score": "0.57397294",
"text": "def invalid_raw_response?(attr)\n attr['answer'].blank? || !question_content_ids.detect {|i| i == attr['question_content_id']}\n end",
"title": ""
},
{
"docid": "728b33e12649c354945cca27c6b1641a",
"score": "0.5727129",
"text": "def respond(input)\n responders.reverse.each do |responder|\n return true if responder.respond(input)\n end\n false\n end",
"title": ""
},
{
"docid": "0f2f99639d392b72ffdeeb31736a6353",
"score": "0.5723758",
"text": "def use_response_error_message?(request, response)\n if (request.path.include?('/data/') && !response.content_type.nil?)\n response.content_type.include? 'text/plain'\n else\n false\n end\n end",
"title": ""
},
{
"docid": "8b96633bf220e2147a63329cd53173b3",
"score": "0.57207984",
"text": "def response_is_success(response)\n %w[200 204].include? response.code\n end",
"title": ""
},
{
"docid": "e9523dffa8667e3a0b8df3dde36b88e9",
"score": "0.57195354",
"text": "def parse_boolean(response, message_id)\n msg = response[/\\|#{message_id}([YN])\\|/, 1]\n return true if msg == 'Y'\n return false if msg == 'N'\n false\n end",
"title": ""
},
{
"docid": "35ba8e0c08153d73a4b75131e5e6a567",
"score": "0.57191217",
"text": "def response_incomplete?\n end",
"title": ""
},
{
"docid": "4f45914931ca16b208dad1a8251edf20",
"score": "0.57107264",
"text": "def error?\n !@http_response.is_a?(Net::HTTPSuccess)\n end",
"title": ""
},
{
"docid": "35752988bf7aa0e1409245452a83a36c",
"score": "0.5708627",
"text": "def is_reply?\n return self.id != self.original_message_id\n end",
"title": ""
},
{
"docid": "317d44becff362212401a6e799371c9c",
"score": "0.57069755",
"text": "def test?\n acknowledge_response['merchant_id'] =~ /^T/ ? true : false\n end",
"title": ""
},
{
"docid": "d6d2d39c22d1f1f9c77fdc7b66e64190",
"score": "0.5706784",
"text": "def boolean_from_response(method, path, options = {})\n request(method, path, options)\n [201, 202, 204].include? @last_response.status\n rescue Octokit::NotFound\n false\n end",
"title": ""
},
{
"docid": "f2e52288369afb1322befbbe7193a45a",
"score": "0.57052356",
"text": "def potential_response?(candidate)\n self.class.response_class === candidate\n end",
"title": ""
},
{
"docid": "0644860f947c7e5dc7abcd5a7cfa4ea3",
"score": "0.57035285",
"text": "def response_is_error?\n is_error = !@parsed_response.dig('errors').nil?\n set_failure_message(FailureMessages::ERROR) if is_error\n is_error\n end",
"title": ""
},
{
"docid": "447ccd9afab56a0668f032dccf767506",
"score": "0.570073",
"text": "def status? response\n return [200, 201, 202, 203, 204, 205].include?(response.code.to_i)\n true\n end",
"title": ""
},
{
"docid": "d42528b190c695e8638951c0683e166b",
"score": "0.5696828",
"text": "def response_available\n uri = URI(@url)\n res = Net::HTTP.get_response(uri)\n res.is_a?(Net::HTTPSuccess)\n rescue StandardError\n false\n end",
"title": ""
},
{
"docid": "6136f28832efbbfba9c8f982ff915f7c",
"score": "0.5687636",
"text": "def response_code_succeed?(response)\n CyberpacResponse.response_code_succeed? response_code_from(response)\n end",
"title": ""
},
{
"docid": "9d836779757f7b5839ad1a632e83b512",
"score": "0.5683971",
"text": "def is_unkdic?\n self.type == UNK_DIC\n end",
"title": ""
},
{
"docid": "cee767154920ee7dfd44ec2d71868379",
"score": "0.5678174",
"text": "def response_is_success(response)\n response.code == '200'\n end",
"title": ""
},
{
"docid": "e99ff5fdc72650b88c998e6a42d5d535",
"score": "0.56656253",
"text": "def respond_to?(m)\n m = m.to_sym\n :close == m || @body.respond_to?(m)\n end",
"title": ""
},
{
"docid": "a112800cc0a863c1609d6ccff71053f2",
"score": "0.5653331",
"text": "def boolean_from_response(method, path, options={})\n request(method, path, options).status == 204\n rescue Invoicexpress::NotFound\n false\n end",
"title": ""
},
{
"docid": "e3e406bdeee1e43eb4d49a600d5eb9ac",
"score": "0.5653229",
"text": "def spam?\n @spam_response == Spam\n end",
"title": ""
}
] |
febc6bf2b04a9d3e6b2be012d3aa6a03
|
update vault with unilevel bonus and investment plans
|
[
{
"docid": "a3124c5101f77032a70b15019607b61b",
"score": "0.639212",
"text": "def update_unilevel_investments_rewards\n @users = User.all\n @users.each do |user|\n rewards = user.rewards.where(reward_status_id: 11).where.not(reward_type_id: 13)\n vault = user.vault\n rewards.each do |reward|\n vault.amount += reward.value\n vault.total_rewards += reward.value\n update_reward = reward.update(reward_status_id: 12)\n vault.save if update_reward\n end\n end\n render json: { message: \"Direct rewards updated\"}, status: :ok\n end",
"title": ""
}
] |
[
{
"docid": "f5e35b53420dc79e42e980b3e2d117b9",
"score": "0.6551702",
"text": "def update_invested\n self.invested_amount = self.investments.map(&:amount).sum\n self.goal_investment = 0 unless self.goal_investment\n self.equity_offered = 0 unless self.equity_offered\n self.save\n end",
"title": ""
},
{
"docid": "d13ecaa1a507de777403e1c3b8d9371e",
"score": "0.5944787",
"text": "def update(vault_id, credit_card, options = {})\n post = {}\n add_address(post, options)\n add_credit_card(post, credit_card)\n options.merge!({ :vault_id => vault_id, :operation => secure_profile_action(:modify) })\n add_secure_profile_variables(post,options)\n commit(post, true)\n end",
"title": ""
},
{
"docid": "9d33a4c7643768e429f1db986c299204",
"score": "0.59168214",
"text": "def critical_update(object)\n\n plans = current_user.dialplans.where([\"dptype = 'ivr' and (data1 = ? or data3 = ? or data5 = ?)\", object.id, object.id, object.id])\n for plan in plans do\n plan.regenerate_ivr_dialplan\n end\n\n end",
"title": ""
},
{
"docid": "ab2f9b641921e2f4d4f2aaa67ddfb948",
"score": "0.58947116",
"text": "def update(vault_id, credit_card, options = {})\n\t post = {}\n\t add_address(post, options)\n\t add_credit_card(post, credit_card)\n\t options.merge!({:vault_id => vault_id, :operation => secure_profile_action(:modify)})\n\t add_secure_profile_variables(post,options)\n\t commit(post, true)\n\t end",
"title": ""
},
{
"docid": "6e4ea5a6102c3f5f2a09bca7e7e6de2f",
"score": "0.5847391",
"text": "def update_purchase_balance\n update(balance: financial_transactions.sum(:total_amount))\n end",
"title": ""
},
{
"docid": "d1f31bf70ad19582ea2c73c5611bb2d7",
"score": "0.58049303",
"text": "def update\n respond_to do |format|\n if @vault.update(vault_params)\n format.html { redirect_to @vault, notice: 'Vault was successfully updated.' }\n format.json { render :show, status: :ok, location: @vault }\n else\n format.html { render :edit }\n format.json { render json: @vault.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b82e22c3df97f95defd4cb6ec7c3610a",
"score": "0.5797986",
"text": "def update_vault(vault, item)\n require_chef_vault!\n bootstrap_vault_item = load_chef_bootstrap_vault_item(vault, item)\n bootstrap_vault_item.clients(client)\n bootstrap_vault_item.save\n end",
"title": ""
},
{
"docid": "2ba0c03ae51d9da1861ba52a7350e025",
"score": "0.5779511",
"text": "def update\n respond_to do |format|\n if @contract.daily_premium_prices.push(params[:daily_premium_prices][0])\n @contract.update_attributes(:premium => contract_params[:premium], :count => contract_params[:count])\n @contract.save\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15a9cdd6cfaf75ae143b31bbaff3a10c",
"score": "0.57785445",
"text": "def update_investments investment_type\n if self.investment_type.nil?\n self.create_investments investment_type\n else\n self.investment_type.update!(:fix_income => investment_type[:fix_income], :equity=> investment_type[:equity], :gold=> investment_type[:gold], :land_and_estate=> investment_type[:land_and_estate])\n end\n end",
"title": ""
},
{
"docid": "b68ab3265e92312b2fac3449d1ddc1fa",
"score": "0.57760894",
"text": "def update!(**args)\n @auth_amount_pretax = args[:auth_amount_pretax] if args.key?(:auth_amount_pretax)\n @auth_amount_tax = args[:auth_amount_tax] if args.key?(:auth_amount_tax)\n end",
"title": ""
},
{
"docid": "7d7abfd16a809cd7699c7f5e2c444a24",
"score": "0.5753824",
"text": "def update(vault_id, payment_method, options = {})\n post = {}\n add_address(post, options)\n if payment_method.respond_to?(:number)\n add_credit_card(post, payment_method)\n else\n post[:singleUseToken] = payment_method\n end\n options[:vault_id] = vault_id\n options[:operation] = secure_profile_action(:modify)\n add_secure_profile_variables(post, options)\n commit(post, true)\n end",
"title": ""
},
{
"docid": "7d7abfd16a809cd7699c7f5e2c444a24",
"score": "0.5753824",
"text": "def update(vault_id, payment_method, options = {})\n post = {}\n add_address(post, options)\n if payment_method.respond_to?(:number)\n add_credit_card(post, payment_method)\n else\n post[:singleUseToken] = payment_method\n end\n options[:vault_id] = vault_id\n options[:operation] = secure_profile_action(:modify)\n add_secure_profile_variables(post, options)\n commit(post, true)\n end",
"title": ""
},
{
"docid": "e1bcae1958491d84f6b480dc078350a8",
"score": "0.5743635",
"text": "def update!(**args)\n @free_trial_duration = args[:free_trial_duration] if args.key?(:free_trial_duration)\n @introductory_pricing_details = args[:introductory_pricing_details] if args.key?(:introductory_pricing_details)\n @promotion = args[:promotion] if args.key?(:promotion)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "c700fdccdb5db6562173836bedb6ee61",
"score": "0.5733572",
"text": "def update\n @plan = Plan.find(params[:id])\n\n respond_to do |format|\n if @plan.update_attributes(params[:plan])\n format.html { redirect_to(artist_profile_url(@plan.artist), :notice => 'Pledge level was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @plan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2e88e084f832cda241431e95c9eff9a",
"score": "0.57275176",
"text": "def approve!\n inventory.restock!(self, Time.current, inventory_check)\n update!(adjustment: difference)\n end",
"title": ""
},
{
"docid": "461fb715b7e42c2ab1d423dc9a977d6d",
"score": "0.5713449",
"text": "def update_self_and_plan(user, plan)\n if plan[:level].to_i == 1\n self.plan.attributes = plan\n self.plan.save(false)\n self.update_attributes(user)\n else\n self.plan.update_attributes(plan) && self.update_attributes(user) && self.plan.process_transaction\n end\n end",
"title": ""
},
{
"docid": "0af7be74d946c384c80b8e63ab16849a",
"score": "0.57134044",
"text": "def update\n\n gst_cost = contractual_labour_params[:gst_cost].to_f\n tds_cost = contractual_labour_params[:tds_cost].to_f\n total_amount = contractual_labour_params[:amount].to_f + gst_cost - tds_cost\n\n ## previous contractor amount calculations ##\n @previous_contractor = Contractor.find(@contractual_labour.contractor_id)\n pre_contractual_lab_total = @contractual_labour.amount.to_f\n previous_contractor_total = @previous_contractor.total_amount.to_f\n @previous_contractor.update(:total_amount => previous_contractor_total - pre_contractual_lab_total)\n ## END ##\n\n\n @new_contractor = Contractor.find(contractual_labour_params[:contractor_id])\n new_contractor_total = @new_contractor.total_amount.to_f\n\n respond_to do |format|\n if @contractual_labour.update(contractual_labour_params)\n @contractual_labour.update(:amount => total_amount)\n @new_contractor.update(:total_amount => new_contractor_total + total_amount)\n format.html { redirect_to session.delete(:return_to), notice: 'Contractual labour was successfully updated.' }\n format.json { render :show, status: :ok, location: @contractual_labour }\n else\n format.html { render :edit }\n format.json { render json: @contractual_labour.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c68b083b862abcee5ce1cf175f1358bd",
"score": "0.57109094",
"text": "def update_legacy_balances\n liabilities.where.not(member_id: nil).find_each { |l| Operations.update_legacy_balance(l) }\n end",
"title": ""
},
{
"docid": "556080d68182b28b7f9ac30aee141d80",
"score": "0.5706498",
"text": "def update_po_remaining_lbs(po_id, prev_trailer_weight_lbs)\n #puts \"****************************************in update po trailer purchase id\"\n #puts po_id.to_s, prev_trailer_weight_lbs, @trailer.weight_lbs\n\n return if (po_id == 0 || prev_trailer_weight_lbs == @trailer.weight_lbs) # exit if empty OR weight has not changed\n #puts \"passed the test\"\n\n prev_trailer_weight_lbs = 0 if prev_trailer_weight_lbs == -1\n\n if @purchase_order = PurchaseOrder.find(po_id)\n\n # user changed the weight in lbs..so lets add the previous verion to the PO and subtract the new weight value\n #puts \"sssssssssssssssssssssssssssssssssssssssss purchase order found\", po_id\n @remaining_lbs = @purchase_order.remaining_weight_lbs - @trailer.weight_lbs + prev_trailer_weight_lbs\n if @remaining_lbs >= 0\n @purchase_order.remaining_weight_lbs = @remaining_lbs\n @purchase_order.remaining_weight_tons = cvt_lbs_to_tons(@remaining_lbs)\n #puts \".........................................po.remaining weight\"\n #puts @purchase_order.remaining_weight_tons, @purchase_order.remaining_weight_lbs,@purchase_order.po_nbr.to_s\n @purchase_order.save\n #puts \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx PO SAVED\",po_id.to_s\n else\n puts \"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\"\n puts \"Remaining Weight cannot be less than 0\"\n #@purchase_order.remaining_weight_tons = 0\n end\n else\n puts \".........................................\"\n puts \"purchase order not found\",po_id\n format.html { render :edit }\n format.json { render json: @trailer.errors, status: :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "3556e6c76205ee49e9eb10fe2205bc61",
"score": "0.5674753",
"text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @unit = args[:unit] if args.key?(:unit)\n end",
"title": ""
},
{
"docid": "e55ce4250a3b0c835364f4109eb748a2",
"score": "0.5673498",
"text": "def update!(**args)\n @commitment_end_time = args[:commitment_end_time] if args.key?(:commitment_end_time)\n @commitment_start_time = args[:commitment_start_time] if args.key?(:commitment_start_time)\n @failure_status = args[:failure_status] if args.key?(:failure_status)\n @name = args[:name] if args.key?(:name)\n @plan = args[:plan] if args.key?(:plan)\n @renewal_plan = args[:renewal_plan] if args.key?(:renewal_plan)\n @slot_count = args[:slot_count] if args.key?(:slot_count)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
},
{
"docid": "842da1118d0be23c8aed45099f6590c2",
"score": "0.5668618",
"text": "def update_amount\n self.amount = purchase_entries\n .find_all(&:price?)\n .sum { |journal_entry| journal_entry.price * journal_entry.quantity }\n \n self.vat_amount = purchase_entries\n .find_all(&:vat_amount?)\n .sum { |journal_entry| journal_entry.vat_amount * journal_entry.quantity }\n end",
"title": ""
},
{
"docid": "fae68fbc626a32b534646b915eac7e69",
"score": "0.5668322",
"text": "def upgrade_plan_from_admin(plan_id, renewal_date, fin_year)\n new_plan = Plan.find_by_id(plan_id.to_i)\n transaction do\n subscription_history = SubscriptionHistory.create!(\n :company_id => self.company_id,\n :plan_id => self.plan_id,\n :start_date => self.start_date,\n :end_date => self.end_date,\n :renewal_date => self.renewal_date,\n :first_subscription_date => self.first_subscription_date,\n :ip_address => self.ip_address,\n :amount => self.amount,\n :allocated_storage_mb => self.allocated_storage_mb,\n :allocated_user_count => self.allocated_user_count\n )\n\n user_count = self.allocated_user_count - self.plan.user_count + new_plan.user_count\n self.update_attributes!(\n :plan_id => new_plan.id,\n :renewal_date => renewal_date,\n :end_date => renewal_date,\n :allocated_user_count => user_count\n )\n\n if Subscription.find(self.id).plan.is_inventoriable? && self.company.warehouses.blank?\n Warehouse.create_default_warehouse(self.company_id, self.company.users.first.id)\n end\n if Subscription.find(self.id).plan.payroll_enabled? && self.company.leave_types.blank?\n LeaveType.create_default_leave_types(self.company_id, self.company.users.first.id)\n end\n\n if Subscription.find(self.id).plan.payroll_enabled? && self.company.holidays.blank?\n year = (Time.zone.now.to_date.month.to_i < fin_year.start_date.month ? fin_year.end_date.year : fin_year.start_date.year )\n holiday_date1 = Date.new(year.to_i, 1, 26)\n holiday_date2 = Date.new(year.to_i, 8, 15)\n holiday_date3 = Date.new(year.to_i, 10, 02)\n holiday = Holiday.create(:company_id => self.company_id, :created_by => self.company.users.first.id, :holiday=> \"Republic day\", :holiday_date => holiday_date1, :description =>\"Republic day of India\")\n holiday = Holiday.create(:company_id => self.company_id, :created_by => self.company.users.first.id, :holiday=> \"Independance Day\", :holiday_date => holiday_date2, :description =>\"Independance day of India\")\n holiday = Holiday.create(:company_id => self.company_id, :created_by => self.company.users.first.id, :holiday=> \"Mahatma Gandhi Jayanti\", :holiday_date => holiday_date3, :description =>\"Gandhi Jayanti celebrated in India to mark the occasion of the birthday of Mahatma Gandhi.\")\n\n end\n\n if Subscription.find(self.id).plan.payroll_enabled? && self.company.payheads.blank?\n accounts = Account.where(:name => [\"Basic\",\"House Rent Allowance\", \"Dearness Allowance\", \"Travelling Allowance\", \"Bonus\"], :company_id => self.company_id)\n if accounts.blank?\n # Account.create_default_accounts(self.company_id, self.company.users.first.id)\n end\n Payhead.create_default_payheads(self.company_id, self.company.users.first.id)\n end\n if !Subscription.find(self.id).plan.free_plan? && self.company.custom_fields.blank?\n CustomField.create_default_record(self.company_id)\n end\n logger.debug \"After subscription attributes\"\n #update users enrolled with appropriate roles in new plans\n if subscription_history.plan_id != self.plan_id\n self.company.users.each do |user|\n # user.roles[0] = new_plan.roles.find_by_name(user.roles[0].name)\n\t\t\t\t\t# user.save\n # logger.debug \"Updated roles\"\n new_role = new_plan.roles.find_by_name(user.roles[0].name)\n assignment = Assignment.find_by_user_id(user.id)\n assignment.update_attribute(:role_id, new_role.id)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "62857e7062290b45bf9eafbf7933c733",
"score": "0.56503105",
"text": "def update!(**args)\n @adult = args[:adult] if args.key?(:adult)\n @porn = args[:porn] if args.key?(:porn)\n @total = args[:total] if args.key?(:total)\n end",
"title": ""
},
{
"docid": "04e02cef6ccc78337e6330245a570af2",
"score": "0.5638595",
"text": "def update\n authorize BonusElementItemValue\n update_params = @bonus_element_item_value.value_type == 'personal' ? personal_params : departmental_params\n amount = BigDecimal(params[:shares]) * BigDecimal(params[:per_share]) rescue 0\n # update_params = update_params.merge(amount: amount) if @bonus_element_item_value.value_type == 'departmental'\n if @bonus_element_item_value.update(update_params)\n if %w(kill_bonus performance_bonus).include? @bonus_element_item_value.bonus_element.key\n bonus_element_item_values = BonusElementItemValue.where(bonus_element_item_id: @bonus_element_item_value.bonus_element_item_id).joins(:bonus_element)\n kill_bonus_item = bonus_element_item_values.where(:bonus_elements => { key: 'kill_bonus' }).first\n performance_bonus_item = bonus_element_item_values.where(:bonus_elements => { key: 'performance_bonus' }).first\n kill_bonus = get_amount_of_item_value(kill_bonus_item)\n performance_bonus = get_amount_of_item_value(performance_bonus_item)\n if performance_bonus < 0\n kill_bonus = kill_bonus + performance_bonus\n kill_bonus = BigDecimal(0) if kill_bonus < 0\n performance_bonus = BigDecimal(0)\n end\n kill_bonus_item.update(amount: kill_bonus)\n performance_bonus_item.update(amount: performance_bonus)\n else\n @bonus_element_item_value.update(amount: amount) if @bonus_element_item_value.value_type == 'departmental'\n end\n render json: @bonus_element_item_value\n else\n render json: @bonus_element_item_value.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9542946e570f06d5b169d19c1a0ff003",
"score": "0.5628893",
"text": "def update!(**args)\n @additional_charges = args[:additional_charges] if args.key?(:additional_charges)\n @promotions = args[:promotions] if args.key?(:promotions)\n @unit_price_pretax = args[:unit_price_pretax] if args.key?(:unit_price_pretax)\n @unit_price_taxes = args[:unit_price_taxes] if args.key?(:unit_price_taxes)\n end",
"title": ""
},
{
"docid": "9867755c32e17cccdc7458508bc99c45",
"score": "0.5622647",
"text": "def update!(**args)\n @cost = args[:cost] if args.key?(:cost)\n @paid_offer_type = args[:paid_offer_type] if args.key?(:paid_offer_type)\n end",
"title": ""
},
{
"docid": "c681c2240cbbade57491d00e99aaedee",
"score": "0.56062573",
"text": "def edit_vault(vault_id, **args)\n request_put(\"/vault/#{vault_id}\", **args)\n end",
"title": ""
},
{
"docid": "2bfdee41627c555de335d55d94b357c4",
"score": "0.5601954",
"text": "def update_remaining_learner_credit()\n remaining_learner_credit = current_user.tenant.remaining_learner_credit\n new_remaining_learner_credit = remaining_learner_credit -1\n current_user.tenant.update_attribute(:remaining_learner_credit, new_remaining_learner_credit)\n end",
"title": ""
},
{
"docid": "53ddc42bd161d1949daed53e568e8d18",
"score": "0.55972767",
"text": "def edit_vault_member(vault_id, user_id, status)\n request_put(\"/vault/#{vault_id}/member/#{user_id}\", status: status)\n end",
"title": ""
},
{
"docid": "8a995bfc9985221376130611910e4d6c",
"score": "0.5583044",
"text": "def update!(**args)\n @active_ingredients = args[:active_ingredients] if args.key?(:active_ingredients)\n @alcohol_by_volume = args[:alcohol_by_volume] if args.key?(:alcohol_by_volume)\n @allergens = args[:allergens] if args.key?(:allergens)\n @derived_nutrition_claim = args[:derived_nutrition_claim] if args.key?(:derived_nutrition_claim)\n @directions = args[:directions] if args.key?(:directions)\n @indications = args[:indications] if args.key?(:indications)\n @ingredients = args[:ingredients] if args.key?(:ingredients)\n @nutrition_claim = args[:nutrition_claim] if args.key?(:nutrition_claim)\n @storage_instructions = args[:storage_instructions] if args.key?(:storage_instructions)\n end",
"title": ""
},
{
"docid": "206d90792aec7e136c2a81006acf98f8",
"score": "0.5576787",
"text": "def update_statement(credit:, debit:)\n @statement.add_transaction(date: Time.new, credit: credit, debit: debit, balance: @balance)\n end",
"title": ""
},
{
"docid": "3314145eb2a4e2b0e57947c7a4f3107c",
"score": "0.5565863",
"text": "def update\n # add_gang_to_unit\n\n unit_cost = unit_params[ :points ].to_f - @unit.points\n @can_pay_unit = unit_cost <= @player.pp\n\n Unit.transaction do\n respond_to do |format|\n\n if @can_pay_unit && @unit.update(unit_params)\n\n after_unit_update( :update,\n amount: @unit.amount, unit_libe: @unit.libe, gang_name: @gang.name )\n\n pay_unit( unit_cost )\n\n check_maintenance_status!\n\n format.html do\n if @maintenance_status_fixed\n redirect_to campaigns_path\n else\n redirect_to gang_units_path( @gang ), notice: t( '.success' ), alert: @alert_message\n end\n end\n else\n sub_edit\n flash[ :alert ] = @can_pay_unit ? '' : I18n.t( 'units.alert.cant_pay' )\n format.html { render :edit }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "60e97205970feee98cc45d36bed4df7d",
"score": "0.5563454",
"text": "def save_inventory_adjustment_vend(response, quantity)\n location_id = response['inventory_level']['location_id']\n shopify_inventory = retail_shopify.shopify_inventories.find_by(location: location_id)\n new_inventory = response['inventory_level']['available']\n\n InventoryUpdate.create(\n vend_qty: vend_datum.sf_inventory,\n prior_qty: shopify_inventory.inventory,\n adjustment: quantity,\n product_id: id,\n new_qty: new_inventory\n )\n\n shopify_inventory.update_attribute(:inventory, new_inventory)\n end",
"title": ""
},
{
"docid": "aac8f779676d47cb237c87a2e9abadf7",
"score": "0.55605817",
"text": "def update_user\n user.financial_status = user.transactions.pluck(:amount).inject(0.0, &:+)\n user.save\n end",
"title": ""
},
{
"docid": "f4e29ab77fe3466f51699392489bf166",
"score": "0.5542012",
"text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @description = args[:description] if args.key?(:description)\n @finite_billing_cycle_details = args[:finite_billing_cycle_details] if args.key?(:finite_billing_cycle_details)\n @line_item_free_trial_end_time = args[:line_item_free_trial_end_time] if args.key?(:line_item_free_trial_end_time)\n @line_item_index = args[:line_item_index] if args.key?(:line_item_index)\n @line_item_promotion_specs = args[:line_item_promotion_specs] if args.key?(:line_item_promotion_specs)\n @one_time_recurrence_details = args[:one_time_recurrence_details] if args.key?(:one_time_recurrence_details)\n @product = args[:product] if args.key?(:product)\n @product_payload = args[:product_payload] if args.key?(:product_payload)\n @recurrence_type = args[:recurrence_type] if args.key?(:recurrence_type)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
},
{
"docid": "4728a7e5d989c8213fb5c32410957fdc",
"score": "0.55340046",
"text": "def update!(**args)\n @currency_code = args[:currency_code] if args.key?(:currency_code)\n @entitlement_id = args[:entitlement_id] if args.key?(:entitlement_id)\n @price_in_micros = args[:price_in_micros] if args.key?(:price_in_micros)\n @super_vod_item_id = args[:super_vod_item_id] if args.key?(:super_vod_item_id)\n @transaction_id = args[:transaction_id] if args.key?(:transaction_id)\n @version = args[:version] if args.key?(:version)\n end",
"title": ""
},
{
"docid": "ace7fde3e647d0f2cac06f908b8363ac",
"score": "0.5531085",
"text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @amount_pretax = args[:amount_pretax] if args.key?(:amount_pretax)\n @amount_tax = args[:amount_tax] if args.key?(:amount_tax)\n @reason = args[:reason] if args.key?(:reason)\n @reason_text = args[:reason_text] if args.key?(:reason_text)\n end",
"title": ""
},
{
"docid": "5f86ac53c285f165a07cc7ca49e79ab7",
"score": "0.5515858",
"text": "def update!(**args)\n @total_amount = args[:total_amount] if args.key?(:total_amount)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "10b08b018666248b8a7e6db740685567",
"score": "0.5515509",
"text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @amount_pretax = args[:amount_pretax] if args.key?(:amount_pretax)\n @amount_tax = args[:amount_tax] if args.key?(:amount_tax)\n @line_item_id = args[:line_item_id] if args.key?(:line_item_id)\n @operation_id = args[:operation_id] if args.key?(:operation_id)\n @product_id = args[:product_id] if args.key?(:product_id)\n @quantity = args[:quantity] if args.key?(:quantity)\n @reason = args[:reason] if args.key?(:reason)\n @reason_text = args[:reason_text] if args.key?(:reason_text)\n end",
"title": ""
},
{
"docid": "506f0403f032b00ce7880fe5f46dd155",
"score": "0.5504837",
"text": "def update\n @payable = Payable.find(params[:id])\n # params[:payable][:payable_accounts_attributes] = @payable.process_removed_accounts(params[:payable][:payable_accounts_attributes])\n\n # Updating GlAccount\n # accountsPayableAmt = 0\n # @payable.payable_accounts.each do |payable_account|\n # CommonActions.update_gl_accounts(payable_account.gl_account.gl_account_title, 'decrement',payable_account.payable_account_amount, @payable.id )\n # accountsPayableAmt += payable_account.payable_account_amount\n # end\n # CommonActions.update_gl_accounts('ACCOUNTS PAYABLE', 'decrement',accountsPayableAmt, @payable.id )\n\n respond_to do |format|\n if @payable.update_attributes(payable_params)\n if Payable.find_by_payable_disperse(\"unassigned\").present?\n payable = Payable.find_by_payable_disperse(\"unassigned\")\n payable.update_attributes(:payable_disperse => \"assigned\")\n end\n # @payable.update_gl_account\n format.html { redirect_to @payable, notice: 'Payable was successfully updated.' }\n format.json { head :no_content }\n else\n p @payable.errors.to_json\n if @payable.payable_type == 'manual'\n format.html { render action: \"manual_edit\" }\n format.json { render json: @payable.errors, status: :unprocessable_entity }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @payable.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "96156210e87b698db10d7070c91dd2ed",
"score": "0.5501626",
"text": "def increase_insurance_premium\n self.insurance_premium += 100\n end",
"title": ""
},
{
"docid": "4a6ec0c72992bfd3e058e19d88e39174",
"score": "0.54924583",
"text": "def update(value)\n\t\tself.premium = value\n\t\tself.date_created = Date.today\n\tend",
"title": ""
},
{
"docid": "01220f35b9584e3eb4f73a183a47bd04",
"score": "0.5489391",
"text": "def add_or_remove_cash(update, cash)\n update[:admin][:total_cash] += cash\n return cash\nend",
"title": ""
},
{
"docid": "01220f35b9584e3eb4f73a183a47bd04",
"score": "0.5489391",
"text": "def add_or_remove_cash(update, cash)\n update[:admin][:total_cash] += cash\n return cash\nend",
"title": ""
},
{
"docid": "a2cf59dcce13d43d315cc5daf5a60b4f",
"score": "0.5487864",
"text": "def update_inventory_and_status\n self.update_inventory\n self.update_status \n end",
"title": ""
},
{
"docid": "f7c5b986c134dd0d13f0ca5ca2675867",
"score": "0.5486202",
"text": "def update_user_balance\n user.decrement(:loyalty_points_balance, loyalty_points)\n user.save!\n end",
"title": ""
},
{
"docid": "cec5c91c4911588f67b1fe2123bb971e",
"score": "0.5485711",
"text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @amount_pretax = args[:amount_pretax] if args.key?(:amount_pretax)\n @amount_tax = args[:amount_tax] if args.key?(:amount_tax)\n @operation_id = args[:operation_id] if args.key?(:operation_id)\n @reason = args[:reason] if args.key?(:reason)\n @reason_text = args[:reason_text] if args.key?(:reason_text)\n end",
"title": ""
},
{
"docid": "d846ce608fd31b4c31e38147d606da18",
"score": "0.5482167",
"text": "def update_totals\n # update_adjustments\n self.payment_total = payments.completed.map(&:amount).sum\n self.item_total = line_items.map(&:amount).sum\n \n self.adjustment_total = adjustments.eligible.map(&:amount).sum\n self.total = item_total + adjustment_total + gift_packaging_total\n end",
"title": ""
},
{
"docid": "ace473c37d6530cea4f67c14e93f63d3",
"score": "0.54815114",
"text": "def update!(**args)\n @lower_amount = args[:lower_amount] if args.key?(:lower_amount)\n @unit = args[:unit] if args.key?(:unit)\n @upper_amount = args[:upper_amount] if args.key?(:upper_amount)\n end",
"title": ""
},
{
"docid": "ace473c37d6530cea4f67c14e93f63d3",
"score": "0.54815114",
"text": "def update!(**args)\n @lower_amount = args[:lower_amount] if args.key?(:lower_amount)\n @unit = args[:unit] if args.key?(:unit)\n @upper_amount = args[:upper_amount] if args.key?(:upper_amount)\n end",
"title": ""
},
{
"docid": "ed613b9a94261b918478cc9fd2d84d95",
"score": "0.5469109",
"text": "def update\n @invoice = CsInvoice.where(:id => params[:invoice_id]).first\n @user = @invoice.user\n\n if params[:increase] && params[:increase] != \"true\"\n params[:invoice][:balance] = 0 if @invoice.balance - params[:invoice][:balance].to_d <= 0 # so it won't get negative\n end\n\n if params[:add_with_tax].to_i == 1 and @invoice.tax\n params[:invoice][:balance_with_tax] = params[:invoice][:balance].to_d\n params[:invoice][:balance] = @invoice.tax.count_amount_without_tax(params[:invoice][:balance]).to_d\n else\n if @invoice.tax\n params[:invoice][:balance_with_tax] = @invoice.tax.apply_tax(params[:invoice][:balance]).to_d\n end\n end\n\n @invoice.update_attributes(params[:invoice])\n\n if params[:invoice][:balance]\n @user.update_attributes({:balance => params[:invoice][:balance].to_d})\n end\n store_invoice_in_session(@user, @invoice)\n\n respond_to do |format|\n format.json { render :json => \"OK\".to_json }\n end\n end",
"title": ""
},
{
"docid": "a65faef069662e90f49f2f29e9fbee5b",
"score": "0.54685384",
"text": "def add_to_bank\n @user.balance -= 10\n @croupier.balance -= 10\n @bank = 20\n end",
"title": ""
},
{
"docid": "8efec01987107bb7bbddfaaecf55eecb",
"score": "0.5467097",
"text": "def update!(**args)\n @payments = args[:payments] if args.key?(:payments)\n end",
"title": ""
},
{
"docid": "d47944327aa82f407992e1a949cceaf3",
"score": "0.5462673",
"text": "def update!(**args)\n @base_unit = args[:base_unit] if args.key?(:base_unit)\n @base_unit_conversion_factor = args[:base_unit_conversion_factor] if args.key?(:base_unit_conversion_factor)\n @base_unit_description = args[:base_unit_description] if args.key?(:base_unit_description)\n @display_quantity = args[:display_quantity] if args.key?(:display_quantity)\n @tiered_rates = args[:tiered_rates] if args.key?(:tiered_rates)\n @usage_unit = args[:usage_unit] if args.key?(:usage_unit)\n @usage_unit_description = args[:usage_unit_description] if args.key?(:usage_unit_description)\n end",
"title": ""
},
{
"docid": "c448087d9d395d42cc623db7af5a9085",
"score": "0.54597765",
"text": "def update!(**args)\n @start_usage_amount = args[:start_usage_amount] if args.key?(:start_usage_amount)\n @unit_price = args[:unit_price] if args.key?(:unit_price)\n end",
"title": ""
},
{
"docid": "1205a08a3d2b9a94136d2df85fda055a",
"score": "0.5457734",
"text": "def update_ledger\n self.create_ledger(amount: self.amount, customer: self.customer, date: self.date, received: 0)\n end",
"title": ""
},
{
"docid": "61762909d802eee1c6581fef75ff666b",
"score": "0.545761",
"text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @amount_pretax = args[:amount_pretax] if args.key?(:amount_pretax)\n @amount_tax = args[:amount_tax] if args.key?(:amount_tax)\n @line_item_id = args[:line_item_id] if args.key?(:line_item_id)\n @product_id = args[:product_id] if args.key?(:product_id)\n @quantity = args[:quantity] if args.key?(:quantity)\n @reason = args[:reason] if args.key?(:reason)\n @reason_text = args[:reason_text] if args.key?(:reason_text)\n end",
"title": ""
},
{
"docid": "dbb0d9478548475c171055ce03548358",
"score": "0.5451602",
"text": "def modify_wallet(bet)\n $wallet -= bet\n if $wallet < 0\n $wallet += bet\n puts \"Oops! Looks like you do not have enough money for that.\".red\n first_spin\n end\n end",
"title": ""
},
{
"docid": "3d477273c5714f5bbed1c21ee5308782",
"score": "0.545071",
"text": "def update\n unless @plan.update(plan_params)\n render json: {status: 'failed', message: '更新失败,请稍后重试 !'}\n end\n end",
"title": ""
},
{
"docid": "0926f965ba341c445ca036d388723943",
"score": "0.54449576",
"text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @region_code = args[:region_code] if args.key?(:region_code)\n end",
"title": ""
},
{
"docid": "0a80bdb8b3acbdcf9c7884c0a9249ee4",
"score": "0.5441047",
"text": "def update!(**args)\n @cost = args[:cost] if args.key?(:cost)\n @currency = args[:currency] if args.key?(:currency)\n @discount_value = args[:discount_value] if args.key?(:discount_value)\n @tax = args[:tax] if args.key?(:tax)\n @transaction_id = args[:transaction_id] if args.key?(:transaction_id)\n @value = args[:value] if args.key?(:value)\n end",
"title": ""
},
{
"docid": "160b06babe143a1f0a9aacbbb74a3f1f",
"score": "0.5439656",
"text": "def update!(**args)\n @backup_plans = args[:backup_plans] if args.key?(:backup_plans)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @unreachable = args[:unreachable] if args.key?(:unreachable)\n end",
"title": ""
},
{
"docid": "cf7dedb9dd0fbad9103b6dda955b4d96",
"score": "0.5439585",
"text": "def update!(**args)\n @amount_pretax = args[:amount_pretax] if args.key?(:amount_pretax)\n @amount_tax = args[:amount_tax] if args.key?(:amount_tax)\n @line_item_id = args[:line_item_id] if args.key?(:line_item_id)\n @operation_id = args[:operation_id] if args.key?(:operation_id)\n @product_id = args[:product_id] if args.key?(:product_id)\n @quantity = args[:quantity] if args.key?(:quantity)\n @reason = args[:reason] if args.key?(:reason)\n @reason_text = args[:reason_text] if args.key?(:reason_text)\n end",
"title": ""
},
{
"docid": "cf7dedb9dd0fbad9103b6dda955b4d96",
"score": "0.5439585",
"text": "def update!(**args)\n @amount_pretax = args[:amount_pretax] if args.key?(:amount_pretax)\n @amount_tax = args[:amount_tax] if args.key?(:amount_tax)\n @line_item_id = args[:line_item_id] if args.key?(:line_item_id)\n @operation_id = args[:operation_id] if args.key?(:operation_id)\n @product_id = args[:product_id] if args.key?(:product_id)\n @quantity = args[:quantity] if args.key?(:quantity)\n @reason = args[:reason] if args.key?(:reason)\n @reason_text = args[:reason_text] if args.key?(:reason_text)\n end",
"title": ""
},
{
"docid": "37c57e688653f80e56d1f93cc633dcfc",
"score": "0.54333705",
"text": "def update!(**args)\n @additional_charge_summaries = args[:additional_charge_summaries] if args.key?(:additional_charge_summaries)\n @customer_balance = args[:customer_balance] if args.key?(:customer_balance)\n @google_balance = args[:google_balance] if args.key?(:google_balance)\n @merchant_balance = args[:merchant_balance] if args.key?(:merchant_balance)\n @product_total = args[:product_total] if args.key?(:product_total)\n @promotion_summaries = args[:promotion_summaries] if args.key?(:promotion_summaries)\n end",
"title": ""
},
{
"docid": "ab6b365f178f08aedecea42a2695559a",
"score": "0.54293597",
"text": "def update\n\t\t# se o usuário não entiver infectado e se já não existir um igual salvo, atualiza o inventário\n\t\tunless User.healthy? inventory_params[:user_id]\n \t \trender json: { error: \"Denied access. User is contaminated!\" }, status: 403 and return\n \tend\n\n\t\tif @inventory.update(inventory_params)\n\t\t\t render json: @inventory, status: 200\n \telse\n \t\trender json: @inventory.errors, status: :unprocessable_entity\n \tend\n\tend",
"title": ""
},
{
"docid": "93dbd22213a4b3cc80994a5d415c9ee3",
"score": "0.5422181",
"text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @currency = args[:currency] if args.key?(:currency)\n end",
"title": ""
},
{
"docid": "93dbd22213a4b3cc80994a5d415c9ee3",
"score": "0.5422181",
"text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @currency = args[:currency] if args.key?(:currency)\n end",
"title": ""
},
{
"docid": "a4f4574e1e032045b98507c67a344478",
"score": "0.54214686",
"text": "def update_captain_and_eligibility(*)\n reload # SQL caching causing users to be empty when creating team making all teams ineligible\n set_team_captain\n update_eligibility\n end",
"title": ""
},
{
"docid": "a09bcfa1987405e94806080ac4293e87",
"score": "0.5421045",
"text": "def update\n @invoice = Invoice.find(params[:id])\n @invoice.update_attributes(params[:invoice])\n @invoice.remaining_sum=@invoice.total_sum\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to(@invoice, :notice => 'Facture modifiée avec succes.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76ff3a2a6e39afeffe2986bafbcccfad",
"score": "0.5416498",
"text": "def set_vault\n @vault = Vault.find(params[:id])\n end",
"title": ""
},
{
"docid": "fb340e12707a2fe3c6f63edc2a63ff1e",
"score": "0.54105824",
"text": "def si_update_approved_amount\n amount = params[:amount].to_f / 10000\n invoice_id = params[:invoice]\n tbl = params[:tbl]\n debt = SupplierInvoice.find(invoice_id).debt rescue -1\n not_yet_approved = SupplierInvoice.find(invoice_id).amount_not_yet_approved rescue -1\n amount = (amount > debt || amount > not_yet_approved) ? '$err' : number_with_precision(amount.round(4), precision: 4)\n @json_data = { \"amount\" => amount.to_s, \"tbl\" => tbl.to_s }\n render json: @json_data\n end",
"title": ""
},
{
"docid": "8708da99a3c40d7f2f933dafdcc7be83",
"score": "0.54082894",
"text": "def update!(**args)\n @behavioral_trust_verdict = args[:behavioral_trust_verdict] if args.key?(:behavioral_trust_verdict)\n @card_testing_verdict = args[:card_testing_verdict] if args.key?(:card_testing_verdict)\n @stolen_instrument_verdict = args[:stolen_instrument_verdict] if args.key?(:stolen_instrument_verdict)\n @transaction_risk = args[:transaction_risk] if args.key?(:transaction_risk)\n end",
"title": ""
},
{
"docid": "8cf399d03a4957e8a5b4c1daa3660510",
"score": "0.54079306",
"text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @description = args[:description] if args.key?(:description)\n @expected_units_per_year = args[:expected_units_per_year] if args.key?(:expected_units_per_year)\n @range = args[:range] if args.key?(:range)\n @type = args[:type] if args.key?(:type)\n @unit = args[:unit] if args.key?(:unit)\n end",
"title": ""
},
{
"docid": "8cf399d03a4957e8a5b4c1daa3660510",
"score": "0.54079306",
"text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @description = args[:description] if args.key?(:description)\n @expected_units_per_year = args[:expected_units_per_year] if args.key?(:expected_units_per_year)\n @range = args[:range] if args.key?(:range)\n @type = args[:type] if args.key?(:type)\n @unit = args[:unit] if args.key?(:unit)\n end",
"title": ""
},
{
"docid": "8cf399d03a4957e8a5b4c1daa3660510",
"score": "0.54079306",
"text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @description = args[:description] if args.key?(:description)\n @expected_units_per_year = args[:expected_units_per_year] if args.key?(:expected_units_per_year)\n @range = args[:range] if args.key?(:range)\n @type = args[:type] if args.key?(:type)\n @unit = args[:unit] if args.key?(:unit)\n end",
"title": ""
},
{
"docid": "3f561ea614319dacbe4636c6c64f66e3",
"score": "0.54068816",
"text": "def update!(**args)\n @addons_vip = args[:addons_vip] if args.key?(:addons_vip)\n @control_plane_vip = args[:control_plane_vip] if args.key?(:control_plane_vip)\n end",
"title": ""
},
{
"docid": "711be12546db217faf48299574338943",
"score": "0.5400622",
"text": "def update!(**args)\n @introductory_pricing_specs = args[:introductory_pricing_specs] if args.key?(:introductory_pricing_specs)\n end",
"title": ""
},
{
"docid": "2d289174bbf9e634f11f9d66459359df",
"score": "0.53982186",
"text": "def update\n\n debt = Debt.find_by_id(params[:id])\n payment = BigDecimal( debt_params[:amount] )\n\n # Since the debted user is paying the indebted user,\n # we can simulate this as the indebted user \"owing\"\n # the debted user (a.k.a. the debt owner) the payed off\n # debt.\n Debt.settleDebt(debt.owner, debt.indebted, payment)\n flash[:success] = \"Debt has been paid successfully.\"\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "b87749d068c646e11db3c8550c39b65c",
"score": "0.53976625",
"text": "def update\n exps = remove_invalid(expirations)\n exps = add_default_expiration(exps)\n return if exps == expirations\n update_expirations(exps)\n rescue Berta::Errors::BackendError => e\n logger.error \"#{e.message} on vm with id #{handle['ID']}\"\n end",
"title": ""
},
{
"docid": "7b65b25eb54ed77474d2e9f29a8c97d0",
"score": "0.539609",
"text": "def update_total_savings_account\n incoming = member.savings_entries.where(\n :savings_status => SAVINGS_STATUS[:savings_account],\n :direction => FUND_DIRECTION[:incoming]\n ).sum(\"amount\") \n \n outgoing = member.savings_entries.where(\n :savings_status => SAVINGS_STATUS[:savings_account],\n ).sum(\"amount\")\n \n self.total_savings_account = incoming - outgoing \n self.save\n end",
"title": ""
},
{
"docid": "73b997507265e2f56e8b7db598e47555",
"score": "0.53883845",
"text": "def update\n @member = Member.find(params[:id])\n\n if @member.vend_total.nil?\n @member.vend_total = 0\n end\n\n if @member.vend_credits.nil?\n @member.vend_credits = 1\n end\n \n if @member.door_count.nil?\n @member.door_count = 0\n end\n \n\n raise CanCan::AccessDenied if cannot? :edit, @member\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "747d07d630b602123d5cb403a84ba327",
"score": "0.538616",
"text": "def update!(**args)\n @disruption_budget = args[:disruption_budget] if args.key?(:disruption_budget)\n @mode = args[:mode] if args.key?(:mode)\n end",
"title": ""
},
{
"docid": "3d218a0c6a0df31e68ed0c199c7976f8",
"score": "0.5383183",
"text": "def update\n @account = @user.account\n @plan = Plan.find(params[:account][:plan_id])\n \n if @account.plan_change_valid?(@plan)\n if @plan.free?\n respond_to do |format|\n if @account.update_attributes(params[:account])\n flash[:notice] = 'Account was successfully updated.'\n format.html { redirect_to(account_path(@account, :subdomain => @user.subdomain)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n else\n session[:account_id] = @account.id\n session[:plan_id] = @plan.id\n checkout(upgrade_account_url, projects_root_url(:subdomain => @user.subdomain))\n end\n else\n flash[:warning] = \"Account plan could not be changed.\"\n redirect_to(projects_root_url(:subdomain => @user.subdomain))\n end\n end",
"title": ""
},
{
"docid": "acb9185667467afc3b7ae96eca0fd674",
"score": "0.53817433",
"text": "def update_defaultee_savings_deduction\n default_payment = self.default_payment \n total_compulsory_savings = self.total_compulsory_savings\n total_voluntary_savings = self.total_voluntary_savings\n total_deductible_member_savings = total_compulsory_savings + total_extra_savings\n \n # refresh the state \n default_payment.compulsory_savings_deduction_amount = BigDecimal(\"0\")\n default_payment.voluntary_savings_deduction_amount = BigDecimal(\"0\")\n default_payment.amount_to_be_shared_with_non_defaultee = BigDecimal(\"0\")\n \n total_amount = default_payment.outstanding_grace_period_amount \n \n if total_amount <= total_compulsory_savings\n default_payment.compulsory_savings_deduction_amount = total_amount \n elsif total_amount > total_compulsory_savings && total_amount <= total_deductible_member_savings \n default_payment.amount_of_compulsory_savings_deduction = total_compulsory_savings \n default_payment.voluntary_savings_deduction_amount = total_amount - total_compulsory_savings\n elsif total_amount > total_deductible_member_savings \n default_payment.compulsory_savings_deduction_amount = total_compulsory_savings \n default_payment.voluntary_savings_deduction_amount = total_extra_savings\n default_payment.amount_to_be_shared_with_non_defaultee = total_amount - total_deductible_member_savings\n end \n \n default_payment.save\n end",
"title": ""
},
{
"docid": "6c9b97a27e56b9db9f48edc198c7833d",
"score": "0.53813124",
"text": "def update!(**args)\n @alarms = args[:alarms] if args.key?(:alarms)\n @snooze_duration = args[:snooze_duration] if args.key?(:snooze_duration)\n @state_fetch_error = args[:state_fetch_error] if args.key?(:state_fetch_error)\n end",
"title": ""
},
{
"docid": "9661c263f8a5c4bc20446279183ff1bb",
"score": "0.5376623",
"text": "def update!(**args)\n @amount_pretax = args[:amount_pretax] if args.key?(:amount_pretax)\n @amount_tax = args[:amount_tax] if args.key?(:amount_tax)\n @line_item_id = args[:line_item_id] if args.key?(:line_item_id)\n @product_id = args[:product_id] if args.key?(:product_id)\n @quantity = args[:quantity] if args.key?(:quantity)\n @reason = args[:reason] if args.key?(:reason)\n @reason_text = args[:reason_text] if args.key?(:reason_text)\n end",
"title": ""
},
{
"docid": "9661c263f8a5c4bc20446279183ff1bb",
"score": "0.5376623",
"text": "def update!(**args)\n @amount_pretax = args[:amount_pretax] if args.key?(:amount_pretax)\n @amount_tax = args[:amount_tax] if args.key?(:amount_tax)\n @line_item_id = args[:line_item_id] if args.key?(:line_item_id)\n @product_id = args[:product_id] if args.key?(:product_id)\n @quantity = args[:quantity] if args.key?(:quantity)\n @reason = args[:reason] if args.key?(:reason)\n @reason_text = args[:reason_text] if args.key?(:reason_text)\n end",
"title": ""
},
{
"docid": "916a8e6c61e966321abe1f6be6536ed5",
"score": "0.53674555",
"text": "def update\n # Prevents unauthorized access by other users\n if current_user.id != @purchase.user_id\n flash[:notice] = \"You don't have permission to view that page!\"\n redirect_to current_user\n return\n end\n respond_to do |format|\n if @purchase.update(purchase_params)\n # update current total price for this payment\n @purchase.update_current_total_price()\n\n format.html { redirect_to @purchase, notice: 'Purchase was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d1df46926a433c6d669134a43094895",
"score": "0.53637546",
"text": "def update_from_pivotal_card(pivotal_card)\n puts \"=> #{pivotal_card.attributes[:name]}\"\n puts \"=> #{pivotal_card.attributes[:current_state].upcase}\\n\\n\"\n set_pivotal_attributes(pivotal_card)\n @pivotal_attributes.map { |k, v| @card.send(\"#{k}=\", v) }\n @card.save\n end",
"title": ""
},
{
"docid": "d4786b9b7632fec67a613941ab2c940f",
"score": "0.5362047",
"text": "def update_balance(transaction_id)\n transaction = Transaction.find(transaction_id)\n account = transaction.account\n balance = account.balance\n\n if transaction.credit == true\n account.update(balance: balance + transaction.amount)\n else\n account.update(balance: balance - transaction.amount)\n end\nend",
"title": ""
},
{
"docid": "039bf587d849116e8d48be81bb9511f9",
"score": "0.5360882",
"text": "def update\n \n begin\n DetailValue.transaction do\n # Increment the instance version\n increment_instance_version\n @resource = update_value(params[:detail_id], \n params[:id], \n {\n 'lock_version' => params[:value][:lock_version],\n 'value' => params[:value][:value] \n })\n \n end\n render :response => :PUT\n rescue Exception => e\n @error = process_exception(e)\n render :response => :error\n end\n end",
"title": ""
},
{
"docid": "7e2f4f43af667ca7ddab81cf2cb240e5",
"score": "0.5357249",
"text": "def test_change_plan\n response=@root_key_api.change_plan(\"test-rb@precog.com\",\"password\",@account_id, \"Bronze\")\n \n response=@root_key_api.describe_plan(\"test-rb@precog.com\",\"password\",@account_id)\n assert_include response, 'type'\n assert_equal 'Bronze', response['type']\n\n response=@root_key_api.change_plan(\"test-rb@precog.com\",\"password\",@account_id, \"Free\")\n end",
"title": ""
},
{
"docid": "f250446d4f25e21d1ba69805bb40d19b",
"score": "0.5349046",
"text": "def add_or_remove_cash(pet_shop, amount)\n pet_shop[:admin][:total_cash] += amount\nend",
"title": ""
},
{
"docid": "59d9b0a8daa71d92029cb46fc4b1e7c9",
"score": "0.53490144",
"text": "def update\n respond_to do |format|\n if @inventory_plan.update(inventory_plan_params)\n format.html { redirect_to @inventory_plan, notice: 'Inventory plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @inventory_plan }\n else\n format.html { render :edit }\n format.json { render json: @inventory_plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62102676e1e8517fb02e82485cb597c4",
"score": "0.53416884",
"text": "def update!(**args)\n @racy_level = args[:racy_level] if args.key?(:racy_level)\n end",
"title": ""
},
{
"docid": "ec99cff065b0c629e383b37834e41ed0",
"score": "0.53398937",
"text": "def update\n # Expecting the following format:\n # {\n # \"dmp\": {\n # \"dmp_id\": {\n # 'type': 'doi',\n # 'identifier': '10.234/erfere.234d'\n # },\n # \"contributor\": [{\n # \"name\": 'Jane Doe',\n # \"mbox\": 'jane.doe@example.org',\n # \"roles\": 'https://credit.org/roles/program_officer',\n # \"affiliation\": {\n # \"name\": 'National Science Foundation (NSF)'\n # },\n # }],\n # \"project\": {\n # \"start_on\": '2020-05-15 10:34:21 UCT',\n # \"end_on\": '2022-05-15 10:34:21 UCT',\n # \"funding\": [{\n # \"name\": \"Example Funder\",\n # \"funder_id\": {\n # 'typer':'ROR',\n # 'identifier': 'http://ror.org/45y4545'\n # },\n # \"grant_id\": {\n # 'type': 'url',\n # 'identifier': 'http://awards.example.org/1234'\n # }\n # \"funding_status\": \"granted\"\n # }]\n # }\n # }\n # }\n @funding = Funding.where(id: params[:id]).first\n if @funding.present? && funding_params.fetch('dmp_id', {}).any? &&\n funding_params['dmp_id']['identifier'].present? &&\n funding_params.fetch('project', {})['funding'].present?\n\n dmp = DataManagementPlan.find_by_doi(funding_params['dmp_Id']['identifier']).first\n if @funding.project.data_management_plans.first.id == dmp.id\n prepare_project_for_update(params: funding_params['project'])\n prepare_funding_for_update(params: funding_params['project']['funding'].first)\n\n if funding_params.fetch('contributor', []).any? && authorize_person_assertions\n DataManagementPlan.contributors_from_json(\n provenance: current_client[:name],\n dmp: dmp,\n json: funding_params\n )\n end\n\n if dmp.save && @funding.project.save && @funding.save\n head :no_content, location: landing_page_url(id: dmp.dois.first&.value)\n\n else\n project_errs = @funding.project.errors.collect { |e, m| { \"#{e}\": m } } || []\n funding_errs = @funding.errors.collect { |e, m| { \"#{e}\": m } } || []\n errs = (project_errs + funding_errs).join(', ')\n Rails.logger.warn \"Error saving Project + Funding during api/v0/fundings#update: #{errs}\"\n render_error errors: \"Unable to assert your Funding: #{errs}\", status: :unprocessable_entity\n end\n else\n render_error errors: 'Unauthorized', status: :unauthorized\n end\n else\n render_error errors: 'Unauthorized', status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "137a85fb479fda67654680abb36a4d72",
"score": "0.53312093",
"text": "def update!(**args)\n @disruption_budget = args[:disruption_budget] if args.key?(:disruption_budget)\n @min_wait_duration = args[:min_wait_duration] if args.key?(:min_wait_duration)\n end",
"title": ""
},
{
"docid": "fdc2895f2b9a7994e8d62ea25cf707f1",
"score": "0.532667",
"text": "def update\n respond_to do |format|\n if @conciliabank_detail.update(conciliabank_detail_params)\n\n @conciliabank_detail[:cargo] = @conciliabank.get_subtotal(\"cargos\")\n @conciliabank_detail[:abono] = @conciliabank.get_subtotal(\"abonos\")\n @conciliabank[:saldo_final] = @conciliabank[:saldo_inicial] - @conciliabank_detail[:cargo] + @conciliabank_detail[:abono]\n \n @conciliabank.update_attributes(:saldo_final=> @conciliabank[:saldo_final])\n\n format.html { redirect_to @conciliabank, notice: 'Detalle conciliacion fue actualizado con exito.' }\n format.json { render :show, status: :ok, location: @conciliabank }\n else\n format.html { render :edit }\n format.json { render json: @conciliabank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
b6ad3d00ab18a50cf64bf3c44d78bd27
|
POST /users POST /users.json
|
[
{
"docid": "392b8b286088db3b3975d8028d5cd4c2",
"score": "0.0",
"text": "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n session[:user_id] = @user.id\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "24c5e44d772da89269600975eeebdfda",
"score": "0.719235",
"text": "def create\n @user = User.new(user_params)\n @user.save\n json_response(@user, :created)\n end",
"title": ""
},
{
"docid": "6e1490da4a56756e02c8de2a503a156e",
"score": "0.7186101",
"text": "def create\n user = User.create(user_params)\n render json: user \n end",
"title": ""
},
{
"docid": "abbd4ae1bf5b73d33895ce37a232ee4e",
"score": "0.7166768",
"text": "def create\n uri = \"http://localhost:3000/api/v1/users\"\n payload = params.to_json # converting the params to json\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n begin\n rest_resource.post payload , :content_type => \"application/json\"\n flash[:notice] = \"User Saved successfully\"\n redirect_to users_path # take back to index page, which now list the newly created user also\n # rescue RestClient::ExceptionWithResponse => e\n # e.response\n rescue Exception => e\n flash[:error] = \"User Failed to save\"\n render :new\n end\n end",
"title": ""
},
{
"docid": "37985c48d5b61c8f5cf1435be046c885",
"score": "0.7150967",
"text": "def create\n # Cria um novo usuário\n \tuser = User.new(users_params)\n \tif user.save\n \t\trender json: :success, status: 201\n \telse\n \t\trender json: user.errors, status: :unprocessable_entity\n \tend\n end",
"title": ""
},
{
"docid": "6daf8ec468346206f77462c0cc6e3f8f",
"score": "0.7134619",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: 201\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "22201f22e629399ac67e583badeab894",
"score": "0.71213424",
"text": "def post_users_json payload\n\tJSON.parse ( rest_client_request :post, HF_URL, payload ).body\nend",
"title": ""
},
{
"docid": "43ac909a0952d35ac026c86ef452bec1",
"score": "0.71002",
"text": "def create\n @user = User.create!(user_params)\n json_response(@user, :created)\n end",
"title": ""
},
{
"docid": "43ac909a0952d35ac026c86ef452bec1",
"score": "0.71002",
"text": "def create\n @user = User.create!(user_params)\n json_response(@user, :created)\n end",
"title": ""
},
{
"docid": "0d97a0230ec27d27301f84e74feba42a",
"score": "0.7084989",
"text": "def create\n user = User.new(user_params)\n if user.save\n render json: { status: :success, data: user.to_json }\n else\n render json: { status: :error, data: user.errors }\n end\n end",
"title": ""
},
{
"docid": "07dda66443bfdb3ed32429d4dc792c3e",
"score": "0.7083972",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6f147d0743269674e02acd0b2139f2a5",
"score": "0.7076253",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7dce7921df400608e751f4f96f67f54b",
"score": "0.7072414",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: @user, status: 200\n else\n render error: {error: 'Unble to create user'}, status: 400\n end\n end",
"title": ""
},
{
"docid": "59a72dc48a5d3d6fbd6229f5b7c7687a",
"score": "0.70646214",
"text": "def create\n user = User.new(user_params)\n if user.save\n render json: user, status: 201, location: [:api, user]\n else\n failed_to_create(user, \"user\")\n end\n end",
"title": ""
},
{
"docid": "1d4ed059e259909d177e4a88f47f05bc",
"score": "0.7059066",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d8ffcf4fd633958a8947bac4db9cb5dc",
"score": "0.70582175",
"text": "def create \n @user = User.create(user_params)\n json_response(@user) # return created user, to signify that the user was created\n end",
"title": ""
},
{
"docid": "ebd87ad8d229bd8cd7de2ac155d7b227",
"score": "0.7037457",
"text": "def create\n @user = User.create(user_params)\n if @user.save\n render json: @user, status: :created\n end\n end",
"title": ""
},
{
"docid": "e9fbfa1bc53a2ac4bd58c00bd1d5638f",
"score": "0.7028001",
"text": "def create\n @user = User.new(user_params(params[:user]))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e9fbfa1bc53a2ac4bd58c00bd1d5638f",
"score": "0.7028001",
"text": "def create\n @user = User.new(user_params(params[:user]))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e9fbfa1bc53a2ac4bd58c00bd1d5638f",
"score": "0.7028001",
"text": "def create\n @user = User.new(user_params(params[:user]))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e9fbfa1bc53a2ac4bd58c00bd1d5638f",
"score": "0.7028001",
"text": "def create\n @user = User.new(user_params(params[:user]))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f47048db1e9115b5c630f9714cc0f75d",
"score": "0.70240223",
"text": "def create\n @user = User.new(params[:user])\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a2d70996dc3fb75fa1611a5ac10678ec",
"score": "0.70096433",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1",
"score": "0.70024",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1",
"score": "0.70024",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1",
"score": "0.70024",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1",
"score": "0.70024",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1",
"score": "0.70024",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "027dceb0e06879f9dd82e3267096fab6",
"score": "0.6988672",
"text": "def create\n user = User.new(user_params)\n if user.save\n render(json: user.as_json, status: :ok)\n else\n render(json: {error: \"Erro ao criar usuário\"}, status: :ok) \n end\n end",
"title": ""
},
{
"docid": "e1e13eee09f048e261c1adc854f89ba8",
"score": "0.6983368",
"text": "def create_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "60008e55efe5e005c89473989a349a73",
"score": "0.6979104",
"text": "def create\n @newUser = User.new user_params\n @newUser.save\n respond_to do |format|\n format.json { render :json =>{ :user => @newUser } }\n end\n end",
"title": ""
},
{
"docid": "8ec352eb64ac87719368e0a6384df870",
"score": "0.69777405",
"text": "def create\n @user = User.new(user_params)\n \n if @user.save\n render json: @user, status: :ok\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f0e15f4bfe9ccb2e01928c79b410056f",
"score": "0.69747496",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: @user\n else\n render json: { error: @user.errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2354332fa19a242825b6ebad7478bd81",
"score": "0.69717956",
"text": "def create\n user = User.new(user_params)\n\n if user.save\n render json: user, status: 201\n else\n render json: { errors: user.errors }, status: 422\n end\n end",
"title": ""
},
{
"docid": "38c2fae14c3a3237a50d99d7804078da",
"score": "0.6971312",
"text": "def create\n user = User.new(user_params)\n\n if user.save\n render json: user, status: 201\n\n else\n render json: { errors: user.errors}, status: 422\n end\n end",
"title": ""
},
{
"docid": "81d92dd09d4653c74e47d465e6ea0518",
"score": "0.69673854",
"text": "def create\n @user = User.new(user_params)\n if @user.valid?\n @user.save\n render json: @user\n else\n render json: { error: 'failed to create user' }, status: :not_acceptable\n end\n end",
"title": ""
},
{
"docid": "d892405a3f0fdac5f0e4edb1975899f2",
"score": "0.69659865",
"text": "def create_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "4dae5bffafa98da4d6846fa897e239db",
"score": "0.6942708",
"text": "def create_user\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users.json'\n ).to_s\n\n puts RestClient.post(\n url,\n { user: { username: \"Gizmo\"} }\n )\nend",
"title": ""
},
{
"docid": "e52b492f541859fc0188a4774fd33dae",
"score": "0.69240993",
"text": "def create\n new_user = User.create!(user_params)\n json_response(new_user, :created)\n end",
"title": ""
},
{
"docid": "84f6f74cea05ed6a92c458db2e2a5f02",
"score": "0.69230026",
"text": "def create\n @user = User.new(JSON.parse(params[:user]))\n\n respond_to do |format|\n if @user.save\n #format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render json: Api::V3::UsersPresenter.new().as_json(@user), status: :created, location: @user }\n else\n #format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a2bb25163b85a2e77c21abf3f5b2992",
"score": "0.69217426",
"text": "def create\n user = User.new(user_params)\n if user.save\n render json: user, status: 201, location: [:api_v1, user]\n else\n render json: { errors: user.errors }, status: 422\n end\n end",
"title": ""
},
{
"docid": "df5af3912b67fcf0cc3a1b8ec7605de0",
"score": "0.68981665",
"text": "def create\n @user = User.new(user_params(params))\n\t\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f401cd8bd43122e22ab229e70587952c",
"score": "0.68928874",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n return render json: { user: @user }, status: :created\n else\n return render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5865556aa0e62f502691438f93a69ffa",
"score": "0.6892376",
"text": "def create\n\t\t@user = User.new(user_params)\n\t\tif @user.save\n\t\t\trender json: @user, status: :created\n\t\telse\n\t\t\t render json: @user.errors, status: :unprocessable_entity\n\t\tend \n\tend",
"title": ""
},
{
"docid": "fa4ad44b4853a5ab1e6aa3313c6d42cf",
"score": "0.68898195",
"text": "def create\n @user = User.new(@json[\"user\"])\n\n if @user.save\n render json: @user\n else\n #internal error, 500\n render nothing: true, status: :internal_server_error\n end\n end",
"title": ""
},
{
"docid": "658a9fd767ace4792e059906c9b9d519",
"score": "0.68891543",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: @user\n else\n render json: { errors: @user.errors, status: 400, msg: 'Something went wrong' }\n end\n end",
"title": ""
},
{
"docid": "1cb8d802bb52471afd5d60bf094f9bdb",
"score": "0.687802",
"text": "def create\n user = User.new(user_params)\n if user.save\n \n render :json => user.to_json, :status => 201\n else\n render json: \"errors\", :status => 422\n end \n end",
"title": ""
},
{
"docid": "94bc59d0b76fc5afd1ed26efc1f78b1f",
"score": "0.6877484",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render_error @user, :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "054d637717a29e21996b88454862fde4",
"score": "0.6873686",
"text": "def create\n @user = User.new(params[:user])\n # p params\n if @user.save\n render json: @user\n else\n render json: { errors: @user.errors.full_messages },\n status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "54eed36c9616b41c583bc458060664be",
"score": "0.6867011",
"text": "def create\n\t\t@user = User.new(user_params)\n\n\t\tif @user.save\n\t\t\trender 'create.json.jbuilder', :status => 201\n\t\telse\n\t\t\trender :json => { :message => @user.errors.full_messages.to_sentence }, :status => 409\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b7779a1b718ac0b72f36ca7b338f68b4",
"score": "0.68598723",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: 201\n else\n render json: @user.errors, status: 401\n end\n end",
"title": ""
},
{
"docid": "1096306d19684a613358267ee6cec6ae",
"score": "0.68467826",
"text": "def create\n @user = User.post(params[:user])\n respond_with(@user)\n end",
"title": ""
},
{
"docid": "454a28611de6d6e2ad4c6b59feffe333",
"score": "0.6846759",
"text": "def create\n user = User.new(user_params)\n if user.save\n render json: {\n id: user.id,\n username: user.username,\n jwt: JWT.encode({user_id: user.id}, ENV['JWT_SECRET'], ENV['JWT_ALGORITHM'])\n }\n else\n render json: [{}], status: 404\n end\n end",
"title": ""
},
{
"docid": "948fe14de3a0e77f164961937bb2377b",
"score": "0.68425506",
"text": "def create\n @user = User.create(user_params)\n # /users --> post\n end",
"title": ""
},
{
"docid": "6519b2125a72c68e1248974001dd9d7d",
"score": "0.68404514",
"text": "def create\n \tuser = User.new(user_params)\n \tif user.save\n \t render json: user\n \telse\n \t render error: {error: \"User is not created\", status: 422}\n \tend\n end",
"title": ""
},
{
"docid": "8df22f393bc8ad52aa1665fe604885ca",
"score": "0.68385375",
"text": "def create\n @user = User.new(params[:user])\n \n if @user.save\n respond_to do |format|\n format.json { render :json => @user.to_json, :status => 200 }\n format.html { redirect_to :action => :index }\n end\n else\n respond_to do |format|\n format.json { render :text => \"Could not create user\", :status => :unprocessable_entity } # placeholder\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "617c21c8c23b38ec49f68ddf76b3e7a1",
"score": "0.6831731",
"text": "def create\n user = User.create(user_params)\n if user.save\n render json: { user: user.id }, status: 200\n else\n render json: { user: nil }, status: 404\n end\n end",
"title": ""
},
{
"docid": "cbd2ad899e0e5718a9f666760c98e4c6",
"score": "0.6824667",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n \trender :json => @user, status: :created\n else\n \trender :json => @user.errors.as_json(full_messages: true), status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "34edf9cb44d488f9c2ffe84c2aced578",
"score": "0.68192047",
"text": "def create\n \n username = params[:user][:username]\n email = params[:user][:email]\n\n @user = User.new({:username => username, :email => email })\n\n if @user.save\n render json: {\"status\": 200, \"message\": \"New User Created\"}\n else\n render json: {\"status\": 400, \"message\": \"Error!!\"}\n end\n\n end",
"title": ""
},
{
"docid": "076894e18d6f0bc4f1d3f94666a7cbdd",
"score": "0.68150824",
"text": "def create_user(options)\n post('/users', options)\n end",
"title": ""
},
{
"docid": "1ff8d97032e5ef3f2cfa03459366afee",
"score": "0.6811071",
"text": "def create_user(params = {})\n post('users', params)\n end",
"title": ""
},
{
"docid": "ba7c76e12af1b2be7494055bb568e90a",
"score": "0.68021876",
"text": "def create\n params.permit!\n @user = User.new params[:user]\n if @user.save\n render :json => @user, :status => :ok\n else\n render :json => { \"errors\" => @user.errors.full_messages} , :status => :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "748fd1ac2b72a250f33f1d2283f580b1",
"score": "0.6780044",
"text": "def create\n @user = User.new(user_params)\n if @user.save \n render json: { status: :created }\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b445a8e22ab09449c9d77d1fc73f7865",
"score": "0.6778866",
"text": "def create\n @user = User.new(resource_params)\n\n if @user.save\n render json: @user, status: :created, location: user_url(@user)\n else\n render json: {\n errors: @user.errors\n }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "dcf86ae36f0a3794e96c047d7e977a82",
"score": "0.6776799",
"text": "def create\n @user = User.new(:last_name=>params[:last_name], \n \t:first_name=>params[:first_name],\n \t:email=>params[:email]\n )\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.json { render :json => { :success => true, :users => [@user], :id=>@user.id } }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => { :success => false} }\n end\n end\n end",
"title": ""
},
{
"docid": "c16615599afe27e1660e93f6fe4a1be8",
"score": "0.676674",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: { status: \"success\", message: \"User created successfully!\", data:@user}, status: :ok\n else\n render json: { status: \"error\",message:\"Sad error. Couldn't create user\"}\n end\n end",
"title": ""
},
{
"docid": "d71bc2fc05bad5a6762618f29ce01c52",
"score": "0.67659235",
"text": "def create\n @user = User.build(user_create_params)\n\n respond_to do |format|\n if @user.save\n format.json { render json: @user, status: :created }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34c18e632a95ef9dbcd0fdb5b8a187bd",
"score": "0.67634434",
"text": "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.json { render json: { message: 'OK' }, status: :ok }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "769ea412b2916fe4c3ab1c258172a945",
"score": "0.6755508",
"text": "def create_user payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post USERS, payload )\n\t\t\t\tend",
"title": ""
},
{
"docid": "f0b9ad9d7740865f9cb3c64752694c1b",
"score": "0.6747282",
"text": "def create\n user = User.new(user_params)\n if user.save\n render json: { id: user.id, email: user.email }, status: :ok\n else\n render json: { message: user.errors.full_messages }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f55ace17cf27d9513f62193f9d5c4e7a",
"score": "0.6739021",
"text": "def create_user\n validate_params :user\n @user = User.new(params[:user])\n if @user.save\n render :text => {:status => 'ok', :id => @user.id}.to_json\n else\n render :text => {:status => 'fail', :errors => @user.errors}.to_json, :status => :bad_request\n end\n end",
"title": ""
},
{
"docid": "b0b29ebdc89e5e27c5eaee218e155472",
"score": "0.67329437",
"text": "def create\n user = params.clone\n name = user[:user_id]\n user.delete :user_id\n user.delete :action\n user.delete :controller\n user[:name] = name\n @user = User.new(user)\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3ed48f500418d53e87c9e54731489c3d",
"score": "0.67311764",
"text": "def create\n @user = User.new(params[:user])\n \n respond_to do |format|\n if @user.save\n format.json { render :json => @user.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { redirect_to users_path, :notice => 'User was successfully created.' }\n else\n format.json { render :text => \"Could not create user\", :status => :unprocessable_entity } \n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02abca95cc48e5aebfd552203edd91f6",
"score": "0.6729345",
"text": "def create_user\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users.json'\n ).to_s\n\n begin\n puts RestClient.post(\n url,\n { user: { name: \"Gizmo\", email: 'cat@cat.com' } }\n )\n rescue RestClient::Exception => e\n puts e.message\n end\n\nend",
"title": ""
},
{
"docid": "15d5461026391c66ddc9d929fa043422",
"score": "0.6728478",
"text": "def create\n #raise params.to_yaml\n @user = User.new(params[:user])\n\n if @user.save\n render :json => @user, :status => :created\n else\n render :json => {:errors => @user.errors, :status =>:unprocessable_entity}\n end\n end",
"title": ""
},
{
"docid": "462fb35deed9c4ab3076a2ca6535edf3",
"score": "0.67266613",
"text": "def create\n user = User.create(user_params)\n if user.valid?\n render json: {user: user}\n else\n errors = user.errors.full_messages\n render json: {errors: errors}\n end\n end",
"title": ""
},
{
"docid": "55cdcaf0a578cf4fcf78c2f31502449c",
"score": "0.67094976",
"text": "def create\n user = User.new(user_params)\n \n if user.save\n render json: {status: 'User created successfully', user_id: user.id, user: user}, status: :created\n else\n render json: { errors: user.errors.full_messages }, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "24dcdd3c192a18a6349a0be80a7375e1",
"score": "0.6708397",
"text": "def create \n user = User.new(user_params)\n # Return the user details if successful and the error messages if unsuccessful\n if user.save\n render :json => {:authentication_token => user.authentication_token, user: user.as_json(except: [:created_at, :update_at])}, :status => 201\n else\n render json: {:errors => user.errors.messages}, :status => 422\n end\n end",
"title": ""
},
{
"docid": "c745891e90b0caa1ffe023be568372ef",
"score": "0.6700333",
"text": "def create\n @user = User.new(user_credentials)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5fb6e6662ec44b2da9c4596dd0d068f6",
"score": "0.66964066",
"text": "def register\n post(\"/api/v1/registrations\", params: { \n user: {\n email: \"new_email@test.com\",\n password: \"a\",\n password_confirmation: \"a\" \n }\n })\n end",
"title": ""
},
{
"docid": "73a0d52bbf83d451021c6961c8af3c6a",
"score": "0.6688275",
"text": "def post(user_form)\n HttpClient::Preconditions.assert_class('user_form', user_form, ::Io::Flow::V0::Models::UserForm)\n r = @client.request(\"/users\").with_json(user_form.to_json).post\n ::Io::Flow::V0::Models::User.new(r)\n end",
"title": ""
},
{
"docid": "4b0b0278b48d74f5d53d6f3ae132cc2f",
"score": "0.66876954",
"text": "def create\n @user = User.new(email: params[:email], username: params[:username].downcase, password: params[:password])\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8305f67720579dc3912a3125e25c0305",
"score": "0.66848165",
"text": "def create\n @user = User.new(user_params)\n ## @user.save\n if @user.save\n render json: @user, status: :created\n else\n raise(ExceptionHandler::InvalidParameters, 'Invalid User Parameters')\n end\n end",
"title": ""
},
{
"docid": "055009f95035794de8e677216f680bd4",
"score": "0.6684562",
"text": "def create\n user = User.create(user_params)\n puts user.user_name\n render json: user, include: [:user_name]\n end",
"title": ""
},
{
"docid": "3bdc35ee53f1027b20eafdb2ad5a1565",
"score": "0.6672482",
"text": "def create\n\n @user = User.new\n\n #Need the [:teams] because its a hash based on the post, and then\n #within that hash, we access the [:name]\n @user.name = params[:user][:name]\n @user.email = params[:user][:email]\n\n @user.save!\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { render :json => @user }\n end\n\n end",
"title": ""
},
{
"docid": "d0d5c89f778a392bb5d4ccebdf37b43e",
"score": "0.66700244",
"text": "def create\n @user = User.new(params[:user])\n\n if @user.save\n respond_to do |format|\n format.json { render :json => @user.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { redirect_to :action => :index }\n end\n else\n respond_to do |format|\n format.json { render :text => \"Could not create user\", :status => :unprocessable_entity } # placeholder\n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4772d872ff5305d61ab582d0aa9b605f",
"score": "0.6645258",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: { user: @user, message: \"User created successfully.\"}, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "72b38d42f8caef32a447acd08d7237bd",
"score": "0.6641091",
"text": "def post(user_form)\n (x = user_form; x.is_a?(::Io::Flow::V0::Models::UserForm) ? x : ::Io::Flow::V0::Models::UserForm.new(x))\n r = @client.request(\"/users\").with_json(user_form.to_json).post\n ::Io::Flow::V0::Models::User.new(r)\n end",
"title": ""
},
{
"docid": "0aa40ed5dae3cf776f9c6425af089437",
"score": "0.6640988",
"text": "def create\n user_parameters[:name] = user_parameters[:email].split('@').first.split('.').join(' ') if user_parameters[:name].blank?\n render json: User.create!(user_parameters)\n rescue\n render_errors(user.errors.full_messages, :unprocessable_entity)\n end",
"title": ""
},
{
"docid": "c552c6fe60fefc6ca7f75ad540b1c2b9",
"score": "0.6640959",
"text": "def test_should_create_user_via_API_JSON\r\n get \"/logout\"\r\n post \"/users.json\", :api_key=>'testapikey',\r\n :user => {:first_name => 'unit',\r\n :last_name => 'test',\r\n :twitter_id=>'uttwit',\r\n :login => 'ut1',\r\n :password => '12345',\r\n :password_confirmation => '12345',\r\n :email => 'ut@email.com'}\r\n assert_response :created, \"Incorrect response type\"\r\n user = JSON.parse(response.body)\r\n check_new_user(user) \r\n user = User.find_by_login('ut1')\r\n assert user.active? == true, 'user should be active'\r\n end",
"title": ""
},
{
"docid": "3b711243d66b8c504d72f2f8229cc9d6",
"score": "0.6640779",
"text": "def create_user\n value = user_params\n create_user = HTTParty.post(ms_ip(\"rg\")+\"/users\", body: value.to_json, :headers => { 'Content-Type' => 'application/json' })\n if create_user.code == 201\n create_ldap = HTTParty.post(ms_ip(\"ldap\")+\"/user/resources/ldapcruds\", body: {\n email: value[:username],\n password: value[:password],\n name: value[:username]\n }.to_json, :headers => { 'Content-Type' => 'application/json' })\n render status: 201, json: create_user.body\n else\n render status: create_user.code, json: create_user.body\n end\n end",
"title": ""
},
{
"docid": "27b9fb671ac6e1db608c681f389082fc",
"score": "0.6639478",
"text": "def create\n @user = User.new(user_params)\n\n if !@user.valid?\n render json: @user.errors, status: :bad_request\n elsif @user.save\n render json: @user, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a33c0e168125252fa684dd279c22aa97",
"score": "0.66389185",
"text": "def create_user(**args)\n request_post('/user', **args)\n end",
"title": ""
},
{
"docid": "267dd56cd70f12e43c6f851f038534a0",
"score": "0.66364974",
"text": "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.json { render :show, status: :created }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7dc17ce1a24316ba7f5c1b08bee37b5",
"score": "0.662644",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render :show, status: :created, location: [:api, @user]\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5a982cfcf17816ee795fd32e51019b20",
"score": "0.66239864",
"text": "def create\n @user = User.new\n @user.name = params[:name]\n @user.dni = params[:dni]\n @user.email = params[:email]\n @user.password = params[:password]\n @user.password_confirmation = params[:password_confirmation]\n @user.save!\n\n render json: { params: params, notice: 'Usuario registrado exitosamente' }\n end",
"title": ""
},
{
"docid": "3093e0fa3aa62524582212431d41e5b1",
"score": "0.66084814",
"text": "def create\n user = User.new(user_params)\n if user.save\n render json:{status: \"Se creó el usuario.\"}, status: :ok\n else\n render json: {status: \"Error al guardar.\", errors: user.errors}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "676c94198dbd98516bbb33097aea747e",
"score": "0.66039085",
"text": "def create\n @user = @target.users.new(user_params)\n @user.save\n respond_with(@user)\n end",
"title": ""
},
{
"docid": "29deb566c9a982b6f5e0ce491c0db1fc",
"score": "0.6600968",
"text": "def create\n new_user(user_params)\n\n respond_to do |format|\n if @user.save\n # Send event to Datadog (DEPRECATED) and Segment\n # TODO: Remove Datadog once Segment pipeline is set up\n MetricUtil.put_metric_now(\"users.created\", 1, [\"user_id:#{@user.id}\"])\n\n format.html { redirect_to edit_user_path(@user), notice: \"User was successfully created\" }\n format.json { render :show, status: :created, location: root_path }\n else\n format.html { render :new }\n format.json { render json: @user.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3b91bf8b3b4807aab0fe737715cb501",
"score": "0.65984315",
"text": "def user_create\n\t\trespond_to do |format|\n\t\t\tnew_user = User.new params.require(:user).permit(:username, :email, :password, :password_confirmation)\n\t\t\tif User.where(:email => new_user.email).count > 0\n\t\t\t\tformat.json { render json: { \"error\" => \"Email ID already taken!\" }, status: 400 }\n\t\t\telsif User.where(:username => new_user.username).count > 0\n\t\t\t\tformat.json { render json: { \"error\" => \"Username already taken!\" }, status: 400 }\n\t\t\telsif new_user.password != new_user.password_confirmation\n\t\t\t\tformat.json { render json: { \"error\" => \"Passwords don't match! Check, and try again.\" }, status: 400 }\n\t\t\telsif new_user.save\n\t\t\t\tformat.json { render json: { \"res\" => new_user }, status: :created }\n\t\t\telse\n\t\t\t\tformat.json { render json: { \"error\" => \"Error while creation!\"}, status: 500 }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e11a1e7e0e3edbab77b7385ba9569923",
"score": "0.6596848",
"text": "def users_post(user, opts = {})\n users_post_with_http_info(user, opts)\n nil\n end",
"title": ""
},
{
"docid": "eed7639218e14c6fe6793d30d6392ba5",
"score": "0.6594044",
"text": "def create\n puts \"created new user\"\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
90718738e1473408313b37bf4781931c
|
Extracts and parses the YAML from the header of the fixture.
|
[
{
"docid": "da9fab8600bb3d619af559bd83f2821e",
"score": "0.5526693",
"text": "def yaml\n @yaml ||= has_yaml? ? YAML.load(@content) : {}\n end",
"title": ""
}
] |
[
{
"docid": "f5ae4acd28eb90c56e6e8a7821ac8ea7",
"score": "0.6384315",
"text": "def take_yaml(yml)\n @data = YAML.load(yml)\n end",
"title": ""
},
{
"docid": "f5ae4acd28eb90c56e6e8a7821ac8ea7",
"score": "0.6384315",
"text": "def take_yaml(yml)\n @data = YAML.load(yml)\n end",
"title": ""
},
{
"docid": "6f4ef79ce35f634e2eda480d7153ec99",
"score": "0.6177532",
"text": "def extract_metadata\n YAML_METADATA.match(content) do |match|\n @metadata = YAML.load(match[0])\n @content = content.gsub(YAML_METADATA, \"\")\n end\n end",
"title": ""
},
{
"docid": "175bb9455b60de481e3bb87ff606c12d",
"score": "0.6097608",
"text": "def body\n return nil unless file?\n has_yaml_props? ?\n yaml_split[1] :\n data[0]\n end",
"title": ""
},
{
"docid": "008069493eed5571ebf925cfc9463a4e",
"score": "0.6013257",
"text": "def read_headers(page_content)\n format = page_content.split(\"---\")\n if format.size > 0\n return YAML.load(format[1])\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "8ae344876a90cc4c8fc8cee5311d27af",
"score": "0.5985399",
"text": "def parse_source(raw)\n if raw =~ /^(.*title:\\s.*?)\\n\\n(.*)/m then\n begin\n @data = YAML.load($1)\n @content = $2\n rescue Exception => e\n raise \"Parse Exception: #{e.message}\"\n end\n end\n end",
"title": ""
},
{
"docid": "73dc0b99feac132b926b237c9a21e558",
"score": "0.5938708",
"text": "def parse_file(source)\n begin\n yaml_pattern = /\\A(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n if source =~ yaml_pattern\n data = YAML.load($1)\n content = $POSTMATCH\n else\n data = {}\n content = source\n end\n rescue => e \n puts \"Error reading file #{File.join(ARGV[0])}: #{e.message}\"\n end\n return [data, content]\n end",
"title": ""
},
{
"docid": "8844fbfb1a9ecb8a078d3d53fea1e3d4",
"score": "0.5893027",
"text": "def read_yaml(base, name)\n self.content = File.read(File.join(base, name))\n\n if self.content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n self.content = $POSTMATCH\n\n begin\n self.data = YAML.load($1)\n rescue => e\n puts \"YAML Exception reading #{name}: #{e.message}\"\n end\n end\n\n self.data ||= {}\n end",
"title": ""
},
{
"docid": "64f2042977e9ebfb8561d5622c8679f8",
"score": "0.5892488",
"text": "def load_yaml(filename); end",
"title": ""
},
{
"docid": "7b9a1dca6c114434042bd4525ace9a2b",
"score": "0.58558106",
"text": "def deserialize_yaml_body( txn )\n\t\treturn YAML.load( txn )\n\tend",
"title": ""
},
{
"docid": "38027f01102aab49ff5ccca913bb091f",
"score": "0.58246696",
"text": "def yaml_split\n body = @node.body.gsub(\"\\r\", \"\")\n ary = body.split(/\\n\\.\\.\\.\\n|\\n---\\n/,2)\n ary[1] = ary[1].lstrip\n ary\n end",
"title": ""
},
{
"docid": "5332f1f0436627769bf915d8cbcdbbaf",
"score": "0.5815179",
"text": "def yaml\n parse_yaml_string(yaml_string(config_file), config_file)\n end",
"title": ""
},
{
"docid": "c832a5f9726b5e7e8d2124c0dbd1c991",
"score": "0.57611763",
"text": "def read_yaml(base, name)\n filename = File.join(base, name)\n\n begin\n content = File.read(filename)\n if content =~ Jekyll::Document::YAML_FRONT_MATTER_REGEXP\n content = $POSTMATCH # rubocop:disable Lint/UselessAssignment\n data = SafeYAML.load(Regexp.last_match(1))\n end\n rescue SyntaxError => e\n Jekyll.logger.warn \"YAML Exception reading #{filename}: #{e.message}\"\n raise e if site.config[\"strict_front_matter\"]\n rescue StandardError => e\n Jekyll.logger.warn \"Error reading file #{filename}: #{e.message}\"\n raise e if site.config[\"strict_front_matter\"]\n end\n\n data || {}\n end",
"title": ""
},
{
"docid": "d73a739ad3fddd1533c8fe0b6e6584b5",
"score": "0.5700989",
"text": "def json_fixture(name)\n YAML.load(fixture(name))\nend",
"title": ""
},
{
"docid": "58e692e1a45763f2bea9577192e1b727",
"score": "0.5699729",
"text": "def parsed_json_fixture(path)\n JSON.parse json_fixture(path)\nend",
"title": ""
},
{
"docid": "bd44b2be8a0030c101bed95c4984424f",
"score": "0.56946826",
"text": "def read_yaml(base, name, opts = {})\n begin\n self.content = File.read(File.join(base, name),\n merged_file_read_opts(opts))\n if content =~ /\\A(---\\s*\\n.*?\\n?)^((---|\\.\\.\\.)\\s*$\\n?)/m\n self.content = $POSTMATCH\n self.data = SafeYAML.load($1)\n end\n rescue SyntaxError => e\n Jekyll.logger.warn \"YAML Exception reading #{File.join(base, name)}: #{e.message}\"\n rescue Exception => e\n Jekyll.logger.warn \"Error reading file #{File.join(base, name)}: #{e.message}\"\n end\n\n self.data ||= {}\n end",
"title": ""
},
{
"docid": "673dd1bc4057c0a5f6866adafc5db25f",
"score": "0.56302476",
"text": "def yaml_split\n data[0].gsub!(\"\\r\", \"\")\n ary = data[0].split(/\\n\\.\\.\\.\\n|\\n---\\n/,2)\n ary[1] = ary[1].lstrip\n ary\n end",
"title": ""
},
{
"docid": "254af0b39142704ac322e9af6a48cc2b",
"score": "0.5622739",
"text": "def read_yaml(base, name)\n begin\n text = File.read(File.join(base, name))\n data = {'layout'=>'default'}\n\n if page_yaml = transfiguration['page_yaml']\n data.merge!(page_yaml)\n end\n\n # commented metadata\n if text =~ /<!--\\s+---\\s*(.*?)-->\\s*$\\n?/m\n text.delete($0)\n data.merge!(YAML.safe_load($1))\n end\n\n self.content = text\n self.data = data\n rescue SyntaxError => e\n puts \"YAML Exception reading #{File.join(base, name)}: #{e.message}\"\n rescue Exception => e\n puts \"Error reading file #{File.join(base, name)}: #{e.message}\"\n end\n\n unless self.data['layout']\n self.data['layout'] = 'page'\n end\n\n return self.data\n end",
"title": ""
},
{
"docid": "54ae6e48ca9fc728ddea83d501d4a18c",
"score": "0.55711293",
"text": "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",
"title": ""
},
{
"docid": "ccd5edefc622cb69915b19098d70767d",
"score": "0.5568424",
"text": "def yaml_content() = JSON.parse(content.to_json).to_yaml",
"title": ""
},
{
"docid": "8eb5e8d36e28a0c223d411afe2cfe951",
"score": "0.55672234",
"text": "def read_post(path)\n chunks = IO.read(path).split(/^---\\s*$/)\n\n metadata = YAML.load(\"---\\n\" + chunks[1])\n\n [metadata, chunks[2]]\nend",
"title": ""
},
{
"docid": "f84fe6d329699e2f719e01d65f49223d",
"score": "0.5561239",
"text": "def metadata\n @metadata ||= (\n if md = /\\<\\!\\-\\-\\-(.*?)\\-{2,3}\\>\\s*\\Z/m.match(content)\n YAML.load(md[1])\n else\n {}\n end\n )\n end",
"title": ""
},
{
"docid": "b7f4058dcd159e6e57b69b8297646030",
"score": "0.555259",
"text": "def setup\n # Retrieve fixtures via their name\n # @first = <%= plural_name %>(:first)\n end",
"title": ""
},
{
"docid": "b19516e1228e294002b5a70c74ec8e2b",
"score": "0.5552496",
"text": "def load_yml(filename); end",
"title": ""
},
{
"docid": "6291674e5f617fe37870c6bdace73e45",
"score": "0.5547727",
"text": "def load(name, is_user_template = false)\n template = IO.read(template_path(name, is_user_template))\n yaml, haml = split_frontmatter(template)\n params = YAML.load yaml\n return params, haml\n end",
"title": ""
},
{
"docid": "7b77812d6608830d350c0d939d4fa382",
"score": "0.55249333",
"text": "def parse_yaml(readable_obj)\n ::YAML.load(readable_obj)\n end",
"title": ""
},
{
"docid": "1faf1ae35e315688421543382cce5c38",
"score": "0.5521651",
"text": "def load_from_yaml(file)\n document_lines = File.readlines(file)\n\n headers = document_lines.enum_for(:each_with_index).\n find_all { |line, _| line =~ /^---/ }\n if headers.empty? || headers.first[1] != 0\n headers.unshift [\"--- name:default\", -1]\n end\n\n options = headers.map do |line, line_number|\n line_options = Hash.new\n line = line.chomp\n line.split(/\\s+/)[1..-1].each do |opt|\n if opt =~ /^(\\w+):(.*)$/\n line_options[$1] = $2\n else\n raise ArgumentError, \"#{file}:#{line_number}: wrong format #{opt}, expected option_name:value, where 'value' has no spaces\"\n end\n end\n line_options['merge'] = (line_options['merge'] == 'true')\n line_options['chain'] = (line_options['chain'] || '').split(',')\n [line_options, line_number]\n end\n options[0][0]['name'] ||= 'default'\n\n options.each do |line_options, line_number|\n if !line_options['name']\n raise ArgumentError, \"#{file}:#{line_number}: missing a 'name' option\"\n end\n end\n\n sections = []\n options.each_cons(2) do |(_, line0), (_, line1)|\n sections << document_lines[line0 + 1, line1 - line0 - 1]\n end\n sections << document_lines[options[-1][1] + 1, document_lines.size - options[-1][1] - 1]\n\n changed_sections = []\n @conf_options = options\n\n sections.each_with_index do |doc, idx|\n doc = doc.join(\"\")\n doc = evaluate_dynamic_content(file, doc)\n\n result = YAML.load(StringIO.new(doc))\n\n conf_options = options[idx].first\n name = conf_options.delete('name')\n changed = in_context(\"while loading section #{name} of #{file}\") do\n add(name, result || Hash.new, conf_options)\n end\n\n if changed\n changed_sections << name\n end\n end\n\t if !changed_sections.empty?\n\t \t@merged_conf.clear\n\t end\n changed_sections\n rescue Exception => e\n raise e, \"error loading #{file}: #{e.message}\", e.backtrace\n end",
"title": ""
},
{
"docid": "f624582acbec1baf8fe5ef8072a1c91f",
"score": "0.5512698",
"text": "def inventory_data\n YAML.load_file(File.expand_path('spec/fixtures/inventory.yaml'))\n end",
"title": ""
},
{
"docid": "0c9e0b2f5ad2a9fb6bc6c0f41ef802cf",
"score": "0.55100095",
"text": "def load_yaml\n if has_file? \"#{name}.yml\"\n YAML.load_file(path / \"#{name}.yml\").apply_to self\n end\n end",
"title": ""
},
{
"docid": "67aa2a1f3a2d7b888254cf7c183a8f8a",
"score": "0.5497617",
"text": "def fixture_hash(filename, data: {})\n file = File.read fixture_file(filename)\n YAML.load render_erb(file, data)\n end",
"title": ""
},
{
"docid": "a1e40438bf9a396042554f9dbf459693",
"score": "0.54969704",
"text": "def assert_generated_yaml(path)\n assert_generated_file(\"#{path}.yml\") do |body|\n yaml = RailsLts::Support::YAML.legacy_load(body)\n assert yaml, 'YAML data missing'\n yield yaml if block_given?\n end\n end",
"title": ""
},
{
"docid": "a85f4fd71c41ec0163e784316d516a61",
"score": "0.5486566",
"text": "def yaml_properties\n if directory?\n yaml_path = ::File.join(@node.path, @yaml_file)\n @node.repos.stat(yaml_path, @node.rev_num) ?\n YAML.load(@node.repos.file(yaml_path, @node.rev_num)[0]) :\n {}\n else\n has_yaml_props? ?\n YAML.load(yaml_split[0]) :\n {}\n end\n end",
"title": ""
},
{
"docid": "f503c2972a404893b8e100913c9e85da",
"score": "0.5485124",
"text": "def has_yaml_header?(file); end",
"title": ""
},
{
"docid": "a3b4d2b428712e265f4117aca4e2bd7b",
"score": "0.5463379",
"text": "def fixture_contents(fixture)\n fixture_file = Dir.entries(fixture_path).find { |e| /^#{fixture}$|#{fixture}\\.[a-z]/.match?(e) }\n File.read(\"#{fixture_path}/#{fixture_file}\")\nend",
"title": ""
},
{
"docid": "8ae6d1805559b90a5cb9aae26871aa0c",
"score": "0.5460971",
"text": "def local_yaml\n parse_yaml_string(yaml_string(local_config_file), local_config_file)\n end",
"title": ""
},
{
"docid": "4fce8c77dfa2d3cf22eed42e11743a82",
"score": "0.5459676",
"text": "def read\n @metadata = {}\n @content = File.read(path)\n\n if @content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n @content = $POSTMATCH\n\n begin\n @metadata = YAML.load($1)\n raise unless @metadata.is_a? Hash\n rescue => ex\n $stderr.puts \"#{File.basename($PROGRAM_NAME)}: #{ex.to_s}\"\n $stderr.puts \"WARNING: Couldn't load metadata.\"\n @metadata = {}\n end\n\n @metadata.symbolize_keys!\n import_metadata\n end\n end",
"title": ""
},
{
"docid": "da5c50eedc1eb615357ac11c1bbc6cc4",
"score": "0.5439748",
"text": "def parse_yaml(message)\n # Check YAML message format\n begin\n parsed_message = YAML.load(message) # parse YAML message\n rescue YAML::ParserError => e\n # If YAML not valid, return with errors\n logger.error \"YAML parsing: #{e}\"\n return message, e.to_s + \"\\n\"\n end\n [parsed_message, nil]\n end",
"title": ""
},
{
"docid": "293f4fb8750425ff70bbc92d73b1a6f6",
"score": "0.5425112",
"text": "def read_yaml(base, name, opts = {})\n filename = @path || site.in_source_dir(base, name)\n Jekyll.logger.debug \"Reading:\", relative_path\n\n begin\n self.content = File.read(filename, **Utils.merged_file_read_opts(site, opts))\n if content =~ Document::YAML_FRONT_MATTER_REGEXP\n self.content = Regexp.last_match.post_match\n self.data = SafeYAML.load(Regexp.last_match(1))\n end\n rescue Psych::SyntaxError => e\n Jekyll.logger.warn \"YAML Exception reading #{filename}: #{e.message}\"\n raise e if site.config[\"strict_front_matter\"]\n rescue StandardError => e\n Jekyll.logger.warn \"Error reading file #{filename}: #{e.message}\"\n raise e if site.config[\"strict_front_matter\"]\n end\n\n self.data ||= {}\n\n validate_data! filename\n validate_permalink! filename\n\n self.data\n end",
"title": ""
},
{
"docid": "9c55f0b2ef373180234ff578d7cb25b5",
"score": "0.5417063",
"text": "def parse(path)\n YAML.load(File.read(path))\n end",
"title": ""
},
{
"docid": "2a2c74eb329fcd5119941fbf10a657b4",
"score": "0.54118717",
"text": "def test_load_headered\n doc = SimpleDocument.read \"folder/headered\"\n \n assert_equal \"#{DIR}/fixtures/folder/headered.md\", doc.uri\n assert_equal :markdown, doc.format\n assert_equal \"A document with a header.\\n\", doc.body\n \n assert_equal nil, doc.header\n assert_equal \"headered\", doc.name\n assert_equal true, doc.active?\n assert_equal Time.parse(\"2012-01-01\"), doc.mtime\n end",
"title": ""
},
{
"docid": "3737c77a0baf3cae46d6c05be7c6dc4b",
"score": "0.54107773",
"text": "def yaml_properties\n if directory?\n fs_yaml_path = fs_path.blank? ? 'meta.yml' : File.join(fs_path, 'meta.yml')\n yaml_path = File.join(@path, 'meta.yml')\n repos.stat(fs_yaml_path, revision) ?\n YAML.load(self.class.new(@changeset, yaml_path).body) :\n {}\n else\n has_yaml_props? ?\n YAML.load(yaml_split[0]) :\n {}\n end\n end",
"title": ""
},
{
"docid": "c93e60ead884c7b3eb02c77dbc0d2439",
"score": "0.54078907",
"text": "def load_from_yaml(yaml_file)\n data = ::YAML.load_file(yaml_file)\n @headers = data[:headers]\n @currencies = data[:currencies]\n end",
"title": ""
},
{
"docid": "ed48a8afb1012f01a665048189ce93d4",
"score": "0.5401407",
"text": "def yaml(filename)\n YAML.load(IO.read(filename).gsub(/---\\z/, ''))\nend",
"title": ""
},
{
"docid": "5737f069e3c673a3136c56883e8520cf",
"score": "0.53877085",
"text": "def loadyaml(filename) YAML.load_file(filename) end",
"title": ""
},
{
"docid": "67e87001579100f0c230a99452a2b7e6",
"score": "0.5385833",
"text": "def parsed\n return @parsed if instance_variable_defined? :@parsed\n\n if source =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n { metadata: YAML.load($1), content: $' }\n else\n { metadata: {}, content: source }\n end\n end",
"title": ""
},
{
"docid": "c0938c504f2348e3789c6d48765f6f06",
"score": "0.53551275",
"text": "def pets\n load_yaml('personaje/pets')\nend",
"title": ""
},
{
"docid": "31bae6c5c39529c05bef09e5bf85307d",
"score": "0.5354446",
"text": "def load yaml\n data = YAML::load yaml \n raise \"Cannot load YAML data\" unless data\n\n @raw = @data = @errors = @commands = nil\n @errors = data.delete('__ERRORS__')\n @commands = data.delete('__COMMANDS__')\n @raw = OpenStruct.new data\n @data = { }\n end",
"title": ""
},
{
"docid": "78bd98ca831ea6c04c93da0631f43636",
"score": "0.53456706",
"text": "def load_yml(template, options={})\n case File.extname(template)\n when '.erb'\n parse_erb(template, options)\n else\n YAML.load_file(template)\n end\n end",
"title": ""
},
{
"docid": "bc11f83b83ac542922a1145057ec28e0",
"score": "0.53439623",
"text": "def parse_yaml(path)\n require 'yaml'\n\n str = Nitro::Template.new.render(File.read(path))\n\n if yaml = YAML::load(str)\n for name, data in yaml\n self[name] = instantiate(data)\n end\n end\n\n # sort the objects.\n\n str.scan(/^(\\w*?):$/).each do |key|\n @objects << self[key.to_s]\n end\n end",
"title": ""
},
{
"docid": "dd9f7d06b4d9a565444162ac270f9db6",
"score": "0.5341724",
"text": "def parse\n parts = text.split(/^\\-\\-\\-/)\n\n if parts.size == 1\n data = {}\n #@parts << Part.new(sect[0]) #, *[@stencil, @default].compact.flatten)\n else\n parts.shift if parts.first.strip.empty?\n data = YAML::load(parts.first)\n if Hash === data\n parts.shift\n else\n data = {}\n end\n end\n\n parse_metadata(data)\n\n @parts = parts.map{ |part| Part.parse(self, part) }\n end",
"title": ""
},
{
"docid": "1e8f77d69b8292920d5283804f159fbc",
"score": "0.5327438",
"text": "def read_codefile\n y = YamlReader.new(@@options.codefile)\n yamltab = y.parse\n end",
"title": ""
},
{
"docid": "cd89be0f93fee587421ec45d57f095c2",
"score": "0.5309249",
"text": "def read_yaml(base, name)\n path = File.join(base, name)\n self.content = File.read(path)\n relative_base = base.gsub(Dir.pwd, \"\")\n if relative_base.start_with?(\"/#{JDoc::DocumentationFile.documentation_directory}\")\n if self.content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n self.content = $POSTMATCH\n begin\n self.data = YAML.load($1)\n rescue => e\n puts \"YAML Exception reading #{name}: #{e.message}\"\n end\n self.data[\"layout\"] = \"documentation\" if self.data[\"layout\"].nil?\n self.data[\"title\"] = JDoc::DocumentationFile.file_title(path) if self.data[\"title\"].nil?\n return\n elsif self.content =~ /^(---\\s*\\n.*?\\n?)/m\n self.content = $POSTMATCH\n self.data = {\n \"layout\" => \"documentation\",\n \"title\" => JDoc::DocumentationFile.file_title(path)\n }\n return\n end\n end\n\n read_yaml_original(base, name)\n end",
"title": ""
},
{
"docid": "55140022cb9d295de3c52213aebfc861",
"score": "0.52920496",
"text": "def fixture(name)\r\n fixture_io(name).read\r\n end",
"title": ""
},
{
"docid": "6ef527c73450b36b63c4c29903373a0e",
"score": "0.52832943",
"text": "def import_yaml(io)\n require 'yaml' unless defined?(YAML)\n YAML.load(io).each {|data| import_record data }\n end",
"title": ""
},
{
"docid": "7cf7855cdc36f4f03c6d668af5f415be",
"score": "0.5255704",
"text": "def cfn_template_yaml\n if File.exist?(f = \"#{cfn_template_stub}.yaml\")\n File.read(f)\n end\n end",
"title": ""
},
{
"docid": "75709e12b1f6ba20b40ce6e77737032f",
"score": "0.5246386",
"text": "def load_database_yaml; end",
"title": ""
},
{
"docid": "75709e12b1f6ba20b40ce6e77737032f",
"score": "0.5246386",
"text": "def load_database_yaml; end",
"title": ""
},
{
"docid": "c1126c05f70c8e9a99e9ca4441241064",
"score": "0.52449024",
"text": "def load_items\n raise \"Fetcher YAML file for today couldn't be found\" unless File.exists?(FETCHER_YAML_FILE)\n @items = YAML.load_file(FETCHER_YAML_FILE)\n end",
"title": ""
},
{
"docid": "757bad0c605157030e09d185f7e5ff77",
"score": "0.5244689",
"text": "def meta_data\n return if @meta_end.nil?\n\n cur, meta_end, @meta_end = tell, @meta_end, nil\n seek 0\n return YAML.load(self)\n\n ensure\n @meta_end = meta_end if defined? meta_end and meta_end\n seek cur if defined? cur and cur\n end",
"title": ""
},
{
"docid": "b01555990b08971118b2834da400490d",
"score": "0.5228194",
"text": "def from_yaml(text)\n if config = YAML.load(text)\n return config\n end\n end",
"title": ""
},
{
"docid": "09a5804d70de700a8913b466efca0810",
"score": "0.520156",
"text": "def load_yaml_file file\r\n load_yaml \"parse_file\", file\r\n end",
"title": ""
},
{
"docid": "183c0c30d4b1482e4f2253baf36e5bfa",
"score": "0.51886123",
"text": "def read_fixture(filename)\n File.open(fixture filename) { |f| f.read }\n end",
"title": ""
},
{
"docid": "b8f172ebf0bfa02425858506468984b0",
"score": "0.5186313",
"text": "def setup\n # Retrieve fixtures via their name\n # @first = vr_cc_solicituds(:first)\n end",
"title": ""
},
{
"docid": "355ac3bdfb004a773abb09362668f282",
"score": "0.5184132",
"text": "def to_yml_fixture(fixture_id = nil)\n raise ArgumentError, \"Error: cannot convert line #{line_number.to_s} to yml because the role is not specified\" if pristine_role.nil?\n raise ArgumentError, \"Error: cannot convert line #{line_number.to_s} to yml because the privilege_set_name is not specified\" if privilege_set_name.blank?\n\n fixture_id = line_number if fixture_id.nil?\n\n yml = \"cbac_permission_00\" << fixture_id.to_s << \":\\n\"\n yml << \" id: \" << fixture_id.to_s << \"\\n\"\n yml << \" context_role: \"\n yml << pristine_role.name if pristine_role.role_type == PristineRole.ROLE_TYPES[:context]\n yml << \"\\n\"\n yml << \" generic_role_id: \" << pristine_role.role_id.to_s << \"\\n\"\n yml << \" privilege_set_id: <%= Cbac::PrivilegeSetRecord.where(name: '#{privilege_set_name}').first.id %>\\n\"\n yml << \" created_at: \" << Time.now.strftime(\"%Y-%m-%d %H:%M:%S\") << \"\\n\"\n yml << \" updated_at: \" << Time.now.strftime(\"%Y-%m-%d %H:%M:%S\") << \"\\n\"\n yml << \"\\n\"\n end",
"title": ""
},
{
"docid": "3e6d0334e2e6ae1c3f8889f8738f6a05",
"score": "0.51748",
"text": "def yaml( *args )\n ::Logging::Layouts::Parseable.yaml(*args)\n end",
"title": ""
},
{
"docid": "64578383682afc4ad3d224112e0b91a1",
"score": "0.5165305",
"text": "def from_yaml\n YAML.load(self)\n end",
"title": ""
},
{
"docid": "ef08887e91ef4f6d515c040a6252b79d",
"score": "0.5153176",
"text": "def test_load_from_yaml\n loaded = Syck.load(<<-eoyml)\n--- !set\nfoo: bar\nbar: baz\n eoyml\n assert_equal(@set, loaded)\n end",
"title": ""
},
{
"docid": "b5d0329530c63ebc000acc1aeb6faa31",
"score": "0.5149262",
"text": "def parse\n @parts = []\n\n sect = text.split(/^\\-\\-\\-/)\n\n if sect.size == 1\n @header = {}\n @parts << Part.new(sect[0]) #, *[@stencil, @default].compact.flatten)\n else\n sect.shift if sect.first.strip.empty?\n\n head = sect.shift\n head = YAML::load(head)\n parse_header(head)\n\n sect.each do |body|\n index = body.index(\"\\n\")\n formats = body[0...index].strip\n formats = formats.split(/\\s+/) if String===formats\n #formats = @default if formats.empty?\n #formats.unshift(@stencil) if @stencil\n text = body[index+1..-1]\n @parts << Part.new(text, *formats)\n end\n end\n end",
"title": ""
},
{
"docid": "46ce323ff1e5b35db2c25ddecf7acb30",
"score": "0.5142558",
"text": "def read_yaml(path)\n data = File.read path\n\n # Necessary to be backward-compatible with documentation generated\n # by earliar RDoc versions.\n data = data.gsub(/ \\!ruby\\/(object|struct):(RDoc::RI|RI).*/, '')\n data = data.gsub(/ \\!ruby\\/(object|struct):SM::(\\S+)/,\n ' !ruby/\\1:RDoc::Markup::\\2')\n\n OpenStructHash.convert YAML.load(data)\n end",
"title": ""
},
{
"docid": "7877f0ad605f56a59c9fec942bbb127d",
"score": "0.5140591",
"text": "def read_yaml(_base, _name, _opts = {})\n self.content = self.output = \"\"\n self.data ||= DEFAULT_DATA.dup\n end",
"title": ""
},
{
"docid": "6029e3bf2c2711dcad7f4f73f1c197b2",
"score": "0.51380885",
"text": "def yaml\n @yaml ||= YAML.load_file path\n rescue StandardError\n {}\n end",
"title": ""
},
{
"docid": "db9b21ca30fbafaa627693ab55227ad7",
"score": "0.5109053",
"text": "def parse_page_file(file_path)\n \n result = {}\n metadata = []\n remaining = ''\n \n File.open(file_path) do |file|\n \n while (not file.eof?)\n line = file.readline \n if match = line.match(/\\w*:\\s[\\w|\\s]*/)\n metadata.push(line)\n else\n remaining << line if not line.match(/^\\n|\\n\\r$/)\n break\n end\n end \n \n remaining << file.read # Reads the rest of the document\n\n result = {}\n \n if metadata and metadata.length > 0 \n result = YAML::load(metadata.join)\n end\n \n result.store(:body, remaining) if remaining\n \n end \n \n return result \n \n end",
"title": ""
},
{
"docid": "646c60786f7273bb915aaed9999311ab",
"score": "0.50928265",
"text": "def load_yaml(yaml_path, variables = nil)\n #puts \"load_yaml #{yaml_path}\"\n if variables\n YAML.load(ERB.new(File.read(yaml_path)).result(OpenStruct.new(variables).instance_eval { binding })) \n else\n YAML.load(ERB.new(File.read(yaml_path)).result)\n end\nend",
"title": ""
},
{
"docid": "de9bc59ebdf280ea5f0d65febf0faad4",
"score": "0.50894344",
"text": "def parse!\n md = File.read(filename)\n doc = Kramdown::Document.new(md, input: 'GFM')\n\n # extract toc\n toc_start, toc_end = Danger::Toc::Extractor.convert(doc.root).first\n @has_toc = toc_start && toc_end\n @toc = md.split(\"\\n\")[toc_start, toc_end - toc_start - 1].reject(&:empty?) if @has_toc\n\n # construct toc\n @headers = Danger::Toc::Constructors.current.convert(doc.root).first\n end",
"title": ""
},
{
"docid": "020e11d92038f426b6bf54be3a8b94cb",
"score": "0.5080637",
"text": "def yaml(*files, **options, &block) = read(*files, parse: :yaml, ext: ['.yml', '.yaml'], **options, &block)",
"title": ""
},
{
"docid": "c3dba280ebaa92d736cb1351de150605",
"score": "0.5079391",
"text": "def load_yaml(args = {})\n file = File.read(args[:file] || CMUX_YAML)\n yaml = YAML.load(file)\n args[:key] ? yaml[args[:key]] : yaml\n rescue Psych::SyntaxError\n message = \"Make sure you've written #{file} in YAML Simple Mapping.\" \\\n ' Please check README.'\n raise message.red\n end",
"title": ""
},
{
"docid": "a1c3dc645d82f592ab9cc8d73913735d",
"score": "0.507627",
"text": "def test_new\n assert_equal({\n \"drylands\"=>\"Drylands\",\n \"savannah\"=>\"Savanna\",\n }, FakeYaml.load(sample(\"terrain_stuff_l_english\")))\n end",
"title": ""
},
{
"docid": "30ca7c379cae93a9b96d1f20a9f84a14",
"score": "0.50747687",
"text": "def parse_and_test(yaml)\n safe_result = parse(yaml)\n\n exception_thrown = nil\n\n unsafe_result = begin\n YAML.unsafe_load(yaml)\n rescue Exception => e\n exception_thrown = e\n end\n\n if exception_thrown\n # If the underlying YAML parser (e.g. Psych) threw an exception, I'm\n # honestly not sure what the right thing to do is. For now I'll just\n # print a warning. Should SafeYAML fail when Psych fails?\n Kernel.warn \"\\n\"\n Kernel.warn \"Discrepancy between SafeYAML and #{SafeYAML::YAML_ENGINE} on input:\\n\"\n Kernel.warn \"#{yaml.unindent}\\n\"\n Kernel.warn \"SafeYAML result:\"\n Kernel.warn \"#{safe_result.inspect}\\n\"\n Kernel.warn \"#{SafeYAML::YAML_ENGINE} result:\"\n Kernel.warn \"#{exception_thrown.inspect}\\n\"\n\n else\n expect(safe_result).to eq(unsafe_result)\n end\n end",
"title": ""
},
{
"docid": "4bbe93964b7ac946f6b7ad56414385a1",
"score": "0.50745416",
"text": "def simple_yaml_load1(file)\n r = []\n File.read(file).split(\"\\n\").each do |line|\n e = line.split(\": \", 2).map(&:strip)\n next if e.size != 2\n r.push(e)\n end\n return r\nend",
"title": ""
},
{
"docid": "759f3cfe3767b092e799339a0165dab6",
"score": "0.5074033",
"text": "def data\n YAML::load_file(files[:config])\n end",
"title": ""
},
{
"docid": "b09de9eab7065c8440c74144a010fd05",
"score": "0.5071882",
"text": "def setup\n # Retrieve fixtures via their name\n # @first = vr_cc_solicitudes(:first)\n end",
"title": ""
},
{
"docid": "f931fef976605a53753ae581aa087ef3",
"score": "0.5067504",
"text": "def yaml_metadata\n if single_post?\n\n # if we were to merge config to data, the default options would\n # take precedence\n data = Jekyll::Utils.deep_merge_hashes @config, single_post.data\n single_post.merge_data! data\n\n\n # we extract the excerpt because it serializes as an object and\n # breaks pandoc\n metadata = single_post.data.reject{ |k| k == 'excerpt' }\n\n if @config['date_format']\n metadata['date'] = metadata['date'].strftime(@config['date_format'])\n else\n metadata.delete('date')\n end\n else\n # we have to use this fugly syntax because jekyll doesn't do\n # symbols\n metadata = {\n 'date' => @config['date_format'] ? Date.today.strftime(@config['date_format']) : nil,\n 'title' => @title,\n 'author' => nil,\n 'papersize' => papersize,\n 'sheetsize' => sheetsize,\n 'signature' => signature\n }\n end\n\n # fix page sizes, pandoc uses 'A4' while printer.rb uses\n # 'a4paper'\n %w[papersize sheetsize].each do |size|\n metadata[size] = fix_size metadata[size]\n end\n\n metadata.to_yaml << \"\\n---\\n\"\n end",
"title": ""
},
{
"docid": "0f5dc9ae8645953ef4b1d3238f5226ff",
"score": "0.50646365",
"text": "def read_yaml(base, name, opts = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "01cf2a4d291c7ddeeea0fc6f81830e4a",
"score": "0.506281",
"text": "def parse_front_matter(content)\n yaml_regex = /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n if content =~ yaml_regex\n content = content[($1.size + $2.size)..-1]\n \n begin\n data = YAML.load($1)\n rescue => e\n puts \"YAML Exception: #{e.message}\"\n return false\n end\n\n else\n return false\n end\n\n [data, content]\n end",
"title": ""
},
{
"docid": "58dc433385b08db0f6c9a5066d9e35b8",
"score": "0.5054716",
"text": "def load_from_yml filename=\"hn.yml\"\n @arr = YAML::load( File.open( filename ) )\n next_url = @arr.last[:article_url]\n unless next_url.index(\"http\")\n next_url = @host + \"/\" + next_url\n end\n @more_url = next_url\n end",
"title": ""
},
{
"docid": "155a7808196c89fb3aba5246d5ecaea3",
"score": "0.50513893",
"text": "def load_yaml(path) # Path must be in /data\n # path must be a yaml file path\n YAML.load_file(File.join(__dir__, \"../data/#{path}.yml\"))\n # YAML keys will be allways strings (never symbols)\n # Returns hash of values (strings)\nend",
"title": ""
},
{
"docid": "f0e740bfc87a0d1ada50008645f22f5e",
"score": "0.5049417",
"text": "def read_yaml(throw_missing: T.unsafe(nil), **kwd); end",
"title": ""
},
{
"docid": "6daf90f899110b86a11bcaa8ad841c98",
"score": "0.5035191",
"text": "def setup\r\n # Retrieve fixtures via their name\r\n # @first = category(:first)\r\n end",
"title": ""
},
{
"docid": "7f9041bceebd2e556c841dfb443354ac",
"score": "0.50322616",
"text": "def parse_header_contents; end",
"title": ""
},
{
"docid": "28d8e00673d0834e4237b50efd2f3191",
"score": "0.5028973",
"text": "def fixture_content(filename)\n path = File.expand_path(\"../fixtures/#{filename}\", __FILE__)\n File.read(path)\nend",
"title": ""
},
{
"docid": "dbe2c1b7554a1e9b21a102ca1bc94e7a",
"score": "0.5028502",
"text": "def fixtures(host, category)\n begin\n fixtures = YAML.load_file(\".fixtures.yml\")[\"fixtures\"]\n rescue Errno::ENOENT\n return {}\n end\n\n if not fixtures\n abort(\"malformed fixtures.yml\")\n end\n\n result = {}\n if fixtures.include? category and fixtures[category] != nil\n fixtures[category].each do |fixture, opts|\n if opts.instance_of?(String)\n source = opts\n target = \"#{host['distmoduledir']}/#{fixture}\"\n real_source = eval('\"'+source+'\"')\n result[real_source] = target\n elsif opts.instance_of?(Hash)\n target = \"#{host['distmoduledir']}/#{fixture}\"\n real_source = eval('\"'+opts[\"repo\"]+'\"')\n result[real_source] = { \"target\" => target, \"ref\" => opts[\"ref\"], \"scm\" => opts[\"scm\"] }\n end\n end\n end\n return result\nend",
"title": ""
},
{
"docid": "7e12bc55af8d78935f9959dee5a332a8",
"score": "0.50256795",
"text": "def parse_yaml_from_spec(rspec_file)\n if rspec_file =~ /^(.+)_spec\\.rb$/\n [ \"#{$1}_spec.yaml\",\n \"#{$1}_spec.yml\",\n \"#{$1}.yaml\",\n \"#{$1}.yml\"\n ].each do |yaml_file|\n if File.exist?(yaml_file)\n parse_rspec_puppet_yaml(yaml_file)\n end\n end\n elsif rspec_file =~ /^(.+\\.ya?ml)$/\n parse_rspec_puppet_yaml($1)\n else\n parse_rspec_puppet_yaml(rspec_file)\n end\nend",
"title": ""
},
{
"docid": "9ea4c30e39072e17fce40715efaefe13",
"score": "0.5022918",
"text": "def setup\r\n # Retrieve fixtures via their name\r\n # @first = categories(:first)\r\n end",
"title": ""
},
{
"docid": "d916c43762108a1551f3edf426bd290d",
"score": "0.501909",
"text": "def read_fixture( path )\n File.read(\"#{ fixtures_folder }/#{ path }\")\nend",
"title": ""
},
{
"docid": "7723dd96b65f3a51dffb49ceb125feaa",
"score": "0.5016378",
"text": "def fixture(path)\n return File.read(fixture_path(path))\nend",
"title": ""
},
{
"docid": "47f6d92146b716c43fa03ef3412fa3ef",
"score": "0.5016295",
"text": "def convert_spec(yaml_spec)\n YAML.load(reduce_spec(yaml_spec)) or\n\traise \"Didn't get a valid YAML document\"\n end",
"title": ""
},
{
"docid": "24e9788b9c2fee662b430961e41b671d",
"score": "0.50047666",
"text": "def to_yaml_front_matter\n yaml_fm = \"---\\n\"\n attr = self.attributes\n attr = attr.delete_if { |key, value| key == \"body\" }\n attr.each do |key, value|\n yaml_fm += \"#{key}: #{value}\\n\"\n end\n yaml_fm += \"---\\n\"\n yaml_fm += self.body\n yaml_fm\n end",
"title": ""
},
{
"docid": "6b167ee7d61d37adecc77ba75b867589",
"score": "0.50015485",
"text": "def yaml_file?; end",
"title": ""
},
{
"docid": "f464b9e8316916f1e060ce73d5c6d1a4",
"score": "0.49963495",
"text": "def setup\n # Retrieve fixtures via their name\n # @first = volunteer_tasks(:first)\n end",
"title": ""
},
{
"docid": "3f2de515cf7b95a24f1c51a10c71cc7a",
"score": "0.49959883",
"text": "def from_yaml\n results = YAML.load(self)\n \n # Replace bad values\n if results == false or results == nil\n \"\"\n else\n results\n end\n end",
"title": ""
}
] |
c4cd8effbaa262fbf5fa685ab65538b7
|
Button to dismiss a modal
|
[
{
"docid": "79de5156a42231a0dcb8a68a04b6312b",
"score": "0.71144587",
"text": "def modal_close_button\n content_tag :button, type: 'button', class: 'close',\n data: {dismiss: 'modal'} do\n icon('close')\n end\n end",
"title": ""
}
] |
[
{
"docid": "d7fdf5c3c7bdeb7b454aac321966e12b",
"score": "0.8108383",
"text": "def dismiss_modal(type, **options, &blk); end",
"title": ""
},
{
"docid": "ac8b2c149d1ada723325323c14b36689",
"score": "0.7458072",
"text": "def close\n @show = false\n # remove(\n # selector: \".modal-backdrop\"\n # )\n end",
"title": ""
},
{
"docid": "b329cc5953e6913c98b62d9a08a1836b",
"score": "0.73557574",
"text": "def dismiss \n end",
"title": ""
},
{
"docid": "b48ebe35c6c593d539d61374517cd0d6",
"score": "0.7237563",
"text": "def close_publishing_modal\n @browser.button(text: 'Hide').fire_event 'click'\n return self\n end",
"title": ""
},
{
"docid": "b1fd0c096593cc9778ad73891d7ef416",
"score": "0.71833843",
"text": "def dismiss(content = nil, **options, &block)\n content ||= capture(&block)\n options[:class] ||= 'close'\n options.update data: { dismiss: 'modal' }, type: 'button'\n button_tag content, options\n end",
"title": ""
},
{
"docid": "73d78c8e14dca02bda24c93f8e9e12e0",
"score": "0.71363366",
"text": "def click_close_modal_button\n wait_for_update_and_click_js close_modal_button_element\n end",
"title": ""
},
{
"docid": "7b2d53a44a5c8384d8f72eb943ca0f10",
"score": "0.6826327",
"text": "def cancel_button_click\n GameControllerContracts.invariant(self)\n @window.close\n end",
"title": ""
},
{
"docid": "7b2d53a44a5c8384d8f72eb943ca0f10",
"score": "0.6826327",
"text": "def cancel_button_click\n GameControllerContracts.invariant(self)\n @window.close\n end",
"title": ""
},
{
"docid": "1014d4aa01cedb12abdfdf1621055df6",
"score": "0.6792344",
"text": "def cancel_btn\n view.button_tag 'Cancel', type: 'button', id: nil, class: 'button btn btn-secondary mx-auto',\n data: { 'dismiss' => 'modal', type: 'button' }\n end",
"title": ""
},
{
"docid": "8bc9a83c9d4e5d4d6a59cb8601b11bbf",
"score": "0.6722981",
"text": "def dismiss_modal(type, **options, &blk)\n raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#dismiss_modal'\n end",
"title": ""
},
{
"docid": "8d481f8edb37e4c722e7403443aefb53",
"score": "0.6709528",
"text": "def destroy\n @modal = Modal.find(params[:id])\n @modal.destroy\n\n respond_to do |format|\n format.html { redirect_to modals_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "38d7e799e0ae19063e64faa1646d4b32",
"score": "0.6706097",
"text": "def buttonCancel__clicked(*args) \n\t\t@builder[\"window1\"].destroy \n\tend",
"title": ""
},
{
"docid": "b458d86f4b73299a6d9c989f331c9cae",
"score": "0.66942906",
"text": "def alert_dismiss\n first_button.click\n end",
"title": ""
},
{
"docid": "b458d86f4b73299a6d9c989f331c9cae",
"score": "0.66942906",
"text": "def alert_dismiss\n first_button.click\n end",
"title": ""
},
{
"docid": "de595e67b7b5ad133f93a39ef06700c4",
"score": "0.66791236",
"text": "def close_email_modal()\n @driver.find_element(:css, '.ui-dialog .ui-dialog-titlebar .ui-icon-closethick').click\n end",
"title": ""
},
{
"docid": "6d094fbf0b91b43ceefe9095401ad00e",
"score": "0.6655922",
"text": "def close_email_modal()\n driver.find_element(:css, '.ui-dialog .ui-dialog-titlebar .ui-icon-closethick').click\n end",
"title": ""
},
{
"docid": "95cf48546c7d285aa4945cabb60bfb79",
"score": "0.66513366",
"text": "def dismiss!\n self.dismiss = true\n self.save!\n end",
"title": ""
},
{
"docid": "448bb9c498717f81540a7802bc8ad187",
"score": "0.6613353",
"text": "def buttonCancel__clicked(*args) \n @builder[\"window1\"].destroy \n end",
"title": ""
},
{
"docid": "e16c7cdcbe9183ce123d30b18fdcb174",
"score": "0.6599021",
"text": "def cancel\n self.div(:id=>\"mymemberships_delete_membership_dialog\").button(:class=>\"s3d-link-button s3d-bold jqmClose\").click\n self.linger_for_ajax(1)\n end",
"title": ""
},
{
"docid": "64861b928bd9a71d4baf34c7f6e246b9",
"score": "0.65678376",
"text": "def close_abandon_modal()\n\t\treturn $test_driver.find_element(:partial_link_text, \"Back to scheduling my appointment\")\n\tend",
"title": ""
},
{
"docid": "02e5de6b9ebbb9af7c0dcf53b8e6104d",
"score": "0.65324914",
"text": "def destroy\n @bike_modal.destroy\n respond_to do |format|\n format.html { redirect_to bike_modals_url, notice: 'Bike modal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9dadf7790037f6fbee7d2a3693c32092",
"score": "0.6527314",
"text": "def close\n #close dialog\n end",
"title": ""
},
{
"docid": "b8d671a945a2b5563932eea5dd210869",
"score": "0.64995563",
"text": "def closeSettings()\n\tc= @browser.div(:class, \"modal-body\")\n d= c.button(:id, \"closeSettingsCross\")\n\td.click\nend",
"title": ""
},
{
"docid": "f2f42998039be0237760011e1255026d",
"score": "0.6491973",
"text": "def close_modal_javascript\n \"Luleka.Modal.close()\"\n end",
"title": ""
},
{
"docid": "000d71fdc9beb2e6babdc9d4d01b805a",
"score": "0.6484088",
"text": "def alert_dismiss_button\n content_tag(\n :button, '×'.html_safe,\n type: 'button',\n class: 'close',\n data: { dismiss: 'alert' },\n 'aria-hidden' => 'true'\n )\n end",
"title": ""
},
{
"docid": "f631f0c3596aca42f3590ed4e42f4097",
"score": "0.64675075",
"text": "def dismiss_confirm(text = nil, **options, &blk)\n dismiss_modal(:confirm, text, options, &blk)\n end",
"title": ""
},
{
"docid": "59a8e511d21545a879ab32fa17940cf7",
"score": "0.6428784",
"text": "def dismiss\n @notification&.dismiss!\n head(:no_content)\n end",
"title": ""
},
{
"docid": "7b6b7251fbf3d616c96a15c988084279",
"score": "0.6425781",
"text": "def destroy\n @test_email_modal.destroy\n respond_to do |format|\n format.html { redirect_to test_email_modals_url, notice: 'Test email modal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bda5dc05b15b1a1b430e0ae10517b407",
"score": "0.63632154",
"text": "def dismiss_prompt(text = nil, **options, &blk)\n dismiss_modal(:prompt, text, options, &blk)\n end",
"title": ""
},
{
"docid": "8624632e8015d0911f16e5fe7cdf40f1",
"score": "0.63537997",
"text": "def link_to_close\n content_tag :button, icon_tag('times'), class: 'close', data: {dismiss: 'modal'}, aria: {hidden: true}, type: 'button'\n end",
"title": ""
},
{
"docid": "8624632e8015d0911f16e5fe7cdf40f1",
"score": "0.63537997",
"text": "def link_to_close\n content_tag :button, icon_tag('times'), class: 'close', data: {dismiss: 'modal'}, aria: {hidden: true}, type: 'button'\n end",
"title": ""
},
{
"docid": "00d1a5e8f87b0aad50dd256f82ea7432",
"score": "0.63240546",
"text": "def modal_footer_close_button(*args)\n options = canonicalize_options(args.extract_options!)\n options = ensure_class(options, 'modal-close modal-footer-close')\n options.merge!(data: {dismiss: 'modal'})\n args.unshift(\"Close\") if args.empty?\n\n button(*args, options)\n end",
"title": ""
},
{
"docid": "8efa23727626d2d4537008cd9a7ffdf4",
"score": "0.6319705",
"text": "def button_close_modal(params={})\n link_to \"back\".ts, params[:back_to], class: \"waves-effect waves-light btn btn-flat btn-cancel-form\"\n end",
"title": ""
},
{
"docid": "72217e545b8e03b09daed741225edb96",
"score": "0.6271962",
"text": "def cancel\n begin\n self.div(:id=>\"deletecontent_dialog\").button(:text=>\"Cancel\").click\n rescue\n self.button(:text=>\"Cancel\").click\n end\n self.wait_for_ajax\n end",
"title": ""
},
{
"docid": "39e66530876f8f35e430d3fe56b0c1e2",
"score": "0.62707865",
"text": "def alert_dismiss_clicked\n game.clear_storyline\n game.go_to_room\n end",
"title": ""
},
{
"docid": "918d73547e27bbf542feaefc60567f83",
"score": "0.625094",
"text": "def destroy\n @dismissal = Dismissal.find(params[:id])\n @dismissal.destroy\n\n respond_to do |format|\n format.html { redirect_to(dismissals_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d355ec113693623169359c3608721da7",
"score": "0.62489456",
"text": "def close_modal(id)\n\t\tmodal = @driver.find_element(:id, id)\n\t\tdismiss = modal.find_element(:class, 'close')\n\t\tdismiss.click\n\t\t@wait.until {@driver.find_element(:tag_name, 'body')[:class].include?('modal-open') == false}\n\tend",
"title": ""
},
{
"docid": "37c8b4e34f20aece4ba3ba31df306a27",
"score": "0.6236201",
"text": "def clear_modal\n begin\n wait = Selenium::WebDriver::Wait.new(:timeout => 30)\n wait.until { @browser.find_element(:xpath, '/html/body/div[5]/div[2]/div[1]')}\n @browser.find_element(:xpath, '/html/body/div[5]/div[2]/div[1]').click()\n puts \"Modal Cleared\"\n rescue Selenium::WebDriver::Error::ElementNotInteractableError\n puts \"ERROR - RETRYING\"\n puts \"\"\n retry\n end \n end",
"title": ""
},
{
"docid": "9f21f119652beec896e71f9bfbb7ce0a",
"score": "0.622898",
"text": "def modal_close(opt = nil)\n html_opt = {\n class: 'blacklight-modal-close close',\n 'data-dismiss': 'modal'\n }\n merge_html_options!(html_opt, opt)\n icon = html_opt.delete(:icon) || '×'.html_safe\n icon = content_tag(:span, icon, aria_hidden: true)\n tip = t('blacklight.modal.close', default: '').presence\n html_opt[:title] ||= tip if tip\n html_opt[:'aria-label'] ||= tip || 'Close'\n content_tag(:button, icon, html_opt)\n end",
"title": ""
},
{
"docid": "e7dfd9d68202303dd224e218ec659e9d",
"score": "0.6164195",
"text": "def close_alert_btn type=\"alert\"\n content_tag :button, \"×\".html_safe, :class => \"close\", :'data-dismiss' => type\n end",
"title": ""
},
{
"docid": "1af6ade19772eb669621b6ddf99b6545",
"score": "0.6153369",
"text": "def on_close\n self.dismissViewControllerAnimated(true, completion:nil)\n end",
"title": ""
},
{
"docid": "f41131ecece9f143149666d8090ae283",
"score": "0.61280257",
"text": "def close_button_tag(options = {})\n content_tag :button, raw('×'), type: 'button', class: 'close',\n data: { dismiss: options[:dismiss] }\n end",
"title": ""
},
{
"docid": "dcfa1ad3357ad1711d3c3f7d3a7cfaaa",
"score": "0.61104107",
"text": "def pop_up_close\n element = @browser.find_element :xpath, '//*[@id=\"numberOneRecModal\"]/div/i'\n element.click if element.displayed?\n sleep 1\n end",
"title": ""
},
{
"docid": "4c187b58ed6985adda01184250e052c8",
"score": "0.61092216",
"text": "def hide\n @dialog.hide\n end",
"title": ""
},
{
"docid": "301c637920e3bf5d6d9f9b6182958c8a",
"score": "0.610009",
"text": "def back\n self.view.window.removeGestureRecognizer(@recognizer)\n @delegate.close_modal_view(true)\n end",
"title": ""
},
{
"docid": "db6048f18fa6e449cf8bb2d49e5bbfc8",
"score": "0.60848665",
"text": "def form_cancel\n cancel_button.click\n end",
"title": ""
},
{
"docid": "e8f58b258c22a1f79778e77314f56fd0",
"score": "0.6081848",
"text": "def cancel_and_close\n return '<input type=\"button\" name=\"cancel\" value=\"Cancel\" title=\"Return to the previous screen\" onclick=\"javascript:window.close()\">'\n end",
"title": ""
},
{
"docid": "60119902545125e301605f4b88dd1ea5",
"score": "0.6056192",
"text": "def close\n @dialog.close if @dialog\n end",
"title": ""
},
{
"docid": "aa358148e3ae5dcfa54c7559a617a2b7",
"score": "0.6041981",
"text": "def destroy\n @calendar_event.destroy\n respond_modal_with @calendar_event, :location => :back\n end",
"title": ""
},
{
"docid": "e1d278a0ee5338cdd1287b6dec845eda",
"score": "0.60226965",
"text": "def dismiss_dashboard\n\n end",
"title": ""
},
{
"docid": "1d3e31fb1657005b166b00bc86da984d",
"score": "0.6019935",
"text": "def button_to_close_facebox(name, html_options = {})\n @uses_facebox = true\n @uses_modal = true\n button_to_function name, 'Facebox.close()', html_options\n end",
"title": ""
},
{
"docid": "3645711fb264ba33cccb9ac42eec6b4e",
"score": "0.6003498",
"text": "def modal_dialog(options = {}, &block)\n options[:title] ||= ''\n options[:id] ||= ''\n options[:include_save] = options[:include_save].nil? ? false : options[:include_save]\n options[:delete_url] ||= nil\n options[:delete_msg] ||= 'Are you sure you want to DELETE this?'\n \n content = with_output_buffer(&block)\n render :partial => 'dm_core/admin/shared/modal_dialog', :locals => { :options => options, :content => content }\n end",
"title": ""
},
{
"docid": "979e05230d07bbba54603217ab7d393d",
"score": "0.5976828",
"text": "def dismiss\n what = params[:commit].downcase\n unless what.blank?\n # check boxes are \"selected\" set. All of them are hidden \"users\" set\n # we are saving query + complexity here by just fetching this data from submitted form\n # nested HTML forms are not supported, anyways\n users = ( (what == \"selected\") ? (params[:selected] ? params[:selected].keys.collect(&:to_i) : []) : params[:users].collect(&:to_i) )\n current_user.dismiss_batch( what, users) unless users.blank?\n end\n redirect_to :back # go back, where came from\n end",
"title": ""
},
{
"docid": "d732413d534c08ee6eb69b7249c55506",
"score": "0.59639657",
"text": "def modal_header_close_button(show=true)\n return ''.html_safe unless show\n button(\"×\".html_safe, type: 'button', class: 'close modal-close modal-header-close', data: {dismiss: 'modal'})\n end",
"title": ""
},
{
"docid": "9e695bca9f2a0aeca2d5d7c2f646c377",
"score": "0.59137106",
"text": "def dismiss_confirm(text = T.unsafe(nil), **options, &blk); end",
"title": ""
},
{
"docid": "bc5bc4207d7a7424bd849b386520d888",
"score": "0.5910403",
"text": "def close_modal_box_link(text)\n return '<button onclick=\"window.parent.hidePopWin()\">'+text+'</button>'\n end",
"title": ""
},
{
"docid": "0cdcdc3a11adcd5d73e7406c1807147f",
"score": "0.58862287",
"text": "def exit\n @window.pause = true\n @window.close\n end",
"title": ""
},
{
"docid": "0cdcdc3a11adcd5d73e7406c1807147f",
"score": "0.58862287",
"text": "def exit\n @window.pause = true\n @window.close\n end",
"title": ""
},
{
"docid": "9bc8ba53195af80106d1473974b0291c",
"score": "0.5872239",
"text": "def dismiss!\n self.data = \"\"\n end",
"title": ""
},
{
"docid": "54774ffc95bc5ebfe0b91641f9563ffd",
"score": "0.5871955",
"text": "def upsell_modal_close_button\n\t\t\t$tracer.trace(__method__)\n\t\t\treturn ToolTag.new(a.className(\"/fancybox-close/\"), __method__, self)\n\t\tend",
"title": ""
},
{
"docid": "72d4ae406d3f544ffb2e23057e01a301",
"score": "0.585952",
"text": "def dismiss_alert(name)\n Alert.dismiss(self, name)\n end",
"title": ""
},
{
"docid": "0f97e7e953d649c37d950903fa86c089",
"score": "0.585162",
"text": "def close\n @conversation = Conversation.find(params[:id])\n\n session[:conversations].delete(@conversation.id)\n\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "28f398082978bfec530d225b1bd979f3",
"score": "0.58329064",
"text": "def modal_toggle(options={}, &block)\n render \"/outpost/shared/modal\", options: options, body: capture(&block)\n end",
"title": ""
},
{
"docid": "44af2b7e24fb211607bfb5f9c1d412c3",
"score": "0.5827683",
"text": "def cancel\n puts \"cancel\"\n @undo.endUndoGrouping\n @undo.undoNestedGroup\n self.dismissViewControllerAnimated(true, completion:nil)\n end",
"title": ""
},
{
"docid": "8fda68abcc0b9a70800c7d0d44fc576d",
"score": "0.58036053",
"text": "def close\n @sms_reply = SmsReply.find_by_id(params[:id])\n \n reject_action and return if @sms_reply.nil?\n \n render_update_with_item :highlight => :white\n end",
"title": ""
},
{
"docid": "5d3a16ff5ee78be4f3514ab6f6599c9a",
"score": "0.58026665",
"text": "def dialog_close_button do_cancel = true, options={}\n content_tag :button,\n 'x',\n options.merge(class: \"#{options[:class]} close dialog-x-box #{'dialog-cancel-button' if do_cancel}\")\n end",
"title": ""
},
{
"docid": "e77cf1b58154e4869462e1dfb84005b0",
"score": "0.57927215",
"text": "def popup_handler\n\t\ttitle = @params['button_id']\n\t\tif title == \"Dismiss\" \n\t\t\tAlert.hide_popup\n\t\telse\t\t\n\t\t @emergency = Emergency.find(:first)\n\t\t if @emergency\n\t\t WebView.navigate(url_for( :action => :show, :id => @emergency.object))\n\t\t else\n\t\t WebView.navigate(url_for( :action => :index ))\n\t\t end \n\t\tend\n\tend",
"title": ""
},
{
"docid": "be4c43385ababab8449644ad96ec7efd",
"score": "0.5774153",
"text": "def cancel_cohort\n wait_for_update_and_click cancel_cohort_button_element\n modal_element.when_not_present Utils.short_wait\n rescue\n logger.warn 'No cancel button to click'\n end",
"title": ""
},
{
"docid": "2701b45a51e55d6e3379b8fa48fa4d19",
"score": "0.577369",
"text": "def elaborate_cancel\n @elaborate_window.close\n @command_window.activate\n end",
"title": ""
},
{
"docid": "fbc8bbc8dbc5609b3c9f030add126de6",
"score": "0.576286",
"text": "def project_cancel\n cancel.click\n end",
"title": ""
},
{
"docid": "ee7a535baaced5af9b950656d10052a7",
"score": "0.5757586",
"text": "def cancel\n handle_action('cancel')\n end",
"title": ""
},
{
"docid": "4ecb114439038f488b24be4b2365fea5",
"score": "0.57568026",
"text": "def onOK(eventData)\n dismiss(eventData)\n end",
"title": ""
},
{
"docid": "e8f5c4226b5f67446d20b77fe5400752",
"score": "0.5745591",
"text": "def destroy\n @administracao_modalidade.destroy\n respond_to do |format|\n format.html { redirect_to administracao_modalidades_url, notice: 'Modalidade foi removido do sistema.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "afaa33241308bb740558f16445e074ff",
"score": "0.5744952",
"text": "def cancel\n self.cancel_button\n self.linger_for_ajax(2)\n end",
"title": ""
},
{
"docid": "fc7fb8fd5ac46393e5bae375c3b69eca",
"score": "0.5739988",
"text": "def delete\n @popup.getSurface.setVisible false\nend",
"title": ""
},
{
"docid": "dcb6202d2a8b6ec9d2249ffade787872",
"score": "0.5720551",
"text": "def cancel_button\n button_to \"Cancel Project\", model, method: :delete, confirm: \"Are you sure you want to cancel this project? All contributions to it will also be cancelled.\", class: 'btn-danger btn-large'\n end",
"title": ""
},
{
"docid": "72bf1b5f7f389da4a8fb0dc5bb247319",
"score": "0.5720515",
"text": "def exit_alert\n self.verify_alert\n within @container do\n fill_in @object, with: @message if @message\n click_button @button.capitalize\n end\n end",
"title": ""
},
{
"docid": "986f751c182e42183168333f7f3ca82e",
"score": "0.5715072",
"text": "def click_modal_button(label)\n within \".modal\" do\n button = find_button(label)\n button.click\n end\n\n has_no_css?(\".modal\", visible: true)\n end",
"title": ""
},
{
"docid": "01e1da2474cdf0c1dce3bb9d96be0369",
"score": "0.571067",
"text": "def destroy\n @modal_id = @claim.event_id\n @modal_event = @claim.event\n @claim.destroy\n current_user.decrement!(:experience,by = 15 )\n respond_to do |format|\n format.html { redirect_to claims_url, notice: 'Claim was successfully destroyed.' }\n format.json { head :no_content }\n format.js { render :layout => false }\n end\n end",
"title": ""
},
{
"docid": "1762a2bfcf9fa34ae5e01d3a4cb3d3bb",
"score": "0.57055837",
"text": "def alert_close(show=true)\n return '' unless show\n content_tag(:button, '×'.html_safe, class: 'close', data: {dismiss: 'alert'})\n end",
"title": ""
},
{
"docid": "b1f99e4ebf13edc98f24b3ec4e48d521",
"score": "0.56854457",
"text": "def close_dialog(action)\n buttons = get_dialog_buttons\n if action == 'Back'\n buttons.each do |button|\n button.click if button.text == 'Back'\n end\n elsif action == 'Tap'\n # Should work for FF/IE\n @browser.find_element(:class, 'dialog-overlay-modal').click\n # Should work for Chrome\n @browser.find_element(:id, 'masterContainer').click\n elsif action == 'Menu'\n click_mobile_menu\n elsif action == 'Cancel'\n buttons.each do |button|\n button.click if button.attribute('data-attribute') == 'cancel' || button.attribute('data-attribute') == 'close'\n end\n else\n fail \"Close Action was not recognised - valid actions are: Back, Menu, Cancel, Tap. \\n Action tried: #{action}\"\n end\n end",
"title": ""
},
{
"docid": "88602f5fcbece16c5774937cf0886d38",
"score": "0.56810564",
"text": "def close\n if @dialog.abortWasRequested\n @dialog.logMessage('Aborted')\n else\n @dialog.setCompleted\n end\n end",
"title": ""
},
{
"docid": "2f7045f4d5fd45e28bcb71d58d5e0215",
"score": "0.56769973",
"text": "def button_to_close_fancybox name\n button_to_function name, \"$.fancybox.close()\"\n end",
"title": ""
},
{
"docid": "e80b77a58bcbf1d7ca7d0e8b8297d3c0",
"score": "0.5660512",
"text": "def destroy\n @gui_dialog = Gui::Dialog.find(params[:id])\n @gui_dialog.destroy\n\n respond_to do |format|\n format.html { redirect_to gui_dialogs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d8675c95bf590a8dce5455e8f056c3f4",
"score": "0.5659502",
"text": "def exit_alert(button = @button)\n super\n end",
"title": ""
},
{
"docid": "c090f126c21f3cb2c3a168843eb577ec",
"score": "0.5657654",
"text": "def cancel\n redirect_to navigation.back(2)\n end",
"title": ""
},
{
"docid": "eac24a8fd7872da244b044bdaf815927",
"score": "0.565481",
"text": "def cancel_payment\n cancel.click\n end",
"title": ""
},
{
"docid": "e36d2681fd0800e840248de8db33c6d2",
"score": "0.56391346",
"text": "def destroy\n @modalidade_pagamento = ModalidadePagamento.find(params[:id])\n @modalidade_pagamento.destroy\n\n respond_to do |format|\n format.html { redirect_to modalidade_pagamentos_url, :flash => { :notice => \"Modalidade Pagamento apagada.\"} }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2fac62ddaa99da9525e2b9c4790dfeae",
"score": "0.5636587",
"text": "def destroy\n @channel.destroy\n\n respond_to do |format|\n format.html { redirect_to user_locations_path(current_user) }\n format.json { head :no_content }\n format.js { render :text => \"$('##{dom_id(@channel, :edit)}').modal('hide');\" }\n end\n end",
"title": ""
},
{
"docid": "1cb33ef2afc15e6073c655198454d88c",
"score": "0.56340903",
"text": "def cancel_update_sequence\r\n error_and_disconnect\r\n if @dialog_sw\r\n @dialog_sw.button_state_initial\r\n @dialog_sw.hide\r\n end\r\n @model_net_data.event_cupe_raised(:ev_update_terminated)\r\n end",
"title": ""
},
{
"docid": "8374303c6cc005abb712c77a43b51bd4",
"score": "0.5632272",
"text": "def cancel\n self.cancel_button\n self.linger_for_ajax\n end",
"title": ""
},
{
"docid": "2952588c708d48d41381891e6d9f4191",
"score": "0.5632149",
"text": "def cancel\n self.div(:id=>\"userpermissions_container\").button(:class=>\"s3d-link-button jqmClose s3d-bold\").click\n end",
"title": ""
},
{
"docid": "184a8ea78582b9a16589c9ddfe8544fd",
"score": "0.56315523",
"text": "def destroy\n @dismissal_type = DismissalType.find(params[:id])\n @dismissal_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(dismissal_types_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "21c3a054b240ea83db225c5319e9ec84",
"score": "0.5630149",
"text": "def window_close\n end",
"title": ""
},
{
"docid": "8f5aa27480513051a2c00cc7edca62aa",
"score": "0.5612656",
"text": "def cancel_button\n # TODO: Formtastic DSL don't support \"cancel\"-buttons yet, monkey-patch or fast-hack needed.\n end",
"title": ""
},
{
"docid": "c77631ec8bfecb8c0c459e3e63345f41",
"score": "0.56039774",
"text": "def closePatientDetails\n @patientElement.click\n end",
"title": ""
},
{
"docid": "9f42a6e9d3cbe29889b0e85289b13e3b",
"score": "0.56003064",
"text": "def destroy\n @entry = Entry.open.find(params[:id])\n\n @entry.close\n respond_to do |format|\n format.html { redirect_to admin_entries_url, notice: 'Entry was successfully closed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "80f388e98b720d80b6ea22938c94d890",
"score": "0.55978763",
"text": "def cancel_code\n @gift_input_window.close\n reset_main_windows\n end",
"title": ""
},
{
"docid": "a8b345f229b212217d1145347ccba16d",
"score": "0.5593963",
"text": "def dismiss!\n File.unlink(self.file_name)\n end",
"title": ""
},
{
"docid": "33dd21f74d885934adffadfe4d25ddd6",
"score": "0.5575846",
"text": "def close\n @vote.close\n redirect_to :back, notice: \"投票[#{@vote.name}]已经归档!\"\n end",
"title": ""
}
] |
63686c3ee8d446a64dde684992a39810
|
METODO TO_S para convertir a string.
|
[
{
"docid": "dfffb2a0c5a8283968ff5cbe1c849aa1",
"score": "0.0",
"text": "def to_s\n\t\taux = \"[\"\n\t\tfor i in(0..@alt)\n\t\t\taux += \"[\"\n\t\t\tfor j in(0..@anc)\n\t\t\t\tif (j!=@anc)\n\t\t\t\t\taux += \"#{@M[i][j]},\"\n\t\t\t\telse\n\t\t\t\t\taux += \"#{@M[i][j]}\"\n\t\t\t\tend\n\t\t\tend\n\t\t\taux += \"]\"\n\t\tend\n\t\taux += \"]\"\n\t\taux\n\tend",
"title": ""
}
] |
[
{
"docid": "79963995f875db9afe89476fa57ae4d4",
"score": "0.8159772",
"text": "def convert_string string\n string\n end",
"title": ""
},
{
"docid": "bd1a0dfe1aeb1fdd7dfeeb2e7287d1a3",
"score": "0.76852864",
"text": "def to(str)\n @to_conv.conv(str)\n end",
"title": ""
},
{
"docid": "54a3063a28f1d8deef2a19a4a705c4fa",
"score": "0.71273136",
"text": "def convert_string\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "7785dd1551e1d3b1ab98235315566142",
"score": "0.71031433",
"text": "def string( str )\n str\n end",
"title": ""
},
{
"docid": "325ffadb3e3b7a5846f3c5804435e216",
"score": "0.69019353",
"text": "def string(str); end",
"title": ""
},
{
"docid": "325ffadb3e3b7a5846f3c5804435e216",
"score": "0.69019353",
"text": "def string(str); end",
"title": ""
},
{
"docid": "325ffadb3e3b7a5846f3c5804435e216",
"score": "0.69019353",
"text": "def string(str); end",
"title": ""
},
{
"docid": "325ffadb3e3b7a5846f3c5804435e216",
"score": "0.69019353",
"text": "def string(str); end",
"title": ""
},
{
"docid": "c95705669822cbb524938cae11d992b2",
"score": "0.68471086",
"text": "def unquote_and_convert_to(str, to_encoding); end",
"title": ""
},
{
"docid": "970dc9c9bb02534d105958c4931634d4",
"score": "0.6765837",
"text": "def to_s\n @string.to_s\n end",
"title": ""
},
{
"docid": "e557c9427fe7b7eafb837d8314af430b",
"score": "0.67247915",
"text": "def to_s\n self.__str__.rubify\n rescue PythonError, NoMethodError\n RubyPython::PyMain.str(self).rubify\n end",
"title": ""
},
{
"docid": "89e4b85a3df016a03c11269f5ab6e600",
"score": "0.6719635",
"text": "def str(str)\n Atoms::Str.new(str)\n end",
"title": ""
},
{
"docid": "f11ff895f06748d793c66c0408484060",
"score": "0.6671573",
"text": "def to_s\n @string.to_s\n end",
"title": ""
},
{
"docid": "4926d3ca69b279eab4155e389e736adb",
"score": "0.65810615",
"text": "def to_ruby(string)\n string.to_s\n end",
"title": ""
},
{
"docid": "a984c4307fbc52e0dcdb818c89f4c0ad",
"score": "0.6555741",
"text": "def string_literal(string); end",
"title": ""
},
{
"docid": "a66c68e49aea50db75b878a2947b1a6f",
"score": "0.655359",
"text": "def to_s\n @str.to_s\n end",
"title": ""
},
{
"docid": "bc38e36b4b89a747cdf4f57d43b3c65c",
"score": "0.6533305",
"text": "def to_string(str)\n res = str\n res = res.gsub(/\"/, '\\\"')\n res = '\"%s\"' % res\n return res\n end",
"title": ""
},
{
"docid": "bc38e36b4b89a747cdf4f57d43b3c65c",
"score": "0.6533305",
"text": "def to_string(str)\n res = str\n res = res.gsub(/\"/, '\\\"')\n res = '\"%s\"' % res\n return res\n end",
"title": ""
},
{
"docid": "a4b1cb64da0bd17c4d67a168e1756295",
"score": "0.6500511",
"text": "def to_s()\n @str\n end",
"title": ""
},
{
"docid": "50265524d8bd64a5ebbbd42900942223",
"score": "0.6485703",
"text": "def transcode string\n string.force_encoding(Encoding::UTF_8)\n end",
"title": ""
},
{
"docid": "930efb3c040220e36ea66e46c7b5e95e",
"score": "0.644143",
"text": "def convert(object)\n if String === object\n object\n elsif object.respond_to?(:to_str)\n object.to_str\n else\n object.inspect\n end\n end",
"title": ""
},
{
"docid": "861ef33be4f9a0d7bfa05ff7c3fb0d77",
"score": "0.64215714",
"text": "def convert(text)\n return nil if text.nil? || text.empty?\n string = text.to_s # ensure we have a string\n string = string.gsub /\\r\\n?/, \"\\n\" # normalize line breaks\n string.encode!(:invalid => :replace, :undef => :replace, :replace => '?')\n return string\n end",
"title": ""
},
{
"docid": "23e1bddaed6e59e7abe30cb0aa5a5bb1",
"score": "0.64108497",
"text": "def iconv(to, from, string); end",
"title": ""
},
{
"docid": "23e1bddaed6e59e7abe30cb0aa5a5bb1",
"score": "0.64108497",
"text": "def iconv(to, from, string); end",
"title": ""
},
{
"docid": "69ea57767faa2d3feeadb361319d887f",
"score": "0.64043844",
"text": "def to_str\n @string\n end",
"title": ""
},
{
"docid": "40c8fa6447f68bc7a55487ec56f7199b",
"score": "0.6396309",
"text": "def to_str(s)\n\t\ts1 = s.strip\n\t\treturn nil if s1.empty?\n\t\treturn nil if s1.match(/\\?+/)\n\t\ts1\n\tend",
"title": ""
},
{
"docid": "c114db28634e0820b9f99ac04bdaf2e7",
"score": "0.638995",
"text": "def to_s\n if string?\n return emit\n end\n _c_slaw_to_string.emit\n end",
"title": ""
},
{
"docid": "54e34d64f2e6e0bafd8525448b09a429",
"score": "0.6387721",
"text": "def translate_str(sexp)\n sexp = sexp.clone\n # No idea why does it need that many backslashes.\n sexp[1] = sexp[1].gsub('\\\\', '\\\\\\\\\\\\').gsub(\"\\n\", \"\\\\n\")\n\n var = next_var_name\n filtered_stmts(class_constructor(:String, var),\n s(:call, std_init_name(:String), s(:args, s(:var, var), sexp))).with_value(s(:var, var), :String)\n end",
"title": ""
},
{
"docid": "a7d9af4be5afb36b96e4772ff83d53b4",
"score": "0.63855594",
"text": "def from(str)\n @from_conv.conv(str)\n end",
"title": ""
},
{
"docid": "380152f643c943e2e419097abfa8803c",
"score": "0.6362812",
"text": "def e(str)\n if str.is_a? String\n #str.gsub!(/%/, '\\%')\n #str.gsub!(/\"/, '\\\"')\n str.gsub!(/\"/, '\\\"')\n #str.gsub!(/#/, '\\#')\n str.gsub!(/\\\\/, '/')\n return str\n #s = [str].pack(\"a\")\n end\n end",
"title": ""
},
{
"docid": "c406b1acd040a76ac4016b7a0f37c0a7",
"score": "0.63466597",
"text": "def normalize_string(str)\n str = str.to_s\n str = str.b if str.ascii_only?\n str\n end",
"title": ""
},
{
"docid": "577de6c4f4447b55f701eafafd630bcd",
"score": "0.62920713",
"text": "def cast_string(string)\n # Convert characters to their ASCII integer representations\n ascii_representations = string.split('').map(&:ord)\n # Convert ASCII integres to bytes\n string_of_bytes = ascii_representations.map { |i| HumanComputer::Processor.eight_bitify i }\n # All strings should be zero-terminated\n string_of_bytes << HumanComputer::Processor.eight_bitify(0)\n end",
"title": ""
},
{
"docid": "6823d80ce43c7626aa3f85714643f81a",
"score": "0.62732744",
"text": "def convert(string)\n retval = \"{}\"\n IO.popen(self.converter_call, 'r+', :err=>[:child, :out]) do |pipe|\n begin\n pipe.puts(string)\n pipe.close_write\n rescue\n # failed to write but we might still get a useful error\n end\n retval= pipe.read\n end\n return retval.chomp\n end",
"title": ""
},
{
"docid": "d7506c1e7e9acacaf4270f8205325a06",
"score": "0.62613356",
"text": "def try_convert(obj)\n String.try_convert(obj)\nend",
"title": ""
},
{
"docid": "bcabd9288243e650230ea7d8ddc7602c",
"score": "0.62372977",
"text": "def to_s\n return string\n end",
"title": ""
},
{
"docid": "a562cc455918562959d0ee683ca578a3",
"score": "0.62344223",
"text": "def convert string\n if string.is_a?(Array)\n string.map do |s|\n convert s\n end\n else\n # Remove invalid and undefined UTF-8 character encodings\n string = string.to_s.dup.force_encoding('UTF-8')\n return string.to_s.chars.select { |i| i.valid_encoding? }.join\n end\n end",
"title": ""
},
{
"docid": "0c36fe1f9623bb5f36fc546f060ee148",
"score": "0.6224634",
"text": "def simple_str(s)\n if s.encoding.name != 'ASCII-8BIT' && s.encoding.name != 'UTF-8'\n die(\"string [%s]\\n encoding is %s,\\n expected ASCII-8BIT\\n\",s,s.encoding.name)\n end\nend",
"title": ""
},
{
"docid": "b35320487319c2178bc12064039229fc",
"score": "0.62164336",
"text": "def StringValue(obj)\n Rubinius::Type.coerce_to obj, String, :to_str\n end",
"title": ""
},
{
"docid": "b35320487319c2178bc12064039229fc",
"score": "0.62164336",
"text": "def StringValue(obj)\n Rubinius::Type.coerce_to obj, String, :to_str\n end",
"title": ""
},
{
"docid": "f68d8b49f096035da59ee674fd624584",
"score": "0.62127674",
"text": "def conv(s)\n #s.gsub(\"\\337\", \"ß\").gsub(\"\\344\", \"ä\").gsub(\"\\374\", \"ü\").gsub(\"\\366\", \"ö\")\n s\nend",
"title": ""
},
{
"docid": "d1f0d39c32cd8416bb95edfd1d9c8357",
"score": "0.6203692",
"text": "def StringValue(obj)\n Type.coerce_to(obj, String, :to_str)\n end",
"title": ""
},
{
"docid": "24d916fd87104a493aa638586a87f442",
"score": "0.61887383",
"text": "def convert_string(str)\n ruby_19 { str = convert_to_ascii_if_ascii(str) }\n\n encoding = 0\n\n str.sub!(/^\"/,'') # Remove leading \"\n str.sub!(/\"$/,'') # Remove trailing \"\n str.gsub!(/\"\"/,'\"') # Substitute Excel's escaped double quote \"\" for \"\n\n # number of characters in str\n length = ruby_18 { str.gsub(/[^\\WA-Za-z_\\d]/, ' ').length } ||\n ruby_19 { str.length }\n\n # Handle utf8 strings\n if is_utf8?(str)\n str = utf8_to_16le(str)\n ruby_19 { str.force_encoding('BINARY') }\n encoding = 1\n end\n\n exit \"String in formula has more than 255 chars\\n\" if length > 255\n\n [@ptg['ptgStr'], length, encoding].pack(\"CCC\") + str\n end",
"title": ""
},
{
"docid": "8de80077206046df158429f1061fe7da",
"score": "0.6159633",
"text": "def to_s\n return self.str\n end",
"title": ""
},
{
"docid": "8cbcb683801206eeff86a6594c8a271d",
"score": "0.61573666",
"text": "def charset_convert(str, from, to = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "806d285104e8e549902957cd09fbdc3c",
"score": "0.6150708",
"text": "def from_s(in_str)\n self.str = in_str\n end",
"title": ""
},
{
"docid": "dce53ef9ce8a4ea40c084a25493870ca",
"score": "0.6148452",
"text": "def validate_and_coerce_string(value, opts)\n value.to_s\n end",
"title": ""
},
{
"docid": "afd755187df2ebef98c6ac78464fe94a",
"score": "0.61443126",
"text": "def to_s\n @string\n end",
"title": ""
},
{
"docid": "39000b8a1023a0144d83f4466bf58202",
"score": "0.6140931",
"text": "def to_s\n\t\treturn @str\n\tend",
"title": ""
},
{
"docid": "6ad45b2b2a0d6366275022de10eed9e7",
"score": "0.61372256",
"text": "def to_str\n to_s\n end",
"title": ""
},
{
"docid": "6ad45b2b2a0d6366275022de10eed9e7",
"score": "0.61372256",
"text": "def to_str\n to_s\n end",
"title": ""
},
{
"docid": "1200a1caf72ca3ce906e94c2992d39e0",
"score": "0.6129759",
"text": "def to_str\n to_s\n end",
"title": ""
},
{
"docid": "1200a1caf72ca3ce906e94c2992d39e0",
"score": "0.6129759",
"text": "def to_str\n to_s\n end",
"title": ""
},
{
"docid": "1200a1caf72ca3ce906e94c2992d39e0",
"score": "0.6129759",
"text": "def to_str\n to_s\n end",
"title": ""
},
{
"docid": "1200a1caf72ca3ce906e94c2992d39e0",
"score": "0.6129759",
"text": "def to_str\n to_s\n end",
"title": ""
},
{
"docid": "1200a1caf72ca3ce906e94c2992d39e0",
"score": "0.6129759",
"text": "def to_str\n to_s\n end",
"title": ""
},
{
"docid": "dd886430de84aeab827680bc9c863a57",
"score": "0.6127585",
"text": "def str(s)\n s.inspect[1..-2]\n end",
"title": ""
},
{
"docid": "afddefef6c7f7c35165a984f082815df",
"score": "0.61226666",
"text": "def convert(string)\n # vclass, val = string.split(':', 2)\n # CONVERTERS[vclass].call(val)\n Marshal.load(string)\n end",
"title": ""
},
{
"docid": "db34dc6d93f4880af08ce69a7a1a7fbd",
"score": "0.6118425",
"text": "def to_str\n # Using any other ways of overriding the String itself will lead you all the way from infinite loops to\n # core dumps. Don't go there.\n @string\n end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.61177814",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.61177814",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.61177814",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.61177814",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.61177814",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.61177814",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.61177814",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.61177814",
"text": "def to_str; end",
"title": ""
},
{
"docid": "e84d3b683c603296879bdcbc0ab6b449",
"score": "0.6115395",
"text": "def StringValue(obj)\n Type.coerce_to(obj, String, :to_str)\nend",
"title": ""
},
{
"docid": "91c475369f6c4e6887b0bc3b03e5080e",
"score": "0.6109032",
"text": "def serialize_to_string(string='')\n case @@encoding\n when EncodingType::BINARY # primitive format\n serialize_to_string_old(string)\n when EncodingType::HASHMAP # JSON format with key = field.name\n serialize_to_json(:name)\n when EncodingType::TAGMAP # JSON format with key = field.tag\n serialize_to_json(:tag)\n when EncodingType::INDEXED # INDEXED format\n serialize_to_indexed\n else\n raise ArgumentError, \"Invalid encoding type\"\n end\n end",
"title": ""
},
{
"docid": "dbd24ac2c674cae011a790360ed5a946",
"score": "0.6107255",
"text": "def nameConverter(str)\n str\n end",
"title": ""
},
{
"docid": "23364cc0f6f16772b0c109eeef538326",
"score": "0.6101168",
"text": "def to_s\n to_string_io.string\n end",
"title": ""
},
{
"docid": "e78dddf35680dadfa689177b1d7a666c",
"score": "0.609366",
"text": "def convert_to_utf8( str )\n return str if str.nil?\n str = str.to_s # you would thing that everything passed in would be a string -- riskman gem\n return str if %w[ UTF-8 US-ASCII ].include?( str.encoding.name ) && str.valid_encoding?\n before_bytes = str.bytesize\n if (str.encoding.name != \"ASCII-8BIT\") && str.valid_encoding? then\n from = str.encoding.name\n else\n from = find_encoding_of( str )\n from = \"UTF-8\" if from == \"ASCII-8BIT\"\n end\n\n # special case if it looks like it is US-ASCII to UTF-8 just force it,\n # it is valid\n if from == \"US-ASCII\" then\n str.force_encoding( \"UTF-8\" )\n return str\n end\n\n result = nil\n used = nil\n %w[ UTF-8//TRANSLIT//IGNORE UTF-8//IGNORE ].each do |to|\n logger.info \"Force an encoding conversion of #{before_bytes} #{str.encoding.name} bytes from #{from} to #{to}\"\n begin\n result = Iconv.conv( to, from, str )\n used = to\n break\n rescue => e\n logger.error e.inspect\n end\n end\n raise GemVersionEncodingError, \"Unable to do utf8 conversion on string >>>#{str}<<<\" unless result\n\n result.force_encoding( \"UTF-8\" )\n logger.info \"Forced an encoding conversion of #{before_bytes} #{str.encoding.name} bytes from #{from} to #{result.bytesize} bytes at #{used}\"\n return result\n end",
"title": ""
},
{
"docid": "95a860c06c352762c21df38dea80b240",
"score": "0.60849774",
"text": "def to_s()\n return to_str()\n end",
"title": ""
},
{
"docid": "4ab0742318d7ad4437b87915a106e565",
"score": "0.6082984",
"text": "def to_str\n end",
"title": ""
},
{
"docid": "378b76b4a8912847d86c08ba281240b7",
"score": "0.6076689",
"text": "def to_s\r\n @parsed_str || ''\r\n end",
"title": ""
},
{
"docid": "8b8841fe61213a4dfa5d004d28e09ef0",
"score": "0.60759974",
"text": "def to_s\n @str\n end",
"title": ""
},
{
"docid": "6a9620e536a8469383f0ca27a6387b93",
"score": "0.6042876",
"text": "def to_s\n @str\n end",
"title": ""
},
{
"docid": "6a9620e536a8469383f0ca27a6387b93",
"score": "0.6042876",
"text": "def to_s\n @str\n end",
"title": ""
},
{
"docid": "76a3e2ea09d378d73b667cfccf1888b5",
"score": "0.60416675",
"text": "def to_s\n instance_of?(String) ? self : \"\".replace(self)\n end",
"title": ""
},
{
"docid": "23145df84416a6d3ef1acc491aa83542",
"score": "0.6036074",
"text": "def to_s\n\t\t\t@str\n\t\tend",
"title": ""
},
{
"docid": "60ba482fdce1d56c351a7f864aa9866c",
"score": "0.6033217",
"text": "def coerce_string(ctx, value:, **)\n value.to_s\n end",
"title": ""
},
{
"docid": "d8a257633b4e5f22af1cefb3f3517646",
"score": "0.60320276",
"text": "def cast(value)\n value.to_s.gsub(/\\A\\\"|\\\"\\z/, '')\n end",
"title": ""
},
{
"docid": "d8a257633b4e5f22af1cefb3f3517646",
"score": "0.60320276",
"text": "def cast(value)\n value.to_s.gsub(/\\A\\\"|\\\"\\z/, '')\n end",
"title": ""
},
{
"docid": "f886d2ecacdc71efd81f041862fe44c5",
"score": "0.6021074",
"text": "def to_s\n to_str\n end",
"title": ""
},
{
"docid": "39f6d65363f036e13c3bc75c1b1d3be7",
"score": "0.60188913",
"text": "def quote_convert(string)\n\t\t\tconverted_string = \"\"\n\t\t\t# error check\n\t\t\tif string == '#'\n\t\t\t\tabort(\"Illegal input: #{@@tokenize[0]}2\") \n\t\t\tend\n\t\t\tif string.numeric? || \n\t\t\t \tstring[0] == \"\\'\" ||\n\t\t\t \tstring[0] == '\\\"'\n\t\t\t\tconverted_string = string + \" \"\n\t\t\telsif string == '(' ||\n\t\t\t\t string == '{' ||\n\t\t\t\t string == '['\n\t\t\t\tconverted_string = '(list '\n\t\t\telsif string == ')' ||\n\t\t\t\t string == '}' ||\n\t\t\t\t string == ']' \n\t\t\t\tconverted_string = ') '\n\t\t\telse\n\t\t\t\tconverted_string = \"\\'\" + string + \" \"\n\t\t\tend\n\t\t\treturn converted_string\n\t\tend",
"title": ""
},
{
"docid": "6734a9d4176dfc64f41d5395b9503941",
"score": "0.6017007",
"text": "def convert_str_to(input_str, data_type)\n\tif data_type == \"int\"\n\t\tinput_str.to_i\n\telsif data_type == \"float\"\n\t\tinput_str.to_f\n\telsif data_type == \"boolean\"\n\t\tto_bool(input_str)\n\telse \n\t\tinput_str\n\tend\nend",
"title": ""
},
{
"docid": "76253ba8b11a13359e3f4ab4574ae0cb",
"score": "0.6016406",
"text": "def to_s\n @original_str\n end",
"title": ""
},
{
"docid": "9bcf4c69b1e4227ce6d29a067527f31f",
"score": "0.59975797",
"text": "def to_s(options = {})\n to(:ascii, options).to_s\n end",
"title": ""
},
{
"docid": "ff98ac346a29e8b3dba0f8f0305c4c3f",
"score": "0.59910154",
"text": "def to_wide_string(str)\n str ? str.encode(encoding) : str\n end",
"title": ""
},
{
"docid": "a9a2e5d4154c62f1eeb65f2e9e29d588",
"score": "0.5982012",
"text": "def to_s\n text.to_s\n end",
"title": ""
},
{
"docid": "5b8d4709159aabba41316551e41d3401",
"score": "0.5981576",
"text": "def encode(str)\n str.chars.map { |c| convert(c) }.join\n end",
"title": ""
},
{
"docid": "7e26253050d2c9da0d7a90555b7d30a7",
"score": "0.59768677",
"text": "def to_s\n to_ruby.to_s\n end",
"title": ""
},
{
"docid": "c50b24b0dddebdb5e3c87d8dc4a22e3e",
"score": "0.59674746",
"text": "def to_native(str, charset=nil)\n str.encode(@charset, charset)\n end",
"title": ""
},
{
"docid": "10902f407f8036bdf296038003a9742e",
"score": "0.59661317",
"text": "def to_s\n @as_str\n end",
"title": ""
},
{
"docid": "fdc96af556728b73eda82961b9757d9b",
"score": "0.59644115",
"text": "def str2rstr_utf8(input)\n input\nend",
"title": ""
},
{
"docid": "82c8848410e21883f84e6d5b244a1b93",
"score": "0.5960523",
"text": "def to_s; text; end",
"title": ""
},
{
"docid": "fa9e993d013e18fa4fd3ed813da18a5b",
"score": "0.595765",
"text": "def conversion(string, &conversion_function)\n out = ''\n sanitized = sanitizeInput(string)\n sanitized.each_byte.with_index { |char, index|\n if char >= 'A'[0].ord and char <= 'Z'[0].ord\n out << conversion_function.call(char, @keystream[index].ord)\n else\n out << char\n end\n }\n return out\n end",
"title": ""
},
{
"docid": "f2c8609c3fe21e876f522c86090a621e",
"score": "0.59560835",
"text": "def my_string = (string)",
"title": ""
},
{
"docid": "17e76b8f7938a5b52abb70f2dfb6adf7",
"score": "0.59476954",
"text": "def normalise_string_encoding(str)\n if RUBY_VERSION >= \"1.9\"\n return str.dup.force_encoding(\"utf-8\")\n else\n str\n end\n end",
"title": ""
},
{
"docid": "fc552887a1795eccbecac13de352cb66",
"score": "0.59437305",
"text": "def c_str(s, out, opts)\n out << opts[:c].brown(s)\n #out << opts[:c].brown(s).tap { |x| p [ x, x.encoding ] }\n #out << opts[:c].brown(s).encode('UTF-8')\n end",
"title": ""
},
{
"docid": "0fc46123c92826169f0472dafff654e6",
"score": "0.59432584",
"text": "def to_str\n return to_s\n end",
"title": ""
},
{
"docid": "0fc46123c92826169f0472dafff654e6",
"score": "0.59432584",
"text": "def to_str\n return to_s\n end",
"title": ""
}
] |
e561e11bcf379ef5dc139c210017366b
|
Only allow a list of trusted parameters through.
|
[
{
"docid": "ef040df782f6b59ad13b4162bd86cc1c",
"score": "0.0",
"text": "def import_params\n params.permit(:import_file)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74768823",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.71700543",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.7044907",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "55ec6c1cf1b67ffe1cee0d4fec651d18",
"score": "0.7009515",
"text": "def allowed_params(*list)\n list.flatten!\n @list_of_allowed_params ||= []\n @list_of_allowed_params += list.map(&:to_s)\n\n params.each do |key, value|\n next if @list_of_allowed_params.index(key.to_s).present?\n\n fail! \"Parameter :#{key} is not allowed\", key.to_sym\n end\n end",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.69897616",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.6773957",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.6758029",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "53d67b9c2ed1e0132c46653273fc708d",
"score": "0.67139274",
"text": "def whitelisted_args\n args.select(&:allowed)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.6638781",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "caf5e21ffb495f1a2566ca6a564a6fdb",
"score": "0.6633307",
"text": "def allowed_arguments(arguments); end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6630876",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c31ef48e8fd467d94158d7ac7f405a3f",
"score": "0.65786487",
"text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.6551157",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.6529035",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.6529035",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "cac0774e508766d2f487cbca3db95df0",
"score": "0.650781",
"text": "def allow_params?\n definition[:param_tokens]\n end",
"title": ""
},
{
"docid": "58d1451e57b0e767db2fc6721dfaa6be",
"score": "0.64761394",
"text": "def allowed_parameters\n parameters.keys\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.64282405",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.63983387",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.63592577",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.6339914",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.6327032",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.63192505",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "706df0e25391ed2b932f54a646bb0a10",
"score": "0.6280703",
"text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end",
"title": ""
},
{
"docid": "839591b72f27e154e4840464f1f4684d",
"score": "0.6278046",
"text": "def whitelist=(lst)\n uri.querystring_params[\"whitelist\"] = lst.split(\",\").map(&:strip).reject{|e|e.blank?}\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.62771213",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e64490ed35123aafa1b4627bd165517d",
"score": "0.62693745",
"text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end",
"title": ""
},
{
"docid": "094cae2a77f3def05726eb7961449324",
"score": "0.62682945",
"text": "def allowed; end",
"title": ""
},
{
"docid": "cc60076a498957ddcd05472aa576a2b1",
"score": "0.62651163",
"text": "def param_whitelist\n case action_name\n when 'create'\n [:type, :author_id, :participant_ids]\n else\n [:participant_ids]\n end\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.62642586",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.62642586",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.6229388",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.6229388",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.6213818",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "21e97a45d3f9fc907204c8dfd146be09",
"score": "0.62028986",
"text": "def required_params(*list)\n list.flatten!\n @list_of_allowed_params ||= []\n @list_of_allowed_params += list.map(&:to_s)\n list.map(&:to_s).each do |param|\n next if params[param].present?\n\n fail! \"Parameter :#{param} should be present\", param\n end\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.61983657",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.61918944",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9ac9542f33069f9d46e4393194623b4c",
"score": "0.61912215",
"text": "def snippets_list_params\n params.require(:snippets_list).permit(:is_public, :tags)\n end",
"title": ""
},
{
"docid": "69d3720ae33b0a9e88f3a951595e767f",
"score": "0.6184765",
"text": "def sanitize_parameters!(sanitizer, params)\n endian = params[:endian] || self.endian\n fields = params[:fields] || self.fields\n hide = params[:hide] || self.hide\n\n params[:endian] = endian unless endian.nil?\n params[:fields] = fields\n params[:hide] = hide\n\n # add default parameters\n default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n super(sanitizer, params)\n end",
"title": ""
},
{
"docid": "a322581bdbf994c8ac99b2f8da40b18f",
"score": "0.61772996",
"text": "def user_params\n params.require(:user).permit(:first_name,:last_name,:email).tap do |whitelisted|\n p params[:user][:role_ids].reject { |c| c.empty? }\n whitelisted[:role_ids] = params[:user][:role_ids].reject { |c| c.empty? }\n end\nend",
"title": ""
},
{
"docid": "9e289c8e3757ad76ffbd2a6991acef28",
"score": "0.61578906",
"text": "def allowed_params\n %i[\n user_defined_id_statelocal\n user_defined_id_cdc\n user_defined_id_nndss\n first_name\n middle_name\n last_name\n date_of_birth\n age\n sex\n white\n black_or_african_american\n american_indian_or_alaska_native\n asian\n native_hawaiian_or_other_pacific_islander\n ethnicity\n primary_language\n secondary_language\n interpretation_required\n nationality\n address_line_1\n foreign_address_line_1\n address_city\n address_state\n address_line_2\n address_zip\n address_county\n monitored_address_line_1\n monitored_address_city\n monitored_address_state\n monitored_address_line_2\n monitored_address_zip\n monitored_address_county\n foreign_address_city\n foreign_address_country\n foreign_address_line_2\n foreign_address_zip\n foreign_address_line_3\n foreign_address_state\n foreign_monitored_address_line_1\n foreign_monitored_address_city\n foreign_monitored_address_state\n foreign_monitored_address_line_2\n foreign_monitored_address_zip\n foreign_monitored_address_county\n primary_telephone\n primary_telephone_type\n secondary_telephone\n secondary_telephone_type\n email\n preferred_contact_method\n preferred_contact_time\n port_of_origin\n source_of_report\n source_of_report_specify\n flight_or_vessel_number\n flight_or_vessel_carrier\n port_of_entry_into_usa\n travel_related_notes\n additional_planned_travel_type\n additional_planned_travel_destination\n additional_planned_travel_destination_state\n additional_planned_travel_destination_country\n additional_planned_travel_port_of_departure\n date_of_departure\n date_of_arrival\n additional_planned_travel_start_date\n additional_planned_travel_end_date\n additional_planned_travel_related_notes\n last_date_of_exposure\n potential_exposure_location\n potential_exposure_country\n contact_of_known_case\n contact_of_known_case_id\n travel_to_affected_country_or_area\n was_in_health_care_facility_with_known_cases\n was_in_health_care_facility_with_known_cases_facility_name\n laboratory_personnel\n laboratory_personnel_facility_name\n healthcare_personnel\n healthcare_personnel_facility_name\n exposure_notes\n crew_on_passenger_or_cargo_flight\n monitoring_plan\n exposure_risk_assessment\n member_of_a_common_exposure_cohort\n member_of_a_common_exposure_cohort_type\n isolation\n jurisdiction_id\n assigned_user\n symptom_onset\n case_status\n ]\n end",
"title": ""
},
{
"docid": "4f7be6ec5bf491c0125e1c2091de0a80",
"score": "0.61395127",
"text": "def place_allow_list_params\n params.permit(:place_id, :group_category_id, :enable)\n end",
"title": ""
},
{
"docid": "3512da8c3cbc10950f1c278d883a22d0",
"score": "0.6128934",
"text": "def check_permit!\n tracker.find_call(:method => :permit!).each do |result|\n if params? result[:call].target and not result[:chain].include? :slice\n warn_on_permit! result\n end\n end\n end",
"title": ""
},
{
"docid": "3ae7a4551c9ded91965010fecb51d76b",
"score": "0.6116012",
"text": "def validate_parameters(allow: [], required: nil, require_any_of: nil) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity\n if required\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{required}\" unless required.is_a?(Array) && required.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: `#{required}` must be provided\" unless @opts.is_a?(Hash) && required.all? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n allow += required\n end\n\n if require_any_of\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{require_any_of}\" unless require_any_of.is_a?(Array) && require_any_of.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: One of `#{require_any_of}` must be provided.\" unless @opts.is_a?(Hash) && require_any_of.any? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n allow += require_any_of\n end\n\n allow += %i(client_args stub_data aws_region aws_endpoint aws_retry_limit aws_retry_backoff resource_data)\n raise ArgumentError, \"Scalar arguments not supported\" unless defined?(@opts.keys)\n raise ArgumentError, \"Unexpected arguments found\" unless @opts.keys.all? { |a| allow.include?(a) }\n raise ArgumentError, \"Provided parameter should not be empty\" unless @opts.values.all? do |a|\n return true if a.instance_of?(Integer)\n return true if [TrueClass, FalseClass].include?(a.class)\n !a.empty?\n end\n true\n end",
"title": ""
},
{
"docid": "356c5fd5dcbe9214f1330792fa2e18b5",
"score": "0.61158365",
"text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "f19218511bb46b261576fd4a0359ddd0",
"score": "0.6112491",
"text": "def public_list_params\n params.require(:public_list).permit(:name, :description, places_attributes: [])\n end",
"title": ""
},
{
"docid": "76ec9935ef327d0b5d1af534978cb4f8",
"score": "0.6111488",
"text": "def voter_list_params\n params.require(:voter_list).permit(:user_id, :selection_process_id, :estado, :search, :admission)\n end",
"title": ""
},
{
"docid": "96a4c3e9d28624613a41897ea478af4c",
"score": "0.6111325",
"text": "def list_params\n params.require(:list).permit(:name, :description, :user_id)\n end",
"title": ""
},
{
"docid": "b275e68d657aac7565b7da55922cbcae",
"score": "0.6102179",
"text": "def should_filter_params(*keys)\n ::ActiveSupport::Deprecation.warn(\"use: should filter_param\")\n keys.each do |key|\n should filter_param(key)\n end\n end",
"title": ""
},
{
"docid": "5775dd2574b8acbba92a6a825c2a30b7",
"score": "0.6079451",
"text": "def allow_scopes(*args)\n @target.filterable_scopes = args\n end",
"title": ""
},
{
"docid": "7e3b725e746658a932308b2245800100",
"score": "0.6065513",
"text": "def list_params\n params.require(:list).permit(:user_id)\n end",
"title": ""
},
{
"docid": "b436ac15f83c93ec97a7852cc3cd560d",
"score": "0.6064122",
"text": "def list_params\n params.require(:list).permit(\n :name, :user_id, :location_ids => []\n )\n end",
"title": ""
},
{
"docid": "f5b444bcf4dbe089582ac3c3cf81ca92",
"score": "0.60615236",
"text": "def price_list_params\n params.fetch(:price_list, {}).permit(PriceList::PERMITED_PARAMS)\n end",
"title": ""
},
{
"docid": "d5df8448adfa675e6d25aeb23d7a5e34",
"score": "0.6058738",
"text": "def sanitize_query_fields\n allowed_fields = @list.property_index_keys\n return request.query_parameters.select {|key, val| allowed_fields.include?(key)}\n end",
"title": ""
},
{
"docid": "61d793e7f8b92dfddfe9ee932db6bae5",
"score": "0.60527927",
"text": "def my_list_params\n params.require(:my_list).permit(:user_id, :query)\n end",
"title": ""
},
{
"docid": "3da9117a80cdfd040f0f0ed9d3ffed55",
"score": "0.60501283",
"text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6045103",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.6032686",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "25220437209ae6056988e50c38a01211",
"score": "0.6025226",
"text": "def trust_params\n trusts = params.select { |k, _v| k.starts_with?(\"vault_entry_\") }\n permitted_params = {}\n trusts.keys.each do |trust|\n permitted_params[trust] = [:id, :name, :notes, :document_id, agent_ids: [], trustee_ids: [], successor_trustee_ids: [], share_ids: [],\n share_with_contact_ids: []]\n end\n trusts.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "08a3b9a8de9dd7334ffe66919731cb94",
"score": "0.60225105",
"text": "def permit_params!(params)\n if @allow_all_params\n params.permit!\n elsif @allowed_params\n @allowed_params.each do |resource, attributes|\n if params[resource].respond_to? :permit\n params[resource] = params[resource].permit(*attributes)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "4aa2ef6967e8f3024acea2b3d1cfd9e5",
"score": "0.6019055",
"text": "def allow_list_all?\n false\n end",
"title": ""
},
{
"docid": "45791845cef485d15b7014088dd0be8d",
"score": "0.60152686",
"text": "def allowed_params\n %i[title body]\n end",
"title": ""
},
{
"docid": "cb7fc4ad3e08a4341c6395a2c154c575",
"score": "0.6009825",
"text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_party\n attribute_list = Lbtt::Party.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end",
"title": ""
},
{
"docid": "cb7fc4ad3e08a4341c6395a2c154c575",
"score": "0.6009825",
"text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_party\n attribute_list = Lbtt::Party.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.6003619",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "0c9d4c365c1621bdf0a6b700bd6e3bef",
"score": "0.59931374",
"text": "def cleanedParams(params)\n params.select {|k, v| ALLOWED_PARAMS.include? k}\n end",
"title": ""
},
{
"docid": "71f97bda880101aa36b21017c0787f98",
"score": "0.5989032",
"text": "def validate_params\n invalid_parameter = @params.find { |key, value| !ConsolidatedScreeningList::PARAMETERS.key?(key) }\n raise ArgumentError, \"Invalid parameter: #{@params}\" if invalid_parameter\n end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.5984926",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.59798354",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
},
{
"docid": "f023b3871638291b75273a71bc75459c",
"score": "0.59747314",
"text": "def page_list_params\n params.permit(:url_list)\n params[:page_list].permit!\n end",
"title": ""
},
{
"docid": "d78d0776c63005d7f56f3a21b5e4c50a",
"score": "0.59729695",
"text": "def user_list_params\n params.require(:user_list).permit(:user_id, :list_id)\n end",
"title": ""
},
{
"docid": "4cf4346dd54b99fe0a7782ceaf7c26be",
"score": "0.5971315",
"text": "def quotation_list_params\n params.require(:quotation_list).permit!\n end",
"title": ""
},
{
"docid": "38ed4234ecadfc5889a7c25028dc9a58",
"score": "0.5965672",
"text": "def sanitize(params = {})\n blacklist = options.fetch(:blacklist, []).map(&:to_s)\n redacted_string = options.fetch(:redacted_string, 'REDACTED')\n params.each do |param, _value|\n params[param] = redacted_string if blacklist.include?(param.to_s)\n end\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.5962804",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "5fc4ba2ae074a90a66c53c25e751f3f0",
"score": "0.5960231",
"text": "def black_list_params\n params.require(:black_list).permit(:user)\n end",
"title": ""
},
{
"docid": "63f5e4e9733f9e6b3f98d5e069440292",
"score": "0.595559",
"text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end",
"title": ""
},
{
"docid": "8e519fbf8b7f524a91ac5c7f842a6121",
"score": "0.59538776",
"text": "def validate_params_present!; end",
"title": ""
},
{
"docid": "037a774fcd9c86ff09a88570fba7bebd",
"score": "0.59527713",
"text": "def filter_for ownable\n # get the class name of the ownable\n class_name = ownable.class_name_to_sym.to_s\n \n # make sure params format is as follows:\n # { ownable_class_name: {param1: :value, param2: :value} }\n params.required(class_name)\n\n # return {} if !params || params.empty?\n\n # get a list of attributes that are allowed for this item\n # could be true, false, or an array of allowed attributes\n allowed_attributes = attributes_for(ownable)\n\n # decide how to handle the received attributes\n if allowed_attributes == true\n \n # allow all\n params.permit!\n\n elsif allowed_attributes == false\n \n # allow none\n params.permit *[]\n\n else\n \n # filter out everything except allowed_attributes\n params.permit *allowed_attributes\n \n raise params.to_yaml\n end\n\n end",
"title": ""
},
{
"docid": "d4e0fd0cd70ef3707f081791087f33b6",
"score": "0.5949399",
"text": "def validate_parameters(allow: [], required: nil, require_any_of: nil)\n opts = @opts\n allow += %i(azure_retry_limit azure_retry_backoff azure_retry_backoff_factor\n endpoint api_version required_parameters allowed_parameters display_name method)\n Validators.validate_parameters(resource_name: @__resource_name__,\n allow: allow, required: required,\n require_any_of: require_any_of, opts: opts)\n true\n end",
"title": ""
},
{
"docid": "d7f0d4c3dc66c34a6e17c0a14432c0e9",
"score": "0.5946416",
"text": "def verification_list_params\n params.require(:verification_list).permit!\n end",
"title": ""
},
{
"docid": "5ed866fb3c6ebdffbc794d04bb9f2531",
"score": "0.5945795",
"text": "def list_params\n params.fetch(:list, {}).permit(\n :name\n )\n end",
"title": ""
},
{
"docid": "ba0704d4182a1a6fb0a743f6eb9cd25e",
"score": "0.59403497",
"text": "def check_params\n\t\t\t return []\t\t\t \n\tend",
"title": ""
},
{
"docid": "229afde2ab7c3109de2027d47fba2c70",
"score": "0.5937114",
"text": "def white_list_params(params, allowed_values, ignored_values = [])\n result = {}\n params.each_pair do |key, value|\n if allowed_values.include? key\n result[key] = value\n elsif !ignored_values.include?(key)\n raise SwaggerInvalidException.new(\"Unknown property [#{key}] with value [#{value}]#{list_or_none(allowed_values, 'properties')}\")\n end\n end\n result\n end",
"title": ""
},
{
"docid": "a99f218b156087cc665291b5dfc21e1f",
"score": "0.59363353",
"text": "def validate_parameters(allow: [], required: nil, require_any_of: nil)\n if required\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{required}\" unless required.is_a?(Array) && required.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: region must be provided via environment variable or hash parameter\" if required.include?(:region) && (!@opts.is_a?(Hash) || (@opts[:region].nil? || @opts[:region] == \"\"))\n raise ArgumentError, \"#{@__resource_name__}: `#{required}` must be provided\" unless @opts.is_a?(Hash) && required.all? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n\n allow += required\n end\n\n if require_any_of\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{require_any_of}\" unless require_any_of.is_a?(Array) && require_any_of.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: One of `#{require_any_of}` must be provided.\" unless @opts.is_a?(Hash) && require_any_of.any? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n\n allow += require_any_of\n end\n\n allow += %i{region} unless allow.include?(:region)\n allow += %i{endpoint} unless allow.include?(:endpoint)\n @opts.delete(:region) if @opts.is_a?(Hash) && @opts[:region].nil?\n\n raise ArgumentError, \"Scalar arguments not supported\" unless defined?(@opts.keys)\n raise ArgumentError, \"Unexpected arguments found\" unless @opts.keys.all? { |a| allow.include?(a) }\n raise ArgumentError, \"Provided parameter should not be empty\" unless @opts.values.all? do |a|\n return true if a.instance_of?(Integer) || a.instance_of?(TrueClass) || a.instance_of?(FalseClass)\n\n !a.empty?\n end\n\n true\n end",
"title": ""
},
{
"docid": "527035c39c066958cc202c06528f2673",
"score": "0.59362227",
"text": "def patient_list_params\n params.require(:patient_list).permit!\n end",
"title": ""
},
{
"docid": "ab49b0baeea5bf6f204adca9e864094e",
"score": "0.59332967",
"text": "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end",
"title": ""
},
{
"docid": "5b53a222b1dec771125370679892e873",
"score": "0.5929766",
"text": "def sanitize(raw_parameters = {})\n kept_params = {}\n sanitize_nesting(kept_params, @whitelist, symbolize_recursive(raw_parameters))\n kept_params\n end",
"title": ""
},
{
"docid": "d8b02fce801fc219417d86d0ca117836",
"score": "0.59260756",
"text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end",
"title": ""
},
{
"docid": "d8b02fce801fc219417d86d0ca117836",
"score": "0.59260756",
"text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.5921627",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "a1a9495fb0e2abd93f64e7d722073f1f",
"score": "0.59203607",
"text": "def interest_list_params\n params.require(:interest_list).permit(:name, :public, :user_id)\n end",
"title": ""
},
{
"docid": "b3e49440054c3ad3ddb77e29e74a8e4b",
"score": "0.59200895",
"text": "def sanitized_allowed_attributes=(attributes)\n sanitizer_vendor.safe_list_sanitizer.allowed_attributes = attributes\n end",
"title": ""
},
{
"docid": "7d35b10ac04b461c800fcfea1623a8bb",
"score": "0.591923",
"text": "def sanitize_by_param(allowed=[], default='id')\n sanitize_params params && params[:by], allowed, default\n end",
"title": ""
},
{
"docid": "7d35b10ac04b461c800fcfea1623a8bb",
"score": "0.591923",
"text": "def sanitize_by_param(allowed=[], default='id')\n sanitize_params params && params[:by], allowed, default\n end",
"title": ""
},
{
"docid": "9bd89e2fd22e220afe97917f75377374",
"score": "0.59133667",
"text": "def whitelist\n gather_params(self.jsonschema) if self.jsonschema.present? && self.jsonschema.key?('properties')\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.5912647",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "7f38dfb5bc4d7e89f8aa414e3097f268",
"score": "0.5905095",
"text": "def allow_access_list(opts)\n opts = check_params(opts,[:self_ips])\n super(opts)\n end",
"title": ""
},
{
"docid": "bf71f22b6a3d024d9581258c3391dd13",
"score": "0.59014034",
"text": "def filter_params(params); end",
"title": ""
},
{
"docid": "925ab7429771692d76184dc744dc843c",
"score": "0.58916956",
"text": "def user_list_params\n params.require(:user_list).permit(:user_id, :user_name)\n end",
"title": ""
},
{
"docid": "1c1ee6cc45fd852cab3c1e192bec902b",
"score": "0.5888005",
"text": "def parametro_params\r\n params.require(:parametro).tap do |whitelisted|\r\n whitelisted[:clave] = params[:parametro][:clave]\r\n whitelisted[:valor] = params[:parametro][:valor]\r\n whitelisted[:bloqueado] = params[:parametro][:bloqueado]\r\n\r\n for i in 0..params[:parametro].count do\r\n whitelisted[\"valor#{i}\".to_sym] = params[:parametro][\"valor#{i}\".to_sym]\r\n end\r\n end\r\n # params.require(:parametro).permit(:clave, :valor)\r\n end",
"title": ""
},
{
"docid": "b248e725f40ba361d6e0529f389090df",
"score": "0.5884956",
"text": "def filter_by_param(params={})\n if (sub_keys = params[\"allowed_keys\"])\n sub_keys.split(',').select do |key|\n self.allowed_keys.any? {|allowed_key| key.start_with?(allowed_key)}\n end\n else\n self.allowed_keys\n end\n end",
"title": ""
}
] |
ade4d84d14efbec99534886be663b4d3
|
GET /displasia/1 GET /displasia/1.json
|
[
{
"docid": "3750bf70df619d737784259cc39dabdb",
"score": "0.74843407",
"text": "def show\n @displasium = Displasium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @displasium }\n end\n end",
"title": ""
}
] |
[
{
"docid": "ffa31a1454d49ec86aad823f0719370f",
"score": "0.7705326",
"text": "def show\n @dispo = Dispo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dispo }\n end\n end",
"title": ""
},
{
"docid": "ffa31a1454d49ec86aad823f0719370f",
"score": "0.7705326",
"text": "def show\n @dispo = Dispo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dispo }\n end\n end",
"title": ""
},
{
"docid": "6e3654e06e02e365524391e29ed99f27",
"score": "0.7348978",
"text": "def show\n @resposta = Resposta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resposta }\n end\n end",
"title": ""
},
{
"docid": "60b43d6b5a769aa9b52bc71f90606a3d",
"score": "0.72514623",
"text": "def show\n @disponibilite = Disponibilite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @disponibilite }\n end\n end",
"title": ""
},
{
"docid": "711604a466e95f32ec5f53a6e10b5384",
"score": "0.72241473",
"text": "def show\n @comida = Comida.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comida }\n end\n end",
"title": ""
},
{
"docid": "86accacbac1db054818b1963cb113529",
"score": "0.72095287",
"text": "def show\n @parceiros = Parceiro.all \n @novidades = Novidade.order('created_at').last(6) \n \n @contato = Contato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contato }\n end\n end",
"title": ""
},
{
"docid": "b510932016b9ce1cfeb7a3c0cc25890b",
"score": "0.71894735",
"text": "def show\n @detalle_compra = DetalleCompra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detalle_compra }\n end\n end",
"title": ""
},
{
"docid": "4defd3f1ac997c94d77cbf5b268101df",
"score": "0.71661526",
"text": "def show\n @composante = Composante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @composante }\n end\n end",
"title": ""
},
{
"docid": "556389086dec95d182fe87aa9525a2bf",
"score": "0.7163693",
"text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "556389086dec95d182fe87aa9525a2bf",
"score": "0.7163693",
"text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "556389086dec95d182fe87aa9525a2bf",
"score": "0.7163693",
"text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "e44f1f0af60bfa529da691670ca9174c",
"score": "0.7149374",
"text": "def show\n @balanco = Balanco.find(params[:id])\n \n @balanco.produto_aferidos.each do |p|\n \n url = Ceam::Application::URL_VPSA + '/produtos/' + p.idProduto.to_s\n \n produtoVPSA = HTTParty.get(url)\n \n p.nomeProduto = produtoVPSA['descricao']\n p.estoque = produtoVPSA['quantidadeEmEstoque']\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @balanco.produtos.to_json(:methods => [:nomeProduto,:estoque])}\n end\n end",
"title": ""
},
{
"docid": "f8a4c8ea49dd931477c954fceb6187df",
"score": "0.7138466",
"text": "def show\n @pelicula = Pelicula.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pelicula }\n end\n end",
"title": ""
},
{
"docid": "f8a4c8ea49dd931477c954fceb6187df",
"score": "0.7138466",
"text": "def show\n @pelicula = Pelicula.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pelicula }\n end\n end",
"title": ""
},
{
"docid": "dbfe2efe932aa7784db2b0ac38a311c5",
"score": "0.7114323",
"text": "def index\n find_cargos\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @cargos.to_json(:only => [:id, :nombre])}\n end\n\n end",
"title": ""
},
{
"docid": "017a7c93dd4e1a3893e1c0978b83db71",
"score": "0.7111748",
"text": "def show\n @ocupacion = Ocupacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ocupacion }\n end\n end",
"title": ""
},
{
"docid": "9d44296435edb861882d12ac7718dd58",
"score": "0.7096124",
"text": "def show\n @orcamento = Orcamento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orcamento }\n end\n end",
"title": ""
},
{
"docid": "9d44296435edb861882d12ac7718dd58",
"score": "0.7096124",
"text": "def show\n @orcamento = Orcamento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orcamento }\n end\n end",
"title": ""
},
{
"docid": "f34f5ac022ee555807032455cc638a38",
"score": "0.7089354",
"text": "def show\n @oficio = Oficio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @oficio }\n end\n end",
"title": ""
},
{
"docid": "3bc05961da138f9f16a61a9c3ba705b8",
"score": "0.70844626",
"text": "def show\n @historia = Historia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historia }\n end\n end",
"title": ""
},
{
"docid": "756c3941b6f9ddd32e4e352296f34e28",
"score": "0.70819575",
"text": "def show\n @comuna = Comuna.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comuna }\n end\n end",
"title": ""
},
{
"docid": "24a536fb0104c2cc38a74df47ad8c0b8",
"score": "0.7078587",
"text": "def show\n @opcion = Opcion.find(params[:id])\n\n render json: @opcion\n end",
"title": ""
},
{
"docid": "4d76422e2466ab19564e24d8d9e0ec6a",
"score": "0.70728165",
"text": "def show\n render json: @distrito\n end",
"title": ""
},
{
"docid": "4fc72acc03a77280da78c87092dafb4c",
"score": "0.70566165",
"text": "def show\n @precio = Precio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @precio }\n end\n end",
"title": ""
},
{
"docid": "7f1796a133bbd968a1cfc10c872c18f7",
"score": "0.7050497",
"text": "def show\n @curso = Curso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @curso }\n end\n end",
"title": ""
},
{
"docid": "733f665d7cdddb335329100f37d74e1f",
"score": "0.7046243",
"text": "def index\n @fornecedores = Fornecedor.page(params[:page]).per(NUMERO_POR_PAGINA)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fornecedores }\n end\n end",
"title": ""
},
{
"docid": "b6573bb9fc63efaa52af0c4f37b1e7f4",
"score": "0.70446193",
"text": "def mostrar_aportes\n @aportes = Aporte.where(:socio_id=>params[:socio_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @aportes }\n end\n end",
"title": ""
},
{
"docid": "84b9c670445fa61d99bd892b674959b5",
"score": "0.7039278",
"text": "def get\n response = ApiPago.get_factura(params[:id_factura])\n render json: response\n end",
"title": ""
},
{
"docid": "d503333cac06d92ccbc313f86e2f8f19",
"score": "0.70387137",
"text": "def show\n @curso = Curso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @curso }\n end\n end",
"title": ""
},
{
"docid": "2dc7461d6de6a8b6f20eeb82a5b23577",
"score": "0.70322824",
"text": "def show\n @parceiros = Parceiro.all\n @novidades = Novidade.order('created_at').last(6) \n \n @recado = Recado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recado }\n end\n end",
"title": ""
},
{
"docid": "b5016182539046670f555a85c5c81430",
"score": "0.7025344",
"text": "def show\n @control_consulta = ControlConsultas.find(params[:id])\n\n render json: @control_consulta\n end",
"title": ""
},
{
"docid": "49420866bbcd2adf160c9e16ae50850b",
"score": "0.701608",
"text": "def show\n @listaprecio = Listaprecio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @listaprecio }\n end\n end",
"title": ""
},
{
"docid": "9dbf5fb2a97b4f327febb0800f2385d4",
"score": "0.70142406",
"text": "def show\n @convo = Convo.find_by(id: params[:id])\n render json: @convo\n end",
"title": ""
},
{
"docid": "9bb50f8954f2da8e22c767c4fc7c78ae",
"score": "0.7008671",
"text": "def show\n @reconocimiento = Reconocimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reconocimiento }\n end\n end",
"title": ""
},
{
"docid": "aaa25b61851e8b4f7bab0948f8c7f743",
"score": "0.7007187",
"text": "def index\n @respostas = Resposta.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @respostas }\n end\n end",
"title": ""
},
{
"docid": "08638ccfc93a63bd7b1d8db728843fa6",
"score": "0.7002955",
"text": "def show\n @comentarios_estrategium = ComentariosEstrategium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comentarios_estrategium }\n end\n end",
"title": ""
},
{
"docid": "7828499b659774071e431998b094d573",
"score": "0.70010763",
"text": "def show\n @conversazione = Conversazione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conversazione }\n end\n end",
"title": ""
},
{
"docid": "ed375191250c7ede407cb6056fe0d09f",
"score": "0.6999488",
"text": "def show\n @pelicula = Pelicula.find_by(id: params[:id])\n if @pelicula\n render json: @pelicula, status: :ok\n else\n render json: {error: 'Not Found'}, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "e93e8a74b447adc5748c25dbf0949faf",
"score": "0.69957465",
"text": "def show\n render json:@respuesta, :only =>[:id, :descripcion, :imagen],status: :ok\n end",
"title": ""
},
{
"docid": "a7f0bb7956b509638f174c5ca2594f9e",
"score": "0.69950527",
"text": "def show\n @punto_servicio = PuntoServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @punto_servicio }\n end\n end",
"title": ""
},
{
"docid": "9785a53787d06159ccfe514704dbb332",
"score": "0.6991791",
"text": "def show\n @congregacion = Congregacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @congregacion }\n end\n end",
"title": ""
},
{
"docid": "297829994ca3b00b41953c296537dfb9",
"score": "0.69900376",
"text": "def show\n @registro_compra = RegistroCompra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registro_compra }\n end\n end",
"title": ""
},
{
"docid": "a5d4128f9a065abbe74de73e8253f1aa",
"score": "0.69894576",
"text": "def show\n @tipo_seguro = TipoSeguro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_seguro }\n end\n end",
"title": ""
},
{
"docid": "229e90929026a813fe6f7a130e3f67cf",
"score": "0.6983432",
"text": "def index\n @convos = Convo.all\n render json: @convos\n end",
"title": ""
},
{
"docid": "0a684b835bde2005b0d3550fb8afbf93",
"score": "0.69830346",
"text": "def show\n @detallefactura = Detallefactura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detallefactura }\n end\n end",
"title": ""
},
{
"docid": "210f5d67203e90c5ba90231800ff7c68",
"score": "0.69825923",
"text": "def show\n @cursoacademico = Cursoacademico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cursoacademico }\n end\n end",
"title": ""
},
{
"docid": "951cf34f22536b0a5ecab664be864b9c",
"score": "0.6974178",
"text": "def show\n @catalogo = Catalogo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @catalogo }\n end\n end",
"title": ""
},
{
"docid": "951cf34f22536b0a5ecab664be864b9c",
"score": "0.6974178",
"text": "def show\n @catalogo = Catalogo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @catalogo }\n end\n end",
"title": ""
},
{
"docid": "f7cba2a03dc4c06ac37fb8c1e77dd2d6",
"score": "0.6967526",
"text": "def show\n @gerente_comercial = GerenteComercial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gerente_comercial }\n end\n end",
"title": ""
},
{
"docid": "2de43c0fc35a52ab963ee6e3f0cb954b",
"score": "0.6966654",
"text": "def show\n @comune = Comune.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comune }\n end\n end",
"title": ""
},
{
"docid": "1545e8221b3af4905798987ccee052b1",
"score": "0.6964832",
"text": "def index\n @pelicula = Pelicula.all\n render json: @pelicula, status: :ok \n end",
"title": ""
},
{
"docid": "8b46243b086330de870b4d2f78ce7e48",
"score": "0.6964528",
"text": "def show\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @asiento }\n end\n end",
"title": ""
},
{
"docid": "4e52667bfecb00248c7f94daff496d19",
"score": "0.6960538",
"text": "def show\n @esclerosi = Esclerosi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @esclerosi }\n end\n end",
"title": ""
},
{
"docid": "ab64aa694c85d41bbf2e6771667338cb",
"score": "0.6957837",
"text": "def show\n @ofrece = Ofrece.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ofrece }\n end\n end",
"title": ""
},
{
"docid": "0ec9a2b446c5b6da150d889d37fe038d",
"score": "0.6950522",
"text": "def show\n @registrocompra = Registrocompra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registrocompra }\n end\n end",
"title": ""
},
{
"docid": "0621e60ea60143ca662b69497134d0b7",
"score": "0.6950055",
"text": "def show\n @localizacao = Localizacao.find(params[:id])\n \n @localizacao.produtos.each do |p|\n\n produtoVPSA = HTTParty.get( url_vpsa_load_produtos p.idProduto.to_s '93' )\n \n p.nomeProduto = produtoVPSA['descricao']\n p.estoque = produtoVPSA['quantidadeEmEstoque']\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @localizacao.produtos.to_json(:methods => [:nomeProduto,:estoque])}\n end\n end",
"title": ""
},
{
"docid": "ab614c91deb6283277c04071e75c4d73",
"score": "0.6947803",
"text": "def show\n @compartido = Compartido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @compartido }\n end\n end",
"title": ""
},
{
"docid": "969da00db1f0674675ef81c22286a238",
"score": "0.69450355",
"text": "def show\n @observacao_vocacionado = ObservacaoVocacionado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @observacao_vocacionado }\n end\n end",
"title": ""
},
{
"docid": "1f151dd67fc6570c5ef25c8d507e5ca4",
"score": "0.6940112",
"text": "def show\n @curriculo = Curriculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @curriculo }\n end\n end",
"title": ""
},
{
"docid": "266b073ed7ded56418ad36a325faaed6",
"score": "0.6932947",
"text": "def show\n render json: @produto\n end",
"title": ""
},
{
"docid": "bdefe4591b580a3f2685313f424e8849",
"score": "0.6931348",
"text": "def show\n @cota = Cota.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cota }\n end\n end",
"title": ""
},
{
"docid": "5fa43b6bf0814cc4d72db8939aa9b49b",
"score": "0.6927214",
"text": "def show\n @factura_distribuidor = FacturaDistribuidor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @factura_distribuidor }\n end\n end",
"title": ""
},
{
"docid": "7321372cbda95e883bab60d339ebca59",
"score": "0.6927158",
"text": "def show\n @aplicacion = Aplicacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aplicacion }\n end\n end",
"title": ""
},
{
"docid": "843b6e6ad98ba3acf80a8d33722f12ea",
"score": "0.69267064",
"text": "def show\n @pensamiento = Pensamiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pensamiento }\n end\n end",
"title": ""
},
{
"docid": "e8a7150f0d128c37edefde79784e856a",
"score": "0.69265795",
"text": "def show\n @disp = Disp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @disp }\n end\n end",
"title": ""
},
{
"docid": "c44161446fdcc7a52fb40a12330572eb",
"score": "0.6924776",
"text": "def show\n @motivo_consulta = MotivoConsulta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @motivo_consulta }\n end\n end",
"title": ""
},
{
"docid": "391510886307915dc23effe324f3b0dd",
"score": "0.69145536",
"text": "def show\n @olimpiada = Olimpiada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @olimpiada }\n end\n end",
"title": ""
},
{
"docid": "055244f4d08607a77bf83f6dda46f61d",
"score": "0.69084734",
"text": "def show\n @nota_entrega = NotaEntrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nota_entrega }\n end\n end",
"title": ""
},
{
"docid": "c019514688050937d9bd66c9eae292a7",
"score": "0.6903782",
"text": "def index\n @clientes = Cliente.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @clientes }\n end\n end",
"title": ""
},
{
"docid": "9f9b24d307923bafbac1956a2f8b3f9c",
"score": "0.6902353",
"text": "def show\n @aporte = Aporte.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aporte }\n end\n end",
"title": ""
},
{
"docid": "9f9b24d307923bafbac1956a2f8b3f9c",
"score": "0.6902353",
"text": "def show\n @aporte = Aporte.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aporte }\n end\n end",
"title": ""
},
{
"docid": "3b250cc49b9b48532e5c11e19cc9efa4",
"score": "0.68959194",
"text": "def show\n @condo = Condo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @condo }\n end\n end",
"title": ""
},
{
"docid": "15f2bd66d0d2a1616d7b422b55bb6b8b",
"score": "0.68946165",
"text": "def show\n @core_nota_retida = Core::NotaRetida.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_nota_retida }\n end\n end",
"title": ""
},
{
"docid": "316a5a2e07d32033a0a2fd2092597649",
"score": "0.68921053",
"text": "def show\n @idioma = Idioma.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @idioma }\n end\n end",
"title": ""
},
{
"docid": "8d1b90399538ddf502d6a4b8263d2098",
"score": "0.6891336",
"text": "def index\n @respuesta = Respuesta.all\n\n \n if @respuesta.count > 0\n render json:@respuesta, :only =>[:id, :descripcion, :imagen],status: :ok\n else\n render json:Respuesta.none, status: :no_content\n end\n \n end",
"title": ""
},
{
"docid": "9b1b961bc17587b056226b3c2cd7be66",
"score": "0.6881012",
"text": "def show\n @presencia = Presencia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @presencia }\n end\n end",
"title": ""
},
{
"docid": "e655dae34c0b7b8a0ece77104c330cf9",
"score": "0.68746835",
"text": "def show\n @conta = Conta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conta }\n end\n end",
"title": ""
},
{
"docid": "28936f59740e65a2dbbfabb38c30f796",
"score": "0.68689716",
"text": "def show\n @sueldo = Sueldo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sueldo }\n end\n end",
"title": ""
},
{
"docid": "83ddc74830348517ca2f3cef46784f42",
"score": "0.68637973",
"text": "def show\n @cuenta_por_cobrar = CuentaPorCobrar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cuenta_por_cobrar }\n end\n end",
"title": ""
},
{
"docid": "499bd4f61092aefc3b74e711d40d8704",
"score": "0.6863589",
"text": "def show\n @factura = Factura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @factura }\n end\n end",
"title": ""
},
{
"docid": "499bd4f61092aefc3b74e711d40d8704",
"score": "0.6863589",
"text": "def show\n @factura = Factura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @factura }\n end\n end",
"title": ""
},
{
"docid": "63930a751e5b0e5548c7f8605144fc1c",
"score": "0.6862769",
"text": "def show\n @tipo_apuestum = TipoApuestum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_apuestum }\n end\n end",
"title": ""
},
{
"docid": "a213135f274ce6ebaeab0f98c93aa87a",
"score": "0.6856804",
"text": "def show\n @convenio = Convenio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @convenio }\n end\n end",
"title": ""
},
{
"docid": "e34c8c75feb8cbd75364f31b23fb15bc",
"score": "0.6848495",
"text": "def consultar\n @curso = Curso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @curso }\n end\n end",
"title": ""
},
{
"docid": "52e1f24bfc1ad2837e64150b995d4eaf",
"score": "0.68481994",
"text": "def show\n @dataele_descritor = DataeleDescritor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dataele_descritor }\n end\n end",
"title": ""
},
{
"docid": "766abd780d62a1bb92919edbf0a90ec7",
"score": "0.68476725",
"text": "def index\n @asesorias = Asesoria.order(\"id desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asesorias }\n end\n end",
"title": ""
},
{
"docid": "b57ef82bed66135875fb50ac63fb7849",
"score": "0.6845538",
"text": "def show\n @aplicacion_periodica = AplicacionPeriodica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aplicacion_periodica }\n end\n end",
"title": ""
},
{
"docid": "83b9c3cfff24c2c0aa88ae2ee1f091da",
"score": "0.68451256",
"text": "def show\n @ocar = Ocar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ocar }\n end\n end",
"title": ""
},
{
"docid": "831ef5124fa20c193f09da74a497d8ab",
"score": "0.6844969",
"text": "def show\n @compra = Compra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @compra }\n end\n end",
"title": ""
},
{
"docid": "55c10ae77a36f63c05f647d17e7d250e",
"score": "0.68430537",
"text": "def show\n @consultorio = Consultorio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultorio }\n end\n end",
"title": ""
},
{
"docid": "6889453d4e18cfa404bf61cae696894f",
"score": "0.68401974",
"text": "def show\n @tipo_aula = TipoAula.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tipo_aula }\n end\n end",
"title": ""
},
{
"docid": "0b87086646a3e3508ef44f9811fc0987",
"score": "0.68392515",
"text": "def show\n @entrega = Entrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrega }\n end\n end",
"title": ""
},
{
"docid": "0b87086646a3e3508ef44f9811fc0987",
"score": "0.68392515",
"text": "def show\n @entrega = Entrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrega }\n end\n end",
"title": ""
},
{
"docid": "24d1deb9b83a4a0823f59f45e209af81",
"score": "0.6838168",
"text": "def show\n @tipo_acc = TipoAcc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_acc }\n end\n end",
"title": ""
},
{
"docid": "5063f52ea7c47efa736e550780f49352",
"score": "0.68374664",
"text": "def show\n @historique = Historique.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historique }\n end\n end",
"title": ""
},
{
"docid": "069969be67b3388c87adb70941984287",
"score": "0.68356425",
"text": "def show\n @agronomiadecanato = Agronomiadecanato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @agronomiadecanato }\n end\n end",
"title": ""
},
{
"docid": "4a48118c4e30ebdec43beaa43610f17c",
"score": "0.683392",
"text": "def show\n @valuta = Valuta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @valuta }\n end\n end",
"title": ""
},
{
"docid": "4b5aa009ea54839233fa38d82ada8474",
"score": "0.6831355",
"text": "def show\n @cargo_tipo = CargoTipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cargo_tipo }\n end\n end",
"title": ""
},
{
"docid": "1b9acc2007b7b9c5988d7411ce0c70ae",
"score": "0.68281853",
"text": "def show\n @status_de_pago_ese = StatusDePagoEse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_pago_ese }\n end\n end",
"title": ""
},
{
"docid": "e8c19a02c77d7499702c9ea1b974469c",
"score": "0.6826158",
"text": "def index\n @distritos = Distrito.all\n\n render json: @distritos\n end",
"title": ""
}
] |
55185b2ae9c6dde9badd49b1fe3554a5
|
returns a hash of the total weights of each child's sumtree
|
[
{
"docid": "7d17e942a6a284d9554448ec7980849c",
"score": "0.83444864",
"text": "def children_sumtrees\n children.each_with_object({}) do |child, sum|\n sum[child.name] = child.total_weight\n end\n end",
"title": ""
}
] |
[
{
"docid": "8067e9fa1d9f95446349f07e454d8335",
"score": "0.75384915",
"text": "def find_weights(node_name,node_hash)\n node = node_hash[node_name]\n if(node[\"children\"])\n node[\"total_weight\"] = node[\"weight\"] + node[\"children\"].map{|c| find_weights(c,node_hash)}.inject(:+)\n else\n node[\"total_weight\"] = node[\"weight\"]\n end\n node[\"total_weight\"]\nend",
"title": ""
},
{
"docid": "b11edcc3e5bc591bb7ef2710c1a22d7a",
"score": "0.6458311",
"text": "def calc_total_weight\n @weight + @node_link.calc_total_weight\n end",
"title": ""
},
{
"docid": "1a862f66d8d62e52aa20d66e623e1edb",
"score": "0.6357156",
"text": "def weight\n @parents.inject(1) { |res, p| res + p.weight * @parent_multiplier }\n end",
"title": ""
},
{
"docid": "363e9a8840f4931774de9f408be6fa22",
"score": "0.632421",
"text": "def hash\n @children.hash\n end",
"title": ""
},
{
"docid": "ee7695c72b8682b429dda50ff5b9cb9b",
"score": "0.6294059",
"text": "def total_weight\n line_items.map(&:weight).sum\n end",
"title": ""
},
{
"docid": "0d90325dff70fd84bfc6bb3fc721bdfb",
"score": "0.62505573",
"text": "def hash\n return super unless has_size?\n\n res = 0\n each do |el|\n res += el.hash\n end\n return res\n end",
"title": ""
},
{
"docid": "28bf349e4da3df8e9a24da078a8fd896",
"score": "0.6217615",
"text": "def total_siblings \n instructors_hash.sum do |instructors_hash|\n instructors_hash[:siblings]\n end \nend",
"title": ""
},
{
"docid": "263bb23682125eb4ff1e2780af4663db",
"score": "0.60923374",
"text": "def hash\n @node.sort.push(@edge).hash\n end",
"title": ""
},
{
"docid": "ee11690b765280787caad6e12638c200",
"score": "0.60351855",
"text": "def total_bags_inside\n children.size + children.map(&:total_bags_inside).sum\n end",
"title": ""
},
{
"docid": "ba803d087bd9fe8b0d18bf392cfad890",
"score": "0.6033511",
"text": "def passing_rushing_penalty_children(hash, xml)\n %w(passing rushing penalty).each do |stat|\n hash[stat.to_sym] = xml.xpath(stat).first.children.first.text.to_i\n end\n end",
"title": ""
},
{
"docid": "f85d7297e102f44b7e8ed3c0bdb4f3bc",
"score": "0.6014451",
"text": "def calc_total_weight\n 0\n end",
"title": ""
},
{
"docid": "8e85063059bf2b7665feddb368a222d1",
"score": "0.5990922",
"text": "def calculate_weight\n update_attribute :weight, votes.sum(:value)\n weight\n end",
"title": ""
},
{
"docid": "1fead39adf786c4706c19301238ea4e2",
"score": "0.59885293",
"text": "def sum_aggregation( node, normalized )\n aggregation = Hash.new\n normalized.keys.each do |entity|\n sum = 0\n node['children'].each do |child|\n entity_hash = normalized[entity]\n if entity_hash.nil?\n entity_hash = Hash.new\n end\n sum += entity_hash[child['id']]\n end\n aggregation[entity] = sum\n end\n aggregation\n end",
"title": ""
},
{
"docid": "753573a2fd0f7e967d38e94259de1a6a",
"score": "0.5988251",
"text": "def resources_cost_from_children\n\t\tif !has_children?\n\t\t\tresources_cost\n\t\telse\n\t\t\tsuma = 0\n\t\t\tchildren.each do |c|\n\t\t\t\tsuma += c.resources_cost_from_children\n\t\t\tend\n\n\t\t\treturn suma \n\t\tend\n\tend",
"title": ""
},
{
"docid": "dfb2dc6d49fbb05aa40edc6e32440830",
"score": "0.5956956",
"text": "def roothash\n root_node._hash || recalculate_hash_at(root_node)\n end",
"title": ""
},
{
"docid": "237863cca17ce12fae4c42602216687a",
"score": "0.5937876",
"text": "def total_weight\n order_items.collect { |oi| oi.weight }.inject { |sum, x| sum + x } || 0\n end",
"title": ""
},
{
"docid": "469f49156dbe937af37681138cc2a989",
"score": "0.59304166",
"text": "def getNodeWeights()\n # (two possible sources: flipped and negated, so \n # add them for each node)\n \n tabRead(@edges){|arr|\n ordered = [arr[0],arr[2]].sort\n @allEdgeWeightScores[ordered.join(\"--\")] += arr[3].to_f\n @nodeList[arr[0]] = 1\n @nodeList[arr[2]] = 1\n }\nend",
"title": ""
},
{
"docid": "2cc3fba361c5e874ac640c2d5c2bc3af",
"score": "0.5922915",
"text": "def calcular_total hash\n p hash.inject(0) { |sum, tuple| sum += tuple[1] }\n end",
"title": ""
},
{
"docid": "34c40f2a076ab7b7e6b20c02fdaa3aca",
"score": "0.590151",
"text": "def tree_hash\n serializable_hash.merge(children: children.map(&:serializable_hash))\n end",
"title": ""
},
{
"docid": "34c40f2a076ab7b7e6b20c02fdaa3aca",
"score": "0.590151",
"text": "def tree_hash\n serializable_hash.merge(children: children.map(&:serializable_hash))\n end",
"title": ""
},
{
"docid": "e335f2ed39181595c3eb18c006d7a446",
"score": "0.58977896",
"text": "def calculate_frequencies\n order_attributes(true)\n build_tree\n end",
"title": ""
},
{
"docid": "e9a1ff00376866ebfaee6d59f6eb9a09",
"score": "0.58636904",
"text": "def total_weight\n order_items.inject(BigDecimal(0)) { |t,i| t + i.total_weight}\n end",
"title": ""
},
{
"docid": "995190f58757cb0490beabe34ef55c99",
"score": "0.58608377",
"text": "def total_child_count\n count = 0\n self.apply_to_children { |e| count += 1 }\n count\n end",
"title": ""
},
{
"docid": "ec098308f80e646c8c951af900cc5c14",
"score": "0.5856282",
"text": "def count_child_nodes(hash = self)\n count = 0\n walk_tree(hash) do\n count += 1\n end\n count\n end",
"title": ""
},
{
"docid": "0b0ac2177fcae66f57441cfd95d31a96",
"score": "0.58416307",
"text": "def compute_weight object\n object.line_items.map { |li| (li.variant.weight || 0) * li.quantity }.sum\n end",
"title": ""
},
{
"docid": "e5ee756468b394cc87ed2b55b167626c",
"score": "0.5823959",
"text": "def recalculate(inode)\n full_count = 0\n inode.list_of_children.each do |node|\n#p node\n komvos = self.get(node)\n#p komvos\n if komvos.normalize==0\n puts \"node #{node} is not leaf\"\n # if not leaf\n #recalc(holon.searchFor(node).listOfChildren)\n self.recalculate(komvos)\n else \n # exw kanei: node.normalize kai einai leaf\n puts \"node #{node} is leaf\"\n \n end\n # uplogizw to sum of coun and re-normalize\n full_count = full_count + komvos.weight\n end\n inode.weight = full_count\n end",
"title": ""
},
{
"docid": "152e077e8b9107cdc9851881ec84335b",
"score": "0.58075804",
"text": "def height\n height_recursive(@root)\n end",
"title": ""
},
{
"docid": "f0ec2ea69396a16c7c580dc726abb3cf",
"score": "0.5798519",
"text": "def nodeCount\n count = 1\n\n if @children.size\n @children.each do |key, val|\n count += val.nodeCount\n end\n end\n\n count\n end",
"title": ""
},
{
"docid": "ea33c96b7b7a031b442c44af855a9352",
"score": "0.5795518",
"text": "def weight_of_items_in_bays(hash,bay_array)\n weight = 0\n for bay in bay_array\n weight += hash[bay][:weight]\n end\n\n return weight\n\nend",
"title": ""
},
{
"docid": "96de31a6b87d09d05d7d0002153bd24e",
"score": "0.5792213",
"text": "def path_weight_to(other)\n shortest_path_to(other,:method => :djikstra).map{|edge| edge.weight.to_f}.sum\n end",
"title": ""
},
{
"docid": "37fa9ca6d8015f6fabc8cfc56f36ee6a",
"score": "0.57764566",
"text": "def children(target, rules)\n rule = rules[target]\n return 1 if rule.empty?\n\n sum = 1\n rule.each do |k, v|\n child_count = children(k, rules)\n sum += v * child_count\n end\n sum\nend",
"title": ""
},
{
"docid": "0ade622648e6e9d13cddbc719d74f97b",
"score": "0.5771853",
"text": "def sum_children(records, parent, total = 0)\n return 0 if records[parent].nil?\n\n records[parent].each do |child, how_many|\n total += how_many\n total += how_many * sum_children(records, child)\n end\n total\nend",
"title": ""
},
{
"docid": "699b2d8cc5cee426234aef8c0ac0e54c",
"score": "0.5749587",
"text": "def root_hash\n self.node_hash root_node_id\n end",
"title": ""
},
{
"docid": "d63c197af2bc555df26937f1a72b6fbb",
"score": "0.5749548",
"text": "def computed_values\n unless defined?(@computed_values) && @computed_values\n # Do nothing if all weights are 1, as n * 1 is n\n @computed_values = hashes if weights.all? {|weight| weight == 1 }\n # Otherwise, multiply the values in each hash by that hash's weighting\n @computed_values ||= hashes.each_with_index.map do |hash, index|\n weight = weights[index]\n Hash[hash.map {|k, v| [k, (v * weight)]}]\n end\n end\n @computed_values\n end",
"title": ""
},
{
"docid": "9afb7d1f0c8f098116ea304371e1651a",
"score": "0.57009166",
"text": "def checksum\n @checksum ||= begin\n if empty?\n EMPTY_CHECKSUM\n else\n ::Digest::MD5.hexdigest(children.map(&:checksum).join)\n end\n end.to_s\n end",
"title": ""
},
{
"docid": "40dc00fd055239f38873bd2a2beaa0e1",
"score": "0.56918067",
"text": "def total_weight\r\n\t\t@items.inject(0.0) { |sum, i| sum + i.total_unit_weight * i.quantity }\r\n\tend",
"title": ""
},
{
"docid": "03889a51c962574523322e357c38d035",
"score": "0.5687217",
"text": "def weight\n order_lines.inject(0) { |sum, l| sum + l.weight }\n end",
"title": ""
},
{
"docid": "f0b44237e10f8dae8cf7934053856e18",
"score": "0.56792045",
"text": "def hash\n size.hash ^ rank.hash\n end",
"title": ""
},
{
"docid": "768215a955ece10a8e7d42a974dda4dd",
"score": "0.5646766",
"text": "def hash\n [self.class.name, children.map { |el| el.hash }].hash\n end",
"title": ""
},
{
"docid": "b68a858d0a87239931064fadb9ed5317",
"score": "0.5645883",
"text": "def weight\n sides.map(&:weight).reduce(&:+)\n end",
"title": ""
},
{
"docid": "17c57e8dee004972d1be47875b453813",
"score": "0.56340224",
"text": "def query_all_weight\n d = 0 \n eqs = query_all_wearings\n p \"=>wearing=#{eqs.inspect}\"\n eqs.each {|k,v|\n d+= v.weight if v\n }\n return d\n end",
"title": ""
},
{
"docid": "9e7a84089ece56f1b507d986890fb3bd",
"score": "0.5630045",
"text": "def height\n return @tree_height\n end",
"title": ""
},
{
"docid": "3d812dac91c5f057821c748ffe4eeea5",
"score": "0.56086195",
"text": "def weight\n self.ingredients.map{|i| i.quantity}.reduce(:+)\n end",
"title": ""
},
{
"docid": "996d906b073109bcfe280478d5df6f28",
"score": "0.56073654",
"text": "def node_hash(node_id)\n \n end",
"title": ""
},
{
"docid": "0f3828c7e4ee7308b2b7aa973c4a5b88",
"score": "0.5604856",
"text": "def actual_amount\n children.length\n end",
"title": ""
},
{
"docid": "a0448d89e708a1d4c094649523e9436d",
"score": "0.56047684",
"text": "def path_sum(root, target)\n return 0 unless root\n\n path_sum_helper(root, target, 0, Hash.new(0))\nend",
"title": ""
},
{
"docid": "744b0fc6f5dde7b496643001b126fe22",
"score": "0.559885",
"text": "def total_students(hash)\n\ttotal = 0\n\thash.each { |key, value| total += value }\n\treturn total\nend",
"title": ""
},
{
"docid": "2b247f9757cd1d2413c7c0d55f49f613",
"score": "0.5595088",
"text": "def weight_results(results)\n weights = Hash.new { |hash, key| hash[key] = 0 }\n\n results.each do |set|\n set.each do |item|\n weights[item.name] += item.hits\n end\n end\n\n weights\n end",
"title": ""
},
{
"docid": "95db14e2f043d2dc5482bac59a6a01a3",
"score": "0.5589341",
"text": "def git_checksum_hash(tree, prefix=nil)\n\n tree.contents.each do |obj|\n if obj.class == Grit::Blob\n item = [prefix, obj.name].join\n @currenthash[item] = Digest::MD5.hexdigest(obj.data)\n #puts \"#{item} : \" + @currenthash[item]\n else\n git_checksum_hash(obj, [prefix, obj.name, \"/\"].join)\n end\n end\n\n return @currenthash\n end",
"title": ""
},
{
"docid": "12d95524c5210648a6ccc0124a827cba",
"score": "0.5580817",
"text": "def weight\n return data.weight\n end",
"title": ""
},
{
"docid": "5acdf7352da6ea6bdd150a6c916ab93c",
"score": "0.5565012",
"text": "def total_votes\n votes.sum(:weight)\n end",
"title": ""
},
{
"docid": "0138d26b46bf471b4bc503d1980632a1",
"score": "0.55641615",
"text": "def sum_root_to_leaf_paths(tree)\n stack = [tree]\n result = []\n hash = Hash.new\n\n until stack.empty?\n node = stack.pop\n\n if !node.left && !node.right\n pointer = node\n array = [node.val]\n until !hash[pointer]\n array.unshift(hash[pointer].val) \n pointer = hash[pointer]\n end\n result << array\n end\n\n if node.right\n stack.push(node.right) \n hash[node.right] = node\n end\n if node.left\n stack.push(node.left)\n hash[node.left] = node\n end\n end\n\n return result.map { |i| i.join.to_i(2) }.reduce(:+)\nend",
"title": ""
},
{
"docid": "2b231c78b5fe2340b541899c85736562",
"score": "0.5559415",
"text": "def get_nodes\n @weights.keys\n end",
"title": ""
},
{
"docid": "c3c927ac4a0773588715ea676de9285d",
"score": "0.5541409",
"text": "def keying_children\n return children.inject( 0 ) do |product, value|\n product += 1 if value.try( :device ).try( :keying? )\n product\n end\n end",
"title": ""
},
{
"docid": "e588d675794982c1e07d91cda2858653",
"score": "0.55385566",
"text": "def correct_node_hash(node_id)\n SpStore::Crypto.hash_for_tree_node node_id, node_hash(left_child(node_id)),\n node_hash(right_child(node_id))\n end",
"title": ""
},
{
"docid": "b70d4fe5ecfd77515492bafc4bbb249a",
"score": "0.5535059",
"text": "def compute_weights\n\t\t@weight = Hash.new\n\t\t\n\t\t@terms.each do |term|\n\t\t\t@doc_list.values.each do |doc|\n\t\t\t\tvalue = doc.freq_rel(term) * @idf[term]\n\t\t\t\t@weight[[term,doc]] = value\n\n\t\t\t\tassert { value >= 0 }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "865fdccfabe07e37d3831e18999e5af5",
"score": "0.55221844",
"text": "def compute_weights\n @weight = Hash.new\n \n @terms.each do |term|\n @doc_list.values.each do |doc|\n value = doc.freq_rel(term) * @idf[term]\n @weight[[term,doc]] = value\n\n assert { value >= 0 }\n end\n end\n end",
"title": ""
},
{
"docid": "c1f81d88f1495a2f48af8e8b00fe4d4b",
"score": "0.55146646",
"text": "def touchdowns_hash(stats_xml)\n { number: stats_xml[:number].to_i }.merge(children_first_text_hash(stats_xml))\n end",
"title": ""
},
{
"docid": "c8cf2f925582c2f26f98953417a03db3",
"score": "0.5496322",
"text": "def weightedsum\n ws = 0\n @inputs.each_index { |i| ws = ws + @inputs[i]*@weights[i] }\n ws\n end",
"title": ""
},
{
"docid": "12a7c8f737507d88e4f2719da011d574",
"score": "0.54924583",
"text": "def hashrate\n 7158278.826666666 * shares.fresh.count\n end",
"title": ""
},
{
"docid": "b1b20c1dee7d8e4d6f240e2cf837d10c",
"score": "0.5491404",
"text": "def weighted_sum\n index = 0\n sum = 0\n\n while index < id_digits.size\n sum += id_digits[index] * CHARACTER_WEIGHTS[index]\n index += 1\n end\n\n sum\n end",
"title": ""
},
{
"docid": "b1b2ea9f0f4095991c8e5bf3ecb02bbb",
"score": "0.5478395",
"text": "def recipes(nodes)\n nodes.inject({}) do |memo, node|\n node.recipes.each do |recipe|\n memo[recipe.to_s] ||= 0\n memo[recipe.to_s] += 1\n end\n\n memo\n end\n end",
"title": ""
},
{
"docid": "964194fc3400c6a1c6ca4c093c5b18e6",
"score": "0.54573166",
"text": "def count_num_trees_supp(num_keys)\n return 1 if num_keys <= 1\n sum_total = 0\n (1..num_keys).each do |val|\n sum = 0\n left_count = count_num_trees_supp(val - 1)\n right_count = count_num_trees_supp(num_keys - val)\n sum += left_count * right_count\n sum_total += sum\n end\n sum_total\n end",
"title": ""
},
{
"docid": "7c535b0ea1a9b522ec52a519daef066b",
"score": "0.5449989",
"text": "def get_total_weight(line_items)\n line_items.map do |li|\n # use default item weight if the weight is not defined for a product\n item_weight = li.variant.weight.nil? ? self.preferred_default_item_weight : li.variant.weight\n item_weight * li.quantity\n end.sum\n end",
"title": ""
},
{
"docid": "7c535b0ea1a9b522ec52a519daef066b",
"score": "0.5449989",
"text": "def get_total_weight(line_items)\n line_items.map do |li|\n # use default item weight if the weight is not defined for a product\n item_weight = li.variant.weight.nil? ? self.preferred_default_item_weight : li.variant.weight\n item_weight * li.quantity\n end.sum\n end",
"title": ""
},
{
"docid": "d7f1a8c787d25c86ee57feffac43dc18",
"score": "0.5448842",
"text": "def hash\n node_id.hash\n end",
"title": ""
},
{
"docid": "f0f2acdb94368628545721715d25ad7d",
"score": "0.5448286",
"text": "def build_weight_array(nodes)\n weight_array = []\n gcd = nodes.map {|n| n.weight }.inject(0) {|r,w| r.gcd(w) }\n nodes.each {|n|\n (n.weight / gcd).times {\n weight_array << n\n }\n }\n weight_array\n end",
"title": ""
},
{
"docid": "e73de95d8d67205998a86c207ec468a9",
"score": "0.544244",
"text": "def compute_tree_children_frequencies(result_frequencies)\n result_frequencies.add_up(@frequencies)\n\n @tree_children.each do |child_cluster|\n child_cluster.compute_tree_children_frequencies(result_frequencies)\n end\n end",
"title": ""
},
{
"docid": "8fe4fd22715a1e6091a3b04d4cf101a4",
"score": "0.5441866",
"text": "def weights\n return @weights if @weights\n return @weights = [] if array.empty?\n\n lo = edges.first\n step = edges[1] - edges[0]\n\n max_index = ((@max - lo) / step).floor\n @weights = Array.new(max_index + 1, 0)\n\n array.each do |x|\n index = ((x - lo) / step).floor\n @weights[index] += 1\n end\n\n return @weights\n end",
"title": ""
},
{
"docid": "62e0723a61b94a64e3f4faa6c27ac16c",
"score": "0.54377925",
"text": "def entry_hash\n entries.map{ |entry| entry.routing_number.to_i / 10 }.compact.inject(&:+)\n end",
"title": ""
},
{
"docid": "b593ab5357a5ed4deec8f6d647d59b28",
"score": "0.54369533",
"text": "def hash\n -element.hash\n end",
"title": ""
},
{
"docid": "4a3bf3e781ba9ffb5c5bccb7afdfb851",
"score": "0.54365283",
"text": "def children_size\n leaf? ? 0 : children.map(&:size).reduce(:+)\n end",
"title": ""
},
{
"docid": "3c3cf32d3d8944ad78a0aae0f41e0de9",
"score": "0.54358727",
"text": "def recalculate_hash_at(node)\n return node._hash = node.value if node.value\n recalculate_hash_at(node.left) if node.left\n recalculate_hash_at(node.right) if node.right\n node._hash = self.class.hash_children(*node_subhashes(node))\n end",
"title": ""
},
{
"docid": "72bb83317b2b3948192d650ee2931c6a",
"score": "0.5431716",
"text": "def total_price\n # convert to array so it doesn't try to do sum on database directly\n items.to_a.select{|item|item.parent_id.nil?}.sum(&:full_price)\n end",
"title": ""
},
{
"docid": "3dce69d8aad5bb5e97539dbeb6598e53",
"score": "0.54141694",
"text": "def total_payout\n # calculate children payout\n count = 0\n self.children.each do |child|\n count = count + child.total_payout\n end\n \n # calculate payout of this ativity\n if self.state == COMPLETE\n return count + self.reward\n elsif self.state == EXPIRED\n return count - self.penalty\n else \n return count\n end\n\n end",
"title": ""
},
{
"docid": "e819cf386e3852ad361c53c3b13f8014",
"score": "0.541318",
"text": "def hash\n @elements.hash\n end",
"title": ""
},
{
"docid": "e819cf386e3852ad361c53c3b13f8014",
"score": "0.541318",
"text": "def hash\n @elements.hash\n end",
"title": ""
},
{
"docid": "ab76a39d0721ae67715555159a0a40b1",
"score": "0.54123724",
"text": "def child_hash\n if !@child_hash\n @child_hash = {}\n self.children.each do |i|\n @child_hash[i.name] = i\n end\n end\n\n @child_hash\n end",
"title": ""
},
{
"docid": "78e0fa25227cb54fedee25c3c91a686e",
"score": "0.5411367",
"text": "def hash\n shasum.hash\n end",
"title": ""
},
{
"docid": "78e0fa25227cb54fedee25c3c91a686e",
"score": "0.5411367",
"text": "def hash\n shasum.hash\n end",
"title": ""
},
{
"docid": "78e0fa25227cb54fedee25c3c91a686e",
"score": "0.5411367",
"text": "def hash\n shasum.hash\n end",
"title": ""
},
{
"docid": "c895f4df2b6dd9f8b2c1d788331cba89",
"score": "0.54106003",
"text": "def size_of_children(arr)\n children_count = arr[0]\n metadata_count = arr[1]\n\n if children_count == 0\n # the value is simply the sum of child nodes\n value = arr[2..(metadata_count+1)].sum\n $metadata_total += value\n return {size: (2 + metadata_count), value: value}\n elsif children_count >= 1\n total_children_size = 0\n\n child_nodes_values = [ nil ] # we need a dummy item at index 0\n\n children_count.times do |index|\n kiddo_report = size_of_children(arr[2+total_children_size..-1])\n total_children_size += kiddo_report[:size]\n child_nodes_values << kiddo_report[:value]\n end\n\n metadata_nodes = arr[(2 + total_children_size)..(1 + total_children_size + metadata_count)]\n $metadata_total += metadata_nodes.sum\n\n # Value is more complicated when the node has child nodes. Value is the sum\n # of the values of child nodes referred to, but we have to be careful since\n # arrays are 0-indexed and references to child nodes are 1-indexed. If the\n # child node doesn't actually exist, the value is 0.\n total_value = 0\n metadata_nodes.each do |node|\n total_value += child_nodes_values.fetch(node, 0)\n end\n\n return {size: (2 + total_children_size + metadata_count), value: total_value}\n end\nend",
"title": ""
},
{
"docid": "0d67dfcf870df3c53b140f4ad5094139",
"score": "0.54078895",
"text": "def all_structural_subhashes\n hashes = []\n self.deep_each do |node|\n hashes << node.structural_hash\n end\n hashes\n end",
"title": ""
},
{
"docid": "9025ba2b18a3f17e34970a9740db3452",
"score": "0.5401394",
"text": "def bins\n Set.new @tree.values\n end",
"title": ""
},
{
"docid": "c7cce6d07a22bb5b8169895e29618f7f",
"score": "0.53944224",
"text": "def vote\n vote = 0\n self.children.each { |c|\n vote = vote + c.vote\n }\n if self.children.size > 0\n (vote / self.children.size)\n else\n vote\n end\n end",
"title": ""
},
{
"docid": "7cc7e07074789be34261146a6f16880d",
"score": "0.5393884",
"text": "def to_tree_hash\n TreeHash.new(self)\n end",
"title": ""
},
{
"docid": "4ebda9805ce68dd050496bbcef14dc5e",
"score": "0.53868693",
"text": "def to_hash\n root.to_hash\n end",
"title": ""
},
{
"docid": "48faedf28b4c6ea695a7a806baf25120",
"score": "0.5386506",
"text": "def divide_aggregation( node, normalized )\n aggregation = Hash.new\n normalized.keys.each do |entity|\n quotient = 0\n node['children'].each do |child|\n entity_hash = normalized[entity]\n if entity_hash.nil?\n entity_hash = Hash.new\n end\n if quotient == 0\n quotient = entity_hash[child['id']]\n else\n quotient = ( quotient / entity_hash[child['id']] )\n end\n end\n aggregation[entity] = quotient\n end\n aggregation\n end",
"title": ""
},
{
"docid": "ad2eff791d5093d9677dc1192e95b25e",
"score": "0.53840494",
"text": "def first_down_hash(stats_xml)\n first_downs = Hash.new\n first_downs[:total] = stats_xml[:total].to_i\n passing_rushing_penalty_children(first_downs, stats_xml)\n first_downs\n end",
"title": ""
},
{
"docid": "2ab3d519939604e93d762b21517e6328",
"score": "0.5382331",
"text": "def total\n object.nodes.size\n end",
"title": ""
},
{
"docid": "ae226e7b26dff314c6d5e3978cfc3468",
"score": "0.5363176",
"text": "def get_total_weight(line_items)\n line_items.map do |li|\n # use default item weight if the weight is not defined for a product\n item_weight = li.variant.weight.nil? ? self.preferred_default_item_weight : li.variant.weight\n item_weight * li.quantity\n end.sum\n end",
"title": ""
},
{
"docid": "ba74a703a2d71881a631e01b00a5b3c8",
"score": "0.5362992",
"text": "def compute_checksums data\n\n digest = OpenSSL::Digest::Digest.new('sha256')\n tree_digest = OpenSSL::Digest::Digest.new('sha256')\n tree_parts = []\n\n until data.eof?\n\n chunk = data.read(1024 * 1024) # read 1MB\n tree_parts << tree_digest.update(chunk).digest\n tree_digest.reset\n\n digest.update(chunk)\n\n end\n\n data.rewind\n\n [digest.to_s, compute_tree_hash(tree_parts)]\n\n end",
"title": ""
},
{
"docid": "69788f084679a3f58b96f8ad2ed9f7b4",
"score": "0.5362562",
"text": "def punts_hash(stats_xml)\n {\n number: stats_xml[:number].to_i,\n average: stats_xml[:avg].to_f,\n net_average: stats_xml[:net_avg].to_f,\n blocked: stats_xml[:blk].to_i\n }\n end",
"title": ""
},
{
"docid": "2cbda37fc3a264e9cc6a4c80957ca2cd",
"score": "0.5357587",
"text": "def hash_sum\n total = 0\n places_hash.each do |k, v|\n total = total + v\n end\n return total\nend",
"title": ""
},
{
"docid": "a1f34228f6bc7303019d2ede91b31479",
"score": "0.5357446",
"text": "def total_score\n rank_items.to_a.sum { |item| item.rank_score * item.weight }\n end",
"title": ""
},
{
"docid": "b16f122d593ba57218ec73c47f029d86",
"score": "0.53536475",
"text": "def hash\n @points.inject(0) { |sum, point| sum += point.x + point.y }\n end",
"title": ""
},
{
"docid": "ce4423e18fa379f0d878011b77c480c6",
"score": "0.5352866",
"text": "def to_hash\n size.map &:to_hash\n end",
"title": ""
},
{
"docid": "06ab739ad5e9163766c1b2f5326cc899",
"score": "0.5350978",
"text": "def hash(p)\n\t\tp.map{|x| (x/@grid_size).round.to_i}\n\tend",
"title": ""
},
{
"docid": "2fe66cff14fdabeab11d6f696606a539",
"score": "0.5347594",
"text": "def hash; map{|el| \"#{el.name} @ #{el.hash}\"}; map(&:hash).reduce(:+) % 2**32; end",
"title": ""
},
{
"docid": "05f18220acf59bedcc68f5d0e736fd74",
"score": "0.534538",
"text": "def calc_total_weight_to_s\n calc_total_weight.to_s\n end",
"title": ""
}
] |
5ee6c56ab5d9f632d6a09a620137257b
|
DELETE /trips/1 DELETE /trips/1.json
|
[
{
"docid": "626c8b4bf4f2a92524676ed8fa2f7118",
"score": "0.6761795",
"text": "def destroy\n @trip.destroy\n redirect_to trips_path\n end",
"title": ""
}
] |
[
{
"docid": "8d7974daec8f84834884a9982cfda923",
"score": "0.76655746",
"text": "def destroy\n @trip.destroy\n\n respond_to do |format|\n format.any(:trips_json, :json) do\n head :no_content\n end\n end\n end",
"title": ""
},
{
"docid": "450279cf721c70c6ebca8f222d47868b",
"score": "0.7400051",
"text": "def destroy\n @trip = current_user.trips.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d2581c6fb7fbb60d6910e6bcc6674233",
"score": "0.73837495",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "77c6d995d47726907fa130dfac5e04da",
"score": "0.738152",
"text": "def destroy\n #@trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0684e5379543662626082716442caf7",
"score": "0.7373286",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0684e5379543662626082716442caf7",
"score": "0.7373286",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0684e5379543662626082716442caf7",
"score": "0.7373286",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0684e5379543662626082716442caf7",
"score": "0.7373286",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0684e5379543662626082716442caf7",
"score": "0.7373286",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0684e5379543662626082716442caf7",
"score": "0.7373286",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0684e5379543662626082716442caf7",
"score": "0.7373286",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0684e5379543662626082716442caf7",
"score": "0.7373286",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0684e5379543662626082716442caf7",
"score": "0.7373286",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "90355cc305c871b6e555b1bc375aa21c",
"score": "0.7278191",
"text": "def destroy\n # Logic to delete a record\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6024cc51bd9dee73e421e89e8e1bc642",
"score": "0.7273358",
"text": "def destroy\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7f23dbc550856bc5dd4c866d50d959a8",
"score": "0.72525823",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7f23dbc550856bc5dd4c866d50d959a8",
"score": "0.72525823",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7f23dbc550856bc5dd4c866d50d959a8",
"score": "0.72525823",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7f23dbc550856bc5dd4c866d50d959a8",
"score": "0.72525823",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7f23dbc550856bc5dd4c866d50d959a8",
"score": "0.72525823",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3935d09e48ca8261442f6718568cf0b8",
"score": "0.7216965",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "723c777ee787d79a6fa4a54949d5e272",
"score": "0.7202632",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to tripes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e8dd60ea7572b01a08d9abf1f6c78d1b",
"score": "0.7190258",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(trips_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e8dd60ea7572b01a08d9abf1f6c78d1b",
"score": "0.7190258",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(trips_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e8dd60ea7572b01a08d9abf1f6c78d1b",
"score": "0.7190258",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(trips_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e8dd60ea7572b01a08d9abf1f6c78d1b",
"score": "0.7190258",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(trips_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e8dd60ea7572b01a08d9abf1f6c78d1b",
"score": "0.7190258",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(trips_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e8dd60ea7572b01a08d9abf1f6c78d1b",
"score": "0.7190258",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(trips_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "96fed386a6a7d1a8d883c58d821351d4",
"score": "0.7158076",
"text": "def destroy\n\t @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n\t end\n end",
"title": ""
},
{
"docid": "ff11ced3f1a22da9695211148db88f9d",
"score": "0.7105237",
"text": "def destroy\n @title = \"Destroy Trip\"\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(trips_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "854e4f825af64046ca24daa6e51a3417",
"score": "0.70713186",
"text": "def destroy\n \t@trip = Trip.find(params[:id])\n\t# tid es la posicion borrada\n \ttid = @trip.trip_id\n \t@trip.destroy\n \t@trips = Trip.find(:all, :order => 'trip_id')\n\n \t@trips.each do |trip|\n \t\tif trip.trip_id > tid\n\t\t\ttrip.trip_id = trip.trip_id - 1\n\t\t\ttrip.save\n\t\tend\n\tend\n\n\trespond_to do |format|\n\t\tformat.html { redirect_to trips_url }\n\t\tformat.json { head :ok }\n\tend\n end",
"title": ""
},
{
"docid": "8f78172ec50cf7871e96c268e33e2b4b",
"score": "0.70696664",
"text": "def destroy\n @tripitem.destroy\n respond_to do |format|\n format.html { redirect_to tripitems_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4bf21b43f273aef7838a3b74773e9dc9",
"score": "0.70120317",
"text": "def destroy\n @roundtrip = Roundtrip.find(params[:id])\n @roundtrip.destroy\n\n respond_to do |format|\n format.html { redirect_to(roundtrips_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "21beec06cfb7f85b58681b4cab0e3f69",
"score": "0.70119256",
"text": "def destroy\n @trip_request = TripRequest.find(params[:id])\n @trip_request.destroy\n\n respond_to do |format|\n format.html { redirect_to trip_requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4c8dc05bcb8786eaae867e94087bfb7e",
"score": "0.69743794",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Registro eliminado satisfactoriamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "53c89eee6ac60e73a07de306a4e409f6",
"score": "0.6931336",
"text": "def destroy\n @otto_view_raw_trip = OttoViewRawTrip.find(params[:id])\n @otto_view_raw_trip.destroy\n\n respond_to do |format|\n format.html { redirect_to otto_view_raw_trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1b94a689acbcb2ac01b780cd0f35bd4a",
"score": "0.69220966",
"text": "def destroy\n @shopping_trip = ShoppingTrip.find(params[:id])\n @shopping_trip.destroy\n\n respond_to do |format|\n format.html { redirect_to shopping_trips_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "86c97a87423d508d6a6d957c504c51f3",
"score": "0.6914486",
"text": "def destroy\n @trip = Trip.where(id: params[:id], driver_id: params[:user_id]).first\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "adae940ba8278ff3ea23e49038c22dfe",
"score": "0.69105923",
"text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(root_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.6893534",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "ea9ac6aff05200f6a9a152de8561c9db",
"score": "0.6885071",
"text": "def destroy\n @one_way_trip = OneWayTrip.find(params[:id])\n @one_way_trip.destroy\n respond_with(@one_way_trip)\n end",
"title": ""
},
{
"docid": "8fb3d72a4b4bb2ca129d04120843f8f1",
"score": "0.68833864",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_path, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "93e866dae67b4a333a34ac97455d0f04",
"score": "0.68708163",
"text": "def destroy\n trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.686541",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3178836eb8e999ef69e0014ed8a133b6",
"score": "0.6864886",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c1e92780b615172bca9d4264e5c9817d",
"score": "0.68585706",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: \"Trip was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cfe5768e09343a6100e6e7e8c71eb2ee",
"score": "0.685645",
"text": "def destroy\n @fieldtrip = Fieldtrip.find(params[:id])\n @fieldtrip.destroy\n\n respond_to do |format|\n format.html { redirect_to fieldtrips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "89b2709e978f3b70b32ef13ee3d8c974",
"score": "0.6835166",
"text": "def destroy\n @reservation_trip = ReservationTrip.find(params[:id])\n @reservation_trip.destroy\n\n respond_to do |format|\n format.html { redirect_to reservation_trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d55ba8ffa70a0288c5021489dab5f898",
"score": "0.67939234",
"text": "def destroy\n @user = User.find(params[:user_id])\n @tour = @user.tours.find(params[:tour_id])\n @trip = @tour.trips.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to user_tour_trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3ac68c8b201edcbb97a123b1648de1c6",
"score": "0.67896914",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to @trip, notice: 'Trip was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "71527e19497c2ca7f9ce1ccdc8cda17b",
"score": "0.6789017",
"text": "def destroy\n @trip = Trip.find(params[:id])\n river_id = @trip.river_id #MH 4/17/13 - save river id before trip gets deleted and we can no longer access it \n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to river_trips_path(river_id) }\n format.json { head :no_content }\n end \n\n end",
"title": ""
},
{
"docid": "71527e19497c2ca7f9ce1ccdc8cda17b",
"score": "0.6789017",
"text": "def destroy\n @trip = Trip.find(params[:id])\n river_id = @trip.river_id #MH 4/17/13 - save river id before trip gets deleted and we can no longer access it \n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to river_trips_path(river_id) }\n format.json { head :no_content }\n end \n\n end",
"title": ""
},
{
"docid": "9d5deb39fc3d12d39615ed015853729e",
"score": "0.6765807",
"text": "def destroy\n @trip_type = TripType.find(params[:id])\n @trip_type.destroy\n\n respond_to do |format|\n format.html { redirect_to trip_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.67307734",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "9106867cee9e8775ba817195d3bc2020",
"score": "0.67153156",
"text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end",
"title": ""
},
{
"docid": "ba67ebd85114998e01be10599c8943ca",
"score": "0.6714004",
"text": "def delete(path)\n RestClient.delete request_base+path\n end",
"title": ""
},
{
"docid": "8d4c84e8e9d69a3739548e055a5b1cb7",
"score": "0.66988415",
"text": "def destroy\n @intended_trip = IntendedTrip.get(params[:id])\n raise unless @intended_trip.user == current_user\n @intended_trip.destroy\n\n respond_to do |format|\n format.html { redirect_to intended_trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "760af6f23c81a17d6027ce9452fc07c4",
"score": "0.6694613",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n flash[:success] = \"Trip was successfully destroyed.\"\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a36b540e88e25c3de988eef8cff33cc5",
"score": "0.66791505",
"text": "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url\n\t\t\t\t\tflash[:info] = 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3dd4ec60e94efa182001c5dab5cefb39",
"score": "0.66723925",
"text": "def delete_rest(db, id)\r\n\tdb.execute(\"DELETE FROM restaurants WHERE id=?\",[id])\r\nend",
"title": ""
},
{
"docid": "f73331e0d4518cdd4f829e7a54641c4c",
"score": "0.66585654",
"text": "def destroy\n @trip = Trip.find(params[:id])\n\n if @trip.destroy\n @trips = current_user.trips.includes(:home)\n render :index\n else\n render json: @trip.errors.full_messages, status: 404\n end\n end",
"title": ""
},
{
"docid": "69aad11b372d5c3797b2a13d74196bc8",
"score": "0.6615775",
"text": "def destroy\n @trip = Trip.find(params[:trip_id].to_i)\n @expense.destroy\n respond_to do |format|\n format.html { redirect_to @trip, notice: 'Expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "023e7e46d1c99bd2e2ffa557cf8ff0c3",
"score": "0.66060364",
"text": "def destroy\n @trip_independent_info = TripIndependentInfo.find(params[:id])\n @trip_independent_info.destroy\n\n respond_to do |format|\n format.html { redirect_to trip_independent_infos_url }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "822ddea2e45bf78350003645efcbdb54",
"score": "0.65967095",
"text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end",
"title": ""
},
{
"docid": "24cda1fb3b39280e3f4d99a26033da34",
"score": "0.6592806",
"text": "def destroy\n @trip.destroy\n end",
"title": ""
},
{
"docid": "24cda1fb3b39280e3f4d99a26033da34",
"score": "0.6592806",
"text": "def destroy\n @trip.destroy\n end",
"title": ""
},
{
"docid": "d9e354f3bc37823cdc974bed6ecc9462",
"score": "0.6580049",
"text": "def destroy\n @day_trip = DayTrip.find(params[:id])\n @day_trip.destroy\n\n respond_to do |format|\n format.html { redirect_to day_trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "57b799133d29316426c358002043baa2",
"score": "0.6575458",
"text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end",
"title": ""
},
{
"docid": "0b24cbc6495df3923ea7679acbcd8deb",
"score": "0.656475",
"text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend",
"title": ""
},
{
"docid": "3fd37b8473c1a669047d553d3944ab6a",
"score": "0.6558323",
"text": "def destroy\n @trip_feature = TripFeature.find(params[:id])\n @trip_feature.destroy\n\n respond_to do |format|\n format.html { redirect_to trip_features_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d590117e238d391eff3f34d1e04b1014",
"score": "0.65537703",
"text": "def destroy\n @snipet = Snipet.find(params[:id])\n @snipet.destroy\n\n respond_to do |format|\n format.html { redirect_to snipets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bea298e6728d48592457d2ed8317008c",
"score": "0.65495366",
"text": "def destroy\n @user_trip.destroy\n respond_to do |format|\n format.html { redirect_to user_trips_url, notice: 'User trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "718fd485f95a30a8c897e2403defb29f",
"score": "0.6540839",
"text": "def delete(path, params={}); make_request(:delete, host, port, path, params); end",
"title": ""
},
{
"docid": "47a3c9c28e1fcd0fcae5ea58416b42bd",
"score": "0.65398914",
"text": "def delete(path)\n api :delete, path\n end",
"title": ""
},
{
"docid": "9c8ef0b4313fef9d26c4290371bc530d",
"score": "0.65332526",
"text": "def delete!\n client.delete(:path => base_path)\n nil\n end",
"title": ""
},
{
"docid": "f8f4f52fa382e61611361913a656afa7",
"score": "0.65312994",
"text": "def destroy\r\n trip = Trip.find_by(id: params[:id])\r\n trip.destroy\r\n trip.trip_locations.each do |tl|\r\n tl.destroy\r\n end\r\n redirect_to user_path(trip.user_id)\r\n end",
"title": ""
},
{
"docid": "23f6c816fa42d11a18b3836d9b0dfe3a",
"score": "0.6528075",
"text": "def destroy\n @field_trip.destroy\n respond_to do |format|\n format.html { redirect_to field_trips_url, notice: 'Field trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "23f6c816fa42d11a18b3836d9b0dfe3a",
"score": "0.6528075",
"text": "def destroy\n @field_trip.destroy\n respond_to do |format|\n format.html { redirect_to field_trips_url, notice: 'Field trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2d65f1798d37758b2fa0cef2c388924e",
"score": "0.6518506",
"text": "def destroy\n @path_train = PathTrain.find(params[:id])\n @path_train.destroy\n\n respond_to do |format|\n format.html { redirect_to path_trains_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "174b723f9e43bfa7501a9cdc389e4c1b",
"score": "0.65166396",
"text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end",
"title": ""
},
{
"docid": "0387aa3c568d857184e97a214e580a14",
"score": "0.6512377",
"text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end",
"title": ""
}
] |
5d88697b1ddc748b9181bc6f36018268
|
send a PWM (pulse width modulation) signal to the pin
|
[
{
"docid": "9857e1e628cd710f05f44c7b4a090f5c",
"score": "0.73575497",
"text": "def pwm(value)\n GPIO.write \"gpio#{@number}/value\", value\n end",
"title": ""
}
] |
[
{
"docid": "63d9cdf92f447abfb91610d4fd16909e",
"score": "0.72344285",
"text": "def send_pulse\n puts 'DEBUG: send_pulse'\n set_intensity :high\n sleep 0.4\n set_intensity :off\n end",
"title": ""
},
{
"docid": "522a9a3bcb88f0e1fef70d43ee53cdbb",
"score": "0.72196805",
"text": "def pwm_set(frequency,on_ratio)\n r=on_ratio.to_i \n \n puts \"pwm #{@gpio} => set to f=#{frequency} pulse=#{r}%\" if @verbose\n async_spawn( \"fast-gpio\",\"pwm\",@gpio.to_s,frequency.to_s,(r < 0 ? 0 : (r > 100 ? 100 : r)).to_s) \n end",
"title": ""
},
{
"docid": "5114ca22f4c4d0423132b317d3658522",
"score": "0.6910044",
"text": "def pwm(v)\n regdata = @@i2c.read(0x08, 1)\n @@i2c.write([0x08, regdata[0] | (1 << @id)])\n @@i2c.write([@ion, v])\n @@i2c.write([0x08, regdata[0]])\n end",
"title": ""
},
{
"docid": "e1d583853de7b3411de4344e2066bc46",
"score": "0.66600543",
"text": "def on\n pwm(0xff)\n end",
"title": ""
},
{
"docid": "f29ebc7378ac170bcaab1e76b8437796",
"score": "0.642344",
"text": "def pin_std_pulse(pin, value1, value2, time, mode)\n start_command(\"F44 P#{pin} V#{value1} W#{value2} T#{time} M#{mode}\", false, @status_debug_msg) \n end",
"title": ""
},
{
"docid": "0e0322d05df97d344813a5ac2a0271a8",
"score": "0.6421315",
"text": "def set_pulse_on_pin(pin)\n @board.digital_write(pin, Firmata::Board::HIGH)\n sleep @sleep_after_pin_set\n @board.digital_write(pin, Firmata::Board::LOW)\n sleep @sleep_after_pin_set\n end",
"title": ""
},
{
"docid": "38d55452437aaf764b83f36fe5d49c1d",
"score": "0.6366887",
"text": "def pin_std_pulse(pin, value1, value2, time, mode)\n execute_command(\"F44 P#{pin} V#{value1} W#{value2} T#{time} M#{mode}\", false, @status_debug_msg) \n end",
"title": ""
},
{
"docid": "4d682b0ccbca101ecef5c0161a5a00b7",
"score": "0.6241519",
"text": "def pin_std_pulse(pin, value1, value2, time, mode)\n @ramps_arduino.execute_command(\"F44 P#{pin} V#{value1} W#{value2} T#{time} M#{mode}\", false, @status_debug_msg)\n end",
"title": ""
},
{
"docid": "d93b652ff49b6cd15bca360b639ecc9c",
"score": "0.6209432",
"text": "def pulse(pulse)\n @grid.pulse(pulse)\n end",
"title": ""
},
{
"docid": "3072adb1a14a8ccc5507cd3484042261",
"score": "0.602779",
"text": "def send! count = @code_send_repeats\n usb_send_pulse_code(wValue: count)\n end",
"title": ""
},
{
"docid": "1668202119a0d826cea9215db41b9021",
"score": "0.59265494",
"text": "def set_pin(val)\n\n @pwm.duty_cycle = val ? @duty_cycle : 0 \n super(val)\n \n end",
"title": ""
},
{
"docid": "a30e6da490663bc5ad915ff7b19b6c26",
"score": "0.55636513",
"text": "def servo_move(degree)\n duty_cycle = 7.5 # Duty cycle is 7.5% (1.5ms), which means position 90 (middle)\n case degree\n when 0\n duty_cycle = 5.0 # Duty cycle 5% (1ms), position 0 (left)\n when 90\n duty_cycle = 7.5 # Duty cycle 7.5% (1.5ms), position 90 (middle)\n when 180\n duty_cycle = 10.0 # Duty cycle 10% (2ms), position 180 (right)\n end\n \n # Set PWM signal to given pulse to go to specific degree.\n $pwm.duty_cycle = duty_cycle\n sleep(1)\nend",
"title": ""
},
{
"docid": "de1cdb999b8c56de86a787bbafe45497",
"score": "0.5475426",
"text": "def setup\n RPi::GPIO.set_numbering(:board)\n\n if @motor_controller.motors.count == 2\n RPi::GPIO.setup(@pins[:enable_a], as: :output)\n @port_a_pwm = RPi::GPIO::PWM.new(@pins[:enable_a], @pwm_freq)\n @port_a_pwm.start(0)\n RPi::GPIO.setup(@pins[:in1], as: :output)\n RPi::GPIO.setup(@pins[:in2], as: :output)\n RPi::GPIO.setup(@pins[:enable_b], as: :output)\n @port_b_pwm = RPi::GPIO::PWM.new(@pins[:enable_b], @pwm_freq)\n @port_b_pwm.start(0)\n RPi::GPIO.setup(@pins[:in3], as: :output)\n RPi::GPIO.setup(@pins[:in4], as: :output)\n else\n if @pins[:enable_a]\n RPi::GPIO.setup(@pins[:enable_a], as: :output)\n @port_a_pwm = RPi::GPIO::PWM.new(@pins[:enable_a], @pwm_freq)\n @port_a_pwm.start(0)\n RPi::GPIO.setup(@pins[:in1], as: :output)\n RPi::GPIO.setup(@pins[:in2], as: :output)\n elsif @pins[:enable_b]\n RPi::GPIO.setup(@pins[:enable_b], as: :output)\n @port_b_pwm = RPi::GPIO::PWM.new(@pins[:enable_b], @pwm_freq)\n @port_b_pwm.start(0)\n RPi::GPIO.setup(@pins[:in3], as: :output)\n RPi::GPIO.setup(@pins[:in4], as: :output)\n else\n raise \"'#{@motor_controller.name}' has no PWM pin set for #{@motor_controller.type.to_s.upcase}\"\n end\n end\n end",
"title": ""
},
{
"docid": "180795b6a9e4571d7931e597a0f3dfbe",
"score": "0.5459939",
"text": "def write_to_port(port, value)\n value = value.to_i\n @values[port.to_i] = value\n # log.debug \"write bar #{port} value #{value}\"\n client.pwm_write(@ports[port.to_i], value)\n end",
"title": ""
},
{
"docid": "db1e006fc47fe9c25b571f94795d8a3a",
"score": "0.5446077",
"text": "def send(inc)\n @h.usb_control_msg(0x21, 0x09, 0x02, 0x01, (message_base << inc).bytes_to_string, 0)\n end",
"title": ""
},
{
"docid": "fa42082757136e7d94be1a5da0a3f79b",
"score": "0.541565",
"text": "def period=(p_value)\n @period = p_value < 1.0 ? p_value : (p_value / 1000.0)\n\n return unless @duty\n\n calc_resistors\n end",
"title": ""
},
{
"docid": "5aa1a7dada0c6a21764a9cbd0575ff3d",
"score": "0.54055315",
"text": "def pitch_bend( channel, value )\n message( PB | channel, value )\n end",
"title": ""
},
{
"docid": "2b6d99568e6ebb6dece2d675bf000a75",
"score": "0.53688085",
"text": "def pulse(text=nil)\n @progressBar.text = text.to_s if text\n @progressBar.pulse\n end",
"title": ""
},
{
"docid": "6deb93af8bd80f43a4dfaa33e523532f",
"score": "0.53351045",
"text": "def poweron(s, level)\n sleep 0.1\n s.puts \"PD#{level.to_i()};\"\nend",
"title": ""
},
{
"docid": "f08ca599363d8105b1e33d28813b47a5",
"score": "0.53336245",
"text": "def on\n GPIO.write \"gpio#{@number}/value\", \"1\"\n end",
"title": ""
},
{
"docid": "c231f8092f71ff4f9c39712fcc919fc1",
"score": "0.52286285",
"text": "def set_pins(motor, mode = :stop)\n pwm, forward, backward = nil, nil, nil\n if motor.port == :a\n pwm = @port_a_pwm\n forward = @pins[:in1]\n backward = @pins[:in2]\n elsif motor.port == :b\n pwm = @port_b_pwm\n forward = @pins[:in3]\n backward = @pins[:in4]\n end\n\n case mode\n when :stop\n pwm.duty_cycle = 0\n RPi::GPIO.set_low(forward)\n RPi::GPIO.set_low(backward)\n when :forward\n pwm.duty_cycle = motor.pwm_speed\n RPi::GPIO.set_high(forward)\n RPi::GPIO.set_low(backward)\n when :backward\n pwm.duty_cycle = motor.pwm_speed\n RPi::GPIO.set_low(forward)\n RPi::GPIO.set_high(backward)\n end\n # log(\"Motor #{motor.port}: POWER: #{motor.power}, PWM: #{pwm.duty_cycle}, forward: #{RPi::GPIO.high?(forward)}, backward: #{RPi::GPIO.high?(backward)}\")\n end",
"title": ""
},
{
"docid": "d60813792191da6a96da68848b902c90",
"score": "0.52214503",
"text": "def pulse_params\n params.require(:pulse).permit(:pulse_rate, :pulse_time)\n end",
"title": ""
},
{
"docid": "ec5012e4562e0016300a730c6a6550f7",
"score": "0.5209317",
"text": "def analog_write(pin, value)\n @pins[pin].value = value\n write(ANALOG_MESSAGE | pin, value & 0x7F, (value >> 7) & 0x7F)\n end",
"title": ""
},
{
"docid": "b54eca9b7bfcb64f95fce98a99b701ce",
"score": "0.51981044",
"text": "def set_pulse\n @pulse = Pulse.find(params[:id])\n end",
"title": ""
},
{
"docid": "f2b0a716d871acd2146783a1b9c12595",
"score": "0.5071221",
"text": "def pin_write(command_line)\n HardwareInterface.current.pin_std_set_value(command_line.pin_nr, command_line.pin_value_1, command_line.pin_mode)\n end",
"title": ""
},
{
"docid": "0a6ae027f301946251006efedfa9bc5b",
"score": "0.50253266",
"text": "def generate_pulse\n @gen ||= Fiber.new do\n wait = 0\n loop do\n if wait == @delay\n wait = 0\n Fiber.yield PulseEngine::Pulse.new\n else\n wait += 1\n Fiber.yield\n end\n end\n end\n end",
"title": ""
},
{
"docid": "71dfdadc70aaf996618534192dcb2c1a",
"score": "0.5009596",
"text": "def gpioinit yabm\n yabm.gpiosetdat(1 << 6)\nend",
"title": ""
},
{
"docid": "a251a63da3ca1b52ee4fe07f3aead5af",
"score": "0.49958095",
"text": "def initialize(pin, frequency, duty_cycle_a, duty_cycle_b)\n set_servo_gpio(pin)\n set_servo_params(frequency, duty_cycle_a, duty_cycle_b)\n @status = \"stopped\"\n end",
"title": ""
},
{
"docid": "9a10b1617070cc8cb556c67ba0618207",
"score": "0.49753377",
"text": "def on!\n digital_write(:high)\n end",
"title": ""
},
{
"docid": "b457baf06b55623b8ceee35742522a10",
"score": "0.49462312",
"text": "def wake\n write_bytes(255)\n # delay(50) # ?\n end",
"title": ""
},
{
"docid": "f72b3dd7bba7428333b1a287650aea88",
"score": "0.4943906",
"text": "def set_power(watts)\n puts \"Setting Watts to #{watts.to_i} watts\" if $verbose\n w='PC'+(('000'+watts.to_i.to_s)[-3..-1])+';'\n puts w if $verbose\n ret=send_cmd(w,'PC;',w,0.25,1.0,3)\n if(ret)\n return(ret.gsub(/^PC/,'').gsub(/;$/,'').to_i)\n else\n return(nil)\n end\nend",
"title": ""
},
{
"docid": "81bcca774d879aef35927ef520d0237a",
"score": "0.49158394",
"text": "def pulse_code\n # 64 is just the max number of entries which maybe in there times two\n length = usb_get_pulse_code_length(dataIn:1).unpack('C').first # find out the length of the currently loaded pulse code\n usb_get_pulse_code(dataIn: length * 2).unpack('v*')\n end",
"title": ""
},
{
"docid": "8b6a41cae396d12d9327a9ffc156292f",
"score": "0.49114686",
"text": "def gpioinit yabm\n yabm.gpiosetdat(1 << 3 | 1 << 4)\nend",
"title": ""
},
{
"docid": "78f0128439a339b90d260ded9a701c07",
"score": "0.49053997",
"text": "def signal(value)\n @sinkg.signal(@sinkp,value)\n end",
"title": ""
},
{
"docid": "03eba9e11fba579713371f720d207d28",
"score": "0.48971885",
"text": "def set(pin)\n Native.gpio_set(pin)\n end",
"title": ""
},
{
"docid": "f32efd8da0ac24ee474ee707f4b8d788",
"score": "0.48917964",
"text": "def off\n pwm(0x00)\n end",
"title": ""
},
{
"docid": "75eddc56ca6f3f8f32a7d448329b85a3",
"score": "0.48851663",
"text": "def output(pin)\n Native.gpio_function(pin, Native::GPIO_FSEL_OUTP)\n end",
"title": ""
},
{
"docid": "5f6169cd938c65d2e68bff7ed2fd9d74",
"score": "0.48835918",
"text": "def write(new_value)\n raise \"#{to_s} cannot be used through Firmata\" if mode == Rufirmata::UNAVAILABLE\n raise \"#{to_s} is set up as an INPUT and therefore cannot be written to\" if mode == Rufirmata::INPUT\n if (new_value != value)\n self.value = new_value\n if mode == Rufirmata::OUTPUT\n port ? port.write() :\n board.write_command(Rufirmata::DIGITAL_MESSAGE, pin_number, value)\n elsif mode == Rufirmata::PWM\n val = (@value * 255).to_i\n board.write_command(Rufirmata::ANALOG_MESSAGE + pin_number, val % 128, val >> 7)\n end\n end\n end",
"title": ""
},
{
"docid": "82b8fc69db8afc3437a9fc8d58d44b30",
"score": "0.48445362",
"text": "def pulse_size\n PULSE_SIZE\n end",
"title": ""
},
{
"docid": "f6f95310739d470db474ecbbe5cd622b",
"score": "0.4827027",
"text": "def digital_write(pin, value)\n port = (pin / 8).floor\n port_value = 0\n\n @pins[pin].value = value\n\n 8.times do |i|\n port_value |= (1 << i) unless @pins[8 * port + i].value.zero?\n end\n\n write(DIGITAL_MESSAGE | port, port_value & 0x7F, (port_value >> 7) & 0x7F)\n end",
"title": ""
},
{
"docid": "3185ccb3ba419163b09f5ff550f5d686",
"score": "0.48220012",
"text": "def write pin, value\n if value == 0\n set_int_at(GPCLR0 + PI_BANK(pin), PI_BIT(pin))\n else\n set_int_at(GPSET0 + PI_BANK(pin), PI_BIT(pin))\n end\n end",
"title": ""
},
{
"docid": "6a1a965c05cb56e602d4615b146ebba7",
"score": "0.48100883",
"text": "def pong\n to_send = [ 0b10001010, 0, \"\" ]\n @connection.write to_send.pack \"C2A0\"\n end",
"title": ""
},
{
"docid": "8aece2ab0975355601ab6f5ee5bec6c7",
"score": "0.48064524",
"text": "def send(v)\n self.signal(0,v)\n end",
"title": ""
},
{
"docid": "d2d42a82cc3b70f5cf2f39c68be56345",
"score": "0.48041177",
"text": "def mouse_moved\n modulate_amount = map1d(mouse_y, (0..height), (220..1))\n modulate_frequency = map1d(mouse_x, (0..width), (0.1..100)) \n fm.frequency.set_last_value(modulate_frequency )\n fm.amplitude.set_last_value(modulate_amount)\nend",
"title": ""
},
{
"docid": "c1028aadbce6693b71daf7c6133ec7f7",
"score": "0.4766621",
"text": "def set_port_monoflop(port, selection_mask, value_mask, time)\n send_request(FUNCTION_SET_PORT_MONOFLOP, [port, selection_mask, value_mask, time], 'k C C L', 0, '')\n end",
"title": ""
},
{
"docid": "fb2a07037a8c4d1d38f145f46bd67325",
"score": "0.47603643",
"text": "def update(value)\n @serial_port.puts value\n end",
"title": ""
},
{
"docid": "ac00963b83789d3c33ce8f62ed34fe1b",
"score": "0.47487167",
"text": "def servo_std_move(pin, value)\n start_command(\"F61 P#{pin} V#{value}\", false, @status_debug_msg)\n end",
"title": ""
},
{
"docid": "ab10118ae892b602e9de96e9c3eb7b0e",
"score": "0.47312522",
"text": "def gpioinit yabm\n yabm.gpiosetdir(1 << 3)\n\n yabm.gpiosetdat(1 << 3)\nend",
"title": ""
},
{
"docid": "52d95e3037191a651bc37fbb2de7be93",
"score": "0.4721965",
"text": "def servo_std_move(pin, value)\n @ramps_arduino.execute_command(\"F61 P#{pin} V#{value}\", false, @status_debug_msg)\n end",
"title": ""
},
{
"docid": "e1a296a1d1e10e5dd343d415b6628783",
"score": "0.46999463",
"text": "def mute _value=0\n send_cmd(\"mute #{_value}\")\n end",
"title": ""
},
{
"docid": "45d85a2592441cbe0a13442752376467",
"score": "0.46946844",
"text": "def allOn (sleepy = 0) \n @segments.each do |segment, pin|\n @io.write(pin, LOW);\n sleep(sleepy)\n end\n end",
"title": ""
},
{
"docid": "1b47ff6d662d408ca302cd34705d5f01",
"score": "0.46893415",
"text": "def doge_control_signal\r\n end",
"title": ""
},
{
"docid": "baf6d872311f988d016ed99bd77ee315",
"score": "0.46846613",
"text": "def radio_set_freq _frequency_in_MHz\n send_cmd(\"radio_set_freq #{_frequency_in_MHz}\")\n end",
"title": ""
},
{
"docid": "1a1b1039af48d7bffbae855bfdaf4889",
"score": "0.46709988",
"text": "def set_power(port, state)\n\t\tstate = state ? 1 : 0\n\t\t\n\t\tdo_send(\"\\eP#{port}*#{state}DCPP\")\n\t\t# Response: DcppP_port*portstatus 0 == off, 1== on\n\tend",
"title": ""
},
{
"docid": "b751ace774c137cc62440f523d2e3646",
"score": "0.46678105",
"text": "def poll(options, &block)\n EM::PeriodicTimer.new(options[:every]) do\n Rpio::SPI.begin options[:slave] do\n output = write options[:write]\n block.call output\n end\n end\n end",
"title": ""
},
{
"docid": "7cb3f74e25698e4ae7f308eeec7e3946",
"score": "0.46561873",
"text": "def update(sender, value) \n if sender.is_a? RegulationCycle\n @cpg.call_potential = value\n \n # The following has the potential to alter the dynamics of the chorus, but may be necessary to save computational power.\n # Since a frog is not being actively evaluated, it is not being stimulated by its neighbors.\n # the only hope is to \"schedule\" it far enough in advance to allow for the potential for stimulation\n # and visa versa, to remove it from the Bus well after it has stopped playing\n \n # remove from the bus if not scheduled to play!!!\n if ((value + 0.2) < @threshold ) and @is_playing and @actuator.is_finished?\n puts \"Removing an Anuran from the Bus\"\n stop\n end\n # add to the bus if scheduled to play!!!\n if ((value - 0.2) > @threshold ) and !@is_playing\n puts \"Putting an Anuran back on the Bus\"\n play\n end\n end\n end",
"title": ""
},
{
"docid": "e6b5a21aecdb55a79297cb1fbc1f3a3d",
"score": "0.4626216",
"text": "def reset(s)\n poweroff(s)\n sleep 0.1\n s.puts \"PA0,0;\"\n sleep 0.1\nend",
"title": ""
},
{
"docid": "cc13942f5ea1226ae7cffac985492da0",
"score": "0.46225205",
"text": "def power_chord(low_note,velocity=127,duration='quarter')\n\t add_notes([0,7].collect { |x| x + low_note }, velocity, duration)\n end",
"title": ""
},
{
"docid": "cc13942f5ea1226ae7cffac985492da0",
"score": "0.46225205",
"text": "def power_chord(low_note,velocity=127,duration='quarter')\n\t add_notes([0,7].collect { |x| x + low_note }, velocity, duration)\n end",
"title": ""
},
{
"docid": "d718f93eed4407eca758b0ba37737054",
"score": "0.46125376",
"text": "def send_data(data)\n # Enable the chip, set the DC line to DATA\n RPi::GPIO.set_low @cs\n RPi::GPIO.set_high @dc\n # Now send the command over the SPI line\n @spi.xfer(txdata: data)\n # We're done, turn off CS\n RPi::GPIO.set_high @cs\n end",
"title": ""
},
{
"docid": "e81a28f8e8629f8d7ee50a710921804d",
"score": "0.46114385",
"text": "def write_parameter_to_device(id, value)\n @ramps_arduino.execute_command(\"F22 P#{id} V#{value}\", false, false)\n end",
"title": ""
},
{
"docid": "b9ec38043fd9b877f27e0e0ce7949f2a",
"score": "0.46114197",
"text": "def write_to_channel()\n store_button()\n sleep(0.5)\n store_button()\n sleep(0.5)\nend",
"title": ""
},
{
"docid": "d71d6e6f31c08a7b2ce10a86b79d0108",
"score": "0.4596801",
"text": "def wave\n [*0..60].map do |e|\n (4095 * Math.sin(e * Math::PI / 60)).round\n end\nend",
"title": ""
},
{
"docid": "fce96ce5409d9aecac37ed1f62263760",
"score": "0.45944554",
"text": "def output_pin(num, opts={})\n raise ArgumentError, \"can only define pin from Fixnum, got #{num.class}\" unless num.is_a?(Fixnum)\n @pin_modes[:output] << num\n if opts[:as]\n if opts[:device]\n case opts[:device]\n when :servo\n new_servo_setup(num, opts)\n return # don't use declarations, accessor, signatures below\n when :orig_servo\n orig_servo_setup(num, opts)\n when :lcd || :LCD\n lcd_setup(num, opts)\n return \n when :pa_lcd || :pa_LCD\n pa_lcd_setup(num, opts)\n return \n when :sf_lcd || :sf_LCD\n sf_lcd_setup(num, opts)\n return \n when :freq_out || :freq_gen || :frequency_generator\n frequency_timer(num, opts)\n return\n when :i2c\n two_wire(num, opts) unless @@twowire_inc\n return #\n when :i2c_eeprom\n two_wire(num, opts) unless @@twowire_inc\n return #\n when :i2c_ds1307\n two_wire(num, opts) unless @@twowire_inc\n ds1307(num, opts) \n return #\n when :i2c_blinkm\n two_wire(num, opts) unless @@twowire_inc\n blinkm\n return #\n when :onewire\n one_wire(num, opts)\n return #\n else\n raise ArgumentError, \"today's device choices are: :servo, :original_servo_setup, :pa_lcd, :sf_lcd, :freq_out,:i2c, :i2c_eeprom, :i2c_ds1307, and :i2c_blinkm got #{opts[:device]}\"\n end\n end\n \n# remove the next 14 lines as soon as documentation on new :device => :servo option is out\n \n if opts[:min] && opts[:max] \n ArduinoPlugin.add_servo_struct\n @servo_pins << num\n refresh = opts[:refresh] ? opts[:refresh] : 200\n @servo_settings << \"serv[#{num}].pin = #{num}, serv[#{num}].pulseWidth = 0, serv[#{num}].lastPulse = 0, serv[#{num}].startPulse = 0, serv[#{num}].refreshTime = #{refresh}, serv[#{num}].min = #{opts[:min]}, serv[#{num}].max = #{opts[:max]} \"\n unless opts[:device]\n puts \"#{\"*\"*80} \\n using :max and :min to instantiate a servo is deprecated\\n use :device => :servo instead\\n#{\"*\"*80}\"\n end\n else \n raise ArgumentError, \"two are required for each servo: min & max\" if opts[:min] || opts[:max] \n raise ArgumentError, \"refresh is an optional servo parameter, don't forget min & max\" if opts[:refresh] \n end\n \n # add state variables for outputs with :state => :on or :off -- useful for toggling a light with output_toggle -- need to make this more modular\n if opts[:state] \n # add debounce settings to dbce struct array\n ArduinoPlugin.add_debounce_struct\n @debounce_pins << num\n state = opts[:latch] == :on ? 1 : 0\n prev = opts[:latch] == :on ? 0 : 1\n adjust = opts[:adjust] ? opts[:adjust] : 200\n @debounce_settings << \"dbce[#{num}].state = #{state}, dbce[#{num}].read = 0, dbce[#{num}].prev = #{prev}, dbce[#{num}].time = 0, dbce[#{num}].adjust = #{adjust}\"\n end\n \n @declarations << \"int _#{opts[ :as ]} = #{num};\"\n \n accessor = []\n accessor << \"int #{opts[ :as ]}() {\"\n accessor << \"\\treturn _#{opts[ :as ]};\"\n accessor << \"}\"\n @accessors << accessor.join( \"\\n\" )\n \n @signatures << \"int #{opts[ :as ]}();\"\n end\n end",
"title": ""
},
{
"docid": "43ed299f9b1f3ba18b289aaafb29b947",
"score": "0.45943758",
"text": "def signal(port, val)\n # The derived class needs to implement the value method.\n self.activate\n @inputs[port] = val\n newval = self.value\n if newval != @outval then\n @outval = newval\n @outputs.each { | c | c.signal(newval) }\n end\n self.deactivate\n end",
"title": ""
},
{
"docid": "6ea83c3dd41b54532807d48754bceb92",
"score": "0.45758343",
"text": "def on\n set_power(\"on\", \"smooth\",1000)\n end",
"title": ""
},
{
"docid": "5f78e86ed13362ab409eede763da0956",
"score": "0.4574843",
"text": "def arm_publish(event, *args)\n arm_globe.signal(self, event, args)\n self\n end",
"title": ""
},
{
"docid": "fdb6b96cb20373b1e1955b65750d725e",
"score": "0.45719126",
"text": "def hal_signal pin\n validate_output pin\n \"#{hal_label}-#{hyphenize(pin)}\"\n end",
"title": ""
},
{
"docid": "2367171dd2480ec1afc9700dfee0a5fb",
"score": "0.45665532",
"text": "def send_dmx(channel, value)\n\n # Write the channel and value in the format for Arduino\n write(\"#{channel}c\")\n write(\"#{value}w\")\n end",
"title": ""
},
{
"docid": "2433eff667004f5632d19b743b22ea54",
"score": "0.4555617",
"text": "def mode=(mode)\n #Can be Rufirmata::INPUT, OUTPUT, ANALOG, PWM or UNAVAILABLE\n return if @mode == mode #Nothing is changing, so nothing to do\n\n raise \"#{to_s} does not have PWM capabilities\" if mode == Rufirmata::PWM and !pwm\n raise \"#{to_s} cannot be used through Firmata\" if @mode == Rufirmata::UNAVAILABLE\n\n changing :pin_mode_changed, :changes=>{ :from=>@mode, :to=>mode } do\n @mode = mode\n unless mode == Rufirmata::UNAVAILABLE\n board.write_command(Rufirmata::SET_PIN_MODE, pin_number, mode)\n enable_reporting if mode == Rufirmata::INPUT\n end\n end\n\n end",
"title": ""
},
{
"docid": "81a2d27345fe356a1db51ef8d6bad18b",
"score": "0.4552517",
"text": "def manage_buttons\n bootup\n @@pin=PiPiper::Pin.new(:pin => 23, :pull => :up)\n @@led=PiPiper::Pin.new(:pin => 18, :direction => :out)\n @@led.on\n @@t=Time.now\n PiPiper.watch :pin => 23,:trigger => :falling , :pull => :up do\n #puts \"Button pressed changed from #{last_value} to #{value}\"\n #puts \".\"\n @@t=Time.now\n end\n PiPiper.watch :pin => 23,:trigger => :rising , :pull => :up do\n delta = Time.now.to_f - @@t.to_f\n @@t = Time.now\n EstormLottoGem::Button.led_mgr(EstormLottoGem::Button.tap()) if 0.03 <= delta and delta < 0.7\n EstormLottoGem::Button.led_mgr(EstormLottoGem::Button.held()) if 2 < delta and delta < 20\n #puts \"debounce\" if 0.1 > delta\n end\n sleep 5\n \n @@led.off\n @@t=Time.now\n PiPiper.wait\n end",
"title": ""
},
{
"docid": "32ef171b86299cf0d8fcc5fee1660591",
"score": "0.4536208",
"text": "def servo_std_move(pin, value)\n execute_command(\"F61 P#{pin} V#{value}\", false, @status_debug_msg)\n end",
"title": ""
},
{
"docid": "09ba49c4c2fa7a5c6f11fb71d7b8a0a0",
"score": "0.45103043",
"text": "def signal\n end",
"title": ""
},
{
"docid": "08798d50a1759199112471fd338bd7a9",
"score": "0.45072553",
"text": "def poweroff(s)\n s.puts \"PU;\"\n sleep 0.1\nend",
"title": ""
},
{
"docid": "837e16518d8c38f730ff1aed7e5a34b2",
"score": "0.45019904",
"text": "def signal(signum = nil)\n handle = Signal.new(@reactor)\n handle.progress &Proc.new if block_given?\n handle.start(signum) if signum\n handle\n end",
"title": ""
},
{
"docid": "5f600bddee329e7267499752acb870d7",
"score": "0.44945645",
"text": "def initialize devref #:nodoc:\n @device = devref\n \n @hardware_pwm_enabled = :unknown\n @hardware_pwm_prescale = :unknown\n @hardware_pwm = [0, 0]\n @software_pwm_enabled = :unknown\n @software_pwm = [0, 0, 0]\n \n # shut everything down, trying to setup littlewire in consistent initial state in case previous programs\n # messed with it's state\n self.software_pwm_enabled = false\n self.hardware_pwm_enabled = false\n self.pin_mode(pin1: :input, pin2: :input, pin3: :input, pin4: :input)\n self.digital_write(pin1: :gnd, pin2: :gnd, pin3: :gnd, pin4: :gnd)\n end",
"title": ""
},
{
"docid": "241137f12bfe2d836815a382f713198b",
"score": "0.44874325",
"text": "def send_io(p0) end",
"title": ""
},
{
"docid": "4f9cf81e7472ca90c07aedd00f9c29b9",
"score": "0.44856778",
"text": "def write_command(cmd, data='', synth=SYNTH_A)\n # Make sure cmd is valid\n raise \"unknown command #{cmd}\" unless LENGTH.has_key?(cmd)\n # Verify length of data to write\n if data.length != LENGTH[cmd]\n raise \"invalid data length for command #{cmd} \" +\n \"(expected #{LENGTH[cmd]}, got #{data.length})\"\n end\n # Make sure synth has no stray bits set\n synth &= (SYNTH_A|SYNTH_B)\n\n serialport do |sp|\n cmd = WR|synth|cmd unless cmd == CMD_WRITE_FLASH\n csum = Valon.generate_checksum(cmd.chr, data)\n cmd_data_csum = [cmd, data, csum].pack('CA*A')\n sp.write(cmd_data_csum)\n ack = sp.read(1).ord\n raise \"nak error (#{ack == NAK ? 'NAK' : ack.inspect})\" if ack != ACK\n end\n nil\n end",
"title": ""
},
{
"docid": "f8caf1acf6608b5044560c4bbc59d238",
"score": "0.44645652",
"text": "def write(s)\n @port.write(s)\n sleep(@wait_after_send / 1000.0) if @wait_after_send\n end",
"title": ""
},
{
"docid": "e1f10abe948091af689b5429c5348629",
"score": "0.44634026",
"text": "def send_param(value)\n begin\n self.device.set_to(value)\n rescue Encoding::CompatibilityError => e\n puts \"Error: #{e}\"\n end\n # Update widget status\n @widget = self.class.find_by_id(self.id)\n @widget.status = value.to_i\n # Send the update to all running sessions\n unless ActionCable.server.logger.nil?\n ActionCable.server.broadcast 'widgets', {type: \"slider\", id: self.id, status: @widget.status}\n end\n end",
"title": ""
},
{
"docid": "cc6ae525020d85b47a07ad92de67ed66",
"score": "0.4458216",
"text": "def send_command(command)\n # Enable the chip, set the DC line to COMMAND\n RPi::GPIO.set_low @cs\n RPi::GPIO.set_low @dc\n # Now send the command over the SPI line\n @spi.xfer(txdata: [command])\n # We're done, turn off CS\n RPi::GPIO.set_high @cs\n end",
"title": ""
},
{
"docid": "b864f934ccb0e85c94cc9b94d9f8e8a3",
"score": "0.44554234",
"text": "def arm_signal(target, event, *args)\n target.arm_container.signal(self, event, args)\n arm_publish(event, *args)\n self\n end",
"title": ""
},
{
"docid": "5f67c9b97bb872d0c2fb25697586b3e0",
"score": "0.44544333",
"text": "def motion(gpio,pir,led_motion, seconds)\n pirVal = 0 \n start = Time.now\n while (Time.now - start < seconds) and (pirVal == 0) \n pirVal = gpio.read(pir) # read input value. 1 if motion detected\n if pirVal == 1 # motion detected. LED on, and will exit loop\n gpio.write(led_motion, 1) # turn LED ON\n end\n end # while\n return pirVal\nend",
"title": ""
},
{
"docid": "52d80a51951d6dfce67bade2e92c37e9",
"score": "0.4452866",
"text": "def poke_4015(_addr, data)\n update\n @pulse_0 .enable(data[0] == 1)\n @pulse_1 .enable(data[1] == 1)\n @triangle.enable(data[2] == 1)\n @noise .enable(data[3] == 1)\n @dmc .enable(data[4] == 1)\n end",
"title": ""
},
{
"docid": "240e6455e13c76fe77ca536ecee97b57",
"score": "0.4448151",
"text": "def on\n @is_on = true\n connection.set_pin_mode(pin, Firmata::Board::OUTPUT)\n connection.digital_write(pin, Firmata::Board::HIGH)\n end",
"title": ""
},
{
"docid": "0e1673f1a37fa7a77a4c9deb7e65bfbd",
"score": "0.44477993",
"text": "def update_tone\n end",
"title": ""
},
{
"docid": "458b6e97be808079e5390d87e62f95cc",
"score": "0.4441092",
"text": "def pitch_bend(low, high, options = {})\n channel = options[:channel] || @channel\n raise \"channel_aftertouch requires a channel\" if channel.nil?\n PitchBend.new(channel, low, high, options)\n end",
"title": ""
},
{
"docid": "8d3a819c48a1a32ceac781b90cceace8",
"score": "0.44349688",
"text": "def turn_on #turn the power on\n @power = true\n end",
"title": ""
},
{
"docid": "bd032204fb1ab97269de814edd5d952f",
"score": "0.4430642",
"text": "def aftertouch( note, channel, pressure )\n message( PA | channel, note, pressure )\n end",
"title": ""
},
{
"docid": "bd12c79294fafa3d24db264ce11d2d7e",
"score": "0.44201642",
"text": "def putc(c)\n @port.write(c)\n sleep(@wait_after_send / 1000.0) if @wait_after_send\n end",
"title": ""
},
{
"docid": "eb922c4bf155a7c79e1ddf36883407cc",
"score": "0.44153404",
"text": "def update\n pulse = generate_pulse.resume\n @connections.values.each do |connection|\n connection.pulse(PulseEngine::Pulse.new) if pulse && !connection.nil?\n end\n end",
"title": ""
},
{
"docid": "2c1961900da994bd3830fdd1fd83c05c",
"score": "0.44146204",
"text": "def alarm\n puts \"\\nYOUR DEVICE IS INFECTED WITH CLIPBOARD HIJACKER !\"\n system(\"notify-send -u critical 'YOUR DEVICE IS INFECTED WITH CLIPBOARD HIJACKER !'\")\n system(\"spd-say 'Your device is infected with clipboard hijacker!'\")\n end",
"title": ""
},
{
"docid": "f192637e128a1a39b8d688ed7fac22ba",
"score": "0.4414396",
"text": "def react_port(port, energy)\n super(port, energy)\n if energy.value >= threshold\n energy.value = 0\n try_callback(:on_react_drain, self, port, energy)\n end\n end",
"title": ""
},
{
"docid": "bb969487512312956bff0734cd8fe3f4",
"score": "0.44130316",
"text": "def signal\n\t\t\t\twrapper = Async::IO::Generic.new(@output)\n\t\t\t\twrapper.write(\".\")\n\t\t\tensure\n\t\t\t\twrapper.reactor = nil\n\t\t\tend",
"title": ""
},
{
"docid": "fb00076114d576b5ae07b246931ac448",
"score": "0.44063646",
"text": "def set_bunny_volume vol\n @exch.publish(vol.to_i) \n end",
"title": ""
},
{
"docid": "b3c983c6b8cadd5e0bdb56f2959b966d",
"score": "0.44038132",
"text": "def create\n\n unless params[:pulse]\n params[:pulse] = params\n end\n @pulse = Pulse.new(pulse_params)\n\n respond_to do |format|\n if @pulse.save\n format.html { redirect_to @pulse, notice: 'Pulse was successfully created.' }\n format.json { render :show, status: :created, location: @pulse }\n else\n format.html { render :new }\n format.json { render json: @pulse.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "139ddde6cb34dbdfed3146c2c50e7e84",
"score": "0.43972626",
"text": "def command(val)\n # record the valve's command state in the db\n update(cmd: val)\n mode = \"gpio -g mode #{gpio_pin} out\"\n system(mode)\n mode_set = 1\n write = \"gpio -g write #{gpio_pin} #{val}\"\n system(write)\n end",
"title": ""
},
{
"docid": "7012a815f14999b68878f755e4075827",
"score": "0.43969175",
"text": "def metronome()\n end",
"title": ""
},
{
"docid": "cfa2c6c75d2635c53d9f42210025268f",
"score": "0.4393996",
"text": "def run\n led.on! # this does what you think it does\n sleep(1) # sleep for 1 second, kind of blunt, since it blocks everthing.\n led.off!\n sleep(1)\n end",
"title": ""
},
{
"docid": "1303a9da682795d529c3d66d15084f51",
"score": "0.4377933",
"text": "def poll_spi(options, &block)\n EM::PeriodicTimer.new(options[:every]) do\n Spi.begin options[:slave] do\n output = write options[:write]\n block.call output\n end\n end\n end",
"title": ""
}
] |
d53869f37fc153344c74752a3d2d7625
|
Returns all user contacts.
|
[
{
"docid": "309cfedd5f04a176ca2bed9dba16aad5",
"score": "0.0",
"text": "def get_contacts\n broadcast('@type' => 'getContacts')\n end",
"title": ""
}
] |
[
{
"docid": "eca03107539927f2c59979d1028aad9f",
"score": "0.8077975",
"text": "def get_user_contacts(options={})\n response = get(\"get_user_contacts/\", options)\n end",
"title": ""
},
{
"docid": "9b7261396c5ab1428691d36610a1112e",
"score": "0.79924214",
"text": "def contacts\n @client.contacts_getPublicList('user_id'=>@id)['contacts']['contact'].collect { |contact| User.new(contact['nsid'], contact['username'], nil, nil, @api_key) }\n #or\n end",
"title": ""
},
{
"docid": "ac72214afadc332475b2f4d42df0c249",
"score": "0.79246676",
"text": "def all\n @@contacts\n end",
"title": ""
},
{
"docid": "359e03ca4223adfe86d14c4fb15d8b3d",
"score": "0.7858039",
"text": "def contacts\n @client.contacts_getPublicList('user_id'=>@id)['contacts']['contact'].collect { |contact| User.new(contact['nsid']) }\n #or\n end",
"title": ""
},
{
"docid": "4a9325124649ee31e09469e2688d7df1",
"score": "0.7663639",
"text": "def contacts\n @contacts ||= Contact.findByAccount(self)\n end",
"title": ""
},
{
"docid": "3f58858fb6c0cd2b9697b19c32b07240",
"score": "0.7558759",
"text": "def index\n @user_contacts = UserContact.all\n end",
"title": ""
},
{
"docid": "6aeb4f6c82755671cea15b216c0d9320",
"score": "0.75530535",
"text": "def index\n @contacts = current_user.contacts.all\n end",
"title": ""
},
{
"docid": "e8faf15ff5690e2b4b4a4b558ad45ac6",
"score": "0.75083715",
"text": "def index\n @contacts = []\n Contact.find_each do |contact|\n @contacts << contact if contact.user.nil? || contact.user.id == @user.id\n end\n end",
"title": ""
},
{
"docid": "71ec21c8899d8b90eff0f545761b4992",
"score": "0.7465689",
"text": "def index\n @contacts = ContactUser.all\n end",
"title": ""
},
{
"docid": "a12e394192f59e9af72de50eebe4631e",
"score": "0.7446561",
"text": "def index\n @contacts = current_user.contacts\n end",
"title": ""
},
{
"docid": "a12e394192f59e9af72de50eebe4631e",
"score": "0.7446561",
"text": "def index\n @contacts = current_user.contacts\n end",
"title": ""
},
{
"docid": "a12e394192f59e9af72de50eebe4631e",
"score": "0.7446561",
"text": "def index\n @contacts = current_user.contacts\n end",
"title": ""
},
{
"docid": "a12e394192f59e9af72de50eebe4631e",
"score": "0.7446561",
"text": "def index\n @contacts = current_user.contacts\n end",
"title": ""
},
{
"docid": "a12e394192f59e9af72de50eebe4631e",
"score": "0.7446561",
"text": "def index\n @contacts = current_user.contacts\n end",
"title": ""
},
{
"docid": "a12e394192f59e9af72de50eebe4631e",
"score": "0.7446561",
"text": "def index\n @contacts = current_user.contacts\n end",
"title": ""
},
{
"docid": "7292d1a5c0d4acaee49450dc866c34b6",
"score": "0.7441448",
"text": "def contacts\n contact_records.map(&:user)\n end",
"title": ""
},
{
"docid": "e0014e16f2c2151eec5bc6031248c77f",
"score": "0.7416759",
"text": "def all_contacts(options = {}, chunk_size = 200)\n in_chunks(options, :contacts, chunk_size)\n end",
"title": ""
},
{
"docid": "f02c5d86a5bc41e755b46a02186bd422",
"score": "0.7404305",
"text": "def contacts\n return @contacts\n end",
"title": ""
},
{
"docid": "f02c5d86a5bc41e755b46a02186bd422",
"score": "0.7404305",
"text": "def contacts\n return @contacts\n end",
"title": ""
},
{
"docid": "6941df80ce66465c0e53532d17b3fdef",
"score": "0.73882335",
"text": "def index\n @usercontacts = Usercontact.all\n end",
"title": ""
},
{
"docid": "680464823216e7f4871a0a4894b924aa",
"score": "0.7363669",
"text": "def contacts()\n get('contactsList')\n end",
"title": ""
},
{
"docid": "c9a933bcbb74643045cd693e1f31da12",
"score": "0.73497945",
"text": "def index\r\n @user_contact = UserContact.all\r\n end",
"title": ""
},
{
"docid": "925442d17e9d3ef68d34ddc05b1e2b77",
"score": "0.7316125",
"text": "def index\n @users_contacts = Users::Contact.all\n end",
"title": ""
},
{
"docid": "60e427bf8ffc523198bad5802fa130b6",
"score": "0.73132354",
"text": "def contacts\n if !@contacts_downloaded && contact_group_id\n @contacts_downloaded = true\n\n # Load the contact list.\n @contacts = gateway.get_contact_group_by_id(contact_group_id).contact_group.contacts || []\n end\n\n @contacts\n end",
"title": ""
},
{
"docid": "858daf1ca19f26952d0dd388cfe1945c",
"score": "0.7307491",
"text": "def contacts(params = {})\n get_contacts(params)\n end",
"title": ""
},
{
"docid": "9588d2f3a866df3b08b0c01ce13587e4",
"score": "0.72882956",
"text": "def list_all\n \tlist(Contact.all)\n\tend",
"title": ""
},
{
"docid": "8eea3a2e86364d38226af95d61abd66e",
"score": "0.72436804",
"text": "def contacts\n get('contacts')\n end",
"title": ""
},
{
"docid": "b3770cc602cb442c7974b8cf49732e34",
"score": "0.72332036",
"text": "def query_contacts(options = nil)\n require_relative 'contact'\n @api.cursor(Contact, get_base_api_path() + \"/contacts\", options)\n end",
"title": ""
},
{
"docid": "b3770cc602cb442c7974b8cf49732e34",
"score": "0.72332036",
"text": "def query_contacts(options = nil)\n require_relative 'contact'\n @api.cursor(Contact, get_base_api_path() + \"/contacts\", options)\n end",
"title": ""
},
{
"docid": "b3770cc602cb442c7974b8cf49732e34",
"score": "0.72332036",
"text": "def query_contacts(options = nil)\n require_relative 'contact'\n @api.cursor(Contact, get_base_api_path() + \"/contacts\", options)\n end",
"title": ""
},
{
"docid": "d745d10f6e68e69110616b330f1b14df",
"score": "0.72183317",
"text": "def contacts(params = {})\n # contacts in this group\n @contacts ||= get_contacts(params)\n end",
"title": ""
},
{
"docid": "36d14188ee717b806866620ba867162e",
"score": "0.72079206",
"text": "def contacts\n contact_ids = @redis.smembers(\"contacts_for:#{entity.id}:#{check}\")\n\n if @logger\n @logger.debug(\"#{contact_ids.length} contact(s) for #{entity.id}:#{check}: \" +\n contact_ids.inspect)\n end\n\n entity.contacts + contact_ids.collect {|c_id|\n Flapjack::Data::Contact.find_by_id(c_id, :redis => @redis, :logger => @logger)\n }.compact\n end",
"title": ""
},
{
"docid": "0a3ee43585d5198f4e7e8e1caa7fb1ce",
"score": "0.7161766",
"text": "def get_contacts\n @user = current_user\n if @user\n render json: @user.meetings.map { |meeting| { :contacts => meeting.users } }\n else\n render json: {error: 'Contacts not found.'}\n end\n end",
"title": ""
},
{
"docid": "9279ccd7fcdbaefa85a66884db97a881",
"score": "0.71377426",
"text": "def contacts\n @contacts ||= fetch_contacts\n end",
"title": ""
},
{
"docid": "9279ccd7fcdbaefa85a66884db97a881",
"score": "0.71377426",
"text": "def contacts\n @contacts ||= fetch_contacts\n end",
"title": ""
},
{
"docid": "9279ccd7fcdbaefa85a66884db97a881",
"score": "0.71377426",
"text": "def contacts\n @contacts ||= fetch_contacts\n end",
"title": ""
},
{
"docid": "eacb3f0b77466bfd48ab3e2f6af2af3e",
"score": "0.7107329",
"text": "def get_contacts(params = {})\n Services::ContactService.get_contacts(params)\n end",
"title": ""
},
{
"docid": "b9c82c4c8bb30b9065bf56497710dafb",
"score": "0.708911",
"text": "def all\n ContactDatabase.read\n end",
"title": ""
},
{
"docid": "1c274cd8d025f7ff0cf2363ff3ead1d2",
"score": "0.70739216",
"text": "def get_users_by_query(query)\n return Amorail::Contact.find_by_query(query) #get array of objects\n end",
"title": ""
},
{
"docid": "385234820fee5ed169f920009d6ec58e",
"score": "0.70501846",
"text": "def contacts(opts = {})\n find_collection(\"contacts\", opts)\n end",
"title": ""
},
{
"docid": "f3b5b27e2df617939e2cdd3ac0592e9a",
"score": "0.70347714",
"text": "def index\n\t\t@contact = current_user.contacts.new\n \t\t@contacts = current_user.contacts.paginate(page: params[:page], :per_page => 5)\n\tend",
"title": ""
},
{
"docid": "3bfd1b970d212c1205ac2bb158e2b664",
"score": "0.69989467",
"text": "def contacts\n bot.contacts\n end",
"title": ""
},
{
"docid": "c282bccebc359c240d23dbe4578b1643",
"score": "0.6998406",
"text": "def contacts\n parsers.inject([]) { |all, parser| all.concat(parser.contacts) }\n end",
"title": ""
},
{
"docid": "c44f3f41773a15ec73405bae21f3c0b3",
"score": "0.69824827",
"text": "def contacts\n @contacts ||= Harvest::API::Contacts.new(credentials)\n end",
"title": ""
},
{
"docid": "82011e3ad9aa8877ecd5ae97bf344ce8",
"score": "0.6972431",
"text": "def index\n @contacts = User.find(current_user.id).contacts\n render json: { contacts: @contacts }, status: :ok\n end",
"title": ""
},
{
"docid": "ff541e8d8ac74a197949c597ec9bbd37",
"score": "0.69634634",
"text": "def contacts(limit = 10000)\n convert_google_contacts_json_to_users(load_contacts(limit))\n end",
"title": ""
},
{
"docid": "5cbcb5807b91ad1ba177e52c4a17e9ea",
"score": "0.6942448",
"text": "def contacts\n @contacts ||= circles.map(&:contacts).flatten.uniq\n end",
"title": ""
},
{
"docid": "6558c5505198636c1b7c1f9dda11a222",
"score": "0.69392633",
"text": "def scrape_contacts\n unless agent.cookies.find{|c| c.name == 'GAUSR' && \n (c.value.include? \"mail:#{options[:username]}\")}\n raise( Blackbook::BadCredentialsError, \"Must be authenticated to access contacts.\" )\n end\n\n\tcontacts = []\n csv = agent.get('https://mail.google.com/mail/contacts/data/export?exportType=ALL&out=GMAIL_CSV')\n\tbody = Kconv.toutf8(csv.body)\n\tFCSV.parse(body) do |row|\n\t\tnext if row[0] == \"Name\" and row[1] == \"E-mail\"\n\t\tcontacts << {:name => row[0], :email => row[1]} unless row[1].blank?\n\tend\n\treturn contacts\n end",
"title": ""
},
{
"docid": "11f95067b414c32cc64626bc94c83f82",
"score": "0.6928603",
"text": "def index\n @contacted_users = current_user.contacted_users\n end",
"title": ""
},
{
"docid": "4c1a3db248531e72a59cac2e797dd92a",
"score": "0.691357",
"text": "def contacts\n collect\n end",
"title": ""
},
{
"docid": "56429b9453042a9383961ab73af617aa",
"score": "0.6911692",
"text": "def contacts\n contacts_res.data.contacts.map {|contact| contact_res_to_map(contact)}\n end",
"title": ""
},
{
"docid": "257d00347c6da766e4fe9ee8754a76ed",
"score": "0.69000274",
"text": "def contacts\n @contacts ||= Contact.new(self)\n end",
"title": ""
},
{
"docid": "5b68480549d7acf9050aebf230e82fb7",
"score": "0.6883897",
"text": "def get_contacts\n uri = 'https://api.xero.com/api.xro/2.0/Contacts'\n response = send(uri, '', :get)\n\n companies = []\n extract_contacts(parse_response(response)).each do |contact|\n companies << create_company_from_node(contact)\n end\n companies\n end",
"title": ""
},
{
"docid": "8b23bdba7accf88f12924febe9c1c38b",
"score": "0.68545413",
"text": "def show_account_contacts(search = nil)\n get('accountContacts', search: search)\n end",
"title": ""
},
{
"docid": "7ed0473e4b90d6655f8d536becddbf28",
"score": "0.68454254",
"text": "def contacts\n users.where('users.user_type = :t AND users.status <> :s AND user_companies.current = :c', t: USER_TYPE_CONTACT, s: USER_STATUS_DELETED, c: true)\n end",
"title": ""
},
{
"docid": "417afcad9fa925ffdf3cdb180dd3d033",
"score": "0.68399614",
"text": "def fetch_contacts\n cuser =User.find params[:cuser]\n\tif cuser.is_super_admin?\n\t\tindividual_contacts = cuser.organization.individual_contacts.order(\"#{sort_column} #{sort_direction}\")\n\t\t#company_contacts = cuser.organization.company_contacts.order(\"#{sort_company_column} #{sort_direction}\")\n else\n\t\tindividual_contacts = IndividualContact.where(\"created_by=?\", cuser.id).order(\"#{sort_column} #{sort_direction}\")\n\t\t#company_contacts = CompanyContact.where(\"created_by=?\", cuser.id).order(\"#{sort_company_column} #{sort_direction}\")\n\tend\n if params[:sSearch].present?\n individual_contacts = individual_contacts.where(\"first_name like :search or email like :search\", search: \"%#{params[:sSearch]}%\")\n #company_contacts = company_contacts.where(\"name like :search or email like :search\", search: \"%#{params[:sSearch]}%\")\n\n end\n # Return combined contacts object and paginate\n all_contacts = individual_contacts #+ company_contacts\n all_contacts.paginate(:page => page, :per_page => per_page)\n end",
"title": ""
},
{
"docid": "c8b9bf1d21b888439a45cb0e05a95fcf",
"score": "0.6827005",
"text": "def get_contacts(opts = {})\n data, status_code, headers = get_contacts_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "c926690a97844a9e3e23f46b051a773f",
"score": "0.6824224",
"text": "def load_contacts\n Contact.all.map{|u| [ u.contact_name, u.contact_name ]}\n end",
"title": ""
},
{
"docid": "a8babfd199d9fac428c331fa03bd5b49",
"score": "0.68196887",
"text": "def display_all_contacts\n all_contacts = Contact.all\n display_contacts(all_contacts)\n end",
"title": ""
},
{
"docid": "68457282fa0aca7cb5c3049ab0f448df",
"score": "0.6815752",
"text": "def list_contacts(opts = {})\n data, _status_code, _headers = list_contacts_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "c6a8885c0ecbdf5f83cec4ba94835a3b",
"score": "0.681206",
"text": "def all\n puts \"\\n\"\n connection.exec(\"SELECT * FROM contacts;\").each do |row|\n puts \"ID: #{row['id']} \\t Name: #{row['name']} \\t Email: #{row['email']}\"\n end\n puts \"\\n\"\n end",
"title": ""
},
{
"docid": "bb82cc5a7124c3bc7e47358f825d3f76",
"score": "0.68079233",
"text": "def contacts()\n return MicrosoftGraph::Me::Contacts::ContactsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "76717021cbb3a752c7f4e1901518e68a",
"score": "0.6793745",
"text": "def contacts\n Services::ContactsService.new(@api_service)\n end",
"title": ""
},
{
"docid": "0cac6f41cf4756bccbb68defbb95ecf5",
"score": "0.67931896",
"text": "def index\n # @contacts = Contact.all\n # byebug\n @contacts = current_user.contacts\n end",
"title": ""
},
{
"docid": "8140d8642f9be39d8485c610f585dc5d",
"score": "0.6779426",
"text": "def list_contacts(opts = {})\n data, _status_code, _headers = list_contacts_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "3b4b48c63f4fa72ac594700db9b4fcfa",
"score": "0.6776687",
"text": "def display_all_contacts\n display_contacts(Contact.all)\n end",
"title": ""
},
{
"docid": "ddef4cbdad5ddfb9687c9f482bfef6ee",
"score": "0.6774965",
"text": "def get_contacts(import_id = nil)\n import_id ||= @import_id\n contacts = nil\n if resp = get_contacts_raw(import_id)\n # decode the contacts for consumption\n contacts = Contact.from_array(resp['contacts'])\n contacts_owner = Contact.new(resp['contacts_owner']) rescue nil\n end\n [contacts, contacts_owner]\n end",
"title": ""
},
{
"docid": "4e36318c173b6b68355e0edf8e4e7b41",
"score": "0.67688394",
"text": "def all\n @page_header = 'All Contacts'\n conditions = user_search_parameters('contacts')\n \n @contact_pages, @contacts = paginate :contacts, :select => 'contacts.id, contacts.first_name, \n contacts.last_name, contacts.mobile,\n contacts.phone, contacts.fax, contacts.user_id,\n contacts.email, \n CONCAT(users.first_name,\\' \\', users.last_name) as agent,\n users.is_active as agent_is_active',\n :joins => 'LEFT JOIN users ON(users.id=contacts.user_id)',\n :per_page => 20,\n :order => 'agent, contacts.first_name',\n :conditions => conditions\n render :action => 'index'\n end",
"title": ""
},
{
"docid": "4c8983614c3ddb14ecce68596f16c4ef",
"score": "0.6765038",
"text": "def all\n @@conn.exec(\"SELECT * FROM contact;\") do |results|\n \t\t#results is a collection (array) of records (hashes)\n \t\tresults.each do |contact|\n \t puts contact.inspect\n end\n end\n\n# @@contacts\n end",
"title": ""
},
{
"docid": "f53850375840d419f9588beb3f6c39d9",
"score": "0.67607063",
"text": "def contacts\n @contacts ||= CreditorContactProxy.new(self)\n end",
"title": ""
},
{
"docid": "f82f2d553707786dadfa6bd9ecdbd294",
"score": "0.6749328",
"text": "def get_contacts(opts = {})\n data, _status_code, _headers = get_contacts_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "dcf35a0a674b52474c4ded3bf18bd4d2",
"score": "0.67475",
"text": "def get_account_contacts\n acontacts = self.contact.accounts[0].present? ? (self.contact.accounts[0].contacts - [self.contact]) : []\n clientcontacts = self.matter_peoples.client_contacts\n acontacts - clientcontacts.collect(&:contact)\n end",
"title": ""
},
{
"docid": "5601706bb6ad656d3e4ca7fd563a4eb5",
"score": "0.673517",
"text": "def contacts\n respond_with_entity(api.get('/api/v1/profile/contacts'),\n PassaporteWeb::Entities::Profile::Contacts)\n end",
"title": ""
},
{
"docid": "8b4fd9ae852cf84fc2ff238be5f131d7",
"score": "0.6730487",
"text": "def list\n ContactDatabase.all\n ContactDatabase.all.map do |row|\n Contact.new(*FIELDS.map {|field| row[field]})\n end\n end",
"title": ""
},
{
"docid": "9222c7220372991279d1f55840cd6c15",
"score": "0.6720363",
"text": "def get_contacts(opts = {})\n data, _status_code, _headers = get_contacts_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "9222c7220372991279d1f55840cd6c15",
"score": "0.6720363",
"text": "def get_contacts(opts = {})\n data, _status_code, _headers = get_contacts_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "2cb4c31013caeb326b4c5827a750feb8",
"score": "0.67089707",
"text": "def get_contacts\n @contacts_selection = Contact.all\n end",
"title": ""
},
{
"docid": "82f8a333a6f4d5d3cc12f7925a7a71d9",
"score": "0.6704021",
"text": "def index\n @contacts = current_user.contacts.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contacts }\n end\n end",
"title": ""
},
{
"docid": "d00189cb8ecc47b385aeba81c0a33b5f",
"score": "0.6703707",
"text": "def get_contacts(inc_non_collidable)\n Body.validate(self)\n contacts = []\n ovs = MSPhysics::Newton.is_object_validation_enabled?\n MSPhysics::Newton.enable_object_validation(false)\n MSPhysics::Newton::Body.get_contacts(@_address, inc_non_collidable).each { |data|\n body = MSPhysics::Newton::Body.get_user_data(data[0])\n if body.is_a?(Body)\n contacts << Contact.new(body, data[1], data[2], data[3], data[4])\n end\n }\n MSPhysics::Newton.enable_object_validation(ovs)\n contacts\n end",
"title": ""
},
{
"docid": "3dfcb9700336fb8c5468cb4433b0f247",
"score": "0.67020875",
"text": "def contacts!(params = {})\n # contacts in this group\n @contacts ||= get_contacts(params)\n end",
"title": ""
},
{
"docid": "540870b946175971d141cccf087a6646",
"score": "0.67014796",
"text": "def contacts\n @contacts ||= ContactsService.new(@http_client)\n end",
"title": ""
},
{
"docid": "4c96512db5b51c427af6994f6490f6bf",
"score": "0.66852814",
"text": "def index\n\t\t@contacts = Contact.all\n\tend",
"title": ""
},
{
"docid": "4818c8ef6f768b3eca7974a3a61cd676",
"score": "0.6669328",
"text": "def display_all_contacts\n contacts = Contact.all\n puts \"********\\n\\nid Name Email\"\n contacts.each do |contact|\n puts \"#{contact.id} #{contact.full_name} #{contact.email}\"\n end\n return\n end",
"title": ""
},
{
"docid": "7589233bad2cceef2598315283dbaac9",
"score": "0.6664366",
"text": "def display_all_contacts\n \t\t@contacts.each { |i| i.display_contact }\n \tend",
"title": ""
},
{
"docid": "12f19854db759bcdf0372d52a58d0b0a",
"score": "0.6641987",
"text": "def index\n\t\t@user = User.find_by(username: params[:username])\n\n\t\trender_list = [];\n\n\t\tfor contact in @user.contacts do\n\t\t\tcontact_hash = Hash.new\n\t\t\tcontact_hash[\"contact\"] = contact\n\t\t\tcontact_hash[\"profile\"] = Profile.find(contact.user_profile_id);\n\t\t\tcontact_hash[\"files\"] = []\n\t\t\tif contact.username != nil\n\t\t\t\tcontact_hash[\"files\"] = User.find_by(username: contact.username).db_files\n\t\t\tend\n\t\t\trender_list << contact_hash\n\t\tend\n\n \trender json: { contacts: render_list }\n\tend",
"title": ""
},
{
"docid": "9cb157d59338b6e77038f81fa421e7b8",
"score": "0.66186804",
"text": "def contacts\n @contacts ||= DebtorContactProxy.new(self)\n end",
"title": ""
},
{
"docid": "9cb157d59338b6e77038f81fa421e7b8",
"score": "0.66186804",
"text": "def contacts\n @contacts ||= DebtorContactProxy.new(self)\n end",
"title": ""
},
{
"docid": "9cb157d59338b6e77038f81fa421e7b8",
"score": "0.66186804",
"text": "def contacts\n @contacts ||= DebtorContactProxy.new(self)\n end",
"title": ""
},
{
"docid": "9cb157d59338b6e77038f81fa421e7b8",
"score": "0.66186804",
"text": "def contacts\n @contacts ||= DebtorContactProxy.new(self)\n end",
"title": ""
},
{
"docid": "38e8f3737299f33ec390c6930af73e27",
"score": "0.661078",
"text": "def contacts_info\n @user = User.find(params[:id]) \n @contacts = @user.personal_contacts\n end",
"title": ""
},
{
"docid": "27626b5ad5b00136de4038a06201ade7",
"score": "0.6609119",
"text": "def index\n @user_contacts = @current_user.user_contacts.order(name: 'ASC').paginate(:page => params[:page], :per_page => 25)\n @pollzapp_contacts = @user_contacts.select { |c| c.contact.present? }\n @other_contacts = @user_contacts.reject { |c| c.contact.present?}\n end",
"title": ""
},
{
"docid": "2213643afd1168c4585ce8409d10f7ae",
"score": "0.6607615",
"text": "def index\n\t@contacts = Contact.find(:all)\n\n end",
"title": ""
},
{
"docid": "a29fd56573399362621dfa89af0e2197",
"score": "0.6604124",
"text": "def fetch_contacts\n cuser =User.find params[:cuser]\n\n if params[:tab].present? && params[:tab] == \"all_contacts\"\n puts \"coming to all cotacts tab................................\"\n if cuser.is_admin? \n puts \"coming to is_admin?................................\" \n individual_contacts = cuser.organization.individual_contacts.order(\"#{sort_column} #{sort_direction}\")\n else\n puts \"coming to not admin................................\" \n individual_contacts = cuser.organization.individual_contacts.where(\"owner_id=? OR is_public=?\", cuser.id, true).order(\"#{sort_column} #{sort_direction}\")\n end\n else\n puts \"coming to no tab present................................\" \n individual_contacts = cuser.organization.individual_contacts.where(\"owner_id=? \", cuser.id).order(\"#{sort_column} #{sort_direction}\")\n \n end\n if params[:sSearch].present?\n individual_contacts = individual_contacts.where(\"first_name like :search or email like :search\", search: \"%#{params[:sSearch]}%\")\n end\n all_contacts = individual_contacts.where(\"is_archive=?\",false).includes(:deals_contacts,:tasks)\n all_contacts.paginate(:page => page, :per_page => per_page)\n end",
"title": ""
},
{
"docid": "d0391891fdb76f7478cabb11c8e4d468",
"score": "0.6603695",
"text": "def list_contacts\n get_results(Contact.includes(:numbers))\n end",
"title": ""
},
{
"docid": "898b214ad94c58e2f036782518639639",
"score": "0.66018736",
"text": "def index\n @contacts = current_user.contacts.desc.search(params[:search_by_name_or_number])\n end",
"title": ""
},
{
"docid": "11c7c02ddf090629abc5f57cf7456ef0",
"score": "0.6598805",
"text": "def contacts\n contact_list.values\n end",
"title": ""
},
{
"docid": "317ca6cf89316e4d14d9b0b80cb83426",
"score": "0.6593942",
"text": "def index\n \t@contacts = Contact.all\n end",
"title": ""
},
{
"docid": "23887fa93a868bddd78cae4c84ce1d01",
"score": "0.6582099",
"text": "def get_contacts_for_roles\n roles_in_contact_types? ? user_role_contacts : @contacts\n end",
"title": ""
},
{
"docid": "064f9e180d3f96c3047631b6cc4d7191",
"score": "0.65803784",
"text": "def index\n @contacts = current_user.contacts\n\n render json: @contacts\n end",
"title": ""
},
{
"docid": "064f9e180d3f96c3047631b6cc4d7191",
"score": "0.65803784",
"text": "def index\n @contacts = current_user.contacts\n\n render json: @contacts\n end",
"title": ""
},
{
"docid": "2f26c242b6491f20533739f780e0a624",
"score": "0.65646017",
"text": "def contacts\n gmail_contacts = GmailContacts.new params['token'].to_s\n\n gmail_contacts.fetch(params['email'])\n \n @contacts = gmail_contacts.contacts\n end",
"title": ""
}
] |
edd216a463b7e82876a555362c8a349b
|
GET /shops/1 GET /shops/1.json
|
[
{
"docid": "b953512e7b8f5768562798a29f9763fc",
"score": "0.0",
"text": "def show\n @shop = Shop.find(params[:id])\n @ave_review = Review.where(shop_id: @shop.id).average(:rate)\n end",
"title": ""
}
] |
[
{
"docid": "2d4dc1c76cb1689bfdd1076ddbfc025c",
"score": "0.7023943",
"text": "def index\n @shop = Shop.find(1)\n render :json => @shop\n return\n end",
"title": ""
},
{
"docid": "b743ab232382c0a1ebd288c8b980a002",
"score": "0.6906654",
"text": "def index\n @workshops = Workshop.past\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workshops }\n end\n end",
"title": ""
},
{
"docid": "f4caf5c2ff7b8cd207caacdbaf4f77d8",
"score": "0.6863234",
"text": "def shops\n render :nothing => true and return if params[:id].nil?\n \n if ( params[:meta] == 'tattoos' )\n @shop = Shop.find(params[:id], :include => :tattoos)\n render :json => @shop.tattoos.to_json(:include => { :assets => { :only => [:id, :data_file_name] } })\n return\n end\n \n @shop = Shop.find(params[:id])\n render :json => @shop.to_json(:include => :assets)\n end",
"title": ""
},
{
"docid": "ebc8dfd019010de427819737ec2fc39d",
"score": "0.67428267",
"text": "def show\n render json: @shop\n end",
"title": ""
},
{
"docid": "cf4871927c257fbc1f46d4394b92b6fc",
"score": "0.6735511",
"text": "def index\n @shops = @shops.all\n end",
"title": ""
},
{
"docid": "ac0ae2fb8e5c865e40d8c8cae552a4dc",
"score": "0.6721623",
"text": "def index\n @shops = Shop.all\n\n # render json: @shops\n\n completedShops = []\n\n @shops.each do |shop| \n completedShops << { shop: { created_at: shop.created_at, description: shop.description, id: shop.id, name: shop.name, logo: shop.logo, shopkeeper_id: shop.shopkeeper_id, products: shop.products } }\n end\n\n render json: completedShops\n\n end",
"title": ""
},
{
"docid": "85e138bd06f1efb947e7369842daf3cb",
"score": "0.669305",
"text": "def shop_url(params)\n @shop = Shop.find(params.id)\n render json: params\n end",
"title": ""
},
{
"docid": "3ab2e6350f0f714a9dc0424b3122be36",
"score": "0.66567355",
"text": "def show\n @workshop = Workshop.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @workshop }\n end\n end",
"title": ""
},
{
"docid": "c3a02afeeb2acc6f69db17546c62f485",
"score": "0.66534406",
"text": "def index\n @shops = Shop.all\n end",
"title": ""
},
{
"docid": "c3a02afeeb2acc6f69db17546c62f485",
"score": "0.66534406",
"text": "def index\n @shops = Shop.all\n end",
"title": ""
},
{
"docid": "c3a02afeeb2acc6f69db17546c62f485",
"score": "0.66534406",
"text": "def index\n @shops = Shop.all\n end",
"title": ""
},
{
"docid": "c3a02afeeb2acc6f69db17546c62f485",
"score": "0.66534406",
"text": "def index\n @shops = Shop.all\n end",
"title": ""
},
{
"docid": "c3a02afeeb2acc6f69db17546c62f485",
"score": "0.66534406",
"text": "def index\n @shops = Shop.all\n end",
"title": ""
},
{
"docid": "eceeb1e061696969ed4d87884b2a7f0f",
"score": "0.65839857",
"text": "def show\n @shop_ose = ShopOse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop_ose }\n end\n end",
"title": ""
},
{
"docid": "ecae0016bdf557be35c33a05e15f7375",
"score": "0.6559399",
"text": "def show\n @shop = Wmall::Shop.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop }\n end\n end",
"title": ""
},
{
"docid": "e91f15feb1da4fab04c0b75a2373ba0d",
"score": "0.6482466",
"text": "def index\n @q = params[:q]\n @q ||= \"\"\n @shops = Shop.search(@q).records\n\n\n respond_to do |format|\n format.html { render action: 'index' }\n format.json { render json: @shops, each_serializer: ShopListSerializer }\n end\n end",
"title": ""
},
{
"docid": "e6e40cdd62fdc6a9dc88ddf29792f78a",
"score": "0.6448709",
"text": "def show\n respond_to do |format|\n format.html { render action: 'show' }\n format.json { render json: @shop }\n end\n end",
"title": ""
},
{
"docid": "66e20527a44b112602383b17d91115c1",
"score": "0.643932",
"text": "def index\n @shops = Shop.all\n @search = Shop.search(params[:q])\n @shops = @search.result.page(params[:page]).per(30)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shops }\n end\n\n end",
"title": ""
},
{
"docid": "5eeb41f23f468df55e1f03cf6ad2a7d2",
"score": "0.64357466",
"text": "def index\n @shop_sections = ShopSection.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shop_sections }\n end\n end",
"title": ""
},
{
"docid": "ad1d5add7ebc9bf76f666de93ea452ea",
"score": "0.63429004",
"text": "def index\n @shops = @business_type.shops.all\n end",
"title": ""
},
{
"docid": "5f2dde5d52c53eaa33f1ead0f15708bb",
"score": "0.63320714",
"text": "def index\n @coupons = Coupon.where('shop_id = ?', params[:shop_id])\n\n respond_to do |format|\n format.html { show_from_resource('index', 'shop_index') }\n format.json { render json: @coupons }\n end\n end",
"title": ""
},
{
"docid": "9a0618baa3c562aa3ebc76e07629df32",
"score": "0.631366",
"text": "def show\n @shops = Barbershop.find(params[:id])\n\n end",
"title": ""
},
{
"docid": "3015ca5274ddc5c7d9129d98c462ea22",
"score": "0.62554944",
"text": "def show\n @shop_item = @flat.shop_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop_item }\n end\n end",
"title": ""
},
{
"docid": "5db093a4ee426a01e88b12aef0304c99",
"score": "0.6233736",
"text": "def show\n @home_categories_products_indices_shop = Home::Categories::Products::Indices::Shop.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home_categories_products_indices_shop }\n end\n end",
"title": ""
},
{
"docid": "afbc5eb27f80476bf87bb367b2794c4f",
"score": "0.6199818",
"text": "def index\n @shops = Shop.all\n\n respond_to do |format|\n format.html\n format.js\n end\n end",
"title": ""
},
{
"docid": "0497c63abcf53b8a6a01897bd999e715",
"score": "0.61960727",
"text": "def show \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @workshop }\n end\n end",
"title": ""
},
{
"docid": "915be1be290fbc54326d4d19e3bda774",
"score": "0.61840725",
"text": "def index\n @workshops = Workshop.all\n end",
"title": ""
},
{
"docid": "2257e9d4179964e87e5fa526da1c31eb",
"score": "0.6168041",
"text": "def index\n @shoes = Shoe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shoes }\n end\n end",
"title": ""
},
{
"docid": "aaf54d00e444d031d324b86fb96ccb4c",
"score": "0.6162913",
"text": "def show\n @shoppinglist = Shoppinglist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shoppinglist }\n end\n end",
"title": ""
},
{
"docid": "f15c9679448fc4de3ac6b169e0348beb",
"score": "0.61339694",
"text": "def get_shop\n @shop = Shop.find(params[:shop_id])\n end",
"title": ""
},
{
"docid": "c958fbd8929630d1701647c9b5092eb8",
"score": "0.6128387",
"text": "def show\n render json: @shelter\n end",
"title": ""
},
{
"docid": "0382563017f71f768645d1909a3a3ff7",
"score": "0.6121566",
"text": "def index\n @shop_section = ShopSection.find_by_short_url(\"brands\")\n @brands = Brand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brands }\n end\n end",
"title": ""
},
{
"docid": "bf94e516c878809af782ae35b9c921b1",
"score": "0.6117067",
"text": "def index\n @shots = Shot.all\n\n render json: @shots\n end",
"title": ""
},
{
"docid": "92f52c04b9aaf85252a0fe2ceacb8eff",
"score": "0.6107817",
"text": "def index\n resource_params = {}\n resource_params[:f] = params[:f].to_json if params[:f].present?\n resource_params[:page] = params[:page].present? ? params[:page] : 1\n resource_params[:per] = params[:per].present? ? params[:per] : 12\n\n @shops = Shop.all(params: resource_params)\n\n @shops = Kaminari::PaginatableArray.new(@shops,{\n limit: @shops.http_response['X-limit'].to_i,\n offset: @shops.http_response['X-offset'].to_i,\n total_count: @shops.http_response['X-total'].to_i\n })\n\n @categories = Category.all\n @sheds = Shed.all\n @users = User.all(params: { f: { scopes: { role: :seller }, select: [:id, :name] }.to_json })\n end",
"title": ""
},
{
"docid": "98348c4a9cacfd8e5de62eab9380d121",
"score": "0.6105632",
"text": "def index\n @admin_workshops = Admin::Workshop::Workshop.all.paginate(page: params[:page])\n\n respond_to do |format|\n format.html\n format.json { render json: @admin_workshops.map { |i| { value: i.id, text: i.to_s } }, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "16d2b07e59362dfaddd6448ba406375e",
"score": "0.6091542",
"text": "def show\n render json: @service\n end",
"title": ""
},
{
"docid": "5d6c9ce6f507f718cdf343e71a7108d2",
"score": "0.6085885",
"text": "def show\n @shoe = Shoe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shoe }\n end\n end",
"title": ""
},
{
"docid": "a496f2fa200f332edf563255c4e00058",
"score": "0.6043952",
"text": "def show\n @shop_purchase = Shop::Purchase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop_purchase }\n end\n end",
"title": ""
},
{
"docid": "6f7bc745b80f878064334398949fad95",
"score": "0.6041258",
"text": "def show\n @shop = Shop.find(params[:id])\n breadcrumbs.add @shop.name,nil\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop }\n end\n end",
"title": ""
},
{
"docid": "75006cb180bf025f53a9cf91ce9fc65c",
"score": "0.6033325",
"text": "def index\n @sales = Sale.all\n\n render json: @sales\n end",
"title": ""
},
{
"docid": "f49f77a505722bc2e8a653af5683a722",
"score": "0.598931",
"text": "def show\n @shop = Shop.find(params[:id])\n @rates = @shop.rates.page(params[:page])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop }\n end\n end",
"title": ""
},
{
"docid": "e5a7b4836c9e9db870212f6bd4d0c00a",
"score": "0.5983008",
"text": "def index\n @shops = if params[:user_id] || user_signed_in?\n Shop.where(user_id: params[:user_id] || current_user.id).page(params[:page])\n else\n Shop.all.page(params[:page])\n end\n end",
"title": ""
},
{
"docid": "3a01c6af14f5848d1241b823f999d79b",
"score": "0.5969764",
"text": "def index\n\t\t@shops = current_user.shop_profiles\n\tend",
"title": ""
},
{
"docid": "c8ee062ed687fa3af67071deaac81914",
"score": "0.59607613",
"text": "def index\n return redirect_to shops_path\n end",
"title": ""
},
{
"docid": "9ed5b5e2dbac89355608cda435da2c78",
"score": "0.5958986",
"text": "def show\n @serviceorg = Serviceorg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @serviceorg }\n end\n end",
"title": ""
},
{
"docid": "625f2505fde28b5d5556175518987f84",
"score": "0.59586906",
"text": "def index\n @gets = Get.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gets }\n end\n end",
"title": ""
},
{
"docid": "2e6c5c01c505ed2b4514b27116ad6d8c",
"score": "0.5946944",
"text": "def index\n @shopdetails = Shopdetail.all\n end",
"title": ""
},
{
"docid": "5a5652083149e1e5bb1f3db4dfbb1eb5",
"score": "0.59396595",
"text": "def show\n @api_wmall_shop_activity = Api::Wmall::ShopActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_wmall_shop_activity }\n end\n end",
"title": ""
},
{
"docid": "371591f0f6c1a07edc50e1025c92bf42",
"score": "0.59327155",
"text": "def index\n @api_v1_stores = Store.all\n json_response(@api_v1_stores)\n end",
"title": ""
},
{
"docid": "101460710b669b67f96b513d093ffd0c",
"score": "0.59207594",
"text": "def show\n @stock = Stock.find(params[:id])\n\n render json: @stock\n end",
"title": ""
},
{
"docid": "ca36f129ff09134cd9f646ff505d993a",
"score": "0.590729",
"text": "def index\n @operations = Operation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @operations }\n end\n end",
"title": ""
},
{
"docid": "9fe3b0c71ce635510c5a9dfd1cba005b",
"score": "0.5894382",
"text": "def show\n @operation = Operation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @operation }\n end\n end",
"title": ""
},
{
"docid": "a2708651741bd1c00cc4a0689104d700",
"score": "0.5885229",
"text": "def show\n if params[:short_url]\n @shop_section = ShopSection.find_by_short_url(params[:short_url])\n else\n @shop_section = ShopSection.find(params[:id])\n end\n\n raise NotFound unless @shop_section\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop_section }\n end\n end",
"title": ""
},
{
"docid": "85ada6ecb57860ecf25ce5bc3a400e5c",
"score": "0.5880923",
"text": "def show\n @troop = Troop.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @troop }\n end\n end",
"title": ""
},
{
"docid": "f52778782d86d4e874ac9540109aac8d",
"score": "0.58744603",
"text": "def show\n @shop = Shop.find(params[:id])\n @candies = @shop.candies\n @shelves = @shop.shelves\n end",
"title": ""
},
{
"docid": "43afa847ce361feb5051d02b45774641",
"score": "0.58711886",
"text": "def show\n @shop_photo = ShopPhoto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop_photo }\n end\n end",
"title": ""
},
{
"docid": "8285e733c4240bc2d43713cf73ba6e1e",
"score": "0.5866449",
"text": "def index\n @sprintstories = Sprintstory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sprintstories }\n end\n end",
"title": ""
},
{
"docid": "5d3ee1ddc496d3384fdf2eeef360da50",
"score": "0.58624345",
"text": "def shop\n return shops[0]\n end",
"title": ""
},
{
"docid": "b2ea03ba07f827d766139d6a0c50a683",
"score": "0.58545053",
"text": "def index\n @api_v1_shopping_lists = ShoppingList.all\n end",
"title": ""
},
{
"docid": "c045a27af1c87c31cde771dd4156ca54",
"score": "0.5831419",
"text": "def show\n render json: @service_history\n end",
"title": ""
},
{
"docid": "83f5ed46108714702f1c9a2ffa3d80ad",
"score": "0.58300596",
"text": "def show\n @supermarket = Supermarket.find(params[:id])\n respond_to do |format|\n format.json { render json: @supermarket, status: :ok } \n end \n end",
"title": ""
},
{
"docid": "bc2365bfaa3d07cb858848f3c12d40e0",
"score": "0.58292764",
"text": "def index\n @api_v1_menus = Menu.all\n render json: @api_v1_menus\n end",
"title": ""
},
{
"docid": "c078fe70aa40fb34482622c1a45ec1c1",
"score": "0.5825554",
"text": "def show\n render json: @sale\n end",
"title": ""
},
{
"docid": "31d4682c3306ba1e46e81fd2d2a3d99f",
"score": "0.5804328",
"text": "def show\n @sale = Sale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sale }\n end\n end",
"title": ""
},
{
"docid": "31d4682c3306ba1e46e81fd2d2a3d99f",
"score": "0.5804328",
"text": "def show\n @sale = Sale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sale }\n end\n end",
"title": ""
},
{
"docid": "b97171cafa33c13a17f8dab1b8e53116",
"score": "0.5804116",
"text": "def show\n @sprintstory = Sprintstory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sprintstory }\n end\n end",
"title": ""
},
{
"docid": "2ac450bbccbc7411772c8e5f6fda9a70",
"score": "0.5798489",
"text": "def show\n @stable = Stable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stable }\n end\n end",
"title": ""
},
{
"docid": "168c93cff16b1ed34c1ae3e87383496f",
"score": "0.5794031",
"text": "def index\n @stores = Store.all\n render json: @stores\n end",
"title": ""
},
{
"docid": "35c1f1aff7b458ba38b09b31fa0687ea",
"score": "0.5788802",
"text": "def show\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio }\n end\n end",
"title": ""
},
{
"docid": "8f9f8dae1c8112b56acf6356122941f7",
"score": "0.5785929",
"text": "def index\n @shopping_carts = ShoppingCart.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shopping_carts }\n end\n end",
"title": ""
},
{
"docid": "8271da9d32bf9500cef515166f7d53e9",
"score": "0.57739943",
"text": "def index\n @team = Team.find(params[:team_id])\n @sprints = @team.sprints.find(:all)\n\n respond_to do |format|\n format.html\n format.json\n end\n end",
"title": ""
},
{
"docid": "e444bb126df1caa7bb7658c13397f56f",
"score": "0.5773786",
"text": "def show\n @socio = Socio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @socio }\n end\n end",
"title": ""
},
{
"docid": "204f1d9345619c5441648d9945db2fff",
"score": "0.57627773",
"text": "def show\n render json: @promotion\n end",
"title": ""
},
{
"docid": "204f1d9345619c5441648d9945db2fff",
"score": "0.57627773",
"text": "def show\n render json: @promotion\n end",
"title": ""
},
{
"docid": "f725d8897a3d0a099e85938af063b3ec",
"score": "0.57578516",
"text": "def show\n @home_promotion = Home::Promotion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home_promotion }\n end\n end",
"title": ""
},
{
"docid": "47ce7b3d98a4fc8b6fcd69425fcee6fc",
"score": "0.57459587",
"text": "def show\n @service = Service.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @service }\n end\n end",
"title": ""
},
{
"docid": "47ce7b3d98a4fc8b6fcd69425fcee6fc",
"score": "0.57459587",
"text": "def show\n @service = Service.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @service }\n end\n end",
"title": ""
},
{
"docid": "47ce7b3d98a4fc8b6fcd69425fcee6fc",
"score": "0.57459587",
"text": "def show\n @service = Service.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @service }\n end\n end",
"title": ""
},
{
"docid": "9685381dc7f79aafbe09f8a5693cf96a",
"score": "0.57343423",
"text": "def index\n @store = Store.find(params[:store_id])\n @menus = @store.menus\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @menus }\n end\n end",
"title": ""
},
{
"docid": "c1131125291b7d642c8bc0fc87fddf57",
"score": "0.57292473",
"text": "def show\n render json: @product, status: 200\n end",
"title": ""
},
{
"docid": "30717cd6f877ebea5f2306d328429086",
"score": "0.57290643",
"text": "def show\n @shop_transaction = Shop::Transaction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop_transaction }\n end\n end",
"title": ""
},
{
"docid": "0638900664f3abbc3599799939321159",
"score": "0.5726239",
"text": "def show\n \n @shop = Shop.find(params[:id])\n @json = @shop.to_gmaps4rails\n \n @reviews = Review.where(:shop_id => params[:id] )\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shop }\n end\n end",
"title": ""
},
{
"docid": "437c32361777ba643d2acb89a6a236d3",
"score": "0.57175756",
"text": "def index\n @opportunities = Opportunity.all\n\n render json: @opportunities\n end",
"title": ""
},
{
"docid": "92d87189ba3298b171f77c895073d717",
"score": "0.571585",
"text": "def show\n @shopifyproduct = Shopifyproduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shopifyproduct }\n end\n end",
"title": ""
},
{
"docid": "d3783b0ee2d7d0ff608fac2e4f831761",
"score": "0.5709622",
"text": "def index\n @site_plans = @product.site_plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @site_plans }\n end\n end",
"title": ""
},
{
"docid": "754abfd46c0789c8080b41cb6a49bf0b",
"score": "0.57085",
"text": "def new\n @shop = Shop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shop }\n end\n end",
"title": ""
},
{
"docid": "754abfd46c0789c8080b41cb6a49bf0b",
"score": "0.57085",
"text": "def new\n @shop = Shop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shop }\n end\n end",
"title": ""
},
{
"docid": "754abfd46c0789c8080b41cb6a49bf0b",
"score": "0.57085",
"text": "def new\n @shop = Shop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shop }\n end\n end",
"title": ""
},
{
"docid": "4b9b6d4e8f46e13884b60780cd13063e",
"score": "0.5708013",
"text": "def show\n @socio = Socio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @socio }\n end\n end",
"title": ""
},
{
"docid": "2d8dd7539a6733b60fcbef370d89b6a6",
"score": "0.57057095",
"text": "def getShop\n @shop\n end",
"title": ""
},
{
"docid": "60528cd7ab53148df76a39e37b8f70e9",
"score": "0.5695151",
"text": "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end",
"title": ""
},
{
"docid": "600c1891a5d94f8ba881adec9215412f",
"score": "0.5694488",
"text": "def show\n @store2product = Store2product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store2product }\n end\n end",
"title": ""
},
{
"docid": "57a8d57919f80b6f315d84a109419aeb",
"score": "0.5692371",
"text": "def show\n @shopping_area = ShoppingArea.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shopping_area }\n end\n end",
"title": ""
},
{
"docid": "dcc5d8c8b6a5007edbc5653c529c6c7d",
"score": "0.5690389",
"text": "def show\n @shout = Shout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shout }\n end\n end",
"title": ""
},
{
"docid": "28a35690fa2b388a6c5ed2dabc517dc7",
"score": "0.5689365",
"text": "def index\n @sales = @saleService.all_to_json().as_json;\n end",
"title": ""
},
{
"docid": "4d9fbfe03e8388c0a3df84c8738f15a1",
"score": "0.5688959",
"text": "def show\n @sprint = Sprint.find(params[:id])\n @stat = Status.find(4)\n @stories = Story.where(\"status_id = ?\", @stat.id)\n @examples = @sprint.stories \n @project_id = @examples.first.project_id\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sprint }\n end\n end",
"title": ""
},
{
"docid": "dcc5d8c8b6a5007edbc5653c529c6c7d",
"score": "0.56889254",
"text": "def show\n @shout = Shout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shout }\n end\n end",
"title": ""
},
{
"docid": "f4cf880f4ab36e81766e9ba007b639bd",
"score": "0.5687988",
"text": "def index\n @supplysites = Supplysite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @supplysites }\n end\n end",
"title": ""
},
{
"docid": "e23b4bc366ee5065536356bc50dc4941",
"score": "0.5685755",
"text": "def index\n @socios = Socio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @socios }\n end\n end",
"title": ""
},
{
"docid": "af71f1b7547be75163d541f87388d56b",
"score": "0.5684342",
"text": "def show\n render json: @opportunity\n end",
"title": ""
},
{
"docid": "e4184e3b38a443d793b14f0c2c029585",
"score": "0.5683234",
"text": "def index\n @reviews = Review.where(shop_id: params[:shop_id])\n @shop = Shop.find(params[:shop_id])\n end",
"title": ""
}
] |
415c4ff96c90a980ea536b4c5399977e
|
Start / Create a machine
|
[
{
"docid": "2ae037d1691cdd92fa994bcfaf943477",
"score": "0.70942104",
"text": "def start\n create_machine :config_id => self.setting, :cluster_number => 1\n end",
"title": ""
}
] |
[
{
"docid": "530e5c19aceddd2f4bb3ae91287e65c4",
"score": "0.7519377",
"text": "def new_machine\n self.start\n end",
"title": ""
},
{
"docid": "d73de6c6bf0a3f21df68606e9f332d83",
"score": "0.66087484",
"text": "def start(inode)\n logger.info(\"machine.start\")\n raise Exceptions::NotImplemented\n end",
"title": ""
},
{
"docid": "98e6c303be57b4ab59c5a89b5853aad2",
"score": "0.66011703",
"text": "def create_virtual_machine(vm)\n kubevirt_client.create_virtual_machine(vm)\n end",
"title": ""
},
{
"docid": "70a3919d0415b7f88a91c724767e24ce",
"score": "0.6598368",
"text": "def start_command\n can_start_instance? or return nil\n\n kvm = SysConf.value_for('kvm_bin')\n basedir = SysConf.value_for(:pid_dir)\n\n inst_num = maint_mode? ? 0 : laboratory.next_instance_to_start\n inst_name = laboratory.instance_name(inst_num)\n mac = laboratory.mac_for_instance(inst_num)\n disks = disk_devs.map {|d| d.dev_string }.join(' ')\n\n pidfile = File.join(basedir,\"#{inst_name}.pid\")\n socket = File.join(basedir, \"#{inst_name}.socket\")\n\n [ \"#{kvm} -name #{inst_name} -m #{ram} -localtime -pidfile #{pidfile}\",\n \"-usb -usbdevice tablet\",\n \"-net nic,macaddr=#{mac},model=#{net_iface.name}\",\n \"-net tap,ifname=tap_#{inst_name},script=/etc/kvm/kvm-ifup\",\n \"-boot c #{disks}\",\n \"-daemonize -vnc none\",\n \"-monitor unix:#{socket},server,nowait\"\n ].join(' ')\n end",
"title": ""
},
{
"docid": "9443338315f8b427a8d8527957c6f61f",
"score": "0.6587569",
"text": "def setup_create\n\t\traise NotImplementedError, \"machine_create is not implemented\"\n\tend",
"title": ""
},
{
"docid": "c18d2a7a2dee93dc6ffbf0874cc71754",
"score": "0.6585982",
"text": "def allocate_machine(action_handler, machine_spec, machine_options)\n Core.connect crowbar_url\n\n # If the server does not exist, create it\n create_servers(action_handler, { machine_spec => machine_options }, Chef::ChefFS::Parallelizer.new(0))\n machine_spec\n end",
"title": ""
},
{
"docid": "e1493667dff126797043c891f2770762",
"score": "0.65805036",
"text": "def create\n\t\t@machine = Machine.new(machine_params)\n\t\t@machine.req_num = 0\n\t\t@machine.duration = 0\n\t\t@machine.score = 90\n\t\trespond_to do |format|\n\t\t if @machine.save\n\t\t format.html { redirect_to '/admin/machines/' + @machine.id.to_s, notice: 'machine was successfully created.' }\n\t\t format.json { render :show, status: :created, location: @machine }\n\t\t else\n\t\t format.html { render :new }\n\t\t format.json { render json: @machine.errors, status: :unprocessable_entity }\n\t\t end\n\t\tend\n\tend",
"title": ""
},
{
"docid": "105808771713b1daead1005d944b8284",
"score": "0.65678006",
"text": "def create\n @core_machine = Core::Machine.new(params[:core_machine])\n\n respond_to do |format|\n if @core_machine.save\n format.html do\n flash[:success] = 'Machine was successfully created.'\n redirect_to @core_machine\n end\n format.json { render json: @core_machine, status: :created, location: @core_machine }\n else\n format.html { render action: \"new\" }\n format.json { render json: @core_machine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "515227d6325544821cbb98b65654a494",
"score": "0.6540337",
"text": "def start_kvm(name)\n unless(system(\"virsh start #{name}\"))\n raise \"Failed to start node: #{name}\"\n end\nend",
"title": ""
},
{
"docid": "7d45ecbb88ef30ad3b5178e8bc6abfad",
"score": "0.64340496",
"text": "def ready_machine(action_handler, machine_spec, machine_options)\n machine_options = deep_symbolize(machine_options)\n merge_options! machine_options\n\n vm = start_machine(action_handler, machine_spec, machine_options)\n if vm.nil?\n raise \"Machine #{machine_spec.name} does not have a server \"\\\n 'associated with it, or server does not exist.'\n end\n\n bootstrap_options = machine_options[:bootstrap_options]\n\n transport_respond?(\n machine_options,\n vm,\n action_handler,\n machine_spec\n )\n\n machine = machine_for(machine_spec, machine_options)\n\n setup_extra_nics(action_handler, bootstrap_options, vm, machine, machine_spec)\n\n if has_static_ip(bootstrap_options) && !is_windows?(vm)\n setup_ubuntu_dns(machine, bootstrap_options, machine_spec)\n end\n\n ## Check if true available after added nic\n @vm_helper.open_port?(machine_spec.location['ipaddress'], @vm_helper.port) unless machine_spec.location['ipaddress'].nil?\n machine\n end",
"title": ""
},
{
"docid": "7b8ace91a0eaf826bd99cbadabc278a3",
"score": "0.6429366",
"text": "def execute(&each_mach)\n routine_separator(:startup)\n unless @routine\n STDERR.puts \"[this is a generic startup routine]\"\n @routine = {}\n end\n machines = generic_machine_runner(:create) \n machines\n end",
"title": ""
},
{
"docid": "d8c19f5d9a430ed4f42ce8981cf4288f",
"score": "0.63852715",
"text": "def create\n @lab = Lab.find(params[:lab_id])\n @machine = @lab.machines.create(machine_params)\n\n respond_to do |format|\n if @machine.save\n format.html { redirect_to lab_path(@lab), notice: 'Machine was successfully created.' }\n format.json { render json: @machine, status: :created, location: @machine }\n else\n format.html { render action: \"new\" }\n format.json { render json: @machine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "933d00fac6e208282d684ee547130a1b",
"score": "0.6371629",
"text": "def create\n @machine = Machine.new(machine_params)\n\n respond_to do |format|\n if @machine.save\n format.html { redirect_to @machine, notice: 'Machine was successfully created.' }\n format.json { render :show, status: :created, location: @machine }\n else\n format.html { render :new }\n format.json { render json: @machine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37c636da98a1173f1b77c8e563cd6f72",
"score": "0.63657147",
"text": "def start\n register unless registered?\n \n VirtualBox.run_command! ['VBoxManage', '--nologo', 'startvm', uid,\n '--type', gui ? 'gui' : 'headless']\n self\n end",
"title": ""
},
{
"docid": "aa6011cdc11e21b6cc6a7d2af2cf934f",
"score": "0.6356376",
"text": "def start\n puts \"Starting #{@resource[:name]}\"\n return if running?\n cmd = [command(:instance_manager)]\n cmd += [\"start\"]\n cmd += [@resource[:name]]\n run(cmd)\n end",
"title": ""
},
{
"docid": "e7bf870930ca437c22d199ba75cb9828",
"score": "0.6287489",
"text": "def create_kvm_instance(name, opts={})\n cmd = \"virt-install -n #{name} --ram #{opts[:memory]} --disk \" <<\n \"path=#{File.join(KVM_HOME, 'storage', \"#{name}.qcow2\")},device=disk,bus=virtio,format=qcow2 \" <<\n \"-v --import --noautoconsole --vcpus=#{opts[:vcpus]},maxvcpus=#{opts[:maxvcpus]}\" \n unless(system(cmd))\n raise \"Failed to create KVM instance!\"\n end \nend",
"title": ""
},
{
"docid": "3dae84d931507c4455cac720722b1e5f",
"score": "0.6263476",
"text": "def start_virtual_machine(vm_name, cloud_service_name)\n vm = get_virtual_machine(vm_name, cloud_service_name)\n if vm\n if vm.status == 'ReadyRole'\n Loggerx.error \"Cannot perform the start operation on started virtual machine.\"\n else\n path = \"/services/hostedservices/#{vm.cloud_service_name}/deployments/#{vm.deployment_name}/roleinstances/#{vm.vm_name}/Operations\"\n body = Serialization.start_virtual_machine_to_xml\n Loggerx.info \"Starting virtual machine \\\"#{vm.vm_name}\\\" ...\"\n request = ManagementHttpRequest.new(:post, path, body)\n request.call\n end\n else\n Loggerx.error \"Cannot find virtual machine \\\"#{vm_name}\\\" under cloud service \\\"#{cloud_service_name}\\\".\"\n end\n end",
"title": ""
},
{
"docid": "5c3291ed0c20d4ae528544d82c3dc9e3",
"score": "0.620284",
"text": "def create_stored_virtual_machine(vm)\n kubevirt_client.create_stored_virtual_machine(vm)\n end",
"title": ""
},
{
"docid": "6c5f513b8f85f92e716403c3b10ddbff",
"score": "0.6174756",
"text": "def start\n create('start')\n end",
"title": ""
},
{
"docid": "59c6d4fd74beb2da700ba106de6d2ab0",
"score": "0.6172295",
"text": "def start(mode)\n execute(\"startvm\", @uuid, \"--type\", mode.to_s)\n end",
"title": ""
},
{
"docid": "6d7df8690b7a8d242303cb3c87734434",
"score": "0.6144111",
"text": "def create_resource(env)\n env[:ui].info(\"Creating machine\")\n\n config = env[:machine].provider_config\n vra = env[:vra]\n\n EntitledItemsCollection.fetch(env[:vra])\n .find_by_id(config.catalog_item_id)\n .request(cpus: config.cpus,\n memory: config.memory,\n requested_for: config.requested_for,\n subtenant_id: config.subtenant_id,\n lease_days: config.lease_days) { |req|\n config.extra_entries.types.each do |type|\n config.extra_entries.of_type(type).each do |k,v|\n req.set_parameter(k, type, v)\n end\n end\n }\n .join\n .machine\n end",
"title": ""
},
{
"docid": "7534de1790ebba0e1cd6d1d19b10c61e",
"score": "0.61340415",
"text": "def start_virtual_machine(vm_name, cloud_service_name)\n vm = get_virtual_machine(vm_name, cloud_service_name)\n if vm\n if vm.status == 'ReadyRole'\n Azure::Loggerx.error 'Cannot perform the start operation on started virtual machine.'\n else\n path = \"/services/hostedservices/#{vm.cloud_service_name}/deployments/#{vm.deployment_name}/roleinstances/#{vm.vm_name}/Operations\"\n body = Serialization.start_virtual_machine_to_xml\n Azure::Loggerx.info \"Starting virtual machine \\\"#{vm.vm_name}\\\" ...\"\n request = client.management_request(:post, path, body: body)\n request.call\n end\n else\n Azure::Loggerx.error \"Cannot find virtual machine \\\"#{vm_name}\\\" under cloud service \\\"#{cloud_service_name}\\\".\"\n end\n end",
"title": ""
},
{
"docid": "e3d54178e23da23df5fab888470fa353",
"score": "0.6110576",
"text": "def acquire_machine(action_handler, node)\n # Set up the provisioner output\n provisioner_options = node['normal']['provisioner_options']\n vm_name = node['name']\n old_provisioner_output = node['normal']['provisioner_output']\n node['normal']['provisioner_output'] = provisioner_output = {\n 'provisioner_url' => provisioner_url(action_handler),\n 'vm_name' => vm_name,\n 'vm_file_path' => File.join(cluster_path, \"#{vm_name}.vm\")\n }\n # Preserve existing forwarded ports\n provisioner_output['forwarded_ports'] = old_provisioner_output['forwarded_ports'] if old_provisioner_output\n\n # TODO compare new options to existing and fail if we cannot change it\n # over (perhaps introduce a boolean that will force a delete and recreate\n # in such a case)\n\n #\n # This is where the work gets done:\n # Create the .vm file, start the vm, and return the Machine\n #\n vm_file = create_vm_file(action_handler, vm_name, provisioner_output['vm_file_path'], provisioner_options)\n start_machine(action_handler, vm_name, vm_file, provisioner_output, provisioner_options['up_timeout'])\n machine_for(node)\n end",
"title": ""
},
{
"docid": "701226bf487d586e34e2af5e968d8695",
"score": "0.6085936",
"text": "def create\n name = params[:machine][:name]\n nickname = params[:machine][:nickname]\n\n @machine = Machine.new(params[:machine])\n \n respond_to do |format|\n if @machine.save\n flash[:notice] = 'Machine was successfully created.'\n format.html { redirect_to machines_path }\n format.xml { render :xml => @machine, :status => :created, :location => @machine }\n format.atom { \n headers[\"Location\"] = formatted_machine_url(@machine, :atom )\n render :action => 'show',\n :status => :created\n }\n else\n format.html { \n @machines = Machine.all\n render :action => :index }\n format.xml { render :xml => @machine.errors, :status => :unprocessable_entity }\n format.atom { render :xml => @machine.errors.to_xml, :status => :bad_request }\n end\n end\n end",
"title": ""
},
{
"docid": "579e575692fec2206e16dd8759bf1f6f",
"score": "0.60833025",
"text": "def create\n @machine = Machine.new(params[:machine])\n\n respond_to do |format|\n if @machine.save\n format.html { redirect_to @machine, notice: t('controller.successfully_created', :model => t('activerecord.models.machine')) }\n format.json { render json: @machine, status: :created, location: @machine }\n else\n format.html { render action: \"new\" }\n format.json { render json: @machine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "209259543b12730d5c0d818043c32771",
"score": "0.60810727",
"text": "def start_instance()\n system(\"sh wso2wsas-SNAPSHOT/bin/wso2server.sh\")\nend",
"title": ""
},
{
"docid": "d2a82a2550a0fbc3f6d61df394e3c681",
"score": "0.60769427",
"text": "def created_machine(machine)\n machine\n end",
"title": ""
},
{
"docid": "24fde3e45c09ad6d5ec7c763d9ac9475",
"score": "0.603428",
"text": "def create_machines\n i = 1\n self.machines = []\n status = MachineStatus.find_by_name(\"bookable\")\n\n while i <= @count.to_i\n name = sprintf \"%s%0.2d\", self.name.downcase, i\n self.machines << Machine.new({ :name => name,\n :description => @machine_description,\n :machine_status => status\n })\n i += 1\n end \n end",
"title": ""
},
{
"docid": "d358bc9f138c202535236d9e677bb3ec",
"score": "0.6028328",
"text": "def create\n init = params[:pos_machine][:name][0]\n pos_machine_number = PosMachine.create_number(params)\n @pos_machine = PosMachine.new(pos_machine_params)\n if @pos_machine.save\n flash[:notice] = 'Pos Machine Created'\n redirect_to pos_machines_path\n else\n flash[:error] = @pos_machine.errors.full_messages.join('<br/>')\n render \"new\"\n end\n end",
"title": ""
},
{
"docid": "0d5ef5d4f38bcf30f5187085e618aad1",
"score": "0.60032535",
"text": "def start(quiet=false)\n if powered_off?\n log_stdout \"starting ...\", quiet\n\n if(@headless)\n type = 'headless'\n else\n type = 'gui'\n end\n `VBoxManage startvm \"#{@vbox_name}\" --type #{type}`\n wait_for_guestcontrol\n else\n log_stdout \"Already started ...\", quiet\n end\n end",
"title": ""
},
{
"docid": "5c38683c5f10a46f36d6054cb3b5347e",
"score": "0.59803516",
"text": "def manage_machine(machine, cli_options)\n if machine.state.id != :running\n env.ui.warn(\"Machine #{machine.name} is not running.\")\n return\n end\n \n env.ui.success(\"#{machine.name}::\")\n machine.action(:ssh_run, \n ssh_run_command: add_options_to_command(cli_options[:values][:cmd], \n cli_options[:values][:dir],\n cli_options[:values][:user]),\n ssh_opts: {extra_args: []})\n end",
"title": ""
},
{
"docid": "217460e7fc59ddf3716d34ab8fd412f7",
"score": "0.5973297",
"text": "def start(obj_vm)\n\t\trun_hyperv_cmd(\"{#@BASE_CMD} -T ws start \\'#{obj_vm.location}\\' nogui\")\n\tend",
"title": ""
},
{
"docid": "609b507b43f9a5489c58c736d6a31835",
"score": "0.5960857",
"text": "def create\n @machine = Machine.new(params[:machine])\n\n respond_to do |format|\n if @machine.save\n flash[:notice] = t 'flash.notice.successfully.created', :object => Machine.human_name\n format.html { redirect_to(@machine) }\n format.xml { render :xml => @machine, :status => :created, :location => @machine }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @machine.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5eb0acd3ca50fa4ba15a3b7746cb2638",
"score": "0.5944183",
"text": "def boot(opts)\n opts[:flavor] ||= 'standard.xsmall'\n opts[:image] ||= /Ubuntu Precise/\n opts[:sec_groups] ||= ['default']\n opts[:key_name] ||= 'default'\n opts[:region] ||= 'az-2.region-a.geo-1'\n\n raise 'no name provided' if !opts[:name] or opts[:name].empty?\n\n cleanup opts[:name]\n private_key = new_key opts[:name]\n write_key(private_key, File.expand_path('~/.ssh/hpcloud-keys/' + opts[:region] + '/'))\n\n server = @os.create_server(\n :imageRef => image_id(opts[:image]),\n :flavorRef => flavor_id(opts[:flavor]),\n :key_name => private_key[:name],\n :security_groups => opts[:sec_groups],\n :name => opts[:name])\n\n wait(300) do\n server = @os.server(server.id)\n raise 'error booting vm' if server.status == 'ERROR'\n server.status == 'ACTIVE'\n end\n sleep 60\n\n {\n :ip => public_ip(server),\n :user => 'ubuntu',\n :key => private_key[:private_key]\n }\n end",
"title": ""
},
{
"docid": "a61607f735d78446165154867f6defaf",
"score": "0.5926399",
"text": "def create_vm(opts = {})\n opts = opts.with_indifferent_access.reverse_merge(\n VSphereConfig.create_vm_defaults.symbolize_keys || {}\n )\n\n opts[:template_path] = compute.image if compute.image\n\n VSphere.with_connection do |vs|\n dest_folder = opts[:dest_folder]\n vm_name = opts[:name] || \"#{compute.image}-\"\\\n \"#{SecureRandom.hex(4)}-#{Time.new.strftime(\"%Y%m%d\")}\"\n exception_cb = lambda do |_p1|\n LabManager.logger.warn(\n \"Failed attempt to create virtual machine: template_name: #{opts[:template_path]}\"\\\n \", vm_name: #{vm_name}\"\n )\n end\n\n Retryable.retryable(\n tries: VSphereConfig.create_vm_defaults[:vm_clone_retry_count],\n on: [RbVmomi::Fault, CreateVMError, Fog::Compute::Vsphere::NotFound],\n exception_cb: exception_cb,\n sleep: ->(n) { Random.rand(n*3..n*3+10.0) }\n ) do\n LabManager.logger.info \"creating machine with name: #{vm_name} options: #{opts.inspect}\"\n machine = vs.vm_clone(\n 'datacenter' => opts[:datacenter],\n 'datastore' => opts[:datastore],\n 'template_path' => opts[:template_path],\n 'name' => vm_name,\n 'cluster' => opts[:cluster],\n 'linked_clone' => opts[:linked_clone],\n 'dest_folder' => dest_folder,\n 'power_on' => opts[:power_on],\n 'wait' => true\n )\n\n setup_network_interfaces({\n uuid: machine['new_vm']['uuid'],\n connection: vs,\n network_name: VSphereConfig.create_vm_defaults[:network_interface_name]\n })\n\n fail CreateVMError, \"Creation of (#{vm_name}) machine failed, retrying\" unless machine || machine['vm_ref']\n set_provider_data(machine['new_vm'], vs: vs)\n end\n\n add_machine_to_drs_rule(\n vs,\n group: opts[:add_to_drs_group],\n machine: \"#{dest_folder}/#{vm_name}\",\n datacenter: opts[:datacenter]\n ) if opts[:add_to_drs_group]\n end\n poweron_vm unless compute.provider_data['power_state'] == 'poweredOn'\n rescue\n # Try to free unsuccessfully started/configured/... VM\n begin\n terminate_vm\n rescue\n nil\n end if instance_uuid\n raise\n end",
"title": ""
},
{
"docid": "5c8fa9ad2ab46bd6864796e6d1174f72",
"score": "0.5919229",
"text": "def connect_to_machine(machine_spec, machine_options)\n Chef::Log.debug('Connect to machine!')\n machine_for(machine_spec,machine_options)\n end",
"title": ""
},
{
"docid": "6724199591af78215bb036a940964c8a",
"score": "0.59139967",
"text": "def create\n @title = Title.find_by_id(params[:title_id])\n logger.debug \"Creating a new machine. current user is #{current_user}\"\n @machine = Machine.new({\n location: @location,\n title: @title,\n created_by: current_user\n })\n\n respond_to do |format|\n if @machine.save\n format.html { redirect_to location_machines_path(@location), notice: 'Machine was successfully created.' }\n format.json { render json: @machine, status: :created, location: @machine }\n else\n format.html { redirect_to location_machines_path(@location), notice: @machine.errors.full_messages.join('. ') }\n format.json { render json: @machine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f41dc39d3c7d1829738fee050a8a3e2",
"score": "0.5912189",
"text": "def run\n sanity_check\n\n ui.info(\"Creating new client for #{node_name}\")\n\n @client = create_client!\n\n ui.info(\"Creating new node for #{node_name}\")\n\n create_node!\n end",
"title": ""
},
{
"docid": "74fc5a106e52c1f5d9eeb5e6fdff4c2c",
"score": "0.5909105",
"text": "def bring_up_machines(machines, options={})\n return [] unless machines.present?\n\n # Invoke once for the entire set of machines.\n result = machines.first.action(:create, options.merge(machines: machines))\n\n # Lets us eliminate some redundant API calls\n cached_objects = {\n api_client: result[:api_client],\n environment: result[:environment],\n machines: machines,\n initial_states: machines.inject({}) {|acc, m| acc[m.id] = m.state.id ; acc },\n }\n\n machines.each do |machine|\n machine.action(:update_hardware, options.merge(cached_objects))\n end\n\n machines.each do |machine|\n @env.ui.info(I18n.t(\n \"vagrant.commands.up.upping\",\n name: machine.name,\n provider: machine.provider_name))\n machine.action(:run_vm, options.merge(cached_objects))\n end\n end",
"title": ""
},
{
"docid": "9ebd912f000410bbb15785f887c6f040",
"score": "0.5908417",
"text": "def create_kvm(kvm_name, template, options)\n ensure_name_availability!(kvm_name)\n clone_kvm(kvm_name, template)\n device = mount_kvm_volume(kvm_name)\n address = update_kvm_ip(kvm_name)\n update_hostname(kvm_name)\n make_console_accessible(kvm_name)\n unmount_kvm_volume(kvm_name, device)\n create_kvm_instance(kvm_name, options)\n puts \"KVM Node #{kvm_name} available at: #{address}\"\nend",
"title": ""
},
{
"docid": "d225965d6b2adba62e94416440ac918e",
"score": "0.59049904",
"text": "def start\n # Generate Device Description XML file\n generate_xml_device_description\n\n # Start server for M-SEARCH request\n start_ssdp_server\n\n # Start server for HTTP request\n start_http_server\n\n # Send initial notification\n notify :alive\n\n # increase BOOTID\n @boot_id = (@boot_id + 1) % 2**31\n\n # and then set a periodic timer for future notifications\n @notify_timer = EM.add_periodic_timer(@notify_interval) { notify :alive }\n end",
"title": ""
},
{
"docid": "acc26e2d00a5768ae15142fbc6e05c3d",
"score": "0.5888526",
"text": "def start\n execute_prlctl('start', @uuid)\n end",
"title": ""
},
{
"docid": "e2c1b4c673f0743e440a215d216cfdae",
"score": "0.5873346",
"text": "def start\n Command::Installer::Start.new(\n *command_params\n ).execute\n rescue => e\n catch_errors(e)\n end",
"title": ""
},
{
"docid": "4b76dddb3bff0e81d3b01d835f1a583a",
"score": "0.58708566",
"text": "def start\n ucommand(:start)\n end",
"title": ""
},
{
"docid": "59c698d344b0c113b6e49e7c0e1fab6a",
"score": "0.5863179",
"text": "def create\n @machine = Machine.new(machine_params)\n # authorize(@machine)\n respond_to do |format|\n if @machine.save\n format.html { redirect_to @machine, notice: 'Machine was successfully created.' }\n format.json { render :show, status: :created, location: @machine }\n else\n format.html { render :new }\n format.json { render json: @machine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c165cb728ea0b351a51cafccb0873ca9",
"score": "0.5858374",
"text": "def create\n ::Velum::Salt.call(\n action: \"cmd.run\",\n targets: \"admin\",\n arg: \"systemctl reboot\"\n )\n\n render json: { status: Minion.statuses[:rebooting] }\n end",
"title": ""
},
{
"docid": "793176bc8777f649a761d1e1bfe880eb",
"score": "0.5843829",
"text": "def machine=(new_machine); end",
"title": ""
},
{
"docid": "ec886dc0055833bbceaba0a75e9e6bb7",
"score": "0.5842737",
"text": "def start!\n message \"Launching minimum_instances\"\n launch_minimum_instances\n message \"Waiting for master to boot up\" \n \n wait_for_all_instances_to_boot\n \n setup_cloud\n end",
"title": ""
},
{
"docid": "909333318e611ec39423d79237e11d1b",
"score": "0.58416516",
"text": "def set_up_server\n node = Chef::Node.new\n node.name 'nothing'\n node.automatic[:platform] = 'kitchen_metal'\n node.automatic[:platform_version] = 'kitchen_metal'\n Chef::Config.local_mode = true\n run_context = Chef::RunContext.new(node, {},\n Chef::EventDispatch::Dispatcher.new(Chef::Formatters::Doc.new(STDOUT,STDERR)))\n recipe_exec = Chef::Recipe.new('kitchen_vagrant_metal',\n 'kitchen_vagrant_metal', run_context)\n\n # We require a platform, but layout in driver is optional\n recipe_exec.instance_eval get_platform_recipe\n recipe = get_driver_recipe\n recipe_exec.instance_eval recipe if recipe\n return run_context\n end",
"title": ""
},
{
"docid": "f5300354c60a9c00fad7df7845afd2ca",
"score": "0.58237314",
"text": "def set_machine\n @machine = Machine.find(params[:id])\n end",
"title": ""
},
{
"docid": "f5300354c60a9c00fad7df7845afd2ca",
"score": "0.58237314",
"text": "def set_machine\n @machine = Machine.find(params[:id])\n end",
"title": ""
},
{
"docid": "4b15b2276c5b8702ae3702176df0d472",
"score": "0.58235574",
"text": "def create_vbox_hdd(client_name,vbox_disk_name)\n message = \"Creating:\\tVM hard disk for \"+client_name\n command = \"VBoxManage createhd --filename \\\"#{vbox_disk_name}\\\" --size \\\"#{$default_vm_size}\\\"\"\n execute_command(message,command)\n return\nend",
"title": ""
},
{
"docid": "d796b316a245961cf06d2db0cbc7b541",
"score": "0.58148",
"text": "def create\n @slot_machine = SlotMachine.new(slot_machine_params)\n\n respond_to do |format|\n if @slot_machine.save\n format.html { redirect_to @slot_machine, notice: 'Slot machine was successfully created.' }\n format.json { render :show, status: :created, location: @slot_machine }\n else\n format.html { render :new }\n format.json { render json: @slot_machine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ac3df9d579a93ed8308d5a049b614de",
"score": "0.5809533",
"text": "def find_or_create_vm(bootstrap_options, machine_spec, action_handler)\n vm = vsphere_helper.find_vm(\n bootstrap_options[:vm_folder],\n machine_spec.name\n )\n if vm\n Chef::Log.info machine_msg(\n machine_spec.name,\n vm.config.instanceUuid,\n 'already created'\n )\n else\n\t if bootstrap_options[:create_new_vm]\n\t vm = clone_vm(\n action_handler,\n bootstrap_options,\n machine_spec.name)\n\t\t else\n raise \"#{machine_spec.name}is not present in the vCenter. Aborting the node creation\"\n end\n end\n vm\n end",
"title": ""
},
{
"docid": "f8785a307924d0657e8152a069140bc2",
"score": "0.579656",
"text": "def connect_to_machine(machine_spec, machine_options)\n Chef::Log.debug('Connect to machine')\n machine_for(machine_spec, machine_options)\n end",
"title": ""
},
{
"docid": "f679d2ccfbb196c25e283df45f86bc47",
"score": "0.5786365",
"text": "def create(options = {})\n raise ArgumentError.new(\"You must provide :cores and :ram\") if options[:ram].nil? or options[:cores].nil?\n raise ArgumentError.new(\":ram has to be at least 256MiB and a multiple of it\") if options[:ram].to_i < 256 or (options[:ram].to_i % 256) > 0\n raise ArgumentError.new(\":availability_zone has to be either 'AUTO', 'ZONE_1', or 'ZONE_2'\") if options[:availability_zone] and !['AUTO', 'ZONE_1', 'ZONE_2'].include? options[:availability_zone]\n raise ArgumentError.new(\":os_type has to be either 'WINDOWS' or 'OTHER'\") if options[:os_type] and !['WINDOWS', 'OTHER'].include? options[:os_type]\n options[:server_name] = options.delete :name if options[:name]\n response = Profitbricks.request :create_server, options\n self.find(:id => response[:server_id])\n end",
"title": ""
},
{
"docid": "ba457b26ba5bd9613ec89e0e4287d325",
"score": "0.5784254",
"text": "def launch\n puts \"==> Creating EC2 instance...\"\n\n @instance = @aws_ec2.instances.create( @config.env.merge( { \"key_name\" => key_name, \"security_groups\" => [security_group_name] } ) )\n @instance.tag(\"environment\", {value: @config.environment})\n\n while @instance.status == :pending\n print \".\"\n sleep 2\n end\n\n # Sleep for 30 more seconds\n 15.times do\n print \".\"\n sleep 2\n end\n puts \".\" # new line\n\n puts \"==> Successfully created EC2 instance '#{@instance.id}'\"\n end",
"title": ""
},
{
"docid": "39c8ba4581e2267fb75b1fc6e5162b8f",
"score": "0.57745165",
"text": "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5f027175324c8ae69dfd661a4d84348b",
"score": "0.5774003",
"text": "def start(name)\n Win32::Service.start(n(name))\n end",
"title": ""
},
{
"docid": "a07dd8d9e3f15ff8f5d05194f54b1d81",
"score": "0.5762693",
"text": "def create(state)\n # we are checking the config here instead of when the class is loaded because\n # test-kitchen doesn't have the platform object instantiated until we call create\n raise Kitchen::UserError, /Error. Only windows is supported./ unless windows_os?\n newhost = poolsclosed_machine\n raise Kitchen::InstanceFailure, /Error, no available instances in poolsclosed/ if newhost.nil?\n state[:hostname] = newhost\n end",
"title": ""
},
{
"docid": "8d2a257d63e82d359407e803d8c7d87b",
"score": "0.57623535",
"text": "def connect_to_machine(machine_spec, machine_options)\n Chef::Log.debug('Connect to machine!')\n end",
"title": ""
},
{
"docid": "32e0cc086dd29017423899992bc44307",
"score": "0.57597727",
"text": "def create # rubocop:disable Metrics/AbcSize\n inst_details = AttrFinder.new(@instanceparameters)\n inst_details.options = @options\n inst_details.validate = @validate\n inst_details.function = 'server'\n BmcAuthenticate.new(@options)\n request = OracleBMC::Core::Models::LaunchInstanceDetails.new\n ssh_public_key = @instanceparameters['server']['ssh-key']\n request.availability_domain = inst_details.ad\n request.compartment_id = inst_details.compartment\n request.display_name = @instanceparameters['server']['display_name']\n request.image_id = inst_details.image\n request.shape = @instanceparameters['server']['shape']\n request.subnet_id = inst_details.subnet\n request.metadata = { 'ssh_authorized_keys' => ssh_public_key }\n api = OracleBMC::Core::ComputeClient.new\n response = api.launch_instance(request)\n @instance_id = response.data.id\n compartment(inst_details.compartment)\n running_instance = api.get_instance(@instance_id).wait_until(:lifecycle_state,\n OracleBMC::Core::Models::Instance::LIFECYCLE_STATE_RUNNING,\n max_interval_seconds: 5, max_wait_seconds: 300)\n if @instanceparameters['server']['attachments']\n @instanceparameters['server']['attachments'].each do |vol|\n attach(@instance_id, vol['volume'])\n end\n end\n running_instance\n end",
"title": ""
},
{
"docid": "a670cb2d2cce12e17099b0e971ee5994",
"score": "0.5746827",
"text": "def defineControlVM(control, vmName)\n\tcontrol.vm.hostname = vmName\n\tcontrol.vm.box = \"https://cloud-images.ubuntu.com/vagrant/utopic/%s/utopic-server-cloudimg-amd64-vagrant-disk1.box\" % $controlRequestImagePath\n\tcontrol.vm.network :private_network, ip: \"10.10.10.10\"\n\n\t# Forward our Docker registry port to the outside world.\n\tcontrol.vm.network \"forwarded_port\", guest: 5000, host: $controlDockerRegistryPort, auto_correct: true\n\n\t# Enabled serial logging if the user asked for it.\n\tsetUpSerialLogging vmName\n\n\t# Build the log directory where all internal control machines logs will go to.\n\tlogFile = setUpProvisionLogging vmName\n\n\t# Provision the machines.\n\tcontrol.vm.provision :shell, :path => \"automation/vagrant/tasks/ProvisionControlBase.sh\", :privileged => false, :args => \"%s\" % logFile\n\tcontrol.vm.provision :shell, :path => \"automation/vagrant/tasks/ProvisionControlFiles.sh\", :privileged => false, :args => \"%s %s\" % [logFile, $coreInstances]\n\tcontrol.vm.provision :shell, :path => \"automation/vagrant/tasks/ProvisionControlAnsible.sh\", :privileged => false, :args => \"%s\" % logFile\n\tcontrol.vm.provision :shell, :path => \"automation/vagrant/tasks/ProvisionControlDocker.sh\", :privileged => false, :args => \"%s\" % logFile\n\tcontrol.vm.provision :shell, :path => \"automation/vagrant/tasks/ProvisionControlRegistry.sh\", :privileged => false, :args => \"%s\" % logFile\nend",
"title": ""
},
{
"docid": "5ff47a148ae5fd73442702a55df40c4a",
"score": "0.57377064",
"text": "def start\n @state_machine.startup\n end",
"title": ""
},
{
"docid": "0433aad24137321b8a261b2d710695cc",
"score": "0.5724576",
"text": "def create params\n raise_start_server unless Server::node\n new params\n end",
"title": ""
},
{
"docid": "84a9b69c2947de2daee798863b89a80e",
"score": "0.57244027",
"text": "def set_up\n #@computer = Computer.new\n end",
"title": ""
},
{
"docid": "52b8b7afaab482c3e7342cc746dcb890",
"score": "0.5719965",
"text": "def create_vm(cpu, ram, capacity, name, cluster)\n return nil if cluster.networks.empty?\n\n vm_config = creation_config(cpu, ram, capacity, add_prefix(name), cluster.networks.first)\n vm = @folder.CreateVM_Task(config: vm_config, pool: cluster.resource_pool).wait_for_completion\n VSphere::VirtualMachine.new vm, folder: self\n end",
"title": ""
},
{
"docid": "0002277cee6588b979c829144cebfca7",
"score": "0.57117796",
"text": "def start\n \n cloud = Cloud.new(CloudInfrastructure.new(), CloudLeader.new(), resource,\n method(:err))\n puts \"Starting cloud %s\" % [resource[:name]]\n \n # Check existence\n if !exists?\n # Cloud does not exist => Startup operations\n \n # Check pool of physical machines\n puts \"Checking pool of physical machines...\"\n pm_up, pm_down = cloud.check_pool()\n unless pm_down.empty?\n puts \"Some physical machines are down\"\n pm_down.each do |pm|\n puts \" - #{pm}\"\n end\n end\n \n # Obtain the virtual machines' IPs\n puts \"Obtaining the virtual machines' IPs...\"\n #vm_ips, vm_ip_roles, vm_img_roles = obtain_vm_data(method(:web_yaml_ips),\n # method(:web_yaml_images))\n vm_ips, vm_ip_roles, vm_img_roles = obtain_vm_data(cloud.resource)\n \n # Check whether you are one of the virtual machines\n puts \"Checking whether this machine is part of the cloud...\"\n part_of_cloud = vm_ips.include?(MY_IP)\n if part_of_cloud\n puts \"#{MY_IP} is part of the cloud\"\n \n # Check if you are the leader\n if cloud.leader?()\n cloud.leader_start(\"web\", vm_ips, vm_ip_roles, vm_img_roles,\n pm_up, method(:web_monitor))\n else\n cloud.common_start()\n end\n else\n puts \"#{MY_IP} is not part of the cloud\"\n cloud.not_cloud_start(\"web\", vm_ips, vm_ip_roles, vm_img_roles,\n pm_up)\n end\n \n else\n \n # Cloud exists => Monitoring operations\n puts \"Cloud already started\"\n \n # Check if you are the leader\n if cloud.leader?()\n cloud.leader_monitoring(method(:web_monitor))\n else\n puts \"#{MY_IP} is not the leader\" # Nothing to do\n end\n end\n \n end",
"title": ""
},
{
"docid": "6aaf17fdd936adb874e11e39e1837077",
"score": "0.5692536",
"text": "def create\n @edc_machine = EdcMachine.new(edc_machine_params)\n if @edc_machine.save\n flash[:notice] = 'EDC Machine was successfully created.'\n redirect_to edc_machines_path\n else\n flash[:error] = @edc_machine.errors.full_messages.join('<br/>')\n render \"new\"\n end\n end",
"title": ""
},
{
"docid": "6a5ddd5ec1b3398925204bafb0e397f3",
"score": "0.5692192",
"text": "def start\n @virtual_machine_state = 'NOSTATE'\n Profitbricks.request :start_server, server_id: self.id\n return true\n end",
"title": ""
},
{
"docid": "849e7dfe2c7318dd3f5d09cfee5cf6f7",
"score": "0.5687687",
"text": "def create_server_on_master(s)\n image_id = server_image_id(s) #s.respond_to?('image_id') ? s.image_id : 'no_image'\n flavor_id = server_flavor_id(s) #s.respond_to?('flavor_id') ? s.flavor_id : nil\n create_record_with_fields(\"machine\",\n [\"name\", \"type\", \"instance_id\", \"public_ipv4\", \"image_id\", \"flavor_id\"],\n [server_name(s), provider, s.identity, s.public_ip_address, image_id , flavor_id])\n end",
"title": ""
},
{
"docid": "de559f214be7b6830c53d5c177d10e4f",
"score": "0.56836617",
"text": "def set_host_machine\n @host_machine = HostMachine.find(params[:id])\n end",
"title": ""
},
{
"docid": "e56be2806ab3851c886d59e8c754ca0e",
"score": "0.5678641",
"text": "def start\n\n cloud = Cloud.new(CloudInfrastructure.new(), CloudLeader.new(), resource,\n method(:err))\n puts \"Starting cloud %s\" % [resource[:name]]\n \n # Check existence\n if !exists?\n # Cloud does not exist => Startup operations\n \n # Check pool of physical machines\n puts \"Checking pool of physical machines...\"\n pm_up, pm_down = cloud.check_pool()\n unless pm_down.empty?\n puts \"Some physical machines are down\"\n pm_down.each do |pm|\n puts \" - #{pm}\"\n end\n end\n \n # Obtain the virtual machines' IPs\n puts \"Obtaining the virtual machines' IPs...\"\n #vm_ips, vm_ip_roles, vm_img_roles = obtain_vm_data(method(:torque_yaml_ips),\n # method(:torque_yaml_images))\n vm_ips, vm_ip_roles, vm_img_roles = obtain_vm_data(cloud.resource)\n \n \n # Check whether you are one of the virtual machines\n puts \"Checking whether this machine is part of the cloud...\"\n part_of_cloud = vm_ips.include?(MY_IP)\n if part_of_cloud\n puts \"#{MY_IP} is part of the cloud\"\n \n # Check if you are the leader\n if cloud.leader?()\n cloud.leader_start(\"torque\", vm_ips, vm_ip_roles, vm_img_roles,\n pm_up, method(:torque_monitor))\n else\n cloud.common_start()\n end\n else\n puts \"#{MY_IP} is not part of the cloud\"\n cloud.not_cloud_start(\"torque\", vm_ips, vm_ip_roles, vm_img_roles,\n pm_up)\n end\n \n else\n \n # Cloud exists => Monitoring operations\n puts \"Cloud already started\"\n\n # Check if you are the leader\n if cloud.leader?()\n cloud.leader_monitoring(method(:torque_monitor))\n else\n puts \"#{MY_IP} is not the leader\" # Nothing to do\n end\n end\n \n end",
"title": ""
},
{
"docid": "42e088b20a70c33442f6981ca57470b8",
"score": "0.56734",
"text": "def start\n Result.new(call(CMD_START))\n end",
"title": ""
},
{
"docid": "bcb79f967c116748a77c4fe7341785c0",
"score": "0.5671376",
"text": "def start\n debug \"Call 'start' for Pacemaker service '#{name}' on node '#{hostname}'\"\n disable_basic_service_on_action :start\n\n enable unless primitive_is_managed? name\n\n if pacemaker_options[:cleanup_on_start]\n if not pacemaker_options[:cleanup_only_if_failures] or primitive_has_failures? name, hostname\n cleanup\n end\n end\n\n if pacemaker_options[:add_location_constraint]\n service_location_add full_name, hostname unless service_location_exists? full_name, hostname\n end\n\n if primitive_is_multistate? name\n service_start_mode pacemaker_options[:start_mode_multistate]\n elsif primitive_is_clone? name\n service_start_mode pacemaker_options[:start_mode_clone]\n else\n service_start_mode pacemaker_options[:start_mode_simple]\n end\n\n debug cluster_debug_report \"#{@resource} start\"\n end",
"title": ""
},
{
"docid": "32220bd043766450f938071c9a0b3a25",
"score": "0.566943",
"text": "def start\n # TODO: if .project.yml and .sh have not been created yet then call init to make them\n puts \"\\n\\n project:\"\n puts ' command: start'\n puts \" name: #{File.basename(root_dir)}\"\n puts \"\\n docker-machine:\"\n puts \" name: #{project_config['docker-machine']['name']}\"\n unless vm_running?\n print \" status: starting...\\r\"\n `docker-machine start #{project_config['docker-machine']['name']}` # > /dev/null 2>&1\n end\n if vm_running?\n puts ' status: running '\n else\n puts ' status: failed to start '\n exit 0\n end\n puts \"\\n watchman:\"\n unless watchman_trigger_installed?\n print \" trigger: installing...\\r\"\n add_watchman_trigger\n end\n puts \" trigger: #{watchman_trigger_installed? ? 'installed' : 'not installed'} \"\n fork do\n 30.times do\n sleep(1)\n if browser_url_responding?\n open_webapp\n break\n end\n end\n exit 0\n end\n puts \"\\n docker-compose:\"\n puts \" service: #{project_config['docker-compose']['service']}\"\n unless service_running?\n print \" status: waiting on docker daemon...\\r\"\n wait_until_docker_daemon_responding # TODO: flip this to before the service_running? check\n puts \" status: starting... \\n\\n\"\n puts \" note: browser will open webapp as soon as service is ready\\n\\n\"\n puts \" tip: execute 'docker-compose logs' to tail the service logs\\n\\n\"\n exec(\"#{setup_docker_env_vars_str} docker-compose start\")\n # stdout_data, stderr_data = Open3.capture3(\"#{setup_docker_env_vars_str} docker-compose start\")\n # 20.times do\n # sleep(1)\n # break if service_running?\n # end\n else\n puts ' status: running'\n end\n # puts \" status: #{service_running? ? 'running' : 'failed to start'} \"\nend",
"title": ""
},
{
"docid": "646c7f4e7188ab3f94727fcbcb318578",
"score": "0.56690675",
"text": "def create_vm(vm, params, namespace)\n vm = param_substitution!(vm, params)\n os_labels = labels || {}\n vm = deep_merge!(vm,\n :spec => {\n :running => false\n },\n :metadata => {\n :namespace => namespace\n }\n )\n\n vm = deep_merge!(vm,\n :metadata => {\n :labels => {\n OS_LABEL => os_labels[OS_LABEL_SYMBOL]\n }\n }\n ) if os_labels[OS_LABEL_SYMBOL]\n\n # Send the request to create the virtual machine:\n vm = service.create_vm(vm)\n end",
"title": ""
},
{
"docid": "ae114db3f6065c644b44453ae7417639",
"score": "0.5668956",
"text": "def startup(workdir)\n validate_platform\n select_target\n setup\n get_remote_workdir\n end",
"title": ""
},
{
"docid": "84692e073a96f35feec48bd14af43de2",
"score": "0.56660306",
"text": "def create\n begin\n enterMaintenanceMode\n rescue\n Puppet.err 'Could not find Host system.Either Host is not exist or disconnected'\n end\n end",
"title": ""
},
{
"docid": "7ca32240984180d6a7ac68597927f296",
"score": "0.5661313",
"text": "def create_virtual_machine(params, options={})\n options[:os_type] = get_os_type(params[:image])\n options[:image_type] = get_image_type(params[:image])\n validate_deployment_params(params, options)\n options[:cloud_service_name] = generate_cloud_service_name(params[:vm_name]) unless options[:cloud_service_name]\n options[:storage_account_name] = generate_storage_account_name(params[:vm_name]) unless options[:storage_account_name] \n optionals = {}\n if options[:virtual_network_name]\n virtual_network_service = Azure::VirtualNetworkManagementService.new\n virtual_networks = virtual_network_service.list_virtual_networks.select{|x| x.name == options[:virtual_network_name]}\n if virtual_networks.empty?\n Loggerx.error_with_exit \"Virtual network #{options[:virtual_network_name]} doesn't exists\"\n else\n optionals[:affinity_group_name] = virtual_networks.first.affinity_group\n end\n elsif options[:affinity_group_name]\n optionals[:affinity_group_name] = options[:affinity_group_name]\n else\n optionals[:location] = params[:location]\n end \n cloud_service = Azure::CloudServiceManagementService.new\n cloud_service.create_cloud_service(options[:cloud_service_name], optionals)\n cloud_service.upload_certificate(options[:cloud_service_name],params[:certificate]) unless params[:certificate].empty?\n Azure::StorageManagementService.new.create_storage_account(options[:storage_account_name], optionals)\n\n body = Serialization.deployment_to_xml(params,options)\n path = \"/services/hostedservices/#{options[:cloud_service_name]}/deployments\"\n Loggerx.info \"Deployment in progress...\"\n request = ManagementHttpRequest.new(:post, path, body)\n request.call\n get_virtual_machine(params[:vm_name],options[:cloud_service_name])\n rescue Exception => e\n e.message\n end",
"title": ""
},
{
"docid": "dfef1b78d6e55d554c770e2fbdba3ad3",
"score": "0.5659307",
"text": "def start(options={})\n unless exists?\n return Response.new :code => 1, :message => 'VM does not exist'\n end\n\n running_response = running?\n return running_response unless running_response.successful?\n\n if running_response.data\n return Response.new :code => 1, :message => 'VM is already running'\n end\n\n conf_file_response = conf_file\n return conf_file_response unless conf_file_response.successful?\n\n unless options[:headless].blank?\n if Fusion.running?\n message = 'It looks like the Fusion GUI is currently running. '\n message << 'A VM cannot be started in headless mode when the Fusion GUI is running. '\n message << 'Exit the Fusion GUI and try again.'\n return Response.new :code => 1, :message => message\n end\n end\n\n command = \"#{vmrun_cmd} start \"\n command << \"#{conf_file_response.data} \"\n\n command << (options[:headless].blank? ? 'gui ' : 'nogui ')\n command << '2>&1'\n\n Response.from_command(`#{command}`)\n end",
"title": ""
},
{
"docid": "0a4a38b9964f7e96e7f14366a634c584",
"score": "0.56556696",
"text": "def create\n begin\n if(params[:machine][:ClusterName]==nil or params[:machine][:ClusterName]==\"\")\n params[:machine][:ClusterName]=@session[:clustername]\n end\n \n if(params[:machine][:ShopName]==nil or params[:machine][:ShopName]==\"\")\n params[:machine][:ShopName]=@session[:shopname]\n end\n \n if(params[:machine][:GroupID]==nil or params[:machine][:GroupID]==\"\")\n params[:machine][:GroupID]=@session[:Groupid]\n end\n @machine = Machine.new(params[:machine])\n @checkmc=Machine.find_first([\"ClusterName=? and ShopName=? and GroupID=? and MachineNo=?\",params[:machine][:ClusterName],params[:machine][:ShopName],params[:machine][:GroupID], params[:machine][:MachineNo]])\n @checkmcname=Machine.find_first([\"ClusterName=? and ShopName=? and GroupID=? and MachineName=?\",params[:machine][:ClusterName],params[:machine][:ShopName],params[:machine][:GroupID], params[:machine][:MachineName]])\n if(@checkmc!=nil)\n flash[:notice]='<font color=red size=3><b>ENTERED MACHINE NO ALREADY EXISTS, PLEASE ENTER NEW MACHINE NO</B></FONT>'\n flash[:confirm]=nil\n render :action=>'new'\n else\n if @machine.save\n flash[:confirm] = '<font color=green size=3><b>MACHINE WAS SUCCESSFULLY CREATED.</b></font>'\n flash[:notice]= nil\n render :action => 'new'\n else\n render :action => 'new'\n end\n end\n rescue Exception=>ex\n puts ex.message\n end\n end",
"title": ""
},
{
"docid": "32ff3d27e647173cfc2c00c4e902e6f7",
"score": "0.56534106",
"text": "def create\n Dir.mkdir dir\n File.symlink Hoboku.project_dir, File.join(dir, 'src')\n vm.write_vagrantfile\n vm.start\n end",
"title": ""
},
{
"docid": "d64bffd44ab0e459c671c736b41dbf6c",
"score": "0.56519973",
"text": "def start_server\n if @task.said_yes?(\"Would you like to start #{@name} server?\")\n action = Marv::Server::Actions.new(@server)\n action.start(false)\n end\n end",
"title": ""
},
{
"docid": "267083dd36455e3008653d0f3080ad74",
"score": "0.56442875",
"text": "def start\n if options.master?\n start_master(options)\n elsif options.slave?\n start_slave(options)\n else\n invoke :help, [:start]\n end\n end",
"title": ""
},
{
"docid": "d2d46f9330736f397c988a8ad60150ad",
"score": "0.5643893",
"text": "def create_vm\n if new_resource.clone\n clone_vm\n else\n data = {\n vmid: vmid,\n bootdisk: 'virtio0',\n cores: INSTANCE_SIZE[new_resource.size]['cpu'],\n memory: INSTANCE_SIZE[new_resource.size]['memory'],\n ide2: \"#{new_resource.cdrom},media=cdrom\",\n numa: (new_resource.numa ? 1 : 0),\n ostype: get_type(new_resource.ostype),\n sockets: 1,\n virtio0: \"#{new_resource.storage}:/vm-#{vmid}-disk-1.qcow2,size=#{new_resource.disk}\"\n }.merge(new_resource.net)\n data.merge(hugepages: new_resource.hugepages) if new_resource.hugepages\n api.post(\"/nodes/#{new_resource.host}/qemu\", data)\n end\nend",
"title": ""
},
{
"docid": "95c8b376fcd0aec9d54d8c573bb842cc",
"score": "0.56393474",
"text": "def start_vm\n unless File.exists?(@image_file) and File.owned?(@image_file)\n @log.error \"Image file #{@image_file} doesn't exist or is not owned by you!\"\n exit 255\n end\n @log.info \"VM Will use SSH Port #{@vm_ssh_port} and VNC Port #{@vm_vnc_port}\"\n @log.info \"Starting vmm now...\"\n @log.debug \"vmm command line is: \" + vmm_command_line()\n @vmm_r, @vmm_w, @vmm_pid = PTY.spawn vmm_command_line()\n @vmm_r.expect(@vmm_prompt,@vmm_timeout) do |line|\n true\n end\n @vm_running = true\n @log.debug \"vmm instance pid is #{@vmm_pid}\"\n end",
"title": ""
},
{
"docid": "5e0b611769177ca49a8fde838470bc15",
"score": "0.5637378",
"text": "def start\n\t\t# puts \"Starting #{@ip} ...\"\n\t\tsystem ipmi_command + \" chassis power on\"\n\tend",
"title": ""
},
{
"docid": "f635414e74822695eebcfb3deee8f1b7",
"score": "0.56361145",
"text": "def create\r\n @product_machine = ProductMachine.new(params[:product_machine])\r\n\r\n respond_to do |format|\r\n if @product_machine.save\r\n format.html { redirect_to @product_machine, notice: 'Produkt wurde erfolgreich angelegt!' }\r\n format.json { render json: @product_machine, status: :created, location: @product_machine }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @product_machine.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "94e25ca8d420d592f7e6bf3dfa591e86",
"score": "0.5632045",
"text": "def boot params={}\n Server.node = Server.start! params\n Server.semaphore = Mutex.new\n Server.workers = []; true\n end",
"title": ""
},
{
"docid": "8bbfe5c58a9b6014d6b2525866e2d839",
"score": "0.5631282",
"text": "def register_vbox_vm(client_name,client_os)\n message = \"Registering:\\tVM \"+client_name\n command = \"VBoxManage createvm --name \\\"#{client_name}\\\" --ostype \\\"#{client_os}\\\" --register\"\n execute_command(message,command)\n return\nend",
"title": ""
},
{
"docid": "107e64219339e68447e709e5b3473a83",
"score": "0.56230927",
"text": "def start_infrastructure_manager\n if HelperFunctions.is_port_open?(\"localhost\", \n InfrastructureManagerClient::SERVER_PORT, HelperFunctions::USE_SSL)\n\n Djinn.log_debug(\"InfrastructureManager is already running locally - \" +\n \"don't start it again.\")\n return\n end\n\n start_cmd = \"/usr/bin/python #{APPSCALE_HOME}/InfrastructureManager/infrastructure_manager_service.py\"\n stop_cmd = \"/usr/bin/pkill -9 infrastructure_manager_service\"\n port = [InfrastructureManagerClient::SERVER_PORT]\n env = {\n 'APPSCALE_HOME' => APPSCALE_HOME,\n 'EC2_HOME' => ENV['EC2_HOME'],\n 'JAVA_HOME' => ENV['JAVA_HOME']\n }\n\n MonitInterface.start(:iaas_manager, start_cmd, stop_cmd, port, env)\n Djinn.log_info(\"Started InfrastructureManager successfully!\")\n end",
"title": ""
},
{
"docid": "0fb7924afda4cbd1b800ce8b10f47e6f",
"score": "0.5622279",
"text": "def create_vm(vms, vm_type, config)\n vms.each do | vm |\n hostname = vm.get_hostname\n \n # cpu & memory\n cpu = vm.get_cpu\n memory = vm.get_memory\n \n # nat port\n ssh_nat_port = vm.get_ssh_nat_port\n http_nat_port = vm.get_http_nat_port\n novnc_nat_port = vm.get_novnc_nat_port \n \n # list of interfaces\n interfaces = vm.get_interfaces\n bridged_interface = vm.get_bridged_interface\n \n # box info\n box_name = vm.box.name\n box_user = vm.box.user\n box_pass = vm.box.pass\n \n switch_type = vm.switch_type\n switch_ver = vm.switch_ver \n \n # IMPORTANT: use your own link_prefix to avoid duplication error with other vagrant instances\n link_prefix=File.basename(Dir.getwd)\n \n interface_count = interfaces.length\n if bridged_interface != \"\"\n interface_count += 1\n end\n \n config.vm.define \"#{hostname}\" do |cfg|\n cfg.vm.box = box_name\n cfg.vm.boot_timeout = 90\n \n cfg.ssh.username = box_user\n cfg.ssh.password = box_pass\n \n for i in interfaces\n cfg.vm.network \"private_network\", auto_config: false, virtualbox__intnet: \"#{link_prefix}_switch_interface_#{i}\" \n end\n \n # bridged interface to have external network connectivity\n if bridged_interface != \"\"\n cfg.vm.network \"public_network\", auto_config: false, bridge: \"#{bridged_interface}\"\n end\n \n #if switch_type != \"\"\n # cfg.vm.provision :shell, :path => \"../common/install_#{switch_type}_#{switch_ver}.sh\"\n #end\n \n if File.exist?(\"init_node_#{hostname}.sh\")\n cfg.vm.provision :shell, :path => \"init_node_#{hostname}.sh\"\n end\n \n cfg.vm.provider \"virtualbox\" do |v|\n v.cpus = cpu\n v.memory = memory\n v.customize [\"modifyvm\", :id, \"--hpet\", \"on\"]\n \n # 스위칭에 이용하는 인터페이스에 대해서 promiscuous mode를 allow vms로 설정해줌\n for i in 2..(interface_count + 1)\n v.customize [\"modifyvm\", :id, \"--nicpromisc#{i}\", \"allow-all\"] \n end\n v.gui = true\n end\n \n if ssh_nat_port != -1\n cfg.vm.network :forwarded_port, guest: 22, host: \"#{ssh_nat_port}\", id: \"ssh\"\n end\n \n if http_nat_port != -1\n cfg.vm.network :forwarded_port, guest: 80, host: \"#{http_nat_port}\", id: \"http\" \n end\n \n if novnc_nat_port != -1\n cfg.vm.network :forwarded_port, guest: 6080, host: \"#{novnc_nat_port}\", id: \"novnc\" \n end\n \n cfg.vm.synced_folder \"../common\", \"/root/common\", disabled: false\n end\n end\nend",
"title": ""
},
{
"docid": "4bc7efc44bdb7cac6ebc19c466b02a00",
"score": "0.56075007",
"text": "def create\n @virtualmachines = Virtualmachine.new(params[:virtualmachines])\n\n respond_to do |format|\n if @virtualmachines.save\n flash[:notice] = 'Virtualmachines was successfully created.'\n format.html { redirect_to(@virtualmachines) }\n format.xml { render :xml => @virtualmachines, :status => :created, :location => @virtualmachines }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @virtualmachines.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "189292c0ca91c85cb22b34a7eddcef5f",
"score": "0.5596294",
"text": "def start\n\n cloud = Cloud.new(CloudInfrastructure.new(), CloudLeader.new(), resource,\n method(:err))\n puts \"Starting cloud %s\" % [resource[:name]]\n \n # Check existence\n if !exists?\n # Cloud does not exist => Startup operations\n \n # Check pool of physical machines\n puts \"Checking pool of physical machines...\"\n pm_up, pm_down = cloud.check_pool()\n unless pm_down.empty?\n puts \"Some physical machines are down\"\n pm_down.each do |pm|\n puts \" - #{pm}\"\n end\n end\n \n # Obtain the virtual machines' IPs\n puts \"Obtaining the virtual machines' IPs...\"\n #vm_ips, vm_ip_roles, vm_img_roles = obtain_vm_data(method(:appscale_yaml_ips),\n # method(:appscale_yaml_images))\n vm_ips, vm_ip_roles, vm_img_roles = obtain_vm_data(cloud.resource)\n \n # Check whether you are one of the virtual machines\n puts \"Checking whether this machine is part of the cloud...\"\n part_of_cloud = vm_ips.include?(MY_IP)\n if part_of_cloud\n puts \"#{MY_IP} is part of the cloud\"\n \n # Check if you are the leader\n if cloud.leader?()\n cloud.leader_start(\"appscale\", vm_ips, vm_ip_roles, vm_img_roles,\n pm_up, method(:appscale_monitor))\n else\n cloud.common_start()\n end\n else\n puts \"#{MY_IP} is not part of the cloud\"\n cloud.not_cloud_start(\"appscale\", vm_ips, vm_ip_roles, vm_img_roles,\n pm_up)\n end\n \n else\n \n # Cloud exists => Monitoring operations\n puts \"Cloud already started\"\n \n # Check if you are the leader\n if cloud.leader?()\n cloud.leader_monitoring(method(:appscale_monitor))\n else\n puts \"#{MY_IP} is not the leader\" # Nothing to do\n end\n end\n \n end",
"title": ""
},
{
"docid": "858a4d32e0a4893dfba0be4798532560",
"score": "0.55889624",
"text": "def start_server\n erl = CliRunner.open 'skirmish_server', 'erl', /\\d>/, /Eshell/\n erl << \"code:add_path(\\\"#{server_dir}/ebin\\\").\" >> /true/\n erl << \"application:start(skirmish_server).\" >> /ok/\n @automation_server = erl\n log.info(\"Automation#start_server\") { \"server started\" }\n end",
"title": ""
},
{
"docid": "17750397dfb8a747119d41e5db65c806",
"score": "0.558604",
"text": "def start\n server.synchronize do\n fail 'server is already running' if started?\n fail 'provide server address' if cfg.address.nil?\n\n FileUtils.mkdir_p(server.runsv_dir)\n run = File.join(server.runsv_dir, 'run')\n\n ErbTemplate.render_to('runsv', {\n name: server.name,\n address: cfg.address,\n netif: cfg.netif,\n }, run)\n\n File.chmod(0755, run)\n File.symlink(server.runsv_dir, service_link)\n end\n end",
"title": ""
},
{
"docid": "e1a467ebd19e9cc58037aac870c417a7",
"score": "0.5582696",
"text": "def set_present_and_running\n if active_instance_dir_exists?\n return if running?\n elsif inactive_instance_dir_exists?\n activate_instance_dir\n else\n make_instance\n end\n start\n end",
"title": ""
},
{
"docid": "d8ff41e9e33c715377b29bd1b349fd56",
"score": "0.5568437",
"text": "def create\n @machine_info = MachineInfo.new(machine_info_params)\n\n respond_to do |format|\n if @machine_info.save\n format.html { redirect_to @machine_info, notice: 'Machine info was successfully created.' }\n format.json { render :show, status: :created, location: @machine_info }\n else\n format.html { render :new }\n format.json { render json: @machine_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3bef52075870c958ea9eeccb17d690ba",
"score": "0.5566258",
"text": "def create_vm(config, node_name)\n config.vm.define node_name do |vm|\n vm.vm.host_name = node_name\n vm.vm.network \"private_network\", type: \"dhcp\"\n vm.vm.box = \"ubuntu/xenial64\"\n end\nend",
"title": ""
}
] |
4f73c4496ae2dc1e94c318f92a037e66
|
Returns a query solution constructed by binding any variables in this pattern with the corresponding terms in the given `statement`.
|
[
{
"docid": "3af5a1e01737e278ee805e6ce7037a92",
"score": "0.7420194",
"text": "def solution(statement)\n RDF::Query::Solution.new do |solution|\n solution[subject.to_sym] = statement.subject if subject.variable?\n solution[predicate.to_sym] = statement.predicate if predicate.variable?\n solution[object.to_sym] = statement.object if object.variable?\n end\n end",
"title": ""
}
] |
[
{
"docid": "585bf109d7bc9c76d9fa3a506c0dff99",
"score": "0.5713085",
"text": "def with_substitutions(assignment_hash)\n return self unless assignment_hash\n statement_hash = to_hash\n [:subject, :object, :predicate].each { |place_in_statement|\n bound_variables, variable = assignment_hash.keys, statement_hash[place_in_statement]\n statement_hash[place_in_statement] = assignment_hash[variable] if bound_variables.collect(&:to_s).include?(variable.to_s)\n #TODO: fix node equality so I don't need to use to_s above\n }\n Statement.new(statement_hash)\n end",
"title": ""
},
{
"docid": "e0e4acc3b433d6ba92f90a1a953a5589",
"score": "0.5610162",
"text": "def statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 7 )\n return_value = StatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __EJS17__ = nil\n __DIRECTIVE18__ = nil\n variable_statement13 = nil\n const_statement14 = nil\n empty_statement15 = nil\n function16 = nil\n class_statement19 = nil\n macro20 = nil\n labelled_statement21 = nil\n let_statement22 = nil\n expression_statement23 = nil\n if_statement24 = nil\n while_statement25 = nil\n do_while_statement26 = nil\n for_loop27 = nil\n continue_statement28 = nil\n break_statement29 = nil\n yield_statement30 = nil\n return_statement31 = nil\n with_statement32 = nil\n switch_statement33 = nil\n throw_statement34 = nil\n try_statement35 = nil\n\n tree_for_EJS17 = nil\n tree_for_DIRECTIVE18 = nil\n\n begin\n # at line 281:3: ( variable_statement | const_statement | empty_statement | ( 'function' )=> function | ( EJS )=> EJS | DIRECTIVE | class_statement | macro | ( ID ':' )=> labelled_statement | ( 'let' )=> let_statement | expression_statement | if_statement | while_statement | do_while_statement | for_loop | continue_statement | break_statement | yield_statement | return_statement | with_statement | switch_statement | throw_statement | try_statement )\n alt_6 = 23\n alt_6 = @dfa6.predict( @input )\n case alt_6\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 281:5: variable_statement\n @state.following.push( TOKENS_FOLLOWING_variable_statement_IN_statement_1902 )\n variable_statement13 = variable_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_statement13.tree )\n end\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 282:5: const_statement\n @state.following.push( TOKENS_FOLLOWING_const_statement_IN_statement_1908 )\n const_statement14 = const_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, const_statement14.tree )\n end\n\n when 3\n root_0 = @adaptor.create_flat_list\n\n\n # at line 283:5: empty_statement\n @state.following.push( TOKENS_FOLLOWING_empty_statement_IN_statement_1914 )\n empty_statement15 = empty_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, empty_statement15.tree )\n end\n\n when 4\n root_0 = @adaptor.create_flat_list\n\n\n # at line 284:5: ( 'function' )=> function\n @state.following.push( TOKENS_FOLLOWING_function_IN_statement_1927 )\n function16 = function\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, function16.tree )\n end\n\n when 5\n root_0 = @adaptor.create_flat_list\n\n\n # at line 285:5: ( EJS )=> EJS\n __EJS17__ = match( EJS, TOKENS_FOLLOWING_EJS_IN_statement_1940 )\n if @state.backtracking == 0\n\n tree_for_EJS17 = @adaptor.create_with_payload( __EJS17__ )\n root_0 = @adaptor.become_root( tree_for_EJS17, root_0 )\n\n end\n\n when 6\n root_0 = @adaptor.create_flat_list\n\n\n # at line 286:5: DIRECTIVE\n __DIRECTIVE18__ = match( DIRECTIVE, TOKENS_FOLLOWING_DIRECTIVE_IN_statement_1947 )\n if @state.backtracking == 0\n\n tree_for_DIRECTIVE18 = @adaptor.create_with_payload( __DIRECTIVE18__ )\n root_0 = @adaptor.become_root( tree_for_DIRECTIVE18, root_0 )\n\n end\n\n when 7\n root_0 = @adaptor.create_flat_list\n\n\n # at line 287:5: class_statement\n @state.following.push( TOKENS_FOLLOWING_class_statement_IN_statement_1954 )\n class_statement19 = class_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, class_statement19.tree )\n end\n\n when 8\n root_0 = @adaptor.create_flat_list\n\n\n # at line 288:5: macro\n @state.following.push( TOKENS_FOLLOWING_macro_IN_statement_1960 )\n macro20 = macro\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, macro20.tree )\n end\n\n when 9\n root_0 = @adaptor.create_flat_list\n\n\n # at line 289:5: ( ID ':' )=> labelled_statement\n @state.following.push( TOKENS_FOLLOWING_labelled_statement_IN_statement_1976 )\n labelled_statement21 = labelled_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, labelled_statement21.tree )\n end\n\n when 10\n root_0 = @adaptor.create_flat_list\n\n\n # at line 290:5: ( 'let' )=> let_statement\n @state.following.push( TOKENS_FOLLOWING_let_statement_IN_statement_1989 )\n let_statement22 = let_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, let_statement22.tree )\n end\n\n when 11\n root_0 = @adaptor.create_flat_list\n\n\n # at line 291:5: expression_statement\n @state.following.push( TOKENS_FOLLOWING_expression_statement_IN_statement_1995 )\n expression_statement23 = expression_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, expression_statement23.tree )\n end\n\n when 12\n root_0 = @adaptor.create_flat_list\n\n\n # at line 292:5: if_statement\n @state.following.push( TOKENS_FOLLOWING_if_statement_IN_statement_2001 )\n if_statement24 = if_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, if_statement24.tree )\n end\n\n when 13\n root_0 = @adaptor.create_flat_list\n\n\n # at line 293:5: while_statement\n @state.following.push( TOKENS_FOLLOWING_while_statement_IN_statement_2007 )\n while_statement25 = while_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, while_statement25.tree )\n end\n\n when 14\n root_0 = @adaptor.create_flat_list\n\n\n # at line 294:5: do_while_statement\n @state.following.push( TOKENS_FOLLOWING_do_while_statement_IN_statement_2013 )\n do_while_statement26 = do_while_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, do_while_statement26.tree )\n end\n\n when 15\n root_0 = @adaptor.create_flat_list\n\n\n # at line 295:5: for_loop\n @state.following.push( TOKENS_FOLLOWING_for_loop_IN_statement_2019 )\n for_loop27 = for_loop\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, for_loop27.tree )\n end\n\n when 16\n root_0 = @adaptor.create_flat_list\n\n\n # at line 296:5: continue_statement\n @state.following.push( TOKENS_FOLLOWING_continue_statement_IN_statement_2025 )\n continue_statement28 = continue_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, continue_statement28.tree )\n end\n\n when 17\n root_0 = @adaptor.create_flat_list\n\n\n # at line 297:5: break_statement\n @state.following.push( TOKENS_FOLLOWING_break_statement_IN_statement_2031 )\n break_statement29 = break_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, break_statement29.tree )\n end\n\n when 18\n root_0 = @adaptor.create_flat_list\n\n\n # at line 298:5: yield_statement\n @state.following.push( TOKENS_FOLLOWING_yield_statement_IN_statement_2037 )\n yield_statement30 = yield_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, yield_statement30.tree )\n end\n\n when 19\n root_0 = @adaptor.create_flat_list\n\n\n # at line 299:5: return_statement\n @state.following.push( TOKENS_FOLLOWING_return_statement_IN_statement_2043 )\n return_statement31 = return_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, return_statement31.tree )\n end\n\n when 20\n root_0 = @adaptor.create_flat_list\n\n\n # at line 300:5: with_statement\n @state.following.push( TOKENS_FOLLOWING_with_statement_IN_statement_2049 )\n with_statement32 = with_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, with_statement32.tree )\n end\n\n when 21\n root_0 = @adaptor.create_flat_list\n\n\n # at line 301:5: switch_statement\n @state.following.push( TOKENS_FOLLOWING_switch_statement_IN_statement_2055 )\n switch_statement33 = switch_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, switch_statement33.tree )\n end\n\n when 22\n root_0 = @adaptor.create_flat_list\n\n\n # at line 302:5: throw_statement\n @state.following.push( TOKENS_FOLLOWING_throw_statement_IN_statement_2061 )\n throw_statement34 = throw_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, throw_statement34.tree )\n end\n\n when 23\n root_0 = @adaptor.create_flat_list\n\n\n # at line 303:5: try_statement\n @state.following.push( TOKENS_FOLLOWING_try_statement_IN_statement_2067 )\n try_statement35 = try_statement\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, try_statement35.tree )\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 7 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "7abec1f16308e4ef80c4d5381f1d08a0",
"score": "0.55200326",
"text": "def query(*triples)\n bindings = nil\n triples.each do |triple|\n binding_position = {}\n query = []\n triple.each_with_index do |e, i|\n if query_variable?(e)\n binding_position[e] = i\n query << nil\n else\n query << e \n end\n end\n rows = find(*query)\n if bindings.nil?\n bindings = rows.inject([]) do |list, row|\n binding = {}\n binding_position.each do |var, pos|\n binding[var] = row[pos]\n end\n list << binding\n end\n else\n new_binding = []\n bindings.each do |binding|\n rows.each do |row|\n valid_match = true\n temp_binding = binding.dup\n binding_position.each do |var, pos|\n if temp_binding.include?(var)\n valid_match = false if temp_binding[var] != row[pos]\n else\n temp_binding[var] = row[pos]\n end\n end\n new_binding << temp_binding if valid_match\n end\n end\n bindings = new_binding.dup\n end\n bindings\n end\n return bindings\n end",
"title": ""
},
{
"docid": "acbc1e3abd39bb6278a287b76bfa6a21",
"score": "0.53821874",
"text": "def from_statements(input)\n defaultGraph = {:nodes => {}, :listMap => {}, :name => ''}\n graphs = {'' => defaultGraph}\n\n value = nil\n ec = EvaluationContext.new\n\n # Create a map for node to object representation\n\n # For each triple in input\n input.each do |statement|\n debug(\"statement\") { statement.to_nquads.chomp}\n\n subject = ec.expand_iri(statement.subject).to_s\n name = statement.context ? ec.expand_iri(statement.context).to_s : ''\n \n # Create a graph entry as needed\n graph = graphs[name] ||= {:nodes => {}, :listMap => {}, :name => name}\n \n case statement.predicate\n when RDF.first\n # If property is rdf:first,\n # create a new entry in _listMap_ for _name_ and _subject_ and an array value\n # containing the object representation and continue to the next statement.\n listMap = graph[:listMap]\n entry = listMap[subject] ||= {}\n object_rep = ec.expand_value(nil, statement.object)\n entry[:first] = object_rep\n debug(\"rdf:first\") { \"save entry for #{subject.inspect} #{entry.inspect}\"}\n next\n when RDF.rest\n # If property is rdf:rest,\n # and object is a blank node,\n # create a new entry in _restMap_ for _name_ and _subject_ and a value being the\n # result of IRI expansion on the object and continue to the next statement.\n next unless statement.object.is_a?(RDF::Node)\n\n listMap = graph[:listMap]\n entry = listMap[subject] ||= {}\n\n object_rep = ec.expand_iri(statement.object).to_s\n entry[:rest] = object_rep\n debug(\"rdf:rest\") { \"save entry for #{subject.inspect} #{entry.inspect}\"}\n next\n end\n\n # Add entry to default graph for name unless it is empty\n defaultGraph[:nodes][name] ||= {'@id' => name} unless name.empty?\n \n # Get value from graph nodes for subject, initializing it to a new node declaration for subject if it does not exist\n debug(\"@id\") { \"new subject: #{subject}\"} unless graph[:nodes].has_key?(subject)\n value = graph[:nodes][subject] ||= {'@id' => subject}\n\n # If property is http://www.w3.org/1999/02/22-rdf-syntax-ns#type\n # and the useRdfType option is not true\n if statement.predicate == RDF.type && !@options[:useRdfType]\n object = ec.expand_iri(statement.object).to_s\n debug(\"@type\") { object.inspect}\n # append the string representation of object to the array value for the key @type, creating\n # an entry if necessary\n (value['@type'] ||= []) << object\n # FIXME: 3.7) If object is a typed literal and the useNativeTypes option is set to true:\n elsif statement.object == RDF.nil\n # Otherwise, if object is http://www.w3.org/1999/02/22-rdf-syntax-ns#nil, let\n # key be the string representation of predicate. Set the value\n # for key to an empty @list representation {\"@list\": []}\n key = ec.expand_iri(statement.predicate).to_s\n (value[key] ||= []) << {\"@list\" => []}\n else\n # Otherwise, let key be the string representation of predicate and \n # let object representation be object represented in expanded form as \n # described in Value Expansion.\n key = ec.expand_iri(statement.predicate).to_s\n object = ec.expand_value(key, statement.object, @options)\n if blank_node?(object)\n # if object is an Unnamed Node, set as the head element in the listMap\n # entry for object\n listMap = graph[:listMap]\n entry = listMap[object['@id']] ||= {}\n entry[:head] = object\n debug(\"bnode\") { \"save entry #{entry.inspect}\"}\n end\n\n debug(\"key/value\") { \"key: #{key}, :value #{object.inspect}\"}\n \n # append the object object representation to the array value for key, creating\n # an entry if necessary\n (value[key] ||= []) << object\n end\n end\n\n # Build lists for each graph\n graphs.each do |name, graph|\n graph[:listMap].each do |subject, entry|\n debug(\"listMap(#{name}, #{subject})\") { entry.inspect}\n if entry.has_key?(:head) && entry.has_key?(:first)\n debug(\"@list\") { \"List head for #{subject.inspect} in #{name.inspect}: #{entry.inspect}\"}\n value = entry[:head]\n value.delete('@id')\n list = value['@list'] = [entry[:first]].compact\n \n while rest = entry.fetch(:rest, nil)\n entry = graph[:listMap][rest]\n debug(\" => \") { \"add #{entry.inspect}\"}\n raise JSON::LD::ProcessingError, \"list entry missing rdf:first\" unless entry.has_key?(:first)\n list << entry[:first]\n end\n end\n end\n end\n\n # Build graphs in @id order\n debug(\"graphs\") {graphs.to_json(JSON_STATE)}\n array = defaultGraph[:nodes].keys.sort.map do |subject|\n entry = defaultGraph[:nodes][subject]\n debug(\"=> default\") {entry.to_json(JSON_STATE)}\n \n # If subject is a named graph, add serialized subject defintions\n if graphs.has_key?(subject) && !subject.empty?\n entry['@graph'] = graphs[subject][:nodes].keys.sort.map do |s|\n debug(\"=> #{s.inspect}\")\n graphs[subject][:nodes][s]\n end\n end\n \n debug(\"default graph\") {entry.inspect}\n entry\n end\n\n # Return array as the graph representation.\n debug(\"fromRDF\") {array.to_json(JSON_STATE)}\n array\n end",
"title": ""
},
{
"docid": "dd689abcc3e25cebc0f0e58344a7bddd",
"score": "0.53266543",
"text": "def query\n <<-SPARQL\n SELECT DISTINCT ?item WHERE {\n {\n ?item p:P31 ?statement0.\n ?statement0 (ps:P31/(wdt:P279*)) wd:Q7889.\n }\n UNION\n {\n ?item p:P31 ?statement1.\n ?statement1 (ps:P31) wd:Q16070115.\n }\n UNION\n {\n ?item p:P31 ?statement2.\n ?statement2 (ps:P31/(wdt:P279*)) wd:Q865493.\n }\n UNION\n {\n ?item p:P31 ?statement3.\n ?statement3 (ps:P31) wd:Q209163.\n }\n }\n SPARQL\nend",
"title": ""
},
{
"docid": "581811857366798811a258cfaf4a69db",
"score": "0.5280022",
"text": "def sql(bindings, type = :find)\n statement, bind_values = build_statement(type)\n statement.gsub('?') { eval_bound_value(bind_values.shift, connection, bindings) }\n end",
"title": ""
},
{
"docid": "9618d4eb49fea33fe70fc4534f5c3e8e",
"score": "0.5274374",
"text": "def statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n return_value = StatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n variable_statement8 = nil\n labelled_statement9 = nil\n if_statement10 = nil\n while_statement11 = nil\n do_while_statement12 = nil\n for_loop13 = nil\n continue_statement14 = nil\n break_statement15 = nil\n yield_statement16 = nil\n return_statement17 = nil\n with_statement18 = nil\n switch_statement19 = nil\n throw_statement20 = nil\n try_statement21 = nil\n expression22 = nil\n\n\n begin\n # at line 35:3: ( variable_statement | labelled_statement | if_statement | while_statement | do_while_statement | for_loop | continue_statement | break_statement | yield_statement | return_statement | with_statement | switch_statement | throw_statement | try_statement | expression )\n alt_5 = 15\n case look_5 = @input.peek( 1 )\n when VAR then alt_5 = 1\n when LABEL then alt_5 = 2\n when IF, UNLESS then alt_5 = 3\n when UNTIL, WHILE then alt_5 = 4\n when DO then alt_5 = 5\n when EACH, FOR, FOR_IN then alt_5 = 6\n when CONTINUE then alt_5 = 7\n when BREAK then alt_5 = 8\n when YIELD then alt_5 = 9\n when RETURN then alt_5 = 10\n when WITH then alt_5 = 11\n when SWITCH then alt_5 = 12\n when THROW then alt_5 = 13\n when CATCH, FINALLY then alt_5 = 14\n when AMP, FUNCTION, PLUS_ASGN, AMP_ASGN, POST_DECR, GEQ, POST_INCR, AREF, GREATER, QMARK, ARRAY, HAT, ARROW, HAT_ASGN, ASGN, REGEX, IN, INCR, INSTANCEOF, RSHIFT, CALL, ITER, RSHIFT3, RSHIFT3_ASGN, RSHIFT_ASGN, LEQ, LESS, SLASH, SLASH_ASGN, STAR, DECR, STAR_ASGN, LSHIFT, DELETE, LSHIFT_ASGN, THIS, MINUS, TILDE, MINUS_ASGN, TRUE, DOT, MOD, MOD_ASGN, TYPEOF, NEQ, UMINUS, NEQQ, UNDEFINED, NEW, NOT, NULL, UPLUS, OBJECT, EQ, OR, VOID, EQQ, OR_ASGN, FALSE, PIPE, PIPE_ASGN, PLUS, ID, IVAR, NUMBER, STRING, DOC then alt_5 = 15\n else\n raise NoViableAlternative( \"\", 5, 0 )\n end\n case alt_5\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 35:5: variable_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_variable_statement_IN_statement_127 )\n variable_statement8 = variable_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, variable_statement8.tree )\n\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 36:5: labelled_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_labelled_statement_IN_statement_133 )\n labelled_statement9 = labelled_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, labelled_statement9.tree )\n\n\n when 3\n root_0 = @adaptor.create_flat_list\n\n\n # at line 37:5: if_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_if_statement_IN_statement_139 )\n if_statement10 = if_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, if_statement10.tree )\n\n\n when 4\n root_0 = @adaptor.create_flat_list\n\n\n # at line 38:5: while_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_while_statement_IN_statement_145 )\n while_statement11 = while_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, while_statement11.tree )\n\n\n when 5\n root_0 = @adaptor.create_flat_list\n\n\n # at line 39:5: do_while_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_do_while_statement_IN_statement_151 )\n do_while_statement12 = do_while_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, do_while_statement12.tree )\n\n\n when 6\n root_0 = @adaptor.create_flat_list\n\n\n # at line 40:5: for_loop\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_for_loop_IN_statement_157 )\n for_loop13 = for_loop\n @state.following.pop\n\n @adaptor.add_child( root_0, for_loop13.tree )\n\n\n when 7\n root_0 = @adaptor.create_flat_list\n\n\n # at line 41:5: continue_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_continue_statement_IN_statement_163 )\n continue_statement14 = continue_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, continue_statement14.tree )\n\n\n when 8\n root_0 = @adaptor.create_flat_list\n\n\n # at line 42:5: break_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_break_statement_IN_statement_169 )\n break_statement15 = break_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, break_statement15.tree )\n\n\n when 9\n root_0 = @adaptor.create_flat_list\n\n\n # at line 43:5: yield_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_yield_statement_IN_statement_175 )\n yield_statement16 = yield_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, yield_statement16.tree )\n\n\n when 10\n root_0 = @adaptor.create_flat_list\n\n\n # at line 44:5: return_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_return_statement_IN_statement_181 )\n return_statement17 = return_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, return_statement17.tree )\n\n\n when 11\n root_0 = @adaptor.create_flat_list\n\n\n # at line 45:5: with_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_with_statement_IN_statement_187 )\n with_statement18 = with_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, with_statement18.tree )\n\n\n when 12\n root_0 = @adaptor.create_flat_list\n\n\n # at line 46:5: switch_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_switch_statement_IN_statement_193 )\n switch_statement19 = switch_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, switch_statement19.tree )\n\n\n when 13\n root_0 = @adaptor.create_flat_list\n\n\n # at line 47:5: throw_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_throw_statement_IN_statement_199 )\n throw_statement20 = throw_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, throw_statement20.tree )\n\n\n when 14\n root_0 = @adaptor.create_flat_list\n\n\n # at line 48:5: try_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_try_statement_IN_statement_205 )\n try_statement21 = try_statement\n @state.following.pop\n\n @adaptor.add_child( root_0, try_statement21.tree )\n\n\n when 15\n root_0 = @adaptor.create_flat_list\n\n\n # at line 49:5: expression\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_statement_211 )\n expression22 = expression\n @state.following.pop\n\n @adaptor.add_child( root_0, expression22.tree )\n\n\n end\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "d8e4ee7b7e163c5e52117f203c32690b",
"score": "0.5273202",
"text": "def buildSolution(symbol)\n\n solArg = []\n solOutput = \"\"\n queryArray = @queryString.split(\"\\n\")\n\n queryArray.each do |l|\n if l.downcase.match(/^select/)\n solArg = l.scan(/\\w+/)\n end\n end\n\n for i in 1..solArg.length-1\n if solOutput != \"\"\n solOutput = solOutput + \"+ \\\"\\\\t\\\" + \" + \" #{symbol}[:#{solArg[i]}]\"\n else\n solOutput = \"#{symbol}[:#{solArg[i]}]\"\n end\n end\n\n return solOutput\n\nend",
"title": ""
},
{
"docid": "02b5a549ccaaa14b49448c1ef54b954a",
"score": "0.51446813",
"text": "def statement (node)\n @logger.debug(\"statement\")\n # At global level this should assign to implicit variable 'ans'\n # At local level the result can be thrown away\n # Since the result is thrown away, then optimizer can eliminate the code\n #result = nil\n n = node.child\n #result =\n #case n.kind\n # Break is only valid inside loops\n #when :BREAK_EXPR then breakExpr(n)\n #when :PRINT_EXPR then printExpr(n)\n #when :RETURN_EXPR then returnExpr(n)\n #when :WHILE_EXPR then whileExpr(n)\n #else\n # expression(n)\n #end\n # statement isn't really supposed to have a result\n result = expression(n)\n result\n end",
"title": ""
},
{
"docid": "4cd18fbe019b5f8a74c850c0b23b063c",
"score": "0.5137724",
"text": "def statement_list\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 4 )\n return_value = StatementListReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n statement6 = nil\n\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 27:5: ( statement )+\n # at file 27:5: ( statement )+\n match_count_4 = 0\n while true\n alt_4 = 2\n look_4_0 = @input.peek( 1 )\n\n if ( look_4_0.between?( AMP, AMP_ASGN ) || look_4_0 == POST_DECR || look_4_0.between?( GEQ, AREF ) || look_4_0.between?( GREATER, HAT ) || look_4_0.between?( ARROW, HAT_ASGN ) || look_4_0.between?( ASGN, REGEX ) || look_4_0.between?( IN, RETURN ) || look_4_0 == INCR || look_4_0.between?( BREAK, RSHIFT3 ) || look_4_0.between?( LABEL, CATCH ) || look_4_0 == RSHIFT_ASGN || look_4_0 == LEQ || look_4_0.between?( LESS, SLASH ) || look_4_0.between?( SLASH_ASGN, CONTINUE ) || look_4_0.between?( STAR, DECR ) || look_4_0 == STAR_ASGN || look_4_0.between?( LSHIFT, THIS ) || look_4_0 == THROW || look_4_0.between?( MINUS, MOD ) || look_4_0.between?( MOD_ASGN, TYPEOF ) || look_4_0.between?( NEQ, UMINUS ) || look_4_0.between?( NEQQ, UNDEFINED ) || look_4_0.between?( NEW, UPLUS ) || look_4_0.between?( OBJECT, FALSE ) || look_4_0.between?( WITH, PLUS ) || look_4_0.between?( ID, DOC ) )\n alt_4 = 1\n\n end\n case alt_4\n when 1\n # at line 27:5: statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_statement_IN_statement_list_100 )\n statement6 = statement\n @state.following.pop\n\n @adaptor.add_child( root_0, statement6.tree )\n\n\n else\n match_count_4 > 0 and break\n eee = EarlyExit(4)\n\n\n raise eee\n end\n match_count_4 += 1\n end\n\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 4 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "4fd9be34e9b7cdee03bfc9e18990dd83",
"score": "0.50870967",
"text": "def execute(statement, *bind_values)\n with_connection do |connection|\n command = connection.create_command(statement)\n command.execute_non_query(*bind_values)\n end\n end",
"title": ""
},
{
"docid": "897d8a4c2a9d91de4a4394b98498a15e",
"score": "0.50819",
"text": "def all_bindings_in_clauses clauses\n clauses.map do |clause|\n clause.nps.map do |np|\n raise \"Noun phrase #{np.inspect} must have a binding\" unless np.binding\n [np.binding] + (np.nested_clauses ? all_bindings_in_clauses(np.nested_clauses) : [])\n end\n end.\n flatten.\n uniq\n end",
"title": ""
},
{
"docid": "9c7cff8d33b981801448337e5d7857e5",
"score": "0.5050608",
"text": "def clause\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n return_value = ClauseReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n expression7 = nil\n\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 31:5: expression\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_clause_114 )\n expression7 = expression\n @state.following.pop\n\n @adaptor.add_child( root_0, expression7.tree )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 5 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "194569d1b82725653e68182e2bd88175",
"score": "0.5023488",
"text": "def where_exp(input, variable, expression); end",
"title": ""
},
{
"docid": "7b0fb723463da26b952c3193dec657d5",
"score": "0.5021762",
"text": "def variable_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n return_value = VariableStatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n string_literal38 = nil\n variable_declaration39 = nil\n\n tree_for_string_literal38 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 70:5: ^( 'var' ( variable_declaration )+ )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal38 = match( VAR, TOKENS_FOLLOWING_VAR_IN_variable_statement_326 )\n\n tree_for_string_literal38 = @adaptor.copy_node( string_literal38 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal38, root_1 )\n\n\n\n match( DOWN, nil )\n # at file 70:14: ( variable_declaration )+\n match_count_8 = 0\n while true\n alt_8 = 2\n look_8_0 = @input.peek( 1 )\n\n if ( look_8_0 == ASGN || look_8_0 == ID )\n alt_8 = 1\n\n end\n case alt_8\n when 1\n # at line 70:14: variable_declaration\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_variable_declaration_IN_variable_statement_328 )\n variable_declaration39 = variable_declaration\n @state.following.pop\n\n @adaptor.add_child( root_1, variable_declaration39.tree )\n\n\n else\n match_count_8 > 0 and break\n eee = EarlyExit(8)\n\n\n raise eee\n end\n match_count_8 += 1\n end\n\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 11 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "b430358614d917879bcd10e50cb5fc57",
"score": "0.501496",
"text": "def criteria_from_array(condition) # :nodoc:\n str, *values = condition\n sql = if values.first.kind_of?(Hash) and str =~ /:\\w+/\n replace_named_bind_variables(str, values.first)\n elsif str.include?('?')\n replace_bind_variables(str, values)\n else\n str % values.collect {|value| quote_value(value) }\n end\n criteria_from_string(sql)\n end",
"title": ""
},
{
"docid": "479a5ebfa968000e0d1108339a3c1cee",
"score": "0.5008951",
"text": "def create_statement(statement)\n case statement\n when Statement then statement\n when Hash then Statement.new(statement)\n when Array then Statement.new(*statement)\n else raise ArgumentError.new # FIXME\n end\n end",
"title": ""
},
{
"docid": "a4c8d4e6491195c71e03b2f0d4349ba1",
"score": "0.50045466",
"text": "def stream_statement(statement)\n # log_debug(\"ss\") {\"state: #{@state.inspect}, stmt: #{statement}\"}\n if @current_graph != statement.graph_name\n end_graph\n start_graph(statement.graph_name)\n end\n\n # If we're writing a list\n @current_node_def ||= { '@id' => statement.subject.to_s }\n\n if statement.subject.to_s != @current_node_def['@id']\n end_node\n @current_node_def = { '@id' => statement.subject.to_s }\n end\n\n if statement.predicate == RDF.type\n (@current_node_def['@type'] ||= []) << statement.object.to_s\n else\n pd = (@current_node_def[statement.predicate.to_s] ||= [])\n\n pd << if statement.object.resource?\n { '@id' => statement.object.to_s }\n elsif statement.object.datatype == RDF_JSON\n { \"@value\" => MultiJson.load(statement.object.to_s), \"@type\" => \"@json\" }\n else\n lit = { \"@value\" => statement.object.to_s }\n lit[\"@type\"] = statement.object.datatype.to_s if statement.object.datatype?\n lit[\"@language\"] = statement.object.language.to_s if statement.object.language?\n lit\n end\n end\n self\n end",
"title": ""
},
{
"docid": "4bf869f3ab632aeb3900054a240abf3f",
"score": "0.49709955",
"text": "def <<(statement)\n # ActiveTriples::Resource expects: RDF::Statement, Hash, or Array\n statement = RDF::Statement.from(statement) unless statement.is_a? RDF::Statement\n\n # Only push statement if the statement's predicate is defined on the class\n field_name = field_from_predicate(statement.predicate)\n return unless field_name\n\n objects = statement.object.is_a?(RDF::Node) && block_given? ? yield : statement.object\n\n update_field(field_name, *objects) if fields[field_name]\n update_relation(field_name, *objects) if relations[field_name]\n end",
"title": ""
},
{
"docid": "09b7d149f229b30b99e92ff2085fc8c2",
"score": "0.495279",
"text": "def clause\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n return_value = ClauseReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal10 = nil\n char_literal12 = nil\n expression_list11 = nil\n\n tree_for_char_literal10 = nil\n tree_for_char_literal12 = nil\n stream_RPAREN = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token RPAREN\" )\n stream_LPAREN = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token LPAREN\" )\n stream_expression_list = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule expression_list\" )\n begin\n # at line 273:5: '(' expression_list ')'\n char_literal10 = match( LPAREN, TOKENS_FOLLOWING_LPAREN_IN_clause_1878 )\n if @state.backtracking == 0\n stream_LPAREN.add( char_literal10 )\n end\n @state.following.push( TOKENS_FOLLOWING_expression_list_IN_clause_1880 )\n expression_list11 = expression_list\n @state.following.pop\n if @state.backtracking == 0\n stream_expression_list.add( expression_list11.tree )\n end\n char_literal12 = match( RPAREN, TOKENS_FOLLOWING_RPAREN_IN_clause_1882 )\n if @state.backtracking == 0\n stream_RPAREN.add( char_literal12 )\n end\n # AST Rewrite\n # elements: expression_list\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 273:29: -> expression_list\n @adaptor.add_child( root_0, stream_expression_list.next_tree )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "a8074241598f2a34be9b503b9a357666",
"score": "0.4951374",
"text": "def preprocess_statement(statement)\n #add_debug {\"preprocess: #{statement.inspect}\"}\n return unless statement.context == graph_name\n bump_reference(statement.subject)\n bump_reference(statement.object)\n @subjects[statement.subject] = true\n get_curie(statement.subject)\n get_curie(statement.predicate)\n get_curie(statement.object)\n get_curie(statement.object.datatype) if statement.object.literal? && statement.object.has_datatype?\n end",
"title": ""
},
{
"docid": "5e1fe98bb41111893e8912ca36adc96b",
"score": "0.49493307",
"text": "def statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 10 )\n\n\n value = nil\n\n\n a = nil\n\n\n begin\n # at line 73:5: a= ( if_statement | while_statement | return_statement | ( function_call_statement assignment_type )=> variable_assignment_statement | function_call_statement ) ( NL )*\n # at line 73:7: ( if_statement | while_statement | return_statement | ( function_call_statement assignment_type )=> variable_assignment_statement | function_call_statement )\n alt_21 = 5\n case look_21 = @input.peek( 1 )\n when IF then alt_21 = 1\n when WHILE then alt_21 = 2\n when RETURN then alt_21 = 3\n when IDENT then look_21_4 = @input.peek( 2 )\n\n if ( syntactic_predicate?( :synpred1_Entity ) )\n alt_21 = 4\n elsif ( true )\n alt_21 = 5\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 21, 4 )\n\n end\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 21, 0 )\n\n end\n case alt_21\n when 1\n # at line 73:9: if_statement\n @state.following.push( TOKENS_FOLLOWING_if_statement_IN_statement_572 )\n a = if_statement\n @state.following.pop\n\n when 2\n # at line 74:5: while_statement\n @state.following.push( TOKENS_FOLLOWING_while_statement_IN_statement_578 )\n a = while_statement\n @state.following.pop\n\n when 3\n # at line 75:5: return_statement\n @state.following.push( TOKENS_FOLLOWING_return_statement_IN_statement_584 )\n a = return_statement\n @state.following.pop\n\n when 4\n # at line 76:5: ( function_call_statement assignment_type )=> variable_assignment_statement\n @state.following.push( TOKENS_FOLLOWING_variable_assignment_statement_IN_statement_597 )\n a = variable_assignment_statement\n @state.following.pop\n\n when 5\n # at line 77:5: function_call_statement\n @state.following.push( TOKENS_FOLLOWING_function_call_statement_IN_statement_603 )\n a = function_call_statement\n @state.following.pop\n\n end\n # at line 78:5: ( NL )*\n while true # decision 22\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0 == NL )\n alt_22 = 1\n\n end\n case alt_22\n when 1\n # at line 78:5: NL\n match( NL, TOKENS_FOLLOWING_NL_IN_statement_609 )\n\n else\n break # out of loop for decision 22\n end\n end # loop for decision 22\n\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = a \n # <-- action\n end\n\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 10 )\n\n\n end\n\n return value\n end",
"title": ""
},
{
"docid": "b53ebf4cfea2a7e9414f951b8391a894",
"score": "0.4945314",
"text": "def variable_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n return_value = VariableStatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal62 = nil\n variable_declaration_list63 = nil\n statement_end64 = nil\n\n tree_for_string_literal62 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 379:5: 'var' variable_declaration_list statement_end\n string_literal62 = match( VAR, TOKENS_FOLLOWING_VAR_IN_variable_statement_2484 )\n if @state.backtracking == 0\n\n tree_for_string_literal62 = @adaptor.create_with_payload( string_literal62 )\n root_0 = @adaptor.become_root( tree_for_string_literal62, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_variable_declaration_list_IN_variable_statement_2487 )\n variable_declaration_list63 = variable_declaration_list\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_declaration_list63.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_statement_end_IN_variable_statement_2489 )\n statement_end64 = statement_end\n @state.following.pop\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 18 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "d583e1ba4f0bc97a3ded9565b377aa8a",
"score": "0.49167666",
"text": "def each(solutions: RDF::Query::Solutions(RDF::Query::Solution.new), &block)\n log_debug(\"(formula each)\") {SXP::Generator.string([self, solutions].to_sxp_bin)}\n\n # Yield statements by binding variables\n solutions.each do |solution|\n # Bind blank nodes to the solution when it doesn't contain a solution for an existential variable\n existential_vars.each do |var|\n solution[var.name] ||= RDF::Node.intern(var.name.to_s.sub(/^\\$+/, ''))\n end\n\n log_debug(\"(formula apply)\") {solution.to_sxp}\n # Yield each variable statement which is constant after applying solution\n log_depth do\n n3statements.each do |statement|\n terms = {}\n [:subject, :predicate, :object].each do |part|\n terms[part] = case o = statement.send(part)\n when RDF::Query::Variable\n if solution[o] && solution[o].formula?\n log_info(\"(formula from var form)\") {solution[o].graph_name.to_sxp}\n form_statements(solution[o], solution: solution, &block)\n else\n solution[o] || o\n end\n when RDF::N3::List\n o.variable? ? o.evaluate(solution.bindings, formulae: formulae) : o\n when RDF::N3::Algebra::Formula\n # uses the graph_name of the formula, and yields statements from the formula. No solutions are passed in.\n log_info(\"(formula from form)\") {o.graph_name.to_sxp}\n form_statements(o, solution: solution, &block)\n else\n o\n end\n end\n\n statement = RDF::Statement.from(terms)\n log_debug(\"(formula add)\") {statement.to_sxp}\n\n block.call(statement)\n end\n\n # statements from sub-operands\n sub_ops.each do |op|\n log_debug(\"(formula sub_op)\") {SXP::Generator.string [op, solution].to_sxp_bin}\n op.each(solutions: RDF::Query::Solutions(solution)) do |stmt|\n log_debug(\"(formula add from sub_op)\") {stmt.to_sxp}\n block.call(stmt)\n # Add statements for any term which is a formula\n stmt.to_a.select(&:node?).map {|n| formulae[n]}.compact.each do |ef|\n log_debug(\"(formula from form)\") {ef.graph_name.to_sxp}\n form_statements(ef, solution: solution, &block) \n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "863bf3dc6aa9f3c600005022f59f0e1a",
"score": "0.48761737",
"text": "def postgres_binds(query_with_binds)\n bind_index = 0\n query_with_binds.gsub('?') { |match|\n bind_index += 1\n \"$#{bind_index}\"\n }\nend",
"title": ""
},
{
"docid": "32654ca9fd16db19efbe46b715006af7",
"score": "0.48686257",
"text": "def sql\n return @incoming_sql if parameter.blank?\n\n @incoming_sql = @incoming_sql.joins(:instances)\n .joins(instances: :reference)\n .where([text_search_version,\n text_search_param(parameter)])\n @incoming_sql = @incoming_sql.where(PROTOLOGUE_CLAUSE) if @parser.protologue?\n @incoming_sql\n end",
"title": ""
},
{
"docid": "6017ace9a5df72900cec3a0a6753d9e4",
"score": "0.48666012",
"text": "def statement\n return for_statement if match?(:for)\n return if_statement if match?(:if)\n return print_statement if match?(:print)\n return return_statement if match?(:return)\n return while_statement if match?(:while)\n return Ringo::Block.new(block) if match?(:lbrace)\n return expression_statement\n end",
"title": ""
},
{
"docid": "12277eeb39f2d8182a357c84a10454d5",
"score": "0.4860277",
"text": "def execute(queryable)\n RDF::Query.new(antecedents).execute(queryable).each do |solution|\n nodes = {}\n consequents.each do |consequent|\n terms = {}\n [:subject, :predicate, :object].each do |r|\n terms[r] = case o = consequent.send(r)\n when RDF::Node then nodes[o] ||= RDF::Node.new\n when RDF::Query::Variable then solution[o]\n else o\n end\n end\n\n yield RDF::Statement.from(terms)\n end\n end\n end",
"title": ""
},
{
"docid": "12277eeb39f2d8182a357c84a10454d5",
"score": "0.4860277",
"text": "def execute(queryable)\n RDF::Query.new(antecedents).execute(queryable).each do |solution|\n nodes = {}\n consequents.each do |consequent|\n terms = {}\n [:subject, :predicate, :object].each do |r|\n terms[r] = case o = consequent.send(r)\n when RDF::Node then nodes[o] ||= RDF::Node.new\n when RDF::Query::Variable then solution[o]\n else o\n end\n end\n\n yield RDF::Statement.from(terms)\n end\n end\n end",
"title": ""
},
{
"docid": "dfa3924f54d57fa450ef5d3d2d928c23",
"score": "0.4856499",
"text": "def statements_as(role)\n if(!term.to_s[0..1].eql? \"_:\")\n input_uri = \"<#{term.to_s}>\"\n elsif(:predicate.eql? role)\n return []\n else\n input_uri = term.to_s\n end\n\n case role\n when :subject\n query = \"SELECT ?p ?o ?dt ?lit ?lang WHERE{ #{input_uri} ?p ?o BIND(datatype(?o) AS ?dt) BIND(isLiteral(?o) AS ?lit) BIND(lang(?o) AS ?lang)}\"\n sparql.query(query).map do |solution|\n check = check_solution(solution)\n create_statement(term.to_s, solution.p, solution.o, solution.lit, check[:lang], check[:data_type])\n end\n when :predicate\n query = \"SELECT ?s ?o ?dt ?lit ?lang WHERE{ ?s #{input_uri} ?o BIND(datatype(?o) AS ?dt) BIND(isLiteral(?o) AS ?lit) BIND(lang(?o) AS ?lang)}\"\n sparql.query(query).map do |solution|\n check = check_solution(solution)\n create_statement(solution.s, term.to_s, solution.o, solution.lit, check[:lang], check[:data_type])\n end\n when :object\n query = \"SELECT ?s ?p WHERE{ ?s ?p #{input_uri}}\"\n sparql.query(query).map do |solution|\n create_statement( solution.s, solution.p, term.to_s)\n end\n else\n Jekyll.logger.error \"Not existing role found in #{term.to_s}\"\n return\n end\n end",
"title": ""
},
{
"docid": "008e5c51fa57db4778310f76f7618b50",
"score": "0.48552105",
"text": "def query_pattern(pattern, options = {}, &block)\n if block_given?\n graph_name = pattern.graph_name\n subject = pattern.subject\n predicate = pattern.predicate\n object = pattern.object\n\n cs = @data.has_key?(graph_name) ? {graph_name => @data[graph_name]} : @data.dup\n cs.each do |c, ss|\n next unless graph_name.nil? || graph_name == false && !c || graph_name.eql?(c)\n ss = if ss.has_key?(subject)\n { subject => ss[subject] }\n elsif subject.nil? || subject.is_a?(RDF::Query::Variable)\n ss.dup\n else\n []\n end\n ss.each do |s, ps|\n next unless subject.nil? || subject.eql?(s)\n ps = if ps.has_key?(predicate)\n { predicate => ps[predicate] }\n elsif predicate.nil? || predicate.is_a?(RDF::Query::Variable)\n ps.dup\n else\n []\n end\n ps.each do |p, os|\n next unless predicate.nil? || predicate.eql?(p)\n os = os.dup # TODO: is this really needed?\n os.each do |o|\n next unless object.nil? || object.eql?(o)\n # FIXME: yield has better performance, but broken in MRI 2.2: See https://bugs.ruby-lang.org/issues/11451.\n block.call(RDF::Statement.new(s, p, o, graph_name: c.equal?(DEFAULT_GRAPH) ? nil : c))\n end\n end\n end\n end\n else\n enum_for(:query_pattern, pattern, options)\n end\n end",
"title": ""
},
{
"docid": "4b9f47707d1bb03b698dc03e0febb45e",
"score": "0.48309726",
"text": "def statement_list\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n return_value = StatementListReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n statement9 = nil\n\n stream_statement = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule statement\" )\n begin\n # at line 269:5: ( statement )+\n # at file 269:5: ( statement )+\n match_count_5 = 0\n while true\n alt_5 = 2\n look_5_0 = @input.peek( 1 )\n\n if ( look_5_0 == GENERAL || look_5_0 == GET || look_5_0 == ARROW || look_5_0 == IF || look_5_0 == REGEX || look_5_0 == INCR || look_5_0 == BREAK || look_5_0 == RETURN || look_5_0 == IS_DEFINED || look_5_0 == LBRACE || look_5_0 == LBRACK || look_5_0.between?( SEMI, CONST ) || look_5_0.between?( SET, LET ) || look_5_0 == DDOC || look_5_0.between?( DECR, LPAREN ) || look_5_0 == DELETE || look_5_0.between?( DGENERAL, DO ) || look_5_0 == THROW || look_5_0 == TILDE || look_5_0 == TRUE || look_5_0 == TRY || look_5_0.between?( TYPEOF, NEW ) || look_5_0.between?( EACH, UNDEFINED ) || look_5_0.between?( NULL, UNLESS ) || look_5_0 == UNTIL || look_5_0 == FALSE || look_5_0 == VAR || look_5_0.between?( VOID, FOR ) || look_5_0 == WHILE || look_5_0.between?( WITH, YIELD ) || look_5_0.between?( IS_UNDEFINED, DOC ) || look_5_0.between?( T__148, T__150 ) )\n alt_5 = 1\n\n end\n case alt_5\n when 1\n # at line 269:5: statement\n @state.following.push( TOKENS_FOLLOWING_statement_IN_statement_list_1859 )\n statement9 = statement\n @state.following.pop\n if @state.backtracking == 0\n stream_statement.add( statement9.tree )\n end\n\n else\n match_count_5 > 0 and break\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n eee = EarlyExit(5)\n\n\n raise eee\n end\n match_count_5 += 1\n end\n\n # AST Rewrite\n # elements: statement\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 269:16: -> ( statement )+\n # at line 269:19: ( statement )+\n stream_statement.has_next? or raise ANTLR3::RewriteEarlyExit\n\n while stream_statement.has_next?\n @adaptor.add_child( root_0, stream_statement.next_tree )\n\n end\n stream_statement.reset\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 5 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "b053d2f94d3a14613622a800e4a027bb",
"score": "0.4813607",
"text": "def each_pattern(&block)\n n3statements.each do |statement|\n terms = {}\n [:subject, :predicate, :object].each do |part|\n terms[part] = case o = statement.send(part)\n when RDF::N3::Algebra::Formula\n form_statements(o, solution: RDF::Query::Solution.new(), &block)\n else\n o\n end\n end\n\n pattern = RDF::Query::Pattern.from(terms)\n block.call(pattern)\n end\n end",
"title": ""
},
{
"docid": "85ed6ef3c2d2f1faee1722857cf51944",
"score": "0.48135144",
"text": "def query(pattern, &block)\n raise TypeError.new(\"#{self} is not readable\") if respond_to?(:readable) && !readable?\n\n case pattern\n when Query\n pattern.execute(self, &block)\n when Array\n query(Statement.new(*pattern), &block)\n when Statement\n if block_given?\n find_all { |statement| pattern === statement }.each(&block)\n else\n find_all { |statement| pattern === statement }.extend(RDF::Enumerable, RDF::Queryable)\n end\n else\n raise ArgumentError.new(\"expected RDF::Query or RDF::Pattern, got #{pattern.inspect}\")\n end\n end",
"title": ""
},
{
"docid": "4c917451afef76b0c2ad34e670af0251",
"score": "0.48103687",
"text": "def match\n # Set up initial variables\n lp = LPSelect.new(:vars => inclusion_vars)\n lp.set_objective(compose_objective)\n\n # Add whatever constraints have been placed\n constraints.each do |c|\n next if c.vars.empty?\n lp.add_constraint(c.to_lp_arg)\n end\n\n # Write to a file for debugging (comment this out later)\n lp.to_file(\"/tmp/eq\")\n\n # Solve the equation\n status = lp.solve\n if status != LPSolve::OPTIMAL\n raise \"No optimal solution\"\n end\n\n # Parse the results\n results = lp.results.reject{|var, result| result.zero?}.keys\n results.map{|result| @variable_set[result]}\n end",
"title": ""
},
{
"docid": "7c9a0c44eb320f8c823865a48ee0a52a",
"score": "0.4795749",
"text": "def statements\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 1 )\n return_value = StatementsReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n statement1 = nil\n\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 18:5: ( statement )+\n # at file 18:5: ( statement )+\n match_count_1 = 0\n while true\n alt_1 = 2\n look_1_0 = @input.peek( 1 )\n\n if ( look_1_0.between?( CREATE_TABLE, CREATE_INDEX ) )\n alt_1 = 1\n\n end\n case alt_1\n when 1\n # at line 18:5: statement\n @state.following.push( TOKENS_FOLLOWING_statement_IN_statements_90 )\n statement1 = statement\n @state.following.pop\n @adaptor.add_child( root_0, statement1.tree )\n\n else\n match_count_1 > 0 and break\n eee = EarlyExit(1)\n\n\n raise eee\n end\n match_count_1 += 1\n end\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 1 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "fb9c1fc076129f6655f413e3cfc8a58f",
"score": "0.47890434",
"text": "def statements_as(role)\n if(!term.to_s[0..1].eql? \"_:\")\n input_uri = \"<#{term.to_s}>\"\n elsif(:predicate.eql? role)\n return []\n else\n input_uri = term.to_s\n end\n\n case role\n when :subject\n query = \"SELECT ?p ?o ?dt ?lit ?lang WHERE{ #{input_uri} ?p ?o BIND(datatype(?o) AS ?dt) BIND(isLiteral(?o) AS ?lit) BIND(lang(?o) AS ?lang)}\"\n Jekyll::JekyllRdf::Helper::RdfHelper::sparql.query(query).map do |solution|\n check = check_solution(solution)\n create_statement(term.to_s, solution.p, solution.o, solution.lit, check[:lang], check[:data_type])\n end\n when :predicate\n query = \"SELECT ?s ?o ?dt ?lit ?lang WHERE{ ?s #{input_uri} ?o BIND(datatype(?o) AS ?dt) BIND(isLiteral(?o) AS ?lit) BIND(lang(?o) AS ?lang)}\"\n Jekyll::JekyllRdf::Helper::RdfHelper::sparql.query(query).map do |solution|\n check = check_solution(solution)\n create_statement(solution.s, term.to_s, solution.o, solution.lit, check[:lang], check[:data_type])\n end\n when :object\n query = \"SELECT ?s ?p WHERE{ ?s ?p #{input_uri}}\"\n Jekyll::JekyllRdf::Helper::RdfHelper::sparql.query(query).map do |solution|\n create_statement( solution.s, solution.p, term.to_s)\n end\n else\n Jekyll.logger.error \"Not existing role found in #{term.to_s}\"\n return\n end\n end",
"title": ""
},
{
"docid": "713bc9ce9ba59db09cb98a6bcb3c5ba3",
"score": "0.47761974",
"text": "def substitute(bound_variable, replacement)\n if self.kind == :variable\n if self.value == bound_variable\n return replacement\n else\n return self\n end\n elsif self.kind == :abstraction\n self.body = self.body.substitute(bound_variable, replacement)\n return self\n elsif self.kind == :application\n self.function = self.function.substitute(bound_variable, replacement)\n self.argument = self.argument.substitute(bound_variable, replacement)\n return self\n else raise ArgumentError, \"First argument is not a LambdaExpression or has no kind.\"\n end\n end",
"title": ""
},
{
"docid": "b0a91e9833bd0a74f2aef1d30ba13c3b",
"score": "0.47562844",
"text": "def query_statement(statement, *arguments)\n if arguments.length > 5\n raise ArgumentError, 'Too many arguments, prepared statement with only upto 5 arguments is supported for simplicity'\n elsif arguments.length == 0\n query_results = @session.execute(\"#{statement}\")\n else\n prepared_statement = @session.prepare(\"#{statement}\")\n query_results = @session.execute(prepared_statement, arguments: arguments)\n end\n return query_results\n end",
"title": ""
},
{
"docid": "ad016532f80a436e5672cbe04d5659b4",
"score": "0.47415715",
"text": "def for_statement_initialiser_part\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 34 )\n @InFor_stack.push( @@InFor.new )\n return_value = ForStatementInitialiserPartReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal153 = nil\n string_literal154 = nil\n expression_list152 = nil\n variable_declaration_list155 = nil\n\n tree_for_string_literal153 = nil\n tree_for_string_literal154 = nil\n\n begin\n # at line 478:3: ( expression_list | ( 'var' | 'let' ) variable_declaration_list )\n alt_33 = 2\n look_33_0 = @input.peek( 1 )\n\n if ( look_33_0 == GENERAL || look_33_0 == GET || look_33_0 == ARROW || look_33_0 == REGEX || look_33_0 == INCR || look_33_0 == IS_DEFINED || look_33_0 == LBRACE || look_33_0 == LBRACK || look_33_0 == SET || look_33_0 == DDOC || look_33_0.between?( DECR, LPAREN ) || look_33_0 == DELETE || look_33_0.between?( DGENERAL, MACRO ) || look_33_0.between?( MINUS, THIS ) || look_33_0 == TILDE || look_33_0 == TRUE || look_33_0.between?( TYPEOF, NEW ) || look_33_0.between?( EACH, UNDEFINED ) || look_33_0 == NULL || look_33_0 == FALSE || look_33_0 == VOID || look_33_0.between?( FUNCTION, PLUS ) || look_33_0.between?( IS_UNDEFINED, DOC ) || look_33_0.between?( T__148, T__150 ) )\n alt_33 = 1\n elsif ( look_33_0 == LET || look_33_0 == VAR )\n alt_33 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 33, 0 )\n end\n case alt_33\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 478:5: expression_list\n @state.following.push( TOKENS_FOLLOWING_expression_list_IN_for_statement_initialiser_part_3208 )\n expression_list152 = expression_list\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, expression_list152.tree )\n end\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 479:5: ( 'var' | 'let' ) variable_declaration_list\n # at line 479:5: ( 'var' | 'let' )\n alt_32 = 2\n look_32_0 = @input.peek( 1 )\n\n if ( look_32_0 == VAR )\n alt_32 = 1\n elsif ( look_32_0 == LET )\n alt_32 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 32, 0 )\n end\n case alt_32\n when 1\n # at line 479:7: 'var'\n string_literal153 = match( VAR, TOKENS_FOLLOWING_VAR_IN_for_statement_initialiser_part_3216 )\n if @state.backtracking == 0\n\n tree_for_string_literal153 = @adaptor.create_with_payload( string_literal153 )\n root_0 = @adaptor.become_root( tree_for_string_literal153, root_0 )\n\n end\n\n when 2\n # at line 479:16: 'let'\n string_literal154 = match( LET, TOKENS_FOLLOWING_LET_IN_for_statement_initialiser_part_3221 )\n if @state.backtracking == 0\n\n tree_for_string_literal154 = @adaptor.create_with_payload( string_literal154 )\n root_0 = @adaptor.become_root( tree_for_string_literal154, root_0 )\n\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_variable_declaration_list_IN_for_statement_initialiser_part_3227 )\n variable_declaration_list155 = variable_declaration_list\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_declaration_list155.tree )\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end# syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n @InFor_stack.last.active = false \n # <-- action\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 34 )\n @InFor_stack.pop\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "69dee065a187572939dfedf3c437918c",
"score": "0.47268948",
"text": "def query(statement, *params)\n @logger.info \"#{statement}: #{params}\"\n @db.exec_params(statement, params)\n end",
"title": ""
},
{
"docid": "eacd7ca5e301e17ce175298d5c7798b3",
"score": "0.47172603",
"text": "def bind(solution)\n patterns.each {|p| p.bind(solution)}\n self\n end",
"title": ""
},
{
"docid": "8a6617904814294ad9475c923923280b",
"score": "0.47154796",
"text": "def parse_statement\n stmt = case lookahead.name\n when :EOF\n return nil\n when :LF\n expect(:LF)\n return node(:empty_statement)\n when :class, :object, :def, :if, :unless, :case, :while, :until, :loop, :case, :for, :return, :delete, :begin\n __send__(\"parse_#{lookahead.name}_statement\")\n when :break, :next\n node(\"#{lex.name}_statement\")\n else\n return parse_expression_statement\n end\n\n if statement_modifier?\n expect_statement_modifier(stmt)\n else\n expect_terminator if match(:LF)\n stmt\n end\n end",
"title": ""
},
{
"docid": "07bc8f888cb101daebff9afffbb7b432",
"score": "0.47089955",
"text": "def statement(var_env)\n (\n block(var_env) or\t\t#12.1\n var_statement(var_env) or\t#12.2\n if_statement(var_env) or\t#12.5\n iteration_statement(var_env) or\t#12.6\n continue_statement(var_env) or\t#12.7\n break_statement(var_env) or\t#12.8\n return_statement(var_env) or\t#12.9\n with_statement(var_env) or\t#12.10\n switch_statement(var_env) or\t#12.11\n labelled_statement(var_env) or\t#12.12\n throw_statement(var_env) or\t#12.13\n try_statement(var_env) or\t#12.14\n debugger_statement(var_env) or\t#12.15\n func_declaration(var_env) or\t#13 => func.rb\n exp_statement(var_env) or\t#12.4\n empty_statement(var_env) \t#12.3\n )\n end",
"title": ""
},
{
"docid": "26c763b8cbc9622e3bb875bd7c4c502e",
"score": "0.4702216",
"text": "def statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n return_value = StatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n create_table2 = nil\n create_index3 = nil\n\n\n begin\n # at line 21:3: ( create_table | create_index )\n alt_2 = 2\n look_2_0 = @input.peek( 1 )\n\n if ( look_2_0 == CREATE_TABLE )\n alt_2 = 1\n elsif ( look_2_0 == CREATE_INDEX )\n alt_2 = 2\n else\n raise NoViableAlternative( \"\", 2, 0 )\n end\n case alt_2\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 21:5: create_table\n @state.following.push( TOKENS_FOLLOWING_create_table_IN_statement_101 )\n create_table2 = create_table\n @state.following.pop\n @adaptor.add_child( root_0, create_table2.tree )\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 22:5: create_index\n @state.following.push( TOKENS_FOLLOWING_create_index_IN_statement_107 )\n create_index3 = create_index\n @state.following.pop\n @adaptor.add_child( root_0, create_index3.tree )\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "6f3c17f21c4cc8dedb6c1c9465cb11ad",
"score": "0.46882233",
"text": "def form_statements(form, solution:, &block)\n # uses the graph_name of the formula, and yields statements from the formula\n log_depth do\n form.each(solutions: RDF::Query::Solutions(solution)) do |stmt|\n stmt.graph_name ||= form.graph_name\n log_debug(\"(form statements add)\") {stmt.to_sxp}\n block.call(stmt)\n end\n end\n\n form.graph_name\n end",
"title": ""
},
{
"docid": "61ef71cfb64d57b51c06dd30ded3c2cf",
"score": "0.46699935",
"text": "def query_patterns\n self.rdf_statements.select{|rdfs| rdfs[1] != Vocabularies::Alignment.measure}.collect{|qp|\n RDF::Query::Pattern.new(*qp.map!{|x| x == resource ? :cell : x })\n }\n end",
"title": ""
},
{
"docid": "c6a4f2608a5b6f964fcbc123218ad4b1",
"score": "0.46609658",
"text": "def create_queries(keyword)\n sql = \"\"\n self.column_names .each do |col|\n\n sql += col + \" LIKE \" + \"\\'\" + keyword + \"\\'\"\n sql += \" OR \"\n end\n sql[0..-5] #removes the last AND. A temporary dirty fix.\n end",
"title": ""
},
{
"docid": "4e5735c8c02a005cbe5d82030acd7eb3",
"score": "0.46554953",
"text": "def replace_variables_in_query_string\n # if @queries_as_string.empty?\n # Display.write_your_own_query\n # else\n # binding.pry\n # MOCKED DATA IF NECESSARY\n # @queries_as_string = [\"MerchantTransaction.find(10553628)\",\n # \"MerchantTransaction.find_by(reference: '1055-3628', kind: 'PLACE_BATCH')\",\n # \"MerchantTransaction.find_by(reference: '1055-3628', kind: 'PLACE_BATCH')\",\n # \"MerchantTransaction.where(parent_ref: '1055-3627', kind: 'BATCH_BET')\",\n # ]\n @queries_as_string.each_with_index do | query, index |\n mocked_query = Display.query(query)\n @mocked_queries_as_string << mocked_query ? mocked_query : query\n end\n Readline.pre_input_hook = nil\n evaluate_queries_as_lambdas\n # end\n end",
"title": ""
},
{
"docid": "ba16829bfb61c7abb6c49e8312f0e2a2",
"score": "0.46501917",
"text": "def query_pattern(pattern, **options, &block)\n return super unless pattern.graph_name == DEFAULT_GRAPH\n\n if block_given?\n pattern = pattern.dup\n pattern.graph_name = nil\n\n each_statement do |statement|\n yield statement if (statement.graph_name == DEFAULT_GRAPH ||\n statement.graph_name.nil?) && pattern === statement\n end\n else\n enum_for(:query_pattern, pattern, options)\n end\n end",
"title": ""
},
{
"docid": "ce3abbe2940868f91c3f2b5249a00c41",
"score": "0.46329588",
"text": "def prepare_statement(condition)\n args = condition.dup\n str = args.shift\n # ? handles a single type.\n # ?* handles an array.\n args.each { |arg| str.sub!(/\\?\\*/, quotea(arg)); str.sub!(/\\?/, quote(arg)) }\n condition = str\n end",
"title": ""
},
{
"docid": "f28a2227c81a1fe88a66a7021f88f4cb",
"score": "0.46319833",
"text": "def make_statement\n end",
"title": ""
},
{
"docid": "f28a2227c81a1fe88a66a7021f88f4cb",
"score": "0.46319833",
"text": "def make_statement\n end",
"title": ""
},
{
"docid": "b1b9da25f8df178fc2c09640b9b20548",
"score": "0.4631896",
"text": "def select_statement(query)\n model = query.model\n fields = query.fields\n conditions = query.conditions\n limit = query.limit\n offset = query.offset\n order = query.order\n group_by = nil\n\n # FIXME: using a boolean for qualify does not work in some cases,\n # such as when you have a self-referrential many to many association.\n # if you don't qualfiy the columns with a unique alias, then the\n # SQL query will fail. This may mean though, that it might not\n # be enough to pass in a Property, but we may need to know the\n # table and the alias we should use for the column.\n\n qualify = query.links.any?\n\n if qualify || query.unique?\n group_by = fields.select { |property| property.kind_of?(Property) }\n end\n\n unless (limit && limit > 1) || offset > 0 || qualify\n # TODO: move this method to Query, so that it walks the conditions\n # and finds an OR operator\n\n # TODO: handle cases where two or more properties need to be\n # used together to be unique\n\n # if a unique property is used, and there is no OR operator, then an ORDER\n # and LIMIT are unecessary because it should only return a single row\n if conditions.kind_of?(Query::Conditions::AndOperation) &&\n conditions.any? { |operand| operand.kind_of?(Query::Conditions::EqualToComparison) && operand.subject.respond_to?(:unique?) && operand.subject.unique? } &&\n !conditions.any? { |operand| operand.kind_of?(Query::Conditions::OrOperation) }\n order = nil\n limit = nil\n end\n end\n\n conditions_statement, bind_values = conditions_statement(conditions, qualify)\n\n statement = \"SELECT #{columns_statement(fields, qualify)}\"\n statement << \" FROM #{quote_name(model.storage_name(name))}\"\n statement << join_statement(query, qualify) if qualify\n statement << \" WHERE #{conditions_statement}\" unless conditions_statement.blank?\n statement << \" GROUP BY #{columns_statement(group_by, qualify)}\" unless group_by.blank?\n statement << \" ORDER BY #{order_statement(order, qualify)}\" unless order.blank?\n\n if limit\n statement << ' LIMIT ?'\n bind_values << limit\n end\n\n if limit && offset > 0\n statement << ' OFFSET ?'\n bind_values << offset\n end\n\n return statement, bind_values\n end",
"title": ""
},
{
"docid": "cdee4bd2e413f36ddf43589ffff09b7c",
"score": "0.46194458",
"text": "def create_binding(variable_to_value_hash) \n current_binding = binding\n for variable in variable_to_value_hash.keys\n eval \"#{variable.to_s} = variable_to_value_hash[variable]\", binding\n current_binding = binding\n end\n current_binding\nend",
"title": ""
},
{
"docid": "114d33da7d46863f8da66a1a9dc89abf",
"score": "0.46152297",
"text": "def execute(sql_statement)\n parse(sql_statement)\n end",
"title": ""
},
{
"docid": "ab4b3a758bda7b146858563f38e911cb",
"score": "0.46147633",
"text": "def preprocess_statement(statement)\n #log_debug(\"preprocess\") {statement.inspect}\n\n # Pre-fetch pnames, to fill prefixes\n get_pname(statement.subject)\n get_pname(statement.predicate)\n get_pname(statement.object)\n get_pname(statement.object.datatype) if statement.object.literal? && statement.object.datatype\n end",
"title": ""
},
{
"docid": "c7784036c5b853967f7545fae2b629eb",
"score": "0.46036723",
"text": "def query(*conditions)\n filters = (conditions + @mapping.conditions).compact.join(\" and \")\n filters = \" where #{filters}\" unless filters.empty?\n\n \"select #{lookups} from #{@record_type}#{filters}\"\n end",
"title": ""
},
{
"docid": "ecb1cc5c956a0a92c3844791cd1d104f",
"score": "0.46004713",
"text": "def prepare_statement_sub(sql)\n sql.gsub(/\\$\\d+/, '?')\n end",
"title": ""
},
{
"docid": "3023d4ca71e1d4a15d1917eebcd26438",
"score": "0.4581273",
"text": "def statement\n # Get first token\n curr_token = get_next_token\n\n # Use curr_token to determine which rule to use\n if curr_token.type == \"HOW\"\n how\n elsif curr_token.type == \"QUIT\"\n quit\n elsif curr_token.type == \"VARIABLE\"\n assign(curr_token)\n else\n raise @err_class, \"I don't know what you're talking about!\" \n end\n end",
"title": ""
},
{
"docid": "238a76390aded86d5a21a0f3aaa6beed",
"score": "0.45784622",
"text": "def statements\n @statements ||= statements_as_subject + statements_as_predicate + statements_as_object\n end",
"title": ""
},
{
"docid": "f25e45de7689e861b55d8dd19afe8c39",
"score": "0.45554098",
"text": "def construct_sql\n if @reflection.options[:finder_sql]\n @finder_sql = interpolate_sql(@reflection.options[:finder_sql])\n else\n @finder_sql = conditions\n end\n \n if @reflection.options[:counter_sql]\n @counter_sql = interpolate_sql(@reflection.options[:counter_sql])\n elsif @reflection.options[:finder_sql]\n # replace the SELECT clause with COUNT(*), preserving any hints within /* ... */\n @reflection.options[:counter_sql] = @reflection.options[:finder_sql].sub(/SELECT (\\/\\*.*?\\*\\/ )?(.*)\\bFROM\\b/im) { \"SELECT #{$1}COUNT(*) FROM\" }\n @counter_sql = interpolate_sql(@reflection.options[:counter_sql])\n else\n @counter_sql = @finder_sql\n end\n end",
"title": ""
},
{
"docid": "edd582745007fca9ebbb2aa56256f8e2",
"score": "0.45482385",
"text": "def variable_declaration\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 12 )\n return_value = VariableDeclarationReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n char_literal40 = nil\n __ID43__ = nil\n declaration_target41 = nil\n expression42 = nil\n\n tree_for_char_literal40 = nil\n tree_for_ID43 = nil\n\n begin\n # at line 75:3: ( ^( '=' declaration_target expression ) | ID )\n alt_9 = 2\n look_9_0 = @input.peek( 1 )\n\n if ( look_9_0 == ASGN )\n alt_9 = 1\n elsif ( look_9_0 == ID )\n alt_9 = 2\n else\n raise NoViableAlternative( \"\", 9, 0 )\n end\n case alt_9\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 75:5: ^( '=' declaration_target expression )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n char_literal40 = match( ASGN, TOKENS_FOLLOWING_ASGN_IN_variable_declaration_347 )\n\n tree_for_char_literal40 = @adaptor.copy_node( char_literal40 )\n\n root_1 = @adaptor.become_root( tree_for_char_literal40, root_1 )\n\n\n\n match( DOWN, nil )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_declaration_target_IN_variable_declaration_349 )\n declaration_target41 = declaration_target\n @state.following.pop\n\n @adaptor.add_child( root_1, declaration_target41.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_variable_declaration_351 )\n expression42 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression42.tree )\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 76:5: ID\n _last = @input.look\n __ID43__ = match( ID, TOKENS_FOLLOWING_ID_IN_variable_declaration_359 )\n\n tree_for_ID43 = @adaptor.copy_node( __ID43__ )\n\n @adaptor.add_child( root_0, tree_for_ID43 )\n\n\n\n end\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 12 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "361d3d10d85f9531eb0fadcf827e8c8f",
"score": "0.45390964",
"text": "def statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n begin\n # at line 536:2: ( assignment | conditional | invocation ';' | loop | print | println | returnstmt | ';' )\n alt_18 = 8\n alt_18 = @dfa18.predict( @input )\n case alt_18\n when 1\n # at line 536:4: assignment\n @state.following.push( TOKENS_FOLLOWING_assignment_IN_statement_636 )\n assignment\n @state.following.pop\n\n when 2\n # at line 536:18: conditional\n @state.following.push( TOKENS_FOLLOWING_conditional_IN_statement_641 )\n conditional\n @state.following.pop\n\n when 3\n # at line 536:32: invocation ';'\n @state.following.push( TOKENS_FOLLOWING_invocation_IN_statement_645 )\n invocation\n @state.following.pop\n match( T__31, TOKENS_FOLLOWING_T__31_IN_statement_647 )\n\n when 4\n # at line 536:49: loop\n @state.following.push( TOKENS_FOLLOWING_loop_IN_statement_651 )\n loop\n @state.following.pop\n\n when 5\n # at line 536:56: print\n @state.following.push( TOKENS_FOLLOWING_print_IN_statement_655 )\n print\n @state.following.pop\n\n when 6\n # at line 536:64: println\n @state.following.push( TOKENS_FOLLOWING_println_IN_statement_659 )\n println\n @state.following.pop\n\n when 7\n # at line 536:74: returnstmt\n @state.following.push( TOKENS_FOLLOWING_returnstmt_IN_statement_663 )\n returnstmt\n @state.following.pop\n\n when 8\n # at line 536:87: ';'\n match( T__31, TOKENS_FOLLOWING_T__31_IN_statement_667 )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 13 )\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "511a6e039fbeb0d6f7654028efc22972",
"score": "0.45366073",
"text": "def statements\n @statements ||= statements_as_subject + statements_as_predicate + statements_as_object\n end",
"title": ""
},
{
"docid": "056d4ab7deca09b1d830fb0288e85804",
"score": "0.45335743",
"text": "def compile_query\n #puts \"DATASET COMPILE self #{self}\"\n #puts \"DATASET COMPILE queries #{queries}\"\n \n # Old way: works but doesn't handle fmp compound queries.\n #query.each_with_object([{},{}]){|x,o| o[0].merge!(x[0] || {}); o[1].merge!(x[1] || {})}\n \n # New way: handles compound queries. Reqires ginjo-rfm 3.0.11.\n return unless queries # This should help introspecting dataset that results from record deletion. TODO: test this.\n queries.inject {|new_query,scope| apply_scope(new_query, scope)} ##puts \"SCOPE INJECTION scope:#{scope} new_query:#{new_query}\"; \n end",
"title": ""
},
{
"docid": "d117b3cd6e080326ba96eb357c68e083",
"score": "0.45235226",
"text": "def prepared_lookup\n # SEQUEL5: Remove\n cached_prepared_statement(:fixed, :lookup){prepare_explicit_statement(filter(prepared_statement_key_array(primary_key)), :first)}\n end",
"title": ""
},
{
"docid": "4a689d117122007efe1934acc94c7866",
"score": "0.45174205",
"text": "def prepare( sql )\n Statement.new( self, sql )\n end",
"title": ""
},
{
"docid": "fa0ff23dee72e3fb8398f427ce805007",
"score": "0.4513568",
"text": "def dbselect(find, table, condition, condition_name)\n if find.kind_of?(Array) == false\n variables = find\n else\n variables = \"\"\n i = 0\n while i < find.length\n variables += find[i].to_s\n i += 1\n if i < find.length\n variables += \", \"\n end\n end\n end\n\n if condition.kind_of?(Array) == false\n cond = condition.to_s + \"=?\"\n else\n cond = \"\"\n i = 0\n while i < condition.length\n cond += condition[i].to_s + \"=?\"\n i += 1\n if i < condition.length\n cond += \" AND \"\n end\n end\n end\n return db.execute(\"SELECT #{variables} FROM #{table} WHERE #{cond}\", condition_name)\nend",
"title": ""
},
{
"docid": "447a4f5220099030ef3e845a8c71db02",
"score": "0.45125154",
"text": "def select_statement(query)\n model = query.model\n fields = query.fields\n conditions = query.conditions\n limit = query.limit\n offset = query.offset\n order = query.order\n group_by = nil\n\n # FIXME: using a boolean for qualify does not work in some cases,\n # such as when you have a self-referrential many to many association.\n # if you don't qualfiy the columns with a unique alias, then the\n # SQL query will fail. This may mean though, that it might not\n # be enough to pass in a Property, but we may need to know the\n # table and the alias we should use for the column.\n\n qualify = query.links.any?\n\n if query.unique?\n group_by = fields.select { |p| p.kind_of?(Property) }\n end\n\n # create subquery to find all valid keys and then use these keys to retrive all other columns\n use_subquery = qualify\n\n # when we can include ROWNUM condition in main WHERE clause\n use_simple_rownum_limit = limit && (offset||0 == 0) && group_by.blank? && order.blank?\n\n unless (limit && limit > 1) || offset > 0 || qualify\n # TODO: move this method to Query, so that it walks the conditions\n # and finds an OR operator\n\n # TODO: handle cases where two or more properties need to be\n # used together to be unique\n\n # if a unique property is used, and there is no OR operator, then an ORDER\n # and LIMIT are unecessary because it should only return a single row\n if conditions.kind_of?(Query::Conditions::AndOperation) &&\n conditions.any? { |operand| operand.kind_of?(Query::Conditions::EqualToComparison) && operand.subject.respond_to?(:unique?) && operand.subject.unique? } &&\n !conditions.any? { |operand| operand.kind_of?(Query::Conditions::OrOperation) }\n order = nil\n limit = nil\n end\n end\n\n conditions_statement, bind_values = conditions_statement(conditions, qualify)\n\n statement = \"SELECT #{columns_statement(fields, qualify)}\"\n if use_subquery\n statement << \" FROM #{quote_name(model.storage_name(name))}\"\n statement << \" WHERE (#{columns_statement(model.key, qualify)}) IN\"\n statement << \" (SELECT DISTINCT #{columns_statement(model.key, qualify)}\"\n end\n statement << \" FROM #{quote_name(model.storage_name(name))}\"\n statement << join_statement(query, qualify) if qualify\n statement << \" WHERE (#{conditions_statement})\" unless conditions_statement.blank?\n if use_subquery\n statement << \")\"\n end\n if use_simple_rownum_limit\n statement << \" AND rownum <= ?\"\n bind_values << limit\n end\n statement << \" GROUP BY #{columns_statement(group_by, qualify)}\" unless group_by.blank?\n statement << \" ORDER BY #{order_statement(order, qualify)}\" unless order.blank?\n\n add_limit_offset!(statement, limit, offset, bind_values) unless use_simple_rownum_limit\n\n return statement, bind_values\n end",
"title": ""
},
{
"docid": "3c2d9e100ae8bf5d970c318aa11beb3e",
"score": "0.45102432",
"text": "def statement_classes(_examples = nil)\n # binding.pry\n\n # Find the constants\n b = Object.const_set(\n self.class.to_s + rand(4_000_000).to_s,\n Class.new do\n include Cauldron::Operator\n include Cauldron::DynamicOperatorModule\n\n attr_reader :indexes\n attr_accessor :failed_uses\n\n def initialize(indexes)\n @indexes = indexes\n @failed_uses = []\n end\n\n def self.context_instances(contexts)\n temp = []\n contexts.each do |context|\n temp << context.keys.collect(&:to_s).select { |x| x.match(/var\\d/) }\n end\n results = temp.flatten.uniq\n\n variable_numbers = results.collect { |x| x.match(/var(\\d+)/)[1] }\n # TODO: Presumes that only one variable is passed\n variable_numbers.collect { |x| new([x.to_i]) }\n end\n\n def self.extend_actualized_composite(x, container, examples, point)\n cloned_container = container.clone_solution\n cloned_container.add_statement_at(x, point)\n cloned_container\n Cauldron::ActualizedComposite.new(cloned_container, examples)\n end\n\n def rip2\n %{\n def function(var0)\n #{Sorcerer.source(to_sexp(Cauldron::Scope.new(['var0']), []), indent: true)}\n end\n }\n end\n end\n )\n b.class_eval(Sorcerer.source(sexp_methods, indent: true))\n [b]\n end",
"title": ""
},
{
"docid": "712f2c76490bd7d3bf6729ada4ddf2c6",
"score": "0.45039925",
"text": "def build_sql(structure)\n structure = structure.is_a?(Constructor) ? structure.structure : structure\n sql = ''\n [:with, :union, :select, :insert, :update, :delete, :set, :from,\n :join, :where, :returning, :group, :order, :limit, :offset].each do |i|\n next unless structure[i]\n sql += send(\"build_#{i}\", structure[i], structure)\n end\n sql\n end",
"title": ""
},
{
"docid": "116b2a1895a73ea285949916365b4816",
"score": "0.45007974",
"text": "def case_clause\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 17 )\n return_value = CaseClauseReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n string_literal64 = nil\n expression65 = nil\n statement_list66 = nil\n\n tree_for_string_literal64 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 99:5: ^( 'case' expression ( statement_list )? )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal64 = match( CASE, TOKENS_FOLLOWING_CASE_IN_case_clause_504 )\n\n tree_for_string_literal64 = @adaptor.copy_node( string_literal64 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal64, root_1 )\n\n\n\n match( DOWN, nil )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_case_clause_506 )\n expression65 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression65.tree )\n # at line 99:27: ( statement_list )?\n alt_18 = 2\n look_18_0 = @input.peek( 1 )\n\n if ( look_18_0.between?( AMP, AMP_ASGN ) || look_18_0 == POST_DECR || look_18_0.between?( GEQ, AREF ) || look_18_0.between?( GREATER, HAT ) || look_18_0.between?( ARROW, HAT_ASGN ) || look_18_0.between?( ASGN, REGEX ) || look_18_0.between?( IN, RETURN ) || look_18_0 == INCR || look_18_0.between?( BREAK, RSHIFT3 ) || look_18_0.between?( LABEL, CATCH ) || look_18_0 == RSHIFT_ASGN || look_18_0 == LEQ || look_18_0.between?( LESS, SLASH ) || look_18_0.between?( SLASH_ASGN, CONTINUE ) || look_18_0.between?( STAR, DECR ) || look_18_0 == STAR_ASGN || look_18_0.between?( LSHIFT, THIS ) || look_18_0 == THROW || look_18_0.between?( MINUS, MOD ) || look_18_0.between?( MOD_ASGN, TYPEOF ) || look_18_0.between?( NEQ, UMINUS ) || look_18_0.between?( NEQQ, UNDEFINED ) || look_18_0.between?( NEW, UPLUS ) || look_18_0.between?( OBJECT, FALSE ) || look_18_0.between?( WITH, PLUS ) || look_18_0.between?( ID, DOC ) )\n alt_18 = 1\n end\n case alt_18\n when 1\n # at line 99:27: statement_list\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_statement_list_IN_case_clause_509 )\n statement_list66 = statement_list\n @state.following.pop\n\n @adaptor.add_child( root_1, statement_list66.tree )\n\n\n end\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 17 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "5813478193981939ecc4882f9a6c85af",
"score": "0.45004302",
"text": "def build_where_ns(query,ns)\n where = \"\"\n query.each_pair do |k, v| \n if (k!='include' and k!='exclude')\n where += \"(`#{ns}`.`#{escape_str_field(k)}` #{build_equal_condition(v)}) AND \"\n end\n end\n where.chomp(' AND ')\n end",
"title": ""
},
{
"docid": "321083e6e98a281af81c5ec813f9c274",
"score": "0.44996232",
"text": "def makeConditions #:doc:\n @condition_string = \"\"\n @condition_values = Hash.new\n i = 0\n \n # if search is from spesific devices\n if @device_ids.size > 0\n @device_ids.uniq!\n firstdevid = true\n @device_ids.each do |id|\n if firstdevid\n @condition_string += \"(devices.id in (\"\n firstdevid = false\n else\n @condition_string += \", \"\n end\n @condition_string += \":cond#{i}\"\n @condition_values.merge!({\"cond#{i}\".intern => id})\n i += 1\n end\n @condition_string += \"))\"\n if not @conditions.empty? or @locationdata.size == 3\n @condition_string += \" AND \"\n end\n end\n \n # take each condition and combine them\n firstcond = true\n @conditions.each do |keyword, values|\n condition = \"(\"\n statement = @condition_rules[keyword]\n \n # combine values\n firstvalue = true\n values.each do |value|\n condition_part = statement.gsub(\"?\") do |s|\n new = \":cond#{i}\"\n # bind the value\n @condition_values.merge!({\"cond#{i}\".intern => value})\n \n # do some special processing if the keyword is type and there's 2 \"?\"'s in the statement\n if keyword == \"type\" and statement.count(\"?\") == 2\n value = value[0..-2].insert(1, \".\")\n end\n i += 1\n new\n end\n \n if not firstvalue\n condition += \" OR \"\n end\n condition += condition_part\n \n firstvalue = false\n end\n \n condition += \")\"\n \n # append condition_string with the condition\n if not firstcond\n @condition_string += \" AND \"\n end\n @condition_string += condition\n firstcond = false\n end\n \n # add distance-search to conditions\n if @locationdata.size == 3\n statement = \"(\" + @condition_rules[\"distance\"] + \")\"\n j = 0\n statement.gsub!(\"?\") do |s|\n j += 1\n new = \":cond#{i}\"\n # bind the value\n if j == 1\n @condition_values.merge!({\"cond#{i}\".intern => @locationdata[\"lat\"]})\n elsif j == 3\n @condition_values.merge!({\"cond#{i}\".intern => @locationdata[\"lon\"]})\n elsif j == 5\n @condition_values.merge!({\"cond#{i}\".intern => (@locationdata[\"distance\"].to_f / @@kms_per_degree) **2})\n else\n i += 1\n end\n new\n end\n \n if not @conditions.empty?\n @condition_string += \" AND \"\n end\n @condition_string += statement\n end\n end",
"title": ""
},
{
"docid": "1b0fa7ba6928b58b37ee8190b38b4cb6",
"score": "0.44975537",
"text": "def query(sql, *bind_values)\n @pool.acquire { |conn| conn.query(sql, *bind_values).first }\n end",
"title": ""
},
{
"docid": "5efcef1b6b0d033b77652b458955d8f4",
"score": "0.4496476",
"text": "def prep_query(original_query)\n if original_query.include? \"$CONDITIONS\"\n return original_query\n elsif original_query.downcase.include? \"where\"\n idxwhere = original_query.downcase.index(\"where\")\n select_where = original_query[0..idxwhere+\"where\".length-1]\n clause = original_query[idxwhere+\"where\".length+1..original_query.length]\n return \"#{select_where} (#{clause}) AND \\$CONDITIONS\"\n else\n return \"#{original_query} WHERE \\$CONDITIONS\"\n end\n end",
"title": ""
},
{
"docid": "3e88197cddaf784a2bf3379e824a9d40",
"score": "0.44817576",
"text": "def expand query\n expands.inject(query) do |result, (regexp, replace)|\n result.gsub regexp, replace\n end\n end",
"title": ""
},
{
"docid": "e9d68eed247cc1ce7bc73ff36afaf9c6",
"score": "0.44755122",
"text": "def to_sql\n @sql ||= case @kind\n when :target, :comp_op, :bin_bool_op, :term\n child(0).to_sql\n when :target_set\n # array of fragments, one per target\n [child(0).to_sql] + (child(1) ? child(2).to_sql : [])\n when :qual_term\n # child(2) will be an array (target_set)\n \"(\" + child(2).to_sql.collect{|sql| comparison(child(0), child(1).child(0), sql)}.join(\" OR \") + \")\"\n when :unqual_term\n \"(\" + default_quals.collect{|q| comparison(q, EQUAL_TOKEN, child(0).to_sql)}.join(\" OR \") + \")\"\n when :query\n # first form\n if child(0).is?(:lparen)\n @children.collect{|c| c.to_sql}.join\n # second form\n elsif child(1) && child(1).is?(:bin_bool_op)\n @children.collect{|c| c.to_sql}.join(\" \")\n # third form\n elsif child(1) && child(1).is?(:query)\n child(0).to_sql + \" AND \" + child(1).to_sql\n # fourth form\n else\n child(0).to_sql\n end\n end\n end",
"title": ""
},
{
"docid": "2449912408bd715fe7c4e7324bb7562c",
"score": "0.4463242",
"text": "def all_bindings_in_clauses clauses\n clauses.map do |clause|\n clause.refs.map do |ref|\n raise \"Binding reference #{ref.inspect} is not bound to a binding\" unless ref.binding\n [ref.binding] + (ref.nested_clauses ? all_bindings_in_clauses(ref.nested_clauses) : [])\n end\n end.\n flatten.\n uniq\n end",
"title": ""
},
{
"docid": "fe24a2460c4b54b26fca489aba5895a4",
"score": "0.44613546",
"text": "def find(statement)\n now = DateTime.parse(Time.now.to_s).strftime('%Y-%m-%d %H:%M:%S')\n result = statement.execute\n return result\n end",
"title": ""
},
{
"docid": "2b2935e9b9c79ebba44d071e6d465bc6",
"score": "0.44604334",
"text": "def _bind(statement, bindvars, tx = nil)\n @statement = statement\n run(:_send_bind, [statement, bindvars], tx)\n end",
"title": ""
},
{
"docid": "200e2e8b16c6a8646e5f3413c48b1130",
"score": "0.44569334",
"text": "def statement \n\n\t$cst.add_branch(\"Statement\")\n\n\tcase scout_token\n\twhen \"T_PRINT\"\n\t\tprint_stmt\n\twhen \"T_ID\"\n\t\tassignment_stmt\n\twhen \"T_TYPE\"\n\t\tvardecl\n\twhen \"T_WHILE\"\n\t\twhile_stmt\n\twhen \"T_IF\"\n\t\tif_stmt\n\twhen \"T_LBRACE\"\n\t\tblock\n\telse\n\t\traise FaultyTokenError.new(\"T_PRINT, T_ID, T_TYPE, T_WHILE, T_IF, or T_LBRACE\", $tokens[$index])\n\tend\n\t\n\t$cst.ascend\n\t\nend",
"title": ""
},
{
"docid": "ebdd9a9bf3f62eeb2a0d4eea82e7f21b",
"score": "0.44549707",
"text": "def select_statement(with_identifier: true)\n return [degenerate_select_fragment] if type == Dimension::TYPES[:degenerate]\n\n ss = [\"#{label_fragment} AS #{name}\"]\n ss << \"#{identifier_fragment} AS #{name}_identifier\" if with_identifier\n ss\n end",
"title": ""
},
{
"docid": "632d6b2af96f754bc573d9c44dae0ae8",
"score": "0.44528693",
"text": "def scan_statement\n # eat any whitespace at the start of the string\n whitespace = @scanner.scan_until(/\\S/)\n\n if whitespace\n @scanner.pos -= 1\n update_counter(whitespace[0..-2])\n end\n\n # look for matches\n case\n when text = @scanner.scan(/\\}\\}/)\n @context = :body\n token(:VAR_CLOSE, text)\n \n when text = @scanner.scan(/%\\}/)\n @context = :body\n token(:STMT_CLOSE, text)\n\n when text = @scanner.scan(/[=]=/) # i've added the square brackets because syntax highlighters dont like /=\n token(:OP_EQ, text)\n\n when text = @scanner.scan(/>=/)\n token(:OP_GEQ, text)\n\n when text = @scanner.scan(/<=/)\n token(:OP_LEQ, text)\n\n when text = @scanner.scan(/[=]>/) # i've added the square brackets because syntax highlighters dont like /=\n token(:OP_MAP, text)\n\n when text = @scanner.scan(/(if|else|endif|for|in|endfor|block|endblock|extends|render)[\\W]/)\n keyword = text[0..-2]\n @scanner.pos -= 1\n\n token(keyword.upcase.to_sym, keyword)\n\n when text = @scanner.scan(/[+\\-]?[0-9]+\\.[0-9]+/)\n token(:REAL, text)\n\n when text = @scanner.scan(/[+\\-]?[1-9][0-9]*|0/)\n token(:INTEGER, text)\n \n when text = @scanner.scan(/['][^']*[']|[\"][^\"]*[\"]/)\n token(:STRING, text)\n\n when text = @scanner.scan(/[A-Za-z_][A-Za-z0-9_\\.]*/)\n token(:IDENTIFIER, text)\n\n else\n next_character = @scanner.getch\n token(next_character, next_character)\n end\n end",
"title": ""
},
{
"docid": "b151fd40229ed19157983c78d3e1906a",
"score": "0.44419467",
"text": "def match(statement1, statement2=nil, noisy = false)\n if (ss = [statement1, statement2].compact.size) != @antecedents.size\n if noisy\n return [nil, \"antecedent size (#{@antecedents.size}) doesn't match the arguments size #{ss}\"]\n else\n return nil\n end\n end\n\n if @antecedents.size == 1\n antecedent = @antecedents.first\n pattern, assignments, slots = antecedent.to_hash, {}, {}\n \n pattern.each {|k,v| slots[k] = pattern.delete(k) if PLACEHOLDERS.include?(v) }\n \n [:subject, :object, :predicate].select {|k| pattern[k].nil?}.each {|k| \n msv = slots[k]\n assignments[msv] = statement1.send(k)\n }\n\n pattern = Statement.new(pattern)\n ad_hoc_repo = RDF::Repository.new.insert(statement1)\n if ad_hoc_repo.query(pattern).empty?\n if noisy\n return [nil, \"pattern was #{pattern.inspect} and did not match #{statement1.inspect}\"]\n else\n return nil\n end\n end\n return consequents_from(assignments)\n else\n pattern1, pattern2 = @antecedents.collect(&:to_hash)\n slots, assignments, statement1_assignments, statement2_assignments = {}, {}, {}, {}\n \n pattern1.each {|k,v| (slots.merge!({\"#{k}_1\" => pattern1.delete(k)})) if PLACEHOLDERS.include?(v) }\n pattern2.each {|k,v| (slots.merge!({\"#{k}_2\" => pattern2.delete(k)})) if PLACEHOLDERS.include?(v) }\n \n pattern1, pattern2 = Statement.new(pattern1), Statement.new(pattern2)\n if (pattern1 === statement1) && (pattern2 === statement2)\n\n [:subject, :object, :predicate].select {|k| pattern1.to_hash[k].nil?}.each {|k| \n msv = slots[\"#{k.to_s}_1\"]\n assignments[msv] = statement1.send k\n }\n \n [:subject, :object, :predicate].select {|k| pattern2.to_hash[k].nil?}.each {|k| \n msv = slots[\"#{k.to_s}_2\"]\n assignments[msv] = statement2.send k\n }\n return consequents_from(assignments) \n elsif (pattern1 === statement2) && (pattern2 === statement1)\n \n [:subject, :object, :predicate].select {|k| pattern1.to_hash[k].nil?}.each {|k| \n msv = slots[\"#{k.to_s}_1\"]\n assignments[msv] = statement2.send(k)\n }\n \n [:subject, :object, :predicate].select {|k| pattern2.to_hash[k].nil?}.each {|k| \n msv = slots[\"#{k.to_s}_2\"]\n assignments[msv] = statement1.send(k)\n }\n return consequents_from(assignments)\n else\n if noisy\n return [nil, \"pattern was #{pattern.inspect} and did not match #{[statement1, statement2].inspect}\"]\n else\n return nil\n end\n end\n end\n end",
"title": ""
},
{
"docid": "01e064465662319a36282d15840ed312",
"score": "0.444032",
"text": "def n3statements\n # BNodes in statements are existential variables.\n @n3statements ||= begin\n # Operations/Builtins are not statements.\n operands.\n select {|op| op.is_a?(RDF::Statement)}\n end\n end",
"title": ""
},
{
"docid": "b0a3a4268af6a9effdea02f51889ec35",
"score": "0.44394067",
"text": "def parse_statement\n\n if peek?(:KW_RETURN)\n stmt = parse_function_return\n elsif peek_any?([:KW_BREAK, :KW_CONTINUE])\n stmt = parse_loop_skip\n elsif peek?(:ID) and peek2?(:OP_ASSIGNMENT) or (peek?(:ID) and peek2?(:L_SQ_BRACKET))\n stmt = parse_assignment\n elsif peek_any?([:KW_READ, :KW_PRINT])\n stmt = parse_IO_op\n elsif peek_any?([:KW_BOOL, :KW_INT, :KW_FLOAT, :KW_STRING]) and !peek2?(:L_SQ_BRACKET)\n stmt = parse_variable_declaration\n elsif peek_any?([:KW_PRINT_VRAM, :KW_CLEAR_VRAM, :KW_FLUSH_VRAM])\n stmt = parse_VRAM_op\n elsif peek?(:KW_SLEEP)\n stmt = parse_sleep\n elsif peek?(:KW_RAND)\n stmt = parse_rand\n else\n stmt = StmtExpr.new(parse_expression)\n end\n\n expect(:SEPARATOR)\n\n stmt\n end",
"title": ""
},
{
"docid": "ae5c60e71cd77d2dbc5a0defbd4589a1",
"score": "0.4429781",
"text": "def default_clause\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n return_value = DefaultClauseReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n string_literal67 = nil\n statement_list68 = nil\n\n tree_for_string_literal67 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 103:5: ^( 'default' ( statement_list )? )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal67 = match( DEFAULT, TOKENS_FOLLOWING_DEFAULT_IN_default_clause_529 )\n\n tree_for_string_literal67 = @adaptor.copy_node( string_literal67 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal67, root_1 )\n\n\n\n if @input.peek == DOWN\n match( DOWN, nil )\n # at line 103:18: ( statement_list )?\n alt_19 = 2\n look_19_0 = @input.peek( 1 )\n\n if ( look_19_0.between?( AMP, AMP_ASGN ) || look_19_0 == POST_DECR || look_19_0.between?( GEQ, AREF ) || look_19_0.between?( GREATER, HAT ) || look_19_0.between?( ARROW, HAT_ASGN ) || look_19_0.between?( ASGN, REGEX ) || look_19_0.between?( IN, RETURN ) || look_19_0 == INCR || look_19_0.between?( BREAK, RSHIFT3 ) || look_19_0.between?( LABEL, CATCH ) || look_19_0 == RSHIFT_ASGN || look_19_0 == LEQ || look_19_0.between?( LESS, SLASH ) || look_19_0.between?( SLASH_ASGN, CONTINUE ) || look_19_0.between?( STAR, DECR ) || look_19_0 == STAR_ASGN || look_19_0.between?( LSHIFT, THIS ) || look_19_0 == THROW || look_19_0.between?( MINUS, MOD ) || look_19_0.between?( MOD_ASGN, TYPEOF ) || look_19_0.between?( NEQ, UMINUS ) || look_19_0.between?( NEQQ, UNDEFINED ) || look_19_0.between?( NEW, UPLUS ) || look_19_0.between?( OBJECT, FALSE ) || look_19_0.between?( WITH, PLUS ) || look_19_0.between?( ID, DOC ) )\n alt_19 = 1\n end\n case alt_19\n when 1\n # at line 103:18: statement_list\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_statement_list_IN_default_clause_531 )\n statement_list68 = statement_list\n @state.following.pop\n\n @adaptor.add_child( root_1, statement_list68.tree )\n\n\n end\n\n match( UP, nil )\n end\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 18 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "20944a7a7ed975a48a50f0682194cd32",
"score": "0.44260773",
"text": "def execute(queryable, solutions:, **options)\n RDF::Query::Solutions(solutions.map do |solution|\n # Might be a variable or node evaluating to a list in queryable, or might be a list with variables\n subject = operand(0).evaluate(solution.bindings, formulae: formulae)\n next unless subject\n # If it evaluated to a BNode, re-expand as a list\n subject = RDF::N3::List.try_list(subject, queryable).evaluate(solution.bindings, formulae: formulae)\n object = operand(1).evaluate(solution.bindings, formulae: formulae) || operand(1)\n object = formulae.fetch(object, object) if object.node?\n\n log_info(self.class.const_get(:NAME), \"subject\") {SXP::Generator.string(subject.to_sxp_bin).strip}\n log_info(self.class.const_get(:NAME), \"object\") {SXP::Generator.string(object.to_sxp_bin).strip}\n next unless validate(subject)\n\n lhs = resolve(subject)\n if lhs.nil?\n log_error(self.class.const_get(:NAME), \"subject evaluates to null\") {subject.inspect}\n next\n end\n\n if object.variable?\n log_debug(self.class.const_get(:NAME), \"result\") {SXP::Generator.string(lhs.to_sxp_bin).strip}\n solution.merge(object.to_sym => lhs)\n elsif object != lhs\n log_debug(self.class.const_get(:NAME), \"result: false\")\n nil\n else\n log_debug(self.class.const_get(:NAME), \"result: true\")\n solution\n end\n end.compact.uniq)\n end",
"title": ""
},
{
"docid": "8f108b15648b2f7cab2bcbee25fe1253",
"score": "0.44228712",
"text": "def prepare(query)\n sth = nil\n mutex.synchronize do\n self.last_query = query\n sth = new_statement(query)\n yield sth if block_given?\n sth.finish if block_given?\n end\n\n return self.last_statement = sth\n end",
"title": ""
},
{
"docid": "2a4eb613953d298e8d6edca008b893cb",
"score": "0.4419105",
"text": "def sql_of( expr, dataset)\n dataset.send :literal_expression_append, rv=String.new, expr\n rv\n end",
"title": ""
},
{
"docid": "38816f047ddee0a0c9179392568dc060",
"score": "0.4409287",
"text": "def build_default_constraint\n return unless default_scopes?(all_queries: true)\n\n default_where_clause = default_scoped(all_queries: true).where_clause\n default_where_clause.ast unless default_where_clause.empty?\n end",
"title": ""
},
{
"docid": "95fdd78ee5a3cebd9a518465a5e206dd",
"score": "0.440643",
"text": "def find_statement\n @statement = Statement.find(params[:id])\n end",
"title": ""
},
{
"docid": "dcdd1b46ad47c25e80c300e012099ccb",
"score": "0.44055745",
"text": "def query(sql, name, binds)\n \n rs = SA.instance.api.sqlany_execute_direct(@connection, sql)\n raise ActiveRecord::StatementInvalid.new(\"#{SA.instance.api.sqlany_error(@connection)}:#{sql}\") if rs.nil?\n \n max_cols = SA.instance.api.sqlany_num_cols(rs)\n fields = {}\n max_cols.times do |i|\n fields[i] = SA.instance.api.sqlany_get_column_info(rs, i)[2]\n end\n \n rows = []\n while SA.instance.api.sqlany_fetch_next(rs) == 1\n result = Array.new(max_cols)\n max_cols.times do |cols|\n result[cols] = SA.instance.api.sqlany_get_column(rs, cols)[1]\n end\n rows << result\n end\n @affected_rows = SA.instance.api.sqlany_affected_rows(rs)\n SA.instance.api.sqlany_free_stmt(rs)\n\n return rows, fields\n end",
"title": ""
},
{
"docid": "fa5b6b2968711ef2fe66697771a30c59",
"score": "0.43979123",
"text": "def normalize_arg(arg , statements)\n sol_arg = arg.to_sol\n return sol_arg if sol_arg.is_a?(Sol::Expression)\n if( sol_arg.is_a?(Sol::Statements))\n while(sol_arg.length > 1)\n statements << sol_arg.shift\n end\n sol_arg = sol_arg.shift\n end\n assign = Sol::LocalAssignment.new( \"tmp_#{arg.object_id}\".to_sym, sol_arg)\n statements << assign\n return Sol::LocalVariable.new(assign.name)\n end",
"title": ""
},
{
"docid": "6584e68acebfc9444241c85ef4dfcc19",
"score": "0.43899047",
"text": "def insert_statement(statement)\n @formula = nil\n @mutable.insert_statement(statement)\n end",
"title": ""
},
{
"docid": "703d0058a5b1f93431048a348f6142f5",
"score": "0.43891177",
"text": "def statement\n # filters clauses\n filters_clauses = []\n filters.each_key do |field|\n next if field == \"subproject_id\"\n v = values_for(field).clone\n next unless v and !v.empty?\n operator = operator_for(field)\n\n # \"me\" value substitution\n if %w(assigned_to_id author_id user_id watcher_id updated_by last_updated_by).include?(field)\n if v.delete(\"me\")\n if User.current.logged?\n v.push(User.current.id.to_s)\n v += User.current.group_ids.map(&:to_s) if field == 'assigned_to_id'\n else\n v.push(\"0\")\n end\n end\n end\n\n if field == 'project_id'\n if v.delete('mine')\n v += User.current.memberships.map(&:project_id).map(&:to_s)\n end\n end\n\n if field =~ /^cf_(\\d+)\\.cf_(\\d+)$/\n filters_clauses << sql_for_chained_custom_field(field, operator, v, $1, $2)\n elsif field =~ /cf_(\\d+)$/\n # custom field\n filters_clauses << sql_for_custom_field(field, operator, v, $1)\n elsif field =~ /^cf_(\\d+)\\.(.+)$/\n filters_clauses << sql_for_custom_field_attribute(field, operator, v, $1, $2)\n elsif respond_to?(method = \"sql_for_#{field.tr('.','_')}_field\")\n # specific statement\n filters_clauses << send(method, field, operator, v)\n else\n # regular field\n filters_clauses << '(' + sql_for_field(field, operator, v, queried_table_name, field) + ')'\n end\n end if filters and valid?\n\n if (c = group_by_column) && c.is_a?(QueryCustomFieldColumn)\n # Excludes results for which the grouped custom field is not visible\n filters_clauses << c.custom_field.visibility_by_project_condition\n end\n\n ################\n # Smile specific #340206 Filtre additifs\n # Or filters clauses\n or_filters_clauses = []\n # Namespace to avoid a confusion with Class:ActiveRecord::AttributeMethods::Query\n if ::Query.respond_to?(:or_filters_provided?)\n or_filters.each_key do |field|\n next if field == \"subproject_id\"\n v = or_values_for(field).clone\n next unless v and !v.empty?\n operator = or_operator_for(field)\n\n # \"me\" value substitution\n ################\n # Smile specific : +old_value fields for Indicators\n # TODO move redmine_smile_indicators old_value_* to hook\n # * old_value_assigned_to_id\n # * old_value_author_id\n # * old_value_user_id\n # * old_value_watcher_id\n if %w(assigned_to_id old_value_assigned_to_id author_id old_value_author_id user_id old_value_user_id watcher_id old_value_watcher_id).include?(field)\n if v.delete(\"me\")\n if User.current.logged?\n v.push(User.current.id.to_s)\n v += User.current.group_ids.map(&:to_s) if field == 'assigned_to_id'\n else\n v.push(\"0\")\n end\n end\n end\n\n if field == 'project_id'\n if v.delete('mine')\n v += User.current.memberships.map(&:project_id).map(&:to_s)\n end\n end\n\n if field =~ /^cf_(\\d+)\\.cf_(\\d+)$/\n or_filters_clauses << sql_for_chained_custom_field(field, operator, v, $1, $2)\n elsif field =~ /cf_(\\d+)$/\n # custom field\n or_filters_clauses << sql_for_custom_field(field, operator, v, $1)\n elsif field =~ /^cf_(\\d+)\\.(.+)$/\n filters_clauses << sql_for_custom_field_attribute(field, operator, v, $1, $2)\n elsif respond_to?(method = \"sql_for_#{field.tr('.','_')}_field\")\n # specific statement\n or_filters_clauses << send(method, field, operator, v)\n else\n # regular field\n or_filters_clauses << '(' + sql_for_field(field, operator, v, queried_table_name, field) + ')'\n end\n end if or_filters and valid?\n\n if (c = group_by_column) && c.is_a?(QueryCustomFieldColumn)\n # Excludes results for which the grouped custom field is not visible\n or_filters_clauses << c.custom_field.visibility_by_project_condition\n end\n or_filters_clauses.reject!(&:blank?)\n end\n # END -- Smile specific #340206 Filtre additifs\n #######################\n\n filters_clauses << project_statement\n filters_clauses.reject!(&:blank?)\n\n result_statement = filters_clauses.any? ? filters_clauses.join(' AND ') : nil\n\n ################\n # Smile specific #340206 Filtre additifs\n if or_filters_clauses.any?\n if filters_clauses.any?\n result_statement += ' AND (' + or_filters_clauses.join(' OR ') + ')'\n else\n result_statement = or_filters_clauses.join(' OR ')\n end\n end\n # END -- Smile specific #340206 Filtre additifs\n #######################\n\n result_statement\n end",
"title": ""
},
{
"docid": "da01f762d1982e40949a3deb629088b1",
"score": "0.43824473",
"text": "def bind(solution)\n map! do |op|\n op.respond_to?(:bind) ? op.bind(solution) : op\n end\n self\n end",
"title": ""
},
{
"docid": "91a29e39bd2c347ba0c5cd9b5c1d93c7",
"score": "0.43818724",
"text": "def statement_list\r\n statement\r\n while true\r\n if (next_token == 'Id' || next_token == 'ReadSym' ||\r\n next_token == 'WriteSym' || next_token == 'IfSym' ||\r\n next_token == 'WhileSym')\r\n statement\r\n else\r\n break\r\n end\r\n end\r\n end",
"title": ""
}
] |
91b50f219155d7a8c5420eb403d1a13d
|
Internal: Adds a message to the logger. level The level of the message. context The context of the message. message The unformatted message. Returns nothing.
|
[
{
"docid": "762026091f291058037544556bfcf741",
"score": "0.8081975",
"text": "def add(level, context, message)\n @logger.send level, @formatter.format(level, context, message)\n rescue => e\n STDERR.puts \"Failed to log message for #{context} with appender #{self} - #{level} - #{message}\\n\"\n STDERR.puts \"#{e}\\n\"\n end",
"title": ""
}
] |
[
{
"docid": "97381eafeb2ad93e3cdbb2270df03dc0",
"score": "0.64307076",
"text": "def add(level, message)\n asl_log(@aslclient, @aslmsg, level, message)\n end",
"title": ""
},
{
"docid": "dc775cfdbbee6ca5e999a81a709f6d3d",
"score": "0.64144945",
"text": "def log(context, msg)\n @log << \"#{context}: #{msg}\"\n end",
"title": ""
},
{
"docid": "8051a985441122a6a0f4b05bd68a7ed5",
"score": "0.6360241",
"text": "def log_message( level, message )\n\n end",
"title": ""
},
{
"docid": "b5d4fc83c160fc3f58606482ff6b95a3",
"score": "0.604146",
"text": "def format(level, context, message)\n msg = message.to_s.strip\n thread = thread_context ? \"[#{thread_name}] - \" : nil\n\n if message.ndc.any?\n msg = \"#{thread}#{level.to_s.upcase} - #{context} #{message.ndc.join(' ')} - #{msg}\"\n else\n msg = \"#{thread}#{level.to_s.upcase} - #{context} - #{msg}\"\n end\n\n with_backtrace(message, msg)\n end",
"title": ""
},
{
"docid": "13b3528db2b8c477d871bd5042da9815",
"score": "0.59513026",
"text": "def log level, message\n logger.send(level, name) { message }\n end",
"title": ""
},
{
"docid": "13b3528db2b8c477d871bd5042da9815",
"score": "0.59513026",
"text": "def log level, message\n logger.send(level, name) { message }\n end",
"title": ""
},
{
"docid": "f4108cb7b852950da7041d0155db3e05",
"score": "0.589348",
"text": "def <<(message_)\n add(@level_group.default, message_)\n end",
"title": ""
},
{
"docid": "86d97862e19345cd02279b239cb36e2f",
"score": "0.58096004",
"text": "def addcontext(message, obj = nil)\n obj ||= @lexer\n\n message += \" on line #{obj.line}\"\n if file = obj.file\n message += \" in file #{file}\"\n end\n\n message\n end",
"title": ""
},
{
"docid": "ae8393b9eed7f2222b9ec223db119ba5",
"score": "0.5800067",
"text": "def add(level, message = nil, progname = nil, &block)\n progname ||= default_options['facility']\n\n if message.nil?\n if block_given?\n message = yield\n else\n message = progname\n progname = default_options['facility']\n end\n end\n\n message_hash = { 'facility' => progname }\n\n if message.is_a?(Hash)\n # Stringify keys.\n message.each do |k,v|\n message_hash[k.to_s] = message[k]\n end\n else\n message_hash['short_message'] = message\n end\n\n if message.is_a?(Exception)\n message_hash.merge!(self.class.extract_hash_from_exception(message))\n end\n\n notify_with_level(level, message_hash)\n end",
"title": ""
},
{
"docid": "74aca6bf895985bad997303ec7aaa30f",
"score": "0.5794649",
"text": "def <<(message)\n asl_log(@aslclient, @aslmsg, @level, message)\n end",
"title": ""
},
{
"docid": "eab0f427370d1dbd7f885d60a756104c",
"score": "0.5793065",
"text": "def log_message(message, level=::Logger::INFO)\n tag_logger(self.class.name, self.job_id, '') do\n msg = if message.is_a?(String)\n { message: 'message' }\n elsif message.is_a?(Exception)\n level = ::Logger::ERROR\n { message: message.message, backtrace: message.backtrace.join(\"\\n\") }\n else\n message\n end\n self.logger.add(level, msg.merge(arguments: self.arguments))\n end\n end",
"title": ""
},
{
"docid": "3d6d339a926977ecd9f29a28cff125e1",
"score": "0.57561564",
"text": "def add(arg_severity, arg1 = nil, arg2 = nil, **context) # Ruby will prefer to match hashes up to last ** argument\n severity = arg_severity || UNKNOWN\n if log_level_enabled?(severity)\n if arg1.nil?\n if block_given?\n message = yield\n progname = arg2 || context.delete(:progname) || @progname\n else\n message = arg2\n progname = @progname\n end\n else\n message = arg1\n progname = arg2 || @progname\n end\n write_entry_to_log(severity, Time.now, progname, message, context: current_context_for_thread.deep_merge(context))\n end\n\n true\n end",
"title": ""
},
{
"docid": "80a92aa30775c2d7a2aa485d1b47262a",
"score": "0.5739502",
"text": "def format_msg_with_context(msg)\n msg\n end",
"title": ""
},
{
"docid": "42c3e6000be9f1198826ace7daf4a999",
"score": "0.5713611",
"text": "def add (level, message, options={})\n configuration = {\n :flash => true,\n :name => nil,\n :remember => false,\n :seen_in => nil,\n :seen_since => nil,\n }.update(options)\n\n # We'll need a valid name for a few different operations\n configuration[:name] = message.object_id if configuration[:name].nil?\n\n # force message names to be strings\n configuration[:name] = configuration[:name].to_s\n\n # Force :flash to false if :remember is true\n configuration[:flash] = false if configuration[:remember]\n\n # don't add if one of the see options was given, and it was already seen\n return if configuration[:seen_in] and seen?(configuration[:name], :in => configuration[:seen_in])\n return if configuration[:seen_since] and seen?(configuration[:name], :since => configuration[:seen_since])\n\n # If it already exists, delete the old one first\n destroy(configuration[:name], false)\n\n # Wow, we made it this far, I guess we better add the message\n message = OpenStruct.new({\n :name => configuration[:name],\n :level => level,\n :message => message,\n :options => configuration,\n })\n\n (@messages[level] ||= []) << message\n @by_id[configuration[:name]] = [message, level]\n end",
"title": ""
},
{
"docid": "187d6d47a2c796523b9417e7639db696",
"score": "0.56319076",
"text": "def format(level, context, message)\n msg = message.evaluated_message\n\n case msg\n when Hash\n # Assume caller is following conventions\n log = msg.dup\n else\n # Otherwise treat as String\n log = { :message => msg.to_s.strip }\n end\n\n log[:timestamp] = timestamp\n log[:level] = format_level(level)\n log[:pid] = Process.pid\n\n unless Thread.current == Thread.main\n log[:thread] = Thread.current.object_id\n end\n\n log[:context] = context\n\n if message.ndc.any?\n log[:ndc] = message.ndc.to_a\n end\n\n if message.error\n error = message.error\n\n log[:error_class] = error.class.to_s\n log[:error_message] = error.message\n log[:error_backtrace]\n\n if error.respond_to?(:backtrace)\n backtrace = error.backtrace\n backtrace = backtrace.take(backtrace_limit) if backtrace_limit\n log[:error_backtrace] = backtrace.join(\"\\n\")\n end\n end\n\n JSON.generate(log.to_h)\n end",
"title": ""
},
{
"docid": "9c0931a048250391675ec0cc4ab1beb2",
"score": "0.56152904",
"text": "def log_message( level, message )\n t = Time.now\n log_time = \"#{t.strftime('%Y/%m/%d %H:%M:%S')}\"\n\n if @db != nil\n begin\n stm = @db.prepare( 'INSERT INTO tblMessages (mStatus, mTime, mText) VALUES (?, ?, ?)' )\n stm.bind_params(level_text(level), log_time, message)\n rs = stm.execute\n mId = @db.last_insert_row_id.to_s\n stm.close\n rescue ::SQLite3::Exception => e\n Maadi::post_message(:Warn, \"Repository (#{@type}:#{@instance_name}) encountered an error (#{e.message}).\")\n end\n end\n end",
"title": ""
},
{
"docid": "86df87c6031045c7cb1610dacd04c820",
"score": "0.56086075",
"text": "def add_processing_message(level, severity, text)\n @process_log.add_processing_message(level, severity, text)\n end",
"title": ""
},
{
"docid": "1d18ec4c49ac3d18aa879796ebaa028b",
"score": "0.5602983",
"text": "def log(level, message = nil)\n level, message = :info, level if message.nil?\n Resqued::Logging.logger.send(level, self.class.name) { message }\n end",
"title": ""
},
{
"docid": "669ebf400de4dc64b6969c925430c416",
"score": "0.55891967",
"text": "def send(level: :debug, **message)\n\t\t\t\t\t@logger.send(level, self) {message}\n\t\t\t\tend",
"title": ""
},
{
"docid": "67a46f1136fd296fd8a448518011e3b8",
"score": "0.558573",
"text": "def write(level, message)\n if Boxlet.debug?\n if message.is_a? String\n puts message\n else\n pp message\n end\n else\n if level == :info\n pp message\n end\n @log.call(level, message)\n end\n end",
"title": ""
},
{
"docid": "7926bf45f761d0579e839ba3a0d2e9b1",
"score": "0.5582297",
"text": "def add(severity, message = nil, progname = nil, &block)\n severity ||= Logger::UNKNOWN\n return true if severity < @level\n\n message = msg2str(message || block.call)\n \n tag_length = tag ? tag.length + 3 : 0\n break_at = MAXIMUM_LINE_LENGTH - tag_length\n lines = 0\n\n while message.length > break_at && lines < MAX_LINES_PER_MSG\n part = message[0,break_at]\n message = message[break_at..-1]\n write(severity, part)\n lines += 1\n end\n\n write(severity, message) if message.length > 0 && lines < MAX_LINES_PER_MSG\n\n return true\n end",
"title": ""
},
{
"docid": "a72be273aaeebe19c37c2d55b72e3082",
"score": "0.5551913",
"text": "def add(severity, message = nil, progname = nil, &block)\n return if @level > severity\n message = (message || (block && block.call) || progname).to_s\n message = formatter.call(formatter.number_to_severity(severity), Time.now.utc, progname, message)\n message = \"#{message}\\n\" unless message[-1] == ?\\n\n buffer << message\n auto_flush\n message\n end",
"title": ""
},
{
"docid": "8d3dc5f258089bf78a0bcdc776aaa54a",
"score": "0.55497795",
"text": "def add_processing_message(level, severity, text)\n \n # See if we are bumping the level up or down\n if @log_level < level\n while @log_level < level\n @process_log << \"<ul>\"\n @log_level += 1\n end\n elsif @log_level > level\n while @log_level > level\n @process_log << \"</ul>\"\n @log_level -= 1\n end\n end\n @log_level = level\n \n # Log Level 1 is a special case for top-level information. \n # All other levels are subordinate to some larger piece (e.g. MileageUpdate processing)\n if level == 1\n @process_log << \"<p class='text-#{severity}'>#{text}</p>\" \n else\n @process_log << \"<li><p class='text-#{severity}'>#{text}</p></li>\"\n end\n end",
"title": ""
},
{
"docid": "3e56cb2ce86d2f3d7e6852c1a0b03692",
"score": "0.55304056",
"text": "def add(level_, message_=nil, progname_=nil, &block_)\n level_obj_ = @level_group.get(level_)\n if level_obj_.nil?\n raise Errors::UnknownLevelError, level_\n end\n return true if level_obj_ < @level\n progname_ ||= @progname\n if message_.nil?\n if block_given?\n message_ = yield\n else\n message_ = progname_\n progname_ = @progname\n end\n end\n case message_\n when ::String\n # Do nothing\n when ::Exception\n message_ = \"#{message_.message} (#{message_.class})\\n\" +\n (message_.backtrace || []).join(\"\\n\")\n else\n message_ = message_.inspect\n end\n @processor.message(Entry::Message.new(level_obj_, ::Time.now, progname_, @current_record_id, message_))\n true\n end",
"title": ""
},
{
"docid": "1ffd2d01723bf887183ffb81154741e6",
"score": "0.55296284",
"text": "def add severity, message = nil, progname = nil\n message = yield if block_given?\n if Errlog.rails_test?\n Rails.logger.add(severity, message, progname)\n else\n @prev_logger and @prev_logger.add(severity, message, progname)\n end\n # Rails.logger.info \"- #{@prev_logger}: #{progname} =\"\n #puts message #if Errlog.rails_test?\n Errlog.context.add_log_record [severity, Time.now, message, progname]\n end",
"title": ""
},
{
"docid": "03b9cca6049201fb2ec32c9310dfeab8",
"score": "0.55019784",
"text": "def push( message )\n context.push(message)\n self\n end",
"title": ""
},
{
"docid": "7d7f293a13e4decc085309eabf7f4ac2",
"score": "0.54956776",
"text": "def add(severity, message = nil, progname = nil, &block)\n return if @level > severity\n message = (message || (block && block.call) || progname).to_s\n # If a newline is necessary then create a new message ending with a newline.\n # Ensures that the original message is not mutated.\n if ActiveRecord::Base.colorize_logging\n message = \"#{color(:black)}[%5s #{color(:dark_gray)}%s#{color(:black)}] #{color(:black)}[#{color(:brown)}%s#{color(:black)}.#{color(:blue)}%s#{color(:black)}]#{color(:nothing)} %s\\n\" % [severity_string(severity),\n Time.now.strftime(\"%m/%d/%y %H:%M:%S\"),\n $0, $$,\n output_message(severity,message)] unless message[-1] == ?\\n\n else\n message = \"[%5s %s] [%s.%s] %s\\n\" % [severity_string(severity),\n Time.now.strftime(\"%m/%d/%y %H:%M:%S\"),\n $0, $$,\n message] unless message[-1] == ?\\n\n end\n buffer << message\n auto_flush\n message\n end",
"title": ""
},
{
"docid": "6e38d6b29c3708472ca194dd9c89e2ad",
"score": "0.54882133",
"text": "def log level, message; write level, message, caller[0] unless level > @level end",
"title": ""
},
{
"docid": "7b79bea00edb456f7e2ccb831bd46d13",
"score": "0.54732805",
"text": "def add(severity, message = nil, progname = nil)\n severity ||= Logger::UNKNOWN\n return true if severity < @level\n\n progname ||= @progname\n\n if message.nil?\n if block_given?\n message = yield\n else\n message = progname\n progname = @progname\n end\n end\n\n message = formatter.call(format_severity(severity), progname, message)\n caller_object = caller_locations(3, 1).first\n\n Systemd::Journal.message(\n :message => message,\n :priority => log_level_map[severity],\n :syslog_identifier => progname,\n :code_line => caller_object.lineno,\n :code_file => caller_object.absolute_path,\n :code_func => caller_object.label\n )\n end",
"title": ""
},
{
"docid": "a15b851eaecccb39fd815f715c968ca1",
"score": "0.54702747",
"text": "def <<(message)\n add(Logger::UNKNOWN, message)\n end",
"title": ""
},
{
"docid": "c0abf82f7050c32f2f75b7f57d22d5fb",
"score": "0.54514843",
"text": "def log(level, message)\n @@logger_instance.log(level, message)\n end",
"title": ""
},
{
"docid": "c0abf82f7050c32f2f75b7f57d22d5fb",
"score": "0.54514843",
"text": "def log(level, message)\n @@logger_instance.log(level, message)\n end",
"title": ""
},
{
"docid": "48f7ef53b7d08b61391a8f285aa2eab6",
"score": "0.5417803",
"text": "def format_msg_with_context(msg)\n if @context_hash.keys.length > 0\n msg_context = '['\n @context_hash.each do |k, v|\n msg_context += \"#{k}=#{v} \"\n end\n msg_context += '] '\n msg = msg.prepend(msg_context)\n end\n msg\n end",
"title": ""
},
{
"docid": "a905d4be28c931195cd70859d8d113bf",
"score": "0.5396716",
"text": "def log(level, message=nil, *params)\n errors.write(\"[cache] #{level}: #{message}\\n\" % params)\n errors.flush\n end",
"title": ""
},
{
"docid": "c4f3e7aecb0d8c7589446f73e9aa4598",
"score": "0.5395258",
"text": "def add(severity, message = nil, progname = nil, &block)\n severity ||= Logger::UNKNOWN\n if severity >= @level\n prepend = progname ? \"[#{progname}] \" : nil\n prepend ||= @filter ? \"[#{@filter}] \" : ''\n message = clean(message || block.call)\n if defined?(Rails) and not @APP_PREFIX\n @APP_PREFIX = \"[#{Deployed::APP_NAME rescue Rails.root.split.last}:#{Rails.env}]\"\n end\n message = \"#{@APP_PREFIX} #{message}\"\n SYSLOG.send LEVEL_LOGGER_MAP[severity], prepend + clean(message)\n end\n true\n end",
"title": ""
},
{
"docid": "521b664753fff659a71e2ef5c2ce96c8",
"score": "0.53535265",
"text": "def log(message, kind: nil)\n @messages << {\n message: message,\n kind: kind\n }\n end",
"title": ""
},
{
"docid": "e40a3509ed07827d331de0fb41ee4ea3",
"score": "0.53507495",
"text": "def addlevel(msg, log_entry)\n player = verify_player msg\n return unless player\n player.level_log << log_entry\n msg.reply \"Congratulations! #{player.name} has ascended to level #{player.level}.\"\n player.save\n end",
"title": ""
},
{
"docid": "6a0da53a7350f6e4d1c85158ca1a922d",
"score": "0.5346226",
"text": "def log_and_update_message(level, msg, update_message = false)\n $evm.log(level, msg.to_s)\n @task.message = msg if @task && (update_message || level == 'error')\nend",
"title": ""
},
{
"docid": "6a0da53a7350f6e4d1c85158ca1a922d",
"score": "0.534581",
"text": "def log_and_update_message(level, msg, update_message = false)\n $evm.log(level, msg.to_s)\n @task.message = msg if @task && (update_message || level == 'error')\nend",
"title": ""
},
{
"docid": "0fad339f33bb5a0730a30d22c0e50303",
"score": "0.53444415",
"text": "def log(message)\n logger.send log_level, message if log?\n end",
"title": ""
},
{
"docid": "920390ef45cf58fcfbe950fc7d8eb218",
"score": "0.5318478",
"text": "def log(level, message)\n OmniAuth.logger.send(level, \"(#{name}) #{message}\")\n end",
"title": ""
},
{
"docid": "6b149ffcf1311f024ea4202cfd2908a7",
"score": "0.5317972",
"text": "def add(level, *args)\n raise ArgumentError.new('Wrong arguments.') unless (0..2).include?(args.count)\n\n # Ruby Logger's author is a maniac.\n message, progname = if args.count == 2\n [args[0], args[1]]\n elsif args.count == 0\n [yield, default_options['facility']]\n elsif block_given?\n [yield, args[0]]\n else\n [args[0], default_options['facility']]\n end\n\n if message.is_a?(Hash)\n # Stringify keys.\n hash = {}\n message.each do |k,v|\n hash[k.to_s] = message[k]\n end\n\n hash['facility'] = progname\n else\n hash = {'message' => message, 'facility' => progname}\n end\n\n hash.merge!(self.class.extract_hash_from_exception(message)) if message.is_a?(Exception)\n\n notify_with_level(level, hash)\n end",
"title": ""
},
{
"docid": "c3a0cd0d74f5a266863226317c7954a9",
"score": "0.53142256",
"text": "def logit(message=\"Hello world\", level=:info, depth=2)\n output = self.logmsg(message, depth)\n RAILS_DEFAULT_LOGGER.send(level, output)\n return output\n end",
"title": ""
},
{
"docid": "780bc9c0d4f2c9f2f8eb7b793e196ad1",
"score": "0.5313893",
"text": "def log(level, message = nil)\n level, message = 'info', level if message.nil? # Handle only one argument if called from Resque, which expects only message\n\n return false unless logger && logger.respond_to?(level)\n logger.send(level, \"#{Time.now}: #{message}\")\n end",
"title": ""
},
{
"docid": "c9afaab216d653b1c1c5a515953752ff",
"score": "0.5297905",
"text": "def log(message)\n logger.send(log_level, message) if log?\n end",
"title": ""
},
{
"docid": "c9afaab216d653b1c1c5a515953752ff",
"score": "0.5297905",
"text": "def log(message)\n logger.send(log_level, message) if log?\n end",
"title": ""
},
{
"docid": "5b91eb3e8ed7ae6da08a613ad47617d2",
"score": "0.5293883",
"text": "def write level, message\n now = Time.now\n usec = sprintf \"%06d\", now.usec\n timestamp = now.strftime \"%Y%m%d-%H:%M:%S.#{usec} %Z\"\n @message_queue << [ZMQ::Message.new(level.to_s), ZMQ::Message.new(timestamp), ZMQ::Message.new(message.to_s)]\n write_queue_to_socket\n end",
"title": ""
},
{
"docid": "bcb03a81daa54d4094f3f5f614d053e0",
"score": "0.5271509",
"text": "def add(severity, message)\n severity = TileUpLogger.sym_to_severity(severity)\n logger.add(severity, message)\n end",
"title": ""
},
{
"docid": "2ac8d8b5fcda7271b95f72408904846f",
"score": "0.5242418",
"text": "def log(message, level=nil)\n level ||= self.class.default_log_level\n\n self.class.before_log.call\n yield if block_given?\n\n if self.class.logging_enabled?\n if message.respond_to? :each_line\n message.each_line do |line|\n msg = filter_class_name(line.chomp)\n logger.send(level, msg)\n end\n else\n message = filter_class_name(message)\n logger.send(level, message)\n end\n end\n end",
"title": ""
},
{
"docid": "6ca825555cde7918c184b2366cd36559",
"score": "0.5228589",
"text": "def add(severity, message = nil, progname = nil, &block)\n @loggly.add(severity, add_metadata(message), progname, &block) if @loggly\n end",
"title": ""
},
{
"docid": "ae72460e0965e037d192b615fd752544",
"score": "0.5225865",
"text": "def log_entry(type, message)\n \"#{message_type(type)}#{message_body(type, message)}\".freeze\n end",
"title": ""
},
{
"docid": "41177b95c253951dcc32c06930dd09cf",
"score": "0.5195421",
"text": "def add_message(name, message)\n\t\tend",
"title": ""
},
{
"docid": "c73f1e9b8a8810453007dbac297d25d4",
"score": "0.5194275",
"text": "def add(severity, message)\n severity = Logger.sym_to_severity(severity)\n logger.add(severity, message)\n end",
"title": ""
},
{
"docid": "4b4a65c50cb8a60c020f1f147ba65c09",
"score": "0.5185783",
"text": "def perform(log)\n log.write(\"#{@message ** @ctx}\\n\")\n true\n end",
"title": ""
},
{
"docid": "b06377868c63bd232e620e36e85331f6",
"score": "0.51820457",
"text": "def log(message); logger.info(message); end",
"title": ""
},
{
"docid": "18d49b1e3a3f71fdbe5bfafc2cc90af0",
"score": "0.51781553",
"text": "def add(severity, message = nil, progname = nil, &block)\n (block && block.call) || message\n end",
"title": ""
},
{
"docid": "38a2239555c7d24f180c2fb62a98d531",
"score": "0.51701725",
"text": "def add(severity, message=nil, progname=nil, shift=0, &block)\n return if (@level > severity)\n\n message = block.call if message.nil? && block_given?\n return if message.nil?\n\n called_by = parse_caller(caller[1+shift])\n\n message = [message.chomp, progname].flatten.compact.join(\": \")\n message = \"%19s.%06d|%05d|%5s|%s%s\\n\" % [Time.now.utc.strftime(\"%Y-%m-%d|%H:%M:%S\"), Time.now.utc.usec, Process.pid, SEVERITIES[severity], called_by, message]\n\n @logdev.write(ZTK::ANSI.uncolor(message))\n @logdev.respond_to?(:flush) and @logdev.flush\n\n true\n end",
"title": ""
},
{
"docid": "cd4e378559ce77f12c598379e484b680",
"score": "0.5152154",
"text": "def add( message, severity=nil )\n if severe_enough?( severity )\n @io << format_message( message, severity )\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "a462d2620d26db4a982840434e2ef77c",
"score": "0.51458573",
"text": "def <<(message)\n debug message\n end",
"title": ""
},
{
"docid": "f23674e2e83ff07167bc6f3695d02925",
"score": "0.5145585",
"text": "def log_message( level, message )\n t = Time.now\n File.open( @options['FILENAME'], 'a') do |f|\n f.puts \"#{t.strftime('%Y%m%d%H%M%S')}\\tMESSAGE\\t#{message}\"\n end\n end",
"title": ""
},
{
"docid": "d554360f5eb0818d6809ff952e726af9",
"score": "0.51397324",
"text": "def log(severity, message)\n messages << [severity, message]\n end",
"title": ""
},
{
"docid": "83cfe8333919597df7931eb319fc7fed",
"score": "0.5118068",
"text": "def log(message)\n if message.is_a? String\n message_key = \"#{TransactionLogger.log_prefix}info\"\n message = { message_key => message }\n @log_queue.push message\n else\n @log_queue.push message\n end\n end",
"title": ""
},
{
"docid": "e2fb55a5b25819bb151c7b862e5930bf",
"score": "0.5115155",
"text": "def log_message(message)\r\n @log.log_message(message)\r\n end",
"title": ""
},
{
"docid": "a7c70e10f64bd8a006bab1e335311d3c",
"score": "0.51150876",
"text": "def level(level, context = nil)\n context = context.to_s unless context.nil?\n self.levels[context] = level\n clear_levels_cache!\n end",
"title": ""
},
{
"docid": "2c4ff2d35a4e31293a5c66575deb883c",
"score": "0.5113593",
"text": "def write_verbose_log(message, level = Honeybadger.configuration.debug ? :info : :debug)\n logger.send(level, LOG_PREFIX + message) if logger\n end",
"title": ""
},
{
"docid": "ae51c322c84bb001aad37e36c478e5f5",
"score": "0.51020837",
"text": "def log(severity, message = nil, &block)\n @log.add(severity, message, @appname, &block) if @log\n end",
"title": ""
},
{
"docid": "ee57de2103e8290246c64d64b05dbb25",
"score": "0.5093808",
"text": "def log(level, category, message)\n log_with_prefix(level, category, (('-' * 5) + '---' + '-' * 25) + ' | ' + message)\n end",
"title": ""
},
{
"docid": "9d8d763bea838dcf1a100d0b8a7f57fc",
"score": "0.5087815",
"text": "def logging(level, *messageList, &body)\n @logger.logging(level, *messageList, &body) ;\n end",
"title": ""
},
{
"docid": "2ed7e75cb9baf582c076fd911d34864e",
"score": "0.5070636",
"text": "def log (msg, **kwargs) Log.write(msg, :info, kwargs) end",
"title": ""
},
{
"docid": "e7bca29791f9b270d7a008813fff2dd7",
"score": "0.50640917",
"text": "def uimessage(message, level=0, sketchup=Sketchup, counter=nil)\n Su2Rad::Logger.log(message, level, sketchup, counter)\n end",
"title": ""
},
{
"docid": "974db2bd6b31e56e353ffdc7dbdecbde",
"score": "0.50615746",
"text": "def add(severity, message = nil, progname = nil, &block)\n if message.nil?\n if block_given?\n msg = yield\n else\n msg = progname\n end\n end\n\n case severity\n #when WARN\n #\t$stderr.puts \"WARN: #{msg}\"\n #\t$stderr.puts\t\n when ERROR\n $stderr.puts \"ERROR: #{msg}\"\n $stderr.puts\t\n when FATAL\n $stderr.puts \"FATAL: #{msg}\"\n $stderr.puts\n end\n super\n end",
"title": ""
},
{
"docid": "d8d3c4558527b1b865da417d3cc36692",
"score": "0.50579405",
"text": "def add_context(context)\n return unless context.present?\n @current_context ||= []\n @current_context << context.strip\n end",
"title": ""
},
{
"docid": "fa12997892c04401f6b9c805cf94b4f7",
"score": "0.5042176",
"text": "def log(severity, message)\n timestamp = Time.now.strftime('%m-%d %H:%M:%S')\n formatted = \"[%s] %s | %s\" % [timestamp, self.class.name, message]\n RDFMapper::Logger::Configuration.target.add(severity, formatted)\n end",
"title": ""
},
{
"docid": "b9ec4212f88e3029a91a21ddfe51c1da",
"score": "0.5038903",
"text": "def log(level, msg)\n LOGGER.tagged(self.experiment.id.to_s) { LOGGER.send(level, msg) }\n end",
"title": ""
},
{
"docid": "9c326a71fa376061af49e753635798e5",
"score": "0.50388753",
"text": "def add(level, *args)\n unless level_filtered?(level)\n event = create_log_event(level, *args)\n if EM.reactor_running?\n schedule_write(event)\n else\n safe_write(event)\n end\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "b5a21ec6a0493e7864c1c60ce59b2b12",
"score": "0.50318754",
"text": "def logging_old(level, *messageList, &body)\n tagInfo = LoggingTag[level] ;\n if(tagInfo[1] >= @logLevel) then\n loggingBody(tagInfo[0], *messageList, &body) ;\n end\n end",
"title": ""
},
{
"docid": "32640ac3f5d11c61b6e4b11b462b3871",
"score": "0.5029461",
"text": "def log(level, message)\n @evm.log(level, \"#{@method_name} - #{message}\")\n end",
"title": ""
},
{
"docid": "380128a8178f57d8884c6e4499173b0c",
"score": "0.5018444",
"text": "def log (level, message, quiet: false, &block)\n if !quiet && (LEVELS.index(level) >= LEVELS.index(Logger.level))\n synchronize do\n message = message.to_s.colorize(COLORS[level]) if level\n message = message.to_s.colorize(COLORS[level]) if level\n message.split(\"\\n\").each do |line|\n STDERR.puts \" \" * thread[:indent] + @prefix + line\n end\n end\n with_indent(&block) if block\n elsif block\n block.()\n end\n end",
"title": ""
},
{
"docid": "4e7780cd273ada60d3b3ea8761e59ad7",
"score": "0.50141054",
"text": "def add(severity, message = nil, progname: @progname, callback: nil, format: nil, **opts)\n\t\t\tseverity=severity(severity, **opts)\n\t\t\tseverity_lvl=severity_lvl(severity)\n\t\t\tif @logdev.nil? or severity_lvl < @level\n\t\t\t\treturn true\n\t\t\tend\n\t\t\tif message.nil?\n\t\t\t\tmessage = yield if block_given?\n\t\t\tend\n\t\t\tcallback.call(message, progname, severity) if callback\n\t\t\t@logdev.write(\n\t\t\t\tformat_message(severity, Time.now, progname, message, formatter: format, caller: self, **opts))\n\t\t\ttrue\n\t\tend",
"title": ""
},
{
"docid": "2daad2ff4cccea17e48a834374553890",
"score": "0.49924335",
"text": "def append(message, truncate = nil, timestamp = nil)\n @log << message.to_s\n end",
"title": ""
},
{
"docid": "d2007c27e6b5c5d165c3c0f1f8bec060",
"score": "0.49847576",
"text": "def my_msg(msg = nil, put_msg = false)\n Rails.logger.info { \"#{self.class}: #{msg}\" }\n @msg << msg if put_msg\n true\n end",
"title": ""
},
{
"docid": "afc86673e8d4319dcfcc39f6f519e356",
"score": "0.49669695",
"text": "def message(message)\n log.info(message.to_s)\n end",
"title": ""
},
{
"docid": "62fd3c52d1588291209971f825b4c140",
"score": "0.49471888",
"text": "def format_message level, time, msg\n prefix = case level\n when \"warn\"; \"WARNING: \"\n when \"error\"; \"ERROR: \"\n else \"\"\n end\n \"[#{time.to_s}] #{prefix}#{msg.rstrip}\\n\"\n end",
"title": ""
},
{
"docid": "cc8576a369cda0d073e7883096fda6d3",
"score": "0.49299997",
"text": "def log(message, level)\r\n\t\t\t\tlogger = Logger.new(\"#{Rails.root}/log/debug.log\")\r\n\t\t\t\toriginal_formatter = Logger::Formatter.new\r\n\t\t\t\tlogger.formatter = proc { |severity, datetime, progname, msg|\r\n\t\t\t\t\toriginal_formatter.call(severity, datetime, progname, msg.dump)\r\n\t\t\t\t}\r\n\t\t\t\tcase level\r\n\t\t\t\twhen 'info'\r\n\t\t\t\t\tlogger.info(message)\r\n\t\t\t\twhen 'error'\r\n\t\t\t\t\tlogger.error(message)\r\n\t\t\t\telse\r\n\t\t\t\t\tlogger.error(\"invalid log level\")\r\n\t\t\tend\r\n\r\n\tend",
"title": ""
},
{
"docid": "009769b8a568ec12bc2d76edf9b0a772",
"score": "0.49187514",
"text": "def write_message?(level_of_message); end",
"title": ""
},
{
"docid": "d62405788f9372fe715852d3d964f09c",
"score": "0.4904576",
"text": "def log message\n @logs << message\n end",
"title": ""
},
{
"docid": "0425384cd0f3039d5dacf843272071ee",
"score": "0.48873827",
"text": "def write(severity, message)\n message = \"[#{tag}] #{message}\" if tag\n SYSLOG.send LEVEL_LOGGER_MAP[severity], clean(message)\n end",
"title": ""
},
{
"docid": "1090f2a1a66398c905e90d61643faf7b",
"score": "0.48847586",
"text": "def new(context)\n dup.tap do |logger|\n logger.context = \"#{logger.context}#{context_separator}#{context}\"\n end\n end",
"title": ""
},
{
"docid": "8adce96be12200a45bb35410a1149c1b",
"score": "0.4881547",
"text": "def log(level, message)\n @outputter.call(level, message)\n end",
"title": ""
},
{
"docid": "95cb3890af83b833b5229df65556acfc",
"score": "0.48739526",
"text": "def log(msg, metadata: {}, restrict: [])\n # clearing a small hash is slightly faster than creating a new\n # one each time.\n merged_metadata.clear\n merged_metadata.merge!(@global_context)\n \n # first load context data\n context.each do |ctx_data|\n case ctx_data\n when Hash\n merged_metadata.merge!(ctx_data)\n \n when Extension\n ctx_data.class.properties.each do |attr_name|\n merged_metadata[attr_name] = ctx_data.send(attr_name)\n end\n \n end\n end\n \n # then add our data\n merged_metadata.merge!(metadata)\n \n # and dispatch the result\n merged_metadata.each do |k,v|\n if v.is_a?(Proc)\n merged_metadata[k] = v.call()\n end\n end\n \n dispatch(msg, metadata: merged_metadata, restrict: restrict)\n end",
"title": ""
},
{
"docid": "4c8a25f674fa4299d34544281e89e45e",
"score": "0.48729953",
"text": "def add_log_level(str)\n # Need a check since debug has a different identifier than the rest\n str = @level == 'debug' ? 'DBUG' : @level[0..3].upcase\n str = add_color_key(str) if with_color\n str += + \" | \"\n end",
"title": ""
},
{
"docid": "074a4ca96cea640091ef23fd3c9186a4",
"score": "0.48710623",
"text": "def log(message, level = :info)\n return unless self.logging?\n level = :info if level.blank?\n self.logger ||= ::Logger.new(::STDOUT)\n self.logger.send(level.to_sym, \"[klarna:] #{level.to_s.upcase} #{message}\")\n end",
"title": ""
},
{
"docid": "8e09fd4a905887513c7821d58939589a",
"score": "0.4870205",
"text": "def log_message(message)\n @log.info(message) if @options[:logging_enabled]\n end",
"title": ""
},
{
"docid": "8e09fd4a905887513c7821d58939589a",
"score": "0.4870205",
"text": "def log_message(message)\n @log.info(message) if @options[:logging_enabled]\n end",
"title": ""
},
{
"docid": "8e09fd4a905887513c7821d58939589a",
"score": "0.4870205",
"text": "def log_message(message)\n @log.info(message) if @options[:logging_enabled]\n end",
"title": ""
},
{
"docid": "f132f4db7ace9513dc43dac9cfbe376f",
"score": "0.4865928",
"text": "def log_entry(type, message)\n log_type(type) + log_message(type, message)\n end",
"title": ""
},
{
"docid": "d03603803279ca449a874b04a80bfc6b",
"score": "0.4865001",
"text": "def log(message, type)\n @messages << ApiApe::ApeDebugLog.new(message, type)\n end",
"title": ""
},
{
"docid": "80aa948aaff0dc00783f3120848133c0",
"score": "0.48521984",
"text": "def log(message)\n @collector.sending_stream.puts pack(:log, message)\n end",
"title": ""
},
{
"docid": "49c887ebe1b0c9d665255df92f3cc109",
"score": "0.48478237",
"text": "def log(message, level)\n if SEVERITY[@log_level] <= SEVERITY[level]\n message = \"#{level}: #{message}\"\n if @output==:file\n File.open('debug.log', 'ab') {|f| f.puts message }\n elsif @output==:stdout\n puts message\n end\n return message \n end\n return nil\n end",
"title": ""
},
{
"docid": "d7e992b2ebe869f95117a4d42d4b88f5",
"score": "0.484626",
"text": "def log(message)\n @__result.add_log(message)\n true\n end",
"title": ""
}
] |
653ae66ff3902dd8eedd06515b41031a
|
PUT /usercases/1 PUT /usercases/1.xml
|
[
{
"docid": "9bb10b1789f8e1c1dac98563b58309e1",
"score": "0.6516272",
"text": "def update\n @usercase = Usercase.find(params[:id])\n\n respond_to do |format|\n if @usercase.update_attributes(params[:usercase])\n flash[:notice] = 'Usercase was successfully updated.'\n format.html { redirect_to(@usercase) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usercase.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "9ddf960eb3f437e62b9b99d34992bc0f",
"score": "0.6394639",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "238fd956be713471aa406c76bf19254a",
"score": "0.61329603",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :status_post => {:body => 'API Status Post 1' }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.60963476",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "2111dcaa67c0caee29e09d6b7459afcf",
"score": "0.59960204",
"text": "def update\n @testcase = Testcase.find(params[:id])\n @testcase[:status] = 'UNDO'\n\n respond_to do |format|\n if @testcase.update_attributes(params[:testcase])\n format.html { redirect_to(@testcase, :notice => 'Testcase was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @testcase.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23b8fd20c4f863cc9fd1d0f2eeefb2e5",
"score": "0.5839923",
"text": "def update_task\n @user = User.find_by_username(session['user'])\n @access_token = OAuth::AccessToken.new(UsersController.consumer, @user.token, @user.secret)\n @response = UsersController.consumer.request(:put, \"/api/v1/tasks/#{params[:id]}.xml\", @access_token, {:scheme => :query_string},\n {'task[title]' => 'Updated Valid Task'})\n render :xml => @response.body\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.5774892",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "1be44c3e0ba097e5e9e3383b5907538c",
"score": "0.57629913",
"text": "def update(id, member=\"Default member\", rating=\"9\", venue_Name=\"Default Venue_Name\", address=\"Default Address\", city=\"Default City\", phone=\"9999999999\" , date=\"\" , comment= \"Default Comment\")\r\n\t\txml_req =\r\n\t\t\"<?xml version='1.0' encoding='UTF-8'?>\r\n\t\t\t<review>\r\n\t\t\t\t<Member>#{member}</Member>\r\n\t\t\t\t<Rating>#{rating}</Rating>\r\n\t\t\t\t<Venue-Name>#{venue_Name}</Venue-Name>\r\n\t\t\t\t<Address>#{address}</Address>\r\n\t\t\t\t<City>#{city}</City>\r\n\t\t\t\t<Phone>#{phone}</Phone>\r\n\t\t\t\t<Date-of-Visit>date</Date-of-Visit>\r\n\t\t\t\t<Comment>#{comment}</Comment>\t\t\t\t\t\r\n\t\t\t</review>\"\r\n\r\n\t\trequest = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n\t\trequest.add_field \"Content-Type\", \"application/xml\"\r\n\t\trequest.body = xml_req\r\n\r\n\t\thttp = Net::HTTP.new(@uri.host, @uri.port)\r\n\t\tresponse = http.request(request)\r\n\r\n\t\t# no response body will be returned\r\n\t\tcase response\r\n\t\twhen Net::HTTPSuccess\r\n\t\t\treturn \"#{response.code} OK\"\r\n\t\telse\r\n\t\t\treturn \"#{response.code} ERROR\"\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "99d24a74bc96db3bd84b0451ef3afb5f",
"score": "0.5755452",
"text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"title": ""
},
{
"docid": "ad54471b285e5e357d9be959c8ade2d8",
"score": "0.5740265",
"text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end",
"title": ""
},
{
"docid": "b5edb8a9b2cad14c7874c5f42c5809e9",
"score": "0.56812936",
"text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end",
"title": ""
},
{
"docid": "96c2c4ca74afa5a26914fb582062f271",
"score": "0.56540066",
"text": "def test_should_update_event_via_API_XML\r\n get \"/logout\"\r\n put \"/events/1.xml\", :event => {:name => 'Test API Event 1',\r\n :start_time => Time.now.to_s(:db),\r\n :end_time => Time.now.to_s(:db),\r\n :user_id => 1,\r\n :description => 'Test API Event 1 Desc',\r\n :event_type => 'API Type',\r\n :location => 'Testville, USA',\r\n :street => 'Testers Rd.',\r\n :city => 'TestTown',\r\n :website => 'http://www.test.com',\r\n :phone => '555-555-5555',\r\n :organized_by => 'API Testers of America'}\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "2f43d79cb8ce757f5e82d8476fd01962",
"score": "0.5610301",
"text": "def test_should_update_topic_via_API_XML\r\n get \"/logout\"\r\n put \"/forum_topics/1.xml\", :forum_topic => {:title=>'Updated API Test Topic',\r\n :description=>'Updated Test topic desc',\r\n :user_id=>1}\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "7469649e52b7e5dac7975165e4b3ca58",
"score": "0.5609218",
"text": "def update\n @usecase = Usecase.find(params[:id])\n\n respond_to do |format|\n if @usecase.update_attributes(params[:usecase])\n format.html { redirect_to(@usecase, :notice => 'Usecase was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usecase.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea9da4416a141658954ffb2340917f14",
"score": "0.5562721",
"text": "def update\n respond_to do |format|\n if @testcase.update_attributes(params[:testcase])\n flash[:notice] = 'Testcase was successfully updated.'\n format.html { redirect_to(@testcase) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @testcase.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5838277fef97eda539bab771d99646b",
"score": "0.55393094",
"text": "def update\n @test_case = TestCase.find(params[:id])\n\n respond_to do |format|\n if @test_case.update_attributes(params[:test_case])\n format.html { redirect_to @test_case, notice: 'Test case 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",
"title": ""
},
{
"docid": "c5838277fef97eda539bab771d99646b",
"score": "0.55393094",
"text": "def update\n @test_case = TestCase.find(params[:id])\n\n respond_to do |format|\n if @test_case.update_attributes(params[:test_case])\n format.html { redirect_to @test_case, notice: 'Test case 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",
"title": ""
},
{
"docid": "64eefd19cd12d42a3010295b0292609f",
"score": "0.55268836",
"text": "def update\n @case = Case.find(params[:id])\n respond_to do |format|\n if @case.update_attributes(params[:case])\n flash[:notice] = 'Case was successfully updated.'\n format.html { redirect_to(@case) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @case.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1bef1e3b2d0d8a4a279e2b78f7819db",
"score": "0.55118424",
"text": "def update\n @test_case = TestCase.find(params[:id])\n @test_case.problems.each do |problem|\n permitted_to! :update, problem\n end\n\n respond_to do |format|\n if @test_case.update_attributes(permitted_params)\n format.html { redirect_to(@test_case, :notice => 'Test case was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @test_case.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cecaa53079d6ce6f8c4a1d54e8d3f69c",
"score": "0.55054265",
"text": "def update_tomcat_usersxml strFile\n\n\tFile.open(strFile) do |tomcatusersfile|\n\t\tusersxml = REXML::Document.new(tomcatusersfile)\n\t\t#update the server port number \n\t\ttomcat_users_root = usersxml.elements['tomcat-users']\n\t\ttomcat_users_root.add_element(get_tomcat_admin_role())\n\t\ttomcat_users_root.add_element(get_tomcat_admin_user())\n\t\tfusersxml = File.open(\"#{dspace_tomcatusers_xml}\", \"w\")\n\t\tfusersxml.puts usersxml\n\t\tusersXmlPath = fusersxml.path\n\t\tfusersxml.close\n\t\tend\nend",
"title": ""
},
{
"docid": "a48b3229e830876ae619b936301400b2",
"score": "0.55047816",
"text": "def put(url, xml, version = nil)\n req = Net::HTTP::Put.new(url)\n req.content_type = 'application/x-ssds+xml'\n \n if(!version.nil?)\n req['if-match'] = version;\n end\n \n req.content_length = xml.to_s.size.to_s\n req.basic_auth @username, @password\n req.body = xml.to_s\n execute_request(req)\n end",
"title": ""
},
{
"docid": "376770d4daf61e7c7c7d4873be1c38b4",
"score": "0.5502389",
"text": "def test_should_update_status_post_via_API_JSON\r\n get \"/logout\"\r\n put \"/status_posts/1.json\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "e257bc14253874a0b521eccbbe2e3b76",
"score": "0.5490514",
"text": "def setuserincident\n @uid = params[:user]\n @iid = params[:incident]\n\n @u = User.find(@uid)\n @u.incident = @iid\n @u.save\n end",
"title": ""
},
{
"docid": "f6018bfebe02fd19d8e4c850bb2ef58f",
"score": "0.5488848",
"text": "def test_changeset_update_invalid\n basic_authorization create(:user).email, \"test\"\n\n changeset = create(:changeset)\n new_changeset = changeset.to_xml\n new_tag = XML::Node.new \"tag\"\n new_tag[\"k\"] = \"testing\"\n new_tag[\"v\"] = \"testing\"\n new_changeset.find(\"//osm/changeset\").first << new_tag\n\n content new_changeset\n put :update, :params => { :id => changeset.id }\n assert_response :conflict\n end",
"title": ""
},
{
"docid": "e21928252bee02d91ea17377f0eaca4f",
"score": "0.54836875",
"text": "def update\n @caseinventor = Caseinventor.find(params[:id])\n\n respond_to do |format|\n if @caseinventor.update_attributes(params[:caseinventor])\n flash[:notice] = 'Caseinventor was successfully updated.'\n format.html { redirect_to(@caseinventor) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @caseinventor.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "07918d5a67562e424f50e841ebcd6a84",
"score": "0.5477754",
"text": "def put(path , params = {})\n request(:put , path , params)\n end",
"title": ""
},
{
"docid": "90efe7b8165fdf88fd9c57cff92d86a1",
"score": "0.54644394",
"text": "def update_test_case(test_case_file, id, value)\n\n index = @@valid_id_array.index(id)\n\n case index\n when nil then puts \"Invalid update statement: #{id} is not a valid test case field.\"; exit;\n when 15 then cdata = true\n when 19 then cdata = true\n when 27..31 then cdata = true\n else cdata = false\n end\n\n if cdata == true and value != nil\n if File.exists?(value)\n temp = ''\n File.open(value) do |file|\n file.each do |line|\n temp += line.chomp\n end\n end\n value = REXML::CData.new(temp)\n else\n value = REXML::CData.new(value)\n end\n end\n\n\n if File.exists?(test_case_file)\n File.open(test_case_file) do |config_file|\n # Open the document and edit the value associated with id\n config = REXML::Document.new(config_file)\n config.root.elements[id].text = value\n\n # Write the result to a new file.\n formatter = REXML::Formatters::Default.new\n File.open(test_case_file, 'w') do |result|\n formatter.write(config, result)\n end\n end\n else\n puts \"Invalid file name: \\\"#{test_case_file}\\\" is not a valid test case file.\"\n exit\n end\n end",
"title": ""
},
{
"docid": "c99238efa98a6e05678c5d303dd5515d",
"score": "0.5460636",
"text": "def update_ticket(ticket_num)\n \n url = ['/tickets/',ticket_num,'.xml'].join\n result = @connection.put url, \n (\n xml = Builder::XmlMarkup.new( :indent => 2 )\n xml.instruct! :xml, :encoding => \"UTF-8\"\n xml.ticket do |t|\n t.tag! \"solved-at\", Time.now\n t.tag! \"status-id\", \"3\"\n end\n )\n end",
"title": ""
},
{
"docid": "477e746764ba30bd3ca8a6f87597bd7d",
"score": "0.5453947",
"text": "def update\n @user_observation = UserObservation.find(params[:id])\n\n respond_to do |format|\n if @user_observation.update_attributes(params[:user_observation])\n flash[:notice] = 'UserObservation was successfully updated.'\n format.html { redirect_to(@user_observation) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_observation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e55a6ecb4c00b7fe18a670cc021207",
"score": "0.54259384",
"text": "def put_entry(id,summary)\n xml = <<DATA\n <entry xmlns=\"http://purl.org/atom/ns#\">\n <summary type=\"text/plain\"></summary>\n </entry>\nDATA\n\n doc = REXML::Document.new(xml)\n doc.elements['/entry/summary'].add_text(summary)\n\n # REXML -> String\n data=String.new\n doc.write(data)\n\n #make request\n path=\"/atom/edit/#{id}\"\n req=Net::HTTP::Put.new(path)\n req['Accept']= 'application/x.atom+xml,application/xml,text/xml,*/*',\n req['X-WSSE']= @credential_string\n\n #YHAAAA!!!\n res = @http.request(req,data)\n return res\n end",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.5397091",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "8c1cf41ae3a0e0832108fa291a6e79c8",
"score": "0.5392235",
"text": "def test_should_update_group_via_API_XML\r\n get \"/logout\"\r\n put \"/groups/1.xml\", :group => { :name=>'renamed unit test group',\r\n :description=>'my new desc',\r\n :featured=>false }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "f190cc14e9e48cb5ce4866a7552775bb",
"score": "0.538839",
"text": "def update_rest\n @dialogix_user = DialogixUser.find(params[:id])\n\n respond_to do |format|\n if @dialogix_user.update_attributes(params[:dialogix_user])\n flash[:notice] = 'DialogixUser was successfully updated.'\n format.html { redirect_to(@dialogix_user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @dialogix_user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e32933bc97afc5569728dcbcf48fbb4c",
"score": "0.53861356",
"text": "def update\n @user_request_detail = UserRequestDetail.find(params[:id])\n\n respond_to do |format|\n if @user_request_detail.update_attributes(params[:user_request_detail])\n format.html { redirect_to(@user_request_detail, :notice => 'User request detail was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_request_detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a0b1d9bf0501cdc9aa6ad1cb2bc87d1e",
"score": "0.53559864",
"text": "def update\n @use_case = UseCase.find(params[:id])\n\n respond_to do |format|\n if @use_case.update_attributes(params[:use_case])\n format.html { redirect_to @use_case, notice: 'Use case was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @use_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c53fb1683e67d799e0de1fbf148f44ac",
"score": "0.53457284",
"text": "def update\n @cup = Cup.find(params[:id])\n\n respond_to do |format|\n if @cup.update_attributes(params[:cup])\n format.html { redirect_to(@cup, :notice => 'Cup was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "265a77e52b89de977516c60be16148aa",
"score": "0.53434545",
"text": "def update\n @urinetest = Urinetest.find(params[:id])\n\n respond_to do |format|\n if @urinetest.update_attributes(params[:urinetest])\n format.html { redirect_to(@urinetest, :notice => 'Urinetest was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @urinetest.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "18ab900b035bae7ae05e4049ad5bed83",
"score": "0.53427136",
"text": "def test_should_update_friendship\n login_as(:jane)\n put :update, :user_id => users(:jane).id, :id => 1, :friendship => { }\n\n assert_response :success\n end",
"title": ""
},
{
"docid": "7f0db5cb57890bf5f6efbcfa38d8cfd7",
"score": "0.5313744",
"text": "def update\n @courtstation = Courtstation.find(params[:courtstation_id])\n @casefile = @courtstation.casefiles.find(params[:id])\n\n respond_to do |format|\n if @casefile.update_attributes(params[:casefile])\n format.html { redirect_to([@casefile.courtstation, @casefile], :notice => 'Casefile was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @casefile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.52994794",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "c7d3cd0f218c42e01dbd0246ab7b00c9",
"score": "0.52964723",
"text": "def put(path, params={}); make_request(:put, host, port, path, params); end",
"title": ""
},
{
"docid": "d0fba1bf3c5e1dc0008c27994e1dabe4",
"score": "0.5292923",
"text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "713161fe04801b44f5b9cdb91a95fe89",
"score": "0.52900285",
"text": "def test_put\n request = Http::Request.new('PUT', '/file2', {}, 'hello')\n\n response = self.request(request)\n\n assert_equal(201, response.status, \"Incorrect status code received. Full response body: #{response.body_as_string}\")\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "6054ac3d551a78c6578056ee27a88872",
"score": "0.5288185",
"text": "def update\n @user = User.find(params[:user_id])\n @tickit = @user.tickits.find(params[:id])\n @tickit.updated_at = DateTime.now\n respond_to do |format|\n if @tickit.update_attributes(params[:tickit])\n format.html { redirect_to(@user, :notice => 'Tickit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tickit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1dc526dddfc457ae22773ddd016f3d72",
"score": "0.52847445",
"text": "def destroy\n @usercase = Usercase.find(params[:id])\n @usercase.destroy\n\n respond_to do |format|\n format.html { redirect_to(usercases_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "34ef2c7d49b3ca40b560fe049cc0ab50",
"score": "0.5283627",
"text": "def update\n @incident = Incident.find(params[:id])\n\n respond_to do |format|\n if @incident.update_attributes(params[:incident])\n flash[:notice] = 'Incident was successfully updated.'\n format.html { redirect_to(@incident) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @incident.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fd8842ed08fa1572950f3e78514aecf",
"score": "0.5277428",
"text": "def do_PUT(req, res)\n domain, resource, id, format = parse_request_path(req.path_info)\n attributes = from_xml(resource, req.body)\n attributes['updated-at'] = Time.now.iso8601\n logger.debug \"Updating item with attributes: #{attributes.inspect}\"\n sdb_put_item(domain, attributes, true)\n raise WEBrick::HTTPStatus::OK\n end",
"title": ""
},
{
"docid": "2a4eeb5aa29149bda7002f5a6b8c5bee",
"score": "0.5276235",
"text": "def update\n @user_unit = UserUnit.find(params[:id])\n\n respond_to do |format|\n if @user_unit.update_attributes(params[:user_unit])\n flash[:notice] = 'UserUnit was successfully updated.'\n format.xml { head :ok }\n else\n format.xml { render :xml => @user_unit.errors, :status => :unprocessable_entity }\n end\n format.html { redirect_to(units_path) }\n end\n end",
"title": ""
},
{
"docid": "83b968cf65f130a5831aca5d2e9ca83d",
"score": "0.52716404",
"text": "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: 'Testcase 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",
"title": ""
},
{
"docid": "83b968cf65f130a5831aca5d2e9ca83d",
"score": "0.52716404",
"text": "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: 'Testcase 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",
"title": ""
},
{
"docid": "83b968cf65f130a5831aca5d2e9ca83d",
"score": "0.52716404",
"text": "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: 'Testcase 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",
"title": ""
},
{
"docid": "2db8510634a8588feaf130b0ace4c384",
"score": "0.5270329",
"text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :api_key => 'testapikey',\r\n :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "370064dd3d95624c67f6e97eff580b94",
"score": "0.5269223",
"text": "def update\n\n prefix = params[:kase][:case_no_prefix]\n while prefix.size < 3 do prefix = '0' + prefix end\n suffix = params[:kase][:case_no]\n params[:kase][:case_no] = prefix + '-' + suffix\n @kase = Kase.find(params[:id])\n\n respond_to do |format|\n if @kase.update_attributes(params[:kase])\n save_case_note(@kase,params[:note])\n format.html { redirect_to(@kase, :notice => 'Case was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @kase.errors, :status => :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a",
"score": "0.52646166",
"text": "def put(*args)\n request :put, *args\n end",
"title": ""
},
{
"docid": "545dadbe32aa3d9d0edf1d22293783fc",
"score": "0.52591795",
"text": "def test_put_existing\n request = Http::Request.new('PUT', '/file1', {}, 'bar')\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'bar',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('bar')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "cde23f786db700c68e983940dcc66986",
"score": "0.52531",
"text": "def update\n \t@incident = @case.incident\n\n respond_to do |format|\n if @incident.update(incident_params)\n format.html { redirect_to [@case, @incident], notice: 'incident was successfully updated.' }\n format.json { render :show, status: :ok, location: @incident }\n else\n format.html { render :edit }\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ee5e29ef62a6e95122a8f5d94e1d50d",
"score": "0.5247307",
"text": "def put(path, params = {})\n request :put, path, params\n end",
"title": ""
},
{
"docid": "f859a0a8591bfbfc7840124a596af648",
"score": "0.5246142",
"text": "def update\n @casefile = Casefile.find(params[:id])\n\n respond_to do |format|\n if @casefile.update_attributes(params[:casefile])\n format.html { redirect_to @casefile, notice: 'Casefile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @casefile.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "230f5300bc9edefbb627a05f03b47fc6",
"score": "0.5241937",
"text": "def update\n @case = Case.find(params[:id])\n\n respond_to do |format|\n if @case.update_attributes(geniverse_case_params)\n flash[:notice] = 'Case was successfully updated.'\n format.html { redirect_to(@case) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @case.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d93b06de1694cb59c3feaa5b30a0d2b",
"score": "0.52382785",
"text": "def update\n @county = County.find(params[:id])\n\n respond_to do |format|\n if @county.update_attributes(params[:county])\n format.html { redirect_to(@county, :notice => 'County was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @county.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2486f06e6a88cac8658c848cdb04e2d6",
"score": "0.5234718",
"text": "def update\n @tc = TestCase.find(params[:id])\n\n respond_to do |format|\n if @tc.update_attributes(params[:test_case])\n format.html { redirect_to(project_test_case_path(@tc.project, @tc)) }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @tc.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf23e1fb22c3d726766064eab1eff987",
"score": "0.5234367",
"text": "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) }\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",
"title": ""
},
{
"docid": "c4bc87a23c91c4c9ded636aaf5480c59",
"score": "0.5225474",
"text": "def update\n @document_use_case = DocumentUseCase.find(params[:id])\n\n respond_to do |format|\n if @document_use_case.update_attributes(params[:document_use_case])\n format.html { redirect_to @document_use_case, notice: 'Document use case was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document_use_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc765fe3005e457a8114626046850d41",
"score": "0.52240604",
"text": "def test_api_update_tags\n tracetag = create(:tracetag)\n trace = tracetag.trace\n basic_authorization trace.user.display_name, \"test\"\n\n content trace.to_xml\n put :api_update, :params => { :id => trace.id }\n assert_response :success\n\n updated = Trace.find(trace.id)\n # Ensure there's only one tag in the database after updating\n assert_equal Tracetag.count, 1\n # The new tag object might have a different id, so check the string representation\n assert_equal trace.tagstring, updated.tagstring\n end",
"title": ""
},
{
"docid": "27096800d14893529f640b6cf4566aba",
"score": "0.52175605",
"text": "def update\n connection.put(\"/todo_lists/#{id}.xml\",\n \"<todo-list>\n <name>#{name}</name>\n <description>#{description}</description>\n <milestone_id>#{milestone_id}</milestone_id>\n </todo-list>\",\n XML_REQUEST_HEADERS)\n end",
"title": ""
},
{
"docid": "e1bc0d7197047f7d7baa994dabf594b3",
"score": "0.5217395",
"text": "def update\n @user = current_user\n @routine = Routine.find(params[:id])\n\n respond_to do |format|\n if @routine.update_attributes(params[:routine])\n format.html { redirect_to @routine, notice: 'Routine was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @routine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "392dbba9395a70891f6405950561702a",
"score": "0.52120113",
"text": "def update\n respond_to do |format|\n if @document_user_case_info.update(document_user_case_info_params)\n format.html { redirect_to @document_user_case_info, notice: 'Document user case info was successfully updated.' }\n format.json { render :show, status: :ok, location: @document_user_case_info }\n else\n format.html { render :edit }\n format.json { render json: @document_user_case_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b3a0c435aa8e42199176fc373cfa3fa",
"score": "0.52099764",
"text": "def update\n @case_file = CaseFile.find(params[:id])\n\n respond_to do |format|\n if @case_file.update_attributes(params[:case_file])\n format.html { redirect_to @case_file, notice: 'Case file was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @case_file.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42bf857bd0dff14a902d5682a6687edc",
"score": "0.5207072",
"text": "def update\n respond_to do |format|\n if @case.update(case_params)\n format.html { redirect_to project_test_case_path(@case.test.project, @case.test, @case), notice: 'Case was successfully updated.' }\n format.json { render :show, status: :ok, location: @case }\n else\n format.html { render :edit }\n format.json { render json: @case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d25b59243f9840fa7186ff8fcaea7825",
"score": "0.5199062",
"text": "def update\n @system_case = SystemCase.find(params[:id])\n\n respond_to do |format|\n if @system_case.update_attributes(params[:system_case])\n format.html { redirect_to @system_case, notice: 'System case was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @system_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fad5fcc1906f8e60eaf79a50e9b1651e",
"score": "0.5188682",
"text": "def update\n @user1 = User1.find(params[:id])\n\n respond_to do |format|\n if @user1.update_attributes(params[:user1])\n format.html { redirect_to(@user1, :notice => 'User1 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user1.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "409e8b1856010a623af3006112dfbbdd",
"score": "0.51879364",
"text": "def update\n @userreq = Userreq.find(params[:id])\n\n respond_to do |format|\n if @userreq.update_attributes(params[:userreq])\n format.html { redirect_to @userreq, notice: 'Userreq was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @userreq.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b80f5de64288777c145916c8f3d8ec12",
"score": "0.5187159",
"text": "def create\n @usercase = Usercase.new(params[:usercase])\n\n respond_to do |format|\n if @usercase.save\n flash[:notice] = 'Usercase was successfully created.'\n format.html { redirect_to(@usercase) }\n format.xml { render :xml => @usercase, :status => :created, :location => @usercase }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @usercase.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6eaddde60ad0ad290c11346400ad414",
"score": "0.5186846",
"text": "def put\n request = Net::HTTP::Put.new(endpoint_uri.request_uri)\n request.basic_auth Unfuzzle.username, Unfuzzle.password\n request.content_type = 'application/xml'\n \n Response.new(client.request(request, @payload))\n end",
"title": ""
},
{
"docid": "ccf9ed09d600e760d6f263e0380c88ca",
"score": "0.51804",
"text": "def update\n update_resource(@user)\n end",
"title": ""
},
{
"docid": "ccf9ed09d600e760d6f263e0380c88ca",
"score": "0.51804",
"text": "def update\n update_resource(@user)\n end",
"title": ""
},
{
"docid": "5af508c488e9b4f7c4e7a2b3d08b7513",
"score": "0.5179944",
"text": "def update\n @it_case = ItCase.find(params[:id])\n\n respond_to do |format|\n if @it_case.update_attributes(params[:it_case])\n format.html { redirect_to mycases_path, notice: '工单已成功更新' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @it_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "03c87bf0bff6302e8f6b741e226ec9c9",
"score": "0.5173687",
"text": "def put_vm(xmlfile)\n xml=File.read(xmlfile)\n vm_info=REXML::Document.new(xml).root.elements\n\n url = URI.parse(@endpoint+'/compute/' + vm_info['ID'].text)\n\n req = Net::HTTP::Put.new(url.path)\n req.body = xml\n\n req.basic_auth @occiauth[0], @occiauth[1]\n\n res = CloudClient::http_start(url) do |http|\n http.request(req)\n end\n\n if CloudClient::is_error?(res)\n return res\n else\n return res.body\n end\n end",
"title": ""
},
{
"docid": "1e90613cd539424b5c7d01b56eb6e9d5",
"score": "0.51713866",
"text": "def update\n @api.update_case( :case_id => @id, :title => @title )\n end",
"title": ""
},
{
"docid": "09546a16d8bce4e17718dba0e81f6643",
"score": "0.5168596",
"text": "def update\n respond_to do |format|\n if @test_case.update(test_case_params)\n format.html { redirect_to @test_case, notice: 'Test case was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_case }\n else\n format.html { render :edit }\n format.json { render json: @test_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c1f94a98d45a753bf54d25d901a3758",
"score": "0.5160855",
"text": "def update\n @ct = current_user.cts.find(params[:id])\n\n respond_to do |format|\n if @ct.update_attributes(params[:ct])\n format.html { redirect_to @ct, notice: 'Ct was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ct.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c6b1a9c91510d3f8bcb362717d67034",
"score": "0.51607597",
"text": "def update\n @contract_user = ContractUser.find(params[:id])\n\n respond_to do |format|\n if @contract_user.update_attributes(params[:contract_user])\n format.html { redirect_to(@contract_user, :notice => 'ContractUser was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @contract_user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819d0dfba3b6bb1113f735e69906dec7",
"score": "0.51604193",
"text": "def update\n @uprofile = current_user.uprofile\n\n respond_to do |format|\n if @uprofile.update_attributes(params[:uprofile])\n flash[:notice] = 'Uprofile was successfully updated.'\n format.html { redirect_to(edit_uprofile_path(@uprofile)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @uprofile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d61a25d69ed10b03601d4f17ba7d9ef3",
"score": "0.5157685",
"text": "def update\n #RAILS_DEFAULT_LOGGER.debug(\"******** REST Call to CRMS: Updating #{self.class.name}:#{self.id}\")\n #RAILS_DEFAULT_LOGGER.debug(caller[0..5].join(\"\\n\")) \n response = connection.put(element_path(prefix_options), to_xml, self.class.headers)\n save_nested\n load_attributes_from_response(response)\n merge_saved_nested_resources_into_attributes\n response\n end",
"title": ""
},
{
"docid": "5e7f56eb1e62b28a791b8dded85ac5c5",
"score": "0.51557505",
"text": "def update_rest\n @v1_item_usage = V1ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @v1_item_usage.update_attributes(params[:v1_item_usage])\n flash[:notice] = 'V1ItemUsage was successfully updated.'\n format.html { redirect_to(@v1_item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @v1_item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb6c28c2a0719adcbab815e458a86a92",
"score": "0.51504636",
"text": "def update\n @identity = Identity.where(:user_id => current_user.id, :id => params[:id]).first\n\n respond_to do |format|\n if @identity.update_attributes(params[:identity])\n format.html { redirect_to(@identity, :notice => 'Identity was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @identity.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a5bf1bba5f44f6d2ce52e2e05b6fb42",
"score": "0.5142659",
"text": "def update\n @testcase_bug_xref = TestcaseBugXref.find(params[:id])\n\n respond_to do |format|\n if @testcase_bug_xref.update_attributes(params[:testcase_bug_xref])\n format.html { redirect_to(@testcase_bug_xref, :notice => 'Testcase bug xref was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @testcase_bug_xref.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d849c2bc448d5ce0df573d1ab918e8f7",
"score": "0.5138521",
"text": "def put(url, options={}, header={})\n body = options[:body]\n access_token.put(url, body, {'Content-Type' => 'application/xml' })\n end",
"title": ""
},
{
"docid": "a2186dc09083a3f962707df06bc974ea",
"score": "0.5131053",
"text": "def update\n @case = Case.find(params[:id])\n\n respond_to do |format|\n if @case.update_attributes(params[:case])\n format.html { redirect_to @case, notice: 'Case was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9cedd7a375ecd3536465962746a08fb",
"score": "0.51253414",
"text": "def update\n respond_to do |format|\n if @user_intake.update(user_intake_params)\n format.html { redirect_to @user_intake, notice: 'User intake was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_intake }\n else\n format.html { render :edit }\n format.json { render json: @user_intake.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c310b2913e0b84e5642012b8d44dc9b8",
"score": "0.5125132",
"text": "def update\n @devex_user = DevexUser.find(params[:id])\n respond_to do |format|\n if @devex_user.update_attributes(params[:devex_user])\n @devex_user.transactions.uploadable.each do |transaction|\n transaction.upload_to_quickbooks\n end\n format.html { redirect_to(mappings_path, :notice => 'Devex user was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @devex_user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76947a495f8371e8e772fdb40663d3b8",
"score": "0.5124024",
"text": "def update_report_template(args = {}) \n put(\"/reports.json/template/#{args[:templateId]}\", args)\nend",
"title": ""
},
{
"docid": "a8cd61e35d000d1ebb39b72b1215c126",
"score": "0.5121477",
"text": "def update\n @case_rec = CaseRec.find(params[:id])\n\n respond_to do |format|\n if @case_rec.update_attributes(params[:case_rec])\n flash[:notice] = 'CaseRec was successfully updated.'\n format.html { redirect_to(@case_rec) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @case_rec.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2f3f0c53e25118c37409f6c58477db9",
"score": "0.51213884",
"text": "def update\n @user_track_xref = UserTrackXref.find(params[:id])\n\n respond_to do |format|\n if @user_track_xref.update_attributes(params[:user_track_xref])\n format.html { redirect_to(@user_track_xref, :notice => 'User track xref was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_track_xref.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0e35bb47ec0f1e27d091980aa2db21b",
"score": "0.51185",
"text": "def put(path, params = {})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "e0e35bb47ec0f1e27d091980aa2db21b",
"score": "0.51185",
"text": "def put(path, params = {})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "e0e35bb47ec0f1e27d091980aa2db21b",
"score": "0.51185",
"text": "def put(path, params = {})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "e0e35bb47ec0f1e27d091980aa2db21b",
"score": "0.51185",
"text": "def put(path, params = {})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "e0e35bb47ec0f1e27d091980aa2db21b",
"score": "0.51185",
"text": "def put(path, params = {})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "fbb7aac732b68fad6741c396de45cf0b",
"score": "0.51183736",
"text": "def update\n @test_obj = TestObj.find(params[:id])\n\n respond_to do |format|\n if @test_obj.update_attributes(params[:test_obj])\n format.html { redirect_to(@test_obj, :notice => 'Test obj was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @test_obj.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c77c61632e7a5655fa8215c4d35a24f0",
"score": "0.511543",
"text": "def update\n @user = User.find_by_name(params[:id])\n @user.update_attributes(params[:user])\n \n respond_with @user, :stautus => :ok\n end",
"title": ""
}
] |
877c325f5b9a4bd6bd172e0c6a7f4272
|
Convert the any or all status to && or ||, for the search query.
|
[
{
"docid": "0907934738949c39af529bb64ea4cc0b",
"score": "0.609596",
"text": "def operation_as_join\n @operation == :all && ' && ' || ' || '\n end",
"title": ""
}
] |
[
{
"docid": "be0dcff61f037df1b9048057fb0a0d03",
"score": "0.619144",
"text": "def status_condition\n value = '|'\n value << 'p' if statuses.include?('prospect')\n value << 's' if statuses.include?('student')\n value << 'f' if statuses.include?('former_student')\n value << '|'\n value\n end",
"title": ""
},
{
"docid": "65c18e029d978ce06ba4bbfbaaa3036d",
"score": "0.58738536",
"text": "def and2or_\n Filterable.and2or_(all)\n #self.where(self.filter(filtering_params).where_values.reduce(:or))\n #hash params always arel\n end",
"title": ""
},
{
"docid": "14dbc0d64fdbc60c651b8eb236dcdd01",
"score": "0.5763222",
"text": "def status_params\n Report.statuses.include?(params[:filter]) ? params[:filter] : 'all'\n end",
"title": ""
},
{
"docid": "23a9ab72f2d470163713b8aa8e308807",
"score": "0.5721007",
"text": "def combine_search_terms(* args)\n args.flatten!\n separate = args.last == true || args.last == false ? args.pop : false\n args = args.map { |term| term.to_s.strip }.reject(& :blank?).compact\n args.map! { |term| '(%s)' % term } if separate\n args.join(' AND ')\n end",
"title": ""
},
{
"docid": "6f59ec93a043430194130be9fc1b9d83",
"score": "0.5676841",
"text": "def append_status_filter_if_required(the_login, current_lucene_query)\n result = current_lucene_query\n if !ControllerRestrictionHelper.has_permission_to_search_non_public_tap?(the_login)\n result << \" AND status_for_solr_t: #{Status::PUBLISHED.status_id}\"\n end\n result\n end",
"title": ""
},
{
"docid": "6e3b21dc9c6b96370231e29e5c0c924a",
"score": "0.5645634",
"text": "def simple_query(query,status,order)\n\t\t\tquery[:bool][:should] << {\n\t\t\t\tbool: {\n\t\t\t\t\tmust: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trange: {\n\t\t\t\t\t\t\t\tnumber: {\n\t\t\t\t\t\t\t\t\tlte: status.to,\n\t\t\t\t\t\t\t\t\tgte: status.from\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnested: {\n\t\t\t\t\t\t\t\tpath: \"employees\",\n\t\t\t\t\t\t\t\tquery: {\n\t\t\t\t\t\t\t\t\tbool: {\n\t\t\t\t\t\t\t\t\t\tmust: [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tterm: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"employees.status_ids\".to_sym => status.id.to_s\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "a79ba33c967bb305e3fca1b5a4a990c7",
"score": "0.5616018",
"text": "def downcase_query(value)\n # rubocop:disable Style/MultilineBlockChain\n if value.is_a?(String)\n value.split(/\\bAND\\b/).map do |a|\n a.split(/\\bOR\\b/).map do |o|\n o.split(/\\bNOT\\b/).map do |n|\n n.split(/\\bTO\\b/).map(&:downcase).join('TO')\n end.join('NOT')\n end.join('OR')\n end.join('AND').gsub(SOLR_DATE_REGEX) { Regexp.last_match[1].upcase }\n else\n value\n end\n # rubocop:enable Style/MultilineBlockChain\n end",
"title": ""
},
{
"docid": "17ef82f5e4e6454d3d994e6516ebca46",
"score": "0.5563027",
"text": "def adv_search_conditions(filters)\n conditions = \"\"\n unless filters.nil? || filters.empty?\n filters_data = ActiveSupport::JSON.decode(filters)\n\t groupOp = filters_data[\"groupOp\"]\n\t filters_data[\"rules\"].each do |search_row|\n data = \"#{search_row[\"data\"]}\"\n\t operator = case search_row[\"op\"]\n when \"eq\" then \" = \"\n when \"ne\" then \" <> \"\n when \"lt\" then \" < \"\n when \"le\" then \" <= \"\n when \"gt\" then \" > \"\n when \"ge\" then \" >= \"\n end\n conditions << \"#{search_row[\"field\"]}#{operator}#{data} AND \"\n end\n end\n conditions.chomp(\"AND \")\n end",
"title": ""
},
{
"docid": "80a82f77f037a1cf6a33979f1b41de4b",
"score": "0.5544723",
"text": "def escape_boolean_operators(query)\n return nil unless query\n substitutions_hash = {'&&' => '\\\\&\\\\&', '||' => '\\\\|\\\\|', '!' => '\\\\!', 'AND' => 'and', 'NOT' => 'not', 'OR' => 'or'}\n new_query = query.gsub(BOOLEAN_OPERATORS_REGEXP) do |match| \n substitutions_hash[match]\n end\n end",
"title": ""
},
{
"docid": "128d08dc06bfc3ebd3b693c11e6d4af3",
"score": "0.55136645",
"text": "def search_process\n search_text=params[:q].to_s\n all=params[:all].to_s\n exact=params[:exact].to_s\n any=params[:any].to_s\n none=params[:none].to_s\n advanced_query=\"\"\n\n if all != \"\"\n all=all.split(' ')\n all_like=all.map {|x| \"keyword like \" + \"'%\" + x + \"%'\" }\n all_like=all_like.join(' and ')\n advanced_query=all_like\n end\n\n if exact != \"\" && all != \"\"\n exact=\"'%\"+exact+\"%'\"\n advanced_query = advanced_query + \" and keyword like \" + exact\n end\n\n if exact != \"\" && all == \"\"\n exact=\"'%\"+exact+\"%'\"\n advanced_query = \"keyword like \" + exact\n end\n\n if any != \"\" and ( all != \"\" or exact != \"\" )\n any=any.split(' ')\n any_like=any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\n any_like=any_like.join(' or ')\n advanced_query = advanced_query + \" and (\" + any_like + \")\"\n end\n\n if any != \"\" and all == \"\" and exact == \"\"\n any=any.split(' ')\n any_like=any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\n any_like=any_like.join(' or ')\n advanced_query = \"(\" + any_like + \")\"\n end\n\n if none != \"\" and (all != \"\" or exact != \"\" or any != \"\")\n none=none.split(' ')\n none_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\n\n none_not_like=none_not_like.join(' and ')\n\n advanced_query=advanced_query + \" and \" + none_not_like\n\n end\n\n if none != \"\" and all == \"\" and exact == \"\" and any == \"\"\n none=none.split(' ')\n none_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\n\n none_not_like=none_not_like.join(' and ')\n\n advanced_query= none_not_like\n end\n\n\n\n\n\n advanced_query = \"SELECT Model_ID FROM keyword_symbol_tables WHERE \"+advanced_query\n puts \"\\n\\n***********************************\\n\\n\"+advanced_query+\"\\n\\n**********************\\n\\n\"\n\n parameter_search_text=search_text.split.join(\" \")\n keyword_array=parameter_search_text.split(' ')\n keyword_count=keyword_array.size\n\n connection = ActiveRecord::Base.connection();\n if all != \"\" or exact != \"\" or any != \"\" or none != \"\"\n @resultset = connection.execute(\"#{advanced_query}\");\n else\n @resultset = connection.execute(\"call keyword_search('#{parameter_search_text}',#{keyword_count})\");\n end\n ActiveRecord::Base.clear_active_connections!()\n\n @resultset.each do |res|\n puts res\n end\n @resultset_strings = @resultset.map { |result| result.to_s.gsub(/[^0-9A-Za-z]/, '')}\n @model_ids=Array.new\n @model_names=Array.new\n @model_types=Array.new\n @resultset_strings.each do |result|\n substring=result[0..4]\n puts\"\\n\\n************\"+substring\n if substring == \"NMLCL\"\n cell=Cell.find_by_Cell_ID(result.to_s)\n name=cell.Cell_Name\n type=\"Cell\"\n end\n\n if substring == \"NMLCH\"\n channel=Channel.find_by_Channel_ID(result.to_s)\n name=channel.Channel_Name\n type=\"Channel\"\n end\n\n\n if substring == \"NMLNT\"\n network=Network.find_by_Network_ID(result.to_s)\n name=network.Network_Name\n type=\"Network\"\n end\n\n#if substring == \"NMLSY\"\n#name=Synapse.find_by_Synapse_ID(result.to_s)\n#type=\"Syanpse\"\n#end\n\n @model_ids.push(result)\n @model_names.push(name)\n @model_types.push(type)\n puts \"result-\"+result+\"name-\"+name.to_s\n end\n\n if @model_ids.count != 0\n render :partial => 'keyword_results_list',:locals => {:model_ids => @model_ids,:model_names => @model_names,:model_types => @model_types}\n else\n render :partial => 'no_results'\n end\n\n\n end",
"title": ""
},
{
"docid": "05bc1705f6947fdf8da9ed7fe993e33f",
"score": "0.54713184",
"text": "def select_active_api_statuses(status)\n return false unless status\n\n %w[pending_customer_approval pending_submission submitted active].include?(status.downcase)\n end",
"title": ""
},
{
"docid": "a9434893a56de9f92a43ff6bb2f1905a",
"score": "0.5443124",
"text": "def prepare_search_conditions(is_location)\n cond_params = Array.new\n cond = Array.new\n\n #This prepares filtering conditions for States, Counties, Cities and zips\n @@PARAM_KEYS.each do |r|\n unless (@search_params[r].nil?)\n cond_tmp = \"(\"\n @search_params[r].each do |elem|\n cond_tmp << \"#{@@JOIN_TABLES[r]['col']} = ?\"\n cond_params << elem\n cond_tmp << \" OR \" unless elem == @search_params[r].last\n end\n cond_tmp << \")\"\n cond << cond_tmp\n end\n end\n #we use is_location as flag to switch between agencies\n # with category != State/Local Plans and category == State/Local Plans\n cond << (is_location ? ' a.agency_category_id != ? ' : ' a.agency_category_id = ? ')\n cond_params << AgencyCategory[:'State/Local Plans'].id\n cond << prepare_active_condition if is_active?# || has_any_conditions?\n\n cond << prepare_counseling_condition if has_counseling_condition?\n if (has_category_condition?)\n sql_q, sql_p = prepare_category_condition\n cond << sql_q\n cond_params << sql_p\n end\n\n #use only active locations, or plans\n cond << (is_location ? ' l.is_active = 1 ' : ' l.is_active=1 and p.is_active = 1 ')\n\n #selected locations must fullfil all conditions from filter\n return [cond.join(' AND '), cond_params]\n end",
"title": ""
},
{
"docid": "d766f9733b9cbadaa6254e57c702da58",
"score": "0.5433555",
"text": "def search_state\n return query if state.member?(\"all\")\n\n open_drafts = state.member?(\"open\") ? query.open : nil\n withdrawn = state.member?(\"withdrawn\") ? query.withdrawn : nil\n published = state.member?(\"published\") ? query.published : nil\n\n query\n .where(id: open_drafts)\n .or(query.where(id: withdrawn))\n .or(query.where(id: published))\n end",
"title": ""
},
{
"docid": "e3f8a101ed210340e8ff3f43fc6aae26",
"score": "0.54303885",
"text": "def boolean_search(attr,params,act_relation,t_type)\n val = params[attr[:param_name]].match(/(true|t|yes|y|1)$/i) != nil ? 1 : 0\n act_relation = act_relation.where([\"CAST(#{t_type.constantize.table_name}.#{attr[:attr]} AS CHAR) = ?\",val.to_s])\n end",
"title": ""
},
{
"docid": "0eb7677c9dae7833b51dee60f6094523",
"score": "0.54000676",
"text": "def build_multi_selection_condition(all_values)\n # We do pure SQL OR, since Arel is nesting every .or into another parentheses, otherwise this would be just\n # all_values.inject(:or)\n all_values.map { |value| \"(#{value.to_sql})\" }.join(\" OR \")\n end",
"title": ""
},
{
"docid": "6dc7a200be51553dda3ae16a270bfcbb",
"score": "0.53937835",
"text": "def boolean_search(attr,params,act_relation,t_type)\n val = params[attr].match(/(true|t|yes|y|1)$/i) != nil ? 1 : 0\n act_relation = act_relation.where([\"CAST(#{t_type.constantize.table_name}.#{attr} AS CHAR) = ?\",val.to_s])\n end",
"title": ""
},
{
"docid": "e619f476b83e1e5343eef4deecd57f84",
"score": "0.5392958",
"text": "def search_options col, val, status='active'\n if val\n {:sql => {:include => @models}, :conditions => {col.to_sym => val, :status => status}, star: true, page: @page} \n else\n {sql: {include: @models}, conditions: {status: status}, star: true, page: @page} \n end\n end",
"title": ""
},
{
"docid": "249cf751347ac8a0339c72f497fcb382",
"score": "0.5346319",
"text": "def build_search_clause(term, all_advanced)\n return '' unless term.present?\n\n if all_advanced == '1'\n \"(#{add_term_to_clause(BOOLEAN_SEARCH_CLAUSE, advanced_search(term))})\"\n else\n \"(#{add_term_to_clause(SEARCH_CLAUSE, term)})\"\n end\n end",
"title": ""
},
{
"docid": "d47f2a99dd281efb2676bd9ac3d5d745",
"score": "0.5342166",
"text": "def filter\n if params[:status] == 'All' && params[:department] == 'All'\n redirect_to admin_organizations_path\n elsif params[:status] != 'All' && params[:department] == 'All'\n redirect_to admin_organizations_path(status: params[:status])\n elsif params[:status] == 'All' && params[:department] != 'All'\n redirect_to admin_organizations_path(department: params[:department])\n else\n redirect_to admin_organizations_path(status: params[:status], department: params[:department])\n end\n end",
"title": ""
},
{
"docid": "a96682bf6805b6c6c726cda7b07d4f5c",
"score": "0.5328408",
"text": "def any_suggested?\n (self.from_status==PENDING and self.to_status==PENDING) or \\\n (self.from_status==PENDING and self.to_status==ACCEPTED) or \\\n (self.from_status==ACCEPTED and self.to_status==PENDING)\n end",
"title": ""
},
{
"docid": "56d50db61d6bfeead4f37b36228361e5",
"score": "0.5327617",
"text": "def cleanup_boolean_operators(solr_parameters)\n return add_advanced_parse_q_to_solr(solr_parameters) if run_advanced_parse?(solr_parameters)\n solr_parameters[:q] = cleaned_query(solr_parameters[:q])\n return solr_parameters unless using_json_query_dsl(solr_parameters)\n\n solr_parameters.dig('json', 'query', 'bool', 'must').map! do |search_element|\n search_element[:edismax][:query] = cleaned_query(search_element[:edismax][:query])\n search_element\n end\n end",
"title": ""
},
{
"docid": "f6f9b1b61cfed84bb53bdd05a9d1ade5",
"score": "0.53105694",
"text": "def query_join_strict(is_strict)\n is_strict ? 'AND' : 'OR'\n end",
"title": ""
},
{
"docid": "b45d7db2aff0178deaf31e0cd92811d1",
"score": "0.5309283",
"text": "def to_params #:nodoc:\n { :fq => to_boolean_phrase }\n end",
"title": ""
},
{
"docid": "8f0b85f758158fb6b0de748d154457c5",
"score": "0.530907",
"text": "def select_active_statuses(status)\n return false unless status\n\n %w[pending submitted active].include?(status.downcase)\n end",
"title": ""
},
{
"docid": "cc8aac98a5dc59f673cbffc55fa8328a",
"score": "0.5308455",
"text": "def parseLogicalANDExpression() \n expr = parseBitwiseORExpression()\n\n while (match('&&')) \n lex()\n expr = {\n type: Syntax[:LogicalExpression],\n operator: '&&',\n left: expr,\n right: parseBitwiseORExpression()\n }\n end\n\n return expr\n end",
"title": ""
},
{
"docid": "61679a837d82fe1438e562016f45e658",
"score": "0.5303191",
"text": "def to_solr_query\n [::Query.normalize(query_string), ::Query.common_filter_query].flatten.join(' AND ')\n end",
"title": ""
},
{
"docid": "fb4d68f6ba6b4fdb8d4a193b494c1c02",
"score": "0.5295523",
"text": "def search_conditions\n if search_support? && params[:q].present?\n search_word_conditions.reduce do |query, condition|\n query.and(condition)\n end\n end\n end",
"title": ""
},
{
"docid": "7d2e9de02740eca64f8245ebf3fd9614",
"score": "0.5290386",
"text": "def normalised_application_status\n return if application_status.blank?\n STATUS_TYPES_AND_ALIASES.detect{ |s_and_a| s_and_a.any?{ |matcher| application_status.match(Regexp.new(matcher, true)) } }.try(:first)\n end",
"title": ""
},
{
"docid": "ba3dd4136e5576d723c9892135149afb",
"score": "0.52711767",
"text": "def query_join_strict(is_strict)\n\t\tis_strict ? 'AND' : 'OR'\n\tend",
"title": ""
},
{
"docid": "075701d76f6c40e17c399e11571c738e",
"score": "0.5270041",
"text": "def build_search_conditions(query)\n\t\t# query && ['LOWER(display_name) LIKE :q OR LOWER(login) LIKE :q', {:q => \"%#{query}%\"}]\n\t\tquery\n\tend",
"title": ""
},
{
"docid": "aeb1f68afb94eae5e50ec27a199ff1f4",
"score": "0.52428436",
"text": "def search_process\r\n@search_text=params[:q].to_s\r\nall=params[:all].to_s\r\nexact=params[:exact].to_s\r\nany=params[:any].to_s\r\nnone=params[:none].to_s\r\nadvanced_query=\"\"\r\n\r\nif all != \"\"\r\nall=all.split(' ')\r\nall_like=all.map {|x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nall_like=all_like.join(' and ')\r\nadvanced_query=all_like\r\nend\r\n\r\nif exact != \"\" && all != \"\"\r\nexact=\"'%\"+exact+\"%'\"\r\nadvanced_query = advanced_query + \" and keyword like \" + exact\r\nend\r\n\r\nif exact != \"\" && all == \"\"\r\nexact=\"'%\"+exact+\"%'\"\r\nadvanced_query = \"keyword like \" + exact\r\nend\r\n\r\nif any != \"\" and ( all != \"\" or exact != \"\" )\r\nany=any.split(' ')\r\nany_like=any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nany_like=any_like.join(' or ')\r\nadvanced_query = advanced_query + \" and (\" + any_like + \")\"\r\nend\r\n\r\nif any != \"\" and all == \"\" and exact == \"\"\r\nany=any.split(' ')\r\nany_like=any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nany_like=any_like.join(' or ')\r\nadvanced_query = \"(\" + any_like + \")\"\r\nend\r\n\r\nif none != \"\" and (all != \"\" or exact != \"\" or any != \"\")\r\nnone=none.split(' ')\r\nnone_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\r\n\r\nnone_not_like=none_not_like.join(' and ')\r\n\r\nadvanced_query=advanced_query + \" and \" + none_not_like\r\n\r\nend\r\n\r\nif none != \"\" and all == \"\" and exact == \"\" and any == \"\"\r\nnone=none.split(' ')\r\nnone_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\r\n\r\nnone_not_like=none_not_like.join(' and ')\r\n\r\nadvanced_query= none_not_like\r\nend\r\n\r\n\r\n\r\n\r\n\r\nadvanced_query = \"SELECT Model_ID FROM keyword_symbol_tables WHERE \"+advanced_query\r\nputs \"\\n\\n***********************************\\n\\n\"+advanced_query+\"\\n\\n**********************\\n\\n\"\r\n\r\nparameter_search_text=@search_text.split.join(\" \")\r\n keyword_array=parameter_search_text.split(' ')\r\n keyword_count=keyword_array.size\r\n#parameter_search_text= parameter_search_text.gsub(/\\\"/,)\r\n# parameter_search_text = parameter_search_text.gsub(/\"/,\"\")\r\nconnection = ActiveRecord::Base.connection();\r\nif all != \"\" or exact != \"\" or any != \"\" or none != \"\"\r\n@resultset = connection.execute(\"#{advanced_query}\");\r\nelse\r\n@resultset = connection.execute(\"call keyword_search('#{parameter_search_text}',#{keyword_count})\");\r\n#@resultset = connection.execute(\"call keyword_srch_modified('#{parameter_search_text}',#{keyword_count})\");\r\nend\r\nActiveRecord::Base.clear_active_connections!()\r\n\r\n@resultset.each do |res|\r\nputs res\r\nend\r\n@resultset_strings = @resultset.map { |result| result.to_s.gsub(/[^0-9A-Za-z]/, '')}\r\n@model_ids=Array.new\r\n@model_names=Array.new\r\n@model_types=Array.new\r\n@resultset_strings.each do |result|\r\nsubstring=result[0..4]\r\nputs\"\\n\\n************\"+substring\r\nif substring == \"NMLCL\"\r\ncell=Cell.find_by_Cell_ID(result.to_s)\r\nname=cell.Cell_Name\r\ntype=\"Cell\"\r\nend\r\n\r\nif substring == \"NMLCH\"\r\nchannel=Channel.find_by_Channel_ID(result.to_s)\r\nname=channel.Channel_Name\r\ntype=\"Channel\"\r\nend\r\n\r\n\r\nif substring == \"NMLNT\"\r\nnetwork=Network.find_by_Network_ID(result.to_s)\r\nname=network.Network_Name\r\ntype=\"Network\"\r\nend\r\n\r\nif substring == \"NMLSY\"\r\nname=Synapse.find_by_Synapse_ID(result.to_s)\r\ntype=\"Synapse\"\r\nend\r\n\r\n@model_ids.push(result)\r\n@model_names.push(name)\r\n@model_types.push(type)\r\nputs \"result-\"+result+\"name-\"+name.to_s\r\nend\r\n\r\nif @model_ids.count != 0\r\nrender :partial => 'keyword_results_list',:locals => {:model_ids => @model_ids,:model_names => @model_names,:model_types => @model_types}\r\nelse\r\nrender :partial => 'no_results'\r\nend\r\n\r\n\r\n end",
"title": ""
},
{
"docid": "cfa0cb988166b41c12bb27039dc60db0",
"score": "0.5215294",
"text": "def simple_conjunction(lhs, rhs)\n @status = lhs.status.merge(rhs.status) { |_, l, r| l & r }\n @priority = lhs.priority.merge(rhs.priority) { |_, l, r| l & r }\n @tags = lhs.tags.merge rhs.tags\n self\n end",
"title": ""
},
{
"docid": "68114aae5d40c8b77b5122663d9a26ed",
"score": "0.5185133",
"text": "def _reduce_39(val, _values, result)\n result = s(:and, val[0], val[2])\n \n result\nend",
"title": ""
},
{
"docid": "68114aae5d40c8b77b5122663d9a26ed",
"score": "0.5185133",
"text": "def _reduce_39(val, _values, result)\n result = s(:and, val[0], val[2])\n \n result\nend",
"title": ""
},
{
"docid": "68114aae5d40c8b77b5122663d9a26ed",
"score": "0.5185133",
"text": "def _reduce_39(val, _values, result)\n result = s(:and, val[0], val[2])\n \n result\nend",
"title": ""
},
{
"docid": "68114aae5d40c8b77b5122663d9a26ed",
"score": "0.5185133",
"text": "def _reduce_39(val, _values, result)\n result = s(:and, val[0], val[2])\n \n result\nend",
"title": ""
},
{
"docid": "f1a7c7f69b76133df9e34adebf89497a",
"score": "0.5179389",
"text": "def build_conditions(params)\n conditions = \"1 = 1 \"\n params.split('&').each do |q|\n the_key, the_value = q.split(\"=\").first, q.split(\"=\").last\n if the_key == \"search\"\n search = Array.new\n self.typus_defaults_for('search').each { |s| search << \"LOWER(#{s}) LIKE '%#{CGI.unescape(the_value)}%'\" }\n conditions << \"AND (#{search.join(\" OR \")}) \"\n end\n self.model_fields.each do |f|\n filter_type = f[1] if f[0] == the_key\n case filter_type\n when \"boolean\"\n if %w(sqlite3 sqlite).include? ActiveRecord::Base.configurations[RAILS_ENV]['adapter']\n conditions << \"AND #{f[0]} = '#{the_value[0..0]}' \"\n else\n status = (the_value == 'true') ? 1 : 0\n conditions << \"AND #{f[0]} = '#{status}' \"\n end\n when \"datetime\"\n case the_value\n when 'today': start_date, end_date = Time.today, Time.today.tomorrow\n when 'past_7_days': start_date, end_date = 6.days.ago.midnight, Time.today.tomorrow\n when 'this_month': start_date, end_date = Time.today.last_month, Time.today.tomorrow\n when 'this_year': start_date, end_date = Time.today.last_year, Time.today.tomorrow\n end\n start_date, end_date = start_date.to_s(:db), end_date.to_s(:db)\n conditions << \"AND created_at > '#{start_date}' AND created_at < '#{end_date}' \"\n when \"integer\"\n conditions << \"AND #{f[0]} = #{the_value} \" if f[0].include? \"_id\"\n when \"string\"\n conditions << \"AND #{f[0]} = '#{the_value}' \"\n end\n end\n end\n return conditions\n end",
"title": ""
},
{
"docid": "d067c2aa331e16a58304aac44ab2e7cd",
"score": "0.5158676",
"text": "def query_to_terms(query)\n query.scan(/(\\+|or \\-?|and \\-?|\\-)?(\"[^\"]*\"?|[\\w\\-]+)/).collect do |prefix, term|\n term = \"(#{term.scan(/[\\w']+/).join('&')})\" if term[0,1] == '\"'\n term = \"!#{term}\" if prefix =~ /\\-/\n [(prefix =~ /or/) ? '|' : '&', term] \n end\n end",
"title": ""
},
{
"docid": "bd3f230245b4bdec3d4a600e9d0831c8",
"score": "0.5151136",
"text": "def update_status!\n s = case\n when !submitted? then :in_progress\n when requires_approval? && submitted? && !approved? then :pending\n when submitted? && approved? && !checked_out? && !checked_in? then :approved\n when checked_out? && late? then :late\n when checked_out? then :checked_out\n when checked_in? && late? then :returned_late\n when checked_in? && !checkin_ok? then :returned_damaged\n when checked_in? then :returned\n else :unknown\n end\n self.status = s.to_s\n end",
"title": ""
},
{
"docid": "3c84ec4af2800ba5d601507e83df20c4",
"score": "0.5151067",
"text": "def merged_conditions(search_conditions, other_conditions)\n other_conditions ? \"(#{sanitize_sql(other_conditions)}) AND (#{search_conditions})\" :\n search_conditions\n end",
"title": ""
},
{
"docid": "6970d66f877e02d7c9c0edf65e408ece",
"score": "0.51480854",
"text": "def transform_query(query, type = 'node')\n if query.size == 1\n query = query[0]\n elsif query.size > 1\n if type == 'node'\n query.unshift('and')\n elsif type == 'klass'\n query.unshift('or')\n end\n end\n\n query\n end",
"title": ""
},
{
"docid": "e323c7050be530a8f9e01c29c7e9785a",
"score": "0.51397985",
"text": "def query_for_search(query)\n if query[:location] != ''\n @location = query[:location]\n else\n @location = '%'\n end\n if query[:department] != ''\n @department = query[:department]\n else\n @department = '%'\n end\n if query[:title] != ''\n @title = query[:title]\n else\n @title = '%'\n end \n 'title like \\'%' + @title + '%\\' and location like \\'' + @location + '\\'' + ' and department like \\'' + @department + '\\' and is_open = 1'\n end",
"title": ""
},
{
"docid": "d62737a2c23212d11e76c7f86cf8a9e9",
"score": "0.51317155",
"text": "def add_custom_search_filters(search)\n return if model_types.nil? || model_types == \"All\"\n search.any_of do |s|\n s.with(:model_types, model_types)\n end\n end",
"title": ""
},
{
"docid": "820564237fe3cdb9c87db40f198d4c90",
"score": "0.5125052",
"text": "def build_search_conditions(query)\n #ActiveSupport::Deprecation.warn(\"You must setup An Axe in your app by overriding the method :build_search_conditions(query) on #{self.class}\")\n query && ['LOWER(display_name) LIKE :q OR LOWER(login) LIKE :q', {:q => \"%#{query}%\"}]\n #query\n end",
"title": ""
},
{
"docid": "b87360249f946be07c09900ff13a5020",
"score": "0.5119944",
"text": "def conditions\r\n unless self.empty?\r\n @filters.inject([\"\"]) do |condition,filter|\r\n filter = filter.dup\r\n condition.first << \" AND \" unless condition.first.empty?\r\n condition.first << filter.shift\r\n condition += filter\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "2338dd2d6f699d96b10c933ffd37493c",
"score": "0.50986844",
"text": "def and_operator\n @and_operator ||=\n begin\n op = t('blacklight.and', default: 'AND').upcase\n render_item(\" #{op} \", class: 'filter-separator')\n end\n end",
"title": ""
},
{
"docid": "c7ead033a81416796e440cd2bf63fe14",
"score": "0.5096262",
"text": "def | filter; Filter.new :or, self, filter; end",
"title": ""
},
{
"docid": "c7ead033a81416796e440cd2bf63fe14",
"score": "0.5096262",
"text": "def | filter; Filter.new :or, self, filter; end",
"title": ""
},
{
"docid": "80ca3b3145d8062c2f6726aa3a52d8a0",
"score": "0.50941044",
"text": "def sanitize_and_merge_conditions_with_or(*conditions)\n conditions = conditions.reject(&:blank?).map {|condition| sanitize_sql_for_assignment(condition)}.reject(&:blank?)\n conditions.empty? ? nil : conditions.join(\" OR \")\n end",
"title": ""
},
{
"docid": "8ace796f94b8f78e48b1e3de9649072a",
"score": "0.50929445",
"text": "def prepare_nation_wide_condition(is_location = false)\n sql_params = Array.new\n\n sql_cond = '(rs.restriction_id IS NULL AND'\n sql_cond << ' rci.restriction_id IS NULL AND'\n sql_cond << ' rcu.restriction_id IS NULL AND'\n sql_cond << ' rz.restriction_id IS NULL'\n sql_cond << \" AND #{prepare_counseling_condition}\" if has_counseling_condition?\n sql_cond << \" AND #{prepare_active_condition}\" if is_active?\n sql_cond << \" AND l.is_provider = 1\" if is_location\n sql_cond << (is_location ? ' AND l.is_active = 1 ' : ' AND p.is_active = 1 ')\n sql_cond << \" AND a.agency_category_id != #{AgencyCategory[:'State/Local Plans'].id} \"\n\n if has_category_condition?\n s, p = prepare_category_condition\n sql_cond << ' AND ' << s\n sql_params << p\n end\n sql_cond << \") \\n\"\n return sql_cond, sql_params\n end",
"title": ""
},
{
"docid": "e1037667365ed4b1a9bd0ff061970ac7",
"score": "0.5091437",
"text": "def text_search_parse(query)\n unless query.blank?\n query = query.gsub(/[^\\w\\-\\+'\"]+/, \" \").gsub(\"'\", \"''\").strip.downcase\n query = query.scan(/(\\+|or \\-?|and \\-?|\\-)?(\"[^\"]*\"?|[\\w\\-]+)/).collect do |prefix, term|\n term = \"(#{term.scan(/[\\w']+/).join('&')})\" if term[0,1] == '\"'\n term = \"!#{term}\" if prefix =~ /\\-/\n [(prefix =~ /or/) ? '|' : '&', term] \n end.flatten!\n query.shift\n query.join\n end\n end",
"title": ""
},
{
"docid": "4ab41588ff7062eb4ce582e873a19d33",
"score": "0.5091272",
"text": "def keyword_op\n op = search_state.params[:op]&.to_sym || :must\n\n if op == :should\n 'OR'\n else\n 'AND'\n end\n end",
"title": ""
},
{
"docid": "29c2015168263f0ba946ef14f656e3d2",
"score": "0.5088038",
"text": "def index\n @search = Car.search(params[:q])\n @cars = @search.result.where([\"is_approved = :status\", {status: 'TRUE'}])\n @search.build_condition\n end",
"title": ""
},
{
"docid": "ddc65012eeb46abcaf49788f1d3ed091",
"score": "0.5058953",
"text": "def accepted? \r\n [\"MAPPED\",\"UNMAPPED\",\"APPROVED\"].include?(status.to_s.upcase)\r\n end",
"title": ""
},
{
"docid": "7992f175aaa19ec5c18c1fbe99ae6900",
"score": "0.50493556",
"text": "def and2or\n # removes scoping first, then reapplies with OR\n unscoped.where( and2or_ )\n end",
"title": ""
},
{
"docid": "543999d062d17ad88a2325ebd8344126",
"score": "0.5046994",
"text": "def all condition\n foldRight(true, -> (a, acc) { condition.(a) && acc })\n end",
"title": ""
},
{
"docid": "290b6cd21f8cd484e2876cac370c014b",
"score": "0.5046311",
"text": "def trailing_and_or(array, bool_op)\n array.each do |a|\n # If the array has only one or no elements, it will return just the one element (or nothing).\n if array.length < 2\n type(\"#{a}\")\n # Otherwise, it runs as intended.\n elsif array.length > 2\n if a == array.last\n type(\"#{bool_op} #{a}\")\n else\n type(\"#{a}, \")\n end\n else\n if a == array.last\n type(\"#{bool_op} #{a}\")\n else\n type(\"#{a} \")\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1a5c0f278c94cebd1c5061c28e566ce0",
"score": "0.5038263",
"text": "def activation_status_filter(locales:, active:)\n filter_mode = active ? :or : :and\n results = []\n locales.each do |locale|\n filter_hash = { term: { active_locales: locale } }\n filter_hash = { not: filter_hash } unless active\n results << filter_hash\n end\n filter(filter_mode => results)\n end",
"title": ""
},
{
"docid": "cdf49bbfb344d54c17172e3eb1e9cde6",
"score": "0.5037748",
"text": "def and\n @query += 'AND '\n return self\n end",
"title": ""
},
{
"docid": "d3c8fcb8d8aa9bc6f144ec898bf4aea3",
"score": "0.50284344",
"text": "def status_includes?(*args)\n stat = status.to_s.downcase\n !!args.map(&:to_s).map(&:downcase).detect do |string|\n stat.include?(string)\n end\n end",
"title": ""
},
{
"docid": "ec422f84f884a289572cda850f224d44",
"score": "0.50227964",
"text": "def enrollments_statuses(statuses)\n @result = if statuses.empty?\n @user.courses_enrollments\n else\n @user.enrollments.filter(statuses)\n end\n end",
"title": ""
},
{
"docid": "9b873a827758765447b26e4821fe5919",
"score": "0.50082004",
"text": "def process_params\n return unless params[:search].present?\n\n params[:search] = params[:search].reduce(Hash.new) do |processed_params, (filter, value)|\n if %w(city_id county_id).include? filter\n processed_params.merge(\"#{filter}_eq\" => value)\n elsif value.is_a? Array\n processed_params.merge(filter => value.map { |v| v.empty? ? nil : v }.compact)\n else\n processed_params.merge(filter => value)\n end.with_indifferent_access\n end\n end",
"title": ""
},
{
"docid": "1853f6375869f39d2296101a7c869db1",
"score": "0.50067234",
"text": "def to_s\n value = @conditions.map do |key,values|\n query = values.map { |value| \"#{key}:#{value}\" }.join(\" OR \")\n values.count > 1 ? \"(#{query})\" : query\n end.join(\" AND \")\n\n conditions.count > 1 ? \"(#{value})\" : value\n end",
"title": ""
},
{
"docid": "93114c557da48faa007d43cd6a4706e0",
"score": "0.49969414",
"text": "def build_search_conditions(query)\n return nil\n end",
"title": ""
},
{
"docid": "9d0eff8c9ef23e9836e14c0a197c12fe",
"score": "0.49953288",
"text": "def get_city_search_condition( params )\n\n if (params[:city_global_location][:country] == nil || params[:city_global_location][:country] == '')\n condition = [ \"LOWER(city) LIKE ? \", \"#{params[:city_global_location][:city]}%\" ]\n else\n condition = [ \"LOWER(city) LIKE ? AND country = ?\", \n \"#{params[:city_global_location][:city]}%\",\n params[:city_global_location][:country] \n ]\n end\n return condition\n end",
"title": ""
},
{
"docid": "7bef7d74a48e518957052b02e8802601",
"score": "0.4995209",
"text": "def apply_filter(scope, value)\n branches = normalize_filters(value).reduce { |a, b| a.or(b) }\n scope.merge branches\n end",
"title": ""
},
{
"docid": "37f70af3d58e06d33ab8a932e21e5892",
"score": "0.49897337",
"text": "def non_regex_search\n case cond\n when Proc\n filter\n when :eq, :not_eq, :lt, :gt, :lteq, :gteq, :in\n searchable_integer? ? raw_search(cond) : empty_search\n when :start_with\n text_search(\"#{formatted_value}%\")\n when :end_with\n text_search(\"%#{formatted_value}\")\n when :like\n text_search(\"%#{formatted_value}%\")\n when :string_eq\n raw_search(:eq)\n when :string_in\n raw_search(:in)\n when :null_value\n null_value_search\n when :date_range\n date_range_search\n end\n end",
"title": ""
},
{
"docid": "f55be525988eb80d3926e901549f250e",
"score": "0.49896768",
"text": "def logic_and( criteria )\n val = criteria[ @keyword ]\n if ! val.kind_of?(Array)\n val = [ val ]\n end\n val.each { |value|\n if ! @allowed_values.include?( value )\n return false\n end\n }\n return true\n end",
"title": ""
},
{
"docid": "ffcb627b35c182a38c27b63a6defcf2f",
"score": "0.4989227",
"text": "def apply_filter(scope, value)\n # normalize filters from nested OR structure, to flat scope list\n branches = normalize_filters(value).reduce { |a, b| a.or(b) }\n scope.merge branches\n end",
"title": ""
},
{
"docid": "fc5a313b3909b02aa2f8fcca10f7e974",
"score": "0.49874058",
"text": "def apply_filter(scope, value)\n # normalize filters from nested OR structure, to flat scope list\n branches = normalize_filters(value).reduce { |a, b| a.or(b) }\n scope.merge branches\n end",
"title": ""
},
{
"docid": "ba9630fbda77f1cbdaaf32052ca0a2b3",
"score": "0.49871808",
"text": "def eval( mapper, obj )\n case @op\n when 'or'\n @args.each { |arg| return true if arg.eval( mapper, obj ) }\n false\n when 'and'\n @args.each { |arg| return false unless arg.eval( mapper, obj ) }\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "95190ff62f381963b91e1f639e916e76",
"score": "0.4985272",
"text": "def where_concat\n @where.join(' AND ') if @where\n end",
"title": ""
},
{
"docid": "c87fd5b0a01c382ab8f9d133ae7ea2c9",
"score": "0.49817726",
"text": "def andand(*commands)\n cmdjoin(commands, \" && \")\n end",
"title": ""
},
{
"docid": "76db31fe336f3087cfeb19850f4dab95",
"score": "0.49798408",
"text": "def sanitize_and_merge_conditions(*conditions)\n conditions = conditions.reject(&:blank?).map {|condition| sanitize_sql_for_assignment(condition)}.reject(&:blank?)\n conditions.empty? ? nil : conditions.join(\" AND \")\n end",
"title": ""
},
{
"docid": "01e5eedfd5679ac195f6a848184eb57c",
"score": "0.49778932",
"text": "def contains_explicit_and?\n !@value[/ AND /].nil?\n end",
"title": ""
},
{
"docid": "bfa09d97a6bd931a910990c1193a0e87",
"score": "0.49766117",
"text": "def _reduce_38(val, _values, result)\n result = s(:and, val[0], val[2])\n \n result\nend",
"title": ""
},
{
"docid": "bfa09d97a6bd931a910990c1193a0e87",
"score": "0.49766117",
"text": "def _reduce_38(val, _values, result)\n result = s(:and, val[0], val[2])\n \n result\nend",
"title": ""
},
{
"docid": "1c4b9dc217c510d0046bab0ab5d4e41f",
"score": "0.49662477",
"text": "def search_condition\n if search_support? && params[:q].present?\n terms = params[:q].split(/\\s+/).collect { |t| \"%#{t}%\" }\n clause = search_columns.collect do |f|\n col = f.to_s.include?('.') ? f : \"#{model_class.table_name}.#{f}\"\n \"#{col} LIKE ?\"\n end.join(\" OR \")\n clause = terms.collect {|t| \"(#{clause})\" }.join(\" AND \")\n\n [\"(#{clause})\"] + terms.collect {|t| [t] * search_columns.size }.flatten\n end\n end",
"title": ""
},
{
"docid": "b748438ca1107a9bfbc192069e362fa6",
"score": "0.49659088",
"text": "def on_and(node)\n left, right = process_all(node)\n left && right\n end",
"title": ""
},
{
"docid": "99a67f547054d0ff8a8f809075055883",
"score": "0.49658272",
"text": "def filter_query\n (center && center_query) || (bounds && bounds_query) || (where && geocode_where(where)) || nil\n end",
"title": ""
},
{
"docid": "22c082ef79c08e78bf555dc76c1ad619",
"score": "0.49656543",
"text": "def search_query\n @search_query ||= params[:query].present? ? JSON.parse(params[:query].gsub('=>', ':')) : false\n end",
"title": ""
},
{
"docid": "571103e7752f3b82a1aabef7486ac421",
"score": "0.4964634",
"text": "def parsed_search_filter\n filter = @search_options[:filter]\n filter = {} unless filter.is_a?(Hash)\n filter.symbolize_keys!\n filter.map do |k, v|\n if v.is_a?(Array)\n # OR together multiple values for the same filter\n '(' + v.map { |i| '%s:\"%s\"' % [k, i] }.join(' OR ') + ')'\n else\n '%s:\"%s\"' % [k, v]\n end\n end\n end",
"title": ""
},
{
"docid": "26a78105788d82129887a2e84b0d1ba8",
"score": "0.49588254",
"text": "def and_operator\n ','\n end",
"title": ""
},
{
"docid": "573ebdf2f0a2c198cc6bc29ea9b6a226",
"score": "0.4958237",
"text": "def normalized_query(*flags); end",
"title": ""
},
{
"docid": "573ebdf2f0a2c198cc6bc29ea9b6a226",
"score": "0.4958237",
"text": "def normalized_query(*flags); end",
"title": ""
},
{
"docid": "2bc08908fb64d4c49a0c203b5933bb25",
"score": "0.49493396",
"text": "def condition_or\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 196 )\n return_value = ConditionOrReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n condition_or_start_index = @input.index\n\n root_0 = nil\n string_literal1065 = nil\n condition_and1064 = nil\n condition_and1066 = nil\n\n tree_for_string_literal1065 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1030:4: condition_and ( 'OR' condition_and )*\n @state.following.push( TOKENS_FOLLOWING_condition_and_IN_condition_or_6456 )\n condition_and1064 = condition_and\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_and1064.tree )\n end\n # at line 1030:18: ( 'OR' condition_and )*\n while true # decision 278\n alt_278 = 2\n look_278_0 = @input.peek( 1 )\n\n if ( look_278_0 == T__51 )\n look_278_2 = @input.peek( 2 )\n\n if ( syntactic_predicate?( :synpred441_Plsql ) )\n alt_278 = 1\n\n end\n\n end\n case alt_278\n when 1\n # at line 1030:20: 'OR' condition_and\n string_literal1065 = match( T__51, TOKENS_FOLLOWING_T__51_IN_condition_or_6460 )\n if @state.backtracking == 0\n\n tree_for_string_literal1065 = @adaptor.create_with_payload( string_literal1065 )\n @adaptor.add_child( root_0, tree_for_string_literal1065 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_condition_and_IN_condition_or_6462 )\n condition_and1066 = condition_and\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_and1066.tree )\n end\n\n else\n break # out of loop for decision 278\n end\n end # loop for decision 278\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 196 )\n memoize( __method__, condition_or_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "3dd8fda9cbb2a4511df8bbbee3fe0a01",
"score": "0.49493292",
"text": "def criterion_to_arel criterion\n if [\"and\", \"or\"].include? criterion[\"operator\"]\n criterion[\"criteria\"].reduce(nil) do |arel, subcriterion|\n condition = criterion_to_arel(subcriterion)\n arel.nil? ? condition : arel.send(criterion[\"operator\"], condition)\n end\n elsif criterion[\"operator\"] == \"not\"\n # The SmartClient \"not\" is the equivalent of the logical negation\n # of OR'ing the children. So, we run the \"or\" first, and then\n # slip in the logical negation at the end.\n criterion[\"criteria\"].reduce(nil) {|arel, subcriterion|\n condition = criterion_to_arel(subcriterion)\n arel.nil? ? condition : arel.send(\"or\", condition)\n }.not\n elsif SMARTCLIENT_OPERATORS.has_key? criterion[\"operator\"]\n operator = SMARTCLIENT_OPERATORS[criterion[\"operator\"]]\n attribute = get_arel_attribute(criterion[\"fieldName\"])\n value = case operator[:value]\n when :contains; \"%#{criterion[\"value\"]}%\"\n when :startsWith; \"#{criterion[\"value\"]}%\"\n when :endsWith; \"%#{criterion[\"value\"]}\"\n when :null; nil\n when :fieldName; get_arel_attribute(criterion[\"value\"])\n when :exclusiveRange; criterion[\"start\"]..criterion[\"end\"]\n when :inclusiveRange; criterion[\"start\"]...criterion[\"end\"]\n when :containsField; raise \"unimplemented\"\n when :startsWithField; raise \"unimplemented\"\n when :endsWithField; raise \"unimplemented\"\n else criterion[\"value\"]\n end\n attribute.send operator[:op], value\n else\n raise \"Did not recognize operator #{criterion[\"operator\"]}\"\n end\n end",
"title": ""
},
{
"docid": "a6689d0a6facd0e62096b4b4ae6807fe",
"score": "0.49467155",
"text": "def validate_boolean_opr(params = {})\n default_boolean_opr = \"all\"\n \n case params[:boolean_opr]\n when nil?\n boolean_opr = default_boolean_opr\n when \"all\", \"any\", \"exact\"\n boolean_opr = params[:boolean_opr]\n else\n boolean_opr = default_boolean_opr\n end\n \n return boolean_opr\n end",
"title": ""
},
{
"docid": "89de188004cb1cf1aa7204e86caebabc",
"score": "0.49460962",
"text": "def generate_conditions\n if @params[:search]\n @params[:search][:filter].each do |key, val|\n filter = @data_filters[key]\n if filter['id_filter']\n client_ids = send(filter['id_query_method'], val['input'])\n condition = client_ids.any? ? \"clients.id in ( #{client_ids.join(',')} )\" : \"\"\n else\n condition = filter['query_string']\n next if val['input'].values.include?(\"\")\n val['input'].each do |index, val|\n parsed_val = parse_input_val(filter['input_type'], filter['query_input_type'], val, condition)\n condition.gsub!(\"{{input_#{(index.to_i)}}}\", parsed_val.to_s)\n end\n end\n @filter_conditions << condition unless condition.blank?\n @join_conditions << filter['join_condition']\n @join_tables << filter['join_tables']\n end\n end\n end",
"title": ""
},
{
"docid": "5a026232353b7a47b53f42eede87d064",
"score": "0.4942314",
"text": "def query_via_solr # rubocop:disable all\n filter_queries = []\n orders = []\n @where_values.each do |wv|\n wv.each do |k, v|\n # If v is blank but not false, check that there is no value for the field in the document\n if v.blank? && v != false\n filter_queries << \"-#{k}:#{full_solr_range(k)}\"\n else\n filter_queries << \"#{k}:(#{solr_format(k, v)})\"\n end\n end\n end\n\n @where_not_values.each do |wnv|\n wnv.each do |k, v|\n # If v is blank but not false, check for any value in the field in the document\n if v.blank? && v != false\n filter_queries << \"#{k}:#{full_solr_range(k)}\"\n else\n filter_queries << \"-#{k}:(#{solr_format(k, v)})\"\n end\n end\n end\n\n @greater_than_values.each do |gtv|\n gtv.each do |k, v|\n filter_queries << \"#{k}:[#{solr_format(k, v)} TO *]\"\n end\n end\n\n @less_than_values.each do |ltv|\n ltv.each do |k, v|\n filter_queries << \"#{k}:[* TO #{solr_format(k, v)}]\"\n end\n end\n\n @order_values.each do |ov|\n ov.each do |k, v|\n if @reverse_order_value\n orders << \"#{k} #{v == :asc ? 'desc' : 'asc'}\"\n else\n orders << \"#{k} #{v == :asc ? 'asc' : 'desc'}\"\n end\n end\n end\n\n sort = orders.join(',')\n\n q = @fulltext_values.empty? ? '*:*' : @fulltext_values.map { |ftv| '(' + ftv[:query] + ')' }.join(' AND ')\n\n params = { q: q, commit: true }\n params[:sort] = sort\n params[:fq] = filter_queries unless filter_queries.empty?\n if @query_parser_value\n params['defType'] = @query_parser_value.keys.first\n params.merge(@query_parser_value.values.first)\n end\n\n # Facets\n # facet=true to enable faceting, facet.field=<field_name> (can appear more than once for multiple fields)\n # Additional options: f.<field_name>.facet.<option> [e.g. f.author.facet.sort=index]\n\n # Facet Fields\n unless field_facet_values.empty?\n params['facet'] = 'true'\n params['facet.threads'] = facet_threads_value if facet_threads_value.present?\n\n facet_fields = []\n field_facet_values.each do |facet|\n facet_field = facet[:field]\n facet_fields << facet_field\n facet[:options].each do |key, value|\n params[\"f.#{facet_field}.facet.#{key}\"] = value.to_s\n end\n end\n params['facet.field'] = facet_fields\n end\n\n # Facet Ranges\n unless range_facet_values.empty?\n params['facet'] = 'true'\n facet_fields = []\n range_facet_values.each do |facet|\n facet_field = facet[:field]\n facet_fields << facet_field\n facet[:options].each do |key, value|\n params[\"f.#{facet_field}.facet.range.#{key}\"] = value.to_s\n end\n end\n params['facet.range'] = facet_fields\n end\n\n if @highlight_options[:fields].present?\n params[:hl] = true\n params['hl.fl'] = @highlight_options[:fields]\n params['hl.snippets'] = @highlight_options[:snippets] if @highlight_options[:snippets]\n params['hl.fragsize'] = @highlight_options[:fragsize] if @highlight_options[:fragsize]\n params['hl.requireFieldMatch'] =\n @highlight_options[:require_field_match] if @highlight_options[:require_field_match].present?\n if @highlight_options[:use_fast_vector]\n params['hl.useFastVectorHighlighter'] = true\n params['hl.tag.pre'] = @highlight_options[:pre_tag] if @highlight_options[:pre_tag].present?\n params['hl.tag.post'] = @highlight_options[:post_tag] if @highlight_options[:post_tag].present?\n else\n params['hl.mergeContiguous'] = @highlight_options[:merge_contiguous].present?\n params['hl.simple.pre'] = @highlight_options[:pre_tag] if @highlight_options[:pre_tag].present?\n params['hl.simple.post'] = @highlight_options[:post_tag] if @highlight_options[:post_tag].present?\n params['hl.maxAnalyzedChars'] =\n @highlight_options[:max_analyzed_chars] if @highlight_options[:max_analyzed_chars].present?\n end\n end\n\n select_columns =\n select_values.empty? ? (@klass.attribute_definitions.keys - @klass.lazy_attributes) : select_values.flatten\n select_columns << @klass.primary_key\n select_columns.map! { |c| @klass.column_for_attribute(c).try(:type) == :map ? \"#{c}*\" : c.to_s }\n params[:fl] = select_columns.uniq.join(',')\n unless @stats_values.empty?\n params[:stats] = 'true'\n @stats_values.flatten.each do |sv|\n params['stats.field'] = sv\n end\n params['stats.facet'] = @group_value\n end\n solr_response = nil\n\n if @group_value\n results = DatastaxRails::GroupedCollection.new\n params[:group] = 'true'\n params[:rows] = 10_000\n params['group.field'] = @group_value\n params['group.limit'] = @per_page_value\n params['group.offset'] = (@page_value - 1) * @per_page_value\n params['group.ngroups'] = 'false' # must be false due to issues with solr sharding\n ActiveSupport::Notifications.instrument(\n 'solr.datastax_rails',\n name: 'Search',\n klass: @klass.name,\n search: params) do\n solr_response = rsolr.post('select', data: params)\n response = solr_response['grouped'][@group_value.to_s]\n results.total_groups = response['groups'].size\n results.total_for_all = response['matches'].to_i\n results.total_entries = 0\n response['groups'].each do |group|\n results[group['groupValue']] = parse_docs(group['doclist'], select_columns)\n if results[group['groupValue']].total_entries > results.total_entries\n results.total_entries = results[group['groupValue']].total_entries\n end\n end\n end\n else\n ActiveSupport::Notifications.instrument(\n 'solr.datastax_rails',\n name: 'Search',\n klass: @klass.name,\n search: params.merge(page: @page_value, per_page: @per_page_value)) do\n solr_response = rsolr.paginate(@page_value, @per_page_value, 'select', data: params, method: :post)\n response = solr_response['response']\n results = parse_docs(response, select_columns)\n results.highlights = solr_response['highlighting']\n end\n end\n if solr_response['stats']\n @stats = solr_response['stats']['stats_fields'].with_indifferent_access\n end\n # Apply Facets if they exist\n if solr_response['facet_counts']\n results.facets = {}\n results.facets = results.facets.merge(solr_response['facet_counts']['facet_fields'].to_h)\n results.facets = results.facets.merge(solr_response['facet_counts']['facet_ranges'].to_h)\n end\n results\n end",
"title": ""
},
{
"docid": "0b68acbd812d6ee5bce5004f2916a21d",
"score": "0.49413756",
"text": "def status_value\n return 'active' if !params.include?(:status) || !STATUS_VALUES.include?(params[:status])\n\n params[:status]\n end",
"title": ""
},
{
"docid": "75d9956e82326edd303dffeabf7d60c2",
"score": "0.49408263",
"text": "def min_match_for_boolean(solr_parameters)\n return unless search_state.query_param&.match?(/\\s(AND|OR|NOT)\\s/)\n\n solr_parameters[:mm] = '1'\n end",
"title": ""
},
{
"docid": "e91029aa9cb17fefc9d9396c65552d45",
"score": "0.49380136",
"text": "def address_state_conditions\n [\"people.address_state LIKE ?\", \"%#{address_state}%\"] unless address_state.blank?\n end",
"title": ""
},
{
"docid": "7da3de66c964dc67ca063b21bf527ecf",
"score": "0.4935826",
"text": "def _reduce_34(val, _values, result)\n result = @builder.logical_op(:and, val[0], val[1], val[2])\n \n result\nend",
"title": ""
},
{
"docid": "7da3de66c964dc67ca063b21bf527ecf",
"score": "0.4935826",
"text": "def _reduce_34(val, _values, result)\n result = @builder.logical_op(:and, val[0], val[1], val[2])\n \n result\nend",
"title": ""
},
{
"docid": "7da3de66c964dc67ca063b21bf527ecf",
"score": "0.4935826",
"text": "def _reduce_34(val, _values, result)\n result = @builder.logical_op(:and, val[0], val[1], val[2])\n \n result\nend",
"title": ""
},
{
"docid": "7da3de66c964dc67ca063b21bf527ecf",
"score": "0.4935826",
"text": "def _reduce_34(val, _values, result)\n result = @builder.logical_op(:and, val[0], val[1], val[2])\n \n result\nend",
"title": ""
},
{
"docid": "7da3de66c964dc67ca063b21bf527ecf",
"score": "0.4935826",
"text": "def _reduce_34(val, _values, result)\n result = @builder.logical_op(:and, val[0], val[1], val[2])\n \n result\nend",
"title": ""
},
{
"docid": "a2500d903264dbc831eee398f9f94902",
"score": "0.4935356",
"text": "def build_database_search_condition(ids) \n operator = case ids.count\n when 0 then ' = NULL '\n when 1 then ' = ? '\n else ' IN (?) '\n end\n \n table = active_scaffold_config.model.table_name\n primary_key = active_scaffold_config.model.primary_key\n [\"#{table}.#{primary_key} #{operator}\", ids]\n end",
"title": ""
},
{
"docid": "7dbd223e878683ab0f18acd11f073aa0",
"score": "0.4934539",
"text": "def apply_filter(scope, value)\n branches = normalize_filters(value).reduce { |a, b| a.or(b) }\n scope.merge branches\n end",
"title": ""
}
] |
66e21a458b23cce0f48c359b9d8b7d7d
|
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
|
[
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.0",
"text": "def context; end",
"title": ""
}
] |
[
{
"docid": "d1758edd04b6374162470ca44c3f1250",
"score": "0.6871894",
"text": "def context\n unless @instance_context\n @instance_context = AuthTokenPromotionContext.new(@version )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "fcc8d61ebc1b17de32c67ea1c1957759",
"score": "0.68632644",
"text": "def context\n unless @instance_context\n @instance_context = AnnotationContext.new(@version , @params['call_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "2445273ba68a741137a17120388e6476",
"score": "0.6829915",
"text": "def context\n unless @instance_context\n @instance_context = PaymentContext.new(@version , @params['account_sid'], @params['call_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "5720fc377e95040adf525c63a86bddc5",
"score": "0.68152946",
"text": "def context\n unless @instance_context\n @instance_context = PaymentContext.new(\n @version,\n @params['account_sid'],\n @params['call_sid'],\n @params['sid'],\n )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "5720fc377e95040adf525c63a86bddc5",
"score": "0.68152946",
"text": "def context\n unless @instance_context\n @instance_context = PaymentContext.new(\n @version,\n @params['account_sid'],\n @params['call_sid'],\n @params['sid'],\n )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c240e207bef26e8e8e95b6ac0776d4ae",
"score": "0.6812421",
"text": "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version, @params['sid'],)\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c240e207bef26e8e8e95b6ac0776d4ae",
"score": "0.6812421",
"text": "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version, @params['sid'],)\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "581b620e95c9f928470f26296226dafe",
"score": "0.68051505",
"text": "def context\n unless @instance_context\n @instance_context = AddressContext.new(@version , @params['account_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "00769245de1e519e86322abe163d7082",
"score": "0.68051076",
"text": "def context\n unless @instance_context\n @instance_context = InteractionContext.new(@version, @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "85d278cf22dd4c8c9d6b4cdbe963ea62",
"score": "0.6789391",
"text": "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version, @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "85d278cf22dd4c8c9d6b4cdbe963ea62",
"score": "0.6789391",
"text": "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version, @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "2d7f6b813bd8949cecb0f0ceeb7339e3",
"score": "0.67869204",
"text": "def context\n unless @instance_context\n @instance_context = AnnotationContext.new(@version, @params['call_sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "dc2dc1b5adbaabb7d7a493527c267322",
"score": "0.6786812",
"text": "def context\n unless @instance_context\n @instance_context = AddressContext.new(@version, @params['account_sid'], @params['sid'],)\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c4c69a584ea5c39267e29996ebb5ba36",
"score": "0.6768594",
"text": "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "cf9055a818811a49657f2e0650199480",
"score": "0.676732",
"text": "def context\n unless @instance_context\n @instance_context = UsageContext.new(@version , @params['sim_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c056295e67397fe07982a9654ff37dda",
"score": "0.67370147",
"text": "def context\n unless @instance_context\n @instance_context = DefaultsContext.new(@version , @params['assistant_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "33b3cf48e7386aa4e2d41052e1295428",
"score": "0.6721106",
"text": "def context\n unless @instance_context\n @instance_context = BusinessContext.new(@version, @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "7a0ea2c7b2174bfdcc58ab9ba4d85bec",
"score": "0.6712639",
"text": "def context\n unless @instance_context\n @instance_context = TriggerContext.new(@version , @params['account_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "02a67fbcca126532f5180946119737d1",
"score": "0.67101777",
"text": "def context\n unless @instance_context\n @instance_context = ArchivedCallContext.new(@version , @params['date'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "578c079cb3a8b285f7e41c10ef8a4bee",
"score": "0.6683156",
"text": "def context\n self.class.new(self)\n end",
"title": ""
},
{
"docid": "b87b17ded93e686370efbafc4d9090b1",
"score": "0.66719323",
"text": "def context\n unless @instance_context\n @instance_context = CallContext.new(@version, @params['account_sid'], @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "b8b99dd2fc7250138c9a0b7d7bfc51d3",
"score": "0.66641396",
"text": "def context\n unless @instance_context\n @instance_context = BindingContext.new(@version , @params['service_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "00c2e08b0bb33203cb2772bc8178ad13",
"score": "0.6640503",
"text": "def context\n unless @instance_context\n @instance_context = CurrentCallContext.new(@version, )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "4ac1b38a2bd5fb6a381531ac78b0db49",
"score": "0.661058",
"text": "def context\n unless @instance_context\n @instance_context = InsightsSessionContext.new(@version )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "34285599f02aa86edf5ea97c0772156d",
"score": "0.6598061",
"text": "def context\n unless @instance_context\n @instance_context = VerificationContext.new(@version , @params['service_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "903034f7f61bb203e67b8597412ff376",
"score": "0.6583486",
"text": "def context\n unless @instance_context\n @instance_context = SessionContext.new(@version , @params['service_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "131e24ce83d82272d969c80474876829",
"score": "0.65720963",
"text": "def context\n unless @instance_context\n @instance_context = AddressConfigurationContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "3088cdfc98ea1d0578658d808d351412",
"score": "0.6570465",
"text": "def build_context\n InterceptionContext.new(@interceptors)\n end",
"title": ""
},
{
"docid": "e09d899413ef55488ab67dff6536e964",
"score": "0.6568277",
"text": "def context\n unless @instance_context\n @instance_context = FlowRevisionContext.new(@version , @params['sid'], @params['revision'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "8e24d595c9f1589400f46ea71239f6fe",
"score": "0.65678656",
"text": "def context\n unless @instance_context\n @instance_context = CompositionHookContext.new(@version, @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "9af871686ca12996803b30d65f00cba2",
"score": "0.65605766",
"text": "def context\n unless @instance_context\n @instance_context = ConfigurationContext.new(@version )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c220f208ac606837fe07211d6d12ba89",
"score": "0.65598965",
"text": "def context\n unless @instance_context\n @instance_context = OpenidDiscoveryContext.new(@version )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "d99c99033983aa98cb0d6164c4ebd1bb",
"score": "0.65575325",
"text": "def context\n unless @instance_context\n @instance_context = SchemaContext.new(@version , @params['id'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "cc5f98b99bcde4453416f11c018824c7",
"score": "0.6547554",
"text": "def context\n unless @instance_context\n @instance_context = ConfigurationContext.new(@version, )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "cc5f98b99bcde4453416f11c018824c7",
"score": "0.6547554",
"text": "def context\n unless @instance_context\n @instance_context = ConfigurationContext.new(@version, )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "0f0c25021a49e9ae47d32e5f03d027fa",
"score": "0.65415525",
"text": "def context\n unless @instance_context\n @instance_context = UserInfoContext.new(@version, )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "15a735aba07c6128d769098c18bf609e",
"score": "0.6540118",
"text": "def in_context(*args, &blk)\n context.instance_exec(*args, &blk)\n end",
"title": ""
},
{
"docid": "608cd0811ab01a8105acfcdd2478cb49",
"score": "0.65385884",
"text": "def context\n unless @instance_context\n @instance_context = OpenidDiscoveryContext.new(@version, )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "dd5a2ff5b0629944c83e706c23c19589",
"score": "0.6533809",
"text": "def context\n unless @instance_context\n @instance_context = AccountContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "83c8ca6b6ae353d3f0986c63fa0099ff",
"score": "0.6530725",
"text": "def context\n unless @instance_context\n @instance_context = VerificationContext.new(@version, @params['service_sid'], @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "83c8ca6b6ae353d3f0986c63fa0099ff",
"score": "0.6530725",
"text": "def context\n unless @instance_context\n @instance_context = VerificationContext.new(@version, @params['service_sid'], @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "43fc25be3834f897b57dbd9586cdeee3",
"score": "0.6529874",
"text": "def context\n unless @instance_context\n @instance_context = UserContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "43fc25be3834f897b57dbd9586cdeee3",
"score": "0.6529874",
"text": "def context\n unless @instance_context\n @instance_context = UserContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "64758baea60be81584b27fc4b4232fdd",
"score": "0.64991",
"text": "def context\n unless @instance_context\n @instance_context = UserContext.new(@version, @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "48d66bbc3993fbc9203839b0095c7346",
"score": "0.6480533",
"text": "def context\n unless @instance_context\n @instance_context = EngagementContextContext.new(\n @version,\n @params['flow_sid'],\n @params['engagement_sid'],\n )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "a6a28eceb83f842cfdb47fb859dcd2ea",
"score": "0.6469857",
"text": "def context\n unless @instance_context\n @instance_context = FlexFlowContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "b41e5f14fc36a0de53c06b7203915550",
"score": "0.6457765",
"text": "def context\n unless @instance_context\n @instance_context = VerificationAttemptContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "bfc2da9ae4d8ca9dadcca48005b3a54d",
"score": "0.6454473",
"text": "def context\n unless @instance_context\n @instance_context = AssessmentsContext.new(@version, @params['assessment_id'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "d5c43c14da62f029d7656f29c7fbacd7",
"score": "0.6450809",
"text": "def context\n unless @instance_context\n @instance_context = ContentContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "649e4b17ee907276135ec1c7565eb283",
"score": "0.6448604",
"text": "def context\n unless @instance_context\n @instance_context = MessageContext.new(@version , @params['account_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "ef3c00c5b2cff11ac25e0c5ae83190b9",
"score": "0.6436881",
"text": "def context\n unless @instance_context\n @instance_context = FlowTestUserContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "47e3b37a0a36a0fd9122ffd2b1af8767",
"score": "0.6429388",
"text": "def context\n unless @instance_context\n @instance_context = ImpressionsRateContext.new(@version, @params['business_sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "0d5e07595aece640a960555df93ca04f",
"score": "0.63745755",
"text": "def context\n unless @instance_context\n @instance_context = UsAppToPersonContext.new(@version , @params['messaging_service_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "45af4642648adf031b1daec173210b5b",
"score": "0.63652766",
"text": "def context\n unless @instance_context\n @instance_context = DeploymentContext.new(@version , @params['fleet_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "50e376d8169750729d667844e83fb5df",
"score": "0.6359984",
"text": "def context\n unless @instance_context\n @instance_context = CompositionContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "8175ea272187ea174e767da5f2fffa3e",
"score": "0.63521093",
"text": "def initialize context\n @context = context\n end",
"title": ""
},
{
"docid": "46273cf4bdbaa5e7a602e7c7fe2707c9",
"score": "0.63508445",
"text": "def Context(object); end",
"title": ""
},
{
"docid": "241a1d72fd5c22e3a14c7902d2642560",
"score": "0.6348875",
"text": "def context\n unless @instance_context\n @instance_context = ChallengeContext.new(@version , @params['service_sid'], @params['identity'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "d77d9f7a42a584323bc0279a1ceb13f7",
"score": "0.6348709",
"text": "def context\n unless @instance_context\n @instance_context = ApprovalFetchContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c4fd7d27abf2f69158c949d6d7c9c27e",
"score": "0.6335909",
"text": "def context(entity)\n @context_factory.new(entity,@distance,self)\n end",
"title": ""
},
{
"docid": "2aea04d4971256233b697837f7472c17",
"score": "0.6328754",
"text": "def initialize context\n @context = context\n end",
"title": ""
},
{
"docid": "de99a84ed76c706ad4e54648d774a47f",
"score": "0.6323376",
"text": "def context\n unless @instance_context\n @instance_context = WebhookContext.new(@version, )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "3ba0f913fd4cbf8e4bb78e2606de5520",
"score": "0.6322338",
"text": "def context\n unless @instance_context\n @instance_context = BuildStatusContext.new(@version , @params['service_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "45f3f48bff38aedc381356f174490bb2",
"score": "0.6320355",
"text": "def context\n unless @instance_context\n @instance_context = WebhookContext.new(@version )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "92e2bfcc91c6b49ce9b1563752573af8",
"score": "0.6305338",
"text": "def context\n unless @instance_context\n @instance_context = ChallengeContext.new(\n @version,\n @params['service_sid'],\n @params['identity'],\n @params['factor_sid'],\n @params['sid'],\n )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "02cab14eba99becc2af252db0a57529c",
"score": "0.63042486",
"text": "def context\n unless @instance_context\n @instance_context = AssessmentsContext.new(@version , @params['assessment_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "6da27fdafa225afd23e30b36581969e5",
"score": "0.6302663",
"text": "def context\n return @target if @target.is_a?(Module) and not @options[:class_methods]\n\n class << @target\n self\n end\n end",
"title": ""
},
{
"docid": "6da27fdafa225afd23e30b36581969e5",
"score": "0.6302663",
"text": "def context\n return @target if @target.is_a?(Module) and not @options[:class_methods]\n\n class << @target\n self\n end\n end",
"title": ""
},
{
"docid": "7de3d6a6480a685752a08089857fe236",
"score": "0.629561",
"text": "def context\n unless @instance_context\n @instance_context = FunctionVersionContentContext.new(@version , @params['service_sid'], @params['function_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "66fee58f5205058224159cd0cb3232b4",
"score": "0.6270371",
"text": "def context\n @context ||= InitialContext.new( properties )\n end",
"title": ""
},
{
"docid": "22b649bbceefa94b6d70a51474e392e2",
"score": "0.6269818",
"text": "def context\n @context ||= create_context\n end",
"title": ""
},
{
"docid": "0ef613ead2e95021a4fc43e752869f60",
"score": "0.6263613",
"text": "def context\n unless @instance_context\n @instance_context = NumberContext.new(@version , @params['destination_number'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "5d292ebd43b1ccb17e576233caa8620d",
"score": "0.62575567",
"text": "def context\n @context ||= Context.new(self)\n end",
"title": ""
},
{
"docid": "d71f61c2041d12695e7b72ad7402d98e",
"score": "0.62555313",
"text": "def context\n unless @instance_context\n @instance_context = BrandContext.new(@version, @params['business_sid'], @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "baba9df4d5a5f598f56fad39b43d5ff5",
"score": "0.6248972",
"text": "def context\n unless @instance_context\n @instance_context = ExportContext.new(@version , @params['resource_type'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c5a84eb678b10de70961ab4b36669309",
"score": "0.6245866",
"text": "def method_missing(method, *args, &block)\n @context.public_send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "80140937adaf7605229391e5b5f5869c",
"score": "0.62382895",
"text": "def context\n unless @instance_context\n @instance_context = AccessTokenContext.new(@version , @params['service_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "9674e4a36210c9a378b746a4ac70e401",
"score": "0.6237742",
"text": "def context\n unless @instance_context\n @instance_context = HostedNumberOrderContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "b9260c3a292f7c62186c1bd45a86979f",
"score": "0.6236172",
"text": "def context\n unless @instance_context\n @instance_context = NumberContext.new(@version , @params['number'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "a96c9d530f6e47d7b200f5fe3deca275",
"score": "0.6233493",
"text": "def context\n unless @instance_context\n @instance_context = SafelistContext.new(@version , @params['phone_number'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "eed4a945503e79452f822d0616145ba6",
"score": "0.6209724",
"text": "def context\n unless @instance_context\n @instance_context = InsightsUserRolesContext.new(@version )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "82d9d128252b846a3d3d3ce1fefc7c6a",
"score": "0.6201323",
"text": "def context\n unless @instance_context\n @instance_context = DeactivationsContext.new(@version, )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "9ef00fdf1d0781f3732e0bb79acd7e24",
"score": "0.6197985",
"text": "def context\n unless @instance_context\n @instance_context = CallSummaryContext.new(@version, @params['call_sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "a11b4951823ec11fc676569ee161a582",
"score": "0.61971056",
"text": "def context\n unless @instance_context\n @instance_context = FormContext.new(@version, @params['form_type'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "ba7918d297ea67f1d536c93ce6595c30",
"score": "0.6186394",
"text": "def context\n @context ||= Context.new(self)\n end",
"title": ""
},
{
"docid": "ba7918d297ea67f1d536c93ce6595c30",
"score": "0.6186394",
"text": "def context\n @context ||= Context.new(self)\n end",
"title": ""
},
{
"docid": "ba7918d297ea67f1d536c93ce6595c30",
"score": "0.6186394",
"text": "def context\n @context ||= Context.new(self)\n end",
"title": ""
},
{
"docid": "77ba6358cff02603c0658e61c808df16",
"score": "0.6185342",
"text": "def context\n unless @instance_context\n @instance_context = JobContext.new(@version , @params['job_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "73257a418f1c8cf5bb446836ca678840",
"score": "0.61847216",
"text": "def context\n unless @instance_context\n @instance_context = MediaProcessorContext.new(@version, @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "1366d218a7f9809533d248a88876974d",
"score": "0.61723137",
"text": "def context\n extract_ids\n apply_builders\n @ctx\n end",
"title": ""
},
{
"docid": "810495a9282a5056ae8427d9178abe60",
"score": "0.61683565",
"text": "def initialize(context, options = {})\n @context = context\n @context << self\n @options = options\n setup\n end",
"title": ""
},
{
"docid": "ed5fc4f6b8abf10f5ea1dd50d08630dc",
"score": "0.61618596",
"text": "def context\n unless @instance_context\n @instance_context = DomainConfigContext.new(@version , @params['domain_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c22d5c9ef51f1d7d1250a9757e6f1253",
"score": "0.6160789",
"text": "def context\n unless @instance_context\n @instance_context = PhoneNumberContext.new(@version , @params['phone_number'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "33fbe17ec7b4c5023e8bcb38ea7685e9",
"score": "0.61597556",
"text": "def context\n unless @instance_context\n @instance_context = OauthContext.new(@version, )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "414f54e4fb99a862617f49daf0f7766e",
"score": "0.61488277",
"text": "def context\n unless @instance_context\n @instance_context = PhoneNumberContext.new(@version, @params['phone_number'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "414f54e4fb99a862617f49daf0f7766e",
"score": "0.61488277",
"text": "def context\n unless @instance_context\n @instance_context = PhoneNumberContext.new(@version, @params['phone_number'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "2f38ce8c0986f8a6f04234aa08d80f93",
"score": "0.61426234",
"text": "def context\n unless @instance_context\n @instance_context = TollfreeVerificationContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "56028d01fd3212f95d0a406cad6dcba2",
"score": "0.61424047",
"text": "def context\n self.class.context\n end",
"title": ""
},
{
"docid": "14b53b35f6d7ef9a21f1edfdfcb1b7f5",
"score": "0.6136024",
"text": "def context\n unless @instance_context\n @instance_context = PhoneNumberContext.new(@version, @params['phone_number'],)\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "adcf99ccfd064a0e96428363c9ccc1ed",
"score": "0.6119371",
"text": "def context\n unless @instance_context\n @instance_context = FormContext.new(@version , @params['form_type'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "8f73bd0f7b871759dea732b538d4caa8",
"score": "0.61156446",
"text": "def context\n unless @instance_context\n @instance_context = WorkflowStatisticsContext.new(@version , @params['workspace_sid'], @params['workflow_sid'])\n end\n @instance_context\n end",
"title": ""
}
] |
9bb8362d535395fcbf05f825a5316bd8
|
numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the first seven triangle numbers: 1: 1 3: 1,3 6: 1,2,3,6 10: 1,2,5,10 15: 1,3,5,15 21: 1,3,7,21 28: 1,2,4,7,14,28 We can see that 28 is the first triangle number to have over five divisors. What is the value of the first triangle number to have over five hundred divisors?
|
[
{
"docid": "bafddcd4ef93b618b64e36c956c082dc",
"score": "0.0",
"text": "def count_divisors(num)\n return 1 if num == 1\n cap = Math.sqrt(num)\n divisors = 0\n\n (1..cap).each do |i|\n if num % i == 0\n divisors += 2\n end\n end\n\n divisors += 1 if cap == cap.floor\n\n divisors\nend",
"title": ""
}
] |
[
{
"docid": "57820fcb9e14bdee89e97999280a1938",
"score": "0.79713845",
"text": "def triangle_divisors8(max)\n sum = 1\n n = 2\n factors = 0\n\n until factors > max\n factors = 0\n sum += n\n divisor = 1\n square_root = Math.sqrt(sum)\n while divisor <= square_root\n if sum % divisor == 0\n divisor < square_root ? factors += 2 : factors += 1\n end\n divisor += 1\n end\n n += 1\n end\n sum\nend",
"title": ""
},
{
"docid": "38196a9b66f18dec7ff4afc411d351aa",
"score": "0.7669345",
"text": "def triangle_divisors5(max)\n sum = 1\n n = 2\n divisors = Set.new\n\n until divisors.size > max\n divisors.clear\n sum += n\n divisor = 1\n square_root = Math.sqrt(sum)\n while divisor <= square_root\n divisors += [divisor, (sum / divisor)] if sum % divisor == 0\n divisor += 1\n end\n n += 1\n end\n sum\nend",
"title": ""
},
{
"docid": "193d6fa64459cabf25d6e31700758fdc",
"score": "0.7600398",
"text": "def triangle_divisors7(max)\n sum = 1\n n = 2\n divisors = Set.new\n\n until divisors.size > max\n divisors.clear\n sum += n\n divisor = 1\n square_root = Math.sqrt(sum)\n while divisor <= square_root\n divisors.merge([divisor, (sum / divisor)]) if sum % divisor == 0\n divisor += 1\n end\n n += 1\n end\n sum\nend",
"title": ""
},
{
"docid": "4548a325f837a306e39a7a2fad21a592",
"score": "0.758926",
"text": "def solution_12\n def num_of_divisor(n)\n prime_factors(n)\n .map { |p| [p, 1] }\n .inject([]) do |acc, pair|\n if acc.empty? or acc.last.first != pair.first\n acc.push(pair)\n else\n temp = acc.pop\n acc.push([pair.first, pair.last + temp.last])\n end\n end\n .map { |pair| pair.last + 1 }\n .inject(1) { |acc, n| acc * n }\n end\n $tri_numbers.each { |v| return v if num_of_divisor(v) > 500 }\n end",
"title": ""
},
{
"docid": "d41648c74579897f6f45de7b9aca4ea7",
"score": "0.75166106",
"text": "def triangle_number_value(num_of_divisors)\n return 1 if num_of_divisors == 1\n count = 1\n triangle_num = 0\n\n loop do\n divisors = 0\n triangle_num += count\n count += 1\n\n (1..Math.sqrt(triangle_num)).each do |num|\n if triangle_num % num == 0\n divisors += 2\n end\n end\n\n return triangle_num if divisors > num_of_divisors\n end\nend",
"title": ""
},
{
"docid": "8a1edd4836c54197cadfb562c79f0047",
"score": "0.74707866",
"text": "def find_500_divisors\n triangle_num = 0\n natural_num = 1\n divisors = 0\n while divisors < 500\n triangle_num += natural_num\n if triangle_num > 500\n divisor = 1\n divisors = 0\n sqrt = Math.sqrt(triangle_num)\n while divisor <= sqrt\n if triangle_num % divisor == 0\n divisors += 2\n end\n divisor += 1\n end\n if sqrt * sqrt == triangle_num\n divisors -= 1\n end\n end\n natural_num += 1\n end\n return triangle_num\nend",
"title": ""
},
{
"docid": "8c2a339cfebb037a55c81ce593a3ee05",
"score": "0.74505967",
"text": "def triangle_divisors6(max)\n sum = 1\n n = 2\n divisors = Set.new\n\n until divisors.size > max\n divisors.clear\n sum += n\n square_root = Math.sqrt(sum)\n 1.upto(square_root) do |x|\n divisors.merge([x, (sum / x)]) if sum % x == 0\n end\n n += 1\n end\n sum\nend",
"title": ""
},
{
"docid": "2e66eb551de19a8b60a64b6e933f4051",
"score": "0.7429974",
"text": "def highly_divisible_triangle_number\n triangle = current = 1\n\n until MAX < Prime.prime_division(triangle).inject(1) { |product, (_, factor) | product * (factor + 1) }\n current += 1\n triangle += current\n end\n\n triangle\n end",
"title": ""
},
{
"docid": "a7cb81b27b31e5e473e5fcdf271cf557",
"score": "0.73822224",
"text": "def triangle_divisors1(max)\n sum = 1\n n = 2\n divisors = []\n\n until divisors.size > max\n divisors.clear\n sum += n\n (1..sum).each { |x| divisors << x if sum % x == 0 }\n n += 1\n end\n sum\nend",
"title": ""
},
{
"docid": "11852298b5ac984dda4494046a6b3f00",
"score": "0.73661506",
"text": "def find_factors(n)\n p = 1\n factors = 0\n # while the square of divisor is smaller than the triangle number \n # we first need to see if a number is a divisor, and if so, then the square of the number would bring 2 factors\n # otherwise, it is just an increase of one factor\n while p*p <= n\n if (n % p == 0)\n if(p*p < n)\n factors += 2\n else\n factors += 1\n end\n end\n p += 1\n end\n return factors\nend",
"title": ""
},
{
"docid": "d788505867b2d73b15ce374b194b9029",
"score": "0.73544323",
"text": "def p12\n require 'triangles'\n puts 'The first triangle number to have over five hundred divisors is:'\n puts Triangles.first_with_factor_count(500)\n end",
"title": ""
},
{
"docid": "a349e6779198c3baa3bbe3e2a731b8fd",
"score": "0.7316728",
"text": "def triangle_divisors4(max)\n sum = 1\n n = 2\n divisors = Set.new\n\n until divisors.size > max\n divisors.clear\n sum += n\n divisor = 1\n while divisor <= Math.sqrt(sum)\n divisors += [divisor, (sum / divisor)] if sum % divisor == 0\n divisor += 1\n end\n n += 1\n end\n sum\nend",
"title": ""
},
{
"docid": "fd7633f8065395961cb3095f64cfa7db",
"score": "0.72657937",
"text": "def triangle_factors(n, divisor_lim = nil)\n divisor_lim ||= 5\n return triangle(n) if factors(triangle(n)).size > divisor_lim\n triangle_factors(n + 1, divisor_lim)\nend",
"title": ""
},
{
"docid": "c15ea12c2b1bbbce824593211a8bb9d0",
"score": "0.726353",
"text": "def triangle_divisors3(max)\n sum = 1\n n = 2\n divisors = Set.new\n\n until divisors.size > max\n divisors.clear\n sum += n\n divisor_a = 1\n divisor_b = sum / divisor_a\n while divisor_b >= divisor_a\n divisors += [divisor_a, divisor_b] if sum % divisor_a == 0\n divisor_a += 1\n end\n n += 1\n end\n sum\nend",
"title": ""
},
{
"docid": "baeec6f137adfea2393f466d2ccb4421",
"score": "0.7234045",
"text": "def tri_divs(n)\ni = 0\nmatch = false\ntri_num = 0\nfactors = 0\nuntil factors > n do\n i += 1\n factors = 0\n tri_num = triangle_number(i)\n j = 1\n while j <= tri_num\n if tri_num % j == 0\n factors += 1\n end\n j += 1\n end\nend\nputs tri_num\nputs i\nreturn factors\nend",
"title": ""
},
{
"docid": "0afc9de060a753ebb6230b3a4db12832",
"score": "0.7148491",
"text": "def triangle_divisors2(max)\n sum = 1\n n = 2\n divisors = []\n\n until divisors.size > max\n divisors.clear\n sum += n\n (1..(sum/2)).each { |x| divisors << x if sum % x == 0 }\n n += 1\n end\n sum\nend",
"title": ""
},
{
"docid": "5013ef211b3ac8aafd501f3ae8fd5646",
"score": "0.71306616",
"text": "def factors(number)\n factors = []\n iterator = 1\n while iterator * iterator <= number\n if number % iterator == 0\n [iterator, number / iterator].uniq.each {|factor| factors << factor }\n end\n iterator += 1\n end\n factors\nend",
"title": ""
},
{
"docid": "e93d57b625cbf7b478db45f8abcd75c5",
"score": "0.7111959",
"text": "def triangular_divisors(min_divisors)\r\n (min_divisors..Float::INFINITY).lazy.each do |n|\r\n # t is the nth triangular number\r\n t = (1..n).inject(:+)\r\n return t if number_of_factors(t) > min_divisors\r\n end\r\nend",
"title": ""
},
{
"docid": "03d94fe8a5eb078be422f1c9f7855a66",
"score": "0.70886314",
"text": "def tri_div(n)\n i = 0\n divisors = []\n until divisors.uniq.length > n\n divisors = []\n i += 1\n tri_num = triangle_number(i)\n (1..Math.sqrt(tri_num)).each { |x|\n if tri_num % x == 0\n divisors << x && divisors << (tri_num / x)\n end\n }\n end\n puts divisors.uniq.length\n puts i\n puts tri_num\nend",
"title": ""
},
{
"docid": "bc1b1d3441576bf6e3e0484ab461f03d",
"score": "0.7015122",
"text": "def sum_of_factors(number)\n sum = 0\n iterator = 1\n while iterator**2 <= number\n if number % iterator == 0\n [iterator, number / iterator].uniq.each {|factor| sum += factor }\n end\n iterator += 1\n end\n sum\nend",
"title": ""
},
{
"docid": "69a848e1dedfa09b88e58e2b641737ed",
"score": "0.6976206",
"text": "def highly_divisible_triangle_number(min_divisors)\r\n\t#stores most recent triangle number\r\n\tlast_triangle = 0\r\n\r\n\t#check each triangle number until finding one with more than min number of divisors\r\n\t(1..Float::INFINITY).each do |n|\r\n\t\t#get next triangle number\r\n\t\tlast_triangle += n\r\n\r\n\t\treturn last_triangle if find_qty_of_divisors(last_triangle) > min_divisors\r\n\tend\r\nend",
"title": ""
},
{
"docid": "d23cf65d41b198fa536b187522d265a7",
"score": "0.69668263",
"text": "def factor(n)\n factors = []\n\n if (n < 8)\n factors.push(n)\n return factors\n end\n\n itr = 4\n itr = (n / 4).to_i if (n < 25)\n while (itr < n - (n / 2) + 1)\n if (n % (itr) == 0)\n factors.concat(factor(itr))\n factors.concat(factor(n / itr))\n else\n itr = itr + 1\n next\n end\n\n itr = itr + 1\n prod = 1\n for num in factors\n prod = prod * num\n end\n\n return factors if (prod == n)\n end\n\n factors.push(n) if (factors.length == 0) # Primes\n\n return factors\nend",
"title": ""
},
{
"docid": "3ca894eacbedae86e336a397436d5dc0",
"score": "0.6965603",
"text": "def triangular_num(divisors)\n beginning_time = Time.now\n max = 1\n f_length = 1\n\n until f_length > divisors\n # if (divisors - f_length) > 20\n # max += 10\n # else \n max += 1\n # end \n\n # max += 1\n #\tputs 'max' + max.to_s\n tri = sum(1,max)\n #\tputs 'tri' + tri.to_s\n if is_prime?(tri)\n f_length = 2 \n else \n f_length = factors2(tri)\n end \n #\tputs 'f_length' + f_length.to_s\n end\n end_time = Time.now\n puts \"Time elapsed #{(end_time - beginning_time)} seconds\"\n puts max \n puts f_length \n return tri\nend",
"title": ""
},
{
"docid": "c39a7196bc92a0bd1168b132ac01f2b9",
"score": "0.696518",
"text": "def find_factors(number)\n\tfactors = 0\n\tnum = 1\n\t\n\twhile num <= number ** 0.5\n\t\tfactors += 2 if number % num == 0\n\t\tnum+=1\n\tend\n\treturn factors\nend",
"title": ""
},
{
"docid": "b92c4ebd6c26ebae6098ae4eb7f75dbc",
"score": "0.69590473",
"text": "def factors(number)\n factors = []\n (1..number ** 0.5).each do |num|\n if number % num == 0\n factors << num\n factors << number / num unless number / num == number\n end\n end\n factors.uniq\nend",
"title": ""
},
{
"docid": "e0611c50dc61f08af98c3fa6398bbefa",
"score": "0.69170666",
"text": "def triangle_num(num)\n inf = 1/0.0\n number = 0\n (1..inf).each do |x|\n number = (x*(x+1)/2)\n if number%2==0\n if number_divisors(number)>=num\n return x\n end\n end\n end\nend",
"title": ""
},
{
"docid": "8e7ffc83aa05d500e9875a3306e8651e",
"score": "0.6898538",
"text": "def factors num\n (1...num).select do |i|\n i % 3 == 0 || i % 5 == 0\n end.reduce(&:+)\nend",
"title": ""
},
{
"docid": "21d74bfb547c856735a01c4ede46d722",
"score": "0.687166",
"text": "def problem12\n divisors, n, tNum = 0, 0, 0\n while divisors < 500\n n += 1\n divisors = properDivisors(tNum = nthTriangularNumber(n)).count\n end\n tNum\nend",
"title": ""
},
{
"docid": "b5fae7822d3ae6bd25d03af96bbba167",
"score": "0.68704",
"text": "def factors_of(number)\n primes, powers = number.prime_division.transpose\n exponents = powers.map{|i| (0..i).to_a}\n divisors = exponents.shift.product(*exponents).map do |powers|\n primes.zip(powers).map{|prime, power| prime ** power}.inject(:*)\n end\n divisors.sort.map{|div| [div, number / div]}\nend",
"title": ""
},
{
"docid": "c1a89ac20df20d55f77164a13d7cda51",
"score": "0.6870046",
"text": "def proper_divisors(number)\n factors = [1]\n\n factor = 2\n while factor * factor <= number\n if number % factor == 0\n factors << factor\n factors << number / factor\n end\n factor += 1\n end\n\n factors.sort.uniq\nend",
"title": ""
},
{
"docid": "59901cad2ec4833143f1b2079e19d9b0",
"score": "0.68666506",
"text": "def nbr_factors(n)\n Prime.prime_division(n).reduce(1){ |t,(_,m)| t * (m+1) }\nend",
"title": ""
},
{
"docid": "0de4ba4826e467ca099d768ad370bab5",
"score": "0.684964",
"text": "def factorsCount(triangle)\n\t(1..triangle**0.5).to_a.select {|x| triangle % x == 0}.length * 2\nend",
"title": ""
},
{
"docid": "fa876b451afa4e64ddf1e05f781a6c0c",
"score": "0.68289834",
"text": "def first_to_have_x_divisors(x)\n start_time = Time.now\n divisors = 0\n num = 1\n triangle_num = 0\n last_divisors = 0\n until divisors > x\n triangle_num = triangle_number(num)\n factors = prime_factorization(triangle_num)\n exp = get_exponents(factors)\n mod = modify_exponents(exp)\n divisors = number_of_factors(mod)\n if divisors > last_divisors\n puts \"Number: #{num}, Triangle Number: #{triangle_num}, Divisors: #{divisors}, Elapsed Time: #{Time.now - start_time} seconds\"\n last_divisors = divisors\n end\n num += 1\n end\n triangle_num\nend",
"title": ""
},
{
"docid": "03519cf5595c223757e9b6b91a1d8d55",
"score": "0.6820693",
"text": "def factors\n 1.upto(Math.sqrt(self)).select { |i| (self % i).zero? }.inject([]) do |f, i|\n f << self / i unless i == self / i\n f << i\n end.sort\n end",
"title": ""
},
{
"docid": "c211aab92a0f7719863ad9326454fa61",
"score": "0.6819189",
"text": "def factors number\n\n return number if number < 2\n\n factor_array = [1]\n upper_bound = (number ** 0.5).to_i\n\n (2..upper_bound).each do |possible_factor|\n\n if number % possible_factor == 0\n factor_array << possible_factor\n factor_array << number / possible_factor\n end\n end\n\n factor_array.uniq.sort\nend",
"title": ""
},
{
"docid": "ca2aaedf1a70c05f91d6938884998876",
"score": "0.68095833",
"text": "def factors\n (1..100).each do |num|\n factors = []\n i = 1\n factor = num\n while factor > i\n if num % i == 0\n factor = num / i\n factors << factor\n factors << i\n end\n i += 1\n end\n puts \"#{num} : \" + factors.to_s\n end\nend",
"title": ""
},
{
"docid": "8e3dad5db005f268de87c90c9aa3f346",
"score": "0.679892",
"text": "def factors_refactored(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0 || dividend < 0\n divisors\nend",
"title": ""
},
{
"docid": "bc993030657b8c0e3180ad418ba0c80a",
"score": "0.6795205",
"text": "def factors_of number\n factors = Set.new\n\n return factors.add(1) if number == 1\n\n # I'm assuming only half of the numbers need to\n # be tested. Could be wrong on this!\n 1.upto(number/2).each do |divisor| \n if number % divisor == 0 \n if factors.add? divisor \n factors.add number / divisor \n else\n # When we can't add a divisor to our\n # set of factors, then we've found all the factors\n break\n end\n end\n end\n\n factors\nend",
"title": ""
},
{
"docid": "671c0f060845010849695e1212efabcc",
"score": "0.6789608",
"text": "def pthFactor(n, p)\n #FOURTH AND FINAL ATTEMPT\n return 1 if n == 1 && p < 2 #check if p is greater than 1\n return 0 if p > n\n return 0 if n.to_i == 0\n\n # upper = n / 2\n # lower = 2\n factors = [1]\n final_arr = []\n digits = n.to_s.chars.map {|digit| digit.to_i}\n p \"all digits: #{digits}\"\n # LOOP, until lowerbound == upperbound --- U = n/2, L = 1\n # return factors[p - 1] if factors.length == p\n if n % 2 == 0 || digits[-1] % 2 == 0 \n p \"digits[-1]: #{digits[-1]}\"\n factors << 2 \n end\n if n % 3 == 0 || digits.sum % 3 == 0\n p \"digits sum: #{digits.sum}\"\n factors << 3\n end\n if n % 4 == 0 || (digits[-1] + digits[-2]) % 4 == 0\n factors << 4\n end\n if n % 5 == 0 || digits[-1] == 0\n factors << 5\n end\n if n % 2 == 0 && n % 3 == 0\n factors << 6\n end\n if n % 7 == 0 \n factors << 7\n end\n if n % 8 == 0 || digits.pop(3).join % 8 == 0 \n p \"number 8: #{digits.pop(3)}\"\n factors << 8\n end\n if n % 9 == 0 || (digits.sum % 9 == 0 && n % 9 == 0)\n p \"digits sum(9): #{digits.sum}\"\n factors << 9\n end\n if n % 10 == 0 || digits[-1] == 0\n factors << 10\n end\n if n % 11 == 0\n factors << 11\n end\n if n % 12 == 0 || (n % 4 == 0 && n % 3 == 0) \n factors << 12\n end\n\n p \"FACTORS AFTER IFS: #{factors}\"\n\n # now we can loop until our lower bound reaches our upper bound\n lower = 13\n upper = n / 2\n counter = 1\n while lower <= upper\n #NEW REITERATION\n #MAX NUMBER --> 1,000,000,000 and 500mil, 250mil\n if counter == 100000000\n return 1 if p == 1\n return n if p == 2\n return 0 if p > 2 \n end \n if n % lower == 0\n factors << lower\n upper = n / lower\n end\n lower += 1\n counter += 1\n end\n\n p \"FACTORS AFTER WHILE LOOP: #{factors}\"\n\n # duplicate factors array\n factors.each do |num|\n final_arr << num\n end\n #then loop backwards and add the divisors n / factors[index]\n factors.reverse.each do |num|\n final_arr << n / num unless final_arr.include?(n / num)\n end\n\n return 0 if p > final_arr.length\n\n p \"final_arr BEFORE SORT: #{final_arr}\"\n p \"final_arr: #{final_arr}\"\n p \"final_arr length: #{final_arr.length} and p: #{p}\"\n p \"final result: #{final_arr[p - 1]}\"\n\n return final_arr[p - 1]\n\n\nend",
"title": ""
},
{
"docid": "407b5196d40d4cba92801ceff3b923d9",
"score": "0.67856777",
"text": "def factors_of( number )\n\t# Get the low factors\n\tlow_factors = (1..Math.sqrt(number).floor).find_all { |f| number%f == 0 }\n\t# Get the high factors\n\tfactors = Array.new(low_factors)\n\tlow_factors.each { |f| factors << number/f if f != 1 }\n\t# For perfect squares the last factor added will be a duplicate of the last low factor\n\tfactors.slice!(factors.length-1) if factors.length > 1 and factors.last == low_factors.last \n\tfactors\nend",
"title": ""
},
{
"docid": "5dfb71be901102b1a4e335f500dcba56",
"score": "0.67825973",
"text": "def proper_divisors(number)\n factors = [1]\n\n factor = 2\n while factor * factor <= number\n if number % factor == 0\n factors << factor\n factors << number / factor\n end\n factor += 1\n end\n\n factors.sort\nend",
"title": ""
},
{
"docid": "74e6b62d39bb145f47923b995fd4f7b1",
"score": "0.6775254",
"text": "def factors_v2(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "151f3244f6c399c699fe48c7f0a4d49f",
"score": "0.6763561",
"text": "def factors_refactored(number)\n return \"number must be greater than zero\" unless number > 0\n dividend = number\n divisors = []\n until dividend.zero?\n divisors << number / dividend if (number % dividend).zero?\n dividend -= 1\n end\n divisors\n end",
"title": ""
},
{
"docid": "7ca0705c0f42e2a83be671bb824088df",
"score": "0.67601544",
"text": "def factors(number)\n dividend = number\n divisors = []\n while divident > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\n end",
"title": ""
},
{
"docid": "50fdff40c622e5ff0f010c5385e3524a",
"score": "0.67554873",
"text": "def factors(number)\n divisors = []\n dividend = number\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -=1\n end\n divisors\nend",
"title": ""
},
{
"docid": "af33e4853a650b0e4a46dc502c82b03e",
"score": "0.67527795",
"text": "def factorize(number)\n factors = []\n (1..(Math::sqrt(number).to_i)).each do |n|\n if((number % n) == 0)\n factors << n\n factors << (number / n)\n end\n end\n factors.sort\nend",
"title": ""
},
{
"docid": "65f4f5e407a89d3f9645fb0d5019ee5d",
"score": "0.67316234",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividened -= 1\n end until dividened == 0\n divisors\nend",
"title": ""
},
{
"docid": "b324c17c0bb7d5bf049bce4103647974",
"score": "0.6728183",
"text": "def factors(number)\n dividend = number\n divisors = []\n while number > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\n end",
"title": ""
},
{
"docid": "6b9d9d6713378527c884c8024096a581",
"score": "0.67278975",
"text": "def factors(number)\n dividend = numberdivisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 0\n end\n divisors\nend",
"title": ""
},
{
"docid": "accf2af8cb3dca68ba2f2d5373d14181",
"score": "0.6721948",
"text": "def factors(number)\n dividend = number\n divisors = []\n (1..number).to_a.reverse.each do |dividend|\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "89236942a440a52a8345f3c276e425c5",
"score": "0.67183644",
"text": "def triangular(number)\n sum = 0\n count = 2\n triangle_number = 3\n flag = false\n while flag == false\n triangle_number = triangle_number + count + 1\n if find_factors(triangle_number).length > number\n flag = true\n end\n count += 1\n end\n return triangle_number\nend",
"title": ""
},
{
"docid": "1534c791b8c0641fffa5e51a1d0186c1",
"score": "0.66904676",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n \tdividend -= 1\n end\n p divisors\nend",
"title": ""
},
{
"docid": "ba2e3e4b4077f506a73f3507b4b12fc0",
"score": "0.66819906",
"text": "def factor(num)\n num = num.to_i\n upper = Math.sqrt(num).ceil\n # Always neglect 1 and 0.\n divs = from(2).to(upper)\n factors = divs.inject([ [], num ]) do |acc, div|\n break(acc) if acc.last == 1\n exp = 0\n while ( acc.last % div == 0 )\n exp += 1\n acc[1] = acc[1] / div\n end\n acc.first << [div, exp] if exp > 0\n acc\n end\n if factors.last > 1\n factors.first << [factors.last, 1]\n end\n factors.first\n end",
"title": ""
},
{
"docid": "58b5d6df6c2a47edfc538805887d8488",
"score": "0.6681717",
"text": "def countFactors3(value)\n factors = 1\n value.prime_division.each {|factor, count| factors *= (count+1)}\n factors\nend",
"title": ""
},
{
"docid": "637ab8e144d30ff18d9024af8253aff8",
"score": "0.66806334",
"text": "def factors_for(value)\n factors = [1, value]\n Math.sqrt(value).to_i.downto(2).each do |i|\n if value % i == 0\n factors << i\n factors << value / i\n end\n end\n factors.sort\nend",
"title": ""
},
{
"docid": "7a2ae5c95e47b92d59f4c5aa40209e6d",
"score": "0.66771793",
"text": "def factors(number)\n\tdividend = number\n\tdivisors =[]\n\twhile dividend > 0 do\n\t\tdivisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "ff366114abf2e9bad8174db3fa25cb79",
"score": "0.6674355",
"text": "def TriangleNumbersExeedOn( n )\n\ti = 1\n\twhile ( true )\n\t\t@TriNumber = GetNthTriangleNumber( i )\n\t\tdivCount = GetDivisorsCount( @TriNumber ) \n\t\tif ( n < divCount )\n\t\t\tprint i, \"th : \", @TriNumber, \" has (\", divCount, \")\\n\"\n\t\t\tbreak\n\t\tend\n\n\t\ti += 1\n\tend\nend",
"title": ""
},
{
"docid": "e1903a52bb3c4856ce99f98209666d0e",
"score": "0.6672234",
"text": "def number_of_factors(number)\n count = 2\n i = 2\n begin\n count += 2 if number % i == 0\n i += 1\n end until i * i > number - 1\n count += 1 if i * i == number\n count\nend",
"title": ""
},
{
"docid": "67599addcc1c201e48988d641d8263fc",
"score": "0.6671707",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend <= 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.666288",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "c5577c4d1591fd2da08cfce27d18efe9",
"score": "0.6662651",
"text": "def factor_number(n)\r\n if n == 1\r\n return 1\r\n end\r\n num = 2\r\n 2.upto Math.sqrt(n).to_i do |div|\r\n if n % div == 0\r\n num += 2\r\n end\r\n end\r\n return num\r\nend",
"title": ""
},
{
"docid": "6337767db1a5db2c4c1b12c36f754765",
"score": "0.66608965",
"text": "def get_factors(number)\n factors = []\n (1..Math.sqrt(number).to_i).each do |num|\n if (number % num).zero?\n factors << num\n factors << number / num\n end\n end\n factors\nend",
"title": ""
},
{
"docid": "7a50cd50813bf6186ab167d0752c532f",
"score": "0.66566336",
"text": "def find_qty_of_divisors(num)\r\n\t#get prime factors of num\r\n\tprime_factors = prime_factorize(num)\r\n\t# handle num == 1\r\n\treturn 1 if prime_factors.empty?\r\n\r\n\texponents = prime_factors.values\r\n\t# formula for number of divisors according to e.g. http://primes.utm.edu/glossary/xpage/tau.html\r\n\texponents.inject(1){|memo, exponent| memo * (exponent + 1)}\r\nend",
"title": ""
},
{
"docid": "2a2dce23c946fb2a474d6e9a3815df07",
"score": "0.6656061",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -=1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "eee821e4419a14c594d305fbdaa54332",
"score": "0.66529894",
"text": "def factors(n)\n\n # increments from 1 to the sqrt of n, selecting\n # numbers that are divisible\n (1..Math.sqrt(n)).select do |val|\n (n % val).zero?\n\n # adds divisble numbers to an arr. divides n by the divisor, i,\n # and adds that number if it does not equal n\n end.inject([]) do |arr, i|\n arr << i\n arr << n / i unless i == n / i\n arr\n end.sort\nend",
"title": ""
},
{
"docid": "7f6a3644e1c1763c977121e0efd756df",
"score": "0.66524225",
"text": "def problem5()\n\n\t#list of factors(excluding 20), which contain the set (1..20) as factors\n\tdivisors =*(11..19)\n\tnum = 20\n\n\t#check multiples of 20 for a number that is divisable by all unique factors\n\twhile true\n\t\tisMultiple = true\n\t\tdivisors.each do |d|\n\t\t\tif num % d != 0\n\t\t\t\tisMultiple = false\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\n\n\t\tif isMultiple\n\t\t\treturn num\n\t\telse\n\t\t\tnum += 20\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "36492b55a0dad21f2ae4474f73cda0b0",
"score": "0.6648484",
"text": "def least_factor(n) \n return 0 if (n == 0) \n return 1 if (n % 1 > 0 || n * n <2)\n return 2 if (n % 2 == 0) \n return 3 if (n % 3 == 0) \n return 5 if (n % 5 == 0) \n m = Math.sqrt(n)\n i = 7\n while i <= m do \n return i if (n % i == 0) \n return i + 4 if (n % (i + 4) == 0) \n return i + 6 if (n % (i + 6) == 0) \n return i + 10 if (n % (i + 10) == 0) \n return i + 12 if (n % (i + 12) == 0) \n return i + 16 if (n % (i + 16) == 0) \n return i + 22 if (n % (i + 22) == 0)\n return i + 24 if (n % (i + 24) == 0)\n i += 30\n end\n n\nend",
"title": ""
},
{
"docid": "36492b55a0dad21f2ae4474f73cda0b0",
"score": "0.6648484",
"text": "def least_factor(n) \n return 0 if (n == 0) \n return 1 if (n % 1 > 0 || n * n <2)\n return 2 if (n % 2 == 0) \n return 3 if (n % 3 == 0) \n return 5 if (n % 5 == 0) \n m = Math.sqrt(n)\n i = 7\n while i <= m do \n return i if (n % i == 0) \n return i + 4 if (n % (i + 4) == 0) \n return i + 6 if (n % (i + 6) == 0) \n return i + 10 if (n % (i + 10) == 0) \n return i + 12 if (n % (i + 12) == 0) \n return i + 16 if (n % (i + 16) == 0) \n return i + 22 if (n % (i + 22) == 0)\n return i + 24 if (n % (i + 24) == 0)\n i += 30\n end\n n\nend",
"title": ""
},
{
"docid": "ae37bfb1bbef57d3ef7d7945a059b201",
"score": "0.66478723",
"text": "def factors(number)\n dividend = number\n divisors = []\n while number > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "e3e792186022e7a524c6be13d9719ee0",
"score": "0.66452366",
"text": "def factors_of(n)\n result = []\n (1..n/2).each do |x|\n quotient, remainder = n.divmod x\n if remainder.zero?\n result << quotient\n result << x\n end\n end\n result.uniq\nend",
"title": ""
},
{
"docid": "5dc245c969cbebad3440c16a98da011e",
"score": "0.6644813",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "be64539cb52cd4af0d8508b136cec2b0",
"score": "0.6643824",
"text": "def factors(noriginal) # gives n's factors\n factors = [1, noriginal] # We know 1 and n are always factors\n f = 2\n\n begin\n n = noriginal\n\n while f * f <= n # Only check up to sqrt(n)\n if n % f == 0\n factors << f << n / f \n n /= f\n else\n\n f += 1\n if noriginal % f == 0 # catches divisors you missed with n < noriginal\n factors << f << noriginal / f\n end\n end\n end \n\n f += 1\n end until f * f > noriginal # Overall, only check up to sqrt(noriginal)\n\n factors.uniq.sort # sort and remove duplicates\nend",
"title": ""
},
{
"docid": "1a4bce797a26b7a562805f9d1799d49b",
"score": "0.6638512",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n p divisors\nend",
"title": ""
},
{
"docid": "9152fd283b9683b7240b5e87e60cb4c2",
"score": "0.6638347",
"text": "def factors n\n 1.upto(Math.sqrt(n)).select{|x| (n % x).zero?}.inject([]) do |arr,x|\n arr << x\n arr << n/x unless x == n/x\n arr.sort\n end\nend",
"title": ""
},
{
"docid": "2f7a5f1db418af0c01627e5f8ff718a9",
"score": "0.6635357",
"text": "def factors(number)\n dividend = number\n divisors = []\n until dividend <= 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "e39e6454403a71f32fa18af6e0909895",
"score": "0.6634102",
"text": "def calculate(number)\n n = 1\n num_of_divisors_n = 1\n num_of_divisors_n_1 = 1\n while (num_of_divisors_n*num_of_divisors_n_1 < number) do\n n+=1\n num_of_divisors_n = num_of_divisors_n_1\n num_of_divisors_n_1 = number_of_divisors_without_one_2_factor(n+1)\n end\n return (n * (n + 1)) / 2\n end",
"title": ""
},
{
"docid": "cd6f290f22a63b3688fab14365daff2a",
"score": "0.663264",
"text": "def factors(number)\n dividend = number\n divisors = []\n\n if dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "94e83d3196acffeeb983a5b9e5e52a39",
"score": "0.6632195",
"text": "def solution(n)\n return 1 if n == 1\n \n factors = 2\n limit = Math.sqrt(n).floor\n if limit * limit == n\n factors += 1 \n limit -= 1\n end\n \n (2..limit).each { |number|\n factors += 2 if n % number == 0\n }\n\n factors\nend",
"title": ""
},
{
"docid": "41cd9ea2fce3b2fcdfad72a765f46c38",
"score": "0.66314036",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "41cd9ea2fce3b2fcdfad72a765f46c38",
"score": "0.66314036",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "41cd9ea2fce3b2fcdfad72a765f46c38",
"score": "0.66314036",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "41cd9ea2fce3b2fcdfad72a765f46c38",
"score": "0.66314036",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
}
] |
ff9e4d6deafb5c3f62c2f48dc1bdc19e
|
returns true if the two cuboids intersect each other. False otherwise.
|
[
{
"docid": "0f2991089e36df3260d91f41e83c9fb3",
"score": "0.725815",
"text": "def intersects?(other)\n raise \"NOT A CUBOID\" unless other.is_a? Cuboid \n self_range = range_finder\n other_range = other.range_finder\n\n self_range.each do |k,_|\n return false unless overlap?(self_range[k], other_range[k])\n end \n\n true \n end",
"title": ""
}
] |
[
{
"docid": "51bece58c24a848f3ad66b622b2e459f",
"score": "0.78990805",
"text": "def intersects?(other_cuboid)\n\t\toverlaps_along_x_with?(other_cuboid) && overlaps_along_y_with?(other_cuboid) && overlaps_along_z_with?(other_cuboid)\n\tend",
"title": ""
},
{
"docid": "84ad31575cc8b86c4cb5b465fef82678",
"score": "0.76804894",
"text": "def intersects?(cuboid)\n return true if self == cuboid\n !left_face_is_right_of_other_right_face(cuboid) &&\n !right_face_is_left_of_other_left_face(cuboid) &&\n !top_face_is_below_other_bottom_face(cuboid) &&\n !bottom_face_is_above_other_top_face(cuboid) &&\n !front_face_is_behind_other_back_face(cuboid) &&\n !back_face_is_front_other_front_face(cuboid)\n end",
"title": ""
},
{
"docid": "6d31b744e12173ea4b53c8800b71540d",
"score": "0.7523567",
"text": "def intersects?(cuboid)\n cuboid.vertices.each do |vertex|\n if self.contains?(vertex) || self.touches?(vertex)\n return true\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "8e28020d9e4e195e8c9a1540a38350d5",
"score": "0.70820683",
"text": "def intersects?(other)\n return false if separate? other\n return false if contained? other\n return false if coincident? other\n true\n end",
"title": ""
},
{
"docid": "93ae7e9bfc970ccf8680df65b5d28f6c",
"score": "0.70796764",
"text": "def intersects?(other)\n self_index = dimensions(self.vertices)\n other_index = dimensions(other.vertices)\n\n intersection = {}\n intersection[:x] = self_index[:x] & other_index[:x]\n intersection[:y] = self_index[:y] & other_index[:y]\n intersection[:z] = self_index[:z] & other_index[:z]\n\n intersection.value?([]) ? false : true\n end",
"title": ""
},
{
"docid": "a25ad6c20a36a6a57d396ea18b30d578",
"score": "0.6934062",
"text": "def intersects?(other)\n if !(self.x2 < other.x1) &&\n !(other.x2 < self.x1) &&\n !(self.y2 < other.y1) &&\n !(other.y2 < self.y1) &&\n !(self.z2 < other.z1) &&\n !(other.z2 < self.z1)\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "bd517802d559853773d1bc3322e6ac95",
"score": "0.6906339",
"text": "def intersects?(other)\n other.vertices.each do |vertex|\n return true if interior?(vertex)\n end\n false\n end",
"title": ""
},
{
"docid": "945803093decb8cc349acb56c4a5996e",
"score": "0.68007666",
"text": "def intersects?(other)\n return false if self.xMax < other.xMin\n return false if self.xMin > other.xMax\n return false if self.yMax < other.yMin\n return false if self.yMin > other.yMax\n return false if self.zMax < other.zMin\n return false if self.zMin > other.zMax\n true\n end",
"title": ""
},
{
"docid": "f2a10bb0d8f63ae50e584dfd06256443",
"score": "0.6741866",
"text": "def intersects?(other)\n !!intersection_with(other)\n end",
"title": ""
},
{
"docid": "8bea278f2868138c093bf7c8e5ce93fe",
"score": "0.6598876",
"text": "def intersects?(other)\n if origin <= other.origin\n vertices.each { |vertex| return true if vertex > other.origin }\n else\n other.vertices.each { |vertex| return true if vertex > origin }\n end\n false\n end",
"title": ""
},
{
"docid": "a5577694e6e4fc3f0e71d4aac7ad8d5d",
"score": "0.6483527",
"text": "def intersects?(other)\n return false if self.equal?(other)\n !(above?(other) || below?(other) || right_of?(other) || left_of?(other) || behind?(other) || in_front_of?(other))\n end",
"title": ""
},
{
"docid": "ab4169bdee4f7f28148b9b069fb3b46d",
"score": "0.6462282",
"text": "def colliding?(block)\n x2 > block.x1 &&\n x1 < block.x2 &&\n y2 > block.y1 &&\n y1 < block.y2 &&\n z2 > block.z1 &&\n z1 < block.z2\n end",
"title": ""
},
{
"docid": "6c08e265ab190a9f995444790c45dfbf",
"score": "0.64231575",
"text": "def collision_detected?\n ($boxes - Array(self)).any? do |other_box|\n # .include method with other_square\n other_box.include?(@square)\n end\nend",
"title": ""
},
{
"docid": "11d6f8cd54d6d8b6d6347e1ec9cdbbb6",
"score": "0.6355845",
"text": "def intersects?(other)\n# (@x <= other.x_outer && other.x <= @x_outer) || (@y <= other.y_outer && other.y <= @y_outer) ||\n# (@z <= other.z_outer && other.z <= @z_outer)\n\n\n (other.x < (@x + @l)) && ((other.x + other.l) > @x) &&\n (other.y < (@y + @w)) && ((other.y + other.w) > @y) &&\n (other.z < (@z + @h)) && ((other.z + other.h) > @z)\n\n end",
"title": ""
},
{
"docid": "94ebdfd9d786906dbd787d56f4accbea",
"score": "0.6319558",
"text": "def intersects?(other)\n horizontal_intersection = self.horizontal_intersection?(other)\n vertical_intersection = self.vertical_intersection?(other)\n within_z_index_range = self.within_z_index_range?(other)\n\n return within_z_index_range && vertical_intersection && horizontal_intersection\n\n end",
"title": ""
},
{
"docid": "ab0128961847907fd8fc8c1fbc389a01",
"score": "0.6306597",
"text": "def intersects?(other)\n (@x <= other.x_max && other.x <= @x_max) &\n (@y <= other.y_max && other.y <= @y_max) &\n (@z <= other.x_max && other.z <= @z_max)\n end",
"title": ""
},
{
"docid": "157a06538ae4c4f6b94fbe3592cb1516",
"score": "0.6286855",
"text": "def coincident?(other)\n center.distance(other.center) == 0 and @r == other.r\n end",
"title": ""
},
{
"docid": "bd5c8288e95d61f4ad34fe87dc79ddca",
"score": "0.6268682",
"text": "def crossing?(other); end",
"title": ""
},
{
"docid": "bd5c8288e95d61f4ad34fe87dc79ddca",
"score": "0.6268682",
"text": "def crossing?(other); end",
"title": ""
},
{
"docid": "bd5c8288e95d61f4ad34fe87dc79ddca",
"score": "0.6268682",
"text": "def crossing?(other); end",
"title": ""
},
{
"docid": "a50bb7c5cc392d5876c278d00a803f9e",
"score": "0.6259042",
"text": "def are_colliding?(obj1, obj2)\n obj1.center_x == obj2.center_x && obj1.center_y == obj2.center_y\n end",
"title": ""
},
{
"docid": "b9b89b86d7439c524c5fbd9ace02bc4f",
"score": "0.6226046",
"text": "def included_in?(other_rect)\n self == self.intersects(other_rect)\n end",
"title": ""
},
{
"docid": "76e889e14b18423441ad52508ecb36ec",
"score": "0.62001604",
"text": "def ==(cube) # :nodoc:\n @vbits == cube.bits\n end",
"title": ""
},
{
"docid": "efd3b7a0fd7bebfd54f64d3d256c9910",
"score": "0.6183575",
"text": "def collision_between obj1, obj2\n\t\t\tif obj1.y + obj1.height < obj2.y ; return false ; end\n\t\t\tif obj1.y > obj2.y + obj2.height ; return false ; end\n\t\t\tif obj1.x + obj1.width < obj2.x ; return false ; end\n\t\t\tif obj1.x > obj2.x + obj2.width ; return false ; end\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "0591fe7e6a94ca9681f6d27fe703b2fb",
"score": "0.6138047",
"text": "def intersects?(r2)\n if @p2.x <= r2.p1.x or r2.p2.x <= @p1.x \n return false\n elsif @p2.y >= r2.p1.y or r2.p2.y >= @p1.y\n end\n return true\n end",
"title": ""
},
{
"docid": "146faced9618155c31ee758691cb85bb",
"score": "0.6080084",
"text": "def intersect? rect\n rect.is_a?(Rectangle) && !(@x + @width < rect.x || rect.x + rect.width < @x || @y + @height < rect.y || rect.y + rect.height < @y)\n end",
"title": ""
},
{
"docid": "3aa198bd0029f9c56d286455c6148d4c",
"score": "0.60753834",
"text": "def collide?(other)\r\n max_left = [left, other.left].max\r\n max_top = [top, other.top].max\r\n min_right = [right,other.right].min\r\n min_bottom = [bottom,other.bottom].min\r\n return max_left <= min_right && max_top <= min_bottom\r\n end",
"title": ""
},
{
"docid": "bbc5504fa1e54a05fb0ab73e1a597c25",
"score": "0.6063483",
"text": "def overlap?(object1, object2)\n\t#upper left corner\n\tlx1 = object1.x\n\tly1 = object1.y\n\n\tlx2 = object2.x\n\tly2 = object2.y\n\t\n\t#lower right corner\n\trx1 = object1.x + object1.class::WIDTH\n\try1 = object1.y + object1.class::HEIGHT\n\n\trx2 = object2.x + object2.class::WIDTH\n\try2 = object2.y + object2.class::HEIGHT\n\n\tif rx1 - lx2 < 5 or\n\t\t\trx2 - lx1 < 5 then\n\t\treturn false\n\tend\n\n\tif ry1 - ly2 < 5 or\n\t\t\try2 - ly1 < 5 then\n\t\treturn false\n\tend\n\n\treturn true\nend",
"title": ""
},
{
"docid": "1e137eab4d8298bd221d4b5940fa2ff7",
"score": "0.6031614",
"text": "def ==(c) \n (@x == c.x) && (@y == c.y)\n end",
"title": ""
},
{
"docid": "1013b4d799ad64aafe38710ac904bd1c",
"score": "0.5984925",
"text": "def crossing?(other)\n return false unless overlaps?(other)\n (@begin_pos <=> other.begin_pos) * (@end_pos <=> other.end_pos) == 1\n end",
"title": ""
},
{
"docid": "6fd447e83c21cc19b8c8970d2a97972a",
"score": "0.5982849",
"text": "def eql?(other_grid)\n return @id == other_grid.id\n #return @id == other_grid.id\n #result = false\n #if other_grid.x == @x && other_grid.y == @y \n # result = true\n # for y in 0...other_grid.y do\n # for x in 0...other_grid.x do\n # unless other_grid.block(x, y) == self.block(x, y)\n#\t result = false\n#\t break\n#\t end\n#\tend\n# end\n# end\n# result\n end",
"title": ""
},
{
"docid": "14cc2c85c2d133f3b5722c42e976b617",
"score": "0.5982005",
"text": "def collides?(object2); radius_collision?(object2); end",
"title": ""
},
{
"docid": "4f646a751b4f65931eedecdd0e64faba",
"score": "0.5956904",
"text": "def ==(other_grid)\n return @id == other_grid.id\n #result = false\n #if other_grid.x == @x && other_grid.y == @y \n # result = true\n # for y in 0...other_grid.y do\n # for x in 0...other_grid.x do\n # unless other_grid.block(x, y) == self.block(x, y)\n # \t result = false\n # break\n # \t end\n # \tend\n # end\n # end\n # result\n end",
"title": ""
},
{
"docid": "31c8fff9e9b11fd02fbf516ec98ceb5d",
"score": "0.5948311",
"text": "def collide(block)\n return (block.x == @x && block.y == @y)\n end",
"title": ""
},
{
"docid": "f478924b7453a8edfc12dfeb5b605364",
"score": "0.5938184",
"text": "def ==(other_envelope)\r\n if other_envelope.class != self.class\r\n false\r\n else\r\n upper_corner == other_envelope.upper_corner and lower_corner == other_envelope.lower_corner\r\n end\r\n end",
"title": ""
},
{
"docid": "b502bbdfbac367536682b9edaccfb1f0",
"score": "0.59270656",
"text": "def disjoint?(*args)\n not intersects?(*args)\n end",
"title": ""
},
{
"docid": "5e9ba47a67711f1c5b633c8c7ebc7b22",
"score": "0.591846",
"text": "def contained?(other)\n center.distance(other.center) < (@r - other.r).abs\n end",
"title": ""
},
{
"docid": "3cdb6a32ff7e208d6030f00c5b1c712f",
"score": "0.5917463",
"text": "def disjoint?(other); end",
"title": ""
},
{
"docid": "3cdb6a32ff7e208d6030f00c5b1c712f",
"score": "0.5917463",
"text": "def disjoint?(other); end",
"title": ""
},
{
"docid": "3cdb6a32ff7e208d6030f00c5b1c712f",
"score": "0.5917463",
"text": "def disjoint?(other); end",
"title": ""
},
{
"docid": "d32629c1a32a3fde503dbe4369349a63",
"score": "0.59113294",
"text": "def intersects?(tile)\n return false if tile.id == @id\n # pp rotated_side\n rotated_sides.any? { |side| tile.sides.any? { |their_side| their_side[:side] == side[:side] } }\n end",
"title": ""
},
{
"docid": "4dd507247d2a25968a923d0f793d207d",
"score": "0.58884573",
"text": "def collision?(other)\n Gosu::distance(@x, @y, other.x, other.y) < @radius * @size + other.radius * other.size\n end",
"title": ""
},
{
"docid": "25d1ab93b1f286c2eb26d265fabb8421",
"score": "0.58802646",
"text": "def intersect?(obj)\n obj.x + obj.w > @x && obj.x < @x + @w &&\n (@inverted ? obj.y < get_y(obj) && obj.y + obj.h > @y : obj.y > get_y(obj) && obj.y < @y + @h)\n end",
"title": ""
},
{
"docid": "c14af8ca8e0bf928e6ac1387c6eeef45",
"score": "0.58703655",
"text": "def intersect?(other_set)\n requires_set(other_set, __method__)\n intersection(other_set).any?\n end",
"title": ""
},
{
"docid": "5f748fa6bad556a129e0468aa8cc8971",
"score": "0.5862585",
"text": "def disjoint?(other)\n horizontally_disjoint?(other) || vertically_disjoint?(other)\n end",
"title": ""
},
{
"docid": "e8312b6242ff187dfddc53006e8cc4b9",
"score": "0.5852675",
"text": "def collides?(other)\n !(\n @pos.x + width <= other.pos.x ||\n @pos.x >= other.pos.x + other.width ||\n @pos.y + height <= other.pos.y ||\n @pos.y >= other.pos.y + other.height\n )\n end",
"title": ""
},
{
"docid": "8856bcd2c698fd6e2fe218376cc64e54",
"score": "0.584438",
"text": "def intersects? other\n\t\t\t\tother.any?{|path| include?(path)}\n\t\t\tend",
"title": ""
},
{
"docid": "cc7ff7a982f7d3616dc8bce0e03e0abe",
"score": "0.5834448",
"text": "def intersects?(other)\n @origin.keys.each do |axis|\n return false unless min_lte_max(axis, other) && max_gte_min(axis, other)\n end\n true\n end",
"title": ""
},
{
"docid": "3218bcc4809a2b99245b857b03c3e6a7",
"score": "0.5817375",
"text": "def contains?(other)\n other.corners.all? { |corner| includes_point?(corner) }\n end",
"title": ""
},
{
"docid": "13e3649718772ef0904717483069bb8d",
"score": "0.5794663",
"text": "def fully_includes?(other)\n overlaps?(other) && other == intersection(other)\n end",
"title": ""
},
{
"docid": "af9508592e9cca69dd885ca91fdaa304",
"score": "0.57885706",
"text": "def parallel?(other)\n cross(other).magnitude == 0\n end",
"title": ""
},
{
"docid": "60686aa97fb57e11d9cf9839c2b6f617",
"score": "0.5757734",
"text": "def ==(other)\n if other.is_a?(Moon::Rect)\n x == other.x && y == other.y && w == other.w && h == other.h\n else\n false\n end\n end",
"title": ""
},
{
"docid": "60686aa97fb57e11d9cf9839c2b6f617",
"score": "0.5757734",
"text": "def ==(other)\n if other.is_a?(Moon::Rect)\n x == other.x && y == other.y && w == other.w && h == other.h\n else\n false\n end\n end",
"title": ""
},
{
"docid": "3f6c37188098f6c1962c393a1c4204f7",
"score": "0.575593",
"text": "def intersect?(triangle, lines)\n line1 = [triangle[0], triangle[2]]\n line2 = [triangle[1], triangle[2]]\n \n lines.any? do |line|\n \n int1 = Geom.intersect_line_line line, line1\n int2 = Geom.intersect_line_line line, line2\n \n intersected = false\n \n if(!int1.nil?)\n puts \"#{line1.inspect} intersect #{line.inspect} at #{int1.inspect}\"\n intersected = true if(in_box(line1, int1) && in_box(line, int1))\n end\n \n if (!int2.nil?)\n puts \"#{line2.inspect} intersect #{line.inspect} at #{int2.inspect}\"\n intersected = true if(in_box(line2, int2) && in_box(line, int2))\n end\n \n intersected\n end\n end",
"title": ""
},
{
"docid": "9673ad562f7cc2cc846b56d7bff69c9d",
"score": "0.574239",
"text": "def eql?(other)\n @left == other.left && @middle == other.middle && @right == other.right\n end",
"title": ""
},
{
"docid": "ea95554524f9e1102fd18f6660087754",
"score": "0.5738172",
"text": "def intersects_plane?(inst1,t1,plane_group,t2)\n #we will perform a test intersection to see if any new edges were created.\n if @helper_group==nil\n @helper_group=Sketchup.active_model.active_entities.add_group #this group will contain the edges from the test intersection\n @helper_group.entities.add_cpoint([0,0,0]) #adding a construction point to ensure that this group contains something to avoid automatic deletion by SketchUp\n end\n ents1=get_entities(inst1)\n ents2=@helper_group.entities\n new_edges=ents1.intersect_with(false,t1,ents2,@helper_group.transformation,false,[plane_group])\n\n if new_edges.length>0 #if new edges were created by the intersection\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "a06ef4a88abcfab7db2e8cb9fcc4a583",
"score": "0.5733039",
"text": "def checkCollision?(other)\n refresh()\n other.refresh()\n \n xMin = @center_left[X]\n xMax = @center_right[X]\n yMin = @center_bottom[Y]\n yMax = @center_top[Y]\n\n xMax > other.center_left[X] && xMin < other.center_right[X] && \n yMin > other.center_top[Y] && yMax < other.center_bottom[Y]\n end",
"title": ""
},
{
"docid": "491fa9d386642765bae5e04e975b7312",
"score": "0.57183707",
"text": "def test_obb_vs_obb(rect_a, rect_b)\n @coll_depth = Numeric::POSITIVE_INFINITY\n 2.times do |i|\n axis_a = rect_a.axes[i]\n depth_a = test_intervals(rect_a.projection(axis_a), rect_b.projection(axis_a))\n return false if depth_a == 0\n\n axis_b = rect_b.axes[i]\n depth_b = test_intervals(rect_a.projection(axis_b), rect_b.projection(axis_b))\n return false if depth_b == 0\n\n abs_a = depth_a.abs\n abs_b = depth_b.abs\n\n if abs_a < @coll_depth.abs or abs_b < @coll_depth.abs\n altb = abs_a < abs_b\n @coll_normal = altb ? axis_a : axis_b\n @coll_depth = altb ? depth_a : depth_b\n end\n end\n\n @cpa = rect_a\n @cpb = rect_b\n true\n end",
"title": ""
},
{
"docid": "bc111acce8dfec831e92e82997683d0f",
"score": "0.5702398",
"text": "def collide?(object)\n return false if object == self\n\n hitbox_a = case @direction\n when :down\n hitbox(0, rad_y)\n when :up\n hitbox(0, -rad_y)\n when :right\n hitbox(rad_x, 0)\n when :left\n hitbox(-rad_x, 0)\n end\n hitbox_b = object.hitbox\n\n # Return true if the hitboxes overlap\n (hitbox_a[0] & hitbox_b[0]).any? &&\n (hitbox_a[1] & hitbox_b[1]).any?\n end",
"title": ""
},
{
"docid": "2021f35ded4aa889e217c6d1cd9d9377",
"score": "0.5699178",
"text": "def overlap(first_rect, second_rect)\n a1 = first_rect[0]\n a2 = first_rect[1]\n b1 = second_rect[0]\n b2 = second_rect[1]\n\n if b1[0] < a2[0] && b1[1] < a2[1]\n return true\n else \n return false\n end\n\nend",
"title": ""
},
{
"docid": "91de50969c85f3158f5ea850b2c74b14",
"score": "0.5698288",
"text": "def ==(other)\n other.kind_of?(Vector3D) &&\n other.x == x && other.y == y && other.z == z\n end",
"title": ""
},
{
"docid": "487e61743ca7a6453cb1ab7f9a6eec8d",
"score": "0.5676972",
"text": "def c2?(g,u)\n ok = false\n g.adjacent_vertices(u).each do |v| \n if (@l[v] == nil or @l[v] == 'inf')\n\tg.adjacent_vertices(v).each do |z|\n\t if @l[z] == @i.to_s\n\t ok = true\n\t break\n\t end # if\n\t ok = false\n\tend # do\n\tif ok == false\n\t return false\n\tend # if\n end # if\n end # do\n return true\n end",
"title": ""
},
{
"docid": "94ed7d6a6cf3970a6f4b04347fe23756",
"score": "0.5657628",
"text": "def ==(other)\n return false unless other.is_a?(Client)\n cluster == other.cluster && options == other.options\n end",
"title": ""
},
{
"docid": "94ed7d6a6cf3970a6f4b04347fe23756",
"score": "0.565646",
"text": "def ==(other)\n return false unless other.is_a?(Client)\n cluster == other.cluster && options == other.options\n end",
"title": ""
},
{
"docid": "bd22ed32ccb97f53af649b64b2bd93a6",
"score": "0.5655507",
"text": "def collide_rect?(other_rect)\n !intersects(other_rect).empty?\n end",
"title": ""
},
{
"docid": "50a4a5bafd9410888303dbac60f1246b",
"score": "0.56525326",
"text": "def testLigneContient(a,a2)\n\t\t0.upto(a.size-1) do |x|\n\t\t\tif a[x].couleur != a2[x].couleur && a2[x].couleur != Tuile.getCouleurVide \n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\t\treturn true\n\n\tend",
"title": ""
},
{
"docid": "accd384d23ed0d6fda7cf712ea03bf20",
"score": "0.56496",
"text": "def overlapping?(left, right)\n (tuples(left) & tuples(right)).any?\n end",
"title": ""
},
{
"docid": "a5518cac16582486c0f08f7c37ed179f",
"score": "0.56383556",
"text": "def same_pos?(pos1, pos2)\n pos1 = pos1.pos if pos1.respond_to?(:pos)\n pos2 = pos2.pos if pos2.respond_to?(:pos)\n pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z\n end",
"title": ""
},
{
"docid": "a5518cac16582486c0f08f7c37ed179f",
"score": "0.56383556",
"text": "def same_pos?(pos1, pos2)\n pos1 = pos1.pos if pos1.respond_to?(:pos)\n pos2 = pos2.pos if pos2.respond_to?(:pos)\n pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z\n end",
"title": ""
},
{
"docid": "6d0f4762c1f4887abf41b96245e4a32e",
"score": "0.561625",
"text": "def same?(other)\n (from_end == other.from_end and\n to_end == other.to_end and\n overlap == other.overlap)\n end",
"title": ""
},
{
"docid": "6d0f4762c1f4887abf41b96245e4a32e",
"score": "0.561625",
"text": "def same?(other)\n (from_end == other.from_end and\n to_end == other.to_end and\n overlap == other.overlap)\n end",
"title": ""
},
{
"docid": "3fafb7844cafe9ba6c83826f5d726c76",
"score": "0.56115437",
"text": "def ==(other)\n return false unless other.is_a? Normal3\n @x == other.x && @y == other.y && @z == other.z\n end",
"title": ""
},
{
"docid": "609fcd7b7db92e8281d8d8abd9ec5d0f",
"score": "0.56071544",
"text": "def intersect?(r)\n @x < r.x + r.w && @x + @w > r.x && @y < r.y + r.h && @y + @h > r.y\n end",
"title": ""
},
{
"docid": "75d0e9abcbeae3570dc40b106185c709",
"score": "0.5606568",
"text": "def contained?(other); end",
"title": ""
},
{
"docid": "75d0e9abcbeae3570dc40b106185c709",
"score": "0.5606568",
"text": "def contained?(other); end",
"title": ""
},
{
"docid": "75d0e9abcbeae3570dc40b106185c709",
"score": "0.5606568",
"text": "def contained?(other); end",
"title": ""
},
{
"docid": "a1e3068a9651742ced42e750fb0aa4b2",
"score": "0.5601089",
"text": "def iscrossing(pt1,pt2, theface)\r\n line = [pt1, pt2]\r\n theface.loops.each { |loop|\r\n edges = loop.edges\r\n edges.each { |e| #check each edge to see if it intersects line inside the edge\r\n l2 = [e.vertices[0].position, e.vertices[1].position] # make a line\r\n point = Geom.intersect_line_line(line, e.vertices) # find intersection\r\n if (point != nil)\r\n online1 = isonline(point, line[0], line[1]) # is the point on the line\r\n online2 = isonline(point, e.vertices[0].position, e.vertices[1].position) # is the point on the edge\r\n #ent.add_cpoint(point) if (online1 and online2)\r\n #puts \"online1 #{online1} #{online2}\"\r\n return true if (online1 and online2)\r\n # if (online1 and online2) then we can return true here, no need to process more\r\n end\r\n } # edges.each\r\n } # loops.each\r\n return false\r\n end",
"title": ""
},
{
"docid": "67955cccc83e7ef77115ecc5239f1a00",
"score": "0.5599473",
"text": "def collide\n # For each block of the shape, check if it collides with\n # another block in the game.\n get_blocks.each do |block|\n collision = block.collide_with_other_blocks;\n if (collision)\n return true\n end\n end\n\n # Check if the shape collide with main windows\n bounds = get_bounds\n \n if ( bounds[3] > @game.height )\n return true\n end\n \n if ( bounds[2] > @game.width )\n return true\n end\n \n if ( bounds[0] < 0 )\n return true\n end \n return false\n end",
"title": ""
},
{
"docid": "bbab59c1f69ddbf100c4727d44dfe4db",
"score": "0.5594699",
"text": "def vt_intersects?(*args)\n vt_range.intersects?(*args)\n end",
"title": ""
},
{
"docid": "5fd7f54636a216171d8a377fc4cbe4a7",
"score": "0.5583596",
"text": "def isCollidedWith(obj)\n if(self == obj)\n return false ;\t\t\t\n end\n\n r = @pos.distanceTo(obj.pos) ;\t\n l = @size + obj.size ;\t\t\n\n return (r < l) ;\t\t\n end",
"title": ""
},
{
"docid": "41ee1f3cfd3514643ab3432ba0a1a558",
"score": "0.5570795",
"text": "def deuce?\n @player1.points == 3 && @player2.points == 3\n end",
"title": ""
},
{
"docid": "b40c48ff69107eba586eca47445945d6",
"score": "0.55702764",
"text": "def overlaps?(other); end",
"title": ""
},
{
"docid": "b40c48ff69107eba586eca47445945d6",
"score": "0.55702764",
"text": "def overlaps?(other); end",
"title": ""
},
{
"docid": "b40c48ff69107eba586eca47445945d6",
"score": "0.55702764",
"text": "def overlaps?(other); end",
"title": ""
},
{
"docid": "20a6e0de8cc97dc4102b782d7a2633a8",
"score": "0.55697274",
"text": "def ==(comp)\n comp.x === x && comp.y === y\n end",
"title": ""
},
{
"docid": "defe2943a84e5e99670e00faea5c1c00",
"score": "0.55664885",
"text": "def coprime?(num_1, num_2)\n arr1 = factors(num_1)\n arr2 = factors(num_2)\n final = arr1 & arr2 # & is the intersection of two arrays.\n if final.length != 0\n return false\n else\n return true\n end\nend",
"title": ""
},
{
"docid": "f00be92622257c19b4d0c23df4ac8d24",
"score": "0.55613977",
"text": "def similar_to?(other)\n self.composition == other.composition\n end",
"title": ""
},
{
"docid": "bf41b7e973de3da1191e2b377ca8be8d",
"score": "0.55610186",
"text": "def pieces_equal?(piece1, piece2)\n return true if piece1.empty? && piece2.empty?\n return false if piece1.empty? || piece2.empty?\n\n if piece1.class.superclass == BasicPiece && piece2.class.superclass == BasicPiece\n if piece1.class == piece2.class &&\n piece1.color == piece2.color &&\n piece1.position == piece2.position\n return true\n end\n end\n\n false\nend",
"title": ""
},
{
"docid": "c53ac80c148bca99235b3d57d70296af",
"score": "0.55539584",
"text": "def intersects?(another_geometry)\n raise Error::UnsupportedOperation, \"Method Geometry#intersects? not defined.\"\n end",
"title": ""
},
{
"docid": "85db43c72e293eda927e344ba39de8e7",
"score": "0.55527854",
"text": "def test_intersect1\n # Testing pathological cases: Intersect one cube against another offset.\n model = Sketchup.active_model\n entities = model.entities\n pts = []\n pts[0] = [0, 0, 0]\n pts[1] = [100, 0, 0]\n pts[2] = [100, 100, 0]\n pts[3] = [0, 100, 0]\n\n #Test instance.intersect\n definition = model.definitions.add(\"component\")\n # Add the face to the entities in the group\n face = definition.entities.add_face pts\n status = face.pushpull -100, true\n\n origin = Geom::Point3d.new 0, 0, 0\n transform = Geom::Transformation.new origin\n point = Geom::Point3d.new 0, 25, 0\n t = Geom::Transformation.new point\n\n golden = entities.add_group\n\n pts1 = []\n pts1[0] = [0, 0, 0]\n pts1[1] = [100, 0, 0]\n pts1[2] = [100, 75, 0]\n pts1[3] = [0, 75, 0]\n\n # Add the face to the entities in the group\n face = golden.entities.add_face pts1\n\n status = face.pushpull -100, true\n\n golden.transform! t\n instance1 = entities.add_instance definition, transform\n instance2 = instance1.copy\n instance2.move! t\n\n intersection = instance1.intersect(instance2)\n assert(golden.equals?(intersection), 'instance.intersect failed')\n end",
"title": ""
},
{
"docid": "6cbd9514b1233ba53d899964c6f75e00",
"score": "0.55482304",
"text": "def ==(other)\n result = (other.x == x && other.y == y && other.z == z)\n # puts \"(#{other.x} == #{x} && #{other.y} == #{y} && #{other.z} == #{z}) = #{result.inspect}\"\n result\n end",
"title": ""
},
{
"docid": "cb6d56cc8cb0189bc1dbcab14578520d",
"score": "0.55338717",
"text": "def collision? args\n #The minimum area enclosed by the center of the ball and the 2 corners of the block\n #If the area ever drops below this value, we know there is a collision\n min_area = ((@block_size * 3) * args.state.ball.radius) / 2\n\n #https://www.mathopenref.com/coordtrianglearea.html\n ax = @x1\n ay = @y1\n bx = @x2\n by = @y2\n cx = args.state.ball.center.x\n cy = args.state.ball.center.y\n\n current_area = (ax*(by-cy)+bx*(cy-ay)+cx*(ay-by))/2\n\n collision = false\n if @rotation >= 0\n if (current_area < min_area &&\n current_area > 0 &&\n args.state.ball.center.y > @y1 &&\n args.state.ball.center.x < @x2)\n\n collision = true\n end\n else\n if (current_area < min_area &&\n current_area > 0 &&\n args.state.ball.center.y > @y2 &&\n args.state.ball.center.x > @x1)\n\n collision = true\n end\n end\n\n return collision\n end",
"title": ""
},
{
"docid": "0e22f41b76eaacd01cf9f594be96ba8e",
"score": "0.5530061",
"text": "def eql?(other)\n return false unless other.captures_hash == captures_hash\n return false unless other.squares_hash == squares_hash\n return false unless other.turn == turn\n return false unless other.state == state\n\n true\n end",
"title": ""
},
{
"docid": "8ef67e7d411b9e6bb5d0387e9867bbd6",
"score": "0.55273795",
"text": "def eql?(other)\n (@x == other.x) && (@y == other.y)\n end",
"title": ""
},
{
"docid": "c1514f5892bf5327c52f732e86b5f2a7",
"score": "0.5520432",
"text": "def ==(other)\n other.x == @x && other.y == @y\n end",
"title": ""
},
{
"docid": "02aece91a3b0a2999c419cade92cb175",
"score": "0.55116117",
"text": "def include?(other_square)\n # top left\n @square.contains?(other_square.x1, other_square.y1) || \n # top right\n @square.contains?(other_square.x1, other_square.y2) || \n # bottom right\n @square.contains?(other_square.x1, other_square.y3) || \n # bottom left\n @square.contains?(other_square.x1, other_square.y4) \nend",
"title": ""
},
{
"docid": "4060d6101561ecfa886a6fdf84d43dc8",
"score": "0.54886556",
"text": "def overlap(first_rectangle, second_rectangle)\n\tfirst_rectangle_x1 = first_rectangle[0][0]\n\tfirst_rectanlge_y1 = first_rectangle[0][1]\n\tfirst_rectangle_x2 = first_rectangle[1][0]\n\tfirst_rectanlge_y2 = first_rectangle[1][1]\n\n\tsecond_rectangle_x1 = second_rectangle[0][0]\n\tsecond_rectanlge_y1 = second_rectangle[0][1]\n\tsecond_rectangle_x2 = second_rectangle[1][0]\n\tsecond_rectanlge_y2 = second_rectangle[1][1]\n\n\tif first_rectangle_x1 < second_rectangle_x2 && first_rectangle_x2 > second_rectangle_x1 && first_rectanlge_y1 < second_rectanlge_y2 && first_rectanlge_y2 > second_rectanlge_y1\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend",
"title": ""
},
{
"docid": "b80b3ce0dbf7f0a2c75288fdc2b42f1b",
"score": "0.5477329",
"text": "def scene_collision?\n return false unless solid?\n scene = Gamework::App.current_scene\n return false if scene.nil?\n\n scene.solid_objects.any? {|object| collide?(object)}\n end",
"title": ""
},
{
"docid": "a26e9711284ac2ac95b5606049952427",
"score": "0.5477139",
"text": "def overlaps?(other)\n !disjoint?(other)\n end",
"title": ""
},
{
"docid": "a26e9711284ac2ac95b5606049952427",
"score": "0.5477139",
"text": "def overlaps?(other)\n !disjoint?(other)\n end",
"title": ""
}
] |
c2fa3473fc2cb0986dd034793b3ae3c5
|
Returns the value of the `enabled_features` attribute.
|
[
{
"docid": "65dc012624582b8f1b7a083c9db67cfe",
"score": "0.84536767",
"text": "def enabled_features\n @enabled_features\n end",
"title": ""
}
] |
[
{
"docid": "50b2d7fc154149d17ca6b4ba6f8dc365",
"score": "0.74542683",
"text": "def feature_enabled?(feature)\n @features[feature.to_sym] || false\n end",
"title": ""
},
{
"docid": "85f007714851cba0f22bdb4c8fbbd6eb",
"score": "0.7386152",
"text": "def disabled_features\n @disabled_features\n end",
"title": ""
},
{
"docid": "57cbfe6cd18c67c64854a6234b3e9acd",
"score": "0.7254748",
"text": "def feature_enabled?(key)\n hash_value(features, key.to_s)\n end",
"title": ""
},
{
"docid": "55992b20feb72c2d1bf5e53d22a7e447",
"score": "0.7214238",
"text": "def feature_enabled?(name)\n enabled_features.include?(name)\n end",
"title": ""
},
{
"docid": "12305a49d4bd317980cfafeeebe74bce",
"score": "0.7117192",
"text": "def isFeatureEnabled( featureName ) \n return @featureInfo[featureName.upcase.strip] ? true : false\n end",
"title": ""
},
{
"docid": "7d4b398d766bfe8ed893f0047886f01f",
"score": "0.7100413",
"text": "def features\n FEATURES\n end",
"title": ""
},
{
"docid": "83f3f80d46a766999e2e2a9dcf06ebd9",
"score": "0.7089997",
"text": "def enabled?( name )\n features_service.enabled?( name )\n end",
"title": ""
},
{
"docid": "5d00136f65ff0259a296ddce80a9d06a",
"score": "0.7038161",
"text": "def enabled_features(_value = true)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "246866ab5493fbce257bce69a0c3ac7b",
"score": "0.6987488",
"text": "def feature_settings\n return @feature_settings\n end",
"title": ""
},
{
"docid": "427ad782a34152c246a438207979b74b",
"score": "0.69874656",
"text": "def enabled?(name)\n @enabled_features.include?(name)\n end",
"title": ""
},
{
"docid": "feafc94b51dd07d35aeba42d2e530674",
"score": "0.6937468",
"text": "def state(feature)\n enabled?(feature) ? 'enabled' : 'disabled'\n end",
"title": ""
},
{
"docid": "6e46d9ccb4c89df29ed77735ecb82ba2",
"score": "0.69020826",
"text": "def feature\n return @feature\n end",
"title": ""
},
{
"docid": "8da57179971a77bc3249d5e936b7a4fa",
"score": "0.6810453",
"text": "def enabled\n data[:enabled]\n end",
"title": ""
},
{
"docid": "8da57179971a77bc3249d5e936b7a4fa",
"score": "0.6810453",
"text": "def enabled\n data[:enabled]\n end",
"title": ""
},
{
"docid": "e575a8201b3316ff85165baeb25fcb37",
"score": "0.6792209",
"text": "def features\n return @features\n end",
"title": ""
},
{
"docid": "4b9ff833d6bc8c2d4b2294b10881b0e4",
"score": "0.67840993",
"text": "def __features__\n @__features__\n end",
"title": ""
},
{
"docid": "924ee42119b393d7daf78d10a8dcd044",
"score": "0.6742777",
"text": "def disabled_features\n []\n end",
"title": ""
},
{
"docid": "e6704bcb7563d988e983fea03f6eb184",
"score": "0.6698005",
"text": "def features\n @features ||= @connection['features']\n end",
"title": ""
},
{
"docid": "13ab332b7661b441ac567d45b2c028d8",
"score": "0.6624812",
"text": "def processor_features\n data[:processor_features]\n end",
"title": ""
},
{
"docid": "a1503625250f83193602c41269c398d7",
"score": "0.6616813",
"text": "def enabled\n data.enabled\n end",
"title": ""
},
{
"docid": "55d833670fa739bb52b8e1784fd039fa",
"score": "0.6603919",
"text": "def get_enabled_features(user_id, attributes = nil)\n enabled_features = []\n\n unless @is_valid\n @logger.log(Logger::ERROR, InvalidDatafileError.new('get_enabled_features').message)\n return enabled_features\n end\n\n return enabled_features unless Optimizely::Helpers::Validator.inputs_valid?({user_id: user_id}, @logger, Logger::ERROR)\n\n @config.feature_flags.each do |feature|\n enabled_features.push(feature['key']) if is_feature_enabled(\n feature['key'],\n user_id,\n attributes\n ) == true\n end\n enabled_features\n end",
"title": ""
},
{
"docid": "96bb7302357d3e108f1955f8197c352a",
"score": "0.6596553",
"text": "def enabled\n string_to_bool(@xml_element.attributes['isEnabled'])\n end",
"title": ""
},
{
"docid": "96bb7302357d3e108f1955f8197c352a",
"score": "0.65954834",
"text": "def enabled\n string_to_bool(@xml_element.attributes['isEnabled'])\n end",
"title": ""
},
{
"docid": "bef5191e307cead9a6d6678e56962a15",
"score": "0.6532423",
"text": "def configuration_manager_client_enabled_features\n return @configuration_manager_client_enabled_features\n end",
"title": ""
},
{
"docid": "c98e4c3b4c575b94e6311854f3f50b86",
"score": "0.6506676",
"text": "def enabled_by_feature?(name = nil)\n if !name\n !!feature\n else\n if feature.class == Array\n feature.each do |f|\n if f == name\n return true\n end\n end\n false\n else\n feature == name\n end\n end\n end",
"title": ""
},
{
"docid": "39063dc67551daa6fac86faa938cc6fe",
"score": "0.6478769",
"text": "def feature_enabled?(key)\n feature = resolve_feature(key)\n return false unless feature.enabled?\n\n namespaces = feature.namespace.split('.')\n namespaces.all? do |ancestor_key|\n feature?(ancestor_key) ? resolve_feature(ancestor_key.to_sym).enabled? : true\n end\n end",
"title": ""
},
{
"docid": "4dbcd90e660509800d8b3b85554e844c",
"score": "0.6464029",
"text": "def features\n self.boat_features_set.attributes.select { |k, v| k if v == true }.keys\n end",
"title": ""
},
{
"docid": "f45a18e86b905077c705bd07de6dc8e5",
"score": "0.64577794",
"text": "def enabled\n return @enabled\n end",
"title": ""
},
{
"docid": "f45a18e86b905077c705bd07de6dc8e5",
"score": "0.64577794",
"text": "def enabled\n return @enabled\n end",
"title": ""
},
{
"docid": "f45a18e86b905077c705bd07de6dc8e5",
"score": "0.64577794",
"text": "def enabled\n return @enabled\n end",
"title": ""
},
{
"docid": "015ce39d499ddd161d03432f34290694",
"score": "0.645735",
"text": "def get_enabled_features(user_id, attributes = nil)\n enabled_features = []\n unless is_valid\n @logger.log(Logger::ERROR, InvalidProjectConfigError.new('get_enabled_features').message)\n return enabled_features\n end\n\n return enabled_features unless Optimizely::Helpers::Validator.inputs_valid?(\n {\n user_id: user_id\n }, @logger, Logger::ERROR\n )\n\n return enabled_features unless user_inputs_valid?(attributes)\n\n config = project_config\n\n config.feature_flags.each do |feature|\n enabled_features.push(feature['key']) if is_feature_enabled(\n feature['key'],\n user_id,\n attributes\n ) == true\n end\n enabled_features\n end",
"title": ""
},
{
"docid": "fef5df2d6a040e4b1b9f808755613de0",
"score": "0.64553016",
"text": "def property_features\n self.dig_for_array(\"propertyFeatures\")\n end",
"title": ""
},
{
"docid": "99192e4cbf5c638b86e7ec3f044570d1",
"score": "0.6447763",
"text": "def active_features\n @model.where(active: true).map { |f| f.name.to_sym }\n end",
"title": ""
},
{
"docid": "959302ce5d4fccdc4ea2d071ef022b8f",
"score": "0.6446211",
"text": "def enabled_features_service\n @enabled_features_service ||= ClusterEnabledFeaturesService.new(self, 'enabledfeatures')\n end",
"title": ""
},
{
"docid": "fe3d5f4a394db152f58822f220f222fa",
"score": "0.6440901",
"text": "def enabled_metrics\n data[:enabled_metrics]\n end",
"title": ""
},
{
"docid": "e60cac9e838d6260ecd7f2f4b2609d8d",
"score": "0.6431494",
"text": "def is_enabled\n return @is_enabled\n end",
"title": ""
},
{
"docid": "e60cac9e838d6260ecd7f2f4b2609d8d",
"score": "0.6431494",
"text": "def is_enabled\n return @is_enabled\n end",
"title": ""
},
{
"docid": "e60cac9e838d6260ecd7f2f4b2609d8d",
"score": "0.6431494",
"text": "def is_enabled\n return @is_enabled\n end",
"title": ""
},
{
"docid": "e60cac9e838d6260ecd7f2f4b2609d8d",
"score": "0.6431494",
"text": "def is_enabled\n return @is_enabled\n end",
"title": ""
},
{
"docid": "e60cac9e838d6260ecd7f2f4b2609d8d",
"score": "0.6431494",
"text": "def is_enabled\n return @is_enabled\n end",
"title": ""
},
{
"docid": "e60cac9e838d6260ecd7f2f4b2609d8d",
"score": "0.6431494",
"text": "def is_enabled\n return @is_enabled\n end",
"title": ""
},
{
"docid": "e60cac9e838d6260ecd7f2f4b2609d8d",
"score": "0.6431494",
"text": "def is_enabled\n return @is_enabled\n end",
"title": ""
},
{
"docid": "e60cac9e838d6260ecd7f2f4b2609d8d",
"score": "0.6431494",
"text": "def is_enabled\n return @is_enabled\n end",
"title": ""
},
{
"docid": "e60cac9e838d6260ecd7f2f4b2609d8d",
"score": "0.6431494",
"text": "def is_enabled\n return @is_enabled\n end",
"title": ""
},
{
"docid": "e60cac9e838d6260ecd7f2f4b2609d8d",
"score": "0.6431494",
"text": "def is_enabled\n return @is_enabled\n end",
"title": ""
},
{
"docid": "d1b3822157478ff685495902af6c1aed",
"score": "0.64280874",
"text": "def attributes\n @enabled\n end",
"title": ""
},
{
"docid": "bddb10924f3da67bde82596cb864797a",
"score": "0.6424813",
"text": "def supports?(feature)\n self.send(:class_variable_get, :@@features)[feature] == true\n end",
"title": ""
},
{
"docid": "bddb10924f3da67bde82596cb864797a",
"score": "0.6424813",
"text": "def supports?(feature)\n self.send(:class_variable_get, :@@features)[feature] == true\n end",
"title": ""
},
{
"docid": "f0e28c650f7bec57f99d3114762b4b66",
"score": "0.641338",
"text": "def feature_flags\n @feature_flag_delegate.to_a\n end",
"title": ""
},
{
"docid": "8b37421e4da75e67fae0bed7e5bb27a7",
"score": "0.64122707",
"text": "def isEnabled\n @enabled\n end",
"title": ""
},
{
"docid": "8b37421e4da75e67fae0bed7e5bb27a7",
"score": "0.64122707",
"text": "def isEnabled\n @enabled\n end",
"title": ""
},
{
"docid": "d44d3f33884a4ac6dff8343741ba0e1a",
"score": "0.6408148",
"text": "def features=(value)\n @features = value\n end",
"title": ""
},
{
"docid": "0fbebfe8d27f8fd26b638bacba706b4d",
"score": "0.6395945",
"text": "def feature(feature_name, enabled = true) \n @features[feature_name.to_sym] = enabled\n end",
"title": ""
},
{
"docid": "5624b634b73d9d86f95415a0e53c8d5e",
"score": "0.6366907",
"text": "def value\n @feature.value\n end",
"title": ""
},
{
"docid": "b04dc28a320cf1129424cff6b6f601cb",
"score": "0.63427085",
"text": "def enabled_services\n return @enabled_services\n end",
"title": ""
},
{
"docid": "6c45d8134cf1061873ba6569f7782235",
"score": "0.63392955",
"text": "def supports?(feature)\n class_variable_get(:@@features)[feature] == true\n end",
"title": ""
},
{
"docid": "7adf92c3205ed574162c2855b867b32b",
"score": "0.6322003",
"text": "def enabled?(feature)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "a10ffe3c7ccee19f8954f50327fe3c23",
"score": "0.6313827",
"text": "def features\n @features ||= []\n end",
"title": ""
},
{
"docid": "a10ffe3c7ccee19f8954f50327fe3c23",
"score": "0.6313827",
"text": "def features\n @features ||= []\n end",
"title": ""
},
{
"docid": "fbf2b6baa945c04ca78230e645f38a74",
"score": "0.630745",
"text": "def disabled_support\n attributes.fetch(:disabledSupport)\n end",
"title": ""
},
{
"docid": "de346638dbd21a893cbe96b25c04ac2b",
"score": "0.6301565",
"text": "def enabled\n @enabled\n end",
"title": ""
},
{
"docid": "de346638dbd21a893cbe96b25c04ac2b",
"score": "0.6301565",
"text": "def enabled\n @enabled\n end",
"title": ""
},
{
"docid": "45b71ec4803c30b3daa6eabaa1936dbe",
"score": "0.62986577",
"text": "def enabled?\n \n return @enabled\n \n end",
"title": ""
},
{
"docid": "9cf7e83029b1e451184dac9ae9275d28",
"score": "0.6259173",
"text": "def enabled_feature?(feature)\n PluginFeature.plugin_features(@_plugin_name)[feature].enabled?\n end",
"title": ""
},
{
"docid": "f943fd831320c25b89343e72fa2faf91",
"score": "0.623056",
"text": "def enabled?\n return @enabled\n end",
"title": ""
},
{
"docid": "f943fd831320c25b89343e72fa2faf91",
"score": "0.623056",
"text": "def enabled?\n return @enabled\n end",
"title": ""
},
{
"docid": "50ee230ffd7635e8600ddb1a108ea025",
"score": "0.621889",
"text": "def features\r\n\t\t@features.map{|feature| feature}\r\n\tend",
"title": ""
},
{
"docid": "d478c084e671e02e16e425d86db3f5c9",
"score": "0.62068677",
"text": "def feature(feat)\n # Get the feature name string from the yaml\n ref = cmd_ref.lookup('feature', feat).to_s[/set_value:.*feature (.*)/]\n\n if ref\n feat_str = Regexp.last_match[1]\n refute_nil(feat_str)\n else\n skip(\"'feature','#{feat}' is unsupported on this node\")\n end\n\n # Get current state of feature, then disable it\n pre_clean_enabled = Feature.send(\"#{feat}_enabled?\")\n config(\"no feature #{feat_str}\") if pre_clean_enabled\n refute_show_match(\n command: \"show running | i '#{feat_str}'\",\n pattern: /^#{feat_str}$/,\n msg: \"#{feat} (#{feat_str}) is still enabled\",\n )\n\n Feature.send(\"#{feat}_enable\")\n # Some features (BGP on n5k!) are slow starters...\n unless Feature.send(\"#{feat}_enabled?\")\n sleep 1\n node.cache_flush\n end\n assert(Feature.send(\"#{feat}_enabled?\"),\n \"Feature #{feat} (#{feat_str}) is not enabled\")\n\n # Return testbed to pre-clean state\n config(\"no feature #{feat_str}\") unless pre_clean_enabled\n rescue RuntimeError => e\n hardware_supports_feature?(e.message)\n end",
"title": ""
},
{
"docid": "a74d2ee15dd8d9e1b0f61176c6a4cc59",
"score": "0.6201001",
"text": "def features?\n definition.features?\n end",
"title": ""
},
{
"docid": "47f0943078c9c50a8c233e7ffe9f97c9",
"score": "0.61868155",
"text": "def is_enabled\n\t\t\t@enabled\t\n\t\tend",
"title": ""
},
{
"docid": "f2c18ca3f5b6626a1c85fe3c7af41d21",
"score": "0.61852187",
"text": "def features\n {\n supported_renderers: feature_renderers,\n file_transfer_support: feature_file_transfer?\n }\n end",
"title": ""
},
{
"docid": "439fcdf920b9d19263d66afede0d06f2",
"score": "0.6160467",
"text": "def features\n adapter.features.map { |name| feature(name) }.to_set\n end",
"title": ""
},
{
"docid": "93394f7e6085dcffdf92a513f9d15bff",
"score": "0.61599463",
"text": "def features\n {\n ignores_supplied_ids:false,\n is_persistent:false,\n is_rdf_model:false,\n is_wrapper:false,\n supports_boolean_property:true,\n supports_double_property:true,\n supports_duplicate_edges:true,\n supports_edge_index:false,\n supports_edge_iteration:true,\n supports_edge_key_index:false,\n supports_float_property:true,\n supports_indices:false,\n supports_integer_property:true,\n supports_key_indices:false,\n supports_long_property:true,\n supports_map_property:true,\n supports_mixed_list_property:true,\n supports_primitive_array_property:true,\n supports_self_loops:true,\n supports_serializable_object_property:true,\n supports_string_property:true,\n supports_threded_transactions:false,\n supports_transactions:false,\n supports_uniform_list_property:true,\n supports_vertex_index:false,\n supports_vertex_iteration:true,\n supports_vertex_key_index:false\n }\n end",
"title": ""
},
{
"docid": "d33bd7657996dad557e4befb5dc45058",
"score": "0.6154443",
"text": "def get_features\n Request.request('GET', 'features', \"apps/#{self.app_key}/features\")\n end",
"title": ""
},
{
"docid": "ad938bdb44815ecd1d9b2af45e5daa3f",
"score": "0.6153849",
"text": "def enabled\n return true if @enabled.nil?\n @enabled\n end",
"title": ""
},
{
"docid": "e34371c60afcbe44a8238c29e065218e",
"score": "0.61490524",
"text": "def configuration_manager_client_enabled_features=(value)\n @configuration_manager_client_enabled_features = value\n end",
"title": ""
},
{
"docid": "ec9039080caecacab8b0708e80983c95",
"score": "0.6130408",
"text": "def _FEATURES; @@FEATURES; end",
"title": ""
},
{
"docid": "9e9998304c58a7ce5c231b5b509c35c1",
"score": "0.6127299",
"text": "def enabled?\n return @enable\n end",
"title": ""
},
{
"docid": "00b1d60aa37e2d4bba5480b3ce5e8773",
"score": "0.6116004",
"text": "def features\n if @features then\n return @features\n end\n\n @features = (0...@nFeatureEntries).map do |i|\n start = 16 + i * 12\n featureType, featureSetting, enableFlags, disableFlags = @bytes[start, 8].unpack('nnnn')\n\n Feature.new(\n featureType: featureType,\n featureSetting: featureSetting,\n enableFlags: enableFlags,\n disableFlags: disableFlags,\n )\n end\n end",
"title": ""
},
{
"docid": "4daaa6221572a48289c17c0504255e3a",
"score": "0.61047983",
"text": "def enabled?(name, *args)\n feature(name).enabled?(*args)\n end",
"title": ""
},
{
"docid": "c147ed980ab00624bb5f2a37d9c63b69",
"score": "0.61035436",
"text": "def feature?(feature)\n supported = (definition[:features] && definition[:features].include?(feature))\n if supported\n Puppet.debug(\"#{definition[:name]} supports `#{feature}`\")\n else\n Puppet.debug(\"#{definition[:name]} does not support `#{feature}`\")\n end\n supported\n end",
"title": ""
},
{
"docid": "19280e1836cd3d70c30ed59df480c2d9",
"score": "0.6102206",
"text": "def features?(what)\n Itsf::Backend.features?(what) && !disabled_features.include?(what)\n end",
"title": ""
},
{
"docid": "5a7666babff2993719feeded3cb74728",
"score": "0.60998225",
"text": "def enabled?()\n @enabled\n end",
"title": ""
},
{
"docid": "ef89f34c4979413876e8c80fa0424138",
"score": "0.6094881",
"text": "def enabled?\n enabled_prop = property(:enabled)\n enabled_prop.nil? || enabled_prop == true\n end",
"title": ""
},
{
"docid": "a53860335a21d81d552bf6c47ff5ba83",
"score": "0.60888594",
"text": "def support\n attributes.fetch(:support)\n end",
"title": ""
},
{
"docid": "477ba42a285bfac30ba7481ce388a47d",
"score": "0.608427",
"text": "def supported_feature_names\n data[:supported_feature_names]\n end",
"title": ""
},
{
"docid": "8666b87a305540b5bbcb30599e1b64c0",
"score": "0.6080556",
"text": "def passive_features\n return @passive_features if @passive_features\n @passive_features = []\n self.note.split(/[\\r\\n]+/).each do |line|\n case line\n when /feature\\[(\\w+)\\]/i\n @passive_features.push(RVKD::Passives::FEATURES[$1.to_sym])\n end\n end\n @passive_features\n end",
"title": ""
},
{
"docid": "74e9b8ef73ba7f8fa0f69d580618bba2",
"score": "0.6075944",
"text": "def feature?(f)\n self.class.features.include?(f)\n end",
"title": ""
},
{
"docid": "459db5fbdb96595786421f9620fead65",
"score": "0.6074538",
"text": "def enabled?\n enabled\n end",
"title": ""
},
{
"docid": "eac23d4e3e0c6f0263c8579536082f8d",
"score": "0.6065059",
"text": "def has_features?\n return ! features.nil?\n end",
"title": ""
},
{
"docid": "683baa28aacd1e15184badc84c31532d",
"score": "0.60539955",
"text": "def features\n ROLLOUT_CLIENT_FEATURES.select do |feature|\n ROLLOUT.active?(feature, object)\n end.map(&:to_s)\n end",
"title": ""
},
{
"docid": "eeac929182cb15f82c97cd38e00c1d32",
"score": "0.6047829",
"text": "def _feature\n @_feature\n end",
"title": ""
},
{
"docid": "4ee7c596654cf3600ed5a189c0f371a0",
"score": "0.6044794",
"text": "def provides_features\n []\n end",
"title": ""
},
{
"docid": "59b47dbf8eb7d67732089687bbfc12dc",
"score": "0.60384923",
"text": "def feature_value(name)\n get_feature(name).value\n end",
"title": ""
},
{
"docid": "4bed00f80310149cf27c6ff2a9a6bd29",
"score": "0.60245585",
"text": "def enabled?\n @enabled\n end",
"title": ""
},
{
"docid": "4bed00f80310149cf27c6ff2a9a6bd29",
"score": "0.60245585",
"text": "def enabled?\n @enabled\n end",
"title": ""
},
{
"docid": "4bed00f80310149cf27c6ff2a9a6bd29",
"score": "0.60245585",
"text": "def enabled?\n @enabled\n end",
"title": ""
},
{
"docid": "4bed00f80310149cf27c6ff2a9a6bd29",
"score": "0.60245585",
"text": "def enabled?\n @enabled\n end",
"title": ""
},
{
"docid": "4bed00f80310149cf27c6ff2a9a6bd29",
"score": "0.60245585",
"text": "def enabled?\n @enabled\n end",
"title": ""
},
{
"docid": "4bed00f80310149cf27c6ff2a9a6bd29",
"score": "0.60245585",
"text": "def enabled?\n @enabled\n end",
"title": ""
}
] |
4d9444c72290e8acdb1ea6a99e61cc36
|
Retorna las llaves de acceso del hash
|
[
{
"docid": "554ea4879d8e6f79a93a0dc1eecba2b7",
"score": "0.0",
"text": "def keys\n @vector.keys\n end",
"title": ""
}
] |
[
{
"docid": "f6d9bc9bb7108b3087c36761273d0d74",
"score": "0.5848885",
"text": "def hash\n [dns, download, first_byte, handshake, redirect, ssl, tcp, total, wait].hash\n end",
"title": ""
},
{
"docid": "e27da4acff8b4d32e8d54ec49d1c347b",
"score": "0.5702002",
"text": "def keys\n self.hash.keys\n end",
"title": ""
},
{
"docid": "5f8027db70235e143aa25141f9b0730a",
"score": "0.56625056",
"text": "def hgetall(hash)\n redis.hgetall(hash)\n end",
"title": ""
},
{
"docid": "a1823ef7ba298ffdcde110893abadd76",
"score": "0.5646638",
"text": "def keys\n hash.keys\n end",
"title": ""
},
{
"docid": "e6242a95a9b1c4610b1879a29913657a",
"score": "0.5631682",
"text": "def keys\n @hash_keys ||= []\n end",
"title": ""
},
{
"docid": "bb8062d8319ecb2feec0627dc31f637f",
"score": "0.5619884",
"text": "def keys\n @__cache.keys\n end",
"title": ""
},
{
"docid": "1c4aaa179b47781ce144e3eeb54156c6",
"score": "0.55954695",
"text": "def links\r\n @links.keys\r\n end",
"title": ""
},
{
"docid": "a2032a62aa9a6f9c42b45e958e8a7312",
"score": "0.5575938",
"text": "def keys\n @hash.keys\n end",
"title": ""
},
{
"docid": "540aa2ff88db2b47a5a2cff6ad8737a0",
"score": "0.55420405",
"text": "def get_keys\n keys = []\n int = 30\n now = Time.now.to_i / int\n key = Base32.decode @secret_key\n sha = OpenSSL::Digest::Digest.new('sha1')\n\n (-1..1).each do |x|\n bytes = [ now + x ].pack('>q').reverse\n hmac = OpenSSL::HMAC.digest(sha, key.to_s, bytes)\n offset = nil\n if RUBY_VERSION > '1.9'\n offset = hmac[-1].ord & 0x0F\n else\n offset = hmac[-1] & 0x0F\n end\n hash = hmac[offset...offset + 4]\n\n code = hash.reverse.unpack('L')[0]\n code &= 0x7FFFFFFF\n code %= 1000000\n\n keys << code\n end\n\n keys\n end",
"title": ""
},
{
"docid": "2a7bc05fddc727e1b6dd5459f58f84e8",
"score": "0.55339533",
"text": "def keys\n @cache.keys\n end",
"title": ""
},
{
"docid": "8f6c95f6d3c0b9f8500609f7c078bd71",
"score": "0.5522979",
"text": "def length\n @hash.length\n end",
"title": ""
},
{
"docid": "6483b39860a713b4780e9868f6657048",
"score": "0.55204934",
"text": "def get_clue_keys\r\n return @clues.keys\r\n end",
"title": ""
},
{
"docid": "20c5f25c1195184d044b1433ecd62e0d",
"score": "0.5511973",
"text": "def keys\n @hash.keys\n end",
"title": ""
},
{
"docid": "818dfb991535496155f05f3aaf2ee71f",
"score": "0.5502234",
"text": "def hashes(data)\n m = @ba.size\n h = Digest::MD5.hexdigest(data.to_s).to_i(16)\n x = h % m\n h /= m\n y = h % m\n h /= m\n z = h % m\n [x] + 1.upto(@k - 1).collect do |i|\n x = (x + y) % m\n y = (y + z) % m\n x\n end\n end",
"title": ""
},
{
"docid": "bd4eefac6f14ba86c79c44caaebf27a0",
"score": "0.5501054",
"text": "def get_shas\n shas = []\n each_sha1 { |sha| shas << sha.unpack(\"H*\")[0] }\n shas\n end",
"title": ""
},
{
"docid": "47254ff1e9fd96277526cae97f91d0df",
"score": "0.5496075",
"text": "def list\n @keystore.keys.map do |key|\n [key, @storage.get_balance(Bitcoin.hash160_from_address(key[:addr]))]\n end\n end",
"title": ""
},
{
"docid": "61463f657057accd27cc60c33fb0f386",
"score": "0.5480225",
"text": "def all\n @hash\n end",
"title": ""
},
{
"docid": "62b795df10164dc02c04a1c7b3b3bc42",
"score": "0.5459421",
"text": "def peers\n# @table_lock.synchronize { @nid_peers.values }\n @nid_peers.values \n end",
"title": ""
},
{
"docid": "600185eae3d3bfd76ed2275c948ddb0f",
"score": "0.5434571",
"text": "def keys\n return @hash.keys\n end",
"title": ""
},
{
"docid": "600185eae3d3bfd76ed2275c948ddb0f",
"score": "0.5434571",
"text": "def keys\n return @hash.keys\n end",
"title": ""
},
{
"docid": "9d3d60acc3b8738280f04d19e84a8437",
"score": "0.5424308",
"text": "def keys\n @cache.keys\n end",
"title": ""
},
{
"docid": "ca4cd6b8aeb12e37f6e603c378d578d6",
"score": "0.5422636",
"text": "def get_list_of_blocked_keys\n @keys.keys - get_list_of_unblocked_key\n end",
"title": ""
},
{
"docid": "f9c6eadd0a769eb10392eb8ba2f3baf0",
"score": "0.5413483",
"text": "def hgetall(key); end",
"title": ""
},
{
"docid": "f9c6eadd0a769eb10392eb8ba2f3baf0",
"score": "0.5413483",
"text": "def hgetall(key); end",
"title": ""
},
{
"docid": "de70d5ec5ba28bc20b28a9085b539094",
"score": "0.54052335",
"text": "def analisarHashes(hash_servico, hash_esperado)\r\n # Mapeando todas as chaves\r\n @chave_esperado = hash_esperado.keys\r\n @comparacao_nivel = true\r\n \r\n for e in 0..(@chave_esperado.size - 1) do\r\n # Nivel 1 - Verificar se a chave existe na hash do serviço\r\n @n1 = hash_servico.has_key?(@chave_esperado[e])\r\n \r\n # Nivel 2 - Verificar se a chave encontrada a cima possue o valor igual, sem considerar sinal\r\n @n2 = hash_servico[@chave_esperado[e]] == hash_esperado[@chave_esperado[e]]\r\n # puts \" #{hash_servico[@chave_esperado[e]]} = #{hash_esperado[@chave_esperado[e]]}\"\r\n \r\n @comparacao_nivel = @n1 & @n2 & @comparacao_nivel\r\n end\r\n @comparacao_nivel\r\n end",
"title": ""
},
{
"docid": "1d84f2b9de0c505e112abdb77301c7c3",
"score": "0.54015416",
"text": "def compute_ell(public_keys)\n Digest::SHA256.digest(public_keys.join)\n end",
"title": ""
},
{
"docid": "ad9f678b6c1e554674d2eb2140ced455",
"score": "0.5400015",
"text": "def links\n\t\t\t@links.keys\n\t\tend",
"title": ""
},
{
"docid": "b3e79352302a569a135344be1c3a6807",
"score": "0.5397924",
"text": "def get_hash( *keys )\n\t\traise MemCacheError, \"no active servers\" unless self.active?\n\t\treturn @mutex.synchronize( Sync::SH ) {\n\t\t\tself.fetch( :get_hash, *keys )\n\t\t}\n\tend",
"title": ""
},
{
"docid": "a2dc2d5d94e9661a7b4b12d5319ce094",
"score": "0.5395024",
"text": "def hgetall(key)\n\t\t\t\t\tcall('HGETALL', key).each_slice(2).to_h\n\t\t\t\tend",
"title": ""
},
{
"docid": "fa2acc1b09ac36e1c15370c0c2dbd01a",
"score": "0.53919256",
"text": "def keys\n @hash.keys\n end",
"title": ""
},
{
"docid": "fa2acc1b09ac36e1c15370c0c2dbd01a",
"score": "0.53919256",
"text": "def keys\n @hash.keys\n end",
"title": ""
},
{
"docid": "ae393bbba293cc8803d9897b4e91a6f6",
"score": "0.5386539",
"text": "def keys\n cache.keys\n end",
"title": ""
},
{
"docid": "22d0610332be53e2bf59429fb5183cc9",
"score": "0.5376251",
"text": "def keys\r\n kys = []\r\n @cwidth.times do |i|\r\n @cache[i].each {|ce| kys << ce.oid if !ce.oid.nil? }\r\n end\r\n kys\r\n end",
"title": ""
},
{
"docid": "fb2536b2190cb7d2fe5774c08689d786",
"score": "0.53711414",
"text": "def armors_hash()\n return @armors\n end",
"title": ""
},
{
"docid": "e3bd534620743e35be8a98c6f6e31935",
"score": "0.5367882",
"text": "def hashes\n node_hashes = Array.new(@blocks)\n File.open(disk_hash_file, 'rb') do |file|\n (0...@blocks).each do |idx|\n node_hashes[idx] = file.read(hash_byte_size)\n end\n end\n node_hashes\n end",
"title": ""
},
{
"docid": "37b697ae448c31600d6c9997b3c63620",
"score": "0.5364721",
"text": "def hash\n super +\n @authorized_keys.hash +\n @files.hash +\n @host.hash +\n @network_configuration.hash +\n @regenerate_ssh_keys.hash +\n @timezone.hash +\n @users.hash\n end",
"title": ""
},
{
"docid": "a144fc607759eee17a292aa72e360538",
"score": "0.53551114",
"text": "def get_keys hash\n\t\t@db.hkeys hash\n\tend",
"title": ""
},
{
"docid": "759eadddf7f1c7370e22cea5a4226ba4",
"score": "0.5323444",
"text": "def refs_hash\n # Initialize only when first call\n if @refs_hash.nil?\n @refs_hash = Hash.new { |h, k| h[k] = [] }\n\n grit.refs.each do |r|\n @refs_hash[r.commit.id] << r\n end\n end\n @refs_hash\n end",
"title": ""
},
{
"docid": "759eadddf7f1c7370e22cea5a4226ba4",
"score": "0.5322684",
"text": "def refs_hash\n # Initialize only when first call\n if @refs_hash.nil?\n @refs_hash = Hash.new { |h, k| h[k] = [] }\n\n grit.refs.each do |r|\n @refs_hash[r.commit.id] << r\n end\n end\n @refs_hash\n end",
"title": ""
},
{
"docid": "64157ec10d457d55eb945d0f9c13f728",
"score": "0.5322337",
"text": "def digests\n @map.map { |sha1, path| sha1 }\n end",
"title": ""
},
{
"docid": "f2682000d25b8c52e96f8b605522bd88",
"score": "0.5316042",
"text": "def length()\n\t\t\treturn real_hash.length()\n\t\tend",
"title": ""
},
{
"docid": "b6036a00fe6eadd55a43133eacc6f489",
"score": "0.53039455",
"text": "def all\n redis.lrange(@key, 0, -2).map(&:to_i)\n end",
"title": ""
},
{
"docid": "8a96b828f706da491d6a39e18b5c4998",
"score": "0.53036815",
"text": "def new_hash\n\t\tlonghash = Digest::SHA1.hexdigest(Time.new.to_i.to_s)\n\t\ti = 0\n\t\thash = nil\n\t\twhile true do\n\t\t\thash = longhash[i..(i+4)]\n\t\t\tif DB[:tinker].filter(:hash => hash).count == 0\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\t\thash\n\tend",
"title": ""
},
{
"docid": "a9c70a0a4721665f17baa2673458e48d",
"score": "0.52967095",
"text": "def size\n @hash.length\n end",
"title": ""
},
{
"docid": "cd5dd70911b55d7fba068d5ace965f6f",
"score": "0.52936876",
"text": "def accessed_keys\n @accessed_keys.to_a\n end",
"title": ""
},
{
"docid": "09872e1d9e5bf383a440f38a7de9fec5",
"score": "0.528332",
"text": "def peers\n result = nil\n @peersMutex.synchronize do\n result = @peers.keys\n end\n result\n end",
"title": ""
},
{
"docid": "41ab6a4ad0d0f864bdf14d687807c4c0",
"score": "0.52760565",
"text": "def get_hash(key)\n @redis.hgetall(key)\n end",
"title": ""
},
{
"docid": "0458d1f4213941e67f86fff918ea4a18",
"score": "0.5272501",
"text": "def keys()\n ensureCache()\n return @cachedHash.keys\n end",
"title": ""
},
{
"docid": "b2849936e16e60213da0fa08b5526d6e",
"score": "0.5269816",
"text": "def hash\n #determine order of the hash\n # p self.to_a.sort.hash\n self.to_a.sort.hash * MERSENNE_PRIME\n end",
"title": ""
},
{
"docid": "ad9e1a822916097908bdb5dc3c9ed6f3",
"score": "0.5268929",
"text": "def algorithms\n (@digests || {}).keys.sort\n end",
"title": ""
},
{
"docid": "fa97eefb45df0722727f4a1a383692ee",
"score": "0.5259035",
"text": "def sha_index; end",
"title": ""
},
{
"docid": "5a9db8437188b075f1544be2f1dd0366",
"score": "0.52570695",
"text": "def members\n\t\t\treturn @hash.keys\n\t\tend",
"title": ""
},
{
"docid": "139beebd2d2eb16b726aae643c4007bc",
"score": "0.524605",
"text": "def get_chain key\n chain = Hash.new\n link = @links[key]\n while link\n x = link[1]\n y = link[2];\n chain[x] = y\n link = link[0]\n end\n chain\n end",
"title": ""
},
{
"docid": "8299fa04c1fcf1208721b7b997f17f0d",
"score": "0.52442104",
"text": "def keys\n head.commit.tree.contents.map{|blob| blob.name }\n end",
"title": ""
},
{
"docid": "d3ad7cd1ffa02bba0d60f42b82bb4ae7",
"score": "0.5224694",
"text": "def htpasswd\n htpasswdlist = Hash.new\n htpasswd = IO.readlines(@content[\"AuthUserFile\"])\n\n htpasswd.each do |line|\n key, value = line.split(':')\n value = value.gsub(/{SHA}/,'' )\n htpasswdlist[key.strip] = value.strip\n end\n\n htpasswdlist\n end",
"title": ""
},
{
"docid": "275458ddbca869f8eb48326a91d1ce7b",
"score": "0.52230406",
"text": "def keys\n cache.keys | store.keys\n end",
"title": ""
},
{
"docid": "7928efc376f0faf1242c515eff8726be",
"score": "0.5219178",
"text": "def hash\n\t\treturn @hash if @hash && @frozen\n\t\t@hash = Digest::SHA2.digest(\"#{prev_hash}#{to_applied}\")[0,20]\n\tend",
"title": ""
},
{
"docid": "992a71cbcaf035558d7fc40d281119d5",
"score": "0.52032375",
"text": "def size\n return @hash.length\n end",
"title": ""
},
{
"docid": "992a71cbcaf035558d7fc40d281119d5",
"score": "0.52032375",
"text": "def size\n return @hash.length\n end",
"title": ""
},
{
"docid": "d2a33334b4564c4a3ae3e2cef70b8c75",
"score": "0.5198629",
"text": "def clave\n [[@uno,@dos,@tres],[@cuatro,@cinco,@seis],[@siete,@ocho,@nueve],[@uno,@cinco,@nueve],[@uno,@cuatro,@siete],[@dos,@cinco,@ocho],[@tres,@seis,@nueve],[@tres,@cinco,@siete]]\n end",
"title": ""
},
{
"docid": "a0416f99fd87fe16fec4067c7fd4ed25",
"score": "0.51979554",
"text": "def hgetall(key)\n\t\tget_h(key).flatten\n\tend",
"title": ""
},
{
"docid": "70ea74a2ffe2f062c12f10fe89a101c8",
"score": "0.51866597",
"text": "def hash\n folder.hash ^ name.hash\n end",
"title": ""
},
{
"docid": "265ead36ab89181012e89c83da127f61",
"score": "0.5183963",
"text": "def hash\n self.class.hash ^ @site.hash ^ @path.hash\n end",
"title": ""
},
{
"docid": "ce74e74cbbe348d92b5cfead698504ed",
"score": "0.51817596",
"text": "def addrs\n @keystore.keys.map{|k| k[:addr]}\n end",
"title": ""
},
{
"docid": "7876ba0e7da4cc242e3e9c387323f1ca",
"score": "0.5180447",
"text": "def keys; @base.keys.sort end",
"title": ""
},
{
"docid": "7b2e7e988821693742ac64fa879ddc86",
"score": "0.51794297",
"text": "def hash\n super +\n @ballooning.hash +\n @guaranteed.hash +\n @max.hash +\n @over_commit.hash +\n @transparent_huge_pages.hash\n end",
"title": ""
},
{
"docid": "f2173a81eab021b020d991ba8a62f5c8",
"score": "0.5176295",
"text": "def acl_entries\n user_acl_entries\n end",
"title": ""
},
{
"docid": "4473d4d54faf8748cc957a20fb3e47b5",
"score": "0.5175961",
"text": "def keys\n redis.hkeys(key)\n end",
"title": ""
},
{
"docid": "17a858516abe042b032473822b816e9b",
"score": "0.5168665",
"text": "def hash\n @hash\n end",
"title": ""
},
{
"docid": "17a858516abe042b032473822b816e9b",
"score": "0.5168665",
"text": "def hash\n @hash\n end",
"title": ""
},
{
"docid": "68b8d88f15f49af54a5e0c4a3f21ba18",
"score": "0.5167653",
"text": "def hash\n super +\n @hosts.hash +\n @read_only.hash +\n @vms.hash\n end",
"title": ""
},
{
"docid": "26fab0c477fbf1eaa413cec435e785b2",
"score": "0.5166073",
"text": "def hash\n 0\n end",
"title": ""
},
{
"docid": "29af429fa5b66539e63795018d3dd73c",
"score": "0.5165349",
"text": "def get_all_clusters\n @raw[\"clusters\"].keys\n end",
"title": ""
},
{
"docid": "a3bfb01e86561690da9d3afe11f021fc",
"score": "0.51640534",
"text": "def hash\n @hash ||= [host, user, port].hash\n end",
"title": ""
},
{
"docid": "a3bfb01e86561690da9d3afe11f021fc",
"score": "0.51640534",
"text": "def hash\n @hash ||= [host, user, port].hash\n end",
"title": ""
},
{
"docid": "a3bfb01e86561690da9d3afe11f021fc",
"score": "0.51640534",
"text": "def hash\n @hash ||= [host, user, port].hash\n end",
"title": ""
},
{
"docid": "a3bfb01e86561690da9d3afe11f021fc",
"score": "0.51640534",
"text": "def hash\n @hash ||= [host, user, port].hash\n end",
"title": ""
},
{
"docid": "0dbe2a68299399de67be9d62005975d7",
"score": "0.51631886",
"text": "def hash;0;end",
"title": ""
},
{
"docid": "0f91044b8bc0dc7c86f60e8f0656267c",
"score": "0.51620185",
"text": "def size\n @hash.length\n end",
"title": ""
},
{
"docid": "c96c2c9d8b1914034ed9191c600ebffb",
"score": "0.5156129",
"text": "def hash\n href.hash\n end",
"title": ""
},
{
"docid": "3d87a894968945b4a67e37fa66d0f2ef",
"score": "0.5153581",
"text": "def hash\n @hash ||= @client.get_hash(path)\n @hash\n end",
"title": ""
},
{
"docid": "d87a53abfcc52b22c798677d5d830d3b",
"score": "0.51515484",
"text": "def get_hashes_for_user\n hashes = (cookies['hashes'] || \"\").split(\",\")\n end",
"title": ""
},
{
"docid": "fe319ed73c2ce9437efe93ab211d5911",
"score": "0.51500976",
"text": "def size\n @hash.size\n end",
"title": ""
},
{
"docid": "29428d55a61ea0dffc456290e91a2e1c",
"score": "0.5148695",
"text": "def solo_nombres(hashito)\n hashito.keys\nend",
"title": ""
},
{
"docid": "b4558296a94a64a8f1b7ea4d9cd07561",
"score": "0.5146743",
"text": "def hash()\n @hash ||= @path.hash\n end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "2b1d968915b6d34d86fd4721378f550b",
"score": "0.5145638",
"text": "def keys; end",
"title": ""
},
{
"docid": "dcc5a00ba0abd063832e971e2dbdc011",
"score": "0.51454157",
"text": "def keys\n @connections_for.keys\n end",
"title": ""
}
] |
9eb298630afb719950f6bdfbaff2a886
|
Destroy this object with the might of 60 jotun!
|
[
{
"docid": "24eec449213076cdae14d924678e6f73",
"score": "0.0",
"text": "def destroy\n self.class.destroy(id)\n end",
"title": ""
}
] |
[
{
"docid": "0fcdec9fe564ad17fd16909d11a7b43a",
"score": "0.66773343",
"text": "def destroy!\n (rand(3) + 5).times { Explosion.new(@x + rand(BoomOffset * 2) - BoomOffset, @y + rand(BoomOffset * 2) - BoomOffset) }\n kill!\n end",
"title": ""
},
{
"docid": "0fcdec9fe564ad17fd16909d11a7b43a",
"score": "0.66773343",
"text": "def destroy!\n (rand(3) + 5).times { Explosion.new(@x + rand(BoomOffset * 2) - BoomOffset, @y + rand(BoomOffset * 2) - BoomOffset) }\n kill!\n end",
"title": ""
},
{
"docid": "1563e2756c513412b8eb603be907ffb7",
"score": "0.66304237",
"text": "def destroy!\n (rand(3) + 5).times { Explosion.new(@x + rand(BoomOffset * 2) - BoomOffset, @y + rand(BoomOffset * 2) - BoomOffset) } \n kill!\n end",
"title": ""
},
{
"docid": "b272061a7308f0b2a238caecdb66a021",
"score": "0.6589862",
"text": "def self_destruct(elapsed, game)\n @age += elapsed\n\n if @age > MAX_AGE\n game.things.reject! { |t| t == self }\n end\n end",
"title": ""
},
{
"docid": "398c86f8a9872b43dc3137f749345f33",
"score": "0.6538983",
"text": "def kill!\n self.lives -= 1\n killed if self.lives > 0\n destroy! if self.lives == 0\n end",
"title": ""
},
{
"docid": "8a516978cb51b919f6cc3d4e52ddae45",
"score": "0.6528523",
"text": "def destroyed!\n 30.times do\n explosion = generate SmallExplosion\n explosion.position += random_vector(rand(7))\n explosion.speed += random_vector(rand(20))\n end\n 8.times do\n debris = generate(Debris)\n debris.speed = self.speed*rand + random_vector(rand(15))\n debris.torque = rand(5)\n end\n end",
"title": ""
},
{
"docid": "978a3215f8149f3d8123325846b0d108",
"score": "0.650606",
"text": "def destroyed!\n 20.times do\n explosion = SmallExplosion.new window\n explosion.warp position + random_vector(rand(50))\n window.register explosion\n end\n end",
"title": ""
},
{
"docid": "5bdeb9e42d18ca75f862be42c2e5737b",
"score": "0.64693487",
"text": "def destroyed!; end",
"title": ""
},
{
"docid": "0a29b34c46ea8546db77149f9e88841c",
"score": "0.6351887",
"text": "def destroy!\n @explosion_sound.play\n (rand(3) + 5).times { Explosion.new(@x + rand(BoomOffset * 2) - BoomOffset, @y + rand(BoomOffset * 2) - BoomOffset) }\n kill!\n end",
"title": ""
},
{
"docid": "4bffccd99d21077a7f329c223e3bce8a",
"score": "0.6325546",
"text": "def destroy!; end",
"title": ""
},
{
"docid": "df2e7eebae5ac13035158d533c541254",
"score": "0.6315271",
"text": "def tick\n lose_energy\n grow_older\n procreate\n if @energy <= 0 or @age > @lifespan\n @world.roids.delete self\n end \n end",
"title": ""
},
{
"docid": "789758bc38b33264a210271596d33f9a",
"score": "0.62718236",
"text": "def kill\n\t\t@alive = false\n\t\t@warm_blooded = false\n\tend",
"title": ""
},
{
"docid": "f0d8b6ce64dd8d204815431f8328907b",
"score": "0.62355816",
"text": "def destroy\n self.update('',:duration => -1)\n end",
"title": ""
},
{
"docid": "9a2a1cf37da1966b6b1642ece0c855cd",
"score": "0.6228764",
"text": "def self_destruct!(with_credits=false)\n planet = self.planet\n\n raise GameLogicError.new(\"This building is not destroyable!\") \\\n unless destroyable?\n\n raise GameLogicError.new(\"Cannot self-destruct upgrading buildings!\") if\n upgrading?\n\n player = nil\n if with_credits\n raise GameLogicError.new(\n \"Player cannot destroy building with creds, because not enough time \" +\n \"has passed for him as planet owner.\"\n ) \\\n if Time.now - planet.owner_changed <\n Cfg.buildings_self_destruct_creds_safeguard_time\n\n player = self.player\n creds_needed = CONFIG['creds.building.destroy']\n raise GameLogicError.new(\"Player does not have enough creds! Req: #{\n creds_needed}, has: #{player.creds}\") if player.creds < creds_needed\n stats = CredStats.self_destruct(self)\n player.creds -= creds_needed\n else\n raise GameLogicError.new(\"Cannot self-destruct this building, planet \" +\n \"still has cooldown: #{planet.can_destroy_building_at.to_s(:db)}\") \\\n unless planet.can_destroy_building?\n end\n\n if with_credits\n stats.save!\n player.save!\n end\n Objective::SelfDestruct.progress(self)\n\n destroy!\n\n # We need to reload the planet, because #destroy! might have increased\n # resources on it. Baargh, we need identity map badly here!\n planet.reload\n planet.can_destroy_building_at = CONFIG.evalproperty(\n \"buildings.self_destruct.cooldown\"\n ).since unless with_credits\n planet.delayed_fire(planet, EventBroker::CHANGED,\n EventBroker::REASON_OWNER_PROP_CHANGE)\n\n metal, energy, zetium = self_destruct_resources\n planet.increase!(:metal => metal, :energy => energy, :zetium => zetium)\n end",
"title": ""
},
{
"docid": "b9d8b8fce19d4df2d2be0d28398068f6",
"score": "0.62077355",
"text": "def destroyed?; end",
"title": ""
},
{
"docid": "b9d8b8fce19d4df2d2be0d28398068f6",
"score": "0.62077355",
"text": "def destroyed?; end",
"title": ""
},
{
"docid": "183ef7091ef80bb0fb729c03fe402492",
"score": "0.6194668",
"text": "def kill; end",
"title": ""
},
{
"docid": "183ef7091ef80bb0fb729c03fe402492",
"score": "0.6194668",
"text": "def kill; end",
"title": ""
},
{
"docid": "183ef7091ef80bb0fb729c03fe402492",
"score": "0.6194668",
"text": "def kill; end",
"title": ""
},
{
"docid": "183ef7091ef80bb0fb729c03fe402492",
"score": "0.6194668",
"text": "def kill; end",
"title": ""
},
{
"docid": "183ef7091ef80bb0fb729c03fe402492",
"score": "0.6194668",
"text": "def kill; end",
"title": ""
},
{
"docid": "183ef7091ef80bb0fb729c03fe402492",
"score": "0.6194668",
"text": "def kill; end",
"title": ""
},
{
"docid": "183ef7091ef80bb0fb729c03fe402492",
"score": "0.6194668",
"text": "def kill; end",
"title": ""
},
{
"docid": "183ef7091ef80bb0fb729c03fe402492",
"score": "0.6194668",
"text": "def kill; end",
"title": ""
},
{
"docid": "a9fac9deef3115d368836bf7c52b402a",
"score": "0.61921376",
"text": "def purge!\n\t\t\tMU::MommaCat.purge(MU.mu_id)\n\t\tend",
"title": ""
},
{
"docid": "756b4166aad38a4f4ba1cab617169892",
"score": "0.6185351",
"text": "def destroy!\n raise Destroyed.new(self.name) if (self.destroyed?)\n self.unlock\n self.instance_eval('def destroyed? ; return true ; end')\n return nil\n end",
"title": ""
},
{
"docid": "cb805ad2037b2f736282d2ec7408646f",
"score": "0.61606276",
"text": "def trigger_destruction; @alive = false; end",
"title": ""
},
{
"docid": "61d4529e14a9aedf9ff9af39ca0c6938",
"score": "0.61542356",
"text": "def destroyed!\n explosion = SmallExplosion.new window\n explosion.warp position + random_vector(rand(20))\n window.register explosion\n 5.times do\n # TODO replace by start_generating Debris\n #\n debris = Debris.new window\n debris.warp position\n debris.speed = random_vector 10.0\n window.register debris\n end\n end",
"title": ""
},
{
"docid": "213516a6fbb90ac99157726b1fa6f0e5",
"score": "0.612195",
"text": "def destroy!\n destroy do\n trigger :refresh\n end\n end",
"title": ""
},
{
"docid": "1729dafe3636604aa068315c74b62c19",
"score": "0.6100968",
"text": "def kill\n @killed = true\n self\n end",
"title": ""
},
{
"docid": "5a4d89749118443e5b93768a137fe076",
"score": "0.6099719",
"text": "def destroy!\n @destroy = true\n end",
"title": ""
},
{
"docid": "07b288fd956708c405b826cd6fb0f370",
"score": "0.6073341",
"text": "def decline\n self.destroy\n end",
"title": ""
},
{
"docid": "e5b3a902144f9265bd4313def4233fcd",
"score": "0.60676676",
"text": "def destroy\n\t @image = Gosu::Image.new(\"media/earth_destroyed.png\")\n\tend",
"title": ""
},
{
"docid": "354f83f0b717574c8ff0822271af34cb",
"score": "0.60671335",
"text": "def destroy\n teardown_construct(construct) if construct\n end",
"title": ""
},
{
"docid": "0e7ee7be15234ff94e91344e46e9af9f",
"score": "0.6065775",
"text": "def _zoidberg_destroy!(error=nil)\n object_string = self.inspect\n oid = _raw_instance.object_id\n ::Zoidberg.logger.debug \"*** Destroying zoidberg instance #{object_string}\"\n super do\n _thread_pool.shutdown\n unless(_thread_pool.wait_for_termination(2))\n _thread_pool.kill\n end\n @_accessing_threads.each do |thread|\n if(thread.alive?)\n begin\n thread.raise ::Zoidberg::DeadException.new('Instance in terminated state!', oid)\n ::Thread.new(thread) do |thread|\n next if thread == ::Thread.current\n thread.join(::Zoidberg::Proxy::Liberated::THREAD_KILL_AFTER)\n if(thread.alive?)\n ::Zoidberg.logger.error \"Failed to halt accessing thread, killing: #{thread.inspect}\"\n thread.kill\n end\n end\n rescue\n end\n end\n end\n @_accessing_threads.clear\n end\n ::Zoidberg.logger.debug \"!!! Destroyed zoidberg instance #{object_string}\"\n end",
"title": ""
},
{
"docid": "9ede7bf095305eb62328475fb4168255",
"score": "0.6063732",
"text": "def destroy!\n _destroy\n end",
"title": ""
},
{
"docid": "dcc33a228fd00157be484dca07cdaa58",
"score": "0.60573155",
"text": "def destroy()\n destroy!\n end",
"title": ""
},
{
"docid": "7eb1ec9ba03fa1b8b7200336d5ccbb40",
"score": "0.6027923",
"text": "def kill!\n kill true\n end",
"title": ""
},
{
"docid": "6d04bfd60f51870f07f6ebf114a70870",
"score": "0.60239714",
"text": "def destroy!\n self.ballot = nil\n self.poll = nil\n self.option = nil\n super\n end",
"title": ""
},
{
"docid": "eeab0093c9d7a51ee2bcac3030c1d168",
"score": "0.60209703",
"text": "def purge\n destroy(true)\n end",
"title": ""
},
{
"docid": "eeab0093c9d7a51ee2bcac3030c1d168",
"score": "0.60209703",
"text": "def purge\n destroy(true)\n end",
"title": ""
},
{
"docid": "d16f42285b11cf097f05b81ce4759696",
"score": "0.6013557",
"text": "def finished\n if Game.player.lifes <= 0\n Game.stop\n else\n Game.player.lifes -= 1\n self.alive = false\n Game.scene.remove_object self\n end\n end",
"title": ""
},
{
"docid": "569f9a42ccdc89fe8558893de2d452b6",
"score": "0.6001037",
"text": "def cleanup\n # delete participating armies\n self.armies.each do |army|\n if army.empty? && !army.garrison?\n if GAME_SERVER_CONFIG['military_only_flag_destroyed_armies']\n army.removed = true\n unless army.save\n raise InternalServerError.new('Failed to flag an army as removed')\n end\n else\n army.destroy\n end\n end\n end\n\n # destroy appropriate event\n self.event.destroy\n\n # remove battle or set to removed\n if GAME_SERVER_CONFIG['military_only_flag_destroyed_battles']\n self.removed = true\n unless self.save\n raise InternalServerError.new('Failed to flag an battle as removed')\n end\n else\n self.destroy\n end\n end",
"title": ""
},
{
"docid": "c949eae82d363be8d7abe0829548a8c4",
"score": "0.59937936",
"text": "def _destroy; end",
"title": ""
},
{
"docid": "d7b90cd2e03faad19558872f938c25ce",
"score": "0.5991733",
"text": "def destroy!\n self.disable!\n self.destroy\n end",
"title": ""
},
{
"docid": "cf2378903a3dfb5202a44a5ae1129974",
"score": "0.5989381",
"text": "def destroy(*args)\n @id = nil\n @class_name = nil\n @unique_id = nil\n @weakref = nil\n end",
"title": ""
},
{
"docid": "20e13ca8acaa4e5b99525a27e1452e24",
"score": "0.59891146",
"text": "def destroy\r\n @parent.remove_game_object(self) if @parent\r\n self.class.instances.delete(self)\r\n end",
"title": ""
},
{
"docid": "50433b067f575f332fa5d497a2d97e7c",
"score": "0.59888566",
"text": "def kill()\n #this removes itself from the asteroids array\n GameManager.getAsteroids().delete(self)\n #this gets rid of the model from the window\n @model.remove\n end",
"title": ""
},
{
"docid": "c5e774be850e98c9c256c835678e6166",
"score": "0.5981609",
"text": "def mark_as_destroyed!; end",
"title": ""
},
{
"docid": "57d9b4fe1f20621c8b078353b4996d15",
"score": "0.5978758",
"text": "def destroy\r\n \r\n end",
"title": ""
},
{
"docid": "86de33a39a933295ab4ca2cf5da21c8c",
"score": "0.5978656",
"text": "def put_away!\n delete!\n end",
"title": ""
},
{
"docid": "baeae30acd00a572255cab6fe082a2b6",
"score": "0.5969938",
"text": "def destroy(by_joining = false)\n # Delete all units this unit was carrying, and any units those held units\n # were carrying as well (e.g. Lander >> APC >> Infantry)\n @holding_units.each{|u| u.holding_units.each{|i| \n index = i.army.units.index(i) \n i.army.units[index] = nil\n }\n index = u.army.units.index(u)\n u.army.units[index] = nil\n }\n # If joining units rather than destroying them\n if by_joining\n index = @army.units.index(self)\n @army.units[index] = nil\n else # Play destruction animation\n # Stops capture of the unit if destroyed in battle\n stop_capture\n # The cursor will move to this unit before playing the destroy animation.\n # After the destroy animation, the cursor will continue to the next action.\n proc = Proc.new{ @destroyed = true; $game_map.set_unit(@x,@y,nil)}\n $game_player.add_move_action(@x, @y, proc, WAIT_UNIT_ANIMATION)\n end\n # For Spriteset_Map update phase\n @needs_deletion = true\n end",
"title": ""
},
{
"docid": "3a0c8607e8be15c7802285e46fd8a592",
"score": "0.59685796",
"text": "def kill()\n @lock.synchronize{ kill! }\n end",
"title": ""
},
{
"docid": "d4764a4f6b2ac5427b5ff05733fd7d47",
"score": "0.5958484",
"text": "def kill\n #SceneManager.display_info(\"#{self.name} - knocked out\")\n $game_map.need_refresh = true\n @ori_through = @through\n cancel_action_without_penalty(true)\n @next_action = nil\n set_target(nil)\n end",
"title": ""
},
{
"docid": "d4764a4f6b2ac5427b5ff05733fd7d47",
"score": "0.5958484",
"text": "def kill\n #SceneManager.display_info(\"#{self.name} - knocked out\")\n $game_map.need_refresh = true\n @ori_through = @through\n cancel_action_without_penalty(true)\n @next_action = nil\n set_target(nil)\n end",
"title": ""
},
{
"docid": "5fe7fd8a7beedebf8c400588c721f46b",
"score": "0.59468806",
"text": "def destroy\n @args = nil\n @ids = nil\n @debug = nil\n end",
"title": ""
},
{
"docid": "762470b3920df54c6f5854607de9f960",
"score": "0.594606",
"text": "def clean_the_house()\n #Thread.new do\n # # TODO: the memory leak seems to occur on this line!\n # swap_out_faulty_nodes\n # swap_out_unresponsive_targets\n #end\n end",
"title": ""
},
{
"docid": "1ee677efbabe5c61e7c3ff46c3042a99",
"score": "0.5942358",
"text": "def die\n @heal_sound.play(1, 1, false)\n $map.delete(self)\n self.destroy\n end",
"title": ""
},
{
"docid": "f2f728aede2e0deeca07b6747223966d",
"score": "0.5933418",
"text": "def destroy\r\n super\r\n @continent.areas.delete self\r\n @rooms.dup.each do |room|\r\n room.destroy\r\n end\r\n @continent = nil\r\n @rooms = nil\r\n Game.instance.destroy_area(self)\r\n return\r\n end",
"title": ""
},
{
"docid": "ad73d1a28c9f3f12854b165c6eaf574d",
"score": "0.5924805",
"text": "def crushKillDestroy\n @cachedHash = nil\n api = getAPI(:metric, :DELETE)\n v = @nr.simpleAPI(api)\n return nil\n end",
"title": ""
},
{
"docid": "10546f4c8a1da872c289017cf3fd00d4",
"score": "0.59087354",
"text": "def destroy\n\t end",
"title": ""
},
{
"docid": "de78d083b0cfb94b00164a84fc09f429",
"score": "0.5907455",
"text": "def kill\n @@kill = true\n end",
"title": ""
},
{
"docid": "71d007426313f01d4866620a642b91ba",
"score": "0.5903934",
"text": "def remove_kill\n @kills -= 1\n end",
"title": ""
},
{
"docid": "82899eeed01515f9381afecd2045ff44",
"score": "0.5899257",
"text": "def destroy\n @latecomer.destroy\n end",
"title": ""
},
{
"docid": "3e35bf6f5faa8415dff35c680d85644b",
"score": "0.5897115",
"text": "def after_destroy(this)\n expire_cache_for(this)\n end",
"title": ""
},
{
"docid": "c5792ee5c76153c60d0c909aa6268f2b",
"score": "0.5893011",
"text": "def purge!\n MU::MommaCat.purge(MU.deploy_id)\n end",
"title": ""
},
{
"docid": "c5792ee5c76153c60d0c909aa6268f2b",
"score": "0.5893011",
"text": "def purge!\n MU::MommaCat.purge(MU.deploy_id)\n end",
"title": ""
},
{
"docid": "3aec2a8c52627eead036f8a6460c40aa",
"score": "0.5890984",
"text": "def destroy\n # Your shutdown code goes here.\n\tend",
"title": ""
},
{
"docid": "0d35e6dd18ca527d4a9739f69e9b10af",
"score": "0.58899075",
"text": "def destroy\n connection.delete(path_prefix).body['gauge']\n end",
"title": ""
},
{
"docid": "202ed6058dfac5c4857b73fc1396eff0",
"score": "0.58874863",
"text": "def destroy\n @heartbeat_running = false\n end",
"title": ""
},
{
"docid": "2336414b6dca050908702e25f8695b18",
"score": "0.58809155",
"text": "def killed; end",
"title": ""
},
{
"docid": "8d838b1c16a7254db5a55add61036944",
"score": "0.5878785",
"text": "def destroy\r\n Game.instance.remove_regen_mobile(self)\r\n Game.instance.remove_combat_mobile(self)\r\n if @reset\r\n @reset.activate\r\n @reset = nil\r\n end\r\n if @room\r\n @room.mobile_exit(self)\r\n end\r\n @race_affects = nil\r\n @mobile_class_affects = nil\r\n self.items.dup.each do |item|\r\n item.destroy\r\n end\r\n if @h2h_equip_slot.item\r\n @h2h_equip_slot.item.destroy\r\n end\r\n @inventory = nil\r\n Game.instance.remove_mobile(self)\r\n super\r\n return\r\n end",
"title": ""
},
{
"docid": "3a62a500808c6095871d824aaea39fd3",
"score": "0.5878375",
"text": "def cleanup\n\t\t@spawners.cleanup\n\tend",
"title": ""
},
{
"docid": "3a62a500808c6095871d824aaea39fd3",
"score": "0.5878375",
"text": "def cleanup\n\t\t@spawners.cleanup\n\tend",
"title": ""
},
{
"docid": "e7716990c0f8c26a49ff5db94ce9762e",
"score": "0.58734554",
"text": "def after_destroy(poi)\n expire_cache_for(poi)\n end",
"title": ""
},
{
"docid": "5ac47fee50ca262ec36d89e36dacc602",
"score": "0.5873207",
"text": "def really_destroy\n run_callbacks(:destroy) {delete}\n end",
"title": ""
},
{
"docid": "54caac37f0b2ed4671c4149893658c54",
"score": "0.5871906",
"text": "def cleanup\n @rock.each do |r|\n @rock.delete(r) if r.offScreen?\n @collided.shift(@collided.size/2)\n end\n\n @explosion.each do |e|\n @explosion.delete(e) if e.gif_complete?\n end\n\n @laser.each do |l|\n @laser.delete(l) if l.offScreen?\n end\n @count = 0\n end",
"title": ""
},
{
"docid": "d429693ce5dde8c1d987438c19dfad43",
"score": "0.58699435",
"text": "def destroy\n self.ballot = nil\n self.poll = nil\n self.option = nil\n super\n end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.5869837",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.5869837",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.5869837",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.5869837",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.5869837",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.5869837",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.5869837",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.5869837",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.5869837",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.5869837",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.5869837",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.5869837",
"text": "def destroy; end",
"title": ""
},
{
"docid": "b336e135dccf6493c5eef0060517e7f3",
"score": "0.5865134",
"text": "def kill!\n end",
"title": ""
},
{
"docid": "f664fc56b7e2ffd59c0f2d35d11b8c5e",
"score": "0.5861767",
"text": "def destroy!\n self.owner = nil\n rankings.destroy! unless rankings.nil?\n options.destroy! unless options.nil?\n ballots.destroy! unless ballots.nil?\n invites.destroy! unless invites.nil?\n reload\n super\n end",
"title": ""
},
{
"docid": "1072735002f428f2e5a73b0247935609",
"score": "0.58588827",
"text": "def cleanup!; end",
"title": ""
},
{
"docid": "1072735002f428f2e5a73b0247935609",
"score": "0.58588827",
"text": "def cleanup!; end",
"title": ""
},
{
"docid": "1072735002f428f2e5a73b0247935609",
"score": "0.58588827",
"text": "def cleanup!; end",
"title": ""
},
{
"docid": "ebfe650390bfa4edd75905969237c17a",
"score": "0.58568615",
"text": "def destroy\n Puppet.debug(\"Calling destroy method\")\n end",
"title": ""
},
{
"docid": "5d868eda4fb7d2c3c8187fd957240c48",
"score": "0.58532804",
"text": "def destroy\n @destroyed = true\n freeze\n end",
"title": ""
},
{
"docid": "7a43f372e16a94a59ff35b4a7dfc4b74",
"score": "0.5847875",
"text": "def kill\n end",
"title": ""
},
{
"docid": "8c17948ada209eb83585a185324216dc",
"score": "0.58437586",
"text": "def destroy!\n run_callbacks(:destroy) { delete! }\n end",
"title": ""
},
{
"docid": "8c17948ada209eb83585a185324216dc",
"score": "0.58437586",
"text": "def destroy!\n run_callbacks(:destroy) { delete! }\n end",
"title": ""
},
{
"docid": "008d31e48bd40cc9bcee214f9591ac49",
"score": "0.58219737",
"text": "def kill!\n @conditional.force!\n end",
"title": ""
}
] |
8afb9d7a31b611869cf68ad4e1f3f660
|
GET /knack_categories/1 GET /knack_categories/1.json
|
[
{
"docid": "16fbca7b632045d1e04d02a1c05815e3",
"score": "0.7012085",
"text": "def show\n @knack_category = KnackCategory.find(params[:id])\n @knacks = @knack_category.knacks.order( \"status desc, date desc\" )\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @knack_category }\n end\n end",
"title": ""
}
] |
[
{
"docid": "3cba43678b445865af5afd71d9719de9",
"score": "0.7976802",
"text": "def get_categories()\n response = RestClient.get @host + \"/categories\", { :accept => :json }\n return JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "efcb5e10780279c84a4be599091f0268",
"score": "0.7836564",
"text": "def categories\n call_api('/categories')\n end",
"title": ""
},
{
"docid": "bd7f457291ea26e7a11c69e4c64b3fd9",
"score": "0.78100127",
"text": "def fetch_categories\n xml = \"Request categories.\"\n respond_with_raw get(\"#{BASE_URL}/v1/categories?api_key=#{API_KEY}&format=json\", :body => xml)\n end",
"title": ""
},
{
"docid": "86e5d5637eeb2a8cc989235e83e67c7b",
"score": "0.7742888",
"text": "def get\n payload = {}\n @client.post('categories/get', payload)\n end",
"title": ""
},
{
"docid": "6d2573a7dd7e66c6b090cb93914bf727",
"score": "0.76156354",
"text": "def categories!\n mashup(self.class.get(\"/\", :query => method_params('aj.categories.getList'))).categories.category\n end",
"title": ""
},
{
"docid": "1945f36528d833e24d02acb7c3d412f0",
"score": "0.74766845",
"text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\n end",
"title": ""
},
{
"docid": "8e1abd1795c29bc436d5ced01a91a98d",
"score": "0.74351823",
"text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\nend",
"title": ""
},
{
"docid": "c794e2b53005975ecd30bf9e84242e82",
"score": "0.7409956",
"text": "def getAllCategories\n render json: Category.all\n end",
"title": ""
},
{
"docid": "2bd85a4101ce25ff3b275a1b7e24ce0f",
"score": "0.7395799",
"text": "def index\n @categories = @user.categories\n json_response(@categories)\n end",
"title": ""
},
{
"docid": "32b1db3e964dac3ebcbc6e02623e281c",
"score": "0.7382178",
"text": "def index\n @categories = Category.all\n render json: @categories\n end",
"title": ""
},
{
"docid": "6f5b1199df94a0f382a0f5270eb32454",
"score": "0.7315837",
"text": "def fetch_categories\r\n c_url = BASE_URL + \"categories/list?\" + \"app_key=\" + API_KEY\r\n\r\n uri = URI.parse(c_url)\r\n body = uri.read\r\n resp = Net::HTTP.get_response(uri)\r\n data = JSON.parse(resp.body)\r\n\r\n categories = data[\"category\"]\r\n # binding.pry\r\n categories.each do |c|\r\n Category.new(c[\"name\"])\r\n end\r\n end",
"title": ""
},
{
"docid": "bf41d6ac953a9480c0497e15ac3cea6c",
"score": "0.7313292",
"text": "def index\n @categories = Category.all\n\n render json: @categories\n end",
"title": ""
},
{
"docid": "ae14ca7e94e1ca2d08ea8acd3ba3fe2a",
"score": "0.7264922",
"text": "def show\n @categories = Catergory.all; \n # render json: @categories\n render json: {status: 'SUCCESS', message: 'Retrieving All Categories', data: categories}, status: :ok\n end",
"title": ""
},
{
"docid": "b107502871062c95f84bb8d4a75a7ceb",
"score": "0.7241581",
"text": "def index\n categories = Category.all\n render json: {status: 'SUCCESS', message: 'Loaded Categories', data: categories},status: :ok\n end",
"title": ""
},
{
"docid": "c53346177c668af4cc027667d049aa4d",
"score": "0.7229009",
"text": "def get_category_list\n begin\n render :status=>200,\n :json=>{:Message=>\"Successfully fetched the categories.\",\n :Response => \"Success\",\n :Data => {:Categories => Category.all.order(\"category_id DESC\")}}\n rescue Exception => e\n render :status=>401,\n :json=>{:Message=>\"Error while fetching categories.\",\n :Response => \"Fail\",\n :Data => e.message}\n end\n end",
"title": ""
},
{
"docid": "ae939484b2c3a1f4b3216a4613476d97",
"score": "0.7208138",
"text": "def index\n categories = Category.all\n render json:categories\n end",
"title": ""
},
{
"docid": "a3ba4406a807764976d8c6c10b83e338",
"score": "0.7188194",
"text": "def categories\n connection.get(\"/categories\").body.spot_categories\n end",
"title": ""
},
{
"docid": "a3ba4406a807764976d8c6c10b83e338",
"score": "0.7188194",
"text": "def categories\n connection.get(\"/categories\").body.spot_categories\n end",
"title": ""
},
{
"docid": "6d6cce29fae6cf7022ecb7a2207ad77a",
"score": "0.7172494",
"text": "def get_categories\r\n # the base uri for api requests\r\n query_builder = Configuration::BASE_URI.dup % [@version]\r\n\r\n # prepare query string for API call\r\n query_builder << \"/categories\"\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 \"X-Api-Key\" => @x_api_key\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.get query_url, headers:headers\r\n\r\n #Error handling using HTTP status codes\r\n if !(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",
"title": ""
},
{
"docid": "f8a2f1aa35b94de433b5fcf5907d8c9a",
"score": "0.71607876",
"text": "def index\n @api_v1_categories = Api::V1::Category.all\n end",
"title": ""
},
{
"docid": "a9dc2553b0d887511d5aee6cb3e00d65",
"score": "0.71599597",
"text": "def index\n\t\tcategories = Category.all\n\t\trender json: categories\n\tend",
"title": ""
},
{
"docid": "301a0d49fe1b6096d117c14c1eb6d9a2",
"score": "0.7097015",
"text": "def all_categories\n categories = Classification.categories.sort_by(&:description)\n render :json => {\n :categories => categories.map do |category|\n {:id => category.id, :name => category.name, :description => category.description}\n end\n }\n end",
"title": ""
},
{
"docid": "4dd21f7b547ec616490a8dee6302b929",
"score": "0.7091291",
"text": "def index\n @categories = Category.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"title": ""
},
{
"docid": "75b0c3968f94ad3a931e4d885f169f68",
"score": "0.7084866",
"text": "def get_category\n category = Category.find(params[:category_id])\n json_response(category)\n end",
"title": ""
},
{
"docid": "7091c3b6bb20c6059e76f6d862615933",
"score": "0.70527935",
"text": "def index\n @accessory_categories = AccessoryCategory.all\n\n render json: @accessory_categories\n end",
"title": ""
},
{
"docid": "d159b605b7f9223c96169d8c161116fa",
"score": "0.7043927",
"text": "def index\n @newscategories = Newscategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @newscategories }\n end\n end",
"title": ""
},
{
"docid": "6c85d4e66ba7c4368b00d86daaa70d5d",
"score": "0.7008152",
"text": "def index\n # check main category\n if params[:cat]\n # show categories\n category = Category.find_by_id(params[:cat])\n if !category.nil?\n @categories = category.children\n else\n flash[:error] = t(:category_not_found)\n @categories = nil\n end\n else\n # show all categories\n @categories = Category.subcategory\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"title": ""
},
{
"docid": "79833803e9ec25fdf3752444bbb1420f",
"score": "0.6995919",
"text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"title": ""
},
{
"docid": "79833803e9ec25fdf3752444bbb1420f",
"score": "0.6995919",
"text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"title": ""
},
{
"docid": "79833803e9ec25fdf3752444bbb1420f",
"score": "0.6995919",
"text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"title": ""
},
{
"docid": "79833803e9ec25fdf3752444bbb1420f",
"score": "0.6995919",
"text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"title": ""
},
{
"docid": "79833803e9ec25fdf3752444bbb1420f",
"score": "0.6995919",
"text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"title": ""
},
{
"docid": "79833803e9ec25fdf3752444bbb1420f",
"score": "0.6995919",
"text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"title": ""
},
{
"docid": "79833803e9ec25fdf3752444bbb1420f",
"score": "0.6995919",
"text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"title": ""
},
{
"docid": "79833803e9ec25fdf3752444bbb1420f",
"score": "0.6995919",
"text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"title": ""
},
{
"docid": "6d304408a086cca9a05a94665dc840d0",
"score": "0.6989738",
"text": "def respond_with_categories(params)\n channel_id = params[:channel_id]\n unless $redis.exists(\"shush:question:#{channel_id}\")\n\t max_category = 18418\n uri = \"http://jservice.io/api/categories?count=5&offset=#{1+rand(max_category/5)}\"\n request = HTTParty.get(uri)\n puts \"[LOG] #{request.body}\"\n \n category_titles = []\n data = JSON.parse(request.body)\n data.each do |child|\n category_titles << child['title']\n key = \"category:#{child['title']}\"\n $redis.set(key, child.to_json)\n end\n response = \"Wonderful. Let's take a look at the categories. They are: `\"\n response += category_titles.join(\"`, `\") + \"`.\"\n response\n end\nend",
"title": ""
},
{
"docid": "c8bfe1c42de8c52b93aa5304ee13e94b",
"score": "0.69868106",
"text": "def index\n @categories = Category.all\n render 'api/v1/categories/index'\n end",
"title": ""
},
{
"docid": "a179b1bc3cef7a8e96420ce8547e1808",
"score": "0.6984743",
"text": "def get_categories(format = nil)\n ext = format.nil? ? @format : format\n rest_url=\"#{@api}.#{ext}\"\n @categories = RestClient.get rest_url\n end",
"title": ""
},
{
"docid": "d6a8ba67c4bb02fcab072adfab2460c7",
"score": "0.69841456",
"text": "def categories\n begin\n print_verbose \"Retrieving module categories\"\n response = RestClient.get \"#{@url}categories\", {:params => {:token => @token}}\n categories = JSON.parse(response.body)\n print_good \"Retrieved #{categories.size} module categories\"\n categories\n rescue => e\n print_error \"Could not retrieve logs: #{e.message}\"\n end\nend",
"title": ""
},
{
"docid": "25081f297e54bd1a294191c76b17b162",
"score": "0.69798625",
"text": "def get_charity_categories\n get(\"charity/categories\")\n end",
"title": ""
},
{
"docid": "10236746ce328c38e4657c582d493303",
"score": "0.6954007",
"text": "def index\n \n id = SecureRandom.uuid.to_s\n\n category_info = {:id => id, :type => \"index\" }\n\n publish :category, JSON.generate(category_info) \n\n @categories = get_categories(id) \n end",
"title": ""
},
{
"docid": "f477230c33075803bfb6dd600eb6cf1b",
"score": "0.6936925",
"text": "def categorize\n out = {}.to_json\n if params[:url]\n # uri_enc_url = Rack::Utils.escape(params[:url])\n endpoint = \"http://access.alchemyapi.com/calls/url/URLGetCategory\"\n q = \"#{endpoint}?apikey=#{ENV[\"ALCHEMY_KEY\"]}&url=#{params[:url]}&outputMode=json\"\n out = RestClient.get(q)\n end\n respond_to do |format|\n format.html\n format.json { render :json => out.body }\n end\n end",
"title": ""
},
{
"docid": "ec14212d07b2c606100f56c1b708c14e",
"score": "0.693592",
"text": "def categories\n get('venues/categories').categories\n end",
"title": ""
},
{
"docid": "8a7a2ddf609742bc353bb4bfd35db186",
"score": "0.69271827",
"text": "def get_categories()\n\t\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\t\tif response.success?\n\t\t\t\t@categories = response.parsed_response\n\t\t\telse\n\t\t\t\traise response.response\n\t\t\tend\n\t\t\treturn @categories\n\t\tend",
"title": ""
},
{
"docid": "5658d2095b610d0e80f54e1d8442d1ef",
"score": "0.6901959",
"text": "def get_categories\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "860c8e967f683fb7023e8999c5b5c138",
"score": "0.68898726",
"text": "def category(id)\n connection.get(\"/categories/#{id}\").body\n end",
"title": ""
},
{
"docid": "860c8e967f683fb7023e8999c5b5c138",
"score": "0.68898726",
"text": "def category(id)\n connection.get(\"/categories/#{id}\").body\n end",
"title": ""
},
{
"docid": "432e613d8cb521fa67985f803d3bbb51",
"score": "0.68829554",
"text": "def index\n @categories = Category.all\n render status: :ok\n end",
"title": ""
},
{
"docid": "81a9734fde733de262768cefb5a4272a",
"score": "0.6877142",
"text": "def index\n @categories = Category.all\n response = @categories.map{|category| get_category_hash(category)}\n render json: response\n end",
"title": ""
},
{
"docid": "1500bd9e33130381fdace25adc9209e0",
"score": "0.6861411",
"text": "def index\n @kategoria = Kategorium.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @kategoria }\n end\n end",
"title": ""
},
{
"docid": "8fb11c432a8bb2c5fc11d5fb6181b5b5",
"score": "0.68475944",
"text": "def get_categories\n body = build_request(2935, 1501, \"ACTIVEHEADINGS\")\n response = send_to_localeze(body)\n xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text)\n end",
"title": ""
},
{
"docid": "ce1428c71cd866b370d5fe139c430ddd",
"score": "0.6831483",
"text": "def get_category id\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.get CATEGORIES, id )\n\t\t\t\tend",
"title": ""
},
{
"docid": "6597781dc6165b866043f101abb1377b",
"score": "0.683063",
"text": "def getCategories\n\t\t@categories = Category.all\n\t\t@ilist = @categories.map do |i| {\n\t\t\t:id => i.id,\n\t\t\t:name => i.name\n\t\t}\n\t\tend\n\t\trespond_to do |format|\n\t\tformat.json { render :json => @ilist.to_json }\n\t\tformat.html { render :json => @ilist.to_json }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a4ad67c4f5b3d913c870ea78e75c30ef",
"score": "0.6816854",
"text": "def index\n @mcategories = Mcategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mcategories }\n end\n end",
"title": ""
},
{
"docid": "e65e9d20a145d387572cca4a3bc9f671",
"score": "0.6803097",
"text": "def list\n @categories = Category.find(:all)\n end",
"title": ""
},
{
"docid": "160d5097532fdcf8cad67dd3b224ba08",
"score": "0.68003803",
"text": "def categories\n response = HTTParty.get('https://www.boardgameatlas.com/api/game/categories?&client_id=' + ENV['CLIENT_ID'])\n @categories = response[\"categories\"]\n end",
"title": ""
},
{
"docid": "9813fe31bee5445f60731fd9247468d8",
"score": "0.67754817",
"text": "def category\n key = params['p']\n @categories = Category.search(key)\n end",
"title": ""
},
{
"docid": "3daa3c9091d83cac3b53a2ca20088498",
"score": "0.67700994",
"text": "def categories(params={})\r\n url = api_url \"/categories\"\r\n req = request_params({currency: @currency, locale: @locale}.merge(params))\r\n \r\n feed_or_retry do\r\n RestClient.get url, req\r\n end \r\n end",
"title": ""
},
{
"docid": "faaf91357e4e9633cee0006bbf028f15",
"score": "0.6769279",
"text": "def index\n @account_categories = AccountCategory.all\n\n render json: @account_categories\n end",
"title": ""
},
{
"docid": "2b25f185919283b535c312fdf9b2f870",
"score": "0.676084",
"text": "def show\n render json: @category\n end",
"title": ""
},
{
"docid": "fa0473550415885bba9c54bd68eb00a6",
"score": "0.6760648",
"text": "def show\n render json: @category\n end",
"title": ""
},
{
"docid": "fd9ebcc697fb371b778f6ad375009c71",
"score": "0.67591804",
"text": "def get_all_apps_with_categories \n get(\"/appcon.json/\")\nend",
"title": ""
},
{
"docid": "faea312189d82d839cf352d2a0dee1d3",
"score": "0.6754653",
"text": "def index\n @product_categories = ProductCategory.all\n\n render json: @product_categories\n end",
"title": ""
},
{
"docid": "01f2fc5f3299a36a5f51ccba2ca4d1f8",
"score": "0.67490494",
"text": "def index\n @categories = Categories.all\n end",
"title": ""
},
{
"docid": "b36451205a8e6e324333241ddeb7b180",
"score": "0.67418635",
"text": "def getCategory(response)\r\n\t\t\t\tcategory_json = JSON.parse response\r\n\t\t\t\tcategory_array = category_json[\"categories\"]\r\n\t\t\t\treturn jsonToCategory(category_array[0])\r\n\t\t\tend",
"title": ""
},
{
"docid": "f1f344ef7316d378cfd8182ef11206ec",
"score": "0.6735566",
"text": "def index\n @categories = @budget.categories\n end",
"title": ""
},
{
"docid": "9d66848a93a58a65fe43e0cbc36fc46a",
"score": "0.67332745",
"text": "def retrieve_categories\n @categories = Category.order(:name)\n end",
"title": ""
},
{
"docid": "73337995866636e73e9841cfe4947fde",
"score": "0.6728167",
"text": "def categories\n Api::V1::ShopsCategories::CompactSerializer.new(\n object.categories.only(:_id, :title)\n ).build_schema\n end",
"title": ""
},
{
"docid": "841fe0e299904ffd5adcc242b5a89afb",
"score": "0.6713947",
"text": "def categories\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "841fe0e299904ffd5adcc242b5a89afb",
"score": "0.6713947",
"text": "def categories\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "91457cf7f4b5f9479cf774e3ddb5d9e8",
"score": "0.6710497",
"text": "def categories\n @categories ||= Hashie::Mash.new\n end",
"title": ""
},
{
"docid": "628c3cf2424d363b8902aa77e904fbcb",
"score": "0.6707734",
"text": "def index\n @categories = Category.select('id, name, parent_id, ancestry').page params[:page]\n respond_with @categories\n end",
"title": ""
},
{
"docid": "54abba7794081a9a1e9e7f789c334de3",
"score": "0.67068243",
"text": "def category(id)\n if id.is_a? Array\n categories(id)\n else\n make_request('/categories/get', {:id => id})\n end\n end",
"title": ""
},
{
"docid": "f5c7d6be0d170294621fcfbf12e1a96a",
"score": "0.67041093",
"text": "def get_categories\n get_sub_categories(nil)\n end",
"title": ""
},
{
"docid": "f5c7d6be0d170294621fcfbf12e1a96a",
"score": "0.67041093",
"text": "def get_categories\n get_sub_categories(nil)\n end",
"title": ""
},
{
"docid": "adc9c955a2dfc494475ea7ecd6b0e786",
"score": "0.67024803",
"text": "def get_categories\n {\n method: \"Tracing.getCategories\"\n }\n end",
"title": ""
},
{
"docid": "eda204b96877f330d65ac77b95d0dbff",
"score": "0.6695717",
"text": "def index\n @client_categories = ClientCategory.all\n end",
"title": ""
},
{
"docid": "3c4a619943cb2055182f9e3400233932",
"score": "0.6693031",
"text": "def list_categories\n header\n input = list(@categories)\n toggle(input) || list_apis(input)\n end",
"title": ""
},
{
"docid": "6ac32a0fc3c7dc794d909b3fc8f0521a",
"score": "0.668605",
"text": "def set_category_list\n\t\tcategories_format_json = HTTPClient.get(\"#{API_URL}category\").body\n\t\tcategories_to_array = JSON.parse(categories_format_json)[\"categories\"]\n\t\tcategories_to_hash = Hash[*(categories_to_array.map{|category|category.values[0,2]}.flatten)]\n\t\t@categories = categories_to_hash\n\tend",
"title": ""
},
{
"docid": "5afde6315e463695e22404528ddac2e0",
"score": "0.6685839",
"text": "def index\n\t\t\t\trespond_with Category.all\n\t\t\tend",
"title": ""
},
{
"docid": "a280a093ef98e314acc2c79346bfb159",
"score": "0.66776514",
"text": "def index\n categories\n end",
"title": ""
},
{
"docid": "666be21601f8e9928ea95ed4b13d7ff3",
"score": "0.6674862",
"text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @award_categories }\n end\n end",
"title": ""
},
{
"docid": "d7b0b4c4fa809885e5098652c7bd3d0e",
"score": "0.6674108",
"text": "def get_categories\n metadata['catgry'].collect do | category |\n Category.new category\n end\n end",
"title": ""
},
{
"docid": "6ef62176649efc1d42ec9a52085e3d04",
"score": "0.66737807",
"text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n # format.json { render json: @webmaster_categories }\n end\n end",
"title": ""
},
{
"docid": "5af0f9bfd11a1dfbeeb007be39c88f81",
"score": "0.6667073",
"text": "def index\n authorize! :index, @user, :message => 'Not authorized as an administrator.'\n @categories = Category.nested_set.select(:id, :title, :content, :secret_field, :parent_id, :lft, :rgt, :depth).paginate(:page => params[:page]).order('id DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n format.xml { render xml: Category.all }\n end\n end",
"title": ""
},
{
"docid": "bb50e1a141d75efbae7a930b1df8feaa",
"score": "0.6666179",
"text": "def getCategories\n return @client.call('metaWeblog.getCategories', @blogid, @username, @password)[0]\n end",
"title": ""
},
{
"docid": "a6b42c15f329d589383aa9be14f08155",
"score": "0.6664737",
"text": "def show\n category = Category.find(params[:id])\n render json: {status: 'SUCCESS', message: 'Loaded category', data:category},status: :ok\n end",
"title": ""
},
{
"docid": "266e0ec963f98d09ddd5f79766cd6f9f",
"score": "0.6660333",
"text": "def get_categories_list\n result, status = get_wrapper('/V1/categories', default_headers)\n return result, status unless status\n return parse_categories(result), status\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.6658391",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.6658391",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.6658391",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.6658391",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.6658391",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.6658391",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.6658391",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.6658391",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.6658391",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.6658391",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.6658391",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.6658391",
"text": "def index\n @categories = Category.all\n end",
"title": ""
}
] |
5662cfabc17d1efa82095cf2a85b51d2
|
Singleton access to mx_l7_application_categories controller.
|
[
{
"docid": "19898fce1c73bdecdc0280493a16f03c",
"score": "0.86693144",
"text": "def mx_l7_application_categories\r\n MXL7ApplicationCategoriesController.instance\r\n end",
"title": ""
}
] |
[
{
"docid": "1a67de5a276a6fd5d7a956907ab2caea",
"score": "0.6607561",
"text": "def mobile_app_categories\n return @mobile_app_categories\n end",
"title": ""
},
{
"docid": "b30dbfacaa41a117badfad7abed142e4",
"score": "0.65852183",
"text": "def index\n @sys_categories = Sys::Category.all\n end",
"title": ""
},
{
"docid": "b1f65e8f2301bbcc8bc1d905394c922e",
"score": "0.6439633",
"text": "def content_filtering_categories\r\n ContentFilteringCategoriesController.instance\r\n end",
"title": ""
},
{
"docid": "b4848b84a458cd9ea8483c081422d4ed",
"score": "0.6431326",
"text": "def index\n @categories = @current_website.categories.all\n end",
"title": ""
},
{
"docid": "2c699e821d924a55e3b474af78def75b",
"score": "0.63498604",
"text": "def index\n @categories = collections_config.values\n end",
"title": ""
},
{
"docid": "89d069d7c4c281d5e0b924d2924fe966",
"score": "0.63094515",
"text": "def index\n @rcadmin_categories = current_admin.categories.default\n end",
"title": ""
},
{
"docid": "22fb4871f0870ad483538da63f26da1b",
"score": "0.6306812",
"text": "def mobile_app_categories()\n return MicrosoftGraph::DeviceAppManagement::MobileAppCategories::MobileAppCategoriesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "99264b86540700e878b92c4c79440035",
"score": "0.62845564",
"text": "def index\n @master_categories = Master::Category.all\n end",
"title": ""
},
{
"docid": "fa1337abcee2973d41d11b527dccaa95",
"score": "0.62383413",
"text": "def index\n @admin_categories = Admin::Category.all\n end",
"title": ""
},
{
"docid": "47c632e85e09046221e937d668437e77",
"score": "0.6236172",
"text": "def get_categories\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "c8a47c540b40d2208dfc1ab91a9b5b8a",
"score": "0.61927897",
"text": "def mobile_app_categories=(value)\n @mobile_app_categories = value\n end",
"title": ""
},
{
"docid": "c8982d55f0b7a7c28de2076a26b64cdf",
"score": "0.61851704",
"text": "def index\n @mk_categories = MkCategoria.all\n end",
"title": ""
},
{
"docid": "8bfa28feedd3792c91188eb9debf0f56",
"score": "0.6127037",
"text": "def all_categories\n end",
"title": ""
},
{
"docid": "430de463893d1974131d271c61269257",
"score": "0.6126239",
"text": "def category_list_builder\n categories = API.get_categories\n categories.each do |cat|\n Category.new(cat)\n end\n end",
"title": ""
},
{
"docid": "3027d6442f2877fdf7dfe86d245ccbe4",
"score": "0.6090305",
"text": "def index\n\t\t@categories = Category.all\n\tend",
"title": ""
},
{
"docid": "d33a8d3dcdfcc54551fcdaef51116b7c",
"score": "0.6057262",
"text": "def index\n\t@categories = Category.all\n\tend",
"title": ""
},
{
"docid": "25fc61cb96cdaa9f29ab67d02c0f2f4c",
"score": "0.60553443",
"text": "def index\n @admin_categories = Category.all\n end",
"title": ""
},
{
"docid": "32ac8fca4e1cacf4c79755f7f6783adb",
"score": "0.6042541",
"text": "def list_categories\n list_categories_button\n wait_for_ajax\n self.class.class_eval { include AddRemoveCategories }\n end",
"title": ""
},
{
"docid": "922b9f725ef1e840599bf0395d9a5119",
"score": "0.6041731",
"text": "def index\n @categories = CategoryService.index\n end",
"title": ""
},
{
"docid": "d2ccd09beeb6945eef0e5bdf63e6698b",
"score": "0.604119",
"text": "def index\n @all_categories = CateItem.all\n end",
"title": ""
},
{
"docid": "948e9d9b257fd5bbf9ead63ff71ccd92",
"score": "0.60218686",
"text": "def show\n @backend_categories = Backend::Category.find(params[:id])\n end",
"title": ""
},
{
"docid": "cb5ce6ed9948fecb96ca43236b1d0c0c",
"score": "0.6008563",
"text": "def index\n @categories = current_user.categories\n end",
"title": ""
},
{
"docid": "283e2750da1f20cafd457f35cd6e44dc",
"score": "0.5999404",
"text": "def index\n # @categories = current_user.categories\n @categories = Category.accessible_by(current_ability).all\n end",
"title": ""
},
{
"docid": "c432ab9a5bc207d8baa2bc0ccddad91f",
"score": "0.59858286",
"text": "def getCategories\n @categories = []\n @categories << Category.new(name: \"All\", id: -1)\n @categories += Category.all\n end",
"title": ""
},
{
"docid": "607f04f0326a37d2ae511aaa84bd8671",
"score": "0.5947995",
"text": "def find_category\n @category = Category.find(params[:category_id])\n\t @main_category = @category.application_root\n end",
"title": ""
},
{
"docid": "2c1edb45ac1b043d62f39be939803df8",
"score": "0.5932337",
"text": "def get_categories()\n\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\tif response.success?\n\t\t\t@categories = response.parsed_response\n\t\telse\n\t\t\traise response.response\n\t\tend\n\t\treturn @categories\n\tend",
"title": ""
},
{
"docid": "e807c866cf116b46de4135917a4ea715",
"score": "0.59281325",
"text": "def index\n @categories = Category.roots\n end",
"title": ""
},
{
"docid": "dcbe8f43b83b52609a14701b97c10598",
"score": "0.59148705",
"text": "def index\n @mcategories = Mcategory.all\n end",
"title": ""
},
{
"docid": "b36c96be39a112b5fbcc7694f78f42e0",
"score": "0.5914039",
"text": "def set_categories\n\t\t@categories = Category.all\t\n\tend",
"title": ""
},
{
"docid": "067771df468df4ab535fb82b2d784a06",
"score": "0.590639",
"text": "def set_categories\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "a39872a672f6981626e27001f10054f1",
"score": "0.59059834",
"text": "def all_categories\n\t\t@categories = Category.all\n\tend",
"title": ""
},
{
"docid": "ac2362223535d54dd84437bba583950a",
"score": "0.5902005",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "4448833a4f4781b18e1eb9041553f4a0",
"score": "0.58886445",
"text": "def index\n ##########\n @category = current_user.category\n end",
"title": ""
},
{
"docid": "853af26e18ec041c1666482ef9289087",
"score": "0.5877848",
"text": "def index\n @cp_categories = Category.all\n @title = \"Categories\"\n end",
"title": ""
},
{
"docid": "6afb3194032664f965af27dcf6a0bab5",
"score": "0.5874651",
"text": "def channel_categories\n build :channel_categories, :using => data_for(:channel_categories)\n end",
"title": ""
},
{
"docid": "a761eaa8ee3fd00b3175dea29773ab0f",
"score": "0.58545136",
"text": "def all_categories\n @mutex.synchronize do\n @categories.keys\n end\n end",
"title": ""
},
{
"docid": "291c3ac012820b20ee940e983fbcd6be",
"score": "0.58537704",
"text": "def categories\n category\n end",
"title": ""
},
{
"docid": "bb1708a56266f58d205ee264a24bb088",
"score": "0.5844984",
"text": "def index\n @aspcategories = Aspcategory.all\n end",
"title": ""
},
{
"docid": "e2155be4231ac31ebcbbb639de4759af",
"score": "0.58444124",
"text": "def conceptual_categories\n @conceptual_categories ||= Fotolia::ConceptualCategories.new(self)\n end",
"title": ""
},
{
"docid": "7402401eda43b90163c3d0491ca4f09e",
"score": "0.5843103",
"text": "def init_root_categories\n @root_categories ||= Category.top_level\n end",
"title": ""
},
{
"docid": "99f556cf1cee45bb926693bc0797098f",
"score": "0.58428377",
"text": "def getCategories(_, _, _)\n @db.categories\n end",
"title": ""
},
{
"docid": "70116ba55014e03cb26dd63fde7333dc",
"score": "0.5821071",
"text": "def categories\n expose Metadata.categories(@oauth_token)\n end",
"title": ""
},
{
"docid": "3d6b742f9abd1062dfacd71bd4cc1c4a",
"score": "0.5814831",
"text": "def category\n conf['category'] || 'apps'\n end",
"title": ""
},
{
"docid": "dbb204f494a32d55d6a2b533c5def5fc",
"score": "0.58060414",
"text": "def index\n @product_categories = Product::Category.all\n end",
"title": ""
},
{
"docid": "7d96fd1c55b7dccedb79c4802d5d3620",
"score": "0.5798279",
"text": "def get_categories(add_params = nil)\n params = {\n }\n api_call('/global/categories(.:format)',:get,params,add_params)\n end",
"title": ""
},
{
"docid": "883f8de0a53da2aeed238c3dbd029393",
"score": "0.5797165",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "dc85329eb0b9e99af6118cb9a6b02a5d",
"score": "0.5796641",
"text": "def index\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "a6d00f4d100b4a5cf2f4093fe96fe6fc",
"score": "0.5787245",
"text": "def index\n\t\t@categories = Category.all\n\t\t@current_user = current_user;\n\t\t@current_category = params[:current_category]\n\tend",
"title": ""
},
{
"docid": "72abbd71aee24b895052c400b704f6fe",
"score": "0.57806396",
"text": "def set_categories\n new_categories = extract_categories_from_url\n unless new_categories.nil?\n @categories = new_categories\n else\n @categories = Type::DefaultCategories\n end\n end",
"title": ""
},
{
"docid": "7dbe27f41f4e4b9f14f27de015fc90d5",
"score": "0.5776969",
"text": "def get_menu_category\n require \"rest_client\"\n require \"json\"\n\n self.categories.update_all(still_present: false)\n response = RestClient.get(\"https://api.omnivore.io/0.1/locations/#{self.omnivore_id}/menu/categories\", {:content_type => :json, :'Api-Key' => Setting.first.app_api_key})\n res = JSON.parse(response)\n res[\"_embedded\"][\"categories\"].each do |category|\n cat = self.categories.where(omnivore_id: category[\"id\"]).first_or_create\n cat.name = category[\"name\"]\n cat.still_present = true\n cat.save\n end\n\n self.categories.where(still_present: false).destroy_all\n end",
"title": ""
},
{
"docid": "eedf60d2d662024b62cc4cf178f51c45",
"score": "0.5772818",
"text": "def index\n @categories = Category.where(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "5c8d7026a3b91f607c8d362f8fd3bef6",
"score": "0.5772046",
"text": "def getCategories()\n\t\tcat = Array.new\n\t\tcat.push(\"heroku\")\n\t\tcat.push(\"go\")\n\t\tcat.push(\"github\")\n\t\tcat.push(\"docker\")\n\t\tcat.push(\"css\")\n\t\tcat.push(\"apache\")\n\t\tcat.push(\"html\")\n\t\tcat.push(\"bootstrap\")\n\t\tcat.push(\"java ee\")\n\t\tcat.push(\"javafx\")\n\t\tcat.push(\"java\")\n\t\tcat.push(\"jquery\")\n\t\tcat.push(\"mips\")\n\t\tcat.push(\"c++\")\n\t\tcat.push(\"laravel\")\n\t\tcat.push(\"linux\")\n\t\tcat.push(\"opengl\")\n\t\tcat.push(\"sml\")\n\t\tcat.push(\"javascript\")\n\t\tcat.push(\"mongo db\")\n\t\tcat.push(\"c\")\n\t\tcat.push(\"yacc\")\n\t\tcat.push(\"circuit\")\n\t\tcat.push(\"php\")\n\t\tcat.push(\"mysql\")\n\t\tcat.push(\"node js\")\n\t\tcat.push(\"photoshop\")\n\t\tcat.push(\"rails\")\n\t\tcat.push(\"postgres\")\n\t\tcat.push(\"ruby\")\n\t\tcat.push(\"redis\")\n\t\tcat.push(\"mac osx\")\n\t\tcat.push(\"sass\")\n\t\tcat.push(\"ubuntu\")\n\t\tcat.push(\"bower\")\n\t\tcat.push(\"wordpress\")\n\t\tcat.push(\"css\")\n\t\tcat.push(\"hosted\")\n\t\tcat.push(\"python\")\n\t\tcat.push(\"maven\")\n\t\tcat.push(\"maven mojo\")\n\t\tcat.push(\"composer\")\n\t\tcat.push(\"mips\")\n\t\tcat.push(\"gulp\")\n\t\tcat.push(\"grunt\")\n\t\tcat.push(\"phpstorm\")\n\t\tcat.push(\"react\")\n\t\tcat.push(\"swift\")\n\t\tcat.push(\"wordpress\")\n\t\tcat.push(\"tomcat\")\n\t\tcat.push(\"redis\")\n\t\tcat.push(\"travis\")\n\t\treturn cat\n\tend",
"title": ""
},
{
"docid": "b38c27533ba8a49f388eeaac8a500827",
"score": "0.57703835",
"text": "def index\n @categories = @project.categories.all\n end",
"title": ""
},
{
"docid": "3260028c0312838346fe92e82ce2ebb4",
"score": "0.5764006",
"text": "def show\r\n @administration_categories = Category.where('parent_id=0').where('active=1')\r\n @current_category = Category.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "8eb2fe4b7f27c4b700eb2d832d924bbd",
"score": "0.57634354",
"text": "def index\n @forum_categories = ForumCategory.all\n end",
"title": ""
},
{
"docid": "e29454de41dd2a376255e0a3dbeb9305",
"score": "0.574504",
"text": "def categories(params={})\n return @categories if (@categories && !params[:force])\n @categories = get_categories\n end",
"title": ""
},
{
"docid": "e4a17b2cac751bb46f3e759a4fb7f7da",
"score": "0.57270813",
"text": "def set_category\n @categories = Category.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a18fe210981ecd2177554c668ec27a7",
"score": "0.5715321",
"text": "def categories_items\n all_items = self.all_active_items\n categories_given_items(all_items)\n end",
"title": ""
},
{
"docid": "3cc627a02045e86d1301730f893d4794",
"score": "0.5712201",
"text": "def index\n @category_systems = CategorySystem.all\n end",
"title": ""
},
{
"docid": "a949e7c5d87430e1f2da989dc6915741",
"score": "0.5709799",
"text": "def index\n @hive_categories = HiveInformation.all\n end",
"title": ""
},
{
"docid": "400a06e2e7ace49ddcf6e9af9859f28f",
"score": "0.5707246",
"text": "def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend",
"title": ""
},
{
"docid": "6efeaaaba50b7a0db22b219004a33703",
"score": "0.57015014",
"text": "def index\n @company_categories = CompanyCategory.all\n end",
"title": ""
},
{
"docid": "2fb97139f79d9a517d351b5df660821a",
"score": "0.56974834",
"text": "def index\n @categories=Category.all\n end",
"title": ""
},
{
"docid": "8c2a5feb154fcb8307c600fd6f50508e",
"score": "0.5686996",
"text": "def set_category\n end",
"title": ""
},
{
"docid": "7659e0e2ef72a446ad5a9c065c624e78",
"score": "0.5676606",
"text": "def index\n @api_v1_group_categories = Api::V1::GroupCategory.all\n end",
"title": ""
},
{
"docid": "007116e834008a66b904fac905f19087",
"score": "0.56706816",
"text": "def index\n @sitecategories = Sitecategory.all\n end",
"title": ""
},
{
"docid": "4d61eebcb066bfa09c02da8f7a3b6759",
"score": "0.56681865",
"text": "def index\n\t\tcreator_categories\n\tend",
"title": ""
},
{
"docid": "b4003aac13a70ea843b56ff6b5a0bd3d",
"score": "0.5665983",
"text": "def categories\n\t\t\t@cat_cache ||= @db.js('musicthoughts.all_categories()').map {|c| c.merge(category: c[@lang]) }\n\t\t\t@cat_cache\n\t\tend",
"title": ""
},
{
"docid": "bee1f6bcf9e53868f1460f3cabc2d448",
"score": "0.56638783",
"text": "def expense_categories\n @expense_categories ||= Harvest::API::ExpenseCategories.new(credentials)\n end",
"title": ""
},
{
"docid": "1a07a27df26cc31658fb6e253d8f6c18",
"score": "0.5658725",
"text": "def index\n @loc_categories = LocCategory.all\n end",
"title": ""
},
{
"docid": "aa647e6050d34d4a9bd837dac34cba1e",
"score": "0.56577444",
"text": "def index\n @activity_categories = ActivityCategory.all\n end",
"title": ""
},
{
"docid": "299d6363e1cc1e5f3d99f27819406cd4",
"score": "0.5654609",
"text": "def categories_shortcut\n (config_params||DEFAULT_CONFIG_PARAMS)[\"Categories Shortcut\"]\n end",
"title": ""
},
{
"docid": "361f3b42cde790e79fd3fcd7680a349f",
"score": "0.5654579",
"text": "def category\n # {{{\n if !@category then\n @category = Category.find(1).with(:is_private.is('t') & \n :category_id.in(User_Category.select(User_Category.category_id) { |cid| \n cid.where(User_Category.user_group_id == user_group_id)\n })).entity\n @category = Category.unassigned_category unless @category\n end\n @category\n end",
"title": ""
},
{
"docid": "ae98a405345cd53aa65a5962f1fdad10",
"score": "0.5649659",
"text": "def categories\n return @categories\n end",
"title": ""
},
{
"docid": "ae98a405345cd53aa65a5962f1fdad10",
"score": "0.5649659",
"text": "def categories\n return @categories\n end",
"title": ""
},
{
"docid": "ae98a405345cd53aa65a5962f1fdad10",
"score": "0.5649659",
"text": "def categories\n return @categories\n end",
"title": ""
},
{
"docid": "caa4f10667052d48fdfa81cb3ac61ffd",
"score": "0.56488466",
"text": "def index\n @category_dbs = CategoryDb.all\n end",
"title": ""
}
] |
93ff33e82a08d71a5469626eaf55f7ff
|
Scaffold methods called from within template
|
[
{
"docid": "9ec1bfe3b9d1953869c9cfae4f8daa04",
"score": "0.0",
"text": "def policy_class_name\n \"#{model.name.as_constant}Policy\"\n end",
"title": ""
}
] |
[
{
"docid": "5819c9e5aab37b53887735937b6434c4",
"score": "0.76325464",
"text": "def scaffold\n end",
"title": ""
},
{
"docid": "18362da27fb3966ac2a80ac45e32ec42",
"score": "0.69444275",
"text": "def views; end",
"title": ""
},
{
"docid": "18362da27fb3966ac2a80ac45e32ec42",
"score": "0.69444275",
"text": "def views; end",
"title": ""
},
{
"docid": "38354c0dd0c314483e4c023b64e49f68",
"score": "0.6771528",
"text": "def view; end",
"title": ""
},
{
"docid": "38354c0dd0c314483e4c023b64e49f68",
"score": "0.6771528",
"text": "def view; end",
"title": ""
},
{
"docid": "713996e91aba164eef856ba0d17484cf",
"score": "0.66335446",
"text": "def view\n end",
"title": ""
},
{
"docid": "c93326b850b6982d9c9b86373906daec",
"score": "0.66101146",
"text": "def view\n \n end",
"title": ""
},
{
"docid": "7f35dbaefc46a2e5bd4ff62483edef9c",
"score": "0.6608537",
"text": "def view\n\t\t\n\tend",
"title": ""
},
{
"docid": "7f35dbaefc46a2e5bd4ff62483edef9c",
"score": "0.6607147",
"text": "def view\n\t\t\n\tend",
"title": ""
},
{
"docid": "e90d2a4012d4d19e71c2c1141dad2897",
"score": "0.6573806",
"text": "def template; end",
"title": ""
},
{
"docid": "e90d2a4012d4d19e71c2c1141dad2897",
"score": "0.6573806",
"text": "def template; end",
"title": ""
},
{
"docid": "e90d2a4012d4d19e71c2c1141dad2897",
"score": "0.6573806",
"text": "def template; end",
"title": ""
},
{
"docid": "4958b4c219f2fb44f7c5f20cf4aaf496",
"score": "0.6569268",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::CampingController\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::CampingHelper\n define_method(:get) do |path, meth, id|\n @scaffold_request_method = 'GET'\n @scaffold_path = path\n @scaffold_method = meth.empty? ? 'index' : meth\n @scaffold_request_id = id.empty? ? nil : id\n scaffold_method_not_allowed if scaffolded_nonidempotent_method?(meth)\n send(@scaffold_method)\n end\n define_method(:post) do |path, meth, id|\n @scaffold_request_method = 'POST'\n @scaffold_path = path\n @scaffold_method = meth.empty? ? 'index' : meth\n @scaffold_request_id = id.empty? ? nil : id\n send(@scaffold_method)\n end\n end",
"title": ""
},
{
"docid": "76bf247a7fc830c99ffdbad5e596447d",
"score": "0.6541893",
"text": "def index\n @my_scaffolds = MyScaffold.all\n end",
"title": ""
},
{
"docid": "0d25aa38f2069cd19ad290f61cf45af8",
"score": "0.6530555",
"text": "def documentor_view\n\n end",
"title": ""
},
{
"docid": "c5d23a1d8161e7d7adcc240789013bd6",
"score": "0.65067184",
"text": "def view_context; end",
"title": ""
},
{
"docid": "3e22b8aaa47fb91a5a0d820f6408dfed",
"score": "0.650295",
"text": "def view\n end",
"title": ""
},
{
"docid": "b0a1470f8691b9dd9dabe2430fcea70b",
"score": "0.6481061",
"text": "def scaffold\n Plaid::Scaffold::Base\n end",
"title": ""
},
{
"docid": "b07d552b4bcb444323a41af90268de5f",
"score": "0.64708126",
"text": "def show\n \t\tsuper\n \tend",
"title": ""
},
{
"docid": "3ac678bc849049a529a0059bf738bd79",
"score": "0.6363065",
"text": "def render(*args)\n bootstrap_page\n super\n end",
"title": ""
},
{
"docid": "b75b168c2910530163ce919f4dd2b2bd",
"score": "0.6358806",
"text": "def templates; end",
"title": ""
},
{
"docid": "ddd02e5d302c4cdc2fde79f6b3269fad",
"score": "0.635486",
"text": "def responsivetemplate\n end",
"title": ""
},
{
"docid": "f07edd49431e0e3b7d674607a25a2b18",
"score": "0.6345726",
"text": "def view\n\tend",
"title": ""
},
{
"docid": "6f18082a4c034d2b9986e29cd5539952",
"score": "0.6284505",
"text": "def scaffold_setup_helper\n helper ScaffoldingExtensions::Helper\n helper ScaffoldingExtensions::ActionControllerHelper\n helper ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::ActionController\n helper_method \"scaffolded_method?\", \"scaffolded_nonidempotent_method?\", :scaffold_url, :scaffold_flash, :scaffold_session\n before_filter :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "4c43c54a26aebbfe653467a93fb44e04",
"score": "0.6281042",
"text": "def index\n @demo_scaffolds = DemoScaffold.all\n end",
"title": ""
},
{
"docid": "546ea4a05322d04deb71c7d453c6ecf8",
"score": "0.6273051",
"text": "def scaffold_setup_helper\n helper ScaffoldingExtensions::Helper\n helper ScaffoldingExtensions::ActionControllerHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::ActionController\n helper_method \"scaffolded_method?\", \"scaffolded_nonidempotent_method?\", :scaffold_url, :scaffold_flash, :scaffold_session\n before_filter :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "0578fd23fd4c72e544cb394cbfd8c434",
"score": "0.6239518",
"text": "def scaffold_setup_helper\n map generate_mapping, :scaffolding_extensions\n map_views '/'\n map_layouts '/'\n engine :Erubis\n layout(:layout){|name, wish| !request.xhr? }\n\n o = Ramaze::App[:scaffolding_extensions].options\n o.roots = [scaffold_template_dir]\n o.views = ['/']\n o.layouts = ['/']\n\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::RamazeController\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::PrototypeHelper\n end",
"title": ""
},
{
"docid": "31e3c591a9d3a1aafdd145b4428711be",
"score": "0.6236956",
"text": "def layout()\n end",
"title": ""
},
{
"docid": "7392582c05d551702f2dc784fb33934b",
"score": "0.62364566",
"text": "def parent_template\n super\n end",
"title": ""
},
{
"docid": "c884033b2f1d25993b95ca59b0386d75",
"score": "0.6224057",
"text": "def view\n { }\n end",
"title": ""
},
{
"docid": "f6a6ea06eb10f32a9697f61f556e7518",
"score": "0.6223804",
"text": "def index\n @ruby2scaffolds = Ruby2scaffold.all\n end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.62237024",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "71563af0ffd68343d6eae0961fd8f746",
"score": "0.6196523",
"text": "def set_my_scaffold\n @my_scaffold = MyScaffold.find(params[:id])\n end",
"title": ""
},
{
"docid": "e0eb2fdac2330c4a16046f94ed54d8b0",
"score": "0.6164287",
"text": "def create\n render(\"content_edit.erb\")\n end",
"title": ""
},
{
"docid": "cbe88188213f70ed4a7e213cf80b7c1c",
"score": "0.616014",
"text": "def new_view_erb\n edit_view_erb\n end",
"title": ""
},
{
"docid": "c0b715e8ca27e89906380701e41b170e",
"score": "0.6142593",
"text": "def show\n raise ActionController::RoutingError.new('Not Found')\n #scaffold 로 자동생성\n end",
"title": ""
},
{
"docid": "c1ee772d379f58173b94b784fb78c9b5",
"score": "0.61334836",
"text": "def template_list\n super\n end",
"title": ""
},
{
"docid": "cf230da34d661ca7f43f4a6de0ae7315",
"score": "0.61309",
"text": "def index\n @scaffold_samples = ScaffoldSample.all\n end",
"title": ""
},
{
"docid": "1c570d96273bfefe6dbc608797c735d3",
"score": "0.6124752",
"text": "def template_setup\n # to be overridden by other controllers\n end",
"title": ""
},
{
"docid": "1c570d96273bfefe6dbc608797c735d3",
"score": "0.6124752",
"text": "def template_setup\n # to be overridden by other controllers\n end",
"title": ""
},
{
"docid": "c123d020b9df702b8f89ab831f4680a8",
"score": "0.6116281",
"text": "def show\r\n checar_super\r\n end",
"title": ""
},
{
"docid": "5304e3ee1d517d389b0ea96ba58796e5",
"score": "0.6108164",
"text": "def show\r\n checar_super\r\n end",
"title": ""
},
{
"docid": "b2bdcea0534c404c5cfec7cf7d86143c",
"score": "0.6098222",
"text": "def show\n \n end",
"title": ""
},
{
"docid": "a1b2d16917c4a8fd4301ee69a068a4d1",
"score": "0.60892624",
"text": "def show\n super\n\n render\n end",
"title": ""
},
{
"docid": "a1b2d16917c4a8fd4301ee69a068a4d1",
"score": "0.60892624",
"text": "def show\n super\n\n render\n end",
"title": ""
},
{
"docid": "4c678b54229f67e7bf1181cefd563164",
"score": "0.6075471",
"text": "def initialize_view\n end",
"title": ""
},
{
"docid": "b370b36a814780cc30165c0067984353",
"score": "0.6052495",
"text": "def render; end",
"title": ""
},
{
"docid": "b370b36a814780cc30165c0067984353",
"score": "0.6052495",
"text": "def render; end",
"title": ""
},
{
"docid": "b370b36a814780cc30165c0067984353",
"score": "0.6052495",
"text": "def render; end",
"title": ""
},
{
"docid": "b370b36a814780cc30165c0067984353",
"score": "0.6052495",
"text": "def render; end",
"title": ""
},
{
"docid": "b370b36a814780cc30165c0067984353",
"score": "0.6052495",
"text": "def render; end",
"title": ""
},
{
"docid": "b370b36a814780cc30165c0067984353",
"score": "0.6052495",
"text": "def render; end",
"title": ""
},
{
"docid": "c2abe2e897d862fa84dc95a1a48d3837",
"score": "0.60419935",
"text": "def new\n @my_test_scaffold = MyTestScaffold.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @my_test_scaffold }\n end\n end",
"title": ""
},
{
"docid": "04bcfd80596ee38308ebaab293fa2015",
"score": "0.6038596",
"text": "def show\n \n end",
"title": ""
},
{
"docid": "5b0ec72358ec669f0789a5d82a62b383",
"score": "0.6028645",
"text": "def loc_view\n \n end",
"title": ""
},
{
"docid": "39522be022748a343d427b3a04f4b4ee",
"score": "0.601735",
"text": "def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name,content|\n view.content_for name, content\n end\n end\n end",
"title": ""
},
{
"docid": "39522be022748a343d427b3a04f4b4ee",
"score": "0.601735",
"text": "def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name,content|\n view.content_for name, content\n end\n end\n end",
"title": ""
},
{
"docid": "a100120a0e949eed8749f1d550e9e800",
"score": "0.6015727",
"text": "def front_page\n\n end",
"title": ""
},
{
"docid": "8e33a3db8688908e329571ceb4d4e842",
"score": "0.60085344",
"text": "def display\n \n end",
"title": ""
},
{
"docid": "8e33a3db8688908e329571ceb4d4e842",
"score": "0.60085344",
"text": "def display\n \n end",
"title": ""
},
{
"docid": "c30957be166b7490cda474a839cc32d8",
"score": "0.6007798",
"text": "def render\n end",
"title": ""
},
{
"docid": "c30957be166b7490cda474a839cc32d8",
"score": "0.6007798",
"text": "def render\n end",
"title": ""
},
{
"docid": "c30957be166b7490cda474a839cc32d8",
"score": "0.6007798",
"text": "def render\n end",
"title": ""
},
{
"docid": "c30957be166b7490cda474a839cc32d8",
"score": "0.6007798",
"text": "def render\n end",
"title": ""
},
{
"docid": "cd601c43e3d0060b04e4b20ff4eb871e",
"score": "0.600329",
"text": "def show\n \n end",
"title": ""
},
{
"docid": "cd601c43e3d0060b04e4b20ff4eb871e",
"score": "0.600329",
"text": "def show\n \n end",
"title": ""
},
{
"docid": "c73d741e5350b44c780e2f7217575ecb",
"score": "0.5992028",
"text": "def show\n @my_test_scaffold = MyTestScaffold.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @my_test_scaffold }\n end\n end",
"title": ""
},
{
"docid": "afc3093d5d3345b21a70ddc98dcceec5",
"score": "0.5970087",
"text": "def details\n render :layout => false #Disable the default layout\n # @stylesheet = 'more_info' #Set the stylesheet\n end",
"title": ""
},
{
"docid": "9697e35ae12fb8335419f8e10b979077",
"score": "0.5963409",
"text": "def template\n @controller.template\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5959305",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "a66321127e502b0b3c3e12700acce43a",
"score": "0.595207",
"text": "def todo\n\n # stub; simply show the view in app/views/static_pages\n\n end",
"title": ""
},
{
"docid": "5116c1ea4797c775872030fd64036a9e",
"score": "0.595166",
"text": "def render\n\n end",
"title": ""
},
{
"docid": "1ac88d90c89fdac1991028947dd90d8d",
"score": "0.5947777",
"text": "def view_context\n self\n end",
"title": ""
},
{
"docid": "77a56d4b034b008c8fa3326077209bc4",
"score": "0.5944894",
"text": "def details\n # renders static page\n end",
"title": ""
},
{
"docid": "89fbf5889a1bc1198299050b1844682d",
"score": "0.5943224",
"text": "def show # will be default will generate show.html.erb\n end",
"title": ""
},
{
"docid": "1eab42754c40ed2bc30f52027ab41dc9",
"score": "0.5936649",
"text": "def view(page, *)\n rails_render(action: page.tr(\"-\", \"_\"), layout: true) ||\n rails_render(html: super.html_safe, layout: true)\n end",
"title": ""
},
{
"docid": "a4e49b22452c505278a6fbd2b103f466",
"score": "0.5935708",
"text": "def contribute\n \trender layout: \"developer_home_template\"\n end",
"title": ""
},
{
"docid": "4b8b8ffdfe6d69c8f888be9a325946d6",
"score": "0.5934932",
"text": "def show\n render component: \"super\"\n end",
"title": ""
},
{
"docid": "ad3725c9ac0d07d53ffb97a1693702f8",
"score": "0.5930643",
"text": "def show \n @alpha_scaffold = AlphaScaffold.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c47791b9a0591778305235685af5b5d",
"score": "0.59292454",
"text": "def build_scaffold!\n directory options[:template].to_s, location\n end",
"title": ""
},
{
"docid": "863ed8661db0d2c47eaf6c1215e0fec0",
"score": "0.5929198",
"text": "def main_container_contents\n h1 raw(\" \")\n div_gutter\n widget Views::Users::ShowViewGen.new(:helper_template => @helper_template)\n\n end",
"title": ""
},
{
"docid": "12b66989cb626b9251c15d2d6b759749",
"score": "0.5926444",
"text": "def scaffold_path\n return 'admin_effective' if admin_effective_scaffold?\n return 'effective' if effective_scaffold?\n 'basic'\n end",
"title": ""
},
{
"docid": "81b8567d97e0c2c3074c159474275526",
"score": "0.5925759",
"text": "def show\n add_view\n end",
"title": ""
},
{
"docid": "1215060261b02206b660efb054ebc2c0",
"score": "0.592137",
"text": "def scaffold_id\n id\n end",
"title": ""
},
{
"docid": "11b905cedceefd0035c88432b90fb31f",
"score": "0.59167165",
"text": "def show\n super\n\n Vedeu.trigger(:_refresh_view_, name)\n end",
"title": ""
},
{
"docid": "6e7a1d3734764c2b16fa5931b2300086",
"score": "0.5904822",
"text": "def show\n @article = Article.find(params[:id]) #scaffoldに追加\n end",
"title": ""
},
{
"docid": "8ace57a7d94ec3e29172a0a3d200d347",
"score": "0.5898055",
"text": "def generate_content; end",
"title": ""
},
{
"docid": "9cfdec68842e7833bd917a18f24f0ae8",
"score": "0.58926004",
"text": "def rendered\n end",
"title": ""
},
{
"docid": "c7f3087925a9f06f430a6593a93c19a3",
"score": "0.5891238",
"text": "def fulldoc_template; end",
"title": ""
},
{
"docid": "e4eae1c5aacdbfd887cf9d3327cf21c3",
"score": "0.5888925",
"text": "def template\r\n TemplateController.instance\r\n end",
"title": ""
},
{
"docid": "e1182313673ceef6055fc0c2a44fccbe",
"score": "0.5885102",
"text": "def show_createitem\n # render :partial => \"createitem\"\n end",
"title": ""
},
{
"docid": "d015bb2d7ae677472f11edc51f415575",
"score": "0.5883597",
"text": "def start_quiz\r\n @title_page = 'Quiz'\r\n erb :start, layout: :template\r\nend",
"title": ""
},
{
"docid": "015d0f413f610b48485a2e79abde118a",
"score": "0.58819497",
"text": "def template_setup; end",
"title": ""
},
{
"docid": "5d7c795e6e5c5b76061634aabeea3023",
"score": "0.5878993",
"text": "def main_content\n wrap_with_batch_action_form do\n build_table_tools\n build_collection\n end\n if active_admin_config.batch_actions.any?\n active_admin_config.batch_actions.each do |batch_action|\n if batch_action.partial.present?\n render(batch_action.partial)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "06de440f51f30a1db46d3ea68e699b46",
"score": "0.58743125",
"text": "def render_scaffold\n (@collection.scaffold || '')\n .gsub('{{DATE}}', Time.now.strftime('%Y-%m-%d'))\n end",
"title": ""
},
{
"docid": "fc0c3daecb5e7cba89186112a19158c7",
"score": "0.58741903",
"text": "def partial_view\n end",
"title": ""
},
{
"docid": "297a29be22933d66901427e18f0b7303",
"score": "0.5873247",
"text": "def create_hooks\n template 'hooks.rb', \"config/initializers/spree_scaffold_#{model_path.pluralize}_hooks.rb\"\n end",
"title": ""
},
{
"docid": "e8a2fd9fe7b00df06685743923a117fe",
"score": "0.5870381",
"text": "def index\n @test_scaffolds = TestScaffold.all\n end",
"title": ""
},
{
"docid": "ea9d9371f5a579fab48b13e50679f938",
"score": "0.5861696",
"text": "def index\n @scaffoldtests = Scaffoldtest.all\n end",
"title": ""
},
{
"docid": "7b2336113e6ffe709ac6ef47f602436b",
"score": "0.5855427",
"text": "def initialize\n super\n render\n end",
"title": ""
},
{
"docid": "73df4e87a5dccf414423413d1da363c3",
"score": "0.58486897",
"text": "def index\n checar_super\n end",
"title": ""
}
] |
af647e3431f01468b52df6150e598ab4
|
Player class should be instantiated with a hash that has :name and :mark keys and will raise exceptoin if the required keys are missing
|
[
{
"docid": "c67f047b7c588a739cc9b0030913954a",
"score": "0.54311067",
"text": "def initialize(input)\n @mark = input.fetch(:mark)\n @name = input.fetch(:name)\n end",
"title": ""
}
] |
[
{
"docid": "b1cca7c978d601a475eb172aaea2e31e",
"score": "0.6507434",
"text": "def initialize(name = \"Player\" , marker) \n @name = name\n @marker = marker\n end",
"title": ""
},
{
"docid": "6ba6484cdd1b3ab92553210300a685d9",
"score": "0.6056753",
"text": "def initialize arguments\n super\n @id = rand(\"zzzzzzzz\".to_i(36)).to_s(36).rjust(8, \"0\")\n if @current_player.name.empty? || @other_player.name.empty?\n raise PlayersMustHaveNames\n end\n end",
"title": ""
},
{
"docid": "fdf6105c39c7d2899faf29ab4dbec843",
"score": "0.59888047",
"text": "def player(name, number, shoe, points, rebounds, assists, steals, blocks, slam_dunks)\n player = \n {\n :player_name => name,\n :number => number,\n :shoe => shoe,\n :points => points,\n :rebounds => rebounds,\n :assists => assists,\n :steals => steals,\n :blocks => blocks,\n :slam_dunks => slam_dunks\n }\nend",
"title": ""
},
{
"docid": "ec3cf4e46fd166c14bf1e9d80a0abc15",
"score": "0.5922581",
"text": "def initialize nickname, *options\n @nickname = nickname\n @statistics = Hash.new\n \n statistics!\n raise PlayerError, \"Player not found\" if @statistics.empty?\n end",
"title": ""
},
{
"docid": "3d05be119cfac0eeb0523028f5193d8f",
"score": "0.59008193",
"text": "def initialize_player(name)\n {\n name: name.to_s,\n hand: [],\n total: 0,\n wins: 0,\n busted: false\n }\nend",
"title": ""
},
{
"docid": "b92c2884b98628324b8914424006ce1f",
"score": "0.5713822",
"text": "def make_player (name,number,shoe,points,rebounds,assists,steals,blocks,slam_dunks)\n your_player = {\n :player_name => name,\n :number => number,\n :shoe => shoe,\n :points => points,\n :rebounds => rebounds,\n :assists => assists,\n :steals => steals,\n :blocks => blocks,\n :slam_dunks => slam_dunks\n }\nend",
"title": ""
},
{
"docid": "4600c7c95b822805799e11531ff60aa2",
"score": "0.57116944",
"text": "def create_players\n other_marker = \"\"\n players = {:One => {:name => \"One\", :marker => \"\"}, :Two => {:name => \"Two\", :marker => \"\"}}\n first_player = true\n players.each do |player_num, player|\n puts \"Player #{player_num.to_s}, Enter your name.\"\n puts \"---\"\n player[:name] = gets.chomp\n puts \"---\"\n if first_player \n player[:marker] = set_marker(player[:name])\n if player[:marker] == \"X\"\n other_marker = \"O\"\n else\n other_marker = \"X\"\n end\n first_player = false\n else\n puts \"#{player[:name]}, your marker is #{other_marker}\"\n player[:marker] = other_marker\n end\n end\n @player1 = Player.new(players[:One][:name], players[:One][:marker])\n @player2 = Player.new(players[:Two][:name], players[:Two][:marker])\n end",
"title": ""
},
{
"docid": "d4fb5360638f2818ee495920162f7624",
"score": "0.5697519",
"text": "def setup_players\n player_name_input = Game.ask_for_input(\"What is your name?\")\n \n begin\n mark_pref_input = Game.ask_for_input(\"Do you prefer O or X? Please type either O or X and press enter.\").downcase\n raise ArgumentError.new(\"Invalid Input!\") if (mark_pref_input != \"o\" && mark_pref_input != \"x\")\n rescue ArgumentError => e\n Game.print_error(e.message, \"You have entered #{mark_pref_input}. Please type either O or X and press enter instead.\")\n retry\n end\n\n if mark_pref_input === \"o\"\n @human_player = HumanPlayer.new(:o, player_name_input)\n @computer_player = ComputerPlayer.new(:x)\n elsif mark_pref_input === \"x\"\n @human_player = HumanPlayer.new(:x, player_name_input)\n @computer_player = ComputerPlayer.new(:o)\n end\n\n puts \"Great! You are #{human_player.mark.to_s} and Computer is #{computer_player.mark.to_s}\".colorize(:green)\n end",
"title": ""
},
{
"docid": "7b86d72c9b24ad8b03869b30a517c928",
"score": "0.5558826",
"text": "def createNewPlayer(fname, lname, email, pickup, address, city, state, zip, gender, affliation, nonPlayer)\n player = Hash.new\n player[:first_name] = fname\n player[:last_name] = lname\n player[:email] = email\n player[:address] = address\n player[:city] = city\n player[:state] = state\n player[:zip] = zip\n player[:gender] = gender\n if (pickup.present? && pickup.include?('Yes'))\n player[:is_pickup_player] = true\n end\n if (affliation.present? && affliation.include?('Manager'))\n player[:is_team_manager] = true\n end\n if (nonPlayer.present? && nonPlayer.include?('Non-Player'))\n player[:is_non_player] = true\n end\n\n player\n end",
"title": ""
},
{
"docid": "0dcf8db04fdb1eeb00edfe9298238e62",
"score": "0.55586195",
"text": "def initialize(player_name, symbol=\"\")\n @name = player_name\n @symbol = symbol\n end",
"title": ""
},
{
"docid": "dd418749ff5a4f111cd6181e0e0d165d",
"score": "0.55447584",
"text": "def initialize(n, *player_mark)\n @n = n\n @num_of_marks = player_mark.length\n #player_mark = [o , x, u]\n \n @players = player_mark.map! do |mark|\n HumanPlayer.new(mark)\n end\n @current_player = @players[0]\n @board = Board.new(n)\n \n end",
"title": ""
},
{
"docid": "28f1718d1ea1493c18b5c75a19dcbf6c",
"score": "0.5529399",
"text": "def initialize raw_player\n @id = raw_player[0]\n @name = raw_player[1]\n @kills = 0\n @deaths = 0\n end",
"title": ""
},
{
"docid": "1f83584f5ff4fdeec10d63d36da756b7",
"score": "0.5520406",
"text": "def player_hash; end",
"title": ""
},
{
"docid": "4ac704fedba65bb44f348de26b1b5a77",
"score": "0.5516712",
"text": "def initialize(options={})\n @square = options.fetch(:square)\n @symbol = options.fetch(:symbol)\n @player = options.fetch(:player)\nend",
"title": ""
},
{
"docid": "c730ca25145c4cae95f737748b13985d",
"score": "0.5515708",
"text": "def test_create_player_in_game\n player_h=player_h={id: \"newone\", alias: \"Just born\"}\n stub_player_create(PlaylyfeClient::Testing::ExpectedResponses.player_created_hash(player_h)) do\n new_player=PlaylyfeClient::V2::Player.create(player_h, @game)\n\n assert_equal player_h[:id], new_player.id \n assert_equal player_h[:alias], new_player.alias\n #check for empty scores and teams?\n\n refute @game.players.find(player_h[:id]).nil?\n end \n end",
"title": ""
},
{
"docid": "8b20eb5ed120f2e23a52d3017092a389",
"score": "0.55071425",
"text": "def check_player(player)\n raise ArgumentError.new(\n \"Player #{player} is not in channel #{@name}!\"\n ) unless has?(player)\n end",
"title": ""
},
{
"docid": "7564db051aa5c0c68806df4e29e83d8f",
"score": "0.54925483",
"text": "def create_player(save_data = nil, pclass = nil, name = nil)\n unless save_data.nil?\n begin\n save_data = JSON.parse(save_data)\n rescue\n raise ArgumentError, \"Save Data corrupted or in invalid format\"\n end\n @@player = Player.new(save_data)\n else\n @@player = Player.new(nil, pclass, name)\n end\n end",
"title": ""
},
{
"docid": "54787cc05b64b0ce0e751922ab2970df",
"score": "0.54847497",
"text": "def initialize(name, symbol)\r\n @player_name = name\r\n @player_symbol = symbol\r\n end",
"title": ""
},
{
"docid": "f5c5661d906d6f4d603a571f1d02c603",
"score": "0.54681385",
"text": "def initialize(opt={})\n [:desc, :start, :no_bonuses].each { |atr| self.send(\"#{atr}=\", opt[atr]) unless opt[atr].nil? }\n @player = Hash.new\n end",
"title": ""
},
{
"docid": "89553a307e73fd3e3768f02ff6b70008",
"score": "0.54510933",
"text": "def initialize(name: nil, key: nil)\n @name = name\n @key = key\n end",
"title": ""
},
{
"docid": "8fcadd5a5aeee1e76a742f90c7eb9677",
"score": "0.54464674",
"text": "def player_params\n params.require(:player).permit(:nick, :leading)\n end",
"title": ""
},
{
"docid": "9e798b6c8fae84650b97a5582ee8de4c",
"score": "0.5445451",
"text": "def initialize(name, side) #=> creates a new player objeect \n @name = name #=> sets the name of the player\n @side = side #=> sets the side of the player can be either 1 or 2\n end",
"title": ""
},
{
"docid": "1038cc58158116ae17f27d17be13ec4f",
"score": "0.5413452",
"text": "def alg_player_declare(player, name_decl)\r\n return if super(player, name_decl)\r\n @log.error(\"alg_player_declare not supported\")\r\n return :not_allowed\r\n end",
"title": ""
},
{
"docid": "1038cc58158116ae17f27d17be13ec4f",
"score": "0.5413452",
"text": "def alg_player_declare(player, name_decl)\r\n return if super(player, name_decl)\r\n @log.error(\"alg_player_declare not supported\")\r\n return :not_allowed\r\n end",
"title": ""
},
{
"docid": "fd12466acabb9555858bdab12345f06a",
"score": "0.5407179",
"text": "def init(entities, args)\n\t\t@entities = entities\n\t\t@entities.each do |e|\n\t\t\tif e.has?(:name) && e.get(:name).downcase == 'player'\n\t\t\t\t@player = e\n\t\t\t\tbreak\n\t\t\tend\t\t\t\n\t\tend\n\t\t\n\t\traise 'Can\\'t find player in entities. You need an entity with :name => \"player\"' if @player.nil?\n\tend",
"title": ""
},
{
"docid": "02571d1d58eae8e65b45fa954d1357d9",
"score": "0.54002094",
"text": "def initialize(player)\n @player = player\n end",
"title": ""
},
{
"docid": "d475a87cdaa241ee139cfdb7333033ce",
"score": "0.5385099",
"text": "def initialize(player_number,marker_local)\n\t\tprint \"\\nPlayer #{player_number} , Enter your name :\"\n\t\t@name=gets.chomp\n\t\t@marker=marker_local\n\t\tif player_number>1 then\n\t\t\tprint \"wel come to game #{@name}!!\"\n\t\telse\n\t\t\tprint \"Hello,#{@name}.\"\n\t\tend\n\t\tprint \" You will be playing with '#{@marker}'\\n\\n\"\n\t\t@has_won=0\n\t\t@player_vector_count=Hash[1=>0,2=>0,3=>0,4=>0,5=>0,6=>0,7=>0,8=>0]\n\tend",
"title": ""
},
{
"docid": "6c2c1e64596331cafcbd0305a0daa3bb",
"score": "0.5356117",
"text": "def initialize(*args)\n #species, level, trainer = nil\n hash = nil\n if args.size == 1 && args[0].is_a?(Hash)\n hash = args[0]\n elsif args.size < 2\n raise ArgumentError, \"wrong number of arguments (given #{args.size}, expected 2)\"\n elsif args.size == 2\n if (args[0].is_a?(Symbol) || args[0].is_a?(Integer)) &&\n (args[1].is_a?(Integer) || args[1].is_a?(Hash))\n species = args[0]\n level = args[1] if args[1].is_a?(Integer)\n hash = args[1] if args[1].is_a?(Hash)\n else\n raise ArgumentError, \"unknown argument format for Pokemon creation.\"\n end\n elsif args.size == 3\n if (args[0].is_a?(Symbol) || args[0].is_a?(Integer)) &&\n args[1].is_a?(Integer) &&\n (args[2].is_a?(Trainer) || args[2].is_a?(Hash))\n species = args[0]\n level = args[1]\n trainer = args[2] if args[2].is_a?(Trainer)\n hash = args[2] if args[2].is_a?(Hash)\n else\n raise ArgumentError, \"unknown argument format for Pokemon creation.\"\n end\n elsif args.size == 4\n if (args[0].is_a?(Symbol) || args[0].is_a?(Integer)) &&\n args[1].is_a?(Integer) &&\n args[2].is_a?(Trainer) &&\n args[3].is_a?(Hash)\n species = args[0]\n level = args[1]\n trainer = args[2]\n hash = args[3]\n else\n raise ArgumentError, \"unknown argument format for Pokemon creation.\"\n end\n end\n if !hash.nil?\n species ||= hash[:species]\n level ||= hash[:level]\n trainer ||= hash[:trainer]\n @genderflag = hash[:gender]\n @name = hash[:name]\n @form = hash[:form]\n @pid = hash[:pid]\n @ivs = hash[:ivs]\n @evs = hash[:evs]\n @happiness = hash[:happiness]\n @ball_used = hash[:ball_used]\n @obtain_type = hash[:obtain_type]\n @obtain_map = hash[:obtain_map]\n @obtain_time = hash[:obtain_time]\n @obtain_level = hash[:obtain_level]\n @moves = hash[:moves]\n @item = hash[:item]\n @status = hash[:status]\n @hp = hash[:hp]\n end\n raise ArgumentError, \"must specify a species to create a Pokemon.\" if species.nil?\n raise ArgumentError, \"must specify a level to create a Pokemon.\" if level.nil?\n\n validate \\\n species => [Symbol, Integer],\n level => Integer,\n trainer => [NilClass, Trainer],\n @genderflag => [NilClass, Integer],\n @name => [NilClass, String],\n @form => [NilClass, Integer],\n @pid => [NilClass, Integer],\n @ivs => [NilClass, Stats],\n @evs => [NilClass, Stats],\n @happiness => [NilClass, Integer],\n @ball_used => [NilClass, Symbol],\n @obtain_type => [NilClass, Symbol],\n @obtain_map => [NilClass, Integer],\n @obtain_time => [NilClass, Time],\n @obtain_level => [NilClass, Integer],\n @moves => [NilClass, Array],\n @item => [NilClass, Symbol, Integer],\n @status => [NilClass, Symbol],\n @hp => [NilClass, Integer]\n\n # Extra validation for properties passes through via a hash.\n if @genderflag.is_a?(Integer) && (@genderflag < 0 || @genderflag > 2)\n raise ArgumentError, \"must specify either 0, 1 or 2 for the gender flag.\"\n end\n if !@form.nil? && @form < 0\n raise ArgumentError, \"forms below id 0 do not exist.\"\n end\n if !@pid.nil? && (@pid < 0 || @pid >= 2 ** 32)\n raise ArgumentError, \"pid has to be between 0 and 2^32.\"\n end\n if !@ivs.nil? && (@ivs.hp < 1 || @ivs.attack < 1 || @ivs.defense < 1 ||\n @ivs.spatk < 1 || @ivs.spdef < 1 || @ivs.speed < 1)\n raise ArgumentError, \"IV stats must be greater than 0.\"\n end\n if !@evs.nil? && (@evs.hp < 0 || @ivs.attack < 0 || @ivs.defense < 0 ||\n @evs.spatk < 0 || @evs.spdef < 0 || @ivs.speed < 0)\n raise ArgumentError, \"EV stats cannot be negative.\"\n end\n if !@happiness.nil? && (@happiness < 0 || @happiness > 255)\n raise ArgumentError, \"happiness must be between 0 and 255.\"\n end\n if !@ball_used.nil? && !Item.exists?(@ball_used)\n raise ArgumentError, \"the ball used must be an existing item.\"\n end\n if !@obtain_type.nil? && ![:MET].include?(@obtain_type)\n raise ArgumentError, \"invalid obtain type.\"\n end\n if !@moves.nil?\n validate_array @moves => UsableMove\n end\n if !@item.nil? && !Item.exists?(@item)\n raise ArgumentError, \"the held item must be an existing item.\"\n end\n if !@status.nil? && ![:BURN,:FROZEN,:PARALYSIS,:POISON,:SLEEP].include?(@status)\n raise ArgumentError, \"the status must be a given status condition.\"\n end\n if !@hp.nil? && @hp < 0\n raise ArgumentError, \"the hp stat cannot be negative.\"\n end\n\n # Ensure the species exists and set some initial values\n # without overwriting possibly pre-set values from the hash.\n species = Species.get(species)\n @species_intname = species.intname\n if @form.nil?\n @form = 0\n if species.get_form_on_creation\n f = species.get_form_on_creation.call(self)\n @form = f || 0\n end\n end\n @name ||= species.name(self.form)\n @exp = EXP.get_exp(species.leveling_rate(self.form), level)\n @pid ||= rand(2 ** 32)\n if @ivs.nil?\n @ivs = Stats.new\n @ivs.hp = rand(32)\n @ivs.attack = rand(32)\n @ivs.defense = rand(32)\n @ivs.spatk = rand(32)\n @ivs.spdef = rand(32)\n @ivs.speed = rand(32)\n end\n if @evs.nil?\n @evs = Stats.new\n @evs.hp = 0\n @evs.attack = 0\n @evs.defense = 0\n @evs.spatk = 0\n @evs.spdef = 0\n @evs.speed = 0\n end\n @happiness ||= species.happiness(self.form)\n @ball_used ||= :POKEBALL\n if trainer\n @ot_name = trainer.name\n @ot_gender = trainer.gender\n @ot_pid = trainer.pid\n else\n @ot_name = nil\n @ot_gender = nil\n @ot_pid = nil\n end\n @obtain_type ||= :MET\n @obtain_map ||= 0\n @obtain_time ||= Time.now\n @obtain_level ||= self.level\n @moves ||= get_moveset_for_level\n calc_stats\n @hp ||= @totalhp\n end",
"title": ""
},
{
"docid": "3b691f29ae4ca10091b07ccd6e600f16",
"score": "0.5355302",
"text": "def player_params\n params.require(:player).permit(:first_name, :last_name, :email, :age, :position)\n end",
"title": ""
},
{
"docid": "c475bd58427cbe486c10a1a335b120bb",
"score": "0.53517705",
"text": "def player_params\n params.require(:player).permit(:first_name, :last_name, :email, :age, :position)\n end",
"title": ""
},
{
"docid": "c475bd58427cbe486c10a1a335b120bb",
"score": "0.53517705",
"text": "def player_params\n params.require(:player).permit(:first_name, :last_name, :email, :age, :position)\n end",
"title": ""
},
{
"docid": "4d1c07340694ccbd40c3ad497dbfc2bf",
"score": "0.5345681",
"text": "def player_params\n params.require(:player).permit(:name, :password, :team_name, :embodied)\n end",
"title": ""
},
{
"docid": "0385409cfc793356058c0848accb495c",
"score": "0.5314681",
"text": "def create_player(name)\n { name: name, balance: 50}\nend",
"title": ""
},
{
"docid": "5bb3c82a23f416d3b2ede632ce262ad7",
"score": "0.5309008",
"text": "def initialize(args={})\n check_all_roles_provided_in!(args)\n players, noplayers = args.partition {|key, *| roles.has_key?(key)}.map {|group| Hash[*group.flatten(1)]}\n @_players = players\n @settings = noplayers\n end",
"title": ""
},
{
"docid": "d8fc9b1bac97e8b583c603600ada9c04",
"score": "0.5306928",
"text": "def player_params\n params.require(:player).permit(:name, :nickname, :activated, :email)\n end",
"title": ""
},
{
"docid": "a8bddd2e1c65ffc19d71c0a95b49e0b5",
"score": "0.5304525",
"text": "def initialize(data={})\n raise ArgumentError unless data.kind_of?(Hash)\n super(data)\n \n raise ArgumentError, \"Name is required\" if @name.nil? or @name.empty?\n end",
"title": ""
},
{
"docid": "9838250c95e5667dda977f5241f730fd",
"score": "0.53028727",
"text": "def initialize(player_name)\n @player = Person.new(player_name)\n @secret_number = SecretNumber.generate\n end",
"title": ""
},
{
"docid": "f425cac408a999e2908449a91222707a",
"score": "0.5290903",
"text": "def player_params\n params.require(:player).permit(:name, :password)\n end",
"title": ""
},
{
"docid": "9851ee6a824f19d36c4f14a51a6a21d8",
"score": "0.5284215",
"text": "def player_params\n params[:player].permit(:name)\n end",
"title": ""
},
{
"docid": "35bc050fc1cec8a49874062024275fb7",
"score": "0.52770185",
"text": "def initialize(raw_player)\n @raw_player = raw_player\n end",
"title": ""
},
{
"docid": "25a41c1971c1873de4ca6e0a67d3dc81",
"score": "0.52757794",
"text": "def initialize(data = {})\n raise ArgumentError unless data.kind_of?(Hash)\n super(data)\n raise ArgumentError, \"Name is required\" if @name.nil? || @name.strip.empty?\n end",
"title": ""
},
{
"docid": "25a41c1971c1873de4ca6e0a67d3dc81",
"score": "0.52757794",
"text": "def initialize(data = {})\n raise ArgumentError unless data.kind_of?(Hash)\n super(data)\n raise ArgumentError, \"Name is required\" if @name.nil? || @name.strip.empty?\n end",
"title": ""
},
{
"docid": "5d187e3ade2c0d3b0560f9cd8d35f8df",
"score": "0.52663934",
"text": "def setup_players\n puts \"Player 1 what is your name\"\n name = gets.chomp \n mark = \"X\"\n value = 1\n @p1 = Player.new(name, mark, value)\n \n \n puts \"Player 2 what is your name\"\n name = gets.chomp\n mark = \"O\"\n value = -1\n @p2 = Player.new(name, mark, value)\n end",
"title": ""
},
{
"docid": "d13cbc3a9826aac73fd27b50611b0cf5",
"score": "0.52615476",
"text": "def initialize(params = {})\n super\n @nickname = params[:nickname] if params[:nickname]\n @strength = params[:strength] ? params[:strength] : \"being lazy\"\n end",
"title": ""
},
{
"docid": "25869bf40c6c0276e26bdde392ec264f",
"score": "0.52553266",
"text": "def player_params\n params.require(:player).permit(:name, :position, :fg, :ft, :tpm, :reb, :ast, :stl, :blk, :pts, :fgs)\n end",
"title": ""
},
{
"docid": "6ac458fd70e1daf9865d602c6981491a",
"score": "0.52527905",
"text": "def initialize()\n @tries = 8\n @name = ask_player_name()\n end",
"title": ""
},
{
"docid": "35f153540bd2807681988392a396a6a0",
"score": "0.5250017",
"text": "def player_params\n params.require(:player).permit(:name, :password, :password_confirmation, :avatar, :role)\n end",
"title": ""
},
{
"docid": "af981ec3cd7db229de985b3ad06b18a8",
"score": "0.52473575",
"text": "def initialize(name) #defining initialize method with the player's name as an argument\n\n @name = name #giving a value to name thanks to 'Player.new(name)'\n @life_points = 10 #defining 10 as the default number of player's life points\n end",
"title": ""
},
{
"docid": "4e3e0154e6cfcc8c936cbfcba9351809",
"score": "0.524641",
"text": "def initialize(player1 = \"Player 1\", player2 = \"Player 2\")\n @player1 = player1\n @player2 = player2\n end",
"title": ""
},
{
"docid": "6100ffc9fe1153eef44bba957f388403",
"score": "0.5245814",
"text": "def player_info(player_hash, numbers, shoes, point, rebound, assist, steal, block, slam_dunk)\n\n player_hash[:number]= numbers\n player_hash[:shoe] = shoes\n player_hash[:points] = point\n player_hash[:rebounds] = rebound\n player_hash[:assists] = assist\n player_hash[:steals] = steal\n player_hash[:blocks] = block\n player_hash[:slam_dunks] = slam_dunk\n return player_hash\nend",
"title": ""
},
{
"docid": "ca71ac331a7f5039984a6fd176ca40d0",
"score": "0.5243898",
"text": "def set_player_name(player)\n\tputs \"Greetings Player. What's your name?\"\n\tname = gets.chomp\n\tif(name.empty?)\n\t\tplayer[:name] = 'Player'\n\telse\n\t\tplayer[:name] = name\n\tend\nend",
"title": ""
},
{
"docid": "06f1c54520586d9e69979bf669c83250",
"score": "0.5242298",
"text": "def initialize(*players)\n\n # Extracting all words from the dictionary and saving it in a Set\n words = File.readlines(\"dictionary.txt\").map(&:chomp)\n @dictionary = Set.new(words)\n\n # Assigning the players array to contain the players name\n @players = players\n\n # Keep check of losses of each player in a HashMap\n @losses = Hash.new { |losses, player| losses[player] = 0 }\n end",
"title": ""
},
{
"docid": "1dbbde7ad960e3675a786b680582648f",
"score": "0.52393216",
"text": "def initialize(player_name) \n @life_points = 10\n @name = player_name\n \n end",
"title": ""
},
{
"docid": "33097dfc16c28dca4ac2c4ee70f85f62",
"score": "0.52362543",
"text": "def initialize(player_name)\n @name = player_name\n @life_points = 10\n end",
"title": ""
},
{
"docid": "eb6b4bcbb0b454cb07a0efc405dcf4d4",
"score": "0.5233665",
"text": "def player_params\n params.require(:player).permit(:ign, :age, :country, :in_game_role, :team_id, :email)\n end",
"title": ""
},
{
"docid": "13932ad4116a2e814790b96ab404c530",
"score": "0.5223884",
"text": "def player_params\n\t\t# params.require(:player).permit(:name, :rank, :class_name, :race, :alignment, :xp, player_spells_attributes: [:id, :level, :spell_id, :_destroy])\n\t\tparams.require(:player).permit!.except(:id, :created_at, :updated_at)\n\tend",
"title": ""
},
{
"docid": "be5dcaaaa092f24f9aa5d8c795678ca7",
"score": "0.5212937",
"text": "def initialize (name, age, height)\n\t\tputs \"initializing new player.\"\n\t\t@name = name\n\t\t@age = age\n\t\t@height = height\n\t#pre-set attribute\n\t\t@position = \"TBD\"\n\tend",
"title": ""
},
{
"docid": "5f604e42f5c1ceeaf7a728507e794479",
"score": "0.5206982",
"text": "def player_params\n params.require(:player).permit(:id, :name, :avatar, :state)\n end",
"title": ""
},
{
"docid": "05c6c0e1c3f70d5e773a6af6fad6c727",
"score": "0.52060497",
"text": "def player_params\n params.require(:player).permit(:first_name, :last_name, :mail,\n :password, :birthday, :position ,:password_confirmation,\n :is_organizer, :avatar)\n end",
"title": ""
},
{
"docid": "a5c8595511609779a8c86ce545cfd608",
"score": "0.52035344",
"text": "def player_params\n params.require(:player).permit!\n end",
"title": ""
},
{
"docid": "f26e0992e966bdcada058266ed7b0249",
"score": "0.5195419",
"text": "def player_params\n params.require(:player).permit(:firstname, :lastname, :nickname, :team)\n end",
"title": ""
},
{
"docid": "9127dd7e2eeefe8a3227424c28803fe8",
"score": "0.51911396",
"text": "def available_player_params\n params.require(:available_player).permit(:first_name, :last_name, :position, :points, :assists, :rebounds, :threes, :field_goal_pct, :free_throw_pct, :steals, :blocks, :turnovers, :league_id)\n end",
"title": ""
},
{
"docid": "7e388a198b53ca24f4fd1bc3f815ab40",
"score": "0.5173809",
"text": "def reject_nested_player(attrs)\n return attrs[:name].blank? || (players.map(&:name).include?(attrs[:name]))\n end",
"title": ""
},
{
"docid": "e0dc738da721ed3721a9936172fc985c",
"score": "0.51712084",
"text": "def to_hash\n { \"player#{@order}\" => { mark: @mark, name: @name } }\n end",
"title": ""
},
{
"docid": "91c3e7905b84cf53e3188dd923a77d4e",
"score": "0.51674306",
"text": "def initialize(player_index, class_name, in_hand)\n\t\nend",
"title": ""
},
{
"docid": "a893acf5fc66038ce05fd44f97405d1d",
"score": "0.51665014",
"text": "def initialize(name_player)\n @name =name_player\n @life_points= 10\n end",
"title": ""
},
{
"docid": "a4ff177195a8d3b838aa4cbc1d1d1e6c",
"score": "0.5166351",
"text": "def player_params\n params.require(:player).permit(:player_id, :team_id, :name, :position, :points, :assists,\n :rebounds, :steals, :turnovers, :blocks, :fantasy, :cost)\n end",
"title": ""
},
{
"docid": "c36f69f1de7a92d388dac0f6935213f9",
"score": "0.5164457",
"text": "def initialize(success, error_message, player)\n super(success, error_message)\n @player = player\n end",
"title": ""
},
{
"docid": "63c975cb195fbe81d2b86dabac95c956",
"score": "0.5161614",
"text": "def create_player(opts = {}) \n\t\t\tseat = opts[:seat]\n\t\t\tif seat\n\t\t\t\topts[:stack] ||= stacks[seat]\n\t\t\t\topts[:name] ||= names[seat]\n\t\t\tend\n\t\t\ttype = opts[:class] || self.default_player_class\n\t\t\topts[:stack] ||= self.default_stack\n\t\t\topts[:game] = self\n\t\t\tobj = type.new(opts)\n\t\t\treturn obj\n\t\tend",
"title": ""
},
{
"docid": "277ee510c0c39258babcb2c41c982aed",
"score": "0.5161529",
"text": "def initialize(name, players, coach)\n @name = name\n @players = players\n @coach = coach\n @points = 0\nend",
"title": ""
},
{
"docid": "45378273242783335bbcb6c66d996b54",
"score": "0.51600116",
"text": "def player_params\n params.require(:player).permit(:pseudo, :email, :score_geo, :score_gci, :score_gen)\n end",
"title": ""
},
{
"docid": "89ed8002be2b6a8d07c85cb9e8f834de",
"score": "0.5157764",
"text": "def player_params\n params.require(:player).permit(:avatar_id, :name)\n end",
"title": ""
},
{
"docid": "71d19ff7a2fb7290586a521ac5542cf6",
"score": "0.5148879",
"text": "def initialize(player_ex, player_oh, game_size=4)\r\n @game_size = game_size\r\n #Set up player related data.\r\n @players = { 1 => player_ex, 2 => player_oh }\r\n end",
"title": ""
},
{
"docid": "4cfa2a818e9cd8333f15c208e30f8358",
"score": "0.514761",
"text": "def player_params\n params.require(:player).permit(:firstName, :lastName, :handicap)\n end",
"title": ""
},
{
"docid": "8905f398471aae142df466ce0b8fff20",
"score": "0.514677",
"text": "def initialize(data={})\n raise ArgumentError unless data.kind_of?(Hash)\n super(data)\n \n if @artist.is_a?(String) then\n @artist = Artist.new(:name => @artist)\n end\n \n raise ArgumentError, \"Artist or mbid is required\" if @artist.nil? && @mbid.nil?\n raise ArgumentError, \"Name is required\" if @name.empty?\n end",
"title": ""
},
{
"docid": "18770c31911ef10f34d2fbde25934794",
"score": "0.5142839",
"text": "def initialize(id, name, password)\n @id_player,@name_player,@password_player = id, name, password\n end",
"title": ""
},
{
"docid": "ac111e126c27f88ecf246868d3632b19",
"score": "0.51405644",
"text": "def initialize(name)\n @name = name\n @roster = {}\nend",
"title": ""
},
{
"docid": "90c5feadff75d6fb18b56c1a42ba3b6b",
"score": "0.51398873",
"text": "def player_params\n params.fetch(:player, {})\n .permit(:firstname, :lastname, :mobile_number, :email_id, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9487deeb2488f887c2e4ae1e15a65146",
"score": "0.5135657",
"text": "def player_params\n params.require(:player).permit(:id, :name, :names, :team_id, :manager, :note, :position, :number, :active, :filename)\n end",
"title": ""
},
{
"docid": "c10b934d7af2ef7890a3d73e5026a2f1",
"score": "0.5133846",
"text": "def initialize(player_id, symb) #called on Player.new\n\t\tputs \"\\n#{player_id}, Enter your name : \" #ask the player in creation to set its nickname\n\t\t@name = gets.chomp\t\t\t\t\t\t\t\t\t\t\t\t#user nick\n\t\t@symb = symb \t\t\t\t\t#x or o depending on arg\n\tend",
"title": ""
},
{
"docid": "ca113ab18e801bd9355a4ba8e5f7a462",
"score": "0.51261824",
"text": "def initialize(name)\n \t\t \t@name = name\n \t\t \t@players = []\n \t\tend",
"title": ""
},
{
"docid": "06dfea4dc8dc43e76c7febc8972e1b11",
"score": "0.5123345",
"text": "def raise_if_missing_key; end",
"title": ""
},
{
"docid": "02cb5e009cc5c81a801e23c6fc61d2cb",
"score": "0.51133305",
"text": "def initPlayers(names)\n \n end",
"title": ""
},
{
"docid": "3dbb16c95a1e1039342ce193fb6325ac",
"score": "0.511029",
"text": "def initialize(save_data = nil, pclass = nil, name = nil)\n unless save_data.nil?\n raise ArgumentError, \"Save Data in unexpected format\" unless save_data.instance_of? Hash\n @hp = save_data['hp']\n @inv = save_data['inv']\n @equip = save_data['equip']\n @lvl = save_data['lvl']\n @str = save_data['str']\n @mind = save_data['mind']\n @dex = save_data['dex']\n @vit = save_data['vit']\n @class = save_data['class']\n @name = save_data['name']\n @cash = save_data['cash']\n @xp = save_data['xp']\n @hit = save_data['hit']\n @defense = save_data['defense']\n @damage = save_data['damage']\n\n # If we don't have any save data, we'll use the starting attributes based on\n # the class the player chose\n else\n raise ArgumentError, \"No player class selected\" if pclass.nil?\n @hp = pclass.hp\n @inv = pclass.inv\n @equip = pclass.equip\n @lvl = pclass.lvl\n @str = pclass.str\n @mind = pclass.mind\n @dex = pclass.dex\n @vit = pclass.vit\n @class = pclass.class\n @name = name\n @cash = pclass.cash\n @xp = 0\n @hit = 0\n @defense = 0\n @damage = \"1d6 + 1\"\n end\n end",
"title": ""
},
{
"docid": "15c10f47d45f12ad518c872492bdcfe8",
"score": "0.5108335",
"text": "def player_params\n params.require(:player).permit(:first_name, :last_name, :position, :salary, :team_id)\n end",
"title": ""
},
{
"docid": "36f44d15306f73460b4d8a64f20b81ed",
"score": "0.51062113",
"text": "def player_params\n params.require(:player).permit(:name, :previous_names, :steam_id, :matches_id)\n end",
"title": ""
},
{
"docid": "429eebaa49617804b2e5615b8e5f832d",
"score": "0.51057225",
"text": "def initialize(score = 0, player_number = 0, player_key = \"1\")\n @score = score\n @player_number = player_number\n @player_key = player_key\n end",
"title": ""
},
{
"docid": "cc8c503c2e4ad6fd6a1fa934d8cafcb3",
"score": "0.51056236",
"text": "def player_params\n params.require(:player).permit(:real_name, :username, :email, :going_to_game)\n end",
"title": ""
},
{
"docid": "b5a783caa0d661fb66133f5c4f84c31d",
"score": "0.51046664",
"text": "def input\n raise NotImplementedError, 'Please implement input method on your player class'\n end",
"title": ""
},
{
"docid": "0c1cde63d925c6a7e559c70bf46fc148",
"score": "0.50974816",
"text": "def initialize(cash, debt, bank_balance, health, storage_item, inventory, has_gun)\r\n Player.cash = cash\r\n Player.debt = debt\r\n Player.bank_balance = bank_balance\r\n Player.health = 100\r\n Player.storage_item = storage_item\r\n Player.inventory = inventory\r\n Player.has_gun = has_gun\r\n end",
"title": ""
},
{
"docid": "7bafc82789c64e03f746520581a2b8ef",
"score": "0.5095308",
"text": "def initialize(content_data)\n raise Exception.new('Wrong formatted S2A_PLAYER packet.') if content_data.nil?\n\n super S2A_PLAYER_HEADER, content_data\n\n # Ignore player count\n @content_data.byte\n @player_hash = {}\n\n while @content_data.remaining > 0\n player_data = @content_data.byte, @content_data.cstring, @content_data.signed_long, @content_data.float\n @player_hash[player_data[1]] = SteamPlayer.new(*player_data[0..3])\n end\n end",
"title": ""
},
{
"docid": "0bebecb34f1adcc07a23ab49fd1a5120",
"score": "0.5077983",
"text": "def poker_player_params\n params.require(:poker_player).permit(:name, :nickname, :title)\n end",
"title": ""
},
{
"docid": "a1e2f6b6a9df1e57f88487249147fece",
"score": "0.50755316",
"text": "def initialize(params)\n # Check if there are any unacceptable attribute names.\n unless params.keys.sort == VALID_FIELDS_AND_TYPES.keys.sort\n raise ArgumentError.new \"Keys of Kit initialization hash don't match \" \\\n \"acceptable values.\"\n end\n\n # Check if any of the attribute datatypes are unacceptable.\n params.keys.each do |attr|\n unless VALID_FIELDS_AND_TYPES[attr].include? params[attr].class\n raise ArgumentError.new \"Data type mismatch in Kit initialization.\"\n end\n end\n\n # Families are going to be stored as FontFamily classes, so seperate them.\n params.each { |k,v| instance_variable_set(\"@#{k}\", v) unless k == 'families' }\n @families = params['families'].map { |f| FontFamily.new(f) }\n end",
"title": ""
},
{
"docid": "bf152f2b14f6d6b76e7df42a143623d6",
"score": "0.5070624",
"text": "def player_params\n params.require(:player).permit(:riotID, :name, :k, :d, :a, :cs, :triple, :quadra, :penta, :towers, :inhibs, :dragon, :baron)\n end",
"title": ""
},
{
"docid": "7e7bf34e1ddeb8e083028ca50072d411",
"score": "0.5067735",
"text": "def player_stats(givenplayer)\n find_the_player(givenplayer).reject { |key, value| key == :player_name }\nend",
"title": ""
},
{
"docid": "02a8c4ac29e8c3ae02e6e2657deb159b",
"score": "0.5065481",
"text": "def player_params\n params[:player].permit(:name, :position, :team, :total_rank, :positional_rank, :bye_week)\n end",
"title": ""
},
{
"docid": "a671e8a8e7c2686d67363ed467023006",
"score": "0.50619805",
"text": "def initialize(name_player) #actions qui s'exécuteront dès lors de la création d'une nouvelle instance\n\t\t@name = name_player\n\t\t@life_point = 10 #n'est pas prit en argument dans la méthode car a une valeur fixe\n\tend",
"title": ""
},
{
"docid": "327e5ee7e234658d68438b33738ff8b9",
"score": "0.5059913",
"text": "def player_params\n params.require(:player).permit(:name, :timezone, :x, :y)\n end",
"title": ""
},
{
"docid": "2f8182088e7896ace9aa101ced836e2e",
"score": "0.5059052",
"text": "def player_params\n params.require(:player).permit(:name, :email, :phone, :rank, :joined, :hidden, :deleted)\n end",
"title": ""
},
{
"docid": "c73baea929a51bf880b63097b219547f",
"score": "0.5054333",
"text": "def player_params\n params.require(:player).permit(:one, :two, :three, :four, :five, :rank, :language, :languageTwo, :location, :solommr, :style, :playerSteamID, :username, :email)\n end",
"title": ""
}
] |
a1d4c4032b5d7c0f21d844747162f3d9
|
Returns a new ChangeNotify object and places a monitor on +path+. The +path+ argument may be a file or a directory. If +recursive is true and +path+ is a directory, then the monitor applies to all subdirectories of +path+. The +filter+ tells the monitor what to watch for, such as file changes, attribute changes, etc. If the +event+ option is specified, it must be a Win32::Event object. It is then set as the event that will be set to the signaled state when a notification has been completed. Yields itself if a block is provided, and automatically closes itself when the block terminates.
|
[
{
"docid": "2f802486392dfc32b1663616053f7bd9",
"score": "0.54693514",
"text": "def initialize(path, recursive, filter, event=nil)\n @path = path\n @recursive = recursive\n @filter = filter\n @overlap = 0.chr * 20 # OVERLAPPED struct\n\n # Because Win32API doesn't do type checking, we do it expicitly here.\n raise TypeError unless path.is_a?(String)\n raise TypeError unless [true, false].include?(recursive)\n raise TypeError unless filter.is_a?(Fixnum)\n\n if event\n raise TypeError unless event.respond_to?(:handle)\n @handle = event.handle\n else\n event = Win32::Event.new\n @handle = event.handle\n end\n \n @event = event\n \n @overlap[16,4] = [@handle].pack('L') # hEvent member\n \n super(@handle)\n \n if block_given?\n begin\n yield self\n ensure\n close\n end\n end \n end",
"title": ""
}
] |
[
{
"docid": "539bdc5cfa490d84aafbb49015dce573",
"score": "0.5044757",
"text": "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",
"title": ""
},
{
"docid": "155a881d57fd9d428a3e05db5dfd580f",
"score": "0.4807635",
"text": "def glob(path)\n path = path.tr('\\\\', '/') if windows?\n if block_given?\n Dir.glob(path) {|f| yield(f)}\n else\n Dir.glob(path)\n end\n end",
"title": ""
},
{
"docid": "bbf761b5aa307220a44fdf925e869949",
"score": "0.47473073",
"text": "def changed_files\n until @changed.empty?\n descriptor = @changed.shift\n file = @watcher.watch_descriptors.delete(descriptor)\n watch(file)\n yield(file)\n end\n end",
"title": ""
},
{
"docid": "bfc9c573d06cfa08571aac906ecdfda8",
"score": "0.4724187",
"text": "def watch(*args, &block)\n yield\n end",
"title": ""
},
{
"docid": "88f4938619f356fec018e672ed9372b7",
"score": "0.46325305",
"text": "def observe_changes(from_root)\n affected_paths = Set.new\n sentinel_path = File.join(from_root, SENTINEL)\n\n # if the directory was recently created, it *seems* like it needs to\n # actually be written out before we start the watch, otherwise we don't\n # receive any events.\n #\n # Unfortunately, sync(3) is a slow/expensive operation and a\n # newly-created direcotry is probably not the most common use-case. As a\n # compromise, we sync(3) only if the directory appears to have been\n # created in the past few seconds.\n if (Time.now - File.stat(from_root).ctime) < 5\n Kernel.syscall(SYS_SYNC)\n end\n\n fsevent = FSEvent.new\n fsevent.watch(from_root, file_events: true, latency: LATENCY) do |paths, meta|\n done = false\n meta['events'].each do |evt|\n # Don't track directories. We could change this...\n next if evt['flags'].include?(ITEM_IS_DIR)\n path = evt['path']\n # Because macOS delivers these events with a configurable latency, we\n # have to wait for it to flush its pipeline before we can escape from\n # the run loop, so we push this sentinel event after invoking the\n # block. We know we're done when we receive it.\n if path.end_with?(SENTINEL)\n done = true\n else\n affected_paths << path\n end\n end\n raise Interrupt if done\n end\n thr = Thread.new { fsevent.run }\n # If we yield before the handler is set up, early events will be\n # discarded.\n sleep 1e-6 until fsevent.instance_variable_get(:@running)\n\n yield\n\n # Once the thread recieves the event for the sentinel_path, it will\n # return, and #join will return.\n FileUtils.touch(sentinel_path)\n thr.join\n File.unlink(sentinel_path) # clean up\n\n affected_paths\n end",
"title": ""
},
{
"docid": "7233caf8a209f2009cc2c13b0a7d7845",
"score": "0.46030313",
"text": "def change_tree(*args)\n begin\n self.model.freeze_notify\n yield(self, *args)\n ensure\n self.model.thaw_notify\n end\n self\n end",
"title": ""
},
{
"docid": "80f02c722614e6de3be2f9ab6ce9e73b",
"score": "0.45693177",
"text": "def check_changes(paths, user)\n paths_by_watched_path={}\n paths_by_users={}\n # look for each path as well\n paths_to_watch=Configuration.config[:paths_to_watch_for_changes]\n\n paths_to_watch.each do |pathtowatch|\n next if ignorable_user?(pathtowatch[:if_commit_user_matches],pathtowatch[:if_commit_user_not_matches], user)\n paths.each do |path|\n path.scan(pathtowatch[:name]) do |w|\n watched_path=pathtowatch[:name]\n paths_by_watched_path[watched_path] ||= [] #make sure entry exists\n paths_by_watched_path[watched_path] << path\n # build the hash keyed by email, containing watched paths\n pathtowatch[:notify_on_change].each do |email|\n paths_by_users[email] ||= []\n paths_by_users[email] << watched_path if !paths_by_users[email].include?(watched_path) \n end\n \n end \n end\n end\n if paths_by_watched_path.size>0 \n yield(paths_by_watched_path,paths_by_users)\n end\n end",
"title": ""
},
{
"docid": "10a5e0ede801a39a01edb56237fc4965",
"score": "0.4525198",
"text": "def glob(pattern, &block)\n result = @lock.with_read_lock { @paths.flat_map { |path| path.glob(pattern, &block) }}\n result unless block\n end",
"title": ""
},
{
"docid": "320799290329b6c02e8f1e3ca8648c15",
"score": "0.4499759",
"text": "def scan_new_or_changed_with_spec(&block) # :yields: file, spec\n yielded_files = {}\n yield_once_block = Proc.new do |file|\n spec_file = spec_for(file)\n next if yielded_files.has_key? spec_file\n next unless File.exist?(spec_file)\n block.call(file, spec_file)\n yielded_files[spec_file]=file\n end\n scan_new(&yield_once_block)\n scan_changed(&yield_once_block)\n end",
"title": ""
},
{
"docid": "974872b9e4aba829b572cff62eee2076",
"score": "0.4492174",
"text": "def filter(&blk)\n Rubylude.new ->() {\n while value = @generator.resume\n Fiber.yield value if blk.call(value)\n end\n }\n end",
"title": ""
},
{
"docid": "afbad43f9f44fb893687d096a3f89a40",
"score": "0.44850728",
"text": "def glob(path, pattern, flags=0)\n flags |= ::File::FNM_PATHNAME\n path = path.chop if path[-1,1] == \"/\"\n\n results = [] unless block_given?\n queue = entries(path).reject { |e| e.name == \".\" || e.name == \"..\" }\n while queue.any?\n entry = queue.shift\n\n if entry.directory? && !%w(. ..).include?(::File.basename(entry.name))\n queue += entries(\"#{path}/#{entry.name}\").map do |e|\n e.name.replace(\"#{entry.name}/#{e.name}\")\n e\n end\n end\n\n if ::File.fnmatch(pattern, entry.name, flags)\n if block_given?\n yield entry\n else\n results << entry\n end\n end\n end\n\n return results unless block_given?\n end",
"title": ""
},
{
"docid": "bb8cdea2825e22344b539679958db25f",
"score": "0.44737154",
"text": "def watch(path, rev=current_revision)\n loop do\n result = wait(path, rev, -1)\n yield result\n rev = result.rev + 1\n end\n end",
"title": ""
},
{
"docid": "01aad30fd0e0e9b9635a5f9798612c9d",
"score": "0.44728535",
"text": "def find_file(*path)\n f = File.join(path)\n if File.exists?(f)\n yield f\n end\n end",
"title": ""
},
{
"docid": "35813e08c61a0ff392d6b69debd389f0",
"score": "0.44230953",
"text": "def in_path(path, &block)\n if path\n Dir.chdir(path, &block)\n else\n block.call\n end\n end",
"title": ""
},
{
"docid": "779e41c274bccfd3bd6dd5c0ada54f3b",
"score": "0.44142556",
"text": "def create_threaded_fsevent(watch_path, options, &action_block)\n fsevent = FSEvent.new\n running_jobs = Set.new\n\n fsevent.watch watch_path, options do |paths|\n paths.delete_if {|path| ignored?(path) }\n log.warn \"Detected change inside: #{paths.inspect}\" unless paths.empty?\n\n if running_jobs.length > 0\n log.warn \"A job is currently running for this watcher, killing...\"\n running_jobs.each {|thread| thread.kill }\n else\n log.warn \"Phew, no running jobs: #{running_jobs}\"\n end\n\n job = Thread.new do\n action_block.call(paths)\n Thread.exit\n end\n\n track_job_on_list(job, running_jobs)\n end\n\n fsevent\n end",
"title": ""
},
{
"docid": "8a3b12297c7e8b855f77f86711f1ec31",
"score": "0.44063988",
"text": "def wait(seconds = INFINITE)\n seconds *= 1000 unless seconds == INFINITE\n \n fni = 0.chr * 65536 # FILE_NOTIFY_INFORMATION struct buffer \n rbytes = [0].pack('L')\n qbytes = [0].pack('L')\n\n subtree = @recursive ? 1 : 0\n dir_handle = get_dir_handle(@path) \n comp_key = [12345].pack('L')\n \n begin\n comp_port = CreateIoCompletionPort(dir_handle, 0, comp_key, 0)\n \n if comp_port == 0\n raise Error, get_last_error\n end\n\n bool = ReadDirectoryChangesW(\n dir_handle,\n fni,\n fni.size,\n subtree,\n @filter,\n rbytes,\n @overlap,\n 0\n )\n \n unless bool\n raise Error, get_last_error\n end\n \n while true\n bool = GetQueuedCompletionStatus(\n comp_port,\n qbytes,\n comp_key,\n @overlap,\n seconds\n )\n \n unless bool\n raise Error, get_last_error\n end\n \n @signaled = true\n @event.signaled = true\n \n break if comp_key.unpack('L').first == 0\n \n yield get_file_action(fni) if block_given?\n \n bool = ReadDirectoryChangesW(\n dir_handle,\n fni,\n fni.size,\n subtree,\n @filter,\n rbytes,\n @overlap,\n 0\n )\n \n unless bool\n raise Error, get_last_error\n end\n end\n ensure \n CloseHandle(dir_handle)\n end\n end",
"title": ""
},
{
"docid": "3b8d0dd636326f6d3d5e43de188cc0d9",
"score": "0.43663436",
"text": "def watch( *glob )\n yield unless block_given?\n files = []\n loop do\n new_files = Dir[*glob].map {|file| File.mtime(file) }\n yield if new_files != files\n files = new_files\n sleep 0.5\n end\nend",
"title": ""
},
{
"docid": "57e5a26bbf538a089c85b9ef6c8d09a9",
"score": "0.43537223",
"text": "def monitor_changes(file, resolution=1)\n puts \"Monitoring #{file}...\"\n last_change = Time.now\n every_n_seconds(resolution) do\n check = File.stat(file).ctime\n if check > last_change\n yield file\n last_change = check\n elsif Time.now - last_change > 60\n puts \"Nothing's happened for a minute, I'm bored.\"\n break\n end\n end\nend",
"title": ""
},
{
"docid": "7d4ee1549a3d034d04f93970baf4a4da",
"score": "0.43165684",
"text": "def ignore(path=nil, &block)\n if path.is_a? Regexp\n @ignored_callbacks << Proc.new {|p| p =~ path }\n elsif path.is_a? String\n path_clean = normalize_path(path)\n if path_clean.include?(\"*\") # It's a glob\n @ignored_callbacks << Proc.new {|p| File.fnmatch(path_clean, p) }\n else\n @ignored_callbacks << Proc.new {|p| p == path_clean }\n end\n elsif block_given?\n @ignored_callbacks << block\n end\n end",
"title": ""
},
{
"docid": "6a136ab96372379f20bb21620c9b46fd",
"score": "0.4312553",
"text": "def chown(path, owner = nil, group = nil, &block)\n add Config::Patterns::Chown do |p|\n p.path = path\n p.owner = owner if owner\n p.group = group if group\n yield p if block_given?\n end\n end",
"title": ""
},
{
"docid": "ed7b9e277010ce38ac33af85e96d8c0c",
"score": "0.4302713",
"text": "def each(&block)\n\t\t\t\treturn to_enum unless block_given?\n\t\t\t\t\n\t\t\t\t::Dir.glob(full_pattern, ::File::FNM_DOTMATCH) do |path|\n\t\t\t\t\t# Ignore `.` and `..` entries.\n\t\t\t\t\tnext if path =~ /\\/..?$/\n\t\t\t\t\t\n\t\t\t\t\tyield Path.new(path, @root)\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "161f1e55a7794bb333c6e22a9bd79137",
"score": "0.43008325",
"text": "def notify(path, event_type = nil)\n changed(true)\n notify_observers(path, event_type)\n end",
"title": ""
},
{
"docid": "5fd259f1ee7df55b7f2cb12eff83ef58",
"score": "0.42855984",
"text": "def setup_watcher!(watch_type, opts)\n return yield unless opts.delete(:watch)\n\n @setup_watcher_mutex.synchronize do\n path = opts[:path]\n added, set = nil, nil\n\n synchronize do\n set = @outstanding_watches.fetch(watch_type)\n added = set.add?(path)\n end\n\n if added\n logger.debug { \"adding watcher #{watch_type.inspect} for #{path.inspect}\"}\n\n # if we added the path to the set, blocking further registration of\n # watches and an exception is raised then we rollback\n begin\n # this path has no outstanding watchers, let it do its thing\n opts[:watcher] = watcher_callback(watch_type)\n\n yield opts\n rescue Exception\n synchronize do\n set.delete(path)\n end\n raise\n end\n else\n logger.debug { \"watcher #{watch_type.inspect} already set for #{path.inspect}\"}\n\n # we did not add the path to the set, which means we are not\n # responsible for removing a block on further adds if the operation\n # fails, therefore, we just yield\n yield opts\n end\n end\n end",
"title": ""
},
{
"docid": "39e93ba7a0a28b9799bf7a5fd17300b5",
"score": "0.4283509",
"text": "def glob(flags = 0)\n if block_given?\n Pathname.glob(@pathname, flags) do |file|\n yield filtered_pathname(file) if visible file\n end\n else\n result = Pathname.glob(@pathname, flags)\n convert_result_if_necessary(result)\n end\n end",
"title": ""
},
{
"docid": "176465f1857013b4913905bed341d73a",
"score": "0.42501256",
"text": "def notify_path(path)\n @blk.call(:path, path, self.class::EXT)\n @path_notified = true\n end",
"title": ""
},
{
"docid": "1fae968dcc6915a6ed67d6488b1e74c4",
"score": "0.4247742",
"text": "def monitor(file_attr_to_checksum=nil)\n\n # Marking/Removing Algorithm:\n # assume that current dir is present\n # ls (glob) the dir path for child dirs and files\n # if child file is not already present, add it as new, mark it and handle its state\n # if file already present, mark it and handle its state.\n # if child dir is not already present, add it as new, mark it and propagates\n # the recursive call\n # if child dir already present, mark it and handle its state\n # marked files will not be remove in next remove phase\n\n # ls (glob) the dir path for child dirs and files\n globed_paths_enum = Dir.glob(@path + \"/*\").to_enum\n \n found_symlinks = {} # Store found symlinks under dir\n loop do\n globed_path = globed_paths_enum.next rescue break\n\n next unless is_globed_path_valid(globed_path)\n if File.symlink?(globed_path)\n add_found_symlinks(globed_path, found_symlinks)\n next\n end\n\n # Get File \\ Dir status\n globed_path_stat = File.lstat(globed_path) rescue next # File or dir removed from OS file system\n if globed_path_stat.file?\n # ----------------------------- FILE -----------------------\n child_stat = @files[globed_path]\n if child_stat\n # Mark that file exists (will not be deleted at end of monitoring)\n child_stat.marked = true\n # Handle existing file If we are not in manual mode.\n # In manual mode do nothing\n handle_existing_file(child_stat, globed_path, globed_path_stat) unless Params['manual_file_changes']\n else\n unless Params['manual_file_changes']\n # Handle regular case of new file.\n handle_new_file(child_stat, globed_path, globed_path_stat)\n else\n # Only create new content data instance based on copied/moved filed.\n handle_moved_file(globed_path, globed_path_stat, file_attr_to_checksum)\n end\n end\n else\n handle_dir(globed_path, file_attr_to_checksum)\n end\n end\n\n remove_not_found_symlinks(found_symlinks)\n\n GC.start\n end",
"title": ""
},
{
"docid": "33e71366876c2f8a3d59861ebacf745f",
"score": "0.42463765",
"text": "def filter(event, &block)\n # filter_func returns all filtered events, including cancelled ones\n filter_func(event).each { |e| block.call(e) }\n end",
"title": ""
},
{
"docid": "65bd07a87ee14e3278ceeefdbdcfe330",
"score": "0.42366827",
"text": "def scan_for_changes(path)\n path = Pathname.new(path)\n path = @app.root.pathname + path if path.relative?\n @app.indexer.scan(path)\n end",
"title": ""
},
{
"docid": "021b7a8c212eb28843da1be20f5bf7f6",
"score": "0.42333382",
"text": "def scan_changed(&block) # :yields: file\n known_files.each do |known_file|\n new_mtime = mtime_for(known_file)\n if new_mtime != last_mtime[known_file]\n block.call(known_file)\n last_mtime[known_file]= new_mtime\n end\n end\n end",
"title": ""
},
{
"docid": "2303d843b8955ad214201fff62874382",
"score": "0.41721007",
"text": "def initialize(path, event=nil, type=nil, fd=nil)\n # set default values\n event = (event.empty?) ? 'CD' : event\n type = type || TYPE_ALL\n \n debug \" [+] new InModule::InotifyMonitor path(#{path.inspect})\" +\n \" event(#{event.inspect}) type(#{type.inspect})\" +\n \" inodeFd(#{fd.inspect})\"\n\n # path could be file or directory but must exists\n if not File.exists? path\n raise WatchError.new \n 'The path does not exist.'\n end\n \n # remove last slash from path\n @path = path.gsub(/\\/$/, '')\n \n # parse type and event string if necessary\n @event = parse_event event # resulting in event bitmask\n \n debug \" [+] @event(#{@event}) event_str(#{event_str})\"\n \n # parse type string into integer TYPE_*\n @type = parse_type type\n \n debug \" [+] @type = #{@type} type_str(#{type_str})\"\n \n # empty watchlist is default\n @watchlist = [] # contains nicknames or channels\n\n # initialize watch and file descriptor ...\n @wd = nil\n @fd = nil\n add_watch(fd) if fd\n end",
"title": ""
},
{
"docid": "f72e14a79e75a3f56c1d2400622a26ac",
"score": "0.41654414",
"text": "def each\n Dir[ path_pattern ].each { |path| yield open(path) }\n end",
"title": ""
},
{
"docid": "fd0bdbb122c8064c8c54db66a89f4e8e",
"score": "0.4154882",
"text": "def glob(pattern = '**/*', **opts)\n Enumerator.new do |acc|\n walk(pattern, **opts) do |path, obj|\n info = BFS::FileInfo.new(path: path, size: obj.size, mtime: obj.last_modified)\n acc << info\n end\n end\n end",
"title": ""
},
{
"docid": "47f36a3c336459a451abb1f077f227b1",
"score": "0.41153204",
"text": "def add_filter(type, path = nil, **options, &block)\n source_location = block.respond_to?(:source_location) ?\n block.source_location.first : caller_files[1]\n result = super\n watch_element(source_location, :\"#{type}_filter\", filters[type].last)\n result\n end",
"title": ""
},
{
"docid": "6833d05c7cf1f179145c28ba79525368",
"score": "0.40945727",
"text": "def each(&block)\n synchronized do\n return if @files.empty?\n\n file_deleteable = []\n # creates this array just once\n watched_files = @files.values\n\n # look at the closed to see if its changed\n watched_files.select {|wf| wf.closed? }.each do |watched_file|\n path = watched_file.path\n begin\n stat = watched_file.restat\n if watched_file.size_changed? || watched_file.inode_changed?(inode(path,stat))\n # if the closed file changed, move it to the watched state\n # not to active state because we want to use MAX_OPEN_FILES throttling.\n watched_file.watch\n end\n rescue Errno::ENOENT\n # file has gone away or we can't read it anymore.\n file_deleteable << path\n @logger.debug? && @logger.debug(\"each: closed: stat failed: #{path}: (#{$!}), deleting from @files\")\n rescue => e\n @logger.debug? && @logger.debug(\"each: closed: stat failed: #{path}: (#{e.inspect})\")\n end\n end\n\n # look at the ignored to see if its changed\n watched_files.select {|wf| wf.ignored? }.each do |watched_file|\n path = watched_file.path\n begin\n stat = watched_file.restat\n if watched_file.size_changed? || watched_file.inode_changed?(inode(path,stat))\n # if the ignored file changed, move it to the watched state\n # not to active state because we want to use MAX_OPEN_FILES throttling.\n # this file has not been yielded to the block yet\n # but we must have the tail to start from the end, so when the file\n # was first ignored we updated the bytes_read to the stat.size at that time.\n # by adding this to the sincedb so that the subsequent modify\n # event can detect the change\n watched_file.watch\n yield(:unignore, watched_file)\n end\n rescue Errno::ENOENT\n # file has gone away or we can't read it anymore.\n file_deleteable << path\n @logger.debug? && @logger.debug(\"each: ignored: stat failed: #{path}: (#{$!}), deleting from @files\")\n rescue => e\n @logger.debug? && @logger.debug(\"each: ignored: stat failed: #{path}: (#{e.inspect})\")\n end\n end\n\n # Send any creates.\n if (to_take = @max_active - watched_files.count{|wf| wf.active?}) > 0\n watched_files.select {|wf| wf.watched? }.take(to_take).each do |watched_file|\n watched_file.activate\n # don't do create again\n next if watched_file.state_history_any?(:closed, :ignored)\n # if the file can't be opened during the yield\n # its state is set back to watched\n if watched_file.initial?\n yield(:create_initial, watched_file)\n else\n yield(:create, watched_file)\n end\n end\n else\n now = Time.now.to_i\n if (now - @lastwarn_max_files) > MAX_FILES_WARN_INTERVAL\n waiting = @files.size - @max_active\n specific = if @close_older.nil?\n \", try setting close_older. There are #{waiting} unopened files\"\n else\n \", files yet to open: #{waiting}\"\n end\n @logger.warn(@max_warn_msg + specific)\n @lastwarn_max_files = now\n end\n end\n\n # wf.active means the actual files were opened\n # and have been read once - unless they were empty at the time\n watched_files.select {|wf| wf.active? }.each do |watched_file|\n path = watched_file.path\n begin\n stat = watched_file.restat\n rescue Errno::ENOENT\n # file has gone away or we can't read it anymore.\n file_deleteable << path\n @logger.debug? && @logger.debug(\"each: active: stat failed: #{path}: (#{$!}), deleting from @files\")\n watched_file.unwatch\n yield(:delete, watched_file)\n next\n rescue => e\n @logger.debug? && @logger.debug(\"each: active: stat failed: #{path}: (#{e.inspect})\")\n next\n end\n\n if watched_file.file_closable?\n @logger.debug? && @logger.debug(\"each: active: file expired: #{path}\")\n yield(:timeout, watched_file)\n watched_file.close\n next\n end\n\n _inode = inode(path,stat)\n read_thus_far = watched_file.bytes_read\n # we don't update the size here, its updated when we actually read\n if watched_file.inode_changed?(_inode)\n @logger.debug? && @logger.debug(\"each: new inode: #{path}: old inode was #{watched_file.inode.inspect}, new is #{_inode.inspect}\")\n watched_file.update_inode(_inode)\n yield(:delete, watched_file)\n yield(:create, watched_file)\n elsif stat.size < read_thus_far\n @logger.debug? && @logger.debug(\"each: file rolled: #{path}: new size is #{stat.size}, old size #{read_thus_far}\")\n yield(:delete, watched_file)\n yield(:create, watched_file)\n elsif stat.size > read_thus_far\n @logger.debug? && @logger.debug(\"each: file grew: #{path}: old size #{read_thus_far}, new size #{stat.size}\")\n yield(:modify, watched_file)\n end\n end\n\n file_deleteable.each {|f| @files.delete(f)}\n end\n end",
"title": ""
},
{
"docid": "765e4b97652b389f7cd81a5435f3f928",
"score": "0.4090416",
"text": "def do_refresh(recurse=true)\n Thread.new do\n file_tree_mutex.synchronize do\n @tree.refresh\n @tree.model.refilter\n @tree.expand_first_row\n end\n end\n end",
"title": ""
},
{
"docid": "18c4504c27589f39a6ecf927664d2608",
"score": "0.40877154",
"text": "def scan_new_or_changed_with_test(&block) # :yields: file, test\n yielded_files = {}\n yield_once_block = Proc.new do |file|\n test_file = test_for(file)\n next if yielded_files.has_key? test_file\n next unless File.exist?(test_file)\n block.call(file, test_file)\n yielded_files[test_file]=file\n end\n scan_new(&yield_once_block)\n scan_changed(&yield_once_block)\n end",
"title": ""
},
{
"docid": "3e3b38d44e64b72860925469d4861060",
"score": "0.40818566",
"text": "def watch_recursive(dir)\n if watch dir\n # if watch current directory succeeded, then continue watching the sub-directories\n Dir.glob(File.join(dir, \"*/\"), File::FNM_DOTMATCH).each do|subdir|\n name = File.basename(subdir)\n next if name == \"..\" or name == \".\"\n watch_recursive subdir\n end\n end\n end",
"title": ""
},
{
"docid": "7b322695a32ddbf33061a556e246df85",
"score": "0.40814775",
"text": "def dir(path, &block)\n add Config::Patterns::Directory do |p|\n p.path = path\n yield p if block_given?\n end\n end",
"title": ""
},
{
"docid": "5b361643cbc4df6df3e6197e0335ce17",
"score": "0.40704495",
"text": "def list_files\n Find.find(path) do |element| yield element end\n end",
"title": ""
},
{
"docid": "f7bba6c8ca21f0a41500d4b4460e6960",
"score": "0.4040294",
"text": "def modify!\n raise ArgumentError.new('no block given') unless block_given?\n\n @mutex.synchronize do\n value = @value\n @value = yield value\n if unlocked_empty?\n @empty_condition.signal\n else\n @full_condition.signal\n end\n apply_deref_options(value)\n end\n end",
"title": ""
},
{
"docid": "96ceee518e80171c992c0e7775a0a4e3",
"score": "0.40138116",
"text": "def watch\n @listener ||= Listen.to(\n File.dirname(PATH),\n only: /\\A#{File.basename(PATH)}\\z/\n ) do |modified, added, removed|\n next if modified.empty? && added.empty? && removed.empty?\n\n reload\n end\n\n @listener.start\n end",
"title": ""
},
{
"docid": "085cb9edfc663a9f6107113e9aa13161",
"score": "0.40093175",
"text": "def each_file\n return to_enum(__method__) unless block_given?\n\n paths.each do |root|\n stat_tree(root).each do |filename, stat|\n if stat.file?\n yield filename\n end\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "166100df6aa4075ff8232f804be6862c",
"score": "0.39863428",
"text": "def each\n changeset.each { |file| yield file }\n end",
"title": ""
},
{
"docid": "97825a8e2cb10f67fee479c120a117f8",
"score": "0.39804572",
"text": "def glob(pattern = '**/*', **_opts)\n Enumerator.new do |acc|\n walk(pattern, with_stat: true) {|info| acc << info }\n end\n end",
"title": ""
},
{
"docid": "fa2190cc192c58ce5a1cd3c86b6950e8",
"score": "0.39718434",
"text": "def at_path #:nodoc:\n value = nil\n Dir.chdir(@resource.value(:path)) do\n value = yield\n end\n value\n end",
"title": ""
},
{
"docid": "34f056d3b7fb15a951e8a14c1bb496ff",
"score": "0.39640266",
"text": "def each_entry(&block) # :yield: p\n Dir.foreach(path) {|f| yield Path::Name.new(f) }\n end",
"title": ""
},
{
"docid": "c02c328650b2e0110ba7aa75a14e97bf",
"score": "0.39590654",
"text": "def filter(*args,&block)\n if args && args.any? || block_given?\n @filter = Lolita::Configuration::Filter.new(dbi,*args,&block)\n add_observer(@filter)\n end\n @filter\n end",
"title": ""
},
{
"docid": "b6090115702939d31eb7e7c32a0387f8",
"score": "0.39555323",
"text": "def in_path(path, &blk)\n old = Dir.pwd\n Dir.chdir path\n say_status :cd, path\n yield\n Dir.chdir old\n end",
"title": ""
},
{
"docid": "5dbd42a3a2fd9d3fd066a85b12bc4dba",
"score": "0.39466977",
"text": "def open(path, &block)\n @io = File.open(path, 'r+') # TODO: r+ will create the file if it doesn't exist =( Do a exists? check before this and simply return nil? Or raise error? I hate errorrrs\n sleep(0.1) until !@io.eof?\n\n @io.readbyte # Sync\n\n if block_given?\n yield(self)\n\n close\n end\n\n self\n end",
"title": ""
},
{
"docid": "2f410d0e7057f05990ad7998e947ed4a",
"score": "0.39423808",
"text": "def watch(&block)\n instance_eval(&block)\n add_watch_callbacks\n end",
"title": ""
},
{
"docid": "58ce220782b091cdb3af430d45f93f97",
"score": "0.3942038",
"text": "def changed_files\n @files.each do |file, stat|\n if new_stat = safe_stat(file)\n if new_stat.mtime > stat.mtime\n @files[file] = new_stat\n yield(file)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b3a587363d927d32020c92203c4f91ec",
"score": "0.39374587",
"text": "def find\n results = [] unless block_given?\n # paths = @path.is_a?(String) ? [@path] : @path\n\n begin\n exclude_dir_regex = @exclude_dir\n rescue => ex\n puts \"--exclude_dir regex Skipping, #{ex.message}\"\n exit\n end\n\n begin\n file_regex = (Regexp.new(@regex) if @regex)\n rescue => ex\n puts \"--rname regex : Skipping, #{ex.message}\"\n exit\n end\n\n recursively_find_file(exclude_dir_regex, path, results, file_regex)\n\n block_given? ? nil : results\n end",
"title": ""
},
{
"docid": "ce477e50a26c53bfd4dfbeb6564900a7",
"score": "0.39359066",
"text": "def each_logical_path(*args, &block)\n return to_enum(__method__, *args) unless block_given?\n\n filters = args.flatten.map { |arg| Manifest.compile_match_filter(arg) }\n logical_paths.each do |a, b|\n if filters.any? { |f| f.call(a, b) }\n if block.arity == 2\n yield a, b\n else\n yield a\n end\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "ce477e50a26c53bfd4dfbeb6564900a7",
"score": "0.39359066",
"text": "def each_logical_path(*args, &block)\n return to_enum(__method__, *args) unless block_given?\n\n filters = args.flatten.map { |arg| Manifest.compile_match_filter(arg) }\n logical_paths.each do |a, b|\n if filters.any? { |f| f.call(a, b) }\n if block.arity == 2\n yield a, b\n else\n yield a\n end\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "bea9cc13af0c5ebfab4a6c564918d7e4",
"score": "0.39326778",
"text": "def dir_contents(path, &b)\n path = Pathname.new(path).cleanpath\n if fs.directory?(path)\n entries = fs.entries(path).map do |entry|\n entry_path = path + entry\n if fs.directory?(entry_path)\n dir_item(entry)\n else\n file_item(entry, fs.get_size(entry_path))\n end\n end\n yield entries\n else\n yield Set.new\n end\n end",
"title": ""
},
{
"docid": "2c003288c19ed850b8902f721efcb384",
"score": "0.39281467",
"text": "def glob_me\n was_changed = false\n files = Dir.glob(path + \"/*\")\n\n # add and monitor new files and directories\n files.each do |file|\n file_stat = File.lstat(file) rescue nil\n if (file_stat.directory?)\n unless (has_dir?(file)) # new directory\n # change state only for existing directories\n # newly added directories have to remain with NEW state\n was_changed = true\n ds = DirStat.new(file, self.stable_state)\n ds.set_event_queue(@event_queue) if @event_queue\n ds.monitor\n add_dir(ds)\n end\n else # it is a file\n unless(has_file?(file)) # new file\n # change state only for existing directories\n # newly added directories have to remain with NEW state\n was_changed = true\n fs = FileStat.new(file, self.stable_state)\n fs.set_event_queue(@event_queue) if @event_queue\n fs.monitor\n add_file(fs)\n end\n end\n end\n\n return was_changed\n end",
"title": ""
},
{
"docid": "b67e6a5271e67623bb1077f5cff08b97",
"score": "0.39259657",
"text": "def each_file_in_tree\n self.directories_in_tree.find_each do |directory|\n next if directory.nil?\n directory.cfs_files.find_each do |cfs_file|\n next if cfs_file.nil?\n\n yield cfs_file if block_given?\n end\n end\n end",
"title": ""
},
{
"docid": "f506d726926330671c2bed6fe1a14ed6",
"score": "0.3922078",
"text": "def watch(path, element)\n watcher_for(path).elements << element\n end",
"title": ""
},
{
"docid": "cac736927ad7db43f6b63e35599a9f55",
"score": "0.39190912",
"text": "def each_data_file(path)\n return enum_for(:each_data_file,path) unless block_given?\n\n each_data_path(path) do |full_path|\n yield(full_path) if File.file?(full_path)\n end\n end",
"title": ""
},
{
"docid": "28563b6349220c69ae3698757e33e55c",
"score": "0.39190868",
"text": "def filter\n opened = unless open?\n open\n true\n end\n\n yield @chain\n\n ensure\n close if opened\n end",
"title": ""
},
{
"docid": "d11b7c75f77e15e38fc4a4f64bb82650",
"score": "0.39181706",
"text": "def scope(path)\n old_node = __getobj__\n node = at(path)\n if node then __setobj__(node)\n else raise \"no node at #{path.inspect}\"\n end\n\n if block_given?\n begin\n yield self\n ensure\n __setobj__(old_node)\n end\n else\n return self\n end\n end",
"title": ""
},
{
"docid": "a32982a9265e73bb59ea34d65edaf4e4",
"score": "0.39149818",
"text": "def glob(pattern, flags: GLOB_OPERATION_FLAGS)\n @sftp.dir.glob(@path.to_s, pattern, flags) { |entry| yield entry.name }\n end",
"title": ""
},
{
"docid": "3ddafa67f5ef50948a1145a2e59eabde",
"score": "0.39138138",
"text": "def foreach(path)\n handle = sftp.opendir!(path)\n while entries = sftp.readdir!(handle)\n entries.each { |entry| yield entry }\n end\n return nil\n ensure\n sftp.close!(handle) if handle\n end",
"title": ""
},
{
"docid": "466ba911a12b5bfb666428b96c7cd913",
"score": "0.39130664",
"text": "def glob(pattern = '**/*', **_opts)\n Enumerator.new do |y|\n walk(pattern) do |path, entry|\n y << file_info(path, entry) if File.fnmatch?(pattern, path, File::FNM_PATHNAME)\n end\n end\n end",
"title": ""
},
{
"docid": "920a4a6da2220c84b31651968303f1c0",
"score": "0.38959816",
"text": "def foreach(&block)\n ::Dir.foreach(path, &block)\n end",
"title": ""
},
{
"docid": "6f1e8cc35a4333207b7ca1f54c981755",
"score": "0.38925275",
"text": "def watch(&block)\n\n # Startup File Watcher\n script_changed = lambda { |modified, added, removed|\n\n @log.debug \"File(s) changed! - #{modified.join(\", \")}\" unless (modified.nil? || modified.empty?)\n @log.debug \"File(s) added! - #{added.join(\", \")}\" unless (added.nil? || added.empty?)\n @log.debug \"File(s) removed! - #{removed.join(\", \")}\" unless (removed.nil? || removed.empty?)\n\n block.call(modified, added, removed)\n }\n\n pig_listener = Listen.to(@project_root_path,\n :ignore => /(^\\..*$|logs.*)/)\n\n pig_listener.change(&script_changed)\n pig_listener.start\n\n\tend",
"title": ""
},
{
"docid": "b7c71aaa103efa3e91e47c8f930185ca",
"score": "0.38899714",
"text": "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",
"title": ""
},
{
"docid": "9b6bf191e6d557013689aae570c236e7",
"score": "0.3887365",
"text": "def watcher_for(path)\n @path_watcher_map[File.expand_path(path)]\n end",
"title": ""
},
{
"docid": "57ce228476177b46d65ecc74f0a79dae",
"score": "0.38838184",
"text": "def start\n return if @thread\n @thread = Thread.start do\n @fd = Inotify.init\n \n @watchers.each do |watch|\n watch.add_watch(@fd)\n end\n\n @filePtr = FFI::IO.for_fd(@fd)\n while true\n debug \" [+] @watch_thread listening for inotify events\"\n \n buffer = FFI::Buffer.alloc_out(Inotify::Event.size + 4096, 1, false)\n event = Inotify::Event.new buffer\n ready = IO.select([@filePtr], nil, nil, nil)\n n = Inotify.read(@fd, buffer, buffer.total)\n\n event_wd = event[:wd]\n event_mask = event[:mask]\n event_len = event[:len]\n\n debug \" [+] meta event message ignored.\" and next if event_len == 0\n \n # the filename is set after the event datastructure(16 bytes fixed)\n event_file = buffer.get_string(16) # 16 bytes offset\n\n debug \" [+] raw event notification wd(#{event_wd.inspect}) \" + \n \"len(#{event[:len]}) mask(#{event_mask}) \" +\n \"subject(#{event_file.inspect})\"\n\n @watchers.each do |watch|\n # process only if watch descriptor matches\n if event_wd == watch.wd\n watch.process(event_mask, event_file, @notify_targets)\n end\n end\n end\n debug \" [+] the watch thread is terminated.\"\n end # end thread\n end",
"title": ""
},
{
"docid": "4f3db7b77ab796f1bb3cf5ed043b133a",
"score": "0.38747",
"text": "def walk\n FileTreeProfiler.monitor_report(:profile, :dir, path)\n @children = []\n Dir.foreach(path) do |entry|\n next if (entry == '..' || entry == '.')\n full_path = ::File.join(path, entry)\n if ::File.directory?(full_path)\n children.push DirFile.new(self, entry)\n else\n children.push DataFile.new(self, entry)\n end\n end\n end",
"title": ""
},
{
"docid": "52d8bfff8592c0afc130825e76eb2080",
"score": "0.38674855",
"text": "def initialize(path)\n @path = path\n \n path = File.expand_path(path) if path\n init_git(path || '.')\n @file_pattern = if @search_path == ''\n \"**.rb\"\n elsif @search_path =~ /\\.rb#{File::SEPARATOR}$/\n # So appending each piece into the search path during init_git\n # causes the search path to always end with a /\n @search_path[0...-1]\n else\n File.join(@search_path,\"**.rb\")\n end\n \n @files = []\n \n FileUtils.cd(@working_dir) do\n git_list = git \"ls-files\"\n git_list.each_line do |line|\n file = line.chomp\n if File.fnmatch(@file_pattern, file)\n @files << file \n end\n end\n end\n \n end",
"title": ""
},
{
"docid": "0ea7c1f1f082717c45c94981ec2f9599",
"score": "0.38531885",
"text": "def find_files(dir, pattern, &block)\n require 'find'\n\n Find.find(dir) do |p|\n if p =~ Regexp.compile(pattern)\n yield p\n end\n end\nend",
"title": ""
},
{
"docid": "b9a20e78335b3a8bd95537ee0015098c",
"score": "0.3842337",
"text": "def find(path='/', &block)\n results = list(path, true)\n return (block_given?) ? results.select(&block) : results\n end",
"title": ""
},
{
"docid": "45ba3c22b04feaaadf812f89925a323a",
"score": "0.38305664",
"text": "def run_loop(path, report, actionfilter = nil, testcasefilter = nil)\n\n result = begin\n mList = File.file?(path) ? path : path+'.rb'\n mList = Dir.entries(path).select do |x|\n x[0..0] != '.' && ( (x=~ /\\.rb$/) || File.directory?(File.join(path,x)))\n end.map do |x|\n File.join(path,x)\n end if File.directory?(path)\n [*mList].sort! do |a, b|\n case a <=> b\n when -1,1\n case File.file?(a) && File.file?(b)\n when true\n case File.basename(a)\n when /setup/\n -1\n when /teardown/\n 1\n else\n case File.basename(b)\n when /setup/\n 1\n when /teardown/\n -1\n else\n a<=>b\n end\n end\n when false\n if(File.file?(a))\n -1\n else\n 1\n end\n end\n when 0\n 0\n end\n end\n rescue\n result = [path]\n end\n\n #llogger = CLogger.new(path)\n result.each do |x|\n begin\n if(File.directory?(x))\n report = run_loop(x, report, actionfilter, testcasefilter)\n else\n next if (not File.exist?(x))\n next if (testcasefilter && (not testcasefilter.include?(x)))\n puts \"Executing testcase: #{x}\"\n report.testcase += 1\n llogger = CLogger.new(x)\n report = processor(x, report, llogger, actionfilter)\n end\n rescue\n puts $!\n end\n end\n\n if block_given?\n yield report\n else\n report\n end\nend",
"title": ""
},
{
"docid": "4c63c9e707306b1c0c81fc3ad9666f9f",
"score": "0.3825878",
"text": "def get_filtered_notifications(filter, time)\n notifications(time, filter)\n end",
"title": ""
},
{
"docid": "a39263cdbd384ea6a443dd73ce5922e3",
"score": "0.3823998",
"text": "def watch_src\n Dispatch::Queue.concurrent.async do\n raise \"$project_src_dir undefined.\" if ! $project_src_dirs\n\n dirs = $project_src_dirs.map { |dir| dir.stringByExpandingTildeInPath }\n options = FSEvent::CLI.parse(dirs.dup << '--file-events')\n format = options[:format]\n\n notifier = FSEvent::Notifier.new\n options[:urls].each do |url|\n puts \"watching #{url.path} with options #{options}\"\n notifier.watch(url.path, *options[:create_flags], options) do |event_list|\n event_list.events.each do |event|\n puts \"reload #{event.path}\"\n self.load_src File.basename(event.path.to_s)\n\n if block_given?\n puts \"yield to block\"\n yield\n end\n end\n end\n end\n notifier.run\n end\n end",
"title": ""
},
{
"docid": "d4a560f979c6a91e3bfa331fbbeeeb71",
"score": "0.38198105",
"text": "def filter(*args, &block)\n if args.length == 1\n args = args.first\n else\n args.freeze\n end\n\n with_opts(:filter=>args, :filter_block=>block)\n end",
"title": ""
},
{
"docid": "fdb133acf03b975561488af7b62f9e0c",
"score": "0.3816483",
"text": "def event_filter(&block)\n filter = EventFilter.new(block)\n @event_filters << filter\n filter\n end",
"title": ""
},
{
"docid": "dd2872c0a0cdc6a5b061ad42c7f9b767",
"score": "0.3815071",
"text": "def foreach(*args, &block)\n warn \"Path::Name#foreach is obsoleted. Use each_line or each_entry.\"\n if FileTest.directory? path\n # For polymorphism between Dir.foreach and IO.foreach,\n # Path::Name#foreach doesn't yield Path::Name object.\n Dir.foreach(path, *args, &block)\n else\n IO.foreach(path, *args, &block)\n end\n end",
"title": ""
},
{
"docid": "a3373078abbebd0999a05199370dc04c",
"score": "0.38098645",
"text": "def get_file(path, &block)\n path = Pathname.new(path).cleanpath\n if fs.file?(path)\n yield fs.get_file(path)\n else\n yield false\n end\n end",
"title": ""
},
{
"docid": "c91e78b0ad7a306da554900459642e34",
"score": "0.38061494",
"text": "def listen_for_changes\n @semaphore.synchronize do\n @files_alive = []\n\n paths = initialize_paths(@paths, @dirs)\n directories = handle_paths(paths)\n if @opts[:recurse]\n update_changed_files(directories)\n end\n\n deleted_files = @file_cache.keys - @files_alive.uniq\n deleted_files.each do |filename|\n @file_cache.delete(filename)\n push_changes(filename, :removed)\n end\n end\n end",
"title": ""
},
{
"docid": "6d001d54ad44fac79265c9b613e3613c",
"score": "0.37951753",
"text": "def ignore(path)\n watcher_for(path).ignore\n end",
"title": ""
},
{
"docid": "b5b12261ba7352271d04d4bc1c56188a",
"score": "0.37909332",
"text": "def for_files(path)\r\n files_names = Dir[path]\r\n files_names.each do |filename|\r\n yield(filename)\r\n end\r\n end",
"title": ""
},
{
"docid": "89df00e9be4beef9ff79fe25bf0a4870",
"score": "0.37797946",
"text": "def process(event_mask, file, notify_targets)\n debug \" [+] Watch process\" +\n \" event_mask(#{event_mask.inspect}) file(#{file.inspect})\"\n\n # do not process event if event is not of correct @type\n is_dir = (event_mask & Inotify::IN_ISDIR) != 0\n\n debug ' [+] stop process, wrong type' and return if\n ( @type == TYPE_DIRECTORY and not is_dir ) or\n ( @type == TYPE_FILE and is_dir )\n\n message = {\n :type => ((is_dir) ? 'directory' : 'file'),\n :event => event_str(event_mask),\n :path => @path,\n :file => file\n }\n \n debug \" [+] Process message for watchlist(#{@watchlist.inspect})\" +\n \" message(#{message.inspect})\"\n \n notify_targets.call(@watchlist, message)\n end",
"title": ""
},
{
"docid": "3f9cd3a7cf53192540c7285b99f4e775",
"score": "0.37768435",
"text": "def inside\n Dir.chdir(dir) do\n output_message\n yield\n end\n end",
"title": ""
},
{
"docid": "3328b86b28c5df7af07f84c6c28ace1e",
"score": "0.3766265",
"text": "def watcher\n zero_start = true \n loop do\n @polling_time.each do |time|\n break if @end_flag\n sleep_interval(time, zero_start)\n zero_start = false\n yield\n end\n break if @end_flag\n end\n end",
"title": ""
},
{
"docid": "833d690982012cb14207b9d6c0c79bbe",
"score": "0.37657896",
"text": "def walk_path(path)\n tree.walk_path(path)\n end",
"title": ""
},
{
"docid": "dc8f2629eebaf9212fbe5680675a551a",
"score": "0.37617582",
"text": "def start_watch(source_path, remote_path, remote_host, rsync_options,\n watch_id, post_sync_command = nil)\n loop do\n # fswatch options:\n # -1: exit after one iteration\n # -r: recurse\n # -L: follow symlinks\n # --event Updated/Removed/Created: only shows events that signify change\n fswatch_options = '-1 -rL --event Updated --event Removed --event Created'\n watch_cmd = \"fswatch #{fswatch_options} \\\"#{source_path}\\\"\"\n # fswatch command stops the thread until it exits, when it detects a change\n `#{watch_cmd}`\n # if there's no remote_host, there's no need for an rsync or loop, so return\n return if remote_host.nil?\n sync_msg(source_path, remote_path, remote_host, watch_id)\n sync(source_path, remote_path, remote_host, rsync_options,\n post_sync_command)\n end\nend",
"title": ""
},
{
"docid": "9d258fd43d1f1c0735aba5031ac02c7e",
"score": "0.3758531",
"text": "def changePath(path, &block)\n currPath = Dir.pwd\n begin\n Dir.chdir(path)\n result = block.call\n Dir.chdir(currPath)\n result\n rescue\n Dir.chdir(currPath)\n raise $!\n end\nend",
"title": ""
},
{
"docid": "5d3560cc67519031d8dbda0881773495",
"score": "0.37559888",
"text": "def fi_scan\n FileObj.all.each do |fo|\n fd = File.open(fo.abs_path)\n if dirty?(fo, fd)\n\t\t\t\twarn\n\t\t\t\tnotify_admin fo if CONFIG['notify_admin']\n\t\t\telse\n\t\t\t\tclean\n\t\t\tend\n puts fo.abs_path\n end\n end",
"title": ""
},
{
"docid": "761985d77f68dec091e47f954e1a62d8",
"score": "0.37481928",
"text": "def scan_new(&block) # :yields: file\n old_known_files = @known_files\n scan\n new_files = known_files - old_known_files\n new_files.each do |new_file|\n block.call(new_file)\n end\n end",
"title": ""
},
{
"docid": "367173b7b5838b557bd17243a63348d9",
"score": "0.37478334",
"text": "def synchronize(path)\n path = File.join(Dir.tmpdir, \"#{Rip.md5(path)}.lock\")\n file = File.new(path, 'w+')\n file.flock(File::LOCK_EX)\n yield\n ensure\n file.flock(File::LOCK_UN)\n file.close\n # We can't safely cleanup the lock file. This litters tmp with\n # lock files. Not a big deal but we could do better.\n end",
"title": ""
},
{
"docid": "c9b5f67cf40ecbe7030b37259fc629c1",
"score": "0.3740942",
"text": "def for_contents(path)\r\n if(path.end_with? 'zip')\r\n for_zipped_contents(path) { |line| yield(line) }\r\n else\r\n File.open(path, \"r\") do |file|\r\n file.each_line do |line|\r\n yield(line)\r\n end\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "2619f2145f550e244169965acb390539",
"score": "0.37342843",
"text": "def watch(directory)\n worker.watch(directory) do |modified_dirs|\n files = modified_files(modified_dirs)\n @callback.call(files) unless files.empty?\n end\n end",
"title": ""
},
{
"docid": "b554a78c2225e4ab464c3ba231ae2ad5",
"score": "0.37330604",
"text": "def watch(name, context: self, method: nil, &blk)\n watcher = blk ? Watcher.new(name, context: context, &blk) : watch_method(name, context: context, method: method)\n watchers.delete_if { |w| w.name == name }\n watchers << watcher.check\n end",
"title": ""
},
{
"docid": "9bdd9ef92358ddbd23666834cb180c99",
"score": "0.37202013",
"text": "def grep(pattern, treeish=head) # :yields: path, blob\n options = pattern.respond_to?(:merge) ? pattern.dup : {:e => pattern}\n options.delete_if {|key, value| nil_or_empty?(value) }\n options = options.merge!(\n :cached => true,\n :name_only => true,\n :full_name => true\n )\n \n unless commit = grit.commit(treeish)\n raise \"unknown commit: #{treeish}\"\n end\n \n sandbox do |git, work_tree, index_file|\n git.read_tree({:index_output => index_file}, commit.id)\n git.grep(options).split(\"\\n\").each do |path|\n yield(path, (commit.tree / path))\n end\n end\n self\n end",
"title": ""
},
{
"docid": "4e230613ca6bf8b1b1f36a969a43140b",
"score": "0.37198225",
"text": "def patch(*args, &block)\n options = Map.options_for!(args)\n\n user = options[:user] || ENV['USER'] || 'ro'\n msg = options[:message] || \"#{ user } edits on #{ File.basename(@root).inspect }\"\n add = options.has_key?(:add) ? options[:add] : true\n\n patch = nil\n\n Thread.exclusive do\n @root.lock do\n Dir.chdir(@root) do\n # ensure .git-ness\n #\n status, stdout, stderr = spawn(\"git rev-parse --git-dir\", :raise => true, :capture => true)\n\n git_root = stdout.to_s.strip\n\n dot_git = File.expand_path(git_root)\n\n unless test(?d, dot_git)\n raise Error.new(\"missing .git directory #{ dot_git }\")\n end\n\n # calculate a tmp branch name\n #\n time = Coerce.time(options[:time] || Time.now).utc.iso8601(2).gsub(/[^\\w]/, '')\n branch = \"#{ user }-#{ time }-#{ rand.to_s.gsub(/^0./, '') }\"\n\n # allow block to edit, compute the patch, attempt to apply it\n #\n begin\n # get pristine\n #\n spawn(\"git checkout -f master\", :raise => true)\n spawn(\"git fetch --all\", :raise => true)\n spawn(\"git reset --hard origin/master\", :raise => true)\n\n # pull recent changes\n #\n trying('to pull'){ spawn(\"git pull origin master\") }\n\n # create a new temporary branch\n #\n spawn(\"git checkout -b #{ branch.inspect }\", :raise => true)\n\n # the block can perform arbitrary edits\n #\n block.call\n\n # add all changes - additions, deletions, or modifications - unless :add => false was specified\n #\n if add\n spawn(\"git add . --all\", :raise => true)\n end\n\n # commit if anything changed\n #\n changes_to_apply =\n spawn(\"git commit -m #{ msg.inspect }\")\n\n if changes_to_apply\n # create the patch\n #\n status, stdout, stderr =\n spawn(\"git format-patch master --stdout\", :raise => true, :capture => true)\n\n patch = Patch.new(:data => stdout, :name => branch)\n\n unless stdout.to_s.strip.empty?\n # apply the patch\n #\n spawn(\"git checkout master\", :raise => true)\n\n #\n spawn(\"git rebase --abort\")\n spawn(\"git am --abort\")\n\n spawn(\"git am --abort\")\n spawn(\"git rebase --abort\")\n\n #\n status, stdout, stderr =\n spawn(\"git am --signoff --3way --ignore-space-change --ignore-whitespace\", :capture => true, :stdin => patch.data)\n\n #\n patch.applied = !!(status == 0)\n\n # commit the patch back to the repo\n #\n patch.committed =\n begin\n trying('to pull'){ spawn(\"git pull origin master\") }\n trying('to push'){ spawn(\"git push origin master\") }\n true\n rescue Object\n false\n end\n end\n end\n ensure\n # get pristine\n #\n spawn(\"git checkout -f master\", :raise => true)\n spawn(\"git fetch --all\", :raise => true)\n spawn(\"git reset --hard origin/master\", :raise => true)\n\n spawn(\"git am --abort\")\n spawn(\"git rebase --abort\")\n\n # get changes\n #\n trying('to pull'){ spawn(\"git pull\") }\n\n # nuke the tmp branch\n #\n if patch and patch.applied and patch.committed\n spawn(\"git branch -D #{ branch.inspect }\")\n end\n end\n end\n end\n end\n\n patch\n end",
"title": ""
},
{
"docid": "8d93a8bb5546436408344178d773ff3d",
"score": "0.37194604",
"text": "def update(sender)\n puts \"update was cllaed\"\n pattern=Regexp.new(sender.stringValue)\n filter_files(pattern)\n rescue\n filter_files(nil)\n end",
"title": ""
},
{
"docid": "cca9fc505adb84a85efede855a8e1c84",
"score": "0.37191638",
"text": "def watch_element(path, type, representation = nil)\n list = Watcher::List.for(self)\n element = Watcher::Element.new(type, representation)\n list.watch(path, element)\n list.watch(register_path, element) if registering_extension?\n end",
"title": ""
},
{
"docid": "7a75e876768ddf72135d1158b8e37731",
"score": "0.3717724",
"text": "def all_files_under(path, &ignore)\n path = Pathname(path)\n\n if path.directory?\n path.children.flat_map do |child|\n all_files_under(child, &ignore)\n end.compact\n elsif path.file?\n if block_given? && ignore.call(path)\n []\n else\n [path]\n end\n else\n []\n end\n end",
"title": ""
}
] |
1cf7eede9fec0d321ff54033b0a9c8d8
|
DELETE /invitaciones/1 DELETE /invitaciones/1.xml
|
[
{
"docid": "43005f09ba60b6ed132c2d4ec0e6e345",
"score": "0.7436802",
"text": "def destroy\n @invitacion = Invitacion.find(params[:id])\n @invitacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(invitaciones_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
[
{
"docid": "c705ad045ef7cc340bf9b48842b46d03",
"score": "0.69644105",
"text": "def destroy\n invoice_id = params[:invoice_id]\n Invoiceitem.destroy_all(:invoice_id => invoice_id)\n @invoice = Invoice.find(invoice_id)\n respond_to do |format|\n format.html { redirect_to(invoice_path(@invoice)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3db18dcaa1dca50fb463423ec2824966",
"score": "0.6889466",
"text": "def destroy\n @invitacion = Invitacion.find(params[:id])\n @invitacion.destroy\n\n respond_to do |format|\n format.html { redirect_to invitaciones_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2eba16efa5996a214fb2c3997b4197ac",
"score": "0.6742197",
"text": "def destroy\n @invite = Invite.find(params[:id])\n @invite.destroy\n\n respond_to do |format|\n format.html { redirect_to(invites_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2eba16efa5996a214fb2c3997b4197ac",
"score": "0.6742197",
"text": "def destroy\n @invite = Invite.find(params[:id])\n @invite.destroy\n\n respond_to do |format|\n format.html { redirect_to(invites_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2eba16efa5996a214fb2c3997b4197ac",
"score": "0.6742197",
"text": "def destroy\n @invite = Invite.find(params[:id])\n @invite.destroy\n\n respond_to do |format|\n format.html { redirect_to(invites_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e13c6b115404450ea23718256a23ee9e",
"score": "0.67345536",
"text": "def destroy\n @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e13c6b115404450ea23718256a23ee9e",
"score": "0.67345536",
"text": "def destroy\n @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "81c9d74eddeff35fa9d36611b4b82df7",
"score": "0.6720758",
"text": "def destroy\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8e36417662c96c13a32fe55b3cd5c5f3",
"score": "0.6716219",
"text": "def del\n @office1 = Office1.find(params[:id])\n @office1.destroy\n\n respond_to do |format|\n format.html { redirect_to(office1s_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "faa9e5141e69d3a2d5a9188024e7b46f",
"score": "0.67015",
"text": "def destroy\n @dependencia = Dependencia.find(params[:id])\n @dependencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(dependencias_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7e2b6a2588f86a08999c85e037d2f636",
"score": "0.66956645",
"text": "def destroy\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(@membership) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9fcde0ac4760b383a0511210db09882e",
"score": "0.66854006",
"text": "def destroy\n @Invite = Invite.find(params[:id])\n @Invite.destroy\n\n respond_to do |format|\n format.html { redirect_to(current_user) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "48079a2a0e81f5b230cbcab10eeec67e",
"score": "0.66811556",
"text": "def del\n @status1 = Status1.find(params[:id])\n @status1.destroy\n\n respond_to do |format|\n format.html { redirect_to(status1s_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "822ddea2e45bf78350003645efcbdb54",
"score": "0.66469944",
"text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end",
"title": ""
},
{
"docid": "732e35d80002c7d5891a740e29d95b8d",
"score": "0.6639245",
"text": "def destroy\n @solicitante = Solicitante.find(params[:id])\n @solicitante.destroy\n\n respond_to do |format|\n format.html { redirect_to(solicitantes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "15acbf2772c6d64de478836058f2298c",
"score": "0.66319835",
"text": "def destroy\n @incidente = Incidente.find(params[:id])\n @incidente.destroy\n\n respond_to do |format|\n format.html { redirect_to(incidentes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "40c19081824a1c044d25696f6ae3fee4",
"score": "0.6626772",
"text": "def destroy\n @transaction_xml = Transaction::Xml.find(params[:id])\n @transaction_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(transaction_xmls_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "cc3015193cfa6d6187d64afef1e24d66",
"score": "0.66201586",
"text": "def destroy\n @invoice_operation = InvoiceOperation.find(params[:id])\n @invoice_operation.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoice_operations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3369bcd289df04abd637e7b798703940",
"score": "0.6612739",
"text": "def destroy\n @referencia = Referencia.find(params[:id])\n @referencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(referencias_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5d103cd0c946848f804975d9e823162b",
"score": "0.6611344",
"text": "def destroy\n @entrega = Entrega.find(params[:id])\n @entrega.destroy\n\n respond_to do |format|\n format.html { redirect_to(entregas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0d0d6b488de027da37706b1e31764dce",
"score": "0.660592",
"text": "def destroy\n @invite.destroy\n\n respond_to do |format|\n format.html { redirect_to(invites_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d16d3900be2899307f5cbddaadd28dca",
"score": "0.65820307",
"text": "def destroy\n @asignado = Asignado.find(params[:id])\n @asignado.destroy\n\n respond_to do |format|\n format.html { redirect_to(asignados_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3d84740e25983992292917760ecee611",
"score": "0.6576182",
"text": "def destroy\n @invite_request = InviteRequest.find(params[:id])\n @invite_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(invite_requests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "cd089c85c8a8c719736ac611baae8193",
"score": "0.65757596",
"text": "def destroy\n @invoice = Invoice.where('id = ? and client_id in (?)', params[:id], current_user.company.clients.all.collect(&:id)).first\n not_found and return unless @invoice\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoices_url, :notice => t('.invoice_deleted')) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6b41aa0b73c1ecfb5f0fab9194974b68",
"score": "0.65682447",
"text": "def destroy\n @invitee = Invitee.find(params[:id])\n @invitee.destroy\n\n respond_to do |format|\n format.html { redirect_to(invitees_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7df8d987d5ebd895e40f21fefca40c4b",
"score": "0.6567636",
"text": "def destroy\n @reserva.invitados.delete_all\n @reserva.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'La reserva fue correctamente eliminada.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6b32e661ee4df662d0d753eeedcd953a",
"score": "0.6558263",
"text": "def destroy\r\n @asignacionexa = Asignacionlabexa.find(params[:id])\r\n @asignacionexa.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(asignacionlabexas_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"title": ""
},
{
"docid": "e003b149a52d371ce725d32fd576bb21",
"score": "0.65495896",
"text": "def destroy\n @deposito = Deposito.find(params[:id])\n @deposito.destroy\n\n respond_to do |format|\n format.html { redirect_to(depositos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f652b9b9af589a5e20da45b920fd40aa",
"score": "0.65424234",
"text": "def destroy\n @correspondencia = Correspondencia.find(params[:id])\n @correspondencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(correspondencias_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bd721932feec210802626339a023944c",
"score": "0.6534864",
"text": "def destroy\n @verifikasi = Verifikasi.find(params[:id])\n @verifikasi.destroy\n\n respond_to do |format|\n format.html { redirect_to(verifikasis_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bd721932feec210802626339a023944c",
"score": "0.6534864",
"text": "def destroy\n @verifikasi = Verifikasi.find(params[:id])\n @verifikasi.destroy\n\n respond_to do |format|\n format.html { redirect_to(verifikasis_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d2a9784c2007bed6c20af0af684e45b7",
"score": "0.65314066",
"text": "def destroy\n @efectivo = Efectivo.find(params[:id])\n @efectivo.destroy\n\n respond_to do |format|\n format.html { redirect_to(efectivos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7ac9aee9040d83e69c6ad23151589ae3",
"score": "0.6529279",
"text": "def destroy\n @referencia_nivei = ReferenciaNivel.find(params[:id])\n @referencia_nivei.destroy\n\n respond_to do |format|\n format.html { redirect_to(referencia_niveis_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2a88b068926861c3b6040989421b9dfd",
"score": "0.6513385",
"text": "def destroy\n @expediente = Expediente.find(params[:id])\n @expediente.destroy\n\n respond_to do |format|\n format.html { redirect_to(expedientes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b605365e0a15cb1f035329fc89d9ba45",
"score": "0.6511205",
"text": "def destroy\n @service_apres_vente = ServiceApresVente.find(params[:id])\n @service_apres_vente.destroy\n\n respond_to do |format|\n format.html { redirect_to(service_apres_ventes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "397c9ec476020ac5cb65ccd522b7133e",
"score": "0.65108037",
"text": "def destroy\n @instancia = Instancia.find(params[:id])\n @instancia.destroy\n\n respond_to do |format|\n format.html { redirect_to(instancias_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dcddaf314d728bdf631c8e5e74ffb3a7",
"score": "0.65098506",
"text": "def destroy\n @exemplo = Exemplo.find(params[:id])\n @exemplo.destroy\n\n respond_to do |format|\n format.html { redirect_to(exemplos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b487552769cffba652e75f90a38d2d94",
"score": "0.65093786",
"text": "def destroy\n @invitation_sent = InvitationSent.find(params[:id])\n @invitation_sent.destroy\n\n respond_to do |format|\n format.html { redirect_to(invitation_sents_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "716140e77187b6811beb68015073780e",
"score": "0.65047294",
"text": "def destroy\n @estagiario = Estagiario.find(params[:id])\n @estagiario.destroy\n\n respond_to do |format|\n format.html { redirect_to(estagiarios_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8dafdeb3bd62f3511785bee9fb718cde",
"score": "0.6503268",
"text": "def destroy\n @inscripcion = Inscripcion.find(params[:id])\n @inscripcion.destroy\n\n respond_to do |format|\n format.html { redirect_to(inscripcions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8416550772497d3486db8d6e8b56970e",
"score": "0.64982456",
"text": "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to(asignaturas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8416550772497d3486db8d6e8b56970e",
"score": "0.64982456",
"text": "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to(asignaturas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8416550772497d3486db8d6e8b56970e",
"score": "0.64982456",
"text": "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to(asignaturas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "33559fdb180a5954113edac878ef14e3",
"score": "0.64947164",
"text": "def destroy\n @depositario = Depositario.find(params[:id])\n @depositario.destroy\n\n respond_to do |format|\n format.html { redirect_to(depositarios_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6f2a52cef0f324dcc012dfded3582ae8",
"score": "0.6491147",
"text": "def destroy\n @verano_acceso = VeranoAcceso.find(params[:id])\n @verano_acceso.destroy\n\n respond_to do |format|\n format.html { redirect_to(verano_accesos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6052abc0e9611c9960ecc15d6250209d",
"score": "0.6489777",
"text": "def destroy\n @estagiarios = Estagiario.find(params[:id])\n @estagiarios.destroy\n\n respond_to do |format|\n format.html { redirect_to(homes_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9b36c45cc08f3035dd4a75572fe40f7d",
"score": "0.6488967",
"text": "def destroy\n @fabricante = Fabricante.find(params[:id])\n @fabricante.destroy\n\n respond_to do |format|\n format.html { redirect_to(fabricantes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bdc8b783c50ff576981f4c70ca6e0430",
"score": "0.6488096",
"text": "def destroy\n @episodio = get_by_numero(params[:id])\n @episodio.destroy\n\n respond_to do |format|\n format.html { redirect_to(episodios_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "270b438a1aaf3a23dbd0990e5636f6bf",
"score": "0.64855534",
"text": "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to(respuestas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4600f1ea8c3527c0847a4305091c2fe5",
"score": "0.64679897",
"text": "def destroy\n @revista = Revista.find(params[:id])\n @revista.destroy\n\n respond_to do |format|\n format.html { redirect_to(revistas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3f70ef0267a38adb1ad56c3006e6e831",
"score": "0.64678633",
"text": "def destroy\n @transferencia = Transferencia.find(params[:id])\n @transferencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(transferencias_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "25b5402e76e1c2b743a95c4d20ec0f5f",
"score": "0.6464934",
"text": "def destroy\n @anexo = Anexo.find(params[:id])\n @anexo.destroy\n\n respond_to do |format|\n format.html { redirect_to(anexos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ddd9704ee518d217a1509f2de54cad7e",
"score": "0.64627546",
"text": "def destroy\n @inviterequest = Inviterequest.find(params[:id])\n @inviterequest.destroy\n\n respond_to do |format|\n format.html { redirect_to inviterequests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b02fcbba7b13a8de506067776f6ab4ab",
"score": "0.6461803",
"text": "def destroy\n @invoice_line = InvoiceLine.find(params[:id])\n @invoice_line.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoice_url(@invoice)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9db77723091cc68ce4fc63e75986714c",
"score": "0.64609396",
"text": "def destroy\n @tconexion = Tconexion.find(params[:id])\n @tconexion.destroy\n\n respond_to do |format|\n format.html { redirect_to(tconexions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "af353f1235b19efad06e38970d6cb856",
"score": "0.6460052",
"text": "def destroy\n @visitante = Visitante.find(params[:id])\n @visitante.destroy\n\n respond_to do |format|\n format.html { redirect_to(visitantes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f367810fcec7c0e018bcf5c713b0cee8",
"score": "0.64596057",
"text": "def destroy\n @vente = Vente.find(params[:id])\n @vente.destroy\n\n respond_to do |format|\n format.html { redirect_to(ventes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d3b08ce54441226dbf7db14f2888f6e4",
"score": "0.6452716",
"text": "def destroy\n @reserva = Reserva.find(params[:id])\n @reserva.destroy\n @invitacion = Invitacione.find_all_by_reserva_id(params[:id])\n @invitacion.each do |invitacion|\n invitacion.destroy\n end\n respond_to do |format|\n format.html { redirect_to user_path(get_id) , :notice=> 'Su reserva ha sido eliminada'}\n\n end\n end",
"title": ""
},
{
"docid": "8263296fa6fb0fd857c13676378c9fed",
"score": "0.6452709",
"text": "def destroy\n @tipo_osexterna = TipoOsexterna.find(params[:id])\n @tipo_osexterna.destroy\n\n respond_to do |format|\n format.html { redirect_to(new_tipo_osexterna_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a230bed7cb65e9e924e58b09d7caa1a6",
"score": "0.6447665",
"text": "def destroy\n @autorizacion = Autorizacion.find(params[:id])\n @autorizacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(autorizaciones_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b9d1a5dc5c944dfdef016c342183e812",
"score": "0.64458054",
"text": "def destroy\n @scrap_xml = ScrapXml.find(params[:id])\n @scrap_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(scrap_xmls_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "df26116eb86dbadafed7137f9e3c2f9e",
"score": "0.6445262",
"text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc.root )\r\n @has[:_exist] = false\r\n true # rsp ... don't return XML, but let's hear from the community...\r\n end",
"title": ""
},
{
"docid": "5c00803a833d4fea65fa17f14235989f",
"score": "0.64440054",
"text": "def delete(id:)\n id_check(:id, id)\n cf_delete(path: \"/organizations/#{org_id}/invites/#{id}\")\n end",
"title": ""
},
{
"docid": "371a5d3fc0bfb26c9d719c1a6b7692fb",
"score": "0.64409554",
"text": "def destroy\n @acceso = Acceso.find(params[:id])\n @acceso.destroy\n\n respond_to do |format|\n format.html { redirect_to(accesos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bbc11d1a5f7c3bade5c1b7c2e65ab4d8",
"score": "0.6440657",
"text": "def destroy\n @archivosactualizacion = Archivosactualizacion.find(params[:id])\n @archivosactualizacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(archivosactualizaciones_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c8c50da5c1fd2421837485e7f8202a2f",
"score": "0.64347106",
"text": "def destroy\n @estado_autorizacion = EstadoAutorizacion.find(params[:id])\n @estado_autorizacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(estado_autorizacions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5d828e7d5be5d25d9d1b1f4fd8414a9b",
"score": "0.6431573",
"text": "def destroy\n @taxinvoice = Taxinvoice.find(params[:id])\n @taxinvoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(taxinvoices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5d828e7d5be5d25d9d1b1f4fd8414a9b",
"score": "0.6431573",
"text": "def destroy\n @taxinvoice = Taxinvoice.find(params[:id])\n @taxinvoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(taxinvoices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bf5837b1899d603b35d6ef8f88afe23b",
"score": "0.64296806",
"text": "def destroy\n @econtrato = Econtrato.find(params[:id])\n @econtrato.destroy\n\n respond_to do |format|\n format.html { redirect_to(econtratos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "be70fa40dc1d5952576f13e717487ab1",
"score": "0.64220476",
"text": "def destroy\n @oferta = Oferta.find(params[:id])\n @oferta.destroy\n\n respond_to do |format|\n format.html { redirect_to(ofertas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c97affe11824c34c5c4f42c8519bfa3d",
"score": "0.64214474",
"text": "def destroy\n @tipo_de_expediente = TipoDeExpediente.find(params[:id])\n @tipo_de_expediente.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipos_de_expedientes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "731c5bd004359911ffb8162d5ccc124e",
"score": "0.64211446",
"text": "def destroy\n @solicitud_documento = SolicitudDocumento.find(params[:id])\n @solicitud_documento.destroy\n\n respond_to do |format|\n format.html { redirect_to(solicitudes_documento_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9b8b8f5d0c9ecef700c027efdadc2a86",
"score": "0.6420296",
"text": "def destroy\n @soap = Soap.find(params[:id])\n @soap.destroy\n\n respond_to do |format|\n format.html { redirect_to(:controller => \"purchase\", :action => \"index\") }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f835adbfffd77d06801907605d85f6e3",
"score": "0.6418372",
"text": "def destroy\n @recurso = Recurso.find(params[:id])\n @recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(recursos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f835adbfffd77d06801907605d85f6e3",
"score": "0.6418372",
"text": "def destroy\n @recurso = Recurso.find(params[:id])\n @recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(recursos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6eb907605515b8737ccbbdeb4b93b82e",
"score": "0.6416962",
"text": "def destroy\n @fichaselemento = Fichaselemento.find(params[:id])\n @fichaselemento.destroy\n\n respond_to do |format|\n format.html { redirect_to(fichaselementos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ad37787cddbf800af969383128b2aba3",
"score": "0.64163536",
"text": "def destroy\n @administraciones = Administraciones.find(params[:id])\n @administraciones.destroy\n\n respond_to do |format|\n format.html { redirect_to(administraciones_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a429d7925c78f8d889edeb2b0e26da6a",
"score": "0.6412647",
"text": "def delete(id)\r\n request = Net::HTTP::Delete.new(\"#{@url}/#{id}.xml\")\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "f60774f4e621886b8bb91d5fe2980d02",
"score": "0.641223",
"text": "def destroy\n @actividad = Actividad.find(params[:id])\n @actividad.destroy\n\n respond_to do |format|\n format.html { redirect_to(actividads_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f60774f4e621886b8bb91d5fe2980d02",
"score": "0.641223",
"text": "def destroy\n @actividad = Actividad.find(params[:id])\n @actividad.destroy\n\n respond_to do |format|\n format.html { redirect_to(actividads_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "27602a53dfa7f31c7fcdc743b164b1ce",
"score": "0.64109427",
"text": "def destroy\n @adjunto = Adjunto.find(params[:id])\n @adjunto.destroy\n\n respond_to do |format|\n format.html { redirect_to(adjuntos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a79f3747f25cb21746b27a692c828f94",
"score": "0.6407418",
"text": "def destroy\n @indicador = Indicador.find(params[:id])\n @indicador.destroy\n\n respond_to do |format|\n format.html { redirect_to(indicadors_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "373a18eefd9cc14d76a5cc6395c90987",
"score": "0.6406796",
"text": "def destroy\n @viagem = Viagem.find(params[:id])\n @viagem.destroy\n\n respond_to do |format|\n format.html { redirect_to(viagems_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "682248282787b57ccf6df00214e9d097",
"score": "0.64057887",
"text": "def destroy\n @ausencia = Ausencia.find(params[:id])\n @ausencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(ausencias_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9afde4e5680ee0aa34772905e1bfa658",
"score": "0.6404097",
"text": "def destroy\n @misale = Misale.find(params[:id])\n @misale.destroy\n\n respond_to do |format|\n format.html { redirect_to(misales_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "cef857471089b938c912e72f49ec42fc",
"score": "0.6401029",
"text": "def destroy\n @obrasproyecto = Obrasproyecto.find(params[:id])\n @obrasproyecto.destroy\n\n respond_to do |format|\n format.html { redirect_to(obrasproyectos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "78cee7b42ac1710b5477b1bd00fb5390",
"score": "0.6399657",
"text": "def destroy\n @feriadocentecalificacion = Feriadocentecalificacion.find(params[:id])\n @feriadocentecalificacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(feriadocentecalificaciones_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "82b2ea4b0b00d94fbf03419a42271df1",
"score": "0.6399555",
"text": "def destroy\n @archivo = Archivo.find(params[:id])\n @archivo.destroy\n\n respond_to do |format|\n format.html { redirect_to(archivos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "abdec7b636978ba19965e0d7dfcc2c46",
"score": "0.6399399",
"text": "def destroy\n @estado = Estado.find(params[:id])\n @estado.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_estados_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "07885e3caf29bb95fcf2cd9a30593d66",
"score": "0.63969207",
"text": "def destroy\n @solicitud = Solicitud.find(params[:id])\n @solicitud.destroy\n\n respond_to do |format|\n format.html { redirect_to(solicitudes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "74d269deac8eaca5d522af7979470186",
"score": "0.639504",
"text": "def destroy\n @objeto = Objeto.find(params[:id])\n @objeto.destroy\n\n respond_to do |format|\n format.html { redirect_to(objetos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f0e34d43ed4094b377f6823f0d93b990",
"score": "0.63941276",
"text": "def destroy\n @autorizacion = Autorizacion.find(params[:id])\n @autorizacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(autorizacions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "78baa1057fbfbf3d5a6e76336c9b39e4",
"score": "0.6393833",
"text": "def destroy\n @informativo = Informativo.find(params[:id])\n @informativo.destroy\n\n respond_to do |format|\n format.html { redirect_to(informativos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fb504d7a2da35ffdb6215fb1a5cbdb7d",
"score": "0.6391289",
"text": "def destroy\n @indicadorescodigo = Indicadorescodigo.find(params[:id])\n @indicadorescodigo.destroy\n\n respond_to do |format|\n format.html { redirect_to(indicadorescodigos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a995e58f524ee564fd1f9cd38a008dd1",
"score": "0.63911456",
"text": "def destroy\n @actividad = Actividad.find(params[:id])\n @actividad.destroy\n\n respond_to do |format|\n format.html { redirect_to(institucion_solicitud_url(@institucion,@solicitud)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c01b1289773e49233a7bf455f0e6a81b",
"score": "0.63898623",
"text": "def destroy\n @contenido = Contenido.find(params[:id])\n @contenido.destroy\n\n respond_to do |format|\n format.html { redirect_to(contenidos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ca7ab708202f5436fabee495e00268ed",
"score": "0.6389429",
"text": "def destroy\n @tipo_consulta = TipoConsulta.find(params[:id])\n @tipo_consulta.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_consultas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d113f57dda1164d27cc0d9639245a924",
"score": "0.63871694",
"text": "def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to(clientes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d113f57dda1164d27cc0d9639245a924",
"score": "0.63871694",
"text": "def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to(clientes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
3a85073c2526ebb42f54d7c8f7b72ee5
|
Number of completed steps or nil if list is not open
|
[
{
"docid": "3d38e04d90208e7e341081032b1df6dc",
"score": "0.7156773",
"text": "def completed\n completed_steps && completed_steps.length\n end",
"title": ""
}
] |
[
{
"docid": "c4f3e3e78a9907f284d581dad16ba632",
"score": "0.6818392",
"text": "def completed_quest_number; completed_quests.size; end",
"title": ""
},
{
"docid": "43dbe87e9a5d3d0af9f09f68b1a0e92e",
"score": "0.6786424",
"text": "def nofDoneInCycle()\n return @doneInCycleList.size ;\n end",
"title": ""
},
{
"docid": "56edfab29158fd0ccac53771fcacddb0",
"score": "0.6750197",
"text": "def no_of_tasks( w )\n @wf_transitions[ w ].size\n end",
"title": ""
},
{
"docid": "628b3923d529ea2c30ae70130cb6a0b1",
"score": "0.673472",
"text": "def complete_count\n items.select(&:complete?).size\n end",
"title": ""
},
{
"docid": "9850a130dfa7826749c1080b373cf458",
"score": "0.6698148",
"text": "def completed_task_count; end",
"title": ""
},
{
"docid": "9850a130dfa7826749c1080b373cf458",
"score": "0.6698148",
"text": "def completed_task_count; end",
"title": ""
},
{
"docid": "eb1cfd7bf2f59e6b2a44ee7afbab47aa",
"score": "0.66562146",
"text": "def complete_count\n items.select{ |i| i.complete? }.size\n end",
"title": ""
},
{
"docid": "1d4dc45ba48a068f4a6cd89e947204e8",
"score": "0.66016215",
"text": "def task_count\n @task_list.length\n puts \"You currently have #{@task_list.length} task(s).\"\n end",
"title": ""
},
{
"docid": "ef3e01d9cc1866311bca1517b39665f7",
"score": "0.6561882",
"text": "def number_fully_completed\n rest_completed_events.count\n end",
"title": ""
},
{
"docid": "bb6c4637ff9997e8e4c7a2590215916c",
"score": "0.65302086",
"text": "def no_of_workflows\n @wf_transitions.size\n end",
"title": ""
},
{
"docid": "9f0704a5eb67acd209c4121a615cdefd",
"score": "0.65061384",
"text": "def number_of_projects_completed\n complete_projects.size\n end",
"title": ""
},
{
"docid": "6bbb0ff2dfe182eb8989bac1d19b8d27",
"score": "0.64894307",
"text": "def incomplete_count\n items.select{ |i| !i.complete? }.size\n end",
"title": ""
},
{
"docid": "90be7b2d490dc2a405f586d31860252b",
"score": "0.6483518",
"text": "def count_unfinnished_tasks(list)\n list[:todos].count { |hash| hash[:completed] }\n end",
"title": ""
},
{
"docid": "9c7b2153497fd60b1626a753a6782a91",
"score": "0.64488214",
"text": "def todos_remaining_count(list)\n list[:todos].count { |todo| todo[:completed] == false }\n end",
"title": ""
},
{
"docid": "63983d863d2e8ef8231493646fd92647",
"score": "0.6440969",
"text": "def length\n steps.length\n end",
"title": ""
},
{
"docid": "f9fc2be64e7ff566b790d8cf38793924",
"score": "0.6425187",
"text": "def number_completed\n completed_events.count\n end",
"title": ""
},
{
"docid": "fe1ff523ba6d6debf8e0e84485ea2e3f",
"score": "0.6420455",
"text": "def incomplete_count\n items.reject(&:complete?).size\n end",
"title": ""
},
{
"docid": "68154b98da93df51760c5e0bbd7af2a1",
"score": "0.63734025",
"text": "def getOpenTaskCount\r\n\t\t\t\t\treturn @openTaskCount\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "3f1f344eadcd16709533ca07044e8129",
"score": "0.63496804",
"text": "def task_count\n puts \"You currently have #{@task_list.length} task(s).\"\n end",
"title": ""
},
{
"docid": "165c2b1f420f241cd2769cdec3cc06b4",
"score": "0.63474303",
"text": "def num_waiting\n @waiting.size\n end",
"title": ""
},
{
"docid": "165c2b1f420f241cd2769cdec3cc06b4",
"score": "0.63474303",
"text": "def num_waiting\n @waiting.size\n end",
"title": ""
},
{
"docid": "6d03c9db83cfd6cd380d95d66810353e",
"score": "0.63446814",
"text": "def num_waiting()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "6d03c9db83cfd6cd380d95d66810353e",
"score": "0.63446814",
"text": "def num_waiting()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "1ace8ce7d4bc2ee030ba73bf2dd7be33",
"score": "0.6323731",
"text": "def list_remaining(list)\n list[:todos].select { |item| !item[:completed] }.size\n end",
"title": ""
},
{
"docid": "c4fef6f32ec520d04668f316b53616e1",
"score": "0.6316623",
"text": "def num_tasks\n tasks.size\n end",
"title": ""
},
{
"docid": "1977723c5f923f9f24002b6e2bcd27e2",
"score": "0.6311199",
"text": "def problem_count\n completed_problems.count\n end",
"title": ""
},
{
"docid": "75394063d425d695c04af9a15e5e0e96",
"score": "0.6248908",
"text": "def task_list\n if @task_list.empty?\n task_count\n else\n puts 'You have the following tasks:'\n puts @task_list\n end\n end",
"title": ""
},
{
"docid": "d67678c3a85246cd54f7499c8a0428c9",
"score": "0.62277925",
"text": "def length\n @wizard_steps.length\n end",
"title": ""
},
{
"docid": "96effa61481ef0f020968e1030542e6d",
"score": "0.6221525",
"text": "def workitem_count\n\n h.workitems ? h.workitems.size : (h.workitem_count || 0)\n end",
"title": ""
},
{
"docid": "3a265dc9cda015232c0bc8d95655ff3f",
"score": "0.62106186",
"text": "def nofDone()\n return @doneParamSetList.size ;\n end",
"title": ""
},
{
"docid": "506556fe8acaf43077298524abe14f47",
"score": "0.6205485",
"text": "def num_waiting\n @waiting.length\n end",
"title": ""
},
{
"docid": "6092ecabf29f7f1dd1a674c215f20c67",
"score": "0.6194091",
"text": "def todos_remaining_count(list)\n list[:todos].count { |todo| !todo[:completed] }\nend",
"title": ""
},
{
"docid": "c7578f18785c70ad3668237f19c4c0bd",
"score": "0.61868286",
"text": "def tasks_count\n tasks.count\n end",
"title": ""
},
{
"docid": "428fe41fc54d9f40f591d76780504cb4",
"score": "0.6183984",
"text": "def no_of_lists\n get_list_names.size\n end",
"title": ""
},
{
"docid": "0881bdd186127337b5cf15d9e93daf13",
"score": "0.61800194",
"text": "def number_of_completed_responses\n if statistics && !statistics.empty? && (completed_data = statistics.find { |a| a[0] == 'Complete' })\n completed_data[1]\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "8ee3abe9cabf7a9ea82e88436fff4eb8",
"score": "0.6158214",
"text": "def checklist_item_count\n return @checklist_item_count\n end",
"title": ""
},
{
"docid": "5bcee31c6ade67e55bec206507973a95",
"score": "0.6141313",
"text": "def completed_workouts\n @completed = 0\n workouts.each { |w|\n w.workout_sessions.each { |ws|\n @completed += 1 if ws.complete\n }\n }\n @completed\n end",
"title": ""
},
{
"docid": "fdade136f607ed69531d0620f66a2987",
"score": "0.6138965",
"text": "def tasks_finished_count\n inject(0) do |sum, node|\n sum + node.graph.tasks_finished_count\n end\n end",
"title": ""
},
{
"docid": "011832ffc40ee32c93a1856795109ac2",
"score": "0.6135874",
"text": "def quest_number; quests.size; end",
"title": ""
},
{
"docid": "61b806aa56ab726bb24dd7a6bb2ded1d",
"score": "0.61335933",
"text": "def checkin_ready_goals\n count = 0\n goals.each do |x|\n count += 1 if x.is_it_checkin_time?\n end\n count\n end",
"title": ""
},
{
"docid": "44f565b2856192e346cac5b9a3be5d00",
"score": "0.6122285",
"text": "def remaining\n remaining_steps && remaining_steps.length\n end",
"title": ""
},
{
"docid": "a79353dba9fc729d25afaf56ba313943",
"score": "0.6114513",
"text": "def get_number_of_tasks\n clear_filter.click\n sleep 3\n task_found_array = task_header.text.split\n task_found = task_found_array[0].to_i\n task_found\n end",
"title": ""
},
{
"docid": "0e5d8956750a5fad40ec09a4108759f6",
"score": "0.6096364",
"text": "def count\n list.count\n end",
"title": ""
},
{
"docid": "b68b68d1aa21f85cc5a206cb88657526",
"score": "0.6091319",
"text": "def completed_assignment_count\n total = 0\n self.oi_instructions.each { |inst| total += inst.completed_assignment_count }\n total\n end",
"title": ""
},
{
"docid": "cda4c4d8cb551c6aed0602946a768f7d",
"score": "0.60884535",
"text": "def length\n\t\tDisbatch.db[:tasks].find({:queue => @id, :status=> -2}).count\n\tend",
"title": ""
},
{
"docid": "1934408b428140c04ea0526fc466b91f",
"score": "0.6083538",
"text": "def finished_todos(list_index)\n @list = session[:lists][list_index]\n @total = 0\n \n @list[:todos].each do |todo|\n return false if @list[:todos].empty?\n if todo[:completed] == true\n @total += 1\n end\n end\n @total\n end",
"title": ""
},
{
"docid": "8e2e6ef560aba6240b2ca444ec1ddecd",
"score": "0.6078044",
"text": "def incomplete_job_count\n return @incomplete_job_count\n end",
"title": ""
},
{
"docid": "4f25d5d9885891c79697b8ca6e84b4f7",
"score": "0.60713196",
"text": "def remaining_size\n incomplete_tasks.sum(&:size)\n end",
"title": ""
},
{
"docid": "9b0dbd887d08589a242c89bceac9cb79",
"score": "0.60468286",
"text": "def pending_manual_steps_device_count\n return @pending_manual_steps_device_count\n end",
"title": ""
},
{
"docid": "22d4a05c509801928494aef6c73f3f1b",
"score": "0.6042843",
"text": "def steps; @steps = 0 if @steps.nil?; @steps; end",
"title": ""
},
{
"docid": "91d5f1c3c082078d225384c415be31c3",
"score": "0.6029972",
"text": "def todos_remaining(list)\n list[:todos].count { |todo| !todo[:complete] }\n end",
"title": ""
},
{
"docid": "aec2dddb91be20217b8130595b29d36f",
"score": "0.6029719",
"text": "def task_status\n return nil unless description\n\n num_tasks = 0\n num_done = 0\n\n description.scan(TASK_PATTERN_MD) do\n num_tasks += 1\n num_done += 1 unless $LAST_MATCH_INFO[:checked] == ' '\n end\n\n \"#{num_tasks} tasks (#{num_done} done, #{num_tasks - num_done} unfinished)\"\n end",
"title": ""
},
{
"docid": "04238e18aec655704da43c96aa0ed14f",
"score": "0.60256153",
"text": "def size; @known_tasks.size end",
"title": ""
},
{
"docid": "422588caa72d96fd5362ca17d35ecca0",
"score": "0.6024835",
"text": "def count_non_nil\n completed_result_marks.size\n end",
"title": ""
},
{
"docid": "925c4033223ff2761f027ab89253f34e",
"score": "0.6000389",
"text": "def getModulesCompletedWithPunchlist ayBoxes\n intCount = 0\n ayBoxes.each do |box|\n if !(box.plant_discharge.nil?) and box.end_actual.nil?\n intCount = intCount + 1\n end\n end\n return intCount\n end",
"title": ""
},
{
"docid": "e7669940c3c446eaeb208555f1474418",
"score": "0.59757006",
"text": "def completed_job_count\n return @completed_job_count\n end",
"title": ""
},
{
"docid": "dcea8ab27f0e7c770504bc04be09beb2",
"score": "0.59736377",
"text": "def completed_assignment_count\n total = 0\n #self.oi_assignments.each { |assignment| total += 1 if assignment.complete? }\n self.oi_assignments.each { |assignment| \n total += 1 if assignment.complete ==OiAssignment.status_id(\"Completed\") \n }\n total\n end",
"title": ""
},
{
"docid": "d52dd9b2d3e0d75362129a09bf49b07d",
"score": "0.5968848",
"text": "def quest_count\r\n each.to_a.size\r\n end",
"title": ""
},
{
"docid": "9f77ee179a52e5ce08eef937d3632f96",
"score": "0.59629583",
"text": "def open_issues_count\n load_issue_counts\n @open_issues_count\n end",
"title": ""
},
{
"docid": "9f77ee179a52e5ce08eef937d3632f96",
"score": "0.59629583",
"text": "def open_issues_count\n load_issue_counts\n @open_issues_count\n end",
"title": ""
},
{
"docid": "d6ef3be3cec1b3a7d078b8d50bb49d9c",
"score": "0.5958102",
"text": "def total\n return status_hash.total if status_hash and status_hash.total\n return evaluation.tasks.count if evaluation\n return 1\n end",
"title": ""
},
{
"docid": "99000855555955d0cc502ed6f42e28e6",
"score": "0.59333414",
"text": "def slots_used\n @jobs_run.list.size - 1 \n end",
"title": ""
},
{
"docid": "cbe26400d44fb572029460331a914ec2",
"score": "0.59254956",
"text": "def nitems\n count = 0\n self.each do |item|\n count += 1 unless item.nil?\n end\n\n return count\n end",
"title": ""
},
{
"docid": "368eb25de51881cd52809d09d3ad2339",
"score": "0.592298",
"text": "def num_waiting; end",
"title": ""
},
{
"docid": "368eb25de51881cd52809d09d3ad2339",
"score": "0.592298",
"text": "def num_waiting; end",
"title": ""
},
{
"docid": "7bc505dbbd6feed3c670467fd592c97e",
"score": "0.5919415",
"text": "def completed_trainings_count\n return @completed_trainings_count\n end",
"title": ""
},
{
"docid": "ff232a3af2714be5530ed3abf3c02cda",
"score": "0.5916358",
"text": "def getCheckCount\n # return nil if not checked\n @checkCount\n end",
"title": ""
},
{
"docid": "5a035477ea1ef9b4d3a57a2c5f2f9281",
"score": "0.5903214",
"text": "def finished_steps\n steps - unfinished_steps\n end",
"title": ""
},
{
"docid": "e69250f9c2fd906652a8ba4b39a50f2e",
"score": "0.58908486",
"text": "def in_progress_count\n get_request(\"/system/in-progress\")[\"values\"].count\n end",
"title": ""
},
{
"docid": "7e12ba292254d7ef3d636b3a822d9943",
"score": "0.58864564",
"text": "def build_steps_remaining\n self.reduce(0) do |result, (target, builders)|\n result + builders.size\n end\n end",
"title": ""
},
{
"docid": "c837358ebd465ca04225a5e8a5713dcf",
"score": "0.58845675",
"text": "def amount_done\n # TODO Do in SQL\n return 1 if jobs.empty?\n num_completed = jobs.find_all { |job| job.completed? }.count\n puts num_completed\n puts jobs.count\n num_completed.to_f / jobs.count\n end",
"title": ""
},
{
"docid": "85944a8f8e726bdd272559ac381dc25b",
"score": "0.5871611",
"text": "def count\n nil\n end",
"title": ""
},
{
"docid": "357c4cad060e8c32bb5a632aa444c9a7",
"score": "0.5871091",
"text": "def new_task_number\n tasks.size + 1\n end",
"title": ""
},
{
"docid": "31491d1cbee648c1b9ce7b45c40cf3a8",
"score": "0.585906",
"text": "def num_of_files_to_schedule\n @num_of_files_to_schedule || 1\n end",
"title": ""
},
{
"docid": "4d70b9efb936a529042a13c40750ad80",
"score": "0.58568025",
"text": "def getOpenMilestoneCount\r\n\t\t\t\t\treturn @openMilestoneCount\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "1f6c78592d1c0c35975137f95b6ed6f4",
"score": "0.5852037",
"text": "def num_waiting()\n @waiters.size\n end",
"title": ""
},
{
"docid": "4115abdb50651e08882411e087c619e7",
"score": "0.5843128",
"text": "def todos_count(list)\n list[:todos].size\n end",
"title": ""
},
{
"docid": "4115abdb50651e08882411e087c619e7",
"score": "0.5843128",
"text": "def todos_count(list)\n list[:todos].size\n end",
"title": ""
},
{
"docid": "21112e704e917a60b88dc875eef9d05d",
"score": "0.5840433",
"text": "def num_of_tickets\n tickets = self.films\n return tickets.size\n end",
"title": ""
},
{
"docid": "722b006843e8abf36821c09556a6d29b",
"score": "0.5825009",
"text": "def next_step_number\n return nil if quest.steps.blank?\n return quest.steps.first.step_number if last_step_completed.blank?\n\n quest.steps.each do |step|\n return step.step_number if step.step_number > last_step_completed\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "a64c1a75115262a62b0e9149b65cb7fc",
"score": "0.5817925",
"text": "def completed\n return total if status_name == :done\n return 0 if status_name == :new\n return status_hash.num || 0\n end",
"title": ""
},
{
"docid": "2e3db83ef46c5a9cfd801f76fa18eb7f",
"score": "0.5812833",
"text": "def count_list_size\n\n h.list_size\n end",
"title": ""
},
{
"docid": "f37c6bf68e52fdfd33ceaf4dcac8bd56",
"score": "0.5806597",
"text": "def count\n @list.length\nend",
"title": ""
},
{
"docid": "14f23dfe77b433d7e80d341b2da6f281",
"score": "0.5805236",
"text": "def step\n number = ReferrerTracker::Utils.conf[current_track][\"actions\"].split.find_index(current_c_a_pair)\n number.nil? ? 0 : number+1\n end",
"title": ""
},
{
"docid": "fe616fad80e3bf61879e91d9d6bd35fd",
"score": "0.5802732",
"text": "def started_workouts\n @started = 0\n workouts.each { |w|\n @started += w.workout_sessions.size\n }\n @started\n end",
"title": ""
},
{
"docid": "d3ad8eddd4303ff326faa1bb0974c36b",
"score": "0.5798435",
"text": "def nofRunning()\n return @runningParamSetList.size ;\n end",
"title": ""
},
{
"docid": "8b029d23aebe5b0845d8c969b4f3bda2",
"score": "0.5793945",
"text": "def number_of_pending_instances(list = list_of_pending_instances)\n list.size\n end",
"title": ""
},
{
"docid": "551ef0327772a9c3ba163a196e9cfd10",
"score": "0.5792917",
"text": "def item_count\n self.line_items.any? ? self.line_items.count : 0\n end",
"title": ""
},
{
"docid": "cb0899fead25f74ad9ac0ae9c43edff3",
"score": "0.5788473",
"text": "def count\n @jobs.size\n end",
"title": ""
},
{
"docid": "cb0899fead25f74ad9ac0ae9c43edff3",
"score": "0.5788473",
"text": "def count\n @jobs.size\n end",
"title": ""
},
{
"docid": "32c7effeeb82d3d0975fa302b62ac0ce",
"score": "0.57868063",
"text": "def tickets_num\n return self.films.count\n end",
"title": ""
},
{
"docid": "640aae48857fb95226df3e0c4a40eebb",
"score": "0.5783431",
"text": "def number_of_actions\n @actions.size\n end",
"title": ""
},
{
"docid": "bb64850968c5ecaf45a40dca9807ebb1",
"score": "0.5779587",
"text": "def count()\n @list_of_positions.length\n end",
"title": ""
},
{
"docid": "71554fa6fcaa354b0bebe66da1a55a18",
"score": "0.57723594",
"text": "def completed_jobs\r\n count = 0\r\n time_minus_12_hrs = Time.now - 12.hours\r\n self.processor_jobs.find(:all, :conditions => [\"processor_flag_time >= ? and job_status = ?\", time_minus_12_hrs, \"Complete\"]).each do |job|\r\n if !job.count.blank? and job.processor_flag_time >= time_minus_12_hrs\r\n count = count + job.count\r\n end\r\n end\r\n return count\r\n end",
"title": ""
},
{
"docid": "35156a6615f4ea8162dbc21baba1797a",
"score": "0.57721317",
"text": "def task_count\n Task.all(self).size\n end",
"title": ""
},
{
"docid": "95cded0418c993eee9380ff49f842d0a",
"score": "0.5771959",
"text": "def completion_count\n count = 0\n\n students.each do |student|\n if student.complete?(self)\n count += 1\n end\n end\n\n return count\n end",
"title": ""
},
{
"docid": "16c41eea80ca1e4ded5e9615fbea39b1",
"score": "0.5770722",
"text": "def active_checklist_item_count\n return @active_checklist_item_count\n end",
"title": ""
},
{
"docid": "a9e6dc012bddc2b181833953d97f4037",
"score": "0.5764969",
"text": "def count\n\n @list.count\n\n end",
"title": ""
},
{
"docid": "b0bdd41a77c9e826919260dade48d727",
"score": "0.57648253",
"text": "def get_opened_pages_quantity\n return @browser.elements(css: /data-test=\"page-name/).length\n end",
"title": ""
},
{
"docid": "f08d1f375c8c1af44dcdcf23ceb3c5ed",
"score": "0.57533664",
"text": "def count\n @file_list.count\n end",
"title": ""
}
] |
e8663c365859fa8f5e63e38059a2c806
|
Check if outputing to shell
|
[
{
"docid": "7b11d2609bde79517726d5474d707044",
"score": "0.6815939",
"text": "def tty?\n stdout.tty?\n end",
"title": ""
}
] |
[
{
"docid": "205452c33874e39873f8819ea080bcc4",
"score": "0.77594894",
"text": "def shell_ok?(command)\n # Using Open3 instead of `` or system(\"cmd\") in order to hide stderr output\n sout, status = Open3.capture2e command\n return status.to_i == 0\n rescue\n return false\n end",
"title": ""
},
{
"docid": "7c134165bfc5eb53d79c180e8fbeac53",
"score": "0.75107753",
"text": "def in_shell?\n !!@in_shell\n end",
"title": ""
},
{
"docid": "c5501a8a309eecc1e3b580d83e238927",
"score": "0.73865205",
"text": "def execute_true?(output)\n _, err, = Open3.capture3 output << ' 2>/dev/null'\n (err == '')\n end",
"title": ""
},
{
"docid": "a0564c606bc55ac90b476e3d5e46e733",
"score": "0.73377955",
"text": "def stdout?\n @mode == :stdout\n end",
"title": ""
},
{
"docid": "8914caa65136003b1d8c4fa2dfafc477",
"score": "0.732081",
"text": "def tty_output?\n $stdout.tty?\n end",
"title": ""
},
{
"docid": "37047f04f9970424982d7ad52643d410",
"score": "0.7157073",
"text": "def redirect_stdout?\n !!@rescue_stdout\n end",
"title": ""
},
{
"docid": "064ce0f2ef3f8c011a7bb29a957bd24b",
"score": "0.712543",
"text": "def stdout?\n @stdout ||= false\n end",
"title": ""
},
{
"docid": "22da4549c1044e671e21a65e2eb8ff56",
"score": "0.71083623",
"text": "def piping?\n return false unless $stdout.respond_to?(:tty?)\n\n !$stdout.tty? && $stdin.tty? && !Helpers::Platform.windows?\n end",
"title": ""
},
{
"docid": "22da4549c1044e671e21a65e2eb8ff56",
"score": "0.71083623",
"text": "def piping?\n return false unless $stdout.respond_to?(:tty?)\n\n !$stdout.tty? && $stdin.tty? && !Helpers::Platform.windows?\n end",
"title": ""
},
{
"docid": "f3dda801e5accb93a13ec499f38eb871",
"score": "0.6985662",
"text": "def interactive_out?\n $stdout.tty?\n end",
"title": ""
},
{
"docid": "74552b93b1d65ccb775ab4b8d099d74e",
"score": "0.6956438",
"text": "def test_command cmd\n\n cmd << \" > /dev/null 2>&1 ; echo $?\"\n return(capture(cmd, shell: :bash, pty: true).strip.to_i == 0)\nend",
"title": ""
},
{
"docid": "44795ed2b27439b4899674473c003c5d",
"score": "0.6897291",
"text": "def remote_command_has_output?(command)\n if @@remote_command_has_output[command].nil?\n output = capture(command).strip\n @@remote_command_has_output[command] = !output.empty?\n end\n\n @@remote_command_has_output[command]\n end",
"title": ""
},
{
"docid": "7dbe3cece7fa168564cea6c5cefb1b22",
"score": "0.6828682",
"text": "def tty_output? # :nodoc:\n @tty_output\n end",
"title": ""
},
{
"docid": "304054c8d4f6445b5a5519bd0c6f1b6f",
"score": "0.6817673",
"text": "def checkOutput(cmd, debug=true)\n puts \"$ '#{strCmd(cmd)}'\" if debug\n stdout, stderr, status = Open3.capture3(*cmd)\n print stderr\n if not status.success?\n print stdout\n raise(\"Command '#{strCmd(cmd)}' failed with code #{status.exitstatus}\")\n end\n return stdout\nend",
"title": ""
},
{
"docid": "475bf978ac72fdca59105d86c47fc80f",
"score": "0.68104947",
"text": "def console_captured?\n $stdout.is_a?(StringIO)\n end",
"title": ""
},
{
"docid": "cb39810c1a34766075ba5736289f165c",
"score": "0.6797158",
"text": "def has_output?\n return @flags[:output]\n end",
"title": ""
},
{
"docid": "6adea662c37fed88532bd1a41595d960",
"score": "0.6746339",
"text": "def log_to_stdout?\n true\n end",
"title": ""
},
{
"docid": "a9a2fcfc7a3e2f83bab89554a1deb57d",
"score": "0.6729321",
"text": "def is_shellcode?(log)\n return log.match(/\\\\x/) != nil\nend",
"title": ""
},
{
"docid": "1f0a0a41a894d36ea9c777d5974e6c87",
"score": "0.6728167",
"text": "def tty?\n @output.respond_to?(:tty?) && @output.tty?\n end",
"title": ""
},
{
"docid": "a71b48e5485e5769d24d34151820ea16",
"score": "0.6719278",
"text": "def console_output?\n any? { |appender| appender.respond_to?(:console_output?) && appender.console_output? }\n end",
"title": ""
},
{
"docid": "2920795e726bca7b493c786e57ee1e7a",
"score": "0.67051595",
"text": "def tty?\n $stdout.tty?\n end",
"title": ""
},
{
"docid": "2920795e726bca7b493c786e57ee1e7a",
"score": "0.67051595",
"text": "def tty?\n $stdout.tty?\n end",
"title": ""
},
{
"docid": "2920795e726bca7b493c786e57ee1e7a",
"score": "0.67051595",
"text": "def tty?\n $stdout.tty?\n end",
"title": ""
},
{
"docid": "2920795e726bca7b493c786e57ee1e7a",
"score": "0.67051595",
"text": "def tty?\n $stdout.tty?\n end",
"title": ""
},
{
"docid": "2920795e726bca7b493c786e57ee1e7a",
"score": "0.67051595",
"text": "def tty?\n $stdout.tty?\n end",
"title": ""
},
{
"docid": "e44fadb5ca35ec156ecdb310f43bdb7c",
"score": "0.6695474",
"text": "def tty?\n @output_stream.tty?\n end",
"title": ""
},
{
"docid": "96238ab337d10f1a568c413537d08b20",
"score": "0.66709614",
"text": "def tty?\n output.tty?\n end",
"title": ""
},
{
"docid": "ea57777fe3414987a35197037ae5ae70",
"score": "0.6664544",
"text": "def tty_output?; end",
"title": ""
},
{
"docid": "5991fa03fe6003b3b56aaf776b714880",
"score": "0.6633321",
"text": "def test?(command)\n exec!(command) do |ch, type, data|\n return true if type == :exit_status && data == 0\n end\n\n false\n end",
"title": ""
},
{
"docid": "5291dbcf70bc9f0ef828ff24667d4a6f",
"score": "0.6631586",
"text": "def color_output?\n $stdout.tty? && !(sshkit_after?(\"1.7.1\") || sshkit_master?)\n end",
"title": ""
},
{
"docid": "9b65d286a10ae1033490c6136a6292b9",
"score": "0.6623531",
"text": "def tty?\n output.respond_to?(:tty?) && output.tty?\n end",
"title": ""
},
{
"docid": "a6f9542e22290b0ec2dab8c7bfca921b",
"score": "0.6616798",
"text": "def correct_output?\n false\n end",
"title": ""
},
{
"docid": "dc3cdfd472bc5e4e54f0c37496321bc1",
"score": "0.66143703",
"text": "def prompt_ready?(stdout)\n breakpoint_hit?(stdout) || (stdout =~ /> $/)\n end",
"title": ""
},
{
"docid": "d6de90170ed952eedbda7f90ec84d725",
"score": "0.6611973",
"text": "def _check_shell(sock)\n\t\tebuf = Rex::Text.rand_text_alphanumeric(16)\n\n\t\t# Send any identifying information that the find sock may need on\n\t\t# the other side, such as a tag. If we do actually send something, \n\t\t# wait a bit longer to let the remote side find us.\n\t\tif (_send_id(sock))\n\t\t\tRex::ThreadSafe.sleep(1.5)\n\t\tend\n\n\t\t# Make sure the read buffer is empty before we test for a shell\n\t\tsock.get_once(-1,1)\n\t\t# Check to see if the shell exists\n\t\tsock.put(\"\\necho #{ebuf}\\n\")\n\n\t\t# Try to read a response\n\t\trbuf = sock.get_once\n\n\t\t# If it contains our string, then we rock\n\t\tif (rbuf =~ /#{ebuf}/)\n\t\t\tprint_status(\"Found shell.\")\n\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "61ed71290e30761192360754dae7b862",
"score": "0.66004455",
"text": "def shell?\n @shell.enabled?\n end",
"title": ""
},
{
"docid": "647fa6d55a43f328e0654339088c9d59",
"score": "0.65883154",
"text": "def tcsh_shell?\n # once run a single time, return state determined at that execution\n return @tcsh_shell if not @tcsh_shell.nil?\n\n result = @system_wrapper.shell_backticks('echo $version')\n\n if ((result[:exit_code] == 0) and (result[:output].strip =~ /^tcsh/))\n @tcsh_shell = true\n else\n @tcsh_shell = false\n end\n\n return @tcsh_shell\n end",
"title": ""
},
{
"docid": "db6c54db9c702cde7053f7fabf7f1ef1",
"score": "0.65858895",
"text": "def tty?\n output.respond_to?(:tty?) && output.tty?\n end",
"title": ""
},
{
"docid": "db6c54db9c702cde7053f7fabf7f1ef1",
"score": "0.65858895",
"text": "def tty?\n output.respond_to?(:tty?) && output.tty?\n end",
"title": ""
},
{
"docid": "868494bb1b9b09e1ad31e68c22a60467",
"score": "0.65696347",
"text": "def terminal?(stream = $stdout)\n case ENV['TTY']\n when 'on' then true\n when 'off' then false\n else\n stream.tty?\n end\n end",
"title": ""
},
{
"docid": "fd362df62567f19d31fe6d5ce3868e84",
"score": "0.6558597",
"text": "def truncate_output? # :nodoc:\n tty_output? || @terminal_columns.nonzero?\n end",
"title": ""
},
{
"docid": "78911370da6b6c70d0e22f84fbebbba9",
"score": "0.6546682",
"text": "def isShellcode(log)\n\treturn (log.match(/\\\\x/) != nil)\nend",
"title": ""
},
{
"docid": "57d82564a5d8350a29e2e169121645d3",
"score": "0.65285176",
"text": "def required?(options)\n options.stdout || (! $stdout.tty?)\n end",
"title": ""
},
{
"docid": "71fd529b6d8311ac3eb02cefe901c0e6",
"score": "0.6513387",
"text": "def captured_console_empty?\n console_captured? and $stdout.string.empty?\n end",
"title": ""
},
{
"docid": "a2b83e23b3aa930d1e4aa8c25282af8c",
"score": "0.6490295",
"text": "def pipe?\n true\n end",
"title": ""
},
{
"docid": "3663382406b66bb8d134cd75874e9dfb",
"score": "0.6479312",
"text": "def system_silent(cmd)\n Popen.popen(cmd).last.zero?\n end",
"title": ""
},
{
"docid": "3663382406b66bb8d134cd75874e9dfb",
"score": "0.6479312",
"text": "def system_silent(cmd)\n Popen.popen(cmd).last.zero?\n end",
"title": ""
},
{
"docid": "39774b4557e4172aefa030b9126c2c71",
"score": "0.6478208",
"text": "def system_silent(cmd)\n Popen::popen(cmd).last.zero?\n end",
"title": ""
},
{
"docid": "532709a27716935eb1f08b7aac1bef1b",
"score": "0.64728874",
"text": "def output?\n @provides_output\n end",
"title": ""
},
{
"docid": "0faa67ff109015b6b6588bdee6900e02",
"score": "0.6464879",
"text": "def command_available?(cmd)\n %x!bash -c \"type #{cmd}\" 2>/dev/null!.chomp.length > 0 rescue false\n end",
"title": ""
},
{
"docid": "01558709855b2dcba77599b8414b6df6",
"score": "0.64609003",
"text": "def shell_pingable? (target)\t\t\n\t\tputs \"Perform ping test from the shell on: #{target}\" if @verbose\n\t\tbegin\n sum=0\n\t\t\ttest_ping= `#{@which_ping} -c 3 #{target}`\n\t\t\ttest_ping.scan(/^(.+?)\\stime=(.+)\\s(.+?)\\n/).map do |entry|\n\t\t\t\tputs \"entry: #{entry}\" if @verbose\n\t\t\t\tsum=sum+entry[1].to_f\n\t\t\tend\n\t\t\tif sum > 0\n\t\t\t\t@latency = sum / 3\n\t\t\t\tputs \"Ping test from the shell environment successful on #{target}.\" if @verbose\n\t\t\t\treturn true\n\t\t\telse\n\t\t\t\tputs \"Ping test from the shell environment fail on #{target}.\" if @verbose\n\t\t\t\treturn false\n\t\t\tend\n\t\trescue Exception => ee\n\t\t\tputs \"Exception on method #{__method__} for #{host}: #{ee}\" if @verbose\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "790c255b952162a16f0e476d2243515c",
"score": "0.6434293",
"text": "def valid?\n @output.exitstatus.zero?\n end",
"title": ""
},
{
"docid": "317f41154ac47acaacf6e6e7716eb984",
"score": "0.639787",
"text": "def tty?\n true\n end",
"title": ""
},
{
"docid": "bf415209cc329b64e050c19624f0eafc",
"score": "0.63632053",
"text": "def exec_available(cli)\n return false unless cli.good?\n\n !TTY::Which.which(cli).nil?\n end",
"title": ""
},
{
"docid": "ff7648be6e2c5f3b9cdbf736d592445b",
"score": "0.6342863",
"text": "def pipe?\n false\n end",
"title": ""
},
{
"docid": "ec521b7c0736652b2d7d0f15becbf31c",
"score": "0.6342307",
"text": "def collect_output?\n collect_output == true\n end",
"title": ""
},
{
"docid": "90ed893de920c088c62773a3f42c920f",
"score": "0.63302654",
"text": "def intrinsic_shell?\n true\n end",
"title": ""
},
{
"docid": "f76490ea957c6f6266a48461a9f756f9",
"score": "0.63260746",
"text": "def tty?\n out = shell_command_token(\"tty;/bin/tty;/usr/bin/tty\")\n return true if out.match \"/dev/\"\n return false if out.match \"not a tty\"\n false\n end",
"title": ""
},
{
"docid": "6f2156b8af22ec9a4805ad2893cd3d07",
"score": "0.631883",
"text": "def command?(command)\n system(\"which #{command} > /dev/null 2>&1\")\nend",
"title": ""
},
{
"docid": "1a7e1a50ad10ca7758b8b9789a387f3b",
"score": "0.6306545",
"text": "def correct_runas_user?\n splunk = Mixlib::ShellOut.new(\"ps -ef|grep splunk|grep -v grep|awk '{print$1}'|uniq\")\n splunk.run_command\n splunk_runas_user == splunk.stdout\nend",
"title": ""
},
{
"docid": "4dc3cf27ac9c9ef71e339397f2e170bb",
"score": "0.6299804",
"text": "def command?( cmd )\n system(\"which #{cmd} > /dev/null 2>&1\")\n end",
"title": ""
},
{
"docid": "e1cb65ad12160629cb3fdca35b8b22ad",
"score": "0.6294726",
"text": "def intrinsic_shell?\n false\n end",
"title": ""
},
{
"docid": "54a72e5ae44783bd7112d3167f545c07",
"score": "0.6294255",
"text": "def ran?\n !output.nil?\n end",
"title": ""
},
{
"docid": "f906ccdfc5ba327a8fb49dd0839d5b30",
"score": "0.6294068",
"text": "def color?\n stdout.tty?\n end",
"title": ""
},
{
"docid": "5e85fc17768ea87174d3fd6d82a3c889",
"score": "0.62792903",
"text": "def command?(command)\n system(\"which #{ command} > /dev/null 2>&1\")\nend",
"title": ""
},
{
"docid": "19d7fbea65da2236157b31428b49f9f0",
"score": "0.62790954",
"text": "def tty?\n false\n end",
"title": ""
},
{
"docid": "09830f0da57d08bbb644966d07d2a283",
"score": "0.6264672",
"text": "def command?(command)\n system(\"which #{ command} > /dev/null 2>&1\")\nend",
"title": ""
},
{
"docid": "09830f0da57d08bbb644966d07d2a283",
"score": "0.6264672",
"text": "def command?(command)\n system(\"which #{ command} > /dev/null 2>&1\")\nend",
"title": ""
},
{
"docid": "e4b3db1ad361f88a9381a22eadb8144b",
"score": "0.6245327",
"text": "def console?\n pathname.nil?\n end",
"title": ""
},
{
"docid": "ad87790aa33320ae9181586def630e64",
"score": "0.6243291",
"text": "def print_shell_result(shell_result)\n puts \"Done in %.3f seconds.\" % shell_result[:time]\n\n if !(shell_result.nil?) && !(shell_result[:output].nil?) && (shell_result[:output].length > 0)\n puts shell_result[:output]\n end\n end",
"title": ""
},
{
"docid": "d7fdba65dd45d74f3923c5a35396f796",
"score": "0.6240198",
"text": "def headless_ok? io\n File === io || String === io || StringIO === io || $stdin == io\n end",
"title": ""
},
{
"docid": "8696753086345bf6b9fe36d71b5dbe6f",
"score": "0.622434",
"text": "def check_command(value)\n output, status = Puppet::Util::SUIDManager.run_and_capture([value])\n # The shell returns 127 if the command is missing.\n if status.exitstatus == 127\n raise ArgumentError, output\n end\n \n status.exitstatus == 0\n end",
"title": ""
},
{
"docid": "0721e56a35aae7b2e31cffb66da8bfd5",
"score": "0.62242645",
"text": "def is_process_running(process_name)\n ps = Mixlib::ShellOut.new(\"ps aux | grep '#{process_name}' | egrep -v \\\"grep .*#{process_name}\\\"\")\n ps.run_command\n\n !ps.stdout.strip.empty?\nend",
"title": ""
},
{
"docid": "2c9978ef1ab00d8961e84d021de44b68",
"score": "0.62172145",
"text": "def check\n return false unless self.pid\n `ps #{self.pid}`\n unless $?.success?\n return false\n end\n true\n end",
"title": ""
},
{
"docid": "9a8334d7147d9ca57aac4b73c7b05efe",
"score": "0.62170637",
"text": "def should_print?\n !@suppress_output\n end",
"title": ""
},
{
"docid": "9a8334d7147d9ca57aac4b73c7b05efe",
"score": "0.62170637",
"text": "def should_print?\n !@suppress_output\n end",
"title": ""
},
{
"docid": "817c71a43254a172e1d5bfa9a7778501",
"score": "0.6188989",
"text": "def running?\n cmd = 'ps -A -c -o command | grep ^Divvy$ || true'\n !shell_out(cmd).stdout.strip.empty?\n end",
"title": ""
},
{
"docid": "39e887746dc879e124b7b952098d0f51",
"score": "0.61856204",
"text": "def output?(device)\n device.respond_to?(:puts)\n end",
"title": ""
},
{
"docid": "d297ca74fa1d16148bb85ac0de320a56",
"score": "0.6176996",
"text": "def git_present?()\n _, _, status = Shell::execute_shell_commands(\"which git\", [:silent_command, :suppress_output])\n return status\nend",
"title": ""
},
{
"docid": "75b020e14284c2fdd4c30ceb044ac265",
"score": "0.6172976",
"text": "def shell_output(cmd, result=0)\n ohai cmd\n output = `#{cmd}`\n assert_equal result, $?.exitstatus\n output\n end",
"title": ""
},
{
"docid": "f218b761ea53a0370cbbb0ba8e200774",
"score": "0.6165434",
"text": "def known_shell?(shell)\n KNOWN_SHELLS.include?(shellname(shell))\n end",
"title": ""
},
{
"docid": "f4576f51db92b021b3bfb81c5ac65fa6",
"score": "0.6161429",
"text": "def exec_exist?(*args)\n require 'tty-which'\n TTY::Which.exist?(*args)\n end",
"title": ""
},
{
"docid": "f4576f51db92b021b3bfb81c5ac65fa6",
"score": "0.6161429",
"text": "def exec_exist?(*args)\n require 'tty-which'\n TTY::Which.exist?(*args)\n end",
"title": ""
},
{
"docid": "f4576f51db92b021b3bfb81c5ac65fa6",
"score": "0.6161429",
"text": "def exec_exist?(*args)\n require 'tty-which'\n TTY::Which.exist?(*args)\n end",
"title": ""
},
{
"docid": "f4576f51db92b021b3bfb81c5ac65fa6",
"score": "0.6161429",
"text": "def exec_exist?(*args)\n require 'tty-which'\n TTY::Which.exist?(*args)\n end",
"title": ""
},
{
"docid": "64ff803f83fbb4d0acda95434dcbdd08",
"score": "0.61593544",
"text": "def bash_compatible\n shell = `sh --version`\n return ($?.to_i == 0)\n end",
"title": ""
},
{
"docid": "bb24b9f0dbdcc645576c88e31d429040",
"score": "0.6157852",
"text": "def output?\n raise \"output is not captured unless you enable :capture\" unless @capture_enabled\n @output.any?\n end",
"title": ""
},
{
"docid": "df0c8bd6a501b628fbdf057e17de3d0b",
"score": "0.6151965",
"text": "def shell_ping_exist? \n\t\tbegin\n\t\t\tputs \"Search local shell environment for the ping program ...\" if @verbose\n\t\t\t@search_path.map do |path|\n\t\t\t\tping_exe=path+\"ping\"\n\t\t\t\tif File.exist?(ping_exe) && File.executable?(ping_exe)\n\t\t\t\t\t@which_ping=ping_exe\n\t\t\t\t\tputs \"Local ping program found: #{ping_exe}\" if @verbose\n\t\t\t\t\treturn true\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn false\n\t\trescue Exception => ee\n\t\t\tputs \"Exception on method #{__method__}: #{ee}\" if @verbose\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5a9480e7c54408daba8baeb3ee08f8a7",
"score": "0.6151274",
"text": "def bash?\n @environment == :cli\n end",
"title": ""
},
{
"docid": "d8aae63fd037125a676cf58aef4c284e",
"score": "0.61504185",
"text": "def shell?(name)\n File.basename(ENV['SHELL']) == name\n end",
"title": ""
},
{
"docid": "4ca2346781ab26b3887438e39a5e95a3",
"score": "0.6149082",
"text": "def print_happy_results(command_str, shell_result, boom=true)\n if ((shell_result[:exit_code] == 0) or ((shell_result[:exit_code] != 0) and not boom))\n output = \"> Shell executed command:\\n\"\n output += \"#{command_str}\\n\"\n output += \"> Produced output:\\n\" if (not shell_result[:output].empty?)\n output += \"#{shell_result[:output].strip}\\n\" if (not shell_result[:output].empty?)\n output += \"> And exited with status: [#{shell_result[:exit_code]}].\\n\" if (shell_result[:exit_code] != 0)\n output += \"\\n\"\n \n @streaminator.stdout_puts(output, Verbosity::OBNOXIOUS)\n end\n end",
"title": ""
},
{
"docid": "35a842d961bffe9c0ad8a378d30720d9",
"score": "0.6139403",
"text": "def svok?\n Util::open_write(svfn('ok')) { true }\n rescue Errno::ENXIO, Errno::ENOENT\n false # No pipe reader, or no pipe!\n end",
"title": ""
},
{
"docid": "a25d10e7220c48de402c98b35eeea07e",
"score": "0.613885",
"text": "def running?\n torrent = ::File.basename(new_resource.torrent)\n cmd = Chef::ShellOut.new(\"pgrep -f #{torrent}\")\n pgrep = cmd.run_command\n Chef::Log.debug \"Output of 'pgrep -f #{torrent}' is #{pgrep.stdout}.\"\n if pgrep.stdout.length == 0\n return false\n else\n return true\n end\nend",
"title": ""
},
{
"docid": "0d50d7f2dfb4c8a6020a281edbc6998c",
"score": "0.61375886",
"text": "def print_happy_results(command_str, shell_result, boom=true)\n if ((shell_result[:exit_code] == 0) or ((shell_result[:exit_code] != 0) and not boom))\n output = \"> Shell executed command:\\n\"\n output += \"'#{command_str}'\\n\"\n output += \"> Produced output:\\n\" if (not shell_result[:output].empty?)\n output += \"#{shell_result[:output].strip}\\n\" if (not shell_result[:output].empty?)\n output += \"> And exited with status: [#{shell_result[:exit_code]}].\\n\" if (shell_result[:exit_code] != 0)\n output += \"\\n\"\n\n @streaminator.stdout_puts(output, Verbosity::OBNOXIOUS)\n end\n end",
"title": ""
},
{
"docid": "eda5e401e577cc36fd557b073f39e82e",
"score": "0.61351484",
"text": "def exists?\n shell_out!(\"#{new_resource.binary} channel-info #{new_resource.channel_name}\")\n true\n rescue Mixlib::ShellOut::ShellCommandFailed\n false\n end",
"title": ""
},
{
"docid": "45761197d44f4d0eca49719b2913825d",
"score": "0.61206245",
"text": "def cmd_matches?(process)\n process.command == Snipr.exec_cmd(\"ps -p #{process.pid} -o 'command='\").first.strip\n end",
"title": ""
},
{
"docid": "d3b89aaab4b232c54a8a03f75ccb3ebc",
"score": "0.6100974",
"text": "def colorize?\n @env['SSHKIT_COLOR'] || (@output.respond_to?(:tty?) && @output.tty?)\n end",
"title": ""
},
{
"docid": "dbab15af3f77091c5c38f0165c67b234",
"score": "0.60835654",
"text": "def shell_out_wrapper(args)\n o = nil\n begin\n cmd = shell_out(args)\n o = (cmd.stdout.empty? ? cmd.stderr : cmd.stdout).strip\n rescue\n o = \"failed to run #{args.first}\"\n end\n o\n end",
"title": ""
},
{
"docid": "04a03aada4b583df40dd1d199dd48893",
"score": "0.6079725",
"text": "def terminal?\n return true\n end",
"title": ""
},
{
"docid": "84b7e6c6aa33105cfcfa7de1759a2610",
"score": "0.6075892",
"text": "def test_echo\n assert(cmd = Patir::ShellCommand.new(:cmd => \"echo hello\"))\n refute(cmd.executed?)\n refute(cmd.run?)\n assert_equal(:not_executed, cmd.status)\n refute(cmd.success?)\n assert_equal(:success, cmd.run)\n assert_equal(\"\", cmd.error)\n assert(cmd.executed?)\n assert_equal(\"hello\\n\", cmd.output)\n assert(cmd.run?)\n assert_equal(:success, cmd.status)\n assert(cmd.success?)\n end",
"title": ""
}
] |
5c4e7a77a1842c1f13be337acc338fc6
|
Returns a collection of Site admins, challenge evaluators and challenge admins
|
[
{
"docid": "3d6c4e4b2da84e40a0845a0925460a96",
"score": "0.59945494",
"text": "def guest_lead_dxusers\n User.site_admins.\n or(User.challenge_admins).\n or(User.challenge_evaluators).\n order(:dxuser).distinct.pluck(:dxuser)\n end",
"title": ""
}
] |
[
{
"docid": "3dd7ca0e0040d7d8e9fac5af9a8570cc",
"score": "0.71780044",
"text": "def index\n @site_admins = SiteAdmin.all\n end",
"title": ""
},
{
"docid": "c427476835e6c54a739dd03ef9a56456",
"score": "0.7064868",
"text": "def admins\n app_users.select(&:admin?)\n end",
"title": ""
},
{
"docid": "3c773a13b85090331a5c74724b6ec787",
"score": "0.7014453",
"text": "def get_admins\n\t\t@sm = Member.where(society_id: self.id)\n\t\t@admins = []\n\t\t@sm.each do |m|\n\t\t #if is an admin, add to array\n\t\t if m.admin then @admins << User.find_by_id(m.user_id) end\n\t\tend\n\t\treturn @admins\n end",
"title": ""
},
{
"docid": "01b0ae678db4754f52a30a489e070683",
"score": "0.6884545",
"text": "def get_admins\n self._get_reviewers(\"admin\")\n end",
"title": ""
},
{
"docid": "659ddb31baf9dab76c8aa9befff77a30",
"score": "0.6868511",
"text": "def fetch_admins\n @admins = Admin.get_all_admins_from_memcache(@client_id)\n\n @admins.each do |admin|\n if admin.role == GlobalConstant::Admin.super_admin_role\n @super_admins[admin.id] = admin\n else\n @normal_admins[admin.id] = admin\n end\n end\n\n end",
"title": ""
},
{
"docid": "c98140c94ffa82659f0ad728d67f72ff",
"score": "0.6767423",
"text": "def admins\n [self.user.email, self.study_shares.can_edit, User.where(admin: true).pluck(:email)].flatten.uniq\n end",
"title": ""
},
{
"docid": "650738457cf5ed9683a02644449cfe37",
"score": "0.66854346",
"text": "def administrators\n adminrole = Role.find(:first, :conditions => \"#{self.class.primary_key}=#{self.id} AND name='Administrator'\")\n adminrole ?\n adminrole.users.select{|u| u.company==self} : nil\n end",
"title": ""
},
{
"docid": "c185b7eb7615fb2b7c66dc3e54a7f151",
"score": "0.6657168",
"text": "def index\n administrators = Administrator.all\n admin_list = []\n administrators.each do |admin|\n admin_info = admin.attributes\n admin_info[:user] = User.find(admin[\"user_id\"])\n admin_info[:geofence] = Geofence.find(admin[\"geofence_id\"])\n admin_list << admin_info\n end\n @administrators = admin_list\n end",
"title": ""
},
{
"docid": "03581541d542fc514325d2620c143b98",
"score": "0.66530436",
"text": "def admins\n User.where(id: memberships.admin.pluck(:user_id)).all\n end",
"title": ""
},
{
"docid": "d316367873fd040a9cf1f46c0fdee6e9",
"score": "0.6567124",
"text": "def index\n @user_admins = UserAdmin.all\n end",
"title": ""
},
{
"docid": "99c7a866a46742d0cbc07d616c487dd7",
"score": "0.65520495",
"text": "def index\n @administrators = Administrator.all\n end",
"title": ""
},
{
"docid": "99c7a866a46742d0cbc07d616c487dd7",
"score": "0.65520495",
"text": "def index\n @administrators = Administrator.all\n end",
"title": ""
},
{
"docid": "99c7a866a46742d0cbc07d616c487dd7",
"score": "0.65520495",
"text": "def index\n @administrators = Administrator.all\n end",
"title": ""
},
{
"docid": "eef0a84f1c84bed0be3b2b8bb71c49c1",
"score": "0.6521446",
"text": "def fetch_admins\n admin_objs = Admin.not_deleted.where(default_client_id: @client_id).order({id: :desc}).all\n admin_objs.each do |admin|\n @admin_user_count += 1\n @curr_page_data << {\n id: admin.id,\n name: admin.name,\n email: admin.email,\n status: admin.status,\n role: admin.role\n }\n end\n\n @can_invite_new_user = (@admin.role == GlobalConstant::Admin.super_admin_role && @admin_user_count < 20) ? true : false\n end",
"title": ""
},
{
"docid": "293906215fc06b69e54434c64f6208bd",
"score": "0.6419314",
"text": "def admins\n [self.user.email, self.user_annotation_shares.can_edit, User.where(admin: true).pluck(:email)].flatten.uniq\n end",
"title": ""
},
{
"docid": "c586431554873f63cd9b2cc2fb7b90b5",
"score": "0.63916934",
"text": "def host_lead_dxusers\n User.site_admins.or(User.challenge_admins).order(:dxuser).distinct.pluck(:dxuser)\n end",
"title": ""
},
{
"docid": "8c0bebb4a6afea493a1d42e01c034500",
"score": "0.63889843",
"text": "def index\n @saas_admins = Admin.all\n end",
"title": ""
},
{
"docid": "252e2b06f6121fff319322b6d3f53f54",
"score": "0.6383546",
"text": "def administrators\n members.where(memberships: { role: 'admin' })\n end",
"title": ""
},
{
"docid": "4def6063ba7b4ab834807e20a89e2568",
"score": "0.63315034",
"text": "def admin_index\n authorize User\n @users = current_user.org.users.includes(:roles)\n end",
"title": ""
},
{
"docid": "4326a9b1bba9d1b39c6e0a34ed95caa1",
"score": "0.63212305",
"text": "def users\n # TODO use SQL\n results = self.approvers + self.observers + [self.requester]\n results.compact\n end",
"title": ""
},
{
"docid": "5c511612c4192440e9effdcd2b09def4",
"score": "0.6302532",
"text": "def get_sites\n\t\ts = get_admin_section \"system.applicationHost/sites\"\n\t IisObjectCollection.new s.Collection, :site, Site, lambda { |site| site.id = s.Collection.Count + 1 }\n end",
"title": ""
},
{
"docid": "cd23f6be9bff8bd3015eef6a0b1e44b5",
"score": "0.6298408",
"text": "def index\n @admins = Admin.all\n end",
"title": ""
},
{
"docid": "cd23f6be9bff8bd3015eef6a0b1e44b5",
"score": "0.6298408",
"text": "def index\n @admins = Admin.all\n end",
"title": ""
},
{
"docid": "cd23f6be9bff8bd3015eef6a0b1e44b5",
"score": "0.6298408",
"text": "def index\n @admins = Admin.all\n end",
"title": ""
},
{
"docid": "cd23f6be9bff8bd3015eef6a0b1e44b5",
"score": "0.6298408",
"text": "def index\n @admins = Admin.all\n end",
"title": ""
},
{
"docid": "cd23f6be9bff8bd3015eef6a0b1e44b5",
"score": "0.6298408",
"text": "def index\n @admins = Admin.all\n end",
"title": ""
},
{
"docid": "cd23f6be9bff8bd3015eef6a0b1e44b5",
"score": "0.6298408",
"text": "def index\n @admins = Admin.all\n end",
"title": ""
},
{
"docid": "078db77720bc53a6cef00fc4a982a93e",
"score": "0.6292342",
"text": "def admins\n contributors.where(admin: true)\n end",
"title": ""
},
{
"docid": "5e194b4e2a045dd3bfa9f29bf296e9a3",
"score": "0.6289846",
"text": "def admins\n # Use the where clause to return users who have admin column set to true (false by default)\n board_members.where(is_admin: true)\n end",
"title": ""
},
{
"docid": "7ed8aefff9a41decbbbc7eac42e36cf0",
"score": "0.62720704",
"text": "def index\n @admin_users = Admin::User.all\n end",
"title": ""
},
{
"docid": "fddbaa22de59b19ffd4338261479ca03",
"score": "0.62642246",
"text": "def other_administrators\n Administrator.where.not(['id = ? or is_super = ?',self.id, true]).order(:organisation).map {\n |t| ['%{org}: %{lname} %{name}'%{org: t.organisation, lname: t.info.last_name, name: t.info.name},t.id]\n }\n end",
"title": ""
},
{
"docid": "124e61af5503e705ab2f1ce9a0d9ab26",
"score": "0.6213432",
"text": "def index\n @admin_surveys = Admin::Survey.all\n end",
"title": ""
},
{
"docid": "370917a8a58dd2dc0b209bbc57fc8b78",
"score": "0.61983645",
"text": "def project_administrators\n people_with_the_role(Seek::Roles::PROJECT_ADMINISTRATOR)\n end",
"title": ""
},
{
"docid": "370917a8a58dd2dc0b209bbc57fc8b78",
"score": "0.61983645",
"text": "def project_administrators\n people_with_the_role(Seek::Roles::PROJECT_ADMINISTRATOR)\n end",
"title": ""
},
{
"docid": "0a5576303fcb12358b50031ec113f003",
"score": "0.61452466",
"text": "def authorized_partner_sites\n if has_role? 'admin'\n sites = PartnerSite.all\n else\n sites =\n PartnerSite.all :conditions => [ 'partner_id = ?', partner_id ]\n end\n sites\n end",
"title": ""
},
{
"docid": "e6e1baf092165eb96c3bd67dc672ebfe",
"score": "0.6139724",
"text": "def index\n @admin_admins = Admin::Admin.page(params[:page]).per(15).load\n end",
"title": ""
},
{
"docid": "adabdadb69f68376abb08793fe1a1ade",
"score": "0.6126055",
"text": "def admin\n @happykid = OpeningTime.all\n @promo = Promo.all\n @news = News.all\n @siteInfo = SiteInfo.all\n @staff = Staff.all\n end",
"title": ""
},
{
"docid": "0bef168e265cedb8c50f82637b28376c",
"score": "0.6118322",
"text": "def index\n @adminusers = Adminuser.all\n end",
"title": ""
},
{
"docid": "06a1f144e6525e5c7a986efb147c893e",
"score": "0.6115811",
"text": "def members\n\t\t(self.users.to_a + self.admins.to_a).uniq\n\tend",
"title": ""
},
{
"docid": "d0eec845ce2c977c323d95747f2b5e5d",
"score": "0.61096126",
"text": "def admins\n ::Syncano::QueryBuilder.new(self, ::Syncano::Resources::Admin)\n end",
"title": ""
},
{
"docid": "b5be29f4771bdabcdf23a10cd06e7160",
"score": "0.6108909",
"text": "def setup_admins_users\n begin\n click_on('Logout')\n rescue\n print\n end\n\n Warden.test_reset!\n\n @a1 = admins(:elle_woods)\n @a2 = admins(:vivian_kensington)\n @a3 = admins(:emmett_richmond)\n\n @u1 = users(:connery)\n @u2 = users(:moore)\n @u3 = users(:brosnan)\nend",
"title": ""
},
{
"docid": "3a929ad04c0234706f802673180ba7af",
"score": "0.6103434",
"text": "def models\n [::AdminSet, Hyrax::AdministrativeSet]\n end",
"title": ""
},
{
"docid": "8a688c546c40dd0ac685016606f213bd",
"score": "0.60971487",
"text": "def index\n @admin_administrators = Admin::Administrator.page(params[:page])\n end",
"title": ""
},
{
"docid": "91adb69d21c43e3c4323f519e452dba9",
"score": "0.6093636",
"text": "def index\n @world_admins = WorldAdmin.all\n end",
"title": ""
},
{
"docid": "d1cd1cc54cc243d74634ac8203ee3b0d",
"score": "0.6090437",
"text": "def get_admins_by_id\n return filter_by_id(get_admins)\n end",
"title": ""
},
{
"docid": "5f6e662a6568b8b197b5b0d43595c001",
"score": "0.60893387",
"text": "def index\n @admins = Admin.all\n\n\n\n\n\n end",
"title": ""
},
{
"docid": "8c49affd979c9099a3fe8a2e889f79a6",
"score": "0.60813767",
"text": "def index\n @administrators = @administrators_active\n @administrators_count = @administrators.size\n end",
"title": ""
},
{
"docid": "d54967857a9a89d917c57fad7377d2df",
"score": "0.6071633",
"text": "def index\n @admins = @admin.role == 1 ? Admin.order(first_name: 'asc') : Admin.joins(:admins_sites).where(\"site_id = ?\", @site.id).order('first_name asc')\n end",
"title": ""
},
{
"docid": "f22d718b69bca636a5621f714ecf92d4",
"score": "0.60698456",
"text": "def index\n @admin_n_admins = Admin::NAdmin.all\n end",
"title": ""
},
{
"docid": "96a1c9d7c029799d88a4b173f289e859",
"score": "0.6053082",
"text": "def users\n if design.only_unblinded\n project.unblinded_members_for_site(subject.site)\n else\n project.members_for_site(subject.site)\n end\n end",
"title": ""
},
{
"docid": "c00ceb935062f58fa195bb39929b2d81",
"score": "0.6051639",
"text": "def active_admins\n admins.select { |admin| circle.has_active_user?(admin) }\n end",
"title": ""
},
{
"docid": "00a576328edc1b355472d5502eb838c5",
"score": "0.6040025",
"text": "def admin\n @userList = User.all\n end",
"title": ""
},
{
"docid": "48a061d17081f3a853be0346444fabc3",
"score": "0.60359615",
"text": "def administrators\n @users = User.admin.search_sort_paginate(params)\n end",
"title": ""
},
{
"docid": "7036c35e6497790b0dc4a18b92cd02cd",
"score": "0.60183",
"text": "def active_admins\n admins.select {|admin| circle.has_active_user?(admin) }\n end",
"title": ""
},
{
"docid": "10649f8012564949635bc9f7571df296",
"score": "0.5996995",
"text": "def index\n @admin_cie_users = Registry::CieUser.all\n end",
"title": ""
},
{
"docid": "322dfec0def023dfc447ba05af13f05a",
"score": "0.5996339",
"text": "def admins\r\n AdminsController.instance\r\n end",
"title": ""
},
{
"docid": "403d1be6544b97872bc0e26d9382853f",
"score": "0.596959",
"text": "def index\n return unless authenticated_admin?\n @users = User.all\n end",
"title": ""
},
{
"docid": "aa728426c3ef015ddaada95f417b8bbb",
"score": "0.5963461",
"text": "def index\n @admins = Admin.order(:email)\n authorize @admins\n end",
"title": ""
},
{
"docid": "5f4e44d23c33adc20cae1397cecd4b51",
"score": "0.59531593",
"text": "def site_list\n @sites = Haiwet::Site.list\n @sites.each.with_index(1) do |site, i|\n puts \"\\n #{i}- #{site.name}\"\n end\n end",
"title": ""
},
{
"docid": "64f8115a0d6d7c3487cf89c5cc4a1d42",
"score": "0.59516954",
"text": "def index\n @adminstrators = Administrator.order(:name)\n end",
"title": ""
},
{
"docid": "b03cd8386f293e4b82d6a7bbeffaf677",
"score": "0.5950149",
"text": "def index\n @user_admins = UserAdmin.ignore_fields_user.page params[:page]\n end",
"title": ""
},
{
"docid": "0eae783cfc7d78a353fbb5de5ed0f964",
"score": "0.5937162",
"text": "def index\n authorize Admin\n @admins = initialize_grid(Admin.where(\"id != ?\", current_admin.id).order('id desc'), per_page: 10)\n end",
"title": ""
},
{
"docid": "026ef709cc521e7ecf01366dc7b2c763",
"score": "0.5933967",
"text": "def index\n\t\tis_current_role_site_admin = session[:role] == User.site_admin\n\t\tis_current_role_vendor_admin = session[:role] == User.vendor_admin\n\t\tis_administrator_role = is_current_role_site_admin || is_current_role_vendor_admin\n\t\tif is_administrator_role\n\t\t\t@users = User.all.where(role_id: Role.get_user_id)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2dfb226eaab08a3c80c9fc9fff923ea1",
"score": "0.59201235",
"text": "def index\n restrict 'allow only admins' or begin\n @admins = Admin.find(:all)\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @admins.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "2dfb226eaab08a3c80c9fc9fff923ea1",
"score": "0.59201235",
"text": "def index\n restrict 'allow only admins' or begin\n @admins = Admin.find(:all)\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @admins.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "5490186ba13c57e69f3b5c7c57e8a94a",
"score": "0.59039456",
"text": "def list_admins\n service_response = ManagerManagement::Team::ListAdmins.new(params).perform\n return render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "8daf5b7fa55fb9f48bd0a6d8ab25bf46",
"score": "0.58985555",
"text": "def administered_journals\n journal_query = Journal.all\n journal_query = yield(journal_query) if block_given?\n if site_admin?\n journal_query\n else\n roles = [:manage_users, :administer]\n filter_authorized_set(roles, journal_query)\n end\n end",
"title": ""
},
{
"docid": "6ff6d6f6de808d610e98912cf82d31df",
"score": "0.58978",
"text": "def index\n @admins = Admin.where(invitation_token: nil)\n end",
"title": ""
},
{
"docid": "b827657a4ccf93827d8658a903e0c310",
"score": "0.5896117",
"text": "def index\n # Replace TaskAdmin with User if we want SuperAdmin to manage all users\n @users = TaskAdmin.all\n end",
"title": ""
},
{
"docid": "c1290f19fe853b4a563abee3125ca6a3",
"score": "0.58856905",
"text": "def index\n\t\tif (current_user.has_role? :super_admin)\n\t\t\t@users = User.with_role :admin\n\t\telse\n\t\t\t@users = User.with_role :member\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d4ef0ffa3204a5094b7d7aa90fa0961b",
"score": "0.58844817",
"text": "def users\n return @canonical_user_pool if @canonical_user_pool\n Egi::Fedcloud::Vmhound::Log.debug \"[#{self.class}] Retrieving all users\"\n check_retval @user_pool.info!\n\n @canonical_user_pool = []\n @user_pool.each { |user| @canonical_user_pool << canonical_user(user) }\n @canonical_user_pool\n end",
"title": ""
},
{
"docid": "e65fd8a44210c1b471bc14242fc7ec2d",
"score": "0.5884289",
"text": "def index\n if current_user.admin == 0\n @eleves_cu = @eleves.where(:user_id => current_user.id).all\n end\n end",
"title": ""
},
{
"docid": "e979c5006be94837d80d2409c5b835d7",
"score": "0.5880076",
"text": "def users\n gateway_check\n @users\n end",
"title": ""
},
{
"docid": "9c7a35295f616c940ee531a77a56fddf",
"score": "0.58791304",
"text": "def index\n @siteusers = Siteuser.all\n end",
"title": ""
},
{
"docid": "43780e62e1572833e2883aad398fb32d",
"score": "0.5875859",
"text": "def admin_labs\n self.roles.where(name: \"admin\", resource_type: \"Lab\")\n end",
"title": ""
},
{
"docid": "3b2855fbc97eefc5ab3d1073ac806227",
"score": "0.58706933",
"text": "def sites\n if permission.value.positive?\n Site.all_cached\n else\n Rails.cache.fetch(\"user_#{id}_sites\", expires_in: 1.month, race_condition_ttl: 30.seconds) do\n puts 'user sites not cached'\n connections.map { |c| Site.find(c.site_id) }.sort_by(&:title)\n end\n end\n end",
"title": ""
},
{
"docid": "ab86209fbe27496cf9f991fa1f7c1a1a",
"score": "0.5863071",
"text": "def users\n return @users\n end",
"title": ""
},
{
"docid": "6b96fe9fb412acd699a299b010338af5",
"score": "0.5862284",
"text": "def setup\n @useradmin3 = useradmins(:useradmin3)\n @user3 = users(:three)\n end",
"title": ""
},
{
"docid": "163b9627c1130042937665e7965f38e0",
"score": "0.58600664",
"text": "def index\n @subadmins = Subadmin.all\n end",
"title": ""
},
{
"docid": "c4d04a3c31468dc82e3edbb631e5fbd8",
"score": "0.58534175",
"text": "def users\n gateway_check\n unavailable_servers_check\n @users\n end",
"title": ""
},
{
"docid": "30cd72bda7fc6fef11d54d5f4d718132",
"score": "0.5851727",
"text": "def index\n @admin = Admin.find_by(id: session[:admin_id])\n @admins = Admin.select_admins_to_show(@admin)\n end",
"title": ""
},
{
"docid": "92ad596c6e6284ba5359673d298e7870",
"score": "0.58352935",
"text": "def index\n if current_user.admin?\n @users = User.all\n end\n \n end",
"title": ""
},
{
"docid": "52f697d3324dd910c67e706b7c60678f",
"score": "0.5831254",
"text": "def admin_all_users\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 !@app.is_admin or @app.is_admin === 0\n redirect_to '/error_page'\n end\n\n\n # Otherwise get list of all Users\n @users = User.all\n\n end",
"title": ""
},
{
"docid": "d4150efe99923f402d43ec4959e6f21f",
"score": "0.5828997",
"text": "def index\n @administrator_locals = AdministratorLocal.all\n end",
"title": ""
},
{
"docid": "a322932b7f3e917f7953e9512d4b751c",
"score": "0.5828307",
"text": "def index\n\t\t@users = AdminUser.sorted\n\tend",
"title": ""
},
{
"docid": "b6ebb612028142f09e587adfc9ea9f49",
"score": "0.5817378",
"text": "def index\n @admin_governorates = Admin::Governorate.all\n end",
"title": ""
},
{
"docid": "1a9e3ff4c82fd0039016d2ab4b139dd1",
"score": "0.58157575",
"text": "def index\n @collection_center_admins = CollectionCenterAdmin.all\n end",
"title": ""
},
{
"docid": "654f79ab92a6c61e4085c57cf3e3667f",
"score": "0.5814279",
"text": "def users\n @users\n end",
"title": ""
},
{
"docid": "0ea7377f02b30ac89adb01a6a4c17adf",
"score": "0.579979",
"text": "def all_viewable_sites\n Site\n .current\n .with_project_or_as_site_user(all_viewable_projects.select(:id), id)\n end",
"title": ""
},
{
"docid": "7372e16623a37cdf29ef12731c987ac3",
"score": "0.57970977",
"text": "def show_admins\r\n @admins_pages, @admins = paginate(:users, \r\n :conditions => ['level = 2'],\r\n :order => 'username') \r\n end",
"title": ""
},
{
"docid": "f079b09d5f44ccdb4e4b976e71b1982b",
"score": "0.5793601",
"text": "def index\n @admin_managers = Admin::Manager.all\n end",
"title": ""
},
{
"docid": "0dc853f281e61a632e78b167114770b3",
"score": "0.57903916",
"text": "def all_sub_admins\n unless @current_admin.is_super_admin\n flash[:error]=\"You are not authorized to navigate to this page \"\n redirect_to admin_index_path\n return\n end\n @all_sub_admins=Admin.where(\"is_super_admin !=?\", true).paginate(:page => params[:page], :per_page => 9)\n end",
"title": ""
},
{
"docid": "065b7806022985c1e6c3606ef37190cf",
"score": "0.5785287",
"text": "def index\n @admins = Admin.page(params[:page]).per(20)\n end",
"title": ""
},
{
"docid": "8670705f1d2a59407d104fb8e5b730bc",
"score": "0.5780828",
"text": "def index\n @shop_admins = ShopAdmin.all\n end",
"title": ""
},
{
"docid": "732d6e3f660ed11d6bad38af18156a31",
"score": "0.57763207",
"text": "def all\n @teachers = @admin.children.unblocked.order(User::DEFAULT_ORDER)\n end",
"title": ""
},
{
"docid": "a36961649981640d77e916d117928452",
"score": "0.5745374",
"text": "def hosts\n @salticid.hosts.select do |host|\n host.roles.include? self\n end\n end",
"title": ""
},
{
"docid": "28b2a87189cd96da8186ef773b8f0ca4",
"score": "0.5742243",
"text": "def setup\n @admin = users(:admin)\n @user = users(:user)\n end",
"title": ""
},
{
"docid": "832c471768793d0e3310d49f94283268",
"score": "0.57354563",
"text": "def info_for_forms\n #Info for page\n #Saving info if we are SA\n @is_super_admin = is_super?\n #Array of admins for SA\n @admins = User.admins_list(with_mentors: false) if @is_super_admin\n end",
"title": ""
},
{
"docid": "9df0546b9187f75e8c7785cc5d6a8e75",
"score": "0.5732166",
"text": "def index\n @@is_current_user_admin = signed_in? && current_user[:admin]\n\n @current_user_collections = if signed_in?\n (\n Collection.where(user_id: current_user).map do |collection|\n [collection.name, collection.id]\n end\n )\n end\n\n end",
"title": ""
},
{
"docid": "ce5418f17344f54434d5f82660478618",
"score": "0.57219946",
"text": "def admins\n group_users(admins_join_table)\n end",
"title": ""
}
] |
48b1f023e557be828c168ad258984703
|
Used in discuss only.
|
[
{
"docid": "7b03479ada43ff87d83eb34fea7e6a0f",
"score": "0.0",
"text": "def search_content\n space = Space.find(unsafe_params[:id])\n results = space.search_content(unsafe_params[:content_type], unsafe_params[:query])\n render json: results\n end",
"title": ""
}
] |
[
{
"docid": "b7567a2a68cade31f2360723a4c42dc7",
"score": "0.6994874",
"text": "def used_by; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.6851591",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.6851591",
"text": "def used; end",
"title": ""
},
{
"docid": "58e2e07d11b107b6864a328f2187e248",
"score": "0.6744784",
"text": "def apop?; end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.6733006",
"text": "def in_use; end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.6733006",
"text": "def in_use; end",
"title": ""
},
{
"docid": "954c5828178f6e4a659c40ef92736547",
"score": "0.66873",
"text": "def helpful!\n\n\t\tend",
"title": ""
},
{
"docid": "a9dd648a5d0d2e7d56223e7c753f5e2e",
"score": "0.6663088",
"text": "def telegraphical()\n end",
"title": ""
},
{
"docid": "b7cfdec5315b5d3c26b002081b1dbae3",
"score": "0.66383636",
"text": "def coming_soon; end",
"title": ""
},
{
"docid": "2290804b238fc95bfd6b38f87c6d2895",
"score": "0.6392951",
"text": "def override; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6381975",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6381975",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6381975",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6381975",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6381975",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6381975",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6371169",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6371169",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6371169",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6371169",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.6371169",
"text": "def implementation; end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.6345949",
"text": "def internal; end",
"title": ""
},
{
"docid": "0a39799e76643367f1b6bfac65569895",
"score": "0.63432664",
"text": "def used?; end",
"title": ""
},
{
"docid": "e44ae2cef169d29f78b2b6306add59da",
"score": "0.6259495",
"text": "def huddlingly()\n end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.6250694",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.6250694",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.6250694",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.62393117",
"text": "def desired; end",
"title": ""
},
{
"docid": "065bf3cbdad8e482de8b92d4d027681c",
"score": "0.62139475",
"text": "def meta; end",
"title": ""
},
{
"docid": "065bf3cbdad8e482de8b92d4d027681c",
"score": "0.62139475",
"text": "def meta; end",
"title": ""
},
{
"docid": "065bf3cbdad8e482de8b92d4d027681c",
"score": "0.62139475",
"text": "def meta; end",
"title": ""
},
{
"docid": "065bf3cbdad8e482de8b92d4d027681c",
"score": "0.62139475",
"text": "def meta; end",
"title": ""
},
{
"docid": "065bf3cbdad8e482de8b92d4d027681c",
"score": "0.62139475",
"text": "def meta; end",
"title": ""
},
{
"docid": "003f93545faf95741b6daf49b5599d9c",
"score": "0.6210953",
"text": "def _self; end",
"title": ""
},
{
"docid": "c8216d758c47c5c1acf2dd26692ffe03",
"score": "0.6204485",
"text": "def purpose; end",
"title": ""
},
{
"docid": "7db0727baf89eb76beac27c515d7fe32",
"score": "0.615456",
"text": "def support; end",
"title": ""
},
{
"docid": "922ad13267ad637c9292ec039c11884f",
"score": "0.6153609",
"text": "def obscured?; end",
"title": ""
},
{
"docid": "2dee7e587ecfe70f997870a7ebcb05ca",
"score": "0.61403596",
"text": "def conatct\n end",
"title": ""
},
{
"docid": "005e6fc140cba1f79535dcb415d4bcd9",
"score": "0.6126853",
"text": "def strategy; end",
"title": ""
},
{
"docid": "005e6fc140cba1f79535dcb415d4bcd9",
"score": "0.6126853",
"text": "def strategy; end",
"title": ""
},
{
"docid": "7ec57c3874853e50086febdbdd3221bf",
"score": "0.610634",
"text": "def wedding; end",
"title": ""
},
{
"docid": "8c525d0972591c68c779b487792172b1",
"score": "0.6105082",
"text": "def initiated; end",
"title": ""
},
{
"docid": "a29c5ce532d6df480df4217790bc5fc7",
"score": "0.6085899",
"text": "def extra; end",
"title": ""
},
{
"docid": "a29c5ce532d6df480df4217790bc5fc7",
"score": "0.6085899",
"text": "def extra; end",
"title": ""
},
{
"docid": "a29c5ce532d6df480df4217790bc5fc7",
"score": "0.6085899",
"text": "def extra; end",
"title": ""
},
{
"docid": "a29c5ce532d6df480df4217790bc5fc7",
"score": "0.6085899",
"text": "def extra; end",
"title": ""
},
{
"docid": "8069e05f0b9277e6a4bed29cfddced3f",
"score": "0.60814834",
"text": "def at_noon; end",
"title": ""
},
{
"docid": "8069e05f0b9277e6a4bed29cfddced3f",
"score": "0.60814834",
"text": "def at_noon; end",
"title": ""
},
{
"docid": "8069e05f0b9277e6a4bed29cfddced3f",
"score": "0.60814834",
"text": "def at_noon; end",
"title": ""
},
{
"docid": "8069e05f0b9277e6a4bed29cfddced3f",
"score": "0.60814834",
"text": "def at_noon; end",
"title": ""
},
{
"docid": "8069e05f0b9277e6a4bed29cfddced3f",
"score": "0.60814834",
"text": "def at_noon; end",
"title": ""
},
{
"docid": "8069e05f0b9277e6a4bed29cfddced3f",
"score": "0.60814834",
"text": "def at_noon; end",
"title": ""
},
{
"docid": "8069e05f0b9277e6a4bed29cfddced3f",
"score": "0.60814834",
"text": "def at_noon; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.6041732",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.60407805",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.60407805",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.60407805",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.60407805",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.60407805",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.60407805",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.60407805",
"text": "def context; end",
"title": ""
}
] |
bd8711c84e60bc8fea9978c9a617678b
|
TODO Any reason not to change this to last name, first name?
|
[
{
"docid": "21035a7b222b436d23788aaf76035f56",
"score": "0.0",
"text": "def <=>(other)\n if other\n id <=> other.id\n else\n -1\n end\n end",
"title": ""
}
] |
[
{
"docid": "c5999cd094fe3af2b42a803c3d262ee9",
"score": "0.8155301",
"text": "def first_and_last_name\n \"#{self.lName} \" \" #{self.fName} \" \" #{self.patronymic}\"\n end",
"title": ""
},
{
"docid": "cfbab808ad528e3a8aa89e8a0d82fd27",
"score": "0.8082844",
"text": "def firstname; first_name; end",
"title": ""
},
{
"docid": "72dc6d4198afc7aaef2bf89bf7e27d2d",
"score": "0.79774463",
"text": "def actual_name\n \"#{first_name} #{first_last_name}\"\n end",
"title": ""
},
{
"docid": "56bb21a1bd405d4460521491597e4f3b",
"score": "0.7961375",
"text": "def name() \"#{first_name} #{last_name}\" end",
"title": ""
},
{
"docid": "67bd43a849ed7a045d0e7ed7a8369052",
"score": "0.7912927",
"text": "def full_name \n # used to be a field in db username, but now we want firstname and last name\n \"#{firstname} #{lastname}\"\n end",
"title": ""
},
{
"docid": "fba01af8d170e6dd6d73f9bc1eed3557",
"score": "0.7875539",
"text": "def full_name\n\t\tfirst + \" \" + last\n\tend",
"title": ""
},
{
"docid": "bd6166336f53fb7c0c085f82cc6ef476",
"score": "0.7852254",
"text": "def last_name\r\n lastName\r\n end",
"title": ""
},
{
"docid": "6157579b3337b2b8972ef0b67a21ff46",
"score": "0.7851355",
"text": "def last_name_first\n \n name = self.last_name + \", \" + self.first_name\n name += \" (#{self.nickname})\" unless self.nickname.blank?\n name\n \n end",
"title": ""
},
{
"docid": "bb603349aebf86b0a2fdf84173934a2f",
"score": "0.7826916",
"text": "def last_first_name\n self.name\n end",
"title": ""
},
{
"docid": "717beddf6251313c546438e9ce8866d3",
"score": "0.7818843",
"text": "def complete_name\n\t\t\"#{first_name} #{last_name}\"\n\tend",
"title": ""
},
{
"docid": "99931fdf0c335a741d0cd6c3f2a7323c",
"score": "0.78174806",
"text": "def proper_name # method to get the full name of user\n first_name + \" \" + last_name\n end",
"title": ""
},
{
"docid": "701ca6d05a9eadb1c59ce07b336e9ee0",
"score": "0.7813566",
"text": "def name\n last_name + \", \" + first_name\n end",
"title": ""
},
{
"docid": "ed3958c5f42baeeff1659e4670b0f351",
"score": "0.7809873",
"text": "def proper_name\n first_name + \" \" + last_name\n end",
"title": ""
},
{
"docid": "41cc0508f9eb690de31f28a628db791f",
"score": "0.78042233",
"text": "def full_name\n\t \"#{first_name} #{last_name}\"\n\tend",
"title": ""
},
{
"docid": "01f8da3792ac9f35e6fe1c9a3d73e03f",
"score": "0.78029716",
"text": "def full_name\r\n \"#{first_name} #{last_name}\"\r\n end",
"title": ""
},
{
"docid": "ad4aeda822337eebe0f6c25384c37912",
"score": "0.78028286",
"text": "def full_name\n \"#{first_name} #{last_name}\"\n end",
"title": ""
},
{
"docid": "ca11483afd49f18a1bf3dde93b4d4955",
"score": "0.77998835",
"text": "def full_name\n \t\"#{self.first_name} #{self.middle_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "78956178cc282409d0defd08f8923464",
"score": "0.7786852",
"text": "def name\n \tfull_name = self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "a45fd55d1654300c8703fff6beac5926",
"score": "0.7786639",
"text": "def name\n \t\tfirst_name + \" \" + last_name\n \tend",
"title": ""
},
{
"docid": "08dd3b01ed82af37988d4353a15094b7",
"score": "0.7784714",
"text": "def full_name\n self.first_name.capitalize + ' ' + self.last_name.capitalize if self.first_name && self.last_name\n end",
"title": ""
},
{
"docid": "ce49e4b1964e0e7b96964d62053e4bbe",
"score": "0.7782527",
"text": "def full_name\n \t\"#{first_name} #{last_name}\"\n end",
"title": ""
},
{
"docid": "1b3b86f0a6ffaf0d4fc5db8dd5abb238",
"score": "0.77693397",
"text": "def full_name\n\t\t\"#{first_name} #{last_name}\"\n\tend",
"title": ""
},
{
"docid": "1b3b86f0a6ffaf0d4fc5db8dd5abb238",
"score": "0.77693397",
"text": "def full_name\n\t\t\"#{first_name} #{last_name}\"\n\tend",
"title": ""
},
{
"docid": "df9b5912011b88d494a96ce19778e0b0",
"score": "0.776903",
"text": "def full_name\n \"#{last_name}, #{first_name}\"\n end",
"title": ""
},
{
"docid": "df9b5912011b88d494a96ce19778e0b0",
"score": "0.776903",
"text": "def full_name\n \"#{last_name}, #{first_name}\"\n end",
"title": ""
},
{
"docid": "df9b5912011b88d494a96ce19778e0b0",
"score": "0.776903",
"text": "def full_name\n \"#{last_name}, #{first_name}\"\n end",
"title": ""
},
{
"docid": "07998eef63d1e04e2f5551e9482be794",
"score": "0.7768431",
"text": "def name\n \treturn \"#{first_name} #{last_name}\"\n end",
"title": ""
},
{
"docid": "41faf3b139f3a67b450c7f2be815ab25",
"score": "0.7763478",
"text": "def full_name\n return self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "e62c5d849df43dbcc50ca795881cddcb",
"score": "0.7753296",
"text": "def full_name\n\t\tself.first_name + \" \" + self.last_name\n\tend",
"title": ""
},
{
"docid": "e62c5d849df43dbcc50ca795881cddcb",
"score": "0.7753296",
"text": "def full_name\n\t\tself.first_name + \" \" + self.last_name\n\tend",
"title": ""
},
{
"docid": "54c1d6e9b2a3478de1bc36c2324bfb22",
"score": "0.7752945",
"text": "def name\n \tfirst_name + ' ' + last_name\n end",
"title": ""
},
{
"docid": "664c7f4990f6624cfadbe44f6e431889",
"score": "0.775238",
"text": "def name\n\t\treturn first_name + \" \" + last_name\n\tend",
"title": ""
},
{
"docid": "3b9bcf954ddc4a9a82822919014b4df9",
"score": "0.7752047",
"text": "def full_name\n \"#{first_name} #{last_name}\"\n end",
"title": ""
},
{
"docid": "f036ec74b98efff8408c5731cecd760e",
"score": "0.7750388",
"text": "def full_name_last_first\n return self.first_name unless (self.last_name.length > 0)\n return (self.last_name + \", \" + self.first_name)\n end",
"title": ""
},
{
"docid": "ba4e37fc051d39475d5cdf44b6112325",
"score": "0.77439946",
"text": "def full_name\n \"#{first_name}, #{last_name}\"\n end",
"title": ""
},
{
"docid": "9563be3726e524fcf9f963435a6ff2f6",
"score": "0.7741716",
"text": "def full_name\n \tfirst_name + \" \" + last_name\n end",
"title": ""
},
{
"docid": "0b6f81ade98cb1233ca6ecc2128428a2",
"score": "0.7738432",
"text": "def name\n last_name + \" \" + first_name\n end",
"title": ""
},
{
"docid": "a612fc33a4138861a89ac8f76918cd35",
"score": "0.77362275",
"text": "def full_name\n self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "ca0f5b908519056f1f6399ef2cb01e0b",
"score": "0.7735517",
"text": "def name \n\t\n\t\t\"#{first_name} #{last_name}\"\n\t\n\tend",
"title": ""
},
{
"docid": "3893b7bf73fe6eaf198ebdf59a8cf0d5",
"score": "0.7734597",
"text": "def full_name\n\t\tfirst_name + \" \" + last_name\n\tend",
"title": ""
},
{
"docid": "3893b7bf73fe6eaf198ebdf59a8cf0d5",
"score": "0.7734597",
"text": "def full_name\n\t\tfirst_name + \" \" + last_name\n\tend",
"title": ""
},
{
"docid": "3893b7bf73fe6eaf198ebdf59a8cf0d5",
"score": "0.7734597",
"text": "def full_name\n\t\tfirst_name + \" \" + last_name\n\tend",
"title": ""
},
{
"docid": "3893b7bf73fe6eaf198ebdf59a8cf0d5",
"score": "0.7734597",
"text": "def full_name\n\t\tfirst_name + \" \" + last_name\n\tend",
"title": ""
},
{
"docid": "95f3aee0bc462f98fada08651ca76025",
"score": "0.77343297",
"text": "def full_name\n\t\t\"#{self.first_name} #{self.last_name}\"\n\tend",
"title": ""
},
{
"docid": "95f3aee0bc462f98fada08651ca76025",
"score": "0.77343297",
"text": "def full_name\n\t\t\"#{self.first_name} #{self.last_name}\"\n\tend",
"title": ""
},
{
"docid": "36312d7746d842865e97856aadae65eb",
"score": "0.7733717",
"text": "def full_name\n self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "36312d7746d842865e97856aadae65eb",
"score": "0.77336633",
"text": "def full_name\n self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "36312d7746d842865e97856aadae65eb",
"score": "0.77336633",
"text": "def full_name\n self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "36312d7746d842865e97856aadae65eb",
"score": "0.77336633",
"text": "def full_name\n self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "36312d7746d842865e97856aadae65eb",
"score": "0.77336633",
"text": "def full_name\n self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "36312d7746d842865e97856aadae65eb",
"score": "0.77336633",
"text": "def full_name\n self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "36312d7746d842865e97856aadae65eb",
"score": "0.77336633",
"text": "def full_name\n self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "36312d7746d842865e97856aadae65eb",
"score": "0.77336633",
"text": "def full_name\n self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "e18b7174960b097f0a3d68df421c35dc",
"score": "0.77295816",
"text": "def full_name\n if self.first_name.present? && self.last_name.present?\n \"#{first_name} #{last_name}\".better_titlecase\n end\n end",
"title": ""
},
{
"docid": "47a8d659402462dbd11cccec4d1d21e9",
"score": "0.7724509",
"text": "def full_name \n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "8c8406e97da3e341f6f3cc8f6e52bdf1",
"score": "0.7722293",
"text": "def full_name\n self.first_name + ' ' + self.last_name\n end",
"title": ""
},
{
"docid": "8c8406e97da3e341f6f3cc8f6e52bdf1",
"score": "0.7722293",
"text": "def full_name\n self.first_name + ' ' + self.last_name\n end",
"title": ""
},
{
"docid": "8c8406e97da3e341f6f3cc8f6e52bdf1",
"score": "0.7722293",
"text": "def full_name\n self.first_name + ' ' + self.last_name\n end",
"title": ""
},
{
"docid": "4df436a843aaa2131770f1c64dd564b2",
"score": "0.77220404",
"text": "def full_name\n self.first_name+\" \"+self.last_name\n end",
"title": ""
},
{
"docid": "4204b6d6634b90e64a87590f068428ca",
"score": "0.7721486",
"text": "def name\n \t\treturn \"#{first_name} #{last_name}\"\n \tend",
"title": ""
},
{
"docid": "f79fb8b7144c5395ee72d225e88ea2c1",
"score": "0.7719532",
"text": "def full_name\n\t\tfirst_name + ' ' + last_name\n\tend",
"title": ""
},
{
"docid": "458e3d109f6ac98f1939c9f5ed4c84cb",
"score": "0.7719142",
"text": "def first_name_last_name_initial\n self.first_name + ' ' + self.last_name[0,1]\n end",
"title": ""
},
{
"docid": "3db1a23b91dae75708b150892b387810",
"score": "0.7714468",
"text": "def name\n last_name + ' ' + first_name\n end",
"title": ""
},
{
"docid": "f51413f32a8b18bd61555bda4472c8fa",
"score": "0.77118886",
"text": "def full_name\n \"#{self.name_first} #{self.name_last}\"\n end",
"title": ""
},
{
"docid": "264a7dffb7b908d610350577d373da47",
"score": "0.771091",
"text": "def full_name\n \"#{last_name} #{first_name}\"\n end",
"title": ""
},
{
"docid": "264a7dffb7b908d610350577d373da47",
"score": "0.771091",
"text": "def full_name\n \"#{last_name} #{first_name}\"\n end",
"title": ""
},
{
"docid": "264a7dffb7b908d610350577d373da47",
"score": "0.771091",
"text": "def full_name\n \"#{last_name} #{first_name}\"\n end",
"title": ""
},
{
"docid": "c8ac62d1ef748770850408e4fd5c86f8",
"score": "0.7709962",
"text": "def full_name\n self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "c8ac62d1ef748770850408e4fd5c86f8",
"score": "0.7709962",
"text": "def full_name\n self.first_name + \" \" + self.last_name\n end",
"title": ""
},
{
"docid": "e95ea37591ef66f106c9d5ba390907dc",
"score": "0.7705027",
"text": "def proper_name\n first_name + \" \" + last_name\n end",
"title": ""
},
{
"docid": "e95ea37591ef66f106c9d5ba390907dc",
"score": "0.7705027",
"text": "def proper_name\n first_name + \" \" + last_name\n end",
"title": ""
},
{
"docid": "e95ea37591ef66f106c9d5ba390907dc",
"score": "0.7705027",
"text": "def proper_name\n first_name + \" \" + last_name\n end",
"title": ""
},
{
"docid": "e95ea37591ef66f106c9d5ba390907dc",
"score": "0.7705027",
"text": "def proper_name\n first_name + \" \" + last_name\n end",
"title": ""
},
{
"docid": "c3c69d5cd03dcc613491abaa2d8b7e9c",
"score": "0.770415",
"text": "def full_name\n self.first_name + \"\" + self.last_name\n end",
"title": ""
},
{
"docid": "1de9b01d9da7a0b89d397f8da5edfdf6",
"score": "0.7702573",
"text": "def full_name\n return \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "1de9b01d9da7a0b89d397f8da5edfdf6",
"score": "0.7702573",
"text": "def full_name\n return \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "590d59b706015096fd8d0ed30978046a",
"score": "0.7697233",
"text": "def full_name\n \"#{self.name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "2aab4da1dc241801a2f5f13dd4413e0a",
"score": "0.76969826",
"text": "def full_name_first_last\n return self.first_name unless (self.last_name.length > 0)\n return (self.first_name + \" \" + self.last_name)\n end",
"title": ""
},
{
"docid": "338834fa53a94953c4645893e2b7ff6c",
"score": "0.7696087",
"text": "def full_name\n last_name + ', ' + first_name\n end",
"title": ""
},
{
"docid": "35f115456f7f9fa03bbacc45349bdc67",
"score": "0.7695302",
"text": "def full_name\n if self.first_name.present? && self.last_name.present?\n \"#{self.first_name} #{self.last_name}\"\n end\n end",
"title": ""
},
{
"docid": "48c9733519b2ecf327cabc3b9ab2b028",
"score": "0.7694789",
"text": "def name \r\n \"#{first_name} #{last_name}\"\r\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
},
{
"docid": "6c4cd2697a57b8d7e3b3752df922df71",
"score": "0.76860404",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end",
"title": ""
}
] |
58673ec821708a98726b042f4b89dd4a
|
haal de probabiliteitsdistributie voor groepen van
|
[
{
"docid": "fc86231922285dd884e0f4b416f5082f",
"score": "0.0",
"text": "def initialize(stap=5,aantal=34)\n @stap = stap\n @monte_carlos = []\n aantal.times do |x|\n van = x*stap\n tot = (x+1)*stap-1\n @monte_carlos[tot] = MonteCarlo.from_db(van,tot)\n end\n end",
"title": ""
}
] |
[
{
"docid": "a109d40e61eddab77a4cd8ccc5e2b041",
"score": "0.66280544",
"text": "def crearProbabilidad\n @probabilidad.clear\n sumaFitness = @fitness.inject {|sum,x| sum+=x }\n @fitness.each do |fitnes|\n @probabilidad << fitnes / sumaFitness\n end\n index=1\n @qsubm.clear\n @probabilidad.each do\n @qsubm << sumarCant(index,@probabilidad)\n index+=1\n end\n end",
"title": ""
},
{
"docid": "2a7fee304201c0889c16897c5c32f55c",
"score": "0.6625033",
"text": "def crearProbabilidad\n @probabilidad.clear\n sumaFitness = @fitness.inject {|sum,x| sum+=x }\n @fitness.each do |fitnes|\n @probabilidad << fitnes / sumaFitness\n end\n index=1\n @qsubm.clear\n @probabilidad.each do\n @qsubm << sumarCant(index,@probabilidad)\n index+=1\n end\n end",
"title": ""
},
{
"docid": "8e2b2420f46f088808a28d016010871c",
"score": "0.6103107",
"text": "def generar_comites(agrupacion)\n @comites = []\n @cant_comites.times do \n comite=[]\n agrupacion.each do |k,v|\n if agrupacion[k] > 0\n comite << k \n agrupacion[k]= agrupacion[k] -1\n end\n end\n @comites << comite\n end\n end",
"title": ""
},
{
"docid": "148f60a042dd217cb95c01b52f95e14a",
"score": "0.6001112",
"text": "def p_of_child_allele(total_d, total_z, total_r, type_of_child)\n prob = 0\n @mating_options.each do |key, value|\n prob += @p[type_of_child][key] * value\n end\n prob\nend",
"title": ""
},
{
"docid": "ad74f6e41ce386742852d25f9fafb91f",
"score": "0.5971514",
"text": "def distribute_non_genpop_priority_appeals\n eligible_judges.map do |judge|\n Distribution.create!(judge: User.find(judge.id), priority_push: true).tap(&:distribute!)\n end\n end",
"title": ""
},
{
"docid": "f7c8717a1b20632be2dfb2b7531cf69a",
"score": "0.5958738",
"text": "def evaluate_diversity()\n #Actualiza el valor de la diversidad de todos los cromosomas\n @maxnum_chromosome.times do |i|\n #Cuantos elemento en la poblacion tienen el fitness del cromosoma i\n @population[i].set_diversity = @population.count{ |x| x.get_fitness == @population[i].get_fitness}\n #El valor minimo entre el fitness y la diversity este dividido por la generacion\n #este es una especie de costo beneficion, por que la mejora que me produce o bien\n #sea la aptitud o la diversidad (minimo entre estos), dividido el costo que he generado\n #para llegar a este valor (generacion)\n @population[i].set_mixfitness = [@population[i].get_fitness, @population[i].get_diversity].min / @generation\n end\n end",
"title": ""
},
{
"docid": "1bb35e05176bf517fb270821ed800f01",
"score": "0.59168607",
"text": "def objective\n objective = {}\n @inclusion_composers.each do |weight,weighted_sets|\n weighted_sets.each do |set|\n cycler = (weight.is_a?(Range) ? weight : [weight]).cycle\n set.to_lp_vars.shuffle.each do |var|\n w = cycler.next\n objective[var] ||= 0\n objective[var] += w\n end\n end\n end\n objective\n end",
"title": ""
},
{
"docid": "1a194706d6339a92d2a3c90f0023d1a6",
"score": "0.5849592",
"text": "def distribute_genpop_priority_appeals\n eligible_judge_target_distributions_with_leftovers.map do |judge_id, target|\n Distribution.create!(\n judge: User.find(judge_id),\n priority_push: true\n ).tap { |distribution| distribution.distribute!(target) }\n end\n end",
"title": ""
},
{
"docid": "eb5652147009dc978c2b36d3116dd778",
"score": "0.583436",
"text": "def generaPoblacion\n @poblacionNueva = Array.new\n numberOfGroups = 2\n sizeOfGroups = @poblacion/numberOfGroups\n usingFullMethod = sizeOfGroups / 2\n usingGrowMethod = usingFullMethod\n for i in 1..numberOfGroups\n for j in 1..sizeOfGroups\n if j <= usingFullMethod then\n if (i == 1) then\n individuo = Individuo.new(@minDepth,newMaxDepth)\n individuo.fullMethod\n @poblacionNueva << individuo\n else\n individuo = Individuo.new(@maxDepth,newMaxDepth)\n individuo.fullMethod\n @poblacionNueva << individuo\n end\n else\n if (i == 2) then\n individuo = Individuo.new(minDepth,newMaxDepth)\n individuo.growMethod\n @poblacionNueva << individuo\n else\n individuo = Individuo.new(maxDepth,newMaxDepth)\n individuo.fullMethod\n @poblacionNueva << individuo\n end\n end\n end\n end\n # Preparo los folders y sus archivos para \n # las batallas\n prepareFolders\n # Evaluo la poblacion inicial\n evaluaPoblacion\n # Estadisticas que indican como va el algoritmo.\n print \"Fitness de la generacion: \"\n print @evaluacionNueva\n print \" ---- Generacion: \"\n print @generacion\n end",
"title": ""
},
{
"docid": "706ff0daf7ce2547cf09ef8a376b75b8",
"score": "0.5807333",
"text": "def compute_distribution\n self.distribution_avg_weight = {}\n self.distribution_deviation = {}\n if is_choice_exclusive\n choices.collect do |choice|\n delta_weight([choice]).each do |pidurl, product_weight|\n compute_distribution_bis(pidurl, product_weight * choice.proba_ok)\n end\n end\n else\n l = choices.clone\n Array.combinatorial(l, false) do |combination_choices|\n # combination is a list of choices\n choice_probability = l.inject(1.0) { |x, c| x *= (combination_choices.include?(c) ? c.proba_ok : c.proba_ko) }\n delta_weight(combination_choices).each do |pidurl, product_weight|\n compute_distribution_bis(pidurl, product_weight * choice_probability)\n end\n end\n end\n distribution_deviation.each { |pidurl, weights| distribution_deviation[pidurl] = weights.stat_standard_deviation }\n end",
"title": ""
},
{
"docid": "23dad741dfe4daaef7cc247f27a68909",
"score": "0.5694795",
"text": "def distribute(m, n)\n # distribute m candies to n children, as easily as possible\n # iterate through n times, adding 1 to each element in this new return array, subtracting one from m, until m == 0\n distributions = []\n n.times do\n \n end\nend",
"title": ""
},
{
"docid": "2dde00f5e4c378582c33a99240d1e825",
"score": "0.56409776",
"text": "def prob_rv_gv\n rv = @uspec_rv.first\n gv = @uspec_gv.first\n\n distr = @pspace.uniq_vals(rv).flat_map do |rv_val|\n #puts \"rv | gv : #{rv.to_s} | #{@gv.to_s}\"\n\n [rv_val, Ps.rv(rv.to_sym => rv_val).given(gv.to_sym).prob]\n end\n Hash[*distr]\n end",
"title": ""
},
{
"docid": "242fd9e98662eed7b09c5a65081e1dc8",
"score": "0.5628052",
"text": "def mmpi_prods p\n a = p.split(//) \n prods = [] \n (1..a.size-6).each do |i|\n (i+1..a.size-5).each do |j|\n prod = a[j+1..a.size-1].join.to_i\n prods << prod if a[0..i].join.to_i * a[i+1..j].join.to_i == prod\n end\n end\n prods\n end",
"title": ""
},
{
"docid": "c990aac8141f39c0a2eccbfc5c2ff4b3",
"score": "0.55809444",
"text": "def perm; end",
"title": ""
},
{
"docid": "a314a1d033fc13fa3250913212b89b8a",
"score": "0.54613864",
"text": "def in_produkte_mit_gesamt_bestellwert()\r\n # TODO\r\n hash = Hash.new()\r\n @kasse.each_value do|produkt_hash|\r\n produkt_hash.each do |name, anzahl_preis|\r\n !hash.key?(name) ? (hash[name] = anzahl_preis[1]) : (hash[name] += anzahl_preis[1]) #anzahl_preis[1] : Gesamte_Preis\r\n end\r\n end\r\n return hash #wichtig , sonst return @kasse, Fehler!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n # all_produ = {}\r\n # for produkt in alle_produkte()\r\n # sum = 0\r\n # @kasse.each(){|nr, bestel| bestel.each {|elem| sum += elem[1][1]*elem[1][0] if elem[0].eql?(produkt) }}\r\n # all_produ[produkt] = sum\r\n # end\r\n # return all_produ\r\n end",
"title": ""
},
{
"docid": "edabfbe126431d108ced96df508cb105",
"score": "0.5459547",
"text": "def distribute population\n\t\thowManyGroups=population.size / @groupSize\n\t\tif howManyGroups > @amountGroups\n\t\t\thowManyGroups=@amountGroups\n\t\tend\n\t\t \n\t\t@arrayGroups=Array.new\n\t\thowManyGroups.times do\n\t\t\tgroup=Group.new @groupSize\n\t\t\t@groupSize.times do\n\t\t\t\tpos=rand(population.size)\n\t\t\t\tgroup.add population[pos]\n\t\t\t\tpopulation.delete_at pos\n\t\t\tend\n\t\t\t@arrayGroups << group\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c3cf384d3f1edf55624e2228044d8305",
"score": "0.54308355",
"text": "def probabilities\n values = (Array(WeightedHash.new(weighted_scalars)) + children).reduce(:+).to_hash\n end",
"title": ""
},
{
"docid": "e18e99822bf2ff46b6aad7b577a8f87c",
"score": "0.5426948",
"text": "def evaluate(pool, genNum)\n\n\t# Define submethod to compare arrays item by item and tally score\n\t# as a percentage, ouput score and percentage\n\tdef compare(seq1, seq2)\n\t\tscore = 0\n\t\tpercentScore = 0.0\n\t\tcompareCount = -1\n\t\tseq1.each_index do |x|\n\t\t\tif seq1[x] == seq2[x]\n\t\t\t\tscore += 1\n\t\t\tend\n\t\tend\n\t\tif score >= 1 then\t\t\t\t# Convert score to percentage\n\t\t\tscore = seq1.length.to_f / score.to_f\n\t\t\treturn percentScore = 100.0 / score\n\t\telse\n\t\t\treturn percentScore = 0.0\n\t\tend\n\tend\n\t\n\tgenSwapPool = []\n\trelativeFitness = []\n\tpool.each_index do |seqnum|\n\t\trelativeFitness[seqnum] = compare($sequenceMaster, pool[seqnum])\n\t\tgenSwapPool[seqnum] = relativeFitness[seqnum], pool[seqnum]\n\tend\n\t\n\t# Sort by scores then display sequences and scores with parents *'s\n\tputs \"Generation (\" + genNum.to_s + \") Sequences: \"\n\tgenSwapPool = genSwapPool.sort.reverse\n\tgenSwapPool.each_with_index do |x, i| \n\t\tsequenceDisplayNum = i + 1\n\t\tif i <= 8\t\t# Format Reference Numbers correctly\n\t\t\tif i <= $parentSize\n\t\t\t\t\tprint \" \" + sequenceDisplayNum.to_s + \". * \" + x[1].to_s + \\\n\t\t\t\t\t\" \" + x[0].to_s + \" %\\n\"\n\t\t\t\t\t$LastGenParents[i] = x[1]\t\t# Dump sequences into array for crossover\n\t\t\telse\n\t\t\t\t\tprint \" \" + sequenceDisplayNum.to_s + \". \" + x[1].to_s + \\\n\t\t\t\t\t\" \" + x[0].to_s + \" %\\n\"\n\t\t\tend\n\t\telse\n\t\t\tif i <= $parentSize\n\t\t\t\t\tprint sequenceDisplayNum.to_s + \". * \" + x[1].to_s + \" \" + \\\n\t\t\t\t\tx[0].to_s + \" %\\n\"\n\t\t\t\t\t$LastGenParents[i] = x[1]\t\t# Dump sequences into array for crossover\n\t\t\telse\n\t\t\t\t\tprint sequenceDisplayNum.to_s + \". \" + x[1].to_s + \" \" + \\\n\t\t\t\t\tx[0].to_s + \" %\\n\"\n\t\t\tend\n\t\tend\n\tend\n\tgenSwapPool\nend",
"title": ""
},
{
"docid": "761b3d3375e81eee76d2159494a8145b",
"score": "0.5406269",
"text": "def por_carbohidratos\n\t\tc = 0\n\t\ti = 0\n\t\tj = 0\n\t\t@listaGr.each do |gramos|\n\t\t\tgr = gramos\n\t\t\ti = i + 1\n\t\t\t@listaAl.each do |element|\n\t\t\t\tj = j + 1\n\t\t\t\tif (i == j)\n\t\t\t\t\tc = c + gr*element.get_carbohidrato/100\n\t\t\t\tend\n\t\t\tend\n\t\t\tj = 0\n\t\tend\n\t\treturn c\n\tend",
"title": ""
},
{
"docid": "e0a4b81bdd2eed670954e81a4ef458fa",
"score": "0.5392389",
"text": "def required_paper(present)\n side_areas = present.permutation(2).map { |a, b| a * b }\n side_areas.min + side_areas.inject(:+)\nend",
"title": ""
},
{
"docid": "994f3c42fbefd04f9aff029e974e747e",
"score": "0.5390366",
"text": "def save_distribution()\t\t\n\t\t(0..(@buses.length-1)).each do |index|\n\t\t\t@buses[index].add_path_locations(@result_distribution[index]) if @result_distribution[index] != nil\n\t\tend\n\t\t@passengers = []\n\t\t@permutation = []\n\t\t@passenger_permutations = []\n\tend",
"title": ""
},
{
"docid": "7f53d1fd92c540f90088e54c8f9053b9",
"score": "0.53900677",
"text": "def get_goal_importance(escenario)\n\t esc = escenario\n\t escObj = esc.goal_escenario # ES: Escenario de evaluacion de objetivos - EN: Goal Assessment Scenario\n\t procesos = ItProcess.all.order(id: :asc)\n\t pesoObjetivos = (esc.goalsWeight.to_f / 100.to_f).round(3)\n\t # ES: Por cada proceso calcula un valor de la siguiente manera:\n\t # EN: For each process, calculate a value with the process described below:\n\t valores = []\n\n\t # 1. Calcula los valores de P y S, para cada tipo de objetivo, y cada dimension: NO SE CALCULA, SON FIJOS\n\t # 1. Calculate the P and S values, for every type of goal and every dimension: IN THIS CASE REMAINS CONSTANT, NOT CALCULATED\n\n\t # P: 5\n\t # S: 2,5\n\t # N: 0\n\n\t pGlobal = 1.0\n\t sGlobal = 0.5\n\t nGlobal = 0.0\n\n\t # ========================= Objetivos de TI =============================\n\t objsTI = Goal.where(\"goal_type = ? AND scope = ?\", GENERIC_TYPE, IT_GOAL) # ES: Objetivos de TI - EN: IT Goals\n\n\t pFinIT = pGlobal # ES: Valor P - Objetivo de TI - Dimension: Financial - EN: P Value - IT Goal - Dimension: Financial\n\t sFinIT = sGlobal # ES: Valor S - Objetivo de TI - Dimension: Financial - EN: S Value - IT Goal - Dimension: Financial\n\n\t pCusIT = pGlobal # ES: Valor P - Objetivo de TI - Dimension: Customer - EN: P Value - IT Goal - Dimension: Customer\n\t sCusIT = sGlobal # ES: Valor S - Objetivo de TI - Dimension: Customer - EN: S Value - IT Goal - Dimension: Customer\n\n\t pIntIT = pGlobal # ES: Valor P - Objetivo de TI - Dimension: Internal - EN: P Value - IT Goal - Dimension: Internal\n\t sIntIT = sGlobal # ES: Valor S - Objetivo de TI - Dimension: Internal - EN: S Value - IT Goal - Dimension: Internal\n\n\t pLyGIT = pGlobal # ES: Valor P - Objetivo de TI - Dimension: Learning and Growth - EN: P Value - IT Goal - Dimension: Learning and Growth\n\t sLyGIT = sGlobal # ES: Valor S - Objetivo de TI - Dimension: Learning and Growth - EN: S Value - IT Goal - Dimension: Learning and Growth\n\n\t # ========================= Objetivos de Negocio =========================\n\t objsBu = Goal.where(\"goal_type = ? AND scope = ?\", GENERIC_TYPE, B_GOAL) # Objetivos de Negocio\n\n\t pFinBu = pGlobal # ES: Valor P - Objetivo de Negocio - Dimension: Financial - EN: P Value - Business Goal - Dimension: Financial\n\t sFinBu = sGlobal # ES: Valor S - Objetivo de Negocio - Dimension: Financial - EN: S Value - Business Goal - Dimension: Financial\n\n\t pCusBu = pGlobal # ES: Valor P - Objetivo de Negocio - Dimension: Customer - EN: P Value - Business Goal - Dimension: Customer\n\t sCusBu = sGlobal # ES: Valor S - Objetivo de Negocio - Dimension: Customer - EN: S Value - Business Goal - Dimension: Customer\n\n\t pIntBu = pGlobal # ES: Valor P - Objetivo de Negocio - Dimension: Internal - EN: P Value - Business Goal - Dimension: Internal\n\t sIntBu = sGlobal # ES: Valor S - Objetivo de Negocio - Dimension: Internal - EN: S Value - Business Goal - Dimension: Internal\n\n\t pLyGBu = pGlobal # ES: Valor P - Objetivo de Negocio - Dimension: Learning and Growth - EN: P Value - Business Goal - Dimension: Learning and Growth\n\t sLyGBu = sGlobal # ES: Valor S - Objetivo de Negocio - Dimension: Learning and Growth - EN: S Value - Business Goal - Dimension: Learning and Growth\n\n\t # ES: Constantes: FINANCIAL, CUSTOMER, INTERNAL, L_AND_G \n\t # EN: Constants: FINANCIAL, CUSTOMER, INTERNAL, L_AND_G \n\n\t # 2. ES: Por cada objetivo de TI, calcula su nivel de importancia, siguiendo el siguiente proceso:\n\t # Cruza cada objetivo de TI, con cada uno de los objetivos de negocio, y realiza la siguiente operación:\n\t # Importancia del objetivo de negocio = A (Definida en la evaluación del escenario de objetivos)\n\t # Valor de P/S de dicho objetivo de negocio = M (Calculado anteriormente)\n\t # Por cada objetivo de TI, calcula su cruce A*M, y suma el total, dicho valor debe ser promediado:\n\n\t # 2. EN: For each IT goal, calculate its importance level, following the next process:\n\t # Crosses each IT goal, with each business goal, and do the next calculation:\n\t # Business goal importance = A (Defined in the evaluation of the goal assessment scenario)\n\t # P/S value of that business goal = M (Calculated previously)\n\t # For each IT goal, calculate the value A*M, and sum up the total, that value must be averaged:\n\n\t # ES: Calificaciones de ambos tipos de objetivos\n\t # EN: Scores of both types of goals \n\t calsObj = escObj.goal_califications \n\t # ES: Arreglo con los valores parametrizados del nivel de importancia por objetivo de TI\n\t # EN: Array with the parametrized goal importance values per IT goal\n\t nivelesObjTI = [] \n\t # ES: Calificaciones para ese escenario, de los objetivos de TI\n\t # EN: Scores for that scenario, from the IT goals\n\t calsTI = calsObj.select{|c| c.goal.scope == IT_GOAL}\n\t # ES: Calificaciones para ese escenario, de los objetivos de negocio \n\t # EN: Scores for that scenario, from the business goals\n\t calsBu = calsObj.select{|c| c.goal.scope == B_GOAL} \n\n\t # ES: Carga la matriz de relaciones: Objetivos de Negocio VS Objetivos de TI\n\t # EN: Load the relationships matrix: Business Goals VS IT Goals\n\t negocioITMatrix = BusinessGoalItMatrix.all \n\t # ES: Carga la matriz de relaciones: Objetivos de TI VS Procesos\n\t # EN: Load the relationships matrix: IT Goals VS Process\n\t procesoITMatrix = ItGoalsProcessesMatrix.all \n\n\t objsTI.each do |objTI|\n\t # ES: En este valor se irá sumando cada valor del cruce A*M para cada objetivo de TI\n\t # EN: This variable will contain each value of the multiplication A*M for each IT goal\n\t value = 0 \n\n\t objsBu.each do |objBu|\n\t # ES: 2.1 Obtiene la importancia del objetivo de negocio, definida en el escenario\n\t # EN: 2.1 Get the business goal importance, defined in the scenario\n\t cal = calsBu.select{|c| c.goal.id == objBu.id}.first\n\t # ES: Si no se calificó dicho objetivo, queda en 0:\n\t # EN: If that goal wasn't scored, its value is 0:\n\t if cal.nil?\n\t importancia = 0\n\t else\n\t importancia = cal.importance\n\t end\n\n\t # ES: 2.2 Obtiene el valor (P/S), del cruce recien definido:\n\t # EN: 2.2 Get the (P/S) value, according to the goals involved in each iteration\n\t valuePS = negocioITMatrix.select{|m| m.it_goal_id == objTI.id && m.business_goal_id == objBu.id}.first.value\n\t # ES: Asigna el valor, según la dimension del objetivo de negocio:\n\t # EN: Assign the value, according the business goal dimension:\n\t case objBu.dimension\n\t when FINANCIAL\n\t # ES: Asigna su valor, según si es P,S o N\n\t # EN: Assing the value, according if its P,S or N\n\t case valuePS\n\t when 'P'\n\t valuePS = pFinBu\n\t when 'S'\n\t valuePS = sFinBu\n\t when 'N'\n\t valuePS = nGlobal\n\t end\n\t when CUSTOMER\n\t # ES: Asigna su valor, según si es P,S o N\n\t # EN: Assing the value, according if its P,S or N\n\t case valuePS\n\t when 'P'\n\t valuePS = pCusBu\n\t when 'S'\n\t valuePS = sCusBu\n\t when 'N'\n\t valuePS = nGlobal\n\t end\n\t when INTERNAL\n\t # ES: Asigna su valor, según si es P,S o N\n\t # EN: Assing the value, according if its P,S or N\n\t case valuePS\n\t when 'P'\n\t valuePS = pIntBu\n\t when 'S'\n\t valuePS = sIntBu\n\t when 'N'\n\t valuePS = nGlobal\n\t end\n\t when L_AND_G\n\t # ES: Asigna su valor, según si es P,S o N\n\t # EN: Assing the value, according if its P,S or N\n\t case valuePS\n\t when 'P'\n\t valuePS = pLyGBu\n\t when 'S'\n\t valuePS = sLyGBu\n\t when 'N'\n\t valuePS = nGlobal\n\t end\n\t end \n\n\t # ES: 2.3 Calcula el valor A*M, para ese cruce de ese objetivo de negocio:\n\t # EN: 2.3 Claculates the value A*M, according to the goal involved in each iteration:\n\t \n\t # ES: importancia = A, valuePS = M - EN: importance = A, valuePS = M\n\t value+= (importancia.to_f * valuePS.to_f)\n\t end\n\n\t # ES: Como el maximo valor que puede tomar value es 50, pero al promediar y que el maximo sea 5 debe ser 85, se suma 35 deliberadamente:\n\t # EN: As the maximun value that can be assigned is 50, but to guarantee a bounded value with a maximun of 85, sum up 35 deliberately:\n\t value = value + 35\n\n\t # ES: 2.4 Al llegar a este punto, ya tiene el total, simplemente lo agrega al arreglo, en forma de string: ID_Objetivo|Valor Total\n\t # EN: 2.4 At this point, the total have been already calculated, simply add it to the array as a string: Goal_ID|Total_Value\n\t temp = objTI.id.to_s << '|' << value.round(3).to_s\n\t valores.push(temp)\n\t end\n\n\t # ES: 3. Promedia el valor total de cada objetivo de TI, sobre el total de objetivos de negocio que fue los que se cruzaron:\n\t # EN: 3. Average the total value for each IT Goal, over the whole business goals:\n\t valoresPara = []\n\n\t valores.each do |v|\n\t idObj = v.split('|')[0].to_s\n\t val = v.split('|')[1].to_f\n\t valAvg = (val / objsBu.size.to_f).round(3)\n\t newVal = idObj.to_s << '|' << valAvg.to_s\n\t valoresPara.push(newVal)\n\t end\n\n\n\n\t # ES: 4. Por cada proceso, calcula su nivel de importancia, siguiendo el siguiente proceso:\n\t # Cruza cada proceso, con cada uno de los objetivos de TI, y realiza la siguiente operación:\n\t # Importancia del objetivo de TI = I (Definida en la evaluación del escenario de objetivos)\n\t # Valor de P/S de dicho objetivo de TI = N (Calculado anteriormente en el punto 1)\n\t # Nivel de importancia del objetivo de TI, promediado en el punto anterior = Z\n\t # Por cada proceso, calcula su cruce I*N*Z/5, y suma el total:\n\n\t # EN: 4. For each process, calculates its importance level, following the next process:\n\t # Cross each process, with each one of the IT Goals, and performs the next operation:\n\t # IT Goal importance = I (defined in the evaluation of the goal assessment scenario)\n\t # P/S value of that IT Goal = N (Calcualted previously in the point 1)\n\t # IT Goal importance level, averaged in the last point = Z\n\t # For each process, calculate the multiplication I*N*Z/5, and sums up the total:\n\n\n\t # ES: Arreglo que guarda strings con el formato: ID_Proceso|Valor Final\n\t # EN: Array that saves string with the format: Process_ID|Final_Value\n\t valoresFinal = [] \n\n\t procesos.each do |pr|\n\t value = 0\n\n\t objsTI.each do |objTI|\n\t # ES: 4.1 Obtiene la importancia del objetivo de TI, definida en el escenario\n\t # EN: 4.1 Gets the IT Goal importance, defined in the scenario\n\t cal = calsTI.select{|c| c.goal.id == objTI.id}.first\n\t # ES: Si no se calificó dicho objetivo, queda en 0:\n\t # EN: If the goal wasn't scored, the value is 0:\n\t if cal.nil?\n\t importancia = 0\n\t else\n\t importancia = cal.importance\n\t end\n\n\t # ES: 4.2 Obtiene el valor (P/S), del cruce recien definido:\n\t # EN: 4.2 Gets the (P/S) value, with the involved goals of the iteration:\n\t valuePS = procesoITMatrix.select{|m| m.it_goal_id == objTI.id && m.process_id == pr.id}.first.value\n\t # ES: Asigna el valor, según la dimension del objetivo de negocio:\n\t # EN: Assigns the value, according to the business goal's dimension:\n\t case objTI.dimension\n\t when FINANCIAL\n\t # ES: Asigna su valor, según si es P,S o N\n\t # EN: Assigns its value, depending on if its P, S or N\n\t case valuePS\n\t when 'P'\n\t valuePS = pFinIT\n\t when 'S'\n\t valuePS = sFinIT\n\t when 'N'\n\t valuePS = nGlobal\n\t end\n\t when CUSTOMER\n\t # ES: Asigna su valor, según si es P,S o N\n\t # EN: Assigns its value, depending on if its P, S or N\n\t case valuePS\n\t when 'P'\n\t valuePS = pCusIT\n\t when 'S'\n\t valuePS = sCusIT\n\t when 'N'\n\t valuePS = nGlobal\n\t end\n\t when INTERNAL\n\t # ES: Asigna su valor, según si es P,S o N\n\t # EN: Assigns its value, depending on if its P, S or N\n\t case valuePS\n\t when 'P'\n\t valuePS = pIntIT\n\t when 'S'\n\t valuePS = sIntIT\n\t when 'N'\n\t valuePS = nGlobal\n\t end\n\t when L_AND_G\n\t # ES: Asigna su valor, según si es P,S o N\n\t # EN: Assigns its value, depending on if its P, S or N\n\t case valuePS\n\t when 'P'\n\t valuePS = pLyGIT\n\t when 'S'\n\t valuePS = sLyGIT\n\t when 'N'\n\t valuePS = nGlobal\n\t end\n\t end\n\n\t # ES: 4.3 Obtiene el valor promediado para ese objetivo de TI:\n\t # EN: 4.3 Get the averaged value for this IT goal:\n\t valuePara = 0.0\n\t valoresPara.each do |v|\n\t idObj = v.split('|')[0].to_i\n\t if idObj == objTI.id\n\t valuePara = v.split('|')[1].to_f\n\t break\n\t end\n\t end\n\n\n\n\t # ES: 4.4 Calcula el valor I*N*Z, para ese cruce de ese proceso:\n\t # EN: 4.4 Calculates the value I*N*Z, for this crossing of this process:\n\t # ES: importancia = I, valuePS = N, valuePara = Z\n\t # EN: importance = I, valuePS = N, valuePara = Z\n\t valueTemp = (importancia.to_f * valuePS.to_f * valuePara.to_f).round(3)\n\t value+= valueTemp\n\t end \n\t \n\t # ES: Como el maximo valor de la sumatoria I*N*Z es 184,54, a partir de ahi realiza el calculo para acotar los valores de 0-5\n\t # EN: Given that the max value of the operation I*N*Z is 184,54, based on that, execute the calculations to bound the value into a range from 0 to 5\n\t value = ((value.round(3) * 5.0) / 184.54).round(3)\n\t value = value * pesoObjetivos.to_f\n\t # ES: 4.5 Al llegar a este punto, ya tiene el total, simplemente lo agrega al arreglo, en forma de string: ID_Proceso|Valor Total\n\t # EN: 4.5 At this point, the total has beend calculated, simply add it to the array, as a string: Process_ID|Total Value\n\t temp = pr.id.to_s << '|' << value.round(3).to_s\n\t valoresFinal.push(temp)\n\n\t end\n\n\t return valoresFinal\n\t end",
"title": ""
},
{
"docid": "56739a9298ce39b9538fbc9387f944c3",
"score": "0.5382503",
"text": "def initialize (grupo,nombre,proteinas,glucidos,grasas)\n super(nombre,proteinas,glucidos,grasas,[])\n @grupo = grupo\n end",
"title": ""
},
{
"docid": "9d9628369be3feee05020279538e991b",
"score": "0.53741",
"text": "def probability_distribution\n @probability_distribution ||= @results.group_by(&:value).inject({}) do |probabilites, (value, results)|\n probabilites[value] = results.size.to_f / self.size\n probabilites\n end\n end",
"title": ""
},
{
"docid": "9d52afc6addf2dd0c184efdd730f6dc4",
"score": "0.5361612",
"text": "def get_weight_comb(set_size)\n result = self\n 0.upto(set_size - 2) do |i|\n result = result.cproduct self\n end\n #p result\n result.find_all{|e|e.sum > 0}.map{|e|e.to_p}.uniq\n end",
"title": ""
},
{
"docid": "aec1b154f599da23477643d9784faaa3",
"score": "0.5356347",
"text": "def initialize(poblacion,proCruza,proMutacion,maxGeneraciones,individuosTorneo,\n maxDepth,newMaxDepth,competidores)\n # Asignacion de variables importantes para la realizacion del algoritmo.\n @poblacion = poblacion\n @proCruza = proCruza\n @proMutacion = proMutacion\n @maxGeneraciones = maxGeneraciones\n @individuosTorneo = individuosTorneo\n @maxDepth = maxDepth\n @minDepth = 2\n @newMaxDepth = newMaxDepth\n @numberElitismo = 1\n @data = Array.new\n @competidores = competidores\n # Inicializo el conteo de las poblaciones.\n @generacion = 0\n @generacion += 1\n # Genero la primera poblacion.\n generaPoblacion\n # Obtengo el inviduo y sus valores del mejor individuo de la\n # generacion\n getElitismo\n # Imprimo strings en pantalla para saber como va la ejecucion del\n # algoritmo.\n puts \" ----- El mejor individuo de la generacion: \"+ @elitismoFitness.to_s\n # Agrego los valores a la variable global data para las estadisticas\n agregaData\n # Saco la mejor solucion encontrada hasta el momento\n obtenElMejor\n # Intercambio los valores de la vieja generacion por la nueva\n # y me deshago de los valores de la poblacion vieja.\n intercambia\n \n end",
"title": ""
},
{
"docid": "36bf3d8aef3a92644652eee1c08f9d3b",
"score": "0.53462213",
"text": "def build_product_distributions\n Spree::Distributor.all.each do |distributor|\n unless self.product_distributions.find_by_distributor_id distributor.id\n self.product_distributions.build(:distributor => distributor)\n end\n end\n end",
"title": ""
},
{
"docid": "1314dd1ce9c42a405b44f0bbc99b651b",
"score": "0.5338352",
"text": "def split_gratuity\n non_managers = Distribution.get_non_managers(self.id)\n self.gratuity / non_managers.count\n end",
"title": ""
},
{
"docid": "70848773edeee0405c141d48bad4be11",
"score": "0.5335361",
"text": "def Gramos_prot\n\n\t\tr = 0\n n = @alimentos.head\n i = @gramos.head\n\n while !n.nil?\n\n r += ((n.value.proteina)*(i.value/100))\n n = n.next\n i = i.next\n end\n\n return (r).round(2)\n\t\n\tend",
"title": ""
},
{
"docid": "94a53df6e678f6efad311ae903f0302f",
"score": "0.53153014",
"text": "def distributions_for flowcell_id\n raise \"implement distributions_for in sub-class\"\n end",
"title": ""
},
{
"docid": "bd35532ef50583cd1b2e680e6bf0fbde",
"score": "0.52943283",
"text": "def deputy_weight_by_group_gexf\n social_graph = {:nodes => [], :edges => []}\n\n index = {:node => 0, :edge => 0}\n\n Deputy.all.each do |deputy|\n puts \"analysing #{deputy.id} #{deputy.slug} with #{deputy.groups.size} groups\"\n social_graph[:nodes] << {:id => deputy.id.to_f, :label => deputy.slug}\n deputy.groups.each do |group|\n puts \"max edges #{group.deputies.size}\"\n group.deputies.reject{|other_deputy| deputy == other_deputy}.each do |other_deputy|\n existing_edges = social_graph[:edges].select{|edge| edge[:source] == deputy.id && edge[:target] == other_deputy.id}\n unless existing_edges.empty?\n existing_edges.each{|edge| edge[:weight] += 1.0}\n else\n social_graph[:edges] << {:id => index[:edge], :source => deputy.id.to_f, :target => other_deputy.id.to_f, :weight => 1.0}\n index[:edge] += 1\n end\n end\n end\n end\n\n return generate_gexf(social_graph)\n end",
"title": ""
},
{
"docid": "88140f5fa59531f46557512632c336e3",
"score": "0.5265736",
"text": "def gu_game(size, p1, p2, p3, p4, e1, e2, e3, e4, alpha, num_modules)\n g = Network.new\n num_modules.times { |i| g.cluster!(i) }\n g.node!(0, 0)\n g.node!(1, 0)\n g.edge!(0, 1)\n\n sum = 0 \n event_prob_acc = [p1, p2, p3, p4].map { |x| sum += x; sum }\n while g.size < size\n event = choose_random_acc(event_prob_acc, [:p1, :p2, :p3, :p4])\n case event\n when :p1\n v = g.node!(g.size, pick(g.clusters))\n e1.times do\n w = choose_with_mbpa(g, v, alpha)\n g.edge!(v, w) if w\n end\n when :p2\n e2.times do\n v = pick(g.nodes)\n w = choose_with_mbpa(g, v, alpha)\n g.edge!(v, w) if w\n end\n when :p3\n e3.times do\n v = pick(g.nodes)\n edge = pick(v.out_edges) # XXX out_edges or edges?\n if edge\n w = choose_with_mbpa(g, v, alpha) \n g.remove_edge(edge)\n g.edge!(v, w) if w\n end\n end\n when :p4\n e4.times do\n edge = pick(g.edges)\n g.remove_edge(edge) if edge\n end\n end \n end\n return g\nend",
"title": ""
},
{
"docid": "9f1f07798e048deffa15e756f2a91f5d",
"score": "0.52529204",
"text": "def proctition_platinum(a, *prcs)\n h = {}\n testing = a\n\n prcs.each_with_index do |p, i|\n are_true = testing.select {|e| p.call(e)}\n to_save = are_true.difference(h.values) \n h[i+1] = to_save\n testing = testing.difference(to_save) # going forward only test values which haven't yet been saved\n end\n h\nend",
"title": ""
},
{
"docid": "d842339575d5638f2543f16b9002d3e5",
"score": "0.525032",
"text": "def possible_groups_for_product(product)\n Group.order(:name) - Group.joins(:product_group_portfolios).where(:product_group_portfolios => {:product_id => product.id, :portfolio_id => self.id}).uniq\n end",
"title": ""
},
{
"docid": "b102ebb550c2620dacbe1555a3aa5d99",
"score": "0.52360123",
"text": "def kriz(druhej)\n for i in (0..@promenne.size-1) do\n if (rand(10) > 4)\n @promenne[i] = @promenne[i]\n else\n @promenne[i] = druhej.promenne[i]\n end\n end\n self\n end",
"title": ""
},
{
"docid": "3b803db3b383be66666e3c30f425eff9",
"score": "0.52347714",
"text": "def switch(prob)\n prob.dep do |s|\n s_ = ($doors - [s[:selected], s[:open]]).map do |d|\n {:open => s[:open], :selected => d, :prize => s[:prize]}\n end\n uniform s_\n end\nend",
"title": ""
},
{
"docid": "4ed31cf3863645441c38fc1a4734318e",
"score": "0.5234656",
"text": "def promedios\n listapromedios = {}\n lista_nomnot = lista_notas\n lista_nomnot.each do |elem|\n nombre = elem[0]\n notas = elem.select { |num| elem.find_index(num) != 0 && num != 'A' }\n notas = notas.map(&:to_i)\n promedio = notas.sum / notas.count\n listapromedios[nombre] = promedio\n end\n escribir_archivo(listapromedios)\nend",
"title": ""
},
{
"docid": "20771a701fd46f22d04c810c21ab8c1a",
"score": "0.52327967",
"text": "def selection_process\n current_generation_temp = []\n #apply obj func on all params, store score in @current_generation[X][:score]\n @current_generation.each do |chromosome|\n current_generation_temp << {:parameters => chromosome[:parameters], :score => chromosome[:score]}\n end\n # sort @current_generation by objective function score (ASC), replace @current_generation w/ temporary array\n @current_generation = current_generation_temp.sort {|a, b| a[:score] <=> b[:score]}\n # the highest rank is 2.0, generate step_size (difference in rank between each element)\n step_size = 2.0/(@current_generation.length-1)\n # counter to be used when assigning rank\n counter = 0\n # next_generation temporary array, @current_generation is replaced by next_generation after loop\n next_generation = []\n # switch scores with ranks\n @current_generation.each do |chromosome|\n # rank (asc) is the order in which the element appears (counter) times step_size so that the max is 2\n rank = counter * step_size\n next_generation << {:parameters => chromosome[:parameters], :score => rank} if rank >= 1.0\n next_generation << {:parameters => chromosome[:parameters], :score => rank} if rank >= 2.0\n next_generation << {:parameters => chromosome[:parameters], :score => rank} if rand <= rank.modulo(1)\n counter += 1\n end\n # if population is too small\n while next_generation.length < @population_size\n select_chromosome = next_generation.sample(1)[0]\n next_generation << select_chromosome\n end\n while next_generation.length > @population_size\n select_chromosome_index = next_generation.index(next_generation.sample(1)[0])\n next_generation.delete_at(select_chromosome_index)\n end\n # sort @current_generation by objective function score (ASC), replace @current_generation w/ temporary array\n @current_generation = next_generation.sort {|a, b| a[:score] <=> b[:score]}\n return\n end",
"title": ""
},
{
"docid": "c99518ff5f740e208e91e295d808fb3f",
"score": "0.5220334",
"text": "def applicants_per_job_distribution(total_resumes)\n max = (Math.log(total_resumes) / 1.5) + 1\n\n dist = (1..max).to_a.map do |num|\n [num, probability_of_resume_pool_size(max, num)]\n end\n\n Hash[dist]\n end",
"title": ""
},
{
"docid": "dba3870d8f21d2d02c3c2044af51e032",
"score": "0.5208068",
"text": "def getprob()\n\t\tprobability = []\n\t\t'''Returns a probability list of all items in its argument'''\n\t\t@@occur.each{|i| probability << (i*1.0/@@outcome.size).round(4)}\n\n\t\treturn probability\n\tend",
"title": ""
},
{
"docid": "9e689e5c7a83bdc89b07851a62e4eb34",
"score": "0.52009",
"text": "def initialize probabilidades\n if probabilidades.empty? then\n raise \"Debe existir al menos un elemento\"\n else\n srand(SEMILLA)\n @probs = Hash.new\n @probs = probabilidades\n self.calcular_probs\n @arreglo = @probs.values\n\n end\n end",
"title": ""
},
{
"docid": "3414b30c85aa1ae19aee405cd0949ddc",
"score": "0.5192245",
"text": "def bus_distribution (culling_cost=nil)\n\t\tif @passengers.length == 0\n\t\t\t#do nothing\n\t\telsif @buses.length == 1 && @passengers.length > 0 \n\t\t\tsort\n\t\t\t@result_distribution = @array_pathes\n\t\t\treturn\n\t\telse\n\t\t\tif @passengers.length % @buses.length == 0\n\t\t\t\tevenly_distributed_num = @passengers.length / @buses.length\n\t\t\telse\n\t\t\t\tevenly_distributed_num = @passengers.length / @buses.length + 1\n\t\t\tend\n\t\t\tprocessing_passengers = @passengers.dup\n\t\t\tpassenger_permutation(processing_passengers)\n\t\t\tlowest_cost = (2**(0.size * 8 -2)-1) #system Max\t\t\t\n\t\t\t@passenger_permutations.each do |array_passengers|\n\t\t\t\tarray_paths = Array.new\n\t\t\t\tcost = 0\n\t\t\t\t#the reason of reverse: we want the new bus get the load\n\t\t\t\t@buses.reverse_each do |bus|\n\t\t\t\t\tnext if cost > lowest_cost\n\t\t\t\t\tif (culling_cost != nil)\n\t\t\t\t\t\t@culling_cost = culling_cost\n\t\t\t\t\telse\n\t\t\t\t\t\t@culling_cost = (2**(0.size * 8 -2)-1) #system Max\n\t\t\t\t\tend\n\t\t\t\t\tarray_locations = Array.new\n\t\t\t\t\tarray_passengers[0...evenly_distributed_num].each do |passenger|\n\t\t\t\t\t\tif passenger != nil\n\t\t\t\t\t\t\tarray_locations.push(passenger.pick_location)\n\t\t\t\t\t\t\tarray_locations.push(passenger.drop_location)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\tif !array_locations.empty?\n\t\t\t\t\t\tsort_bus(bus, array_locations)\n\t\t\t\t\t\tcost += @culling_cost\n\t\t\t\t\tend\n\t\t\t\t\tif bus.path_locations.length > 1\t\t\t\t\t\t\n\t\t\t\t\t\tcost += find_cost(bus.cur_location, bus.path_locations, (1...bus.path_locations.length).to_a)\t\t\t\t\t\t\n\t\t\t\t\telsif bus.path_locations.length == 1\t\n\t\t\t\t\t\tcost += 1\n\t\t\t\t\tend\t\t\t\t\n\t\t\t\t\tarray_passengers = array_passengers - array_passengers[0...evenly_distributed_num]\n\t\t\t\t\tarray_paths << array_locations\n\t\t\t\tend\n\t\t\t\tif lowest_cost > cost\n\t\t\t\t\tlowest_cost = cost\n\t\t\t\t\tculling_cost = cost\n\t\t\t\t\t#since we add the array reversely\n\t\t\t\t\t@result_distribution = array_paths.reverse.dup\n\t\t\t\telse\n\t\t\t\t\tarray_paths = [] #we only want the cheapest, this isn't, so clear out\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "28871b3b7fb2ad4af1a325a277956320",
"score": "0.519069",
"text": "def assignment_problem_cost prob, assignment\n n = prob[:costs].size # assumed square\n n.times.map{|i| prob[:costs][i][assignment[i]]}.inject(:+)\n end",
"title": ""
},
{
"docid": "bf9742c7082e64892c640f91b7d98bb8",
"score": "0.5189669",
"text": "def bests\n \n end",
"title": ""
},
{
"docid": "883ac1e888bf1a44fda847a3adee0f7f",
"score": "0.5187858",
"text": "def show\n @product = Product.find(params[:id])\n\n @components = Component.where(:product_id => @product.id)\n\n @components_materia_prima = @components.joins(:ingredient).where(ingredients: {material_type:'Materia Prima'})\n\n @components_material_empaque_primario = @components.joins(:ingredient).where(ingredients: {material_type:'Material Empaque 1o'})\n\n @components_material_empaque_secundario = @components.joins(:ingredient).where(ingredients: {material_type:'Material Empaque 2o'})\n \n #Calcular el maximo a producir---------- \n # 1. Para cada componente calcular el maximo que se puede producir de acuerdo al stock\n\n # 1.1 Inicializar a un numero muy grande el numero maximo de unidades a producir de dicho producto\n @product.max_units_to_produce = 1000000000\n\n @components.each do |component|\n\n # 2. Dividir el stock actual de cada componente entre lo que se necesita para producir una unidad (tableta o capsula) \n @component_max_units_to_produce = (component.ingredient.stock / component.qty )/ ( @product.number_of_blisters_per_box * @product.number_of_units_per_blister)\n \n # 3. Comparar los componentes y ver cual tienen el numero mas pequeno, ese seria el numero maximo de unidades para el producto.\n if @component_max_units_to_produce < @product.max_units_to_produce\n @product.max_units_to_produce = @component_max_units_to_produce \n @product.production_limited_by = component.ingredient.name \n end\n\n end\n\n # 4. Si el numero maximo no cambiara con respecto al inicial. Dejarlo en \"0\".\n if @product.max_units_to_produce == 1000000000\n @product.max_units_to_produce = 0\n end\n\n @product.save\n\n end",
"title": ""
},
{
"docid": "6bc2ebaba9a2aae07a6f6388e6af097c",
"score": "0.51874614",
"text": "def collyrium_phylacobiosis(paralogism)\n end",
"title": ""
},
{
"docid": "bd5bddb21cb91c02cefd6b68c0485eeb",
"score": "0.5178673",
"text": "def combinaisons\n unless @combinaisons\n # Quelles sont les suites (tierces...) dans la main du joueur ?\n @combinaisons = combiner_par_couleur\n # Quelles sont les séries (brelans...) dans la main du joueur ?\n @combinaisons += combiner_par_valeur\n end\n\n # Renvoie les combinaisons possibles\n @combinaisons\n end",
"title": ""
},
{
"docid": "6a0ce5017dc5448f0cc0a28c99fae8ce",
"score": "0.517675",
"text": "def entity_combinations\n\t\t\t## okay so how does this work exactly.\n\n\t\tend",
"title": ""
},
{
"docid": "7e2ee56f684ffb87bbfa4d152a70511e",
"score": "0.51694024",
"text": "def generate_probability_strategy\n steps_on_which_to_play = []\n @probabilities.each_with_index do |probability, index|\n steps_on_which_to_play << index if @number_generator[] <= probability\n end\n @strategies << L{ |step| steps_on_which_to_play.include? step }\n @strategy_selector = @strategy_select[@strategies]\n end",
"title": ""
},
{
"docid": "7595bd5c390f135d1276170a073b4c52",
"score": "0.5166434",
"text": "def divideConjunto(dicionario)\n if dicionario.length > 1\n # cria subconjunto direito, o esquerdo será o restante do dicionário de entrada\n subconjuntoDireito = {}\n\n prob = 0.0\n maxProb = calcularProbabilidade(dicionario) / 2\n\n # aqui é feita a divisão entre os conjuntos em relação aos pesos\n while prob < maxProb\n ultimaChave = dicionario.keys.last\n if maxProb >= dicionario[ultimaChave] + prob\n subconjuntoDireito[ultimaChave] = dicionario.delete(ultimaChave)\n prob += subconjuntoDireito[ultimaChave]\n else\n prob += dicionario[ultimaChave]\n end\n end\n\n # atribui o valor 0 à esquerda e o valor 1 à direita\n dicionario.each do |chave, valor|\n @codigos[chave] += \"0\"\n end\n subconjuntoDireito.each do |chave, valor|\n @codigos[chave] += \"1\"\n end\n\n # chama recursivamente para cada subconjunto\n divideConjunto(dicionario)\n divideConjunto(subconjuntoDireito)\n end\n end",
"title": ""
},
{
"docid": "8c505e6f4ec1d835579db52fa7b0a86c",
"score": "0.5157538",
"text": "def generate_choices_pidurl2weight(knowledge)\n products = knowledge.products\n choices.each { |choice| choice.generate_pidurl2weight(products, self, knowledge) }\n compute_distribution\n save\n end",
"title": ""
},
{
"docid": "21538e357fcc431f8ce84d66171a4b22",
"score": "0.5147022",
"text": "def prob_rv\n distr = ::Ps.uniq_vals(@uspec_rv).flat_map do |rv_vals|\n spec_rv = Hash[*@uspec_rv.zip(rv_vals).flatten]\n [rv_vals, Ps.rv(spec_rv).prob]\n end\n\n Hash[*distr]\n end",
"title": ""
},
{
"docid": "0ec14e8d0779248deeb22a054323ccb8",
"score": "0.51463914",
"text": "def partitions; end",
"title": ""
},
{
"docid": "84779efe774a7067d07e4749a1100edd",
"score": "0.51367754",
"text": "def prob\r\n self.probability(self.k)\r\n end",
"title": ""
},
{
"docid": "80f0af84a944ec3a2974a32a6266ded5",
"score": "0.51349926",
"text": "def crearProbabilidad(suma, arreglo)\n flotante = suma.to_f\n arreglo_aux = [0] * arreglo.length\n\n for x in 0..(arreglo.length-1)\n arreglo_aux[x] = arreglo[x] / flotante\n end\n return arreglo_aux\nend",
"title": ""
},
{
"docid": "9e5285e7c6f4b81a816935ea2687babb",
"score": "0.51202595",
"text": "def permutation_constraints\n items = (1..@size).to_a.join \", \"\n lines = [\"Set = [#{items}],\"]\n\n 1.upto @size do |n|\n lines << \"permutation(Row#{n}, Set),\"\n lines << \"permutation(Col#{n}, Set),\"\n end\n\n lines.join \"\\n\"\n end",
"title": ""
},
{
"docid": "ba79ab0ae9ca5568a36bce6bd28dfdd6",
"score": "0.5118799",
"text": "def calculate_composite_scores\n self.scores.clear\n self.assignment_submissions.each do |s|\n # we want grades for each component...\n self.configured_modules(nil).each do |m|\n if m.has_evaluation?\n s_obj = self.scores.build({\n :user => s.user,\n :tag => m.tag\n })\n \n if m.author_rubric\n weight = 0.0\n score = 0.0\n AssignmentParticipation.find(:all,\n :joins => [ :assignment_submission ],\n :conditions => [\n 'assignment_submissions.assignment_id = ? AND\n assignment_participations.tag = ? AND\n assignment_participations.user_id = ?',\n self.id, m.tag, s.user.id\n ]).each do |ap|\n if ap.author_eval\n if m.author_rubric.use_trust?\n w = ap.assignment_submission.trust\n else\n w = 1.0\n end\n weight = weight + w\n score = score + w*ap.author_eval_score\n end\n end\n if weight > 0.0\n s_obj.participant_score = score / weight\n end\n end\n if m.participant_rubric\n weight = 0.0\n score = 0.0\n AssignmentParticipation.find(:all,\n :conditions => [\n 'assignment_submission_id = ? AND\n tag = ?',\n s.id, m.tag\n ]).each do |ap|\n if ap.participant_eval\n if m.participant_rubric.use_trust?\n w = self.assignment_submission(ap.user).trust\n else\n w = 1.0\n end\n weight = weight + w\n score = score + w*ap.participant_eval_score\n end\n end\n if weight > 0.0\n s_obj.author_score = score / weight\n end\n end\n s_obj.save\n end\n end\n # now calculate final scores\n s.calculate_score(self.use_trust?)\n end\n end",
"title": ""
},
{
"docid": "61456c130fc9eb26be50d59a5452d15d",
"score": "0.51171046",
"text": "def neediest_buckets\n multipliers = self.needed_multipliers( self._select_all, @wanted_distribution ).to_a\n multipliers.sort! { |a, b| b[1] <=> a[1] } # Sort on multiplier descending\n multipliers.map{ |bucket_name, multiplier| bucket_name }\n end",
"title": ""
},
{
"docid": "131d3adf8adf627f76a3f6d361609ea2",
"score": "0.51110566",
"text": "def calculate_probability\n for i in 0..(@board.rows-1)\n for j in 0..(@board.columns-1)\n\n if @board.get_campo(i,j).isaberto?\n @probability_fields[i][j] = 0.0\n else\n\n neighboors = @board.get_vizinhos(i,j)\n\n # Identify if the neighboor is the first one used in the calcs\n first = true\n\n # for each of the neighboors of the field being verified\n neighboors.each do |field|\n if @board.get_campo(field[:x],field[:y]).isaberto?\n\n number_closed = @board.get_neighboors_closed(field[:x],field[:y]).size\n\n if number_closed > 0\n\n # calculate the probability of the field according to its neighboors\n probability = @board.get_campo(field[:x],field[:y]).vizinhos.to_f() / number_closed\n\n # If the neighboor is the first one verified\n if first\n @probability_fields[i][j] = probability\n first = false\n else\n # if it`s not he first one, calculates the formula: probability of the union of n events\n @probability_fields[i][j] = (@probability_fields[i][j] + probability) - (probability * @probability_fields[i][j])\n end\n\n # break the loop if the probability calculated is 1 or zero\n break if (@probability_fields[i][j] == 1.0) || (@probability_fields[i][j] == 0.0)\n end\n end\n\n end\n end\n \n end\n end\n\n # (Re)calcula a probabilidade para os campos fechados que não possuem nenhum vizinho aberto,\n # assi, dependendo do número de bombas já descobertass e as que faltam\n for i in 0..(@board.rows-1)\n for j in 0..(@board.columns-1)\n field = @board.get_campo(i,j)\n if @board.get_neighboors_opened(i,j).size == 0\n @probability_fields[i][j] = (@board.numero_bombas - @bomb_fields.size).to_f() / @board.get_number_closed()\n end\n end\n end\n\n # Return the field with the smaller probability\n get_smaller_probability\n end",
"title": ""
},
{
"docid": "a0a5b79fc9b6b8740369afec8eec000c",
"score": "0.50984675",
"text": "def derivarPol\n \tif @a.size == 0 \n \t\treturn Polinomio.new([0],\"reales\")\n \telse\n\t\t\ta2 = []\n\t j = 0\n\t\t\tif @b == \"reales\" \t\n\t \t@a.each do |x|\n\t \t\tif (j > 0) \n\t \t\ta2.push(x*j)\n\t \tend\n\t\t \tj = j + 1\n\t \tend \n\t\t \t@a = a2\n\t\t p2 = Polinomio.new(a2,@b)\n\t\t return p2\n\t\t\telsif @b == \"complejos\"\n\t\t\t\t@a.each do |x|\n\t \t\tif (j > 0) \n\t \t\ta2.push(x.multPorEscalar(j))\n\t \tend\n\t\t \tj = j + 1\t\n\t \tend \n\t\t \t@a = a2\n\t\t p2 = Polinomio.new(a2,@b)\n\t\t return p2\n\t\t\tend\n\t\tend\n end",
"title": ""
},
{
"docid": "ea547bf3519b03fc6ba270a006b313ec",
"score": "0.5089093",
"text": "def initialize(*args)\n \tsuper *args\n\n \tself.d1 = @@possible_desires[rand(@@possible_desires.length)]\n \tself.d2 = @@possible_desires[rand(@@possible_desires.length)]\n \tself.proportion = rand(2000)\n \tself.weight = 1\n end",
"title": ""
},
{
"docid": "4a5674bb314ff2c84bcbca8a00fa2a6e",
"score": "0.50846523",
"text": "def pc1\n perm \"\n 57 49 41 33 25 17 9\n 1 58 50 42 34 26 18\n 10 2 59 51 43 35 27\n 19 11 3 60 52 44 36\n 63 55 47 39 31 23 15\n 7 62 54 46 38 30 22\n 14 6 61 53 45 37 29\n 21 13 5 28 20 12 4 \"\n end",
"title": ""
},
{
"docid": "109ca8398553c68f609948d970aac710",
"score": "0.5076337",
"text": "def run\n for i in 1...@maxGeneraciones\n @poblacionNueva = Array.new\n @evaluacionNueva = Array.new\n size = @poblacion/2\n for j in 1..size\n crossover = true\n padre1 = nil\n padre2 = nil\n while (crossover) do\n # Obtengo los padres nuevos.\n padre1 = tournament()\n padre2 = tournament() \n # Si estos se cruzan, entonces genero\n # a sus hijos.\n if (@proCruza > rand) then\n crossover = false\n hijos = padre1.crossover(padre2)\n hijo1 = hijos[0]\n hijo2 = hijos[1]\n end\n end\n \n # Si la mutacion es true, entonces los muto.\n if (@proMutacion > rand) then\n hijo1.mutation\n end\n if (@proMutacion > rand) then\n hijo2.mutation\n end\n # Agrego los hijos a la poblacion nueva.\n @poblacionNueva.push(hijo1)\n @poblacionNueva.push(hijo2)\n end\n # Aumento la generacion de estos\n @generacion += 1\n # Agrego al mejor de la poblacion pasada\n # a esta poblacion.\n setElitismo\n # Se evaluan\n evaluaPoblacion\n # Imprimo estadisticias en la terminal.\n print \"Fitness de la generacion: \"\n print @evaluacionNueva\n print \" ---- Generacion: \"\n print @generacion\n # Obtengo al mejor de la generacion.\n getElitismo\n puts \" ----- El mejor individuo de la generacion: \"+ @elitismoFitness.to_s\n # Si se genero una solucion mejor entonces la guardo, si no\n # no hago nada.\n obtenElMejor\n # Agrego los datos a las estadisiticas\n agregaData\n # Intercambio las poblaciones para hacer otra iteracion.\n intercambia\n end\n # Genero el codigo de la mejor solucion\n # para guadar el .java y tambien para\n # compilarlo.\n tree = JSON.parse(@elMejor,:max_nesting => false)\n individuo = Individuo.new(@elMejorDepths[0],@elMejorDepths[1])\n individuo.tree = tree\n decode = Decode.new(individuo,\"Mejor\")\n decode.decode\n javaCode = decode.javaExpresion\n file = File.open(\"robots/Mejor/Mejor.java\",\"w+\")\n file.write(javaCode)\n file.close\n compileString = \"javac -classpath libs/robocode.jar robots/Mejor/Mejor.java\"\n system(compileString)\n puts \"El mejor Robot se obtubo en la generacion: \" + @generacionElMejor.to_s\n puts \"El codigo del robot esta en la carpeta robots/Mejor/Mejor.java\"\n puts\n puts \"Para correr las batallas con cada competidor, debe de ejecutar los siguientes\\n\n comandos por separado para ver cada batalla\"\n for i in 0...@competidores.size\n puts \"java -classpath libs/robocode.jar robocode.Robocode -battle battles/Mejor\"+(@competidores[i].delete(\" \"))+\n \".battle\"\n end\n end",
"title": ""
},
{
"docid": "c2f34c6981eb6f1aa584acfd36dc76ff",
"score": "0.5071738",
"text": "def solution\n sub_per_person + (percent * sub_per_person) + share_of_tax\n end",
"title": ""
},
{
"docid": "c47e8818a1a98bbe500e9bf584c07ba3",
"score": "0.5071067",
"text": "def generateproblems\n # First problem is unique\n # rand(0..1) picks a random problem from type 0 or 1\n # , 0) is the first problem\n types(rand(0..1), 0)\n (2..10).each do |i|\n types(rand(1..8), i)\n end\n end",
"title": ""
},
{
"docid": "102c05e4b3c19243dbf7bbf9a96ec36c",
"score": "0.5069203",
"text": "def get_mejores_precios\n detalles = self.pedido_compra_detalles\n mejores_precios = {}\n # Por cada detalle/componente recorremos todas sus cotizaciones\n detalles.each do |d|\n cotizaciones = d.cotizados # Cotizaciones cotizadas para este componente\n # Seteamos la primera cotizacion como mejor\n mejor_precio_ids = []\n\n mejores_precios[d.id] = []\n if cotizaciones.size > 0\n mejor_precio = cotizaciones[0].costo_unitario\n\n cotizaciones.each do |cotizacion|\n #unless cotizacion.costo_unitario.nil? || cotizacion.costo_unitario == 0\n if cotizacion.costo_unitario < mejor_precio\n mejor_precio = cotizacion.costo_unitario\n mejor_precio_ids = [cotizacion.id]\n elsif cotizacion.costo_unitario == mejor_precio\n mejor_precio_ids.push(cotizacion.id)\n end\n #end\n end\n end\n mejores_precios[d.id] = mejor_precio_ids\n end\n mejores_precios\n end",
"title": ""
},
{
"docid": "0860c3b037176dd7b587f1e6e93666bb",
"score": "0.506704",
"text": "def get_unbalanced_sub_program\n @sub_programs.min_by do |program| \n @sub_programs.count { |p| p.total_weight == program.total_weight }\n end\n end",
"title": ""
},
{
"docid": "8a986d4a0e9f95f7952a8dc257ba0ccd",
"score": "0.5065488",
"text": "def work\n\n hist={}\n best_fitness=1e150\n best_candidate={}\n\n num_computations.times do\n # Tirage des paramètres\n params=random_params @params_ranges\n\n # Setup du calcul\n data_sim[:init_values]=calc_init_data params\n model=evaluator_class.new(data_sim, params)\n\n # Lancement\n model.run\n\n # Exploitation des résultats\n hist[params]=model.numids\n fitness=model.fitness\n\n if fitness < best_fitness\n best_fitness = fitness\n best_candidate=params.dup\n end\n end\n\n [best_fitness, best_candidate, hist]\n end",
"title": ""
},
{
"docid": "49edbcaf7a283657b429d2a1cc841b3a",
"score": "0.5062786",
"text": "def discretize_for_suc\n discretize_by_ChiMerge!(0.10)\n end",
"title": ""
},
{
"docid": "e82a3d1b205ada764fa9af3263622a49",
"score": "0.506105",
"text": "def sched_1\n s_arr = []\n Marshal.load(Marshal.dump(self.courses)).each do |m|\n s_arr.push(m)\n end\n s_des = Marshal.load(Marshal.dump(self.subjects))\n s_out = []\n earliest = s_arr.select {|c| c.user_weight == 1}.sort! {|a,b| a.timeslot <=> b.timeslot}.first\n\n # initial thing\n # warning blah blah\n s_out.push(earliest)\n s_des = s_des - s_des.select {|s| s.casecmp(earliest.name) == 0}\n s_arr.delete(earliest)\n\n\n # conflict resol\n # remove dsmae name\n s_arr = s_arr - s_arr.select {|v| v.name.casecmp(s_out.last.name) == 0}\n self.conflict_resol(s_out.last, s_arr)\n\n #checkers\n #puts \"sched _1\", s_des\n #puts \"s_arr\"\n #s_arr.each do |s|\n #puts s.name, s.timeslot, s.day\n #end\n #puts \"s_out\"\n #s_out.each do |s|\n #puts s.name, s.timeslot, s.day\n #end\n\n # other classes loop\n while s_des.size != 0 and s_arr.size != 0 do\n # get adjacency of each course in s_arr\n s_arr.each do |c|\n c_0 = s_out.select {|v| same_day(v.day, c.day) and v.timeslot + 1 == c.timeslot}.first\n adjacency = location_adj(c.location, c_0 ? c_0.location : c.location)\n c.priority = c.user_weight + adjacency + c.timeslot\n end\n\n # get the one with the lowest p(c, c0)\n top = s_arr.select{|v| v}.sort! {|a,b| a.priority <=> b.priority }.first\n s_out.push(top)\n s_des = s_des - s_des.select {|s| s.casecmp(top.name) == 0}\n s_arr.delete(top)\n\n #conflict\n # remove dsmae name\n s_arr = s_arr - s_arr.select {|v| v.name.casecmp(s_out.last.name) == 0}\n self.conflict_resol(s_out.last, s_arr)\n\n # consecutivity next\n for i in (0..3) do\n subset = s_arr.select {|v| v.day == i}\n if i == 1 or i == 2 then\n subset = subset + s_arr.select {|v| v.day == 4}\n end\n\n #if subset.sort.each_cons(self.breaks).all? {|a,b| b == a+1} then\n #end\n subset = subset.sort! {|a,b| a.timeslot <=> b.timeslot }\n m = subset.size - self.breaks\n for j in (0..m) do\n ssum = subset[j..j+self.breaks-1].map {|v| v.timeslot}.sum\n n = subset[j..j+self.breaks-1].size\n if ssum == (subset[j]-1)*n + n*(n+1)/2 then\n # Remove classes before and after the consecutives\n sub_b = subset.select {|v| v.timeslot = ss.first.timeslot - 1}\n sub_a = subset.select {|v| v.timeslot = ss.last.timeslot + 1}\n s_arr = (s_arr - sub_b) - sub_a\n end\n end\n end\n end\n\n return s_out\n end",
"title": ""
},
{
"docid": "3919eb2c3936ab3568d6f53832e9e4fa",
"score": "0.5058681",
"text": "def distribution\n @distribution\n end",
"title": ""
},
{
"docid": "a025799a272251e03049d67eec312c21",
"score": "0.50524116",
"text": "def generate_ranking_report2\n @batch = @subject.batch\n @students ||= @batch.students\n @exam_groups ||= @batch.result_published\n end",
"title": ""
},
{
"docid": "54f592754491deb6bbd11340a0a12e94",
"score": "0.50471735",
"text": "def production\r\n n = 0\r\n @workers.each do |worker|\r\n pr = 3\r\n pr *= 2 if worker.skills.include? worker.job\r\n n += pr\r\n end\r\n return [@type.good, n]\r\n end",
"title": ""
},
{
"docid": "d968e6d36680a522ed3df28f4599dd4c",
"score": "0.5044942",
"text": "def regimens(weight=nil)\n Regimen.program(program_id).criteria(weight).select('concept_id').includes(:concept).group('concept_id, program_id'\n ).order('regimen_id').map(&:concept)\n end",
"title": ""
},
{
"docid": "126b0f448ee59e536e71d7cb58cbf52e",
"score": "0.50446826",
"text": "def possibilities(aPoss, aSoduku, aColumn, aSquare)\n possNum = 0\n sqNum = 0\n (0..8).each do |row|\n aPoss[row] = []\n (0..8).each do |column|\n aPoss[row][column] = []\n if aSoduku[row][column] == 0\n (1..9).each do |x|\n sqNum = (row/3)*3 + (column/3)\n possNum = addPoss(aSoduku, aColumn, aSquare, row, column, sqNum, x)\n aPoss[row][column] << possNum unless possNum.nil?\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "ce8f619997120077b1d2264289cd86e4",
"score": "0.5042482",
"text": "def group(ppl)\n @all = ppl.sort\n @count = ppl.count\n end",
"title": ""
},
{
"docid": "f60aff2dd308969b889d02abcf798117",
"score": "0.50410765",
"text": "def costs_of_topologies(group_of_four)\n topologies(group_of_four).map { |topology| cost(topology) }\n end",
"title": ""
},
{
"docid": "174fe76ee7fd09322ec28582148e8d40",
"score": "0.503014",
"text": "def porcGrasa\n (1.2 * self.imc + 0.23 * @edad - 10.8 * @sexo - 5.4).round(1)\n end",
"title": ""
},
{
"docid": "f99752d4187541366bedff80f4d7fac1",
"score": "0.5027723",
"text": "def grade_using key\n\t\t\t# Put a list of \"concept - proposition - concept\" triplets on the side\n\t\t\tgenerate_listing\n\n\t\t\t# Count the number of distinct connections in the key for later.\n\t\t\tdistinct_connections = key.number_of_distinct_connections\n\n\t\t\t# Mark the special edges and keep track of the number of missing edges for grading later.\n\t\t\tmark_misplaced_and_extra_edges key\n\t\t\tmissing_edges = mark_missing_edges key\n\n\t\t\t# Put the legend on the map that will be output.\n\t\t\tgenerate_legend\n\n\t\t\t# Calculate the number of correct edges in the student map.\n\t\t\tcorrect = distinct_connections - missing_edges\n\n\t\t\t# In case someone foolishly turned in a map with no edges, handle the grade accordingly.\n\t\t\tif !(distinct_connections == 0)\n\t\t\t\tgrade = (correct.to_f/distinct_connections.to_f) * 100\n\t\t\telse\n\t\t\t\tif correct < 0\n\t\t\t\t\tgrade = 0\n\t\t\t\telse\n\t\t\t\t\tgrade = 100\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tgrade = grade.round\n\n\t\t\t# Put the grade in a node on the map.\n\t\t\tadd_grade_node grade.to_s\n\n\t\t\t# Put the grade to the console.\n\t\t\treturn grade.to_i\n\t\tend",
"title": ""
},
{
"docid": "14cde5eaffb1b85a608f0685a579152c",
"score": "0.5021271",
"text": "def permutation?; end",
"title": ""
},
{
"docid": "22564aebaf169db2e13630c29d7f7137",
"score": "0.50182104",
"text": "def pvalue_distribution\n distrib = RBTree.new { |h,k| h[k] = 0 }\n distances.each do |v|\n distrib[v] += 1\n end\n distrib\n end",
"title": ""
},
{
"docid": "9d2fa60e5d43f1dcabca73501fecb4d8",
"score": "0.5013318",
"text": "def carbohidratos\n aux=@dieta.head\n auxgramos=@gramos.head\n prot=0\n cantotal=0\n for i in 0...@dieta.size\n prot+=aux.value.get_carbohidrato*(auxgramos.value/100)\n cantotal+=(aux.value.get_proteina+aux.value.get_lipidos+aux.value.get_carbohidrato)*(auxgramos.value/100)\n aux=aux.next unless aux.next.nil?\n auxgramos=auxgramos.next unless auxgramos.next.nil?\n end\n return (prot/cantotal)*100\n end",
"title": ""
},
{
"docid": "fb10fb32a479ab2b9b97e41b29e00a51",
"score": "0.5007264",
"text": "def GP(sel_module,crossover_probability=0.75)\n ng_name = sel_module.to_s.gsub(/[^A-Za-z0-9]/,'_')\n Module.new{\n include sel_module.dup\n alias_method ng_name, :next_generation\n define_method(:next_generation){|population|\n send(ng_name,population){|*parents|\n if rand < crossover_probability\n [*parents[0].class.cross(*parents)]\n else\n parents.map{|c| c.mutate }\n end\n }\n }\n self.name= \"GP(#{sel_module.to_s},#{crossover_probability})\"\n }\nend",
"title": ""
},
{
"docid": "8707109a98da4c613849719ead6377f5",
"score": "0.5006475",
"text": "def collapse!(repunits=2)\n @proteins.values.each {|p| p.collapse!(repunits)}\n\t\tupdate_arrangements()\n\t\tself.rewind\n end",
"title": ""
},
{
"docid": "56da382781c97d7e674d36299d25f82f",
"score": "0.5005985",
"text": "def make_it_better distribution\n distribution = sort_distributions distribution\n heaviest_press_jobs = distribution.last.clone\n lightest_press_jobs = distribution.first.clone\n old_heavy_load = distribution_length heaviest_press_jobs\n heaviest_press_jobs.each do |heavy_job|\n lightest_press_jobs.each do |light_job|\n if !(heavy_job == light_job) && !(light_job > heavy_job)\n new_heaviest_press_jobs, new_lightest_press_jobs = change_jobs heaviest_press_jobs.clone, lightest_press_jobs.clone, heavy_job, light_job\n heavy_load = distribution_length(new_heaviest_press_jobs)\n light_load = distribution_length(new_lightest_press_jobs)\n # if there is a better solution then change the values\n if heavy_load < old_heavy_load && light_load < old_heavy_load\n heaviest_press_jobs = distribution.last\n lightest_press_jobs = distribution.first\n heaviest_press_jobs, lightest_press_jobs = change_jobs distribution.last, distribution.first, heavy_job, light_job\n return distribution\n end\n end\n end\n end\n return distribution\n end",
"title": ""
},
{
"docid": "06719a800b6786c7d0f62b6ad2a8dfc1",
"score": "0.4998673",
"text": "def probTo(ant)\n i = ant.tour[@currentIndex]\n\n denom = 0.0\n (0 ... @n).each do |l|\n if (!ant.visited(l))\n #puts \"#{i}, #{l} = #{@graph[i][l]}\"\n d = ant.distance(i, l)\n denom += pow(@trails[i][l], @alpha) * pow(1.0 / d, @beta)\n end\n end\n\n (0 ... @n).each do |j|\n if (ant.visited(j))\n @probs[j] = 0.0\n else\n d = ant.distance(i, j)\n numerator = pow(@trails[i][j], @alpha) * pow(1.0 / d, @beta)\n @probs[j] = numerator / denom\n end\n end\n end",
"title": ""
},
{
"docid": "0e8a7a4e3b961de6100356b41579cfdc",
"score": "0.49967456",
"text": "def gen_scores(prod = false)\n score_percentages = {\n :theme => 20,\n :choreography => 15,\n :technique => 15,\n :presentation => 20,\n :costume => 15,\n :music => 15,\n :violation => 15\n }\n\n scores = {}\n score_percentages.each do |c,p|\n if prod\n scores[c] = 0\n else\n r = Random.rand(0..p)\n scores[c] = r\n end\n end\n\n total = ScoresHelper.total_score(scores)\n scores[:total] = total\n\n scores\nend",
"title": ""
},
{
"docid": "345c6d29478262ceea590774d9d9c1d9",
"score": "0.49956086",
"text": "def proctition_platinum(arr, *procs)\r\n hash = Hash.new \r\n counter = 1\r\n procs.length.times do\r\n hash[counter] = arr.select { |el| procs[counter-1].call(el) && !hash.values.flatten.include?(el) }\r\n counter += 1\r\n end\r\n hash\r\nend",
"title": ""
},
{
"docid": "687dded7cd202c9b1252e142312a03c4",
"score": "0.4992253",
"text": "def groups; end",
"title": ""
},
{
"docid": "687dded7cd202c9b1252e142312a03c4",
"score": "0.4992253",
"text": "def groups; end",
"title": ""
},
{
"docid": "687dded7cd202c9b1252e142312a03c4",
"score": "0.4992253",
"text": "def groups; end",
"title": ""
},
{
"docid": "687dded7cd202c9b1252e142312a03c4",
"score": "0.4992253",
"text": "def groups; end",
"title": ""
},
{
"docid": "687dded7cd202c9b1252e142312a03c4",
"score": "0.4992253",
"text": "def groups; end",
"title": ""
},
{
"docid": "687dded7cd202c9b1252e142312a03c4",
"score": "0.4992253",
"text": "def groups; end",
"title": ""
},
{
"docid": "687dded7cd202c9b1252e142312a03c4",
"score": "0.4992253",
"text": "def groups; end",
"title": ""
},
{
"docid": "687dded7cd202c9b1252e142312a03c4",
"score": "0.4992253",
"text": "def groups; end",
"title": ""
},
{
"docid": "687dded7cd202c9b1252e142312a03c4",
"score": "0.4992253",
"text": "def groups; end",
"title": ""
},
{
"docid": "c0ed764b9aac3e1e6ebeb0c483ad96e6",
"score": "0.49909982",
"text": "def sumaPol(p)\n \taux = p.getArray\n i = 0\n if p.class != Polinomio\n \treturn \"No es un polinomio\"\n\t \texit\n\t\telsif @b == \"reales\"\n \tif p.getGrado >= getGrado\n \t\t@a.each do |x|\n\t \t\t if x != nil\n\t \t\t \t\taux[i] = aux[i] + x\n\t \t\t end\n\t \t\t \ti = i + 1\n\t \t\tend\n\t \t\tp2 = Polinomio.new(aux,@b)\n\t \t\treturn p2\n \telse\n \t\taux.each do |x|\n\t \t \tif x != nil\n\t \t \t\t\t@a[i] = @a[i] + x\n\t \t \tend\n\t\t\t \ti = i + 1\n\t \t\tend\n\t \t\tp2 = Polinomio.new(@a,@b)\n\t \t\treturn p2\n \tend\n\t\telsif @b == \"complejos\"\n\t\t\tif p.getGrado >= getGrado\n \t\t@a.each do |x|\n\t \t\t if x != nil\n\t \t\t \t\taux[i] = aux[i].sumaDeComplejos(x)\n\t \t\t end\n\t \t\t \ti = i + 1\n\t \t\tend\n\t \t\tp2 = Polinomio.new(aux,@b)\n\t \t\treturn p2\n \telse\n \t\taux.each do |x|\n\t \t \tif x != nil\n\t \t \t\t\t@a[i] = @a[i].sumaDeComplejos(x)\n\t \t \tend\n\t\t\t \ti = i + 1\n\t \t\tend\n\t \t\tp2 = Polinomio.new(@a,@b)\n\t \t\treturn p2\n \tend\t\n\t\tend\n end",
"title": ""
},
{
"docid": "3c067fdf865415470be319b6a99bbd39",
"score": "0.4990951",
"text": "def max_profit_assignment(difficulty, profit, worker)\n hworker = Hash.new(0)\n worker.each { |w| hworker[w] += 1 }\n\n d2p = Hash.new(0)\n difficulty.each_with_index do |d, i|\n d2p[d] = [d2p[d], profit[i]].max\n end\n\n difficulty = d2p.keys.sort!\n profit = []\n max_profit = 0\n\n difficulty.each_with_index do |d, i|\n max_profit = [d2p[d], max_profit].max\n profit[i] = max_profit\n end\n\n r = 0\n dsize = difficulty.size\n hworker.keys.each do |k|\n i = (0..dsize - 1).bsearch { |j| difficulty[j] > k } || dsize\n next if i.zero?\n r += profit[i - 1] * hworker[k]\n end\n r\nend",
"title": ""
},
{
"docid": "76f76b7d1e3fe34044f525be5716920e",
"score": "0.49888206",
"text": "def capacity_index\n return @capacity_index if @capacity_index\n\n @capacity_index = {}\n place_index.values.each do |place|\n @capacity_index[place.capacity] ||= []\n @capacity_index[place.capacity] << Set.new([place.id])\n end\n Trixer::Combinator.combinations(adjacency_list: links, objects: place_index.values.map(&:id)).each do |comb|\n comb_capacity = comb.inject(0) { |sum, place_id| sum += place_index[place_id].capacity }\n @capacity_index[comb_capacity] ||= []\n @capacity_index[comb_capacity] << Set.new(comb)\n end\n # sort from smaller combinations to bigger combinations\n @capacity_index.each do |capacity, comb|\n @capacity_index[capacity].sort! do |c1, c2|\n if c1.size == c2.size\n links1 = c1.inject(0) { |sum, place_id| sum += (linksize_index[place_id] || 0) }\n links2 = c2.inject(0) { |sum, place_id| sum += (linksize_index[place_id] || 0) }\n if links1 == links2\n # same amount of links: sort by priority\n c1prio = c1.map { |place_id| place_index[place_id].priority || 100_000 }.min\n c2prio = c2.map { |place_id| place_index[place_id].priority || 100_000 }.min\n c1prio <=> c2prio\n else\n # prioritize cominations with less links\n links1 <=> links2\n end\n else\n c1.size <=> c2.size\n end\n end\n end\n @capacity_index\n end",
"title": ""
},
{
"docid": "6cea1f8908baeb4387913a772559d55d",
"score": "0.49847147",
"text": "def create_matingpool()\n #seleccion por torneo cualquier\n (0..@mating_pool-1).each do |i|\n #Genero una posicion aleatoria\n pos =rand(@maxnum_chromosome)\n #obtengo el cromosoma de la poblacion\n chromosome = @population[pos]\n #Genero una posicion aleatoria\n pos =rand(@maxnum_chromosome)\n if @type_selection == 0\n #Si la aptitud que tengo es mayor pues el\n #me quedo con el cromosoma de menor aptitud\n if chromosome.get_fitness > @population[pos].get_fitness\n chromosome =@population[pos]\n end\n elsif @type_selection ==1\n #Si la diversidad que tengo es mayor pues el\n #me quedo con el cromosoma de menor diversidad\n if chromosome.get_diversity > @population[pos].get_diversity\n chromosome =@population[pos]\n end \n elsif @type_selection==2\n #Si la aptitud mixta que tengo es mayor pues el\n #me quedo con el cromosoma de menor aptitud mixta \n if chromosome.get_mixfitness > @population[pos].get_mixfitness\n chromosome =@population[pos]\n end \n end\n #Lo agrego al matting pool\n @mating_array[i]= chromosome\n end\n if @debug\n puts \"Matting :\\n #{@mating_array}\"\n end\n end",
"title": ""
}
] |
bc36726a995065e77e0270626789f1e9
|
DELETE /setbreaks/1 DELETE /setbreaks/1.json
|
[
{
"docid": "3428f0668aa3a67daf6a58fada6dd085",
"score": "0.5931671",
"text": "def destroy\n @setbreak.destroy\n respond_to do |format|\n format.html { redirect_to controller: :playlist, action: :index }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "2211ade05bb1f35e4860ee364ae3e5fa",
"score": "0.6407492",
"text": "def destroy\n @req_breakdown = ReqBreakdown.find(params[:id])\n @req_breakdown.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_req_breakdowns_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5c8073726a06d0ffae1a402aed12ccf9",
"score": "0.6217735",
"text": "def destroy\n @entry_set = EntrySet.find(params[:id])\n @entry_set.destroy\n\n respond_to do |format|\n format.html { redirect_to entry_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2eaa1618ebc5e51afafd4da034b97d35",
"score": "0.61019284",
"text": "def destroy\n gig = @gig_set.gig\n @gig_set.destroy\n gig.gig_sets.each_with_index do |set, ix|\n set.number = ix + 1\n set.save!\n end\n\n respond_to do |format|\n format.html { redirect_to edit_gig_path(gig) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e414155d81a3211567a9a79ac83a0cc6",
"score": "0.6098912",
"text": "def destroy\n @label_set.destroy\n respond_to do |format|\n format.html { redirect_to label_sets_url, notice: 'Label set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b32d02ae5eecde105216556a31bf16d6",
"score": "0.6070049",
"text": "def destroy\n @frequent_set = FrequentSet.find(params[:id])\n @frequent_set.destroy\n\n respond_to do |format|\n format.html { redirect_to frequent_sets_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7070e4dc3849fac5852c0271c9b6d7cc",
"score": "0.59926736",
"text": "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"title": ""
},
{
"docid": "aae078adb672f8dadccb3a900ecd708c",
"score": "0.5991972",
"text": "def destroy\n @coin_set = CoinSet.find(params[:id])\n @coin_set.destroy\n\n respond_to do |format|\n format.html { redirect_to coin_sets_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3c473e1ac76d39086921bfec197a5672",
"score": "0.59650236",
"text": "def destroy\n @breakdown = Breakdown.find(params[:id])\n @breakdown.destroy\n\n respond_to do |format|\n format.html { redirect_to breakdowns_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e88b542cf11a872fd0f579432d90f9cd",
"score": "0.5962282",
"text": "def destroy\r\n @batch = Batch.find(params[:batch_id])\r\n @batch_set.destroy\r\n respond_to do |format|\r\n format.html { redirect_to @batch, notice: 'Batch set was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "046fa905571cc625acc13fc7ed5e52ad",
"score": "0.59278816",
"text": "def destroy\n @subset.destroy\n respond_to do |format|\n format.html { redirect_to subsets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ff3ab89494792aed0cfc3b1ab68618e0",
"score": "0.59255075",
"text": "def destroy\n @lesson_entryset.destroy\n respond_to do |format|\n format.html { redirect_to lesson_entrysets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f0b5234ffc63b77800291dd9d908108b",
"score": "0.5917564",
"text": "def destroy\n @indicator_set = IndicatorSet.find(params[:id])\n @indicator_set.destroy\n\n respond_to do |format|\n format.html { redirect_to indicator_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ffa074859360dd77b53aa779bce5afe2",
"score": "0.5901342",
"text": "def destroy\n @survey_value_set = SurveyValueSet.find(params[:id])\n @survey_value_set.destroy\n\n respond_to do |format|\n format.html { redirect_to survey_value_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c0f1d298de9aa6107e9b444db1d68265",
"score": "0.58887786",
"text": "def destroy\n @defset.destroy\n respond_to do |format|\n format.html { redirect_to defsets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "13d368611a6b4a1e7695088f3b015559",
"score": "0.5875474",
"text": "def destroy\n @breakdown = Breakdown.find(params[:id])\n @breakdown.destroy\n\n respond_to do |format|\n format.html { redirect_to(breakdowns_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "444f153048577e09d1a55344a40216c9",
"score": "0.5843512",
"text": "def destroy\n contest = @data_set.contest\n @data_set.destroy\n respond_to do |format|\n format.html { redirect_to admin_contest_url(contest), notice: 'Data set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bd0b60b24bdcf4405a5b5f74abdf25e0",
"score": "0.58155495",
"text": "def destroy\n render_json_auto @survey.delete_logic_control_rule(params[:id].to_i) and return\n end",
"title": ""
},
{
"docid": "2b1f5550bf78e3327f7b71898cbfcbd5",
"score": "0.58118176",
"text": "def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(@line.budget) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f6d1ffcd6cbdd78cfd2325307ba6f3e0",
"score": "0.57994264",
"text": "def destroy\n @instruction_set = InstructionSet.get(params[:id])\n @instruction_set.destroy\n\n respond_to do |format|\n format.html { redirect_to instruction_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e013ca16d7230324e64db1b90587f31d",
"score": "0.57673496",
"text": "def destroy\n @uset = Uset.find(params[:id])\n @uset.destroy\n\n respond_to do |format|\n format.html { redirect_to usets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0d29e61f6ef78879e0497862454b46d9",
"score": "0.5761693",
"text": "def destroy\n @cell_set.destroy\n respond_to do |format|\n format.html { redirect_to cell_sets_url, notice: 'Cell set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "76097c7ef4e6b2f94a9a0263d4f036b3",
"score": "0.57567567",
"text": "def destroy\n @rule_set = RuleSet.find(params[:id])\n @rule_set.destroy\n\n respond_to do |format|\n format.html { redirect_to rule_sets_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d79eb685022038067edf664edbb8e575",
"score": "0.5755426",
"text": "def destroy\n @questionset = Questionset.find(params[:id])\n @questionset.destroy\n\n respond_to do |format|\n format.html { redirect_to questionsets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e10b34def4f826157f5aa7555c894272",
"score": "0.5745531",
"text": "def destroy\n @question_set = QuestionSet.find(params[:id])\n @question_set.destroy\n\n respond_to do |format|\n format.html { redirect_to question_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a33ab368407d41277a984b54decf8223",
"score": "0.573388",
"text": "def destroy\n\t\t@data_set = DataSet.find(params[:id])\n\t\t@data_set.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to data_sets_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "db3e579a56d684168c0813a2b155d98e",
"score": "0.57312506",
"text": "def destroy\n @pcc_break_request = PccBreakRequest.find(params[:id])\n @pcc_break_request.destroy\n\n respond_to do |format|\n format.html { redirect_to pcc_break_requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "86692d15f65526b1cea59f73621fabfd",
"score": "0.5711643",
"text": "def destroy\n @date_break = DateBreak.find(params[:id])\n @date_break.destroy\n\n respond_to do |format|\n format.html { redirect_to(date_breaks_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f7857373db672140feceb513466228c5",
"score": "0.5710468",
"text": "def destroy\n @key_set.destroy\n respond_to do |format|\n format.html { redirect_to key_sets_url, notice: 'Key set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.5705961",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "a278711946f2b50f32dee192437c6f9c",
"score": "0.5698294",
"text": "def destroy\n @exercise_set = ExerciseSet.find(params[:id])\n @exercise_set.destroy\n\n respond_to do |format|\n format.html { redirect_to exercise_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fa7fc1bd2a0b98f56c3d4e0f2602fe17",
"score": "0.5694592",
"text": "def destroy\n @key_word_set = KeyWordSet.find(params[:id])\n @key_word_set.destroy\n\n respond_to do |format|\n format.html { redirect_to key_word_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b28ae663b1c895755a9e0db4d205185f",
"score": "0.56893617",
"text": "def destroy\n @resource_breakdown_structure.destroy\n respond_to do |format|\n format.html { redirect_to resource_breakdown_structures_url, notice: 'Resource Breakdown Structure wurde erfolgreich gelöscht' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a0a00d5245c1a8467bb2054c0f1775e3",
"score": "0.56851774",
"text": "def delete_segment_batch(segment_id_array)\n payload = segment_id_array.to_s\n url = \"#{@base_url}/segments_batch\"\n return RestClient::Request.execute(:method => :delete, :url => url, :payload => payload){|response, request, result| response }\n end",
"title": ""
},
{
"docid": "130821c0dddbb488d53e275e8cce1ed1",
"score": "0.5680745",
"text": "def destroy\n @sets_and_rep.destroy\n respond_to do |format|\n format.html { redirect_to sets_and_reps_url, notice: 'Sets and rep was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f93fef6f33af8bb6948f1ea82fdab0e9",
"score": "0.56640697",
"text": "def destroy\n @liftset.destroy\n respond_to do |format|\n format.html { redirect_to liftsets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4b10b4382e6b307a55f55388d17933da",
"score": "0.56522584",
"text": "def destroy\n @wbr_datum = WbrDatum.find(params[:id])\n @wbr_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to wbr_data_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6157637f676b4998b8bf98c3b3f251cf",
"score": "0.56506354",
"text": "def destroy\n @game_set.destroy\n respond_to do |format|\n format.html { redirect_to game_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9134b6f5b3d615dc095683ff2b72d148",
"score": "0.56462044",
"text": "def destroy\n @configuration_set = ConfigurationSet.find(params[:id])\n @configuration_set.destroy\n\n respond_to do |format|\n format.html { redirect_to configuration_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d635151dee47113f0ad6a6ef0b73f89e",
"score": "0.56343806",
"text": "def destroy\n @budget_line.destroy\n respond_to do |format|\n format.html { redirect_to budget_lines_url, notice: 'Budget line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fbc035cc77b3cad2d1f036594d755d95",
"score": "0.5624808",
"text": "def destroy\n \t#chart = Chart.find(params[:chart_id])\n \tchart = Chart.where(\"id = ? AND user_id = ?\", params[:chart_id], current_user.id).limit(1)[0]\n \tdata_set = chart.data_sets.find(params[:id])\n \tdata_set.destroy\n\n respond_with(data_set) do |format|\n format.json { render json: { success: data_set.destroyed? } }\n end\n end",
"title": ""
},
{
"docid": "ff8932c8ec6bef8defca99943e23e879",
"score": "0.56129074",
"text": "def destroy \n @franchise_set = FranchiseSet.find(params[:id])\n @franchise_set.destroy\n\n respond_to do |format|\n format.html { redirect_to franchise_sets_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1b3e37bc38bad31c9b04223ae3a94ee3",
"score": "0.5602919",
"text": "def destroy\n @test_set = TestSet.find(params[:id])\n permitted_to! :destroy, @test_set\n @test_set.destroy\n\n respond_to do |format|\n format.html { redirect_to test_sets_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "846ebc9811354ce2063d78756174954a",
"score": "0.55952466",
"text": "def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end",
"title": ""
},
{
"docid": "731f6ca24e67ec73d31379b648650a57",
"score": "0.5592357",
"text": "def destroy\n @order_break_time.destroy\n respond_to do |format|\n format.html { redirect_to order_break_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b264ab835d78228241bb15e5795b0852",
"score": "0.5582533",
"text": "def destroy\n @data_set.destroy\n\n respond_to do |format|\n format.html { redirect_to(data_sets_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4db8b848cf744c36b95f8e7277940f66",
"score": "0.5576657",
"text": "def delete_workset (token, workset_name)\n Rails.logger.debug \"delete_workset #{workset_name}\"\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::Delete.new(url.request_uri)\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n request.add_field(\"Accept\", \"application/vnd.htrc-workset+xml\")\n response = http.request(request)\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 deleting workset (HTTP #{response.code})\")\n end\n\n end",
"title": ""
},
{
"docid": "a0807cc99e10af2edbb2d8cae8fe4699",
"score": "0.5575859",
"text": "def destroy\n @workout_set = WorkoutSet.find(params[:id])\n @workout_set.destroy\n\n respond_to do |format|\n format.html { redirect_to workout_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5fe2e3295e91c374299bc10ba62f5ac6",
"score": "0.55666876",
"text": "def destroy\n @setlist.destroy\n respond_to do |format|\n format.html { redirect_to setlists_url, notice: \"Setlist was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9b146c3dc4fa743a8c5ec39e9a8e1cdc",
"score": "0.5563591",
"text": "def destroy\n @batting_line = BattingLine.find(params[:id])\n @batting_line.destroy\n\n respond_to do |format|\n format.html { redirect_to batting_lines_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "adc43d5dbfec716d9253bf05a96babca",
"score": "0.55620885",
"text": "def destroy\n @image_label_set.destroy\n respond_to do |format|\n format.html { redirect_to image_label_sets_url, notice: 'Image label set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b5b05dc29ae9996b2ef323e9e37f19f3",
"score": "0.5559915",
"text": "def delete datapoints\n datapoints = [*datapoints]\n datapoints.each do |dp|\n @user.delete \"/users/me/goals/#{@slug}/datapoints/#{dp.id}.json\"\n end\n end",
"title": ""
},
{
"docid": "6a7fc91bad20a29774b5b69dd83b0593",
"score": "0.5554959",
"text": "def destroy\n @monthly_overhead_breakdown_item = MonthlyOverheadBreakdownItem.find(params[:id])\n @monthly_overhead_breakdown_item.destroy\n\n respond_to do |format|\n format.html { redirect_to monthly_overhead_breakdown_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "391d792707af2973cdbe34269b3354f8",
"score": "0.5554797",
"text": "def destroy\n @diseasesubset.destroy\n respond_to do |format|\n format.html { redirect_to diseasesubsets_url, notice: 'Diseasesubset was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "19f61815ef5e40da5be13a5fdf99e932",
"score": "0.55489206",
"text": "def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dd8e5978b59400dfc73d940dbf9d416b",
"score": "0.55441195",
"text": "def destroy\n @poll_options_set = PollOptionsSet.find(params[:id])\n @poll_options_set.destroy\n\n respond_to do |format|\n format.html { redirect_to poll_options_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eda8d0cad950f3dc8ca6212a1ac6a126",
"score": "0.5541305",
"text": "def delete\n Iterable.request(conf, base_path).delete\n end",
"title": ""
},
{
"docid": "ae6170cb5e9d869c48adb0ea5bd8c74d",
"score": "0.5528761",
"text": "def destroy\n @task_set.destroy\n respond_to do |format|\n format.html { redirect_to task_sets_url, notice: 'Task set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2ef23d5333ed2ba2a888db63586c17a6",
"score": "0.5526986",
"text": "def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bd39b54f406bddbfba41bd07b7d05cfe",
"score": "0.5524777",
"text": "def destroy\n @exam_set.destroy\n respond_to do |format|\n format.html { redirect_to exam_sets_url, notice: 'Exam set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b53eb6f24d81bc664d88be0f89db65d8",
"score": "0.55189854",
"text": "def destroy\n @word_set.destroy\n respond_to do |format|\n format.html { redirect_to browse_path, warning: \"Word set deleted.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fa9e3b0825f2bf7926db7efd01c00f3d",
"score": "0.55178016",
"text": "def destroy\n @choice_set.destroy\n respond_to do |format|\n format.html { redirect_to choice_sets_url, notice: 'Choice set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4fb62421c04f9e817c71556662462524",
"score": "0.5514061",
"text": "def destroy\n #@incidentcategory.destroy\n render json: {}, status: 200\n end",
"title": ""
},
{
"docid": "c4d04494b3126c5551083acda1bccd03",
"score": "0.55135024",
"text": "def destroy\n @quantile_setting = QuantileSetting.find(params[:id])\n @quantile_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to quantile_settings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "656d66562c404eb3cb6536780ba0a062",
"score": "0.55118513",
"text": "def destroy\n @setum.destroy\n respond_to do |format|\n format.html { redirect_to seta_url, notice: 'Setum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dccd53ea536e90e65b9719e86b5d3c63",
"score": "0.551127",
"text": "def destroy\n @breakdown = Breakdown.find(params[:id])\n @breakdown.destroy\n\n redirect_to @breakdown.bill\n\n end",
"title": ""
},
{
"docid": "b4cfe0b864d48bddbd285d8baf673e44",
"score": "0.5511102",
"text": "def delete_break_type(id:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::DELETE,\n '/v2/labor/break-types/{id}',\n 'default')\n .template_param(new_parameter(id, key: 'id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'accept'))\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end",
"title": ""
},
{
"docid": "9d847f91b0ef91642d0edd93f2dd2b86",
"score": "0.55008847",
"text": "def destroy\n @mlines = @book.lines.multiple(params[:id])\n @mlines.each {|l| l.destroy}\n respond_to do |format|\n format.html { redirect_to book_multiple_lines_url(@book) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2b030834e07ef2cad8c1db9bfce1db85",
"score": "0.5494134",
"text": "def destroy\n @threshold = Threshold.find(params[:id])\n @threshold.destroy\n\n respond_to do |format|\n format.html { redirect_to thresholds_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1de585f90229df85f395a437f30fe46d",
"score": "0.549224",
"text": "def destroy\n @monthly_revenue_breakdown_item = MonthlyRevenueBreakdownItem.find(params[:id])\n @monthly_revenue_breakdown_item.destroy\n\n respond_to do |format|\n format.html { redirect_to monthly_revenue_breakdown_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b3b8244eaefde319c4e639d04a9f42f2",
"score": "0.5488866",
"text": "def destroy\n Break.end\n respond_to do |format|\n format.html { redirect_to admin_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6a5e87c1d929f14c3969cabf827a235f",
"score": "0.548707",
"text": "def destroy\n @set_list.destroy\n respond_to do |format|\n format.html { redirect_to set_lists_url, notice: 'Set list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0e4a6be83c991f4c58e2dbf8ea1b9863",
"score": "0.5483227",
"text": "def destroy\n @sample_set = SampleSet.find(params[:id])\n @project = Project.find(@project_property.project_id)\n @sample_set.destroy\n respond_to do |format|\n format.html { redirect_to sample_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8afd68ebaea21e7e7bf8a5b85005a36b",
"score": "0.54831576",
"text": "def destroy\n @admin_cron_request.destroy\n respond_to do |format|\n format.html { redirect_to admin_cron_requests_url, notice: I18n.t('admin.cron_requests.destroy.message.success') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9597ba5c0fa37bc5cf787d48e3792d87",
"score": "0.5476815",
"text": "def destroy\n render_json_auto @survey.delete_filter(params[:id].to_i) and return\n end",
"title": ""
},
{
"docid": "7dd98f7fac65cc6ba77007ff3ccc4867",
"score": "0.5473525",
"text": "def destroy\n @therapy_budget.destroy\n respond_to do |format|\n format.html { redirect_to therapy_budgets_url, notice: 'Therapy budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "92b06f73876b817e5025419df7bfdf26",
"score": "0.5467716",
"text": "def destroy\n @setmarkassent = Setmarkassent.find(params[:id])\n @setmarkassent.destroy\n\n respond_to do |format|\n format.html { redirect_to setmarkassents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6c9ee2a9bd2b5fbeb9557cc6e62b7f41",
"score": "0.5467076",
"text": "def destroy\n return if new_record?\n \n @api.delete \"/meetings/#{shortcode_url}.json\"\n end",
"title": ""
},
{
"docid": "ef3e0bb1411142432a49317f5dd0056d",
"score": "0.5461411",
"text": "def destroy\n Clenum.destroy params[:ids].split(',')\n\n respond_to do |format|\n format.html { redirect_to(clenums_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "21d8f4e00afae1956529718d975b7277",
"score": "0.5457667",
"text": "def destroy\n @tourney_set.destroy\n respond_to do |format|\n format.html { redirect_to tourney_sets_url, notice: 'Tourney set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "303283fdd26445d29206ce63f4672733",
"score": "0.54555553",
"text": "def destroy\n @shuttle_run.destroy\n respond_to do |format|\n format.html { redirect_to shuttle_runs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1c0c5d03438d92ac44b07497a3f336f1",
"score": "0.54531944",
"text": "def destroy\n @setquestionlink.destroy\n respond_to do |format|\n format.html { redirect_to setquestionlinks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba67ebd85114998e01be10599c8943ca",
"score": "0.54491585",
"text": "def delete(path)\n RestClient.delete request_base+path\n end",
"title": ""
},
{
"docid": "b2189cb36e64e1026370eb2b2c1475eb",
"score": "0.5446596",
"text": "def destroy\n @questionset.destroy\n respond_to do |format|\n format.html { redirect_to questionsets_url, notice: 'Questionset was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "193dc89c3401c0766af71d6b20d32c94",
"score": "0.54454994",
"text": "def destroy\n @set_detail.destroy\n respond_to do |format|\n format.html { redirect_to set_details_url, notice: 'Set detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "37c4b89e45529604e8fb8a4e3b90a173",
"score": "0.5440616",
"text": "def delete\n # mark each version of the history as deleted, not just the most recent one\n @patient.histories\n .where(original_comment_id: @history.original_comment_id)\n .update_all({ deleted_by: current_user.email, delete_reason: params.permit(:delete_reason)[:delete_reason], updated_at: DateTime.now })\n end",
"title": ""
},
{
"docid": "21552b7948489274c349d4fc3e45b567",
"score": "0.5440519",
"text": "def test_delete\n g = [22058]\n Group.delete(g)\n end",
"title": ""
},
{
"docid": "963f3a976b55db599fafa5037cd74103",
"score": "0.54357916",
"text": "def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "157fe8abaaec5b1279f321e52c86bc71",
"score": "0.54276896",
"text": "def delete!\n Recliner.delete(uri)\n end",
"title": ""
},
{
"docid": "7ae68d48e26e65fdde24fd27805a3ad3",
"score": "0.54252166",
"text": "def destroy\n collection = Collection.find(@mlog_entry[:collection_id])\n @mlog_entry.destroy\n respond_to do |format|\n format.html { redirect_to collection}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "43c2ff45ca6eb0f2059f40dfb8831ca3",
"score": "0.542435",
"text": "def destroy\n @unlimited.destroy\n respond_to do |format|\n format.html { redirect_to unlimiteds_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a5a7d75dd1114530c12d29c47e927b0c",
"score": "0.54186165",
"text": "def destroy\n @climb_datum = ClimbDatum.find(params[:id])\n @climb_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to climb_data_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0c6d554fd812c6e3c8c00e5cfb293799",
"score": "0.54166484",
"text": "def destroy\n @legend.destroy\n respond_to do |format|\n format.html { redirect_to legends_url, notice: 'Legend was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "73d5f8973b9216b458b154bc2a7af51e",
"score": "0.5416622",
"text": "def destroy\n @post_setting.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_index_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6260348f0a1c7fb404460be9b85abc4c",
"score": "0.5413096",
"text": "def destroy\n persister.delete(resource: delete_change_set)\n respond_to do |format|\n format.html { redirect_to data_dictionary_fields_url, notice: 'Metadata field was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4ecde2966824d3e80f53f79af939dd89",
"score": "0.5411966",
"text": "def destroy\n @lookup_set = LookupSet.find(params[:id])\n @lookup_set.destroy\n\n respond_to do |format|\n format.html { redirect_to(lookup_sets_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "02e867b8b430fdf9914084aaa10f17c6",
"score": "0.54118913",
"text": "def destroy\n @cut = Cut.find(params[:id])\n @cut.destroy\n\n respond_to do |format|\n format.html { redirect_to cuts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "903ac6b42b276b5f59d570775131acb7",
"score": "0.5410628",
"text": "def destroy\n @attribute_set.destroy\n respond_to do |format|\n format.html { redirect_to attribute_sets_url, notice: 'Attribute set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8bdc3f06c299be66b716b6825bf4fee0",
"score": "0.5409665",
"text": "def delete_kubernetes_stateful_set_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KubernetesApi.delete_kubernetes_stateful_set ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling KubernetesApi.delete_kubernetes_stateful_set\"\n end\n # resource path\n local_var_path = '/api/v1/kubernetes/StatefulSets/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\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]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"KubernetesApi.delete_kubernetes_stateful_set\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: KubernetesApi#delete_kubernetes_stateful_set\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0e58f46e84e25a56becff0d21b8cf589",
"score": "0.54055613",
"text": "def destroy\n @hit = Hit.find(params[:id])\n @hit.reactions.destroy_all\n @hit.destroy\n\n respond_to do |format|\n format.html { redirect_to hits_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0f1f91cac80ad998289348f0d49bb1c2",
"score": "0.5403528",
"text": "def destroy\n @studentset = Studentset.find(params[:id])\n @studentset.destroy\n\n respond_to do |format|\n format.html { redirect_to studentsets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
96880759bd53d6897f81e98682c903f0
|
'dock' used to store a bike
|
[
{
"docid": "ecd6227017ced9f33c8be464db0ca9f5",
"score": "0.6556323",
"text": "def dock(bike)\n @bike = bike\n end",
"title": ""
}
] |
[
{
"docid": "adb869a6dfc4cabea3881f6bee4d3791",
"score": "0.67328364",
"text": "def dock(bike)\n raise \"Docking station full\" if full?\n\n \t# creates an instance variable that stores the variable bike (instance of bike)\n \tstored_bikes << bike\n end",
"title": ""
},
{
"docid": "fbbfb2ebe372064595af2a17aa98d04d",
"score": "0.6547042",
"text": "def dock(bike)\n # Use an instance variable to store the bike\n # in the 'state' of this instance\n @bike = bike \n end",
"title": ""
},
{
"docid": "ecea25ce921b40f0c6d115d30151c762",
"score": "0.64428115",
"text": "def dock(bike)\n\t\tbikes << bike\n\tend",
"title": ""
},
{
"docid": "cf03c8c8b2c4a89adb472221cb340bfa",
"score": "0.63951904",
"text": "def dock(bike)\n fail 'Docking station full' if full?\n bikes << bike\n end",
"title": ""
},
{
"docid": "b8feb6e21306e6a3bba60dc220de9464",
"score": "0.6298084",
"text": "def bike\n @bike\n end",
"title": ""
},
{
"docid": "5b09d985abfc9b492fb38728e6856af9",
"score": "0.6245941",
"text": "def dock bike\n\t\t# fail \"NO MORE BIKES PLEASE\" if full?\n\t\t# bikes << bike\n\t\tadd_bike bike\n\tend",
"title": ""
},
{
"docid": "14e931a86570392d021fcb8a382755b0",
"score": "0.6179986",
"text": "def dock(bike)\n raise \"Dock is full\" if full?\n @bike_rack.push(@bike)\n @bike = bike\n end",
"title": ""
},
{
"docid": "7ffd5025295f09dea749f057cf9e1194",
"score": "0.61461216",
"text": "def release_bike\n\tBike.new\nend",
"title": ""
},
{
"docid": "66042ac3b4d1242af8e54bb7feaa18fd",
"score": "0.61150724",
"text": "def dock(bike)\n fail \"Dock is at capacity\" if full?\n @docked_bikes << bike\n end",
"title": ""
},
{
"docid": "74eab763de3981fb24b448f7674c1174",
"score": "0.6088136",
"text": "def dock_bike(bike)\n fail 'Docking station full: Cannot accept more than 20 bikes' if full?\n @bikes << bike # array of bikes\n end",
"title": ""
},
{
"docid": "7f28e26afed6260df641a82b7f7766d5",
"score": "0.6041251",
"text": "def initialize\n @bike = nil\n end",
"title": ""
},
{
"docid": "a752155cabdbad3506bde7c25ba4c8c0",
"score": "0.6024325",
"text": "def dock(bike)\n fail \"Dock is at capacity\" unless at_capacity? != true\n @bike = bike\n end",
"title": ""
},
{
"docid": "acf112e480b26caaaf8c89e2d08ad3c0",
"score": "0.5992882",
"text": "def dock(bike)\n fail 'The docking station is full' if @bike\n @bike = bike\n end",
"title": ""
},
{
"docid": "7bb5c24dbf81b1895e86ba6043a5ba1a",
"score": "0.5977915",
"text": "def dock(bike)\n fail \"Dock is at capacity\" if full?\n @bikes_array << bike\n end",
"title": ""
},
{
"docid": "a21f5b9f277c82c629bbad2747064656",
"score": "0.59675676",
"text": "def release_bike\n Bike.new # returns an instance of this bike \n #fail 'No bikes available' unless @bike\n # @bike \n end",
"title": ""
},
{
"docid": "2beab78155c9dfbbed7fa20dbd11e48c",
"score": "0.5820041",
"text": "def return_bike(bike)\n full? ? (raise \"Docking Station full\") : @docking_station << bike\n end",
"title": ""
},
{
"docid": "9b2a9285907fa8cb270c9b1907897af7",
"score": "0.58091706",
"text": "def dock(bike)\n\t\tfail 'Dock is full' if self.full?\n\t\t@available_bikes.append(bike)\n\t\t@available_bikes[@available_bikes.length - 1]\n\tend",
"title": ""
},
{
"docid": "7f177ac5836398868274cbc0500db35a",
"score": "0.5777805",
"text": "def release(bike)\n @bikes.delete bike\n end",
"title": ""
},
{
"docid": "faa429d116856a9ada22ae1c397ee989",
"score": "0.57748157",
"text": "def bikes # accessor methods accesses instance variable values from outside the class\n\t\t# accesses @bikes instance variable from DockingStation class\n\t\t\t@bikes ||= []\n\t\tend",
"title": ""
},
{
"docid": "028f2f9a5b0d2e49f4a38902fa815d63",
"score": "0.57475615",
"text": "def stake\n higher_bid\n end",
"title": ""
},
{
"docid": "11da278b33c002b52bf713f5d1742b77",
"score": "0.5708184",
"text": "def undock(bike)\n raise \"This bike is not docked\" unless bikes.include?(bike)\n bikes.delete(bike) \n end",
"title": ""
},
{
"docid": "1fa9094420869d872415220ad70b7437",
"score": "0.5707753",
"text": "def release_bike\n fail \"No Bikes avaliable\" unless @station\n Bike.new\n end",
"title": ""
},
{
"docid": "6c919a9054c2a0814ab6c63207f50e86",
"score": "0.5674266",
"text": "def dock(bike)\n fail 'Docking full' if self.full?\n bike.working? ? @working_bikes << bike : @broken_bikes << bike\n @bikes += 1\n self\n end",
"title": ""
},
{
"docid": "8ad5b793322772bc73e7e5efb2525b53",
"score": "0.5666111",
"text": "def release_bike(bike)\n @bike = bike \n raise \"This is an exception\" \n Bike.new\n end",
"title": ""
},
{
"docid": "f9b9e01aac013bcbb6797bb70482e03a",
"score": "0.566367",
"text": "def initialize\n\n @docked_bikes = []\n end",
"title": ""
},
{
"docid": "f1e4b2a591ccf757ad3d9059909982a7",
"score": "0.56593513",
"text": "def dock_broken_bike\n full? ? fail(\"I do apologise, this station is full\") : @bikes << Bike.new(false)\n end",
"title": ""
},
{
"docid": "6b6a534672874383909fee44858352b4",
"score": "0.5652257",
"text": "def add_drink(drink_name, price, stock_level)\n @stock << {\n name: drink_name,\n price: price,\n stock: stock_level\n }\n end",
"title": ""
},
{
"docid": "80f774f81cee488895b59566a056634a",
"score": "0.5646035",
"text": "def buy_dog(name)\n dog = Dog.new(name)\n pets[:dogs] << dog\n end",
"title": ""
},
{
"docid": "1fc55cba8ee3076b63dbbde9a9e8ae62",
"score": "0.56456846",
"text": "def hire_bike(station)\n @bike = station.release_bike(false)\n end",
"title": ""
},
{
"docid": "bc00e3385209e9fcab97a0b0066a7e64",
"score": "0.5625328",
"text": "def release_bike\n p @bike \n fail 'No bikes available' unless @bike\n @bike\n end",
"title": ""
},
{
"docid": "c18cfe2798c9364df6af6bda8b533ce3",
"score": "0.5600279",
"text": "def dock(bike, status = 'working')\n add_bike bike\n end",
"title": ""
},
{
"docid": "ea9d8fc9869139d575c29dec63e246ed",
"score": "0.5586288",
"text": "def store?; end",
"title": ""
},
{
"docid": "11f2b5d8b64e505da275d8473690370b",
"score": "0.55794257",
"text": "def release(bike)\n raise \"I do not hold this bike\" unless bikes.include?(bike)\n raise \"Item is not a bike\" unless bike.instance_of?(Bike) \n bikes.delete(bike)\n end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.5577574",
"text": "def store; end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.5577574",
"text": "def store; end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.5577574",
"text": "def store; end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.5577574",
"text": "def store; end",
"title": ""
},
{
"docid": "8f5a51dc14e208ee600021bb55986c1e",
"score": "0.5577574",
"text": "def store; end",
"title": ""
},
{
"docid": "0e01b617cd38dd477a19785dc229139e",
"score": "0.5570372",
"text": "def buy_bike(brand, index)\n new_bike = brand.bikes_available[index]\n # binding.pry\n new_bike.shop = self\n end",
"title": ""
},
{
"docid": "87546bfb2651d1439651ceb518e30023",
"score": "0.5516861",
"text": "def load(bike)\n \t\t@broken_bikes << bike unless bike.working?\n \t\t@working_bikes << bike if bike.working?\n\t\t\n\tend",
"title": ""
},
{
"docid": "bd4c08cd93328a2c2cd09d064baa9f0b",
"score": "0.5510632",
"text": "def hold; end",
"title": ""
},
{
"docid": "d577518d8d9389df387b95db45742374",
"score": "0.55000985",
"text": "def release_bike\n \tif empty?\n raise \"No bike\"\n else\n if @docking_station.last.working?\n\n @docking_station.pop\n else\n fail \"No working bikes\"\n end\n end\n end",
"title": ""
},
{
"docid": "86589964ca797260f8884ac461f85f2e",
"score": "0.54553264",
"text": "def drink=(drink)\n self.drink_id = drink.id\n self.price = drink.price\n end",
"title": ""
},
{
"docid": "bb0c1b31a4afa8951ffb66dfb12a3ea6",
"score": "0.5441595",
"text": "def receive_fixed_bikes (fixed_bikes)\n @docking_station += fixed_bikes\n end",
"title": ""
},
{
"docid": "7ab513627b72088d159052d5be58e7d8",
"score": "0.5438741",
"text": "def buy_dog(name)\n pets[:dogs] << Dog.new(name)\n end",
"title": ""
},
{
"docid": "f44fdd3e30db45b7d46aab2647cd6c4b",
"score": "0.54328215",
"text": "def bikes\n\t\t@bikes ||= []\n\tend",
"title": ""
},
{
"docid": "c557176c6e90d42705e6d62a89c1d252",
"score": "0.5428362",
"text": "def kicker\n\n end",
"title": ""
},
{
"docid": "e27bfbb398ec3a809eb242e1f27c5182",
"score": "0.5400927",
"text": "def new_bike(bike_hash)\n Bike.new bike_attrs(bike_hash)\n end",
"title": ""
},
{
"docid": "091ff24ff04a6bb29243fd132e946073",
"score": "0.53973687",
"text": "def buy_dog(name)\n dog = Dog.new(name)\n @pets[:dogs] << dog\n end",
"title": ""
},
{
"docid": "f36bd5463dad40e8cf94bbe50d4da09d",
"score": "0.53941005",
"text": "def release\n raise \"Asking for a bike that doesn't exist\" if empty?\n return storage.pop if !empty?\n end",
"title": ""
},
{
"docid": "46150500d67b33d2d072aaf8bcc4e61b",
"score": "0.53922164",
"text": "def dock_bike(bike)\n raise \"dock is full\" if full?\n puts \"Is this bike broken y/n\"\n input = gets.chomp\n case input.upcase\n when \"Y\"\n bike.broken\n end\n if bike.working?\n @collection.bikes << bike\n else\n @collection.broken_bikes << bike\n end\n end",
"title": ""
},
{
"docid": "0d23ee5e3b4c576d05bafba86e90ff94",
"score": "0.5384387",
"text": "def add_hike(hike)\r\n @hikes << hike\r\n end",
"title": ""
},
{
"docid": "ba98589a63f132cc7af5a431d07b6f75",
"score": "0.53802913",
"text": "def record!; end",
"title": ""
},
{
"docid": "dedfe34499e4b1912e99a7de5a619d34",
"score": "0.5375414",
"text": "def set_bike\n @bike = Bike.find(params[:id])\n end",
"title": ""
},
{
"docid": "c6d2d71782e4da6fcc80d400fa146be3",
"score": "0.5374667",
"text": "def set_bike\n @bike = Bike.find(params[:id])\n end",
"title": ""
},
{
"docid": "c6d2d71782e4da6fcc80d400fa146be3",
"score": "0.53745764",
"text": "def set_bike\n @bike = Bike.find(params[:id])\n end",
"title": ""
},
{
"docid": "c6d2d71782e4da6fcc80d400fa146be3",
"score": "0.53745764",
"text": "def set_bike\n @bike = Bike.find(params[:id])\n end",
"title": ""
},
{
"docid": "c6d2d71782e4da6fcc80d400fa146be3",
"score": "0.53745764",
"text": "def set_bike\n @bike = Bike.find(params[:id])\n end",
"title": ""
},
{
"docid": "76e0fabab7d2055ae4bcb740bfc6fdec",
"score": "0.53706354",
"text": "def return_bike_to_station\n #if you have a bike, you have to return it\n end",
"title": ""
},
{
"docid": "08081a62a793f0ffe65f229d37a7b53c",
"score": "0.53439397",
"text": "def dock(bike)\n bike.fix\n super(bike)\n end",
"title": ""
},
{
"docid": "d1d6f33a67b643ee7835088508f9b9cb",
"score": "0.5332784",
"text": "def stock(bike_array)\n bike_array.each do |bike| \n raise(\"No capacity for more bikes\") if self.full?\n if bike.working? == true\n @working_bikes << bike \n else\n @broken_bikes << bike\n end\n @bikes += 1\n end\n end",
"title": ""
},
{
"docid": "ac643f84bdd8c16ba6e72bf25d294956",
"score": "0.5322172",
"text": "def buy_dog(dog_name)\n Dog.new(dog_name, self)\n end",
"title": ""
},
{
"docid": "ac643f84bdd8c16ba6e72bf25d294956",
"score": "0.5322172",
"text": "def buy_dog(dog_name)\n Dog.new(dog_name, self)\n end",
"title": ""
},
{
"docid": "afb80747796a5edb07741e6fb3bf9145",
"score": "0.5308574",
"text": "def initialize(name) #name each individual doggo\n @name = name\n save\n end",
"title": ""
},
{
"docid": "d9c5f55ea4f384549fe6d10b6d243420",
"score": "0.5307805",
"text": "def tie_with_bj\n puts say(\"#{name} hit Blackjack too! Push for #{name}.\")\n self.chips += self.bet_chips\n end",
"title": ""
},
{
"docid": "4990e2d69423e08d4473832e029431cf",
"score": "0.53069794",
"text": "def set_buy\n end",
"title": ""
},
{
"docid": "e9be3db43c8a14ac5446ff2703ab604d",
"score": "0.5302316",
"text": "def stock # Metodo protegido, accesible desde clases derivadas\n end",
"title": ""
},
{
"docid": "e98a9427171440553d00b97bcdbbc4db",
"score": "0.52964365",
"text": "def buy_dog(new_dog_name)\n new_dog = Dog.new(new_dog_name)\n @pets[:dogs] << new_dog\n end",
"title": ""
},
{
"docid": "d7e568503338436137cb7487cba8b78e",
"score": "0.5291626",
"text": "def buy_dog(dog)\n Dog.new(dog, self)\n end",
"title": ""
},
{
"docid": "6bf689ca23af28d8dbf35a05b29fcd8b",
"score": "0.5289558",
"text": "def buy_drink(drink)\n @wallet -= drink.price\n end",
"title": ""
},
{
"docid": "4eccc1faded3d8fcbeebc4ac79f03564",
"score": "0.52884716",
"text": "def initialize\n @bike_rack = []\n end",
"title": ""
},
{
"docid": "e4287c210898374671f4f8c7c80e4d43",
"score": "0.52788275",
"text": "def buy_dog(name)\n dog = Dog.new(name, self)\n end",
"title": ""
},
{
"docid": "03731c48dc52526c66a7974472837866",
"score": "0.52767706",
"text": "def release_bike\n # Create a variable = Instantiation of class to be returned\n raise \"No bikes available\" if empty?\n @bike_rack.pop\n end",
"title": ""
},
{
"docid": "35d8d79e9b6373ed672c77073f7d9af9",
"score": "0.5264507",
"text": "def get_drink(db, name, decaf, drink_size, iced, number_of_shots)\n db.execute(\"INSERT INTO drinks (name, decaf, drink_size, iced, number_of_shots) VALUES (?, ?, ?, ?, ?)\", [name, decaf, drink_size, iced, number_of_shots])\nend",
"title": ""
},
{
"docid": "e32f06077eafc4926f973a482131e8f7",
"score": "0.52635276",
"text": "def initialize(capacity = DEFAULT_CAPACITY)\n # sets up an array to store bikes\n @docked_bikes = []\n # sets up capacity variable.\n @capacity = capacity\n end",
"title": ""
},
{
"docid": "ccbbabf6ca6c0237ea7cea06457680dd",
"score": "0.5260808",
"text": "def buy_fish(name)\n @pets[:fishes] << Fish.new(name)\n end",
"title": ""
},
{
"docid": "b56c2810ef5952a6d3d5d64b528396c9",
"score": "0.52557236",
"text": "def buy_fish(name)\n fishy = Fish.new(name)\n @pets[:fishes] << fishy\n end",
"title": ""
},
{
"docid": "ef7191c0fa1f024243fbd816509d65ff",
"score": "0.52474636",
"text": "def release_bike\n if empty?\n raise \"dock is empty\"\n else\n @collection.bikes.pop\n end\n end",
"title": ""
},
{
"docid": "d6d9238f3c39bef400ca325db10ba48f",
"score": "0.52430964",
"text": "def pick_up(station)\n current_bike = (station.bikes).pop\n fail \"this bike is working\" if current_bike.working? == true\n @bike = current_bike\n end",
"title": ""
},
{
"docid": "5725bf939e32a523a5bd48cc2ef5198d",
"score": "0.5241582",
"text": "def brakes\n @brakes = true #These are a example of seperation of concern\n end",
"title": ""
},
{
"docid": "21820b8af566ca93ae5d56600f9ac71c",
"score": "0.523565",
"text": "def bake\n # change our pizza to being 'baked'\n @baked = true\n end",
"title": ""
},
{
"docid": "81ed88e9668075ff21329647219e8b73",
"score": "0.5217317",
"text": "def dock(bike)\n fail 'Docking station full' if full?\n # puts \"Would you like to report the bike as broken? (y/n)\"\n # ans = gets.chomp.downcase\n # if (ans != \"n\")\n # return_broken_bike?\n # else\n @bikes << bike\n # end\n end",
"title": ""
},
{
"docid": "ddab317bb48cea7b0ceec6f8d955d34f",
"score": "0.521038",
"text": "def give_up(person, pet)\n #this defines a variable called animal. The variable is equal to @clients[person].pets[pet]\n #@clients[person] returns the value of the key value pairing associated with the person key. THAT VALUE IS A CLASS OBJECT OF CLIENT\n #so...\n #.pets calls the pets attribute out of that class object, and uses the pet key to return the value of pets.\n #so effectively @clients[person].pets[pet] returns the value of of an attributed in the a Client class object, which is an animal object. Fuck.\n #the key value pairing fo that pets hashs is {animal name => animal ojbect} I think\n animal = @clients[person].pets[pet]\n #this creates a new key value pairing in the @animals hash\n #the key is name of pet (name of animal), and the value is an animal object\n @animals[pet] = animal\n #this deletes a key value pairing fron a client class object\n #@clients[person returns] the value of the @clients hash. That value is a client class object\n #.pets calls teh pets attribue from the class ojbect. That attribute is itself a hash.\n #.delete(pet) deletes the key value pairing with the key pet\n @clients[person].pets.delete(pet)\n end",
"title": ""
},
{
"docid": "4d1d100dc064471148662cf6560588df",
"score": "0.52030903",
"text": "def initialize\n @total_money = 0\n @sale_amount = 0\n @stocks = {}\n @stocks.default = 0\n @drinks = {}\n\n store(Drink.cola, 5)\n store(Drink.water, 5)\n store(Drink.redbull, 5)\n end",
"title": ""
},
{
"docid": "f49479fcc9f66de79f9fa3bc81427950",
"score": "0.52013195",
"text": "def buy_fish(name)\n pets[:fishes] << Fish.new(name)\n end",
"title": ""
},
{
"docid": "6392a7858feedc84fa199ebca9d757f9",
"score": "0.5196846",
"text": "def buy_dog(name)\n Dog.new(name, self)\n end",
"title": ""
},
{
"docid": "6392a7858feedc84fa199ebca9d757f9",
"score": "0.5196846",
"text": "def buy_dog(name)\n Dog.new(name, self)\n end",
"title": ""
},
{
"docid": "6392a7858feedc84fa199ebca9d757f9",
"score": "0.5196846",
"text": "def buy_dog(name)\n Dog.new(name, self)\n end",
"title": ""
},
{
"docid": "6392a7858feedc84fa199ebca9d757f9",
"score": "0.5196846",
"text": "def buy_dog(name)\n Dog.new(name, self)\n end",
"title": ""
},
{
"docid": "ecb8cbebb6d12211394eb2df7a86301d",
"score": "0.51924956",
"text": "def buy_fish(name)\n # initialize new Fish instance and push into :fishes array in the :pets hash\n self.pets[:fishes] << Fish.new(name)\n end",
"title": ""
},
{
"docid": "3b603bdf93c2d59dc7e5e0ac2a1c0579",
"score": "0.5190631",
"text": "def release_bike\n #checks if the docking station is empty\n raise \"No bikes available\" if empty?\n #checks if any working bikes present\n if @bikes.any? { |bike| bike.broken == false }\n #loop through array to find first match\n @bikes.find do |bike|\n if bike.broken == false\n @bikes.delete(bike)\n end\n end\n\n else\n raise \"No working bikes\"\n end\n\n end",
"title": ""
},
{
"docid": "f8bc8e895d130537e0eed90dbc902a1e",
"score": "0.5182885",
"text": "def buy_fish(name)\n fish = Fish.new(name)\n @pets[:fishes] << fish\n end",
"title": ""
},
{
"docid": "4da03b1a1f332be5e430b234d49ebc15",
"score": "0.5182524",
"text": "def release_bike\n fail 'No bikes available' if empty?\n\n fail 'No bikes available' if broken?\n bikes.pop\n end",
"title": ""
},
{
"docid": "810f6c9296e575865f9397f512230fa7",
"score": "0.51790076",
"text": "def hold?; end",
"title": ""
},
{
"docid": "5fe79bc620d93812684b49c089c4bc2b",
"score": "0.5172108",
"text": "def add_pet_to_stock(pet_shop, pet)\n pet_shop[:pets] << pet\nend",
"title": ""
},
{
"docid": "f1041985fed1e98c536eeee17748f363",
"score": "0.51554644",
"text": "def collect_fixed_bikes(garage)\n garage.available_bikes.each do |bike|\n garage.release(bike)\n self.dock(bike)\n end\n end",
"title": ""
},
{
"docid": "79e0ce6f08ef39d236f0784e0aa75925",
"score": "0.51485026",
"text": "def add_pet_to_stock( shop, new_pet )\n shop[:pets] << new_pet\nend",
"title": ""
},
{
"docid": "75ee39bef78097bd3bbc5411c4c7a4d0",
"score": "0.5145218",
"text": "def store; @store end",
"title": ""
},
{
"docid": "b6da32f5a48a7209b668edd398b1ae1f",
"score": "0.5142409",
"text": "def put_data(dockey,data={},append=false)\n get_store(0).put_data(dockey, data, append)\n end",
"title": ""
},
{
"docid": "28bfd6e3be2367d0f4d543d71f3153e0",
"score": "0.51365",
"text": "def add_pet_to_stock(unit, new_pet)\n unit[:pets] << new_pet\nend",
"title": ""
}
] |
04ff8b9cd1469a33d5c380dac689bf6a
|
POST /teams/1/add_jersey_to_player possible params: player_id jersey
|
[
{
"docid": "9c2ba55209d3a0860b694ffc04e78393",
"score": "0.81566787",
"text": "def add_jersey_to_player\n @team.assign_jersey(@player, @jersey)\n\n redirect_to team_path(@team)\n end",
"title": ""
}
] |
[
{
"docid": "c56d658cdb1a64f2172c5fe7b4d56ace",
"score": "0.82497174",
"text": "def add_player\n @team.add_player(@player, @jersey)\n\n redirect_to team_path(@team)\n end",
"title": ""
},
{
"docid": "2e2e9e31825e4251b5ad076d00e89bdf",
"score": "0.68806356",
"text": "def create\n @team = Team.find(params[:team_id])\n @player = @team.players.build(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to([@player.team, @player], :notice => 'Player was successfully created.') }\n format.json { render :json => @player, :status => :created, :location => [@player.team, @player] }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @player.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77fa0d0fcfa88215ec3fe7d86d3145fb",
"score": "0.6863375",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n @players = Player.all\n @players.each do |p|\n if p.id != @player.id\n @team = Team.create(name: p.name[0, 3] + @player.name[0, 3] + (p.id + @player.id).to_s, player_ids: [p.id, @player.id])\n else\n end\n end\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20a32a2b429817e67a25e95d634dfdc1",
"score": "0.66521794",
"text": "def player_params\n params.require(:player).permit(:team_id, :jersey_number, :first_name, :last_name)\n end",
"title": ""
},
{
"docid": "79da3d2acdfd72f6179f9de49c13912b",
"score": "0.6636471",
"text": "def add_match_day_player\n match_day_team = MatchDayTeam.find(params[:match_day_team_id])\n match_day_player = MatchDayPlayer.find(params[:id])\n match_day_team.match_day_players << match_day_player\n update_match_day_team(match_day_team)\n end",
"title": ""
},
{
"docid": "a79ad6672c7b4aaa68c1a1c036e5f044",
"score": "0.6605924",
"text": "def create\n puts(params);\n @player = Player.new(player_params)\n \n respond_to do |format|\n if @player.save\n # Tell the playerMailer to send a welcome email after save\n # @user_player = Userplayer.new(user_id: @user.id, player_id: @player_id)\n # if @user_player.save\n @tournament.players << @player\n # @tournament.update_attribute(num_players: @tournament.num_players + 1)\n format.html { redirect_to(root_path, notice: 'player was successfully added.') }\n format.json { render json: @player, status: :created, location: @player }\n # end\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12a9b226eaf95ad007887021f540ae91",
"score": "0.6560575",
"text": "def create\n @fantasy_team_player = FantasyTeamPlayer.create(team_id: @team.id, player_id: params[:player_id])\n unless @fantasy_team_player.new_record?\n render json: @fantasy_team_player, status: :ok, include: [:player]\n else\n render json: error_messages_on_create, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "af1a6173115eceaf04c69346f86aa21e",
"score": "0.6517147",
"text": "def create\n # The data is only in json-format in this example\n player = Player.new(player_params) # using strong parameters\n\n if player.save\n # ok respond with the created object (team)\n respond_with player, status: :created\n else\n # render or error message\n error = ErrorMessage.new(\"Could not create the resource. Bad parameters?\", \"Could not create the resource!\" )\n render json: error, status: :bad_request # just json in this example\n end\n\n end",
"title": ""
},
{
"docid": "fdf482e620f0ef8a08099fe4ab34d71e",
"score": "0.6496304",
"text": "def create\n player = Player.new(player_params)\n if player.save\n render json: player, status: 201, location: [:api, player]\n else\n failed_to_create(player, \"player\")\n end\n end",
"title": ""
},
{
"docid": "f4a0bee94c0c05a01e5ad0ef4740994b",
"score": "0.6476267",
"text": "def add_player(new_player)\n @players << new_player\n end",
"title": ""
},
{
"docid": "b36717eb7ce9faae207c93c50667d25e",
"score": "0.6466089",
"text": "def add_player(player, tier = nil)\n # See if this player is already in this round\n return if participants.where(player_id: player.id).exists?\n\n Round.transaction do\n p1 = Participant.create!(round_id: id,\n tier_id: (tier || smallest_tier).id,\n player_id: player.id)\n\n create_games_for(p1)\n return p1\n end\n end",
"title": ""
},
{
"docid": "e885bb322cfe6d59e668ce9335349e87",
"score": "0.6431709",
"text": "def create\n player = Player.create(player_params)\n render json: player, status: 201\n end",
"title": ""
},
{
"docid": "50c04f0e0320888944ce439fb87b069d",
"score": "0.64309144",
"text": "def add_player(new_player)\n @team_members.push(new_player)\n end",
"title": ""
},
{
"docid": "753335e43ade95dd4d4b4998fd2b5cf0",
"score": "0.63829136",
"text": "def add_new_player(new_player)\n players.push(new_player)\n end",
"title": ""
},
{
"docid": "b0e910d28cfe066411dd9a2e4aae7bfc",
"score": "0.63813496",
"text": "def add_player player\n p = player_by_id(player.id)\n if !p\n @players << player\n elsif p.name != player.name\n p.name = player.name\n end\n end",
"title": ""
},
{
"docid": "e51040ceed2178c8a72bc5cc7315dda0",
"score": "0.6375028",
"text": "def create\n @teams_player = TeamsPlayer.new(teams_player_params)\n\n respond_to do |format|\n if @teams_player.save\n format.html { redirect_to @teams_player, notice: 'Teams player was successfully created.' }\n format.json { render :show, status: :created, location: @teams_player }\n else\n format.html { render :new }\n format.json { render json: @teams_player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d8d723198ccd5767743bb7372b0d7fe",
"score": "0.6349307",
"text": "def create\n\t\tPlayer.create(player_params.merge(team_id: params[:team_id]))\n\n\t\tredirect_to \"/\"\n\tend",
"title": ""
},
{
"docid": "a206b5db6cd6db4081ac42c6a87265e4",
"score": "0.63408804",
"text": "def add_new_player(new_player)\n @players.push(new_player)\n end",
"title": ""
},
{
"docid": "c2ffaf64c7cb4c158dbe566e2cd07f85",
"score": "0.63381964",
"text": "def add_player_to_roster\n response = Hash.new\n profileId = params[:profile_id]\n teamId = params[:team_id]\n profile = Profile.find_by_id(profileId)\n roster = Roster.new(\n :team_id => teamId,\n :profile_id => profileId\n )\n if roster.valid?\n roster.save\n response[:success] = true\n response[:profile_html] = render_to_string \"teams/_roster_profile.haml\", :layout => false, :locals => { :roster => roster}\n else\n response[:errors] = roster.errors.full_messages\n end\n respond_to do |format|\n format.json { render :json=> response}\n end\n end",
"title": ""
},
{
"docid": "f11e17f64e73e0db0dedb6641b0f83c9",
"score": "0.63034505",
"text": "def create\n @player = Player.new(player_params)\n @player.user = current_user\n # automatically create a new team for the user if there isn't one already\n unless @player.team || @player.name.blank?\n team = Team.find_or_initialize_by(name: \"#{@player.name}'s Team\", code: @player.name.upcase)\n @player.team = team if team.save\n end\n respond_to do |format|\n if @player.save\n format.html { redirect_to(@player, :notice => 'Player was successfully created.') }\n format.xml { render :xml => @player, :status => :created, :location => @player }\n else\n team.destroy if team\n format.html { render :action => \"new\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38fe13b6be146dad01f8347395923cb6",
"score": "0.6302564",
"text": "def create\n @team_player = TeamPlayer.new(team_player_params)\n\n respond_to do |format|\n if @team_player.save\n format.html { redirect_to @team_player, notice: 'Team player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team_player }\n else\n format.html { render action: 'new' }\n format.json { render json: @team_player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70685c001e88fe7ffd12b4cf5fe027c7",
"score": "0.62451017",
"text": "def addToTournament\n #create competitors too\n @tournament = Tournament.find(params[:tournament_id])\n\t@team = Team.find(params[:id])\n\t\n\t@tournament.teams << @team \n\t\n respond_to do |format|\n format.html { redirect_to(@tournament, :notice => 'Team was successfully added to the tournament.') }\n format.xml { render :xml => @tournament, :status => :created, :location => @tournament }\n end\n end",
"title": ""
},
{
"docid": "fde72bdce830185c455cc6b521134740",
"score": "0.622073",
"text": "def register_player!(params)\n self.player = Player.new(params)\n self.roles << :player\n self.save\n self.player.save\n self.player\n end",
"title": ""
},
{
"docid": "36ce7c1588e032b85e3169f608bcef37",
"score": "0.6218177",
"text": "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to \"/players/new\", notice: (@player.name + ' was successfully created.') }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4f22f754a49b2489e9a4ca0d4ac6dd7",
"score": "0.62055284",
"text": "def create\n @leagueplayer = Leagueplayer.new(params[:leagueplayer])\n \n respond_to do |format|\n if @leagueplayer.save\n format.html { redirect_to(@leagueplayer, :notice => 'Leagueplayer was successfully created.') }\n format.xml { render :xml => @leagueplayer, :status => :created, :location => @leagueplayer }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @leagueplayer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae6dbc372e560485e4586b50df2f6177",
"score": "0.6201959",
"text": "def add_new_player(new_player)\n @players.push(new_player)\nend",
"title": ""
},
{
"docid": "251f8ee9ecf7181b4670d8b4497197c2",
"score": "0.6188137",
"text": "def team_add\n # Convert ids from routing to object\n @athlete = Athlete.find(params[:id])\n @team = Team.find(params[:team])\n\n unless @athlete.is_on_roster?(@team)\n # add team to list using << operator\n @athlete.teams << @team\n flash[:notice] = 'Team was successfully added.'\n else\n flash[:error] = 'Athlete was already on roster.'\n end\n\n # Update Team Captain\n @AthleteTeam = AthletesTeam.find_by(:athlete_id => @athlete.id, :team_id => @team.id)\n @AthleteTeam.update_attributes(:captain => params[:captain], :jerseynumber => params[:jerseynumber], :position => params[:position])\n\n\n redirect_to :action => :teams, :id => @athlete\n end",
"title": ""
},
{
"docid": "01bf7527d99a3450481d70305c1686cd",
"score": "0.61588275",
"text": "def create\n @team = Team.new(team_params)\n\n @team.created_by_id = current_user.id\n\n respond_to do |format|\n if @team.save!\n\n # Add creator to PlayerTeamR table\n relationship = PlayerTeamR.new(team_id: @team.id, user_id: @team.created_by_id)\n relationship.save!\n\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f720eadc96bdf51335f8bbbec0d4b3a2",
"score": "0.61564386",
"text": "def create\n tournament = Tournament.open.last\n\n if tournament\n @player = tournament.players.new name: params[:name],\n key: SecureRandom.uuid\n if @player.valid?\n @player.save!\n message = { :name => @player.name,\n :key => @player.key,\n :message => @player.key }\n else\n message = { :message => \"You must register with a valid and unique player name.\" }\n end\n\n respond_to do |format|\n format.json { render :json => message }\n format.xml { render :xml => message }\n format.html { redirect_to '/pages/registration', :notice => message[:message] }\n end\n else\n respond_to do |format|\n format.json { render_not_found \"The tournament is currently closed.\" }\n format.xml { render_not_found \"The tournament is currently closed.\" }\n format.html { redirect_to '/pages/registration', :alert => \"The tournament is currently closed.\" }\n end\n end\n end",
"title": ""
},
{
"docid": "7ca69e8c8574b52659ef5f7931dd13e8",
"score": "0.6145709",
"text": "def add_player_to_players(player)\n players.push(player)\n end",
"title": ""
},
{
"docid": "b2693ac247725e07e115a285cdb0fe23",
"score": "0.61435974",
"text": "def create\n @player = Player.new(player_params)\n\n if @player.save\n render json: @player, status: :created, location: @player\n else\n render json: {errors: @player.errors}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "935a1faead79905ea57eead850f7e8a9",
"score": "0.614059",
"text": "def create\n @team = Team.find_by_name(params[:team][:team_name])\n if @team.nil?\n @team = Team.new(captain_id: params[:team][:captain_id],\n\t\t team_name: params[:team][:team_name])\n\n respond_to do |format|\n if @team.save\n format.json { render json: @team, status: :created, location: @team }\n if params[:players]\n \tTeamPlayers.create(params[:players], team_name: @team.name)\n end\n else\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n else \n Team.update(params[:team])\n end\n end",
"title": ""
},
{
"docid": "80aad046589110e3a7334bdeeb52ead6",
"score": "0.61293954",
"text": "def create\n\t\t# league admin can add\n\t\t# anyone can add (own team) as pending iff league is addable\n\t\tds = DivisionSeason.find params[:division_season_id]\n\t\tteam = Team.find team[:team_id]\n\n\t\tif can? :manage_teams, ds\n\t\t\tTeamDSService.add_team(ds, team)\n\t\telse\n\t\t\tauthorize! :add_team, ds\n\t\t\tTeamDSService.add_pending_team(ds, team)\n\t\tend\n\n\t\trespond_with tdsr\n\tend",
"title": ""
},
{
"docid": "96350516223bf152b958899a7db237e9",
"score": "0.612299",
"text": "def add_player(player_name)\n @player_names.push(player_name)\n end",
"title": ""
},
{
"docid": "b37d5978f0b8af4bbe41487e8ab4abcf",
"score": "0.6119307",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n event \"create\", :player, @player.id, description: \"#{current_player.name} created player #{@player.name}\"\n format.html { redirect_to @player, flash: { success: 'Player was successfully created.' } }\n format.json { render json: @player.to_json(only: public_attrs), status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67aed8c1f9d3bdb1ed22bc8054eb5a1e",
"score": "0.6118007",
"text": "def test_add_new_player\n team = SportsTeam.new(\"Celtic\", [\"Hendrik Larsson\", \"Captain Football\", \"Some Guy\"], \"Mr. Manager\")\n team.add_new_player(\"Dave Supercool\")\n assert_equal([\"Hendrik Larsson\", \"Captain Football\", \"Some Guy\", \"Dave Supercool\"], team.players)\n end",
"title": ""
},
{
"docid": "0424d8121fb0894da329399f0ecb9c80",
"score": "0.61162645",
"text": "def create\n @player = Player.new(params[:player])\n \n if @player.save\n render :json => @player, :status => :created, :location => @player\n else\n render :json => @player.errors, :status => :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "63b7bb9d97ec4b8ef7bc5e73be31f2ba",
"score": "0.6112486",
"text": "def add_player(player)\n new_player = if player_one\n { player_two: player }\n else\n { player_one: player }\n end\n update_attributes(new_player)\n end",
"title": ""
},
{
"docid": "b53298b6f0ccda20ced48f9d0cb7d6f8",
"score": "0.61092275",
"text": "def create\n @player = Player.create!(player_params) # anticipated possible exceptions rescued in BaseController\n render json: @player, status: :created\n end",
"title": ""
},
{
"docid": "831eea01870e95fb399cfd9eb0fa1030",
"score": "0.6095916",
"text": "def add_player(player, password)\n @storage.save_player(player, password)\n self.add_object(player)\n end",
"title": ""
},
{
"docid": "6aa204b4e67a63b6bc45d19bce837240",
"score": "0.6094552",
"text": "def create_player(name)\n {\n \"id\" => @player_class.create(:player_name => name).id\n }\n end",
"title": ""
},
{
"docid": "5fd3da405efeef6a7a7798cd30515476",
"score": "0.609372",
"text": "def player_params\n params.required(:player).permit(:id, :team_id)\n end",
"title": ""
},
{
"docid": "0a0b39c1c70e17338333522379467b1b",
"score": "0.6084316",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.json { render json: @player, status: :created }\n else\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ea8d39c395c67ae27a89092302464df",
"score": "0.6069714",
"text": "def add_player(name)\n @players.push(name)\n end",
"title": ""
},
{
"docid": "5674af963016af0c0771be0d881abce3",
"score": "0.60695416",
"text": "def add_player(player_name)\n player = Player.new(player_name)\n $players << player\n end",
"title": ""
},
{
"docid": "ab9e72ab5a79640008f86d025a05d934",
"score": "0.6037334",
"text": "def team_player_params\n params.require(:team_player).permit(:team_id, :player_id)\n end",
"title": ""
},
{
"docid": "a5b6b7822f25f728beead52cb77d0488",
"score": "0.60315496",
"text": "def create\n plan_id = params[:player].delete(:plan_id)\n travel_date_year = params[:player].delete(:travel_date_year)\n travel_date_season = params[:player].delete(:travel_date_season)\n @player = Player.new(player_params)\n @player.plan = Plan.find(plan_id)\n @player.travel_date = \"#{travel_date_season}/#{travel_date_year}\"\n @player.password = params[:player][:email]\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to active_players_path, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b69f32aa9c730bea075cd194510907ca",
"score": "0.6024601",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8431daa08e703a75865a7d7b3e54c5f3",
"score": "0.6021106",
"text": "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8431daa08e703a75865a7d7b3e54c5f3",
"score": "0.6021106",
"text": "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8431daa08e703a75865a7d7b3e54c5f3",
"score": "0.6021106",
"text": "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8431daa08e703a75865a7d7b3e54c5f3",
"score": "0.6021106",
"text": "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b467a4a2b2875b1a7525e2f2c1f86668",
"score": "0.6015075",
"text": "def create\n \t#Add player to playground\n @playground = current_playground\n @playgrounds = Playground.all\n #Reset player question variables\n\t@player = Player.find(params[:player_id])\n\t@player.update_attribute(:number_response, 0)\n\t@player.update_attribute(:correct, -1)\n\t@player.update_attribute(:time, 1000)\n\t@player.update_attribute(:winner, -1)\n\t\n\t@game_player = @playground.game_players.build(player: @player)\n\t\n respond_to do |format|\n if @game_player.save\n format.html { redirect_to board_url }\n format.js\n format.json { render json: @game_player, status: :created, location: @game_player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game_player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bcda8c0d4087e2a5f57b2de830369b04",
"score": "0.5999525",
"text": "def test_add_player_to_players()\n team = SportsTeam.new(\"Belgium\", [\"Player 1\", \"Player 2\", \"Player 3\"], \"Mr Belgium\")\n team.add_player_to_players(\"Player 4\")\n assert_equal([\"Player 1\", \"Player 2\", \"Player 3\", \"Player 4\"], team.players())\n end",
"title": ""
},
{
"docid": "2fea03aa634a6d198c9e5cb8280c0065",
"score": "0.5999127",
"text": "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to root_path, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba8f5bf207993ea3b007e60ababa24d5",
"score": "0.59979177",
"text": "def create\n @player = Player.new(player_params)\n @player.game = @game\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to game_player_path(id: @player.id), notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6942c202561b88faf825904aa826cd9",
"score": "0.59946686",
"text": "def player_params\n params.require(:player).permit(:name, :tickets, :raffle_id)\n end",
"title": ""
},
{
"docid": "273759d07bdf7717a63b5190cf7e7175",
"score": "0.59940493",
"text": "def add_player()\n @players.push(players)\n end",
"title": ""
},
{
"docid": "c8d2f986a1d5bbfc72a8d7c13b87b4b9",
"score": "0.59827197",
"text": "def player_params\n params.require(:player).permit(:name, :initials, :team_id)\n end",
"title": ""
},
{
"docid": "6d1092cb7ca5a44ed53f213230d978e6",
"score": "0.597432",
"text": "def add_player(player_name)\n player = Player.new(player_name, 3)\n @players.push(player)\n end",
"title": ""
},
{
"docid": "f81264185cda17d8e84f8779aa9dc77a",
"score": "0.5970752",
"text": "def add_player(id)\n\t\t@players[id]=Player.new\n\tend",
"title": ""
},
{
"docid": "df7f37ed46db28bc7affd7ce1e664eee",
"score": "0.5967812",
"text": "def add_new_player(new_player)\n return @players.push(new_player)\nend",
"title": ""
},
{
"docid": "513bad57854388dd2b104c58c1cd284d",
"score": "0.59647435",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: \"Player was successfully created.\" }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b21ab6d9308233ba84c725f1e71eef8a",
"score": "0.59644616",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b21ab6d9308233ba84c725f1e71eef8a",
"score": "0.59644616",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b21ab6d9308233ba84c725f1e71eef8a",
"score": "0.59644616",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b21ab6d9308233ba84c725f1e71eef8a",
"score": "0.59644616",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b21ab6d9308233ba84c725f1e71eef8a",
"score": "0.59644616",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b21ab6d9308233ba84c725f1e71eef8a",
"score": "0.59644616",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b55308acdc0f4e54832784588361dd6",
"score": "0.5961962",
"text": "def create\n @player = Player.new(player_params)\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d5092cbe92fbb8402a3852ea7890302",
"score": "0.5949564",
"text": "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html {\n redirect_to @player, notice: I18n.t(\"messages.players.create.success\")\n }\n else\n format.html {\n @errors = @player.errors\n render action: \"new\"\n }\n end\n end\n end",
"title": ""
},
{
"docid": "61f9780673b0abc3f0133f687caf1fd6",
"score": "0.5929969",
"text": "def create\n @team = Team.new(team_params)\n respond_to do |format|\n if @team.save\n # current_game.users.push(@team)\n format.html { redirect_to teams_path, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93cfcf5a5d5ab331f43e58c012267a9c",
"score": "0.5924412",
"text": "def create\n @league = League.new(league_params)\n @league.league_owner_id = current_user.id\n\n respond_to do |format|\n if @league.save\n format.html { redirect_to :action => \"addteam\", :id => @league.id }\n format.json { render :show, status: :created, location: @league.addteam }\n format.js { }\n else\n format.html { render :new }\n format.json { render json: @league.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3831d63cfc72631e767dc54531792fe1",
"score": "0.5920163",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @player }\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3831d63cfc72631e767dc54531792fe1",
"score": "0.5920163",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @player }\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3831d63cfc72631e767dc54531792fe1",
"score": "0.5920163",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @player }\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3831d63cfc72631e767dc54531792fe1",
"score": "0.5920163",
"text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @player }\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b0d1b8905d3ca8ec0c7496f70c32bce",
"score": "0.5920013",
"text": "def create\n json = ActiveSupport::JSON.decode(params[:player])\n @player = Player.new\n @player.gender = json[\"gender\"]\n @player.username = json[\"username\"]\n @player.uuid = json[\"uuid\"]\n @player.last_location = json[\"location\"]\n @player.player_monsters = [ PlayerMonster.new({ :nickname => json[\"starting_monster\"][\"nickname\"],\n :monster_id => json[\"starting_monster\"][\"id\"],\n :caught_location => json[\"location\"]\n }) ]\n if @player.save\n render :json => { :success => true, :player => @player } , :status => 200\n else\n render :json => { :success => false, :message => @player.errors } , :status => 400\n end\n end",
"title": ""
},
{
"docid": "d6c03bd8268cc8749eff9f1a3626fe13",
"score": "0.5912751",
"text": "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n# ToDo 0 => Wenn Spieler erstellt wurde, schließe das Fenster und aktualisiere die Spielerliste bzw. die Spielerübersicht\n format.html { redirect_to home_path, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef9c60b842d9e13a51962ccf121fad85",
"score": "0.5905022",
"text": "def player_params\n params.require(:player).permit(:first_name, :last_name, :number, :team_id)\n end",
"title": ""
},
{
"docid": "768a7f8c8c318d65eaa21ac2a6106d11",
"score": "0.5892975",
"text": "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n flash[:notice] = 'Api::Player was successfully created.'\n format.html { redirect_to(@player) }\n format.xml { render :xml => @player, :status => :created, :location => @player }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3c8c2de35ed8cf2702255c923c6b7db",
"score": "0.5884922",
"text": "def team_params\n params.require(:team).permit(:name, :short_name, :player_id)\n end",
"title": ""
},
{
"docid": "dafa721c9ddf96ccfcf0b792de51c89b",
"score": "0.5878183",
"text": "def new\n @team = Team.find(params[:team_id])\n @player = @team.players.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @player }\n end\n end",
"title": ""
},
{
"docid": "e5656c393bb231989c42ebee1534f89c",
"score": "0.58745646",
"text": "def create\n @client_player = ClientPlayer.new(params[:client_player])\n\n respond_to do |format|\n if @client_player.save\n format.html { redirect_to @client_player, notice: 'Client player was successfully created.' }\n format.json { render json: @client_player, status: :created, location: @client_player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client_player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc642d509a778899ad4a7bfce06e6ccb",
"score": "0.58727133",
"text": "def add_user_to_team(team, username)\n team_id = team_id_by_name(team)\n client.add_team_membership(team_id, username)\n end",
"title": ""
},
{
"docid": "5ca53c45217b9c4f182a553d204c3631",
"score": "0.5863752",
"text": "def create\n\n \t\t\t@player = Player.new player_params\n\n \t\t\tif @player.save\n\n \t\t\t\trender json: @player,status: :created\n\n \t\t\telse\n\n \t\t\t\trender json: {error: true,errors: @player.errors},status: :unprocessable_entity\n\n \t\t\tend\n\n \t\tend",
"title": ""
},
{
"docid": "1dbfd27183b3a1eacff830c778d64a12",
"score": "0.5860651",
"text": "def create\n @player = Player.new(player_params)\n\n if @player.save\n flash[:notice] = 'Player was successfully created.'\n respond_with @player\n else\n render action: :new\n end\n end",
"title": ""
},
{
"docid": "70e154ee42823b14703d27f33364a7bd",
"score": "0.5854771",
"text": "def create\n @group_player = GroupPlayer.new(group_player_params)\n\n respond_to do |format|\n if @group_player.save\n format.html { redirect_to @group_player, notice: 'Group player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @group_player }\n else\n format.html { render action: 'new' }\n format.json { render json: @group_player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e04496949fa7b9e277905bfe79c12f7",
"score": "0.5847299",
"text": "def create_player(id,name)\n @players.push(Player.new(id, name, 0))\n end",
"title": ""
},
{
"docid": "5f4f109de93feb60ef5ca7a2074c011c",
"score": "0.5837378",
"text": "def add_player(player)\n # Confirm user isn't already playing a game\n return errors.add(:base, 'Player is already playing a game') unless player.games.active.count == 0\n # Confirm the game is not full\n return errors.add(:base, 'Game is full') unless players.count < num_players\n # Add player\n game_players.create(player: player)\n start if players.count == num_players\n end",
"title": ""
},
{
"docid": "8f8a9c51d2f8f209d13ee517feedfdd8",
"score": "0.58355474",
"text": "def create\n player_params = {\"name\"=>room_params[:leader], score: 0, lives: 2}\n \n @room = Room.new(room_params)\n @room.round = 0\n\n respond_to do |format|\n if @room.save\n @player = @room.players.create(player_params)\n if @player.save\n session[:player_id] = @player.id\n format.html { redirect_to @room, notice: 'Room and Player were successfully created.' }\n format.json { render :show, status: :created, location: @room }\n else\n format.html { render :new }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n else\n format.html { render :new }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dfec50eb33c4ef4712f7b63e280fc666",
"score": "0.5831059",
"text": "def add_player\n add_remove_player :add\n end",
"title": ""
},
{
"docid": "286aa1bf51895e47dd3d3c70674ce700",
"score": "0.582533",
"text": "def create\n @player = Player.new(player_params)\n @player.save\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to [:admin, @player], notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e65480f8ea31dcc8dbb0f2897219f051",
"score": "0.5823396",
"text": "def create\n @player = Player.new(player_params)\n flash[:notice] = \"Player was created successfully.\" if @player.save\n respond_with @player\n end",
"title": ""
},
{
"docid": "968088632ee3e16ff34b2ab0e7584b7b",
"score": "0.5813936",
"text": "def create\n @practice = Practice.new(practice_params)\n\n\n respond_to do |format|\n if @practice.save\n\n @practice.team_season.players.each do |pp|\n player_practice = PlayerPractice.new\n player_practice.player = pp\n player_practice.practice = @practice\n player_practice.save\n end\n\n format.html { redirect_to @practice, notice: 'Practice was successfully created.' }\n format.json { render :show, status: :created, location: @practice }\n else\n format.html { render :new }\n format.json { render json: @practice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce61d5269858371c10cc0fe19e583143",
"score": "0.58048487",
"text": "def player_params\n params.require(:player).permit(:account_id, :player_slot, :hero_id)\n end",
"title": ""
},
{
"docid": "80af0867a78b494994e0eceb1064beca",
"score": "0.58005536",
"text": "def create\n @player = Player.new(player_params)\n respond_to do |format|\n if @player.save\n EventMailer.new_player(@player).deliver\n format.html { redirect_to page_thank_you_path }\n format.json { render action: 'show', status: :created, location: @player }\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e511289dc819a8693ebb75e0680c26d2",
"score": "0.5798062",
"text": "def register\n return unless request.post? \n\n params[:user][:auth_token] = cookies[:auth_token]\n\n u = User.create_with_player( params[:user], params[:player] ) \n\n session[:player_id] = u.playing_as.id\n # current_player = u.playing_as\n redirect_to matches_url\n end",
"title": ""
},
{
"docid": "4b3306cdc6f02667e7d49f5f3299ae89",
"score": "0.57977784",
"text": "def add_player(player)\n @players[@players.count + 1] = player\n end",
"title": ""
},
{
"docid": "972b76924e84bda9714bfbbac8885011",
"score": "0.5796278",
"text": "def create\n server = params[:summoner][:server].downcase\n name = params[:summoner][:name].downcase\n\n @summoner = Summoner.new(summoner_params)\n @summoner.user_id = current_user.id\n\n search_string = \"https://community-league-of-legends.p.mashape.com/api/v1.0/#{server}/summoner/getSummonerByName/#{name}\"\n response = Unirest.get(search_string)\n\n if response.code == 200 && response.body[\"summonerLevel\"] == 30\n @summoner.name = response.body[\"name\"]\n @summoner.icon_id = response.body[\"profileIconId\"]\n @summoner.riot_id = response.body[\"summonerId\"]\n @summoner.acct_id = response.body[\"acctId\"]\n \n search_string = \"https://community-league-of-legends.p.mashape.com/api/v1.0/#{server}/summoner/getLeagueForPlayer/#{@summoner.riot_id}\"\n response = Unirest.get(search_string)\n\n if response.code == 200\n response.body[\"entries\"][\"array\"].each do |entry|\n if entry[\"playerOrTeamName\"] == response.body[\"requestorsName\"]\n @summoner.league = entry\n end\n end\n end\n\n search_string = \"https://community-league-of-legends.p.mashape.com/api/v1.0/#{server}/summoner/retrieveTopPlayedChampions/#{@summoner.acct_id}\"\n response = Unirest.get(search_string)\n\n if response.code == 200\n @summoner.most_played = {}\n response.body[\"array\"].each do |value|\n value[\"stats\"][\"array\"].each do |stat|\n if stat[\"statType\"] == \"TOTAL_SESSIONS_PLAYED\"\n @summoner.most_played[\"#{stat[\"championId\"]}\"] = \"#{stat[\"value\"]}\"\n end\n end\n end\n end\n\n search_string = \"https://community-league-of-legends.p.mashape.com/api/v1.0/#{server}/summoner/getSummonerHonor/#{@summoner.acct_id}\"\n response = Unirest.get(search_string)\n\n if response.code == 200\n @summoner.honor = response.body\n end\n end\n\n respond_to do |format|\n if @summoner.save\n format.html { redirect_to @summoner, notice: 'Summoner was successfully created.' }\n format.json { render action: 'show', status: :created, location: @summoner }\n else\n format.html { render action: 'new' }\n format.json { render json: @summoner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
cea62f032a202dd749cbd25334840ec7
|
DELETE /over_tags/1 DELETE /over_tags/1.json
|
[
{
"docid": "f6b5d99f5aafe3f927137ec56b5c85a3",
"score": "0.7299258",
"text": "def destroy\n @over_tag.destroy\n respond_to do |format|\n format.html { redirect_to over_tags_url, notice: 'Over tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "d67c29208071bc07677edfe1b1e5ef52",
"score": "0.7634441",
"text": "def tagDelete(tag)\n http, req = initReq(\"tags/#{tag}\", \"DELETE\")\n http.request(req).body\nend",
"title": ""
},
{
"docid": "d67c29208071bc07677edfe1b1e5ef52",
"score": "0.7634441",
"text": "def tagDelete(tag)\n http, req = initReq(\"tags/#{tag}\", \"DELETE\")\n http.request(req).body\nend",
"title": ""
},
{
"docid": "2b36d8808266472d4ec63d34ef97e58d",
"score": "0.7365817",
"text": "def destroy\n tag.destroy\n render json: {}, status: :no_content\n end",
"title": ""
},
{
"docid": "20ab39d737034e41e73231ca7d95ad9b",
"score": "0.73188645",
"text": "def destroy\n begin\n tag = Tagger::Tag.find(params[:id])\n tag.send(Tagger.association).delete_all\n tag.destroy\n render json: { message: \"Deleted successfully\" }\n rescue Exception => e\n render json: { error: \"Unprocessable entity\" }, status: 422\n end\n end",
"title": ""
},
{
"docid": "a186fb8918f5e50fdcb727f59277b686",
"score": "0.727592",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5949e000bc84dca0fec43fb4165c51e6",
"score": "0.717005",
"text": "def destroy\n @tag.destroy\n \n render json: {success: true}\n end",
"title": ""
},
{
"docid": "eb2c8e3df3441948788283ef26994b17",
"score": "0.71435136",
"text": "def destroy\n tagging = Tagging.find(params[:id])\n Tagging.deleteOne(tagging.name, tagging.bmark_id, current_user.id)\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a02ef74518df19d739c6770f62b66911",
"score": "0.7081431",
"text": "def destroy\n @tag.expunge\n\n respond_to do |format|\n format.html { redirect_to :tags, notice: \"Tag, #{@tag} deleted.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ea886d4acfc058cf9a63311701f113c",
"score": "0.70663565",
"text": "def delete\n @options[:connection].delete(\"/tags/#{path}\") && true\n end",
"title": ""
},
{
"docid": "b014c8633b33229fcccc6e032a3beb91",
"score": "0.7017803",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b014c8633b33229fcccc6e032a3beb91",
"score": "0.7016722",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b014c8633b33229fcccc6e032a3beb91",
"score": "0.7016722",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b014c8633b33229fcccc6e032a3beb91",
"score": "0.7016722",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b014c8633b33229fcccc6e032a3beb91",
"score": "0.7016722",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "30dd77b67b9e236a7b8a156d3c95dc01",
"score": "0.70151335",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "30dd77b67b9e236a7b8a156d3c95dc01",
"score": "0.70151335",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c77a194ddd892c1d575e74df72dce96f",
"score": "0.7012973",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c77a194ddd892c1d575e74df72dce96f",
"score": "0.7012973",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c77a194ddd892c1d575e74df72dce96f",
"score": "0.7012973",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c77a194ddd892c1d575e74df72dce96f",
"score": "0.7012973",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c77a194ddd892c1d575e74df72dce96f",
"score": "0.7012973",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "49b242fa00a9044e314004a24b637d2e",
"score": "0.7010086",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f15748b597d10327ff243520d964d8c3",
"score": "0.70005906",
"text": "def destroy\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d6bb6e44858cb933018d2210da0029d3",
"score": "0.6996275",
"text": "def destroy\r\n @tag = Tag.find_by_id(params[:id])\r\n @tag.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to tags_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "073f7e06a1a4314b12529ec41ac2998a",
"score": "0.69834834",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "13213e9b8bfea4b3f8daad9d9d8338b2",
"score": "0.69792163",
"text": "def destroy\n tag = Tag.find_by_id(params[:id])\n if !tag\n render_json_response(404, \"Could not find tag\")\n end\n\n if tag.destroy\n render_json_response(200, \"Removed tag successfully\")\n else\n render_json_response(406, \"Could not remove tag\")\n end\n end",
"title": ""
},
{
"docid": "fad6c9ee885f08c749e48bdedc1d5776",
"score": "0.69791794",
"text": "def destroy\n @tagged.destroy\n respond_to do |format|\n format.html { redirect_to taggeds_url, notice: 'Tagged was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0183c6e3f190dafa1ede18339eaf6999",
"score": "0.6972789",
"text": "def destroy\n @tag.destroy\n render json: { message: 'Tag was successfully deleted!' }\n end",
"title": ""
},
{
"docid": "0dd3428c2c0640685bc5a9b6d4a85d93",
"score": "0.6958607",
"text": "def destroy\n @post_tag = PostTag.find(params[:id])\n @post_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to post_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6bdd6d1310c6a8049b3921e31a384eb9",
"score": "0.6953196",
"text": "def destroy\n @tag = Tag.find_by_permalink!(params[:id])\n @object.tags.delete(@tag) if @object.tags.include?(@tag)\n\n respond_to do |format|\n format.html { redirect_to(@path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "206cf3c24217d152b80f4f6508ca0265",
"score": "0.69478834",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { head :no_content }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c91d742af3d73364f14a8847efa6e259",
"score": "0.69357944",
"text": "def destroy\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to Tag }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a14620bec8c1fb24ca43b277fadb7b0c",
"score": "0.693484",
"text": "def destroy\n @tag_post.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "27ea29304087a411caef46b3d3d921ab",
"score": "0.6933091",
"text": "def destroy\n# @tag = current_node.tags.find(params[:id])\n# authorize! :destroy, @tag\n @tag.destroy\n \n respond_with(@user) do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "804ebfe19f6dc12b3208bdbf32d2acf6",
"score": "0.6932276",
"text": "def destroy\n @posttag = Posttag.find(params[:id])\n @posttag.destroy\n\n respond_to do |format|\n format.html { redirect_to posttags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db20eaff77e56351d2da4dd12a52d1f",
"score": "0.69154894",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6b9c92bc1b4c58e40ea4e67315b39a12",
"score": "0.691032",
"text": "def destroy\n @pet_tag.destroy\n respond_to do |format|\n format.html { redirect_to pet_tags_url, notice: 'Pet tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d45b3ff629b3533a8974f8451c9f036b",
"score": "0.6894581",
"text": "def destroy\n @official_tag.destroy\n respond_to do |format|\n format.html { redirect_to admin_official_tags_path, notice: 'tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "216a1ce84db4b1f57605709987bb4f85",
"score": "0.6892622",
"text": "def destroy\n if @tag.destroy\n head :no_content\n else\n render json: {errors: @tag.errors}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9ce5c42a04e2afd9878770d0b814f28c",
"score": "0.68917567",
"text": "def destroy\n @tag = @business.tags.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to business_tags_url(@business) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9ce5c42a04e2afd9878770d0b814f28c",
"score": "0.68917567",
"text": "def destroy\n @tag = @business.tags.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to business_tags_url(@business) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9791bb212955f657ba1eb5b658379458",
"score": "0.6884124",
"text": "def dropletDeleteByTag(tag)\n http, req = initReq(\"droplets?tag_name=#{tag}\", \"DELETE\")\n http.request(req).body\n tagCleanUp()\nend",
"title": ""
},
{
"docid": "8aca0cb52f61b5925b424e79dd05ef0a",
"score": "0.68828636",
"text": "def destroy\n @tag.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "89eb7b4b298c11d94b6b1fcaee187483",
"score": "0.6875396",
"text": "def destroy\n @sub_tag.destroy\n respond_to do |format|\n format.html { redirect_to sub_tags_url, notice: 'Sub tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee3837f43702b56a64a6b5534b84bc13",
"score": "0.6873978",
"text": "def destroy\n @haircut_tag.destroy\n respond_to do |format|\n format.html { redirect_to haircut_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3c21245e53aa842dba29b5ae59cdb87e",
"score": "0.68570405",
"text": "def destroy\n @feed_item = FeedItem.find(params[:tagging][:feed_item_id])\n @tag = Tag(current_user, params[:tagging][:tag])\n \n current_user.taggings.find_by_feed_item(@feed_item, :all, \n :conditions => { :classifier_tagging => false, :tag_id => @tag }).each(&:destroy) \n\n respond_to :json\n end",
"title": ""
},
{
"docid": "34d88b150014fa6e367f8b500276c6a9",
"score": "0.68561715",
"text": "def destroy\n @recipe_tag = RecipeTag.find(params[:id])\n @recipe_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to recipe_tags_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8d58f522e62dea821fed8038cffcccd3",
"score": "0.68531275",
"text": "def destroy\n @tag = general_destroy(Tag, params[:id], tags_url)\n end",
"title": ""
},
{
"docid": "2fa813d570c5f363aff3416f6b486e7b",
"score": "0.6848123",
"text": "def destroy\n @koozy_tag = KoozyTag.find(params[:id])\n @koozy_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(koozy_tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0057a918cefef2cad2d8507225465814",
"score": "0.6837166",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "280c9f5e46efba2db450355a058e02b7",
"score": "0.6836697",
"text": "def destroy\n @posts_tag = PostsTag.find(params[:id])\n @posts_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8551e030253939975f1978c6a70ab2aa",
"score": "0.6833432",
"text": "def delete(tag)\n _params = {:tag => tag}\n return @master.call 'tags/delete', _params\n end",
"title": ""
},
{
"docid": "f94a041aae025b474cecc00367925386",
"score": "0.6831402",
"text": "def delete_tags(name); end",
"title": ""
},
{
"docid": "206cf7dc023449d7f9aafb3c4882c4f5",
"score": "0.6824405",
"text": "def destroy\n unless @tag.nil?\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "6db370be54520bde24eeca3af471485a",
"score": "0.68195957",
"text": "def destroy\n @insta_tag.destroy\n respond_to do |format|\n format.html { redirect_to insta_tags_url, notice: 'Insta tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "451e67835acf223294cd43591bb72bf8",
"score": "0.68164027",
"text": "def destroy\n @tagline = Tagline.find(params[:id])\n @tagline.destroy\n\n respond_to do |format|\n format.html { redirect_to taglines_url }\n format.json { head :no_content }\n end\n \n end",
"title": ""
},
{
"docid": "768b519e39d90314d6e0d9bcfb481cf5",
"score": "0.68142325",
"text": "def destroy\n @id3_tag.destroy\n respond_to do |format|\n format.html { redirect_to id3_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bdd0c22361e6d5be716054c4391f3d65",
"score": "0.68100923",
"text": "def destroy\r\n @app_tag = AppTag.where(user_id: params[:user_id], app_id: params[:app_id], tag_id: Tag.ensure(params[:tag_name]).id).first if params[:tag_name]\r\n # @app_tag = AppTag.where(user_id: params[:user_id], app_id: params[:app_id], tag_id: params[:tag_id]).first if params[:tag_id]\r\n @app_tag = AppTag.find(params[:id]) if params[:id]\r\n\r\n @app_tag.destroy\r\n app = App.find_by_id params[:app_id]\r\n app.tags_count(true)\r\n\r\n respond_to do |format|\r\n # format.json { head :no_content }\r\n format.json { render json: @app_tag }\r\n end\r\n end",
"title": ""
},
{
"docid": "253baf7dcf0792a49cd8093d0b758a04",
"score": "0.68041444",
"text": "def destroy\n\n\n @post = Post.find(params[:id])\n @t = Tag.find_all_by_post_id(params[:id])\n @t.each do |tag|\n tag.destroy\n tag.save\n end\n @post.destroy\n\n\n\n\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aa6520c02c731b772ce884d1c9d960d1",
"score": "0.6799185",
"text": "def destroy\n @resource_tag.destroy\n respond_to do |format|\n format.html { redirect_to resource_tags_url, notice: 'Resource tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1a848b5328711722656687eab0772727",
"score": "0.6795797",
"text": "def destroy\n @tag_two.destroy\n respond_to do |format|\n format.html { redirect_to tag_twos_url, notice: 'Tag two was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e7496c1d6790690280e51a4cec5acf52",
"score": "0.67909586",
"text": "def destroy\n @story_tag.destroy\n respond_to do |format|\n format.html { redirect_to story_tags_url, notice: 'Story tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6b09dc1914b68a0c6245eb009a1b025f",
"score": "0.6786654",
"text": "def delete(key)\n key = key.to_s\n\n @client.delete_tag key\n @tags.delete key\n\n nil\n end",
"title": ""
},
{
"docid": "d423759b5046def4d7b9df882e827fd3",
"score": "0.6786256",
"text": "def destroy\n @tag = @repository.tags.where(name: params[:tag_name]).first!\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2433ac95b6441435d7c01c9a6d0bee11",
"score": "0.67856693",
"text": "def destroy\n @tag_hash.destroy\n respond_to do |format|\n format.html { redirect_to tag_hashes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bedd82552368cec0bf06902736472f7d",
"score": "0.6769329",
"text": "def destroy\n @event_tag = EventTag.find(params[:id])\n @event_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to event_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "601b6d0ff292b79ce33035dbafbbf53c",
"score": "0.67632836",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html {redirect_to tags_url, notice: 'Tag removida com sucesso.'}\n format.json {head :no_content}\n end\n end",
"title": ""
},
{
"docid": "03f25781b6e1cbd40898adc0008e373c",
"score": "0.67594177",
"text": "def delete_tag(key)\n call_serf 'tags', '-delete', key\n end",
"title": ""
},
{
"docid": "db98f848a044940f330f01b78ec5aea5",
"score": "0.6752418",
"text": "def tags_delete(tag)\n params = { tag: tag }\n\n options = create_params(params)\n self.class.get('/tags/delete', options)\n nil\n end",
"title": ""
},
{
"docid": "f610ac818f172e7036686ece8449afef",
"score": "0.6751705",
"text": "def delete_tag(tag_name)\n self.class.delete \"/api2/tags/#{tag_name}\", default_options\n true\n end",
"title": ""
},
{
"docid": "c799ae6360ffd5aea9695f5cc4976666",
"score": "0.6749171",
"text": "def delete(tag)\n _params = {:tag => tag}\n return @master.call 'tags/delete', _params\n end",
"title": ""
},
{
"docid": "f22a21f20f35f5302c387c7f58c0fc14",
"score": "0.6748211",
"text": "def destroy\n params[:id].each{|id| \n tag = Tag.find(id.to_i)\n tag.destroy\n }\n\n respond_to do |format|\n format.html { redirect_to(tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a2eab52a8261ae813e007328f619c8c",
"score": "0.6746399",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1853488f0fecd4a0e23df241b58e41cf",
"score": "0.6741295",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n \n respond_to do |format|\n format.html { redirect_to(tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c8083b27b3bc5e58aafb6e69c94f2a97",
"score": "0.6734751",
"text": "def destroy\n current_user.tags.find(params[:id]).delete\n render :text => \"Success!\"\n end",
"title": ""
},
{
"docid": "e2367cddda9a8e728639dc592ad0d942",
"score": "0.6723362",
"text": "def destroy\n \n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ac0cd53ce3f46ebf0b7f570fd13314d0",
"score": "0.67165726",
"text": "def destroy\n @Title = \"Tags\"\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19af510e93a2ef6d11b9b7f4379fe0ec",
"score": "0.67125726",
"text": "def destroy\n @inspection = Inspection.find(params[:id])\n Tag.destroy_all(:inspection_id => @inspection.id)\n @inspection.destroy\n\n respond_to do |format|\n format.html { redirect_to inspections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ed73300f00c80509242976240c8d2b87",
"score": "0.66999024",
"text": "def delete_tag\n if request.post?\n @story.delete_tag(params[:tag_name])\n #seems silly\n @story = Story.find(params[:story_id])\n end\n end",
"title": ""
},
{
"docid": "d741ca0c176fb7dbcc09037c7c2cd1e3",
"score": "0.66989887",
"text": "def destroy\n @hash_tag = HashTag.find(params[:id])\n @hash_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to hash_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f7d61a823876b6b1a8317eeadd14d963",
"score": "0.6692816",
"text": "def destroy\n @int_tag = IntTag.find(params[:id])\n @int_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(int_tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c729ce781784947a5b3e4e3e77c2fe06",
"score": "0.6682964",
"text": "def destroy\n @tag_item = TagItem.find(params[:id])\n @tag_item.destroy\n\n respond_to do |format|\n format.html { redirect_to tag_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6eecd58210fb015aa097e82421cc7dd4",
"score": "0.66823417",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html do\n redirect_to tags_url,\n notice: t('shared.msgs.success_destroyed',\n obj: t('activerecord.models.tag', count: 1))\n end\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b6d6d284dbe98f4674bb2454312c0e72",
"score": "0.6681198",
"text": "def tag_delete(id, tag)\n wf_source_id?(id)\n wf_string?(tag)\n api.delete([id, 'tag', tag].uri_concat)\n end",
"title": ""
},
{
"docid": "1e4bfc6823b16ea1e2158d66c1bf0a69",
"score": "0.66802824",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cef37f3dfe05bc07131e1f0e94199172",
"score": "0.6678882",
"text": "def destroy\n @tagging.destroy\n respond_to do |format|\n format.html { redirect_to taggings_url, notice: 'Tagging was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e728d8f097de52a4a8df27f012eee631",
"score": "0.66787595",
"text": "def destroy\n @snippet_tag = SnippetTag.find(params[:id])\n @snippet_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to snippet_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8b2fc790633a15a4eba58f0e84f936fb",
"score": "0.66707224",
"text": "def destroy\n @recipes_diet_tag.destroy\n respond_to do |format|\n format.html { redirect_to recipes_diet_tags_url, notice: 'Recipes diet tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "25d187e72109af6d441c4f4736af8a8a",
"score": "0.6666923",
"text": "def destroy\n @master_tag = MasterTag.find(params[:id])\n @master_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to master_tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ff2cc7ecd4b152247114069c018d25ee",
"score": "0.6666202",
"text": "def destroy\n @item_tag.destroy\n respond_to do |format|\n format.html { redirect_to item_tags_url, notice: 'Item tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "920e3eab1695d302a6150611f6280680",
"score": "0.6660871",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "72666958661bb0c6e27449f91bf86816",
"score": "0.6659861",
"text": "def destroy\n @tag = Tag.find_by_name(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_tags_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "720042dc7f482a990b5540bbaf9f65e7",
"score": "0.6657842",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "720042dc7f482a990b5540bbaf9f65e7",
"score": "0.6657188",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "720042dc7f482a990b5540bbaf9f65e7",
"score": "0.6657188",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "720042dc7f482a990b5540bbaf9f65e7",
"score": "0.6657188",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "720042dc7f482a990b5540bbaf9f65e7",
"score": "0.6657188",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "720042dc7f482a990b5540bbaf9f65e7",
"score": "0.6657188",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "720042dc7f482a990b5540bbaf9f65e7",
"score": "0.6657188",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "720042dc7f482a990b5540bbaf9f65e7",
"score": "0.6657188",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html { redirect_to tags_url, notice: 'Tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
530252fe54d0656b7ade7a80fe95aed0
|
Calculate number of full nodes (nodes with all cores free) available that contain one or more GPUs available
|
[
{
"docid": "359ad863474b3b489bb460a311837d8b",
"score": "0.8255435",
"text": "def calc_full_nodes_avail\n @full_nodes_available = 0\n #if @cluster_title.eql?(\"Ruby\")\n # # See line 62\n #@full_nodes_available = nodes_info.lines(\"\\n\\n\").select { |node| node.include?(\"dedicated_threads = 0\") && node.include?(\"np = 20\") && node.include?(\"gpu_state=Unallocated\")}.size\n #else\n #@full_nodes_available = nodes_info.lines(\"\\n\\n\").select { |node| node.include?(\"dedicated_threads = 0\") && node.include?(\"gpu_state=Unallocated\") }.size\n #end\n end",
"title": ""
}
] |
[
{
"docid": "07e2e8eb9573e76c1caa8ec7d9298575",
"score": "0.79324883",
"text": "def calc_total_gpus\n @total_gpus = 0\n #if @cluster_title.eql?(\"Ruby\")\n # # For the Ruby cluster, pbsnodes takes into account two debug nodes with two GPUs along with the other Ruby GPU nodes. The debug nodes will not be considered in the total GPUs and unallocated GPUs calculation, as they cannot be allocated as part of a regular job request with other GPU nodes. Here np = 20 is the number of processors for a GPU node rather than a debug node (np = 16) in a Ruby cluster.\n # @total_gpus = nodes_info.scan(/np = 20/).size\n # else\n # @total_gpus = nodes_info.lines(\"\\n\\n\").size\n #end\n end",
"title": ""
},
{
"docid": "cfebad19b8de378a9f1f8945d3215524",
"score": "0.7328075",
"text": "def total_allocatable_job_nodes_cpu\n cpus = job_nodes.map {|n| n['status']['allocatable']['cpu'].to_i}\n cpus.inject {|sum,n| sum + n}\n end",
"title": ""
},
{
"docid": "c37bfa4231cf5ec644a336f5c1d81e6b",
"score": "0.7267041",
"text": "def calc_gpus_unallocated\n @gpus_unallocated = 0\n #if @cluster_title.eql?('Owens')\n # @gpus_unallocated = nodes_info.lines(\"\\n\\n\").select { |node|\n # !node.include?(\"dedicated_threads = 28\") && node.include?(\"Unallocated\") }.size\n # elsif @cluster_title.eql?('Pitzer')\n # @gpus_unallocated = nodes_info.lines(\"\\n\\n\").select { |node| !node.include?(\"dedicated_threads = 40\") }.to_s.scan(/gpu_state=Unallocated/).size\n # else @cluster_title.eql?('Ruby')\n # # See line 62. Excluding the two debug nodes from the calculation.\n # @gpus_unallocated = nodes_info.lines(\"\\n\\n\").select { |node| node.include?(\"Unallocated\") && !node.include?(\"dedicated_threads = 20\") && node.include?(\"np = 20\") }.size\n # @oodClustersAdapter.info_all_each { |job| p job}\n #end\n end",
"title": ""
},
{
"docid": "972179e06971f103a7994efe3577ced5",
"score": "0.68479174",
"text": "def calc_queued_jobs_requesting_GPUs\n @queued_jobs_requesting_gpus = 0\n #@queued_jobs_requesting_gpus = 0\n #@oodClustersAdapter.info_all_each { |job| queued_jobs_requesting_gpus_counter(job) }\n #@queued_jobs_requesting_gpus\n end",
"title": ""
},
{
"docid": "b5bd06860491018472d521065604332f",
"score": "0.6809248",
"text": "def total_capacity_job_nodes_cpu\n cpus = job_nodes.map {|n| n['status']['capacity']['cpu'].to_i}\n cpus.inject {|sum,n| sum + n}\n end",
"title": ""
},
{
"docid": "06ff1225a4caeebb0a77e0d074b6144f",
"score": "0.6724018",
"text": "def full_tree_node_count(min_capacity)\n full_tree_leaf_count(min_capacity) * 2 - 1\n end",
"title": ""
},
{
"docid": "4398f054c83645a3ec31ca9554fe6e58",
"score": "0.66813415",
"text": "def num_free_processors\n num_processors - processors_in_use\n end",
"title": ""
},
{
"docid": "b6482c736a2ee5198a962e6b4857bc95",
"score": "0.6654145",
"text": "def nodes_percent\n (nodes_used.to_f / nodes_avail.to_f) * 100\n end",
"title": ""
},
{
"docid": "8fd6c40577bbaf41eaea390bfe0cd5b1",
"score": "0.66360927",
"text": "def target_num_nodes() ; info[:target_num_nodes] ; end",
"title": ""
},
{
"docid": "d66fcddfbfe679526cc37f29572aeda5",
"score": "0.6490017",
"text": "def current_num_nodes() ; info[:current_num_nodes] ; end",
"title": ""
},
{
"docid": "457e25996760b2599356e8c341ad72fc",
"score": "0.6448316",
"text": "def num_source_nodes(total_nodes,sources_per,detectors_per)\n total_nodes.to_f / (sources_per.to_f/detectors_per.to_f + 1.0)\nend",
"title": ""
},
{
"docid": "4ec5d7880e8cc32b8d6906fb8da451ae",
"score": "0.6340213",
"text": "def number_of_cpu_cores\n case RbConfig::CONFIG['host_os']\n when /linux/\n Dir.glob('/sys/devices/system/cpu/cpu[0-9]*').count\n when /darwin|bsd/\n Integer(`sysctl -n hw.ncpu`)\n when /solaris/\n Integer(`kstat -m cpu_info | grep -w core_id | uniq | wc -l`)\n else\n 5\n end\n end",
"title": ""
},
{
"docid": "46f1ddf55bc1ae21de17270c4235ebdd",
"score": "0.63381755",
"text": "def ll_size()\n return @num_nodes\n end",
"title": ""
},
{
"docid": "ae613c4a1a9f12771ede67f7dabdaa92",
"score": "0.63156265",
"text": "def nr_of_regions\n ConnectedComponents.new(in_use_graph).count\n end",
"title": ""
},
{
"docid": "e804074b8ff8d8bc07448414349dcbcf",
"score": "0.63073397",
"text": "def ncpus\n case os\n when 'darwin'\n Integer(`hwprefs cpu_count`)\n when 'linux'\n cores = File.read(\"/proc/cpuinfo\").scan(/core id\\s+: \\d+/).uniq.size\n cores > 0 ? cores : 1\n else raise \"don't know how to determine CPU count on #{os}\"\n end\n end",
"title": ""
},
{
"docid": "5c0648fc60409e02f190e105d41e5d7d",
"score": "0.63040954",
"text": "def nodes\n @grpc.node_count\n end",
"title": ""
},
{
"docid": "2606fcd0a5427bed6112b6fe4334d12a",
"score": "0.6279268",
"text": "def count_used_instances\n count = 0\n return count\n end",
"title": ""
},
{
"docid": "aad59f91e235e7c0381e817a140122b8",
"score": "0.626637",
"text": "def percent_resources_used\n guests = self.xen_guests.map{|xm| m = xm.guest.machine; [m.ram, m.cpu_cores ]}.transpose.map{|c| c.sum }\n return [ 0, 0] if guests.empty?\n my_resources = [machine.ram,machine.cpu ]\n\n if my_resources.first == 0 or my_resources.last == 0 then\n return [ 0, 0] \n end\n \n# => [17152, 23]\n#>> [xen.model.ram, xen.model.cpu ]\n#=> [32768, 8]\n#>> (17152.to_f / 32768.to_f * 100) .to_i\n#=> 52\n#>> [ [17152, 23], [32768, 8]].transpose.map{|r| (r.first.to_f / r.last.to_f * 100).to_i }\n [ guests , my_resources ].transpose.map{|r| (r.first.to_f / r.last.to_f * 100).to_i }\n end",
"title": ""
},
{
"docid": "2e0c7986cb2b0cb5559515869d11966b",
"score": "0.625223",
"text": "def log_nodes_count\n @max_nodes += 1\n end",
"title": ""
},
{
"docid": "cf789956e23e0767798f0f3dd1ef30b4",
"score": "0.6241111",
"text": "def prepared_nodes_count\n Bebox::Node.list(self.project_root, self.environment, 'prepared_nodes').count\n end",
"title": ""
},
{
"docid": "48ddadc353aa9116d964b9da70123ea6",
"score": "0.61934763",
"text": "def gpus_percent\n ((0.10).to_f) * 100\n #((total_gpus - full_nodes_available).to_f / total_gpus.to_f) * 100\n end",
"title": ""
},
{
"docid": "4bed653c1ef538fd589ca2f4bdb3119b",
"score": "0.61792034",
"text": "def active_on_cluster_count\n (waiting_count + running_count)\n end",
"title": ""
},
{
"docid": "7be4be0c7b2afd886f8522cedfda4395",
"score": "0.6171838",
"text": "def get_node_ready(nodes)\n ready_nodes = nodes.select { |node| check_node_status(node) == \"ready\" }\n idle_nodes = []\n ready_nodes.each { |node| idle_nodes << node if !(DRbObject.new(nil, \"druby://#{node.ip}:9000\").executando_job) }\n idle_nodes.min{|a,b| DRbObject.new(nil, \"druby://#{a.ip}:9000\").cpu <=> DRbObject.new(nil, \"druby://#{b.ip}:9000\").cpu }\n end",
"title": ""
},
{
"docid": "3d3d44c64d206db525b00efa81466265",
"score": "0.61476207",
"text": "def processors_count\n @processors.length\n end",
"title": ""
},
{
"docid": "6051d31355fe24474d2ec2d65a933c53",
"score": "0.61409384",
"text": "def numvcpus\n begin\n os_cpu_cores\n rescue\n 4\n end\nend",
"title": ""
},
{
"docid": "6b0ab1c5c87f998f758e0a436e5cacd3",
"score": "0.6131155",
"text": "def size\n all_nodes.length\n end",
"title": ""
},
{
"docid": "4afccf3160ac2c2a2b45ec4f51ea1e73",
"score": "0.61301756",
"text": "def get_cpu_core_count\n # only support Linux for now\n os = Facter['kernel'].value\n physicalid = nil\n coreid = nil\n corecount = nil\n cores = {}\n if os == 'Linux'\n IO.foreach(\"/proc/cpuinfo\") do |line|\n if line =~ /^processor\\s*: (\\d+)/\n physicalid = nil\n coreid = nil\n elsif line =~ /^physical id\\s*: (\\d+)/\n physicalid = $1\n elsif line =~ /^core id\\s*: (\\d+)/\n coreid = $1;\n end\n if physicalid && coreid\n cores[\"#{physicalid}:#{coreid}\"] = 1;\n end\n end # IO.foreach\n corecount = cores.size\n end # if statement\n return corecount\n end",
"title": ""
},
{
"docid": "0084c048113886994a7c631aebcc7cdc",
"score": "0.6110116",
"text": "def cpu_cores\n `cat /proc/cpuinfo | grep bogomips | wc -l`.strip\n end",
"title": ""
},
{
"docid": "a22ee497edbc594e1a5a0c10bd2faa6f",
"score": "0.6100959",
"text": "def cluster_size\n `curl -s -i -L \\\n -u #{Conn[:creds]} \\\n -H 'content-type:application/json' \\\n #{[Conn[:host_api], 'nodes'].join('/')} | grep -o \"contexts\" | wc -l`\n end",
"title": ""
},
{
"docid": "812eb0bc9462a7bff8113f553385efeb",
"score": "0.60869133",
"text": "def get_number_of_cpu\n return `cat /proc/cpuinfo | grep processor | wc -l`.to_i\n end",
"title": ""
},
{
"docid": "dbcfdb4677dd7f52b73ed52def1a2e46",
"score": "0.60845715",
"text": "def count\n\t\t\t\t# CPU count can change during the program runtime\n\t\t\t\tcpuinfo.count { |x| x.start_with?('processor') }\n\t\t\tend",
"title": ""
},
{
"docid": "c6714bb9ac1cd90f8734a1f27f0377e5",
"score": "0.6074043",
"text": "def count\n number_of_trees + number_of_networks\n end",
"title": ""
},
{
"docid": "6a030a308a4a14da9796dcf58f7caca6",
"score": "0.6034751",
"text": "def node_size\n @results.size\n end",
"title": ""
},
{
"docid": "c8c4fbb8a8aa6fe384425cc47cd25e64",
"score": "0.5985286",
"text": "def all_ready_nodes\n current_platform_spec.nodes\n end",
"title": ""
},
{
"docid": "e1f3f4ac7e1d881a8c97e1681b77f192",
"score": "0.5974366",
"text": "def usage\n usage = 0\n instance.nodes.each do |node|\n data = DockerVolumeLocal::Node.new(node).remote_exec(\n %Q(sudo bash -c \"du --total --block-size 1024 -s #{DockerVolumeLocal.config[:docker_volume_path]}/#{instance.name}/_data | grep total\")\n )\n usage += data.split(\"\\t\")[0].strip.to_i\n end\n usage\n rescue\n nil\n end",
"title": ""
},
{
"docid": "d704e24949884a967b1c04bc8836fba0",
"score": "0.59692055",
"text": "def num_neighbors\r\n @neighbors.count\r\n end",
"title": ""
},
{
"docid": "1906bcfc7b919b2d6dc76f2f5acf1706",
"score": "0.59483165",
"text": "def cpu_count\n File.read(\"/proc/cpuinfo\").split(\"\\n\").select { |s| s.start_with?(\"processor\\t:\") }.size\n end",
"title": ""
},
{
"docid": "8ebe8f2b0b2e77b25fd4027d35be5408",
"score": "0.5944042",
"text": "def size_all\n\t\tfname=\"Node:#{__method__}\"\n\t\tret=0\n\t\tlevel=0\n\t\tbegin\n\t\t\tret=self.size_all_(ret, level)\n\t\trescue Exception=>e\n\t\t\tLOG.error(fname){\"EXCEPTION during nodes size calculation: #{e} \"}\n\t\tret=-1\n\t\tend\n\t\tret\n\tend",
"title": ""
},
{
"docid": "5f21777285f268a8025f8c56bf1dffda",
"score": "0.59244525",
"text": "def total_count\n object.nodes.size\n end",
"title": ""
},
{
"docid": "eb3a55e4e17076137cc7d29341eef5e7",
"score": "0.59189296",
"text": "def physical_processor_count\n @physical_processor_count ||= begin\n ppc =\n case RbConfig::CONFIG[\"target_os\"]\n when /darwin[12]/\n IO.popen(\"/usr/sbin/sysctl -n hw.physicalcpu\").read.to_i\n when /linux/\n cores = {} # unique physical ID / core ID combinations\n phy = 0\n File.read(\"/proc/cpuinfo\").scan(/^physical id.*|^core id.*/) do |ln|\n if ln.start_with?(\"physical\")\n phy = ln[/\\d+/]\n elsif ln.start_with?(\"core\")\n cid = \"#{phy}:#{ln[/\\d+/]}\"\n cores[cid] = true unless cores[cid]\n end\n end\n cores.count\n when /mswin|mingw/\n require 'win32ole'\n result_set = WIN32OLE.connect(\"winmgmts://\").ExecQuery(\n \"select NumberOfCores from Win32_Processor\"\n )\n result_set.to_enum.collect(&:NumberOfCores).reduce(:+)\n else\n processor_count\n end\n # fall back to logical count if physical info is invalid\n ppc > 0 ? ppc : processor_count\n end\n end",
"title": ""
},
{
"docid": "d322f5520e40e0d61990fc008337dcfb",
"score": "0.591523",
"text": "def all_nodes_ready?\n if current_platform_spec.nodes.nil?\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "33be56ff82ee1653b020df54434ca3b4",
"score": "0.5903565",
"text": "def concurrent_count\n debug(\"Getting puppet status\")\n\n running = 0\n\n @puppet.status do |resp|\n begin\n running += resp[:body][:data][:running].to_i\n rescue Exception => e\n debug(\"Failed to get node status: #{e}, continuing\")\n end\n end\n\n running\nend",
"title": ""
},
{
"docid": "d69a6213d84bc117aee7cfa0d084b880",
"score": "0.59019995",
"text": "def maxcpucount\n case RbConfig::CONFIG['host_os']\n when /darwin9/\n `hwprefs cpu_count`.to_i\n when /darwin/\n ((`which hwprefs` != '') ? `hwprefs thread_count` : `sysctl -n hw.ncpu`).to_i\n when /linux/\n `cat /proc/cpuinfo | grep processor | wc -l`.to_i\n when /freebsd/\n `sysctl -n hw.ncpu`.to_i\n when /mswin|mingw/\n require 'win32ole'\n wmi = WIN32OLE.connect(\"winmgmts://\")\n cpu = wmi.ExecQuery(\"select NumberOfLogicalProcessors from Win32_Processor\")\n cpu.to_enum.first.NumberOfLogicalProcessors\n end\nend",
"title": ""
},
{
"docid": "c2174ae626f41bf03438dd6d4ecc8402",
"score": "0.58990985",
"text": "def cu_desired\n if @queue.exists?\n # The additional number of compute units modifying this queue will\n # cost.\n (@desired - @queue.size) * @queue.cu_per_node\n else\n # The number of compute units creating this queue will cost.\n @desired * @queue.cu_per_node\n end\n end",
"title": ""
},
{
"docid": "418076d2ffd5509e5f36f2dd3531fa33",
"score": "0.5889358",
"text": "def cpu_count\n File.read(\"/proc/cpuinfo\").split(\"\\n\").count { |s| s.start_with?(\"processor\\t:\") }\n end",
"title": ""
},
{
"docid": "649864c6b37a6f71c2317f10b1283a8c",
"score": "0.5853011",
"text": "def guest_cpus\n begin\n host_cpus / 2\n rescue\n 4\n end\nend",
"title": ""
},
{
"docid": "2173d1f8add43024ddb5b4552a084b8f",
"score": "0.58508503",
"text": "def size\n @nodes.length\n end",
"title": ""
},
{
"docid": "2173d1f8add43024ddb5b4552a084b8f",
"score": "0.58508503",
"text": "def size\n @nodes.length\n end",
"title": ""
},
{
"docid": "f60f4d85a5405632c2fcd4de71094c96",
"score": "0.5849466",
"text": "def singleton_nodes\n all_node_ids = Node_Query.new(analysis_window: aw).run.first[:objects].collect{|n| n.id}.uniq\n all_nodes_in_ways = Way_Query.new(analysis_window: aw).run.first[:objects].collect{|w| w.nodes}.flatten.uniq\n # all_nodes_in_rels = Relation_Query.new(analysis_window: aw).run.first[:objects].collect{|r| r.nodes}.flatten.uniq\n nodes_not_in_ways_or_rels = (all_node_ids - all_nodes_in_ways).length\n puts \"Total Nodes: #{all_node_ids.length}, Nodes not in ways or relations: #{nodes_not_in_ways_or_rels}\"\n puts \"Percentage: #{nodes_not_in_ways_or_rels.to_f / all_node_ids.length.to_f}\"\n end",
"title": ""
},
{
"docid": "1f7b2ba039c113d8e72bd6b077a83bf3",
"score": "0.5845571",
"text": "def processor_count # rubocop:disable all\n @processor_count ||=\n begin\n if Overcommit::OS.windows?\n require 'win32ole'\n result = WIN32OLE.connect('winmgmts://').ExecQuery(\n 'select NumberOfLogicalProcessors from Win32_Processor'\n )\n result.to_enum.collect(&:NumberOfLogicalProcessors).reduce(:+)\n elsif File.readable?('/proc/cpuinfo')\n IO.read('/proc/cpuinfo').scan(/^processor/).size\n elsif File.executable?('/usr/bin/hwprefs')\n IO.popen('/usr/bin/hwprefs thread_count').read.to_i\n elsif File.executable?('/usr/sbin/psrinfo')\n IO.popen('/usr/sbin/psrinfo').read.scan(/^.*on-*line/).size\n elsif File.executable?('/usr/sbin/ioscan')\n IO.popen('/usr/sbin/ioscan -kC processor') do |out|\n out.read.scan(/^.*processor/).size\n end\n elsif File.executable?('/usr/sbin/pmcycles')\n IO.popen('/usr/sbin/pmcycles -m').read.count(\"\\n\")\n elsif File.executable?('/usr/sbin/lsdev')\n IO.popen('/usr/sbin/lsdev -Cc processor -S 1').read.count(\"\\n\")\n elsif File.executable?('/usr/sbin/sysctl')\n IO.popen('/usr/sbin/sysctl -n hw.ncpu').read.to_i\n elsif File.executable?('/sbin/sysctl')\n IO.popen('/sbin/sysctl -n hw.ncpu').read.to_i\n else\n # Unknown platform; assume 1 processor\n 1\n end\n end\n end",
"title": ""
},
{
"docid": "21e11c17b8b0cc52fd96e22d45d0778a",
"score": "0.5843745",
"text": "def processor_count; end",
"title": ""
},
{
"docid": "21e11c17b8b0cc52fd96e22d45d0778a",
"score": "0.5843745",
"text": "def processor_count; end",
"title": ""
},
{
"docid": "adb9449583eb27e3a5e7a86dbea991f6",
"score": "0.5839248",
"text": "def size\n @nodes.size\n end",
"title": ""
},
{
"docid": "1abadfd1117b621b898b05bd3491ace4",
"score": "0.5792549",
"text": "def cores\n return @cores if @cores\n count = ssh_cmd %q{cat /proc/cpuinfo|grep 'processor\\s*:' | wc -l}\n @cores = (count ? count.to_i : 1)\n end",
"title": ""
},
{
"docid": "ddb0e610d9d48f7934fbd8df77060593",
"score": "0.579235",
"text": "def free_block_count\n dev_stat ? dev_stat.blocks_free / (Block.size / dev_stat.block_size) : 0\n end",
"title": ""
},
{
"docid": "086581811de7265f27fe6078d9598008",
"score": "0.5781298",
"text": "def free_nodes\n nodes.select(&:is_free?)\n end",
"title": ""
},
{
"docid": "a13c26704ffc315c04b451da7f14a1db",
"score": "0.57773536",
"text": "def node_count\n @nodes.length - 1\n end",
"title": ""
},
{
"docid": "f4242b0dab953492f55f835f4547edfa",
"score": "0.5777018",
"text": "def processor_count\n case RbConfig::CONFIG['host_os']\n when /darwin9/\n `hwprefs cpu_count`.to_i\n when /darwin/\n (`which hwprefs` != '' ? `hwprefs thread_count` : `sysctl -n hw.ncpu`).to_i\n when /linux|cygwin/\n `grep -c ^processor /proc/cpuinfo`.to_i\n when /(net|open|free)bsd/\n `sysctl -n hw.ncpu`.to_i\n when /mswin|mingw/\n require 'win32ole'\n wmi = WIN32OLE.connect(\"winmgmts://\")\n cpu = wmi.ExecQuery(\"select NumberOfLogicalProcessors from Win32_Processor\")\n cpu.to_enum.first.NumberOfLogicalProcessors\n when /solaris2/\n `psrinfo -p`.to_i # this is physical cpus afaik\n else\n $stderr.puts \"Unknown architecture ( #{RbConfig::CONFIG[\"host_os\"]} ) assuming one processor.\"\n 1\n end\nend",
"title": ""
},
{
"docid": "1a3f8db3b99489313d4af72d861e6874",
"score": "0.57768464",
"text": "def used_bytes\n size = 0\n unless empty?\n actual_node = @tail_node\n while actual_node != nil do\n size += actual_node.value.value.length\n actual_node = actual_node.next_node\n end\n end\n size\n end",
"title": ""
},
{
"docid": "227e6b100d87ed2d5e23ed690207381f",
"score": "0.5752743",
"text": "def full_nodes_count(root)\n if root.nil?\n puts 'Empty tree'\n return\n end\n full_nodes_count = 0\n queue = QueueWithLinkedList.new\n queue.enqueue(root)\n while !queue.isEmpty?\n node = queue.dequeue\n full_nodes_count += 1 if node.left && node.right\n queue.enqueue(node.left) if node.left\n queue.enqueue(node.right) if node.right\n end\n full_nodes_count\n end",
"title": ""
},
{
"docid": "3ee821953d6dc6dd1ff913b8fece3aee",
"score": "0.57358545",
"text": "def number_of_processors\n if RUBY_PLATFORM =~ /linux/\n return `cat /proc/cpuinfo | grep processor | wc -l`.to_i\n elsif RUBY_PLATFORM =~ /darwin/\n return `sysctl -n hw.logicalcpu`.to_i\n elsif RUBY_PLATFORM =~ /win32/\n # this works for windows 2000 or greater\n require 'win32ole'\n wmi = WIN32OLE.connect(\"winmgmts://\")\n wmi.ExecQuery(\"select * from Win32_ComputerSystem\").each do |system| \n begin\n processors = system.NumberOfLogicalProcessors\n rescue\n processors = 0\n end\n return [system.NumberOfProcessors, processors].max\n end\n end\n raise \"can't determine 'number_of_processors' for '#{RUBY_PLATFORM}'\"\nend",
"title": ""
},
{
"docid": "61e23bc611f0f4a4fe98a0953df5b513",
"score": "0.5731213",
"text": "def bc_count\n \t@generic.size + @initial.size + @final.size + @cyclic.size\n end",
"title": ""
},
{
"docid": "60a3ef0fe305a48acb32354b0737f2d8",
"score": "0.57224876",
"text": "def size\n count = 0\n visit_nodes do\n count += 1\n end\n count\n end",
"title": ""
},
{
"docid": "2ab3d519939604e93d762b21517e6328",
"score": "0.571891",
"text": "def total\n object.nodes.size\n end",
"title": ""
},
{
"docid": "abcb2f29d77f971b7da685b64c5f0e7c",
"score": "0.5711073",
"text": "def processor_count\n @processor_count ||= begin\n os_name = RbConfig::CONFIG[\"target_os\"]\n if os_name =~ /mingw|mswin/\n require 'win32ole'\n result = WIN32OLE.connect(\"winmgmts://\").ExecQuery(\n \"select NumberOfLogicalProcessors from Win32_Processor\")\n result.to_enum.collect(&:NumberOfLogicalProcessors).reduce(:+)\n elsif File.readable?(\"/proc/cpuinfo\")\n IO.read(\"/proc/cpuinfo\").scan(/^processor/).size\n elsif File.executable?(\"/usr/bin/hwprefs\")\n IO.popen(\"/usr/bin/hwprefs thread_count\").read.to_i\n elsif File.executable?(\"/usr/sbin/psrinfo\")\n IO.popen(\"/usr/sbin/psrinfo\").read.scan(/^.*on-*line/).size\n elsif File.executable?(\"/usr/sbin/ioscan\")\n IO.popen(\"/usr/sbin/ioscan -kC processor\") do |out|\n out.read.scan(/^.*processor/).size\n end\n elsif File.executable?(\"/usr/sbin/pmcycles\")\n IO.popen(\"/usr/sbin/pmcycles -m\").read.count(\"\\n\")\n elsif File.executable?(\"/usr/sbin/lsdev\")\n IO.popen(\"/usr/sbin/lsdev -Cc processor -S 1\").read.count(\"\\n\")\n elsif File.executable?(\"/usr/sbin/sysconf\") and os_name =~ /irix/i\n IO.popen(\"/usr/sbin/sysconf NPROC_ONLN\").read.to_i\n elsif File.executable?(\"/usr/sbin/sysctl\")\n IO.popen(\"/usr/sbin/sysctl -n hw.ncpu\").read.to_i\n elsif File.executable?(\"/sbin/sysctl\")\n IO.popen(\"/sbin/sysctl -n hw.ncpu\").read.to_i\n else\n $stderr.puts \"Unknown platform: \" + RbConfig::CONFIG[\"target_os\"]\n $stderr.puts \"Assuming 1 processor.\"\n 1\n end\n end\n end",
"title": ""
},
{
"docid": "f8eea9eea3af6182820c5304f498e30c",
"score": "0.5710795",
"text": "def size\n counter = 0\n each { |node| counter += 1 }\n return counter\n end",
"title": ""
},
{
"docid": "bd6eee032a7beb2f21f99115c518cec6",
"score": "0.570963",
"text": "def total_free_space\n self.free_spaces.reduce(0, :+)\n end",
"title": ""
},
{
"docid": "73ab5a76f2e87ae3c66e86dc3173bd1c",
"score": "0.570892",
"text": "def node_count\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "c78b8439a13489a173ddbeb813516674",
"score": "0.56991684",
"text": "def get_anodes()\n nodes = [] ; 1.upto(32){|i|nodes << \"compute-0-#{i}\"}\n run_cluster(nodes, \"uptime\").map{|e|[e[0], e[1].scan(/\\d\\.\\d\\d/)[0].to_f, e[2]]}.sort_by{|e|e[1]} \nend",
"title": ""
},
{
"docid": "f3a1d4be5ff94c92ea1451931725d97d",
"score": "0.567346",
"text": "def cores\n @cores ||= (@node[\"cores\"] || []) + @node.find_all(\"core\")\n end",
"title": ""
},
{
"docid": "9951e36df0d8ca4e9e09524a4215458e",
"score": "0.5669774",
"text": "def total_workload\n @graders.map(&:workload).reduce(:+)\n end",
"title": ""
},
{
"docid": "3ed58835c7b8a680b591520f7784ade4",
"score": "0.56693476",
"text": "def physical_processor_count\n @physical_processor_count.value\n end",
"title": ""
},
{
"docid": "ea97e4f923bf766df294dd267cb64a80",
"score": "0.5669102",
"text": "def size_support(node)\n return 0 if node.nil?\n size_support(node.left) + 1 + size_support(node.right)\n end",
"title": ""
},
{
"docid": "346308bf182da7dd1b6f070d1670e185",
"score": "0.5667386",
"text": "def count\n count = 0\n\n each do |node|\n count += 1\n end\n\n return count\n end",
"title": ""
},
{
"docid": "ba9132f9e186a3dcdec425d35fc8b2b7",
"score": "0.56670004",
"text": "def get_njobs(nodes)\n\n # Reset job count on each input node\n nodes.each do |wn|\n wn[:njobs] = -1\n end\n\n begin\n pbsnodes_xml = REXML::Document.new( %x[ #{$cmd_pbsnodes} 2> /dev/null ] )\n rescue\n return\n end\n\n return if pbsnodes_xml.elements.empty?\n\n pbsnodes_xml.elements.each('//Data/Node') do |node_xml|\n\n name = node_xml.elements['name'].text\n is_offline = node_xml.elements['state'].text.include?('offline')\n is_down = node_xml.elements['state'].text.include?('down')\n\n jobs_xml = node_xml.elements['jobs']\n if jobs_xml\n njobs = jobs_xml.text.split(' ').length\n else\n njobs = 0\n end\n\n # Find matching input nodes: FQDN must be set, node must be up and offline\n nodes.each do |wn|\n next unless wn[:fqdn] and wn[:fqdn] == name and is_offline and !is_down\n wn[:njobs] = njobs\n end\n\n end\n\nend",
"title": ""
},
{
"docid": "e451b367ea242169d100dae2ad49b69a",
"score": "0.5661504",
"text": "def fork_count\n ENV['OPAL_PREFORK_THREADS']&.to_i || (Etc.nprocessors * 3 / 4.0).ceil\n end",
"title": ""
},
{
"docid": "715854a173abee39bd0f7dac74a24cc4",
"score": "0.56571937",
"text": "def active_node_count\n Puppet.debug('Querying PuppetDB for Active Nodes')\n pql = ['from', 'nodes',\n ['and',\n ['=', ['node', 'active'], true],\n ]\n ]\n results = query_puppetdb(pql)\n return nil if results.nil?\n Puppet.debug(results)\n results.count\n end",
"title": ""
},
{
"docid": "00d74e18fa89f5c5250f17d7f6de24b6",
"score": "0.5653763",
"text": "def getNodeElementCount\n return @nodeElements.size\n end",
"title": ""
},
{
"docid": "4085e18c467654544e33c739008a364c",
"score": "0.56499004",
"text": "def pool \n @pool.select(&:alive?).size\n end",
"title": ""
},
{
"docid": "58fd5944114f5fd3b15023bb225d214b",
"score": "0.56455004",
"text": "def test_size\n @results.map {|node_name, classes|\n classes.size\n }.reduce(:+) || 0\n end",
"title": ""
},
{
"docid": "33e8be072f9d741fe853730e5ad55fa0",
"score": "0.56305224",
"text": "def os_cpu_cores\n case RbConfig::CONFIG['host_os']\n when /darwin/\n Integer(`sysctl -n hw.ncpu`)\n when /linux/\n Integer(`cat /proc/cpuinfo | grep processor | wc -l`)\n else\n raise StandardError, \"Unsupported platform\"\n end\nend",
"title": ""
},
{
"docid": "8e1e242f1691f368e4ea9d17856a010a",
"score": "0.5628987",
"text": "def get_num_connections(params)\n # TODO: deal with node not existing (nil coming back from get_stats)\n get_stats(params)['STATISTIC_SERVER_SIDE_CURRENT_CONNECTIONS']\n end",
"title": ""
},
{
"docid": "e877ee38d029cf04b2b471f752817341",
"score": "0.56270427",
"text": "def cpu_percent_available?\n true\n end",
"title": ""
},
{
"docid": "a2a206e577069328a4c6d8b44207c168",
"score": "0.56210095",
"text": "def worker_count()\n @workers.size\n end",
"title": ""
},
{
"docid": "a2a206e577069328a4c6d8b44207c168",
"score": "0.56210095",
"text": "def worker_count()\n @workers.size\n end",
"title": ""
},
{
"docid": "246157fe00c32308c0801725e271531f",
"score": "0.56205595",
"text": "def size_without_waiters\n clients.inject(0) do |sum, element|\n sum += 1 unless element.waiting?\n sum\n end\n end",
"title": ""
},
{
"docid": "ac1518129ea8683411c5daa988d57c1a",
"score": "0.56034744",
"text": "def memused\n @memtotal - @memfree\n end",
"title": ""
},
{
"docid": "e8ac561007d76b0cb214b5d7dc1f8cfc",
"score": "0.55998343",
"text": "def returned_nodes_count\n @traversal_position.returnedNodesCount\n end",
"title": ""
},
{
"docid": "89dc2a665b8910e38ff75b812e68050f",
"score": "0.5593199",
"text": "def detect_cpu_cores_nix\n # On Unix platforms trying to use etc module to determine accessible\n # number of cores\n require 'etc'\n Etc.nprocessors\n end",
"title": ""
},
{
"docid": "e4339cc7cbafd62034a3fec4ca9861ef",
"score": "0.5593186",
"text": "def num_layers\n num_layers = 0\n # binding.pry\n while !nodes.where(net_id: id, layer: num_layers).empty?\n num_layers += 1\n end\n num_layers\n end",
"title": ""
},
{
"docid": "482fe358695939ea1267108499b21d93",
"score": "0.5584735",
"text": "def get_allocated_cells\n\t\tallocated_cells = 0.0;\n\t\t@cells.each { |i| i.each { |j| allocated_cells += 1 if j.type != Cell::BLOCKED } }\n\t\treturn (allocated_cells*Dungeon::ROOM_ALLOCATION_WEIGHT).floor\n\tend",
"title": ""
},
{
"docid": "6fe040c253a71de1f6d7a921457cc984",
"score": "0.5579027",
"text": "def tasks_total_count\n inject(0) do |sum, node|\n sum + node.graph.tasks_total_count\n end\n end",
"title": ""
},
{
"docid": "6fe040c253a71de1f6d7a921457cc984",
"score": "0.5579027",
"text": "def tasks_total_count\n inject(0) do |sum, node|\n sum + node.graph.tasks_total_count\n end\n end",
"title": ""
},
{
"docid": "bee6a115c6a5cb6d6430911b9abdc421",
"score": "0.55783135",
"text": "def njobs\n @pool.njobs\n end",
"title": ""
},
{
"docid": "b9c2373f5162b5ff3cd052b81953c27d",
"score": "0.5562147",
"text": "def busy_workers\n if @threadsafe\n 0\n else\n @workers.size - @worker_queue.size\n end\n end",
"title": ""
},
{
"docid": "279233665297ce599e3c6bc74a754707",
"score": "0.55556387",
"text": "def count_neighbors(x, y)\n return count_left(x, y) + count_right(x, y) + count_up(x, y) + count_down(x, y) + count_diagonals(x, y)\nend",
"title": ""
},
{
"docid": "000c9bd576c04041e1a9b06b2d47b3be",
"score": "0.5554956",
"text": "def get_allocated_cells\n allocated_cells = 0.0;\n @cells.each { |i| i.each { |j| allocated_cells += 1 if j.type != Cell::BLOCKED } }\n (allocated_cells*Dungeon::ROOM_ALLOCATION_WEIGHT).floor\n end",
"title": ""
},
{
"docid": "96fd47d1bcb343caed9203a0ac4c4e42",
"score": "0.55523694",
"text": "def available_node_list\n all_nodes = Node.by_name\n return all_nodes.select {|node| node.status == \"RUNNING\"}\n end",
"title": ""
},
{
"docid": "06430669cd8eff94e301aef9c4d95bab",
"score": "0.5549572",
"text": "def length\n @executor.getPoolSize\n end",
"title": ""
},
{
"docid": "f9ddd500109f39e453cf19cd97cbf1a6",
"score": "0.55456674",
"text": "def strongly_connected_components\n\t\t@explored_nodes = Array.new(size, false)\n\t\t@finishing_time_arr = Array.new(size)\n\t\t@scc = Array.new\n\t\t@dfs_queue = Array.new\n\t\t@finishing_time_queue = Array.new\n\t\t@finishing_time = 0\n\t\tcalculate_finishing_time\n\t\t@leaders = scc_call_order\n\t\tcalculate_scc\n\t\tputs \"#{@scc.map(&:count).sort.reverse.take(5)}\"\n\tend",
"title": ""
}
] |
04a90b04bb1bb66c0aad7ae5605caae9
|
POST /escalation_levels POST /escalation_levels.json
|
[
{
"docid": "9295cad18e120b91459321062b504b34",
"score": "0.6876609",
"text": "def create\n @escalation_level = EscalationLevel.new(escalation_level_params)\n authorize! :create, @escalation_level\n \n respond_to do |format|\n if @escalation_level.save\n format.html { redirect_to @escalation_level, notice: 'Escalation level was successfully created.' }\n format.json { render :show, status: :created, location: @escalation_level }\n else\n format.html { render :new }\n format.json { render json: @escalation_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "1cea7ec16a8726aab3ff13d9b857789a",
"score": "0.6815601",
"text": "def escalation_level_params\n params.require(:escalation_level).permit(:name)\n end",
"title": ""
},
{
"docid": "8d78a71e02f4fb2595dbbbe770e2d32b",
"score": "0.61455643",
"text": "def set_escalation_level\n @escalation_level = EscalationLevel.find(params[:id])\n end",
"title": ""
},
{
"docid": "b444aa2bca0efbd1f4cd029bcb37d2cb",
"score": "0.5992723",
"text": "def levels\n self.dig_for_integer(\"levels\")\n end",
"title": ""
},
{
"docid": "1fe62051cbe5fd5984d1fcf629535778",
"score": "0.5976659",
"text": "def energy_level_params\n params.require(:energy_level).permit(:user_id, :energy_level)\n end",
"title": ""
},
{
"docid": "051aa08d6b934b88ce1f4ca5578bd6b4",
"score": "0.5945325",
"text": "def create_difficulty_levels\n DifficultyLevel.create(title: 'Easy',\n description: 'Events are understandable for everyone without knowledge of the topic.',\n color: '#32CB2A', program_id: id)\n DifficultyLevel.create(title: 'Medium',\n description: 'Events require a basic understanding of the topic.',\n color: '#E6B65B', program_id: id)\n DifficultyLevel.create(title: 'Hard',\n description: 'Events require expert knowledge of the topic.',\n color: '#EF6E69', program_id: id)\n end",
"title": ""
},
{
"docid": "b8c713d63ce2604cf4e92cdc1a2b45dd",
"score": "0.5930801",
"text": "def update\n authorize! :update, @escalation_level\n respond_to do |format|\n if @escalation_level.update(escalation_level_params)\n format.html { redirect_to @escalation_level, notice: 'Escalation level was successfully updated.' }\n format.json { render :show, status: :ok, location: @escalation_level }\n else\n format.html { render :edit }\n format.json { render json: @escalation_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acd84bbe5f32440fb90eae33baab27ba",
"score": "0.591188",
"text": "def create\n @level = Level.new(level_params)\n\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render :show, status: :created, location: @level }\n else\n format.html { render :new }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acd84bbe5f32440fb90eae33baab27ba",
"score": "0.591188",
"text": "def create\n @level = Level.new(level_params)\n\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render :show, status: :created, location: @level }\n else\n format.html { render :new }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acd84bbe5f32440fb90eae33baab27ba",
"score": "0.591188",
"text": "def create\n @level = Level.new(level_params)\n\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render :show, status: :created, location: @level }\n else\n format.html { render :new }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acd84bbe5f32440fb90eae33baab27ba",
"score": "0.591188",
"text": "def create\n @level = Level.new(level_params)\n\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render :show, status: :created, location: @level }\n else\n format.html { render :new }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2606d8ef94c77225932698060cc55809",
"score": "0.58506054",
"text": "def create\n respond_to do |format|\n if @level.save\n format.html { redirect_to referential_level_path(@referential, @level), notice: 'Level was successfully created.' }\n format.json { render :show, status: :created, location: @level }\n else\n format.html { render :new }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b01fcedbccabe599fc555b8f613ae74a",
"score": "0.57801825",
"text": "def create\n @process_levels = ProcessLevel.create!(process_level_params)\n json_response(@process_levels, :created)\n end",
"title": ""
},
{
"docid": "9d6e737508e74b65abe883c605da2254",
"score": "0.5761723",
"text": "def create\n @registry_level = Registry::Level.new(registry_level_params)\n\n respond_to do |format|\n if @registry_level.save\n format.html { redirect_to @registry_level, notice: 'Área fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @registry_level }\n else\n format.html { render :new }\n format.json { render json: @registry_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d09432fc8cd2fa4dbf1b43f6fbbfbcf3",
"score": "0.5748215",
"text": "def level_params\n params.require(:education_level).permit(:name, :sequence, :program_ids => [])\n end",
"title": ""
},
{
"docid": "6ffc68675e71731d11851fc8acf3abb1",
"score": "0.5746925",
"text": "def level_params\n params[:level].permit([:name, :level_url, :level_num, :skin, {concept_ids: []}])\n end",
"title": ""
},
{
"docid": "8c37ac9d6c0abc19f2440407b3a8d252",
"score": "0.57410234",
"text": "def level_params\n params.require(:grade_level).permit(:level, :name, :next_level)\n end",
"title": ""
},
{
"docid": "4df2a1665dc956862acafe0636e1f03a",
"score": "0.57401663",
"text": "def level_params\n params[:level].permit([:maze, :name, :type, :level_url, :level_num, :skin, :instructions, :x, :y, :start_direction, :user, :step_mode, :is_k1, :nectar_goal, :honey_goal, :flower_type, {concept_ids: []}])\n end",
"title": ""
},
{
"docid": "85a6b3f04546e3d41afb0f8fe35f343d",
"score": "0.5738403",
"text": "def level=(value)\n @values['level'] = value\n end",
"title": ""
},
{
"docid": "f271bd7235a2caeb275db1799edf96a8",
"score": "0.57164073",
"text": "def assessments_levels_chart_data\n data = ::Api::Charts::MQAssessment.new(@mq_assessment).assessments_levels_data\n\n render json: data.chart_json\n end",
"title": ""
},
{
"docid": "a0d749242b3ef3eac5607204a47310a0",
"score": "0.5711394",
"text": "def risk_level_params\n params.require(:risk_level).permit(:level)\n end",
"title": ""
},
{
"docid": "4c2401e2db260f7b47bde095bc3bebd0",
"score": "0.5708772",
"text": "def destroy\n authorize! :destroy, @escalation_level\n @escalation_level.destroy\n respond_to do |format|\n format.html { redirect_to escalation_levels_url, notice: 'Escalation level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0b7b9d1225862be6f0a5a29b0d9204c7",
"score": "0.570364",
"text": "def create\n @ensemble_level = EnsembleLevel.new(ensemble_level_params)\n\n respond_to do |format|\n if @ensemble_level.save\n format.html { redirect_to @ensemble_level, notice: 'Nível de Núcleo criado com sucesso.' }\n format.json { render :show, status: :created, location: @ensemble_level }\n else\n format.html { render :new }\n format.json { render json: @ensemble_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5bb6eac3f8a42618e700bda45ddcb5e3",
"score": "0.56967056",
"text": "def new\r\n @levels = session[:kingdom].levels\r\n end",
"title": ""
},
{
"docid": "d9425826b0b9a0f01140ff2d462bb17c",
"score": "0.56911427",
"text": "def catch_params\n params.require(:catch).permit(:level)\n end",
"title": ""
},
{
"docid": "872aa650114a16ba32a5260a1fe0fb7d",
"score": "0.5687033",
"text": "def get_levels(opts = {})\n data, _status_code, _headers = get_levels_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "a340a43e106a352007dc99ef103ffbb7",
"score": "0.56852436",
"text": "def level_params\n params.require(:level).permit(:name, :description, :position, :cycle_id)\n end",
"title": ""
},
{
"docid": "e6881f5eb5f2fef8eb3e8de97497e899",
"score": "0.5681675",
"text": "def level_params\n params[:level].permit([:name, :level_url, :level_num, :skin, :instructions, :x, :y, :start_direction, {concept_ids: []}])\n end",
"title": ""
},
{
"docid": "a038a89aae80832ae83635f8daca635a",
"score": "0.56717795",
"text": "def level_params\n params.require(:level).permit(:number)\n end",
"title": ""
},
{
"docid": "186d29e2b99c6017d000c26b863cd2cf",
"score": "0.56693566",
"text": "def level=(level)\n # Check up and down limits\n level = [[level, $data_actors[@actor_id].final_level].min, 1].max\n # Change EXP\n self.exp = @exp_list[level]\n end",
"title": ""
},
{
"docid": "186d29e2b99c6017d000c26b863cd2cf",
"score": "0.56693566",
"text": "def level=(level)\n # Check up and down limits\n level = [[level, $data_actors[@actor_id].final_level].min, 1].max\n # Change EXP\n self.exp = @exp_list[level]\n end",
"title": ""
},
{
"docid": "744ad33171d57effb0a10b707aeb9d5e",
"score": "0.5658213",
"text": "def hqlevel_params\n params.require(:hqlevel).permit(:name, :level, :parent, :ranking, :reorderset, :locale,:chaos)\n end",
"title": ""
},
{
"docid": "af5fc757810b233ed1f103513144fa8a",
"score": "0.5632186",
"text": "def create\n @allowedvalueslevel = Allowedvalueslevel.new(allowedvalueslevel_params)\n\n respond_to do |format|\n if @allowedvalueslevel.save\n format.html { redirect_to @allowedvalueslevel, notice: 'Allowedvalueslevel was successfully created.' }\n format.json { render :show, status: :created, location: @allowedvalueslevel }\n else\n format.html { render :new }\n format.json { render json: @allowedvalueslevel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c515de0f4c9084e7ddea19f439fa49ff",
"score": "0.5627795",
"text": "def add_titration_level_set(level_name,type,levels,initial)\n name.set level_name\n type.nil? scheduled.click : unschedule.click\n remove_buttons.each { |remove| remove.click }\n levels.split(',').each_with_index { |level,index|\n add_level.click\n level_names[index].set level\n initial_dose[index].click if initial==level\n }\n save.click\n end",
"title": ""
},
{
"docid": "5c2b18eb904392f7fc5066be2a7efd14",
"score": "0.5615186",
"text": "def ensemble_level_params\n params.require(:ensemble_level).permit(:description, :precedence_order)\n end",
"title": ""
},
{
"docid": "6de5e4a5a96c31c22fc596005e22f7d1",
"score": "0.5611983",
"text": "def glucose_level_params\n params.require(:glucose_level).permit(:value, :user_id)\n end",
"title": ""
},
{
"docid": "95326b9083dad1dadb90b2c54ed2c25a",
"score": "0.5604112",
"text": "def userlevel_params\n params.require(:userlevel).permit(:level)\n end",
"title": ""
},
{
"docid": "21cb0892300f7b2d0837ac22861c7cfc",
"score": "0.5603942",
"text": "def create\n @privilege_level = PrivilegeLevel.new(privilege_level_params)\n\n respond_to do |format|\n if @privilege_level.save\n format.html { redirect_to @privilege_level, notice: 'Privilege level was successfully created.' }\n format.json { render action: 'show', status: :created, location: @privilege_level }\n else\n format.html { render action: 'new' }\n format.json { render json: @privilege_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b952a2001f68528b206a9db136d2cfc",
"score": "0.55928737",
"text": "def level\n nodes = EasyLevel.all\n inodes = IntermediateLevel.all\n dnodes = DifficultLevel.all\n cnodes = ChallengeLevel.all\n respond_to do |format|\n format.html { render :level, locals: { nodes: nodes, inodes: inodes, dnodes: dnodes, cnodes: cnodes} }\n end\n end",
"title": ""
},
{
"docid": "e569f7b9b86c35e59871e6950a63b87b",
"score": "0.5591902",
"text": "def level_params\r\n params.require(:level).permit(:name, :description, :ranking, :active)\r\n end",
"title": ""
},
{
"docid": "089681ca06107e02016df77ec92f4e2e",
"score": "0.55546504",
"text": "def hqlevel_params\n params.require(:hqlevel).permit(:name, :level, :parent)\n end",
"title": ""
},
{
"docid": "c174a983b3ed5145c1df73c60097391c",
"score": "0.5528167",
"text": "def level_params\n params.require(:level).permit(:name, :event_id, :game_id, :doors, :description, :level_image, :image)\n end",
"title": ""
},
{
"docid": "f1658067958db3fb5334bdbda44ce694",
"score": "0.5519589",
"text": "def character_level_params\n params.require(:character_level).permit(:character, :level, :character_class_id, :class_level, :hp)\n end",
"title": ""
},
{
"docid": "b7ae4811214c1f519d5f0f83ab4f45a6",
"score": "0.5518601",
"text": "def create\n authorize! :create, :level\n case params[:level_type]\n when 'maze'\n create_maze\n when 'artist'\n create_artist\n else\n raise \"Unkown level type #{params[:level_type]}\"\n end\n end",
"title": ""
},
{
"docid": "64e0661cc888f4c822c8a6fc61147216",
"score": "0.5514707",
"text": "def levels\n (0..11).to_a\n end",
"title": ""
},
{
"docid": "8cdcf7113a3eb1f5a145cbcaf8df9dbc",
"score": "0.5512229",
"text": "def create\n @exam_level = ExamLevel.new(params[:exam_level])\n\n respond_to do |format|\n if @exam_level.save\n format.html { redirect_to @exam_level, notice: 'Exam level was successfully created.' }\n format.json { render json: @exam_level, status: :created, location: @exam_level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exam_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe3de582a2724fa75c179201df447ec3",
"score": "0.5510794",
"text": "def load_levels\n @levels = @course.numbered_levels\n end",
"title": ""
},
{
"docid": "7850af1f0e2399d451fe89cd8b0ce1e9",
"score": "0.5505265",
"text": "def hierarchy_levels\n @hierarchy_levels ||= {}\n end",
"title": ""
},
{
"docid": "ba35fe914110cdbcc2c6225c60522c91",
"score": "0.54993165",
"text": "def levels\n [1, 3, 5, 7, 9]\n end",
"title": ""
},
{
"docid": "64f1498c472cea5873482600990b4101",
"score": "0.54896444",
"text": "def create\n @userlevel = Userlevel.new(userlevel_params)\n\n respond_to do |format|\n if @userlevel.save\n format.html { redirect_to @userlevel, notice: 'Userlevel was successfully created.' }\n format.json { render :show, status: :created, location: @userlevel }\n else\n format.html { render :new }\n format.json { render json: @userlevel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ac160e3a701518cd8f7280e703387bb",
"score": "0.54881984",
"text": "def create\n @glucose_level = GlucoseLevel.new(glucose_level_params)\n respond_to do |format|\n @glucose_level.valid?\n if @glucose_level.errors.blank?\n @glucose_level.save\n format.html { redirect_to glucose_levels_path, notice: 'Glucose level was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "bb4130b16cded6dfc30b982af45193c1",
"score": "0.5475592",
"text": "def create\n @educational_level = EducationalLevel.new(params[:educational_level])\n\n respond_to do |format|\n if @educational_level.save\n flash[:notice] = 'EducationalLevel was successfully created.'\n format.html { redirect_to(@educational_level) }\n format.xml { render :xml => @educational_level, :status => :created, :location => @educational_level }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @educational_level.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d1eeddfeb13eb981b37fbdbc1e5480d",
"score": "0.54691356",
"text": "def gradelevel_params\n params.require(:gradelevel).permit(:name, :level)\n end",
"title": ""
},
{
"docid": "00d574f19e8ede3b5d343d0be7d2406d",
"score": "0.54578185",
"text": "def create\n @energy_level = EnergyLevel.new(energy_level_params)\n @energy_level.user_id = current_user\n @energy_level.save\n flash[:success] = \"Energy Level Updated!\"\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "025423ffec9e674fcce64a7eeabe6e1d",
"score": "0.5455882",
"text": "def create\n @level_of_effort = LevelOfEffort.new(level_of_effort_params)\n\n respond_to do |format|\n if @level_of_effort.save\n format.html { redirect_to @level_of_effort, notice: 'Level of effort was successfully created.' }\n format.json { render :show, status: :created, location: @level_of_effort }\n else\n format.html { render :new }\n format.json { render json: @level_of_effort.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30d5790b2358d3207dc9f3dfdef9a320",
"score": "0.54552037",
"text": "def create\n @complexitylevel = Complexitylevel.new(complexitylevel_params)\n\n respond_to do |format|\n if @complexitylevel.save\n format.html { redirect_to @complexitylevel, notice: 'Complexitylevel was successfully created.' }\n format.json { render action: 'show', status: :created, location: @complexitylevel }\n else\n format.html { render action: 'new' }\n format.json { render json: @complexitylevel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2a78b93eae5988529f9c5e27c9e1f7d",
"score": "0.5453893",
"text": "def level_params\n params.require(:level).permit(:name, :description)\n end",
"title": ""
},
{
"docid": "f9034658d1f1eedc2840e728eb2a5eb3",
"score": "0.5439409",
"text": "def handle_power_levels(event)\n content = event['content']\n @permissions.update content\n @users.process_power_levels @room, content['users']\n end",
"title": ""
},
{
"docid": "ba903ef0eed6ba506ac0fa1e4ebb44b4",
"score": "0.5434633",
"text": "def create\n authorize! :create, :level\n type_class = level_params[:type].constantize\n\n # Set some defaults.\n params[:level].reverse_merge!(skin: type_class.skins.first)\n params.merge!(user: current_user)\n\n begin\n @level = type_class.create_from_level_builder(params, level_params)\n rescue ArgumentError => e\n render status: :not_acceptable, json: {error: e.message}.to_json and return\n rescue ActiveRecord::RecordInvalid => invalid\n render status: :not_acceptable, json: invalid.record.errors.to_json and return\n end\n\n render json: { redirect: game_level_url(@level.game, @level) }.to_json\n end",
"title": ""
},
{
"docid": "c3fa2269aa72a9c8350b6583a84b4b55",
"score": "0.5430281",
"text": "def complexitylevel_params\n params.require(:complexitylevel).permit(:complexitylevel)\n end",
"title": ""
},
{
"docid": "a7e92a24724a7229ed2760495b6287f8",
"score": "0.54260224",
"text": "def create\n @character_level = CharacterLevel.new(character_level_params)\n\n respond_to do |format|\n if @character_level.save\n format.html { redirect_to @character_level, notice: 'Character level was successfully created.' }\n format.json { render action: 'show', status: :created, location: @character_level }\n else\n format.html { render action: 'new' }\n format.json { render json: @character_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57f58a82272fccf00f356f1291fed20f",
"score": "0.54208285",
"text": "def create\n @training_level = TrainingLevel.new(training_level_params)\n\n respond_to do |format|\n if @training_level.save\n format.html { redirect_to @training_level, notice: 'Training level was successfully created.' }\n format.json { render :show, status: :created, location: @training_level }\n else\n format.html { render :new }\n format.json { render json: @training_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ac9bdaa8e2132616259535fac915601",
"score": "0.5419948",
"text": "def create\n @course_level = CourseLevel.new(params[:course_level])\n\n respond_to do |format|\n if @course_level.save\n format.html { redirect_to course_levels_path, notice: 'Course level was successfully created.' }\n format.json { render json: @course_level, status: :created, location: @course_level, course_levels: CourseLevel.all }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "69d2be0b22248b4428e266dcf4bad994",
"score": "0.5412582",
"text": "def level=(level)\n level = [[level, final_level].min, 1].max\n self.exp = @exp_list[level]\n end",
"title": ""
},
{
"docid": "da5ece0c1caee2115d3aa8e2fbdfc397",
"score": "0.54040545",
"text": "def create\n @game_level = @game.game_levels.new(game_level_params)\n\n respond_to do |format|\n if @game_level.save\n format.html { redirect_to game_game_levels_path(@game), notice: 'Game level was successfully created.' }\n format.json { render :show, status: :created, location: @game_level }\n else\n format.html { render :new }\n format.json { render json: @game_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56bed2b9b06f6e1f1bfd2a84d80f0489",
"score": "0.5401267",
"text": "def level=(value)\n @level = value\n end",
"title": ""
},
{
"docid": "56bed2b9b06f6e1f1bfd2a84d80f0489",
"score": "0.5401267",
"text": "def level=(value)\n @level = value\n end",
"title": ""
},
{
"docid": "6bb6e6daf1f438a4e7cee83c7f0eab02",
"score": "0.5388093",
"text": "def levels_chart_data\n data = ::Api::Charts::Sector.new(\n companies_scope(params), enable_beta_mq_assessments: session[:enable_beta_mq_assessments]\n ).companies_count_by_level\n\n render json: data.chart_json\n end",
"title": ""
},
{
"docid": "1780d647ed4abe6aca994e9168860681",
"score": "0.5386895",
"text": "def create\n @level = Level.new(params[:level])\n\n respond_to do |format|\n if @level.save\n flash[:notice] = 'Level was successfully created.'\n format.html { redirect_to(@level) }\n format.xml { render :xml => @level, :status => :created, :location => @level }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @level.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "393688d4c68a41d03ff93e3ab06029df",
"score": "0.5380498",
"text": "def level=(level)\n # Check up and down limits\n level = [[level, maxlevel].min, 1].max\n # Change EXP\n self.exp = @exp_list[level]\n end",
"title": ""
},
{
"docid": "afe29ec58b155582b4bee8c362f81833",
"score": "0.5378862",
"text": "def create\n @auth_level = AuthLevel.new(params[:auth_level])\n\n respond_to do |format|\n if @auth_level.save\n format.html { redirect_to @auth_level, notice: 'Auth level was successfully created.' }\n format.json { render json: @auth_level, status: :created, location: @auth_level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @auth_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44387cbf8ca19a10e8e90fd130a83100",
"score": "0.53635395",
"text": "def levels\n @@levels ||= platform::Levels.new\n end",
"title": ""
},
{
"docid": "accaafa964317dbe989735ee512a419b",
"score": "0.5361491",
"text": "def create\n @production_level = ProductionLevel.new(params[:production_level])\n\n respond_to do |format|\n if @production_level.save\n format.html { redirect_to @production_level, notice: 'Production level was successfully created.' }\n format.json { render json: @production_level, status: :created, location: @production_level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @production_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d9239ea00fd434fe82141075073cfb8",
"score": "0.53602487",
"text": "def fire_ant_risk_levels\n [\n ['None', 0],\n ['Medium', 1],\n ['High', 2]\n ]\n end",
"title": ""
},
{
"docid": "36dfabd5a206f15a387faad4798efa2c",
"score": "0.53552717",
"text": "def level=(s)\n write_attribute(:level, VALID_LEVELS[s])\n end",
"title": ""
},
{
"docid": "e9d1603dc99c33959bdb68cce7858e8b",
"score": "0.53521764",
"text": "def create\n @question_level = QuestionLevel.new(params[:question_level])\n\n respond_to do |format|\n if @question_level.save\n format.html { redirect_to @question_level, notice: 'Question level was successfully created.' }\n format.json { render json: @question_level, status: :created, location: @question_level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7867885953ce93dd070586f4f42cc333",
"score": "0.5347356",
"text": "def hormone_level_params\n params.require(:hormone_level).permit(:level, :min, :max)\n end",
"title": ""
},
{
"docid": "e9509522bfd7e2bb16c577958adc2894",
"score": "0.5337304",
"text": "def level_params\n params.require(:level).permit(:title, :start_date, :end_date, :duration, :start_time, :end_time, :level_remarks, :days_of_week)\n end",
"title": ""
},
{
"docid": "3ef675057e272b55f043c062c6152dc2",
"score": "0.53307813",
"text": "def spell_level_params\n params.require(:spell_level).permit(:spell_id, :character_class_id, :level)\n end",
"title": ""
},
{
"docid": "39832648792f074c1076433e52239d85",
"score": "0.5324711",
"text": "def create\n @level = Level.new(params[:level])\n\n respond_to do |format|\n if @level.save\n flash[:notice] = 'Level was successfully created.'\n format.html { redirect_to(@level) }\n format.xml { render :xml => @level, :status => :created, :location => @level }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @level.errors }\n end\n end\n end",
"title": ""
},
{
"docid": "275aadc3a151ffd79bcb949f15e5f80c",
"score": "0.53218555",
"text": "def level=(value)\n set :level, value\n end",
"title": ""
},
{
"docid": "34aa217470ad5eb04ee54bc16965908f",
"score": "0.5317837",
"text": "def create\n @high_level_term = HighLevelTerm.new(high_level_term_params)\n\n respond_to do |format|\n if @high_level_term.save\n format.html { redirect_to @high_level_term, notice: 'High level term was successfully created.' }\n format.json { render :show, status: :created, location: @high_level_term }\n else\n format.html { render :new }\n format.json { render json: @high_level_term.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "07f568c66e203dcbfad663cb26ffe403",
"score": "0.5315931",
"text": "def set_level_names(levels)\n levels.each_with_index do |level, index|\n self['level_' + index.to_s + '_name'] = level\n end\n save\n end",
"title": ""
},
{
"docid": "aa5a20238c207a4a0a64a1e8bd960975",
"score": "0.53088963",
"text": "def privilege_level_params\n params.require(:privilege_level).permit(:name)\n end",
"title": ""
},
{
"docid": "49dde56c91a606c564f9a8c63bc277c6",
"score": "0.5307992",
"text": "def get_levels\n return @level\n end",
"title": ""
},
{
"docid": "8f08f4c6ff4db1e50b8315855e3af546",
"score": "0.5307443",
"text": "def create\n @urgency_level = UrgencyLevel.new(urgency_level_params)\n\n respond_to do |format|\n if @urgency_level.save\n format.html { redirect_to @urgency_level, notice: 'Urgency level was successfully created.' }\n format.json { render :show, status: :created, location: @urgency_level }\n else\n format.html { render :new }\n format.json { render json: @urgency_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b2d8d15393bb8fe5d7dddaa6f05f3ee6",
"score": "0.5302416",
"text": "def valid_levels\n raise \"The logging class did not supply a valid_levels method\"\n end",
"title": ""
},
{
"docid": "43cc44561b1d35d6977c1c989aa16b6a",
"score": "0.5297994",
"text": "def get_game_levels\n\t\tlevels = Level.order(\"points DESC\").all\n\t\trender :json => levels.map{|level| level.as_json(:only=>[:id,:name,:points],:methods => :image)}.to_json\n\tend",
"title": ""
},
{
"docid": "ea7bb839c71b1640d80b3614c8306fd2",
"score": "0.52958256",
"text": "def level=(value)\n @level = value\n end",
"title": ""
},
{
"docid": "774f131628c9c9b1947ccd8316fc16f2",
"score": "0.52953684",
"text": "def create\n @experience_level = ExperienceLevel.new(user_params)\n\n respond_to do |format|\n if @experience_level.save\n format.html { redirect_to @experience_level, notice: 'Experience level was successfully created.' }\n format.json { render json: @experience_level, status: :created, location: @experience_level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @experience_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17d151076363239041dd6b7085a6b083",
"score": "0.52930725",
"text": "def level_params\n params.fetch(:level, {})\n end",
"title": ""
},
{
"docid": "17d151076363239041dd6b7085a6b083",
"score": "0.52930725",
"text": "def level_params\n params.fetch(:level, {})\n end",
"title": ""
},
{
"docid": "17d151076363239041dd6b7085a6b083",
"score": "0.52930725",
"text": "def level_params\n params.fetch(:level, {})\n end",
"title": ""
},
{
"docid": "b6116bc92fa313af49cda5be22e34e8b",
"score": "0.52924764",
"text": "def update\n respond_to do |format|\n if @escalation_rule.update(escalation_rule_params)\n @escalation_rule.levels.each {|level| level.destroy}\n params[:escalation_rule][:contacts].each do |i, contact|\n Level.create(escalation_rule: @escalation_rule, contact_id: contact['id'], level_number: contact['level'])\n end\n format.html { redirect_to @escalation_rule, notice: 'Escalation rule was successfully updated.' }\n format.json { render :show, status: :ok, location: @escalation_rule }\n else\n format.html { render :edit }\n format.json { render json: @escalation_rule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d99e97586864f9cfb6a8ac1d1c8852b8",
"score": "0.52878374",
"text": "def constructional_level_params\n params.require(:constructional_level).permit(:name, :code, :options)\n end",
"title": ""
},
{
"docid": "9102d0c34442e90a98ca36b7cd692b84",
"score": "0.52845",
"text": "def level_params\n params.require(:level).permit(:name, :gamemode, :image_url)\n end",
"title": ""
},
{
"docid": "ce3ee2285c0174031c64cbea3a1611c6",
"score": "0.52835476",
"text": "def create\n @auction_level = Auction::Level.new(auction_level_params)\n\n respond_to do |format|\n if @auction_level.save\n format.html { redirect_to @auction_level, notice: 'Level was successfully created.' }\n format.json { render :show, status: :created, location: @auction_level }\n else\n format.html { render :new }\n format.json { render json: @auction_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d3cbe756086b9b9149b915d750449ab",
"score": "0.52807456",
"text": "def create\n @escalation_rule = current_org.escalation_rules.new(escalation_rule_params)\n params[:escalation_rule][:contacts].each do |i, contact|\n if Contact.find(contact['id']).unverified?\n return respond_to do |format|\n format.html { render :new , status: :unprocessable_entity}\n format.json { render json: { error: \"Contacts should be verified\"}, status: :unprocessable_entity }\n end\n end\n Level.create(escalation_rule: @escalation_rule, contact_id: contact['id'], level_number: contact['level'])\n end\n respond_to do |format|\n if @escalation_rule.save\n format.html { redirect_to @escalation_rule, notice: 'Escalation rule was successfully created.' }\n format.json { render :show, status: :created, location: @escalation_rule }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: { error: @escalation_rule.errors.full_messages }, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d12a20cb12a8984b5bc0514e4ae88b0",
"score": "0.52806383",
"text": "def allowedvalueslevel_params\n params.require(:allowedvalueslevel).permit(:values)\n end",
"title": ""
},
{
"docid": "789d7e3660a02d7f1f60847b7aa07f9c",
"score": "0.5279191",
"text": "def pain_level_params\n params.require(:pain_level).permit(:pain_level)\n end",
"title": ""
},
{
"docid": "5df9180f110b4eeaf813e5dd3bb7b621",
"score": "0.5276849",
"text": "def create\n @english_level = EnglishLevel.new(params[:english_level])\n\n respond_to do |format|\n if @english_level.save\n format.html { redirect_to english_levels_path, notice: 'English level was successfully created.' }\n format.json { render json: @english_level, status: :created, location: @english_level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @english_level.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
a4f6ab0d2e1f048fa6ebab557d213d37
|
Renders the date and time in a given format for the current user's time zone. The default time zone is whatever is set in the environment.rb (i.e. UTC) when the current user cannot be determined. See /config/initializers/date_time.rb for predefined formats. ==== Parameters +date_time+ The datetime object to be formatted. +format+ The format to use, defaults to :default.
|
[
{
"docid": "777522ba03a830a2877397df08220fa0",
"score": "0.7497362",
"text": "def render_current_user_date_time date_time, format = :default\n date_time.in_time_zone(current_user.time_zone).to_s(format) if date_time && current_user\n end",
"title": ""
}
] |
[
{
"docid": "0b0a4140fb9cfbecc941154dd4253865",
"score": "0.69951826",
"text": "def current_user_date_time(date_time)\n return unless date_time\n\n Formatter::TimeWithZone.format date_time, nil, current_user: current_user\n end",
"title": ""
},
{
"docid": "f1ce2893e32e9486fa874d9affe87227",
"score": "0.6877487",
"text": "def format_datetime(date, format = :long, user: nil)\n user ||= respond_to?(:current_user) ? current_user : nil\n user_zone = user&.time_zone || Application.config.x.default_user_time_zone\n # TODO: Fix the query. This is a workaround to display the time in the correct zone, there are\n # places where datetimes are directly fetched from db and skipped AR, which result in incorrect\n # time zone.\n date = date.in_time_zone(user_zone) if date.zone != user_zone\n\n date.to_formatted_s(format)\n end",
"title": ""
},
{
"docid": "f1ce2893e32e9486fa874d9affe87227",
"score": "0.6877487",
"text": "def format_datetime(date, format = :long, user: nil)\n user ||= respond_to?(:current_user) ? current_user : nil\n user_zone = user&.time_zone || Application.config.x.default_user_time_zone\n # TODO: Fix the query. This is a workaround to display the time in the correct zone, there are\n # places where datetimes are directly fetched from db and skipped AR, which result in incorrect\n # time zone.\n date = date.in_time_zone(user_zone) if date.zone != user_zone\n\n date.to_formatted_s(format)\n end",
"title": ""
},
{
"docid": "009a1c1b807abbdf7b188dbd5982695f",
"score": "0.654161",
"text": "def display_time(time,format = :qjitsu_standard)\n format = case format\n when :qjitsu_standard\n \"%b %d, %Y %I:%M %p %Z\"\n when :B_e_Y\n \"%B %e, %Y\" \n when :datetime_picker\n \"%m/%d/%Y %I:%M %p %Z\"\n else \n format\n end\n\n if(time.present?)\n time.in_time_zone.strftime(format)\n end\n end",
"title": ""
},
{
"docid": "b547cb1b496601e74f7ccb0bbbbcd5cd",
"score": "0.6354516",
"text": "def format_datetime(date, format)\n date_string = format_date(date, format)\n date = datetime(date)\n time_string = date.strftime('%-I:%M %p')\n %Q{#{date_string} at #{time_string}}\n end",
"title": ""
},
{
"docid": "b88b6817bc92fc3ee4d6b9cbe6e3a4ec",
"score": "0.62064064",
"text": "def format_date_time(date_time)\n if defined?(ActiveSupport)\n date_time.strftime(DATE_TIME_FORMAT)\n else\n date_time.inspect\n end\n end",
"title": ""
},
{
"docid": "3edd6cd48fc7c3cd738969d0d2befd3c",
"score": "0.6206352",
"text": "def format_time(date_time)\n date_time.strftime('%Y-%m-%d %H:%M %Z')\n end",
"title": ""
},
{
"docid": "23d2b0ed6cd593f42d021cd62a9cf6e3",
"score": "0.60617536",
"text": "def format_date_time(date_time)\n date_time.strftime '%Y-%m-%d %H:%M:%S'\n end",
"title": ""
},
{
"docid": "b8c237d5b2a17aa5d76486545c503268",
"score": "0.5988555",
"text": "def format_date datetime\n begin\n zone = ActiveSupport::TimeZone.new(\"Pacific Time (US & Canada)\")\n d = datetime.is_a?(Time) ? datetime : DateTime.parse(datetime).in_time_zone(zone)\n I18n.l(d)\n rescue\n d = datetime.is_a?(Time) ? datetime : Time.parse(datetime.to_s)\n d.strftime('%Y-%m-%d %I:%M%p')\n end\n end",
"title": ""
},
{
"docid": "45e3504086df0c5371d21237410770f0",
"score": "0.5944865",
"text": "def time_format(date)\n full_date = DATE_FORMAT % [date.year, date.month, date.day]\n time = TIME_FORMAT % [date.hour, date.min]\n [full_date + \" \" + time]\n end",
"title": ""
},
{
"docid": "a622cbd55b2356ef7489b2c7e540880d",
"score": "0.59304905",
"text": "def formatted_date\n #01/19/2017 at 01:55PM (example format)\n if self.date.nil?\n return \"\"\n else\n return self.date.in_time_zone(\"Eastern Time (US & Canada)\").strftime(\"%m/%d/%Y at %I:%M%p\")\n end\n end",
"title": ""
},
{
"docid": "cff33a325a8d7f672c78b29245b153e9",
"score": "0.5919982",
"text": "def dc_format_date_time(value, format = nil)\n return '' if value.nil?\n\n format ||= value.class == Date ? t('date.formats.default') : t('time.formats.default')\n value.strftime(format)\nend",
"title": ""
},
{
"docid": "a482d8e590db665e7571ce2e8d0dc671",
"score": "0.59031457",
"text": "def dc_format_date_time(value, format=nil)\n return '' if value.nil?\n format ||= value.class == Date ? t('date.formats.default') : t('time.formats.default')\n value.strftime(format)\nend",
"title": ""
},
{
"docid": "fd17c564064977c9b9f88be6a1802366",
"score": "0.5873474",
"text": "def format_date(time); end",
"title": ""
},
{
"docid": "774df1c55996d29f23b9c768718c799d",
"score": "0.5854485",
"text": "def format_datetime( date, time)\n Time.zone.parse(\"#{date} #{time}\")\n end",
"title": ""
},
{
"docid": "382c6092d20cd0baddd734475dfcaa47",
"score": "0.58520323",
"text": "def format_datetime(time, options = {})\n time.nil? ? 'n/a' : (format_date(time, options[:full_date], options) + (options[:date_only] ? '' : \" \" + time.localize(format: :hhmmpp)))\n end",
"title": ""
},
{
"docid": "fec6e853a44a66476c9eeffa6a779047",
"score": "0.5834828",
"text": "def format_as_date_time(datetime, use_slashes=true)\n if use_slashes\n datetime.strftime(\"%m/%d/%Y %I:%M %p\") unless datetime.nil?\n else\n datetime.strftime(\"%b %d %Y %I:%M %p \") unless datetime.nil?\n end\n end",
"title": ""
},
{
"docid": "99d6b208ea31a778deba39f21337f058",
"score": "0.5806325",
"text": "def format_date(date, format, default=nil)\n if date\n begin\n date.strftime(format)\n rescue\n default\n end\n else\n default\n end\n end",
"title": ""
},
{
"docid": "13b31567833e8123256b1906311a7153",
"score": "0.5795897",
"text": "def formatted_date_time\n if @date_time.respond_to?(:ctime)\n @date_time.ctime\n else\n @date_time.strftime '%a %b %e %T %Y'\n end\n end",
"title": ""
},
{
"docid": "5d89a138ad62737ca38d244df47d3f99",
"score": "0.57846725",
"text": "def format_date(date)\n date.nil? ? 'never' : date.in_time_zone(Time.zone).strftime('%m/%d/%Y')\n end",
"title": ""
},
{
"docid": "f16fec64131ac6e5c553fcdeb2e0792e",
"score": "0.5777294",
"text": "def datetime_format=(format)\n if @template.respond_to?(:datetime_format=)\n @template.datetime_format = format\n end\n end",
"title": ""
},
{
"docid": "6a71f0101b6d8ef641189356ea8b9904",
"score": "0.5768862",
"text": "def dc_format_date_time(value, format=nil) #:nodoc:\n CmsCommonHelper.dc_format_date_time(value, format)\nend",
"title": ""
},
{
"docid": "46351cd30c47e42a17b82c56d9fa3af8",
"score": "0.57196474",
"text": "def format_day_with_time(date)\n date.strftime(\"%b %d, %Y at %I:%M%P\")\n end",
"title": ""
},
{
"docid": "c888703646776f7b8d73cdeddaf250c5",
"score": "0.5700271",
"text": "def formatted_date_time\n if date_time.respond_to?(:ctime)\n date_time.ctime\n else\n date_time.strftime '%a %b %e %T %Y'\n end\n end",
"title": ""
},
{
"docid": "e467df6fd40d39e20fc9dcd21b20e805",
"score": "0.5700219",
"text": "def format_date_and_time(date)\n date.day == Time.zone.now.day ? date.to_s(:time) : date.to_s(:short)\n end",
"title": ""
},
{
"docid": "31e161ee111a14720ac01b34a7a6774a",
"score": "0.56901646",
"text": "def format_date(object, options={})\n return nil unless object\n\n dt = object\n date = object\n if object.is_a?(Java::JavaUtil::Date)\n dt = Api::Utils.java_to_ruby_datetime(object)\n date = dt.to_date\n elsif object.is_a?(DateTime)\n dt = object\n date = object.to_date\n end\n if options[:time_if_today] && (Date.today - date.to_date == 0)\n dt.strftime('%H:%M')\n else\n l(date, options)\n end\n end",
"title": ""
},
{
"docid": "403af4e059edf9901ff51db7da95edd0",
"score": "0.567482",
"text": "def format_gm_time(date_time,time_format=nil)\r\n if date_time.kind_of?(Time)\r\n return(date_time.day.to_s + \r\n \"-\" + \r\n date_time.mon.to_s + \r\n \"-\" + \r\n date_time.year.to_s + \r\n \" \" + \r\n date_time.hour.to_s + \r\n \":\" + \r\n date_time.min.to_s + \r\n \":\" + \r\n date_time.sec.to_s)\r\n else\r\n nil\r\n end\r\n end",
"title": ""
},
{
"docid": "36d5e6abb9f97546e10e2b4943ce3694",
"score": "0.5666513",
"text": "def fmt_time(time, fmt='%B %e, %Y %l:%M%P %Z') # default fmt: January 1, 2015 10:10am\n local_time = time.blank? || !time.kind_of?(Time) ? Time.now : time.localtime\n local_time.strftime(fmt)\n end",
"title": ""
},
{
"docid": "c06d99e2592fb24fc8e4ea66314585db",
"score": "0.5628226",
"text": "def format_timezone(time, timezone = Time.zone.name, ftype = \"view\")\n timezone = timezone.name if timezone.kind_of?(ActiveSupport::TimeZone) # If a Timezone object comes in, just get the name\n if !time.blank?\n new_time = time.in_time_zone(timezone)\n case ftype\n when \"gtl\" # for gtl views\n new_time = I18n.l(new_time.to_date) + new_time.strftime(\" %H:%M:%S %Z\")\n when \"fname\" # for download filename\n new_time = new_time.strftime(\"%Y_%m_%d\")\n when \"date\" # for just mm/dd/yy\n new_time = I18n.l(new_time.to_date)\n when \"export_filename\" # for export/log filename\n new_time = new_time.strftime(\"%Y%m%d_%H%M%S\")\n when \"tl\"\n new_time = I18n.l(new_time)\n when \"raw\" # return without formatting\n when \"compare_hdr\" # for drift/compare headers\n new_time = I18n.l(new_time, :format => :long) + new_time.strftime(\" %Z\")\n when \"widget_footer\" # for widget footers\n new_time = I18n.l(new_time, :format => :long)\n else # for summary screens\n new_time = I18n.l(new_time)\n end\n else # if time is nil\n new_time = \"\"\n end\n new_time\n end",
"title": ""
},
{
"docid": "61cc312cef5424b06ec21c96fbb921ae",
"score": "0.5599072",
"text": "def message_time_format(time)\n\t\tbegin\n\t\t\ttime.in_time_zone(\"Mumbai\").strftime(\"%m/%d/%Y %I:%M%p\")\n\t\trescue Exception => e\n\t\t\t\"\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "61cc312cef5424b06ec21c96fbb921ae",
"score": "0.5599072",
"text": "def message_time_format(time)\n\t\tbegin\n\t\t\ttime.in_time_zone(\"Mumbai\").strftime(\"%m/%d/%Y %I:%M%p\")\n\t\trescue Exception => e\n\t\t\t\"\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "da00c05a8aa43948986a5acb26e3f046",
"score": "0.55965406",
"text": "def format_datetime(datetime)\n return datetime if !datetime.respond_to?(:strftime)\n datetime = @user.tz.utc_to_local(datetime) if @user\n datetime.strftime(\"%d-%m-%Y\")\nend",
"title": ""
},
{
"docid": "fa9e03133a7dd924f8eb276aeebd3d62",
"score": "0.5584922",
"text": "def format_as_timezone(context, value, **options) = context.format",
"title": ""
},
{
"docid": "bbc2302505ab68f48e4d9aa8dd2eb468",
"score": "0.5566245",
"text": "def format_time(time)\n time.strftime(\"%m/%d/%Y %I:%M:%S%p\")\n end",
"title": ""
},
{
"docid": "ef5641f02ff278a7ea16e4fb8c72ef59",
"score": "0.55526334",
"text": "def set_date_format(format)\n @date_format = format\n end",
"title": ""
},
{
"docid": "149890823711b87101d0e72b3296e337",
"score": "0.55462873",
"text": "def format_date(date_time)\n '%d-%s-%s %s-%s-%s' % [\n date_time.year,\n date_time.month.to_s.rjust(2, '0'),\n date_time.day.to_s.rjust(2, '0'),\n date_time.hour.to_s.rjust(2, '0'),\n date_time.minute.to_s.rjust(2, '0'),\n date_time.second.to_s.rjust(2, '0')\n ]\n end",
"title": ""
},
{
"docid": "a1ae672fbe76c4f078dad590b236ffd2",
"score": "0.55246824",
"text": "def format_datetime\n date_time = Time.parse(self.datetime)\n\n return date_time.strftime('%a, %b-%d-%Y at %I:%M %p %z')\n end",
"title": ""
},
{
"docid": "e71c1e1db2626937633345510ae7daf1",
"score": "0.55186796",
"text": "def format_time(time)\n time.strftime(\"%B %d, %Y at %l:%M%p\")\n end",
"title": ""
},
{
"docid": "359b9c773b1885ed1c6748a8f653f400",
"score": "0.5511833",
"text": "def time_format(date)\n [DATE_FORMAT % [date.year, date.month, date.day]]\n end",
"title": ""
},
{
"docid": "cbd625181ede9ee0e224134d02502c49",
"score": "0.5509341",
"text": "def time_tag(time_object, format = nil, options ={})\n # if there's a specified format and it's a string, assume it's an strftime string\n if format && format.is_a?(String)\n time_string = time_object.strftime(format)\n # if there's a specified format and it's a symbol, assume it's a predefined format\n elsif format && format.is_a?(Symbol)\n time_string = time_object.to_s(format)\n else\n time_string = time_object.to_s\n end\n options.merge(:datetime => time_object.strftime(TIMETAG_FORMAT))\n content_tag(:time, time_string, options)\n end",
"title": ""
},
{
"docid": "d171798025b2484e2c0adb62f5fc945a",
"score": "0.550531",
"text": "def show_created_time(created_at, format)\n created_at.in_time_zone('Asia/Bangkok').strftime(format)\n end",
"title": ""
},
{
"docid": "59dec055d4ced520a2bc7079195e4b9d",
"score": "0.5501238",
"text": "def display_date_time(datetime)\n datetime.strftime(\"%m/%d/%Y - %I:%M %p\")\nend",
"title": ""
},
{
"docid": "66682ae89280d4c9a33b93790dd7dbba",
"score": "0.5498343",
"text": "def format_date(date, format=\"%Y/%m/%d\")\n\t\t\tdate.strftime(format)\n\t\tend",
"title": ""
},
{
"docid": "c7c703a5b76737e527cbcb24b3913476",
"score": "0.548097",
"text": "def format_time(time)\n case time_format\n when :iso_8601\n time.utc.iso8601(precision)\n when nil\n \"\"\n else\n time.strftime(time_format)\n end\n end",
"title": ""
},
{
"docid": "acd04988d261f046e9d43987ac07b90d",
"score": "0.54801035",
"text": "def format_datetime(object, options={})\n return nil unless object\n if object.is_a?(Java::JavaUtil::Date)\n dt = Api::Utils.java_to_ruby_datetime(object)\n else\n dt = object\n end\n if options[:time_if_today] && (Date.today - date.to_date == 0)\n dt.strftime('%H:%M')\n else\n l(dt, options)\n end\n end",
"title": ""
},
{
"docid": "df56d22fa315833556893f0c413c4f97",
"score": "0.54768884",
"text": "def pretty_date(value, options={})\n style = options[:style] # let #date_format set the defaults for these\n sep = options[:sep]\n localize = options.keys.include?(:localize) ? options[:localize] : true\n undefined_text = options[:undefined_text] || 'n/a'\n\n value = Time.parse(value) if value.is_a?(String) rescue true\n begin\n time_zone = current_user.try(:time_zone)\n rescue\n time_zone = nil\n end\n\n if defined?(current_user) && localize && time_zone.present?\n value.in_time_zone(time_zone).strftime(date_format(:style => style, :sep => sep)) rescue undefined_text\n else\n value.strftime(date_format(:style => style, :sep => sep)) rescue undefined_text\n end\n end",
"title": ""
},
{
"docid": "62a2d06922dcf1580b519b2848f285cc",
"score": "0.54693574",
"text": "def display_transaction_date(time_with_zone)\n\t\ttime_with_zone.in_time_zone('America/Los_Angeles').strftime('%b %-d, %Y') if time_with_zone\n\tend",
"title": ""
},
{
"docid": "9eeb3de35e763e9f8f73d7590b19fe2d",
"score": "0.546856",
"text": "def date_format(date_field)\n date_field.is_a?(ActiveSupport::TimeWithZone) ? date_field.time.strftime('%Y/%m/%d') : date_field.to_time.strftime('%Y/%m/%d') if date_field\n end",
"title": ""
},
{
"docid": "424d37faa07e92c58b5a8f5587bf0def",
"score": "0.54565644",
"text": "def display_datetime(datetime)\n format_date(datetime, format: :full_date, time: true)\n end",
"title": ""
},
{
"docid": "f5239bdb9be4ccaed3c4c8db1bd6bede",
"score": "0.54548347",
"text": "def format_as_date_time(datetime, compact=true)\n if compact\n datetime.strftime(\"%I:%M %p %m/%d/%Y\") unless datetime.nil?\n else\n datetime.strftime(\"%I:%M %p %b %d %Y\") unless datetime.nil?\n end\n end",
"title": ""
},
{
"docid": "9236fda75d6da9bc0f3b7a46978b99b8",
"score": "0.5445878",
"text": "def set_date_format(format)\n\t\t@date_format = format\n\tend",
"title": ""
},
{
"docid": "629764e49626fa20d5295ad2c3632902",
"score": "0.5441156",
"text": "def format_date(date)\n begin\n Chronic.parse(date).strftime('%m/%d/%y %I:%M %p')\n rescue\n 'invalid date'\n end\n end",
"title": ""
},
{
"docid": "0eaa090b315779a1d10f1be7bb15657d",
"score": "0.54135793",
"text": "def display_as_timezone(time)\n time.strftime(\"%d-%b-%Y %I:%M %p\")\n #Time.use_zone('Pretoria') do\n # time.in_time_zone.strftime(\"%d-%b-%Y %I:%M %p\")\n #end\n end",
"title": ""
},
{
"docid": "0eaa090b315779a1d10f1be7bb15657d",
"score": "0.5413096",
"text": "def display_as_timezone(time)\n time.strftime(\"%d-%b-%Y %I:%M %p\")\n #Time.use_zone('Pretoria') do\n # time.in_time_zone.strftime(\"%d-%b-%Y %I:%M %p\")\n #end\n end",
"title": ""
},
{
"docid": "d6c3d81f2ddac7ee2ff506123c0d06cc",
"score": "0.5400075",
"text": "def format(format_string = nil)\n if format_string != nil\n @moment.format(format_string)\n else\n @moment.format\n end\n end",
"title": ""
},
{
"docid": "a6a95805f90ef60a1ed99c76d59ed8c2",
"score": "0.5391709",
"text": "def format_date(date, format = \"%m/%d/%Y\")\n date.respond_to?(:strftime) ? date.strftime(format) : date.to_s\n end",
"title": ""
},
{
"docid": "cfcc28ef92789137b9882b9a011af87c",
"score": "0.53642917",
"text": "def format_date(date)\n date.strftime(DATE_FORMAT)\n end",
"title": ""
},
{
"docid": "cfcc28ef92789137b9882b9a011af87c",
"score": "0.53642917",
"text": "def format_date(date)\n date.strftime(DATE_FORMAT)\n end",
"title": ""
},
{
"docid": "ca061deab79a0f826df3d21671c5158a",
"score": "0.53611016",
"text": "def display_friendly_date(date)\n if logged_in? && !current_user.time_zone.blank?\n date = date.in_time_zone(current_user.time_zone)\n end\n \n date.strftime(\"%b #{date.day.ordinalize}, %Y %H:%M %Z\")\n end",
"title": ""
},
{
"docid": "321daedad10ca1af477a28dad5c25bf1",
"score": "0.5361019",
"text": "def formatted_date_time; end",
"title": ""
},
{
"docid": "d001b51598f1020c0c6a8ebcb5b159b9",
"score": "0.5358185",
"text": "def format_datetime(time); end",
"title": ""
},
{
"docid": "d001b51598f1020c0c6a8ebcb5b159b9",
"score": "0.5358185",
"text": "def format_datetime(time); end",
"title": ""
},
{
"docid": "0f8b6583f9e65f89b395392d12dbea8b",
"score": "0.53542227",
"text": "def format_time(date)\n year = date[6, 4]\n month = date[0, 2]\n day = date[3, 2]\n\n Time.new(year, month, day)\n end",
"title": ""
},
{
"docid": "2ad7063478c7cff296c9cc67fa823b16",
"score": "0.5340527",
"text": "def format_time(time,override=false)\n\t\treturn \"-\" if time.nil?\n\t\treturn time.strftime(\"%l:%M %p on %B %d, %Y\") if override\n\t\ttime.strftime(\"%l:%M %p \"+day_word(time)) unless override\n end",
"title": ""
},
{
"docid": "20b3a8f752fa526a671335a12087329d",
"score": "0.5328974",
"text": "def format_time(time)\n time = Time.zone.parse(time.to_s)\n time.strftime(\"%B #{time.day.ordinalize}, %Y %l:%M%p %Z\")\n end",
"title": ""
},
{
"docid": "1728ff3bf5a94034a6666423073ee649",
"score": "0.53238916",
"text": "def format_date( date )\n\tdate.strftime( \"%Y-%m-%dT%H:%M:%S:%L%z\" ) if date\nend",
"title": ""
},
{
"docid": "67d1a27f6ffbb8f957bc405bf940be26",
"score": "0.5322011",
"text": "def format_date(time)\n time.strftime(\"%m/%d/%Y\").gsub(\"/\", \"-\")\n end",
"title": ""
},
{
"docid": "c37311dd114547719428505c9158837f",
"score": "0.5318961",
"text": "def update_time_formats!\n Time::DATE_FORMATS.update(\n :db => '%Y-%m-%d %H:%M:%S',\n :ui => '%d.%m.%Y %H:%M',\n :yaml => '%Y-%m-%d %H:%M:%S %:z', # For DateTimes\n :default => lambda do |time|\n non_zero_time = time.hour != 0 || time.min != 0 || time.sec != 0\n time.strftime(non_zero_time ? '%d.%m.%Y %H:%M' : '%d.%m.%Y')\n end\n )\n end",
"title": ""
},
{
"docid": "b288748346cc440ede8f37621dc64545",
"score": "0.5307412",
"text": "def format_date(date, format)\n date = datetime(date)\n if format.nil? || format.empty? || format == \"ordinal\"\n date_formatted = ordinalize(date)\n else\n date_formatted = l date.strftime(format)\n end\n date_formatted\n end",
"title": ""
},
{
"docid": "0c2d0c2d4d2a032390018d93437f273e",
"score": "0.5294097",
"text": "def format_time(time)\n time.to_time.strftime(\"%d-%m-%Y %H:%M:%S\")\n end",
"title": ""
},
{
"docid": "79206fad55f2467163ed966880e53fd4",
"score": "0.5286601",
"text": "def formatted_date_time_for_zone(time_zone, date_time_utc)\n time_zone.strftime(HEARING_TIME_DISPLAY_FORMAT, date_time_utc)\n end",
"title": ""
},
{
"docid": "6d23f1ab81a23562854fd11329b982f1",
"score": "0.5283645",
"text": "def time(zone, format: \"%a, %b %d %Y %l:%M %p %Z\")\n Time.use_zone(zone) { Time.current.strftime(format) }\n end",
"title": ""
},
{
"docid": "c16b21b5d0d3a025e18491fd8df8ace4",
"score": "0.5280161",
"text": "def format_date(dt)\n if dt.is_a?(Time)\n dt = dt.to_datetime\n end\n dt.new_offset('-0400').strftime(\"%B %e, %Y %H:%M\") unless dt.nil?\n end",
"title": ""
},
{
"docid": "40c238679597f694076daf0fd9adb212",
"score": "0.52789366",
"text": "def display_datetime(datetime)\n datetime.strftime(\"%b. %e, %Y at %I:%M %p\")\n end",
"title": ""
},
{
"docid": "80e65bdc25ed0c782bac0be22c9cebf9",
"score": "0.5278061",
"text": "def set_user_time_zone\n Time.zone = current_user.time_zone if logged_in?\n end",
"title": ""
},
{
"docid": "cac25704aec34eccb20b9534cd18223f",
"score": "0.5277782",
"text": "def format_time(t)\n t.strftime('%Y-%m-%d %H-%M-%S')\n end",
"title": ""
},
{
"docid": "bff3d3dfb88c09759d8f9744980a0a3f",
"score": "0.52630395",
"text": "def nice_format(date, zone)\n date.in_time_zone(zone).strftime('%B %d, %Y @ %l:%M %p')\n end",
"title": ""
},
{
"docid": "7b956561e4b76c406cc2e8692fff5990",
"score": "0.52560925",
"text": "def format_day(time)\n case time\n when String then time.to_time.strftime('%-d %b %Y')\n when Time then time.strftime('%-d %b %Y')\n when nil, '' then '-- -- ----'\n end\n end",
"title": ""
},
{
"docid": "3e712fb8aeecf82991ead9ec9b22b71d",
"score": "0.52461815",
"text": "def date_format(time, type, lang)\n engine = @reg.get_engine(lang, date_format_registry_key)\n raise Mack::Localization::Errors::FormatEngineNotFound.new(lang.to_s) if engine.nil?\n return u(engine.format(time, type))\n end",
"title": ""
},
{
"docid": "88f7932282ed21a938c7434bea08b590",
"score": "0.52339673",
"text": "def datetime_format\n @time_formatter.format\n end",
"title": ""
},
{
"docid": "011b7841738f367735e14a4add82bcd1",
"score": "0.5233462",
"text": "def set_time_zone\n if logged_in?\n Time.zone = current_user.time_zone\n end\n end",
"title": ""
},
{
"docid": "697a1aaa080d6ec36485a0f6e6bac661",
"score": "0.52302617",
"text": "def formatted_date\n #01/19/2017 at 01:55PM (example format)\n if self.review_completion_date.nil?\n return \"\"\n else\n return self.review_completion_date.in_time_zone(\"Eastern Time (US & Canada)\").strftime(\"%m/%d/%Y at %I:%M%p\")\n end\n end",
"title": ""
},
{
"docid": "11cc9a38490020d010f6c3861ff5255b",
"score": "0.52129495",
"text": "def formatted_date(datetime = take_off)\n datetime.strftime('%F at %H:%M')\n end",
"title": ""
},
{
"docid": "6e7a606ade6cad71d9da2133d7e6473a",
"score": "0.5195233",
"text": "def dash_nice_format(date, zone)\n if date.strftime('%d%m%Y') == Time.now.strftime('%d%m%Y')\n # the given day is today\n if date.strftime('%H:%M') < Time.now.strftime('%H:%M')\n # the time specified in date has already passed\n 'Now'\n else\n # the time has not passed yet\n date.in_time_zone(zone).strftime('@ %l:%M %p')\n end\n else\n # the given date is sometime in the future\n date.in_time_zone(zone).strftime('%a %d/%m')\n end\n end",
"title": ""
},
{
"docid": "0daee14e79dc9fca9a6a0342e3ab3680",
"score": "0.5186697",
"text": "def format_article_date(datetime, short=true, format='%I:%M %p')\n return nil unless datetime\n now = Time.now\n if short\n if datetime.today?\n datetime.strftime('%I:%M %p')\n elsif now.yesterday.beginning_of_day < datetime && datetime < now.yesterday.end_of_day\n \"#{I18n.t('time.yesterday')} #{datetime.strftime(format)}\"\n elsif format != '%I:%M %p'\n datetime.strftime(format)\n else\n \"#{I18n.t('date.abbr_month_names')[datetime.month]} #{datetime.day}, #{datetime.year}\"\n end\n else\n I18n.l(datetime)\n end\n end",
"title": ""
},
{
"docid": "16d89f7fe691ba186a28a953cf2ceadd",
"score": "0.51856685",
"text": "def set_user_time_zone\n if @current_user != nil\n Time.zone = @current_user.time_zone\n end\n end",
"title": ""
},
{
"docid": "7e7a8e13724760b4266b6ee7a2e8287a",
"score": "0.5181266",
"text": "def nice_format(date, zone)\n date.in_time_zone(zone).strftime('%B %d, %Y %l:%M %p %Z')\n end",
"title": ""
},
{
"docid": "dd7ac18ef5285353faed22863646f934",
"score": "0.51807415",
"text": "def display_datetime(dt)\n\t\tdt.strftime(\"%m/%d/%Y %I:%M%P %Z\") # MM/DD/YY H:MM AM/PM\n\tend",
"title": ""
},
{
"docid": "8faf2d2e6d3988077f23e9a1328ab5db",
"score": "0.5178444",
"text": "def formatted_with_time(options={})\n options = {:order => [:date, :time],\n :time_order => [:hour, :minute, :second],\n :date_order => [:day, :month, :year],\n :date_separator => '/',\n :time_separator => ':',\n :separator => ' '}.merge(_options)\n date = self.formatted(:order => options[:date_order], :separator => options[:date_separator])\n codes = options[:time_order].map {|o| SYMBOLS_TO_CODE[o]}.compact.uniq\n time = codes.join(options[:time_separator])\n blocks = []\n options[:order].each do |o|\n case o.to_sym\n when :date\n blocks << date\n when :time\n blocks << time\n end\n end\n text = blocks.join(options[:separator])\n self.strftime(text)\n end",
"title": ""
},
{
"docid": "1210e8ebc5780bdd8ba72a6ab130aff6",
"score": "0.51765454",
"text": "def formatted_time\n utc = opts[:appointment]&.resource&.start\n time = DateTime.strptime(utc).in_time_zone(DEFAULT_TIME_ZONE)\n\n \"#{time.strftime(TIME_FORMAT)} #{time.strftime(TIME_ZONE_FORMAT)}\"\n end",
"title": ""
},
{
"docid": "7b07063890ea8943864dcd6b21bb911c",
"score": "0.5173076",
"text": "def to_s(format = :default)\n if format == :db\n utc.to_s(format)\n elsif formatter = ::Time::DATE_FORMATS[format]\n formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter)\n else\n \"#{time.strftime(\"%Y-%m-%d %H:%M:%S\")} #{formatted_offset(false, 'UTC')}\" # mimicking Ruby Time#to_s format\n end\n end",
"title": ""
},
{
"docid": "ce0841d93e6cf351bc6149763c4a958e",
"score": "0.51727164",
"text": "def posted_time(options = {})\n options.reverse_merge! format: '%A %b %-d, %Y %H:%M' # set the default time as \"Thursday Sep 19, 2013 22:32\"\n created_at.strftime(options[:format])\n end",
"title": ""
},
{
"docid": "2b01f817f5767824384267e6b8d08646",
"score": "0.51684904",
"text": "def datetime_format=(format)\n @log.datetime_format = format\n end",
"title": ""
},
{
"docid": "b6692d30b0df512c19b53524d22315e8",
"score": "0.51660323",
"text": "def set_time_zone\n Time.zone = current_user.time_zone if current_user\n end",
"title": ""
},
{
"docid": "b6692d30b0df512c19b53524d22315e8",
"score": "0.51660323",
"text": "def set_time_zone\n Time.zone = current_user.time_zone if current_user\n end",
"title": ""
},
{
"docid": "9db62fb1ac3987af83c48ba75fd7db78",
"score": "0.5161819",
"text": "def datetime_format=(datetime_format)\n @default_formatter.datetime_format = datetime_format\n end",
"title": ""
},
{
"docid": "26164f8890d7dc488a2bd1643742a979",
"score": "0.51494485",
"text": "def format_date(date, format)\n date = datetime(date)\n if format.nil? || format.empty? || format == \"ordinal\"\n date_formatted = ordinalize(date)\n else\n date_formatted = format.gsub(/%a/, ABBR_DAYNAMES_TR[date.wday])\n date_formatted = date_formatted.gsub(/%A/, DAYNAMES_TR[date.wday])\n date_formatted = date_formatted.gsub(/%b/, ABBR_MONTHNAMES_TR[date.mon])\n date_formatted = date_formatted.gsub(/%B/, MONTHNAMES_TR[date.mon])\n date_formatted = date.strftime(date_formatted)\n end\n date_formatted\nend",
"title": ""
},
{
"docid": "eb8105e2a829948f31fc4e146bb7d9dc",
"score": "0.51433957",
"text": "def format_time(time)\n (!time.nil?) ? time.strftime(\"%m/%d/%Y\") : \"\"\n end",
"title": ""
},
{
"docid": "bf92e6936b0e926206ebfa1ffdd72447",
"score": "0.51380014",
"text": "def display_date\n self.date.strftime(\"%A, %B %d, %Y - %I:%M %p\") \n end",
"title": ""
},
{
"docid": "b70ee8ffa52c7057e008f2e34b5d3d23",
"score": "0.51373464",
"text": "def nice_date(date, ofset = 1)\n if date\n format = (!session || session[:date_format].to_s.blank?) ? '%Y-%m-%d' : session[:date_format].to_s\n format = format.to_s\n time_tmp = date.respond_to?(:strftime) ? date : date.to_time\n time_tmp = time_tmp.class.to_s == 'Date' ? time_tmp.to_time : time_tmp\n res_date = (session && ofset.to_i == 1) ? current_user.user_time(time_tmp).strftime(format) : time_tmp.strftime(format)\n else\n res_date = ''\n end\n return res_date\n end",
"title": ""
}
] |
d41e7133d73ffcc77fc6ff7316de1e3b
|
TODO: more thorough checking?
|
[
{
"docid": "ddf74c0c5c8e92b29b39f78933da812a",
"score": "0.0",
"text": "def ensure_datetime(date)\n return date if date.is_a? DateTime\n\n # rubocop:disable Style/GuardClause, Style/DateTime\n if date.is_a? String\n month, day, year = date.split(%r{[/-]}).map(&:to_i)\n DateTime.new(year, month, day)\n end\n # rubocop:enable Style/GuardClause, Style/DateTime\n end",
"title": ""
}
] |
[
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.661194",
"text": "def desired; end",
"title": ""
},
{
"docid": "5928f8efe9c6c2d408ea21a4cdce83ad",
"score": "0.6505642",
"text": "def preliminary?; end",
"title": ""
},
{
"docid": "58e2e07d11b107b6864a328f2187e248",
"score": "0.6233482",
"text": "def apop?; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.61990553",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.61990553",
"text": "def used; end",
"title": ""
},
{
"docid": "d882f3a248ba33088a4284a47c263d0d",
"score": "0.61506987",
"text": "def missing?; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.60852593",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.60852593",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.60852593",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.60852593",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.60852593",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.60852593",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "6e6891d187cd127b8bc7e632ec0b2d50",
"score": "0.60835254",
"text": "def unitary?; end",
"title": ""
},
{
"docid": "351d6b035a75ce301f020861a1907560",
"score": "0.60674995",
"text": "def check; end",
"title": ""
},
{
"docid": "bb2cf20999efd9fcacf7668301ebe565",
"score": "0.60069996",
"text": "def missing; end",
"title": ""
},
{
"docid": "bb2cf20999efd9fcacf7668301ebe565",
"score": "0.60069996",
"text": "def missing; end",
"title": ""
},
{
"docid": "8b79e8f7bbe83880e51794d26cd62a8f",
"score": "0.59779525",
"text": "def try; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.59613395",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.59613395",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.59613395",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.59613395",
"text": "def preparable; end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.59582806",
"text": "def in_use; end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.59582806",
"text": "def in_use; end",
"title": ""
},
{
"docid": "0212351345358772373f549b97821c62",
"score": "0.5932156",
"text": "def regular?; end",
"title": ""
},
{
"docid": "0a39799e76643367f1b6bfac65569895",
"score": "0.59153455",
"text": "def used?; end",
"title": ""
},
{
"docid": "8d1d77531cce0d12539ad149eebad454",
"score": "0.58570087",
"text": "def sub_from; end",
"title": ""
},
{
"docid": "6d967e0574a93ad1a7a438ecf62b646c",
"score": "0.58264655",
"text": "def ex; end",
"title": ""
},
{
"docid": "6d967e0574a93ad1a7a438ecf62b646c",
"score": "0.58264655",
"text": "def ex; end",
"title": ""
},
{
"docid": "8a91bfaa4b92b136c5d230a732b0d6e6",
"score": "0.579743",
"text": "def eod?; end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.57928723",
"text": "def anchored; end",
"title": ""
},
{
"docid": "36d6426b60095cdd1428a9f39841eb63",
"score": "0.57734483",
"text": "def expected; end",
"title": ""
},
{
"docid": "49560b3ade41bfbe4a3b9d6b401dd517",
"score": "0.5773356",
"text": "def exc; end",
"title": ""
},
{
"docid": "0aa0db9270c5a88c81da713a1ee0e8f8",
"score": "0.57678485",
"text": "def rescued_exception; end",
"title": ""
},
{
"docid": "7d73ca93aed82d814ee3609681895be5",
"score": "0.5744208",
"text": "def missed?; end",
"title": ""
},
{
"docid": "7d73ca93aed82d814ee3609681895be5",
"score": "0.5744208",
"text": "def missed?; end",
"title": ""
},
{
"docid": "6e37c1e308f058381c565a17b02678f5",
"score": "0.5742583",
"text": "def hermitian?; end",
"title": ""
},
{
"docid": "334240d22c3d5bd0b2bbbcd882626810",
"score": "0.573495",
"text": "def needed?; end",
"title": ""
},
{
"docid": "950bef128403f02279cc1bb4ef43a028",
"score": "0.5728714",
"text": "def realized?; end",
"title": ""
},
{
"docid": "950bef128403f02279cc1bb4ef43a028",
"score": "0.5728714",
"text": "def realized?; end",
"title": ""
},
{
"docid": "794a198d95cf296afde54486d8c4e262",
"score": "0.5720027",
"text": "def avail_out=(*) end",
"title": ""
},
{
"docid": "b7567a2a68cade31f2360723a4c42dc7",
"score": "0.570474",
"text": "def used_by; end",
"title": ""
},
{
"docid": "f0d50116d6d067bd787bf1044910efcb",
"score": "0.5694583",
"text": "def attempt; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.56871116",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.56871116",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.56871116",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.56871116",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.56871116",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.56871116",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.56871116",
"text": "def loc; end",
"title": ""
},
{
"docid": "1acb0e2012761a8bf78cc4d86bc736e7",
"score": "0.5685967",
"text": "def subscopable?; end",
"title": ""
},
{
"docid": "5ffd4221c0adbb90a19d26836dc1440b",
"score": "0.56776065",
"text": "def parter; end",
"title": ""
},
{
"docid": "7db0727baf89eb76beac27c515d7fe32",
"score": "0.5676769",
"text": "def support; end",
"title": ""
},
{
"docid": "954c5828178f6e4a659c40ef92736547",
"score": "0.5664717",
"text": "def helpful!\n\n\t\tend",
"title": ""
},
{
"docid": "d0991d39b3c49cefeda109aed5d76565",
"score": "0.566292",
"text": "def missed; end",
"title": ""
},
{
"docid": "e66c3e6966b775d1799a6b8fed500121",
"score": "0.5658711",
"text": "def check()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "c3285b979f713395f60cf13edce8a310",
"score": "0.56563723",
"text": "def methodmissing; end",
"title": ""
},
{
"docid": "7ec57c3874853e50086febdbdd3221bf",
"score": "0.5652793",
"text": "def wedding; end",
"title": ""
},
{
"docid": "8b608597e4f8cb342968a26900959e68",
"score": "0.5650913",
"text": "def extended?; end",
"title": ""
},
{
"docid": "deca5e01605df7655cd433763b5329db",
"score": "0.5638139",
"text": "def non_example_failure; end",
"title": ""
},
{
"docid": "a9dd648a5d0d2e7d56223e7c753f5e2e",
"score": "0.5626322",
"text": "def telegraphical()\n end",
"title": ""
},
{
"docid": "3ae137b1a40ff3aae4f3cbb2b6082797",
"score": "0.56256783",
"text": "def reaper; end",
"title": ""
},
{
"docid": "4ea6f5c11a3bc16e2394d273e748b292",
"score": "0.56194973",
"text": "def internal?; end",
"title": ""
},
{
"docid": "8ef86a1189509bccd2cb3f913a5cbe81",
"score": "0.5611186",
"text": "def well_formed?()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "0e02f83784c17c376ac60c44d26d2ebb",
"score": "0.5594275",
"text": "def existing; end",
"title": ""
},
{
"docid": "dd634988bef3cbda8a94486413375360",
"score": "0.5580775",
"text": "def lookup; end",
"title": ""
},
{
"docid": "dd634988bef3cbda8a94486413375360",
"score": "0.5580775",
"text": "def lookup; end",
"title": ""
},
{
"docid": "1a04e1912fce1db32cc9383803b3136b",
"score": "0.55386746",
"text": "def expected_from=(_arg0); end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5537235",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5537235",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5537235",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5537235",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5537235",
"text": "def implementation; end",
"title": ""
},
{
"docid": "8089b15b5e979249890167fbc9229f0a",
"score": "0.553497",
"text": "def valid()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "ac376300f000603568c56235135951a3",
"score": "0.55248433",
"text": "def viable?; end",
"title": ""
},
{
"docid": "ac376300f000603568c56235135951a3",
"score": "0.55248433",
"text": "def viable?; end",
"title": ""
},
{
"docid": "e9ff7d25994ff243c44475269de035cd",
"score": "0.5523603",
"text": "def supported; end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.55189973",
"text": "def internal; end",
"title": ""
},
{
"docid": "d4b51441e9803335f40f611467a77896",
"score": "0.55131114",
"text": "def returned; end",
"title": ""
},
{
"docid": "d4b51441e9803335f40f611467a77896",
"score": "0.55131114",
"text": "def returned; end",
"title": ""
},
{
"docid": "67e9b6e8898f2936c7de8b6d0bae66de",
"score": "0.5512999",
"text": "def compshape?; false end",
"title": ""
},
{
"docid": "e28593026497a2baf9c546a2da299bf7",
"score": "0.55078095",
"text": "def nonstpreason\nend",
"title": ""
},
{
"docid": "baabe5bb658b17a85353fb66fdbbf873",
"score": "0.5505671",
"text": "def extended; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.55006254",
"text": "def operations; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.55006254",
"text": "def operations; end",
"title": ""
},
{
"docid": "e40385308a8da48755a43eeb31011abf",
"score": "0.54954386",
"text": "def internal_error; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.54954135",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.54954135",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.54954135",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "720b63b9f144b38f4861ac47880c4cb5",
"score": "0.54942644",
"text": "def missing\n end",
"title": ""
},
{
"docid": "d75c7529a52027a3fe78dfdb73b1e57c",
"score": "0.5486702",
"text": "def in_use?; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.5485088",
"text": "def next; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.5485088",
"text": "def next; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.5485088",
"text": "def next; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.5485088",
"text": "def next; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.5485088",
"text": "def next; end",
"title": ""
},
{
"docid": "d95befff0537c0b7b2e53bcaf47fe645",
"score": "0.5484336",
"text": "def real?; end",
"title": ""
},
{
"docid": "907e9765259f083a71b0ebf61956f3a0",
"score": "0.54801345",
"text": "def available; end",
"title": ""
},
{
"docid": "907e9765259f083a71b0ebf61956f3a0",
"score": "0.54801345",
"text": "def available; end",
"title": ""
},
{
"docid": "907e9765259f083a71b0ebf61956f3a0",
"score": "0.54801345",
"text": "def available; end",
"title": ""
},
{
"docid": "907e9765259f083a71b0ebf61956f3a0",
"score": "0.54801345",
"text": "def available; end",
"title": ""
},
{
"docid": "33cb725c78d997115b4cd22cacceea0d",
"score": "0.5475681",
"text": "def inner_error; end",
"title": ""
}
] |
b160093055d511cbe573fc0be4a2eb4d
|
DELETE /monkeys/1 DELETE /monkeys/1.json
|
[
{
"docid": "6e64badbc9fbf06fa98a95d54e94e41a",
"score": "0.6560608",
"text": "def destroy\n @monkey = Monkey.find(params[:id])\n @monkey.destroy\n\n respond_to do |format|\n format.html { redirect_to monkeys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.64879316",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "b99047274b288eda2713d05d2c1732a1",
"score": "0.64389086",
"text": "def delete(key)\n timeout_retry(3, 3){\n write \"DEL #{key}\\r\\n\"\n integer_reply == 1\n }\n end",
"title": ""
},
{
"docid": "1aab4a195279e084bd438c440932d234",
"score": "0.6438869",
"text": "def delete\n redis.eval(LUA_SCRIPT_DELETE, :keys => [build_key('*')])\n end",
"title": ""
},
{
"docid": "ec6c975ac95c3b82f72dcfa83d185b5b",
"score": "0.63868785",
"text": "def delete(key)\n log \"deleting #{key} from #{container_path}\"\n object_path = File.join(container_path, Raca::Util.url_encode(key))\n response = storage_client.delete(object_path)\n (200..299).cover?(response.code.to_i)\n end",
"title": ""
},
{
"docid": "db76cfe347ffa12eae9298b9314b9d4d",
"score": "0.63683516",
"text": "def call(id)\n client.delete(\"/api/rest/v1/api_keys/#{id}.json\")\n true\n end",
"title": ""
},
{
"docid": "f48e2da0f4b9b29b8698f50469600c99",
"score": "0.6368152",
"text": "def destroy\n @monkey = Monkey.find(params[:id])\n @monkey.destroy\n\n respond_to do |format|\n format.html { redirect_to(monkeys_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2f09b1bc18309831d672d8a2ac1eaa20",
"score": "0.63232845",
"text": "def delete(key)\n\n end",
"title": ""
},
{
"docid": "d1f0a8e8c97a0438790f1ddeeecaca29",
"score": "0.6224733",
"text": "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"title": ""
},
{
"docid": "66b5902c8fe9fe3acde7d54bc7a99e35",
"score": "0.620348",
"text": "def delete!\n\t\t\tClient.delete @root\n\t\tend",
"title": ""
},
{
"docid": "37f374e394598cc05d19fae393ed41f3",
"score": "0.6201073",
"text": "def destroy\n @key = Key.find(params[:id])\n @key.destroy\n\n respond_to do |format|\n format.html { redirect_to keys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "80a1668de261058a93c245ce96af54a4",
"score": "0.61822003",
"text": "def destroy\n @whiskey = Whiskey.find(params[:id])\n @whiskey.destroy\n\n respond_to do |format|\n format.html { redirect_to whiskeys_url }\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d2f2b7e27bbbe134661361074c399275",
"score": "0.61643183",
"text": "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.61499584",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "4d0519093589fcb588104fb26a6b6ce8",
"score": "0.6149039",
"text": "def delete(monkey)\n @monkeys.delete(monkey)\n end",
"title": ""
},
{
"docid": "fc9a939e0eecbfd3a5a9c753175230fc",
"score": "0.6144226",
"text": "def delete_key(key)\n end",
"title": ""
},
{
"docid": "ce1e7cf90aa82857889c1b10e9f7d91a",
"score": "0.6142719",
"text": "def destroy\n @client.delete( name )\n end",
"title": ""
},
{
"docid": "7cb9eca8e36ca08c593f40fddb371adc",
"score": "0.61270326",
"text": "def delete(key)\n\n # FIXME: insert code that connects to the backend and affects the delete\n # operation\n #\n # - This delete should be done atomically\n # - Convert any exceptions into a failed status result with a meaningful\n # error message.\n #\n\n { :result => false, :err_msg => 'FIXME: not implemented' }\n end",
"title": ""
},
{
"docid": "db6c5a2822b870f58f23de574ff1387e",
"score": "0.61133736",
"text": "def destroy\n conf.delete 'api'\n end",
"title": ""
},
{
"docid": "8d209bac545981bad0cfe76244211211",
"score": "0.61061347",
"text": "def destroy\n @apikey.destroy\n respond_to do |format|\n format.html { redirect_to apikeys_url, notice: \"Apikey was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "98b2689226cffc5684177e89ea7f1eea",
"score": "0.60997695",
"text": "def destroy\n @whiskey.destroy\n respond_to do |format|\n format.html { redirect_to whiskeys_url, notice: \"Whiskey was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2993700721988a232d30fabe1ebb332a",
"score": "0.6097598",
"text": "def delete!\n server.delete(name)\n end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.60973334",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.60973334",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.60973334",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.60973334",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.60973334",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "d7d3c63b7953786567365eebd7e48340",
"score": "0.6092424",
"text": "def delete(options={})\n connection.delete(\"/\", @name)\n end",
"title": ""
},
{
"docid": "1f235dd3ae3f7b6892313da216f23c6f",
"score": "0.6091132",
"text": "def delete(key)\n put(key, nil) if servers?\n end",
"title": ""
},
{
"docid": "2b0f75db6a99b0baa487065fac9b460d",
"score": "0.60848874",
"text": "def delete(key)\n configuration.hpath_delete.tap do |result|\n save if sync_down\n end\n end",
"title": ""
},
{
"docid": "0dd3979ddf714821583260d45ef64d20",
"score": "0.60722184",
"text": "def delete(args)\n args = {:path => args} unless args.is_a?(Hash)\n assert_supported_keys(args, [:path, :version, :callback, :context])\n assert_required_keys(args, [:path])\n args[:version] ||= -1\n\n if args[:callback] ## asynchronous\n raise KeeperException::BadArguments unless args[:callback].kind_of?(VoidCallback)\n return zoo_adelete(@zk_handle, args[:path], args[:version], args[:callback].proc, YAML.dump(args[:context]))\n end\n\n ## synchronous\n rc = zoo_delete(@zk_handle, args[:path], args[:version])\n raise KeeperException.by_code(rc), ZooKeeperFFI::zerror(rc) unless rc == ZOK\n return rc\n end",
"title": ""
},
{
"docid": "a91f8d2e07efd03439794f8ea050de80",
"score": "0.6052337",
"text": "def destroy\n @sshkey.destroy\n respond_to do |format|\n format.html { redirect_to sshkeys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7070e4dc3849fac5852c0271c9b6d7cc",
"score": "0.6047973",
"text": "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"title": ""
},
{
"docid": "1a5d3c4090ec19fabe0c5a2c2e051105",
"score": "0.60412973",
"text": "def delete(key)\n perform_delete(:delete, key)\n end",
"title": ""
},
{
"docid": "ac613674c9eaf7944d2ad1fe7cd1a3ae",
"score": "0.6040686",
"text": "def destroy\n @api_key.destroy\n\n respond_to do |format|\n format.html { redirect_to(api_keys_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b3d5cc7be98c38ed2845836ab57352e3",
"score": "0.6034128",
"text": "def destroy\n @client.delete(@name)\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.60175997",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.60175997",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.60175997",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.60175997",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "7a5eea7c7a07ce3e7f95fa50802d596e",
"score": "0.60008913",
"text": "def delete path\n make_request(path, \"delete\", {})\n end",
"title": ""
},
{
"docid": "ba67ebd85114998e01be10599c8943ca",
"score": "0.599927",
"text": "def delete(path)\n RestClient.delete request_base+path\n end",
"title": ""
},
{
"docid": "8f5526e5505da0f6fc948165a3dd1f38",
"score": "0.5992298",
"text": "def delete(key)\n @db.delete(key.to_s.downcase)\n end",
"title": ""
},
{
"docid": "bd43f185a999af6ce756a0980eb4093d",
"score": "0.5992178",
"text": "def destroy\n @keystroke = Keystroke.find(params[:id])\n @keystroke.destroy\n\n respond_to do |format|\n format.html { redirect_to keystrokes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee563480d90630ec608ef4110caa5736",
"score": "0.5986023",
"text": "def destroy\n @kv.destroy\n respond_to do |format|\n format.html { redirect_to kvs_url, notice: 'Kv was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c51ae6a5f571b9bf9d789473436807d5",
"score": "0.59828067",
"text": "def delete\n redis.del key\n end",
"title": ""
},
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.5979586",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "5228617299f11b309d6e9124884f74e8",
"score": "0.59792155",
"text": "def destroy\n @apikey.destroy\n respond_to do |format|\n format.html { redirect_to apikeys_url, notice: 'API key was successfully destroyed.' }\n end\n end",
"title": ""
},
{
"docid": "33b888c8f2b033bb54789de80c57d692",
"score": "0.5972914",
"text": "def delete\n client.delete(url)\n @deleted = true\nend",
"title": ""
},
{
"docid": "3bbe532f009f1a184b0c02732cbe4aaf",
"score": "0.5968689",
"text": "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"title": ""
},
{
"docid": "078f9cdbe59be32f1e3c963b957b11be",
"score": "0.5966329",
"text": "def delete(_url)\n # do nothing since we can't find the key by url\n end",
"title": ""
},
{
"docid": "b3d32543bc7784f797f1d754b34d3566",
"score": "0.59585315",
"text": "def destroy\n debug(\"#{self.class}::destroy\")\n\n #Retrieval of key\n if ((defined? $key) && !(($key.nil?) || ($key.empty?)))\n Puppet.debug('INFO: key already provided as a command parameter ' + $key)\n\n elsif (!($name.to_s.empty?) )\n\n #Retrieve key\n uriAttributeMap1 = {}\n uriAttributeMap1[:name] = $name\n resourceType = \"storage-service-levels\"\n $key = self.retrieveKeyOfObjectType('/api/1.0/slo/storage-service-levels', resourceType, uriAttributeMap1)\n\n end\n\n\n apiUri = '/api/1.0/slo/storage-service-levels/'+$key\n resourceType = \"storageservicelevel\"\n\n if(transport.http_delete_request(apiUri ,resourceType))\n if(resource[:name] != null)\n puts \"#{resourceType} : #{resource[:name]} successfully deleted\"\n\t\t\telse\n\t\t\t puts \" #{resourceType} successfully deleted\"\n\t\t\tend\n else\n if(resource[:name] != null)\n puts \" #{resourceType} : #{resource[:name]} deletion failed\"\n\t\t else\n\t\t\t puts \" #{resourceType} deletion failed\"\n\t\t end\n end\n\nend",
"title": ""
},
{
"docid": "765dafb23987e21dc2b36836aab41321",
"score": "0.5957588",
"text": "def destroy\n chef_rest_v1.delete(\"clients/#{@name}\")\n end",
"title": ""
},
{
"docid": "9476fe6cd97efc21d4a8305d0f47e722",
"score": "0.5951276",
"text": "def delete(command)\n pp @client.files.delete(clean_up(command[1]))\n end",
"title": ""
},
{
"docid": "9dd95a4fe749030387365a671cdc92d0",
"score": "0.5950616",
"text": "def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1d1b92eb57853d2f7a59149b381565e3",
"score": "0.5942571",
"text": "def destroy\n @server = Server.find(params[:id])\n checkaccountobject(\"servers\",@server)\n @server.send_delete\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6c9ee2a9bd2b5fbeb9557cc6e62b7f41",
"score": "0.5933444",
"text": "def destroy\n return if new_record?\n \n @api.delete \"/meetings/#{shortcode_url}.json\"\n end",
"title": ""
},
{
"docid": "30205c64503a326c9767f8b0b21d8ba9",
"score": "0.59289086",
"text": "def kill_monkeys\n ADB.kill_monkeys(@device_list)\n end",
"title": ""
},
{
"docid": "568acdceab97cc845359a47e40ce117c",
"score": "0.59247667",
"text": "def delete(key, opts = {})\n key = add_namespace(key) unless opts[:no_namespace]\n\n deleted = @redis.del(key)\n\n # Technically the server could delete multiple keys. Since we consider this undefined behaviour at this point\n # in time we throw. In the future we may support deleting multiple keys.\n raise 'Too many keys deleted' if deleted > 1\n\n deleted == 1\n end",
"title": ""
},
{
"docid": "24e8113f42aeeb7829c1ba6f025efed0",
"score": "0.59126395",
"text": "def destroy\n @swift_api_key.destroy\n respond_to do |format|\n format.html { redirect_to swift_api_keys_url, notice: 'Swift api key was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a945662a81c6fe4b64a4301d87866f28",
"score": "0.59008384",
"text": "def delete\n @mapper.delete(@remote_key)\n\n forget\n end",
"title": ""
},
{
"docid": "74403e0e7a66828fb79fd51a62e4e33d",
"score": "0.58915544",
"text": "def delete_multiple(keys = [])\n verify_connection_url\n\n keys.each { |key| delete key }\n end",
"title": ""
},
{
"docid": "3633e737644dae5f5d8d49f3248f7a12",
"score": "0.5886932",
"text": "def delete\n api(\"Delete\")\n end",
"title": ""
},
{
"docid": "d18a37c03374778eda04947fe9177c5f",
"score": "0.5885751",
"text": "def delete_by(wildcard)\n redis.keys(wildcard).each do |key|\n redis.del(key)\n end\nend",
"title": ""
},
{
"docid": "ff16b7b4acbdb72e0fb275ca5dd08454",
"score": "0.5878836",
"text": "def delete(key)\n db.delete(key)\n end",
"title": ""
},
{
"docid": "b55aa4796571c8103f6c26e2a8f78e63",
"score": "0.5877489",
"text": "def delete(key)\n run_hook(:before_delete)\n db.delete(key)\n run_hook(:after_delete)\n end",
"title": ""
},
{
"docid": "522e787502895f0a05c9b2c6ca4e5ced",
"score": "0.58761865",
"text": "def delete\n request(:delete)\n end",
"title": ""
},
{
"docid": "fc6662e6300e872d7199d9c990e5c2ba",
"score": "0.58753186",
"text": "def delete_data key\n init_data\n\n Bot::DB[my_name].delete key\n end",
"title": ""
},
{
"docid": "fc6662e6300e872d7199d9c990e5c2ba",
"score": "0.58753186",
"text": "def delete_data key\n init_data\n\n Bot::DB[my_name].delete key\n end",
"title": ""
},
{
"docid": "e78f746f6c800a3e6951f9b22b9b3106",
"score": "0.58745664",
"text": "def delete_file(path)\n \n puts \"Sending path via MCollective Files client\"\n @mc.delete(:path => path)\n printrpcstats\n \n end",
"title": ""
},
{
"docid": "e9e387633dfbd50e5f44f2d06a122775",
"score": "0.5863818",
"text": "def remove_key(key)\n\t\tdelete(\"/user/keys/#{escape(key)}\")\n\tend",
"title": ""
},
{
"docid": "e9e387633dfbd50e5f44f2d06a122775",
"score": "0.5863818",
"text": "def remove_key(key)\n\t\tdelete(\"/user/keys/#{escape(key)}\")\n\tend",
"title": ""
},
{
"docid": "03b9a3a27f640574b351157d6ef7539d",
"score": "0.5860706",
"text": "def delete\n connection.delete(\"/#{URI.escape(@key)}\", @bucket_name)\n end",
"title": ""
},
{
"docid": "3f47b99d44a515efe964fd3207d68b31",
"score": "0.58581346",
"text": "def cmd_delete argv\n setup argv\n e = @hash['element']\n response = @api.delete(e)\n msg response\n return response\n end",
"title": ""
},
{
"docid": "3768118fe9af96a4c91dad72a6a03568",
"score": "0.58581334",
"text": "def destroy\n @heartbeat = Heartbeat.find(params[:id])\n @heartbeat.destroy\n\n respond_to do |format|\n format.html { redirect_to heartbeats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "85266c9f67f1f84e3b87c7b3848d2544",
"score": "0.5852717",
"text": "def destroy\n @kv = Kv.find(params[:id])\n @kv.destroy\n\n respond_to do |format|\n format.html { redirect_to kvs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "34264605c47edda6ffe32df87c7a7266",
"score": "0.5849668",
"text": "def delete\n delete_from_server single_url\n end",
"title": ""
},
{
"docid": "532f951eb50d1ea39f9449bb80500353",
"score": "0.5846186",
"text": "def destroy(name)\n\t\tdelete(\"/apps/#{name}\")\n\tend",
"title": ""
},
{
"docid": "532f951eb50d1ea39f9449bb80500353",
"score": "0.5846186",
"text": "def destroy(name)\n\t\tdelete(\"/apps/#{name}\")\n\tend",
"title": ""
},
{
"docid": "236799cf101b5fca9628e82226fbda2a",
"score": "0.58402514",
"text": "def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end",
"title": ""
},
{
"docid": "6565c80f677dae68fed9ba9133e9bad3",
"score": "0.58382833",
"text": "def host_delete(host)\n curl = setup_curl(\"#{@foreman_url}/api/hosts/#{host}\", true)\n curl.http_delete\n end",
"title": ""
},
{
"docid": "72a2ba69f9a9e18365787ff1e9f929e6",
"score": "0.58359736",
"text": "def destroy\n @secret_key.destroy\n respond_to do |format|\n format.html { redirect_to secret_keys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "83c14908ecd38bae5553029e7e12fe5d",
"score": "0.5833226",
"text": "def delete_cookie name, path\r\n command 'deleteCookie', name, path\r\n end",
"title": ""
},
{
"docid": "eab7edd0e408459310fcb5ac3c36522d",
"score": "0.58316433",
"text": "def destroy\n @monit = Monit.find(params[:id])\n @monit.destroy\n\n respond_to do |format|\n format.html { redirect_to monits_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "16e897d25713defeb318c31779ce1663",
"score": "0.5825722",
"text": "def delete_api_key(key, request_options = {})\n client.delete(Protocol.index_key_uri(name, key), :write, request_options)\n end",
"title": ""
},
{
"docid": "240d1666f8572b7b02d242b521aa1135",
"score": "0.58252925",
"text": "def delete\n start { |connection| connection.request http :Delete }\n end",
"title": ""
},
{
"docid": "642b4bd4b513d285f22799eb616d786c",
"score": "0.5824689",
"text": "def delete(path)\n make_call(mk_conn(path), :delete)\n end",
"title": ""
},
{
"docid": "f09c807e4788fe9c7833b6d786838584",
"score": "0.5824421",
"text": "def destroy\n @server1 = Server1.find(params[:id])\n @server1.destroy\n\n respond_to do |format|\n format.html { redirect_to server1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee8080891886a4f50035e02f47e137fe",
"score": "0.5818109",
"text": "def delete(path)\n request(:delete, path)\n end",
"title": ""
},
{
"docid": "f7857373db672140feceb513466228c5",
"score": "0.5814106",
"text": "def destroy\n @key_set.destroy\n respond_to do |format|\n format.html { redirect_to key_sets_url, notice: 'Key set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "01d42b1f1f2d6b5e399a23ac1f38cd9a",
"score": "0.58118516",
"text": "def destroy\n @key_metric = KeyMetric.find(params[:id])\n @key_metric.destroy\n\n respond_to do |format|\n format.html { redirect_to(key_metrics_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "49ce2f614ba1c37d904f742da09549e7",
"score": "0.58054215",
"text": "def remove_all_keys\n\t\tdelete(\"/user/keys\")\n\tend",
"title": ""
},
{
"docid": "49ce2f614ba1c37d904f742da09549e7",
"score": "0.58054215",
"text": "def remove_all_keys\n\t\tdelete(\"/user/keys\")\n\tend",
"title": ""
},
{
"docid": "f172e42fa161d882713f493b615e3b79",
"score": "0.58016855",
"text": "def delete_key_pair(name)\n delete(\"tenants/#{tenant}/sshkeys/#{name}\")\n end",
"title": ""
},
{
"docid": "1fd7dc0e91f151ed3e5049a52c30472f",
"score": "0.5786864",
"text": "def delete\n \n end",
"title": ""
},
{
"docid": "1523d093eed147e7ee53d375984af5cb",
"score": "0.5784427",
"text": "def destroy\n onesecgroup('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "1d484b6a82e093fd3892cfe579040305",
"score": "0.5784375",
"text": "def test_delete1()\n key = \"_Delete1\"\n c = Scalaroid::JSONConnection.new(url = Scalaroid::DEFAULT_URL)\n rdht = Scalaroid::ReplicatedDHT.new(conn = c)\n sc = Scalaroid::TransactionSingleOp.new(conn = c)\n\n (0..($_TEST_DATA.length - 1)).each do |i|\n sc.write(@testTime.to_s + key + i.to_s, $_TEST_DATA[i])\n end\n\n # now try to delete the data:\n (0..($_TEST_DATA.length - 1)).each do |i|\n ok = rdht.delete(@testTime.to_s + key + i.to_s)\n assert_equal(4, ok)\n results = rdht.get_last_delete_result()\n assert_equal(4, results.ok)\n assert_equal(0, results.locks_set)\n assert_equal(0, results.undefined)\n _checkKeyDoesNotExist(@testTime.to_s + key + i.to_s)\n\n # try again (should be successful with 0 deletes)\n ok = rdht.delete(@testTime.to_s + key + i.to_s)\n assert_equal(0, ok)\n results = rdht.get_last_delete_result()\n assert_equal(0, results.ok)\n assert_equal(0, results.locks_set)\n assert_equal(4, results.undefined)\n _checkKeyDoesNotExist(@testTime.to_s + key + i.to_s)\n end\n\n c.close()\n end",
"title": ""
},
{
"docid": "dc7978b571fa1af94fbce826dcf38dc1",
"score": "0.57787174",
"text": "def destroy; delete end",
"title": ""
},
{
"docid": "a726bc831c703796886890f7a1e35a49",
"score": "0.57771736",
"text": "def destroy\n @keyval.destroy\n respond_to do |format|\n format.html { redirect_to keyvals_url, notice: 'Keyval was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee46766766ba7c9330c8e1bbcdd3ae2b",
"score": "0.5776884",
"text": "def destroy\n @keylist.destroy\n respond_to do |format|\n format.html { redirect_to keylists_url, notice: 'Keylist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "adba8ee21ff81bb1fc794f42211ba8b9",
"score": "0.57759833",
"text": "def bucket_delete_object(key)\n http.delete(\"/#{key}\", bucket: bucket, key: key)\n end",
"title": ""
}
] |
54bae55bbe44723e306a5092db80b473
|
Converts the first character in the string to lowercase. downcase_first('If they enjoyed The Matrix') => "if they enjoyed The Matrix" downcase_first('I') => "i" downcase_first('') => ""
|
[
{
"docid": "719a5162625ed02aef15348e1f13a0be",
"score": "0.8347486",
"text": "def downcase_first(string)\n string.length > 0 ? string[0].downcase.concat(string[1..-1]) : \"\"\n end",
"title": ""
}
] |
[
{
"docid": "21e12c4f06dcf43a5da6475c2ddd5d90",
"score": "0.83119154",
"text": "def downcase_first\n letters = split('')\n letters.first.downcase!\n letters.join\n end",
"title": ""
},
{
"docid": "4da8d401ded75e0b856c357f21fc2846",
"score": "0.8091105",
"text": "def downcase_first_letter(str)\n str[0].downcase + str[1..-1]\n end",
"title": ""
},
{
"docid": "9309d13260e37c6be8e05efff3dba62d",
"score": "0.8050912",
"text": "def first_char(string)\n string[0].downcase\n end",
"title": ""
},
{
"docid": "9d6f970ed3aca07b47e7c087fa65771e",
"score": "0.8050507",
"text": "def upcase_first(string); end",
"title": ""
},
{
"docid": "9d6f970ed3aca07b47e7c087fa65771e",
"score": "0.8050507",
"text": "def upcase_first(string); end",
"title": ""
},
{
"docid": "9d6f970ed3aca07b47e7c087fa65771e",
"score": "0.8050507",
"text": "def upcase_first(string); end",
"title": ""
},
{
"docid": "8a7327fc8a61d31691b695acfa75d17e",
"score": "0.78708917",
"text": "def first_char(str)\n\tstr[0].downcase\nend",
"title": ""
},
{
"docid": "d8d21cd68f2d2c3df1152ca8d112938b",
"score": "0.78668034",
"text": "def first_char(string)\n string[0].downcase\nend",
"title": ""
},
{
"docid": "5becad4bc1bc8536c69abae017e467b6",
"score": "0.78398544",
"text": "def upcase_first(string)\n string.length > 0 ? string[0].upcase.concat(string[1..-1]) : \"\"\n end",
"title": ""
},
{
"docid": "5becad4bc1bc8536c69abae017e467b6",
"score": "0.78398544",
"text": "def upcase_first(string)\n string.length > 0 ? string[0].upcase.concat(string[1..-1]) : \"\"\n end",
"title": ""
},
{
"docid": "90cc2d5cecbbaa40f5aa3236b6a52c56",
"score": "0.7835634",
"text": "def cap_first\n sub(/^\\w/) do |m|\n m.upcase\n end\n end",
"title": ""
},
{
"docid": "f3b3b1b44166828691decabdd8538883",
"score": "0.78094226",
"text": "def first_char (word)\n return word.chars.first.downcase\nend",
"title": ""
},
{
"docid": "5f300ff48c290ac7d754bc165c3d30d5",
"score": "0.78007734",
"text": "def downcase_first\n str = self.dup\n str[0] = str[0].chr.downcase\n str\n end",
"title": ""
},
{
"docid": "40eac541e8df8ba26f23658cf42a83e0",
"score": "0.7798985",
"text": "def first_char (word)\n word.chars.first.downcase\nend",
"title": ""
},
{
"docid": "220fde6b85fb65028e2484122c253eba",
"score": "0.77918816",
"text": "def first_char str\n str[0].downcase\nend",
"title": ""
},
{
"docid": "986da2357f9eba68794d43386df436c8",
"score": "0.7701416",
"text": "def first_char(str)\n str[0, 1].downcase\nend",
"title": ""
},
{
"docid": "25709112a207f0ae063f30c8f647b3fe",
"score": "0.76819134",
"text": "def first_char(word)\n word.slice(0).downcase\nend",
"title": ""
},
{
"docid": "a8182e65e94a9af60bcb6be6b38b10de",
"score": "0.76649046",
"text": "def first_char (word)\n word[0].downcase!\n\nend",
"title": ""
},
{
"docid": "929bae26106a166b6436a8cece3004f5",
"score": "0.7662148",
"text": "def first_char(word) # passing in word as param\n first_letter = word[0] #taking first letter of word and storing in variable\n first_letter.downcase #downcasing stored variable\nend",
"title": ""
},
{
"docid": "5bc46222a736dde109b097e28f2733af",
"score": "0.7626813",
"text": "def first_char(word)\n word[0].downcase\n end",
"title": ""
},
{
"docid": "6e89ff656d209f3737240ff60479665f",
"score": "0.7616368",
"text": "def first_char(word)\n word[0].downcase \nend",
"title": ""
},
{
"docid": "cc0d2290d8cd10838b07fb917835d28a",
"score": "0.7614587",
"text": "def cap_first_letter string\n string[0] = string[0].capitalize\n return string\n end",
"title": ""
},
{
"docid": "1d33fdc765e8ba790fc1beef6bbb65b0",
"score": "0.75963897",
"text": "def first_char(word)\n return word[0].downcase\nend",
"title": ""
},
{
"docid": "93fe92975a535624d5798b24de392ca5",
"score": "0.7588786",
"text": "def first_char(word)\n first_letter = word.each_char.first\n return first_letter.downcase\nend",
"title": ""
},
{
"docid": "169f49947336f67cbcc2bc310a7e09f1",
"score": "0.758548",
"text": "def first_char(string)\n string = string.downcase.split(\"\")\n return string[0]\n end",
"title": ""
},
{
"docid": "a5e6e103ba4b43ae0ff848cc643e36c6",
"score": "0.75836265",
"text": "def capitalize_first_letter(input)\n (input.slice(0,1).capitalize || '') + (input.slice(1..-1) || '')\n end",
"title": ""
},
{
"docid": "ccaa7e465e90a7087dcb84adde11c38c",
"score": "0.7581096",
"text": "def first_char(word)\n #word.downcase\n return word[0].downcase\nend",
"title": ""
},
{
"docid": "b75cd298235fe819bc1253b903a49fe7",
"score": "0.7555849",
"text": "def first_char word\n word[0].downcase\nend",
"title": ""
},
{
"docid": "63a53a6d03ff6bd92f1b31ac80998e24",
"score": "0.75424165",
"text": "def first_char(word)\n word[0].downcase\nend",
"title": ""
},
{
"docid": "63a53a6d03ff6bd92f1b31ac80998e24",
"score": "0.75424165",
"text": "def first_char(word)\n word[0].downcase\nend",
"title": ""
},
{
"docid": "63a53a6d03ff6bd92f1b31ac80998e24",
"score": "0.75424165",
"text": "def first_char(word)\n word[0].downcase\nend",
"title": ""
},
{
"docid": "353a20b544205c72f32924af28b0046a",
"score": "0.7516143",
"text": "def first_char (word)\n word[0].downcase\nend",
"title": ""
},
{
"docid": "353a20b544205c72f32924af28b0046a",
"score": "0.7516143",
"text": "def first_char (word)\n word[0].downcase\nend",
"title": ""
},
{
"docid": "9a7a4b8d5024ca41751628492d1d8aaa",
"score": "0.74795455",
"text": "def downcase_first!\n self[0] = self[0].chr.downcase\n end",
"title": ""
},
{
"docid": "6d0ce8eafe43333f71204df48f45c239",
"score": "0.7394586",
"text": "def first_char(word)\n word[0].downcase\n # + word[1..word.length]\nend",
"title": ""
},
{
"docid": "fdf2f13c14755d219e8d4f70dbcbccb2",
"score": "0.7368073",
"text": "def firstcase\n self.length > 0 ? self.first.upcase + self[1..self.length - 1] : self\n end",
"title": ""
},
{
"docid": "35ac813d615278405a13aa6f45d0056a",
"score": "0.7342439",
"text": "def first_char(word)\n word.chr.downcase\n end",
"title": ""
},
{
"docid": "75122659a3442d563263605575516d2b",
"score": "0.73044515",
"text": "def capitalize_first_letter!\n unless self[0] == (c = self[0,1].upcase[0])\n self[0] = c\n self\n end\n end",
"title": ""
},
{
"docid": "9e96ed7460b3310da6479bdbc57e931d",
"score": "0.7283994",
"text": "def getCapitalizedFirst(str)\n newStr = String.new\n newStr += str[0, 1].capitalize\n\n if (str.length > 1)\n newStr += str[1..str.length - 1]\n end\n\n return(newStr)\n end",
"title": ""
},
{
"docid": "9e96ed7460b3310da6479bdbc57e931d",
"score": "0.7283994",
"text": "def getCapitalizedFirst(str)\n newStr = String.new\n newStr += str[0, 1].capitalize\n\n if (str.length > 1)\n newStr += str[1..str.length - 1]\n end\n\n return(newStr)\n end",
"title": ""
},
{
"docid": "9e96ed7460b3310da6479bdbc57e931d",
"score": "0.7283994",
"text": "def getCapitalizedFirst(str)\n newStr = String.new\n newStr += str[0, 1].capitalize\n\n if (str.length > 1)\n newStr += str[1..str.length - 1]\n end\n\n return(newStr)\n end",
"title": ""
},
{
"docid": "4b4730439a4ffc1cd1b3785d7899d4c6",
"score": "0.7228286",
"text": "def upcase_first\n str = self.dup\n str[0] = str[0].chr.upcase\n str\n end",
"title": ""
},
{
"docid": "9927292fbdcd607335bc2a5b495ebac1",
"score": "0.7212975",
"text": "def first_char(stuff)\n stuff[0].downcase\nend",
"title": ""
},
{
"docid": "459bf0d42d5f9cb77e2bdbb4f6da229e",
"score": "0.7195487",
"text": "def capitalize_first!\n first = self[/\\A(({[A-Za-z]|[^A-Za-z])*)([a-z])/, 3]\n if first\n return gsub!(/\\A(({[A-Za-z]|\\s)*)([a-z])/, \"#{$1}#{first.upcase}\")\n end\n return nil\n end",
"title": ""
},
{
"docid": "7e142ffa97f20bb4d03a00addbd01d62",
"score": "0.71882516",
"text": "def upcase_first; end",
"title": ""
},
{
"docid": "7e142ffa97f20bb4d03a00addbd01d62",
"score": "0.71882516",
"text": "def upcase_first; end",
"title": ""
},
{
"docid": "9e1f15ee59b38ba78b618b476a73ac82",
"score": "0.7165813",
"text": "def return_first_letter(string)\n return string[0]\n end",
"title": ""
},
{
"docid": "495d9817cca01f5017f41c8e27e1462d",
"score": "0.71583945",
"text": "def first_letter\n\t\tm = basic_name.match(/([a-z])/i)\n\t\tm[1].downcase if m\n\tend",
"title": ""
},
{
"docid": "b914ee5a4233eaf6c9383ad69b6b833d",
"score": "0.7156391",
"text": "def dcfirst\n self[0,1].downcase + self[1..-1]\n end",
"title": ""
},
{
"docid": "b914ee5a4233eaf6c9383ad69b6b833d",
"score": "0.71559256",
"text": "def dcfirst\n self[0,1].downcase + self[1..-1]\n end",
"title": ""
},
{
"docid": "afb386a463eb3239f0f8cd3256023dfe",
"score": "0.7137342",
"text": "def first_letter(string)\n return string[0]\nend",
"title": ""
},
{
"docid": "fe2c7b638be58f3099a6e750cfbfa0cf",
"score": "0.7135132",
"text": "def get_first_letter(string)\n return string[0]\nend",
"title": ""
},
{
"docid": "50d958c9c08a28cb101105c77b6876db",
"score": "0.7114089",
"text": "def capitalize_first\n self.slice(0,1).capitalize + self.slice(1..-1)\n end",
"title": ""
},
{
"docid": "6f989452461e2dc1d0916449fb98de30",
"score": "0.7094277",
"text": "def upcase_first\n to_s.upcase_first.to_sym\n end",
"title": ""
},
{
"docid": "765cf3d79208a8304b16af549cf2d5d2",
"score": "0.70347685",
"text": "def staggered_case(string, first_char = \"upcased\")\n toggle_first_char = first_char == \"downcased\" ? 1 : 0\n string.chars.map.with_index do |char, index|\n (index + toggle_first_char).even? ? char.upcase : char.downcase\n end.join\nend",
"title": ""
},
{
"docid": "4614805c03761d2eb831bec569934a98",
"score": "0.701586",
"text": "def camelize capitalize_first_letter = false\n string = Extlib::Inflection.camelize(self)\n return string if capitalize_first_letter\n string[0,1] = string.first.downcase\n string\n end",
"title": ""
},
{
"docid": "4244624d86c535786148535fcc55a8c8",
"score": "0.700405",
"text": "def first_letter(string)\n string[0]\nend",
"title": ""
},
{
"docid": "1bfbff49a5bf1289946510b211cc9756",
"score": "0.69785136",
"text": "def artist_first_letter(string)\n string[0].upcase.tr(\"ÀÂÄÉÈËÊÎÏÖÔÛÜ\", \"AAAEEEEIIOOUU\")\n end",
"title": ""
},
{
"docid": "575545052900d2a889bca77d826b4ec4",
"score": "0.6974386",
"text": "def upcase_first!\n self[0] = self[0].chr.upcase\n end",
"title": ""
},
{
"docid": "b4046fbb48d3b1b181048293a4ef8a94",
"score": "0.69293106",
"text": "def first_word(string) \n \tstring = string.split(' ')[0]\nend",
"title": ""
},
{
"docid": "c1bb1a91ec0653abb167a6f0ab8cdd0e",
"score": "0.6906014",
"text": "def capitalize_first\n \"#{self[0, 1].upcase}#{self[1, self.length]}\"\n end",
"title": ""
},
{
"docid": "1e2cc286f2d8ab6c43172774249487fc",
"score": "0.68915296",
"text": "def titlecase\n first = true\n words = downcase.split(/(?<!\\w')\\b/)\n\n words.map.with_index do |word,i|\n if LOWERCASE_WORDS.include?(word) and i > 0 # leave LOWERCASE_WORDS lowercase, unless it's the first word.\n word\n else\n word.gsub(/^\\w/) { |c| c.upcase } # capitalize first letter\n end\n end.join('')\n end",
"title": ""
},
{
"docid": "c323fb5de29e47694a4d8beead65e24b",
"score": "0.6891501",
"text": "def first_letter\n Util::Brand.to_pinyin(name).upcase\n end",
"title": ""
},
{
"docid": "2ca5739b300cc47b98317a15cc1f72bf",
"score": "0.68885404",
"text": "def extract_first(name)\n return unless name and name.size >= 1\n\n @first = name.first\n name.delete_at(0)\n\n @first.capitalize! unless @first =~ /[a-z]/ and @first =~ /[A-Z]/\n end",
"title": ""
},
{
"docid": "84717d8c4023dd2a28c9f554d09d31b1",
"score": "0.68802917",
"text": "def capitalize_first\n \"#{self[0,1].upcase}#{self[1,self.length]}\"\n end",
"title": ""
},
{
"docid": "50e2789e69faa302187595e5e44bf584",
"score": "0.68592095",
"text": "def camelize(string, uppercase_first_letter = true)\n string = string.to_s\n if uppercase_first_letter\n string = string.sub(/^[a-z\\d]*/) { |match| match.capitalize }\n else\n string = string.sub(/^(?:(?=\\b|[A-Z_])|\\w)/) { |match| match.downcase }\n end\n string.gsub(/(?:_|(\\/))([a-z\\d]*)/) { \"#{$1}#{$2.capitalize}\" }.gsub(\"/\", \"::\")\n end",
"title": ""
},
{
"docid": "9ba1b7f9cd81d7daa95f7f903ef9637c",
"score": "0.6859181",
"text": "def first_word(string)\n\ttableau = string.split(\" \")\n\treturn tableau[0]\n\nend",
"title": ""
},
{
"docid": "cb7e89b70b4f74ed52c0c3b80a69b95d",
"score": "0.68584013",
"text": "def extract_first(name)\n return unless name && name.size >= 1\n\n @first = name.first\n name.delete_at(0)\n\n @first.capitalize! unless @first =~ /[a-z]/ && @first =~ /[A-Z]/\n end",
"title": ""
},
{
"docid": "be02342ebfcac563110810fa2990af6a",
"score": "0.68508697",
"text": "def camelize(s, first_letter_in_uppercase = true)\n if first_letter_in_uppercase\n s.to_s.gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n else\n s.to_s[0].chr.downcase + camelize(s)[1..-1]\n end\n end",
"title": ""
},
{
"docid": "49446ffaf20b903276574a91003f1104",
"score": "0.6842304",
"text": "def gets_first_word(first_word)\n index = 0\n first_word.reverse.each_char { |char|\n if is_vowel?(char)\n break\n end\n index += 1\n }\n # get the first part of portmanteau\n first_part_portmanteau = first_word.reverse[index + 1, first_word.reverse.length - index].reverse\n return first_part_portmanteau\nend",
"title": ""
},
{
"docid": "6783858128f1bff5c06bdd1bf93266c9",
"score": "0.6835078",
"text": "def get_first_letter(title)\n return title[0]\n end",
"title": ""
},
{
"docid": "ef069e763f18fcceaf507efbbd659c41",
"score": "0.6829629",
"text": "def staggered_case(string, start_at_first_char? = true)\n result = ''\n need_upper = start_at_first_char?\n string.chars.each do |char|\n if need_upper\n result << char.upcase\n else\n result << char.downcase\n end\n need_upper = !need_upper\n end\n result\nend",
"title": ""
},
{
"docid": "70831803dd5df8c29d7986ae4ba4eba5",
"score": "0.68231344",
"text": "def cap_to_front(s)\n\tupcase_letters = []\n\tdowncase_letters = []\n\ts.each_char do |char| \n\t\tif char == char.upcase \n\t\t\tupcase_letters << char \n\t\telse \n\t\t\tdowncase_letters << char\n\t\tend \n\tend \n\tnew_str = upcase_letters + downcase_letters \n\tnew_str.join(\"\")\nend",
"title": ""
},
{
"docid": "50744ff02dd3f64bf59282c900bd3199",
"score": "0.68163997",
"text": "def first_word(word)\n \"#{word.split(\" \")[0]}\"\n end",
"title": ""
},
{
"docid": "f46d375b2d1b69308fbac7d955ec5d09",
"score": "0.6814142",
"text": "def first_letter(word)\n return word[0]\nend",
"title": ""
},
{
"docid": "253436fddd771484c72ceae909efc5d0",
"score": "0.68094665",
"text": "def staggered_case(string, first_char_upcase = true)\n result = ''\n first_char_upcase ? need_upper = true : need_upper = false\n string.chars.each do |char|\n if char =~ /[^a-z]/i\n result += char\n next\n end\n if need_upper\n result += char.upcase\n else\n result += char.downcase\n end\n need_upper = !need_upper\n end\n result\nend",
"title": ""
},
{
"docid": "a8a158cea0ee2ed4aa785ce01d8bc2f3",
"score": "0.68044996",
"text": "def first_word( string )\n\n\t# use split to break words into array and return first\n\tstring.split(' ').first\n\nend",
"title": ""
},
{
"docid": "da13fce214436808a6ce4cf3be2fc9b7",
"score": "0.6801919",
"text": "def get_each_first_letter(string)\n string.split.map(&:first).join\n end",
"title": ""
},
{
"docid": "6b91175fb341140758e786b765ce13e7",
"score": "0.67950785",
"text": "def capitalize_first\n first = self[/\\A(({[A-Za-z]|[^A-Za-z])*)([a-z])/, 3]\n if first\n return gsub(/\\A(({[A-Za-z]|\\s)*)([a-z])/, \"#{$1}#{first.upcase}\")\n end\n return self\n end",
"title": ""
},
{
"docid": "fa9a1e0b90707ff4a7f3c3fdf770f3f0",
"score": "0.6786093",
"text": "def capitalise_first_word\n @title = @title.slice(0,1).upcase + @title.slice(1..-1)\n end",
"title": ""
},
{
"docid": "3b2bf152b4a1fbb91f8bf7309866bcd7",
"score": "0.6783839",
"text": "def staggered_case(string, first_char_upcase = true)\n result = ''\n first_char_upcase ? need_upper = true : need_upper = false\n string.chars.each do |char|\n if need_upper\n result += char.upcase\n else\n result += char.downcase\n end\n need_upper = !need_upper\n end\n result\nend",
"title": ""
},
{
"docid": "aef447f68724f435b7568436d33ea7e8",
"score": "0.6771585",
"text": "def make_head_lower\n self[0].downcase + self[1..-1]\n end",
"title": ""
},
{
"docid": "08971789bd0a1d2d46e4afa634cbcae9",
"score": "0.6757697",
"text": "def first_letter\n char = name[0,1].upcase\n char =~ /[A-Z]/ ? char : '#'\n end",
"title": ""
},
{
"docid": "7bcf639c4ea3d0d321696139b3cf1eb0",
"score": "0.6756876",
"text": "def ucfirst(string)\n if !string.nil? && string != ''\n string[0] = string[0,1].upcase\n end\n string\n end",
"title": ""
},
{
"docid": "daea479f3028739705736426a181f03c",
"score": "0.67553586",
"text": "def staggered_case(string, first = 'uppercase')\n result = string.chars\n result.each_with_index do |char, index|\n if first == 'uppercase'\n index.even? ? char.upcase! : char.downcase!\n else\n index.odd? ? char.upcase! : char.downcase!\n end\n end\n result.join\nend",
"title": ""
},
{
"docid": "b12c097d468c3e596c5c2cb83c9a2e37",
"score": "0.67522234",
"text": "def to_camel_case(str)\n first_letter = str[0]\n str.gsub!(/[\\s_-]+[a-z]/) { |a| a.upcase }\n str.gsub!(/[\\s_-]/, '')\n str[0].nil? ? nil : str[0] = first_letter\n str\nend",
"title": ""
},
{
"docid": "b9f0f7eca71723e7cf15fccc66c5cea5",
"score": "0.67305315",
"text": "def titlecase\n first = true\n words = downcase.split(/(?<!\\w')\\b/)\n\n words.map.with_index do |word,i|\n prev_word = (i > 0) ? words[i-1] : nil\n if LOWERCASE_WORDS.include?(word) and (i > 0 or prev_word != \" - \") # leave LOWERCASE_WORDS lowercase, unless it's the first word, or it comes after a \" - \"\n word\n elsif UPPERCASE_WORDS.include?(word)\n word.upcase\n else\n word.gsub(/^\\w/) { |c| c.upcase } # capitalize first letter\n end\n end.join('')\n end",
"title": ""
},
{
"docid": "567fbf301153fb46e26abb8d61aaef5b",
"score": "0.6722484",
"text": "def first_word(string)\n\n return string.split.first\nend",
"title": ""
},
{
"docid": "07dd469447d6b1c5384c4e1477d35b43",
"score": "0.6711381",
"text": "def first_word(str)\n\tstr.split[0]\nend",
"title": ""
},
{
"docid": "fd4ea0b95377fdc65d1cf2a9658b13fd",
"score": "0.6675151",
"text": "def first_word(str)\n str.split.first\nend",
"title": ""
},
{
"docid": "fd4ea0b95377fdc65d1cf2a9658b13fd",
"score": "0.6675151",
"text": "def first_word(str)\n str.split.first\nend",
"title": ""
},
{
"docid": "64ce5aad32aa567f2587f2ed66535c62",
"score": "0.6672913",
"text": "def first_letter(word)\n word[0]\nend",
"title": ""
},
{
"docid": "c0bdefef87bd924797421e91920a93c6",
"score": "0.66727835",
"text": "def camelize(upper_case_first=true)\n result = self.downcase.scan(/[a-z,0-9]+/).each.inject(\"\") do |str, word|\n str << word.capitalize\n end\n upper_case_first ? result : result.uncapitalize\n end",
"title": ""
},
{
"docid": "f981a27925edc8eb7454790f8d8fbde5",
"score": "0.6667905",
"text": "def first_char(string_c)\n string_c = string_c.split(\" \")\n string_c = string_c[0].split(\"\")\n return string_c[0]\nend",
"title": ""
},
{
"docid": "d0f4d7a732afef97efde3d12fac56780",
"score": "0.6666504",
"text": "def staggered_case(string, first_case = 'upcase')\n letter_array = string.chars\n if first_case == 'downcase'\n letter_array.each_with_index do |item, index|\n index.even? || index == 0 ? letter_array[index] = item.downcase : letter_array[index] = item.upcase\n end.join\n else\n letter_array.each_with_index do |item, index|\n index.even? || index == 0 ? letter_array[index] = item.upcase : letter_array[index] = item.downcase\n end.join\n end\nend",
"title": ""
},
{
"docid": "0f2d1acefc3d933828fe5d874ee47977",
"score": "0.6665171",
"text": "def titleize_firstletter(word)\n\t\treturn word.chars[0].upcase + word.chars[1..word.size].join \n\tend",
"title": ""
},
{
"docid": "6533ff7ea782c21c2c72b9c2a80ebf5c",
"score": "0.6658172",
"text": "def first_word(string)\n string.slice(/^\\S+\\s+/).chop\nend",
"title": ""
},
{
"docid": "2aeb4e27a7220b3aecfaeaaae9b144ad",
"score": "0.66547626",
"text": "def downcase(string); end",
"title": ""
},
{
"docid": "3e9a0e9ea7c51c38a3ed528422c2c584",
"score": "0.66477996",
"text": "def first_word (str)\n str.split(' ')[0] \nend",
"title": ""
},
{
"docid": "8ca80ed3fd188c95efe2bf6e2e82d977",
"score": "0.6641392",
"text": "def change_string(string)\n string.split(\"\")[0] == string.split(\"\")[0].upcase ? string.upcase : string.downcase\nend",
"title": ""
}
] |
64632528207ba7236945f3b3833ac364
|
SQL to start a new savepoint
|
[
{
"docid": "3a7ec0c3ec52b707263ac7d2dc95125c",
"score": "0.5975011",
"text": "def begin_savepoint_sql(depth)\n SQL_SAVEPOINT % depth\n end",
"title": ""
}
] |
[
{
"docid": "94369f11007f1179e5e2d22ddf8e9fd8",
"score": "0.769998",
"text": "def create_savepoint\n @connection.save\n execute(\"SAVEPOINT #{current_savepoint_name}\")\n end",
"title": ""
},
{
"docid": "df38919ed09a5d0376d6729b2509c431",
"score": "0.7202299",
"text": "def begin_savepoint_sql(depth)\n \"SAVEPOINT autopoint_#{depth}\"\n end",
"title": ""
},
{
"docid": "b9488c061be54ca825fbde8b164ca217",
"score": "0.69534487",
"text": "def create_savepoint(name = current_savepoint_name(true))\n @connection.create_savepoint(name)\n end",
"title": ""
},
{
"docid": "e8a51a9ff0dcaf23ef510b19874fa214",
"score": "0.69362587",
"text": "def savepoint(name)\n execute \"SAVEPOINT #{name}\"\n end",
"title": ""
},
{
"docid": "a19964b5f01c555f4ba40b0842b0a10d",
"score": "0.6797582",
"text": "def create_savepoint(name = 'COCKROACH_RESTART'); end",
"title": ""
},
{
"docid": "610bc1792ce0547d097bdcd5f2a2dd86",
"score": "0.67794174",
"text": "def begin_savepoint(conn, opts)\n log_connection_execute(conn, begin_savepoint_sql(savepoint_level(conn)-1))\n end",
"title": ""
},
{
"docid": "f5ecd73c39ad77c1fbe84661ab560c53",
"score": "0.65785736",
"text": "def begin_savepoint_sql(depth)\n \"SAVE TRANSACTION autopoint_#{depth}\"\n end",
"title": ""
},
{
"docid": "5ffeab80cf91359a05f0860f3eee7c29",
"score": "0.649287",
"text": "def savepoint(name)\n\t\t\t\tself.call(\"SAVEPOINT #{name}\")\n\t\t\tend",
"title": ""
},
{
"docid": "1e4323ef313aa46ba17c5dd00367dba7",
"score": "0.6183327",
"text": "def commit_savepoint_sql(depth)\n \"RELEASE SAVEPOINT autopoint_#{depth}\"\n end",
"title": ""
},
{
"docid": "a863baa73d1470c0e3638b7cd4e000a4",
"score": "0.61351824",
"text": "def begin_savepoint_sql(depth)\n SQL_SAVEPOINT % depth\n end",
"title": ""
},
{
"docid": "15d63009fb9649d92267ca1f1b8831be",
"score": "0.61106336",
"text": "def start!\n self.started = true\n return self.save\n end",
"title": ""
},
{
"docid": "4cfd098c05929f04aa49016339690662",
"score": "0.57963175",
"text": "def checkpoint\n dump()\n start()\n end",
"title": ""
},
{
"docid": "c61c20e8aff9057f54ce4fca74ac1c34",
"score": "0.57781947",
"text": "def begin_transaction(conn, opts={})\n if supports_savepoints?\n th = @transactions[conn]\n if sps = th[:savepoints]\n sps << log_yield(TRANSACTION_SAVEPOINT){conn.set_savepoint}\n else\n log_yield(TRANSACTION_BEGIN){conn.setAutoCommit(false)}\n th[:savepoints] = []\n end\n th[:savepoint_level] += 1\n else\n log_yield(TRANSACTION_BEGIN){conn.setAutoCommit(false)}\n end\n end",
"title": ""
},
{
"docid": "845db3be79a2fc15f822b8685bcf491d",
"score": "0.5740194",
"text": "def savepoint( name )\n point_name = name.to_s.strip\n raise Amalgalite::Error, \"Invalid savepoint name '#{name}'\" unless point_name and point_name.length > 1\n execute( \"SAVEPOINT #{point_name};\")\n if block_given? then\n begin\n return ( yield self )\n ensure\n if $! then\n rollback_to( point_name )\n raise $!\n else\n release( point_name )\n end\n end\n else\n return in_transaction?\n end\n end",
"title": ""
},
{
"docid": "10e9223b495427454f20b6d878c0d9c6",
"score": "0.5737488",
"text": "def release_savepoint(name = current_savepoint_name(false))\n @connection.release_savepoint(name)\n end",
"title": ""
},
{
"docid": "5e877ebd351fe99809367ee89aa500ef",
"score": "0.57358444",
"text": "def supports_savepoints?; end",
"title": ""
},
{
"docid": "f785414eb01267d3d2bab5da2d667112",
"score": "0.5713049",
"text": "def savepoint_name; end",
"title": ""
},
{
"docid": "790a2dc65ab1756fe65c719eb2bed5ca",
"score": "0.571253",
"text": "def save_insert_file\n run_sql_cmd(save_insert_cmd)\n end",
"title": ""
},
{
"docid": "3dd6432cbc9e3685f3c2a45f6ec9dc97",
"score": "0.5686964",
"text": "def set_start_point\n @start_point = StartPoint.find(params[:id])\n end",
"title": ""
},
{
"docid": "f9fb651ba5469d0202973903c5f8da4f",
"score": "0.56698227",
"text": "def set_startpoint\n @startpoint = Startpoint.find(params[:id])\n end",
"title": ""
},
{
"docid": "f70c93b077621c7e3ff22e8a98efc5fd",
"score": "0.5643078",
"text": "def start\n Thread.current[:transaction_store] = self\n\n # neumann: works with earlier PSQL databases too.\n exec('BEGIN TRANSACTION') if @transaction_nesting < 1\n\n if @transaction_nesting >= 1 && @conn.server_version > 80000\n exec(\"SAVEPOINT SP#{@transaction_nesting}\")\n end\n\n @transaction_nesting += 1\n end",
"title": ""
},
{
"docid": "06df08713d50191931742e212c159e86",
"score": "0.5472687",
"text": "def set_start_up\n @start_up = StartUp.find(params[:id])\n @current_obj = @start_up\n end",
"title": ""
},
{
"docid": "93efc8a2a130a0edc609a7c40190fff9",
"score": "0.54305536",
"text": "def set_sparrow\n @sparrow = Sparrow.find(params[:id])\n end",
"title": ""
},
{
"docid": "b27f9e051b8a4795bc5c66a851e2be05",
"score": "0.5422307",
"text": "def save()\n connect() unless @statement\n @statement.execute(self.app_id, self.experiment_id, self.variation_id)\n end",
"title": ""
},
{
"docid": "dcb860bb8742405a10e7a975ce0f1082",
"score": "0.5421182",
"text": "def start\n return false if started?\n self.started_at = Time.now\n self.paused_at = nil\n self.resumed_at = nil\n self.finished_at = nil\n self.save\n end",
"title": ""
},
{
"docid": "3c2d1e5dd7ec193dd4b03a059a7a90d5",
"score": "0.5415568",
"text": "def init_db\n execute_sql_query(CREATE_EXTENTION)\n execute_sql_query(CREATE_TABLE)\n execute_sql_query(CLEAR_POINTS_TABLE)\nend",
"title": ""
},
{
"docid": "6c5f513b8f85f92e716403c3b10ddbff",
"score": "0.5403811",
"text": "def start\n create('start')\n end",
"title": ""
},
{
"docid": "9b1c01dc8461b4b8f7f6d1084799b168",
"score": "0.5398681",
"text": "def play!\n self.start_time = Time.now\n self.save!\n end",
"title": ""
},
{
"docid": "8ce333b7629e492320bf3d8dd9c15d89",
"score": "0.5380477",
"text": "def start\n self.state = \"opened\"\n save\n end",
"title": ""
},
{
"docid": "1661aa6ac9076ccae3bc9f27c2b12d70",
"score": "0.53781927",
"text": "def commit_savepoint_sql(depth)\n SQL_RELEASE_SAVEPOINT % depth\n end",
"title": ""
},
{
"docid": "752be76872bde96a84f05b4352f3a612",
"score": "0.5371527",
"text": "def begin_transaction(conn, opts=OPTS)\n if supports_savepoints?\n th = _trans(conn)\n if sps = th[:savepoint_objs]\n sps << log_connection_yield('Transaction.savepoint', conn){conn.set_savepoint}\n else\n log_connection_yield('Transaction.begin', conn){conn.setAutoCommit(false)}\n th[:savepoint_objs] = []\n set_transaction_isolation(conn, opts)\n end\n else\n log_connection_yield('Transaction.begin', conn){conn.setAutoCommit(false)}\n set_transaction_isolation(conn, opts)\n end\n end",
"title": ""
},
{
"docid": "9061b39294967985c2852c5d4962b0ff",
"score": "0.5365612",
"text": "def start(login)\n uuid = SecureRandom.uuid\n @pgsql.exec('INSERT INTO job (id, log, login) VALUES ($1, $2, $3)', [uuid, 'Running', login])\n uuid\n end",
"title": ""
},
{
"docid": "a5e9a60ead7d77d7bfb1167c51f1d4e4",
"score": "0.53542715",
"text": "def move_point\n\n # student1 = Student.first\n # # 10.times do\n # student1.latitude += 0.005\n # student1.longitude += 0.005\n # student1.save!\n # # sleep 1\n # # end\n #\n # student2 = Student.second\n # student2.latitude += 0.005\n # student2.longitude += 0.005\n # student2.save!\n\n point = Point.all\n\n Point.all.each do |point|\n point.latitude += 0.0005\n point.longitude += 0.0005\n point.save\n end\n\n\n\n\n end",
"title": ""
},
{
"docid": "d66673a615eddf4ef4e379d52a8b4e39",
"score": "0.5318403",
"text": "def save!\n save_real_source(true)\n end",
"title": ""
},
{
"docid": "1a8c35669c7f779b2d4cb4833295dee9",
"score": "0.52939546",
"text": "def set_spawn_point\n @spawn_point = SpawnPoint.find(params[:id])\n end",
"title": ""
},
{
"docid": "a52999d102a15d848e2a7230775c6ea4",
"score": "0.5290553",
"text": "def create_backup\n run_script(\"backup\", s_one)\n wait_for_snapshots\n end",
"title": ""
},
{
"docid": "c07bf90c283ceaf6a07966185cd9f114",
"score": "0.5285558",
"text": "def commit_savepoint_sql(depth)\n SQL_RELEASE_SAVEPOINT % depth\n end",
"title": ""
},
{
"docid": "b876f45b6026f02c4a086238c4f2a8fe",
"score": "0.5272046",
"text": "def start(start_date, end_date)\n self.start_date = start_date\n self.end_date = end_date\n self.active = true\n save\n end",
"title": ""
},
{
"docid": "35369dc886cfb52e04ac8bc842c30b11",
"score": "0.5265814",
"text": "def start\n @saved_time = millis\n end",
"title": ""
},
{
"docid": "de41412269fe05ab487716430fc4da1b",
"score": "0.52504575",
"text": "def call_save\n $game_player.straighten\n $game_temp.save_calling = false\n call_scene(GamePlay::Save)\n end",
"title": ""
},
{
"docid": "f45d313239e739951dfd4ae7a2e6579b",
"score": "0.52451926",
"text": "def start_run\n workflow_id = params[:id]\n start_block = Block.new\n new_run = Run.new({:user_id => session[:user_id], :workflow_id => workflow_id})\n ActiveRecord::Base.transaction do\n start_block = Block.where('workflow_id = ? and sort_index = 0', workflow_id).first\n new_run.block_id = start_block.id\n new_run.save!\n end\n redirect_to :action => 'expert_workflow', :block_id => start_block.id, :run_id => new_run.id, :first_block => true # TODO: This should be a POST request, but all redirects are GET requests.\n end",
"title": ""
},
{
"docid": "36efb73e43bfdde2eecaca51c358ecc8",
"score": "0.52379394",
"text": "def scheduler(db, name, species, diet, fed)\r\n\tchart.execute(\"INSERT INTO pets (name, species, diet, fed) VALUES (?, ?, ?, ?)\", [name, species, diet, fed])\r\nend",
"title": ""
},
{
"docid": "ff272e5a69f1c0f3693cd9f7fb742d14",
"score": "0.52363086",
"text": "def begin_transaction(conn, opts=OPTS)\n if supports_savepoints?\n if savepoint_level(conn) > 1\n begin_savepoint(conn, opts)\n else\n begin_new_transaction(conn, opts)\n end\n else\n begin_new_transaction(conn, opts)\n end\n end",
"title": ""
},
{
"docid": "7739396157cebd06dff7b72040d4950e",
"score": "0.5235659",
"text": "def begin_transaction(conn, opts={})\n if supports_savepoints?\n th = _trans(conn)\n if (depth = th[:savepoint_level]) > 0\n log_connection_execute(conn, begin_savepoint_sql(depth))\n else\n begin_new_transaction(conn, opts)\n end\n th[:savepoint_level] += 1\n else\n begin_new_transaction(conn, opts)\n end\n end",
"title": ""
},
{
"docid": "12e4512fe17c0693562caa9d66247ba9",
"score": "0.5233186",
"text": "def create_parking(db, street, city, state, zip, start_time, end_time)\n db.execute(\"INSERT INTO parking (street, city, state, zip, start_time, end_time) VALUES (?, ?, ?, ?, ?, ?)\", [street, city, state, zip, start_time, end_time])\nend",
"title": ""
},
{
"docid": "3c1f5fc47df17c4f0e2b782acf61ccd7",
"score": "0.52250236",
"text": "def runs_into(record)\n # NOTE: We cannot use the normal ActiveRecord saving here because we are changing a value concerned with\n # the primary key that identifies this record. Hence we have to do the update ourselves using good\n # old SQL!\n #\n # TODO: Remove the 'is_current=>false' once the is_current column has been removed from third party queries\n self.class.updating(self).update_all(\"`#{date_sequence_to_attribute}`=#{record.date_sequence_from.to_s(:db).inspect}, `is_current`=false\")\n end",
"title": ""
},
{
"docid": "eb4ffc33c6b4a97976567b5455fff395",
"score": "0.5209799",
"text": "def set_workpoint\n @workpoint = Workpoint.find(params[:id])\n end",
"title": ""
},
{
"docid": "059efa0fcd669efd35b68c1613096852",
"score": "0.52077055",
"text": "def start_track\n @track = Track.new\n @track.name = params[:name] || \"Track from #{Time.now}\"\n @track.user = current_user\n @track.is_public = false\n @track.save!\n end",
"title": ""
},
{
"docid": "0d74ee8760c20628fe7de2f2d247b745",
"score": "0.52071995",
"text": "def set_power_point\n @power_point = PowerPoint.find(params[:id])\n end",
"title": ""
},
{
"docid": "12c2a294db2a00f31686bd611775ab71",
"score": "0.52027994",
"text": "def rollback_to_savepoint(name = current_savepoint_name(true))\n @connection.rollback_savepoint(name)\n end",
"title": ""
},
{
"docid": "67c47422ec03e9d5d3d6c1b0a89e2f6a",
"score": "0.5202031",
"text": "def save\n send_command([:save])\n end",
"title": ""
},
{
"docid": "50ca1e7736191ee569748eda92732b2c",
"score": "0.5198437",
"text": "def save\n @api.send(\"world.checkpoint.save()\")\n end",
"title": ""
},
{
"docid": "3c3a035cb671a9e88101c53b66e6b0a7",
"score": "0.5185065",
"text": "def save\n CONNECTION.execute(\"UPDATE trains SET name = '#{self.name}', location_id = #{self.location_id} WHERE id = #{self.id};\")\n end",
"title": ""
},
{
"docid": "953b18f6f29ecab0951789c10e1c4278",
"score": "0.51791906",
"text": "def rollback_to_savepoint\n execute(\"ROLLBACK TO SAVEPOINT #{current_savepoint_name}\")\n end",
"title": ""
},
{
"docid": "2e828de0de83ddb2a5253a367ff6718a",
"score": "0.51697814",
"text": "def start issuename, notes=''\n unless issuename.nil? or issuename.empty?\n stopresult = stop if @db.getcurrent\n @db.startnew issuename, notes\n [true, stopresult]\n else\n false\n end\n end",
"title": ""
},
{
"docid": "a7aceb98c583e22a1304e8517ae891a6",
"score": "0.51631266",
"text": "def start_review!\n @saving_review = true\n end",
"title": ""
},
{
"docid": "f657a889121316bc6f5fc7664cc252e7",
"score": "0.51603264",
"text": "def createSave(historicName)\n\n\t\t@aventureDB.execute(\"UPDATE aventure historic = '#{historicName}' WHERE idMap = '#{@currentMap}' AND idSave = '#{@idSave}'\")\n\n\tend",
"title": ""
},
{
"docid": "8ee1b101f0ce47a7f78d793f39ba8e2e",
"score": "0.5159871",
"text": "def start\n return false if started?\n self.started_at = Time.now\n self.last_played_at = Time.now\n self.save\n end",
"title": ""
},
{
"docid": "3e0b775b5917104a59624e418c8ab5c8",
"score": "0.5155767",
"text": "def release( point_name )\n execute( \"RELEASE SAVEPOINT #{point_name}\" ) if in_transaction? \n end",
"title": ""
},
{
"docid": "d7858eb6ce7e29c0065f8b1bb95dd167",
"score": "0.5153478",
"text": "def set_default_start\n @default_start = DefaultStart.find(params[:id])\n end",
"title": ""
},
{
"docid": "0de316063eeb75d3594fe5bfcbab9f47",
"score": "0.51527905",
"text": "def rollback_savepoint_sql(depth)\n \"ROLLBACK TO SAVEPOINT autopoint_#{depth}\"\n end",
"title": ""
},
{
"docid": "cae1541e7ab873581cb85731dbe32e2f",
"score": "0.514855",
"text": "def set_powerpoint\n @powerpoint = Powerpoint.find(params[:id])\n end",
"title": ""
},
{
"docid": "e88a1cb7dd728a1fb57b3f1a23bc6ed3",
"score": "0.51354015",
"text": "def execute!\n if @type.eql?('S')\n show = Show.new(@region, @show_name, @starting_at, @ending_at)\n GRID.schedule(show)\n else\n shows = GRID.query(@region, @airing_at)\n output(shows)\n end\n end",
"title": ""
},
{
"docid": "f758281706f947da0cd4db53dfeedd6a",
"score": "0.51331913",
"text": "def createSave\n\t\t@save = ConnectDB.new.save(Connexion.getJoueur,self.to_yaml()).id_save\n\tend",
"title": ""
},
{
"docid": "7bec57e8f17b522907c2c24ebac2a8f6",
"score": "0.5127733",
"text": "def save ; end",
"title": ""
},
{
"docid": "7bec57e8f17b522907c2c24ebac2a8f6",
"score": "0.5127733",
"text": "def save ; end",
"title": ""
},
{
"docid": "6fb8c8506cd806d1b446abfd478dc823",
"score": "0.5123119",
"text": "def start\n # just logs the moisture value for now, \n # time information is logged in stop\n truncateOldRows()\n if (params.has_key?(:moisture)) \n @moistureEntry = Moisture.new(:moisture => params[:moisture])\n @moistureEntry.save\n end\n end",
"title": ""
},
{
"docid": "912ae1f772822ed97cc446394c5b0e7e",
"score": "0.5118386",
"text": "def take_a_step\n Position.create!(game_id: game_id, player_id: player_id,\n face: face, x: x, y: y)\n end",
"title": ""
},
{
"docid": "ac5bcde0dafdecb3611b8f36710ac02b",
"score": "0.51183474",
"text": "def start_progress!\n self.started_at = DateTime.now.utc\n self.status = STATUSES.key(:in_progress)\n self.save!\n end",
"title": ""
},
{
"docid": "0335b54ef3271143715da6bd1a719a7d",
"score": "0.5114589",
"text": "def save_point\n saved = new_mark\n column = @goal_column\n @save_point_level += 1\n begin\n yield(saved)\n ensure\n point_to_mark(saved)\n saved.delete\n @goal_column = column\n @save_point_level -= 1\n end\n end",
"title": ""
},
{
"docid": "7dfbe95e79278e152d04668f902a381d",
"score": "0.51089776",
"text": "def autosave; end",
"title": ""
},
{
"docid": "d83fba16776e01fde6973ac66700d73c",
"score": "0.5096127",
"text": "def set_work_point\n @work_point = WorkPoint.find(params[:id])\n end",
"title": ""
},
{
"docid": "c684f956df6a452ed3d68a0b1b24f424",
"score": "0.5093798",
"text": "def save()\n sql = \"INSERT INTO screenings(film_id, screening_time)\n VALUES ($1, $2)\n RETURNING id\"\n values = [@film_id, @screening_time]\n screening = SqlRunner.run(sql, values)[0];\n @id = screening['id'].to_i\n end",
"title": ""
},
{
"docid": "df8fdcfe16f1e7c936866a551c1029ae",
"score": "0.50830346",
"text": "def new_sample(db, coffee_id, roast_date)\n\t\tdb.execute(\"INSERT INTO samples (coffee_id, roast_date) VALUES (?, ?)\", [coffee_id, roast_date])\n\tend",
"title": ""
},
{
"docid": "fb9b46e2b0219543574597b076d86dc6",
"score": "0.5076096",
"text": "def run_hyunwoo_20140520_upload \n v_base_path = Shared.get_base_path()\n @schedule = Schedule.where(\"name in ('hyunwoo_20140520_upload')\").first\n @schedulerun = Schedulerun.new\n @schedulerun.schedule_id = @schedule.id\n @schedulerun.comment =\"starting hyunwoo_20140520_upload -MOVED TO SHARED_RETIRED.rb\"\n @schedulerun.save\n @schedulerun.start_time = @schedulerun.created_at\n @schedulerun.save\n \n end",
"title": ""
},
{
"docid": "b6ef83630aaeceaf6385242765c5058c",
"score": "0.5072056",
"text": "def set_setpoint\n @setpoint = Setpoint.find(params[:id])\n end",
"title": ""
},
{
"docid": "a1e2b097dc66135678cadf46414ffe50",
"score": "0.5050487",
"text": "def save\n Save()\n end",
"title": ""
},
{
"docid": "8090c6ce31476d39562ec4a45b751f5c",
"score": "0.5047544",
"text": "def start_suspending(name, klass, smart_id = nil)\n data_store.sadd(SUSPEND_OPS_KEY, [name, klass, smart_id].compact.join('/'))\n end",
"title": ""
},
{
"docid": "3efaf7983b96054143512aef2a782ce6",
"score": "0.5041445",
"text": "def set_gps_point\n @gps_point = GpsPoint.find(params[:id])\n end",
"title": ""
},
{
"docid": "47937c7c926cdcf491055795bc2cb97a",
"score": "0.5038815",
"text": "def rollback_to( point_name )\n execute( \"ROLLBACK TO SAVEPOINT #{point_name}\" )\n end",
"title": ""
},
{
"docid": "f7cb03553838d60ef635975814622b8e",
"score": "0.5031511",
"text": "def run_padi_upload # CHNAGE _STATUS_FLAG = Y !!!!!!! ## add mri_visit_number????\n v_base_path = Shared.get_base_path()\n @schedule = Schedule.where(\"name in ('padi_upload')\").first\n @schedulerun = Schedulerun.new\n @schedulerun.schedule_id = @schedule.id\n @schedulerun.comment =\"starting padi_upload -MOVED TO SHARED_RETIRED\"\n @schedulerun.save\n @schedulerun.start_time = @schedulerun.created_at\n @schedulerun.save\n \n end",
"title": ""
},
{
"docid": "e9e5de31a1ba18bb75c5df7498a3a391",
"score": "0.50217545",
"text": "def save\n connection = Sandwich.open_connection\n\n sql = \"INSERT INTO sandwich (title, description) VALUES ('#{self.title}', '#{self.description}')\"\n\n connection.exec(sql)\n end",
"title": ""
},
{
"docid": "5c79ade974c4d196227c7c0c1244d08c",
"score": "0.5016426",
"text": "def run(db,name,address,distance)\r\n\tdb.execute(\"INSERT INTO running(name,address,distance) VALUES(?,?,?)\",[name,address,distance])\r\nend",
"title": ""
},
{
"docid": "00362b7b6380ac99fca500348a79c5c3",
"score": "0.501189",
"text": "def store_start_timestamp(experiment, timestamp)\n end",
"title": ""
},
{
"docid": "547db7fb852057153445ec064bd5fc95",
"score": "0.5010794",
"text": "def start(valve_id)\n valve = Valve.find(valve_id)\n log \"history.start: #{valve.name}, \"\n update(start_time: Time.now, valve_id: valve_id)\n valve.update(active_history_id: id)\n end",
"title": ""
},
{
"docid": "9c5995cf529573481567a6959aa91eff",
"score": "0.50079733",
"text": "def start_new_test\n if start_over?\n redirect_to :action => :index\n end\n end",
"title": ""
},
{
"docid": "d19b8dd1a87d4f2898320210de206304",
"score": "0.499874",
"text": "def set_checkpoint\n @checkpoint = Checkpoint.find(params[:id])\n end",
"title": ""
},
{
"docid": "d19b8dd1a87d4f2898320210de206304",
"score": "0.499874",
"text": "def set_checkpoint\n @checkpoint = Checkpoint.find(params[:id])\n end",
"title": ""
},
{
"docid": "8eacce878cebd1334bcca6dec3585174",
"score": "0.49873933",
"text": "def set_positive_point\n @positive_point = PositivePoint.find(params[:id])\n end",
"title": ""
},
{
"docid": "01798d0ecf875a9cab31eb283041d06c",
"score": "0.4985988",
"text": "def call_save\n $game_temp.next_scene = nil\n $scene = Scene_File.new(true, false, true)\n end",
"title": ""
},
{
"docid": "4408f1ad7c1dbbf7e731bb01a48be6c5",
"score": "0.49837807",
"text": "def saver; end",
"title": ""
},
{
"docid": "4408f1ad7c1dbbf7e731bb01a48be6c5",
"score": "0.49837807",
"text": "def saver; end",
"title": ""
},
{
"docid": "4408f1ad7c1dbbf7e731bb01a48be6c5",
"score": "0.49837807",
"text": "def saver; end",
"title": ""
},
{
"docid": "beaa7e753b25768ea2d94315818b2736",
"score": "0.4979224",
"text": "def run_adrc_pcvipr \n v_base_path = Shared.get_base_path()\n v_preprocessed_path = v_base_path+\"/preprocessed/visits/\"\n @schedule = Schedule.where(\"name in ('adrc_pcvipr')\").first\n @schedulerun = Schedulerun.new\n @schedulerun.schedule_id = @schedule.id\n @schedulerun.comment =\"starting adrc_pcvipr MOVED TO SHARED_RETIRED\"\n @schedulerun.save\n @schedulerun.start_time = @schedulerun.created_at\n @schedulerun.save\n end",
"title": ""
},
{
"docid": "423c0deb56c4b9ae462388cac6f89baf",
"score": "0.4978905",
"text": "def save\n result = DB.exec(\"INSERT INTO trains (train_name) VALUES ('#{@train_name}') RETURNING id;\")\n @id = result.first().fetch('id').to_i\n end",
"title": ""
},
{
"docid": "e93ae71678dd4e0a9af60a7b134bb94d",
"score": "0.4974075",
"text": "def save\n intersys_call(\"%Save\")\n end",
"title": ""
},
{
"docid": "aefc31ad83a731969de9d161fb653558",
"score": "0.4972689",
"text": "def previous_track; execute 'previous track'; end",
"title": ""
},
{
"docid": "cd87f19979be0faed5ab29734298612b",
"score": "0.49675056",
"text": "def fly_in(db, plane, passengers, flying_attendant)\n db.execute(\"INSERT INTO controller (plane, passengers, flying_attendant) VALUES (?, ?, ?)\", [plane, passengers, flying_attendant])\nend",
"title": ""
},
{
"docid": "59d86938f3f6ca6d4ad5efc47225427a",
"score": "0.49674648",
"text": "def save()\n sql = \"INSERT INTO plastics (type, existence, weight, conversion_factor, recycable) VALUES ($1, $2, $3, $4, $5)\n RETURNING id;\"\n values=[@type, @existence, @weight, @conversion_factor, @recycable]\n results = SqlRunner.run(sql, values)\n @id = results.first()['id'].to_i\nend",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "0fe7c19ac44eae94361e9be7de96623a",
"score": "0.0",
"text": "def vote_params\n params.require(:vote).permit(:hold_date, :presenter, :score, :comment)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7497801",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957249",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.6922864",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6894648",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.6786758",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.67450184",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6682515",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.66380686",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.66294324",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.662768",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.6562991",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6491257",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64791185",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.64545095",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.64005315",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.63839954",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.63651323",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.6340763",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6336921",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6326123",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.63204646",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.63156325",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.6315594",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.63078135",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.63025755",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.62997544",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.6297044",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292996",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292996",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.62799454",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.62747735",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6267526",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6256206",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.6255869",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.6253548",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6236989",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62287927",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.62287027",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6228029",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.6226944",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6201237",
"text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end",
"title": ""
},
{
"docid": "d724124948bde3f2512c5542b9cdea74",
"score": "0.6191959",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.6184071",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.61811763",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61642146",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.61621594",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.6156416",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.61560374",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.613732",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.6134527",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61210734",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6117956",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6117956",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.6113261",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61116403",
"text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61052126",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61052126",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6099496",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6099496",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6086654",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.608609",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.6085689",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.607834",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.6075777",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.60698164",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60677266",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.6067109",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6066692",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.60653156",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.6064253",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.6063467",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60578674",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60511786",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60511786",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.60500324",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.6047289",
"text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end",
"title": ""
},
{
"docid": "080d2fb67f69228501429ad29d14eb29",
"score": "0.60416925",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.60361874",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6032305",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6025675",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6022113",
"text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.60209477",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6017353",
"text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.6015427",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "2aa7b93e192af3519f13e9c65843a6ed",
"score": "0.60087335",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60068774",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60068774",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006627",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.6004571",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.60036385",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60023195",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.60013676",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.60013676",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59998983",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59998983",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.59997034",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.5996126",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5994328",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.59936756",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.5991889",
"text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.59916514",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
}
] |
1952d6df3049495c0d834d2386348560
|
POST /calendars or /calendars.json
|
[
{
"docid": "529da68f1426bffb61b0415d25b09a3e",
"score": "0.70419997",
"text": "def create\n @calendar = Calendar.new(calendar_params)\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.json { render :show, status: :created, location: @calendar }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "378d72d8962a99e5c9d7bc7d9b33722f",
"score": "0.74203604",
"text": "def create\n @calendar = Calendar.new(calendar_params)\n\n respond_to do |format|\n if @calendar.save\n format.json { head :created }\n else\n format.json { head :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d130c21390b9f24d65349df47599da6a",
"score": "0.73431647",
"text": "def create\n @calendar = Calendar.new(calendar_params)\n \n if @calendar.save\n render json: @calendar, status: :created\n else\n render json: {message: \"could not create calendar\", errors: @calendar.errors.full_messages }\n end\n\n end",
"title": ""
},
{
"docid": "c4d5075d5ef4fa38377757d81bd30562",
"score": "0.72723323",
"text": "def create\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.json { render :show, status: :created, location: @calendar }\n else\n format.html { render :new }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0218d93f61ea40289719a2b32d314785",
"score": "0.71923184",
"text": "def create\n @calendar = Calendar.new(params[:calendar])\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.json { render json: @calendar, status: :created, location: @calendar }\n else\n format.html { render action: \"new\" }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "576681d9d53d2b3d0b23b9e342699713",
"score": "0.7184231",
"text": "def calendar\n date = Date.parse(params[:start_date]) || Date.new\n events = Event.for_calendar(date).all\n render json: calendar_json(events), status: 200\n end",
"title": ""
},
{
"docid": "c581502b240dc0b3c1201c5e3f08a5c0",
"score": "0.7173859",
"text": "def create\n authorize! :index, @user, :message => 'Not authorized.'\n @calendar = Calendar.new(params[:calendar])\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.json { render json: @calendar, status: :created, location: @calendar }\n else\n format.html { render action: \"new\" }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d69c693066e30aa1e58e11c3eaf5184a",
"score": "0.7151065",
"text": "def calendar\n #we don't prepare any data, all info is requested by the calendar dynamically \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @calendar }\n end\n end",
"title": ""
},
{
"docid": "338c524f3083d76abf459a3d9e6f6a3f",
"score": "0.7052488",
"text": "def create\n @calendar = Calendar.new(calendar_params)\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.json { render :show, status: :created, location: @calendar }\n else\n format.html { render :new }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "338c524f3083d76abf459a3d9e6f6a3f",
"score": "0.7052488",
"text": "def create\n @calendar = Calendar.new(calendar_params)\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.json { render :show, status: :created, location: @calendar }\n else\n format.html { render :new }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "338c524f3083d76abf459a3d9e6f6a3f",
"score": "0.7051235",
"text": "def create\n @calendar = Calendar.new(calendar_params)\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.json { render :show, status: :created, location: @calendar }\n else\n format.html { render :new }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a2bb84601b398ce5acbca97d173ad71",
"score": "0.69387144",
"text": "def create\n @calendar = Calendar.new(calendar_params)\n respond_to do |format|\n if @calendar.save\n flash[:success] = 'Calendar was successfully created.'\n format.html { redirect_to admin_calendar_url(@calendar) }\n format.json { render :show, status: :created, location: @calendar }\n else\n format.html { render :new }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f7a2f0bf700c14cf9107b34bee4e24f",
"score": "0.6872957",
"text": "def create\n respond_to do |format|\n if @calendar_event.save\n format.html { redirect_to @calendar, notice: 'Calendar Event was successfully created.' }\n format.json { render :show, status: :created, location: @calendar }\n else\n format.html { render :new }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d97e1e530f25f6f28887fdb5070f0ffd",
"score": "0.68619305",
"text": "def create\n pp create_params\n @calendar = Calendar.new(create_params)\n @calendar.save\n @calendar.errors.empty? and add_history\n respond_with @calendar, :location => calendars_path\n end",
"title": ""
},
{
"docid": "97d21d29d1c4095f3b632917aa478907",
"score": "0.6840307",
"text": "def calendar\n @recuest = Recuest.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recuest }\n end\n end",
"title": ""
},
{
"docid": "b9345953984c468951a4a799ea8135fc",
"score": "0.68256944",
"text": "def calendar # rubocop:disable AbcSize, MethodLength\n prepare_calendar_vars\n\n # extract calendar data\n respond_to do |format|\n format.html\n format.json { @calendar_res = generate_calendar_reservations }\n # generate iCal version\n # see https://gorails.com/forum/multi-event-ics-file-generation\n format.ics do\n @calendar_res = generate_calendar_reservations\n cal = Icalendar::Calendar.new\n\n @calendar_res.each do |r|\n event = Icalendar::Event.new\n event.dtstart = Icalendar::Values::Date.new(r.start_date)\n event.dtend = Icalendar::Values::Date.new(r.end_date + 1.day)\n event.summary = r.reserver.name\n event.location = r.equipment_item.name unless r.equipment_item.nil?\n event.url = reservation_url(r, format: :html)\n cal.add_event(event)\n end\n cal.publish\n\n response.headers['Content-Type'] = 'text/calendar'\n response.headers['Content-Disposition'] =\n 'attachment; filename=reservations.ics'\n render plain: cal.to_ical\n end\n end\n end",
"title": ""
},
{
"docid": "282bc1944f227bc3d9da8401a66b3c55",
"score": "0.67774403",
"text": "def index\n @calendars = Calendar.all\n render json: @calendars\n end",
"title": ""
},
{
"docid": "dd3bd0d11fd1e9b01ffb527cd9f21b70",
"score": "0.6776897",
"text": "def create\n @calendar = Calendar.new(calendar_params)\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.json { render :show, status: :created, location: @calendar }\n else\n\n @data = JSON.parse(format)\n @data.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n\n\n #format.html { render :new }\n #format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c17b9bbefbf416a7fe44ec99eab7f513",
"score": "0.6753904",
"text": "def create\n @new_calendar = NewCalendar.new(new_calendar_params)\n\n respond_to do |format|\n if @new_calendar.save\n format.html { redirect_to @new_calendar, notice: 'New calendar was successfully created.' }\n format.json { render action: 'show', status: :created, location: @new_calendar }\n else\n format.html { render action: 'new' }\n format.json { render json: @new_calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "be1610df76bb6fad5056e84650913137",
"score": "0.6726632",
"text": "def create\n @calendar = Calendar.new(params[:calendar])\n\n respond_to do |format|\n if @calendar.save\n flash[:notice] = 'Calendar was successfully created.'\n format.html { redirect_to(@calendar) }\n format.xml { render :xml => @calendar, :status => :created, :location => @calendar }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @calendar.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "be1610df76bb6fad5056e84650913137",
"score": "0.6726632",
"text": "def create\n @calendar = Calendar.new(params[:calendar])\n\n respond_to do |format|\n if @calendar.save\n flash[:notice] = 'Calendar was successfully created.'\n format.html { redirect_to(@calendar) }\n format.xml { render :xml => @calendar, :status => :created, :location => @calendar }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @calendar.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93e221f52a1fb29f9fa66aa41392b614",
"score": "0.6677999",
"text": "def index\n json_response(@calendar.events)\n end",
"title": ""
},
{
"docid": "6f8eef69d6fb2859080acea812baa23c",
"score": "0.6633146",
"text": "def index\n respond_with @calendars\n end",
"title": ""
},
{
"docid": "3f532c3c82d603b6f32592ce4c9784f5",
"score": "0.66232586",
"text": "def index\n json_response(@user.calendars)\n end",
"title": ""
},
{
"docid": "307f273e796ccd3df2d869c2ea4de3d1",
"score": "0.6593285",
"text": "def save(account_id:, calendars:) # rubocop:disable Metrics/MethodLength\n calendar_lists = []\n calendars.each do |calendar|\n next unless calendar.access_role == 'owner'\n\n calendar_lists.push(\n {\n gid: calendar.gid,\n summary: calendar.summary,\n description: calendar.description,\n location: calendar.location,\n time_zone: calendar.time_zone,\n access_role: calendar.access_role\n }\n )\n end\n\n response = HTTP.post(\"#{@config.API_URL}/accounts/#{account_id}/calendars\", json: calendar_lists)\n\n raise('Failed to save') unless response.code == 201\n\n JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "66e79f3a2ee4254103818969cba6a496",
"score": "0.65815645",
"text": "def create\n @calendar = Calendar.new(calendar_params)\n respond_to do |format|\n unico = Calendar.find_by_status_id(8)\n if unico.nil?\n if @calendar.save\n crear_pagos(@calendar.id)\n format.html { redirect_to @calendar, notice: 'Calendar creado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @calendar }\n else\n format.html { render :new }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n else\n errors.add('status: ', \"Existe un Calendario Abierto, Favor de cerrarlo antes de abrir uno Nuevo\")\n format.html { render :new, @calendar.errors }\n end\n end\n end",
"title": ""
},
{
"docid": "dbd4f20a80f81becfa810f9d56ade6c6",
"score": "0.6578747",
"text": "def create\n @calendar = Calendar.new(params[:calendar])\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to(calendars_path(:company_id => @calendar.company_id), :notice => 'Calendário criado com sucesso.') }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @calendar.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf497351ff02962ec039dff2803b5d3a",
"score": "0.6558267",
"text": "def create\n \n interpret_calendar_event\n\n if params[:calendarId] && params[\"_method\"] != 'delete'\n @jqcalendar = Jqcalendar.find(params[:calendarId])\n @jqcalendar.update_attributes(params[:jqcalendar])\n elsif params[\"_method\"] == 'delete'\n unless params[:cancel]\n @jqcalendar = Jqcalendar.find(params[:calendarId])\n @jqcalendar.destroy\n end \n else\n @jqcalendar = Jqcalendar.new(params[:jqcalendar])\n end\n @jqcalendar.save\n\n # respond_to do |format|\n # if @jqcalendar.save\n # format.html { redirect_to @jqcalendar, notice: 'Jqcalendar was successfully created.' }\n # format.json { render json: @jqcalendar, status: :created, location: @jqcalendar }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @jqcalendar.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "6cbc3844e1e33bfc11e6cda07f6c52ca",
"score": "0.6536425",
"text": "def create\n @admin_calendar = Calendar.new(params[:calendar])\n\n respond_to do |format|\n if @admin_calendar.save\n format.html { redirect_to [:admin, @admin_calendar] , notice: 'Evento criado com sucesso.' }\n format.json { render json: [:admin, @admin_calendar], status: :created, location: @admin_calendar }\n else\n format.html { render action: \"new\" }\n format.json { render json: [:admin, @admin_calendar.errors], status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b6447dec87aacfbf0f0b7f30446a250a",
"score": "0.6506787",
"text": "def create\n\n @one_day_calendar = Calendar.where(\"date = ?\", calendar_params[:date])\n if !@one_day_calendar.present?\n @calendar = Calendar.new(calendar_params)\n if @calendar.day_off == true\n @calendar.time_start = nil\n @calendar.time_stop = nil\n end\n @calendar.user_id = params[:user_id]\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.json { render :show, status: :created, location: @calendar }\n else\n format.html { render :new }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to :back, error: \"An error message for the user\"\n end\n end",
"title": ""
},
{
"docid": "3fa103a751dec53d08f912ab513204a2",
"score": "0.6506372",
"text": "def create\n @calendar = Calendar.new(params[:calendar])\n if @current_user\n @calendar.user_id = @current_user.id\n end\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.json { render json: @calendar, status: :created, location: @calendar }\n else\n format.html { render action: \"new\" }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e415e415802fbb6d576a7baf583120d8",
"score": "0.6498648",
"text": "def events\n\t\t\t\t\tdate_from = Date.parse(params[:start].to_s)\n\t\t\t\t\tdate_to = Date.parse(params[:end].to_s)\n\t\t\t\t\tdisabled_calendars = params[:disabled_calendars]\n\t\t\t\t\trender json: load_calendars(date_from, date_to, disabled_calendars)\n\t\t\t\tend",
"title": ""
},
{
"docid": "d99bb3b83ddc04e15f6e991e8b2aee06",
"score": "0.6473268",
"text": "def create\n @now = Time.current\n @calendar = current_user.calendar.new(calendar_params)\n unless @calendar.ymd.present?\n @calendar.ymd = @now.strftime(\"%Y-%m-%d\")\n end\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to calendars_path }\n format.json { render :show, status: :created, location: @calendar }\n else\n format.html { render :new }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "3fd76b36c92fbc8ac20a32349eed4439",
"score": "0.6445562",
"text": "def new\n @calendar = Calendar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @calendar }\n end\n end",
"title": ""
},
{
"docid": "3fd76b36c92fbc8ac20a32349eed4439",
"score": "0.6445562",
"text": "def new\n @calendar = Calendar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @calendar }\n end\n end",
"title": ""
},
{
"docid": "07a7c3da8ad866622acfe8763358909f",
"score": "0.6438881",
"text": "def create\n @calendar = @hairdresser.calendars.create(calendar_params)\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to hairdresser_calendar_path(@hairdresser,@calendar), notice: 'Calendar was successfully created.' }\n format.json { render :show, status: :created, location: @calendar }\n else\n format.html { render :new }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2aa54d25f60675b95e68646fa4f84e85",
"score": "0.64265794",
"text": "def add_calendar(calendar)\n xml_text = calendar.to_xml.to_s\n resp = NetRedirector::post(@http, OWNED_CALENDARS_PATH, xml_text, headers)\n calendar.process_add_response(resp)\n end",
"title": ""
},
{
"docid": "456eceff46027123782dcf8b9b2f50c0",
"score": "0.6364683",
"text": "def create \n @calendar = Calendar.new(calendar_params)\n if @calendar.valid?\n # binding.pry\n @calendar.save\n redirect_to user_calendars_path, method: :get\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "c88394e3471cf8a2cba3b5efc2ebc695",
"score": "0.6362729",
"text": "def create\n @calendar = Calendar.create calendar_params\n if @calendar.save\n flash[:notice] = 'Calendar was successfully created'\n redirect_to root_path\n else\n flash[:error] = 'Calendar was NOT saved'\n render :new\n end\n end",
"title": ""
},
{
"docid": "4ed3b4f7171e5fcf6014ee45155643b5",
"score": "0.6360649",
"text": "def create\n @calendario = Calendario.new(calendario_params)\n\n respond_to do |format|\n if @calendario.save\n format.html { redirect_to @calendario, notice: 'Calendario was successfully created.' }\n format.json { render :show, status: :created, location: @calendario }\n else\n format.html { render :new }\n format.json { render json: @calendario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2862722a3f2cec656eaf220d8086160a",
"score": "0.6345202",
"text": "def calendar\n @t = \"events\"\n\n respond_to do |format|\n format.html do\n render :action => 'index'\n end\n format.js\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2c5dc805b5e665d270ef32a672fb89a7",
"score": "0.63421965",
"text": "def create\n @calendario = Calendario.new(calendario_params)\n\n respond_to do |format|\n if @calendario.save\n format.html { redirect_to calendarios_path, notice: 'El calendario se creó correctamente.' }\n format.json { render :show, status: :created, location: @calendario }\n else\n format.html { render :new }\n format.json { render json: @calendario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3b1fa4528a0422318084fcaa63fdb45",
"score": "0.63400215",
"text": "def new\n respond_with @calendar\n end",
"title": ""
},
{
"docid": "4acabe7423167a0b2c7b579cc42e5d97",
"score": "0.63341576",
"text": "def calendars()\n return MicrosoftGraph::Me::Calendars::CalendarsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "ecd13a95ba80890d861000f9c0299216",
"score": "0.63289857",
"text": "def index\n @calendars = Calendar.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @calendars }\n format.json { render :json => @calendars }\n end\n end",
"title": ""
},
{
"docid": "d4c33b0f04dd3300457542bb6af22b47",
"score": "0.632395",
"text": "def create\n @calender = Calender.new(calender_params)\n\n respond_to do |format|\n if @calender.save\n format.html { redirect_to @calender, notice: 'Calender was successfully created.' }\n format.json { render :show, status: :created, location: @calender }\n else\n format.html { render :new }\n format.json { render json: @calender.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c34c8b6584cd29e911156970316f071b",
"score": "0.6315953",
"text": "def create\n @calendar = Calendar.new(calendar_params)\n @calendar.reserved = true\n @calendar.customer_id = current_customer.id\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to action: \"index\", notice: 'Calendar was successfully created.' }\n format.json { render :show, status: :created, location: @calendar }\n else\n format.html { render :new }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8a5655fd2e7f7d78c322023d14d1515",
"score": "0.6285609",
"text": "def new_calendar\n return calendar unless params[\"calendar\"]\n CalendarProxy.new(params[\"calendar_type\"], params[\"calendar\"])\n end",
"title": ""
},
{
"docid": "6594c966cc3916685f2430058206d06e",
"score": "0.626862",
"text": "def index\n @user_calendars = @current_user.calendars\n @acalendars = @user_calendars.find_all{|c| c.calendar_type == Calendar::AVAILABILITY}\n @wcalendars = @user_calendars.find_all{|c| c.calendar_type == Calendar::SHIFTS}\n @allcalendars = Calendar.find_all_by_calendar_type(Calendar::SHIFTS)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @calendars }\n end\n end",
"title": ""
},
{
"docid": "b5e070783542c34bbc5ce4dc0fd02213",
"score": "0.62483925",
"text": "def create\n @message_calendar = MessageCalendar.new(params[:message_calendar])\n\n respond_to do |format|\n if @message_calendar.save\n format.html { redirect_to @message_calendar, notice: 'Message calendar was successfully created.' }\n format.json { render json: @message_calendar, status: :created, location: @message_calendar }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message_calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "024c30121de5e2ef2cc4365c1e59ee3f",
"score": "0.6233451",
"text": "def to_calendar\n from_date = DateTime.strptime(params[:start],'%s').strftime(\"%Y-%m-%d\")\n to_date = DateTime.strptime(params[:end],'%s').strftime(\"%Y-%m-%d\")\n\n respond_to do |format|\n format.js {render json: Event.to_calendar(from_date, to_date)}\n end\n end",
"title": ""
},
{
"docid": "88aec577f8e09357686e954330a4ccaf",
"score": "0.6232407",
"text": "def create\n @calendar = Calendar.new(calendar_params)\n create_q(@calendar)\n end",
"title": ""
},
{
"docid": "6e0f3b06f4b03eefa56bd8e6f6e85e59",
"score": "0.62292975",
"text": "def manage\n @labcalendars = Calendar.find_all_by_calendar_type(Calendar::LAB) || []\n @sscalendars = AvailabilitySnapshot.all || []\n @wcalendars = Calendar.find_all_by_calendar_type(Calendar::SHIFTS) || []\n respond_to do |format|\n format.html\n format.json { render json: @acalendars }\n end\n end",
"title": ""
},
{
"docid": "ffe7b2460a649510a6b03af3baeae8e1",
"score": "0.622882",
"text": "def create_calendar\n @calendar.create_schedule\n end",
"title": ""
},
{
"docid": "9d137560639f7f403fac19d9f5a4fe36",
"score": "0.62138695",
"text": "def create\n params[:calendar_event][:start] = Time.zone.parse(params[:start_date] + ' ' + params[:start_time] )\n params[:calendar_event][:end] = Time.zone.parse(params[:end_date] + ' ' + params[:end_time] )\n logger.debug params\n @calendar_event = CalendarEvent.new(params[:calendar_event])\n @calendar_event.user = current_user\n\n respond_to do |format|\n if @calendar_event.save\n format.html { redirect_to(@calendar_event, :notice => 'Calendar event was successfully created.') }\n format.xml { render :xml => @calendar_event, :status => :created, :location => @calendar_event }\n format.json { render :json => @calendar_event, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @calendar_event.errors, :status => :unprocessable_entity }\n format.json { render :json => @calendar_event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e13f770f71bd62cedd0691a4ce0a5054",
"score": "0.6162167",
"text": "def index\n @calendar_tab = \"Calendar\"\n\n respond_to do |format|\n format.html do\n render_page\n end\n format.rss do\n redirect_to schedule_path(format: :atom), status: :moved_permanently\n end\n format.atom\n format.json do\n events = []\n @events.each do |event|\n events << {\n id: event.id,\n title: event.full_name,\n description: event.full_name,\n start: event.date.to_s,\n end: event.end_date.to_s,\n allDay: true,\n url: event.flyer.to_s\n }\n end\n render json: events.to_json\n end\n format.ics { render_ics }\n format.xlsx { headers[\"Content-Disposition\"] = 'filename=\"schedule.xlsx\"' }\n end\n end",
"title": ""
},
{
"docid": "0d88b23955ac11fcb7978b94d1b773ea",
"score": "0.61590034",
"text": "def new\n @admin_calendar = Calendar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_calendar }\n end\n end",
"title": ""
},
{
"docid": "600b7802edaa227123e07298ee5a1ddf",
"score": "0.6154886",
"text": "def create\n event = CalEvent.new({\n :summary => params[:summary],\n :start => to_utc(params[:start]),\n :end => to_utc(params[:end]),\n :creator_id => current_user.id,\n :description => params[:description] \n })\n\n if event.save\n render :json => objectify_event(event), :status => 201 # created\n else\n render :nothing => true, :status => 400 # bad request\n end\n end",
"title": ""
},
{
"docid": "a936bfe47e6f2e8baf80a36e4e302e3d",
"score": "0.6148858",
"text": "def create\n @promotion_calendar = PromotionCalendar.new(params[:promotion_calendar])\n\n respond_to do |format|\n if @promotion_calendar.save\n format.html { redirect_to promotion_calendars_path, notice: 'Promotion calendar was successfully created.' }\n format.json { render json: @promotion_calendar, status: :created, location: @promotion_calendar }\n else\n format.html { render action: \"new\" }\n format.json { render json: @promotion_calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc7beba774bd5c6e153e6926e2d448b5",
"score": "0.613483",
"text": "def calendar\n if current_user\n\t current_phone_number = current_user.phone_number\n\tend\n @user = User.find_by_phone_number(params[:phone_number]) || User.find_by_phone_number(current_phone_number)\n if !verify_user_calendar(@user)\n @user = User.new\n\t @user.phone_number = \"123456\" #dummy phone number\n\t @events=[]\n\t @contents=[]\n\t #used for displaying the login box in the calendar view\n\t @need_to_login = true\n\telse\n\t @need_to_login = false\n @events = Event.find(:all, :conditions => {:user_id => @user.id, :deleted => false}) unless @user.nil?\n @contents = @events.collect {|event|\n # ActiveSupport::JSON.decode(event.content)\n\t event\n }\n @contents = @contents.to_json\n\tend\n\n\n respond_to do |format|\n format.json { render :json => {:phone_number => @user.phone_number, :contents => @events.as_json, :need_to_login => @need_to_login }}\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"title": ""
},
{
"docid": "592fcc14e5249d25d0539574e4f53c87",
"score": "0.61342394",
"text": "def index\n @events = Event.find :all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n format.js { render :json => @events.map(&:to_hash_for_calendar).to_json } \n end\n end",
"title": ""
},
{
"docid": "89fd873b8c7cbdf0ee4a4275e9822f13",
"score": "0.61198753",
"text": "def create\n # parse data from params when picked data\n date_from = Date.parse(calendar_params[:start_date])\n date_to = Date.parse(calendar_params[:end_date])\n\n # iterate through array\n (date_from..date_to).each do |date_modal|\n calendar = Calendar.where(room_id: params[:room_id], day: date_modal)\n\n # for chosen dates, room already updated data -> Available etc. in modal\n if calendar.present?\n calendar.update_all(price: calendar_params[:price], status: calendar_params[:status])\n else\n # params for getting room_id !!!\n Calendar.create(\n room_id: params[:room_id],\n day: date_modal,\n price: calendar_params[:price],\n status: calendar_params[:status]\n )\n end\n end\n # redirect_to host_calendar_path\n redirect_back(fallback_location: request.referer)\n end",
"title": ""
},
{
"docid": "58adf6ca4a37628d32d63301801ef8c8",
"score": "0.6082624",
"text": "def add_calendar_evnets\n EVENT_INFO.each do |event_info|\n calendar = CalendarCoordinator::Calendar.first\n CalendarCoordinator::EventService.create(calendar_id: calendar.id, data: event_info)\n end\nend",
"title": ""
},
{
"docid": "e8d296f70512d02a963c31f473077d3b",
"score": "0.6073561",
"text": "def get_calendars\n http = Net::HTTP.new(@google_url, 80)\n response, data = http.get(\"http://#{@google_url}/calendar/feeds/\" + @user_id, @headers)\n case response\n when Net::HTTPSuccess, Net::HTTPRedirection\n redirect_response, redirect_data = http.get(response['location'], @headers)\n case response\n when Net::HTTPSuccess, Net::HTTPRedirection\n doc = REXML::Document.new redirect_data\n\t doc.elements.each('//entry')do |e|\n\t title = e.elements['title'].text\n\t url = e.elements['link'].attributes['href']\n\t @calendars << GCalendar.new(title, url.sub!(\"http://#{@google_url}\",''))\n\t end\n return redirect_response\n else\n response.error!\n end\n else\n response.error!\n end\n end",
"title": ""
},
{
"docid": "3f356c1ea9a76a6c14e9ac7a8906d663",
"score": "0.6071369",
"text": "def create\n @default_calendar = DefaultCalendar.new(default_calendar_params)\n\n respond_to do |format|\n if @default_calendar.save\n flash[:success] = \"Calendario dado de alta correctamente\"\n format.html { redirect_to default_calendars_path }\n else\n format.html { render :new }\n end\n end\n \n end",
"title": ""
},
{
"docid": "f505b96eddcfde39c43bdde206d66e30",
"score": "0.606672",
"text": "def new\n @calendar_entry = CalendarEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @calendar_entry }\n end\n end",
"title": ""
},
{
"docid": "d8e723bc41a90fe7ebadcd03c411aee0",
"score": "0.6066286",
"text": "def index\n @calendars = Calendar.all\n end",
"title": ""
},
{
"docid": "d8e723bc41a90fe7ebadcd03c411aee0",
"score": "0.6066286",
"text": "def index\n @calendars = Calendar.all\n end",
"title": ""
},
{
"docid": "d8e723bc41a90fe7ebadcd03c411aee0",
"score": "0.6066286",
"text": "def index\n @calendars = Calendar.all\n end",
"title": ""
},
{
"docid": "d8e723bc41a90fe7ebadcd03c411aee0",
"score": "0.6066286",
"text": "def index\n @calendars = Calendar.all\n end",
"title": ""
},
{
"docid": "938d4da1634c64bb5f308ad625588caa",
"score": "0.6060511",
"text": "def calendars=(value)\n @calendars = value\n end",
"title": ""
},
{
"docid": "938d4da1634c64bb5f308ad625588caa",
"score": "0.6060511",
"text": "def calendars=(value)\n @calendars = value\n end",
"title": ""
},
{
"docid": "f228d5c8a56abbd84f72992866c6773d",
"score": "0.6055217",
"text": "def query_filing_calendars_post(model, options={})\n path = \"/api/v2/filingcalendars/query\"\n post(path, model, options)\n end",
"title": ""
},
{
"docid": "4f637c0b48eb0034f9db873a8363b760",
"score": "0.6049894",
"text": "def calendar_params\n params.require(:calendar).permit(:calendar_type, :from, :to, :created_at, :updated_at)\n end",
"title": ""
},
{
"docid": "8f7b4eab7b139284a000d7e5f69509d9",
"score": "0.6049767",
"text": "def create\n @calendar_date_service = CalendarDateService.new(params[:calendar_date_service])\n\n respond_to do |format|\n if @calendar_date_service.save\n format.html { redirect_to @calendar_date_service, notice: 'Calendar date service was successfully created.' }\n format.json { render json: @calendar_date_service, status: :created, location: @calendar_date_service }\n else\n format.html { render action: \"new\" }\n format.json { render json: @calendar_date_service.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2eef8b8cff21718e896d958e888c5fe4",
"score": "0.60488886",
"text": "def index\n @calendars = view_context.get_calendars\n end",
"title": ""
},
{
"docid": "c1064b04b044fe4b5367d5152d52701c",
"score": "0.6046791",
"text": "def index\n @seen_events = {}\n respond_to do |format|\n format.html {\n timeout = (Radiant::Config['event_calendar:cache_duration'] || self.class.cache_timeout || 3600).seconds\n expires_in timeout.to_i, :public => true, :private => false\n }\n format.js {\n render :json => events.to_json\n }\n format.rss {\n render :layout => false\n }\n format.ics {\n ical = RiCal.Calendar do |cal| \n events.each { |event| cal.add_subcomponent(event.to_ri_cal) } \n end\n send_data ical.to_s, :filename => \"#{filename}.ics\", :type => \"text/calendar\"\n }\n end\n end",
"title": ""
},
{
"docid": "02a6508daa3f3cd856fb1b042a1fe8ba",
"score": "0.60296375",
"text": "def create\n @calendar_event = CalendarEvent.new(calendar_event_params)\n end",
"title": ""
},
{
"docid": "4bd28bd41974cce7ce3fa02a0095af1a",
"score": "0.60291564",
"text": "def destroy\n @new_calendar.destroy\n respond_to do |format|\n format.html { redirect_to new_calendars_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2b0b825f2979efaf04c4b28786f5a6fc",
"score": "0.60283035",
"text": "def get_calendar(url, duration_in_days)\n today = DateTime.now\n # Treats recurring events like other events. Gets all events starting between RIGHT NOW and this\n # => upcoming midnight. Orders them by start time, with closest first.\n get(url, :params => { 'alt' => 'jsonc',\n 'singleevents' => 'true',\n 'start-min' => today.to_s,\n 'start-max' => (today + duration_in_days).to_date.to_datetime.to_s,\n 'orderby' => 'starttime',\n 'sortorder' => 'ascending'\n })\n end",
"title": ""
},
{
"docid": "0b44e9ddf64ee5b5caab27f1536834d2",
"score": "0.6027857",
"text": "def create\n \n ids = params[:m][:cids]\n ids.shift()\n\n ids.map {|id|\n @calendar_entry = CalendarEntry.new(params[:calendar_entry])\n @calendar_entry.course_id = id;\n @calendar_entry.save\n }\n\n respond_to do |format|\n if @calendar_entry.save\n format.html { redirect_to @calendar_entry, notice: 'Calendar entry was successfully created.' }\n format.json { render json: @calendar_entry, status: :created, location: @calendar_entry }\n else\n format.html { render action: \"new\" }\n format.json { render json: @calendar_entry.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "48be4926574ed08520a6a95a00944285",
"score": "0.60215557",
"text": "def update\n respond_to do |format|\n if @calendar.update(calendar_params)\n format.html { redirect_to calendars_path(@calendar) }\n format.json { render :show, status: :ok, location: @calendar }\n else\n format.html { render :edit }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe67189aeba9cd715f2619920b443c3b",
"score": "0.6013012",
"text": "def http_get(request, response)\n query_params = request.query_parameters\n return true unless query_params.key?('export')\n\n path = request.path\n\n node = @server.properties(\n path,\n [\n '{DAV:}resourcetype',\n '{DAV:}displayname',\n '{http://sabredav.org/ns}sync-token',\n '{DAV:}sync-token',\n '{http://apple.com/ns/ical/}calendar-color'\n ]\n )\n\n return true unless node.key?('{DAV:}resourcetype') && node['{DAV:}resourcetype'].is(\"{#{Plugin::NS_CALDAV}}calendar\")\n\n # Marking the transactionType, for logging purposes.\n @server.transaction_type = 'get-calendar-export'\n\n properties = node\n\n start = nil\n ending = nil\n expand = false\n component_type = ''\n\n if query_params.key?('start')\n fail Dav::Exception::BadRequest, 'The start= parameter must contain a unix timestamp' unless query_params['start'] =~ /^\\d+$/\n\n start = Time.zone.at(query_params['start'].to_i)\n end\n\n if query_params.key?('end')\n fail Dav::Exception::BadRequest, 'The end= parameter must contain a unix timestamp' unless query_params['end'] =~ /^\\d+$/\n\n ending = Time.zone.at(query_params['end'].to_i)\n end\n\n unless query_params['expand'].blank?\n fail Dav::Exception::BadRequest, 'If you\\'d like to expand recurrences, you must specify both a start= and end= parameter.' unless start && ending\n\n expand = true\n component_type = 'VEVENT'\n end\n\n if query_params.key?('componentType')\n unless %w(VEVENT VTODO VJOURNAL).include?(query_params['componentType'])\n fail Dav::Exception::BadRequest, \"You are not allowed to search for components of type: #{query_params['componentType']} here\"\n end\n\n component_type = query_params['componentType']\n end\n\n format = Http::Util.negotiate(\n request.header('Accept'),\n [\n 'text/calendar',\n 'application/calendar+json'\n ]\n )\n\n if query_params.key?('accept')\n if query_params['accept'] == 'application/calendar+json' || query_params['accept'] == 'jcal'\n format = 'application/calendar+json'\n end\n end\n\n format = 'text/calendar' if format.blank?\n\n generate_response(path, start, ending, expand, component_type, format, properties, response)\n\n # Returning false to break the event chain\n false\n end",
"title": ""
},
{
"docid": "5a0b3fd460a25a7f332337e27ead6376",
"score": "0.6012911",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "5a0b3fd460a25a7f332337e27ead6376",
"score": "0.6012911",
"text": "def set_calendar\n @calendar = Calendar.find(params[:id])\n end",
"title": ""
},
{
"docid": "de3a05007800573fc5dbe6072fd991e0",
"score": "0.6010839",
"text": "def destroy\n @calendar.destroy\n respond_to do |format|\n format.html { redirect_to user_calendars_path, method: :get }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "257ec1348d35746c744d06a2bb39d0cf",
"score": "0.6006921",
"text": "def index\n @calendars = Calendar.select('id as calendar_id,name as calendar_name')\n render json: @calendars\n end",
"title": ""
},
{
"docid": "d5abd0cbb4223c5707fa284c359fb1d1",
"score": "0.60049456",
"text": "def calendar_params\n params.require(:calendar).permit(:title, :content, :location, :start_date, :start_time, :end_date, :end_time, :repeat, :reminder)\n end",
"title": ""
},
{
"docid": "ac0dc1bb8a1b48e39dab74e502f6e468",
"score": "0.6004903",
"text": "def create\n @calendar_test = CalendarTest.new(calendar_test_params)\n\n respond_to do |format|\n if @calendar_test.save\n format.html { redirect_to @calendar_test, notice: 'Calendar test was successfully created.' }\n format.json { render :show, status: :created, location: @calendar_test }\n else\n format.html { render :new }\n format.json { render json: @calendar_test.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7773c9bc80ac8dd693da1dcac4d5922f",
"score": "0.6002725",
"text": "def create\n @web_calendar = WebCalendar.new(params[:web_calendar])\n\n respond_to do |format|\n if @web_calendar.save\n flash[:notice] = 'WebCalendar was successfully created.'\n format.html { redirect_to(@web_calendar) }\n format.xml { render :xml => @web_calendar, :status => :created, :location => @web_calendar }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @web_calendar.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ba8d9365a46bf73d6b36a725cf18cf9",
"score": "0.59823406",
"text": "def new\n @calendar_date_service = CalendarDateService.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @calendar_date_service }\n end\n end",
"title": ""
},
{
"docid": "8cb833da0cc25e40e48da11dba0e1c4a",
"score": "0.5981723",
"text": "def calendar_list\n params[:id] = \"#{Time.now.strftime('%Y-%m-%d')}\" if !params[:id]\n @events = Calendar.current_events(params[:id])\n\n @daily_events = @events.group_by { |d| d.start_date }\n\n respond_to do |format|\n format.html\n end\n end",
"title": ""
},
{
"docid": "bc13596bca869b46d0fa50c1eb710aa7",
"score": "0.59793735",
"text": "def calendar_list\n response = @api_client.execute(\n api_method: @service.calendar_list.list,\n )\n\n response.data.items.each_with_object({}) do |calendar, hash|\n hash[calendar['summary']] = calendar['id']\n end\n end",
"title": ""
},
{
"docid": "aefb89b6caa03bbfa39a49b8e8ad48ba",
"score": "0.597679",
"text": "def index\n redirect_to calendar_url\n end",
"title": ""
},
{
"docid": "6210bbd4c0232d7a236f64283f0d1542",
"score": "0.597661",
"text": "def create\n @entry = CalendarEntry.new(params[:calendar_entry])\n @entry.user_id = current_user.id\n @date = @entry.date\n\n respond_to do |format|\n if @entry.save\n format.html { redirect_to show_date_dashboard_index_path(:year => @date.year, :month => @date.month, :day => @date.day), notice: 'Entry was successfully created.'}\n format.json { render json: @entry, status: :created, location: @entry }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end \n end",
"title": ""
},
{
"docid": "f61742f6289b947e2bb5d7e7c5ab7b9d",
"score": "0.59755445",
"text": "def index\n if (params[:course_id])\n @course = Course.find(params[:course_id])\n @calendar_entries = @course.calendar_entries.order(\"created_at DESC\")\n else\n @calendar_entries = CalendarEntry.all.order(\"created_at DESC\")\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @calendar_entries }\n end\n end",
"title": ""
},
{
"docid": "816ec9b540765736af46b0df15102892",
"score": "0.59700346",
"text": "def destroy\n @calendar.destroy\n respond_to do |format|\n format.html { redirect_to calendars_calendars_url, notice: t('calendar.delete') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4610cac51bcb75021bab4b439a526346",
"score": "0.5968347",
"text": "def show\n @calendar = Calendar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @calendar }\n end\n end",
"title": ""
},
{
"docid": "f2759750b74d932ab61b686dba1ccf23",
"score": "0.59667575",
"text": "def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n \n #create and add event to calendar\n event_g = GCal4Ruby::Event.new(@@service)\n event_g.title = @event.title\n event_g.content = @event.description\n event_g.where = @event.location\n event_g.start_time = @event.start_date\n event_g.end_time = @event.end_date\n event_g.calendar = @@cal \n \n #remember to save\n event_g.save\n @@cal.save\n \n @event.event_id = event_g.id\n @event.update_attributes(params[:event])\n @event.save\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4cc31640531e47ebae5d8c5a2f71f36",
"score": "0.59585744",
"text": "def index\n @calendars = Calendar.all \n end",
"title": ""
},
{
"docid": "97bd24b132a83ed3de8de67be586819e",
"score": "0.59557945",
"text": "def list_calendars(current_account)\n response = HTTP.auth(\"Bearer #{current_account.auth_token}\")\n .get(\"#{@config.API_URL}/calendars\")\n\n response.code == 200 ? JSON.parse(response, object_class: OpenStruct).data : nil\n end",
"title": ""
}
] |
5a0a2745a64fd1ab15fa6c7e7a7fa688
|
My old convention was '1' for true, "" for false; the new form helpers send '1' for true and '0' for false.
|
[
{
"docid": "1d4c222cf1cf5213dd9768c9f0ec8928",
"score": "0.0",
"text": "def mybool(value) #:nodoc:\n return false if value.blank?\n return false if value.is_a?(String) and value == \"0\"\n return false if value.is_a?(Numeric) and value == 0\n return true\n end",
"title": ""
}
] |
[
{
"docid": "32c06d446900590564ab4173992542a3",
"score": "0.7211712",
"text": "def form_to_boolean(value)\n return value == '1' if value.is_a? String\n !!value\n end",
"title": ""
},
{
"docid": "8e7ad04a158df6b52df72618f115bb76",
"score": "0.7145758",
"text": "def human_boolean(boolean)\n boolean ? \"simple_form.yes\" : \"simple_form.no\"\n end",
"title": ""
},
{
"docid": "db6fcb58254979696ba5052cc52e375e",
"score": "0.7134239",
"text": "def kyc_submitted_false\n \"false\"\n end",
"title": ""
},
{
"docid": "7b767d2d897e16333b4b882af6ec29f6",
"score": "0.6855318",
"text": "def input_boolean(sch)\n unless opts.has_key?(:as)\n opts[:as] = (sch[:allow_null] || opts[:required] == false) ? :select : :checkbox\n end\n\n v = opts.has_key?(:value) ? opts[:value] : obj.send(field)\n\n case opts[:as]\n when :radio\n true_value = opts[:true_value]||'t'\n false_value = opts[:false_value]||'f'\n opts[:options] = [[opts[:true_label]||'Yes', {:value=>true_value, :key_id=>'yes'}], [opts[:false_label]||'No', {:value=>false_value, :key_id=>'no'}]]\n unless v.nil?\n opts[:value] = v ? true_value : false_value\n end\n _input(:radioset, opts)\n when :select\n opts[:value] = (v ? 't' : 'f') unless v.nil?\n opts[:add_blank] = true unless opts.has_key?(:add_blank)\n opts[:options] = [[opts[:true_label]||'True', opts[:true_value]||'t'], [opts[:false_label]||'False', opts[:false_value]||'f']]\n _input(:select, opts)\n else\n opts[:checked] = v\n opts[:value] = 't'\n _input(:checkbox, opts)\n end\n end",
"title": ""
},
{
"docid": "bc7c69430b65b02abbd27e514ea18561",
"score": "0.67469794",
"text": "def Boolean(value)\n case value\n when \"true\" then true\n when \"false\" then false\n end\nend",
"title": ""
},
{
"docid": "cfa0dcde0ec5648a08910c1013d86d25",
"score": "0.6540383",
"text": "def bool_it(object)\n case object.to_s\n when /^true$/i, /^yes$/i, /^t$/i, /^1$/i\n true\n when /^false$/i, /^no$/i, /^f$/i, /^0$/i\n false\n end\n end",
"title": ""
},
{
"docid": "0608696af8c849380040c9657234da19",
"score": "0.64816344",
"text": "def boolean_format\n value ? 1 : 0\n end",
"title": ""
},
{
"docid": "9ed207bb121f4c2faf90321e189bedee",
"score": "0.64784664",
"text": "def quote_boolean(value)\n value ? 1 : 0\n end",
"title": ""
},
{
"docid": "6d2b243e5e91467886f7fe160eaae851",
"score": "0.64776796",
"text": "def make_true; end",
"title": ""
},
{
"docid": "6d2b243e5e91467886f7fe160eaae851",
"score": "0.64776796",
"text": "def make_true; end",
"title": ""
},
{
"docid": "3a55f268d99cc36193689e92b3b18a81",
"score": "0.6475183",
"text": "def quote_boolean(value)\n if value\n\t'1'\n else\n\t'0'\n end\n end",
"title": ""
},
{
"docid": "c5bef3acff86d83a87ba1507c6243909",
"score": "0.6431791",
"text": "def normalize_boolean bool\n bool ? byte(1) : byte(0)\n end",
"title": ""
},
{
"docid": "c5bef3acff86d83a87ba1507c6243909",
"score": "0.6431791",
"text": "def normalize_boolean bool\n bool ? byte(1) : byte(0)\n end",
"title": ""
},
{
"docid": "062852ed2ff3fa4046fd1ebcf70b92ad",
"score": "0.64304787",
"text": "def boolean_type\n 'BOOLEAN'\n end",
"title": ""
},
{
"docid": "cf1bc4d14b2146d4d659141954334564",
"score": "0.64224833",
"text": "def literal_true\n 'TRUE'\n end",
"title": ""
},
{
"docid": "cd5a42a5912e6e29af211533ac4c1435",
"score": "0.6415678",
"text": "def type_string\n \"bool\"\n end",
"title": ""
},
{
"docid": "ac6fdd464248908ec2894ddd0696bc4f",
"score": "0.64088637",
"text": "def quoted_true\n \"true\"\n end",
"title": ""
},
{
"docid": "9d33a503648d1b27fbfae1ba1abe8ca1",
"score": "0.6399452",
"text": "def boolean_fields\n return [:required]\n end",
"title": ""
},
{
"docid": "3bb09379ead1ccf4bd72043523f30933",
"score": "0.63918513",
"text": "def true?\n self.value == '1'\n end",
"title": ""
},
{
"docid": "3bb09379ead1ccf4bd72043523f30933",
"score": "0.63918513",
"text": "def true?\n self.value == '1'\n end",
"title": ""
},
{
"docid": "a0b19d84086ecaa8448a5f8d18553b63",
"score": "0.63849324",
"text": "def true_false_rationale(text)\n frm.text_field(:name=>/:deliverTrueFalse:rationale/).value=text\n end",
"title": ""
},
{
"docid": "a0b19d84086ecaa8448a5f8d18553b63",
"score": "0.63849324",
"text": "def true_false_rationale(text)\n frm.text_field(:name=>/:deliverTrueFalse:rationale/).value=text\n end",
"title": ""
},
{
"docid": "26f4cc752ef229f39cdf50ec1e31e6e2",
"score": "0.637108",
"text": "def boolean_format\n boolean ? 1 : 0\n end",
"title": ""
},
{
"docid": "7881590a67f7b09f17eda0915b530e05",
"score": "0.6364084",
"text": "def boolean_field(attr, html_options = {})\n check_box(attr, html_options)\n end",
"title": ""
},
{
"docid": "7881590a67f7b09f17eda0915b530e05",
"score": "0.6364084",
"text": "def boolean_field(attr, html_options = {})\n check_box(attr, html_options)\n end",
"title": ""
},
{
"docid": "f117ac94f67194e436e98e2005fe0e84",
"score": "0.6361766",
"text": "def data_type\n :Boolean\n end",
"title": ""
},
{
"docid": "ca9f1feea28dd41127b1727a04548c65",
"score": "0.6349568",
"text": "def default_coerce_form_params\n false\n end",
"title": ""
},
{
"docid": "13552653461cc1bb18fac28fcf2f0493",
"score": "0.63434356",
"text": "def humanize_boolean value\n value ? t('boolean_yes') : t('boolean_no')\n end",
"title": ""
},
{
"docid": "ad644363c073fb7f4b3216180eeae920",
"score": "0.6333985",
"text": "def quoted_false\n \"false\"\n end",
"title": ""
},
{
"docid": "ac45b0cedc305c7098f4d1bb89aced32",
"score": "0.63005185",
"text": "def to_bool\n case self\n when 'true' then true\n when '1' then true\n when 'false' then false\n when '0' then false\n end\n end",
"title": ""
},
{
"docid": "ecb8f9be025e432755980fcd36751f8f",
"score": "0.6299822",
"text": "def boolean(value)\n t(:to_boolean)[value.to_s.downcase]\n end",
"title": ""
},
{
"docid": "89e18a9a852ba9807b5a5b719c6e55d4",
"score": "0.6279478",
"text": "def literal_true\n '1'\n end",
"title": ""
},
{
"docid": "89e18a9a852ba9807b5a5b719c6e55d4",
"score": "0.6279478",
"text": "def literal_true\n '1'\n end",
"title": ""
},
{
"docid": "89e18a9a852ba9807b5a5b719c6e55d4",
"score": "0.6279478",
"text": "def literal_true\n '1'\n end",
"title": ""
},
{
"docid": "89e18a9a852ba9807b5a5b719c6e55d4",
"score": "0.6279478",
"text": "def literal_true\n '1'\n end",
"title": ""
},
{
"docid": "41732325b40bec5dd146b73786f89df8",
"score": "0.627837",
"text": "def boolean(value); end",
"title": ""
},
{
"docid": "41732325b40bec5dd146b73786f89df8",
"score": "0.627837",
"text": "def boolean(value); end",
"title": ""
},
{
"docid": "9a9efff166d336665fbed7ba1145276b",
"score": "0.6276245",
"text": "def make_bool(value)\n value = value.downcase\n if bool?(value)\n value = (value == \"true\" || value == \"on\" || value == \"yes\")\n else\n value\n end\n end",
"title": ""
},
{
"docid": "c5a98826835c65845ed3c19a4160e0ad",
"score": "0.62743104",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "c5a98826835c65845ed3c19a4160e0ad",
"score": "0.62743104",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "c5a98826835c65845ed3c19a4160e0ad",
"score": "0.62743104",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "cf80570a6ff31b8c86c1fad1afa55f39",
"score": "0.62716305",
"text": "def to_bool(text) \n if text == \"on\" || text == \"true\" || text == \"yes\"\n return true\n elsif text == \"off\" || text == \"false\" || text == \"no\"\n return false\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "05a34e8321b620818178f876932c820c",
"score": "0.6269246",
"text": "def munge_boolean(value)\n case value\n when true, 'true', :true\n 'true'\n when false, 'false', :false\n 'false'\n else\n raise \"Invalid value for munge_boolean #{value}\"\n end\n end",
"title": ""
},
{
"docid": "05a34e8321b620818178f876932c820c",
"score": "0.6269246",
"text": "def munge_boolean(value)\n case value\n when true, 'true', :true\n 'true'\n when false, 'false', :false\n 'false'\n else\n raise \"Invalid value for munge_boolean #{value}\"\n end\n end",
"title": ""
},
{
"docid": "a52c62825ccbb7bee9bde33651c54c02",
"score": "0.6242853",
"text": "def to_boolean value\n\t\t\tif value == \"true\"\n\t\t\t\treturn true\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "11353c044fc5aeb8207d149754571709",
"score": "0.6242573",
"text": "def humanize_value_bool(value)\n \treturn \"No\" unless value\n \t\"Si\"\n \tend",
"title": ""
},
{
"docid": "95479095dafc4af843fb1cc1d6a0226e",
"score": "0.62387335",
"text": "def rs_format_boolean(v,f); v ? 'true' : 'false'; end",
"title": ""
},
{
"docid": "2ba181c3227e98c00f6732832f1bf885",
"score": "0.6238332",
"text": "def boolean_string(value)\n { true => 'Y', false => 'N' }[value]\n end",
"title": ""
},
{
"docid": "2b7eb1f492150c80475e92951517b1f8",
"score": "0.6237126",
"text": "def to_bool(questionable_string)\n if questionable_string == \"true\"\n true\n else\n false\n end \nend",
"title": ""
},
{
"docid": "98ee4c20dce82cee0131597797eeeac7",
"score": "0.6212303",
"text": "def param_to_bool(v)\n return true if v == true || v =~ /^(true|t|yes|y|1)$/i\n return false if v == false || v.nil? || v.empty? || v =~ /^(false|f|no|n|0)$/i\n raise ArgumentError, \"invalid value for Boolean: \\\"#{v}\\\"\"\n end",
"title": ""
},
{
"docid": "63157445601dba367e7600245093f81e",
"score": "0.6203559",
"text": "def normalize_value(value)\n case value\n when 'true'\n true\n when 'false'\n false\n else\n value\n end\n end",
"title": ""
},
{
"docid": "3c40151a29850cf228d82023efa45bef",
"score": "0.61942047",
"text": "def to_b\n \tif(self.downcase.eql?(\"yes\") || self.downcase.eql?(\"true\"))\n \t\treturn true\n \telse \n \t\tif(self.downcase.eql?(\"no\") || self.downcase.eql?(\"false\"))\n \t\t\treturn false\n \t\telse\n \t\t\treturn nil\n \t\tend\n \tend\n end",
"title": ""
},
{
"docid": "bb0aca750079e1b73dc2349bff37303a",
"score": "0.6193184",
"text": "def to_s\n return 'true'\n end",
"title": ""
},
{
"docid": "fa38381d34007d9b87c755ef4168d47a",
"score": "0.6188062",
"text": "def is_form_type?\n false\n end",
"title": ""
},
{
"docid": "d62c3bf245045df9f6d3570ca0ceaf63",
"score": "0.6186822",
"text": "def to_boolean(input_value)\n input_value == 'true' ? 't' : 'f'\n end",
"title": ""
},
{
"docid": "cf77cb8c4e93d04a88b467d3e569c0ab",
"score": "0.6175384",
"text": "def use_tobacco_string(value)\n if value == 'True'\n 'Yes'\n else\n 'No'\n end\n end",
"title": ""
},
{
"docid": "6d0d7f150302ebc3ba0165925ae6ddee",
"score": "0.61738646",
"text": "def to_bool(questionable_string)\n questionable_string == \"true\"\nend",
"title": ""
},
{
"docid": "8ea3ed854d01234b1edbdc4de4998130",
"score": "0.6167372",
"text": "def default_coerce_form_params\n true\n end",
"title": ""
},
{
"docid": "8ea3ed854d01234b1edbdc4de4998130",
"score": "0.6167372",
"text": "def default_coerce_form_params\n true\n end",
"title": ""
},
{
"docid": "d44b9c6ee373f8304a0ce3f5faae8e15",
"score": "0.61672306",
"text": "def literal_false\n 'FALSE'\n end",
"title": ""
},
{
"docid": "740c83260959c760817f1769e213ac1c",
"score": "0.6166099",
"text": "def normalize(field)\n case field\n when \"true\" then true\n when \"false\" then false\n when \"\" then nil\n when \"null\" then nil\n else field\n end \n end",
"title": ""
},
{
"docid": "ce3acfd9b92afe2d52ae5647b76aeeb6",
"score": "0.61614287",
"text": "def literal_true\n \"'Y'\"\n end",
"title": ""
},
{
"docid": "fed84a1a7884289cb3bd1746f7c13cf8",
"score": "0.6160707",
"text": "def to_bool(questionable_string)\n if questionable_string == 'true'\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "fce0862745a160ee51ad90c93a8211e1",
"score": "0.6155599",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "fce0862745a160ee51ad90c93a8211e1",
"score": "0.6155599",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "fce0862745a160ee51ad90c93a8211e1",
"score": "0.6155599",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "fce0862745a160ee51ad90c93a8211e1",
"score": "0.6155599",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "fce0862745a160ee51ad90c93a8211e1",
"score": "0.6155599",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "fce0862745a160ee51ad90c93a8211e1",
"score": "0.6155599",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "fce0862745a160ee51ad90c93a8211e1",
"score": "0.6155599",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "fce0862745a160ee51ad90c93a8211e1",
"score": "0.6155599",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "03bfa215a5981fb4ed5d1adbc0385b15",
"score": "0.61551213",
"text": "def boolean( str )\n ::Amalgalite::Boolean.to_bool( str )\n end",
"title": ""
},
{
"docid": "cbbedcdf58903e757e93d33454e3e7a6",
"score": "0.61513495",
"text": "def boolean_input(method, options)\n input_label(method, options, \n @template.check_box(@object_name, method) + \n label_text(method, options)\n )\n end",
"title": ""
},
{
"docid": "ae8ecf9d3d244ddfa58c3d33ad9deec7",
"score": "0.6142097",
"text": "def boolean()\n return 'true'==strip() ? true : false\n end",
"title": ""
},
{
"docid": "88e3d5853a8120bc0e8b85cd7290a72c",
"score": "0.6137011",
"text": "def validation_default; false; end",
"title": ""
},
{
"docid": "1912abc396579481b2bcd9f63453d6f4",
"score": "0.6136058",
"text": "def convert_bool(name, value)\n case value\n when true, \"true\", 'TRUE'\n true\n when false, \"false\", 'FALSE'\n false\n else\n log_warn(\"invalid boolean option for #{name}: #{value}\")\n nil\n end\n end",
"title": ""
},
{
"docid": "6be7c64b0662f5ad32cdf018054107a1",
"score": "0.6135589",
"text": "def to_boolean\n self.downcase == 'true'\n end",
"title": ""
},
{
"docid": "1a57f5129cbe1c5e54337a4fa07d7869",
"score": "0.6133735",
"text": "def default_coerce_form_params\n true\n end",
"title": ""
},
{
"docid": "b2734440959a6db561f2ab0910a2ed3f",
"score": "0.6119106",
"text": "def boolean_params\n params.require(:boolean).permit(:id, :name, :value)\n end",
"title": ""
},
{
"docid": "69e6013bdbaf094fe0905c01b468113a",
"score": "0.61133415",
"text": "def unquoted_true\n 1\n end",
"title": ""
},
{
"docid": "85521c57942f4ee28f16ac52f2ea0d5f",
"score": "0.6107548",
"text": "def params_tf input\n\t\treturn true if input == true || input == 'true' \n\t\treturn false if input == false || input == 'false'\n\t\treturn false; \n\tend",
"title": ""
},
{
"docid": "9f446e8f2f2a28119aedcf657d4ab284",
"score": "0.61005586",
"text": "def bool_data_attr val\n return false unless attr?(val)\n if attr(val).downcase == 'false' || attr(val) == '0'\n 'false'\n else\n true\n end\n end",
"title": ""
},
{
"docid": "9f446e8f2f2a28119aedcf657d4ab284",
"score": "0.61005586",
"text": "def bool_data_attr val\n return false unless attr?(val)\n if attr(val).downcase == 'false' || attr(val) == '0'\n 'false'\n else\n true\n end\n end",
"title": ""
},
{
"docid": "a8df8f6d8b84c0650a400a3268ecee0e",
"score": "0.6097647",
"text": "def to_bool(value)\n !(value.nil? || value == \"\" || value =~ /^(false|f|no|n|0)$/i || value == false)\n end",
"title": ""
},
{
"docid": "9768ec5cdde1f04ca5c0114fd25a660a",
"score": "0.6097562",
"text": "def to_s\n return 'false'\n end",
"title": ""
},
{
"docid": "e87743bf465a9b5a355d91b327a2bee5",
"score": "0.6088524",
"text": "def boolean?\n value_type == 'boolean'\n end",
"title": ""
},
{
"docid": "669aef070de669e944258da8b45d4ce9",
"score": "0.608729",
"text": "def normalize(field)\n case field\n when \"true\" then true\n when \"false\" then false\n when \"\" then nil\n when \"null\" then nil\n else field\n end\n end",
"title": ""
},
{
"docid": "669aef070de669e944258da8b45d4ce9",
"score": "0.608729",
"text": "def normalize(field)\n case field\n when \"true\" then true\n when \"false\" then false\n when \"\" then nil\n when \"null\" then nil\n else field\n end\n end",
"title": ""
},
{
"docid": "669aef070de669e944258da8b45d4ce9",
"score": "0.608729",
"text": "def normalize(field)\n case field\n when \"true\" then true\n when \"false\" then false\n when \"\" then nil\n when \"null\" then nil\n else field\n end\n end",
"title": ""
},
{
"docid": "88126280f8451cdb795ccd6f262f5684",
"score": "0.608357",
"text": "def is_form_field\n true\n end",
"title": ""
},
{
"docid": "88126280f8451cdb795ccd6f262f5684",
"score": "0.608357",
"text": "def is_form_field\n true\n end",
"title": ""
},
{
"docid": "e85f8c8511630ac1188589ac05a61f72",
"score": "0.608339",
"text": "def coerce_bool(value)\n\t\t\t\t!!value\n\t\t\tend",
"title": ""
},
{
"docid": "30a3c6f9b3124731f6dbfd87f80958a0",
"score": "0.60790086",
"text": "def bool_to_word bool\r\n # TODO\r\n bool ? \"Yes\" : \"No\"\r\nend",
"title": ""
},
{
"docid": "b2b9b50f7fc5ed92b1e5cbc19d78818a",
"score": "0.60789573",
"text": "def boolean_to_string(b)\n b.to_s\nend",
"title": ""
},
{
"docid": "3b7f1c678102b33aca67e3037199fea5",
"score": "0.6078656",
"text": "def typecast_value_boolean(opts={});true;end",
"title": ""
},
{
"docid": "267c0ed1f6fae27c4a955ef89f409a37",
"score": "0.60751",
"text": "def to_boolean\n self == \"true\"\n end",
"title": ""
},
{
"docid": "53efeb4cb925a91fdf22039d1ba778ca",
"score": "0.607153",
"text": "def validate_boolean(v); end",
"title": ""
},
{
"docid": "e22ebc43782ddcb801ff094d3d684980",
"score": "0.6071431",
"text": "def string_boolean_converter\n proc do |v|\n dv = v.downcase\n if dv == \"true\"\n v = true\n elsif dv == \"false\"\n v = false\n end\n v\n end\n end",
"title": ""
},
{
"docid": "f6c56d15f918d290bb219bef84547c90",
"score": "0.6064551",
"text": "def human_boolean(boolean)\n\t\tboolean ? \"Yes\" : \"No\"\n\tend",
"title": ""
},
{
"docid": "e1bf67d030a2c5eeb9a69303c33bc728",
"score": "0.6057821",
"text": "def to_bool(input)\n\tcase input.downcase\n\twhen true, \"true\", 1, \"1\", \"t\", \"y\" then true\n\twhen false, \"false\", nil, \"\", 0, \"0\", \"f\", \"n\" then false\n\tend\nend",
"title": ""
},
{
"docid": "9f0ac3f1234c5e3b7108147614c00d87",
"score": "0.60566247",
"text": "def type_cast_boolean(raw_value)\n ActiveModel::Type::Boolean.new.cast(raw_value)\n end",
"title": ""
}
] |
2681c81245ae0325cfa0fd8b19b27f51
|
GET /manage/payments GET /manage/payments.json
|
[
{
"docid": "c74874e0245f547fff193c2173ef9bef",
"score": "0.0",
"text": "def index\n if current_user.role?(:admin) && params[:admin] == \"true\"\n @title = \"平台提现管理\"\n @payments = Payment.order(\"updated_at DESC\").page(params[:page])\n else\n @title = \"提现明细\"\n @payments = current_user.payments.order(\"updated_at DESC\").page(params[:page])\n end\n end",
"title": ""
}
] |
[
{
"docid": "64465651022d07dfe82005c89d193e8c",
"score": "0.7582585",
"text": "def get_payments\n response = self.class.get('/payments', headers: authorization_header)\n response.parsed_response['payments']\n end",
"title": ""
},
{
"docid": "481c9fcb4cd29ebd951992aa1c6d11ed",
"score": "0.7429988",
"text": "def payments\n reset_errors!\n \n response = Http.get(\"/invoices/#{uuid}/payments/\", domain.token)\n \n return [] if response.code != 200\n \n MultiJson.decode(response.body)\n end",
"title": ""
},
{
"docid": "3866e33a9b4fbc9b619d67e110b0eabc",
"score": "0.7397963",
"text": "def users_payments\n @payments = Payment.where(\"user_id = ?\", current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "001514185936e504df2c0a84815fe0d0",
"score": "0.73561746",
"text": "def payments(options = {})\n # /api/en/v1.0/:token/payments\n response = get('payments', options)\n log_and_map(response).parsed_response['data']\n .map { |d| Hashie::Mash.new(d) }\n end",
"title": ""
},
{
"docid": "116174ac3695749019b0baea65cca913",
"score": "0.7243248",
"text": "def payments\n expose Member.payments(@oauth_token, params[:membername], payments_fields, payments_order_by)\n end",
"title": ""
},
{
"docid": "db864d4d70da2703eb2bade68a29cec0",
"score": "0.7180203",
"text": "def index\n @payments = Payment.all\n render json: @payments\n end",
"title": ""
},
{
"docid": "5616caa5d8287e369bc051502720c0ac",
"score": "0.7160496",
"text": "def index\n @payments = current_user.payments\n end",
"title": ""
},
{
"docid": "69372bbf25a8f3ad4522e172851dd5d7",
"score": "0.7107091",
"text": "def index\n @payments = current_user.payments.find(:all, :order => \"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "4b27695c23dabb9563da4f3ae53d5771",
"score": "0.7076327",
"text": "def payments\n if params[\"form_payment\"]\n results = Members.update(current_access_token, @current_user.username, params[\"form_payment\"])\n #check for errors!!\n if results[\"Success\"].eql?('false')\n flash.now[:error] = results[\"Message\"]\n else\n flash.now[:notice] = \"Your payment information has been updated.\"\n end\n end\n # get the member's id for docusign\n member = Members.find_by_username(current_access_token, @current_user.username, 'id').first\n @memberId = member['Id']\n @payments = Payments.all(current_access_token, :select => 'id,name,challenge__r.name,challenge__r.challenge_id__c,money__c,place__c,reason__c,status__c,type__c,Reference_Number__c,payment_sent__c', :where => current_user.username)\n @payments.each do |record| \n if record['Status__c'].eql?('Paid')\n @show_paid_section = true\n else \n @show_outstanding_section = true\n end\n end\n @page_title = \"Your Payments and Payment Info\"\n get_account\n respond_to do |format|\n format.html\n format.json { render :json => @payments }\n end\n end",
"title": ""
},
{
"docid": "8f140fbd47dab12fdb317570d18e14e9",
"score": "0.7045408",
"text": "def payments\n end",
"title": ""
},
{
"docid": "0094a81a90ff19357b6b5f22b7249640",
"score": "0.6962351",
"text": "def index\n\n @payments_all = Payment.all\n @payments_current = current_user.payments\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments_all }\n format.json { render json: @payments_current }\n end\n end",
"title": ""
},
{
"docid": "c74861b52f26a204ba97143a03eb77e3",
"score": "0.69534487",
"text": "def index\n\n @payments = Payment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "6e7ec39fbe81b772375833388ca01b96",
"score": "0.69531626",
"text": "def index\n @payments = Payment.where(:invoice_id => params[:invoice_id])\n @invoice = Invoice.find(params[:invoice_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "e4805840c7ec303a78d1e6a86142737a",
"score": "0.6950453",
"text": "def payment(payment, options = {})\n get(\"payments/#{payment}\", options).pop\n end",
"title": ""
},
{
"docid": "492ed4bcdd52c3ec01eb92b6a7b93c68",
"score": "0.69497365",
"text": "def payments(options={})\n # /api/en/v1.0/:token/payments\n response = TheCurrencyCloud.get(\"/#{token}/payments\",query: options)\n response.parsed_response['data'].collect{|d| Payment.new(d)}\n end",
"title": ""
},
{
"docid": "6c74ccdbee87f68f60ac6001b16b44a9",
"score": "0.6932633",
"text": "def payments(options = {})\n status = options[:status] || \"all\"\n page = options[:page] || 1\n\n uri = \"payments/status/#{status}?page=#{page}\"\n\n pay_get(uri)\n end",
"title": ""
},
{
"docid": "b60c1058eec92bae2a40aa9d822219a8",
"score": "0.692711",
"text": "def payments(options = {})\n status = options[:status] || \"all\"\n page = options[:page] || 1\n\n uri = \"payments/status/#{status}?page=#{page}\"\n\n _get(uri)\n end",
"title": ""
},
{
"docid": "42d5da09de1a17893a1779b06669c78b",
"score": "0.6926231",
"text": "def get_payments(payment_ids)\n return self.send_request(\n Net::HTTP::Post,\n \"/payments\",\n payload: payment_ids\n )\n end",
"title": ""
},
{
"docid": "ec96767393645acdb451a56d9424f8e8",
"score": "0.6925845",
"text": "def index\n @payments = Payment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "ec96767393645acdb451a56d9424f8e8",
"score": "0.6925845",
"text": "def index\n @payments = Payment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "ec96767393645acdb451a56d9424f8e8",
"score": "0.6925845",
"text": "def index\n @payments = Payment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "ec96767393645acdb451a56d9424f8e8",
"score": "0.6925845",
"text": "def index\n @payments = Payment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "ec96767393645acdb451a56d9424f8e8",
"score": "0.6925845",
"text": "def index\n @payments = Payment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "ec96767393645acdb451a56d9424f8e8",
"score": "0.6925845",
"text": "def index\n @payments = Payment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "ec96767393645acdb451a56d9424f8e8",
"score": "0.6925845",
"text": "def index\n @payments = Payment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "69de1a13ac7ec6699509c7c8248554a5",
"score": "0.69209313",
"text": "def index\n @payments = Payment.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "2510962310e05a0afe4a458b6ddc8482",
"score": "0.68919927",
"text": "def get_payment(id)\r\n\t\turi_prefix = @sandbox ? \"/sandbox\" : \"\"\r\n\r\n\t\t@rest_client.get(uri_prefix + \"/v1/payments/\" + id)\r\n\r\n\tend",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "e4386f45e63fd277454314d6d0137119",
"score": "0.686033",
"text": "def index\n @payments = Payment.all\n end",
"title": ""
},
{
"docid": "099fa9f3d8b5b694949bb673598f0152",
"score": "0.68593913",
"text": "def payments\n @payments ||= parse_params_into_payments\n end",
"title": ""
},
{
"docid": "584cd0a723a15ad34e999620a0343e8a",
"score": "0.6855694",
"text": "def index\n @payments = Payment.all\n \n end",
"title": ""
},
{
"docid": "2d5e9bfb52a41acb7344d8bc1f874ca5",
"score": "0.68409544",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end",
"title": ""
},
{
"docid": "78feb371bfc2cf9190d1686c16a50e0f",
"score": "0.6819762",
"text": "def index\n @payments = @order.payments\n if !params[:format].nil? && params[:format] == \"json\"\n render :json => @payments.to_json, :status => 201\n else\n respond_with(@payments)\n end\n end",
"title": ""
},
{
"docid": "2683a2472e91abfaffd13da3c3c7973f",
"score": "0.6805631",
"text": "def payments\n @payments ||= PaymentsApi.new config\n end",
"title": ""
},
{
"docid": "01a296a649109c339c64b96808593fab",
"score": "0.67955595",
"text": "def index\n @payments = @store.payments\n end",
"title": ""
},
{
"docid": "54aec559ffcb4f4082e8c166a571d7d7",
"score": "0.6730395",
"text": "def index\n page = params[:page] || 1\n @payments = Payment.payments_of_user(current_user).page page\n end",
"title": ""
},
{
"docid": "54b7a7bf38c3c6c5ed2ad2d4e918845f",
"score": "0.6728719",
"text": "def index\n @payments = current_login.payments\n\n end",
"title": ""
},
{
"docid": "54b7a7bf38c3c6c5ed2ad2d4e918845f",
"score": "0.6728719",
"text": "def index\n @payments = current_login.payments\n\n end",
"title": ""
},
{
"docid": "57fda7775c4ca34202f56f10fee3604a",
"score": "0.6728231",
"text": "def payments_json_response\n {\n key: 'payments',\n type: 'async',\n html: render_to_string(formats: [:html], layout: false)\n }\n end",
"title": ""
},
{
"docid": "fe2671b40c184a06ad84ffe1744457d3",
"score": "0.6721678",
"text": "def get_payment(id)\n\t\tbegin\n\t\t\taccess_token = get_access_token\n\t\trescue => e\n\t\t\treturn e.message\n\t\tend\n\n\t\turi_prefix = @sandbox ? \"/sandbox\" : \"\"\n\n\t\t@rest_client.get(uri_prefix + \"/v1/payments/\" + id + \"?access_token=\" + access_token)\n\n\tend",
"title": ""
},
{
"docid": "f950463077b4429d4df55f01f8eeb076",
"score": "0.66993254",
"text": "def index\n @method_payments = MethodPayment.all\n end",
"title": ""
},
{
"docid": "34a5a6254b1942f20fbffc9523c9cb4c",
"score": "0.66968805",
"text": "def index\n @ser_payments = current_user.payments.where(entity_type: 'ServiceBooking')\n @insu = current_user.payments.where(entity_type: 'InsuranceRenewal')\n @payments = {\"ServiceBooking\": @ser_payments, \"InsuranceRenewal\": @insu}\n render json: @payments\n end",
"title": ""
},
{
"docid": "2ead98dc253031d3ae7edec38abb8043",
"score": "0.66962004",
"text": "def payments( params={} )\n payments = get_connections(\"payments\", params)\n return map_connections payments, :to => Facebook::Graph::Payment\n end",
"title": ""
},
{
"docid": "4c23375d0be6ead006dd7965ad267947",
"score": "0.66749066",
"text": "def show\n @payment = Payment.find(params[:id].split(\",\"))\n\n render json: @payment\n end",
"title": ""
},
{
"docid": "faee214e11440cd79546b5ad74cd7ab7",
"score": "0.6668044",
"text": "def payments\n Breeze::Commerce::Payment.where(:reference => id)\n end",
"title": ""
},
{
"docid": "0c6d2cabae214a4fa53deed440ddf015",
"score": "0.66543674",
"text": "def index\n @payments = Payment.where(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "768761a5d225031b868fd7779b64293a",
"score": "0.6629228",
"text": "def payment_amount\n amount = Ride.find(params[:id]).payment_amount\n render json: {amount_payable: amount}\n end",
"title": ""
},
{
"docid": "ec915bad49d00beac92386501dd151ce",
"score": "0.662806",
"text": "def show\n render json: @payment\n end",
"title": ""
},
{
"docid": "ec915bad49d00beac92386501dd151ce",
"score": "0.662806",
"text": "def show\n render json: @payment\n end",
"title": ""
},
{
"docid": "ec915bad49d00beac92386501dd151ce",
"score": "0.662806",
"text": "def show\n render json: @payment\n end",
"title": ""
},
{
"docid": "38f98b63a5b8923bbe072662921c7242",
"score": "0.66057837",
"text": "def payments\n Services::PaymentsService.new(@api_service)\n end",
"title": ""
},
{
"docid": "dfa608564c7e095a33fa69b3db8157a8",
"score": "0.65880835",
"text": "def show\n @payment = current_user.payments.find(params[:id]) #*** THIS WILL GIVE ERROR FOR SHOWING MONEY YOU OWE\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "2d00acde073db67d5b16c15258661929",
"score": "0.65417576",
"text": "def index\n @payment_methods = PaymentMethod.all\n render json: @payment_methods\n end",
"title": ""
},
{
"docid": "95906e1ea4dae46e3bed33fbc1669214",
"score": "0.6534923",
"text": "def payments(options = {})\n status = options[:status] || \"all\"\n page = options[:page] || 1\n from = options[:from]\n to = options[:to]\n\n uri = \"payments/status/#{status}?page=#{page}\"\n uri += \"&from=#{from}\" if from\n uri += \"&to=#{to}\" if to\n\n pay_get(uri)\n end",
"title": ""
},
{
"docid": "28e67ff5d7496e075504a5e873e40c45",
"score": "0.65339506",
"text": "def get_payment_id\n \n path = \"/paymentterms/\"\n \n response = self.get_request(path)\n \n payments = {}\n if response.kind_of? Net::HTTPSuccess\n payments = JSON.parse(response.body.to_s)\n end\n \n return payments\n \n end",
"title": ""
},
{
"docid": "077d17f458c45d58d3518ac85895893a",
"score": "0.65130836",
"text": "def show_payment(payment_id)\n get \"///pay/#{price_setting_id}/payments/#{payment_id}\" do |data|\n payment_hash data\n end\n end",
"title": ""
},
{
"docid": "09539ce4c5237a9971b610d73269396a",
"score": "0.6497003",
"text": "def list_payments_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PaymentApi.list_payments ...\"\n end\n # resource path\n local_var_path = \"/payments\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['bearer']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Payment>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PaymentApi#list_payments\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "598c8dd0a98ad5a4a5ea33e735d43724",
"score": "0.64867324",
"text": "def show\n @payment_plan = PaymentPlan.find(params[:id])\n @payments=@payment_plan.payments\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment_plan }\n end\n end",
"title": ""
},
{
"docid": "66b9711052b42981aefebdc395379b6f",
"score": "0.64784",
"text": "def index\n @payments = Payment.order(\"created_at\").find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @payments }\n end\n end",
"title": ""
},
{
"docid": "14efad4ed7535f939e17573ba5915f61",
"score": "0.6476523",
"text": "def show\n @payment = @loan.payments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "b1c5f58ca6767dd39230110d403d36dd",
"score": "0.64740103",
"text": "def payments\n @payments ||= Services::PaymentsService.new(@api_service)\n end",
"title": ""
},
{
"docid": "1db15400d86eba0dd8cf111d272c8a29",
"score": "0.64536846",
"text": "def index\n @paymentmanagements = Paymentmanagement.all\n end",
"title": ""
},
{
"docid": "09fa339b2a53e11204a691bcbd2cb6be",
"score": "0.6446989",
"text": "def payment_method\n payment_methods = PaymentDetail.payment_methods\n render json: {\n status:\"OK\",\n results: payment_methods,\n error: nil\n }, status: :ok\n end",
"title": ""
},
{
"docid": "0ad5473751e1ae5608bb3c0f8f1525d1",
"score": "0.6419894",
"text": "def show\n @payment = Payment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "0ad5473751e1ae5608bb3c0f8f1525d1",
"score": "0.6419894",
"text": "def show\n @payment = Payment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "0ad5473751e1ae5608bb3c0f8f1525d1",
"score": "0.6419894",
"text": "def show\n @payment = Payment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "0ad5473751e1ae5608bb3c0f8f1525d1",
"score": "0.6419894",
"text": "def show\n @payment = Payment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "0ad5473751e1ae5608bb3c0f8f1525d1",
"score": "0.6419894",
"text": "def show\n @payment = Payment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "0ad5473751e1ae5608bb3c0f8f1525d1",
"score": "0.6419894",
"text": "def show\n @payment = Payment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "0ad5473751e1ae5608bb3c0f8f1525d1",
"score": "0.6419894",
"text": "def show\n @payment = Payment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "0ad5473751e1ae5608bb3c0f8f1525d1",
"score": "0.6419894",
"text": "def show\n @payment = Payment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "0ad5473751e1ae5608bb3c0f8f1525d1",
"score": "0.6419894",
"text": "def show\n @payment = Payment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "0ad5473751e1ae5608bb3c0f8f1525d1",
"score": "0.6419894",
"text": "def show\n @payment = Payment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
}
] |
c3ade6723ca35f196262e0c4cd5fca41
|
Returns an array of installed rubies.
|
[
{
"docid": "96dea7415ae35835b0c5f49bda2c3313",
"score": "0.5944517",
"text": "def rubies\n @parent.list_strings\n end",
"title": ""
}
] |
[
{
"docid": "b0080655f1ec0a19bf017214f136baa8",
"score": "0.65145177",
"text": "def supported_rubies\n @supported_rubies ||= supported_mri_rubies + jrubies\n end",
"title": ""
},
{
"docid": "f19fa747343a3d99b474a4b7beb900fe",
"score": "0.6458473",
"text": "def recent_rubies\n @recent_rubies ||= %w[ ruby-3.2 ruby-3.1 jruby-9.3 ]\n end",
"title": ""
},
{
"docid": "516c2bf61da21ddeea3cb9744e6a708a",
"score": "0.643866",
"text": "def older_rubies\n @older_rubies ||= %w[ ruby-3.0 ruby-2.7 ruby-2.6 ruby-2.5 ]\n end",
"title": ""
},
{
"docid": "5257b1ac8c66b0258c537655872b0ee7",
"score": "0.61128426",
"text": "def jrubies\n @jrubies ||= %w[ jruby-9.3 jruby-9.2 ]\n end",
"title": ""
},
{
"docid": "60134787926d0f24684593f9b5c8e9e8",
"score": "0.6016292",
"text": "def installed_gems\n gems = []\n\n cmd = [attributes.gem_binary, 'list', '-l']\n cmd << '--prerelease' if attributes.prerelease\n\n run_command(cmd).stdout.each_line do |line|\n next unless /\\A([^ ]+) \\(([^\\)]+)\\)\\z/ =~ line.strip\n\n name = $1\n versions = $2.split(', ')\n gems << { name: name, versions: versions }\n end\n gems\n rescue Backend::CommandExecutionError\n []\n end",
"title": ""
},
{
"docid": "7307ca47ed9ee74639a359850136462f",
"score": "0.5946406",
"text": "def supported_mri_rubies\n @supported_mri_rubies ||= %w[\n ruby-3.2 ruby-3.1 ruby-3.0\n ruby-2.7 ruby-2.6 ruby-2.5\n ]\n end",
"title": ""
},
{
"docid": "34d7870c497f59451975d2cb780ac16b",
"score": "0.5918354",
"text": "def sample_rubies\n @sample_rubies ||= sample_mri_rubies + %w[ jruby-9.3 ]\n end",
"title": ""
},
{
"docid": "cab6081522303e35bf274ea6e404d385",
"score": "0.5839556",
"text": "def list_installed_addons()\n list = Array.new\n addons = Array.new\n \n Dir.foreach(@addons) {|x| list.push x }\n \n list.each do |l|\n if !@no_way.index(l)\n addons.push l\n end\n end\n \n return addons\n end",
"title": ""
},
{
"docid": "1921b8b9502ff59b1725164ed0e12ad8",
"score": "0.5822841",
"text": "def sample_mri_rubies\n @sample_mri_rubies ||= %w[ ruby-3.2 ruby-2.7 ]\n end",
"title": ""
},
{
"docid": "41996a22fa4dc573ef67270c8b890096",
"score": "0.58155316",
"text": "def versions\n installs.map { |i| i['version'] }.uniq\n end",
"title": ""
},
{
"docid": "41996a22fa4dc573ef67270c8b890096",
"score": "0.58155316",
"text": "def versions\n installs.map { |i| i['version'] }.uniq\n end",
"title": ""
},
{
"docid": "41996a22fa4dc573ef67270c8b890096",
"score": "0.58155316",
"text": "def versions\n installs.map { |i| i['version'] }.uniq\n end",
"title": ""
},
{
"docid": "fba654b8e11e8253aab25bec918a5d1b",
"score": "0.5685383",
"text": "def installed\n api.get('installed')\n end",
"title": ""
},
{
"docid": "3f85d9566944eed02f1caf0938264ce4",
"score": "0.5665004",
"text": "def runtime_specific_gems\n []\n end",
"title": ""
},
{
"docid": "393ed72f9cac8e37b61eeec559812826",
"score": "0.56388575",
"text": "def available_versions\n Mixlib::Install.new(\n product_name: project_name,\n channel: channel_name.to_sym,\n user_agent_headers: ['omnitruck']\n ).available_versions\n rescue Mixlib::Install::Backend::ArtifactsNotFound\n # Return an empty array if no artifacts are found\n []\n end",
"title": ""
},
{
"docid": "9010f6dd7237b0a4440452433b279dc0",
"score": "0.5606555",
"text": "def gems\n provisioner, version = @impl.split('-')\n get_gem_list(provisioner, version)\n end",
"title": ""
},
{
"docid": "b243d3f31b9c8cc746f5b0b386806e20",
"score": "0.556876",
"text": "def create_rubies\n @rubies = [[1, 1], [2, 2], [1, 1], [0, 3], [3, 0], [2, 2], [2, 2]]\n end",
"title": ""
},
{
"docid": "87f79acc8cd7d83c75ab9fbd5f88fc7a",
"score": "0.5504957",
"text": "def installed_apps\n return @installed_apps\n end",
"title": ""
},
{
"docid": "87f79acc8cd7d83c75ab9fbd5f88fc7a",
"score": "0.5504957",
"text": "def installed_apps\n return @installed_apps\n end",
"title": ""
},
{
"docid": "f9cade1d32c99f3e4129272f324bae6a",
"score": "0.5421705",
"text": "def installed_versions; end",
"title": ""
},
{
"docid": "8df3f56b5c1798278deaa53f787a0c49",
"score": "0.5411731",
"text": "def get_all_versions()\n return []\n end",
"title": ""
},
{
"docid": "d2c75838bd82661d56d7b9904a8fb980",
"score": "0.53760564",
"text": "def identify_registry\n values = []\n basekey = \"HKLM\\\\SOFTWARE\\\\Apache Software Foundation\\\\Tomcat\"\n instances = registry_enumkeys(basekey)\n if not instances.nil? and not instances.empty?\n instances.each do |i|\n major_version_key = \"#{basekey}\\\\#{i}\"\n services = registry_enumkeys(major_version_key)\n\n if services.empty?\n val_installpath = registry_getvaldata(major_version_key,\"InstallPath\")\n val_version = registry_getvaldata(major_version_key,\"Version\")\n values << [val_installpath,val_version]\n else\n services.each do |s|\n service_key = \"#{major_version_key}\\\\#{s}\"\n val_installpath = registry_getvaldata(service_key,\"InstallPath\")\n val_version = registry_getvaldata(service_key,\"Version\")\n values << [val_installpath,val_version]\n end\n end\n end\n end\n return values\n rescue\n print_error(\"\\t\\t! failed to locate install path\")\n return nil || []\n end",
"title": ""
},
{
"docid": "c293cd365731874d5efc918d986e771b",
"score": "0.53044647",
"text": "def installs\n return node['visualstudio']['installs'] unless node['visualstudio']['installs'].nil?\n return [{\n 'edition' => node['visualstudio']['edition'],\n 'version' => node['visualstudio']['version']\n }]\n end",
"title": ""
},
{
"docid": "35a0194b0bf2fc29b39a0ec9e3139265",
"score": "0.5256473",
"text": "def all_environments\n envs = []\n find('').sort.each do |file|\n envs << File.basename(file)\n end\n envs\n end",
"title": ""
},
{
"docid": "e69e6a46e6f62ecc0d158f06be6d3a81",
"score": "0.5248118",
"text": "def installed_plugins\n @data[\"installed\"]\n end",
"title": ""
},
{
"docid": "a90230da370e00964238a76a1893f2b3",
"score": "0.52344",
"text": "def get_all_versions\n []\n end",
"title": ""
},
{
"docid": "dade0dbf305bf6df0dec02f21e145592",
"score": "0.52322525",
"text": "def installs\n return node['visualstudio']['installs'] unless node['visualstudio']['installs'].nil?\n [{\n 'edition' => node['visualstudio']['edition'],\n 'version' => node['visualstudio']['version'],\n }]\n end",
"title": ""
},
{
"docid": "4282a6e14927b021763de256f8067ebb",
"score": "0.52289736",
"text": "def installs\n return node['visualstudio']['installs'] unless node['visualstudio']['installs'].nil?\n [{\n 'edition' => node['visualstudio']['edition'],\n 'version' => node['visualstudio']['version']\n }]\n end",
"title": ""
},
{
"docid": "af64972e517a79f03652e69b5b9ef202",
"score": "0.5211539",
"text": "def required_gem_list\n Mack::Utils::GemManager.instance.required_gem_list\n end",
"title": ""
},
{
"docid": "c106602dcf7d303feee9593c98d14afb",
"score": "0.5202947",
"text": "def installed_assets()\n installed = Array.new()\n asset_on_segment_historys.each do |hist|\n if !hist.assets.first.nil?\n asset = Asset.find_by_guid(hist.assets.first.g_u_i_d)\n installed << asset unless asset.asset_on_segment_history.nil?\n end\n end\n return installed\n end",
"title": ""
},
{
"docid": "a8c97b45d2c6489345920d17a283d222",
"score": "0.5196991",
"text": "def installed_versions(name, requirement)\n if gem_installed?(name, requirement)\n Chef::Log.info \"Gem #{name} (#{requirement}) found in OpsWorks user space.\"\n # from rubygems/specification.rb#find_all_by_name\n Gem::Dependency.new(name, requirement).matching_specs\n else\n Chef::Log.debug \"Gem #{name} (#{requirement}) not found in OpsWorks user space.\"\n []\n end\n end",
"title": ""
},
{
"docid": "91260148b89272dc2da07c6e372ce970",
"score": "0.5196605",
"text": "def installed_packages()\n\t\t\t\treturn(PackageList.new())\n\t\t\tend",
"title": ""
},
{
"docid": "44b682448871a20e7a613304b5f6d722",
"score": "0.5192115",
"text": "def available_versions\n Mixlib::Install.available_versions(project, channel)\n end",
"title": ""
},
{
"docid": "9a91b7318e2b46e1219350b93c594c92",
"score": "0.5153625",
"text": "def get_gem_names\n fetcher = Gem::SpecFetcher.fetcher\n\n list, = fetcher.available_specs(:complete)\n\n tuples = list.values.first\n\n tuples.map do |tuple,|\n tuple = tuple.to_a\n case tuple.last\n when Gem::Platform::RUBY then\n tuple[0, 2]\n else\n tuple\n end.join '-'\n end\n end",
"title": ""
},
{
"docid": "f4d9adb8e9a48bbd372401d9b1b4cd33",
"score": "0.51516634",
"text": "def get_repo_list\n Chef::Log.debug(\n \"Fetching all versions of #{new_resource.module_name} \" +\n \"from #{new_resource.repository}.\",\n )\n latest = powershell_out!(\n <<-EOH,\n $splat = @{\n Name = \"#{new_resource.module_name}\"\n Repository = \"#{new_resource.repository}\"\n AllVersions = $True\n }\n (Find-Module @splat).Version.ForEach({$_.ToString()})\n EOH\n ).stdout.to_s.chomp.split(\"\\r\\n\")\n Chef::Log.debug(\"Available versions: #{latest.join(', ')}\")\n\n return latest.map { |v| Gem::Version.new(v) }\n end",
"title": ""
},
{
"docid": "565ad33b986e40643222db269cc4ce69",
"score": "0.5146203",
"text": "def get_all_path\n # some default directories\n env_paths = []\n env_paths << \"/bin\"\n env_paths << \"/usr/bin\"\n env_paths << \"/usr/local/bin\"\n env_paths << \"/sbin\"\n env_paths << \"/usr/sbin\"\n env_paths << \"/usr/local/sbin\"\n env_paths << \"/opt/bin\"\n env_paths += cmd_exec(\"echo $PATH\").split(\":\")\n env_paths.uniq\n end",
"title": ""
},
{
"docid": "f5f810df9109be794029460ed3a9a191",
"score": "0.51092905",
"text": "def versions_of(keg_name)\n `/bin/ls #{HOMEBREW_CELLAR}/#{keg_name}`.collect { |version| version.strip }.reverse\nend",
"title": ""
},
{
"docid": "fb98f120faace54b1ae306ac206eeffc",
"score": "0.5100817",
"text": "def get_variants\n return [] if is_pdc?\n get_variants_by_package.values.flatten.uniq\n end",
"title": ""
},
{
"docid": "b27cd8b3c382b1731cfe0233b88c2055",
"score": "0.5073299",
"text": "def list\n ridley.environment.all\n end",
"title": ""
},
{
"docid": "b64d53500ded49223f2f0c6882dd3c32",
"score": "0.50478745",
"text": "def installed_packages()\n\t\t\t\tinstalledpackagelist = `#{@finkbin} list -i`\n\n\t\t\t\tinstalledpackages = PackageList.new()\n\t\t\t\tinstalledpackagelist.each_line() { |line|\n\t\t\t\t\tlinearr = line.split()\n\t\t\t\t\tinstalledpackages[linearr[1]] = PackageInfo.new()\n\t\t\t\t\tinstalledpackages[linearr[1]].name = linearr[1]\n\t\t\t\t\tinstalledpackages[linearr[1]].version = linearr[2]\n\t\t\t\t\tinstalledpackages[linearr[1]].description = linearr[3]\n\t\t\t\t\tinstalledpackages[linearr[1]].installed = true\n\t\t\t\t}\n\n\t\t\t\treturn(installedpackages)\n\t\t\tend",
"title": ""
},
{
"docid": "470cf8e294a86e59f8d45723314d5782",
"score": "0.5038962",
"text": "def supported_pkgs\n {\"rpm\"=>1, \"deb\"=>1}\nend",
"title": ""
},
{
"docid": "5a65db4a0f674e305fcff1dc0e27c9fd",
"score": "0.50284666",
"text": "def brew_cask_list\n \"ls -1 /opt/homebrew-cask/Caskroom/\"\n end",
"title": ""
},
{
"docid": "678d20d157b967a8d20cf40637d65f7d",
"score": "0.5024374",
"text": "def available_versions\n the_gem_line = gem_remote_list_output.scan(/^#{name}\\s.*$/).first\n the_gem_line.scan /\\d+\\.\\d+\\.\\d+/\n end",
"title": ""
},
{
"docid": "8fe83ba2e7660f0d203cf4a2e2a68ba5",
"score": "0.50062084",
"text": "def gems\n Recommendable.config.ratable_classes.map { |klass| gemd_for(klass) }.flatten\n end",
"title": ""
},
{
"docid": "7a6f04c47bb5eb0c326edb796378878d",
"score": "0.49972466",
"text": "def run_list\n Array(platform.run_list) + Array(suite.run_list)\n end",
"title": ""
},
{
"docid": "471133663c5d397fc2d5e60a06d37fee",
"score": "0.4989372",
"text": "def to_rubygems_a\n [ name, version, platform_string ]\n end",
"title": ""
},
{
"docid": "144f011b91d59dfe9d54eb5aeda8d89a",
"score": "0.49666825",
"text": "def ruby_versions\n if jruby?\n [ \"JRuby #{JRUBY_VERSION}\", \"like Ruby #{RUBY_VERSION}\" ]\n else\n [ \"Ruby #{RUBY_VERSION}\" ]\n end\n end",
"title": ""
},
{
"docid": "7043115d4663bc8009fbe0e6acf21142",
"score": "0.49658966",
"text": "def check_installed\n @install_array = []\n cmd = \"\\\"#{webpicmd}\\\" /List /ListOption:Installed\"\n cmd << \" /XML:#{node['webpi']['xmlpath']}\" if node['webpi']['xmlpath']\n cmd_out = shell_out(cmd, returns: @new_resource.returns)\n if cmd_out.stderr.empty?\n @new_resource.product_id.split(',').each do |p|\n # Example output\n # HTTPErrors IIS: HTTP Errors\n # Example output returned via grep\n # \\r \\rHTTPErrors IIS: HTTP Errors\\r\\ns\n if cmd_out.stdout.lines.grep(/^\\s{6}#{p}\\s.*$/i).empty?\n @install_array << p\n end\n end\n else\n Chef::Log.info(cmd_out.stderr)\n @install_array = @new_resource.product_id\n end\n @install_list = @install_array.join(',')\n end",
"title": ""
},
{
"docid": "d44d5f1ff4d1b72911a82e3222ec721f",
"score": "0.49367112",
"text": "def init_rubies\n @table = [\n [1, 1], # Enumerable Canyon ==> 0\n [1, 1], # Monkey Patch City ==> 1\n [2, 2], # Duck Type Beach ==> 2\n [3, 0], # Matzburg ==> 3\n [0, 3], # Nil Town ==> 4\n [2, 2], # Hash Crossing ==> 5\n [2, 2] # Dynamic Palisades ==> 6\n ]\n end",
"title": ""
},
{
"docid": "5deaa79bd96aaac0a7365a5033fa6c09",
"score": "0.49266052",
"text": "def installed_packages()\n\t\t\tend",
"title": ""
},
{
"docid": "a0d8527c7a87e208cb686fe4f8850159",
"score": "0.49173486",
"text": "def installed? components = nil\n Hash[(components || to_install).map{|k, args|[k, cmp_installed?(*args)]}]\n end",
"title": ""
},
{
"docid": "57535a7f667967f9ce0d305ed6f466d3",
"score": "0.4914611",
"text": "def operating_systems\n collect\n end",
"title": ""
},
{
"docid": "b752caa84a025d0705590352fbdaf797",
"score": "0.4910221",
"text": "def to_rubygems_a\n [name, version, platform_string]\n end",
"title": ""
},
{
"docid": "7fe46911d2d657d681033902b0fb49ac",
"score": "0.49098077",
"text": "def gems; end",
"title": ""
},
{
"docid": "7fe46911d2d657d681033902b0fb49ac",
"score": "0.49098077",
"text": "def gems; end",
"title": ""
},
{
"docid": "7fe46911d2d657d681033902b0fb49ac",
"score": "0.49098077",
"text": "def gems; end",
"title": ""
},
{
"docid": "0dc440b2b5f621ec09692906c774d6df",
"score": "0.49007672",
"text": "def list_installed(options={})\n software, version = parse_software_args((options[:software]||options[:package]||\"\"), options[:version])\n run_command(\"#{command} list #{software} | grep \\\"*\\\"\", options)\n end",
"title": ""
},
{
"docid": "db2ba060ff4220e71629b5a6a699161f",
"score": "0.4891709",
"text": "def installed_plugins\n PluginList.installed(@client)\n end",
"title": ""
},
{
"docid": "658020ae4d78fe01e0fce608151acdc8",
"score": "0.48823574",
"text": "def install_instructions\n []\n end",
"title": ""
},
{
"docid": "72998447e67f9023ceaa64af974e3fee",
"score": "0.4877765",
"text": "def get_cookbook_chef_versions ()\n cookbooks = rest.get_rest(\"/cookbooks/#{@cookbook_name}?num_version=all\")\n cookbooks[@cookbook_name]['versions'].each do |v|\n @versions.push v['version']\n end\n end",
"title": ""
},
{
"docid": "9eaeea3b901411d5620563293d8c5f21",
"score": "0.48681104",
"text": "def available_versions\n return unless @version\n the_gem_line = gem_remote_list_output.scan(/^#{name}\\s.*$/).first\n the_gem_line.scan /\\d+\\.\\d+\\.\\d+/\n end",
"title": ""
},
{
"docid": "5134dc7015bfee90b2c6bf8fa531ca31",
"score": "0.48508862",
"text": "def pythons\n deps.map(&:to_formula)\n .select { |f| f.name.match?(/^python@\\d\\.\\d+$/) }\n .sort_by(&:version)\n .map { |f| f.opt_libexec/\"bin/python\" }\n end",
"title": ""
},
{
"docid": "b966faf8aaa0e74f72f2370d913cc2c3",
"score": "0.4850486",
"text": "def installed_spec_directories; end",
"title": ""
},
{
"docid": "2c90897b912e1e29f6a096710bfac7d2",
"score": "0.4846451",
"text": "def list_addons\n Dir.glob(\"/var/lib/apollo/addons/*.gem\")\n end",
"title": ""
},
{
"docid": "c3af19f867a906b86ed103664b327497",
"score": "0.48381555",
"text": "def test_rubies_found_positive\n prospector = Rubyist.new(1)\n prospector.rubies_found(2, 2)\n assert prospector.real_ruby_count == 2 && prospector.fake_ruby_count == 2\n end",
"title": ""
},
{
"docid": "ca2de21f6c3ad9bb3fd2e81aa4440574",
"score": "0.48186594",
"text": "def index\n @rubies = Ruby.all\n end",
"title": ""
},
{
"docid": "c051faa4ff4a7cacbd9e04c188f6546e",
"score": "0.48129457",
"text": "def recipes\n Array fetch(:run_list)\n end",
"title": ""
},
{
"docid": "204e1fc6014365c8b9decaf2b49ccc6d",
"score": "0.48083827",
"text": "def apt_installed_packages\n @apt_installed_packages ||= Puppet::Type.type(:package).provider(:apt).instances.map(&:name)\n end",
"title": ""
},
{
"docid": "2d556c41d023829d2eca5a9e13e31c76",
"score": "0.48049387",
"text": "def apt_packages\n PRE_INSTALLED_OS_PACKAGES[@app.release].join(\" #{NL_TAB}\")\n end",
"title": ""
},
{
"docid": "54159e8e427f123eadb08fd931fc7a65",
"score": "0.4795853",
"text": "def all_breweries_in_us\n state_names.collect do |state|\n name_iterate_through_json(state)\n end\n end",
"title": ""
},
{
"docid": "077de7a54722601d4f76e40d4a159d31",
"score": "0.47882104",
"text": "def packages\n @packages ||= []\n end",
"title": ""
},
{
"docid": "077de7a54722601d4f76e40d4a159d31",
"score": "0.47882104",
"text": "def packages\n @packages ||= []\n end",
"title": ""
},
{
"docid": "1a756454a4a51e9930a5c76f521cd366",
"score": "0.47793233",
"text": "def vagrant_experimentals()\n res = []\n if ENV[\"VAGRANT_EXPERIMENTAL\"]\n res = ENV[\"VAGRANT_EXPERIMENTAL\"].split(\",\")\n end\n res\n end",
"title": ""
},
{
"docid": "15edb697f2bda11306676fc511ca4497",
"score": "0.4777959",
"text": "def find_rubies\r\n # Add 1 to max_rubies to make maximum inclusive\r\n @random.rand(@max_rubies + 1)\r\n end",
"title": ""
},
{
"docid": "de332663d6959f676dda1ac5a56aaabb",
"score": "0.47681844",
"text": "def get_available_cartridges\n args = Hash.new\n args['--porcelain'] = true\n args['--with-descriptors'] = true\n result = execute_direct(@@C_CONTROLLER, 'cartridge-list', args, false)\n result = parse_result(result)\n cart_data = JSON.parse(result.resultIO.string)\n cart_data.map! {|c| OpenShift::Cartridge.new(YAML.load(c))}\n end",
"title": ""
},
{
"docid": "cab1ec574fc5430d9f9f4e7068415021",
"score": "0.4753138",
"text": "def local_gems\n %x(ls #{local_cache_path}).split(/\\s+/)\n end",
"title": ""
},
{
"docid": "3479df822ef06080a6c332fe8dc18c31",
"score": "0.47477305",
"text": "def installed_packages()\n\t\t\t\tpackages = PackageList.new()\n\t\t\t\tpackageregex = /^([^ ]+)-([^- ]+)\\s+(.*)$/\n\n\t\t\t\tinstalledpackageslist = `/usr/sbin/pkg_info`\n\t\t\t\tinstalledpackageslist.each_line() { |line|\n\t\t\t\t\tline.strip!()\n\t\t\t\t\tmatch = packageregex.match(line)\n\t\t\t\t\tif(match != nil)\n\t\t\t\t\t\tname = match[1]\n\t\t\t\t\t\tversion = match[2]\n\t\t\t\t\t\tdescription = match[3]\n\n\t\t\t\t\t\tpackages[name] = PackageInfo.new()\n\t\t\t\t\t\tpackages[name].name = name\n\t\t\t\t\t\tpackages[name].version = version\n\t\t\t\t\t\tpackages[name].description = description\n\t\t\t\t\tend\n\t\t\t\t}\n\n\t\t\t\treturn(packages)\n\t\t\tend",
"title": ""
},
{
"docid": "fab799482358b6e561e22f96b4f4bb3b",
"score": "0.4745511",
"text": "def r(*gems)\n gems.map {|g| require g.to_s}\nend",
"title": ""
},
{
"docid": "7fe8a5e96fe40a4ff7294bfdd1c487e7",
"score": "0.47077337",
"text": "def fetch_installed_vibs\n Puppet.debug(\"Getting list of installed VIBs...\")\n cnt = 0\n host.esxcli.software.vib.get.each do |installed_vib_data|\n if installed_vib_data[:ID]\n @processed_vibs[installed_vib_data[:ID]] = installed_vib_data\n cnt += 1\n end\n end\n Puppet.debug(\"Found %d installed VIBs\" % cnt)\n end",
"title": ""
},
{
"docid": "fb75f97658891298373eec07ff8a71c4",
"score": "0.47058803",
"text": "def os_dependencies\n []\n end",
"title": ""
},
{
"docid": "fd4daf34513ef098f28aa74ce857c30e",
"score": "0.47058004",
"text": "def depends_all\n pkg_depends = self.class.depends_all\n if self.class.omnibus_package\n self.class.omnibus_recipes.each { |omni_recipe|\n recipe_file = File.expand_path(omni_recipe + '.rb', File.dirname(filename))\n\n Book.instance.load_recipe(recipe_file, config) do |recipe|\n pkg_depends << recipe.depends_all\n end\n }\n end\n\n pkg_depends.flatten.uniq\n end",
"title": ""
},
{
"docid": "fd4daf34513ef098f28aa74ce857c30e",
"score": "0.47058004",
"text": "def depends_all\n pkg_depends = self.class.depends_all\n if self.class.omnibus_package\n self.class.omnibus_recipes.each { |omni_recipe|\n recipe_file = File.expand_path(omni_recipe + '.rb', File.dirname(filename))\n\n Book.instance.load_recipe(recipe_file, config) do |recipe|\n pkg_depends << recipe.depends_all\n end\n }\n end\n\n pkg_depends.flatten.uniq\n end",
"title": ""
},
{
"docid": "32aa961bff575a62019a06de75b7005b",
"score": "0.46983793",
"text": "def rpaths\n command(:LC_RPATH).map(&:path).map(&:to_s)\n end",
"title": ""
},
{
"docid": "d447df84e33a80b5cb69f87295cc0225",
"score": "0.46927264",
"text": "def GetPackages\n ProbeKernel() if !@kernel_probed\n deep_copy(@kernel_packages)\n end",
"title": ""
},
{
"docid": "88a54006ff796d07967f0a00b9a9022f",
"score": "0.46883944",
"text": "def running\n if launchctl?\n # TODO: find replacement for deprecated \"list\"\n Utils.popen_read(\"#{launchctl} list | grep homebrew\")\n else\n Utils.popen_read(systemctl, systemctl_scope, \"list-units\", \"--type=service\", \"--state=running\", \"--no-pager\",\n \"--no-legend\")\n end.chomp.split(\"\\n\").map do |svc|\n Regexp.last_match(1) if svc =~ /\\s?(homebrew\\.[a-z.]*)\\s?/\n end.compact\n end",
"title": ""
},
{
"docid": "21d09c5ac2d4b7a0b06d08f0db2a5524",
"score": "0.46709898",
"text": "def list_bundles\n BrickFTP::API::Bundle.all\n end",
"title": ""
},
{
"docid": "21d09c5ac2d4b7a0b06d08f0db2a5524",
"score": "0.46709898",
"text": "def list_bundles\n BrickFTP::API::Bundle.all\n end",
"title": ""
},
{
"docid": "08f3bb50a2d6a4951875175dc91e6047",
"score": "0.4665413",
"text": "def run_list\n self.roles.collect { |role| \"role[#{role}]\" } +\n self.recipes.collect { |recipe| \"recipe[#{recipe}]\" }\n end",
"title": ""
},
{
"docid": "2ef550d0cb90a0b538332623e513b391",
"score": "0.465928",
"text": "def versions\n @versions ||= run( :versions, '--bare' ).lines.map( &:chomp )\n end",
"title": ""
},
{
"docid": "9e307b3cc3a4f3c2e536e667a966d200",
"score": "0.4658727",
"text": "def recipes_from_cookbook_version(cookbook)\n cookbook.fully_qualified_recipe_names.map do |recipe_name|\n unqualified_name =\n if /::default$/.match?(recipe_name)\n name.to_s\n else\n recipe_name\n end\n\n @recipes[unqualified_name] ||= \"\"\n provides(unqualified_name)\n\n unqualified_name\n end\n end",
"title": ""
},
{
"docid": "1f188baf3cae734659ff3301ec2f0152",
"score": "0.46577013",
"text": "def packages()\n\t\t\t\tpackages = installed_packages()\n\n\t\t\t\tpackagelist = `#{@finkbin} list -n`\n\n\t\t\t\tpackagelist.each_line() { |line|\n\t\t\t\t\tlinearr = line.split()\n\t\t\t\t\tpackages[linearr[0]] = PackageInfo.new()\n\t\t\t\t\tpackages[linearr[0]].name = linearr[0]\n\t\t\t\t\tpackages[linearr[0]].version = linearr[1]\n\t\t\t\t\tpackages[linearr[0]].description = linearr[2]\n\t\t\t\t}\n\n\t\t\t\treturn(packages)\n\t\t\tend",
"title": ""
},
{
"docid": "b593ebcd6ee65ad707d4e47524e48730",
"score": "0.46571493",
"text": "def gems(*args)\n gems.each{|g| gem(g) }\n end",
"title": ""
},
{
"docid": "52c6abad432a05ef7c899be8b9c2da27",
"score": "0.4655976",
"text": "def recipes\n (@run_list.to_set - roles.to_set).to_a\n end",
"title": ""
},
{
"docid": "4174550e1e47cf7c8621372ba89b3823",
"score": "0.46554294",
"text": "def running\n if System.launchctl?\n # TODO: find replacement for deprecated \"list\"\n Utils.popen_read(\"#{System.launchctl} list | grep homebrew\")\n else\n Utils.popen_read(System.systemctl, System.systemctl_scope, \"list-units\",\n \"--type=service\",\n \"--state=running\",\n \"--no-pager\",\n \"--no-legend\")\n end.chomp.split(\"\\n\").map do |svc|\n Regexp.last_match(0) if svc =~ /homebrew(?>\\.mxcl)?\\.([\\w+-.@]+)/\n end.compact\n end",
"title": ""
},
{
"docid": "009c6dd51d800aacd0c5ef06474c6c40",
"score": "0.46541503",
"text": "def check_for_installed_software_only\n check_all_installed @options\n end",
"title": ""
},
{
"docid": "a771a30200859d35e31e044bead0b47a",
"score": "0.4646299",
"text": "def available_platform\n downloads.collect(&:platform).flatten.uniq\n end",
"title": ""
},
{
"docid": "93edaa4c4b90b5b4c8a5bae9d6c75651",
"score": "0.46448684",
"text": "def installable\n (expanded_known + ruby_svn_tags).uniq.sort\n end",
"title": ""
},
{
"docid": "7d7195ac572652497c3cdf2a9738d9d9",
"score": "0.46427852",
"text": "def all_gems()\n self.sort.collect {|k,g| g }\n end",
"title": ""
},
{
"docid": "fe4eab65fba01dc1f06e3bb56aef2abe",
"score": "0.46405798",
"text": "def spec_set\n Bundler.locked_gems.specs\n end",
"title": ""
},
{
"docid": "3c177916a9ad18b55b361c0feae7a6d4",
"score": "0.4630506",
"text": "def platforms; platform_names; end",
"title": ""
}
] |
47d853165f96ddc84d7e8acd228444c0
|
Retrieves the Transition based on the Issue Key and Transition ID [Arguments] :key (required) issue key :id (required) transition id
|
[
{
"docid": "877ea9f9ae0915e386d6b58859bb0433",
"score": "0.7736116",
"text": "def find_by_key_and_id(key, id)\n issueKey_test(key)\n response = fetch({:parent => parent_name, :parent_key => key, :body => {\"transitionId\" => id}, :body_to_params => true })\n response.parsed_response['transitions'].each do |t|\n t['jira_key'] = key\n end\n return new(response.parsed_response['transitions'])\n end",
"title": ""
}
] |
[
{
"docid": "5475c896b7fdddbb81d14aadc10ee956",
"score": "0.81235963",
"text": "def get(key)\n Jiralicious::Issue::Transitions.find(key)\n end",
"title": ""
},
{
"docid": "45a6737fe00786434348d3f0c2e03026",
"score": "0.7636984",
"text": "def transitionsFor(key)\n verbose \"Fetching transitions for #{key}\"\n data = get('issue/' + key + '/transitions')\n data[:transitions]\n end",
"title": ""
},
{
"docid": "afad21022ca22474db3fbffad9585082",
"score": "0.71042156",
"text": "def get_jira_transition_details(jira_key, step_id)\r\n fail 'Jira ticket key and transition step ID required to find transition details.' if jira_key.nil? || step_id.nil?\r\n\r\n headers = { 'Content-Type' => 'application/json',\r\n 'Accept' => 'application/json' }\r\n\r\n uri = URI.parse((\"#{@service_data[:jira_url]}#{jira_key}/transitions?expand=transitions.fields.\"))\r\n req = Net::HTTP::Get.new(uri.to_s, headers)\r\n response = send_jira_request(uri, req)\r\n\r\n transitions = JSON.parse(response.body)\r\n\r\n if transitions.has_key? 'transitions'\r\n transitions['transitions'].each do |transition|\r\n if transition['to']['statusCategory']['id'].to_s == step_id.to_s\r\n return transition\r\n end\r\n end\r\n end\r\n error = \"Response was <#{transitions}> and desired close Step ID was <#{@service_data[:close_step_id]}>. Jira returned no valid transition to close the ticket!\"\r\n @log.log_message(error)\r\n return nil\r\n end",
"title": ""
},
{
"docid": "35313d22fd492217664ba18cca9de6ab",
"score": "0.68774164",
"text": "def transition(key, toID)\n verbose \"Transitioning key #{key} to #{toID}\"\n post('issue/' + key + '/transitions', {:transition=>{:id=>toID}}) unless $cfg['tool.dry']\n end",
"title": ""
},
{
"docid": "99ef22a51d3005d26d1df87259ecfe51",
"score": "0.67203665",
"text": "def meta(key, id, options = {})\n issueKey_test(key)\n response = fetch({:method => :get, :parent => parent_name, :parent_key => key, :body_to_params => true,\n :body => {\"transitionId\" => id, \"expand\" => \"transitions.fields\"}})\n response.parsed_response['transitions'].each do |t|\n t['jira_key'] = key\n end\n return (options[:return].nil?) ? new(response.parsed_response['transitions'], key) : response\n end",
"title": ""
},
{
"docid": "223edebbbb4589bacc1ea72fd04bad6c",
"score": "0.581433",
"text": "def get_id_from_key(key)\n @params = { from_key: key }\n run_action :get_id_from_key\n end",
"title": ""
},
{
"docid": "223edebbbb4589bacc1ea72fd04bad6c",
"score": "0.581433",
"text": "def get_id_from_key(key)\n @params = { from_key: key }\n run_action :get_id_from_key\n end",
"title": ""
},
{
"docid": "5daf6f3e3bb76538a05f9635ab764d1d",
"score": "0.5692247",
"text": "def get_issue(params)\n key = params[:key] or raise \"No :key argument given\"\n issueify(key)\n end",
"title": ""
},
{
"docid": "5edb6ca066525fff7b869ac6cb382748",
"score": "0.5566332",
"text": "def get_transition(v1, x)\n if has_state?(v1)\n @transition[v1][x]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "f4ff6d9ae2520e0067b2d3493c3ac602",
"score": "0.54810995",
"text": "def get_transition(v1,x)\n if has_state?(v1)\n @transition[v1][x]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "f4ff6d9ae2520e0067b2d3493c3ac602",
"score": "0.54810995",
"text": "def get_transition(v1,x)\n if has_state?(v1)\n @transition[v1][x]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "9c5011690dc064f962d4fc53a6afcea4",
"score": "0.5431489",
"text": "def get_issue(issue_key)\n Backlog::Object::Issue.new(\n self.call(\"backlog.getIssue\", conv_str_to_int(issue_key))\n )\n end",
"title": ""
},
{
"docid": "1609fc3905c34d0368008b1a244d6b77",
"score": "0.54233176",
"text": "def get_issue(key)\n JiraIssue.new(@soap.getIssue(@token, key), self)\n end",
"title": ""
},
{
"docid": "d43bb40cb9243696dc6674f95819f0b7",
"score": "0.5385722",
"text": "def get_by_key(organization, key)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('key', key, String)\n r = @client.request(\"/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}\").get\n ::Io::Flow::V0::Models::Experience.new(r)\n end",
"title": ""
},
{
"docid": "581f3fce82843874d52c487102ebd520",
"score": "0.5367455",
"text": "def transitions\n require_parameters :issue\n issue_key = params[:issue]\n transitions = Internal.issues.listTransitions(issue_key)\n render :json => jsonp(\n {\n :transitions => transitions.map { |t| t.key() }\n }\n )\n end",
"title": ""
},
{
"docid": "a815ad3410de8adeff7d20496005592f",
"score": "0.5364121",
"text": "def [](key)\n get_issue(key)\n end",
"title": ""
},
{
"docid": "4b95674e5193eb8fc1da59b3524da0c0",
"score": "0.5337572",
"text": "def get_by_key(organization, key)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('key', key, String)\n r = @client.request(\"/#{CGI.escape(organization)}/refunds/#{CGI.escape(key)}\").get\n ::Io::Flow::V0::Models::Refund.new(r)\n end",
"title": ""
},
{
"docid": "4b95674e5193eb8fc1da59b3524da0c0",
"score": "0.5337572",
"text": "def get_by_key(organization, key)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('key', key, String)\n r = @client.request(\"/#{CGI.escape(organization)}/refunds/#{CGI.escape(key)}\").get\n ::Io::Flow::V0::Models::Refund.new(r)\n end",
"title": ""
},
{
"docid": "a6a85867d7226f67c0d2b326d7279a6c",
"score": "0.5290661",
"text": "def retreat\n Jiralicious::Issue::Transitions.go(@key, @previous, {})\n end",
"title": ""
},
{
"docid": "9550f9a62b9c93e2447020d8a15a6e61",
"score": "0.524782",
"text": "def get_state_by_key(project_key, key, opts = {})\n data, _status_code, _headers = get_state_by_key_with_http_info(project_key, key, opts)\n data\n end",
"title": ""
},
{
"docid": "1f4b35b0c29aa5cd8b0eadbac6b48f48",
"score": "0.52424985",
"text": "def get_by_key(organization, key)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('key', key, String)\n r = @client.request(\"/#{CGI.escape(organization)}/captures/#{CGI.escape(key)}\").get\n ::Io::Flow::V0::Models::Capture.new(r)\n end",
"title": ""
},
{
"docid": "1f4b35b0c29aa5cd8b0eadbac6b48f48",
"score": "0.52424985",
"text": "def get_by_key(organization, key)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('key', key, String)\n r = @client.request(\"/#{CGI.escape(organization)}/captures/#{CGI.escape(key)}\").get\n ::Io::Flow::V0::Models::Capture.new(r)\n end",
"title": ""
},
{
"docid": "a66bc55c9994c872a526903314480c06",
"score": "0.5197386",
"text": "def set_transition\n @transition = @workflow.transitions.find(params[:id])\n end",
"title": ""
},
{
"docid": "bbb7e26e66a3b50ed3d05e93679c33ac",
"score": "0.5174516",
"text": "def go(key, id, options = {})\n issueKey_test(key)\n transition = {\"transition\" => {\"id\" => id}}\n if options[:comment].is_a? String\n transition.merge!({\"update\" => {\"comment\" => [{\"add\" => {\"body\" => options[:comment].to_s}}]}})\n elsif options[:comment].is_a? Jiralicious::Issue::Fields\n transition.merge!(options[:comment].format_for_update)\n elsif options[:comment].is_a? Hash\n transition.merge!({\"update\" => options[:comment]})\n end\n if options[:fields].is_a? Jiralicious::Issue::Fields\n transition.merge!(options[:fields].format_for_create)\n elsif options[:fields].is_a? Hash\n transition.merge!({\"fields\" => options[:fields]})\n end\n fetch({:method => :post, :parent => parent_name, :parent_key => key, :body => transition})\n end",
"title": ""
},
{
"docid": "301e0036a51004308c272aea650fd3cb",
"score": "0.51534647",
"text": "def get(key)\n return nil if !@actions.has_key?(key)\n @actions[key].call\n end",
"title": ""
},
{
"docid": "12f7d90d928b00e41632e13fae6b6b6f",
"score": "0.51206726",
"text": "def issue(key)\n return nil if Squash::Configuration.jira.disabled?\n\n begin\n client.Issue.find(key)\n rescue ::JIRA::HTTPError\n nil\n end\n end",
"title": ""
},
{
"docid": "80f4bc6c1d8818f959c0b46a7198a425",
"score": "0.5107987",
"text": "def find_by_key_and_id(key, id)\n issueKey_test(key)\n response = fetch({:parent => parent_name, :parent_key => key, :key => id})\n a = new(response)\n a.jira_key = key\n return a\n end",
"title": ""
},
{
"docid": "57c4cd53257f6db071bd1953d4008340",
"score": "0.5105011",
"text": "def issue(key)\n if key.nil? || key.to_s.strip.empty?\n raise ArgumentError.new(\"Issue key is required\")\n end\n json = self.get \"issue/#{key}\"\n if json and (json.empty? or json['errorMessages'])\n raise IssueNotFound.new(\"Issue '#{key}' not found in Jira\")\n else\n return Issue.new(self, json)\n end\n end",
"title": ""
},
{
"docid": "d44f49d067ac3c1331be6e12b66ee8d2",
"score": "0.50768936",
"text": "def retrieve_key(key_id)\n start.uri('/api/key')\n .url_segment(key_id)\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "7bb2459c9f380d097fdcb5c6c166d0fe",
"score": "0.5071608",
"text": "def retrieve_key(key_id)\n start.uri('/api/key')\n .url_segment(key_id)\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "9339a464e9753aed2150adabffa7c2ee",
"score": "0.5040663",
"text": "def set_transition\n @transition = Transition.find(params[:id])\n end",
"title": ""
},
{
"docid": "46949e8504c7db4ec6eda9c4edbc3f96",
"score": "0.50323075",
"text": "def step_by_key key\n @steps.each do |s|\n return s[1] if s[0] == key\n end\n return nil\nend",
"title": ""
},
{
"docid": "1754beb15fb4865501f912210589b16c",
"score": "0.5028164",
"text": "def get(key)\n @client.get(\"key/#{key}\")\n end",
"title": ""
},
{
"docid": "b68fce7001337e874c23c870599a9af3",
"score": "0.5019468",
"text": "def advance\n Jiralicious::Issue::Transitions.go(@key, @next, {})\n end",
"title": ""
},
{
"docid": "60cf084758a488577575caeca5bd76e3",
"score": "0.5016517",
"text": "def get_by_key(organization, key, incoming={})\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('key', key, String)\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))\n }.delete_if { |k, v| v.nil? }\n r = @client.request(\"/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}\").with_query(query).get\n ::Io::Flow::V0::Models::Experience.new(r)\n end",
"title": ""
},
{
"docid": "7ddb923cb9fa7fe3198faaab006487ce",
"score": "0.50151414",
"text": "def getTransitionsFor(alphabetItem)\n @transitions[alphabetItem]\n end",
"title": ""
},
{
"docid": "bb8c9dead2df6f2432babaf510de9121",
"score": "0.49655706",
"text": "def do_transition\n verify_post_request\n require_parameters :issue, :transition\n\n result = Internal.issues.doTransition(params[:issue], params[:transition])\n render_result_issue(result)\n end",
"title": ""
},
{
"docid": "bd89524894268b5681461144deab1272",
"score": "0.49536088",
"text": "def set_transition\n @transition = @workflow.transitions.find(params[:transition_id])\n end",
"title": ""
},
{
"docid": "80ab4e77256a11b3c339e5875b7ff06c",
"score": "0.49252808",
"text": "def set_issue\n @issue = ::Issue.find(params[:id]) unless params[:id].blank?\n @issue = ::Issue.find_by_key(params[:key]) unless params[:key].blank?\n end",
"title": ""
},
{
"docid": "011eb61a0d2bbe1aae7864824e70cfd7",
"score": "0.49126744",
"text": "def get(key, opts = {})\n response = api_execute(key_endpoint + key, :get, params: opts)\n Response.from_http_response(response)\n end",
"title": ""
},
{
"docid": "3dd74e9fc8d6b7e20a9921ebe415c8e3",
"score": "0.49026462",
"text": "def set_key_activity\n @key_activity = KeyActivity.find(params[:id])\n end",
"title": ""
},
{
"docid": "d88acd47dcc2d90e36bd0df275735468",
"score": "0.48895955",
"text": "def get(key)\n self.class.store.get(id, key.to_s)\n end",
"title": ""
},
{
"docid": "c8f6e5ed0d78452b156595e1c5480643",
"score": "0.48888978",
"text": "def dump_transitions(issue)\n issue = @client.Issue.find(issue)\n available_transitions = @client.Transition.all(issue: issue)\n available_transitions.each { |ea| puts \"#{ea.name} (id #{ea.id})\" }\n end",
"title": ""
},
{
"docid": "68132601c732aff930032527b6ceec4b",
"score": "0.48740605",
"text": "def workflow\n @issue.send(params[:transition]) if @issue.state_transitions.any? { |x| x.event == params[:transition].to_sym }\n\n respond_with @issue do |format|\n format.html { redirect_to show_path }\n end\n end",
"title": ""
},
{
"docid": "d6daf5db94221c916e66df2e217b9147",
"score": "0.48612207",
"text": "def get(key)\n from_record(@table[key])\n end",
"title": ""
},
{
"docid": "5c24f684f6096b0583963581751b8e70",
"score": "0.4853857",
"text": "def get(key)\n @model.first(@model.key.first.name => key)\n end",
"title": ""
},
{
"docid": "f0e1ff512607336e1eb9cc1522c1c652",
"score": "0.48145536",
"text": "def get_rule(key)\n\n results = @rules.select { |r| r[:key] == key }\n if !results.empty?\n results[0][:instance]\n else\n raise ValidationProfiler::Exceptions::ValidationRuleNotFound.new(key)\n end\n end",
"title": ""
},
{
"docid": "bad7c332a225965ff20e3b98e16c0e06",
"score": "0.47863248",
"text": "def find(key)\n $tracer.trace(\"\\tAction: #{__method__}(\\\"#{key}\\\")\")\n if @item_h.has_key?(key)\n return GameStopRecomConditionPanelTab.new(ToolTag.new(@tag.find.td.className(create_ats_regex_string(\"ats-rcm-tab\")).at(@item_h[key].to_i), format_method(__method__), @browser))\n else\n raise Exception.new(\"key, #{key} not found in menu list\")\n end\n end",
"title": ""
},
{
"docid": "370555e00899ff7a05b9c24de9e1a33a",
"score": "0.47629082",
"text": "def [](key)\n actions[key]\n end",
"title": ""
},
{
"docid": "a2950c790760b663c143659268d0f195",
"score": "0.47616398",
"text": "def find_transition(event, target=nil, *args)\n target ||= args.last[:to].to_sym rescue nil\n query = transitions.for_event(event).to(target).with(*args)\n query.find || query.valid.singular || nil\n end",
"title": ""
},
{
"docid": "c0ef575df1071cc7c740b047a03c4c00",
"score": "0.4761452",
"text": "def call(state, input)\n @transitions.fetch([state, input])\n rescue KeyError\n raise TransitionError.new(state, input)\n end",
"title": ""
},
{
"docid": "edc9c3356fbe5bafec6526aaf356c1e6",
"score": "0.4755317",
"text": "def fetch(key, id)\n retrieve(key, id).one!\n end",
"title": ""
},
{
"docid": "8977a18d17f90c78da5b4dfbaf0170d2",
"score": "0.47539613",
"text": "def fetch(key_id)\n @keys.fetch(key_id)\n end",
"title": ""
},
{
"docid": "8977a18d17f90c78da5b4dfbaf0170d2",
"score": "0.47539613",
"text": "def fetch(key_id)\n @keys.fetch(key_id)\n end",
"title": ""
},
{
"docid": "e9f18a407e2c38feb0822b2cea3e1e1b",
"score": "0.47509784",
"text": "def find(key)\n $tracer.trace(\"\\tAction: #{__method__}(\\\"#{key}\\\")\")\n item = find_key(key)\n if item.nil?\n raise Exception.new(\"key, #{key} not found in list\")\n end\n\n return item\n end",
"title": ""
},
{
"docid": "e9f18a407e2c38feb0822b2cea3e1e1b",
"score": "0.47509784",
"text": "def find(key)\n $tracer.trace(\"\\tAction: #{__method__}(\\\"#{key}\\\")\")\n item = find_key(key)\n if item.nil?\n raise Exception.new(\"key, #{key} not found in list\")\n end\n\n return item\n end",
"title": ""
},
{
"docid": "5f88d0028be3cf7bf660d0fcc3c092de",
"score": "0.47480035",
"text": "def get(key)\n self.class.client.get(key)\n end",
"title": ""
},
{
"docid": "8bc7bf90a1af3e8af0dc2fbe5bf54ca5",
"score": "0.47314247",
"text": "def get_state_by_key_with_http_info(project_key, key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.get_state_by_key ...'\n end\n # verify the required parameter 'project_key' is set\n if @api_client.config.client_side_validation && project_key.nil?\n fail ArgumentError, \"Missing the required parameter 'project_key' when calling DefaultApi.get_state_by_key\"\n end\n # verify the required parameter 'key' is set\n if @api_client.config.client_side_validation && key.nil?\n fail ArgumentError, \"Missing the required parameter 'key' when calling DefaultApi.get_state_by_key\"\n end\n # resource path\n local_var_path = '/{projectKey}/states/key={key}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'State'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['oauth_2_0']\n\n new_options = opts.merge(\n :operation => :\"DefaultApi.get_state_by_key\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#get_state_by_key\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0bbecb585b26e1e01156bec2d82402b2",
"score": "0.4726806",
"text": "def get_key(key, opts= {})\n raise ArgumentError unless key.is_a? String\n c = @client[\"#{@user_path}/keys/#{key}\"]\n headers = gen_headers(opts)\n attempt(opts[:attempts]) do\n do_get(c, headers)\n end\n end",
"title": ""
},
{
"docid": "b816386ebd75482ec09e400349cf569a",
"score": "0.47258443",
"text": "def get(key)\n klass.send :from_hash, self[key].merge(klass.id_method => key)\n end",
"title": ""
},
{
"docid": "26ecad71e603fcbb13644b3f19ac2ee4",
"score": "0.4721953",
"text": "def [](key)\n Nanoc::NotificationCenter.post(:visit_started, resolve)\n Nanoc::NotificationCenter.post(:visit_ended, resolve)\n\n resolve.attributes[key]\n end",
"title": ""
},
{
"docid": "0dd44fc732ffbbe6c7d7069efc6f0e3c",
"score": "0.4719553",
"text": "def get_by_key(organization, key)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('key', key, String)\n r = @client.request(\"/#{CGI.escape(organization)}/item-functions/#{CGI.escape(key)}\").get\n ::Io::Flow::V0::Models::ItemFunction.new(r)\n end",
"title": ""
},
{
"docid": "4497a94c77fdd19101889ec0e61f975d",
"score": "0.47191137",
"text": "def get(key, args={})\n @http.get(make_url(key))\n end",
"title": ""
},
{
"docid": "9ef55c65568a9d2db0f4523d3a408ab2",
"score": "0.4693963",
"text": "def get(key, headers={})\n key = Key.create(self, key.to_s) unless key.is_a?(Key)\n key.get(headers)\n end",
"title": ""
},
{
"docid": "82a9d590f072d1b2992219db8d424613",
"score": "0.4693497",
"text": "def key_transition(attribute, value, duration)\n @key_transition ||= {}\n if @key_transition.key?(attribute)\n remove_transition(@key_transition[attribute])\n end\n key = attribute\n t = @key_transition[key] = transition(attribute, value, duration)\n t.key = key\n t\n end",
"title": ""
},
{
"docid": "15a6a73989df4c4d94a6182c2abf1aba",
"score": "0.46928412",
"text": "def get(key)\n\t\t\t\t\tcall('GET', key)\n\t\t\t\tend",
"title": ""
},
{
"docid": "ccf25988b8bc6da360f405b909d1fed9",
"score": "0.46802354",
"text": "def get(key)\n return nil unless @actions.has_key?(key)\n return @results_cache[key] if @results_cache.has_key?(key)\n @results_cache[key] = @actions[key].call\n end",
"title": ""
},
{
"docid": "e2c839eb0e874aada71df289c6f11be5",
"score": "0.46744782",
"text": "def get(key, opts={})\n response = api_execute(key_endpoint + key, :get, params:opts)\n json2obj(response)\n end",
"title": ""
},
{
"docid": "2afa39e1b42fa62c1e98344081596550",
"score": "0.4670779",
"text": "def transition(state, event)\n transitions_for_event = @transitions_for[event]\n unless transitions_for_event\n raise InvalidEvent.new(\"invalid event\", event, state)\n end\n transitions_for_event[state]\n end",
"title": ""
},
{
"docid": "efb4b0531a6da5feba50af58022d2f18",
"score": "0.4658757",
"text": "def get_by_key(key)\n HttpClient::Preconditions.assert_class('key', key, String)\n r = @client.request(\"/trade/agreements/#{CGI.escape(key)}\").get\n ::Io::Flow::V0::Models::TradeAgreement.new(r)\n end",
"title": ""
},
{
"docid": "55cf23a2369a86d4f79c44fd4568a223",
"score": "0.46338364",
"text": "def trigger_with_key(key)\n triggers = self.triggers.select { |trigger| trigger.key.downcase == key.downcase }\n if triggers.empty?\n return nil\n else\n triggers[0]\n end\n end",
"title": ""
},
{
"docid": "5fa065cf425c68927276de26babb90b2",
"score": "0.46301198",
"text": "def get(key)\n raise('Catastrophic failure for get')\n end",
"title": ""
},
{
"docid": "9bb8bf90d679fe3ddfe2da0f2b94e6a1",
"score": "0.46286216",
"text": "def find_key(key)\n if @item_h.has_key?(key)\n #return ToolTag.new(@tag.find.a.id(\"/OrderID$/\").at(@item_h[key].to_i).parent(\"tr\"), format_method(__method__))\n return self.at(@item_h[key].to_i)\n else\n # not finding the order is valid, return nil\n return nil\n end\n end",
"title": ""
},
{
"docid": "aa0a5db6d474c99b5b5c17654045c99e",
"score": "0.4613876",
"text": "def get_by_key(organization, key)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('key', key, String)\n r = @client.request(\"/#{CGI.escape(organization)}/duty/item/producers/#{CGI.escape(key)}\").get\n ::Io::Flow::V0::Models::DutyItemProducer.new(r)\n end",
"title": ""
},
{
"docid": "b68653116fe8a83731b02e6505768814",
"score": "0.46118936",
"text": "def get(key)\n status, body = do_rest(\"GET\", key, nil)\n\n case status\n when 200\n body\n when 404\n nil\n end\n end",
"title": ""
},
{
"docid": "b8469d312ed8eddd5fee2288823cbe6f",
"score": "0.46034023",
"text": "def get(key, params={})\n entry = nil\n begin\n entry = _get(key, params)\n rescue KeyDeletedError\n raise KeyNotFoundError\n end\n\n entry\n end",
"title": ""
},
{
"docid": "1987d0a06d401f8d6aa64cbd377b14ed",
"score": "0.46012935",
"text": "def get(key)\n raise BadKey.new(key) unless key =~ VALID_KEY\n value = nil\n\n @sources.each do |s|\n value = s.get(key)\n break unless value.nil?\n end\n\n value\n end",
"title": ""
},
{
"docid": "b1ed3a282f106c7b3cf81e775182e927",
"score": "0.45974803",
"text": "def get_transitions(transitions_url)\n Jiralicious.session.request(:get, transitions_url, :handler => handler)\n end",
"title": ""
},
{
"docid": "e4a6dda75c775cf1d4d489ae67759f04",
"score": "0.459502",
"text": "def get_clone_by_key_and_id(organization, key, id)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('key', key, String)\n HttpClient::Preconditions.assert_class('id', id, String)\n r = @client.request(\"/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/clone/#{CGI.escape(id)}\").get\n ::Io::Flow::V0::Models::ExperienceClone.new(r)\n end",
"title": ""
},
{
"docid": "65fd9bd6d651878a9ee48f23234ba986",
"score": "0.45947954",
"text": "def get(key)\n @connection.get key.to_s\n end",
"title": ""
},
{
"docid": "bf239bbe8a27e631b4cc0faec487e129",
"score": "0.45809686",
"text": "def key_show(project_id, id, params)\n path = sprintf(\"/api/v2/projects/%s/keys/%s\", project_id, id)\n data_hash = {}\n post_body = nil\n \n if params.present?\n unless params.kind_of?(PhraseApp::RequestParams::KeyShowParams)\n raise PhraseApp::ParamsHelpers::ParamsError.new(\"Expects params to be kind_of PhraseApp::RequestParams::KeyShowParams\")\n end\n end\n \n data_hash = params.to_h\n err = params.validate\n if err != nil\n return nil, err\n end\n reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)\n rc, err = PhraseApp.send_request(@credentials, \"GET\", path, reqHelper.ctype, reqHelper.body, 200)\n if err != nil\n return nil, err\n end\n \n return PhraseApp::ResponseObjects::TranslationKeyDetails.new(JSON.load(rc.body)), err\n end",
"title": ""
},
{
"docid": "1337619cc1fce801fdb9c06b804daebb",
"score": "0.45629665",
"text": "def key(project_id, key_id, params = {})\n c_r Lokalise::Resources::Key, :find, [project_id, key_id], params\n end",
"title": ""
},
{
"docid": "22bbd5e1edfc15b221a55de0b518d9ba",
"score": "0.4560587",
"text": "def get_by_key(organization, key)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('key', key, String)\n r = @client.request(\"/#{CGI.escape(organization)}/virtual/cards/#{CGI.escape(key)}\").get\n ::Io::Flow::V0::Models::VirtualCard.new(r)\n end",
"title": ""
},
{
"docid": "3764f21324e8ec151b5d9f345ad11172",
"score": "0.45595762",
"text": "def get key\n clean_cache!\n @hash[key][1]\n end",
"title": ""
},
{
"docid": "d8f3250119eddaca54bcce6d8b2607d2",
"score": "0.45455998",
"text": "def [](key)\n if key.kind_of?(Integer)\n result = @org_activities[key]\n else\n result = @org_activities[0] if key == \"Deployment\"\n result = @org_activities[1] if key == \"Employment-Defensive\"\n result = @org_activities[2] if key == \"Employment-Offensive\"\n result = @org_activities[3] if key == \"Stand-Down\"\n end\n return result\n end",
"title": ""
},
{
"docid": "5521b46f67f45823faf9ca9e85950d3c",
"score": "0.45097646",
"text": "def change_for(key)\n Change.new(\n current: @current.fetch(key),\n previous: @previous.fetch(key),\n ).freeze\n end",
"title": ""
},
{
"docid": "e0b20d174f8f2f8b50dd89dbefecf8d3",
"score": "0.45087016",
"text": "def get_payment_by_key(project_key, key, opts = {})\n data, _status_code, _headers = get_payment_by_key_with_http_info(project_key, key, opts)\n data\n end",
"title": ""
},
{
"docid": "7262794e23610c8bca00cf73ef7b0c48",
"score": "0.45049235",
"text": "def retrieve_workflow(id)\n @url = \"#{@url}/#{id}\"\n retrieve_resource\n end",
"title": ""
},
{
"docid": "6d5ecf4698cb76e33aaaed95ac2b4aae",
"score": "0.45022652",
"text": "def get_by_id(key)\n search(key).to_s\n end",
"title": ""
},
{
"docid": "29dedd31078a38b333ce374cf281c3ff",
"score": "0.44971913",
"text": "def get_change(change_id)\n\n # AWS methods return change_ids that looks like '/change/id'. Let the caller either use \n # that form or just the actual id (which is what this request needs)\n change_id = change_id.sub('/change/', '')\n\n request({\n :expects => 200,\n :parser => Fog::Parsers::DNS::AWS::GetChange.new,\n :method => 'GET',\n :path => \"change/#{change_id}\"\n })\n\n end",
"title": ""
},
{
"docid": "18a04ade8d43f4428fc26a80210319b2",
"score": "0.44963074",
"text": "def get(key)\n @path[key.to_sym]\n end",
"title": ""
},
{
"docid": "6f6e136317295a36987b1326bbed730f",
"score": "0.44910923",
"text": "def fetch(key)\n @mutex.synchronize do\n do_fetch(key)\n end\n end",
"title": ""
},
{
"docid": "5f76cb5427d6cddbdf5e7b37ad050c8a",
"score": "0.44903463",
"text": "def get_change(change_id)\n # AWS methods return change_ids that looks like '/change/id'. Let the caller either use\n # that form or just the actual id (which is what this request needs)\n change_id = change_id.sub('/change/', '')\n\n request({\n :expects => 200,\n :parser => Fog::Parsers::AWS::DNS::GetChange.new,\n :method => 'GET',\n :path => \"change/#{change_id}\"\n })\n end",
"title": ""
},
{
"docid": "81e529baf60a8dcd1dacb0dc55122d0e",
"score": "0.44887978",
"text": "def get_change(change_id)\n # AWS methods return change_ids that looks like '/change/id'. Let the caller either use\n # that form or just the actual id (which is what this request needs)\n change_id = change_id.sub('/change/', '')\n\n request({\n :expects => 200,\n :parser => Fog::Parsers::DNS::AWS::GetChange.new,\n :method => 'GET',\n :path => \"change/#{change_id}\"\n })\n end",
"title": ""
},
{
"docid": "f798de4346c7e34d69b2c0281a870ea7",
"score": "0.44706666",
"text": "def match(key)\n return key, fetch(key) {\n raise AmbiguousArgument, catch(:ambiguous) {return complete(key)}\n }\n end",
"title": ""
},
{
"docid": "b32c3cce7bd11bc764d6a086a4f76732",
"score": "0.44704494",
"text": "def get_flow_param_key(key)\n JSON.parse(self.flow_params || '{}')[key]\n end",
"title": ""
},
{
"docid": "b32c3cce7bd11bc764d6a086a4f76732",
"score": "0.44704494",
"text": "def get_flow_param_key(key)\n JSON.parse(self.flow_params || '{}')[key]\n end",
"title": ""
},
{
"docid": "9c8731676715cddd3c94b9fe49f48331",
"score": "0.4467471",
"text": "def get_from conn, key, params = { }\n res = conn.get do | req |\n req.headers['x-api-key'] = key\n req.params = params\n end\n JSON.parse res.body\n end",
"title": ""
},
{
"docid": "a9068e3f0aaa5cdb7768a3e88142bf4d",
"score": "0.44568804",
"text": "def get(key)\n find_by_keys([key]).first\n end",
"title": ""
},
{
"docid": "a9068e3f0aaa5cdb7768a3e88142bf4d",
"score": "0.44568804",
"text": "def get(key)\n find_by_keys([key]).first\n end",
"title": ""
}
] |
576509eb3fad91524bfca7b3cf33888e
|
POST /commodities POST /commodities.json
|
[
{
"docid": "fc3ca020a2a3f74613ea7a03e52df72f",
"score": "0.61792195",
"text": "def create\n @commodity = Commodity.new(commodity_params) \n @commodity.created_by = current_user.id\n respond_to do |format|\n if @commodity.save\n format.html { redirect_to @commodity, notice: 'Commodity was successfully created.' }\n format.json { render :show, status: :created, location: @commodity }\n else\n format.html { render :new }\n format.json { render json: @commodity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "bb8ddac5640cd520694f5a65880045bf",
"score": "0.6726653",
"text": "def commodity_params\n params.require(:commodity).permit(:title, :user_id, :status, :commodity_number, :orders_count, :comments_count)\n end",
"title": ""
},
{
"docid": "53cab50c767ecf46085db813783b11c3",
"score": "0.6635235",
"text": "def commodity_params\n params.require(:commodity).permit(:name, :price)\n end",
"title": ""
},
{
"docid": "ac28114609fba439fa28891bba1207b7",
"score": "0.66254324",
"text": "def create\n @commodoty = Commodoty.new(commodoty_params)\n\n respond_to do |format|\n if @commodoty.save\n format.html { redirect_to @commodoty, notice: 'Commodoty was successfully created.' }\n format.json { render :show, status: :created, location: @commodoty }\n else\n format.html { render :new }\n format.json { render json: @commodoty.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "24d5b8c1dd7d496b3377a1bcc571f3d5",
"score": "0.65590435",
"text": "def commodity_params\n params.require(:commodity).permit(:name, :name_am, :long_name, :code, :code_am, :description, :hazardous, :cold_storage, :min_temperature, :max_temperature, :commodity_category_id, :uom_category_id)\n end",
"title": ""
},
{
"docid": "97e39be3415d45862b40d2b9c539e18d",
"score": "0.6555788",
"text": "def create\n @commodity = Commodity.new(params[:commodity])\n @commodity.set_jan\n @ingredients = Ingredient.all\n\n respond_to do |format|\n if @commodity.save\n format.html { redirect_to @commodity, notice: 'Commodity was successfully created.' }\n format.json { render json: @commodity, status: :created, location: @commodity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @commodity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c25b4e64023051b5a9846d9ad9431c53",
"score": "0.6538637",
"text": "def index\n @commodities = PlanetaryCommodity.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @commodities }\n end\n end",
"title": ""
},
{
"docid": "5b188daa57d969bbf959fd4cc4e357c1",
"score": "0.6504059",
"text": "def add_commodity(commodity)\n @commodities[commodity.name] = commodity\n end",
"title": ""
},
{
"docid": "4b7ab4170ae19dbf877979b63ff5f69e",
"score": "0.6366819",
"text": "def commodity_params\n params[:commodity].permit!\n end",
"title": ""
},
{
"docid": "b0b868192748c46f5f6a883d41908e0b",
"score": "0.6311525",
"text": "def create\n #@commodity = Commodity.new(commodity_params)\n respond_to do |format|\n if @commodity.save\n format.html { redirect_to @commodity, notice: I18n.t('controller.create_success_notice', model: '商品') }\n format.json { render action: 'show', status: :created, location: @commodity }\n else\n format.html { render action: 'new' }\n format.json { render json: @commodity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c35c6fd7dcfa5338ccda333d8f5d5a7b",
"score": "0.6237773",
"text": "def index\n @commodities = Commodity.all\n end",
"title": ""
},
{
"docid": "c904560961173669f922b70bc9de5bda",
"score": "0.6208199",
"text": "def new\n @commodity = Commodity.new\n @ingredients = Ingredient.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @commodity }\n end\n end",
"title": ""
},
{
"docid": "5e69c549eb5499aa4becbac8af6ff0b7",
"score": "0.6201697",
"text": "def commodity_create_params\n params.require(:fixed_assets_commodity).permit(\n :name,\n :description\n )\n end",
"title": ""
},
{
"docid": "a3bbb33920c503ac481e334eb252dd90",
"score": "0.6142073",
"text": "def commodoty_params\n params.require(:commodoty).permit(:name, :description, :cost, :price, :quantity, :quantitySold)\n end",
"title": ""
},
{
"docid": "a9aa5343b55fbbd8d5fdd518b17e2030",
"score": "0.6127872",
"text": "def commodity_params\n\t\tparams.require(:commodity).permit(:name, :description, :price, :image_url, :category, :year, :winner)\n\tend",
"title": ""
},
{
"docid": "9069f2af4a07bbbe3b62c6ee3df4319d",
"score": "0.6085057",
"text": "def update\n\t\t#@commodity = Commodity.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @commodity.update(commodity_params)\n\t\t\t\tSKEPTICS.write_commodities_to_json\n\t\t\t\tformat.html { redirect_to @commodity, notice: 'Commodity was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @commodity.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7070a916c1313081720c2d9a10362fd2",
"score": "0.6078814",
"text": "def commodity_item_params\n params.require(:commodity_item).permit(:gross, :tare, :price, :total, :commodity_id, :transaction_id)\n end",
"title": ""
},
{
"docid": "b1fc68fb9c008864d866406c259a7641",
"score": "0.5953581",
"text": "def commodity_params\n params.require(:fixed_assets_commodity).permit(\n :name,\n :description,\n :amount,\n :activated_at,\n :planned_depreciation_type,\n :planned_depreciation_amount,\n :btl_depreciation_type,\n :btl_depreciation_amount,\n :cost_centre,\n :target,\n :project,\n :previous_btl_depreciations,\n :transferred_procurement_amount\n )\n end",
"title": ""
},
{
"docid": "01ce76995a3b6e1f8992f14eb65a55ff",
"score": "0.5939506",
"text": "def set_commodity\n @commodity = Commodity.find(params[:id])\n end",
"title": ""
},
{
"docid": "01ce76995a3b6e1f8992f14eb65a55ff",
"score": "0.5939506",
"text": "def set_commodity\n @commodity = Commodity.find(params[:id])\n end",
"title": ""
},
{
"docid": "01ce76995a3b6e1f8992f14eb65a55ff",
"score": "0.5939506",
"text": "def set_commodity\n @commodity = Commodity.find(params[:id])\n end",
"title": ""
},
{
"docid": "fa731b3a1694f9f79df5880976420530",
"score": "0.59354365",
"text": "def create\n @commodity_type = CommodityType.new(commodity_type_params)\n\n respond_to do |format|\n if @commodity_type.save\n format.html { redirect_to commodity_types_url, flash: {success: '操作成功.' } }\n format.json { render :show, status: :created, location: @commodity_type }\n else\n format.html { render :new }\n format.json { render json: @commodity_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "737a7fe42ceed532161251ebd0368827",
"score": "0.5802212",
"text": "def index\n @commodoties = Commodoty.all\n end",
"title": ""
},
{
"docid": "829a11ae6462f25bf3e80a8dbdad67b1",
"score": "0.57841957",
"text": "def commodity_type_params\n params.require(:commodity_type).permit(:name)\n end",
"title": ""
},
{
"docid": "ff411b6fbf86af1728163428232a4051",
"score": "0.57809293",
"text": "def set_commodity\n\t\t@commodity = Commodity.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "63dc7663332383f54a31f8d5f4a6cc37",
"score": "0.5763134",
"text": "def create\n @company_params = company_params.to_json\n @reponse = HTTParty.post(\"https://rails-api-ipo.herokuapp.com/api/v1/companies.json\",\n :body => @company_params,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/companies/'+(@reponse['id'].to_s), notice: 'Company was successfully created.' }\n end\n end",
"title": ""
},
{
"docid": "5657b6de387a41f4665f178319946a3b",
"score": "0.56973714",
"text": "def create\n oppurtunity = Oppurtunity.create(opp_params)\n render json: oppurtunity,status: 201\n end",
"title": ""
},
{
"docid": "7202c7afeabf6e0c1715edf1f5ed921b",
"score": "0.56690323",
"text": "def create\n #Add dorms hash to accomodation hash\n params[:accommodation].merge!(params[:dorms_hash])\n \n @accommodation = Accommodation.new(params[:accommodation])\n\n respond_to do |format|\n if @accommodation.save\n format.html { redirect_to @accommodation, notice: 'Accommodation was successfully created.' }\n format.json { render json: @accommodation, status: :created, location: @accommodation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @accommodation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9a5974b423646fb445db630f65f3206",
"score": "0.56020874",
"text": "def create\n @commodity_category = CommodityCategory.new(commodity_category_params)\n @commodity_category.created_by = current_user.id\n\n respond_to do |format|\n if @commodity_category.save\n format.html { redirect_to commodity_categories_path, notice: 'Commodity category was successfully created.' }\n format.json { render :show, status: :created, location: @commodity_category }\n else\n format.html { render :new }\n format.json { render json: @commodity_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c663be6ff658f208d98f163379ac7e0",
"score": "0.56017727",
"text": "def commodity_category_params\n params.require(:commodity_category).permit(:name, :code, :code_am, :uom_category_id, :description)\n end",
"title": ""
},
{
"docid": "89e5a9e069f7fb0df2793540791f0f5c",
"score": "0.55943143",
"text": "def create\n costs = Potion.compute_production_costs(params[\"ingredients\"])\n \n potion_params[\"production_cost\"] = costs\n \n @potion = Potion.new(name: potion_params[\"name\"], description: potion_params[\"description\"], production_cost: costs)\n \n respond_to do |format|\n if @potion.save\n Potion.save_ingredients(params[\"ingredients\"], @potion.id)\n format.html { redirect_to @potion, notice: 'Potion was successfully created.' }\n format.json { render :show, status: :created, location: @potion }\n else\n format.html { render :new }\n format.json { render json: @potion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5dcd6b47263dc44f4bc4a587021d105",
"score": "0.5592171",
"text": "def index\n# @commodity_items = CommodityItem.all\n @commodity_items = current_company.commodity_items\n end",
"title": ""
},
{
"docid": "569ab31dec785316baef32de43f510dd",
"score": "0.5591295",
"text": "def index\n if !params[:code].blank?\n specifications = Specification.accessible_by(current_ability).where([\"sixnine_code = ? or sku = ?\", params[:code], params[:code]])\n cid = []\n specifications.each do |s|\n cid << s.commodity.id\n end\n @commodities = Commodity.where(id: cid)\n end\n @commodities = initialize_grid(@commodities,\n :order => 'commodities.id',\n :order_direction => 'desc')\n @commodities.with_resultset do |comm|\n @@comm_export = comm\n end\n end",
"title": ""
},
{
"docid": "6dbf9c7f222171b08aa0c3fd2f0edbcc",
"score": "0.5576617",
"text": "def index\n @commodity_types = CommodityType.all\n end",
"title": ""
},
{
"docid": "1603c876b998453c75a62ad466980e00",
"score": "0.55627555",
"text": "def create\n @company = Company.new(params[:company])\n @treatments = Treatment.all\n \n usuarioLogueado = User.find(session[:user_id])\n unless usuarioLogueado.admin == true #si es un admin el que esta creando empresas, no tiene sentido que figure como manager\n @company.user_id = usuarioLogueado.id \n end\n \n @localities = Locality.all\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, :notice => 'Company was successfully created.' }\n format.json { render :json => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38742179153bacd1f036b4a9ccbcd833",
"score": "0.55612046",
"text": "def get_commodity(commodity_name)\n @commodities[commodity_name]\n end",
"title": ""
},
{
"docid": "99bd1f959518eb9a3631ec67ad5e3fcb",
"score": "0.5549227",
"text": "def commodities\n @commodities.values\n end",
"title": ""
},
{
"docid": "abf10a78816214be355a3076d6ade4ed",
"score": "0.55179703",
"text": "def create\n @commodity = Commodity.find(params[:commodity_id])\n @order = Order.new(params[\"order\"[\"price\"]])\n @order.user = current_user\n @order.name = Time.now.to_i\n @order.price = @commodity.price\n @order.state = 0\n\n respond_to do |format|\n if @order.save\n alert = Alert.new\n alert.commodity = @commodity\n alert.user = @commodity.user\n alert.info = \"#{current_user.profile.name}が商品を買いたいです\"\n alert.user.havemessage = 1\n alert.user.save\n alert.save\n\n @commodity.orders << @order\n @commodity.save\n format.html { redirect_to @order, notice: 'Order was successfully created.' }\n format.json { render json: @order, status: :created, location: @order }\n format.js\n else\n format.html { render action: \"new\" }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d098eba20896a1c4f1e71f5d5e96241f",
"score": "0.5510314",
"text": "def index\n @commodities = PlanetaryCommodity.find(:all, :conditions => ['tier > 0'])\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @schematics }\n end\n end",
"title": ""
},
{
"docid": "c50f597a362236c0a52309565af1c7d9",
"score": "0.55103093",
"text": "def create\n @equipment = Equipment.new(equipment_params)\n\n if @equipment.save\n render json: @equipment, status: :created, location: @equipment\n else\n render json: @equipment.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6045f95aa52622a85bf53e12018d3dee",
"score": "0.5508885",
"text": "def create\n \n @pagetitle = \"Nuevo inventario \"\n @action_txt = \"Create\"\n \n \n @inventory = Inventory.new(inventory_params)\n \n @company = Company.find(params[:inventory][:company_id])\n \n @locations = @company.get_locations()\n @divisions = @company.get_divisions() \n \n \n respond_to do |format|\n if @inventory.save\n format.html { redirect_to @inventory, notice: 'Inventory was successfully created.' }\n format.json { render :show, status: :created, location: @inventory }\n else\n format.html { render :new }\n format.json { render json: @inventory.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c04b1576b4f147b6347dcb80c45297b",
"score": "0.54848325",
"text": "def create\n @opportunity = Opportunity.find(params[:opportunity_id])\n @equipment = @opportunity.equipment.create(equipment_params)\n\n unless @equipment.equipment_type.blank?\n @equipment.name = @equipment.equipment_type.name\n @equipment.fuel_per_hour = @equipment.equipment_type.fuel_per_hour\n @equipment.conversion_cost = @equipment.equipment_type.conversion_cost\n @equipment.propane_factor = @equipment.equipment_type.propane_factor\n @equipment.save\n end\n\n\n respond_to do |format|\n if @opportunity.update_attributes(params[:opportunity])\n format.html { redirect_to opportunity_path(@opportunity), notice: 'Vehicle group was added.' }\n format.json { render action: 'show', status: :created, location: @equipment }\n else\n format.html { render :action => 'new', alert: 'Status: all fields are required.' }\n format.json { render json: @equipment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "517ca4376ed8677645d8bce3121e06b9",
"score": "0.5473516",
"text": "def destroy\n @commodity.destroy\n respond_to do |format|\n format.html { redirect_to commodities_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a342c784a1bce30e6b4beca0c7f4799b",
"score": "0.546883",
"text": "def create\n params[:inventory].each do |p|\n Inventory.create(amount: p[:amount].to_d, user_id: p[:user_id].to_i, product_id: p[:product_id].to_i, number: p[:number].to_i)\n end\n respond_to do |format|\n format.html { redirect_to inventories_path, notice: 'Inventory was successfully created.' }\n format.json { render :show, status: :created, location: @inventory }\n end\n end",
"title": ""
},
{
"docid": "e0cf3903cb04a8e9276e540c7a8c9010",
"score": "0.5463377",
"text": "def create\n @accommodation = Accommodation.new(accommodation_params)\n\n respond_to do |format|\n if @accommodation.save\n format.html { redirect_to @accommodation, notice: 'Accommodation was successfully created.' }\n format.json { render :show, status: :created, location: @accommodation }\n else\n format.html { render :new }\n format.json { render json: @accommodation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0cf3903cb04a8e9276e540c7a8c9010",
"score": "0.5463377",
"text": "def create\n @accommodation = Accommodation.new(accommodation_params)\n\n respond_to do |format|\n if @accommodation.save\n format.html { redirect_to @accommodation, notice: 'Accommodation was successfully created.' }\n format.json { render :show, status: :created, location: @accommodation }\n else\n format.html { render :new }\n format.json { render json: @accommodation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a45fb7b6357e425e42eefd1d028b222f",
"score": "0.54632235",
"text": "def create\n @commodity_item = CommodityItem.new(commodity_item_params)\n\n respond_to do |format|\n if @commodity_item.save\n# CommodityItemsChannel.broadcast(@commodity_item)\n format.html { redirect_to edit_transaction_path(@commodity_item.txn), notice: 'Commodity item was successfully created.' }\n format.json { render :show, status: :created, location: @commodity_item }\n else\n format.html { render :new }\n format.json { render json: @commodity_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb115ed5d8e56778f14f07d95a882d66",
"score": "0.5437832",
"text": "def commission_params\n params.require(:commission).permit(:name, :price)\n end",
"title": ""
},
{
"docid": "30645257df552c97dddd352ef6c14ce7",
"score": "0.54376364",
"text": "def destroy\n @commodity = Commodity.find(params[:id])\n @commodity.destroy\n\n respond_to do |format|\n format.html { redirect_to commodities_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "098861aa7b00d7a03148a3a8a91b64cc",
"score": "0.5416469",
"text": "def set_commodity_item\n @commodity_item = CommodityItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "40ed451e52adbfe19b22fcbece6b8078",
"score": "0.5413969",
"text": "def create\n @carpool = Carpool.new(params[:carpool])\n\n respond_to do |format|\n if @carpool.save\n format.html { redirect_to @carpool, notice: 'Carpool was successfully created.' }\n format.json { render json: @carpool, status: :created, location: @carpool }\n else\n format.html { render action: \"new\" }\n format.json { render json: @carpool.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c3e19f3a69f83e05204c27e9e13a8263",
"score": "0.5398815",
"text": "def new\n @position = Position.new\n 1.times { @position.competencies.build }\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @position }\n end\n end",
"title": ""
},
{
"docid": "1c216b6eaab5afba4257a0ea8e3ee27f",
"score": "0.5390931",
"text": "def index\n @commodity_categories = CommodityCategory.all\n end",
"title": ""
},
{
"docid": "f0e8e382f1739427b6089276f8dd5b52",
"score": "0.53845155",
"text": "def create\n @opcional = Opcional.new(opcional_params)\n\n respond_to do |format|\n if @opcional.save\n format.html { redirect_to @opcional, notice: 'Opcional was successfully created.' }\n format.json { render :show, status: :created, location: @opcional }\n else\n format.html { render :new }\n format.json { render json: @opcional.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb542d84a7304734c8a19802c815636f",
"score": "0.5370558",
"text": "def create\n @recipy = Recipy.new(recipy_params)\n\n params[:recipy][:ingredients].each do |e|\n @ingredient = Ingredient.find_by name: e\n if @ingredient.nil?\n render json: {status: 'Ingredient not found'}, status: :unprocessable_entity\n return\n else\n @recipy.ingredients << @ingredient\n end\n end\n\n params[:recipy][:categories].each do |e|\n @category = Category.find_by name: e\n if @category.nil?\n render json: {status: 'Category not found'}, status: :unprocessable_entity\n return\n else\n @recipy.categories << @category\n end\n end\n\n @recipy.user = current_user\n\n if @recipy.save\n render :show, status: :ok, location: @recipy\n else\n render json: @recipy.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ba8e67048804bdf832261e78aabb42f9",
"score": "0.537051",
"text": "def create_companies(model) path = \"/api/v2/companies\"\n post(path, model, {}, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "e7782d6797c5a3901c255eb92cb96f0d",
"score": "0.53678924",
"text": "def create\n @opportunity = current_company.opportunities.new(params[:opportunity])\n\n respond_to do |format|\n if @opportunity.save\n format.html { redirect_to @opportunity, notice: 'Opportunity was successfully created.' }\n format.json { render json: @opportunity, status: :created, location: @opportunity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @opportunity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fdca2cbd8b8daff48b6b548a599003cc",
"score": "0.5344952",
"text": "def update\n @commodity = Commodity.find(params[:id])\n\n respond_to do |format|\n if @commodity.update_attributes(params[:commodity])\n format.html { redirect_to @commodity, notice: 'Commodity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @commodity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aad94f1295b93668fa10f76fa8f2020d",
"score": "0.5333968",
"text": "def create\n # @order = Order.find(params[:order_id].to_i)\n # @order_detail.order = @order\n # binding.pry\n @commodity = Commodity.find(params[:commodity_id].to_i)\n @order_detail.commodity = @commodity\n @order_detail.at_unit = current_user.unit\n @order_detail.status = \"waiting\"\n @order_detail.cost_price = @commodity.try :cost_price\n \n respond_to do |format|\n if @order_detail.save\n format.html { redirect_to @order_detail, notice: I18n.t('controller.create_success_notice', model: '子订单') }\n format.json { render action: 'show', status: :created, location: @order_detail }\n else\n format.html { render action: 'new' }\n format.json { render json: @order_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9fc6f1174fd5f01b529df492a4d1e50c",
"score": "0.53338933",
"text": "def create_product( a, p )\n product_json = { \n :product => { \n :escell_clone => p[:escell_clone], \n :allele_id => a[\"id\"] \n } \n }.to_json\n \n product_data = request(\n :url => \"products.json\",\n :method => \"post\",\n :payload => product_json\n )\n \n product = JSON.parse(product_data)[\"product\"]\n return product\nend",
"title": ""
},
{
"docid": "3fa32d2ec95b554a95534fe1eed866fc",
"score": "0.5330018",
"text": "def create\n @competence = Competence.new(competence_params)\n\n @competence.save!\n render json: {status: :ok}\n end",
"title": ""
},
{
"docid": "0694e19e2dffcf115d3d0326ce71367b",
"score": "0.5327935",
"text": "def create\n @productivity = Productivity.new(productivity_params)\n\n respond_to do |format|\n if @productivity.save\n format.html { redirect_to productivities_path, notice: 'A produtividade foi criada com sucesso.' }\n format.json { render :show, status: :created, location: @productivity }\n else\n format.html { render :new }\n format.json { render json: @productivity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f46be6a75892e0ea3a4ffbbd7750ea71",
"score": "0.53263247",
"text": "def create\n @expense = Expense.new(date: expense_params[:date],\n description: expense_params[:description], amount: expense_params[:amount])\n\n expense_params[:expense_categories].reject(&:blank?).each do |id|\n @expense.expense_categories << ExpenseCategory.find(id)\n end\n\n respond_to do |format|\n if @expense.save\n format.html { redirect_to expenses_path, notice: 'Expense was successfully created.' }\n format.json { render :show, status: :created, location: expenses_path }\n else\n format.html { render :new }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6a0170e48c7b07ebe88497da78e166c",
"score": "0.5316259",
"text": "def list_commodities\n\treturn if authorise_for_web(program_name?,'read') == false \n\n \tif params[:page]!= nil \n\n \t\tsession[:commodities_page] = params['page']\n\n\t\t render_list_commodities\n\n\t\t return \n\telse\n\t\tsession[:commodities_page] = nil\n\tend\n\n\tlist_query = \"@commodity_pages = Paginator.new self, Commodity.count, @@page_size,@current_page\n\t @commodities = Commodity.find(:all,\n\t\t\t\t :limit => @commodity_pages.items_per_page,\n\t\t\t\t :offset => @commodity_pages.current.offset)\"\n\tsession[:query] = list_query\n\trender_list_commodities\nend",
"title": ""
},
{
"docid": "4fc1cc8b692326ae63b151670f140b78",
"score": "0.5308714",
"text": "def create\n @company = current_user.create_company(company_params)\n industry_id = company_params[:industry_ids]\n \n if industry_id.empty? || industry_id.nil?\n @company.valid?\n render :action => \"new\"\n return\n else\n @company.industries << Industry.find(company_params[:industry_ids])\n end\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to your_solutions_company_path(@company), notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b46b4ad35fd1b988b34944003ce3fae",
"score": "0.5304699",
"text": "def create\n @miscellaneous_pricing = MiscellaneousPricing.new(miscellaneous_pricing_params)\n\n if @miscellaneous_pricing.save\n render json: @miscellaneous_pricing, status: :created, location: @miscellaneous_pricing\n else\n render json: @miscellaneous_pricing.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a0edbedf82e547dfa0e9acfccca7cd38",
"score": "0.5304126",
"text": "def company_params\n params.require(:company).permit(:name, :city_ids => [])\n end",
"title": ""
},
{
"docid": "875b5d1803151001790e94300bef20de",
"score": "0.52962756",
"text": "def accommodation_params\n params.require(:accommodation).permit(:title, :city, :country, :type_id, :floor_area, :bedrooms, :bathrooms, :min_stay_nights, :max_guests, :rating_id)\n end",
"title": ""
},
{
"docid": "f611df1268a48b6627be58e1b0220fb2",
"score": "0.5287347",
"text": "def create\n @accommodation = current_user.accommodations.new(params[:accommodation])\n\n respond_to do |format|\n if @accommodation.save\n format.html { redirect_to @accommodation, notice: 'Accommodation was successfully created.' }\n format.json { render json: @accommodation, status: :created, location: @accommodation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @accommodation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f926b6327a76686b699fadf1eff1005",
"score": "0.5285407",
"text": "def create_company\n \n data = JSON.parse(request.raw_post)\n errors = []\n company = Company.new(data[\"company\"])\n\n if company.valid? \n company.save\n \n # Loop through persons and apply them\n data[\"persons\"].each do |person|\n begin\n Person.create(:company_id => company.id, :name => person[\"name\"], :title => person[\"title\"])\n rescue \n errors << \"Person with name: '#{person[\"name\"]}' was not saved due to lack of data\"\n end\n end\n\n # Did any issues appear, while creating persons?\n if errors.count == 0\n render json: {result: \"OK\", message: \"success\"}.to_json\n else\n Person.where(:company_id => company.id).each { |p| p.destroy }\n company.destroy\n render json: {result: \"Error\", message: errors.join(',')}.to_json\n end\n\n else\n render json: {result: \"Error\", message: company.errors.full_messages.join(',')}.to_json\n end\n end",
"title": ""
},
{
"docid": "12fcf456022b5c98158256812c7accb7",
"score": "0.52743953",
"text": "def create\n @opportunity = Opportunity.new(opportunity_params)\n\n @opportunity.propane_royalties = 0.3\n @opportunity.propane_turnkey_royalties = 0.1\n @opportunity.propane_price = 2.75\n @opportunity.propane_cost = 2.45\n @opportunity.propane_turnkey_cost = 2.65\n @opportunity.conversion_margin = 0.5\n @opportunity.gasoline_price = 3.65\n @opportunity.annual_management_charge = 6000.0\n\n respond_to do |format|\n if @opportunity.save\n format.html { redirect_to @opportunity, notice: 'Your opportunity is ready for analysis.' }\n format.json { render action: 'show', status: :created, location: @opportunity }\n else\n format.html { render action: 'new' }\n format.json { render json: @opportunity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff022c6ac9ee4d4edaa243aea00f3d9b",
"score": "0.52709866",
"text": "def create\n roommates = params[:expense][:roommate_expenses]\n params[:expense].delete :roommate_expenses\n @expense = Expense.create params[:expense]\n\n roommates.values.each { |r|\n @expense.roommate_expenses.new(r)\n }\n\n respond_to do |format|\n if @expense.save\n Notification.notify!(@expense.roommates, current_user, :created, @expense)\n format.html { redirect_to expenses_path, notice: 'Expense was successfully created.' }\n format.json { render json: @expense, status: :created, location: @expense }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4658e4f5edece0c8f2546e179e274161",
"score": "0.52654207",
"text": "def accommodation_params\n params.require(:accommodation).permit(:name, :description, :address, :phone, :price_per_night, :free_wi_fi, :air_conditioned, :breakfast, :child_friendly, :airport_shuttle, :gym, :parking, :laundry_service, :pool, :restaurant, :hot_tub, :smoke_free, :accessible, :pets_allowed, :spa, :bar, :latitude, :longitude, :logo, :website, :facebook, :twitter, :booking_url)\n end",
"title": ""
},
{
"docid": "d3e4a9bd54bbef48a384a5ab2cb2131f",
"score": "0.52599275",
"text": "def create\n usuarioLogueado = User.find(session[:user_id])\n if usuarioLogueado.manager\n @companies = Company.where(:user_id => usuarioLogueado.id)\n else\n @companies = Company.all\n end\n \n @internship = Internship.new(params[:internship])\n @situations = Situation.all\n @types = Type.all\n\n respond_to do |format|\n if @internship.save\n format.html { redirect_to @internship, :notice => 'Internship was successfully created.' }\n format.json { render :json => @internship, :status => :created, :location => @internship }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @internship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2b1fe9756ebdaf70dd8419f74466095",
"score": "0.52547014",
"text": "def equipment_params\n params.require(:equipment).permit(:name, :quantity, :equipment_type_id, :fuel_per_hour, :hours_per_year, :conversion_cost, :percent_propane, :opportunity_id)\n end",
"title": ""
},
{
"docid": "8014fa5910288f12985d7957d67ff542",
"score": "0.5250299",
"text": "def commodities(commodities_hash)\n return self if commodities_hash.nil?\n\n commodities_hash.each do |preference_hash|\n commodity = @sim_data.get_commodity(preference_hash['Name'])\n buys = preference_hash['Buys?']\n sells = preference_hash['Sells?']\n ideal_stock = preference_hash['Ideal Stock']\n\n @role.set_commodity_prefs(commodity, ideal_stock, buys, sells)\n end\n\n self\n end",
"title": ""
},
{
"docid": "537ef8f1f9d3c2b4777404867077923f",
"score": "0.52463734",
"text": "def destroy\n @commodity.destroy\n respond_to do |format|\n format.html { redirect_to commodities_url, notice: 'Commodity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "befaa365999fc16ec1ae11208ab9a629",
"score": "0.5241243",
"text": "def create\n @company = Company.new\n params[:company].keys.each do |attribute|\n if attribute == \"address\"\n params[:company][attribute] = Perpetuity[Address].find(params[:company][attribute])\n end\n @company.send(attribute+\"=\",params[:company][attribute])\n end\n Perpetuity[Company].insert @company\n\n respond_to do |format|\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n end\n end",
"title": ""
},
{
"docid": "952b431d81ad67e9a5c1b9c64675e3bd",
"score": "0.5240579",
"text": "def competency_params\n params.require(:competency).permit(:position_id, :cluster_id, :name, :title, :rank, :description)\n end",
"title": ""
},
{
"docid": "9466e522030b67c1916f3dccf6b6d0b3",
"score": "0.52381754",
"text": "def create\n @food_parcel = FoodParcel.new(params[:food_parcel])\n\n respond_to do |format|\n if @food_parcel.save\n format.html { redirect_to @food_parcel, notice: 'Food parcel was successfully created.' }\n format.json { render json: @food_parcel, status: :created, location: @food_parcel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @food_parcel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff766b810aae060327c43a837b445b0e",
"score": "0.52351177",
"text": "def set_commodoty\n @commodoty = Commodoty.find(params[:id])\n end",
"title": ""
},
{
"docid": "fd294a60fa57d770b5135cddb867272d",
"score": "0.5228273",
"text": "def create\n @capacity = Capacity.new(params[:capacity])\n\n respond_to do |format|\n if @capacity.save\n format.html { redirect_to @capacity, notice: 'Capacity was successfully created.' }\n format.json { render json: @capacity, status: :created, location: @capacity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @capacity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ace868d93ce07b969e43bf4e25318c75",
"score": "0.5227067",
"text": "def create\n @equipment = Equipment.new(equipment_params)\n respond_to do |format|\n if @equipment.save\n format.html do\n redirect_to equipment_index_url,\n notice: 'Equipment added.'\n end\n else\n format.html { render :new }\n format.json do\n render json: @equipment.errors,\n status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "cba1b4928f05d953d6c641e6de959f85",
"score": "0.52240735",
"text": "def create\n product_name = competitor_params[:title]\n honestbee_datas = get_honestbee_data (product_name)\n predict_catalog = get_predict_catalog ( product_name )\n save_data_in_postgres (predict_catalog)\n render :json => honestbee_datas\n end",
"title": ""
},
{
"docid": "a134f1151e8fedd2670433cb08db4bbe",
"score": "0.522091",
"text": "def competency_params\n params.require(:competency).permit(:position_id, :cluster_id, :name, :title, :description, :rank)\n end",
"title": ""
},
{
"docid": "1a226e37a2925cd37d907e8c47f40625",
"score": "0.5214103",
"text": "def create\n \n new_name= params[:name]\n new_notability = params[:notability]\n new_celebrity = {'name': new_name, 'notability': new_notability}\n session[:celebrities].push(new_celebrity)\n render json: new_celebrity\n end",
"title": ""
},
{
"docid": "fb2351a4b081c8a4dd764c9fe5113417",
"score": "0.5213605",
"text": "def create\n @vehicle_expense = VehicleExpense.new(params[:vehicle_expense])\n\n respond_to do |format|\n if @vehicle_expense.save\n format.html { redirect_to @vehicle_expense, notice: 'Vehicle expense was successfully created.' }\n format.json { render json: @vehicle_expense, status: :created, location: @vehicle_expense }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vehicle_expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f787979a481d38b38828f9a535beca6",
"score": "0.52091545",
"text": "def create\n @parciality = Parciality.new(parciality_params)\n\n respond_to do |format|\n if @parciality.save\n format.html { redirect_to @parciality, notice: 'Parciality was successfully created.' }\n format.json { render :show, status: :created, location: @parciality }\n else\n format.html { render :new }\n format.json { render json: @parciality.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b54092f9aa94aee9fdfc6e8c3d623dd0",
"score": "0.5198097",
"text": "def set_commodity_type\n @commodity_type = CommodityType.find(params[:id])\n end",
"title": ""
},
{
"docid": "f0e8c12ef6acda6d116a62ce8842d0b4",
"score": "0.5188882",
"text": "def create\n p params\n scholarship = Scholarship.new(\n amount: params[:amount],\n frequency: params[:frequency],\n camp: current_camp)\n # save the information from user input to create a new scholarship.\n scholarship.save!\n if scholarship.save!\n render json: scholarship.as_json\n else\n render json: {errors: scholarship.errors.full_messages}\n end\n end",
"title": ""
},
{
"docid": "81bb8c833152df403126ea59d710b9fa",
"score": "0.518358",
"text": "def create\n @compra_produto = CompraProduto.new(compra_produto_params)\n\n respond_to do |format|\n if @compra_produto.save\n @compra_produto.produto_comprados.each do |item|\n i = Produto.find(item.produto_id)\n i.quantidade = i.quantidade + item.quantidade\n i.save\n end\n format.html { redirect_to @compra_produto, notice: 'Compra produto was successfully created.' }\n format.json { render action: 'show', status: :created, location: @compra_produto }\n else\n format.html { render action: 'new' }\n format.json { render json: @compra_produto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd97d3ab219472a45499decbcc75e3f6",
"score": "0.51828825",
"text": "def create\n expense = Expense.new(expense_params)\n if expense.save\n render json: {\n status: 201,\n expense: expense\n }\n else\n render json: {\n status: 422,\n errors: expense.errors.full_messages.join(\", \")\n }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a612ba07309900ffe92f4904b00c0059",
"score": "0.5176869",
"text": "def create\n user = UserSession.user_by_authentication_token(params[:authentication_token])\n groceryRecipe = GroceryRecipe.find_or_create_by_user_id_and_recipe_id(user.id, params[:recipe_id])\n groceryRecipe.recipe_groceries.destroy_all\n @groceries = []\n\n if params[:groceries]\n names = params[:groceries].split(',')\n for name in names\n ingredient = Ingredient.find_or_create_by_name(name.downcase.titleize)\n grocery = RecipeGrocery.new(:grocery_recipe => groceryRecipe, :ingredient => ingredient)\n if grocery.save\n @groceries << grocery\n end\n end\n end\n respond_to do |format|\n if @groceries.length > 0\n format.json { render :json => { :groceries => @groceries}}\n else\n format.json { render :json => { :message => \"Nothing to add\"}}\n end\n end\n end",
"title": ""
},
{
"docid": "0adce5f241f879e5ee362f32eba21016",
"score": "0.51702565",
"text": "def parcel_params\n params.require(:parcel).permit(:name, :quantity, :phone, :courier, :remakrs)\n end",
"title": ""
},
{
"docid": "7927c4c8f09c58fb3efb93b62107e2e7",
"score": "0.51698977",
"text": "def create\n @charity = Charity.new(params[:charity])\n\n respond_to do |format|\n if @charity.save\n format.html { redirect_to admins_charities_url, notice: 'Charity was successfully created.' }\n format.json { render json: @charity, status: :created, location: @charity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @charity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9c70e49d299776a6f9308234589f65b",
"score": "0.51687706",
"text": "def create\n @company = Company.new(params[:company])\n\n if @company.save\n render json: @company, status: :created, location: @company\n else\n render json: @company.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "733b84865b2ea5d9600a3dc29a408430",
"score": "0.51666486",
"text": "def create\n params.require([:name, :edible_portion, :code, :energy_value, :category_id, :composition])\n if !params[:composition].empty?\n category = FoodCategory.find(params[:category_id])\n food = category.foods.create!(params.permit(:name, :edible_portion, :code, :energy_value))\n params[:composition].each do |c|\n component = Component.find(c[:component_id])\n Composition.create!(quantity: c[:quantity], food: food , component: component)\n end\n head :created\n else\n render_json(\"A food must have at least one component\", :unprocessable_entity)\n end\n end",
"title": ""
},
{
"docid": "5f7ecd6de2efcd1c99d5b3531b3a93cb",
"score": "0.5165199",
"text": "def create\n respond_to do |format|\n if @charity.save\n format.html { redirect_to(api_charity_url(@charity), notice: 'Charity was successfully created.') }\n format.json { render :show, status: :created, location: api_charity_url(@charity) }\n else\n format.html { render json: @charity.errors, status: :unprocessable_entity } # TODO(chandler37): show proper html for this rare case\n format.json { render json: @charity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73df26ed1694d5d414f1744864d7644e",
"score": "0.51623785",
"text": "def createForCompany\n #takes the :id for the company and converts it to company_id for person\n if params[\"id\"]\n params[\"person\"][\"company_id\"] = params[\"id\"].to_i\n end\n render json: Person.create(params[\"person\"])\n end",
"title": ""
},
{
"docid": "f9a8a6ca241d9f9ab8f4b2e1c3bfbcb1",
"score": "0.5159154",
"text": "def create\n @opcion = Opcion.new(params[:opcion])\n\n if @opcion.save\n render json: @opcion, status: :created, location: @opcion\n else\n render json: @opcion.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4b0f24935bd0fbeacb03806a944343c3",
"score": "0.51565063",
"text": "def create\n @charity = Charity.new(params[:charity])\n\n respond_to do |format|\n if @charity.save\n format.html { redirect_to @charity, notice: 'Charity was successfully created.' }\n format.json { render json: @charity, status: :created, location: @charity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @charity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
025eda1b2fdc7c4690f2fb9dd34dc1c5
|
DELETE /drawer_conteiner_incomes/1 DELETE /drawer_conteiner_incomes/1.json
|
[
{
"docid": "d57ce717103c274b5a17aeb4d4738c9d",
"score": "0.7943514",
"text": "def destroy\n @drawer_conteiner_income.destroy\n respond_to do |format|\n format.html { redirect_to drawer_conteiner_incomes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "4db31711dcc6d7983c9ba5a070d33098",
"score": "0.71942604",
"text": "def destroy\n @income = Income.find(params[:id])\n @income.destroy\n\n respond_to do |format|\n format.html { redirect_to incomes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4db31711dcc6d7983c9ba5a070d33098",
"score": "0.71942604",
"text": "def destroy\n @income = Income.find(params[:id])\n @income.destroy\n\n respond_to do |format|\n format.html { redirect_to incomes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c42d31265b75cf50bdecd0482902613a",
"score": "0.7167729",
"text": "def destroy\n @income.destroy\n respond_to do |format|\n format.html { redirect_to incomes_url, notice: 'Income was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c84e108c198eff27530c3d59f7fed2c5",
"score": "0.71493787",
"text": "def destroy\n @income.destroy\n respond_to do |format|\n format.html { redirect_to incomes_url, notice: '収入1件削除しました。' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf12d99b47212a720b312d4cbca1e915",
"score": "0.7125839",
"text": "def destroy\n set_income\n @income.destroy\n respond_to do |format|\n format.html { redirect_to incomes_path, notice: 'Income was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "53f637dd7922d535d222d8d47b98e5ed",
"score": "0.7107546",
"text": "def destroy\n @app_income = AppIncome.find(params[:id])\n @app_income.destroy\n\n respond_to do |format|\n format.html { redirect_to app_incomes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4d3ef71c2b9928658793ed17dd8cf6f1",
"score": "0.71019685",
"text": "def delete_income(id, _options = {})\n delete \"incomes/#{id}\"\n end",
"title": ""
},
{
"docid": "d42266cbad36c1b4d11af07f6c615625",
"score": "0.7079542",
"text": "def destroy\n set_proposed_income\n calculate_saving\n \n\n @proposed_income.destroy\n respond_to do |format|\n format.html { redirect_to @budget, notice: 'Proposed income was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "945bfb19259d7ad1a522503af617db89",
"score": "0.70740503",
"text": "def destroy\n @income.destroy\n respond_to do |format|\n format.html { redirect_to edit_budget_path(@budget), notice: 'Income was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "43363f281735503b256d4669e4d08be1",
"score": "0.7038987",
"text": "def destroy\n @budget_income.destroy\n respond_to do |format|\n format.html { redirect_to budget_incomes_url, notice: 'Budget income was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "635c51d98373943a4d8f1eb77d84eb7b",
"score": "0.703789",
"text": "def destroy\n\n @income.destroy\n \n respond_to do |format|\n format.html { redirect_to incomes_url, notice: 'Income was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d1107f5b55288a62792e527425a19d3d",
"score": "0.70239675",
"text": "def destroy\n @incomes = Income.find(params[:id])\n @incomes.destroy\n redirect_to dashboard_index_path\n end",
"title": ""
},
{
"docid": "2ca0715f651e4924ec1bca591efdcaea",
"score": "0.7017592",
"text": "def destroy\n @income_method = IncomeMethod.find(params[:id])\n @income_method.destroy\n\n respond_to do |format|\n format.html { redirect_to income_methods_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a3e788ca60c0613ef5d114d9fae497d7",
"score": "0.69981825",
"text": "def destroy\n @income.destroy\n respond_to do |format|\n format.html { redirect_to incomes_url, notice: t('Income was successfully destroyed.') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ef82a83da356a584ac8920dd4edd3769",
"score": "0.6994878",
"text": "def destroy\n @income.destroy\n respond_to do |format|\n format.html { redirect_to incomes_url, notice: 'Income was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ef82a83da356a584ac8920dd4edd3769",
"score": "0.6994878",
"text": "def destroy\n @income.destroy\n respond_to do |format|\n format.html { redirect_to incomes_url, notice: 'Income was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ef82a83da356a584ac8920dd4edd3769",
"score": "0.6994878",
"text": "def destroy\n @income.destroy\n respond_to do |format|\n format.html { redirect_to incomes_url, notice: 'Income was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "62707c0b2150fc6634c6f5005a65b70b",
"score": "0.69798315",
"text": "def destroy\n @income_expense.destroy\n respond_to do |format|\n format.html { redirect_to income_expenses_url, notice: 'Income expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "74d7eb3d559ad027e9ee5d2d7b121fd7",
"score": "0.6893122",
"text": "def destroy\n @income_item = IncomeItem.find(params[:id])\n @income_item.destroy\n\n respond_to do |format|\n format.html { redirect_to income_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "718dd27d1db0a40d5240cefcda648861",
"score": "0.68548",
"text": "def destroy\n @income_summary.destroy\n respond_to do |format|\n format.html { redirect_to income_summaries_url, notice: 'Income summary was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20282650a327ea7ed2e572c6d613692e",
"score": "0.68426704",
"text": "def destroy\n @income_statement.destroy\n respond_to do |format|\n format.html { redirect_to income_statements_url, notice: 'Income statement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a0587117ffddff810de05dbe3d8b531a",
"score": "0.6835314",
"text": "def destroy\n @expense.destroy\n respond_to do |format|\n format.html { redirect_to invoice_expenses_url(@expense.invoice.to_param) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c204f551fcb02404f0d6491e9d114aee",
"score": "0.6824395",
"text": "def destroy\n @income = Income.find(params[:id])\n @income.destroy\n\n respond_to do |format|\n format.html { redirect_to(incomes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "de11701a69640608b069b33c82c9ca91",
"score": "0.6821562",
"text": "def destroy\n @expense.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "77655c00f2f2ad55b2af961630cf39a2",
"score": "0.68164927",
"text": "def destroy\n @income_status.destroy\n respond_to do |format|\n format.html { redirect_to income_statuses_url, notice: 'Income status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee6fa9edba2d399512239163762e3b31",
"score": "0.6811315",
"text": "def destroy\n @api_v1_initiative_expense.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_initiative_expenses_url, notice: 'Initiative expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ee4ca0405dcb86aa7408006b6d5208e",
"score": "0.68040866",
"text": "def destroy\n @periodic_income.destroy\n respond_to do |format|\n format.html { redirect_to profile_path(@periodic_income.profile), notice: 'Periodic income was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9344448e5cdab517cc4f7a5462326ebf",
"score": "0.67937523",
"text": "def destroy\n @round_expense = RoundExpense.find(params[:id])\n @round_expense.destroy\n\n respond_to do |format|\n format.html { redirect_to round_expenses_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b3e369f220b04dc91e2f9f3057077739",
"score": "0.678339",
"text": "def destroy\n @income_item.destroy\n respond_to do |format|\n format.html { redirect_to income_items_url, notice: 'Income item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e03fcf8eef80e7911b563c77908fe79",
"score": "0.6783288",
"text": "def destroy\n @income_value = IncomeValue.find(params[:id])\n @income_value.destroy\n\n respond_to do |format|\n format.html { redirect_to income_values_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f0b0d7b2ca3ada62583bc621c65d978c",
"score": "0.6770876",
"text": "def destroy\n @economia1 = Economia1.find(params[:id])\n @economia1.destroy\n\n respond_to do |format|\n format.html { redirect_to economia1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ed77d2697e2f3d29ad6b28f6d0ede89",
"score": "0.67611957",
"text": "def destroy\n @drawer.destroy\n respond_to do |format|\n format.html { redirect_to client_budget_mobile_url(@client, @budget, @mobile), notice: \"Gaveta deletada com sucesso.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4c6c2179a704cb896a7d27b4634f72e",
"score": "0.675379",
"text": "def delete_income\n @transaction = FinanceTransaction.shod(params[:id])\n authorize! :delete, @transaction\n @transaction.destroy\n flash[:notice] = t('income_delete')\n redirect_to view_income_finance_index_path\n end",
"title": ""
},
{
"docid": "d5b9c8dead2889cb914b333fb85618ce",
"score": "0.67505056",
"text": "def destroy\n @line_investigation.destroy\n respond_to do |format|\n format.html { redirect_to line_investigations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "57bbc5e3d51e1bb753aad76be824bdc5",
"score": "0.67449254",
"text": "def destroy\n @income_category = IncomeCategory.find(params[:id])\n @income_category.destroy\n\n respond_to do |format|\n format.html { redirect_to income_categories_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3a20f3905e2bf5cdd1dfcb674b1b2a57",
"score": "0.6744618",
"text": "def destroy\n @in_come = InCome.find(params[:id])\n @in_come.destroy\n\n respond_to do |format|\n format.html { redirect_to in_comes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0c164ff915fb49959d0fc862d72a4bb5",
"score": "0.6738124",
"text": "def destroy\n @estimated_expense.destroy\n respond_to do |format|\n format.html { redirect_to estimated_expenses_url, notice: 'Estimated expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3438ba197e3d69ea69a9abc9ac247392",
"score": "0.6712634",
"text": "def destroy\n @source_of_income.destroy\n respond_to do |format|\n format.html { redirect_to source_of_incomes_url, notice: \"source of income was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bd49c5ec16db01bdb1fb53d205fd6ef3",
"score": "0.67117554",
"text": "def destroy\n @accident_insurance.destroy\n respond_to do |format|\n format.html { redirect_to accident_insurances_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "656c2be08d3edccb1017fde0565003ba",
"score": "0.6708493",
"text": "def destroy\n @client_fee.destroy\n respond_to do |format|\n format.html { redirect_to client_fees_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8b16e646971d7114afc4e863c882934a",
"score": "0.66993815",
"text": "def destroy\n @insurance_fee.destroy\n respond_to do |format|\n format.html { redirect_to insurance_fees_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf1b7cd1714a305aebf4873db0286a5b",
"score": "0.6690813",
"text": "def destroy\n @incomelevel = Incomelevel.find(params[:id])\n @incomelevel.destroy\n\n respond_to do |format|\n format.html { redirect_to(incomelevels_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "534197ba45a7b563cc0786c8191f694e",
"score": "0.6687308",
"text": "def destroy\n @general_expense.destroy\n respond_to do |format|\n format.html { redirect_to general_expenses_url, notice: 'General expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4b8eac82a2e2ee6588e9d3946dfeb81e",
"score": "0.6681788",
"text": "def destroy\n @life_insurance_contract.destroy\n\n respond_to do |format|\n format.html { redirect_to life_insurance_contracts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aef5437b94168ade2bad094875cfb271",
"score": "0.6679371",
"text": "def destroy\n @expense.destroy\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aef5437b94168ade2bad094875cfb271",
"score": "0.6679371",
"text": "def destroy\n @expense.destroy\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "767610b498304b731972664b861780f2",
"score": "0.66766524",
"text": "def destroy\n @fixed_income.destroy\n respond_to do |format|\n format.html { redirect_to products_path, notice: 'Fixed income was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69dc1a9cef44e2d210c82458f2b1850b",
"score": "0.6670277",
"text": "def destroy\n @benefit_incident.destroy\n respond_to do |format|\n format.html { redirect_to benefit_incidents_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5c181505ac0deedddfba684db419e428",
"score": "0.6668732",
"text": "def delete\n render json: Own.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "87b73dc823df63d3a36942794e5c7f30",
"score": "0.6666862",
"text": "def destroy\n @seja_investidore = SejaInvestidore.find(params[:id])\n @seja_investidore.destroy\n\n respond_to do |format|\n format.html { redirect_to seja_investidores_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9fc86aa7ba126affb096a0a6ea15de55",
"score": "0.6665868",
"text": "def destroy\r\n @beneficiaire = Beneficiaire.find(params[:id])\r\n @beneficiaire.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to beneficiaires_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "0d5244e22afdb6ff73a35a3fb3f0274e",
"score": "0.6664635",
"text": "def destroy\n @client_cash = ClientCash.find(params[:id])\n @client_cash.destroy\n\n respond_to do |format|\n format.html { redirect_to client_cashes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4bddaf8822d31f0efe17f30d07676864",
"score": "0.6661738",
"text": "def destroy\n @coverage = Coverage.find(params[:id])\n @coverage.destroy\n\n respond_to do |format|\n format.html { redirect_to coverages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a91662e38b5321ea78f6659f05020baf",
"score": "0.6652776",
"text": "def destroy\n @invest.destroy\n respond_to do |format|\n format.html { redirect_to invests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a91662e38b5321ea78f6659f05020baf",
"score": "0.6652776",
"text": "def destroy\n @invest.destroy\n respond_to do |format|\n format.html { redirect_to invests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "208da692cc0fd89241a8d86c08271821",
"score": "0.6640733",
"text": "def destroy\n @economia5 = Economia5.find(params[:id])\n @economia5.destroy\n\n respond_to do |format|\n format.html { redirect_to economia5s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "38e44e11d58441731735b57739602423",
"score": "0.6635651",
"text": "def destroy\n @client_earning = ClientEarning.find(params[:id])\n @client_earning.destroy\n\n respond_to do |format|\n format.html { redirect_to client_earnings_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "59cc11e1eef1330edc38d357e9c1265d",
"score": "0.6622003",
"text": "def destroy\n @admin_expense = Admin::Expense.find(params[:id])\n @admin_expense.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_expenses_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "719c466f0d4f7cc31dd770d78b032263",
"score": "0.66161156",
"text": "def destroy\n @economia6 = Economia6.find(params[:id])\n @economia6.destroy\n\n respond_to do |format|\n format.html { redirect_to economia6s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b833cefd0a04744f4629efe6594de20e",
"score": "0.66086066",
"text": "def destroy\n @invoice = Invoice.find(params[:id])\n \n @invoice.visits.each do |visit|\n visit.invoice_id = nil\n visit.save\n end\n \n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to invoices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1a6fe1551f0425a432c152b118f4bd03",
"score": "0.66042215",
"text": "def destroy\n @expense.destroy\n respond_to do |format|\n format.html { redirect_to expenses_url, notice: '支出1件削除しました。' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2d56a2d0479d20613d6ab4e6d2438914",
"score": "0.66026616",
"text": "def destroy\n @incomelog.destroy\n respond_to do |format|\n format.html { redirect_to incomelogs_url, notice: 'Incomelog was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "077efcdfb57ae55085b2488b007d092e",
"score": "0.66013324",
"text": "def destroy\n @vehicle_expense = VehicleExpense.find(params[:id])\n @vehicle_expense.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicle_expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4feaaae455f3207e560f39ecbeaf49d5",
"score": "0.65948075",
"text": "def destroy\n @expense.destroy\n respond_to do |format|\n format.html { redirect_to budget_expenses_url(@budget), notice: 'Expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "67ddabae5a90e9e8843542497c93c551",
"score": "0.6589741",
"text": "def destroy\n @income_category.destroy\n respond_to do |format|\n format.json { head :no_content }\n format.js\n end\n end",
"title": ""
},
{
"docid": "e4bf3176b7095c76c45082925eeaa22a",
"score": "0.6587558",
"text": "def destroy\n @insurance = Insurance.find(params[:id])\n @insurance.destroy\n\n respond_to do |format|\n format.html { redirect_to insurances_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "03b3c1c55728f2c2b22e54cfc6f3da56",
"score": "0.6587027",
"text": "def destroy\n @income_tipe.destroy\n respond_to do |format|\n format.html { redirect_to tenant_income_tipes_path(tenant_id: @tenant.id), notice: 'Income tipe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f7e6817d37436e79f1274da32f1f9acf",
"score": "0.6583448",
"text": "def destroy\n @contractual.destroy\n respond_to do |format|\n format.html { redirect_to contractuals_url, notice: t('contractual.destroy') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e23fd584bcc1b4b195def991c49ca1b1",
"score": "0.6573256",
"text": "def destroy\n @expense = Expense.find(params[:id])\n @expense.destroy\n\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "faa3b6ebfc9e07f01c78afb5fd7842c0",
"score": "0.6572414",
"text": "def destroy\n @financial_objects_income.destroy\n respond_to do |format|\n format.html { redirect_to financial_objects_incomes_url, notice: 'Income was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e08506514e546a9fdad6886f76a7da8",
"score": "0.65702266",
"text": "def destroy\n @addendum = Addendum.find(params[:id])\n @addendum.destroy\n\n respond_to do |format|\n format.html { redirect_to addendums_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a345e0c7e0376873cca9509341e7a643",
"score": "0.65699947",
"text": "def destroy\n @incident_investigator = IncidentInvestigator.find(params[:id])\n @incident_investigator.destroy\n\n respond_to do |format|\n format.html { redirect_to incident_investigators_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9942eb57a5fc5b28e25aa9b76cbfe5b0",
"score": "0.6569258",
"text": "def destroy\n @expense = Expense.find(params[:id])\n @expense.destroy\n\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9942eb57a5fc5b28e25aa9b76cbfe5b0",
"score": "0.6569258",
"text": "def destroy\n @expense = Expense.find(params[:id])\n @expense.destroy\n\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9942eb57a5fc5b28e25aa9b76cbfe5b0",
"score": "0.6569258",
"text": "def destroy\n @expense = Expense.find(params[:id])\n @expense.destroy\n\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9942eb57a5fc5b28e25aa9b76cbfe5b0",
"score": "0.6569258",
"text": "def destroy\n @expense = Expense.find(params[:id])\n @expense.destroy\n\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9942eb57a5fc5b28e25aa9b76cbfe5b0",
"score": "0.6569258",
"text": "def destroy\n @expense = Expense.find(params[:id])\n @expense.destroy\n\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9942eb57a5fc5b28e25aa9b76cbfe5b0",
"score": "0.6569258",
"text": "def destroy\n @expense = Expense.find(params[:id])\n @expense.destroy\n\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9942eb57a5fc5b28e25aa9b76cbfe5b0",
"score": "0.6569258",
"text": "def destroy\n @expense = Expense.find(params[:id])\n @expense.destroy\n\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9942eb57a5fc5b28e25aa9b76cbfe5b0",
"score": "0.6569258",
"text": "def destroy\n @expense = Expense.find(params[:id])\n @expense.destroy\n\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c222d7d00acc878e5c49d1ca44752dae",
"score": "0.656416",
"text": "def destroy\n @income_source.destroy\n respond_to do |format|\n format.html { redirect_to income_sources_url, notice: 'Income source was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "05207827c11011216456c07e421f2d4d",
"score": "0.6561187",
"text": "def destroy\n @expense.destroy\n respond_to do |format|\n format.html { redirect_to expenses_url, notice: 'Expense was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d5103a84db8d2f14a287c9eae29a8609",
"score": "0.65601957",
"text": "def destroy\n @company_regions_growth.destroy\n respond_to do |format|\n format.html { redirect_to company_regions_growths_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9360aec2c35531f2e734fae3f8fb509a",
"score": "0.65600497",
"text": "def destroy\n @daily_regiman = DailyRegimen.find(params[:id])\n @daily_regiman.destroy\n\n respond_to do |format|\n format.html { redirect_to daily_regimen_index_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a603398f57b54cc7adf56107facf68ad",
"score": "0.65557593",
"text": "def destroy\n @expense = Expense.find(params[:id])\n @expense.destroy\n Period.recalculate_beginning_balances(budget_id= current_budget.id)\n\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :no_content, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "f0bc67cf4fd4783a1593b6c970e9a530",
"score": "0.6549962",
"text": "def destroy\n @continent.destroy\n respond_to do |format|\n format.html { redirect_to continents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6f0894be9636ba58ab89a69c94bbf56c",
"score": "0.654891",
"text": "def destroy\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to client_budgets_url(@client), notice: 'Orçamento deletado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ab0356e191e11d589522a717d54d26a",
"score": "0.6542949",
"text": "def destroy\n @convenio = Convenio.find(params[:id])\n @convenio.destroy\n\n respond_to do |format|\n format.html { redirect_to convenios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "997c494e52e90578974671fd658b4cec",
"score": "0.6534879",
"text": "def destroy\n @coverage.destroy\n respond_to do |format|\n\n format.html { redirect_to redirect_after_destroy(@coverage.rider), notice: 'Coverage was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "19bb74793df1fef8a83d8e46a684d14c",
"score": "0.6530852",
"text": "def destroy\n @expense = Expense.find(params[:id])\n @expense.destroy\n Notification.notify!(@expense.roommates, current_user, :deleted, @expense)\n\n respond_to do |format|\n format.html { redirect_to expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6423f5cced0f002f27fb04b6cc0cd37c",
"score": "0.65264374",
"text": "def destroy\n expense = Expense.find_by_id(params[:id])\n if expense.destroy\n render json: { status: 200, expense: expense }\n else\n render json: { status: 500 }\n end\n end",
"title": ""
},
{
"docid": "31472713873c4c24a2bd214bbae2bc8f",
"score": "0.65220886",
"text": "def destroy\n @covenant = Covenant.find(params[:id])\n @covenant.destroy\n\n respond_to do |format|\n format.html { redirect_to covenants_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cd750f130077d550a79937bcf4e2c152",
"score": "0.6520508",
"text": "def destroy\n @fixed_income = FixedIncome.for_user(current_user).find(params[:id])\n @fixed_income.destroy\n\n respond_to do |format|\n format.html { redirect_to(fixed_incomes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c097eccc98c1cf65ebea4188cda225ee",
"score": "0.65071064",
"text": "def destroy\n @incomeplan.destroy\n respond_to do |format|\n format.html { redirect_to incomeplans_url, notice: 'Incomeplan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "801ce71e01586dcd396138c7836d4a07",
"score": "0.6505091",
"text": "def destroy\n @drumy = Drumy.find(params[:id])\n @drumy.destroy\n\n respond_to do |format|\n format.html { redirect_to drumies_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "492b052e4d7d860c066372fc41a0ef68",
"score": "0.64999443",
"text": "def destroy\n @indicador_economico.destroy\n respond_to do |format|\n format.html { redirect_to indicador_economicos_url, notice: 'Indicador economico eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "29c560aae11045d5d074cd8050abc7e2",
"score": "0.64996964",
"text": "def destroy\n @investigate.destroy\n respond_to do |format|\n format.html { redirect_to investigates_url, notice: 'Investigate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c12d4b3a3dca1faca099dae9c943ea40",
"score": "0.64983976",
"text": "def destroy\n @convenio.destroy\n respond_to do |format|\n format.html { redirect_to convenios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a6bf0d876ba3b1758ce3b9a7d2389e1e",
"score": "0.6497158",
"text": "def destroy\n @income.destroy\n respond_to do |format|\n format.html { redirect_to [@income_category, @income], notice: 'Income was successfully destroyed.' }\n format.json { head :no_content }\n #format.js\n end\n end",
"title": ""
},
{
"docid": "b27d0105a14c5b82820f710070c41585",
"score": "0.6495463",
"text": "def destroy\n @cultural_heritage_incidence = CulturalHeritage::Incidence.find(params[:id])\n @cultural_heritage_incidence.deleted = 1\n @cultural_heritage_incidence.save\n #@cultural_heritage_incidence.destroy\n\n respond_to do |format|\n format.html { redirect_to(cultural_heritage_incidences_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
fe31bc6640f0054f2d3e9e48aa392da5
|
Checks whether this case statement has an `else` branch.
|
[
{
"docid": "2b897d634556ce740234f0aa12c2ac4f",
"score": "0.72817385",
"text": "def else?\n !loc.else.nil?\n end",
"title": ""
}
] |
[
{
"docid": "2572a5c22fae23e7c29ea1c60c74c81e",
"score": "0.7920566",
"text": "def else_branch?\n !node.else.kind_of?(Rubinius::AST::NilLiteral)\n end",
"title": ""
},
{
"docid": "c7c9099e9ec2e56176abae787ee7bec7",
"score": "0.7403805",
"text": "def empty_case_statement?(node)\n node.else_branch.nil? && node.when_branches.all? { |x| x.body.nil? }\n end",
"title": ""
},
{
"docid": "6e82b35153aa032e3aa2023298505fae",
"score": "0.711721",
"text": "def else?\n loc.else\n end",
"title": ""
},
{
"docid": "985171cfc10ae7a4e3a9b597084a7359",
"score": "0.680666",
"text": "def else_statement\n if @enum.peek.value == 'else'\n @instruction.push('state_'+(@if_count+1).to_s+\":\\n\")\n match(Token.new(:reserved, 'else'))\n block_statements\n end\n end",
"title": ""
},
{
"docid": "d9723a8525594494e5952cbdc8ab463c",
"score": "0.6743763",
"text": "def k_else!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 40 )\n\n\n\n type = K_ELSE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 413:4: 'else'\n match( \"else\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 40 )\n\n\n end",
"title": ""
},
{
"docid": "7e8573f6234eb3b0a5afa1daf816f9b8",
"score": "0.67277855",
"text": "def else!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n type = ELSE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 322:8: 'else'\n match( \"else\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n end",
"title": ""
},
{
"docid": "572c7f2904c23a68bba8c1b9edda7f27",
"score": "0.6720578",
"text": "def else_statement(fn, ce_false, is_nxt)\n if @scanner.peek.value == 'else'\n match(Token.new(:identifier, 'else'))\n fn.code << \"#{ce_false}:;\\n\"\n block_statements(fn)\n fn.code << \"#{is_nxt}:;\\n\"\n\n else\n fn.code << \"#{is_nxt}:;\\n\"\n fn.code << \"#{ce_false}:;\\n\"\n end\n end",
"title": ""
},
{
"docid": "f8d979b9c0d8f8efaf33e232e698b8b4",
"score": "0.67117107",
"text": "def else!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 66 )\n\n type = ELSE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 187:8: 'else'\n match( \"else\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 66 )\n\n end",
"title": ""
},
{
"docid": "3f76254042b5314916b90b8b6f3855bc",
"score": "0.67018664",
"text": "def else_branch\n node.else\n end",
"title": ""
},
{
"docid": "c60bf5506b6f5be3b2054371e52c9f79",
"score": "0.66557026",
"text": "def else!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 44 )\n\n\n\n type = ELSE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 222:7: 'else'\n match( \"else\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 44 )\n\n\n end",
"title": ""
},
{
"docid": "3f97c8fe99050041464d6d5c0f2d1ba6",
"score": "0.653512",
"text": "def handle_rescue_else_manually?\n !in_ensure? && has_rescue_else?\n end",
"title": ""
},
{
"docid": "ea51e080448f2b2f27ae0f9811482539",
"score": "0.63850373",
"text": "def tokenize_else(_chunk)\n raise Errors::UnexpectedElse unless @current_scope.inside_if_block?\n token = Token.new Token::ELSE\n @stack << token\n close_if_statement\n token\n end",
"title": ""
},
{
"docid": "4feb47b4b992a0da12af239546fb1e75",
"score": "0.6328144",
"text": "def elseif!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 22 )\n\n type = ELSEIF\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 324:10: 'elseif'\n match( \"elseif\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 22 )\n\n end",
"title": ""
},
{
"docid": "a2de6392ef28ea86ea2aec9f5eb30bdf",
"score": "0.60142183",
"text": "def check_truth?(statement)\n if statement == nil\n \"Neither exactly true nor false\"\n elsif statement == true\n \"It's true!\"\n else\n \"I admit, tis' false.\"\n end\nend",
"title": ""
},
{
"docid": "a2de6392ef28ea86ea2aec9f5eb30bdf",
"score": "0.60142183",
"text": "def check_truth?(statement)\n if statement == nil\n \"Neither exactly true nor false\"\n elsif statement == true\n \"It's true!\"\n else\n \"I admit, tis' false.\"\n end\nend",
"title": ""
},
{
"docid": "a2de6392ef28ea86ea2aec9f5eb30bdf",
"score": "0.60142183",
"text": "def check_truth?(statement)\n if statement == nil\n \"Neither exactly true nor false\"\n elsif statement == true\n \"It's true!\"\n else\n \"I admit, tis' false.\"\n end\nend",
"title": ""
},
{
"docid": "31a23ab933db7f201905a45cc6285ea5",
"score": "0.5919001",
"text": "def parser_else(args)\r\n if @if_stack.empty?\r\n #_rl_init_file_error (\"$else found without matching $if\")\r\n return 0\r\n end\r\n\r\n # Check the previous (n) levels of the stack to make sure that\r\n # we haven't previously turned off parsing.\r\n return 0 if @if_stack.detect {|x| x }\r\n\r\n # Invert the state of parsing if at top level.\r\n @_rl_parsing_conditionalized_out = !@_rl_parsing_conditionalized_out\r\n return 0\r\n end",
"title": ""
},
{
"docid": "f089b9921d2fb2f23efec4cf8ae390a5",
"score": "0.59107584",
"text": "def else!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n\n\n type = ELSE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 27:7: 'sino'\n match( \"sino\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n\n end",
"title": ""
},
{
"docid": "2a1bb0984a2924253b6fa9106f37ce7e",
"score": "0.5899807",
"text": "def excl\n \"else \"\n end",
"title": ""
},
{
"docid": "c5c285f2a6c6974c4f18a9262c54b638",
"score": "0.5892036",
"text": "def expand_elses(branch); end",
"title": ""
},
{
"docid": "c5c285f2a6c6974c4f18a9262c54b638",
"score": "0.5892036",
"text": "def expand_elses(branch); end",
"title": ""
},
{
"docid": "babba1d452fafaf4141c9f2996474966",
"score": "0.5881764",
"text": "def if_branch?\n !node.body.kind_of?(Rubinius::AST::NilLiteral)\n end",
"title": ""
},
{
"docid": "94bca00ba8122229f1510f4aa05fa66b",
"score": "0.5862902",
"text": "def else_branch\n node_parts[-1]\n end",
"title": ""
},
{
"docid": "94bca00ba8122229f1510f4aa05fa66b",
"score": "0.5862902",
"text": "def else_branch\n node_parts[-1]\n end",
"title": ""
},
{
"docid": "c45a10484b64dae25583e508524bb853",
"score": "0.58387995",
"text": "def else_clause\n expect :if\n self[3]\n end",
"title": ""
},
{
"docid": "caa36aa0ba0a907f5611e2ec08133c00",
"score": "0.57482177",
"text": "def visit_if(node)\n check_indentation(node)\n\n if @allow_non_nested_indentation\n yield # Continue linting else statement\n elsif node.else\n visit(node.else)\n end\n end",
"title": ""
},
{
"docid": "920e04935aeba04687ad7acd9f3a686a",
"score": "0.57448006",
"text": "def check_else(els)\n # put through translator with original target to mimic as if\n # else were change;\n # literal=true to make sure always x>y syntax\n return initial(@rule[0], els, true).sub(/\\A(.*)>/, '').strip\n end",
"title": ""
},
{
"docid": "17650aff4dcde40379f2aeec40913122",
"score": "0.5633138",
"text": "def process_else(exp)\n add_to_score :branch\n penalize_by 0.1 do\n process_until_empty exp\n end\n s()\n end",
"title": ""
},
{
"docid": "554f7eb0788623043f2e45d832bb0607",
"score": "0.56109315",
"text": "def has_exception_case?\n @exception_case > 0\n end",
"title": ""
},
{
"docid": "117fded7e29228536d681cdf756ecb6b",
"score": "0.5565789",
"text": "def eval_if_then_else(node, env, stack_trace)\n\n\tcondition = eval_node_under(node.condition, env, stack_trace)\n\tcase condition\n\tin Boolean\n\t\tif condition.value \n\t\t\treturn eval_node_under(node.true_exp, env, stack_trace), env\n\t\telse\n\t\t\tif condition.false_exp # is not empty\n\t\t\t\treturn eval_node_under(node.false_exp, env, stack_trace), env\n\t\t\telse # Don't do anything (return UnitNode)\n\t\t\t\treturn UnitNode(node.line, node.col), env\n\t\t\tend\n\t\tend\n\telse\n\t\tthrow_error(\"If statement's condition does not evaluate to a Boolean.\", node, stack_trace)\n\tend\nend",
"title": ""
},
{
"docid": "9be8c2a7d36c8de07756bb16d6003e08",
"score": "0.5514639",
"text": "def else_block\n self << \"else {\"\n yield if block_given?\n self << \"}\"\n nil\n end",
"title": ""
},
{
"docid": "e28dc206861952997711ffab69c56141",
"score": "0.5470859",
"text": "def emit_else_branch_presence_mutation\n emit_self(receiver, when_branches, nil)\n end",
"title": ""
},
{
"docid": "87fbb4f5aef42dc839b014abb56e8f2e",
"score": "0.53954667",
"text": "def parse_if_statement cur_tok\n\t\t\n\t\tconditional = parse_next\n\t\tif not (@tokens.peak and @tokens.peak.type == \"Keyword\" and @tokens.peak.value == \"then\")\n\t\t\tthrow_error(\"In If statement, expected 'then', got: #{@tokens.peak}.\", tokens.peak)\n\t\tend\n\t\t@tokens.next # Get rid of 'then'.\n\n\t\tif_true = parse_next\n\t\tif (@tokens.peak and @tokens.peak.type == \"Keyword\" and @tokens.peak.value == \"end\")\n\t\t\t@tokens.next \n\t\t\treturn IfThenElse.new(cur_tok.line, cur_tok.col, conditional, if_true)\n\t\telsif not (@tokens.peak and @tokens.peak.type == \"Keyword\" and @tokens.peak.value == \"else\")\n\t\t\tthrow_error(\"In If statement, expected 'else', got: #{@tokens.peak}.\", tokens.peak)\n\t\tend\n\t\t@tokens.next # Get rid of 'else'.\n\t\t\n\t\tif_false = parse_next\n\t\tif (@tokens.peak and @tokens.peak.type == \"Keyword\" and @tokens.peak.value == \"end\")\n\t\t\t@tokens.next\n\t\t\treturn IfThenElse.new(cur_tok.line, cur_tok.col, conditional, if_true, if_false)\n\t\telse\n\t\t\tthrow_error(\"In If statement, expected 'end', got: #{@tokens.peak}.\", @tokens.peak)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "15978da7dbec1abb05575975b81b6c94",
"score": "0.5363451",
"text": "def process_else(exp)\n add_to_score :branch\n @scorer.penalize_by 0.1 do\n analyze_list exp\n end\n s()\n end",
"title": ""
},
{
"docid": "872db572e5488be16d8b9a95b83b7c8b",
"score": "0.5349275",
"text": "def if(node, in_sentence=false)\n body, else_body = node.body, node.else\n keyword = 'if'\n\n if node.body.is_a?(Rubinius::AST::NilLiteral) && !node.else.is_a?(Rubinius::AST::NilLiteral)\n\n body, else_body = else_body, body\n keyword = 'unless'\n end\n\n emit \"#{keyword} \"\n visit node.condition, true\n emit \" is truthy, then \"\n\n visit body, true\n\n if else_body.is_a?(Rubinius::AST::NilLiteral)\n return\n end\n\n emit \" -- else, \"\n\n visit else_body, true\n end",
"title": ""
},
{
"docid": "9b756f8031653aacd99e89068f7ea2cc",
"score": "0.5309628",
"text": "def expand_elses(branch)\n elsif_branches = expand_elsif(branch)\n else_branch = elsif_branches.any? ? elsif_branches.pop : branch\n [elsif_branches, else_branch]\n end",
"title": ""
},
{
"docid": "ba20194a264a99392f0a3e78b87387db",
"score": "0.5246679",
"text": "def emit_true_if_branch\n emit_self(new(Rubinius::AST::TrueLiteral), if_branch, else_branch)\n end",
"title": ""
},
{
"docid": "fa6a86893d29abd85f4628b3dcbb523c",
"score": "0.52438337",
"text": "def if_elsif_else\nif x == true\n puts x\nend\n\nif x\n puts x\nend\n\nif x\n puts \"It's true\"\nelse\n puts \"It's false\"\nend\n\nif num <= 0\n puts \"The number is too low\"\nelsif num > 3 && num < 7\n puts \"The number is just right\"\nelse\n puts \"The number is too high\"\nend\n\nif num % 2 == 0\n if num < 10\n puts \"even less than 10\"\n else\n puts \"even greater than 10\"\n end\nelse\n puts \"The number is odd\"\nend\nend",
"title": ""
},
{
"docid": "87304ec525035d13ac6e1f61f29d226c",
"score": "0.5227284",
"text": "def emit_false_if_branch\n emit_self(new(Rubinius::AST::FalseLiteral), if_branch, else_branch)\n end",
"title": ""
},
{
"docid": "c6d9546baf47f13ad9c7789eca1e4aa5",
"score": "0.51774836",
"text": "def else(&fn)\n raise Qo::Exceptions::MultipleElseClauses if @else\n\n @else = fn || Qo::IDENTITY\n end",
"title": ""
},
{
"docid": "01a2ce2db0bc3343f9aa50bab1384026",
"score": "0.50965226",
"text": "def if_statement(fn)\n match(Token.new(:reserved, 'if'))\n match(Token.new(:symbol, '('))\n tf = condition_expression(fn)\n match(Token.new(:symbol, ')'))\n is_nxt = fn.new_label\n is_else = tf[1]\n fn.code << \"#{tf[0]}:;\\n\"\n #fn.code << block_statements(fn)\n block_statements(fn)\n fn.code << \"goto #{is_nxt};\\n\"\n else_statement(fn, tf[1], is_nxt)\n\n end",
"title": ""
},
{
"docid": "05419df808b37701e9dfce4102ea9641",
"score": "0.5058995",
"text": "def parse_else_if_header\n expect(:KW_ELSE_IF)\n expect(:L_PARANTH)\n cond = parse_expression\n expect(:R_PARANTH)\n\n cond\n end",
"title": ""
},
{
"docid": "7bd019add78bc968b8b5887130b9c8cf",
"score": "0.5014256",
"text": "def fb_else(&proc)\n content = capture(&proc) \n concat(content_tag(\"fb:else\",content),proc.binding)\n end",
"title": ""
},
{
"docid": "9e8bf0a2eb8e457b8344fae942a4a4c9",
"score": "0.5012739",
"text": "def elif!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n\n type = ELIF\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 323:8: 'elif'\n match( \"elif\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 21 )\n\n end",
"title": ""
},
{
"docid": "544dcb74b4e6403a6ccbc852299b0872",
"score": "0.5008789",
"text": "def expand_elses(branch)\n if branch.nil?\n [nil]\n elsif branch.if_type?\n _condition, elsif_branch, else_branch = *branch\n expand_elses(else_branch).unshift(elsif_branch)\n else\n [branch]\n end\n end",
"title": ""
},
{
"docid": "c2089c16f8ab277c7b1270fa364e7830",
"score": "0.4986761",
"text": "def sIf\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 7 )\n\n begin\n # at line 45:11: IF LPAR comp RPAR bloq ( ELSE bloq )?\n match( IF, TOKENS_FOLLOWING_IF_IN_sIf_333 )\n match( LPAR, TOKENS_FOLLOWING_LPAR_IN_sIf_335 )\n @state.following.push( TOKENS_FOLLOWING_comp_IN_sIf_337 )\n comp\n @state.following.pop\n match( RPAR, TOKENS_FOLLOWING_RPAR_IN_sIf_339 )\n # --> action\n agc_4('if')\n # <-- action\n @state.following.push( TOKENS_FOLLOWING_bloq_IN_sIf_343 )\n bloq\n @state.following.pop\n # --> action\n agc_5('if')\n # <-- action\n # --> action\n agc_4('else')\n # <-- action\n # at line 45:78: ( ELSE bloq )?\n alt_9 = 2\n look_9_0 = @input.peek( 1 )\n\n if ( look_9_0 == ELSE )\n alt_9 = 1\n end\n case alt_9\n when 1\n # at line 45:79: ELSE bloq\n match( ELSE, TOKENS_FOLLOWING_ELSE_IN_sIf_350 )\n @state.following.push( TOKENS_FOLLOWING_bloq_IN_sIf_352 )\n bloq\n @state.following.pop\n\n end\n # --> action\n agc_5('else')\n # <-- action\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 7 )\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "0e630ccdbc8ab9e20b650e5f1690cfdc",
"score": "0.49704295",
"text": "def final_situation?(sit)\n (super(sit) and sit.stack.empty?) ? true : false\n end",
"title": ""
},
{
"docid": "c2a8bf2472918239887370226c3f818c",
"score": "0.49531677",
"text": "def maybe?\n self.checkState == MAYBE\n end",
"title": ""
},
{
"docid": "c2a8bf2472918239887370226c3f818c",
"score": "0.49531677",
"text": "def maybe?\n self.checkState == MAYBE\n end",
"title": ""
},
{
"docid": "c2a8bf2472918239887370226c3f818c",
"score": "0.49531677",
"text": "def maybe?\n self.checkState == MAYBE\n end",
"title": ""
},
{
"docid": "c2a8bf2472918239887370226c3f818c",
"score": "0.49531677",
"text": "def maybe?\n self.checkState == MAYBE\n end",
"title": ""
},
{
"docid": "312bf5737133a73af2e42de10b78ee1a",
"score": "0.49336982",
"text": "def halted?\n !!@halt\n end",
"title": ""
},
{
"docid": "8f4c113bd3ad5dc2479ac526a58581eb",
"score": "0.49100545",
"text": "def branch_is_empty?(node)\n children = node.children.dup\n return true if children.nil?\n\n # test for only-child situation\n first_born = children.shift\n if children.empty?\n if first_born == n0(:continue)\n return true\n else\n return false\n end\n end\n\n # if only 2 children, check qualificataions, else done and return false\n next_born = children.shift\n if children.empty?\n if (first_born.type == :continue && next_born.type == :set_result) ||\n (first_born.type == :set_result && next_born.type == :continue)\n return true\n end\n end\n false\n end",
"title": ""
},
{
"docid": "a7a7d93fce63d2fcc3d6e1cc488a6703",
"score": "0.48632646",
"text": "def halt?\n @halt\n end",
"title": ""
},
{
"docid": "3821dd0b1ee7345f5dc719aee862a16e",
"score": "0.48534802",
"text": "def emit_deleted_else_branch\n emit_self(condition, if_branch, nil)\n end",
"title": ""
},
{
"docid": "a905bed91a30e133e168cf1927cdb870",
"score": "0.48394462",
"text": "def if_statement\n consume(:lparen, \"Expect '(' after 'if'.\")\n condition = expression\n consume(:rparen, \"Expect ')' after if condition.\")\n\n then_branch = statement\n else_branch = match?(:else) ? statement : nil\n\n return Ringo::If.new(condition, then_branch, else_branch)\n end",
"title": ""
},
{
"docid": "15ae0e863918e78e08d1536d8295fe2c",
"score": "0.48156634",
"text": "def has_halt?\n @tokens.any? { |t| t.is_halt? }\n end",
"title": ""
},
{
"docid": "68f88d276ec2882deab5b274692ccc89",
"score": "0.4788473",
"text": "def one?\n when_branches.one?\n end",
"title": ""
},
{
"docid": "0ea3b58f2ca3963e6c292264965eca31",
"score": "0.47853804",
"text": "def if_condition; end",
"title": ""
},
{
"docid": "999e4d1d2aede6ad32799a1160eefb98",
"score": "0.4732456",
"text": "def elseb\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n\n\n return_value = ElsebReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n\n root_0 = nil\n\n __K_ELSE116__ = nil\n __LLAIZQ117__ = nil\n __LLADER119__ = nil\n bodyexp118 = nil\n\n\n tree_for_K_ELSE116 = nil\n tree_for_LLAIZQ117 = nil\n tree_for_LLADER119 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 127:4: K_ELSE LLAIZQ bodyexp LLADER\n __K_ELSE116__ = match( K_ELSE, TOKENS_FOLLOWING_K_ELSE_IN_elseb_560 )\n if @state.backtracking == 0\n tree_for_K_ELSE116 = @adaptor.create_with_payload( __K_ELSE116__ )\n @adaptor.add_child( root_0, tree_for_K_ELSE116 )\n\n end\n\n __LLAIZQ117__ = match( LLAIZQ, TOKENS_FOLLOWING_LLAIZQ_IN_elseb_562 )\n if @state.backtracking == 0\n tree_for_LLAIZQ117 = @adaptor.create_with_payload( __LLAIZQ117__ )\n @adaptor.add_child( root_0, tree_for_LLAIZQ117 )\n\n end\n\n @state.following.push( TOKENS_FOLLOWING_bodyexp_IN_elseb_564 )\n bodyexp118 = bodyexp\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, bodyexp118.tree )\n end\n\n __LLADER119__ = match( LLADER, TOKENS_FOLLOWING_LLADER_IN_elseb_566 )\n if @state.backtracking == 0\n tree_for_LLADER119 = @adaptor.create_with_payload( __LLADER119__ )\n @adaptor.add_child( root_0, tree_for_LLADER119 )\n\n end\n\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n if @state.backtracking == 0\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n\n end\n\n return return_value\n end",
"title": ""
},
{
"docid": "82f8633c09ac5453d951792f4be3530a",
"score": "0.4731527",
"text": "def check_condition binding\n return true if condition.nil? || condition.empty?\n begin\n Evaluator.eval_condition binding, condition\n rescue\n set_error_state \"Unable to evaluate condition\",\n refers_to: :BREAKPOINT_CONDITION\n false\n end\n end",
"title": ""
},
{
"docid": "0622af6c0b1d195aff5e0e23f80b832a",
"score": "0.47145632",
"text": "def is_transaction_type_missing_check_or_check_only?\n found_desired_transaction_type = false\n transaction_type = get_transaction_type\n if transaction_type == 'Missing Check' || transaction_type == 'Check Only'\n found_desired_transaction_type = true\n end\n found_desired_transaction_type\n end",
"title": ""
},
{
"docid": "f7c0e840025e76a67aba9db133f66676",
"score": "0.4714559",
"text": "def else *guards, &block\n if guards.empty? \n return self if self\n else\n guards.each do |cond|\n return self if send_as_function(cond)\n end\n end\n\n block_given? ? yield_or_eval(&block) : self\n end",
"title": ""
},
{
"docid": "40d61d7d48b10eb7922b8fefe51663e1",
"score": "0.47062233",
"text": "def final_decision?\n final_decision\n end",
"title": ""
},
{
"docid": "51fa7e4cc1288822ae1e54e1b2bcd80e",
"score": "0.4692658",
"text": "def if_statement(var_env)\n return nil unless eql_lit?(ECMA262::ID_IF)\n unless(eql_lit?(ECMA262::PUNC_LPARENTHESIS) and cond=exp(var_env, {}) and\n eql_lit?(ECMA262::PUNC_RPARENTHESIS) and s = statement(var_env))\n raise ParseError.new(\"unexpected token\", self)\n end\n if(eql_lit?(ECMA262::ID_ELSE) and e = statement(var_env))\n ECMA262::StIf.new(cond, s, e)\n else\n ECMA262::StIf.new(cond, s, nil)\n end\n end",
"title": ""
},
{
"docid": "e6c90674c317a3873989457123b395d1",
"score": "0.4674433",
"text": "def conditional_statement_Handler(cs)\n\texpr = cs.elems[0]\n\tinstr1 = cs.elems[1]\n\tresult = instr_Handler(instr1)\n\tif (cs.elems[2] != nil)\n\t\tinstr2 = cs.elems[2]\n\t\tresult += instr_Handler(instr2)\n\tend\n\tif (expression_Handler(expr) != :BOOLEAN)\n\t\tputs \"CONDITIONAL STATEMENT ERROR: expression must be boolean.\"\n\t\tresult += 1\n\tend\n\treturn result\nend",
"title": ""
},
{
"docid": "e6c90674c317a3873989457123b395d1",
"score": "0.4674433",
"text": "def conditional_statement_Handler(cs)\n\texpr = cs.elems[0]\n\tinstr1 = cs.elems[1]\n\tresult = instr_Handler(instr1)\n\tif (cs.elems[2] != nil)\n\t\tinstr2 = cs.elems[2]\n\t\tresult += instr_Handler(instr2)\n\tend\n\tif (expression_Handler(expr) != :BOOLEAN)\n\t\tputs \"CONDITIONAL STATEMENT ERROR: expression must be boolean.\"\n\t\tresult += 1\n\tend\n\treturn result\nend",
"title": ""
},
{
"docid": "041dfec8a6ebd3494866fca9917e7ff9",
"score": "0.4653579",
"text": "def branch_exists?(name)\n rugged.branches.exists?(name)\n\n # If the branch name is invalid (e.g. \".foo\") Rugged will raise an error.\n # Whatever code calls this method shouldn't have to deal with that so\n # instead we just return `false` (which is true since a branch doesn't\n # exist when it has an invalid name).\n rescue Rugged::ReferenceError\n false\n end",
"title": ""
},
{
"docid": "e5767f105c440a2e384bdff8f5b2ba0d",
"score": "0.46471104",
"text": "def evaluates?(item, node)\n\n # subtle: else-nodes have no conditions. since the default\n # matcher :all? returns true for an empty list we do not\n # need to check for an else node specifically.\n\n # return true if node.nodename == 'else'\n\n node.conditions.send(node.matcher) do |type, matcher, values|\n case type\n when :disambiguate\n false # TODO not implemented yet\n\n when :'is-numeric'\n evaluates_condition? matcher, values do |value|\n v = item.data.unobservable_read_attribute(value)\n v.respond_to?(:numeric?) && v.numeric?\n end\n\n when :'is-uncertain-date'\n evaluates_condition? matcher, values do |value|\n v = item.data.unobservable_read_attribute(value)\n v.respond_to?(:uncertain?) && v.uncertain?\n end\n\n\n when :locator\n locator = item.locator.to_s.tr(' ', '-')\n\n evaluates_condition? matcher, values do |value|\n value.to_s == locator\n end\n\n when :position\n false # TODO not implemented yet\n\n when :type\n type = item.data.unobservable_read_attribute(:type).to_s\n\n evaluates_condition? matcher, values do |value|\n value.to_s == type\n end\n\n when :variable\n evaluates_condition? matcher, values do |value|\n item.data.attribute?(value)\n end\n\n else\n fail \"unknown condition type: #{type}\"\n end\n end\n end",
"title": ""
},
{
"docid": "7982de1ecd359d29f684ff38b8c741dc",
"score": "0.46338972",
"text": "def if_statement\n @instruction.push(@enum.peek.value)\n match(Token.new(:reserved, 'if'))\n @instruction.push(@enum.peek.value)\n match(Token.new(:symbol, '('))\n condition_expression\n @instruction.push(@enum.peek.value)\n match(Token.new(:symbol, ')'))\n @if_count += 1\n @instruction.push('goto state_'+@if_count.to_s+';'+\"\\n\"+'goto state_'+(@if_count+1).to_s+';'+\"\\n\"+' state_'+@if_count.to_s+':;'+\"\\n\")\n @if_count += 1\n block_statements\n @instruction.push(' state_'+@if_count.to_s+\":0;\\n\")\n else_statement\n end",
"title": ""
},
{
"docid": "2ad54a04689b75affe336cff6eae5393",
"score": "0.46310204",
"text": "def halted?\n @halt\n end",
"title": ""
},
{
"docid": "28f35877101edf057ef163cb6379f6df",
"score": "0.45990318",
"text": "def in_decision\n return @decision_level > 0\n end",
"title": ""
},
{
"docid": "f89eb1f8be4ff14f05415a9a64d71110",
"score": "0.45870942",
"text": "def build_else(raise_on_error=true)\n if raise_on_error\n @code << <<-CODE\n\t\t\t\telse\n\t\t\t\t\traise NotAllowedTokenError.new(@scanner.current,#{@name})\n\t\t\tCODE\n end\n @code << \"\\nend\\n\"\n @else = \"\"\n end",
"title": ""
},
{
"docid": "326db4cc3e5542221a19d7e3c100b404",
"score": "0.4544258",
"text": "def schengen_check?\n schengen_overstay? == false && continuious_overstay? == false\n end",
"title": ""
},
{
"docid": "2c6ef2535ad0c214754945688a929b06",
"score": "0.45387113",
"text": "def check_misplaced_return(stmts)\n stmts.each do |stmt|\n case stmt\n when If\n check_misplaced_return(stmt.then_stmts)\n check_misplaced_return(stmt.else_stmts)\n when For\n check_misplaced_return(stmt.body_stmts)\n when Return\n raise \"cannot return from main\"\n end\n end\n end",
"title": ""
},
{
"docid": "db6fd8dee6cc8079d0610a5632813c94",
"score": "0.45377916",
"text": "def end(raise_on_error=true)\n build_else(raise_on_error) if @else != \"\"\n build_end\n end",
"title": ""
},
{
"docid": "2d2828e8b795d71b2aac63c1c2781eff",
"score": "0.45324004",
"text": "def if_stmt \n\t\n\t$cst.add_branch(\"IfStatement\")\n\t\n\tmatch_token(\"T_IF\", $tokens[$index])\n\tboolexpr\n\tblock\n\t\n\t$cst.ascend\n\t\nend",
"title": ""
},
{
"docid": "a18d5c3ccd53a5a9781f5b5b52db3c61",
"score": "0.45306244",
"text": "def final_state?(curr_state = nil, **)\n next_state(curr_state).blank?\n end",
"title": ""
},
{
"docid": "38c9a22dc65ec4c977e8bfde623a732a",
"score": "0.45280114",
"text": "def finish_step?\n return !goto_true && !goto_false\n end",
"title": ""
},
{
"docid": "f2489595a7f76738bf70fcec2bb91e16",
"score": "0.45247415",
"text": "def exit?\n !exit_code.nil?\n end",
"title": ""
},
{
"docid": "e49e3d2ed14e19d182c6f953f7095643",
"score": "0.45222268",
"text": "def casesGrises?()\n return @casesGrises\n end",
"title": ""
},
{
"docid": "d87c4640fec9a3f1673447b2f51b559c",
"score": "0.45216262",
"text": "def parse_stmt()\n\t\tif next_TokenGrabbed(\"skip\")\n\t\t\tputs \"Skip Hit.\"\n\t\t\ttrue\n\n\n\t\t\t# FIXME: This code sucks harder than a black hole.\n\t\telsif next_TokenGrabbed(\"if\")\n\t\t\tputs \"if statement Hit.\"\n\t\t\t\tif next_TokenGrabbed(\"(\")\n\t\t\t\tputs \"Open Paren Hit.\"\n\t\t\t\tparse_lexpr()\n\t\t\t\t\tif next_TokenGrabbed(\")\")\n\t\t\t\t\tputs \"Close Paren Hit.\"\n\t\t\t\t\t\tif next_TokenGrabbed(\"then\")\n\t\t\t\t\t\tputs \"Then Statement Hit.\"\n\t\t\t\t\t\t\tif next_TokenGrabbed(\"(\")\n\t\t\t\t\t\t\tputs \"Open Paren Hit.\"\n\t\t\t\t \t\t\tparse_stmts()\n\t\t\t\t\t\t\t\tif next_TokenGrabbed(\")\")\n\t\t\t\t\t\t\t\tputs \"Close Paren Hit.\"\n\t\t\t\t\t\t\t\tif next_TokenGrabbed(\"else\")\n\t\t\t\t\t\t\t\tputs \"else statement Hit.\"\n\t\t\t\t\t\t\t\t\tif next_TokenGrabbed(\"(\")\n\t\t\t\t\t\t\tputs \"Open Paren Hit.\"\n\t\t\t\t \t\t\tparse_stmts()\n\t\t\t\t\t\t\t\tif next_TokenGrabbed(\")\")\n\t\t\t\t\t\t\t\tputs \"Close Paren Hit.\"\n\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\n\t\telsif next_TokenGrabbed(\"while\")\n\t\t\tputs \"while statement Hit.\"\n\t\t\tif next_TokenGrabbed(\"(\")\n\t\t\t\tputs \"Open Paren Hit.\"\n\t\t\t\t parse_lexpr()\n\t\t\t\t\tif next_TokenGrabbed(\")\")\n\t\t\t\t\tputs \"Close Paren Hit.\" #FIXME: This breaks sometimes.\n\t\t\t\tif next_TokenGrabbed(\"do\")\n\t\t\t\t\tputs \"do statement Hit.\"\n\t\t\tif next_TokenGrabbed(\"(\")\n\t\t\t\tputs \"Open Paren Hit.\"\n\t\t\t\t\tparse_stmts()\n\t\t\t\tif next_TokenGrabbed(\")\")\n\t\t\t\tputs \"Close Paren Hit.\"\n\t\t\t\t\n\t\t\t\t\t# This stuff.. I have no idea. I'm afraid to touch it.\n\t\t\t\t\t\ttrue\n\t\t\t\t\telse\n\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\n\t\telsif @next_token[0].match(/[a-zA-Z]+[\\w]*/) #FIXME: Can this be done any better?\n\t\t\tputs \"Identifier Hit!\"\n\t\t\tadvance()\n\t\t\tif next_TokenGrabbed(\":=\")\n\t\t\t\tputs \"Assignment oper Hit.\"\n\t\t\t\tparse_expr()\n\t\t\t\ttrue\n\n\t\telse \n\t\t\tputs \"Error: Line \" + @token[1].to_s + \": unknown token: \" + @token[0] #This should NEVER happen.\n\t\t\tfalse\n\t\tend\n\tend\n\tend",
"title": ""
},
{
"docid": "dba7beeba8d70bc44d05fabde49f511f",
"score": "0.45117006",
"text": "def some_method(x)\n if x > 5 && x < 10\n return :a\n elsif x < 5\n return :b\n end # else??\n \n :c\nend",
"title": ""
},
{
"docid": "1e4dea6c095b09ef95e75357706b6813",
"score": "0.44989872",
"text": "def handled?\n\t\treturn ! @status.nil?\n\tend",
"title": ""
},
{
"docid": "3204542f14b44127ad783c461423f629",
"score": "0.44971305",
"text": "def browser_block\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n return_value = BrowserBlockReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal102 = nil\n string_literal105 = nil\n browser_name103 = nil\n statement_block104 = nil\n block106 = nil\n\n tree_for_char_literal102 = nil\n tree_for_string_literal105 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 417:5: '!' browser_name statement_block ( 'else' block )?\n char_literal102 = match( NOT, TOKENS_FOLLOWING_NOT_IN_browser_block_2757 )\n if @state.backtracking == 0\n\n tree_for_char_literal102 = @adaptor.create_with_payload( char_literal102 )\n @adaptor.add_child( root_0, tree_for_char_literal102 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_browser_name_IN_browser_block_2759 )\n browser_name103 = browser_name\n @state.following.pop\n if @state.backtracking == 0\n root_0 = @adaptor.become_root( browser_name103.tree, root_0 )\n end\n @state.following.push( TOKENS_FOLLOWING_statement_block_IN_browser_block_2762 )\n statement_block104 = statement_block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, statement_block104.tree )\n end\n # at line 417:39: ( 'else' block )?\n alt_20 = 2\n look_20_0 = @input.peek( 1 )\n\n if ( look_20_0 == ELSE )\n alt_20 = 1\n end\n case alt_20\n when 1\n # at line 417:41: 'else' block\n string_literal105 = match( ELSE, TOKENS_FOLLOWING_ELSE_IN_browser_block_2766 )\n @state.following.push( TOKENS_FOLLOWING_block_IN_browser_block_2769 )\n block106 = block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, block106.tree )\n end\n\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 26 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "56ffed23318f165921407094e85ef81a",
"score": "0.44960615",
"text": "def game_over?\n if victory?\n puts \"The code has been broken!\"\n true\n elsif (@turns == 12)\n puts \"The codebreaker failed.\"\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "f7571981446bed9bd436a1791b18b051",
"score": "0.4491183",
"text": "def empty_branch?(branch)\n (is_branch & (1 << branch)) == 0\n end",
"title": ""
},
{
"docid": "91d9a309d213c6822067dcccfe3c39ec",
"score": "0.44906104",
"text": "def error_check?\n !@error_rules.empty?\n end",
"title": ""
},
{
"docid": "55b7f91f86f3880743a5e16c312af067",
"score": "0.44790137",
"text": "def returns?\n branch_type == 'return'\n end",
"title": ""
},
{
"docid": "f4a35f8fd56dfec9ab43428bbc574b34",
"score": "0.44692948",
"text": "def check?\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b4c4bf837c7a73b6a916bc762e32821d",
"score": "0.4464464",
"text": "def halted?\n @halted\n end",
"title": ""
},
{
"docid": "bc19f914844fe48e9366243d87c27453",
"score": "0.44577718",
"text": "def certain?\n level = @url_generator.level\n if @parser.just_country?(@result) ||\n @parser.not_correct_country?(@result)\n false\n elsif @parser.city_present?(level) || @parser.state_present?(level) ||\n @parser.pc_present?(level)\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "1dafdde9dea9cda3ecc90b144891ece2",
"score": "0.44508362",
"text": "def truth\n\t\t\t\"You can't handle the truth\" ; true\n\t\tend",
"title": ""
},
{
"docid": "0a4626c69a412b7878fb0b829886d4f0",
"score": "0.44438708",
"text": "def ==(other)\n super && @condition == other.condition && @then_part == other.then_part && @else_part == other.else_part\n end",
"title": ""
},
{
"docid": "497af5cd00d54a03f78eae4c614cc0b6",
"score": "0.44215462",
"text": "def ok?\n @stack.stack_status == 'CREATE_COMPLETE' ||\n @stack.stack_status == 'UPDATE_COMPLETE'\n end",
"title": ""
},
{
"docid": "104dc3652850d5c1c620b7cebcc11ebb",
"score": "0.44081753",
"text": "def canary?\n @got.respond_to?('__stack_chk_fail') || @symbols.respond_to?('__stack_chk_fail')\n end",
"title": ""
},
{
"docid": "e9809e7b2e94d04ab9c2fe037a6faf25",
"score": "0.4407693",
"text": "def visitElseActions(elem, data)\r\n @@log.debug(\"XmlVisitor::visitElseActions\")\r\n @@log.debug(elem.inspect)\r\n\r\n if (elem.elements.size < 1)\r\n @@log.error(\"*** ElseActions element has no children.\")\r\n end\r\n\r\n elem.each_element do |child|\r\n data = visit(child, data)\r\n end\r\n\r\n return data\r\n end",
"title": ""
},
{
"docid": "b89af30f5541750c034bb43630cb42d6",
"score": "0.44009188",
"text": "def findlastelse(blk)\n# pp \"FFFFFFFFFFFFFFFFFF: findlastelse:\", blk\n curblk = blk\n depth=0\n while true\n nextif = curblk[1]\n nextelse = nextif[3]\n if nextelse == nil then\n return nextif\n else\n depth+=1\n curblk = nextelse\n end\n end\n raise \"should never reached\"\nend",
"title": ""
},
{
"docid": "86eb0c545273ef553f3bdad9f6f6b5cb",
"score": "0.43974665",
"text": "def missing_switches?\n !@missing_switches.nil?\n end",
"title": ""
},
{
"docid": "993d45abcb1d96311106cbe79ca636f9",
"score": "0.43970224",
"text": "def complex_condition?(condition); end",
"title": ""
}
] |
630f7f0b8ff472c7369c2fc0b3b23c0e
|
level 2 alert profiles
|
[
{
"docid": "21b12fbf0cbe2348fcbaed78480dd234",
"score": "0.0",
"text": "def x_get_tree_custom_kids(parent, count_only, options)\n assert_type(options[:type], :alert_profile)\n\n objects = MiqAlertSet.where(:mode => parent[:id].split('-'))\n\n count_only_or_objects(count_only, objects, :description)\n end",
"title": ""
}
] |
[
{
"docid": "588fc4c6b7b7a05fbd92ef17a0a3c68c",
"score": "0.60120994",
"text": "def alert_profile_get_info(alert_profile)\n @record = @alert_profile = alert_profile\n aa = @alert_profile.get_assigned_tos\n @alert_profile_tag = Classification.find(aa[:tags].first.first.parent_id) unless aa[:tags].empty?\n @alert_profile_alerts = @alert_profile.miq_alerts.sort_by { |a| a.description.downcase }\n @right_cell_text = _(\"Alert Profile \\\"%{name}\\\"\") % {:name => alert_profile.description}\n @right_cell_div = \"alert_profile_details\"\n end",
"title": ""
},
{
"docid": "519538e4f6b4bfee72f2c02c0177873b",
"score": "0.5915416",
"text": "def alert\n alerts\n end",
"title": ""
},
{
"docid": "bd50cd16950094af25e4575074881a98",
"score": "0.59088445",
"text": "def alerts \n alert = (flash[:alert] || flash[:error] || flash[:notice]) #mini conditionals\n\n if alert\n alert_generator alert\n end\n end",
"title": ""
},
{
"docid": "2419b42051fb11ecaf165390410eface",
"score": "0.58549017",
"text": "def alert\n\t\t\t(@info[@api_target] || @info[@api_target])['alert']\n\t\tend",
"title": ""
},
{
"docid": "86441a24528d3f1e4f411c8f4d07a582",
"score": "0.5776497",
"text": "def level\n @level ||= self.alert_group.level\n end",
"title": ""
},
{
"docid": "e8a2ed4097175abe6644ca63769ff2c8",
"score": "0.57605684",
"text": "def alerts\n alert = (flash[:notice] || flash[:error] || flash[:alert])\n if alert\n alert_generator alert\n end\n end",
"title": ""
},
{
"docid": "3bb3844533e8dd5c19324919ab7ae798",
"score": "0.57529324",
"text": "def level_notifier; end",
"title": ""
},
{
"docid": "3bb3844533e8dd5c19324919ab7ae798",
"score": "0.57529324",
"text": "def level_notifier; end",
"title": ""
},
{
"docid": "7d3a7e9892768a0d15acbf11c5e98ef5",
"score": "0.5731746",
"text": "def alerts\n alert = (flash[:alert] || flash[:notice] || flash[:error])\n if alert\n alert_generator alert\n end\n end",
"title": ""
},
{
"docid": "c14c31e550caa2aed82ac6b2a1590f70",
"score": "0.57313746",
"text": "def alerts\n alert = ( flash[:alert] || flash[:error] || flash[:notice] )\n \n if alert\n alert_generator(alert)\n end\n end",
"title": ""
},
{
"docid": "4b1a93cfc341de30bc054bd904fb3e92",
"score": "0.57264024",
"text": "def show\n super\n @alert_profile = @record\n aa = @alert_profile.get_assigned_tos\n @alert_profile_tag = Classification.find(aa[:tags].first.first.parent_id) unless aa[:tags].empty?\n @alert_profile_alerts = @alert_profile.miq_alerts.sort_by { |a| a.description.downcase }\n end",
"title": ""
},
{
"docid": "eae781f3b4c9cbb06eb4493b9bd2723b",
"score": "0.57005525",
"text": "def alert; end",
"title": ""
},
{
"docid": "eae781f3b4c9cbb06eb4493b9bd2723b",
"score": "0.57005525",
"text": "def alert; end",
"title": ""
},
{
"docid": "bcdab1e45ec80394606242c760b21bf6",
"score": "0.5678316",
"text": "def set_alert\n\n \tend",
"title": ""
},
{
"docid": "c628b27c0cf08fe77e066a8b60187b58",
"score": "0.56692576",
"text": "def alerts\n alert = (flash[:alert] || flash[:error] || flash[:notice])\n\n if alert\n alert_generator alert\n end\n end",
"title": ""
},
{
"docid": "444c72eb3d8019d43b2cfad708f8bbd5",
"score": "0.565743",
"text": "def flash_class(level)\n case level\n when :notice then \"alert-box radius secondary\"\n when :success then \"alert-box radius success\"\n when :error then \"alert-box radius alert\"\n when :alert then \"alert-box radius alert\"\n end\n end",
"title": ""
},
{
"docid": "e8d3427d4131c38df3940565313410bd",
"score": "0.56445765",
"text": "def flash_class(level)\n case level.to_sym\n when :notice then \"alert alert-info\"\n when :info then \"alert alert-info\"\n when :success then \"alert alert-success\"\n when :error then \"alert alert-error\"\n when :alert then \"alert alert-error\"\n end\n end",
"title": ""
},
{
"docid": "6f197fcfc4f76f45f8324393f372e116",
"score": "0.5600864",
"text": "def flash_class(level)\n case level\n when :info then \"alert alert-info\"\n when :success then \"alert alert-success\"\n when :warning then \"alert alert-warning\"\n when :danger then \"alert alert-danger\"\n end \n end",
"title": ""
},
{
"docid": "723f87a7c839a7709d65af7e447a952c",
"score": "0.55946517",
"text": "def alert\n state[\"alert\"]\n end",
"title": ""
},
{
"docid": "3aa0acadf3db57dabb427ac563423df4",
"score": "0.5574928",
"text": "def flash_class(level)\n case level.to_sym\n when :notice then \"alert-info\"\n when :error then \"alert-error\"\n when :alert then \"alert-warning\"\n when :success then \"alert-success\"\n end\n end",
"title": ""
},
{
"docid": "16b9f552a7b325fde7138c344a714ae8",
"score": "0.55738556",
"text": "def profile; end",
"title": ""
},
{
"docid": "16b9f552a7b325fde7138c344a714ae8",
"score": "0.55738556",
"text": "def profile; end",
"title": ""
},
{
"docid": "16b9f552a7b325fde7138c344a714ae8",
"score": "0.55738556",
"text": "def profile; end",
"title": ""
},
{
"docid": "16b9f552a7b325fde7138c344a714ae8",
"score": "0.55738556",
"text": "def profile; end",
"title": ""
},
{
"docid": "881fdcd492206a83f0eab2b4b6ca6a28",
"score": "0.5557502",
"text": "def alert=(message); end",
"title": ""
},
{
"docid": "881fdcd492206a83f0eab2b4b6ca6a28",
"score": "0.5557502",
"text": "def alert=(message); end",
"title": ""
},
{
"docid": "74ff8bbbd79ad92d6df50801a3def014",
"score": "0.5535996",
"text": "def alert_and_welcome\n self.player.alert_for_name\n self.player.welcome_player\n end",
"title": ""
},
{
"docid": "d660b09e672e622e3efd952541c91709",
"score": "0.55299515",
"text": "def status_change_alert\n end",
"title": ""
},
{
"docid": "74ea433fd58a360b1d57588c1142b12e",
"score": "0.5523083",
"text": "def flash_class(level)\n case level.to_sym\n when :notice then 'alert alert-info'\n when :success then 'alert alert-success'\n when :error then 'alert alert-danger'\n when :alert then 'alert alert-danger'\n end\n end",
"title": ""
},
{
"docid": "24b87d877465c75cf64a3a674fab01a5",
"score": "0.5506755",
"text": "def alert_log_message\n \"check generated an alert\"\n end",
"title": ""
},
{
"docid": "77ce776392a2e066b1872b61f795c31f",
"score": "0.55063903",
"text": "def flash_class(level)\n case level\n when :alert then \"alert\"\n when :success then \"alert alert-success\"\n when :notice then \"alert alert-info\"\n when :error then \"alert alert-error\"\n end\n end",
"title": ""
},
{
"docid": "c33c195ad443b2f64e7c0d80553370ac",
"score": "0.5495193",
"text": "def alert_group\n alert.alert_group\n end",
"title": ""
},
{
"docid": "aec35ab7b9475d4902cd26eb70926502",
"score": "0.5480953",
"text": "def boot_alert_name(type)\n case type\n when 'alert'\n 'danger'\n when 'notice'\n 'info'\n else\n type\n end\n end",
"title": ""
},
{
"docid": "70c1541ef02a4de9aa2789d09a371472",
"score": "0.5478805",
"text": "def flash_class(level)\n case level\n when 'notice' then \"alert alert-info\"\n when 'success' then \"alert alert-success\"\n when 'error' then \"alert alert-danger\"\n when 'alert' then \"alert alert-danger\"\n end\n end",
"title": ""
},
{
"docid": "e737ac5583d892cd0feaa589d0cf28c5",
"score": "0.5466901",
"text": "def flash_class(level)\n case level\n when :notice then \"alert alert-info\"\n when :success then \"alert alert-success\"\n when :error then \"alert alert-danger\"\n when :alert then \"alert alert-danger\"\n when :warning then \"alert\"\n end\n end",
"title": ""
},
{
"docid": "abf5b639ad76ac8611425eeab30955ce",
"score": "0.5466322",
"text": "def flash_class(level)\n p level\n case level\n when \"notice\" then \"alert alert-info\"\n when \"alert\" then \"alert alert-info\"\n when \"success\" then \"alert alert-success\"\n when \"error\" then \"alert alert-danger\"\n when \"danger\" then \"alert alert-danger\"\n end\n end",
"title": ""
},
{
"docid": "b1dd480849993e3b8980a4faba73c50f",
"score": "0.5426882",
"text": "def flash_class(level)\n case level\n when :notice then 'alert-info'\n when :error then 'alert-error'\n when :alert then ''\n end\n end",
"title": ""
},
{
"docid": "62060437f7df819e5c5beb7d2f53ce12",
"score": "0.5414157",
"text": "def flash_class(level)\n case level\n when 'notice' then 'alert-info'\n when 'success' then 'alert-success'\n when 'error' then 'alert-error'\n when 'alert' then 'alert alert-alert'\n end\n end",
"title": ""
},
{
"docid": "0b455230f45b0f143dbefcd59fa8d636",
"score": "0.5394655",
"text": "def flash_class(level)\n case level\n when 'notice' then \"alert alert-info\"\n when 'success' then \"alert alert-success\"\n when 'error' then \"alert alert-error\"\n when 'alert' then \"alert alert-error\"\n end\n end",
"title": ""
},
{
"docid": "6f6adc144b2a2c2e90ff8f7f979d1e5f",
"score": "0.53930676",
"text": "def level() end",
"title": ""
},
{
"docid": "2fdcc354eda449f0ff9c494762269b83",
"score": "0.53808475",
"text": "def map_alert(type)\n alert_mappings = {\n notice: \"success\",\n alert: \"warning\"\n }\n alert_mappings[type.to_sym] || type.to_s\n end",
"title": ""
},
{
"docid": "0a40f3432063fa19f4f556886244188e",
"score": "0.5375849",
"text": "def dummy_msg\n \"JUST HERE FOR FUN W #{object.profile_name}\"\n end",
"title": ""
},
{
"docid": "c731e2cb6f6cca13dae135b9b5ccb23d",
"score": "0.5370973",
"text": "def level_up2\n @level += SAR::Game_Cheat::LEVEL\n self.class.learnings.each do |learning|\n learn_skill(learning.skill_id) if learning.level == @level\n end\n if SAR::Game_Cheat::LEVELDIS\n $game_message.new_page\n $game_message.add(sprintf(Vocab::LevelUp, @name, Vocab::level, @level))\n end\n end",
"title": ""
},
{
"docid": "84e4723d2de2dc73d0f43ac8ce2c1df5",
"score": "0.5370038",
"text": "def cookie_alert_render_secondary_alert\n render partial: CookieAlert.config.secondary_alert_template\n end",
"title": ""
},
{
"docid": "8860c0c2bdaf0e433e884f40c8cd0ac4",
"score": "0.53692454",
"text": "def profiles; end",
"title": ""
},
{
"docid": "8860c0c2bdaf0e433e884f40c8cd0ac4",
"score": "0.53692454",
"text": "def profiles; end",
"title": ""
},
{
"docid": "3608ef5ed4e0c70180896285b5225ea8",
"score": "0.536014",
"text": "def get_alert()\n return get_string(\"getAlert\", [])\n end",
"title": ""
},
{
"docid": "8d374af88721944dcdbf95b36bbefa88",
"score": "0.5355213",
"text": "def flash_class(level)\n case level\n when :notice then \"alert alert-info\"\n when :success then \"alert alert-success\"\n when :error then \"alert alert-error\"\n when :alert then \"alert alert-error\"\n end\n end",
"title": ""
},
{
"docid": "2a2c0cba03e2bb2a39c26e3990d89f4a",
"score": "0.5353194",
"text": "def flash_class(level)\n case level.to_sym\n when :success then \"alert-success alert-dismissable\"\n when :notice then \"alert-info alert-dismissable\"\n when :alert then \"alert-warning alert-dismissable\"\n when :error then \"alert-danger\"\n end\n end",
"title": ""
},
{
"docid": "529089bc66472bf02f69a222b93734ea",
"score": "0.533248",
"text": "def flash_class(level)\n case level\n when 'notice' then \"alert alert-info\"\n when 'success' then \"alert alert-success\"\n when 'error' then \"alert alert-danger\"\n when 'alert' then \"alert alert-warning\"\n end\n end",
"title": ""
},
{
"docid": "f281a4753162ac3b8b3877653870c16e",
"score": "0.5325327",
"text": "def profile\n end",
"title": ""
},
{
"docid": "f281a4753162ac3b8b3877653870c16e",
"score": "0.5325327",
"text": "def profile\n end",
"title": ""
},
{
"docid": "f281a4753162ac3b8b3877653870c16e",
"score": "0.5325327",
"text": "def profile\n end",
"title": ""
},
{
"docid": "f281a4753162ac3b8b3877653870c16e",
"score": "0.5325327",
"text": "def profile\n end",
"title": ""
},
{
"docid": "f281a4753162ac3b8b3877653870c16e",
"score": "0.5325327",
"text": "def profile\n end",
"title": ""
},
{
"docid": "f281a4753162ac3b8b3877653870c16e",
"score": "0.5325327",
"text": "def profile\n end",
"title": ""
},
{
"docid": "f281a4753162ac3b8b3877653870c16e",
"score": "0.5325327",
"text": "def profile\n end",
"title": ""
},
{
"docid": "f281a4753162ac3b8b3877653870c16e",
"score": "0.5325327",
"text": "def profile\n end",
"title": ""
},
{
"docid": "f281a4753162ac3b8b3877653870c16e",
"score": "0.5325327",
"text": "def profile\n end",
"title": ""
},
{
"docid": "f281a4753162ac3b8b3877653870c16e",
"score": "0.5325327",
"text": "def profile\n end",
"title": ""
},
{
"docid": "f281a4753162ac3b8b3877653870c16e",
"score": "0.5325327",
"text": "def profile\n end",
"title": ""
},
{
"docid": "f281a4753162ac3b8b3877653870c16e",
"score": "0.5325327",
"text": "def profile\n end",
"title": ""
},
{
"docid": "c3ff619182375dc771e867c050a7917e",
"score": "0.5322755",
"text": "def flash_class(level)\n case level\n when :notice then \"alert alert-info\"\n when :success then \"alert alert-success\"\n when :error then \"alert alert-danger\"\n when :alert then \"alert alert-danger\"\n end\n end",
"title": ""
},
{
"docid": "c3ff619182375dc771e867c050a7917e",
"score": "0.5322755",
"text": "def flash_class(level)\n case level\n when :notice then \"alert alert-info\"\n when :success then \"alert alert-success\"\n when :error then \"alert alert-danger\"\n when :alert then \"alert alert-danger\"\n end\n end",
"title": ""
},
{
"docid": "9a2c98f8329540321ed2258b266f6436",
"score": "0.53219914",
"text": "def alerts\n return @alerts['alerts']\n end",
"title": ""
},
{
"docid": "d5ac6e59d0b5cbd38b2686f897440e4b",
"score": "0.5321181",
"text": "def alert_get_info(alert)\n @record = @alert = alert\n @email_to = []\n if @alert.responds_to_events == \"_hourly_timer_\"\n @event = _(\"Hourly Timer\")\n else\n e = MiqEventDefinition.find_by(:name => @alert.responds_to_events)\n @event = e.nil? ? _(\"<No Event configured>\") : e.etype.description + \": \" + e.description\n end\n if @alert.options && @alert.options[:notifications] && @alert.options[:notifications][:email] && @alert.options[:notifications][:email][:to]\n @alert.options[:notifications][:email][:to].each do |to|\n user = User.find_by(:email => to)\n @email_to.push(user ? \"#{user.name} (#{to})\" : to)\n end\n end\n @right_cell_text = _(\"Alert \\\"%{name}\\\"\") % {:name => alert.description}\n @right_cell_div = \"alert_details\"\n\n @record = @alert\n @expression_table = exp_build_table(@alert.expression.exp) if @alert.expression.kind_of?(MiqExpression)\n\n if x_active_tree == :alert_tree\n @alert_profiles = @alert.memberof.sort_by { |p| p.description.downcase }\n end\n\n if @alert.expression && !@alert.expression.kind_of?(MiqExpression) # Get the EMS if it's in the expression\n @ems = ExtManagementSystem.find_by(:id => @alert.expression[:options][:ems_id])\n end\n if @alert.expression.kind_of?(Hash) && @alert.expression[:eval_method]\n MiqAlert.expression_options(@alert.expression[:eval_method]).each do |eo|\n case eo[:name]\n when :perf_column\n @perf_column_unit = alert_get_perf_column_unit(eo[:values][@alert.db][@alert.expression[:options][:perf_column]])\n end\n end\n end\n end",
"title": ""
},
{
"docid": "717a32e01ac9acefacaa9f39698128cf",
"score": "0.53163373",
"text": "def render_alert_class\n flash.keys.first == :notice ? \"alert-info\" : \"alert-\"+flash.keys.first.to_s\n end",
"title": ""
},
{
"docid": "17a3610c9222029403bf89782daf2975",
"score": "0.5307805",
"text": "def show\n super\n @alert = @record\n @email_to = []\n if @alert.responds_to_events == \"_hourly_timer_\"\n @event = _(\"Hourly Timer\")\n else\n e = MiqEventDefinition.find_by(:name => @alert.responds_to_events)\n @event = e.nil? ? _(\"<No Event configured>\") : e.etype.description + \": \" + e.description\n end\n if @alert.options && @alert.options[:notifications] && @alert.options[:notifications][:email] && @alert.options[:notifications][:email][:to]\n @alert.options[:notifications][:email][:to].each do |to|\n user = User.find_by(:email => to)\n @email_to.push(user ? \"#{user.name} (#{to})\" : to)\n end\n end\n\n @expression_table = exp_build_table(@alert.expression.exp) if @alert.expression.kind_of?(MiqExpression)\n @alert_profiles = @alert.memberof.sort_by { |p| p.description.downcase }\n\n if @alert.expression && !@alert.expression.kind_of?(MiqExpression) # Get the EMS if it's in the expression\n @ems = ExtManagementSystem.find_by(:id => @alert.expression[:options][:ems_id])\n end\n if @alert.expression.kind_of?(Hash) && @alert.expression[:eval_method]\n @expression_options = MiqAlert.expression_options(@alert.expression[:eval_method])\n @expression_options.each do |eo|\n case eo[:name]\n when :perf_column\n @perf_column_unit = alert_get_perf_column_unit(eo[:values][@alert.db][@alert.expression[:options][:perf_column]])\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5bd03c3f6f78591c9460a2585d39ca6b",
"score": "0.52988595",
"text": "def profile_status_message\n profile = self.presenter_profile\n if profile == nil\n \"No profile created\"\n else\n if profile.pending_admin?\n \"Pending Approval\"\n elsif profile.draft_admin?\n \"Draft Saved\"\n elsif profile.pending_presenter?\n \"Pending Approval\"\n elsif profile.draft_presenter?\n \"Draft Saved\"\n else\n \"\"\n end\n end\n end",
"title": ""
},
{
"docid": "596fb29402c23c2921be270177d95f55",
"score": "0.5285265",
"text": "def display_level_up_sub(new_skills)\n return if !@subclass_id || @subclass_id == 0\n level_sub = class_level(@subclass_id).to_i\n $game_message.new_page\n temp = ESTRIOLE::SUBCLASS_VOCAB\n text = \"%s's %s now reached %s %s!\"\n text = \"%s's %s now reached\\n%s %s!\" if SceneManager.scene_is?(Scene_Battle)\n $game_message.add(sprintf(text, @name, temp ,Vocab::level ,level_sub))\n new_skills.each do |skill|\n $game_message.add(sprintf(Vocab::ObtainSkill, skill.name))\n end\n end",
"title": ""
},
{
"docid": "6ee0bc68fd030d4d650fea743db0dd93",
"score": "0.5270204",
"text": "def track_alerts(item)\n perform_action(:alert, item) if item.verdict.count {|x| x == :alert } >= 1 \n end",
"title": ""
},
{
"docid": "52c2032e2adfa336ae401de85ecd292b",
"score": "0.5266686",
"text": "def badge_level_up\n\t\tbadge_level_up_aux(\"Chef\",\"chef\",\"doneits\")\n\tend",
"title": ""
},
{
"docid": "68cab7e8c023cb56560cef273b9bc86e",
"score": "0.5240468",
"text": "def alert\n string_command \"getAlert\"\n end",
"title": ""
},
{
"docid": "0f215963888e07b62b1269348c4aa9c3",
"score": "0.5223586",
"text": "def level\n if self.user_level == 1\n level= \"Admin\"\n elsif self.user_level == 2\n level= \"Teller\"\n elsif self.user_level == 3\n level= \"Customer\"\n else\n level= \"NO LEVEL!\"\n end\n\tend",
"title": ""
},
{
"docid": "0f215963888e07b62b1269348c4aa9c3",
"score": "0.5223586",
"text": "def level\n if self.user_level == 1\n level= \"Admin\"\n elsif self.user_level == 2\n level= \"Teller\"\n elsif self.user_level == 3\n level= \"Customer\"\n else\n level= \"NO LEVEL!\"\n end\n\tend",
"title": ""
},
{
"docid": "e3b3423e761f8bfc84e362f5e62ba2cc",
"score": "0.5221732",
"text": "def alert(type=\"info\", message=\"\")\n return \"\" if message.empty?\n signs = {success: \"info\", info: \"info\", warning: \"warning\", danger: \"warning\"}\n %(<div class=\"alert alert-#{type}\" role=\"alert\"><strong>\n <span class=\"glyphicon glyphicon-#{signs[type.to_sym]}-sign\"></span> #{message.h}</strong></div>)\n end",
"title": ""
},
{
"docid": "813a8edf9a27b46a0871edfb07ad6512",
"score": "0.52214575",
"text": "def default_text_for_bootstrap_alert(level)\n text = case level.to_sym\n when :notice then nil\n when :error then '<strong>Oh oh!</strong> Parece que hay algún dato erróneo'\n when :alert then nil\n when :success then '<strong>Listo!</strong> Se han actualizado los datos'\n else nil\n end\n return nil unless text\n text.html_safe\n end",
"title": ""
},
{
"docid": "f9ed0e9b5603a8ed36a4d1212f510570",
"score": "0.52046496",
"text": "def iLevel; end",
"title": ""
},
{
"docid": "12b13b9b7d03006ac4289e03d8285256",
"score": "0.5199327",
"text": "def create_alertus_alert(profile_id, message, alertus_url, alertus_groups)\n client = Savon.client(wsdl: alertus_url, headers: {\"SOAPAction\" => \"\"})\n p = client.call(:get_alert_profile, message: {arg0: profile_id})\n profile = p.body[:get_alert_profile_response][:return]\n coder = HTMLEntities.new\n message = coder.decode(message)\n alertus_data = {\n :alert_profile => profile,\n :text => message.gsub(/\\r/, \" \").gsub(/\\n/, \" \").gsub(\"_\", \" \"),\n :sender => \"#{self.started_by.email}\",\n :client_name => \"Regroup\",\n :duration => \"900000\",\n :priority => \"1\"\n }\n if alertus_groups.include?(\"All\")\n alertus_data = alertus_data.merge(\n {:command_recipients => {\n :address_mode => {:address_mode => \"All\", :id => \"0\"},\n :localization_mode => \"0\"\n }})\n else\n alertus_data = alertus_data.merge(\n {:command_recipients => {\n :address_mode_recipients => alertus_groups,\n :address_mode => {:address_mode => \"Group\", :id => \"1\"},\n :localization_mode => \"0\"\n }})\n end\n res = client.call(:dispatch_alertus_message, message: {:arg0 => alertus_data})\n Rails.logger.error \"AlertUS Response: #{res.body}\"\n self.update_attributes(:alertus_message_id => res.body[:dispatch_alertus_message_response][:return][:id])\n end",
"title": ""
},
{
"docid": "623c19cfd6307bcee2c9984875978030",
"score": "0.5199211",
"text": "def alert_type\n return @alert_type\n end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
},
{
"docid": "abcd899e1bf5918bb9aaf9f3f9fa8537",
"score": "0.51898795",
"text": "def level; end",
"title": ""
}
] |
c677e2ccb36ab955c74a7bce3764b9f6
|
POST /people POST /people.json
|
[
{
"docid": "d530f6d60f147f8ccce399f9f99f8503",
"score": "0.0",
"text": "def create\n @person = Person.new(person_params)\n @agreement = Agreement.last\n @person.skip_validation = false\n respond_to do |format|\n if @person.save\n @person.agreements << Agreement.last\n if current_user\n if current_user.user?\n current_user.person_id = @person.id\n current_user.save\n end\n end\n format.html { redirect_to @person, notice: 'Uppgifterna lades till. Tack.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "b15085b8ebe0f929720fc799ccb1766b",
"score": "0.67881876",
"text": "def create\n @person = current_user.created_people.new(person_params_with_school)\n if @person.save\n render :show, status: :created, location: api_v1_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "35beccf91c252011cd0016e1db719ce4",
"score": "0.6764775",
"text": "def create\n @person = Person.new(person_params)\n if @person.save\n render :show, status: :created, location: api_v2_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a0d8b83aaf2298d96096735a2a5139e0",
"score": "0.6746794",
"text": "def create\n @person = Person.new(person_params)\n\n if @person.save\n render json: { status: 'POST Success', id: @person.id }, status: :ok\n else\n render json: { status: 'Error', message:'Error registering a new person', person: @person.errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fe2800b7060e1827064c381bd2d9a241",
"score": "0.6744064",
"text": "def create\n @person = current_user.created_people.new(person_params_with_school)\n if @person.save\n render :show, status: :created, location: api_v2_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "20a984a71d6e43b9c9ec17c148af539f",
"score": "0.6739768",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html do\n redirect_to people_url, notice: 'Person was successfully created.'\n end\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json do\n render json: @person.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a507799d918ce67f832795dc11280a21",
"score": "0.6729674",
"text": "def create\n \t@person = Person.new(person_params) \t\n respond_to do |format|\n if @person.save\n format.json {render json: @person, status: :ok }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a72994fd1cbe464e1d7720a4a6a8693f",
"score": "0.66953397",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to people_path, notice: 'Person was successfully created.' }\n format.json { render action: 'show', status: :created, location: @person }\n else\n format.html { render action: 'new' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c0bd7623669f084c71cc14d6a6fe7cb",
"score": "0.6693399",
"text": "def create\n @person = @account.people.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25c7221fa0a785cce1ab34979137cc83",
"score": "0.66375554",
"text": "def create\n @people = People.new(people_params)\n\n respond_to do |format|\n if @people.save\n format.html { redirect_to root_path, notice: 'Um VIP ' + @people.name.to_s + ' foi criado com sucesso!' }\n format.json { render :show, status: :created, location: @people }\n else\n format.html { render :new }\n format.json { render json: @people.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38100e6b6a949b8989e0e89c7210a00a",
"score": "0.6606581",
"text": "def create\n @person_info = PersonInfo.new(person_info_params(params[:person_info]))\n\n if @person_info.save\n render json: @person_info, status: :created, location: @person_info\n else\n render json: @person_info.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ab7ad30bc41b3732c02cb820e8e158d7",
"score": "0.6598919",
"text": "def create\n @person = Person.new\n \tpopulate_attributes(@person, params[:person])\n \n respond_to do |format|\n if @person.save\n @person = Person.find(@person.id)\n populate_attributes(@person, params[:person])\n @person.save\n\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a94ddadb4257f161e3d85147f28b083f",
"score": "0.6555125",
"text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a94ddadb4257f161e3d85147f28b083f",
"score": "0.6555125",
"text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a94ddadb4257f161e3d85147f28b083f",
"score": "0.6555125",
"text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a94ddadb4257f161e3d85147f28b083f",
"score": "0.6555125",
"text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12adefe11cb7bc6c80bb838bb396b38d",
"score": "0.65204376",
"text": "def create\n @user_person = UserPerson.new(params[:user_person])\n\n respond_to do |format|\n if @user_person.save\n format.html { redirect_to @user_person, notice: 'User person was successfully created.' }\n format.json { render json: @user_person, status: :created, location: @user_person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e2ac315060056e75b0f5825323cd933",
"score": "0.65104914",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: \"#{@person.name} was successfully created.\" }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78d69f28ebe9b82861b92a9457e818d6",
"score": "0.64947516",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78d69f28ebe9b82861b92a9457e818d6",
"score": "0.64947516",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78d69f28ebe9b82861b92a9457e818d6",
"score": "0.64947516",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78d69f28ebe9b82861b92a9457e818d6",
"score": "0.64947516",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78d69f28ebe9b82861b92a9457e818d6",
"score": "0.64947516",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78d69f28ebe9b82861b92a9457e818d6",
"score": "0.64947516",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78d69f28ebe9b82861b92a9457e818d6",
"score": "0.64947516",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78d69f28ebe9b82861b92a9457e818d6",
"score": "0.64947516",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aba4610616208badfe7c56f5a2804f32",
"score": "0.6486652",
"text": "def create\n @people = People.new(params[:people])\n\n respond_to do |format|\n if @people.save\n flash[:notice] = 'People was successfully created.'\n format.html { redirect_to(@people) }\n format.xml { render :xml => @people, :status => :created, :location => @people }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @people.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "624fdda08bdae71a0137fdb55a3210a5",
"score": "0.645885",
"text": "def create \n @person = Person.new(person_params)\n respond_to do |format|\n if @person.save!\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "002d23cdeafb9a4659927d369c980914",
"score": "0.6441447",
"text": "def create\n @person = Person.new(params[:person])\n \n #save name(s)\n #params[:name].each {|name| \n # @name = Name.new\n # @name.name = name\n # @name.person_id = @person.id\n # @name.save\n #}\n\n respond_to do |format|\n if @person.save\n flash[:notice] = 'Person was successfully created.'\n format.html { redirect_to(@person) }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\", :layout => \"main\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0b74d79ce60ce319eed7f45fbbe37a4",
"score": "0.6437698",
"text": "def create\n @person.save\n respond_with(@person, :location => people_path)\n end",
"title": ""
},
{
"docid": "bb37128cc8bf88e76aa3874df55d8c83",
"score": "0.64308655",
"text": "def create\n # if “Content-Type” header is set as “application/json” then ...\n if request.content_type == \"application/json\" \n # Person.new is like a \"Insert into People values ...\" in SQL\n @person = Person.new(person_params)\n # .save is the commit to database\n if @person.save\n # :created is the http status code 201\n render json: @person, status: :created\n # :bad_request is the http status code 400\n else\n render json: @person.errors, status: :bad_request #:unprocessable_entity\n end\n else\n render status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "95d4f4eb10058eedd1ab9071f553513c",
"score": "0.64277434",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render action: 'show', status: :created, location: @person }\n else\n format.html { render action: 'new' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "40983dddacbc366305f56631a704ec5d",
"score": "0.6350435",
"text": "def create\n @person = Person.new(params[:person])\n \n respond_to do |format|\n if @person.save\n format.html { redirect_to \"people/#{@person.id}\" }\n format.json { render :nothing }\n format.xml { render :nothing }\n else \n format.html { render :action => \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "daf4cc93a72115ce296fbe1754b6f1be",
"score": "0.6328709",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.js {}\n format.html { redirect_to people_url, notice: \"Person #{@person.first_name} was successfully created.\" }\n format.json { render :show, status: :created, location: @person }\n else\n format.js {}\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f33e99c62322c3df2957a62846d7c430",
"score": "0.63102233",
"text": "def create\n @people = People.new(people_params) \n @people.user_created_id = current_user.id \n respond_to do |format|\n if @people.save\n format.html { redirect_to @people, notice: 'Persona creada con éxito.' }\n format.json { render :show, status: :created, location: @people }\n else\n format.html { render :new }\n format.json { render json: @people.errors, status: :unprocessable_entity }\n end\n end \n end",
"title": ""
},
{
"docid": "0e4878a1b21ca8c2f38c63c79879f68b",
"score": "0.63038504",
"text": "def create\n\t\t@person = Person.new(person_params)\n\n\t\trespond_to do |format|\n\t\t\tif @person.save\n\t\t\t\tformat.html { redirect_to @person, notice: 'Person was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @person }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @person.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d7529fe4baa759a9c15dbab502062638",
"score": "0.6258656",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to admin_person_url(@person), notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d331fce7a3b49510a52c981ccf1b6fe5",
"score": "0.6258096",
"text": "def create\r\n @person = Person.new(person_params)\r\n set_field\r\n\r\n respond_to do |format|\r\n if @person.save\r\n format.json { render :show, status: :created, location: @person }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @person.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "186d7eb40069b62dabf3514b2688036c",
"score": "0.6255262",
"text": "def create\n @persona = Persona.new(params[:persona])\n \n respond_to do |format|\n if @persona.save\n format.json { render :json => @persona,\n :status => :created, :location => @persona }\n else\n format.json { render :json => @persona.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67133f79e79dbbbc18b71fa0c3cf43e1",
"score": "0.62043524",
"text": "def create\n @person = Person.new(person_params)\n # @person.addresses.build()\n respond_to do |format|\n if @person.save\n # @person.addresses.create\n # @person.companies.create\n\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n @addresses = @person.addresses\n @page_title = 'Add a new person'\n addresses = @person.addresses.build\n companies = @person.companies.build\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64524c9899db194e26f5de1bb5a77cb9",
"score": "0.6203833",
"text": "def people_params\n params.permit(people: [:first_name, :last_name, :email, :phone])\n end",
"title": ""
},
{
"docid": "10f5b019f16954066eded87b824aa53d",
"score": "0.61962974",
"text": "def create\n @person = Person.new(params[:person])\n flash[:notice] = 'Person was successfully created.' if @person.save\n respond_with(@person)\n end",
"title": ""
},
{
"docid": "c57df070552cec4f1fd277b12f568ecd",
"score": "0.6189019",
"text": "def create\n @person = Person.new(params[:person])\n current_organization.people << @person\n if @person.save\n redirect_to people_path, notice: @person.name.to_s + ' was successfully created.'\n else\n render action: \"new\"\n end\n end",
"title": ""
},
{
"docid": "89ffec28286a0dffca3725743bf002b0",
"score": "0.6185893",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: \"Person was successfully created.\" }\n flash.alert = \"Person updated\"\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0d565bc049805e8860f073f17376c01",
"score": "0.6185193",
"text": "def create\n \n# next line commented out and following line added 2 aug 17 for connecting users to people (step 17)\n# Person.create(person_params)\n current_user.people.create(person_params) # check nomster/flixter code in this area\n\n redirect_to new_person_path # change to redirect to page showing person created, maybe entire tree\n end",
"title": ""
},
{
"docid": "6591334d64f5ace8500a624da05f811a",
"score": "0.6182681",
"text": "def new\n @person = people_type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "14d2a67bfdb5ca70d48aa137c614a517",
"score": "0.614",
"text": "def create\n @person = Person.new(person_params)\n authorize! :create, @person\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: t('.create_ok') }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e5b4625f083f475371812acc015a67a",
"score": "0.61326283",
"text": "def create(data)\n data.each do |response|\n puts person = @person_repository.create_or_find(response)\n homeworld_response = StarwarsService.get_response(response[\"homeworld\"])\n planet = @planet_repository.find(homeworld_response[\"name\"]).first\n person.planet_id = planet.id\n\n if response[\"species\"].empty? == false\n species_response = StarwarsService.get_response(response[\"species\"].first)\n specie = @specie_repository.find(species_response[\"name\"]).first\n person.specie_id = specie.id\n end\n person.save\n end\n end",
"title": ""
},
{
"docid": "e4905c10f1953b43656d117101d59936",
"score": "0.60855377",
"text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.js\n format.json { render json: @person, status: :created, location: @person }\n else\n format.js\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a8c64c803263c454384e0150900db67",
"score": "0.60836893",
"text": "def create\n logger.debug(\"PeopleController.create: person_params: #{person_params.inspect}\")\n\n @person = Person.new(person_params)\n logger.debug(\"PeopleController.create: @person: #{@person.inspect}\")\n\n respond_to do |format|\n if @person.save \n # TBD: setup specs for this: or we will be adding to our 'technical debt'!\n Notifier.notice(@person, 'new account').deliver\n format.html do\n sign_in @person\n flash[:success] = \"Welcome to Talk Invite!\"\n redirect_to @person\n end\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "b6cf3006a27af3e8343007d006948229",
"score": "0.60831004",
"text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Клиент создан' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "16f56e809fc1a06303b138aa2aa065cc",
"score": "0.60666573",
"text": "def create\n @personnage = Personnage.new(params[:personnage])\n\n respond_to do |format|\n if @personnage.save\n format.html { redirect_to @personnage, notice: 'Personnage was successfully created.' }\n format.json { render json: @personnage, status: :created, location: @personnage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @personnage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42d35d69998925e2f6344c5b70640164",
"score": "0.6053629",
"text": "def create\n @related_person = RelatedPerson.new(related_person_params)\n\n respond_to do |format|\n if @related_person.save\n format.html { redirect_to @related_person, notice: 'Related person was successfully created.' }\n format.json { render :show, status: :created, location: @related_person }\n else\n format.html { render :new }\n format.json { render json: @related_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8d125894989976edc65dd537d70947e",
"score": "0.6052461",
"text": "def create\n @request_person = RequestPerson.new(request_person_params)\n\n respond_to do |format|\n if @request_person.save\n format.html { redirect_to @request_person, notice: 'Request person was successfully created.' }\n format.json { render :show, status: :created, location: @request_person }\n else\n format.html { render :new }\n format.json { render json: @request_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f186392fd95e4ca74a8ec1de48c0a6c",
"score": "0.6039029",
"text": "def create\n filter_sampled_persons_ineligibilties\n\n @person = Person.new(params[:person])\n @provider = Provider.find(params[:provider_id]) unless params[:provider_id].blank?\n\n respond_to do |format|\n if @person.save\n create_relationship_to_participant\n\n path = people_path\n msg = 'Person was successfully created.'\n if @provider\n path = provider_path(@provider)\n msg = \"Person was successfully created for #{@provider}.\"\n end\n format.html { redirect_to(path, :notice => msg) }\n format.json { render :json => @person }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @person.errors }\n end\n end\n end",
"title": ""
},
{
"docid": "193e8ef4b231f681d70307e597309e61",
"score": "0.60340136",
"text": "def create\n @person = Person.new( person_params )\n respond_to do |format|\n if @person.save\n format.html { render :edit, notice: t( 'people.msg.new_ok' )}\n else\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "27d50edd7bb50ba33a2f13fccfd159e2",
"score": "0.6025379",
"text": "def create\n\t\t@person = Person.create(person_params)\n\t\tredirect_to person_url(@person)\n\tend",
"title": ""
},
{
"docid": "8abe64e65fa676b4a2584c08b8591191",
"score": "0.60247153",
"text": "def test_post_request_collection\n params = {\n size: 3,\n employmentTypeUris: ['/dk/atira/pure/person/employmenttypes/academic'],\n employmentStatus: 'ACTIVE'\n }\n response = client.persons.all_complex params: params\n assert_equal response.code, 200\n assert_instance_of HTTP::Response, response\n end",
"title": ""
},
{
"docid": "c41bde8c573a093f99a37ca945ca266d",
"score": "0.598812",
"text": "def create\n @person = Person.new(params[:person])\n work = Work.find(@person.work_id) if @person.work_id.present?\n expression = Expression.find(@person.expression_id) if @person.expression_id.present?\n manifestation = Manifestation.find(@person.manifestation_id) if @person.manifestation_id.present?\n\n respond_to do |format|\n if @person.save\n if work\n @person.works << work\n end\n if expression\n @person.expressions << expression\n end\n if manifestation\n @person.manifestations << manifestation\n end\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9f77954923258295a9891ec98d5fc5e9",
"score": "0.5985407",
"text": "def create\n if params['csv_file'].present?\n require 'csv'\n params[:people] = []\n csv_text = File.read(params['csv_file'].path)\n csv = CSV.parse(csv_text, :headers => true)\n csv.each do |row|\n params[:people] << row.to_hash\n end\n people = Person.create(people_params[:people])\n render json: people.as_json(methods: :error_messages), status: :ok\n elsif params['person'].present?\n person = Person.new(person_params)\n if person.save\n render json: person.as_json(methods: :error_messages), status: :ok\n else\n render json: { errors: person.error_messages }, status: :unprocessable_entity\n end\n else\n render json: { message: 'CSV file not found.' }, status: :not_found and return\n end\n end",
"title": ""
},
{
"docid": "477ef045d5813f17d2cdf2e5c4f29643",
"score": "0.5961036",
"text": "def create\n @team_person = TeamPerson.new(team_person_params)\n\n respond_to do |format|\n if @team_person.save\n format.html { redirect_to @team_person, notice: 'Team person was successfully created.' }\n format.json { render :show, status: :created, location: @team_person }\n else\n format.html { render :new }\n format.json { render json: @team_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "82df168a333cee961d3dda86985650a6",
"score": "0.5958211",
"text": "def create\n\n if !params[:name].nil? && !params[:email].nil?\n user = User.find_by_email(params[:email])\n if user\n pet = user.pets.create(name:params[:name], observations: params[:observations])\n if pet\n render json: pet, status: :created\n else\n render json: {message: 'There was an error saving pet, please try it again'}, status: :bad_request\n end\n else\n render json: {message: 'There was an error saving pet, please try it again'}, status: :bad_request\n end\n else\n render json: {message: 'Pet name not provided'}, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "075c0ee7cfc6daa5dec71740ba4f91c7",
"score": "0.5954977",
"text": "def create\n @people_number = PeopleNumber.new(people_number_params)\n\n respond_to do |format|\n if @people_number.save\n format.html { redirect_to @people_number, notice: 'People number was successfully created.' }\n format.json { render :show, status: :created, location: @people_number }\n else\n format.html { render :new }\n format.json { render json: @people_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e92ebeaf524036ff7dcc1f1b2371976b",
"score": "0.59527683",
"text": "def create\n @projects_person = ProjectsPerson.new(params[:projects_person])\n\n respond_to do |format|\n if @projects_person.save\n format.html { redirect_to @projects_person, notice: 'Projects person was successfully created.' }\n format.json { render json: @projects_person, status: :created, location: @projects_person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @projects_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b650e6c5a56f5c06bc5b63dbe4892be",
"score": "0.59509444",
"text": "def create\n @tasks_person = TasksPerson.new(params[:tasks_person])\n\n respond_to do |format|\n if @tasks_person.save\n format.html { redirect_to @tasks_person, notice: 'Tasks person was successfully created.' }\n format.json { render json: @tasks_person, status: :created, location: @tasks_person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tasks_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0dd6337586c898536ec6bfb09b5ade11",
"score": "0.59285986",
"text": "def create\n @addresses_person = AddressesPerson.new(addresses_person_params)\n\n respond_to do |format|\n if @addresses_person.save\n format.html { redirect_to @addresses_person, notice: 'Addresses person was successfully created.' }\n format.json { render :show, status: :created, location: @addresses_person }\n else\n format.html { render :new }\n format.json { render json: @addresses_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "546d159f55eaa83b89f73029d114419f",
"score": "0.59091806",
"text": "def create\n @persona = Persona.new(params[:persona])\n\n respond_to do |format|\n if @persona.save\n format.html { redirect_to @persona, notice: 'Persona was successfully created.' }\n format.json { render json: @persona, status: :created, location: @persona }\n else\n format.html { render action: \"new\" }\n format.json { render json: @persona.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7d18f0a0f79ebc37c19c726fb1dabee",
"score": "0.5908004",
"text": "def create\n @person = Person.new(person_params)\n \n if @person.save\n redirect_to action: 'list'\n else\n render action: 'new'\n end\n end",
"title": ""
},
{
"docid": "ba33f0a84e1eb6944a4f0c70f2513b2f",
"score": "0.5903917",
"text": "def people_params\n params.require(:people).permit(:first_name,:surname, :type_identification, :identification_document, \n :email, :date_birth, :sex, :civil_status, :phone, :cellphone, :address )\n end",
"title": ""
},
{
"docid": "2e09e4ee8e5afc829e308cdb3a82e882",
"score": "0.5893905",
"text": "def create\n @persona = Persona.new(params[:persona])\n\n respond_to do |format|\n if @persona.save\n format.html { redirect_to @persona, notice: 'la Persona fue creada exitosamente.' }\n format.json { render json: @persona, status: :created, location: @persona }\n else\n format.html { render action: \"new\" }\n format.json { render json: @persona.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32065dfa4f97026953b84f24efcf9f94",
"score": "0.5879194",
"text": "def create\n @personaje = Personaje.new(params[:personaje])\n\n respond_to do |format|\n if @personaje.save\n format.html { redirect_to @personaje, notice: 'Personaje was successfully created.' }\n format.json { render json: @personaje, status: :created, location: @personaje }\n else\n format.html { render action: \"new\" }\n format.json { render json: @personaje.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4e2f0df213a8b75729f781e1edefb42",
"score": "0.58701587",
"text": "def new\n @person = Person.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "de42dddee8c9ead8a179bdacb271c56e",
"score": "0.5861915",
"text": "def create\n @person = Person.new(params[:person].merge :creator_site_id => Site.current_id)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to(@person, :notice => 'Person was successfully created.') }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n format.json { render :json => @person, :status => :created, :location => @person }\n else\n status = @person.errors.delete(:status) || :unprocessable_entity\n\n format.html { render :action => 'new' }\n format.xml { render :xml => @person.errors, :status => status }\n format.json { render :json => @person.errors, :status => status }\n end\n end\n end",
"title": ""
},
{
"docid": "31f9718f92b7c4c6d7b2c7196f287cd8",
"score": "0.5853736",
"text": "def create\n @contactinfo = Contactinfo.new(params[:contactinfo])\n @contactinfo.user_id = current_user.id\n \n respond_to do |format|\n if @contactinfo.save\n format.html { redirect_to person_path(@contactinfo.people_id), :notice => 'Contactinfo was successfully created.' }\n format.json { render :json => @contactinfo, :status => :created, :location => @contactinfo }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @contactinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86a2509be6fd047e1f2bb1209464ada7",
"score": "0.58426595",
"text": "def create\n @persona = Persona.new(persona_params)\n\n respond_to do |format|\n if @persona.save\n format.html { redirect_to @persona, notice: 'Datos personales registrados exitosamente.' }\n format.json { render :show, status: :created, location: @persona }\n else\n format.html { render :new }\n format.json { render json: @persona.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31b2b40d639be572deba60c613ec4a55",
"score": "0.58423305",
"text": "def create\n @person_interest = PersonInterest.new(params[:person_interest])\n\n respond_to do |format|\n if @person_interest.save\n format.html { redirect_to @person_interest, notice: 'Person interest was successfully created.' }\n format.json { render json: @person_interest, status: :created, location: @person_interest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person_interest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0476257600bbe969cf8e8c19afc0d349",
"score": "0.5841449",
"text": "def new\n @user_person = UserPerson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_person }\n end\n end",
"title": ""
},
{
"docid": "9566e33fb1f31465db188c5eb8e71e46",
"score": "0.5841175",
"text": "def create\n\t\t@person = Person.new(params[:person])\n\n\t\trespond_to do |format|\n\t\t\tif @person.save\n\t\t\t\tformat.html { redirect_to(@person, :notice => 'Person was successfully created.') }\n\t\t\t\tformat.xml { render :xml => @person, :status => :created, :location => @person }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b2561e34119dc611f2a02ad2f1ee0f13",
"score": "0.58365774",
"text": "def people_params\n params.require(:person).permit(:name, :surname, :mail, :home, :phone, :age, :pilot, :member, :guest, :status, :id_number)\n end",
"title": ""
},
{
"docid": "e66cc7ae31e238c9c2836432e9445a6d",
"score": "0.5835134",
"text": "def create\n @type_person = TypePerson.new(params[:type_person])\n\n respond_to do |format|\n if @type_person.save\n format.html { redirect_to @type_person, notice: 'Type person was successfully created.' }\n format.json { render json: @type_person, status: :created, location: @type_person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @type_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53e247f2bd010864de994e5e59f1dec0",
"score": "0.58348966",
"text": "def create\n @person = Person.new(admin_person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to [:admin, @person], notice: 'Person was successfully created.' }\n format.json { render action: 'show', status: :created, location: [:admin, @person] }\n else\n format.html { render action: 'new' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec541d67d805569f6c34c6c1f90438b7",
"score": "0.5832317",
"text": "def create\n # render json: params\n render json: Users.create(params[\"user\"])\n end",
"title": ""
},
{
"docid": "70dd93b6c50881afccb6e0adb235d824",
"score": "0.5830943",
"text": "def create\n filtered_params = person_params\n filtered_params[:roles] ||= [:leaser]\n filtered_params[:status] ||= [:pending]\n\n @person = Person.new(filtered_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n format.xml { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n format.xml { render xml: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca0647572072d16c1b4c905bbe1b7ddc",
"score": "0.5828289",
"text": "def create\n @person = Person.new(person_params)\n\n if @person.save\n redirect_to :action => 'list'\n else\n render :action => 'new'\n end\n end",
"title": ""
},
{
"docid": "88917cff2470553373f3cbdbc95bf0ce",
"score": "0.58265173",
"text": "def create\n p params\n family = Family.new(\n first_name: params[:first_name],\n last_name: params[:last_name],\n email: params[:email],\n password: params[:password],\n phone_number: params[:phone_number],\n street_address: params[:street_address],\n secondary_address: params[:secondary_address],\n city: params[:city],\n state: params[:state],\n zip_code: params[:zip_code],\n photo: params[:photo])\n # save the information from user input to create a new family.\n family.save!\n if family.save!\n render json: family.as_json\n else\n render json: {errors: family.errors.full_messages}\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.5819807",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.5819807",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.5819807",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.5819807",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.5819807",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.5819807",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.5819807",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "ea31780244b8b96aa41a202e4dd5911f",
"score": "0.5816536",
"text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n track_activity @person\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render layout: 'form', action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e41ec02a662dcdbd8b6a079453d278b8",
"score": "0.5814323",
"text": "def create\n Rails.logger.info(params)\n # check if all the criterias are filled\n # first I just continue to create iff name, positionl, institution exists\n if params.has_key?(:name) && params.has_key?(:position) && params.has_key?(:institution)\n # check if the person already exists? The person might exists as a mentor of other maybe\n unless Person.exists?(name: params[:name])\n @person = Person.new_person(params[:name], params[:position], params[:institution])\n if @person != nil && @person.save\n render json: @person.as_json, status: :created\n return\n end\n else\n render json: {error: 'person exists'}, status: :bad_request\n end\n end\n #render json: {warning: 'not implemented'}, status: 200\n end",
"title": ""
},
{
"docid": "788a5eea552ccacd02b4e11c1b02aa02",
"score": "0.5807793",
"text": "def create\n @person = current_user.people.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to [:logbook, @person], notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n format.js\n else\n format.html { redirect_to logbook_people_path, notice: 'Person was not saved.' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n format.js { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b093eef800df27e31404f528f0ff463e",
"score": "0.5805489",
"text": "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n if @person\n @car.people << @person\n format.html { redirect_to @person, notice: \"#{@person.name} got a new car!\" }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { redirect_to @car, notice: 'Car created!' }\n format.json { render :show, status: :created, location: @car }\n end\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d049b573f86f1056670818eddfeca1b",
"score": "0.5794464",
"text": "def create\n @person = Person.new(person_params)\n @person.user = current_user\n authorize @person\n\n flash[:notice] = \"Person was successfully created.\" if @person.save\n respond_with(@person)\n end",
"title": ""
},
{
"docid": "ef1222bb51687f2d28b37a1b473b4e61",
"score": "0.57873255",
"text": "def create\n @documents_person = DocumentsPerson.new(documents_person_params)\n\n respond_to do |format|\n if @documents_person.save\n format.html { redirect_to @documents_person, notice: 'Documents person was successfully created.' }\n format.json { render :show, status: :created, location: @documents_person }\n else\n format.html { render :new }\n format.json { render json: @documents_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2198856180b2e763b8bf7c8abb27e64a",
"score": "0.5773334",
"text": "def create\n @pet = @person.pets.build(pet_params)\n\n respond_to do |format|\n if @pet.save\n format.html { redirect_to person_path(@person), notice: 'Pet was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e1b7de4a7fcb05022f9d27824cae5bc9",
"score": "0.5771273",
"text": "def create\n @persona = Persona.new(persona_params)\n\n respond_to do |format|\n if @persona.save\n format.html {redirect_to personas_url, notice: 'Persona was successfully created.'}\n format.json {render :show, status: :created, location: @persona}\n else\n format.html {render :new}\n format.json {render json: @persona.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "e998b1105cbfe8464f5aca1e1e120b61",
"score": "0.5747976",
"text": "def create\n @key_person = KeyPerson.new(params[:key_person])\n\n respond_to do |format|\n if @key_person.save\n format.html { redirect_to @key_person, notice: 'Key person was successfully created.' }\n format.json { render json: @key_person, status: :created, location: @key_person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @key_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "825a96d10a5c685217de0dcd1bb72f66",
"score": "0.5740893",
"text": "def create\n @people_student = People::Student.new(people_student_params)\n\n respond_to do |format|\n if @people_student.save\n format.html { redirect_to @people_student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @people_student }\n else\n format.html { render :new }\n format.json { render json: @people_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
153c3de7c5920a14b42db956db82af11
|
Create a new ReleaseData object with a semver (XSemVer::SemVer instance) and a list of artifacts
|
[
{
"docid": "e978c0ad95aa78d1e9a4a7d17433fc7d",
"score": "0.74240464",
"text": "def initialize semver, artifacts\n raise ArgumentError, 'missing \"semver\" argument' unless semver\n raise ArgumentError, 'missing \"artifacts\" argument' unless artifacts\n raise ArgumentError, '\"artifacts\" should respond to #each' unless artifacts.respond_to? :each\n @semver = semver\n @artifacts = artifacts\n end",
"title": ""
}
] |
[
{
"docid": "f2a3e1e5318a26a5a26e231f7e4b6728",
"score": "0.61579275",
"text": "def initialize(release_name,\n data_dir: nil,\n spec_file: nil,\n spec_data: nil,\n arch: nil,\n ws: Autoproj.workspace)\n @releases = {}\n @data_dir = data_dir || DEFAULT_DATA_DIR\n if spec_file && spec_data\n raise ArgumentError, \"#{self.class} please provide either spec_data\"\\\n \" or spec_file\"\n end\n if !spec_file && !spec_data\n spec_file = DEFAULT_SPEC_FILE\n end\n\n if spec_file\n releases_spec_file = File.join(@data_dir, spec_file)\n @spec = YAML::load_file(releases_spec_file)\n elsif spec_data\n raise ArgumentError, \"#{self.class} spec data has wrong format - expected hash\"\\\n \" got #{spec_data.class}\" unless spec_data.kind_of?(Hash)\n @spec = spec_data\n end\n\n if !@spec\n raise RuntimeError, \"#{self.class} invalid spec provided - expected filename (String) or data (Hash)\"\\\n \" spec_file: #{spec_file} -- spec_data: #{spec_data}\"\n end\n\n\n if @spec.has_key?('default')\n @repo_url = @spec['default']['repo_url']\n @public_key = @spec['default']['public_key']\n @separate_prefixes = @spec['default']['separate_prefixes']\n end\n\n if !@spec.has_key?(release_name)\n raise ArgumentError, \"Release file #{@spec} does not contain: #{release_name} (available keys are: #{@spec.keys} -- please inform the maintainer of the package_set rock-osdeps\"\n end\n @name = release_name\n @ws = ws\n @arch = arch || @@debian_arch\n\n @hierarchy = dependencies(@name).reverse\n\n data = @spec[release_name]\n return unless data\n @repo_url = data['repo_url'] if data.has_key?('repo_url')\n @public_key = data['public_key'] if data.has_key?('public_key')\n @separate_prefixes = data['separate_prefixes'] if data.has_key?('separate_prefixes')\n end",
"title": ""
},
{
"docid": "1b856e7d311dd4a4725db1ef58c4d5b0",
"score": "0.5958476",
"text": "def prepare_release_versions(commit_range, tag_version, pr_version, build_number, lock_snapshots)\n\n system_stdout('git fetch --unshallow')\n\n if commit_range != nil && !commit_range.to_s.strip.empty? && !pr_version.to_s.strip.empty?\n module_paths = get_project_diff_list(commit_range)\n else\n module_paths = Array.new\n all_modules = maven_module_list('.', true)\n all_modules.each do |all_module|\n module_paths.push(all_module.to_s)\n end\n end\n\n prepare_maven_node_release_versions(module_paths, tag_version, pr_version, build_number, lock_snapshots)\n prepare_s3deploy_versions(module_paths)\nend",
"title": ""
},
{
"docid": "fa437fcaed1ce7c30e4c96d78b22f0a6",
"score": "0.58717906",
"text": "def releases\n @releases ||= JSON.parse(Chef::HTTP.new(GITHUB_API_URI).get(releases_path))\n end",
"title": ""
},
{
"docid": "41c79b2c9cdba4ab4c6c1e5ff926440d",
"score": "0.5653124",
"text": "def initialize(major, minor, patch, release_labels = nil, metadata = nil)\n @major = Integer(major, major.is_a?(String) ? 10 : 0)\n @minor = Integer(minor, minor.is_a?(String) ? 10 : 0)\n @patch = Integer(patch, patch.is_a?(String) ? 10 : 0)\n\n if !release_labels.nil?\n release_labels = release_labels.to_s.split('.') if !release_labels.kind_of? Array\n SemanticVersion.validate_identifiers release_labels\n @release_labels = release_labels\n end\n\n SemanticVersion.validate_identifier metadata if !metadata.nil?\n @metadata = metadata\n end",
"title": ""
},
{
"docid": "6f29a40c4224919b750d67f2aa5879f2",
"score": "0.56465095",
"text": "def prepare_maven_node_release_versions(modified_modules, tag_version, pr_version, build_number, lock_snapshots)\n modified_artifacts = Set.new\n\n # Always add the root, parent, grandparent, and bom pom artifacts!\n modified_artifacts.add(maven_module_info('.'))\n modified_artifacts.add(maven_module_info('parent'))\n modified_artifacts.add(maven_module_info('grandparent'))\n modified_artifacts.add(maven_module_info('bom'))\n\n modified_modules.each do |modified_module|\n modified_artifacts.add(maven_module_info(modified_module))\n end\n\n all_modules = maven_module_list(\".\", true)\n # Always update the root pom\n all_modules.push('.')\n\n bom_deps_hash = Hash.new\n if lock_snapshots\n latest_tag_version = `git describe --tags --abbrev=0`.to_s.strip\n\n puts \"Locking SNAPSHOT versions to release #{latest_tag_version}...\"\n\n # Remove leading v\n if latest_tag_version.start_with?('v')\n latest_tag_version = latest_tag_version[1..-1]\n end\n\n bom = Document.new(open(\"https://artifactory.psdops.com/psddev-releases/com/psddev/brightspot-bom/#{latest_tag_version}/brightspot-bom-#{latest_tag_version}.pom\"))\n\n XPath.each(bom, '//dependency') do |bom_dep|\n\n bom_dep_group_id = XPath.first(bom_dep, \"groupId/text()\")\n bom_dep_artifact_id = XPath.first(bom_dep, \"artifactId/text()\")\n bom_dep_version = XPath.first(bom_dep, \"version/text()\")\n\n bom_deps_hash[\"#{bom_dep_group_id}:#{bom_dep_artifact_id}\"] = bom_dep_version\n end\n\n end\n\n all_modules.each do |all_module|\n\n # ---------------------\n # Handle Maven Versions\n # ---------------------\n\n pom_modified = false\n pom = nil\n\n File.open(\"#{all_module}/pom.xml\") do |pom_file|\n pom = Document.new(pom_file)\n\n XPath.each(pom, \"//dependency | //plugin | //parent | /project\") do |dep|\n dep_modified = false\n\n group_id = XPath.first(dep, \"groupId/text()\")\n if group_id == nil && dep.name() == 'project'\n group_id = XPath.first(dep, \"parent/groupId/text()\")\n end\n\n artifact_id = XPath.first(dep, \"artifactId/text()\")\n version_elmt = XPath.first(dep, \"version\")\n\n modified_artifacts.each do |modified_artifact|\n\n if group_id == modified_artifact.group_id && artifact_id == modified_artifact.artifact_id && version_elmt != nil\n old_version = version_elmt.text\n release_version = module_release_version(modified_artifact.path, tag_version, pr_version, nil, false)\n\n if release_version != nil\n version_elmt.text = release_version\n pom_modified = true\n dep_modified = true\n\n puts \"Set #{all_module}/pom.xml #{dep.name()} #{group_id}:#{artifact_id}:#{old_version} to version #{release_version}.\"\n end\n end\n end\n\n # If snapshots need to be locked\n if lock_snapshots && !dep_modified && version_elmt != nil && version_elmt.text.end_with?('-SNAPSHOT')\n old_version = version_elmt.text\n release_version = bom_deps_hash[\"#{group_id}:#{artifact_id}\"]\n\n if release_version != nil\n version_elmt.text = release_version\n pom_modified = true\n\n puts \"Set #{all_module}/pom.xml #{dep.name()} #{group_id}:#{artifact_id}:#{old_version} to version #{release_version}.\"\n end\n end\n end\n end\n\n if pom_modified\n formatter = REXML::Formatters::Default.new\n File.open(\"#{all_module}/pom.xml\", 'w') do |f|\n formatter.write(pom, f)\n end\n end\n\n # --------------------\n # Handle Node Versions\n # --------------------\n\n if File.file?(\"#{all_module}/package.json\")\n\n updated_node_module = false\n\n # Update node release versions\n if modified_modules.include?(all_module)\n\n new_version = module_release_version(all_module, tag_version, pr_version, build_number, true)\n\n if new_version != nil\n package_json = JSON.parse(File.read(\"#{all_module}/package.json\"))\n old_version = package_json['version']\n package_json['version'] = new_version\n updated_node_module = true\n\n puts \"Set #{all_module}/package.json version #{old_version} to #{new_version}.\"\n\n File.open(\"#{all_module}/package.json\", 'w') do |f|\n f.write(JSON.pretty_generate(package_json))\n end\n end\n end\n\n # If snapshots need to be locked, just grab the version from this module's\n # pom version since it will have just been updated in the Maven step above.\n if lock_snapshots && !updated_node_module\n\n package_json = JSON.parse(File.read(\"#{all_module}/package.json\"))\n old_version = package_json['version']\n\n if old_version.end_with?('-SNAPSHOT')\n\n File.open(\"#{all_module}/pom.xml\") do |pom_file|\n pom = Document.new(pom_file)\n new_version = XPath.first(pom, '/project/version/text()')\n package_json['version'] = new_version\n\n puts \"Set #{all_module}/package.json version #{old_version} to #{new_version}.\"\n\n File.open(\"#{all_module}/package.json\", 'w') do |f|\n f.write(JSON.pretty_generate(package_json))\n end\n\n end\n end\n end\n\n end\n\n end\nend",
"title": ""
},
{
"docid": "43c02efd639f146317c9d306dcefec88",
"score": "0.5603211",
"text": "def initialize root, release_txt\n parsed = JSON.parse release_txt\n @release = root.verify(:release, parsed)\n @targets = @release[\"meta\"][\"targets.txt\"]\n end",
"title": ""
},
{
"docid": "a37b7feab4fa4ab7863fa7219d46a3e3",
"score": "0.5466689",
"text": "def create\n render :nothing => true\n body = JSON.parse(request.body.read);\n\n # FIXME - This doesn't properly parse the time portion of the DateTime field\n release_fields = {\n project_name: body['repository']['name'],\n repository: body['repository']['full_name'],\n git_id: body['head_commit']['id'],\n commit_message: body['head_commit']['message'],\n commit_timestamp: Date.parse(body['head_commit']['timestamp']),\n committer_name: body['head_commit']['committer']['name']\n }\n\n create_new_release(release_fields)\n end",
"title": ""
},
{
"docid": "8c3019f8da496001871e78dcd511a7ff",
"score": "0.5452681",
"text": "def uploadable_releases\n parsed_releases.map { |release|\n next unless url = release[\"url\"]\n next unless url =~ %r{\\Adir\\+bosh://(.+)\\z}\n\n @uploadable_release_factory.new_uploadable_release(\n release[\"name\"], \n release[\"version\"], \n $1, # host_dir\n )\n }.compact\n end",
"title": ""
},
{
"docid": "f025153304572a4338f364ea7427cd61",
"score": "0.544735",
"text": "def create_release_docs(params)\n params.fetch(:deploy_groups).each do |dg|\n dg.fetch(:roles).to_a.each do |role|\n release_docs.create!(\n deploy_group_id: dg.fetch(:id),\n kubernetes_role_id: role.fetch(:id),\n replica_target: role.fetch(:replicas),\n cpu: role.fetch(:cpu),\n ram: role.fetch(:ram)\n )\n end\n end\n raise ArgumentError, 'No roles or deploy groups given' if release_docs.empty?\n end",
"title": ""
},
{
"docid": "83249aa2053f7b054caec60a2435f7c5",
"score": "0.54408765",
"text": "def releases\n revisions_by_status([RevisionInfo::Status::LATEST_RELEASE, RevisionInfo::Status::EXPIRED])\n end",
"title": ""
},
{
"docid": "3c0b52798616b96e834595f2c1af5b94",
"score": "0.54367477",
"text": "def releases(changes)\n rel = []\n tags = self.tags.dup\n\n #ver = repo.bump(version)\n\n name = config.version || 'HEAD'\n user = adapter.user\n date = ::Time.now + (3600 * 24) # one day ahead\n\n change = Change.new(:id=>'HEAD', :date=>date, :who=>user)\n\n tags << Tag.new(:name=>name, :date=>date, :who=>user, :msg=>\"Current Development\", :commit=>change)\n\n # TODO: Do we need to add a Time.now tag?\n # add current verion to release list (if given)\n #previous_version = tags[0].name\n #if current_version < previous_version # TODO: need to use natural comparision\n # raise ArgumentError, \"Release version is less than previous version (#{previous_version}).\"\n #end\n\n # sort by release date\n tags = tags.sort{ |a,b| a.date <=> b.date }\n\n # organize into deltas\n delta = []\n last = nil\n tags.each do |tag|\n delta << [tag, [last, tag.commit.date]]\n last = tag.commit.date\n end\n\n # gather changes for each delta\n delta.each do |tag, (started, ended)|\n if started\n set = changes.select{ |c| c.date >= started && c.date < ended }\n #gt_vers, gt_date = gt.name, gt.date\n #lt_vers, lt_date = lt.name, lt.date\n #gt_date = Time.parse(gt_date) unless Time===gt_date\n #lt_date = Time.parse(lt_date) unless Time===lt_date\n #log = changelog.after(gt).before(lt)\n else\n #lt_vers, lt_date = lt.name, lt.date\n #lt_date = Time.parse(lt_date) unless Time===lt_date\n #log = changelog.before(lt_date)\n set = changes.select{ |c| c.date < ended }\n end\n rel << Release.new(tag, set)\n end\n rel.sort\n end",
"title": ""
},
{
"docid": "e4e9ce1947cf52b2307537e8a079393d",
"score": "0.5384076",
"text": "def versions_with_release\n @versions ||= begin\n all_releases = get_package_info.fetch('releases', {})\n ver_release_pairs = all_releases.each_pair.map do |ver, info|\n [\n parse_version_str(ver),\n info.select {|f| f['packagetype'] == 'sdist'}.map do |f|\n Time.parse(f['upload_time_iso_8601'])\n end.min\n ].freeze\n end\n ver_release_pairs.reject! do |vn, rd|\n (vn.kind_of?(Version) && vn.prerelease?) || rd.nil?\n end\n ver_release_pairs.sort! do |l, r|\n case \n when l[0].kind_of?(String) && r[0].kind_of?(Version) then -1\n when l[0].kind_of?(Version) && r[0].kind_of?(String) then 1\n else l <=> r\n end\n end\n ver_release_pairs.reverse!\n ver_release_pairs.freeze\n end\n end",
"title": ""
},
{
"docid": "c37c88cdc6498f4cae64c7c4b1c00f33",
"score": "0.5377538",
"text": "def releases(project)\n @releases ||= get(\"/projects/#{project}/releases.json\").map {|x| Release.new(x[\"release\"])}\n end",
"title": ""
},
{
"docid": "d31d49759de9bbfa7587de098af191d8",
"score": "0.5367156",
"text": "def semver\n @semver ||= begin\n {}.tap do |h|\n h[:major], h[:minor], h[:patch], h[:rev], h[:rev_hash] = gitver[1..-1].split(/[.-]/)\n end\n end\n end",
"title": ""
},
{
"docid": "28448d7ad1e27e485af1271741f28694",
"score": "0.53561854",
"text": "def releases\n @releases ||= ReleaseSet.new self\n end",
"title": ""
},
{
"docid": "4e2d7e524caccd038157ea8c10d32d16",
"score": "0.532097",
"text": "def release\n options = {}\n options[:release] = release_template % [version]\n options[:is_public] = !private_release\n\n if notelog && test(?f, notelog)\n options[:notes] = File.read(notelog)\n else\n options[:notes] = project.history.release.notes\n end\n\n if changelog && test(?f, changelog)\n options[:changes] = File.read(changelog)\n else\n options[:changes] = project.history.release.changes\n end\n\n #else\n # if notelog\n # notes = File.read(notelog)\n # index = notes.index(/^(###|===|---)/m)\n # if index\n # changes = notes[index..-1]\n # notes = notes[0...index]\n # else\n # changes = ''\n # end\n # options[:notes] = notes\n # options[:changes] = changes\n # end\n #end\n\n options[:date] = Time::now.strftime('%Y-%m-%d %H:%M')\n\n # collect package files\n files = Dir.glob(project.pack / \"*-#{version}.*\")\n\n packages = {}\n\n files.each do |file|\n name = file.chomp(File.extname(file))\n name = name.chomp('.tar') # in case of 'tar.gz' or 'tar.bz2'\n name = name.sub(/-#{version}$/,'')\n name = File.basename(name)\n packages[name] ||= []\n packages[name] << file\n end\n\n packages.each do |name, files|\n options[:package] = name\n options[:files] = files\n options[:processor] = 'Any' # TODO: Correlate processor to platform\n\n rfiles = files.collect{ |f| Pathname.new(f).relative_path_from(project.root) }\n if dryrun?\n status \"rubyforge release --processor=#{options[:processor]} #{rfiles.join(' ')}\"\n else\n #status \"rubyforge announce #{options.to_console}\"\n rubyforge.release(options)\n end\n end\n end",
"title": ""
},
{
"docid": "2681e9cdb86c51312808ed5715d4455f",
"score": "0.5305927",
"text": "def new(segments, prerelease = nil)\n self.class.allocate.tap do |version|\n version.segments = segments\n version.prerelease = prerelease\n end\n end",
"title": ""
},
{
"docid": "8ea50f751c220038c1cbe7490a7ea98d",
"score": "0.52959824",
"text": "def initialize(target_branch, commit_id, release_metadata = ReleaseTools::ReleaseMetadata.new)\n @target_branch = target_branch\n @target_name = target_branch.to_s\n @commit_id = commit_id\n @release_metadata = release_metadata\n end",
"title": ""
},
{
"docid": "8ea50f751c220038c1cbe7490a7ea98d",
"score": "0.52959824",
"text": "def initialize(target_branch, commit_id, release_metadata = ReleaseTools::ReleaseMetadata.new)\n @target_branch = target_branch\n @target_name = target_branch.to_s\n @commit_id = commit_id\n @release_metadata = release_metadata\n end",
"title": ""
},
{
"docid": "4f6b91096081b36a72cbee01db51121a",
"score": "0.5286354",
"text": "def publish_version!(params, user)\n metadata = params.metadata\n\n if metadata.privacy &&\n ENV[\"ENFORCE_PRIVACY\"].present? &&\n ENV[\"ENFORCE_PRIVACY\"] == \"true\"\n errors.add(:base, I18n.t(\"api.error_messages.privacy_violation\"))\n raise ActiveRecord::RecordInvalid.new(self)\n end\n\n tarball = params.tarball\n readme = params.readme\n changelog = params.changelog\n\n dependency_names = metadata.dependencies.keys\n existing_cookbooks = Cookbook.with_name(dependency_names)\n\n cookbook_version = nil\n\n transaction do\n cookbook_version = cookbook_versions.build(\n cookbook: self,\n user: user,\n description: metadata.description,\n license: metadata.license,\n version: metadata.version,\n tarball: tarball,\n readme: readme.contents,\n readme_extension: readme.extension,\n changelog: changelog.contents,\n changelog_extension: changelog.extension,\n chef_versions: metadata.chef_versions,\n ohai_versions: metadata.ohai_versions\n )\n\n self.updated_at = Time.current\n\n [:source_url, :issues_url].each do |url|\n url_val = metadata.send(url)\n\n if url_val.present?\n self[url] = url_val\n end\n end\n\n self.privacy = metadata.privacy\n save!\n\n metadata.platforms.each do |name, version_constraint|\n cookbook_version.add_supported_platform(name, version_constraint)\n end\n\n metadata.dependencies.each do |name, version_constraint|\n cookbook_version.cookbook_dependencies.create!(\n name: name,\n version_constraint: version_constraint,\n cookbook: existing_cookbooks.find { |c| c.name == name }\n )\n end\n end\n\n cookbook_version\n end",
"title": ""
},
{
"docid": "eb9c75a099acec528c3e276d3bdcde97",
"score": "0.52694076",
"text": "def artifacts_for_version(version)\n begin\n results = get(\"/api/v1/#{options.channel}/#{omnibus_project}/#{version}/artifacts\")[\"results\"]\n rescue Net::HTTPServerException => e\n if e.message =~ /404/\n return []\n else\n raise e\n end\n end\n\n # Merge artifactory properties to a flat Hash\n results.collect! do |result|\n {\n \"filename\" => result[\"name\"],\n }.merge(\n map_properties(result[\"properties\"])\n )\n end\n\n # Convert results to build records\n results.map { |a| create_artifact(a) }\n end",
"title": ""
},
{
"docid": "9a477e7c218c826e280fe0237fa38389",
"score": "0.52585256",
"text": "def create_new_version(prog, latest)\n puts \"create_new_version(#{prog.id}, #{latest})\"\n ver = prog.versions.create(\n version: latest[1],\n date: latest[0],\n )\nend",
"title": ""
},
{
"docid": "fe0cb7dc1bae7fc096d02a0518fb31eb",
"score": "0.5211055",
"text": "def new\n @version = Version.find_by_done(false) || Version.create\n collect_data\n end",
"title": ""
},
{
"docid": "0b86e8f068272add7c77f40a08b55336",
"score": "0.5185304",
"text": "def generate_manifest\n available_versions.each do |version|\n puts \"Processing #{project_name} - #{channel_name} - #{version}\"\n\n artifacts_for(version).each do |artifact|\n p = artifact.platform\n pv = artifact.platform_version\n m = artifact.architecture\n\n manifest[p] ||= {}\n manifest[p][pv] ||= {}\n manifest[p][pv][m] ||= {}\n manifest[p][pv][m][artifact.version] = {\n sha1: artifact.sha1,\n sha256: artifact.sha256,\n url: artifact.url\n }\n end\n end\n\n manifest\n end",
"title": ""
},
{
"docid": "0b86e8f068272add7c77f40a08b55336",
"score": "0.5185304",
"text": "def generate_manifest\n available_versions.each do |version|\n puts \"Processing #{project_name} - #{channel_name} - #{version}\"\n\n artifacts_for(version).each do |artifact|\n p = artifact.platform\n pv = artifact.platform_version\n m = artifact.architecture\n\n manifest[p] ||= {}\n manifest[p][pv] ||= {}\n manifest[p][pv][m] ||= {}\n manifest[p][pv][m][artifact.version] = {\n sha1: artifact.sha1,\n sha256: artifact.sha256,\n url: artifact.url\n }\n end\n end\n\n manifest\n end",
"title": ""
},
{
"docid": "c23b3c666c4d231f06b63fef9db6c909",
"score": "0.5173242",
"text": "def sync_releases\n new_releases = []\n\n refs(tags).each do |ref|\n tag = ref.name[%r{[^/]+\\z}]\n unless Release.exists?(tag: tag)\n new_releases << Release.import!(tag, repo.lookup(ref.target))\n end\n end\n\n Release.process_commits(self, new_releases)\n\n new_releases.size\n end",
"title": ""
},
{
"docid": "0fb1d08d9235ef068f9a15e59e5680cb",
"score": "0.5168266",
"text": "def create_package_version\n Package.transaction do\n @package_version = PackageVersion.new(version: self.version,\n description: package_description['Description'],\n date_of_publication: package_description['Date/Publication'].to_date)\n @package_version.package = package\n @package_version.maintainers << package_maintainers\n @package_version.authors << package_authors\n @package_version.save\n end\n end",
"title": ""
},
{
"docid": "c2bc3c60b4244a7070b57adfcf88900e",
"score": "0.51571673",
"text": "def sdk_yml_release(sdk)\n release_project_ids = []\n repos = Repo.get_by_version_id(sdk.version_id)\n\n repos.each do |r|\n release_project_ids << r['project_id'].to_i unless release_project_ids.include?(r['project_id'].to_i)\n release_path = r['repo_url']\n version_fullname = r['version_fullname']\n # Create log folder\n log_folder = sdk.log_folder\n FileUtils.mkdir_p(log_folder) unless Dir.exist?(log_folder)\n log_path = log_folder.join(\"#{Digest::MD5.hexdigest release_path}.log\").to_s\n logger = logger_new log_path, sdk\n begin\n git_status = write_spec_to_git(r, logger, sdk.id)\n if git_status[:status] == 0\n sdk.status = 7\n release_result_output(sdk, false, {:release_path => git_status[:uri], :log_path => log_path})\n logger.fatal \"[FAILED] #{version_fullname} release to #{git_status[:uri]} failed!\\n\"\n else\n sdk.status = 5\n release_result_output(sdk, true, {:release_path => git_status[:uri], :log_path => log_path})\n logger.fatal \"[SUCCESSED] #{version_fullname} release to #{git_status[:uri]} successed!\\n\"\n end\n rescue => e\n logger.error e.message\n sdk.status = 7\n release_result_output(sdk, false, {:release_path => git_status[:uri], :log_path => log_path})\n logger.fatal \"[FAILED] #{version_fullname} release to #{git_status[:uri]} failed!\\n\"\n end\n end\n\n sdk.release_project_ids = release_project_ids.uniq\n end",
"title": ""
},
{
"docid": "0fa7b30c5639b4dd70bcd9600a040b7b",
"score": "0.51282394",
"text": "def sync_releases\n new_releases = []\n\n refs(tags).each do |ref|\n tag = ref.name[%r{[^/]+\\z}]\n unless Release.exists?(tag: tag)\n target = ref.target\n commit = target.is_a?(Rugged::Commit) ? target : target.target\n new_releases << Release.import!(tag, commit)\n end\n end\n\n Release.process_commits(self, new_releases)\n\n new_releases.size\n end",
"title": ""
},
{
"docid": "6718db1de21eeb15a24bc3bbef8e4fb4",
"score": "0.5121528",
"text": "def artifactory_artifacts(version)\n results = artifactory_query(<<-QUERY)\nitems.find(\n {\"repo\": \"omnibus-#{options.channel}-local\"},\n {\"@omnibus.project\": \"#{options.product_name}\"},\n {\"@omnibus.version\": \"#{version}\"}\n).include(\"repo\", \"path\", \"name\", \"property\")\n QUERY\n\n # Merge artifactory properties and downloadUri to a flat Hash\n results.collect! do |result|\n { \"downloadUri\" => generate_download_uri(result) }.merge(\n map_properties(result[\"properties\"])\n )\n end\n\n # Convert results to build records\n results.map { |a| create_artifact(a) }\n end",
"title": ""
},
{
"docid": "f9d784f0e2a83164a52e9e1a2129a9b5",
"score": "0.51181716",
"text": "def [](version)\n Release.new(versions.fetch(version))\n end",
"title": ""
},
{
"docid": "772179866d65bc6326a46d63f6047cca",
"score": "0.51161665",
"text": "def results\n (releases = []).tap do\n releases_xml.xpath('//xmlns:release').each do |node|\n releases << BrainzReleases::Release.build_from_node(node)\n end\n end\n end",
"title": ""
},
{
"docid": "35b8ca2089b7ea22cd82a9bffa992da4",
"score": "0.50929344",
"text": "def initialize(reqs)\n @requirements = reqs.collect do |rq|\n\top, version_string = parse(rq)\n\t[op, Version.new(version_string)]\n end\n @version = nil # Avoid warnings.\n end",
"title": ""
},
{
"docid": "17789b03b8fae4ae4b000107c40f0c2b",
"score": "0.50855124",
"text": "def releases(repo, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "3d1672ae504b2f2db94fccf51a9fe0fb",
"score": "0.50583005",
"text": "def get_existing_commits!\n releases = Vector::Release.all!(RELEASE_REFERENCE_DIR)\n release_commits = releases.collect(&:commits).flatten\n\n release_log_paths = Dir.glob(\"#{RELEASE_REFERENCE_DIR}/*.log\").to_a\n\n log_commits =\n release_log_paths.collect do |release_log_path|\n git_log = Vector::GitLogCommit.from_file!(release_log_path)\n Vector::Commit.from_git_log!(git_log)\n end.flatten\n\n release_commits + log_commits\nend",
"title": ""
},
{
"docid": "f14bff5afa6fd50e5771ed64b29c0e68",
"score": "0.50547546",
"text": "def artifactory_artifacts(version)\n results = artifactory_query(<<-QUERY\nitems.find(\n {\"repo\": \"omnibus-#{options.channel}-local\"},\n {\"@omnibus.project\": \"#{omnibus_project}\"},\n {\"@omnibus.version\": \"#{version}\"},\n {\"name\": {\"$nmatch\": \"*.metadata.json\" }}\n).include(\"repo\", \"path\", \"name\", \"property\")\n QUERY\n )\n\n # Merge artifactory properties to a flat Hash\n results.collect! do |result|\n {\n \"artifactory_standard_path\" => generate_artifactory_standard_path(result),\n \"filename\" => result[\"name\"],\n }.merge(\n map_properties(result[\"properties\"])\n )\n end\n\n # Convert results to build records\n results.map { |a| create_artifact(a) }\n end",
"title": ""
},
{
"docid": "38100c9f1bab4a55c32ed3a8423e8c18",
"score": "0.5035973",
"text": "def release\n options = config_load('release')\n\n # merge in any commandline options\n options.merge!(@options.to_h) #(ReleaseOptions.parse.to_h)\n\n #options = {}\n #options.update info.gather('rubyforge')\n #options.update info.gather('release')\n #options.update info.select('version', 'changelog', 'notelog', 'processor'=>'arch')\n #options['files'] = Dir[File.join(info.package_store,\"*#{options['version']}.*\")]\n\n store = options['store']\n name = options['package']\n vers = options['version']\n\n options['files'] ||= Dir[File.join(store,\"#{name}-#{ver}.*\")]\n\n name = options['host'] || options['domain']\n host = host_class(name).new(options)\n\n host.release(options)\n end",
"title": ""
},
{
"docid": "cbe33128f72d8caef9f277feec729ca8",
"score": "0.50240284",
"text": "def artifacts\n unless @artifacts\n @artifacts = @data['artifacts'].collect {|each| Artifact.new(each['fileName'], URI(@uri.to_s + '/artifact/' + each['relativePath']))}\n end\n @artifacts\n end",
"title": ""
},
{
"docid": "3ea219766ed1ed508593aaf8095440b0",
"score": "0.5015471",
"text": "def initialize(major, minor = 0, patch = 0, prerelease = nil, metadata = nil)\n self.major = major\n self.minor = minor\n self.patch = patch\n self.prerelease = prerelease\n self.metadata = metadata\n end",
"title": ""
},
{
"docid": "c898e956b498fea4107be32576f3ec05",
"score": "0.5003512",
"text": "def releases(full_name)\n begin\n raise Octokit::NotFound if @github_access.nil?\n @github_access.releases(full_name)\n rescue Octokit::NotFound => e\n ErrorExchange.new(:github_octokit_not_found, nil, {error: e.to_json})\n end\n end",
"title": ""
},
{
"docid": "c03bd2a661f65b90e908e283ce070318",
"score": "0.500272",
"text": "def new_version\n return ['0.1.0'.to_version, []] unless git.has_any_release?\n %w(major minor patch).each do |level|\n changes = git_changelog.select(&\"#{level}?\".to_sym)\n return [ last_release.send(\"#{level}!\"), changes ] if changes.size > 0\n end\n raise ExistingRelease, \"No commit since last release (#{last_release})\"\n end",
"title": ""
},
{
"docid": "4727073baac9e651ea33b9f26e4709b2",
"score": "0.49997965",
"text": "def create_packages(package_metas, release_dir)\n return [] if package_metas.empty?\n\n package_refs = []\n\n event_log_stage = Config.event_log.begin_stage('Creating new packages', package_metas.size)\n\n package_metas.each do |package_meta|\n package_desc = \"#{package_meta['name']}/#{package_meta['version']}\"\n package = nil\n event_log_stage.advance_and_track(package_desc) do\n logger.info(\"Creating new package '#{package_desc}'\")\n package = create_package(package_meta, release_dir)\n register_package(package)\n end\n\n next unless @compiled_release\n\n package_refs << {\n package: package,\n package_meta: package_meta,\n }\n end\n\n package_refs\n end",
"title": ""
},
{
"docid": "671b4939cc295905f8ccc62dbcb20423",
"score": "0.49982873",
"text": "def create_release(tag_name: nil, target_commitish: 'master', name: nil, body: nil, draft: false, prerelease: true)\n @upload_uri = nil\n raise RuntimeError, ':tag_name is required' unless tag_name\n raise RuntimeError, ':target_commitish is required' unless target_commitish\n raise RuntimeError, ':name is required' unless name\n raise RuntimeError, ':body is required' unless body\n payload = {tag_name: tag_name, target_commitish: target_commitish, name: name, body: body, draft: draft, prerelease: prerelease}\n res = api_post(payload: payload)\n @upload_uri = res['upload_url'].gsub(/\\{.+\\}\\z/, '')\n res\n end",
"title": ""
},
{
"docid": "9b5e322f8461d082684848a4cc754d30",
"score": "0.49968526",
"text": "def initialize(args = nil)\n if args && args.is_a?(Hash) \n args.keys.reject { |key| key.is_a?(Symbol) }.each{ |key| args[key.to_sym] = args.delete(key) }\n\n [:major, :minor].each do |param|\n raise ArgumentError.new(\"The #{param.to_s} parameter is required\") if args[param].nil?\n end\n end\n\n @major = args[:major].to_s\n @minor = args[:minor].to_s\n @patch = args[:patch].to_s unless args[:patch].nil?\n @milestone = args[:milestone].to_s unless args[:milestone].nil?\n @branch = args[:branch].to_s unless args[:branch].nil?\n @commiter = args[:commiter].to_s unless args[:commiter].nil?\n @format = args[:format].to_s unless args[:format].nil?\n\n unless args[:build_date].nil?\n get_date = case args[:build_date]\n when 'git-revdate', ''\n get_revdate_from_git\n else \n args[:build_date].to_s\n end\n @build_date = Date.parse(get_date)\n end\n\n unless args[:branch].nil?\n @branch = get_branch_name_from_git\n end\n\n @build = case args[:build]\n when 'git-revcount'\n get_revcount_from_git\n when 'git-hash'\n get_hash_from_git\n when nil, ''\n unless args[:build].nil?\n args.delete(:build)\n end\n else \n args[:build].to_s\n end\n end",
"title": ""
},
{
"docid": "eead358d03ba13990601f78c9c71680a",
"score": "0.49910748",
"text": "def create_release\n release = Kubernetes::Release.create_release(\n builds: @builds,\n deploy: @job.deploy,\n grouped_deploy_group_roles: grouped_deploy_group_roles,\n git_sha: @job.commit,\n git_ref: @reference,\n user: @job.user,\n project: @job.project\n )\n\n unless release.persisted?\n raise Samson::Hooks::UserError, \"Failed to create release: #{release.errors.full_messages.inspect}\"\n end\n\n @output.puts(\"Created kubernetes release #{release.url}\")\n release\n end",
"title": ""
},
{
"docid": "e93237bddd6e2a0e1c646a9047ea9c1d",
"score": "0.498961",
"text": "def releases\n unless @releases\n buffer = \"\"\n run \"ls -x1 #{releases_path}\", :once => true do |ch, str, out|\n buffer << out if str == :out\n raise \"could not determine releases #{out.inspect}\" if str == :err\n end\n @releases = buffer.split.sort\n end\n\n @releases\n end",
"title": ""
},
{
"docid": "635625803d17aa3a58e0b48db36c80cc",
"score": "0.49884605",
"text": "def artifacts\n @artifacts ||= Collection::Artifact.new(self, repos: key) do\n Resource::Artifact.search(name: \".*\", repos: key)\n end\n end",
"title": ""
},
{
"docid": "8b428195e7c3ca112a8b60062364a366",
"score": "0.49809456",
"text": "def versions_with_release\n @versions ||= get_gems_versions.map do |ver|\n [\n Gem::Version.new(ver['number']),\n Time.parse(ver['created_at']).freeze\n ].freeze\n end.reject {|vn, rd| vn.prerelease?}.sort.reverse.freeze\n end",
"title": ""
},
{
"docid": "3cd51c5de39d683149a3cbdc680d0c04",
"score": "0.49746788",
"text": "def versions\n @versions ||= AssetVersions.new(dir, key, filename, asset_processor.version_names)\n end",
"title": ""
},
{
"docid": "a19374986da52a3966102e425b4bfa2b",
"score": "0.49648467",
"text": "def next_release\n self.login\n \n versions = @jira.getVersions(self.project)\n \n # create an array of versions with release dates in the future and sort it\n release_dates = Array.new;\n \n # populate release date array with hashes\n versions.each do |version|\n if(version.releaseDate != nil && version.releaseDate.future?)\n release_dates.push({'name' => version.name, 'release_date' => version.releaseDate})\n end\n end\n \n # sort array by release_date key in hash\n release_dates = release_dates.sort_by do | version |\n version[\"release_date\"]\n end\n \n # return name of the first version in the array\n release_dates[0]\n end",
"title": ""
},
{
"docid": "797a622446cff1c9fe3dbdcaf8fbebf5",
"score": "0.49335706",
"text": "def pipeline_release\n @pipeline_release_resource ||= PipelineRelease.new(@client)\n end",
"title": ""
},
{
"docid": "deac4fc135ac12aec0e69181a8395d23",
"score": "0.493306",
"text": "def create_app_store_version_release_request\n resp = Spaceship::ConnectAPI.post_app_store_version_release_request(app_store_version_id: id)\n return resp.to_models.first\n end",
"title": ""
},
{
"docid": "27d9e80ce6c339d6e5c73210d1ddfc3e",
"score": "0.4932049",
"text": "def process_release(release_dir)\n @release_model = Models::Release.find_or_create(name: @name)\n\n @version = next_release_version if @rebase\n\n release_is_new = false\n @release_version_model = Models::ReleaseVersion.find_or_create(release: @release_model, version: @version.to_s) do\n release_is_new = true\n end\n\n if release_is_new\n @release_version_model.uncommitted_changes = @uncommitted_changes if @uncommitted_changes\n @release_version_model.commit_hash = @commit_hash if @commit_hash\n @release_version_model.save\n elsif @release_version_model.commit_hash != @commit_hash ||\n @release_version_model.uncommitted_changes != @uncommitted_changes\n raise ReleaseVersionCommitHashMismatch,\n \"release '#{@name}/#{@version}' has already been uploaded with commit_hash as \" \\\n \"'#{@release_version_model.commit_hash}' and uncommitted_changes as '#{@uncommitted_changes}'\"\n else\n @fix = true if @release_version_model.update_completed == false\n @release_version_model.update_completed = false\n @release_version_model.save\n end\n\n single_step_stage('Resolving package dependencies') do\n resolve_package_dependencies(manifest_packages)\n end\n\n process_packages(release_dir)\n process_jobs(release_dir)\n\n event_log_stage = Config.event_log.begin_stage(\n @compiled_release ? 'Compiled Release has been created' : 'Release has been created',\n 1,\n )\n event_log_stage.advance_and_track(\"#{@name}/#{@version}\") {}\n\n @release_version_model.update_completed = true\n @release_version_model.save\n end",
"title": ""
},
{
"docid": "27d9e80ce6c339d6e5c73210d1ddfc3e",
"score": "0.4932049",
"text": "def process_release(release_dir)\n @release_model = Models::Release.find_or_create(name: @name)\n\n @version = next_release_version if @rebase\n\n release_is_new = false\n @release_version_model = Models::ReleaseVersion.find_or_create(release: @release_model, version: @version.to_s) do\n release_is_new = true\n end\n\n if release_is_new\n @release_version_model.uncommitted_changes = @uncommitted_changes if @uncommitted_changes\n @release_version_model.commit_hash = @commit_hash if @commit_hash\n @release_version_model.save\n elsif @release_version_model.commit_hash != @commit_hash ||\n @release_version_model.uncommitted_changes != @uncommitted_changes\n raise ReleaseVersionCommitHashMismatch,\n \"release '#{@name}/#{@version}' has already been uploaded with commit_hash as \" \\\n \"'#{@release_version_model.commit_hash}' and uncommitted_changes as '#{@uncommitted_changes}'\"\n else\n @fix = true if @release_version_model.update_completed == false\n @release_version_model.update_completed = false\n @release_version_model.save\n end\n\n single_step_stage('Resolving package dependencies') do\n resolve_package_dependencies(manifest_packages)\n end\n\n process_packages(release_dir)\n process_jobs(release_dir)\n\n event_log_stage = Config.event_log.begin_stage(\n @compiled_release ? 'Compiled Release has been created' : 'Release has been created',\n 1,\n )\n event_log_stage.advance_and_track(\"#{@name}/#{@version}\") {}\n\n @release_version_model.update_completed = true\n @release_version_model.save\n end",
"title": ""
},
{
"docid": "ff9be48deb33bc6e8fd33662f8f223e9",
"score": "0.49240145",
"text": "def initialize(major, minor = 0, revision = nil, *rest)\n\t\tself.components = [ major, minor, revision, *rest ]\n\tend",
"title": ""
},
{
"docid": "6749a536eb44cdd19d626479e1cdb5dc",
"score": "0.4922102",
"text": "def create\n @release = Release.new(release_params)\n # @release.steps_releases =\n\n respond_to do |format|\n if @release.save\n format.html { redirect_to @release, notice: 'Release was successfully created.' }\n format.json { render :show, status: :created, location: @release }\n else\n format.html { render :new }\n format.json { render json: @release.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7eb73f3c030f2c06c51c7fd3f64116a1",
"score": "0.49174878",
"text": "def version(data = nil)\n @version = data.nil? ? @version : Semverse::Version.new(data)\n end",
"title": ""
},
{
"docid": "b8979574e8cda224d31a97d0ab5d1351",
"score": "0.4915816",
"text": "def initialize(data={})\n raise CommitError, \"Commit data required!\" if data.empty?\n \n unless (REQUIRED_FIELDS & data.keys).size == REQUIRED_FIELDS.size\n raise CommitError, \"Invalid commit data!\"\n end\n \n @revision = data['commit']\n @message = data['message']\n @files = data['files'].map { |f| f['file'] }\n end",
"title": ""
},
{
"docid": "fc157fa5e35b68e807afa1598bcb8b77",
"score": "0.4901202",
"text": "def initialize repo_url, branch, manifest_path = MANIFEST_FILE\r\n\r\n @repo_url = repo_url\r\n @branch = branch\r\n @manifest_path = manifest_path\r\n @manifest = JSON.parse File.read(@manifest_path) if File.exist? @manifest_path\r\n\r\n end",
"title": ""
},
{
"docid": "fb385495ef2328e0a63f84644145f97b",
"score": "0.4899081",
"text": "def artifacts_for(version)\n artifacts = Mixlib::Install.new(\n product_name: project_name,\n channel: channel_name.to_sym,\n product_version: version,\n user_agent_headers: ['omnitruck']\n ).artifact_info\n\n Array(artifacts)\n end",
"title": ""
},
{
"docid": "27047528d14928dd0b8be8d356869c79",
"score": "0.48976046",
"text": "def test_release_value_1\n value_ = ::Versionomy.create(:major => 1, :tiny => 4, :tiny2 => 2, :patchlevel => 5)\n assert_equal(1, value_.major)\n assert_equal(0, value_.minor)\n assert_equal(4, value_.tiny)\n assert_equal(2, value_.tiny2)\n assert_equal(:final, value_.release_type)\n assert_equal(5, value_.patchlevel)\n assert_equal(0, value_.patchlevel_minor)\n assert_equal(false, value_.has_field?(:prerelase_version))\n assert_equal(false, value_.has_field?(:prerelase_minor))\n end",
"title": ""
},
{
"docid": "30b297091cdcdf092fca5b115d9d47f9",
"score": "0.48959488",
"text": "def create_package(package_meta, release_dir)\n name = package_meta['name']\n version = package_meta['version']\n\n package_attrs = {\n release: @release_model,\n name: name,\n sha1: nil,\n blobstore_id: nil,\n fingerprint: package_meta['fingerprint'],\n version: version,\n }\n\n package = Models::Package.new(package_attrs)\n package.dependency_set = package_meta['dependencies']\n\n save_package_source_blob(package, package_meta, release_dir) unless @compiled_release\n\n package.save\n end",
"title": ""
},
{
"docid": "f542af0f0ea10e61b3e2270a6faef1fe",
"score": "0.48826912",
"text": "def initialize(dep, latest)\n @dep = dep # The gem\n @name = dep.name # Gem name\n @latest = latest # Latest Gem version\n req_s = dep.requirement.as_list.last # Gem version defined in Gemfile\n num_index = req_s.index(/\\p{N}/) # Find index of the first number in string\n @current = req_s[num_index..req_s.length] # Pluck gem version number X.Y.Z\n end",
"title": ""
},
{
"docid": "d67a6f6882aae3b9dc00af3338f828d5",
"score": "0.4872347",
"text": "def create_version(attributes = nil)\n versions.create(attributes || version_attributes)\n reset_version_changes\n reset_version\n end",
"title": ""
},
{
"docid": "82c14c3d8406a576fe4945d415cbfa92",
"score": "0.48721418",
"text": "def initialize(args = nil)\n if args && args.is_a?(Hash)\n args.keys.reject { |key| key.is_a?(Symbol) }.each { |key| args[key.to_sym] = args.delete(key) }\n\n [:major, :minor].each do |param|\n fail ArgumentError.new(\"The #{param} parameter is required\") if args[param].blank?\n end\n\n @major = args[:major].to_s\n @minor = args[:minor].to_s\n @patch = args[:patch].to_s unless args[:patch].blank?\n @meta = args[:meta].to_s unless args[:meta].blank?\n @milestone = args[:milestone].to_s unless args[:milestone].blank?\n @build = args[:build].to_s unless args[:build].blank?\n @branch = args[:branch].to_s unless args[:branch].blank?\n @committer = args[:committer].to_s unless args[:committer].blank?\n @format = args[:format].to_s unless args[:format].blank?\n\n unless args[:build_date].blank?\n b_date = case args[:build_date]\n when 'git-revdate'\n get_revdate_from_git\n else\n args[:build_date].to_s\n end\n @build_date = Date.parse(b_date)\n end\n\n @build = case args[:build]\n when 'svn'\n get_build_from_subversion\n when 'git-revcount'\n get_revcount_from_git\n when 'git-hash'\n get_hash_from_git\n when nil, ''\n nil\n else\n args[:build].to_s\n end\n end\n end",
"title": ""
},
{
"docid": "b9798f5ebb9845bdb156525523b34e51",
"score": "0.48643103",
"text": "def semver\n @semver ||= SemVer.parse(version)\n end",
"title": ""
},
{
"docid": "070da8090789db55f557b544bda5d33e",
"score": "0.4856114",
"text": "def release(version, date, tag)\n abort \"Version #{version} already exists!\" if releases.any? { |r| r.version == version }\n\n # create new release\n new_release = Changefu::Release.new(version, date, tag)\n\n # create new release directory\n new_release.create_dir\n\n # compose new releases array\n new_releases_list = (releases + [new_release]).map(&:to_yaml_hash)\n\n # update releases.yml file\n save_file(new_releases_list.to_yaml, 'changelog/releases.yml')\n\n # move changes files from unreleased\n Changefu.path_helper('changelog/unreleased').glob('*.yml').each do |file|\n move_file(file, new_release.path)\n end\n\n # reset releases list to force reload next time\n @releases = nil\n end",
"title": ""
},
{
"docid": "847111fb298c603dfb39f0a80a72db13",
"score": "0.48560873",
"text": "def resolve_releases\n uploaded_releases = uploadable_releases.map(&:upload)\n\n parsed_releases.each do |release|\n uploaded_releases.each do |uploaded_release|\n if release[\"name\"] == uploaded_release.name\n release.merge!(uploaded_release.as_hash)\n end\n end\n end\n\n nil # ah\n end",
"title": ""
},
{
"docid": "2dec33f2f128940eec13a1c16a176e14",
"score": "0.48462233",
"text": "def latest_tag_from_version\n return @_latest_tag_from_version if @_latest_tag_from_version\n fail unless system('../dev/releasenotes-md-to-yaml.rb') # generate combined YAML file\n release = YAML.load_file('../config/releases.yml')['releases'].first\n @_latest_tag_from_version = \\\n \"#{TAG_PREFIX}\"\"#{release['version_major']}\" \\\n + \".#{release['version_minor']}.#{release['version_patch']}\" \\\n + (release['version_pre'] ? \"-#{release['version_pre']}\" : '')\nend",
"title": ""
},
{
"docid": "d690cc27d488561f1810d7ad026d247d",
"score": "0.4845887",
"text": "def create\n @artist = Artist.find(params[:artist_id])\n @release = @artist.releases.build(params[:release])\n\n respond_to do |format|\n if @release.save\n format.html { redirect_to [@artist, @release], :notice => 'Release was successfully created.' }\n else\n format.html { render :action => \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "d690cc27d488561f1810d7ad026d247d",
"score": "0.4845887",
"text": "def create\n @artist = Artist.find(params[:artist_id])\n @release = @artist.releases.build(params[:release])\n\n respond_to do |format|\n if @release.save\n format.html { redirect_to [@artist, @release], :notice => 'Release was successfully created.' }\n else\n format.html { render :action => \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "7277ffdefd8d17460bfc16d2bac98a64",
"score": "0.48450598",
"text": "def versions\n @versions ||= github_api_authenticated_get(\"/repos/#{repository_slug}/tags\").map do |x|\n Gem::Version.new(x.fetch('name'))\n end.sort\nend",
"title": ""
},
{
"docid": "78a3c0add1a02b53305f876e12129bb6",
"score": "0.4842197",
"text": "def test_release_value_2\n value_ = ::Versionomy.create(:major => 0, :minor => 3)\n assert_equal(0, value_.major)\n assert_equal(3, value_.minor)\n assert_equal(0, value_.tiny)\n assert_equal(0, value_.tiny2)\n assert_equal(:final, value_.release_type)\n assert_equal(0, value_.patchlevel)\n assert_equal(0, value_.patchlevel_minor)\n assert_equal(false, value_.has_field?(:prerelase_version))\n assert_equal(false, value_.has_field?(:prerelase_minor))\n end",
"title": ""
},
{
"docid": "4e2a7bce585d25ecc28ee275eedcef91",
"score": "0.48388878",
"text": "def source_release\n puts 'github source_release'\n\n # push the version bumped metadata file + newly created files to\n CapsuleCD::GitUtils.push(@source_git_local_path, @source_git_local_branch, @source_git_base_info['ref'])\n # sleep because github needs time to process the new tag.\n sleep 5\n\n # calculate the release sha\n release_sha = ('0' * (40 - @source_release_commit.sha.strip.length)) + @source_release_commit.sha.strip\n\n # get the release changelog\n release_body = CapsuleCD::GitUtils.generate_changelog(@source_git_local_path, @source_git_base_info['sha'], @source_git_head_info['sha'], @source_git_base_info['repo']['full_name'])\n\n release = @source_client.create_release(@source_git_base_info['repo']['full_name'], @source_release_commit.name, target_commitish: release_sha,\n name: @source_release_commit.name,\n body: release_body)\n\n @source_release_artifacts.each do |release_artifact|\n @source_client.upload_asset(release[:url], release_artifact[:path], name: release_artifact[:name])\n end\n\n FileUtils.remove_entry_secure @source_git_parent_path if Dir.exists?(@source_git_parent_path)\n # set the pull request status\n @source_client.create_status(@source_git_base_info['repo']['full_name'], @source_git_head_info['sha'], 'success',\n context: 'CapsuleCD',\n target_url: 'http://www.github.com/AnalogJ/capsulecd',\n description: 'Pull-request was successfully merged, new release created.')\n end",
"title": ""
},
{
"docid": "0ac78c0df98394663f6f5683f4fb7aed",
"score": "0.48319644",
"text": "def run\n @repo_names.map! { |name|\n github = Github.new\n repo = github.get_single_repo(name)\n\n Product.where(github_identifier: repo.full_name).first_or_create do |r|\n r.title = repo.name\n r.state = \"Under Development\"\n r.github_identifier = repo.full_name\n r.description = repo.description\n r.rails_version = github.get_rails_version(name)\n r.ruby_version = github.get_ruby_version(name)\n end\n }.compact\n end",
"title": ""
},
{
"docid": "48234747137bd94a96b5b677a7523690",
"score": "0.48305035",
"text": "def initialize(args = nil)\n if args && args.is_a?(Hash)\n args.each_key {|key| args[key.to_sym] = args.delete(key) unless key.is_a?(Symbol)}\n \n [:major, :minor].each do |param|\n raise ArgumentError.new(\"The #{param.to_s} parameter is required\") if args[param].nil?\n end\n\n @major = int_value(args[:major])\n @minor = int_value(args[:minor])\n\n if args[:patch] && args[:patch] != '' && int_value(args[:patch]) >= 0\n @patch = int_value(args[:patch])\n end\n \n if args[:milestone] && args[:milestone] != '' && int_value(args[:milestone]) >= 0\n @milestone = int_value(args[:milestone])\n end\n\n if args[:build] && args[:build] != '' && int_value(args[:build]) >= 0\n @build = int_value(args[:build])\n end\n\n @branch = args[:branch] unless args[:branch] == ''\n @committer = args[:committer] unless args[:committer] == ''\n \n if args[:build_date] && args[:build_date] != ''\n str = args[:build_date].to_s\n @build_date = Date.parse(str)\n end\n\n @build = case args[:build] \n when 'svn'\n get_build_from_subversion\n when 'git-revcount'\n get_revcount_from_git\n when 'git-hash'\n get_hash_from_git\n else\n args[:build] && int_value(args[:build])\n end\n end\n end",
"title": ""
},
{
"docid": "ce98a54ba442fafdb32b31e5ea0f53cb",
"score": "0.48204502",
"text": "def semver_version\n if Build::Check.on_tag?\n # timestamp is disabled in omnibus configuration\n Omnibus.load_configuration('omnibus.rb')\n Omnibus::BuildVersion.semver\n else\n latest_git_tag = Info::Git.latest_tag.strip\n latest_version = latest_git_tag && !latest_git_tag.empty? ? latest_git_tag[0, latest_git_tag.match(\"[+]\").begin(0)] : '0.0.1'\n commit_sha = Build::Info::Git.commit_sha\n ver_tag = \"#{latest_version}+\" + (Build::Check.is_nightly? ? \"rnightly\" : \"rfbranch\")\n ver_tag += \".fips\" if Build::Check.use_system_ssl?\n [ver_tag, Gitlab::Util.get_env('CI_PIPELINE_ID'), commit_sha].compact.join('.')\n end\n end",
"title": ""
},
{
"docid": "d2914305d843d3326c72b95c12a11026",
"score": "0.48175085",
"text": "def release_create(account_id, distribution_id, params)\n path = sprintf(\"/api/v2/accounts/%s/distributions/%s/releases\", account_id, distribution_id)\n data_hash = {}\n post_body = nil\n \n if params.present?\n unless params.kind_of?(PhraseApp::RequestParams::ReleasesParams)\n raise PhraseApp::ParamsHelpers::ParamsError.new(\"Expects params to be kind_of PhraseApp::RequestParams::ReleasesParams\")\n end\n end\n \n data_hash = params.to_h\n err = params.validate\n if err != nil\n return nil, err\n end\n reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)\n rc, err = PhraseApp.send_request(@credentials, \"POST\", path, reqHelper.ctype, reqHelper.body, 201)\n if err != nil\n return nil, err\n end\n \n return PhraseApp::ResponseObjects::Release.new(JSON.load(rc.body)), err\n end",
"title": ""
},
{
"docid": "b86a4cf3a7b5366de8cc797f31bbcde7",
"score": "0.48066422",
"text": "def execute(version)\n tags = release_tags\n exact = matching_tags(tags, version.major, version.minor, version.patch)\n\n # If there already is a Helm version for the input version. we just\n # return that one.\n return latest_version(exact) if exact.any?\n\n # Next, we try to find Helm tags for the GitLab MAJOR.MINOR version. If\n # found, we will return a new patch version based on the found version.\n minor = matching_tags(tags, version.major, version.minor)\n\n return Version.new(latest_version(minor).next_patch) if minor.any?\n\n # Next, we try to find Helm tags for the GitLab MAJOR version. If found,\n # we will return a new minor version based on the found version.\n major = matching_tags(tags, version.major)\n\n return Version.new(latest_version(major).next_minor) if major.any?\n\n # No tags were found for the specified GitLab version. In this case we\n # simply take the latest Helm version, and generate a new major version\n # based on that.\n return Version.new(latest_version(tags.keys).next_major) if tags.any?\n\n # If there are no tags at all, which in practise is not the case, we\n # just raise an error.\n raise 'The Helm charts project does not have any Git tags'\n end",
"title": ""
},
{
"docid": "937911b13a71d34c474ffc5a6b6f6043",
"score": "0.48047718",
"text": "def create_release(build)\n # find role configs to avoid N+1s\n roles_configs = Kubernetes::DeployGroupRole.where(\n project_id: @job.project_id,\n deploy_group: @job.deploy.stage.deploy_groups.map(&:id)\n )\n\n # get all the roles that are configured for this sha\n configured_roles = Kubernetes::Role.configured_for_project(@job.project, @job.commit)\n if configured_roles.empty?\n raise Samson::Hooks::UserError, \"No kubernetes config files found at sha #{@job.commit}\"\n end\n\n # build config for every cluster and role we want to deploy to\n errors = []\n group_config = @job.deploy.stage.deploy_groups.map do |group|\n roles = configured_roles.map do |role|\n role_config = roles_configs.detect do |dgr|\n dgr.deploy_group_id == group.id && dgr.kubernetes_role_id == role.id\n end\n\n unless role_config\n errors << \"No config for role #{role.name} and group #{group.name} found, add it on the stage page.\"\n next\n end\n\n {\n id: role.id,\n replicas: role_config.replicas,\n cpu: role_config.cpu,\n ram: role_config.ram\n }\n end\n {id: group.id, roles: roles}\n end\n\n raise Samson::Hooks::UserError, errors.join(\"\\n\") if errors.any?\n\n release = Kubernetes::Release.create_release(\n deploy_id: @job.deploy.id,\n deploy_groups: group_config,\n build_id: build.try(:id),\n git_sha: @job.commit,\n git_ref: @reference,\n user: @job.user,\n project: @job.project\n )\n\n unless release.persisted?\n raise Samson::Hooks::UserError, \"Failed to create release: #{release.errors.full_messages.inspect}\"\n end\n\n @output.puts(\"Created release #{release.id}\\nConfig: #{group_config.to_json}\")\n release\n end",
"title": ""
},
{
"docid": "f06a8695ad642397570e91c39e7b5faa",
"score": "0.48044696",
"text": "def create!\n @client.create_version(@repo_name, @package_name, @version_name)\n end",
"title": ""
},
{
"docid": "22b1f05b8f8b487b9c7e8e7e59ee3c5f",
"score": "0.48035428",
"text": "def build_entry\n wanted_keys = %w(apiVersion description name version)\n chart_info = read_chart(tar_file_path).select { |k, v| wanted_keys.include? k }\n digest = Digest::SHA256.file(tar_file_path).hexdigest\n result = chart_info.merge(\n created: File.ctime(tar_file_path).to_datetime.rfc3339,\n digest: digest,\n urls: [ chart_url ],\n )\n # Do a sort on the keys to match output of the official helm CLI\n Hash[result.transform_keys(&:to_s).to_a.sort]\nend",
"title": ""
},
{
"docid": "4f791892fac1fe45c4005a81b6450473",
"score": "0.4799379",
"text": "def initialize name, version\n @name = name\n @version = version\n end",
"title": ""
},
{
"docid": "dc4490fc915d682000dd267103cfbd66",
"score": "0.47958708",
"text": "def initialize(distribution_release_name, architecture)\n if distribution_release_name\n @distribution_release_name = distribution_release_name.downcase\n else\n @distribution_release_name = nil\n end\n @architecture = architecture || \"amd64\"\n end",
"title": ""
},
{
"docid": "31a26ac65231b39e80a4e4004a833488",
"score": "0.4790828",
"text": "def initialize(major, minor, patch, revision = 0, release_labels = nil, metadata = nil)\n super(major, minor, patch, release_labels, metadata)\n\n @revision = Integer(revision, revision.is_a?(String) ? 10 : 0)\n end",
"title": ""
},
{
"docid": "474e6e3771620a723dfaa6b965188b95",
"score": "0.47876668",
"text": "def publish_version!(metadata, tarball, readme)\n dependency_names = metadata.dependencies.keys\n existing_cookbooks = Cookbook.where(name: dependency_names)\n\n transaction do\n self.maintainer = metadata.maintainer\n self.description = metadata.description\n\n cookbook_version = cookbook_versions.build(\n cookbook: self,\n license: metadata.license,\n version: metadata.version,\n tarball: tarball,\n readme: readme.contents,\n readme_extension: readme.extension\n )\n\n save!\n\n metadata.platforms.each do |name, version_constraint|\n cookbook_version.supported_platforms.create!(\n name: name,\n version_constraint: version_constraint\n )\n end\n\n metadata.dependencies.each do |name, version_constraint|\n cookbook_version.cookbook_dependencies.create!(\n name: name,\n version_constraint: version_constraint,\n cookbook: existing_cookbooks.find { |c| c.name == name }\n )\n end\n end\n\n CookbookNotifyWorker.perform_async(id)\n\n true\n end",
"title": ""
},
{
"docid": "376984cf04d5ed57cb65ccd7a7f7116e",
"score": "0.47874945",
"text": "def create\n @project = Project.find_or_create_by name: params[:project_id]\n \n env = params[:environment] || params[:release][:environment]\n\n # old style\n if env.is_a? String\n @environment = Environment.find_or_create_by(name: env)\n params[:release].delete(:environment)\n end\n\n # new style\n if env.is_a? Hash\n @environment = Environment.find_or_initialize_by deployment_host: env[:deployment_host], destination: env[:destination]\n @environment.update_attributes(environment_params)\n end\n\n\n @release = Release.new(release_params)\n @release.project = @project\n @release.environment = @environment\n\n respond_to do |format|\n if @release.save!\n format.html { redirect_to [@project, @release], :notice => 'Release was successfully created.' }\n format.json { render :json => @release, :status => :created, :location => project_release_path(@release.project.name, @release) }\n else\n format.html { render :text => @release.errors }\n format.text { render :text => @release.errors }\n format.json { render :json => @release.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62b565d6f8c68b20d34c766c2d58dbd7",
"score": "0.47864935",
"text": "def latest_version\n graph = Solve::Graph.new\n versions.each do |version, url|\n graph.artifacts(name, version)\n end\n graph.demands(name, \">= 0.0.0\")\n\n version = Solve.it!(graph)[name]\n\n [ version, versions[version] ]\n end",
"title": ""
},
{
"docid": "7434e06ec145c28a1fabf8ed016398fe",
"score": "0.47832322",
"text": "def initialize(attributes)\n @id = attributes['id']\n @version = attributes['build_version']['display_version']\n @build_number = attributes['build_version']['build_version']\n @release_notes = attributes['release_notes_summary']\n @distributed_at = attributes['distributed_at']\n @json = attributes\n end",
"title": ""
},
{
"docid": "bfc956ef7a794153396fe87d4468bd99",
"score": "0.47812426",
"text": "def create\n @release = Release.new(params[:release])\n\n if params[:add_states] != nil\n params[:add_states].each do |f|\n @state = State.find(f)\n @release.states << @state\n end\n end\n\n if params[:create_by_system] == \"1\"\n @release.event_types << EventType.find(1)\n end\n\n if params[:add_event_types] != nil\n params[:add_event_types].each do |f|\n @event_type = EventType.find(f)\n @release.event_types << @event_type\n end\n end\n\n respond_to do |format|\n if @release.save\n format.html { redirect_to @release, notice: 'Ausloeser wurde erfolgreich erzeugt' }\n format.json { render json: @release, status: :created, location: @release }\n else\n self.reload_params\n format.html { render action: \"new\" }\n format.json { render json: @release.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c815b64421ff564407b94dce3a7135fd",
"score": "0.47755763",
"text": "def new\n @article = Article.new params[:article]\n @categories = Category.all\n @version = @article.versions.build\n end",
"title": ""
},
{
"docid": "9c9857bc87f70639a20e281b0cd6d546",
"score": "0.47739545",
"text": "def initialize(*args)\n args = args.flatten!\n self.name = args.first\n self.sha = args.last\n end",
"title": ""
},
{
"docid": "47dedd6a5d64290ddf9b810b7b52b5a6",
"score": "0.47698802",
"text": "def initialize(major = 0, minor = 0, revision = 0)\n @major = major\n @minor = minor\n @revision = revision\n end",
"title": ""
},
{
"docid": "d905f5f3c359ffd634acde7efcb1d4aa",
"score": "0.47677106",
"text": "def initialize(project, client)\n @project = project\n @client = client\n @existing_tags = project.releases.pluck(:tag).to_set\n end",
"title": ""
},
{
"docid": "4939a4ded1eccd009ac532c1cf44ec83",
"score": "0.47665143",
"text": "def serialize_releases(releases) \n json = \"{[\"\n releases.each do |release|\n json += serialize_release(release)\n json += \",\" unless release == releases.last\n end\n json += \"]}\"\n end",
"title": ""
},
{
"docid": "be69d3de640899284ec052d5cdf6d3ad",
"score": "0.4759401",
"text": "def release dimension=\"patch\"\n %x[semver inc #{dimension}]\n %x[git commit -m \"Version $(semver tag)\" -- .semver]\n %x[git semtag]\n end",
"title": ""
},
{
"docid": "378fc128dd923b1458a87839720d1411",
"score": "0.47553852",
"text": "def release_file \n lines = []\n lines << \"Origin: #{@options[:origin]}\"\n lines << \"Label: #{@options[:origin]}\"\n lines << \"Suite: #{@options[:distribution]}\"\n lines << \"Version: #{@options[:version]}\"\n lines << \"Codename: #{@options[:distribution]}\"\n lines << \"Date: #{Time.new.utc.strftime '%a, %d %b %Y %H:%M:%S UTC'}\"\n lines << \"Architectures: #{@options[:architectures].join(\" \")}\"\n lines << \"Components: #{@options[:components]}\"\n lines << \"Description: #{@options[:description]}\"\n lines << \"MD5Sum:\"\n @options[:architectures].each do |arch|\n # Have to create the files in real life to get the real size\n temp_packages_file = Tempfile.new(\"Packages\")\n temp_packages_file.write packages_file(arch)\n temp_packages_file_gz = Tempfile.new(\"Packages.gz\")\n temp_packages_file_gz.write packages_file_gz(arch)\n lines << \" #{Digest::MD5.hexdigest(packages_file(arch))} #{temp_packages_file.size} #{@options[:components]}/binary-#{arch}/Packages\"\n lines << \" #{Digest::MD5.hexdigest(packages_file_gz(arch))} #{temp_packages_file_gz.size} #{@options[:components]}/binary-#{arch}/Packages.gz\"\n end\n lines.join(\"\\n\") + \"\\n\"\n end",
"title": ""
},
{
"docid": "7fa94d62424562ec2499931476874f72",
"score": "0.47475326",
"text": "def initialize name, version, platform = nil, source = nil, &specblock\n @dependencies = []\n @name = name\n @platform = platform || Gem::Platform::RUBY\n @source = source\n @specblock = specblock || MISSING\n @version = Gem::Version.create version\n end",
"title": ""
},
{
"docid": "b58f5af08e9e365bf0a0b5ab71f23ca9",
"score": "0.4747498",
"text": "def create\n @project = Project.find params[:project_id]\n @release = @project.releases.new(release_params)\n\n if @release.save\n redirect_to project_url(@project), notice: 'Release was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "7f779c64d4655328d66a3ea55a84e57c",
"score": "0.4739694",
"text": "def build_release\n converge_by 'execute before_build' do\n instance_eval(&new_resource.before_build)\n end if new_resource.before_build\n\n converge_if_changed :purge_on_build do\n new_resource.purge_on_build.each do |dst|\n directory release_name(dst) do\n path release_path(dst)\n recursive true\n action :delete\n only_if do\n ::File.directory?(release_path(dst))\n end\n not_if do\n ::File.symlink?(release_path(dst))\n end\n end\n end\n end\n\n converge_if_changed :create_on_build do\n new_resource.create_on_build.each do |dst|\n directory release_name(dst) do\n path release_path(dst)\n owner new_resource.user\n group new_resource.group\n not_if do\n ::File.symlink?(release_path(dst))\n end\n end\n end\n end\n\n converge_if_changed :symlink_on_build do\n new_resource.symlink_on_build.each do |src, dst|\n link release_name(dst) do\n target_file release_path(dst)\n to shared_path(src)\n only_if do\n !::File.exist?(release_path(src)) ||\n ::File.symlink?(release_path(src))\n end\n end\n end\n end\n\n converge_by 'execute after_build' do\n instance_eval(&new_resource.after_build)\n end if new_resource.after_build\n\n converge_if_changed :release_hash do\n converge_by 'execute after_updated' do\n instance_eval(&new_resource.after_updated)\n end if new_resource.after_updated\n end\n end",
"title": ""
}
] |
0c11669b07fca9d9fd8a2a63ab44ef5a
|
DELETE /item_sp_resource_invs/1 DELETE /item_sp_resource_invs/1.json
|
[
{
"docid": "dcd408f0f4899b20f560f555b2a54852",
"score": "0.7976812",
"text": "def destroy\n @item_sp_resource_inv = ItemSpResourceInv.find(params[:id])\n @item_sp_resource_inv.destroy\n\n respond_to do |format|\n format.html { redirect_to item_sp_resource_invs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "ac15c32c1fa6a910c298192a2135b9a5",
"score": "0.7369601",
"text": "def destroy\n @resource_item = ResourceItem.find(params[:id])\n @resource_item.destroy\n\n respond_to do |format|\n format.html { redirect_to resource_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dd28d3e1a88c9bb835fba6d92785ccca",
"score": "0.7123977",
"text": "def destroy\n @sp_resource = SpResource.find(params[:id])\n @sp_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to sp_resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8c53dbeece4c1433d45b19d517872b2e",
"score": "0.6968973",
"text": "def destroy\n\t\t@resource_item.destroy\n\t respond_to do |format|\n\t format.html { redirect_to resource_items_url, notice: 'Resource item was successfully destroyed.' }\n\t format.json { head :no_content }\n\t end\n\tend",
"title": ""
},
{
"docid": "f0e82ff26734819737f904269816e3ca",
"score": "0.6830292",
"text": "def destroy\n onevnet('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "bf7d08a55a42656abd37fcd3e761a44e",
"score": "0.6754582",
"text": "def destroy\n onevnet \"delete\", resource[:name]\n end",
"title": ""
},
{
"docid": "cdc69632974a72dbd8aadc2e9957f7f6",
"score": "0.6745218",
"text": "def destroy_rest\n @v1_item_usage = V1ItemUsage.find(params[:id])\n @v1_item_usage.destroy\n\n respond_to do |format|\n format.html { redirect_to(v1_item_usages_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "174b723f9e43bfa7501a9cdc389e4c1b",
"score": "0.6739521",
"text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end",
"title": ""
},
{
"docid": "c619fd123244f9aa1060b69cf725287e",
"score": "0.67029643",
"text": "def destroy\n @interp_item = InterpItem.find(params[:id])\n @interp_item.destroy\n\n respond_to do |format|\n format.html { redirect_to interp_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ec4f461cd83072c1a3154510ae617af0",
"score": "0.66863346",
"text": "def destroy\n @request_item = RequestItem.find(params[:id])\n @request_item.destroy\n\n respond_to do |format|\n format.html { redirect_to request_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5db28defc5db9e0ab954ab9fd61aa51e",
"score": "0.66680163",
"text": "def destroy_rest\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d1dbb713630b5b93c2ff1fbdf3ba01b0",
"score": "0.6666755",
"text": "def delete_item token, item_id\n uri = URI.parse \"https://#{get_hostname(token)}/sf/v3/Items(#{item_id})\"\n puts uri\n \n http = Net::HTTP.new uri.host, uri.port\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n \n request = Net::HTTP::Delete.new(uri.request_uri)\n request[\"Authorization\"] = get_authorization_header(token)\n \n response = http.request request\n puts \"#{response.code} #{response.message}\"\n if response.kind_of? Net::HTTPNoContent\n puts \"Deleted Item\"\n end\nend",
"title": ""
},
{
"docid": "c1f7467fd51c9fe4482e72dde9a3a08a",
"score": "0.6628468",
"text": "def destroy\n @rs_item.destroy\n respond_to do |format|\n format.html { redirect_to rs_items_url, notice: 'Rs item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "78e4ca862d5bd16170226a61df8edb6e",
"score": "0.6602216",
"text": "def destroy\n @v1_item_line = V1::ItemLine.find(params[:id])\n @v1_item_line.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "dd8b8458191edf0b5a4c6e1fa426afeb",
"score": "0.65581673",
"text": "def destroy\n @vegresource = Vegresource.find(params[:id])\n @vegresource.destroy\n\n respond_to do |format|\n format.html { redirect_to vegresources_url }\n # format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eb39e08b6641fc748734257eba48fae4",
"score": "0.6556934",
"text": "def destroy\n @spot_plan_item = SpotPlanItem.find(params[:id])\n @spot_plan_item.destroy\n\n respond_to do |format|\n format.html { redirect_to spot_plan_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf80dbdec1ac2b7c14dcd4f5954f33b6",
"score": "0.6535583",
"text": "def destroy\n @resource = @client.resources.find(params[:id])\n @resource.destroy\n\n respond_to do |format|\n flash[:notice] = 'Resource was successfully removed.' \n format.html { redirect_to client_resources_url(@client) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "87632d2a9296136aa9adabc240e424ba",
"score": "0.65348",
"text": "def delete(resource)\n\t\t\tend",
"title": ""
},
{
"docid": "87632d2a9296136aa9adabc240e424ba",
"score": "0.65348",
"text": "def delete(resource)\n\t\t\tend",
"title": ""
},
{
"docid": "ac6ce581a27e69d0fc21ae3d9c02ce26",
"score": "0.6531671",
"text": "def delete\n self.class.headers 'Authorization' => \"OAuth #{ENV['sfdc_token']}\"\n self.class.headers 'Content-Type' => \"application/json\"\n response = self.class.delete(SObject.root_url+\"/sobjects/#{@object_name}/#{@Id}\")\n raise response.parsed_response[0]['message'] if response.code.to_i > 299\n nil\n end",
"title": ""
},
{
"docid": "7ba3ffc3f842560fa1fbcad79adc92a0",
"score": "0.6517558",
"text": "def delete_item\n @item.destroy!\n render json: { }\n end",
"title": ""
},
{
"docid": "85552fb3ad2653405279bc4bb559aef9",
"score": "0.6501347",
"text": "def destroy\n output = \"onevnet delete #{resource[:name]} \", self.class.login\n `#{output}`\n end",
"title": ""
},
{
"docid": "9df5493612b7cad981e008bd4513cd2b",
"score": "0.64992803",
"text": "def destroy\n @api_item.destroy\n end",
"title": ""
},
{
"docid": "9df5493612b7cad981e008bd4513cd2b",
"score": "0.64992803",
"text": "def destroy\n @api_item.destroy\n end",
"title": ""
},
{
"docid": "108041bc77bf172cd96a4d4effa0512d",
"score": "0.64861375",
"text": "def delete(resource:)\n trace(\"valkyrie.delete\") do |span|\n span.set_tag(\"param.resource\", resource.id.to_s)\n __getobj__.delete(resource: resource)\n end\n end",
"title": ""
},
{
"docid": "53f726edb49ea41e0ac73c994854a2b1",
"score": "0.6481945",
"text": "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",
"title": ""
},
{
"docid": "513be81407e355c7ebb2a9107e59a6d0",
"score": "0.647255",
"text": "def destroy\n @invoiceitem = Invoiceitem.find(params[:id])\n @invoiceitem.destroy\n\n respond_to do |format|\n format.html { redirect_to invoiceitems_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3957283654a1d870c9d9ed30ac3c3192",
"score": "0.6459928",
"text": "def destroy\n @inventory_item = InventoryItem.find(params[:id])\n @inventory_item.destroy\n\n respond_to do |format|\n format.html { redirect_to inventory_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3957283654a1d870c9d9ed30ac3c3192",
"score": "0.6459928",
"text": "def destroy\n @inventory_item = InventoryItem.find(params[:id])\n @inventory_item.destroy\n\n respond_to do |format|\n format.html { redirect_to inventory_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "003826bcac3e5f66a0c6bd310e60ba7e",
"score": "0.6438633",
"text": "def destroy\n @resource = Resource.find(params[:id])\n @resource.delete()\n render json: {status: 200}\n end",
"title": ""
},
{
"docid": "9481656533c9a6e6f606f8eb477a37ff",
"score": "0.6438416",
"text": "def destroy\n @item_inst.destroy\n respond_to do |format|\n format.html { redirect_to item_insts_url, notice: 'Item inst was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8bf798991b464682282ce992b2cc858f",
"score": "0.6433053",
"text": "def destroy\n ensure_authenticated!\n dpl = find_item(params[:id])\n authorize!(dpl.user_uid)\n dpl.base_uri = api_path()\n dpl.user = @credentials[:cn]\n\n begin\n dpl.cancel! if dpl.can_cancel?\n rescue Exception => e\n raise ServerError, \"Cannot cancel deployment: #{e.message}\"\n end\n\n location_uri = uri_to(\n resource_path(params[:id]),\n :in, :absolute\n )\n\n render :text => \"\",\n :head => :ok,\n :location => location_uri,\n :status => 202\n end",
"title": ""
},
{
"docid": "526d9f59784f48031c9066550a1e97b0",
"score": "0.6431217",
"text": "def destroy\n @statement_item.destroy\n respond_to do |format|\n format.html { redirect_to statement_statement_items_url(@statement) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "838eabf37782d320c93e562e007cdde8",
"score": "0.64237905",
"text": "def destroy\n @inttableitem.destroy\n respond_to do |format|\n format.html { redirect_to inttableitems_url, notice: 'Inttableitem was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "892bd9d05d5fa92aa893beaa78a8687f",
"score": "0.6418593",
"text": "def destroy\n @sa_action_item.destroy\n respond_to do |format|\n format.html { redirect_to sa_action_items_url, notice: 'Sa action item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "06a0736ea616cd4ca0598a328e7078dd",
"score": "0.64162797",
"text": "def do_DELETE(req, res)\n domain, resource, id, format = parse_request_path(req.path_info)\n sdb_delete_item(domain, \"#{resource}_#{id}\")\n raise WEBrick::HTTPStatus::OK\n end",
"title": ""
},
{
"docid": "c267d44eee753c4389d7521cf0c0d6ff",
"score": "0.6415138",
"text": "def delete(resource_type_identifier); end",
"title": ""
},
{
"docid": "7287ea477c40be471a943b700f6e2e17",
"score": "0.64115393",
"text": "def destroy\n @grsi_item.destroy\n respond_to do |format|\n format.html { redirect_to grsi_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6908a24c8f6b7fe3f786729ccb73fb0e",
"score": "0.6409899",
"text": "def destroy\n @request_item = RequestItem.find(params[:id])\n @request_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(request_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a916227d1c6a85b28621a5d79f4f7b26",
"score": "0.6406167",
"text": "def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to [@plan, @assembly] }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ad1c41dc020f32fcd020ec50b291ca3",
"score": "0.6404434",
"text": "def destroy\n @itemservice = Itemservice.find(params[:id])\n @itemservice.destroy\n\n respond_to do |format|\n format.html { redirect_to itemservices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20ec5155d440e780c2935a0b2d013896",
"score": "0.64021516",
"text": "def destroy\n @item_api = ItemApi.find(params[:id])\n @item_api.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_apis_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5b0ab37e33b164e381e72c8f92acc7a3",
"score": "0.63923573",
"text": "def destroy\n Api.delete(\"#{BASE_PATH}/#{line_item_id}\")\n true\n end",
"title": ""
},
{
"docid": "e9cecca44e6c103e358712052293fc16",
"score": "0.63828033",
"text": "def destroy\n ensure_authenticated!\n dpl = find_item(params[:id])\n authorize!(dpl.user_uid)\n dpl.base_uri = api_path\n dpl.tls_options = tls_options_for(:out)\n dpl.user = @credentials[:cn]\n\n begin\n dpl.cancel! if dpl.can_cancel?\n rescue StandardError => e\n raise ServerError, \"Cannot cancel deployment: #{e.message}\"\n end\n\n location_uri = uri_to(\n resource_path(params[:id]),\n :in, :absolute\n )\n\n render plain: '',\n head: :ok,\n location: location_uri,\n status: 202\n end",
"title": ""
},
{
"docid": "758985b6e4b1e6f89bfa0c890e524827",
"score": "0.6379673",
"text": "def destroy\n @map_item_inv = MapItemInv.find(params[:id])\n @map_item_inv.destroy\n\n respond_to do |format|\n format.html { redirect_to map_item_invs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5c338e2938f2e45d3f2cd4eb23cfcc89",
"score": "0.6371023",
"text": "def destroy\n @request_item.destroy\n respond_to do |format|\n format.html { redirect_to request_items_url, notice: 'Request item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d0c4042c2199cdd9e4ac8c46c2c7cd3b",
"score": "0.6370906",
"text": "def destroy\n @st_item.destroy\n respond_to do |format|\n format.html { redirect_to st_items_url, notice: 'St item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "85de423f1f24305391029737d0265f61",
"score": "0.6369696",
"text": "def destroy\n item = Item.find(params[:id])\n item.destroy\n render :json => item\n end",
"title": ""
},
{
"docid": "83baee25e963c288f4bec4ac089c3599",
"score": "0.63671845",
"text": "def destroy\n @production_item = ProductionItem.find(params[:id])\n @production_item.destroy\n\n respond_to do |format|\n format.html { redirect_to production_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c2b06c8934a1264699cd5a0e366f4cd9",
"score": "0.63665855",
"text": "def destroy\n # :id here represents the name so we don't have to change the routes\n @item = Item.find_by_name(params[:id])\n p params\n logger.debug @item.inspect\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content, status: 200 }\n end\n end",
"title": ""
},
{
"docid": "057bb7143c78bf8c674d0317504021f0",
"score": "0.63631684",
"text": "def destroy\n @item = Item.find(params[:id])\n respond_to do |format|\n if @item.destroy\n format.json { render json: {:id => @item.id}, status: :ok }\n else\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12eb6568a3f6151ea70f030dfa8de5d4",
"score": "0.636069",
"text": "def destroy\n generic_item = @specific_item.generic_item\n @specific_item.destroy\n\n respond_to do |format|\n format.html { redirect_to :back, :notice => t('notice.successfully_deleted')}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "94ad1c119637632b6ee9fa38a4a14321",
"score": "0.63601476",
"text": "def destroy\n @dummy_resource = DummyResource.find(params[:id])\n @dummy_resource.destroy\n\n respond_to do |format|\n format.html { redirect_to dummy_resources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "315bd9b6437e34abcaa43f1fe5dc4ad3",
"score": "0.63592386",
"text": "def destroy\n @sta_item.destroy\n respond_to do |format|\n format.html { redirect_to sta_items_url, notice: 'Sta item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "193553ab0b8b27c9b580341c3ac4ebca",
"score": "0.6356534",
"text": "def destroy\n @horizon_service_item.destroy\n respond_to do |format|\n format.html { redirect_to horizon_service_items_url, notice: \"Horizon service item was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bf5dd01aeca3a5eeff8eb9a82c0f1615",
"score": "0.6354306",
"text": "def destroy\n @invoice_line_item = InvoiceLineItem.find(params[:id])\n @invoice_line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to invoice_line_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0cc243806aafef13299cda03d9959eff",
"score": "0.63508826",
"text": "def destroy\n @medium_tc_item_inv = MediumTcItemInv.find(params[:id])\n @medium_tc_item_inv.destroy\n\n respond_to do |format|\n format.html { redirect_to medium_tc_item_invs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cdd23683923e27ef9708c977c191f875",
"score": "0.63507783",
"text": "def destroy\n @item_lines = ItemLine.find(params[:id])\n @item_lines.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "cee408f03e729061f713b5b0e9ce572d",
"score": "0.6347961",
"text": "def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to edit_invoice_path(@item.invoice.id) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9112ab42f0d0fa4973feb6aba47adb86",
"score": "0.6346286",
"text": "def destroy\n @item = @course.items.find(:first, :conditions => ['lower(name) = ?', params[:item_id].downcase.gsub('_', ' ')])\n @irating = @item.iratings.find(params[:id])\n @irating.destroy\n\n respond_to do |format|\n format.html { redirect_to(course_item_iratings_path(@course, @item)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a82ffe6e0bea3bb1cc29c2685cc0f5ee",
"score": "0.63378143",
"text": "def destroy\n @item.destroy\n render json: { status: 'success' }\n end",
"title": ""
},
{
"docid": "245c4affdd8f190f770b23d0fd7ed988",
"score": "0.63377625",
"text": "def destroy\n @appresource = Appresource.find(params[:id])\n @appresource.destroy\n\n respond_to do |format|\n format.html { redirect_to appresources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "606ca6421f51328db405314ea9ab0010",
"score": "0.6336017",
"text": "def destroy\n @uniform_item.destroy\n respond_to do |format|\n format.html { redirect_to uniform_items_url, notice: (t 'uniform_items.title')+(t 'actions.removed') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d7894fe8f8289be6ddf4d659bbd69209",
"score": "0.6327958",
"text": "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",
"title": ""
},
{
"docid": "5b378adb178af80c6e0e2b08b4e690f5",
"score": "0.63212484",
"text": "def destroy\n @intcalcitem.destroy\n respond_to do |format|\n format.html { redirect_to intcalcitems_url, notice: 'Intcalcitem was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "406a99dbdca9771ec1fb14cafac291c2",
"score": "0.63190544",
"text": "def destroy\n @pit_lineitem.destroy\n respond_to do |format|\n format.html { redirect_to pit_lineitems_url, notice: 'Pit lineitem was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f54d70fbf36efb5d53eee7f1b5da581c",
"score": "0.6318025",
"text": "def destroy\n @az_store_item_scetch = AzStoreItemScetch.find(params[:id])\n @az_store_item_scetch.destroy\n\n respond_to do |format|\n format.html { redirect_to(az_store_item_scetches_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "34e8be546b6adccdcfa64f46ab03d222",
"score": "0.63154876",
"text": "def destroy\n @item = Item.find(params[:item_id])\n @request.destroy\n respond_to do |format|\n format.html { redirect_to item_url(@item), notice: \"Request was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "843a80eb7a01621c89af1e3f1743b40e",
"score": "0.63116807",
"text": "def destroy\n @item.destroy\n render json: nil\n end",
"title": ""
},
{
"docid": "12b055f187606b2813628811c2cc93ea",
"score": "0.6311042",
"text": "def destroy\n\tputs \"destroy\"\n @resource = Resource.find(params[:id])\n @resource.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "58a1c49c007e8ed9e769df333574696d",
"score": "0.6307203",
"text": "def destroy\n @sla_item.destroy\n respond_to do |format|\n format.html { redirect_to sla_items_url, notice: 'Sla item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c5233942dcd9cabe5b19b61a899f9f41",
"score": "0.63021594",
"text": "def destroy\n @line_items = LineItem.find(params[:id])\n @line_item.destroy\n if @line_item.destroy\n render json: {status: :successfully}\n else\n render json: { status: error}\n end\n end",
"title": ""
},
{
"docid": "bb1bbf46ce51c592fb2c9f05e26a44ef",
"score": "0.62997115",
"text": "def destroy\n if @item.destroy\n head :no_content, status: 200\n else\n render json: @item.errors, status: 405\n end\n end",
"title": ""
},
{
"docid": "1149e55374960c7b3a193cdb10e432d9",
"score": "0.6296119",
"text": "def destroy\n @static_item = StaticItem.find(params[:id])\n @static_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(static_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "00e17eb824b02b764ec0440c2319667c",
"score": "0.6288372",
"text": "def destroy\n @pipeline_item = PipelineItem.find(params[:id])\n @pipeline_item.destroy\n\n respond_to do |format|\n format.html { redirect_to pipeline_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d2da3fb19e3ad67321e6b918c13d3ddd",
"score": "0.6272613",
"text": "def destroy\n @item.destroy\n render :json => { status: :deleted, head: :no_content }\n end",
"title": ""
},
{
"docid": "f9d302a1f75361545cf91c44f1b7f92a",
"score": "0.62717974",
"text": "def destroy\n @item_collection.destroy\n respond_to do |format|\n format.html { redirect_to item_collections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4f588a203de0254579994f89344ee0e8",
"score": "0.62712777",
"text": "def domainResourceDelete args\n \tif not args.has_key(:ResourceID)\n \t\traise \"ResourceID argument missing from argument list\"\n \tend\n \t\n \tmake_request this_method, args\n end",
"title": ""
},
{
"docid": "195efbe55200134a83c546bedfee5e59",
"score": "0.6269991",
"text": "def destroy\n @item = Item.find(params[:id])\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",
"title": ""
},
{
"docid": "30da7fe43a2df3dbc57f8c8dfa0a0d7d",
"score": "0.62697875",
"text": "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 :no_content }\n end\n end",
"title": ""
},
{
"docid": "6caaeb69c5a42e68801946413c82b620",
"score": "0.626333",
"text": "def delete( client, id = nil)\n # FIXME if id defined - should use class method\n id = self.resource_id unless id\n # FIXME if no id defined\n client.delete( (sprintf \"%s/%s\", end_point, id), { 'format' => 'json' })\n self.resource_id = nil\n end",
"title": ""
},
{
"docid": "ffb33b8880a0ad7a9676092d8ec160f5",
"score": "0.6262432",
"text": "def destroy\n\t\t@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",
"title": ""
},
{
"docid": "cebd84430491d8af42dedf4a3a398bf1",
"score": "0.6262081",
"text": "def destroy\n @item = Item.find(params[:id])\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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259481",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6259141",
"text": "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",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "a2711dc32468f164ab0b270ef4623ae2",
"score": "0.0",
"text": "def redeemed_voucher_params\n params.require(:redeemed_voucher).permit(:user_id, :voucher_id)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69225836",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.68929327",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67848456",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.674347",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6682223",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.6636527",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.66291976",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.66258276",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65625846",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6491194",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.64526874",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.64001405",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.63810205",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.63634825",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.633783",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6336759",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6325718",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.631947",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.63146484",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.63137317",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.6306224",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.6301168",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.63000035",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.629581",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.6280713",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.6271388",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6266194",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6256044",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.62550515",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.62525266",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6234781",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62278074",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6226693",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.6226605",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6226114",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6200643",
"text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end",
"title": ""
},
{
"docid": "d724124948bde3f2512c5542b9cdea74",
"score": "0.61913997",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61835426",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.6179986",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61630195",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6160931",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6155551",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61542404",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61356604",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61342114",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61188847",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.61140966",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61107725",
"text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61038506",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61038506",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.60860336",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60855556",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.608446",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6076753",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60742563",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60677326",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60666215",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6065763",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.60655254",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.6064794",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.6062697",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60562736",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.60491294",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.6046521",
"text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end",
"title": ""
},
{
"docid": "080d2fb67f69228501429ad29d14eb29",
"score": "0.6041768",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.60346854",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6030552",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6024842",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6021606",
"text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.6019679",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6017253",
"text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.60145336",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "2aa7b93e192af3519f13e9c65843a6ed",
"score": "0.60074294",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006753",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60048765",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60009843",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6000161",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.599852",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.59947807",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5993962",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.5992739",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.59911275",
"text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.59906775",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
}
] |
d60f07ffebe1d997cc5bacc13d3bea99
|
GET /medicine_histories/1 GET /medicine_histories/1.json
|
[
{
"docid": "793d0570fc6a0492e9ec7bbe4afb4b89",
"score": "0.72066313",
"text": "def show\n @medicine_history = MedicineHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medicine_history }\n end\n end",
"title": ""
}
] |
[
{
"docid": "8781c9b3121b0cae67ff5efeb9964bc1",
"score": "0.7299959",
"text": "def index\n @medicalhistories = Medicalhistory.all\n end",
"title": ""
},
{
"docid": "ebfc1ad2b9685a5e395934374c38668a",
"score": "0.7080224",
"text": "def index\n\t\t@medical_histories = MedicalHistory.all\n\t\thide_remove_action\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @medical_histories }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c80e9541969642103da7ef614976cc5e",
"score": "0.69231683",
"text": "def show\n @medical_history = MedicalHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @medical_history }\n end\n end",
"title": ""
},
{
"docid": "22fcf41dac36db036b3a238ab9795d10",
"score": "0.6915053",
"text": "def show\n @medical_history = current_user.medical_histories.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"title": ""
},
{
"docid": "e1fe1b4ecda37fcfd0e48f706762696f",
"score": "0.6831161",
"text": "def new\n @medicine_history = MedicineHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medicine_history }\n end\n end",
"title": ""
},
{
"docid": "9a6be4f06edf5579a1bfa5e6d060804b",
"score": "0.6678897",
"text": "def index\n @histories = History.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @histories }\n end\n end",
"title": ""
},
{
"docid": "b9c110a231a43e8f6216b3f1edb2cfcc",
"score": "0.6630938",
"text": "def new\n @medical_history = MedicalHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @medical_history }\n end\n end",
"title": ""
},
{
"docid": "bbb4d4a10af0a015669877e26724a741",
"score": "0.6576323",
"text": "def show\n @pur_hist = PurHist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pur_hist }\n end\n end",
"title": ""
},
{
"docid": "ac7c3712d4f581d4f9203a60fdbdd8f9",
"score": "0.6563621",
"text": "def show\n @historial_odc = HistorialOdc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial_odc }\n end\n end",
"title": ""
},
{
"docid": "920960c62e30a09c6de99bbe3801ace4",
"score": "0.6553017",
"text": "def index\n @patient = Patient.find(params[:patient_id])\n @patient_injuries = @patient.patient_injuries\n @title = \"Patient Histories\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @patient_injuries }\n end\n end",
"title": ""
},
{
"docid": "d320ff5ed7bc3e289517669037e5a63e",
"score": "0.65475804",
"text": "def index\n @personal_histories = @patient.personal_histories.all\n end",
"title": ""
},
{
"docid": "8661b2578dd85891ddb9e743bcd463f1",
"score": "0.6431426",
"text": "def index\n @medicaments = Medicament.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @medicaments }\n end\n end",
"title": ""
},
{
"docid": "a69c13315ef9f6a52fe4a7d444326e47",
"score": "0.642133",
"text": "def index\n @medicaments = Medicament.all\n\n render json: @medicaments\n end",
"title": ""
},
{
"docid": "fcd2d7133dfed3cce538f12beca68170",
"score": "0.63962",
"text": "def index\n @empleado = Empleado.find(params[:empleado_id])\n @historia_medicas = @empleado.historia_medicas.all\n end",
"title": ""
},
{
"docid": "3efa35575dd9fa3c899a819ddaccee7c",
"score": "0.63822913",
"text": "def histories_show\n @gallery = Gallery.find(params[:id])\n @ads = @gallery.ads\n @history_info = @ads.map do |ad|\n has_seen_total = ad.histories.count { |e| e.has_been_seen == true }\n has_notseen_total = ad.histories.count { |e| e.has_been_seen == false }\n total = has_seen_total + has_notseen_total\n history = {\n has_seen_total: has_seen_total,\n has_notseen_total: has_notseen_total,\n total: total\n }\n\n end\n\n if @history_info\n render json: {\n gallery: @gallery,\n ads: @ads,\n history_info: @history_info,\n }\n else\n render json: {\n status: 500,\n errors: ['no histories found']\n }\n end\n end",
"title": ""
},
{
"docid": "e9fb4690475a8884ff6f35ec1f00fdac",
"score": "0.6382209",
"text": "def show\n\t\t@medical_history = MedicalHistory.find(params[:id])\n\t\t@back_url = params[:back_url].nil? ? medical_histories_path : params[:back_url]\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @medical_history }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0b7411958e1a02200136c0f6eb46ae7e",
"score": "0.6359105",
"text": "def index\n @histories = History.all\n respond_with(@histories)\n end",
"title": ""
},
{
"docid": "3051ee5f65fe42e68e272b55b607620e",
"score": "0.63370186",
"text": "def set_medicalhistory\n @medicalhistory = Medicalhistory.find(params[:id])\n end",
"title": ""
},
{
"docid": "24abd59555efc106a10d4dc924038b53",
"score": "0.63245356",
"text": "def show\n @marital_history = MaritalHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @marital_history }\n end\n end",
"title": ""
},
{
"docid": "2518cb058e145adb2c753ff32bea3721",
"score": "0.6318183",
"text": "def index\n @item_histories = ItemHistory.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @item_histories }\n end\n end",
"title": ""
},
{
"docid": "4a2a29d84695a03a11718ddc21baa35b",
"score": "0.6296242",
"text": "def index\n @title = \"Препараты\"\n @medicaments = Medicament.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @medicaments }\n end\n end",
"title": ""
},
{
"docid": "aa87d675e14ef64e1643f68478e25537",
"score": "0.62766796",
"text": "def new\n\t\t@medical_history = MedicalHistory.new\n\t\t@medical_history.initialize_with_associations\n\t\t@medicals = Medical.all.sort\n\t\t@back_url = medical_histories_path\n\n\t\t@allergies_count\t\t\t= 0\n\t\t@antecedents_count\t\t= 0\n\t\t@consultations_count\t= 0\n\t\t@diseases_count\t\t\t\t= 0\n\t\t@medical_exams_count\t= 0\n\t\t@medications_count\t\t= 0\n\t\t@vaccines_count\t\t\t\t= 0\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @medical_history }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0f7b182154dabf278e40660977861fa7",
"score": "0.62711596",
"text": "def new\n @historial_odc = HistorialOdc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @historial_odc }\n end\n end",
"title": ""
},
{
"docid": "e8231e302018308141a7b2b3ebe93afa",
"score": "0.6221141",
"text": "def index\n @dhermatologic_visits = @patient.dhermatologic_visits.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dhermatologic_visits }\n end\n end",
"title": ""
},
{
"docid": "f9e673ab2c6647e25412aeaa55ba7a88",
"score": "0.6219645",
"text": "def new\n @pur_hist = PurHist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pur_hist }\n end\n end",
"title": ""
},
{
"docid": "d1fdd21f24aaecb737eef4cdf28a08f1",
"score": "0.6212233",
"text": "def index\n @home_page = true\n @last_added_medications = Medication.order_by([[:updated_at, :desc]]).limit(10)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @medications }\n end\n end",
"title": ""
},
{
"docid": "10dee4373e520dc9ba71446ba48675ae",
"score": "0.6202555",
"text": "def set_medical_history\n @medical_history = MedicalHistory.find(params[:id])\n end",
"title": ""
},
{
"docid": "331e3b32f39f71ade05946ef56e50d75",
"score": "0.6145282",
"text": "def index\n @search_histories = SearchHistory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @search_histories }\n end\n end",
"title": ""
},
{
"docid": "42789c796012369923ecd47f442cbdf4",
"score": "0.61415225",
"text": "def index\n @page = \"histories\"\n\n if user_signed_in?\n @histories = History.where(\"user_id = ? and executed_date > chosen_date and tour_id > 0\", current_user.id).order(\"executed_date DESC\").paginate(:per_page => 12, :page => params[:page])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @histories }\n end\n end",
"title": ""
},
{
"docid": "9e6abfabe3cd046d6c38b0b48078ca10",
"score": "0.61232907",
"text": "def index\n @payment_histories = PaymentHistory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @payment_histories }\n end\n end",
"title": ""
},
{
"docid": "4ebb9340070a7035fbbb2354445eebb7",
"score": "0.610471",
"text": "def index\n @patienthistories = Patienthistory.all\n end",
"title": ""
},
{
"docid": "68c3c8c56d41450e796cf73523abd8b9",
"score": "0.6097022",
"text": "def index\n @medical_administration_records = MedicalAdministrationRecord.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @medical_administration_records }\n end\n end",
"title": ""
},
{
"docid": "848b2fd40b78a6525272532a1c8aeaaa",
"score": "0.6093267",
"text": "def history\n historical_data = DrainHistory.all\n render :json => {:history => historical_data}\n end",
"title": ""
},
{
"docid": "70a4f824ff70ee0534bd8aa40f998aa5",
"score": "0.60928416",
"text": "def show\n @medical_history = MedicalHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @medical_history }\n end\n end",
"title": ""
},
{
"docid": "06f1ec0735f80bfd83fd8dd18e24f5de",
"score": "0.6086023",
"text": "def show\n @loan_history = LoanHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @loan_history }\n end\n end",
"title": ""
},
{
"docid": "e2042af2ae0d368a9599288e0fc74b56",
"score": "0.6085149",
"text": "def index\n @personal_histories = PersonalHistory.all\n end",
"title": ""
},
{
"docid": "d27583d0784b684cd7d6109b7e0c3819",
"score": "0.60850734",
"text": "def new\n @medical_history = MedicalHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end",
"title": ""
},
{
"docid": "22896856417dc9fcbeaa9117db644ffd",
"score": "0.6078909",
"text": "def index\n if params.has_key?(:identity_id)\n identity = Identity.find_by_id_identifier_or_nickname(params[:identity_id], :find_deleted => staff?) # only staff can see deleted users\n raise NotFoundError.new('Page Not Found') if identity.nil? \n if current_game.nil?\n @histories = identity.events\n else\n @histories = identity.events.where(:game_id => current_game.id)\n end\n else\n @asked_for_index = true\n end\n\n respond_to do |format|\n format.html do\n if @resource_histories.nil?\n @histories = Resource::History.paginate(:order => \"identity_id ASC\", :page => params[:page], :per_page => 50) \n @paginate = true \n end \n end\n format.json do\n raise ForbiddenError.new('Access Forbidden') if @asked_for_index\n render json: @histories \n end\n end \n end",
"title": ""
},
{
"docid": "b6afb841182e4df7857a81c66e3eff0a",
"score": "0.6077256",
"text": "def index\n @animal_histories = AnimalHistory.all.page params[:page]\n end",
"title": ""
},
{
"docid": "a0bfc319c08df144d7b213b7ed0bf9c6",
"score": "0.6076737",
"text": "def show\n @expense_history = ExpenseHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense_history }\n end\n end",
"title": ""
},
{
"docid": "9f4396255daa427aa69f77ce6019a6a2",
"score": "0.60726357",
"text": "def index\n @humedals = Humedal.all\n render json: @humedals\n end",
"title": ""
},
{
"docid": "c4ef8f9786b9279251e130e09896d29e",
"score": "0.60723877",
"text": "def index\n #@applicant_education_histories = ApplicantEducationHistory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @applicant_education_histories }\n end\n end",
"title": ""
},
{
"docid": "257b0dbca83fc3b40eab0cb6ad6fd4f6",
"score": "0.6061653",
"text": "def index\n history = @user.histories\n histories = []\n @user.histories.each do |history|\n histories << { place_type: history.place_type, name: history.name, date: history.created_at.to_date }\n end\n render json: histories, status: 200\n end",
"title": ""
},
{
"docid": "09ef210237a107e7697e34f996516626",
"score": "0.6052837",
"text": "def show\n @historial_oct = HistorialOct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial_oct }\n end\n end",
"title": ""
},
{
"docid": "ff7fe24cee39ea71bff8e0a460b45212",
"score": "0.60376996",
"text": "def index\n @response_histories = ResponseHistory.all\n end",
"title": ""
},
{
"docid": "e71c56759d4436ce140d03940aaf63aa",
"score": "0.60302585",
"text": "def index\n @horesases = Horesase.all\n @horesase_boys = Kaminari.paginate_array(JSON.parse(fetch_meigens)).page(params[:page]).per(50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @horesases }\n end\n end",
"title": ""
},
{
"docid": "f7356718039a4f18d1ad4c74fee90212",
"score": "0.6030026",
"text": "def index\n @historials = Historial.all\n end",
"title": ""
},
{
"docid": "ba5594469a4e2da7002733f3c06aa58f",
"score": "0.601592",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: MedicamentsDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "5063f52ea7c47efa736e550780f49352",
"score": "0.6008046",
"text": "def show\n @historique = Historique.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historique }\n end\n end",
"title": ""
},
{
"docid": "69ab33bac1d28457105b8e5eb7d66743",
"score": "0.59962094",
"text": "def show\n @medicine = Medicine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medicine }\n end\n end",
"title": ""
},
{
"docid": "523147502cf6a5764756dfe137a8d98f",
"score": "0.5993284",
"text": "def index\n @histories = History.all\n end",
"title": ""
},
{
"docid": "523147502cf6a5764756dfe137a8d98f",
"score": "0.5993284",
"text": "def index\n @histories = History.all\n end",
"title": ""
},
{
"docid": "aac32f6fcd41d85808206981621738d4",
"score": "0.5989538",
"text": "def index\n @ste_supplier_histories = SteSupplierHistory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ste_supplier_histories }\n end\n end",
"title": ""
},
{
"docid": "b8c9eca9bc38052fcb5bcea4087df9c2",
"score": "0.5987704",
"text": "def index\n @hills = Hill.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hills }\n end\n end",
"title": ""
},
{
"docid": "eee1e9398e1ccb684b5483ab8eb9fb32",
"score": "0.59827954",
"text": "def index\n @login_histories = LoginHistory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @login_histories }\n end\n end",
"title": ""
},
{
"docid": "33c9792a1c6137e8f78daa32b244ebeb",
"score": "0.59748393",
"text": "def destroy\n\t\t@medical_history = MedicalHistory.find(params[:id])\n\t\t@medical_history.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to medical_histories_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a4ed506684b0246b8b016ab132a8ec31",
"score": "0.59715307",
"text": "def show\n @medic = Medic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medic }\n end\n end",
"title": ""
},
{
"docid": "73bddb447efb2c4dd060bb9a9cdf1285",
"score": "0.59682983",
"text": "def show\n @ticket = Ticket.find(params[:id])\n @tickets = [@ticket] \n @histories = []\n @tickets.each do |ticket|\n temp = {}\n ticket.histories.each do |h|\n temp[h.cuota.strftime('%Y-%m-%d')] = h\n end\n @histories[ticket.id] = temp\n end unless @tickets.nil?\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ticket }\n end\n end",
"title": ""
},
{
"docid": "6e9c3444d0bdab6569f1c03d4bf0813b",
"score": "0.5965144",
"text": "def index\n @ste_customer_histories = SteCustomerHistory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ste_customer_histories }\n end\n end",
"title": ""
},
{
"docid": "b9981689319e6da93359e01c5c408b88",
"score": "0.5959294",
"text": "def show\n @histories = @user.histories.order(created_at: :DESC)\n end",
"title": ""
},
{
"docid": "ee3a123c9410034580a5d1fcabd381b7",
"score": "0.59392595",
"text": "def index\n @memories = apply_scopes(Memory).page(params[ :p ])\n\n respond_to do |format|\n format.json { render json: @memories,\n serializer: MemoriesSerializer,\n each_serializer: MemorySpanSerializer,\n total: @memories.total_count,\n page: @page,\n date: @date,\n julian: @julian,\n calendaries: @calendary_slugs,\n locales: @locales }\n format.html { render :index } end;end",
"title": ""
},
{
"docid": "0e64e8155bebe4e1c51209da2fb80987",
"score": "0.5936828",
"text": "def index\n @patient=Patient.find_by_user_id(current_user.id)\n @family_histories = @patient.family_histories.all\n end",
"title": ""
},
{
"docid": "cba07d4ccea90d95122a317a8529048e",
"score": "0.5929112",
"text": "def new\n @medical_history = MedicalHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @medical_history }\n end\n end",
"title": ""
},
{
"docid": "a5850070b23f282b594fa6a042aa9c39",
"score": "0.5918445",
"text": "def index\n @service_histories = ServiceHistory.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @service_histories\n end",
"title": ""
},
{
"docid": "a55454bf61ca58d8245417a94838f360",
"score": "0.5910273",
"text": "def index\n @employment_histories = @person.employment_histories\n end",
"title": ""
},
{
"docid": "d82f1082c3f3b32c9fb8186018ca382f",
"score": "0.59054947",
"text": "def show\n @creature_history = CreatureHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @creature_history }\n end\n end",
"title": ""
},
{
"docid": "003b1ac5cdc937f68f2cdb56c8b9c398",
"score": "0.590034",
"text": "def index\n @equipment_histories = EquipmentHistory.all\n end",
"title": ""
},
{
"docid": "595194726d33bebbf374fce35e30c6cc",
"score": "0.5896401",
"text": "def retrieval_histories\n if context[:days].to_i > 0\n model.retrieval_histories.after_days(context[:days].to_i)\n elsif context[:months].to_i > 0\n model.retrieval_histories.after_months(context[:months].to_i)\n elsif context[:year].to_i > 0\n model.retrieval_histories.until_year(context[:year].to_i)\n else\n model.retrieval_histories\n end\n end",
"title": ""
},
{
"docid": "181e78c00b8f13c7f88c34f40c71d493",
"score": "0.5895822",
"text": "def show\n @personal_history = PersonalHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personal_history }\n end\n end",
"title": ""
},
{
"docid": "8b944f1d44c244f17a4b74f61f1b3ee0",
"score": "0.589547",
"text": "def destroy\n @medical_history = current_user.medical_histories.find(params[:id])\n @medical_history.destroy\n\n respond_to do |format|\n format.html { redirect_to(medical_histories_path) }\n end\n end",
"title": ""
},
{
"docid": "1fded1a3bbfb1807de5a30165c62e36e",
"score": "0.58902204",
"text": "def index\n @itemhistories = Itemhistory.all\n end",
"title": ""
},
{
"docid": "f99c4b447652797037111f9f2a33bd88",
"score": "0.58882576",
"text": "def index\n @pur_hists = PurHist.all\n\n if @pur_hists.size < 1\n \n @hist_sets = []\n \n else\n \n @hist_sets = _index_Build_hist_sets\n \n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pur_hists }\n end\n end",
"title": ""
},
{
"docid": "fac54d1810e6c0449c2a7e071041c224",
"score": "0.58840847",
"text": "def show\n @alarm_history = AlarmHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @alarm_history }\n end\n end",
"title": ""
},
{
"docid": "1a2a355126c4e56464acb24476a30023",
"score": "0.5878332",
"text": "def index\n\t \t@histories = History.all\n\t \t@histories = @histories.search(params[:search]) if params[:search].present? \n\tend",
"title": ""
},
{
"docid": "d24ce4bd64d65b2a42e229a4c9aa5ed1",
"score": "0.58769536",
"text": "def index\n @olympic_medals = OlympicMedal.all\n end",
"title": ""
},
{
"docid": "e0b084e0474c0877289c1a6e6ae0a574",
"score": "0.5875492",
"text": "def new\n @historial_oct = HistorialOct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @historial_oct }\n end\n end",
"title": ""
},
{
"docid": "48ddcfeee49f76a29b2fc103c6d7eb4e",
"score": "0.58706766",
"text": "def destroy\n @medical_history = MedicalHistory.find(params[:id])\n @medical_history.destroy\n\n respond_to do |format|\n format.html { redirect_to medical_histories_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df27fec2e49f90c021f88dc7515568c1",
"score": "0.58683884",
"text": "def create\n @medical_history = MedicalHistory.new(params[:medical_history])\n\n respond_to do |format|\n if @medical_history.save\n format.html { redirect_to @medical_history, :notice => 'Medical history was successfully created.' }\n format.json { render :json => @medical_history, :status => :created, :location => @medical_history }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @medical_history.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4068236abdea4c3976139af5a373c6b4",
"score": "0.58651346",
"text": "def history\n if login?\n @histories = SearchHistory.where(user_id: current_user.id)\n .limit(LIMIT)\n .order(updated_at: :desc)\n render :index\n else\n render json: {}, status: 200\n end\n end",
"title": ""
},
{
"docid": "50cff0c490a1e22101017d5dabe8a024",
"score": "0.58634096",
"text": "def create\n @medicalhistory = Medicalhistory.new(medicalhistory_params)\n\n respond_to do |format|\n if @medicalhistory.save\n format.html { redirect_to @medicalhistory, notice: 'Medicalhistory was successfully created.' }\n format.json { render :show, status: :created, location: @medicalhistory }\n else\n format.html { render :new }\n format.json { render json: @medicalhistory.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d604e48f6aaae868f0104c82210afdd9",
"score": "0.58487654",
"text": "def index\n @medicines = Medicine.all\n end",
"title": ""
},
{
"docid": "8ff90f4466c1d1da00ce5d20408dbb29",
"score": "0.58369064",
"text": "def get_wiki_histories(wiki_id, params = {})\n get(\"wikis/#{wiki_id}/history\", params)\n end",
"title": ""
},
{
"docid": "2c0e613692edd1dc1249d53708f6a204",
"score": "0.58358616",
"text": "def index\n @humidities = Humidity.all\n end",
"title": ""
},
{
"docid": "5cf42ac094c6d96bdd507822ff2000e5",
"score": "0.5833402",
"text": "def show\n @prescriptions = @medication.prescriptions.order_by([:created_at, :desc])\n @secondary_effects = @prescriptions.with_secondary_effects.page(params[:page]).per(10)\n @experiences = @prescriptions.with_experience\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medication }\n end\n end",
"title": ""
},
{
"docid": "d9d2c6e4176c7ca9621455f705f1785a",
"score": "0.5832929",
"text": "def index\n @pet_histories = @pet.pet_histories# Se muestran los historiales asociados a este mascota\n end",
"title": ""
},
{
"docid": "4b1e5d0d03c1caadce4612222b4b9b7f",
"score": "0.5831828",
"text": "def return_histograms\n\t\t\tresp = {\n\t\t\tcategory: params[:_id],\n\t\t\tseries: {}\n\t\t\t}\n\t\t\t@types.each do |type|\n\t\t\t\tresp[:series][type[\"name\"].to_sym] = {\n\t\t\t\t\ttype: type[\"name\"],\n\t\t\t\t\tdata: @hists[type[\"name\"].to_sym].histogram,\n\t\t\t\t\tmean: @hists[type[\"name\"].to_sym].mean,\n\t\t\t\t\tmean_position: @hists[type[\"name\"].to_sym].mean_box,\n\t\t\t\t\tfork_size: @hists[type[\"name\"].to_sym].fork_size,\n\t\t\t\t\tmin_value: @hists[type[\"name\"].to_sym].min_value,\n\t\t\t\t\tmax_value: @hists[type[\"name\"].to_sym].max_value\n\t\t\t\t}\n\t\t\tend\n\t\t\tresp.to_json\n\t\tend",
"title": ""
},
{
"docid": "285247df112f6aa94df6e8db21750386",
"score": "0.58318233",
"text": "def surgical_history\n render json: service.surgical_history(patient, date)\n end",
"title": ""
},
{
"docid": "e5512a12048bf0768d98af582ef4f872",
"score": "0.58301854",
"text": "def new\n @medic = Medic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medic }\n end\n end",
"title": ""
},
{
"docid": "998f3c6cf7b4a599a5a9ab5a2c8d64a6",
"score": "0.58258677",
"text": "def set_historia_medica\n @empleado = Empleado.find(params[:empleado_id])\n @historia_medica = @empleado.historia_medicas.find(params[:id])\n end",
"title": ""
},
{
"docid": "3bc05961da138f9f16a61a9c3ba705b8",
"score": "0.58217674",
"text": "def show\n @historia = Historia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historia }\n end\n end",
"title": ""
},
{
"docid": "4ebe660a2738f9c41ac081d7bf1d921a",
"score": "0.58192545",
"text": "def new\n @expense_history = ExpenseHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense_history }\n end\n end",
"title": ""
},
{
"docid": "b3480b93a7aaffe0cfdab4b8094d9832",
"score": "0.581779",
"text": "def index\n @pet_histories = @pet.pet_histories\n end",
"title": ""
},
{
"docid": "691f43b6258f79655d816db15ddf391c",
"score": "0.58098567",
"text": "def index\n @medical_services = MedicalService.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @medical_services }\n end\n end",
"title": ""
},
{
"docid": "dc1c941904aa1e2a3e149b9753e27423",
"score": "0.58040273",
"text": "def index\n @ko_medications = KoMedication.all\n end",
"title": ""
},
{
"docid": "2fe3e3f582e53070f536c751581b172a",
"score": "0.5800588",
"text": "def index\n @medical_records = MedicalRecord.all\n end",
"title": ""
},
{
"docid": "4b918e3824d5e69ad44cfb50c24beda2",
"score": "0.5799725",
"text": "def index\n @history_invoices = HistoryInvoice.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @history_invoices }\n end\n end",
"title": ""
},
{
"docid": "7066203fff1730a68f1253a94513a636",
"score": "0.5797057",
"text": "def index\n @medical_histories = current_user.medical_histories.find(:all, :order => :approx_date)\n @illness = current_user.illness_histories.find(:all, :order => :measured_on)\n @medications = current_user.medications.find(:all, :order => :prescribed_start)\n \n \n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"title": ""
},
{
"docid": "6b8fd70816e6005de8566b809ecfbbbe",
"score": "0.5795722",
"text": "def index\n \n per_page = _index_get_per_page()\n @histories = History.paginate(\n :page => params[:page],\n :order => 'created_at asc',\n :per_page => per_page)\n # :per_page => per_page,\n # :conditions => ['memos LIKE ?', \"%#{search_word}%\"])\n\n @history_size = History.all.size\n \n #debug\n write_log(\n @log_path,\n \"@histories.size => \" + @histories.size.to_s,\n # __FILE__,\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @histories }\n end\n end",
"title": ""
},
{
"docid": "0529e6f32455a05b9f78205ab6931a08",
"score": "0.57918143",
"text": "def create\n\t\t@medical_history = MedicalHistory.new(params[:medical_history])\n\t\t@medicals = Medical.all.sort\n\t\t@back_url = params[:back_url].nil? ? medical_histories_path : params[:back_url]\n\n\t\t@allergies_count\t\t\t= @medical_history.id.nil? ? 0 : @medical_history.allergies.size\n\t\t@antecedents_count\t\t= @medical_history.id.nil? ? 0 : @medical_history.antecedents.size\n\t\t@consultations_count\t= @medical_history.id.nil? ? 0 : @medical_history.consultations.size\n\t\t@diseases_count\t\t\t\t= @medical_history.id.nil? ? 0 : @medical_history.diseases.size\n\t\t@medical_exams_count\t= @medical_history.id.nil? ? 0 : @medical_history.medical_exams.size\n\t\t@medications_count\t\t= @medical_history.id.nil? ? 0 : @medical_history.medications.size\n\t\t@vaccines_count\t\t\t\t= @medical_history.id.nil? ? 0 : @medical_history.vaccines.size\n\n\t\trespond_to do |format|\n\t\t\tif @medical_history.save\n\t\t\t\tformat.html { redirect_to medical_histories_path, notice: CrudTranslations.model_was_created(@medical_history) }\n\t\t\t\tformat.json { render json: @medical_history, status: :created, location: @medical_history }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @medical_history.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "335af38450949289c4daafd278e768be",
"score": "0.5781988",
"text": "def show\n @historial = Historial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historial }\n end\n end",
"title": ""
}
] |
3f3ad490a13bcd7d0a88453d32caf6ec
|
gets the most popular trends by occurrence
|
[
{
"docid": "31f159b0c22daf9191bb6352a8ba24d9",
"score": "0.6595628",
"text": "def get_top_trends\n trend_info = TrendDatum.find_by_sql(\n [\n 'select locations.name as city, locations.country as country,\n trends.name as name, count(trend_data.trend_id) as value_occurrence from trend_data\n inner join locations on trend_data.location_id = locations.id\n inner join trends on trend_data.trend_id = trends.id\n group by trend_data.trend_id order by value_occurrence desc limit 20'\n ]\n )\n\n trending_data = []\n trend_info.each do |trend_data|\n trend_data_point = LocalTrendData.new(trend_data.country, trend_data.city, trend_data.name)\n unless trend_data_point.nil?\n trending_data.push trend_data_point\n end\n end\n trending_data\n end",
"title": ""
}
] |
[
{
"docid": "dad46e0ae0c7442ba0d35e537f139f99",
"score": "0.6087611",
"text": "def find_most_popular(dimension = nil)\n all.sort_by { |o| o.rate_average(true, dimension) }.last\n end",
"title": ""
},
{
"docid": "e57fc2923337603c720f0c614fdbd251",
"score": "0.60317075",
"text": "def word_with_most_repeats(sentence)\n words = sentence.split\n\n hash = {}\n\n words.each do |word|\n hash[word] = count_repeats(word)\n end\n\n max = hash.values.max\n\n ties = hash.select {|k, v| v == max }.first.first\n\n\n\n\nend",
"title": ""
},
{
"docid": "b95f8f650539bf52ec0bb9269ddaa95f",
"score": "0.6022227",
"text": "def popular\n act = self.listings.map {|l| l.activity_id}\n activities = act.map {|a| Activity.find(a)}\n counts = Hash.new 0\n act.each do |id|\n counts[id] += 1\n end\n popular = 0\n appearances = 0\n counts.each do |id, value|\n if value > appearances \n appearances = value\n popular = id\n end\n end\n Activity.find(popular)\n end",
"title": ""
},
{
"docid": "057b1476b12a6f6e87395ff7cfef9b11",
"score": "0.5933986",
"text": "def calculate_line_with_highest_frequency\n @highest_count_across_lines = @analyzers.max_by(&:highest_wf_count).highest_wf_count\n @highest_count_words_across_lines = []\n @analyzers.each do |word|\n @highest_count_words_across_lines << word if word.highest_wf_count == @highest_count_across_lines\n end\n end",
"title": ""
},
{
"docid": "fd5bf1972813977563348cba8a6b500e",
"score": "0.59034956",
"text": "def highestfrequency\r\n #@counts.group_by { |x| x }.map { |element, matches| [ element, matches ] }.to_h\r\n #@counts.each_with_object({}) { |item, memo| memo[item] ||= 0; memo[item] += 1 }\r\n ##@counts.uniq.map { |x| [x, @counts.count(x)] }.to_h\r\n #freq = @counts.inject(Hash.new(0)) { |h,v| h[v] += 1; h }\r\n @counts.max_by { |k,v| v }\r\n end",
"title": ""
},
{
"docid": "4c8d061c851b36b6937e03109e9c251d",
"score": "0.58919525",
"text": "def popular_time\n sql = \"SELECT screenings.screen_time FROM screenings\n INNER JOIN tickets ON screenings.id = tickets.screening_id\n WHERE tickets.film_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql,values)\n\n array_of_screen_times = result.map { |row_hash|\n row_hash['screen_time']}\n\n\n screentimes_counts = Hash.new(0)\n for time_str in array_of_screen_times\n screentimes_counts[time_str] += 1\n end\n\n return screentimes_counts.max_by{|k,v| v}[0]\n # frequency_hash = array_of_screen_times.inject(Hash.new(0)) { |h,v| h[v] += 1; h }\n # highest_frequency_pair = frequency_hash.max_by { |v| frequency_hash[v] }\n # return highest_frequency_pair[0]\n end",
"title": ""
},
{
"docid": "94ab41b61840e73d5727766688785ad2",
"score": "0.58547133",
"text": "def calculate_line_with_highest_frequency()\n maximo = @analyzers.max_by(&:highest_wf_count)\n @highest_count_across_lines = maximo.highest_wf_count\n @highest_count_words_across_lines = []\n @analyzers.each do |linha|\n if linha.highest_wf_count == @highest_count_across_lines\n @highest_count_words_across_lines << linha\n end\n end\n #puts \"maximo dos maximos: #{@highest_count_across_lines}#{highest_count_words_across_lines.flatten}\"\n #@highest_count_words_across_lines = Array.new\n #@analyzers.each do |analyzed| \n # @highest_count_words_across_lines << analyzed.highest_wf_words\n #end\n end",
"title": ""
},
{
"docid": "42bb7a62854cec5f18cb05108e6cb871",
"score": "0.58305883",
"text": "def calculate_line_with_highest_frequency()\n @highest_count_across_lines = 0\n @highest_count_words_across_lines = []\n for line in @@analyzers\n if line.highest_wf_count >= @highest_count_across_lines\n\n @highest_count_across_lines = line.highest_wf_count\n @highest_count_words_across_lines.push(line)\n \n end\n \n end\n end",
"title": ""
},
{
"docid": "e364f635cfc95707a1ff41e5ae306150",
"score": "0.5744538",
"text": "def calculate_most_viewed_pages\n pages_with_frequency = calculate_page_frequency\n pages_with_frequency.sort_by { |_key, value| value }.reverse.to_h\n end",
"title": ""
},
{
"docid": "36b93c537e724ea832eb9ef3790476a0",
"score": "0.57361",
"text": "def calculate_stats\n # this one gets the anaylyzer\n analyzer_w_most_repeated_word = @analyzers.max_by { |analyzer| analyzer.highest_wf_count }\n #this one gets its highest word count\n @highest_count_across_lines = analyzer_w_most_repeated_word.highest_wf_count\n\n # this one gets all lines that match that highest word count - it will be an array of objects\n # containing one or more objects\n @highest_count_words_across_lines = @analyzers.select { |e| e.highest_wf_count == @highest_count_across_lines }\n\n # return a hash with some useful info\n { top_line: analyzer_w_most_repeated_word, repeat_word_count: @highest_count_across_lines,\n top_line_and_ties: @highest_count_words_across_lines }\n end",
"title": ""
},
{
"docid": "580f7de2b21aa48efd5ef8df317d7668",
"score": "0.5714795",
"text": "def winning_results_frequency_for_each_nominee\n category_id = self.id\n results = Result.where({\"category_id\" => category_id})\n nominee_hash = Hash.new(0)\n\n results.each do |winner| \n winner = winner.loved_id\n if winner != nil\n nominee_hash[winner] +=1\n end\n end\n\n tallied_results = nominee_hash.sort_by{ |key, value| value}.reverse.to_h\n return tallied_results\n end",
"title": ""
},
{
"docid": "c4b0f8d049017964d7e4c95a4cd55807",
"score": "0.5657673",
"text": "def standard_stats(use_p2_stats = true)\n results = search_results(:standard)\n counts = Hash.new(0)\n results.facet(:p1_class_and_archetype).rows.each do |f|\n counts[f.value] = f.count\n end\n if use_p2_stats\n results.facet(:p2_class_and_archetype).rows.each do |f|\n counts[f.value] += f.count\n end\n end\n counts.sort_by {|_, counts| -counts }.take(5)\n end",
"title": ""
},
{
"docid": "4b026735f17c960afdbb56bd465c9b7c",
"score": "0.56403947",
"text": "def get_most_frequent_word(words, title_text)\n word_counts = Hash.new\n words.each { |word| word_counts[word] = title_text.scan(word).count }\n if word_counts.values.count(word_counts.values.max) == 1\n word_counts.max_by { |_, v| v }.first\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "b72ef827bb38e0593ef2e8c8f38a4b27",
"score": "0.563519",
"text": "def most_used_hashtags\n # my_tags = self.hashtags.each do |hashtag|\n # hashtag.posts.select do |post|\n # post.user_id == self \n # end\n # end \n my_tags = []\n self.posts.each do |post|\n my_tags << post.hashtags\n end\n flattened = my_tags.flatten\n tallied = Hash[flattened.group_by{|x|x}.map{|x,y|[x,y.size]}]\n # sorted.each do |hashtag|\n # # need to associate hashtag w it's count\n \n # # gives number of times hashtag appears in sorted list\n # sorted.find_all[hashtag].count \n # end\n tallies_sorted = tallied.sort_by{|x,y| y}.reverse\n my_most = tallies_sorted[0..4]\n most_used = my_most.map do |array|\n array[0]\n end\n most_used\n end",
"title": ""
},
{
"docid": "39795be3937fddd1419ca026e569f6c4",
"score": "0.56292975",
"text": "def most_popular\n @books.sort_by {|book| book.rate}\n end",
"title": ""
},
{
"docid": "6ed1d0e4fe7c5e78d0b4a5d579fa5571",
"score": "0.5595882",
"text": "def most_popular_profession\n \"SELECT googleknowledge_occupation, COUNT(googleknowledge_occupation) FROM daily_show_guests GROUP BY googleknowledge_occupation ORDER BY COUNT(googleknowledge_occupation) DESC LIMIT 1;\"\nend",
"title": ""
},
{
"docid": "a14e9db8c5c52cd5194db5f3421c9259",
"score": "0.5568264",
"text": "def most_popular_profession_per_year\n sql = <<-SQL\n WITH mp AS (\n SELECT show_year,\n guest_occupation,\n \tCOUNT(id) as occupation_count\n FROM guest_appearances\n GROUP BY guest_occupation, show_year)\n SELECT show_year, guest_occupation, MAX(occupation_count) as frequency\n FROM mp\n GROUP BY show_year;\n SQL\n DB[:conn].execute(sql).each {|record| puts \"#{record[0]}: #{record[1]}, #{record[2]}.\"}\nend",
"title": ""
},
{
"docid": "a1d91962fd9b002f611ddf18f4424f3f",
"score": "0.55431676",
"text": "def print_highest_word_frequency_across_lines()\n puts @highest_count_across_lines\n @highest_count_words_across_lines.each do |lineanalyzer|\n lineanalyzer.highest_wf_words.each { |v| puts \"#{v}\" }\n end\n end",
"title": ""
},
{
"docid": "bdb2ac1d5eaa3b02f6d8519a5eaeea37",
"score": "0.5522102",
"text": "def base_popularity\n 10\n end",
"title": ""
},
{
"docid": "943285c83e953442c135f77a68f56ae1",
"score": "0.5521918",
"text": "def google_hot_trends(limit = 10)\n feed = Feed.fetch_feed('http://www.google.com/trends/hottrends/atom/hourly')\n result = Nokogiri::HTML(feed.entries[0].content)\n google_hot_trends_terms = result.css('a').collect{ |a| change_chars(a.text) }.compact\n render :partial => 'google/hot_trends', :locals => { :google_hot_trends_terms => google_hot_trends_terms[0, limit] }\n end",
"title": ""
},
{
"docid": "b3a30a730cd3fceb8550de7ea6e6a2e2",
"score": "0.55124015",
"text": "def find_less_popular(dimension = nil)\n all.sort_by { |o| o.rate_average(true, dimension) }.first\n end",
"title": ""
},
{
"docid": "b9f9f2b9f0a85c8b3bf0fb750ba66a15",
"score": "0.55072844",
"text": "def popularity_list\n @movie_list.values.sort{|a,b| b.popularity <=> a.popularity}\n end",
"title": ""
},
{
"docid": "c2438307f1bfcccfb65539f8b4f1d18d",
"score": "0.55052054",
"text": "def popularity_list\n averageRatingMoviesHash = {}\n @ratedMoviesHash.each {|movie, ratings| averageRatingMoviesHash[movie] = average(ratings) * (2 ** (@ratedMoviesHash[\"#{movie}\"].length / (@allUsersHash.keys.length).to_f)) - 1}\n ratedMoviesArray = averageRatingMoviesHash.sort_by { |movie, aveRating| -aveRating }\n popularityList = []\n ratedMoviesArray.each {|item| popularityList.push(item[0].to_i)} \n return popularityList\n\tend",
"title": ""
},
{
"docid": "f04ec6d7ed3b7d10ea8428f0e6ead881",
"score": "0.5503578",
"text": "def most_popular_group_per_year\n sql = <<-SQL\n WITH mp AS (\n SELECT show_year,\n guest_group,\n COUNT(id) as group_count\n FROM guest_appearances\n GROUP BY guest_group, show_year)\n SELECT show_year, guest_group, MAX(group_count) as frequency\n FROM mp\n GROUP BY show_year;\n SQL\n DB[:conn].execute(sql).each {|record| puts \"#{record[0]}: #{record[1]}, #{record[2]}.\"}\nend",
"title": ""
},
{
"docid": "271d0b656f0c049f4c4b35e8c1c5b436",
"score": "0.5488185",
"text": "def top_3\n freq_hash = each_with_object(Hash.new(0)) { |v, h| h[v] += 1 }\n freq_hash.sort_by { |k, v| -v }.first(3).map(&:first)\n end",
"title": ""
},
{
"docid": "86e07e42de253840b61789b07714cb1a",
"score": "0.54812294",
"text": "def topMatches( prefs, person, n=5, scorefunc = :sim_pearson )\n scores = []\n for other in prefs.keys\n if scorefunc == :sim_pearson\n scores << [ sim_pearson(prefs,person,other), other] if other != person\n else\n scores << [ sim_distance(prefs,person,other), other] if other != person\n end\n end\n return scores.sort.reverse.slice(0,n)\n end",
"title": ""
},
{
"docid": "7dc2adfd50e0ed530f7e1baf6dc519f7",
"score": "0.54747903",
"text": "def top_k_frequent_elements(list, k)\n k_freq = []\n return k_freq if list.empty?\n \n hash_map = Hash.new\n\n list.each do |element| \n hash_map[element] ? hash_map[element] += 1 : hash_map[element] = 1\n end\n \n vals = hash_map.values \n max_vals = vals.max(k) \n \n max_vals.each do |val| \n key = hash_map.key(val)\n k_freq << key\n hash_map.delete(key)\n end\n return k_freq\nend",
"title": ""
},
{
"docid": "a69d2f27787aa6c2c2d92b24b3b5e9cb",
"score": "0.54669094",
"text": "def topMatches( prefs, person, n=5, scorefunc = :sim_pearson )\n scores = []\n for other in prefs.keys\n if scorefunc == :sim_pearson\n scores << [ sim_pearson(prefs,person,other), other] if other != person\n else\n scores << [sim_distance(prefs,person,other), other] if other != person\n end\n end\n return scores.sort.reverse.slice(0,n)\n end",
"title": ""
},
{
"docid": "1befbe38d22d7705aaeb4acbf298c6eb",
"score": "0.54608554",
"text": "def popularity_boost\n return 0 if word_datas.empty?\n\n rare_words = word_datas.select { |data| data[:rarity] }\n return 0 if rare_words.empty?\n\n # 0-1 score for popularity\n # Then divide it by 0-1 for word length\n boosts = rare_words.map do |word|\n 1 - Math.log(word[:rarity] + 1, 60_000)\n end\n boosts.reduce(0, &:+)\n end",
"title": ""
},
{
"docid": "b6bfa6be618368053bcbc4b0001e3f7d",
"score": "0.54578644",
"text": "def losing_results_frequency_for_each_nominee\n category_id = self.id\n results = Result.where({\"category_id\" => category_id})\n nominee_hash = Hash.new(0)\n\n results.each do |loser| \n loser = loser.lost_id\n if loser != nil\n nominee_hash[loser] +=1\n end\n end\n tallied_results = nominee_hash.sort_by{ |key, value| value}.reverse.to_h\n return tallied_results\n end",
"title": ""
},
{
"docid": "49e1e073593c25f8eb0d07a4bb403058",
"score": "0.54522073",
"text": "def popularity_list\n @movies.values.sort { |movie1, movie2| popularity(movie2.movie_id) <=> popularity(movie1.movie_id) }.map(&:movie_id)\n end",
"title": ""
},
{
"docid": "a0e6af80e0f5300b359fe067757f04a9",
"score": "0.54483926",
"text": "def most_frequent_word(str)\n frqWrd = \"\"\n words = word_count(str)\n words.each do |key|\n frqWrd = key if words[key] >= words[frqWrd]\n end\n frqWrd[0]\nend",
"title": ""
},
{
"docid": "2c01235311130990e883d8342d83ea1c",
"score": "0.5444446",
"text": "def popular(model)\n Popularity.new(model, @redis)\n end",
"title": ""
},
{
"docid": "7744ee4941d57c31466abc7786ca464d",
"score": "0.5417408",
"text": "def most_frequent(nums)\n hash = {}\n max_occurence = 0\n\n nums.each do |num|\n if !hash.has_key?(num.to_s)\n hash[num.to_s] = 1\n else\n hash[num.to_s] += 1\n if max_occurence < hash[num.to_s] \n max_occurence = hash[num.to_s]\n end\n end\n end\n\n hash.select { |key, value| value == max_occurence }\n .map { |key, value| key.to_i} \nend",
"title": ""
},
{
"docid": "58c11daabc52cbfe08052511a46c71bd",
"score": "0.5412094",
"text": "def guest_with_most_appearances\n sql = <<-SQL\n SELECT guest_name,\n \tCOUNT(id) as appearance_count\n FROM guest_appearances\n GROUP BY guest_name\n ORDER BY appearance_count DESC\n LIMIT 1;\n SQL\n fg = DB[:conn].execute(sql)[0]\n puts \"#{fg[0]}: #{fg[1]} appearances.\"\nend",
"title": ""
},
{
"docid": "04fcca2b03f8f3a9fb8c347b485aec63",
"score": "0.5405129",
"text": "def get_top_frequencies(frequencies, threshold = 5)\n frequencies.sort_by(&:last).last(threshold).reverse.to_h.deep_symbolize_keys\n end",
"title": ""
},
{
"docid": "9f9e1af09b78ece37237f8533b5d2235",
"score": "0.54039264",
"text": "def highest_standard_deviation\n highest_standard_deviation_hash = {}\n analytics_hash = self.get_std_all_items\n highest_standard_deviation = analytics_hash.keys.max\n highest_standard_deviation_instance = analytics_hash[highest_standard_deviation]\n highest_standard_deviation_hash[highest_standard_deviation] = highest_standard_deviation_instance\n highest_standard_deviation_hash\n end",
"title": ""
},
{
"docid": "0443ee1c886c090314edf1f4e7c23b25",
"score": "0.54032576",
"text": "def most_popular_profession\n sql = <<-SQL\n SELECT guest_occupation,\n COUNT(id) as occupation_count\n FROM guest_appearances\n GROUP BY guest_occupation\n ORDER BY occupation_count DESC\n LIMIT 1;\n SQL\n mp = DB[:conn].execute(sql)[0]\n puts \"#{mp[0]}: #{mp[1]} appearances.\"\nend",
"title": ""
},
{
"docid": "437b9f78abbee7b322904cb1be9babc6",
"score": "0.53994566",
"text": "def analyze_most_popular_radlibs(radlib)\n # calculate score\n most_popular = 1\n most_popular *= (val = radlib.num_likes) > 0 ? val : 1\n most_popular *= (val = radlib.num_fillins) > 0 ? val : 1\n most_popular *= (val = radlib.num_views) > 0 ? val : 1\n\n # scale it down to avoid too big a number, using 10000.1 (with decimal ensures that we extend the value's significant digits)\n most_popular /= 100.1\n\n analyze_most_generic(radlib.radlib_id, most_popular.to_f, DOCS[:most_popular_radlibs])\n self\n end",
"title": ""
},
{
"docid": "4dac08cf750ec526656b07ce3c89eed7",
"score": "0.5398495",
"text": "def top_10 (matches)\n matches.sort_by! { |match| match['score'] }.reverse[:10]\nend",
"title": ""
},
{
"docid": "3c83a5122b597630f5849397c57ec3e0",
"score": "0.539008",
"text": "def wild_stats(use_p2_stats = true)\n results = search_results(:wild)\n counts = Hash.new(0)\n results.facet(:p1_class_and_archetype).rows.each do |f|\n counts[f.value] = f.count\n end\n if use_p2_stats\n results.facet(:p2_class_and_archetype).rows.each do |f|\n counts[f.value] += f.count\n end\n end\n counts.sort_by {|_, counts| -counts }.take(5)\n end",
"title": ""
},
{
"docid": "989a7dc1b5cf4b3f2f4cfdb9a9589125",
"score": "0.538818",
"text": "def top_k_frequent_elements(list, k)\n hash = {}\n \n list.each do |value|\n if hash[value]\n hash[value] += 1\n else\n hash[value] = 1\n end\n end\n \n top_elements = Array.new(k)\n return top_elements = hash.sort_by{ |key, value| value } \nend",
"title": ""
},
{
"docid": "5ec57d2e868d388d97f85e18aa29e8b2",
"score": "0.53735334",
"text": "def frequent_foods\n get(\"/user/#{@user_id}/foods/log/frequent.json\")\n end",
"title": ""
},
{
"docid": "50d62e32570c00edfeeaf013316287f2",
"score": "0.53709024",
"text": "def print_highest_word_frequency_across_lines\n puts \"The line(s) with most repeated words are:\"\n @highest_count_words_across_lines.each do |line|\n # using string interpolation here, also combining into one line\n puts \"\\tLine #{line.line_number}: (#{line.highest_wf_words.join(\", \")}), appears #{@highest_count_across_lines\n } times\\n#{word_wrap(line.content, 80, 2)}\"\n end\n q = nil\n end",
"title": ""
},
{
"docid": "1f67cbdfee382e7b926547d43b4d5f04",
"score": "0.53663486",
"text": "def popularity_contest\n @popular = Work.maximum(:impressions_count).to_f\n n = 1 - self.impressions_count.fdiv(@popular).round(2)\n return (n*255).round\n end",
"title": ""
},
{
"docid": "eeeb04eeb3f01a5b9adf94c81ba01f3e",
"score": "0.53521174",
"text": "def count_people_ordered_most_popular_books(count_of_popular_books)\n most_popular_books = most_popular\n people = Array.new\n most_popular_books[0..count_of_popular_books].each do |book|\n @readers.each do |name, value|\n value.orders.detect do |order|\n# p \"order.book=\"+order.book.to_s\n# p \"book=\"+book.title.to_s\n p \"Book.class= \"+order.book.class.to_s\n people << value if book == order.book\n end\n end \n end\n return people.size #maybe a good idea return all people?\n end",
"title": ""
},
{
"docid": "0a6a205f6f96775a6265af3c78adce82",
"score": "0.5347894",
"text": "def count_value_frequency\n frequency = []\n @item.reviews.each do |review|\n review.properties.each do |k, v|\n frequency << k\n frequency << v\n end\n end\n frequency.each_slice(2).to_a\n end",
"title": ""
},
{
"docid": "2283ae11523d21208777d0986a6bda9b",
"score": "0.5343023",
"text": "def most_hits(seasonasstring) # shots in game team stats\n #get a list of all teams that played in that season\n #use above list to sum all shots across all games in season\n #find highest across list\n #return team name as found in 139\n end",
"title": ""
},
{
"docid": "18a639925cced7d9588bf1bb4a985477",
"score": "0.5324199",
"text": "def find_frequently_reviewed_restaurants(topic, reviewer)\n restaurants = reviewer.subscribed_restaurants.by_topic(topic.id)\n frequency_with_restaurants = {}\n restaurants.each do |restaurant|\n frequency_with_restaurants[restaurant] ||= 0\n frequency_with_restaurants[restaurant] += 1\n end\n\n sorted = frequency_with_restaurants.sort{|v1, v2| v2.last <=> v1.last}\n\n # Take top 5 restaurants\n sorted[0..5]\n end",
"title": ""
},
{
"docid": "1ecc4d303139f5fb775240f8498f0a56",
"score": "0.5320685",
"text": "def popularity(movie_id)\n @movies[movie_id]\n end",
"title": ""
},
{
"docid": "a0a36960ce9692fe4f2f4106c07b1a55",
"score": "0.5319608",
"text": "def most_popular_tags(options = {})\n if all_tags = Tag.by_pseud(self).by_type(options[:categories]).canonical\n tags_with_count = {}\n all_tags.uniq.each do |tag|\n tags_with_count[tag] = all_tags.find_all{|t| t == tag}.size\n end\n all_tags = tags_with_count.to_a.sort {|x,y| y.last <=> x.last }\n options[:limit].blank? ? all_tags : all_tags[0..(options[:limit]-1)]\n end\n end",
"title": ""
},
{
"docid": "be57b0980dd7d22b0ff342ebcaf3e80d",
"score": "0.5310453",
"text": "def top_readers\n readers_with_duplicates = []\n self.articles.each { |article| readers_with_duplicates << article.readers }\n\n readers_with_duplicates.flatten!\n readers = readers_with_duplicates.uniq\n frequency = Hash.new(0)\n readers_with_duplicates.each { |r| frequency[r] += 1 }\n array = frequency.sort_by { |key, value| value }\n return [array[-1], array[-2], array[-3]]\n\n end",
"title": ""
},
{
"docid": "efc279f4e557a8a52fa55f399bf6f368",
"score": "0.5307704",
"text": "def top_k_frequent_elements(list, k)\n return [] if list.empty?\n\n frequency_count = Hash.new(0)\n list.each do |num|\n frequency_count[num] += 1\n end\n\n top_k = frequency_count.to_a.sort_by { |e| e[1] }\n\n if k == 1\n top_k.first(k).map { |e| e[0] }\n else\n top_k.last(k).map { |e| e[0] }\n end\nend",
"title": ""
},
{
"docid": "b6b5854a2778cecba37367059b2d0823",
"score": "0.5307228",
"text": "def popularity_list\n @popularity_list=@movie_index.sort_by { |x| -x[1].size }.col(0) if @popularity_list.nil?\n @popularity_list\n end",
"title": ""
},
{
"docid": "7b784f31ab21bd9350eeadbe620c52b1",
"score": "0.53036994",
"text": "def print_highest_word_frequency_across_lines\n puts 'The following words have the highest word frequency per line:'\n @analyzers.each do |word|\n if word.highest_wf_count == @highest_count_across_lines\n puts \"#{word.highest_wf_words} (appears in line #{word.line_number})\"\n end\n end\n end",
"title": ""
},
{
"docid": "2b9eeec650bb539bfa5c72bc17caa8ae",
"score": "0.5300988",
"text": "def popular\n @api_response = Tmdb::Movie.popular\n @movies = []\n puts @api_response.results[0]\n @api_response.results.each do |movie|\n @movies.push(Movie.new(movie.to_h))\n end\n end",
"title": ""
},
{
"docid": "b4c0665ae3710518caef7843e4ec4fce",
"score": "0.5298973",
"text": "def get_best_and_worst_tokens(n=10)\n list = get_all_tokens_deviance.sort {|a,b| a[1] <=> b[1]}\n best = list[0..n-1]\n worst = list[-n, n]\n return {:best => best, :worst => worst}\n end",
"title": ""
},
{
"docid": "6092e7e44789b5cd5d7c279fa00f3db6",
"score": "0.5294324",
"text": "def print_highest_word_frequency_across_lines\n for line in @highest_count_words_across_lines\n puts \"#{line.highest_wf_words} (appears in line #{line.line_number} )\"\n end\n end",
"title": ""
},
{
"docid": "02aacc93670580c8c97a2039d9bf1de0",
"score": "0.52909786",
"text": "def determine_frequency_term_sets(all_grams, query)\n # only count a result if it has non-0 words length\n effective_length = @gram_collections.reject do |result|\n result.grams.nil? || result.grams.empty?\n end.length\n\n min_cover_l = @min_support * effective_length\n\n # for speed only look at top N grams\n # below block, worst case O(|all_grams|)\n frequent_grams = all_grams.sort do |gram1, gram2|\n gram2.frequency <=> gram1.frequency\n end.first(@num_top_grams)\n\n # below block, worst case O(|frequent_grams| x |gram_collections|)\n frequent_grams = frequent_grams.delete_if do |gram|\n !cover(gram, min_cover_l)\n end\n\n # below block, worst case O(|frequent_grams| x |gram_collections|)\n @gram_collections.reduce(Hash.new(0)) do |top_grams, gram_collection|\n max_fitness = 0\n max_fit = nil\n\n frequent_grams.each do |gram|\n content_frequency = (\n gram_collection.content_to_frequency[gram.content] || 0)\n fitness = content_frequency / gram.frequency.to_f\n gram_collection.fitness[gram.content] = fitness\n\n if fitness > max_fitness\n max_fitness = fitness\n max_fit = gram.content\n end\n end\n\n # puts \"#{max_fit}: #{max_fitness}\"# if DEBUG\n top_grams[max_fit] += 1 if max_fit\n top_grams\n end\n end",
"title": ""
},
{
"docid": "1ba79df086e271bb4cf675de0970452a",
"score": "0.5283585",
"text": "def most_liked(n)\n QuestionLike.most_liked_questions(n)\n end",
"title": ""
},
{
"docid": "854a797177a3c51d9af2bc94eb4d3bef",
"score": "0.52830017",
"text": "def k_most_visited input, k\n \n hotels_to_visits = Hash.new\n \n input.each do |user|\n user.each do |hotel_id|\n hotels_to_visits[hotel_id] = (hotels_to_visits[hotel_id] || 0) + 1\n end\n end\n \n sorted_hotels_and_visits = hotels_to_visits.to_a.sort { |a,b| a[1] < b[1] }\n \n return sorted_hotels_and_visits[0..k]\n \nend",
"title": ""
},
{
"docid": "bfb9040780777a807d33c5e5b0275e0a",
"score": "0.527779",
"text": "def most_views\n @content.sort_by { |address| address[1].length }.reverse.each do |values|\n @output << \"#{values.first} #{values.last.count} visits\"\n end\n end",
"title": ""
},
{
"docid": "1809a211301934adb77049557ab69deb",
"score": "0.5272414",
"text": "def find_most_popular(array)\n url_hash = {}\n \n array.each do |url|\n if url_hash[url]\n url_hash[url] += 1\n else\n url_hash[url] = 1\n end\n end\n \n max_url = url_hash.max_by(1) do |url, count|\n count\n end\n \n return max_url[0][0]\nend",
"title": ""
},
{
"docid": "efb6352360916a0e5a5ccb42c3c26c99",
"score": "0.52714324",
"text": "def frequent_elements_with_ties(spectrum, m)\n # Given an array of masses in the spectrum figure out the most 'm' frequent masses\n # including the ties\n\n freq_h = {}\n spectrum.each do |m|\n if freq_h[m]\n freq_h[m] += 1\n else\n freq_h[m] = 1\n end\n end\n\n freq_sorted_h = Hash[freq_h.sort_by{|k,v| v}.reverse]\n\n return_arr = freq_sorted_h.keys.slice(0, m)\n\n # puts freq_sorted_h\n\n (m..(freq_sorted_h.keys.length-1)).each do |i|\n if (freq_sorted_h.values[m-1] == freq_sorted_h.values[i])\n return_arr << freq_sorted_h.keys[i]\n elsif (freq_sorted_h.values[m-1] > freq_sorted_h.values[i])\n break\n end\n end\n # puts return_arr.to_s\n return return_arr\n end",
"title": ""
},
{
"docid": "8c775d7da9c731fdefb9b7c9a7a5224c",
"score": "0.5270189",
"text": "def how_orders_of_three_most_popular_books\n books_count.each {|title, times| puts \"The most popular books, '#{title}', ordered #{times}\" if times == books_count.values.max }\n end",
"title": ""
},
{
"docid": "4d4fd85e973ccbde83e466844769539d",
"score": "0.5268811",
"text": "def most_popular\n\n # Recipecard.all.select {|rc| rc.recipe ==self}\n # most_popular.map {|rc| rc.users}\n recipe_hash = {}\n RecipeCard.all.each do |recipecard|\n if recipe_hash[recipecard.name]==nil\n recipe_hash[recipecard.name]=1\n else\n recipe_hash[recipecard.name]+= 1\n end\n end\n recipe_hash.max_by{|k,v| v}[0]\n end",
"title": ""
},
{
"docid": "6bd10254779c8a9d6d9dd8146e3e7583",
"score": "0.526881",
"text": "def most_popular_screening_film\n most_popular = nil\n unsold_tickets = 2 #max capacity of the cinema\n screenings = return_film_screenings\n screenings.each do |screening|\n if screening.tickets_left.to_i < unsold_tickets\n most_popular = screening\n end\n end\n return most_popular\n end",
"title": ""
},
{
"docid": "7a907ec9ae1ffd755abcdf024fdc0dbe",
"score": "0.52661204",
"text": "def top_k_frequent_elements(list, k)\n return [] if list.empty? || k == 0\n\n item_with_freq = []\n item_freq = {}\n\n # make hash with freq of each element\n list.each do |item|\n if item_freq[item]\n item_freq[item] += 1\n else\n item_freq[item] = 1\n end\n end\n\n # turn hash into array and sort by freq\n item_with_freq = item_freq.to_a\n item_with_freq.sort_by { |item| item[1] }\n\n # iterate through sorted array k times and pull out top items\n top_items = []\n k.times do |i|\n top_items << item_with_freq[i][0]\n end\n\n return top_items\nend",
"title": ""
},
{
"docid": "78bad4fbf5e0edf62ab7bd883d0a05c4",
"score": "0.52620864",
"text": "def most_explored_tags(topic, tag_groups = [], limit = 5)\n # Take 5 mostly visited places\n most_visited = self.checkins.by_topic(topic.id).most.all(:limit => 5)\n most_visited_tags = sort_tags(tag_groups, most_visited.collect(&:restaurant)) \n\n # Take 5 mostly reviewed and loved places\n most_loved = self.reviews.by_topic(topic.id).most.all(:limit => 5) \n most_loved_tags = sort_tags(tag_groups, most_loved.collect(&:restaurant))\n \n # Take 5 recently explored places\n recent_explored = self.restaurants.by_topic(topic.id).recent.all(:limit => 5) \n recent_explored_tags = sort_tags(tag_groups, recent_explored)\n \n # Merge all tags (5 + 5 + 5) = 15 (At most)\n # Remove duplicates and pick 5 based on their frequencies\n (most_visited_tags + most_loved_tags + recent_explored_tags).sort_by{|a| a.last}.reverse.collect{|a| a.first}.uniq[0..4]\n end",
"title": ""
},
{
"docid": "00365b64b43dc2a873ed8a07ec20efcd",
"score": "0.525866",
"text": "def top_k_frequent_elements(list, k)\n return [] if list.empty?\n\n count_hash = Hash.new(0)\n result = []\n\n list.each do |element|\n count_hash[element] += 1\n end\n\n max_array = count_hash.sort_by { |k, v| -v }\n\n (0...k).each do |i|\n result << max_array[i][0]\n end\n\n return result\nend",
"title": ""
},
{
"docid": "1458ffff5abbee9bd68884c40571a225",
"score": "0.52560437",
"text": "def top_k_frequent_elements(list, k)\n return list if list.empty? || list.length == k\n count = {}\n \n list.each do |num|\n count[num] ? count[num] += 1 : count[num] = 1\n end\n \n sorted = count.sort_by { |k, v| -v }\n \n most_frequent = Array.new(k)\n k.times { |i| most_frequent[i] = sorted[i][0] } \n \n return most_frequent\nend",
"title": ""
},
{
"docid": "73a8c54cc92d8306e7a366f3559319fd",
"score": "0.5256002",
"text": "def get_worst_tokens(n=10)\n worst = get_all_tokens_deviance.sort {|a,b| b[1] <=> a[1]}\n return worst[0..n-1]\n end",
"title": ""
},
{
"docid": "92c6e1748742e527b00fd717e6dd6c11",
"score": "0.52509975",
"text": "def most_popular_venue\n venues = @games.group_by { |game| game.venue}\n venues.max_by { |venue, games| games.count }.first\n end",
"title": ""
},
{
"docid": "614f3eb578e5ec7c16329f991381e88c",
"score": "0.5250058",
"text": "def popularity(movie_id)\n\t\t@movies[movie_id]\n\tend",
"title": ""
},
{
"docid": "32dfb3cd7a228e7793ec2b3fdb957b6b",
"score": "0.5240835",
"text": "def print_highest_word_frequency_across_lines()\n puts \"The following words have the highest word frequency per line:\"\n @highest_count_words_across_lines.each do |line|\n puts \"#{line.highest_wf_words} (appears in line #{line.line_number})\"\n end\n #puts \"[\\\"#{highest_count_words_across_lines}\\\"] (appears in line#)\"\n end",
"title": ""
},
{
"docid": "b981ce3f7531181b5e81a202f4cd8863",
"score": "0.5240024",
"text": "def popularity(movie_id)\n\t\treturn movie_popularity_hash[movie_id]\n\tend",
"title": ""
},
{
"docid": "acf4f9abc340525e8880e41604111897",
"score": "0.5239565",
"text": "def top_k_frequent_elements(list, k)\n return list if list.empty?\n\n num_frequency = {}\n\n list.each do |num|\n num_frequency[num] ? num_frequency[num] += 1 : num_frequency[num] = 1\n end\n\n top_frequent_nums = []\n\n k.times do\n max_frequency = 0\n max_frequent_num = nil\n\n num_frequency.each do |key, value|\n if value > max_frequency\n max_frequency = value\n max_frequent_num = key\n end\n end\n\n top_frequent_nums << max_frequent_num\n num_frequency[max_frequent_num] = 0\n end\n\n return top_frequent_nums\nend",
"title": ""
},
{
"docid": "663e6e09e3081d27ad80e0af7704ad5d",
"score": "0.5230265",
"text": "def popularity_list\r\n\t\tif @mov_pop_ar_hs.nil?\r\n\t\t\tputs \"data has not been loaded\"\r\n\t\t\treturn[]\r\n\t\telse\r\n\t\t\tmovie_avg_pop={}\r\n\t\t\tcount = 0\r\n\t\t\twhile count < @mov_pop_ar_hs.length\r\n\t\t\t\tmovie_avg_pop[count]=popularity(count)\r\n\t\t\t\tcount = count + 1\r\n\t\t\tend\r\n\t\t\t#sort from highest to lowest\r\n\r\n\t\t\treturn movie_avg_pop.sort_by {|movie, pop| pop}.reverse\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "e787d6e32d35c0d5060cc16b6d6e9962",
"score": "0.5228729",
"text": "def calculate_popularity_score\n top_guide = (Guide.order_by(\"impressions_field\" => :asc).last)\n at_most = (top_guide.impressions_field || 0).to_i\n normalized = impressions_field.to_f / at_most\n write_attributes(popularity_score: normalized)\n end",
"title": ""
},
{
"docid": "36afba33354ce1f00f8e3e096d76f2e4",
"score": "0.5226177",
"text": "def count_most_often(c)\n numbers = {}\n sorted = []\n (1..42).to_a.each do |e|\n conditions = \"(n1 = #{e} OR n2 = #{e} OR n3 = #{e} OR n4 = #{e} OR n5 = #{e})\"\n conditions += \" AND (no >= #{no-100})\" #if !n.nil?\n r = Result.count(:conditions => conditions,\n :order =>'no DESC')\n numbers[e] = r\n end\n numbers.sort_by{|k,v| v}.reverse.each{|e| sorted << e[0]}\n while numbers[c] == numbers[c+1]\n c += 1\n end\n #p sorted\n return sorted[0..c-1]\n end",
"title": ""
},
{
"docid": "a1369905980fe3205cdb7140d82df228",
"score": "0.5224387",
"text": "def get_latest_trends_timing\n # Trolls the db looking for most recent trending events for the country upon which the method is called; returns the time of last seed.\n return LocalTrendingEvent.where(country_id: self.id).order(\"time_of_trend desc\").limit(1).first.time_of_trend\n end",
"title": ""
},
{
"docid": "2d22831c6464c0bd43bbe73f6b54daf8",
"score": "0.522336",
"text": "def get_wins_results_array_frequency_for_each_nominee\n winning_count = winning_results_frequency_for_each_nominee\n winning_arr = []\n\n winning_count.each do |key, value|\n winning_arr << key\n end \n\n return winning_arr\n end",
"title": ""
},
{
"docid": "40b63cc60a4a430486fffd61757ab468",
"score": "0.52204424",
"text": "def top_k_frequent_elements(list, k)\n result_arr = []\n return result_arr if list.length == 0\n\n frequency_hash = {}\n\n list.each do |element|\n if frequency_hash[element]\n frequency_hash[element] += 1\n else\n frequency_hash[element] = 1\n end\n end\n\n k.times do\n top_element = nil\n top_frequency = 0 \n\n frequency_hash.each do |element, frequency|\n top_frequency = frequency && top_element = element if frequency > top_frequency\n end\n\n result_arr << top_element\n frequency_hash[top_element] = 0\n end\n\n return result_arr\nend",
"title": ""
},
{
"docid": "18bec153e5138377239f4b15cdba83e8",
"score": "0.5212009",
"text": "def most_frequent_word(string)\n hash = {}\n splitstring = string.split(\" \")\n splitstring.each {|element| element.downcase!}\n p splitstring\n splitstring.each{|element| if hash[element].nil?\n hash[element]=1\n else\n hash[element]+=1\n end}\nmost_frequent_item = hash.max_by{ |i| hash.count( i ) }\nputs most_frequent_item\nend",
"title": ""
},
{
"docid": "a944bbdc9e8de3ec78ac0038d2019608",
"score": "0.5210073",
"text": "def most_common_nationalities_list\n nationalities_hash = self.players.group_by{\n |player| player.nationality\n }\n count_hash={}\n nationalities_string = nationalities_hash.map do |nationality, players|\n # puts \"Number of players from \" + nationality + \": \" + players.count.to_s\n count_hash[nationality]=players.count\n end\n count_hash.sort_by {|nationality, num| num}.reverse\n end",
"title": ""
},
{
"docid": "3becafe5be0634f27aa0f123c2848cff",
"score": "0.5204277",
"text": "def find_popular(*date)\n find_popular_in_structure(@content.dig(*date))\n end",
"title": ""
},
{
"docid": "900fa9be383cd5b3e5768d1da022dd68",
"score": "0.51987207",
"text": "def popularity(movie_id)\n @movie_index[movie_id].size\n end",
"title": ""
},
{
"docid": "ef740d32759c051c2c853b45cb4d4927",
"score": "0.5191997",
"text": "def select_value_and_count_of_most_prolific_species\n\" SELECT species, COUNT(species) FROM characters\n GROUP BY species ORDER BY COUNT(species) DESC LIMIT 1;\"\nend",
"title": ""
},
{
"docid": "3d6878c59fc7496f5d4689c3381fe724",
"score": "0.51890063",
"text": "def popular_terms(query, fields, count=10)\n raise \"The class #{self.class.name} must implement the 'popular_terms' method.\"\n end",
"title": ""
},
{
"docid": "81830063c01cb007da85b95fd97be77b",
"score": "0.51835626",
"text": "def popularity\n @_popularity ||= @popularity.to_f\n end",
"title": ""
},
{
"docid": "e8ba9cbc361c8ff34b0bf93304c0bfd1",
"score": "0.5178243",
"text": "def popular_profession\n sql = <<-SQL\n SELECT google_knowledge_occupation, count(google_knowledge_occupation)\n FROM guests\n GROUP BY google_knowledge_occupation\n ORDER BY count(google_knowledge_occupation) DESC LIMIT 1;\n SQL\n DB[:conn].execute(sql)[0][0]\nend",
"title": ""
},
{
"docid": "395d479d4141ed6e6706925c87193ce8",
"score": "0.51772577",
"text": "def appears_most_times(array)\n hash = {}\n max = 0\n key_max = array[0]\n array.each do |num|\n if hash[num].nil?\n hash[num] = 1\n else\n hash[num] += 1\n end\n if hash[num] > max\n max = hash[num]\n key_max = num\n end\n end\n key_max\nend",
"title": ""
},
{
"docid": "514a2508f95071e5ed5f19587367dde2",
"score": "0.51766306",
"text": "def top_5\n count = @sentence.blips.group(:body).distinct.count\n percent = count.each {|k, v| count[k] = v / @sentence.blips_count.to_f }\n statistics = percent.sort_by { |k, v| v }.reverse[0..4].flatten.each { |k, v| puts \"#{k}: #{v}\" }\n end",
"title": ""
},
{
"docid": "3597b8f266ee53e015826b94a3d45015",
"score": "0.5172716",
"text": "def top_k_frequent_elements(list, k)\n # create a counter hash for the numbers\n counter = {}\n # go through the list of numbers\n # test the hash keys, if it is not there, add it with a number 1 value\n # otherwise increment the value by 1\n list.each do |num|\n if !counter[num]\n counter[num] = 1\n else\n counter[num] += 1\n end\n end\n\n # list.each do |element|\n # counts[element] ||= 0\n # counts[element] += 1\n # end\n\n # find the K max counts\n highest_counts = counter.values.max(k)\n # return the values of those keys\n most_frequent = []\n highest_counts.each do |n|\n most_frequent << counter.key(n)\n counter.delete(counter.key(n))\n end\n return most_frequent\nend",
"title": ""
},
{
"docid": "685c05d93e82563258ec2c9b7a967027",
"score": "0.5168658",
"text": "def calculate_favorite_tweeter\n # Count each fav as 1 point\n scores = Hash[most_faved]\n scores.default = 0\n\n # Count each RT as 1.5 points\n most_retweeted.each { |screen_name, rts| scores[screen_name] += (rts * 1.5) }\n\n winning_screen_name, winning_score = scores.max_by { |_, score| score }\n\n {\n :screen_name => winning_screen_name,\n :favs_count => Hash[most_faved][winning_screen_name],\n :retweets_count => Hash[most_retweeted][winning_screen_name],\n :score => winning_score\n }\n end",
"title": ""
},
{
"docid": "2df9b2883f629b9bb2b8940b1be2281b",
"score": "0.5165844",
"text": "def top_winners\n max_val = history.list.values.map { |ary| ary.reduce(:-) }.max\n history.list.select { |_, val| val.reduce(:-) == max_val }.keys\n end",
"title": ""
},
{
"docid": "503665064560eb4f2f483d295c2d9f71",
"score": "0.51632154",
"text": "def print_highest_word_frequency_across_lines\n puts \"The following lines have the highest word frequency per line:\"\n end",
"title": ""
},
{
"docid": "76b1b2de8058876430642f53380d869f",
"score": "0.51552826",
"text": "def top_k_frequent_elements(list, k)\n # list = [1,1,1,2,2,3]\n # k = 2\n return [] if list == []\n\n counter = {}\n\n list.each do |value|\n if counter[value]\n counter[value] += 1\n else\n counter[value] = 1\n end\n end\n\n puts counter\n\n ordered = counter.sort_by{ |key, value| value } \n\n k_most = []\n\n k.times do |i|\n k_most << ordered[-i]\n end\n\n return k_most\nend",
"title": ""
},
{
"docid": "10042ae40425f9f308d08f5307190f16",
"score": "0.51547325",
"text": "def top_k_frequent_elements(list, k)\n \n return [] if list.empty?\n ranked_hash = {}\n ranked = []\n\n list.each do |element|\n if ranked_hash.has_key?(element)\n ranked_hash[element] += 1\n else\n ranked_hash[element] = 1\n end\n end\n\n sorted = ranked_hash.sort_by { | k, v | -v }\n\n k.times do \n max = sorted.shift\n ranked << max[0]\n k -= 1\n end\n\n return ranked \n\nend",
"title": ""
},
{
"docid": "00ebd8492219290b8a7ecb91584d6245",
"score": "0.5152033",
"text": "def get_most_popular_deal_type\n all_active_past_deals = Deal.active_and_expired.where(:redeemable => true)\n unique_deal_type = all_active_past_deals.uniq.pluck(:type_of_deal)\n all_active_past_deals = all_active_past_deals.order(title: :asc)\n count = 0\n most_popular_deal_type = \"\"\n unique_deal_type.each do |udt|\n deal_type = all_active_past_deals.where(:type_of_deal => udt).pluck(:id)\n total_redemption_count = DealAnalytic.where(deal_id: deal_type).sum(:redemption_count)\n total_deals = deal_type.count\n total_average_count = (total_redemption_count.to_f/total_deals).round(2)\n if (total_average_count > count)\n count = total_average_count\n most_popular_deal_type = udt\n end\n end\n most_popular_deal = [most_popular_deal_type, count]\n end",
"title": ""
}
] |
310002149d271343b5ae7b3a4fd5d56a
|
===================== Complex validations: =====================
|
[
{
"docid": "717c7fd7c88a807bbd4e56451149c3a1",
"score": "0.0",
"text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:standard_size_count_value => self.standard_size_count_value}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_standard_count\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:old_pack_code => self.old_pack_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_old_pack\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:commodity_code => self.commodity_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_commodity\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:basic_pack_code => self.basic_pack_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_basic_pack\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend",
"title": ""
}
] |
[
{
"docid": "dfc1c45c91fbba6f8ead648d3a33315a",
"score": "0.74459374",
"text": "def validate\n validate_value(self.value)\n validate_mandatory\n validate_unique\n\n errors.empty?\n end",
"title": ""
},
{
"docid": "9868c6a73b0c5ca8c2b7d230d58eb204",
"score": "0.7388451",
"text": "def validate(data); end",
"title": ""
},
{
"docid": "5b6d6ef79ae2c83d4a0af5959baca27c",
"score": "0.73689944",
"text": "def validate?; end",
"title": ""
},
{
"docid": "9bdb87e4d380433c682d55db35db0efa",
"score": "0.7323272",
"text": "def validate\n # optional\n end",
"title": ""
},
{
"docid": "6b045ce4860f3e02870498792c74a0b9",
"score": "0.731587",
"text": "def validate; end",
"title": ""
},
{
"docid": "6b045ce4860f3e02870498792c74a0b9",
"score": "0.731587",
"text": "def validate; end",
"title": ""
},
{
"docid": "6b045ce4860f3e02870498792c74a0b9",
"score": "0.731587",
"text": "def validate; end",
"title": ""
},
{
"docid": "6b045ce4860f3e02870498792c74a0b9",
"score": "0.731587",
"text": "def validate; end",
"title": ""
},
{
"docid": "6b045ce4860f3e02870498792c74a0b9",
"score": "0.731587",
"text": "def validate; end",
"title": ""
},
{
"docid": "6b045ce4860f3e02870498792c74a0b9",
"score": "0.731587",
"text": "def validate; end",
"title": ""
},
{
"docid": "6b045ce4860f3e02870498792c74a0b9",
"score": "0.731587",
"text": "def validate; end",
"title": ""
},
{
"docid": "f76d274c4cadcca58032349c0b16b019",
"score": "0.73144066",
"text": "def valid?\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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end",
"title": ""
},
{
"docid": "cca57e445865cd6bde5afe3c43ffbd8d",
"score": "0.7300634",
"text": "def valid?\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 \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 end",
"title": ""
},
{
"docid": "e5bd75d55b4baf2aba8a270fbd37975a",
"score": "0.7282373",
"text": "def validate\n validate_code\n validate_percentage\n validate_type\n validate_product_ids if product_list?\n true\n end",
"title": ""
},
{
"docid": "c6bee665885ac43abe2cf6ccf11287be",
"score": "0.72167146",
"text": "def validation()\n\t @immediate_age = validate_single_field(@immediate_age,\"Immediate age cannot be converted into a number\",1.0)\n\t @commencement_age = validate_single_field(@commencement_age,\"Commencement age cannot be converted into a number\",1.0)\n\t @secondary_age = validate_single_field(@secondary_age,\"Spousal age cannot be converted into a number\",1.0)\n\t @joint_survivor_type = validate_single_field(@joint_survivor_type,\"JS Type cannot be converted into a number\",3.0)\n @joint_survivor_percent = validate_single_field(@joint_survivor_percent,\"JS percent cannot be converted into a number\",4.0)\n validate_mortality(@primary_mortality,\"Primary\")\n validate_mortality(@secondary_mortality,\"Secondary\") \n\t\t@interest_segment_a = validate_single_field(@interest_segment_a,\"Interest segment A cannot be converted into a number\",2.0)\n @interest_segment_b = validate_single_field(@interest_segment_b,\"Interest segment B cannot be converted into a number\",2.0)\n @interest_segment_c = validate_single_field(@interest_segment_c,\"Interest segment C cannot be converted into a number\",2.0) \n @certain_period = validate_single_field(@certain_period,\"Certain period cannot be converted into a number\",1.0)\n @temporary_period = validate_single_field(@temporary_period,\"Temporary period cannot be converted into a number\",1.0)\n @rounding = validate_single_field(@rounding,\"Rounding cannot be converted into a number\",5.0) \n end",
"title": ""
},
{
"docid": "209623525f7f2f3e083ae0d4bbb160d2",
"score": "0.720925",
"text": "def validate\n validate_single_record\n\n validates_presence :oai_record_prefix\n validates_presence :oai_admin_email\n validates_presence :oai_repository_name\n\n validate_oai_admin_email_is_email\n validate_repo_set_fields\n validate_sponsor_set_fields\n end",
"title": ""
},
{
"docid": "dce1759ef2416118b8a6f0614159f0a5",
"score": "0.7208198",
"text": "def valid?\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 \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 \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 \n \n \n end",
"title": ""
},
{
"docid": "3e57ec2769fe53c196189804981e6c57",
"score": "0.7174245",
"text": "def validate; true; end",
"title": ""
},
{
"docid": "d6fb659d501db05b55eb36a1822cbd08",
"score": "0.71402234",
"text": "def validate\r\n end",
"title": ""
},
{
"docid": "570f1dd70a2fa35a19464739dc6a1f5c",
"score": "0.7085555",
"text": "def validate!; end",
"title": ""
},
{
"docid": "570f1dd70a2fa35a19464739dc6a1f5c",
"score": "0.7085555",
"text": "def validate!; end",
"title": ""
},
{
"docid": "570f1dd70a2fa35a19464739dc6a1f5c",
"score": "0.7085555",
"text": "def validate!; end",
"title": ""
},
{
"docid": "570f1dd70a2fa35a19464739dc6a1f5c",
"score": "0.7085555",
"text": "def validate!; end",
"title": ""
},
{
"docid": "0f96a45ffb2265bd8eb14b54db7d6c0d",
"score": "0.7073988",
"text": "def valid?; false; end",
"title": ""
},
{
"docid": "af9ebbda2ac3790f194da3080c9059fa",
"score": "0.70631486",
"text": "def validate(variables)\n end",
"title": ""
},
{
"docid": "25780d1af7b2ccf1caa37fdc76f2d91d",
"score": "0.7060541",
"text": "def validate\n \n end",
"title": ""
},
{
"docid": "cc9bbb1febdcea79441cb4523fce006d",
"score": "0.7053672",
"text": "def valid?; end",
"title": ""
},
{
"docid": "cc9bbb1febdcea79441cb4523fce006d",
"score": "0.7053672",
"text": "def valid?; end",
"title": ""
},
{
"docid": "cc9bbb1febdcea79441cb4523fce006d",
"score": "0.7053672",
"text": "def valid?; end",
"title": ""
},
{
"docid": "cc9bbb1febdcea79441cb4523fce006d",
"score": "0.7053672",
"text": "def valid?; end",
"title": ""
},
{
"docid": "90248d1212fb4065affe1ce9b0b79ed0",
"score": "0.70528466",
"text": "def validated?; end",
"title": ""
},
{
"docid": "a9991d159b13abde05761d2ead33e5bd",
"score": "0.703794",
"text": "def validate\n return false if @id.nil? or @id < 0\n return false if @name.nil? or @name.strip.length <= 0\n return false if @description.nil? or @description.strip.length <= 0\n return false if @capacity.nil? or @capacity <= 0\n return true\n end",
"title": ""
},
{
"docid": "f0c6f784779e34937dcc4471b0474a88",
"score": "0.7014163",
"text": "def validate\n\n end",
"title": ""
},
{
"docid": "7e156e33fc93e87dca708fc8a2d2a8a6",
"score": "0.70131606",
"text": "def validate(record); end",
"title": ""
},
{
"docid": "7e156e33fc93e87dca708fc8a2d2a8a6",
"score": "0.70131606",
"text": "def validate(record); end",
"title": ""
},
{
"docid": "7e156e33fc93e87dca708fc8a2d2a8a6",
"score": "0.70131606",
"text": "def validate(record); end",
"title": ""
},
{
"docid": "90f49f7c22184feb13937563c1442404",
"score": "0.7008697",
"text": "def valid?\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 \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 \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 \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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end",
"title": ""
},
{
"docid": "2da4bc965b1bab21d2ebfc8651b1914c",
"score": "0.7001184",
"text": "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 100\n return false if @type.nil?\n return false if @company.nil?\n return false if @contact.nil?\n return false if !@customer_po.nil? && @customer_po.to_s.length > 50\n return false if !@reason_cancelled.nil? && @reason_cancelled.to_s.length > 50\n return false if !@work_order.nil? && @work_order.to_s.length > 20\n return false if !@internal_notes.nil? && @internal_notes.to_s.length > 5000\n application_units_validator = EnumAttributeValidator.new('String', [\"Amount\", \"Hours\", \"Incidents\"])\n return false unless application_units_validator.valid?(@application_units)\n application_cycle_validator = EnumAttributeValidator.new('String', [\"Contract2Weeks\", \"Contract4Weeks\", \"ContractYear\", \"CalendarMonth\", \"CalendarQuarter\", \"CalendarWeek\", \"ContractQuarter\", \"CalendarYear\"])\n return false unless application_cycle_validator.valid?(@application_cycle)\n employee_comp_rate_validator = EnumAttributeValidator.new('String', [\"Actual\", \"Hourly\"])\n return false unless employee_comp_rate_validator.valid?(@employee_comp_rate)\n employee_comp_not_exceed_validator = EnumAttributeValidator.new('String', [\"Billing\", \"Percent\", \"Amount\"])\n return false unless employee_comp_not_exceed_validator.valid?(@employee_comp_not_exceed)\n invoicing_cycle_validator = EnumAttributeValidator.new('String', [\"CalendarYear\", \"ContractYear\"])\n return false unless invoicing_cycle_validator.valid?(@invoicing_cycle)\n bill_time_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_time_validator.valid?(@bill_time)\n bill_expenses_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_expenses_validator.valid?(@bill_expenses)\n bill_products_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_products_validator.valid?(@bill_products)\n period_type_validator = EnumAttributeValidator.new('String', [\"Current\", \"Future\", \"Both\", \"Undefined\"])\n return false unless period_type_validator.valid?(@period_type)\n return true\n end",
"title": ""
},
{
"docid": "c0012eda450efa37266920c04bcd0b01",
"score": "0.69911176",
"text": "def validate!\n end",
"title": ""
},
{
"docid": "2cf4bd30c0f60eb1ded7c0e8033f87f1",
"score": "0.6985615",
"text": "def valid?; true; end",
"title": ""
},
{
"docid": "2cf4bd30c0f60eb1ded7c0e8033f87f1",
"score": "0.6985615",
"text": "def valid?; true; end",
"title": ""
},
{
"docid": "55976728baa2ce2902ff31c50a047f0a",
"score": "0.69768655",
"text": "def valid?\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 \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 \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 \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 \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 end",
"title": ""
},
{
"docid": "55976728baa2ce2902ff31c50a047f0a",
"score": "0.69768655",
"text": "def valid?\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 \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 \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 \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 \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 end",
"title": ""
},
{
"docid": "e694f39a8832155a7807c9d95d64a2cc",
"score": "0.6968013",
"text": "def validate; false; end",
"title": ""
},
{
"docid": "491efb8aff2cdf34cab96ac42658d659",
"score": "0.696755",
"text": "def validate\n end",
"title": ""
},
{
"docid": "491efb8aff2cdf34cab96ac42658d659",
"score": "0.696755",
"text": "def validate\n end",
"title": ""
},
{
"docid": "491efb8aff2cdf34cab96ac42658d659",
"score": "0.696755",
"text": "def validate\n end",
"title": ""
},
{
"docid": "491efb8aff2cdf34cab96ac42658d659",
"score": "0.696755",
"text": "def validate\n end",
"title": ""
},
{
"docid": "763ba48a1b721f2d3dc15192eb3224bc",
"score": "0.695855",
"text": "def validation\n #\n end",
"title": ""
},
{
"docid": "712aaf3abf5ade1747eaf01dc1e85a65",
"score": "0.6935551",
"text": "def validate!(props)\n\n end",
"title": ""
},
{
"docid": "fca2e3431e521a5db6ebe3321195c699",
"score": "0.6929156",
"text": "def validate\n end",
"title": ""
},
{
"docid": "fca2e3431e521a5db6ebe3321195c699",
"score": "0.6929156",
"text": "def validate\n end",
"title": ""
},
{
"docid": "fca2e3431e521a5db6ebe3321195c699",
"score": "0.6929156",
"text": "def validate\n end",
"title": ""
},
{
"docid": "fca2e3431e521a5db6ebe3321195c699",
"score": "0.6929156",
"text": "def validate\n end",
"title": ""
},
{
"docid": "fca2e3431e521a5db6ebe3321195c699",
"score": "0.6929156",
"text": "def validate\n end",
"title": ""
},
{
"docid": "fca2e3431e521a5db6ebe3321195c699",
"score": "0.6929156",
"text": "def validate\n end",
"title": ""
},
{
"docid": "1bf629d2aa16f86d95b393b9cc980321",
"score": "0.69286835",
"text": "def validateable?; end",
"title": ""
},
{
"docid": "1bf629d2aa16f86d95b393b9cc980321",
"score": "0.69286835",
"text": "def validateable?; end",
"title": ""
},
{
"docid": "4d10fc26e868dec5c3dcc70150eb1c82",
"score": "0.6923405",
"text": "def validated; end",
"title": ""
},
{
"docid": "4d10fc26e868dec5c3dcc70150eb1c82",
"score": "0.6923405",
"text": "def validated; end",
"title": ""
},
{
"docid": "5ffbfed600baa4e302eee7ad982c24a8",
"score": "0.6919364",
"text": "def check_validity\r\n end",
"title": ""
},
{
"docid": "9b0c2c5b4c15bf89c9c2177343e92a1c",
"score": "0.6916237",
"text": "def validate?()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "522af60f6d2a1b7322130405158511f6",
"score": "0.69006497",
"text": "def valid?(*args); end",
"title": ""
},
{
"docid": "d3233379b23b0af92d5e0a3b4d27deba",
"score": "0.6899888",
"text": "def valid?\n validate_top_coordinates\n validate_starting_position\n validate_instructions\n\n self.errors.empty?\n end",
"title": ""
},
{
"docid": "d1feabc5aef25b09fd74bc3df84080f1",
"score": "0.68707377",
"text": "def validate\n is_valid = true\n preceded_by = self.preceded_by\n if preceded_by == nil || preceded_by == \"\"\n errors.add_to_base(\"preceded_by can not be blank\")\n end\n\n\n if preceded_by != nil\n valid_preceded_values\n validate_preceded_first_value\n validate_status_code\n end\n\nend",
"title": ""
},
{
"docid": "add9ebeb0f2070d052248ca74721a635",
"score": "0.6858053",
"text": "def valid?\n end",
"title": ""
},
{
"docid": "add9ebeb0f2070d052248ca74721a635",
"score": "0.6858053",
"text": "def valid?\n end",
"title": ""
},
{
"docid": "add9ebeb0f2070d052248ca74721a635",
"score": "0.6858053",
"text": "def valid?\n end",
"title": ""
},
{
"docid": "add9ebeb0f2070d052248ca74721a635",
"score": "0.6858053",
"text": "def valid?\n end",
"title": ""
},
{
"docid": "add9ebeb0f2070d052248ca74721a635",
"score": "0.6858053",
"text": "def valid?\n end",
"title": ""
},
{
"docid": "add9ebeb0f2070d052248ca74721a635",
"score": "0.6858053",
"text": "def valid?\n end",
"title": ""
},
{
"docid": "add9ebeb0f2070d052248ca74721a635",
"score": "0.6858053",
"text": "def valid?\n end",
"title": ""
},
{
"docid": "add9ebeb0f2070d052248ca74721a635",
"score": "0.6858053",
"text": "def valid?\n end",
"title": ""
},
{
"docid": "b583cdb301efe1a7852782fea1c810b1",
"score": "0.68554896",
"text": "def validate\r\n if self.description.nil? || self.description.blank?\r\n \"Please enter the description\"\r\n elsif self.image_url.nil? || self.image_url.blank?\r\n \"Please enter the image_url\"\r\n elsif self.name.nil? || self.name.blank?\r\n \"Please enter the name\"\r\n elsif self.manufacturer.nil? || self.manufacturer.blank?\r\n \"Please enter the manufacturer\"\r\n elsif self.price.nil? || self.price.blank? || self.price.to_f <= 0\r\n \"Please enter the correct price\"\r\n else\r\n nil\r\n end\r\n end",
"title": ""
},
{
"docid": "ec3bc31d93f8d4e3376bf03ca481b61a",
"score": "0.6853993",
"text": "def validates!(*attributes); end",
"title": ""
},
{
"docid": "ec3bc31d93f8d4e3376bf03ca481b61a",
"score": "0.6853993",
"text": "def validates!(*attributes); end",
"title": ""
},
{
"docid": "cdab3afc2c10fc126d0b932b9da44294",
"score": "0.685335",
"text": "def validate(entry); end",
"title": ""
},
{
"docid": "3ee19b5fe46408415f06a6b9b6c61b25",
"score": "0.6847913",
"text": "def valid?\n end",
"title": ""
},
{
"docid": "1359b9107650ad153ab3a7fe688f2653",
"score": "0.68341434",
"text": "def validate_mandatory\n\n end",
"title": ""
},
{
"docid": "fc1f0d1dcf0ddc4c07baedf1424e3334",
"score": "0.6825424",
"text": "def validate\n super\n #validates_presence %i[name date uploader subject]\n validates_presence :name, message: \"Se requiere un nombre\"\n validates_presence :date, message: \"Se requiere una fecha\"\n validates_presence :uploader, message: \"Se requiere un que nombre del cargador\"\n validates_presence :subject, message: \"Se requiere ingresar asunto\"\n end",
"title": ""
},
{
"docid": "991a9fe4bdf4f27ba78cf6790efdf839",
"score": "0.6809058",
"text": "def validate()\n # TODO ... later\n end",
"title": ""
},
{
"docid": "21efe0d67eea95653b4ab0c6f702d216",
"score": "0.6808518",
"text": "def validate\n errors.add_to_base(\"Your phone number is to long!\") if self.businessPhone.to_s.length > 15\n errors.add_to_base(\"Your Title is to long\")if self.titleOfAd.to_s.length > 50\n errors.add_to_base(\"Your Buiness is to long\")if self.businessAd.to_s.length > 50\n errors.add_to_base(\"Your URL is to long\")if self.urlAd.to_s.length > 50\n errors.add_to_base(\"Your Contact is to long\")if self.businessContact.to_s.length > 50\n errors.add_to_base(\"Your Email is to long\")if self.businessEmail.to_s.length > 50\n errors.add_to_base(\"Your Business is to long\")if self.businessAddress.to_s.length > 50\n errors.add_to_base(\"Your Size is to long\")if self.size.to_s.length > 2\n errors.add_to_base(\"Your phone number is to short!\") if self.businessPhone.to_s.length < 7\n end",
"title": ""
},
{
"docid": "bf373bc3cc89e145fe30111da9f19308",
"score": "0.68009806",
"text": "def valid?; @valid; end",
"title": ""
},
{
"docid": "30d355327238b7dcbbd991912232ccaf",
"score": "0.67955476",
"text": "def validate\n return false if @id.nil? || (@id < 0)\n return false if @name.nil? || (@name.strip.length <= 0)\n return false if @description.nil? || (@description.strip.length <= 0)\n return false if @capacity.nil? || (@capacity < -1)\n\n true\n end",
"title": ""
},
{
"docid": "8f956530aa4d248653d084332cfaf34d",
"score": "0.6794411",
"text": "def valid?\n return false if @customer.nil?\n return false if !@receiver_email.nil? && @receiver_email.to_s.length > 254\n return false if !@overdue_notice_email.nil? && @overdue_notice_email.to_s.length > 254\n return false if !@number.nil? && @number.to_s.length > 100\n return false if !@reference.nil? && @reference.to_s.length > 255\n return false if @order_date.nil?\n return false if !@invoices_due_in.nil? && @invoices_due_in > 10000\n return false if !@invoices_due_in.nil? && @invoices_due_in < 0\n invoices_due_in_type_validator = EnumAttributeValidator.new('String', [\"DAYS\", \"MONTHS\", \"RECURRING_DAY_OF_MONTH\"])\n return false unless invoices_due_in_type_validator.valid?(@invoices_due_in_type)\n return false if @delivery_date.nil?\n order_line_sorting_validator = EnumAttributeValidator.new('String', [\"ID\", \"PRODUCT\", \"CUSTOM\"])\n return false unless order_line_sorting_validator.valid?(@order_line_sorting)\n return false if !@subscription_duration.nil? && @subscription_duration < 0\n subscription_duration_type_validator = EnumAttributeValidator.new('String', [\"MONTHS\", \"YEAR\"])\n return false unless subscription_duration_type_validator.valid?(@subscription_duration_type)\n return false if !@subscription_periods_on_invoice.nil? && @subscription_periods_on_invoice < 0\n subscription_periods_on_invoice_type_validator = EnumAttributeValidator.new('String', [\"MONTHS\"])\n return false unless subscription_periods_on_invoice_type_validator.valid?(@subscription_periods_on_invoice_type)\n subscription_invoicing_time_in_advance_or_arrears_validator = EnumAttributeValidator.new('String', [\"ADVANCE\", \"ARREARS\"])\n return false unless subscription_invoicing_time_in_advance_or_arrears_validator.valid?(@subscription_invoicing_time_in_advance_or_arrears)\n return false if !@subscription_invoicing_time.nil? && @subscription_invoicing_time < 0\n subscription_invoicing_time_type_validator = EnumAttributeValidator.new('String', [\"DAYS\", \"MONTHS\"])\n return false unless subscription_invoicing_time_type_validator.valid?(@subscription_invoicing_time_type)\n return true\n end",
"title": ""
},
{
"docid": "0ac21620c75ee8daa5f285e0461e75ba",
"score": "0.6777996",
"text": "def valid?\n return false if @name.nil?\n return false if !@vat.nil? && @vat > 1\n return false if !@vat.nil? && @vat < 0\n return false if @amount.nil?\n return false if @amount < 0\n return false if !@quantity.nil? && @quantity < 1\n return false if @handle.nil?\n return false if @version.nil?\n return false if @version < 1\n return false if @state.nil?\n state_validator = EnumAttributeValidator.new('String', [\"active\", \"superseded\", \"deleted\"])\n return false unless state_validator.valid?(@state)\n return false if @currency.nil?\n return false if @created.nil?\n return false if !@renewal_reminder_email_days.nil? && @renewal_reminder_email_days < 1\n return false if !@trial_reminder_email_days.nil? && @trial_reminder_email_days < 1\n partial_period_handling_validator = EnumAttributeValidator.new('String', [\"bill_full\", \"bill_prorated\", \"bill_zero_amount\", \"no_bill\"])\n return false unless partial_period_handling_validator.valid?(@partial_period_handling)\n return false if !@setup_fee.nil? && @setup_fee < 0\n return false if !@fixed_count.nil? && @fixed_count < 1\n fixed_life_time_unit_validator = EnumAttributeValidator.new('String', [\"months\", \"days\"])\n return false unless fixed_life_time_unit_validator.valid?(@fixed_life_time_unit)\n return false if !@fixed_life_time_length.nil? && @fixed_life_time_length < 1\n trial_interval_unit_validator = EnumAttributeValidator.new('String', [\"months\", \"days\"])\n return false unless trial_interval_unit_validator.valid?(@trial_interval_unit)\n return false if !@trial_interval_length.nil? && @trial_interval_length < 1\n return false if @interval_length.nil?\n return false if @interval_length < 1\n return false if @schedule_type.nil?\n schedule_type_validator = EnumAttributeValidator.new('String', [\"manual\", \"daily\", \"weekly_fixedday\", \"month_startdate\", \"month_fixedday\", \"month_lastday\"])\n return false unless schedule_type_validator.valid?(@schedule_type)\n return false if !@schedule_fixed_day.nil? && @schedule_fixed_day > 28\n return false if !@schedule_fixed_day.nil? && @schedule_fixed_day < 1\n return false if !@base_month.nil? && @base_month > 12\n return false if !@base_month.nil? && @base_month < 1\n return false if !@notice_periods.nil? && @notice_periods < 0\n return false if !@fixation_periods.nil? && @fixation_periods < 0\n return true\n end",
"title": ""
},
{
"docid": "5d580ce30099341ea5184d1fda837450",
"score": "0.67720145",
"text": "def valid?\n true \n end",
"title": ""
},
{
"docid": "8ab16263ef7eaa5204dc91b769ac7425",
"score": "0.6771094",
"text": "def do_validate(_name, _values, _errors)\n true\n end",
"title": ""
},
{
"docid": "642a67d38d2725af639765d6fd275b6d",
"score": "0.6768967",
"text": "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 50\n return false if @location.nil?\n return false if @department.nil?\n bill_time_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_time_validator.valid?(@bill_time)\n bill_expense_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_expense_validator.valid?(@bill_expense)\n bill_product_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_product_validator.valid?(@bill_product)\n return false if !@notify_email_from.nil? && @notify_email_from.to_s.length > 50\n return false if !@notify_email_from_name.nil? && @notify_email_from_name.to_s.length > 60\n problem_sort_validator = EnumAttributeValidator.new('String', [\"Ascending\", \"Descending\"])\n return false unless problem_sort_validator.valid?(@problem_sort)\n resolution_sort_validator = EnumAttributeValidator.new('String', [\"Ascending\", \"Descending\"])\n return false unless resolution_sort_validator.valid?(@resolution_sort)\n internal_analysis_sort_validator = EnumAttributeValidator.new('String', [\"Ascending\", \"Descending\"])\n return false unless internal_analysis_sort_validator.valid?(@internal_analysis_sort)\n all_sort_validator = EnumAttributeValidator.new('String', [\"Ascending\", \"Descending\"])\n return false unless all_sort_validator.valid?(@all_sort)\n return true\n end",
"title": ""
},
{
"docid": "b9939f11c38a970eedea66d34ae8d612",
"score": "0.6766306",
"text": "def validate\n errors.add_to_base(\"Your Photo ID is to long, can only store 8 characters!\") if self.photoId.to_s.length > 8\n errors.add_to_base(\"Your Caption is to long, can only store 500 characters!\")if self.caption.to_s.length > 500\n errors.add_to_base(\"Your Gallery Number is to long, can only store 6 characters!\")if self.gallery.to_s.length > 6\n errors.add_to_base(\"Your Link is to long, can only store 50 characters!\")if self.link.to_s.length > 50\n errors.add_to_base(\"Your Photographer is to long, can only store 100 characters!\") if self.photographer.to_s.length > 100\n errors.add_to_base(\"Your Issue Number is to long, can only store 4 characters!\") if self.issue.to_s.length > 4\n errors.add_to_base(\"Your Thumbnail name is to long, can only store 50 characters!\") if self.thumbnail.to_s.length > 50\n end",
"title": ""
},
{
"docid": "ade585d0f5130108f7092f7758789aa6",
"score": "0.67615235",
"text": "def validate\n end",
"title": ""
},
{
"docid": "ade585d0f5130108f7092f7758789aa6",
"score": "0.67615235",
"text": "def validate\n end",
"title": ""
},
{
"docid": "ade585d0f5130108f7092f7758789aa6",
"score": "0.67615235",
"text": "def validate\n end",
"title": ""
},
{
"docid": "ade585d0f5130108f7092f7758789aa6",
"score": "0.67615235",
"text": "def validate\n end",
"title": ""
},
{
"docid": "d8581f5a4374904381049c950aab7504",
"score": "0.67588943",
"text": "def validate\n return false if @id.nil? or @id < 0\n return false if @name.nil? or @name.strip.length <= 0\n return false if @description.nil? or @description.strip.length <= 0\n return false if @capacity.nil? or @capacity < -1\n return true\n end",
"title": ""
},
{
"docid": "d9cc3e38a0909d1afa179c3eb85bfaca",
"score": "0.67560714",
"text": "def validate\n\n end",
"title": ""
},
{
"docid": "474f32824a9a8dfba6b90815e55176c6",
"score": "0.6746982",
"text": "def valid?\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 \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 \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 \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 \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 \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 \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 \n \n \n end",
"title": ""
},
{
"docid": "2cf40765a00c244769f801a2a89edbe9",
"score": "0.67440146",
"text": "def additional_validation!(args)\n end",
"title": ""
},
{
"docid": "fc7eccb6353bd1e09b7de001f03e025e",
"score": "0.67433953",
"text": "def valid?\n validate\n super\n end",
"title": ""
},
{
"docid": "1285bf1848ee1025b4d96baae9d62628",
"score": "0.67336214",
"text": "def validate\n\t\tself.validate_idents\n\t\tself.validate_specs\n\t\tself.validate_protocol\n\t\tself.validate_uniqueness\n\tend",
"title": ""
},
{
"docid": "73ec037eaec599f10c13a3f867e648b2",
"score": "0.6730815",
"text": "def valid?\n # Controllo di tutti i campi\n @control[:title]=\"valid\" if (@title.is_a?(String) && !@title.empty?)\n @control[:author]=\"valid\" if (@author.is_a?(String) && !@author.empty?)\n @control[:release_date]=\"valid\" if (@release_date.is_a?(Date))\n @control[:publisher]=\"valid\" if (@publisher.is_a?(String) && !@publisher.empty?)\n @control[:isbn]=\"valid\" if (@isbn.is_a?(Fixnum) && @isbn <= 10**10 && @isbn >= 10**9)\n \n # se anche un solo campo non é valido restituisco falso\n @control.each do |key, value|\n if value != \"valid\"\n return false\n end\n end\n return true\n end",
"title": ""
}
] |
fb88ee6b57defd6b0ffa8d5c14b47478
|
Watch and reload files.
|
[
{
"docid": "c8835c2ef894cafe16a14f4b29ceba7c",
"score": "0.6529157",
"text": "def watch *paths\n paths.each{|path| watcher.paths << path unless watcher.paths.include? path}\n watcher.start\n end",
"title": ""
}
] |
[
{
"docid": "99b9a307bcb1b5c8d928c82e24cbe740",
"score": "0.7868133",
"text": "def start_watch_files\n watched_files.each do |file|\n @notifier.watch(file, :modify) do\n Js2coffee.watch_file(file)\n end\n end\n end",
"title": ""
},
{
"docid": "5c328310aca77742bba79df286394c6d",
"score": "0.7796755",
"text": "def reload\n clear_files\n load_files\n end",
"title": ""
},
{
"docid": "1f01f651f81d606760e24d537dc1c964",
"score": "0.77512145",
"text": "def reload!\n changed_files = []\n\n @monitor_dirs.keys.each do |dir|\n check_monitor_dir(dir, changed_files)\n end\n\n removed_files = []\n delete_hooks = []\n\n @monitor_files.to_a.each do |file, (time, delete_hook)|\n if File.file?(file)\n if file_changed?(file, time)\n changed_files << file\n end\n else\n delete_hooks << [delete_hook, file] if delete_hook\n removed_files << file\n end\n end\n\n remove_files(removed_files)\n delete_hooks.each{|hook, file| hook.call(file)}\n\n return if changed_files.empty?\n\n unless @dependencies.empty?\n changed_files = Unreloader.expand_directory_paths(reload_files(changed_files))\n \n order = @dependency_order\n order &= changed_files\n changed_files = order + (changed_files - order)\n end\n\n unless @skip_reload.empty?\n changed_files -= Unreloader.expand_directory_paths(@skip_reload)\n end\n\n changed_files.select! do |file|\n @monitor_files.has_key?(file)\n end\n changed_files.each do |file|\n safe_load(file)\n end\n end",
"title": ""
},
{
"docid": "fdb53f455b756c4a0d31b2537d044450",
"score": "0.771739",
"text": "def reload!\n # Detect changed files\n rotation do |file, mtime|\n # Retrive the last modified time\n new_file = MTIMES[file].nil?\n previous_mtime = MTIMES[file] ||= mtime\n logger.devel \"Detected a new file #{file}\" if new_file\n # We skip to next file if it is not new and not modified\n next unless new_file || mtime > previous_mtime\n # Now we can reload our file\n apps = mounted_apps_of(file)\n if apps.present?\n apps.each { |app| app.app_obj.reload! }\n else\n safe_load(file, :force => new_file)\n # Reload also apps\n Padrino.mounted_apps.each do |app|\n app.app_obj.reload! if app.app_obj.dependencies.include?(file)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1173ecd6e111689380404349db3fc716",
"score": "0.7688793",
"text": "def watcher\n fsevent = FSEvent.new\n fsevent.watch Dir.pwd do |directories|\n reload!\n end\n fsevent.run\nend",
"title": ""
},
{
"docid": "cb148f3de09374d00c3f0d279664b38c",
"score": "0.7624144",
"text": "def reload\n Dir.glob('**/*.rb').each { |file| Reloader.reload_file(file) }\n\n self.last_run_passed = true\n self.rerun_specs = []\n end",
"title": ""
},
{
"docid": "60c2dcc9acb29b4a256fddf1b33e89d5",
"score": "0.760143",
"text": "def reload\n reload_file_set if implicitly_loaded?\n @files.each {|file| file.reload_if_modified}\n end",
"title": ""
},
{
"docid": "468cd543f84ea3d948b0464e0497e2bb",
"score": "0.75280493",
"text": "def reload\n SourceReloadHooks.before_reload\n all_reload_files.each do |file|\n mtime = mtime(file)\n\n next if (@mtimes[file] ||= mtime) == mtime\n\n Log.debug(\"reload #{file}\")\n safe_load(file) # ignore status, we don't want load errors to flood us\n @mtimes[file] = mtime\n end\n SourceReloadHooks.after_reload\n end",
"title": ""
},
{
"docid": "e8eb5f9eb8f000b6cccc2108e510a567",
"score": "0.73265",
"text": "def reload(files)\n @mutex.synchronize {\n files = files.map { |f| File.expand_path(f) }.grep(/\\.rb$/)\n return if files.empty?\n Logging.logger[self].debug \"reloading changed file(s): \" + files.inspect\n $\".delete_if { |f| files.include? f }\n files.each { |f| require f }\n }\n end",
"title": ""
},
{
"docid": "fb6192ca06bdd4f5c17ca3d13bce93ea",
"score": "0.7326234",
"text": "def reload!\n load_all \"./config\" if Dir.exists?(\"./config\")\n load_all \"./app\" if Dir.exists?(\"./app\")\n load_all \"./*.rb\" if Dir.entries(\".\").include?(/\\.rb/)\nend",
"title": ""
},
{
"docid": "873eb70640ee4871871d99d0b6829af5",
"score": "0.7294466",
"text": "def watch_feature_files\n files.each do |file|\n watch(file)\n end \n end",
"title": ""
},
{
"docid": "de2d46b4e009f058e81db7ed8455775b",
"score": "0.728802",
"text": "def reload_modified_files!\n LOADED_FILES.each do |path, last_modified|\n reload_file(path) if File.mtime(path) > last_modified\n end\n end",
"title": ""
},
{
"docid": "b5f097d8a60cd873848d970a05dfd599",
"score": "0.7246608",
"text": "def run_on_changes(paths)\n reload\n end",
"title": ""
},
{
"docid": "6a159b26940d8126f430b032c0605886",
"score": "0.71314585",
"text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end",
"title": ""
},
{
"docid": "6a159b26940d8126f430b032c0605886",
"score": "0.71314585",
"text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end",
"title": ""
},
{
"docid": "abf592862f59dfb1a4dfe44830817650",
"score": "0.7109867",
"text": "def reload!\r\n Dir.glob(\"lib/**/*.rb\") { |file| load file }\r\nend",
"title": ""
},
{
"docid": "25d9f491e9e3e9330099fd6e0e08118a",
"score": "0.70681536",
"text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob('**/*')))\n end",
"title": ""
},
{
"docid": "b2e0619953589214a8ab90f9d893fcb4",
"score": "0.70673853",
"text": "def run_all\n patterns = @watchers.map { |w| w.pattern }\n files = Dir.glob('**/*.*')\n r = []\n files.each do |file|\n patterns.each do |pattern|\n r << file if file.match(Regexp.new(pattern))\n end\n end\n run_on_change(r)\n end",
"title": ""
},
{
"docid": "9847ff5253110e6224c83fb52b1ac897",
"score": "0.7066503",
"text": "def run_all\n run_on_changes(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end",
"title": ""
},
{
"docid": "5ebfd1bc78320c0f13b6b1c501453ab0",
"score": "0.7014438",
"text": "def run_all\n run_on_modifications(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end",
"title": ""
},
{
"docid": "198546d090dd7d2a38018baba4b02733",
"score": "0.7010115",
"text": "def run_on_modifications(paths)\n reload\n end",
"title": ""
},
{
"docid": "96aa591c2b897eaf30554bf2021d8518",
"score": "0.6999472",
"text": "def run_all\n run_on_changes(Watcher.match_files(self, Dir.glob(\"**/*\")))\n end",
"title": ""
},
{
"docid": "1a7519faa6a0612321e6eb190d52157c",
"score": "0.69963264",
"text": "def listeners\n watch_paths.map do |pth|\n gem_path_dir = File.join(@gem_base, pth)\n Listen.to(gem_path_dir, only: /\\.html\\.erb$/) do |modded, added, removed|\n Rails.logger.warn(\"[#{self.class}] : updates: changed => #{modded}, added: #{added}, removed: #{removed}\")\n (modded + added).each do |f|\n dest = Rails.root.join(pth, File.basename(f))\n Rails.logger.info(\"Updating #{f} to #{dest}\")\n FileUtils.copy_file(f, dest)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "06a2908bf75f3e78fe87ec1423b54b16",
"score": "0.69858855",
"text": "def watch(&block)\n path = File.expand_path(@path)\n @logger.info(\"Watching for changes to #{path}\")\n dir = File.dirname(path)\n fname = File.basename(path)\n Listen.to(dir, :filter => /#{Regexp.quote(fname)}/) do |modified, added, removed|\n begin\n @logger.info(\"Change to control file detected...\")\n inifile = IniFile.load(path)\n distributions = parse!(inifile)\n\n @watch_mutex.synchronize do\n @distributions = distributions\n end\n @logger.info(\"...rebuilt\")\n yield if block_given?\n rescue => e\n @logger.error(\"Error reloading changes: #{e}\")\n @logger.error(e)\n end\n end\n end",
"title": ""
},
{
"docid": "6e290a7778c29988b31bc73b9192af08",
"score": "0.69780636",
"text": "def watch_filepaths(filepaths)\n listener = Listen.to(*filepaths) do |modified, added, removed|\n on_change(modified, added, removed)\n end\n listener.start\n end",
"title": ""
},
{
"docid": "25fe1431d9a0bcfbc695f944626889b1",
"score": "0.69553065",
"text": "def reload_modified_files_in(reload_path_roots)\n reload_file_paths = $\".select do |path|\n reload_path_roots.any? { |matcher| /^#{matcher}\\// =~ path }\n end.select do |path|\n File.mtime(path) > RubyTerminal.options[:loaded_at]\n end\n\n $\".replace($\" - reload_file_paths)\n\n reload_file_paths.each do |file_path|\n load file_path\n puts \"reloaded #{file_path.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "c86be67e5ffa2bd69ee9671762c71e7f",
"score": "0.6948332",
"text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob(File.join('**', '[^_]*.*'))))\n end",
"title": ""
},
{
"docid": "b04d0a9d89ea1dc8460630a52bd77919",
"score": "0.69226384",
"text": "def reload!\n changed_files = []\n rotation do |file, mtime|\n # Retrive the last modified time\n new_file = mtimes[file].nil?\n previous_mtime = mtimes[file] ||= mtime\n logger.debug \"Detected a new file #{file}\" if new_file\n # We skip to next file if it is not new and not modified\n changed_files << [file, mtime] if new_file || mtime > previous_mtime\n # Now we can reload our file\n end\n all_classes = schema.classes.dup\n\n modified_classes = changed_files.map do |file, mtime|\n schema_classes_for_file(file)\n end.flatten\n\n affected_subclasses = modified_classes.map do |modified_class|\n all_classes.select { |schema_class|\n schema_class < modified_class\n }\n end.flatten\n\n\n subclass_files_to_reload = affected_subclasses.map do |subclass|\n file_for_class(subclass)\n end.flatten\n\n changed_files.each { |file, mtime|\n begin\n safe_load(file, mtime)\n rescue => boom\n # remove the file so that it gets reloaded next time, this stops errors in the schema files\n # from resulting in a schema map change...\n mtimes.delete(file)\n raise boom\n end\n }\n subclass_files_to_reload.each { |file| safe_load(file) }\n end",
"title": ""
},
{
"docid": "f8c8ce85b7fc507a752ce41afbe3cada",
"score": "0.6920886",
"text": "def startWatch()\n \tself.fsRoots.each do |root|\n\t \t\taddWatch(root)\n\t \tend\n\t\trunWatch()\n\tend",
"title": ""
},
{
"docid": "4a8c62d2a504b1569d05894a972974d4",
"score": "0.6914324",
"text": "def reload!\n load \"extensions.rb\"\n load \"record.rb\"\n load \"user.rb\"\n load \"repo.rb\"\n load \"reader.rb\"\nend",
"title": ""
},
{
"docid": "9cda591e8f10e8a43bc7e64b8477bf96",
"score": "0.6907494",
"text": "def run_all\n patterns = @watchers.map {|w| w.pattern}\n files = Dir.glob('**/*.*')\n r = []\n files.each do |file|\n patterns.each do |pattern|\n r << file if file.match(Regexp.new(pattern))\n end\n end\n run_on_change(r)\n end",
"title": ""
},
{
"docid": "7409cd8986a0272e656e9b25099dddca",
"score": "0.688175",
"text": "def watch(directory)\n @existing = all_files\n end",
"title": ""
},
{
"docid": "7409cd8986a0272e656e9b25099dddca",
"score": "0.688175",
"text": "def watch(directory)\n @existing = all_files\n end",
"title": ""
},
{
"docid": "1886aab6448dd411f3b349b9c0f62a0a",
"score": "0.68763125",
"text": "def run_on_changes(paths)\n restart\n end",
"title": ""
},
{
"docid": "1886aab6448dd411f3b349b9c0f62a0a",
"score": "0.68763125",
"text": "def run_on_changes(paths)\n restart\n end",
"title": ""
},
{
"docid": "1886aab6448dd411f3b349b9c0f62a0a",
"score": "0.68763125",
"text": "def run_on_changes(paths)\n restart\n end",
"title": ""
},
{
"docid": "1886aab6448dd411f3b349b9c0f62a0a",
"score": "0.68763125",
"text": "def run_on_changes(paths)\n restart\n end",
"title": ""
},
{
"docid": "1e931d7196f1361d42997965c6ae80e0",
"score": "0.68543816",
"text": "def run_all\n run_on_changes(Watcher.match_files(self, Dir.glob('**{,/*/**}/*').uniq.compact))\n end",
"title": ""
},
{
"docid": "19610d71d34b0c47c495c7546d0e2fcd",
"score": "0.684278",
"text": "def reload!(print = true)\n puts 'Reloading ...' if print\n\n root_dir = File.expand_path('..', __dir__)\n reload_dirs = %w{lib}\n reload_dirs.each do |dir|\n Dir.glob(\"#{root_dir}/#{dir}/**/*.rb\").each { |f| load(f) }\n end\n\n true\nend",
"title": ""
},
{
"docid": "697bc0050ab5ab8df30d1ce0fe941c60",
"score": "0.68368113",
"text": "def start\n watch(@directory)\n timestamp_files\n end",
"title": ""
},
{
"docid": "a6edbcb68d78880cf0eaacef97dea1f5",
"score": "0.68033975",
"text": "def file_watcher; end",
"title": ""
},
{
"docid": "6dca2d83dcaedc296d747304793c5f46",
"score": "0.6800063",
"text": "def reload!\n @sources.each {|k,s,v| do_load_source(k,s,v)}\n end",
"title": ""
},
{
"docid": "66c96c4e21f318e07ac44b18d0622b6d",
"score": "0.6745124",
"text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob('{,**/}*{,.*}').uniq))\n end",
"title": ""
},
{
"docid": "66c96c4e21f318e07ac44b18d0622b6d",
"score": "0.6745124",
"text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob('{,**/}*{,.*}').uniq))\n end",
"title": ""
},
{
"docid": "34db5cba668768873f3b6981296da1ce",
"score": "0.6738837",
"text": "def perform_reload\n api.file_reload(self)\n end",
"title": ""
},
{
"docid": "4983891cbf13ac581cae30852dc7ca47",
"score": "0.67247313",
"text": "def reload!\n require 'pathname'\n Pathname.new(File.expand_path(__FILE__)).parent.find do |path|\n if path.extname == '.rb' and path.mtime > reload_time\n puts path.to_s\n load path.to_s\n end\n end\n clear_plugin_cache\n @reload_time = Time.now\n end",
"title": ""
},
{
"docid": "70ffe4dcdd40ceae6d6ac78e73ccf7ab",
"score": "0.6718753",
"text": "def run_all\n run_on_modifications( Watcher.match_files(self, Dir.glob('**{,/*/**}/*.{tex,erb.tex,tex.erb}')) )\n end",
"title": ""
},
{
"docid": "9a99715e19b284479883c1e451e9f32b",
"score": "0.6683914",
"text": "def refresh!\n now = Time.now\n candidate_paths = Dir[File.join(path, @glob)].select { |path| File.file? path }\n (@file_stats.keys - candidate_paths).each { |k| @file_stats.delete(k) }\n candidate_paths.each do |path|\n h_stat = @file_stats[path] ||= {}\n mtime = File.mtime(path)\n h_stat[:hot] = h_stat[:mtime] ? mtime > h_stat[:mtime] : now - mtime < 60.0 # ∆t in seconds\n h_stat[:mtime] = mtime\n @file_stats[path] = h_stat\n end\n self\n end",
"title": ""
},
{
"docid": "c6857155115ee8bbcc26299d32c1ba3a",
"score": "0.6679707",
"text": "def run_on_changes(paths = {})\n restart_and_ping\n end",
"title": ""
},
{
"docid": "c72360853efcf33d130fd8153c0324b3",
"score": "0.66770625",
"text": "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",
"title": ""
},
{
"docid": "a93d0bf43b6fab1d481fdd7ee4687699",
"score": "0.6669322",
"text": "def start_reloader\n Thread.new do\n base = File.dirname(__FILE__)\n path = File.join(base, 'morrow/web_server/backend.rb')\n mtime = File.mtime(path)\n\n loop do\n if (t = File.mtime(path)) > mtime\n debug('web server modified; attempting to reload ...')\n mtime = t\n\n begin\n # We do this in stages; try to load the file, and if it's\n # successful, reset the web server, then load it again. The\n # reset is necessary, otherwise the routes from the previous web\n # server definition take precidence.\n load(path)\n WebServer::Backend.reset!\n load(path)\n info('web server reloaded')\n rescue Exception => ex\n error('failed to reload web server')\n log_exception(ex)\n end\n end\n\n sleep 5\n end\n end\n end",
"title": ""
},
{
"docid": "7cfeffcefcee59c68dfd8b8d967b0f8d",
"score": "0.6662643",
"text": "def reload!\n initialize(@file_root)\n end",
"title": ""
},
{
"docid": "9200178a824f74e29b4ff3178a103584",
"score": "0.66554403",
"text": "def reload ; config.reloadable.each { |mod| mod.reload } ; end",
"title": ""
},
{
"docid": "9200178a824f74e29b4ff3178a103584",
"score": "0.66554403",
"text": "def reload ; config.reloadable.each { |mod| mod.reload } ; end",
"title": ""
},
{
"docid": "9200178a824f74e29b4ff3178a103584",
"score": "0.66554403",
"text": "def reload ; config.reloadable.each { |mod| mod.reload } ; end",
"title": ""
},
{
"docid": "9200178a824f74e29b4ff3178a103584",
"score": "0.66554403",
"text": "def reload ; config.reloadable.each { |mod| mod.reload } ; end",
"title": ""
},
{
"docid": "9f675bdab9c72ec476195154994a87ad",
"score": "0.6632965",
"text": "def run_on_changes(paths)\n paths.each do |path|\n file_changed(path)\n end\n end",
"title": ""
},
{
"docid": "9f675bdab9c72ec476195154994a87ad",
"score": "0.6632965",
"text": "def run_on_changes(paths)\n paths.each do |path|\n file_changed(path)\n end\n end",
"title": ""
},
{
"docid": "dd195b200b05b781902a55671f67b1d6",
"score": "0.66296905",
"text": "def watch()\n GALogger.log(\"Watching...\")\n system(\"filewatcher '*.{m,swift}' 'xctestfile $FILENAME'\", out: $stdout, err: :out)\n end",
"title": ""
},
{
"docid": "b93fe4b0e80954b1cb1f3095985093a7",
"score": "0.65977615",
"text": "def reload_plugin_files\n plugins_path.each do |plugin_search_path|\n plugin_files = Utils.safe_glob(plugin_search_path, File.join(\"**\", \"*.rb\"))\n Array(plugin_files).each do |name|\n Bridgetown.logger.debug \"Reloading:\", name.to_s\n self.class.add_registered_plugin name\n load name\n end\n end\n end",
"title": ""
},
{
"docid": "c43b82b05f87a77f9044872ed9cfd9dc",
"score": "0.65968364",
"text": "def reload\n load_config\n run_all\n end",
"title": ""
},
{
"docid": "1a26a135e9cd540938154bed95e57d75",
"score": "0.6588976",
"text": "def watchable_files; end",
"title": ""
},
{
"docid": "554af54e412f52f486dfea4ae98d2114",
"score": "0.65828973",
"text": "def run_all\n patterns = @watchers.map { |w| w.pattern }\n files = Dir.glob('**/*.*')\n paths = []\n files.each do |file|\n patterns.each do |pattern|\n paths << file if file.match(Regexp.new(pattern))\n end\n end\n run(paths)\n end",
"title": ""
},
{
"docid": "18c76eadf857a50f3fd7a513cbd73f0d",
"score": "0.6556947",
"text": "def reload\n if Stealth.config.hot_reload\n @checker.execute_if_updated\n end\n end",
"title": ""
},
{
"docid": "4e75415d58bc4380ad56e555753aa6e7",
"score": "0.6556913",
"text": "def reload!\r\n initialize(@file_root)\r\n end",
"title": ""
},
{
"docid": "d0f513e26ca5948e022d6be640efd2e9",
"score": "0.6532732",
"text": "def watching(filepath)\n \n notifier = INotify::Notifier.new\n notifier.watch(filepath, :close_write) do |event|\n # The #name field of the event object contains the name of the affected file\n @file = event.name\n @fullpath = filepath + event.name\n puts @file\n end\n notifier.run\n end",
"title": ""
},
{
"docid": "4d77410a6c2c68e3f2c04c06a4979945",
"score": "0.6526975",
"text": "def run_once\n files = scan_files\n keys = [files.keys, @files.keys] # current files, previous files\n\n find_added(files, *keys)\n find_modified(files, *keys)\n find_removed(*keys)\n\n notify_observers\n @files = files # store the current file list for the next iteration\n self\n end",
"title": ""
},
{
"docid": "1dd3333f6e6736a565708a1fd8064702",
"score": "0.64990777",
"text": "def watch!\n raise 'Initialization required' if @path.nil? or @bucket.nil?\n callback = Proc.new do |modified, added, removed|\n urls = []\n (added | modified).sort.each do |file_name|\n next if file_name.start_with?(@proc_dir)\n logger.info \"new file: #{file_name}\"\n info = process_image(file_name)\n info[:files].each do |file_info|\n key, content_type, file_name = file_info\n upload(key, file_name, content_type)\n end\n urls << info[:url]\n end\n unless urls.empty?\n Clipboard.copy urls.join(\"\\n\")\n if @args[:notify]\n title = urls.length > 1 ?\n \"#{urls.length} files uploaded\" : \"File uploaded\"\n notify(title, urls.join(\"\\n\"))\n end\n end\n end\n Listen.to(@path,\n only: Regexp.new(\"(\\\\.%s)$\" % Sup::LEGAL_EXTENSIONS.join('|')),\n latency: @args.latency,\n force_polling: @args.force_polling,\n &callback).start\n\n logger.info \"watching #{@path} (use Ctrl-C to exit)\"\n trap(\"INT\") {exit}\n sleep\n end",
"title": ""
},
{
"docid": "762151e3921a255ef8c562a239f6a5c0",
"score": "0.6485008",
"text": "def reload\n pattern = File.join(File.dirname(__FILE__), 'mappings', '**', '*.rb')\n Dir.glob(pattern).each { |mapping| require mapping.chomp!('.rb') }\n end",
"title": ""
},
{
"docid": "bf5390d3118c29fe553d3c8cb6cee4f0",
"score": "0.64835405",
"text": "def find_new_files(path)\n reload_path(path, true)\n end",
"title": ""
},
{
"docid": "b2515865f85d9cf5e6d173b00c924c41",
"score": "0.6479182",
"text": "def watch_change\n until @stop\n start = Time.now.to_f\n files = modified_files([@directory], :all => true)\n @callback.call(files) unless files.empty?\n nap_time = @latency - (Time.now.to_f - start)\n sleep(nap_time) if nap_time > 0\n end\n end",
"title": ""
},
{
"docid": "b735f7cded18bde263133645220570ff",
"score": "0.6475374",
"text": "def reload\n Compat::UI.info \"method reload\"\n run_all\n end",
"title": ""
},
{
"docid": "bded3ce465352156639c623114df2cf8",
"score": "0.64734316",
"text": "def run_on_change(paths)\n restart\n end",
"title": ""
},
{
"docid": "bded3ce465352156639c623114df2cf8",
"score": "0.64734316",
"text": "def run_on_change(paths)\n restart\n end",
"title": ""
},
{
"docid": "43ecb130806583f5b3e3fed5942bebd1",
"score": "0.64725614",
"text": "def reload\n load @filename\n end",
"title": ""
},
{
"docid": "41dbad725d39016efbe9902a7dd7efa1",
"score": "0.64711696",
"text": "def reload!(print = true)\n puts 'Reloading ...' if print\n # Main project directory.\n root_dir = File.expand_path('..', __dir__)\n # Directories within the project that should be reloaded.\n reload_dirs = %w[lib]\n # Loop through and reload every file in all relevant project directories.\n reload_dirs.each do |dir|\n Dir.glob(\"#{root_dir}/#{dir}/**/*.rb\").each { |f| load(f) }\n end\n # Return true when complete.\n true\nend",
"title": ""
},
{
"docid": "3b8d0dd636326f6d3d5e43de188cc0d9",
"score": "0.64706415",
"text": "def watch( *glob )\n yield unless block_given?\n files = []\n loop do\n new_files = Dir[*glob].map {|file| File.mtime(file) }\n yield if new_files != files\n files = new_files\n sleep 0.5\n end\nend",
"title": ""
},
{
"docid": "13bea4ac76cc659347a83e54ff0728d6",
"score": "0.64632976",
"text": "def run_on_modifications(_paths)\n restart\n end",
"title": ""
},
{
"docid": "5607282836952cfee44fc6359db23288",
"score": "0.64596754",
"text": "def watch\n compile()\n # options = {:latency => 4, :no_defer => true }\n fsevent = FSEvent.new\n fsevent.watch SOURCE_DIR.to_s do |directories|\n puts \"Detected change inside: #{directories.inspect}\"\n \n Rake::Task[\"compile\"].reenable\n Rake::Task[\"compile\"].invoke\n end\n fsevent.run\n end",
"title": ""
},
{
"docid": "ca818cee1005f022ae36eefdd96823d2",
"score": "0.6459206",
"text": "def start\n load_app\n loop do\n sleep(@i)\n f1 = Array.new\n @files.each { |f| f1 << file_stat(f) } \n if !(f1 == @f0)\n puts (\"MONSTAR::File change... will restart #{@app} NOW (#{Time.now.to_s})\")\n puts \" * file change detected !!!\"\n # shut the process down\n kill_app\n puts \" * app process killed...\"\n @f0 = f1\n puts \" * file ctime stamp stored... restarting #{@app}\"\n # load a new process\n load_app\n puts \" * MONSTAR:: #{@app} restarted!\"\n end\n end\n Process.waitall\n end",
"title": ""
},
{
"docid": "7da8bcd83ecef2e3e1cf85038682368f",
"score": "0.6455702",
"text": "def reloader\n ::Piktur::EventedFileUpdateChecker\n .new([], paths) { |changes| ::Piktur::Reloader.on_change(changes) }\n .instance_exec { @pid = ::Process.pid if @pid != ::Process.pid; self }\n end",
"title": ""
},
{
"docid": "71c4dbc06caa14c462ab37375aae41e5",
"score": "0.6439197",
"text": "def reload \n load 'stock-objects/options.rb'\n load 'stock-objects/stock.rb'\n load 'services/stock_service.rb'\n load 'tools/tools.rb'\n load 'ui/graphs.rb'\nend",
"title": ""
},
{
"docid": "f5b87cfdec23cbeb456505c0cd547fc1",
"score": "0.64373064",
"text": "def reload!\n\tload_all './lib'\nend",
"title": ""
},
{
"docid": "4de2660deeecc29393abc0a2ac0c6442",
"score": "0.64282346",
"text": "def watch_change\n @watch_change = true\n until @stop\n if RbConfig::CONFIG['build'] =~ /java/ || IO.select([worker.to_io], [], [], @latency)\n break if @stop\n\n sleep(@latency)\n worker.process\n\n files = modified_files(@files.shift(@files.size).map { |f| File.dirname(f) }.uniq)\n @callback.call(files) unless files.empty?\n end\n end\n @watch_change = false\n end",
"title": ""
},
{
"docid": "3640a0a1319f1692fdde6df20485bd00",
"score": "0.64263153",
"text": "def reload_if_modified\n reload if modified?\n end",
"title": ""
},
{
"docid": "b7e05afec4e171ebbd8be1a1e7e0b578",
"score": "0.6426244",
"text": "def reload\n @related_resources.each {|resource| resource.unload}\n @related_files.each {|file| file.load}\n end",
"title": ""
},
{
"docid": "fe48c330dbffe3efc88ab59f6c30d3bf",
"score": "0.64226514",
"text": "def reload!\n SetupHandlers::LoadGameFiles.new.load_game_files!\n end",
"title": ""
},
{
"docid": "c0f94f0c351c93da8e9a5ff1cf74cdf0",
"score": "0.6414108",
"text": "def reload\n\t\t\trun_all if options[:all_on_start]\n\t\tend",
"title": ""
},
{
"docid": "03805444e3226cca0e377ffac7f6c579",
"score": "0.6406301",
"text": "def reload!\n load './lib/search_jobs/cli.rb'\n load './lib/search_jobs/jobs.rb'\n load './lib/search_jobs/scraper.rb'\nend",
"title": ""
},
{
"docid": "f20af457e9ce8494cac8f5e8a9f2b7c8",
"score": "0.64027715",
"text": "def update\n @files.each {|f| update_file(f) }\n end",
"title": ""
},
{
"docid": "0a00da4783fad6f32a662136c8d8c926",
"score": "0.63977075",
"text": "def reload!\n Object.send(:remove_const, :Kitchenw)\n path = File.expand_path(\"../\", __FILE__)\n Dir.glob(\"#{path}/**/*.rb\") { |f| load f }\nend",
"title": ""
},
{
"docid": "d1f7690dbac70623354ac0102b9e872e",
"score": "0.6387783",
"text": "def reload\n start\n end",
"title": ""
},
{
"docid": "378a723cac98ba7ef75b8e34fc37ab53",
"score": "0.63855857",
"text": "def all_reload_files\n files = Array[$0, *$LOADED_FEATURES]\n paths = Array['./', *$LOAD_PATH]\n\n unless [@files, @paths] == [files, paths]\n @files, @paths = files.dup, paths.dup\n\n @map = files.map{|file|\n if Pathname.new(file).absolute?\n file\n else\n path = paths.find{|pa|\n ex = File.expand_path(File.join(pa, file))\n File.exists?(ex)\n }\n File.expand_path(File.join(path, file)) if path\n end\n }.compact\n end\n\n @map.grep(class_trait[:reload_glob])\n end",
"title": ""
},
{
"docid": "f2a3df2ac759e8ac0d4480b540a3b1c7",
"score": "0.6383501",
"text": "def watch(folder)\n end",
"title": ""
},
{
"docid": "263403b71dcf25c95f1415481025ad7e",
"score": "0.63813853",
"text": "def run_on_changes(paths)\n run_all\n end",
"title": ""
},
{
"docid": "42c66d9c8d257dc8424c60a7713dce46",
"score": "0.6368356",
"text": "def run_on_change(paths)\n return true if @serious_issue\n reload_tab = false\n paths.each do |path|\n case path\n when /\\.css$/ then reload_css(path)\n when /\\.js$/ then reload_js(path)\n else reload_tab = true\n end\n end\n reload_current_tab(paths) if reload_tab\n end",
"title": ""
},
{
"docid": "7114d02bd3cd8f5e09538867f0ab0049",
"score": "0.63658196",
"text": "def watch(directory)\n worker.watch(directory, :all_events, :recursive) do |event|\n paths = [File.expand_path(event.watcher.path)]\n files = modified_files(paths, :all => true)\n @callback.call(files) unless files.empty?\n end\n end",
"title": ""
},
{
"docid": "64ca345ab34363763deda61793021e4e",
"score": "0.6360726",
"text": "def reload\n load __FILE__\nend",
"title": ""
},
{
"docid": "6bb7db79bddf9ae8b33a7b12797849d1",
"score": "0.63584256",
"text": "def run_all\n run_on_changes files.reject {|f| partial?(f) }\n end",
"title": ""
},
{
"docid": "6bb7db79bddf9ae8b33a7b12797849d1",
"score": "0.63584256",
"text": "def run_all\n run_on_changes files.reject {|f| partial?(f) }\n end",
"title": ""
}
] |
eb27fd75892ca9bcf91983c3bf92db5b
|
If we are doing discovery based on a central tuplespace
|
[
{
"docid": "ef245b9ef72735644bb903e64ab97586",
"score": "0.80496293",
"text": "def central_discovery?; !!@discovery_tuplespace end",
"title": ""
}
] |
[
{
"docid": "81025efc10fd7495a2d80b11f1f1ba20",
"score": "0.56644845",
"text": "def check_for_tuple(tuple)\n if @sourcce\n # should check if +tuple+ has the same size as description\n if @result_map\n # need to expand\n unless @expand_map\n @expand_map = @source.description.collect do |name|\n index = @description.find_index do |n2| name == n2 end\n end\n end\n up_tuple = @expand_map.collect do |i| i nil? ? nil : tuple[i] end\n else\n up_tuple = tuple\n end\n @source.check_for_tuple(up_tuple)\n end\n end",
"title": ""
},
{
"docid": "345d24ec4f1c364c63d82e5a11b3fde6",
"score": "0.54939204",
"text": "def is_adc_node\n val = false\n nodes = adc_nodes\n nodes.each do |n|\n if n['hostname'] == node['hostname']\n val = true\n break\n end\n end\n val\nend",
"title": ""
},
{
"docid": "db8b850e6099fd19edde2cb1e87fdb05",
"score": "0.5466282",
"text": "def check_tuple_space_servers\n @tuple_space_server_lock.synchronize do\n @tuple_space_servers.select! do |ts|\n begin\n timeout(1) { ts.ping }\n rescue Exception\n false\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5f62f286911d9221542a52443ac2858d",
"score": "0.54061604",
"text": "def each_tuple_space\n return enum_for __method__ unless block_given?\n\n @ring_finger.lookup_ring do |tuple_space|\n yield tuple_space\n end\n end",
"title": ""
},
{
"docid": "e56eb279410b56a655abab3a34f3b085",
"score": "0.53966373",
"text": "def enumerate_tuple_spaces\n Thread.start do\n loop do\n @ring_finger.lookup_ring do |tuple_space|\n yield tuple_space\n end\n end\n end\n end",
"title": ""
},
{
"docid": "07b3c9f0bcfeb0046de4ac6d1a0ed5f4",
"score": "0.5300653",
"text": "def ring_discovery?; @ring_discovery end",
"title": ""
},
{
"docid": "3f7a9ef1b4443afbbe18cc4fb9b9e6c9",
"score": "0.52965975",
"text": "def searchForTarget\n @run.society.each_node do |node|\n mgmtComp = false\n node.each_facet(:role) do |facet|\n if facet[:role] == $facetManagement ||\n facet[:role] == $facetSubManagement ||\n facet[:role] == $facetRootManagement ||\n facet[:role] == 'RootCertificateAuthority' ||\n facet[:role] == 'CertificateAuthority' ||\n facet[:role] == 'RedundantCertificateAuthority' ||\n facet[:role] == 'AR-Management'\n mgmtComp = true\n break \n end \n end\n if mgmtComp == false\n #logInfoMsg \"found first non-security node: #{node.name}\"\n # get the enclave for this node\n @enclave = node.host.get_facet(:enclave).capitalize\n #logInfoMsg \"enclave: #{@enclave}\"\n @pdm = \"#{@enclave}PolicyDomainManager\"\n #logInfoMsg \"pdm: #{@pdm}\"\n node.each_agent do |agent|\n # get the first agent from this node\n @attackAgent = agent\n saveAssertion('Stress1e1', \"Found attack agent: #{@attackAgent.name}\" )\n return\n end \n end # if securityComp == false\n end # @run.society.each_node\nend",
"title": ""
},
{
"docid": "09a9ca640388fe7b6768978655d6fe70",
"score": "0.528634",
"text": "def check_for_tuple(tuple)\n if @sourcce\n # should check if +tuple+ has the same size as description\n if @result_map\n rtuple = @result_map.collect do |i| tuple[i] end\n else\n rtuple = tuple\n end\n if @block.call(*rtuple)\n @source.check_for_tuple(tuple)\n end\n end\n end",
"title": ""
},
{
"docid": "e2518e92a0c34247aae8f5d14451bb4f",
"score": "0.52833676",
"text": "def tuple_space\n unless @tuple_space \n DRb.start_service\n ring_server = Rinda::RingFinger.primary\n\n ts = ring_server.read([:name, :TupleSpace, nil, nil])[2]\n @tuple_space = Rinda::TupleSpaceProxy.new ts\n end\n @tuple_space\n end",
"title": ""
},
{
"docid": "887c5f27b4e7447cb1d3674cc29a8d82",
"score": "0.5243294",
"text": "def expand_cluster tuple,cluster_id,epsilion,min_points\n seeds = region_query tuple,epsilion\n\t\tif (seeds.size < min_points)\n set_cluster_nr_of_tuple tuple,0\n return false\n else\n change_cluster_id seeds,cluster_id\n seeds.delete(tuple)\n\t\t\twhile seeds.size!=0\n current_tuple = seeds.first\n\t\t\t\tresult = region_query current_tuple,epsilion\n\t\t\t\tif result.size>=min_points\n result.each do |result_tuple|\n if (get_cluster_nr_of_tuple result_tuple) ==0 || (get_cluster_nr_of_tuple result_tuple)==-1\n if (get_cluster_nr_of_tuple result_tuple)==-1\n seeds.push result_tuple\n end\n\t\t\t\t\t\t\tset_cluster_nr_of_tuple result_tuple,cluster_id\n end\n end\n end\n\t\t\t seeds.delete(current_tuple)\n end\n end\n \treturn true\n end",
"title": ""
},
{
"docid": "2728f782da9c5bbaaa05f784909b2ecd",
"score": "0.52193236",
"text": "def find_via(loc1, loc2)\n\t\tif(@fourth.locations.include?(loc1) && @fourth.locations.include?(loc2))\n\t\t\treturn @fourth\n\t\telsif (@foo.locations.include?(loc1) && @foo.locations.include?(loc2))\n\t\t\treturn @foo\n\t\telsif (@bar.locations.include?(loc1) && @bar.locations.include?(loc2))\n\t\t\treturn @bar\n\t\telsif (@fifth.locations.include?(loc1) && @fifth.locations.include?(loc2))\n\t\t\treturn @fifth\n\t\telse\n\t\t\treturn(false)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3fce938c033c1175629fa3675996da5d",
"score": "0.5206894",
"text": "def get_isprimary\n\tnodesprimary = @parsed[\"routing_nodes\"][\"nodes\"]\n\treturn nodesprimary\nend",
"title": ""
},
{
"docid": "1531da08690ee3342051d65c03337ff7",
"score": "0.51582885",
"text": "def known_location?\n\t\t( @source == :spot ) or ( @source == :waypoint )\n\tend",
"title": ""
},
{
"docid": "dd634988bef3cbda8a94486413375360",
"score": "0.5119332",
"text": "def lookup; end",
"title": ""
},
{
"docid": "dd634988bef3cbda8a94486413375360",
"score": "0.5119332",
"text": "def lookup; end",
"title": ""
},
{
"docid": "9421a360fea7e39b03a7d33238add4e4",
"score": "0.50901204",
"text": "def station_exists line, station\n return get_subway[line][:stops].include? station\nend",
"title": ""
},
{
"docid": "e5d087a9a0d1613e29a52e14c8c4100e",
"score": "0.50849533",
"text": "def offset_provided?(node); end",
"title": ""
},
{
"docid": "fefc1f06b669f4d83e4146f20d00e0aa",
"score": "0.5083601",
"text": "def isKnown( relation, a, b)\n if (relation[a][b] == 1)\n return true\n end\n return false\nend",
"title": ""
},
{
"docid": "ea048089798665c72b01898c9a4393b9",
"score": "0.5076267",
"text": "def empty_lookup; end",
"title": ""
},
{
"docid": "ea048089798665c72b01898c9a4393b9",
"score": "0.5076267",
"text": "def empty_lookup; end",
"title": ""
},
{
"docid": "88de7854e4fee5d4e5bf934abbf81f4d",
"score": "0.5071914",
"text": "def space\n @@space ||= Rinda::TupleSpaceProxy.new(Rinda::RingFinger.primary)\n end",
"title": ""
},
{
"docid": "444bc046ff612e6141289860c9ef27f6",
"score": "0.5049821",
"text": "def next_station_exists?\n @station_idx != @route.stations.size + 1\n end",
"title": ""
},
{
"docid": "949863624efe90ffd7c6d8cd88a84feb",
"score": "0.5046907",
"text": "def test_defined?(query)\n locations = find_locations(query)\n not locations.empty?\n end",
"title": ""
},
{
"docid": "5930761249ad935482b7956d18120e62",
"score": "0.5045926",
"text": "def lookups; end",
"title": ""
},
{
"docid": "b8871dad61020291506f741e359b13bd",
"score": "0.5033367",
"text": "def reflection_at?(x, y) ; REFLECTION_TERRAIN_TAGS.include?(terrain_tag(x, y)) end",
"title": ""
},
{
"docid": "e6e90280e6418c511a939fde63c9dea8",
"score": "0.50121313",
"text": "def is_location(it)\n\t\tnodes = []\n\t\twhile nodes.size < 5 and it.hasNext\n\t\t\tlabel = it.next.label.to_s\n\t\t\tif label.match(/[A-Z]{2,3}/)\n\t\t\t\tnodes << label\n\t\t\t\tbreak\tif nodes.size == 4 and label == \"NNP\" # Stop matching, successful\n\t\t\tend\n\t\tend\n\t\n\t\t[[\"PP\", \"IN\", \"NP\", \"NNP\"],\n\t\t [\"PP\", \"TO\", \"NP\", \"NNP\"],\n\t\t [\"PP\", \"IN\", \"NP\", \"NP\", \"NNP\"],\n\t\t [\"PP\", \"IN\", \"NP\", \"DT\", \"NNPS\"], # the netherlands :x\n\t\t [\"PP\", \"TO\", \"NP\", \"NP\", \"NNP\"],\n\t\t [\"PP\", \"IN\", \"NP\", \"DT\", \"NNP\"]].include? nodes\n\tend",
"title": ""
},
{
"docid": "b66f998b59a9edbd636ada9ac73ab89f",
"score": "0.5002595",
"text": "def cluster_exists?\n not (search(:node, 'recipes:ceph\\:\\:mon').empty?)\n end",
"title": ""
},
{
"docid": "d6352b069f0865e5a5c5601a3de59db1",
"score": "0.4996067",
"text": "def auto_discover\n # #YELLOW\n # this will only work for a single namespace as of now\n mount_info = find_mnt_pts.split(\"\\n\")\n warning 'No mount points found' if mount_info.length == 0\n # #YELLOW\n # I want to map this to make eaiser to read for large filesystems\n puts 'This is a list of mount_pts and their current \\\n status: ', mount_info if config[:debug]\n rw_in_proc?(mount_info)\n rw_test?(mount_info)\n puts \"The critical mount points according to proc \\\n are: #{ @crit_pt_proc }\" if config[:debug]\n puts \"The critical mount points according to actual testing \\\n are: #{ @crit_pt_test }\" if config[:debug]\n end",
"title": ""
},
{
"docid": "e93c6d89f19436287332a24e5bf45e70",
"score": "0.496575",
"text": "def topic_found?(topics, topic_arn)\n topics.each do |topic|\n return true if topic.topic_arn == topic_arn\n end\n return false\nend",
"title": ""
},
{
"docid": "21f3b0a05df139f59caefccc4ebe5f35",
"score": "0.4948869",
"text": "def connected_to?(role:, shard: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "298dc181d513706acb3ec17182b0a7bd",
"score": "0.49393407",
"text": "def update_tuple_space_servers(tuple_space_servers)\n @tuple_space_server_lock.synchronize do\n del_targets = @tuple_space_servers - tuple_space_servers\n add_targets = tuple_space_servers - @tuple_space_servers\n\n # bye\n #del_targets.each do |ts_server|\n # ts_server.write(Tuple[:bye].new(agent_type: agent_type, uuid: uuid))\n #end\n # hello\n #add_targets.each do |ts_server|\n # ts_server.write(Tuple[:agent].new(agent_type: agent_type, uuid: uuid))\n #end\n\n # update\n @tuple_space_servers = tuple_space_servers\n\n if Global.show_presence_notifier\n timeout(1) do\n puts \"broker's tuple space servers: %s\" % [@tuple_space_servers]\n end\n end\n end\n rescue Exception\n check_tuple_space_servers\n end",
"title": ""
},
{
"docid": "ce212647169473af67c03d6009c840cb",
"score": "0.49337488",
"text": "def check_graph\n @graph.each_pair do | state, neighbours |\n neighbours.each do | neighbour |\n if @graph[ neighbour ].nil?\n puts \"no graph entry for #{neighbour.to_s}\"\n elsif !@graph[ neighbour ].include?( state )\n puts \" #{state.to_s} -> #{neighbour.to_s} exists, but not #{neighbour.to_s} -> #{state.to_s}\" \n end\n end\n end\n end",
"title": ""
},
{
"docid": "5fc490ea42c10c6d49c4f7b01169a416",
"score": "0.49276426",
"text": "def station_correcto?(base)\n base.is_a? SpaceStation\n end",
"title": ""
},
{
"docid": "62f91db6016089610c46758be86e180e",
"score": "0.49190247",
"text": "def neighbour_discovery\n\t\tThread.current.priority = 2\n\n\t\tdiscovered = []\n\n\t\t# Initialize so that @discovery_start == discovery_start\n\t\t@discovery_start = nil\n\t\tdiscovery_start = nil\n\t\tfinger\t = nil\n\t\tloop do\n\t\t return if @quit_neighbour_thread\n\n\t\t Roby.synchronize do\n\t\t\told_neighbours, @neighbours = @neighbours, []\n\t\t\tfor new in discovered\n\t\t\t unless new.remote_id == remote_id || @neighbours.include?(new)\n\t\t\t\t@neighbours << new\n\t\t\t\tunless old_neighbours.include?(new)\n\t\t\t\t new_neighbours << [self, new]\n\t\t\t\tend\n\t\t\t end\n\t\t\tend\n\t\t\tdiscovered.clear\n\t\t end\n\n\t\t connection_listeners.each { |listen| listen.call(self) }\n\t\t synchronize do\n\t\t\t@last_discovery = discovery_start\n\t\t\tfinished_discovery.broadcast\n\n\t\t\twhile @discovery_start == @last_discovery\n\t\t\t start_discovery.wait(mutex)\n\t\t\tend\n\t\t\treturn if @quit_neighbour_thread\n\t\t\tdiscovery_start = @discovery_start\n\t\t end\n\n\t\t from = Time.now\n if ring_discovery? && (!finger || (finger.port != discovery_port))\n finger = Rinda::RingFinger.new(ring_broadcast, discovery_port)\n end\n\t\t if central_discovery?\n\t\t\tdiscovery_tuplespace.read_all([:droby, nil, nil]).\n\t\t\t each do |n| \n\t\t\t\tnext if n[2] == remote_id\n\t\t\t\tn = Neighbour.new(n[1], n[2]) \n\t\t\t\tdiscovered << n\n\t\t\t end\n\t\t end\n\n\t\t if ring_discovery?\n if discovery_period\n remaining = (@discovery_start + discovery_period) - Time.now\n end\n\n\t\t\tfinger.lookup_ring(remaining) do |cs|\n\t\t\t next if cs == self\n\n\t\t\t discovered << Neighbour.new(cs.name, cs.remote_id)\n\t\t\tend\n\t\t end\n\t\tend\n\n\t rescue Interrupt\n\t rescue Exception => e\n\t\tDistributed.fatal \"neighbour discovery died with\\n#{e.full_message}\"\n\t\tDistributed.fatal \"Peers are: #{Distributed.peers.map { |id, peer| \"#{id.inspect} => #{peer}\" }.join(\", \")}\"\n\n\t ensure\n\t\tDistributed.info \"quit neighbour thread\"\n\t\tneighbours.clear\n\t\tnew_neighbours.clear\n\n\t\t# Force disconnection in case something got wrong in the normal\n\t\t# disconnection process\n\t\tDistributed.peers.values.each do |peer|\n\t\t peer.disconnected! unless peer.disconnected?\n\t\tend\n\n\t\tsynchronize do\n\t\t @discovery_thread = nil\n\t\t finished_discovery.broadcast\n\t\tend\n\t end",
"title": ""
},
{
"docid": "ce07e1b571178d6bed4e4f787b729ccb",
"score": "0.49167958",
"text": "def lookup\n\n end",
"title": ""
},
{
"docid": "39eb66f25da37182575159b1ab697ae0",
"score": "0.49153307",
"text": "def used_anywhere?\n # check the changes table to see if this location is being used \n # for more than one change, so really this should be called\n # used_in_more_than_one_place?\n places_used = 0\n loc_changes = Change.find(:all, :conditions => {:new_value => self.id, :change_type => [Change::PERSON_LOCATION, Change::PERSON_MAIN_LOCATION]})\n places_used += loc_changes.length\n # Ah, but also need to check people, items and destinations!\n person_array = Person.find(:all, :conditions => {:id => self.person_id})\n places_used += person_array.length\n item_array = Item.find(:all, :conditions => {:id => self.item_id})\n places_used += item_array.length\n status_array = Status.find(:all, :conditions => {:id => self.status_id})\n places_used += status_array.length\n destination_array = Destination.find(:all, :conditions => {:location_id => self.id})\n places_used += destination_array.length\n if places_used >= 1\n retval = true\n else\n retval = false\n end\n retval\n end",
"title": ""
},
{
"docid": "d204d74550fba96bd4052719f965e85d",
"score": "0.4915139",
"text": "def next_station_available?\n last_station_index = @route.stations.length - 1\n current_station_index != last_station_index\n end",
"title": ""
},
{
"docid": "0a8f49c69c00fd8da983bed21a3eb20a",
"score": "0.49147102",
"text": "def tuple_space_server\n @__tuple_space_server__\n end",
"title": ""
},
{
"docid": "d452afeed4388cbd6ba62a26c0d6bb1a",
"score": "0.49041104",
"text": "def is_fragm_conn(ai, af, bi, bf)\n\n #using java range objects from appache commmons\n rng_a = JavaRange.between(ai.to_java,af.to_java)\n rng_b = JavaRange.between(bi.to_java,bf.to_java)\n\n connect_frag = false\n \n if rng_a.is_overlapped_by(rng_b)\n #connect overlapping fragments\n connect_frag = true\n puts \"rng_a: #{rng_a}, ----- intersection ---- #{rng_a.intersection_with(rng_b)} ---- rng_b: #{rng_b} \"\n elsif rng_a.is_before_range(rng_b)\n #connect non-overlaping near fragments\n dist = rng_b.get_minimum() - rng_a.get_maximum()\n connect_frag = true if dist <= @epsilon_dist_frag\n puts \"rng_a: #{rng_a}, ----before ---dist: #{dist} ---- rng_b: #{rng_b} \"\n\n elsif rng_a.is_after_range(rng_b)\n #connect non-overlaping near fragments\n dist = rng_a.get_minimum() - rng_b.get_maximum()\n connect_frag = true if dist <= @epsilon_dist_frag\n puts \"rng_a: #{rng_a}, ----after ---dist: #{dist} ---- rng_b: #{rng_b} \"\n\n end\n\n puts \"connected: #{connect_frag}\"\n return connect_frag\n\n\n end",
"title": ""
},
{
"docid": "e980f4a96d5ababc2d9dd609ad177ec1",
"score": "0.4901542",
"text": "def find service_name\n found = nil\n\n each_tuple_space.any? do |ts|\n tuples = ts.read_all [:name, nil, DRbObject, nil]\n\n found = tuples.find do |_, found_service_name, service, _|\n begin\n next unless found_service_name == service_name\n\n if DRbObject === service then\n service.method_missing :object_id # ping service for liveness\n else\n service\n end\n rescue DRb::DRbConnError\n next\n rescue NoMethodError\n next\n end\n end\n end\n\n raise \"unable to find service #{service_name.inspect}\" unless found\n\n found[2]\n end",
"title": ""
},
{
"docid": "4d3ea40f519f641d20e67deb164b1274",
"score": "0.488896",
"text": "def geo_replication; end",
"title": ""
},
{
"docid": "acf5ce6a07b808bf365c956951b27d19",
"score": "0.48849887",
"text": "def decide(knowns)\n\n\n end",
"title": ""
},
{
"docid": "f25613c355d7e566fca9af376349974d",
"score": "0.4875852",
"text": "def check_graph\r\n @graph.each_pair do | state, neighbours |\r\n neighbours.each do | neighbour |\r\n if @graph[ neighbour ].nil?\r\n puts \"no graph entry for #{neighbour.to_s}\"\r\n elsif !@graph[ neighbour ].include?( state )\r\n puts \" #{state.to_s} -> #{neighbour.to_s} exists, but not #{neighbour.to_s} -> #{state.to_s}\"\r\n end\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "e6ba822bbc8c1be62faa38f51307340c",
"score": "0.48702216",
"text": "def has_region? \n\t\tnot @square.neighbor(@next_dir).region.nil?\n\tend",
"title": ""
},
{
"docid": "41e22f3fe8b54ab175adffaa5c69688b",
"score": "0.48683098",
"text": "def find_primary\n # We can see who's in cluster from @status\n if am_i_in_the_cluster?\n primary_search_res = @status['members'].find{|i| i['stateStr'] == STATE_PRIMARY_STR}\n return primary_search_res['name'].split(':').first if primary_search_res\n end\n\n # Otherwise we have to see if someone else knows...\n etags = Ec2Tag2Instance.new\n etags.get_other_mongo_dns_endpoints.each do |node|\n r_status = mcmd('rs.status()', node)\n next unless r_status\n next unless r_status.key?('members')\n return unless primary_search_res = r_status['members'].find{|i| i['stateStr'] == STATE_PRIMARY_STR}\n return primary_search_res['name'].split(':').first\n end\n\n # didn't find a primary master\n return nil\n end",
"title": ""
},
{
"docid": "3dc3ca0d3a4974cfd61aefb1dfbbbbe3",
"score": "0.48676735",
"text": "def exists?\n # TODO: network_name should be defaulted, but we havn't found how to do that in a type definition.\n @loader = ::Pinas::Compute::Provider::Loader\n @computeservice = ::Pinas::Compute::Provider::Compute\n network_name = @loader.get_network_name(@resource[:server_template])\n @networkservice = (network_name != nil ) ? @loader.get_network(@resource[:server_template]) : nil\n pinas = @computeservice.instance(@loader.get_compute, @networkservice)\n\n Puppet.notice \"checking if nodes #{@resource[:nodes]} exist.\"\n\n @resource[:nodes].each do |server|\n server_name = get_servername(server)\n server_found = pinas.server_exist?(server_name)\n return false if !server_found\n end\n Puppet.notice \"all nodes found, for instance : #{@resource[:instance_id]}\"\n return true\n end",
"title": ""
},
{
"docid": "6fae5769c5cd1b9f9d67e897e79b6749",
"score": "0.48670188",
"text": "def get_tuple_space_server(address)\n ref = DRbObject.new_with_uri(address)\n ref.ping\n ref.tuple_space_server\n end",
"title": ""
},
{
"docid": "2385c237b162a6041865b460859ea65d",
"score": "0.4865685",
"text": "def location_information?\n [:site, :building, :room, :freezer, :shelf, :box, :box_position].detect { |l| self.send(l).present? }\n end",
"title": ""
},
{
"docid": "956eb61d8cec6e6520f62273d55562d0",
"score": "0.48482242",
"text": "def connected?(spec_name, role: T.unsafe(nil), shard: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "2693c5497a0e2fcfcf7521e538ecfb36",
"score": "0.48316833",
"text": "def test_connections\n @doors.all? do |k, v|\n v[-1] ? v[-1].leads_to?(self.class, k): true\n end\n end",
"title": ""
},
{
"docid": "fba59d9a462b16b11846e675d87f88b4",
"score": "0.48298854",
"text": "def consistent_topology(group_of_four)\n topologies(group_of_four).detect { |topology| consistent_with?(topology) }\n end",
"title": ""
},
{
"docid": "7dc6e057da9dde35e340ff1148a34ad6",
"score": "0.4822147",
"text": "def topology_start; end",
"title": ""
},
{
"docid": "6c5d3b87c852b88ec19be73432ca0eaf",
"score": "0.48220658",
"text": "def probe_tables\n if Jetpants.topology.shards.first == self\n super\n else\n Jetpants.topology.shards.first.probe_tables\n end\n end",
"title": ""
},
{
"docid": "1dff9bc5a16196072f20c83089e9f282",
"score": "0.48196393",
"text": "def location_match(pair)\n pair[0].distance_from(pair[1]) <= 1.0\n end",
"title": ""
},
{
"docid": "37152f4fee858bd6fbcdbc5db0554f17",
"score": "0.48188105",
"text": "def next_station_available?\n current_station_index != @route.stations.length - 1\n end",
"title": ""
},
{
"docid": "865f401f50fa614bbf99ff810976d9fd",
"score": "0.48187846",
"text": "def scanSub()\n XML::XPath.each(@xml,\"dia:connections/dia:connection\"){|connection|\n handle = connection.attribute('handle').value() ;\n connectTo = connection.attribute('to').value() ;\n case(handle)\n when(\"0\") ; @from = connectTo ;\n when(\"1\") ; @to = connectTo ;\n else\n raise \"unknown connection handle:#{handle} in #{self}\" ;\n end\n }\n# p [:generalization, @from, @to] ;\n end",
"title": ""
},
{
"docid": "63695e37dbac1a71280fea8f40022c64",
"score": "0.4815287",
"text": "def found_cluster(jvalue)\n if jvalue['nodes'].length > 1\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "52c447bad8e66e8eda66fd71b80d5f2e",
"score": "0.48113835",
"text": "def is_fragm_conn(ai, af, bi, bf)\n\n #using java range objects from appache commmons\n rng_a = JavaRange.between(ai.to_java,af.to_java)\n rng_b = JavaRange.between(bi.to_java,bf.to_java)\n\n connect_frag = false\n \n if rng_a.is_overlapped_by(rng_b)\n #connect overlapping fragments\n connect_frag = true\n #puts \"rng_a: #{rng_a}, ----- intersection ---- #{rng_a.intersection_with(rng_b)} ---- rng_b: #{rng_b} \"\n elsif rng_a.is_before_range(rng_b)\n #connect non-overlaping near fragments\n dist = rng_b.get_minimum() - rng_a.get_maximum()\n connect_frag = true if dist <= @epsilon_dist_frag\n #puts \"rng_a: #{rng_a}, ----before ---dist: #{dist} ---- rng_b: #{rng_b} \"\n\n elsif rng_a.is_after_range(rng_b)\n #connect non-overlaping near fragments\n dist = rng_a.get_minimum() - rng_b.get_maximum()\n connect_frag = true if dist <= @epsilon_dist_frag\n #puts \"rng_a: #{rng_a}, ----after ---dist: #{dist} ---- rng_b: #{rng_b} \"\n\n end\n\n #puts \"connected: #{connect_frag}\"\n return connect_frag\n\n\n end",
"title": ""
},
{
"docid": "62c6c07a95da99b95465d88330afd2e5",
"score": "0.4808061",
"text": "def get_adc_backend_federated_nodes\n results = []\n # Get the list of backend servers\n nodes = node['cepheus']['adc']['backend']['servers']\n servers = node['cepheus']['cobbler']['servers']\n nodes.each do | bes |\n servers.each do | server |\n if server['name'] == bes['name']\n svr = {}\n svr['name'] = server['name']\n svr['ip'] = server['network']['public']['ip']\n svr['type'] = bes['type']\n svr['instance'] = bes['instance']\n svr['port'] = bes['port']\n svr['weight'] = bes['weight']\n svr['options'] = bes['options']\n results.push(svr)\n end\n end\n end\n results\nend",
"title": ""
},
{
"docid": "f7c6e7da8f0c9d7b76cd993f7be093cb",
"score": "0.4804731",
"text": "def clusterize epsilion,min_number_of_points\n prepare_dataset\n cluster_id=1\n @working_dataset.dataset.each do |tuple|\n if (get_cluster_nr_of_tuple(tuple)==-1)\n if expand_cluster tuple,cluster_id,epsilion,min_number_of_points\n cluster_id=cluster_id+1\n end\n end\n end\n return @clustered_dataset\n end",
"title": ""
},
{
"docid": "43d403ee545c9922c2a2ddce908b1f3c",
"score": "0.48019734",
"text": "def any_keys_found?; end",
"title": ""
},
{
"docid": "24b1c6a1396ae808ee8c934c592300a1",
"score": "0.4789027",
"text": "def legal_to_start?(corporation)\n return false if @lner\n return true if corporation.tokens.first&.used\n\n hex = hex_by_id(corporation.coordinates)\n city = hex.tile.cities.first\n city.tokenable?(corporation, free: true) || upgrade_tokenable?(hex)\n end",
"title": ""
},
{
"docid": "7ce0853e0ce0df8605f17f427d7f4194",
"score": "0.47814986",
"text": "def complete?\n stations = map.tile_objects.select { |x| x.is_a?(Entities::StationObject) }\n station_pairs = stations.group_by(&:number)\n\n station_pairs.each do |_, (a, b)|\n if connects?(a.point.moved(a.orientation), b.point.moved(b.orientation))\n return true\n end\n end\n\n false\n end",
"title": ""
},
{
"docid": "465b38f4637772bfb006dc707fdd8476",
"score": "0.47810504",
"text": "def suitable_member_of_node(node)\n config.logger&.debug(\n \"Starting to discover #{node.host}:#{node.port} node for candidates.\"\n )\n members = node_members(node)\n return unless members\n\n suitable_member = detect_suitable_member(members)\n return unless suitable_member\n\n config.logger&.debug(\n \"Found suitable member: #{suitable_member.host}:#{suitable_member.port} with \" \\\n \"role \\\"#{suitable_member.state}\\\".\"\n )\n suitable_member\n end",
"title": ""
},
{
"docid": "e832c9e279924d2b91a893ad3ccdb768",
"score": "0.4777892",
"text": "def is_nmap_scan?(packet)\n return contains_nmap?(packet.payload)\nend",
"title": ""
},
{
"docid": "ee6140357d3ab3aced87ce71ad9992bd",
"score": "0.4774931",
"text": "def has_ele\n flag = false\n return if self.g_map_tracks.empty?\n self.g_map_tracks.each do |gmt|\n coord = gmt.coords.split(\" \")\n coord.each do |c|\n lng,lat,alt = c.split(\",\")\n if alt.to_f != 0\n flag = true\n break\n end\n end\n end\n flag\n end",
"title": ""
},
{
"docid": "217dccfd01993cd9e4a01d5ae18edc02",
"score": "0.4768555",
"text": "def region_query tuple,epsilion\n result = Array.new\n @working_dataset.dataset.each do |loop_tuple|\n \t if (@working_dataset.get_minkovski_distance_between_tuples(tuple,loop_tuple)) < epsilion\n\t\t\t\t\tresult.push loop_tuple\n end\n end\n \t return result\n end",
"title": ""
},
{
"docid": "b57c6f60a0a988c8a99c599754a9d616",
"score": "0.4749738",
"text": "def search_nodes(deployment_state)\n found_nodes = []\n\n deployment_id = deployment_state.manifest.id\n\n servers = compute.servers.all\n servers.each do |server|\n server_deployment_id = server.metadata.find { |m| m.key == 'askr_deployment_id' }\n server_cloud_name = server.metadata.find { |m| m.key == 'askr_cloud_name' }\n server_rsource_pool_name = server.metadata.find { |m| m.key == 'askr_resource_pool_name' }\n server_job_name = server.metadata.find { |m| m.key == 'askr_job_name' }\n server_job_index = server.metadata.find { |m| m.key == 'askr_job_index' }\n server_idle = server.metadata.find { |m| m.key == 'askr_idle' }\n\n if server_deployment_id\n if server_deployment_id.value == deployment_id\n if !server_idle.nil?\n found_nodes.push(\n Askr::IdleNode.new(\n deployment_state,\n self,\n\n server_cloud_name.value,\n server_rsource_pool_name.value,\n server.id\n )\n )\n elsif ![server_cloud_name, server_rsource_pool_name, server_job_name, server_job_index].include?(nil)\n node = Askr::ExistingNode.new(\n deployment_state,\n self,\n\n server_cloud_name.value,\n server_rsource_pool_name.value,\n server_job_name.value,\n server_job_index.value.to_i,\n server.id\n )\n # TODO: check availability\n # TODO: support multiple networks\n node.private_ip_address = server.addresses.first[1][0][\"addr\"]\n\n static_ips = addresses.find_all do |address|\n address.instance_id == server.id\n end\n node.static_ip_addresses = static_ips.map(&:ip)\n\n found_nodes.push(node)\n else\n # TODO: do more user friendly procedure\n fail \"Found an invalid server `#{server.id}`.\"\n end\n end\n end\n end\n\n found_nodes\n end",
"title": ""
},
{
"docid": "dee42cc0db186736031764f7661a5b46",
"score": "0.4747569",
"text": "def lookup(lat:, lng:)\n raise \"Numeric lat and lng required\" unless lat.is_a?(Numeric) && lng.is_a?(Numeric)\n\n point = @factory.point(lng, lat)\n match = @nta_neighborhoods.find{ |n| n.geometry.contains? point }\n return unless match\n\n match.properties\n end",
"title": ""
},
{
"docid": "2836c41a29ace862fd5c9ada312a015e",
"score": "0.4742807",
"text": "def check_for_tuple(tuple)\n raise \"Method 'check_for_tuple' is not implemented\"\n end",
"title": ""
},
{
"docid": "44e05404daa2720d1d79fc2715041b40",
"score": "0.47365737",
"text": "def find_nn_active(cm, cl)\n find_host_with_any_role(cm, cl, 'NN(A)')\n end",
"title": ""
},
{
"docid": "853513efd37249f2c8053d62f453193b",
"score": "0.47357035",
"text": "def known?(*nodes)\n nodes.reduce(true) { |result, name| result && name.present? && node?(name) }\n end",
"title": ""
},
{
"docid": "5ed98bc73d222aab2ec320ed22073be7",
"score": "0.47313344",
"text": "def standalone_discovered\n @topology = topology.standalone_discovered\n end",
"title": ""
},
{
"docid": "bbb17c13ee20465bfd75d228aa5871e1",
"score": "0.47307768",
"text": "def is_full?(i,j)\n @grid.connected? 0,get_index(i,j)+1 # offest by 1 for the virtual sites\n end",
"title": ""
},
{
"docid": "8a721d5282591890d73af64f049537e4",
"score": "0.4727242",
"text": "def has_cluster?( name )\n \n return @clusters.has_key?( name.to_sym )\n \n end",
"title": ""
},
{
"docid": "d1ad42bd86b985338050ed57187169ed",
"score": "0.47222725",
"text": "def run_neptune_in_cloud?(neptune_info)\n Djinn.log_debug(\"activecloud_info = #{neptune_info}\")\n return true if is_cloud? && !neptune_info[\"nodes\"].nil?\n return true if !is_cloud? && !neptune_info[\"nodes\"].nil? && !neptune_info[\"machine\"].nil?\n return false\n end",
"title": ""
},
{
"docid": "bf1529258ebcb7853a812cf3454b9dbe",
"score": "0.4714205",
"text": "def topology_exit; end",
"title": ""
},
{
"docid": "8f6114cb8f4d15449026c2e1a449767a",
"score": "0.4710084",
"text": "def check_final\n %w[Monroeville Downtown].include?(@driver.location(nil))\n end",
"title": ""
},
{
"docid": "57206cfa82a20e0f9c57589aac6d196c",
"score": "0.47085103",
"text": "def matched?(node_id); end",
"title": ""
},
{
"docid": "57206cfa82a20e0f9c57589aac6d196c",
"score": "0.47085103",
"text": "def matched?(node_id); end",
"title": ""
},
{
"docid": "5ad82001ac0851cd72d6260f8846e95c",
"score": "0.47045562",
"text": "def get_tuple_space(tuple_space_id)\n @tuple_space\n end",
"title": ""
},
{
"docid": "a6d965c727ad3be3a0f8007eca028d6e",
"score": "0.47005033",
"text": "def based_near\n descMetadata.has_location #.map(&:location_name).flatten\n end",
"title": ""
},
{
"docid": "65063022c3af4a555f178fd8321c9dec",
"score": "0.46991187",
"text": "def analyze_cluster (ids)\n # 2d hash where [doc + attr] -> vals\n # Refresh for each cluster.\n @doc_attr_vals = {};\n ids.each do |id|\n @doc_attr_vals[id] = {};\n id_args = ([id] * @tables.size);\n # Look up all the attribute values for each id in the ids array.\n @union_q.enumerate(*id_args) do |row|\n attr = row[:t];\n val = row[:str_id].to_i;\n doc = row[:gd_id].to_i;\n @doc_attr_vals[id][attr] ||= [];\n # Remember that doc 555 has title = 123.\n @doc_attr_vals[id][attr] << val;\n end\n if @doc_attr_vals.keys.size % 1000 == 0 then\n @log.d(\"Big cluster, #{@doc_attr_vals.keys.size} / #{ids.size}\");\n end\n end\n\n related = [];\n\n # Get related subset(s).\n get_related(ids, [], related);\n\n related.sort_by!{|x| x.size};\n related.each_with_index do |x,i|\n related.each_with_index do |y,j|\n next if i >= j;\n next if x.empty?;\n next if y.empty?;\n if (x - y).empty? then\n # Each set which is a subset of another is to be forgotten.\n # I.e. if we have {a,b,c,d,e}, {a,b} and {c,d} then forget {a,b} and {c,d}\n if Time.new() - @ping_t > 1 then\n # Don't ping more than once per second.\n @ping_t = Time.new();\n @ping_q.enumerate do |x|\n @log.d(\"Ping!\");\n end\n end\n x = [];\n end\n end\n end\n\n related.each do |r|\n next if r.empty?;\n # Print related to file.\n @rels.file.puts(\"related\\t#{r.join(',')}\");\n # Now let's get out the ones that are dups from each set.\n get_duplicates(r).each do |d|\n # Print dups to file, with score.\n s = Score.cluster(d, @doc_attr_vals);\n @dups.file.puts(\"duplicates\\t#{s}\\t#{d.join(',')}\");\n end\n end\nend",
"title": ""
},
{
"docid": "cb636e640211b8bae1d80932a95bc1fc",
"score": "0.46810108",
"text": "def discoverable?\n !has?(:shadowed_location_facet, 'UNDISCOVERABLE')\n end",
"title": ""
},
{
"docid": "9db7a8c3dfc46181494d784baba22072",
"score": "0.46800956",
"text": "def check_sync_id(node)\n # Create an empty array\n $to_sync = []\n # Hash containing Sync IDs. Format: \n # { index: { shard: { primary: $val, replicas: [ $val, $val ] } } }\n sync_ids = Hash.new\n # Create client object\n client = Elasticsearch::Client.new(host: node)\n # List of indices via cat api\n myindices = client.cat.indices h: 'i'\n # create array from string, split on newline\n myindices = myindices.split(\"\\n\")\n puts 'Checking sync ids'\n # For each index...\n myindices.each do |index|\n # Strip whitespace\n index = index.strip\n # Create a hash for this index to contain shards and their sync ids\n sync_ids[index] = Hash.new\n #puts \"Data for index '#{index}'\"\n # create object with index data\n stats = client.indices.stats index: index, level: 'shards'\n # For each shard id...\n stats['indices'][index]['shards'].each_key do |shardid|\n #puts \"Data for shard #{shardid}\"\n # Create the shardid hash to contain sync ids\n sync_ids[index][shardid] = Hash.new\n # This is my hacked way of getting the array id for reporting.\n iter = 0\n # Create an array for replica ids\n sync_ids[index][shardid]['replicas'] = Array.new\n # Each shard id contains an array of shards. For each one...\n stats['indices'][index]['shards'][shardid].each do |shard|\n #puts \"Stats for shard #{shardid}:#{iter}\"\n # This object contains the sync_id for this particular shard.\n sync_id_obj = shard['commit']['user_data']['sync_id']\n # If the shard has no sync_id, mark it\n if sync_id_obj.nil?\n #puts \"INDEX: #{index} SHARD: #{shardid}:#{iter} - missing sync_id!\"\n $to_sync.push(index)\n elsif shard['routing']['primary'] == true\n #puts \"#{index} primary shard sync_id = #{sync_id_obj}\"\n sync_ids[index][shardid]['primary'] = sync_id_obj\n else \n sync_ids[index][shardid]['replicas'].push(sync_id_obj)\n end\n iter = iter + 1\n # Now we check for ID consistency.\n end\n sync_ids[index][shardid]['replicas'].each do |replica|\n primary = sync_ids[index][shardid]['primary']\n # If the replica's sync ID doesn't match the primary shard's sync id...\n if replica != primary\n puts \" |- Mismatch on index #{index} shard #{shardid}\".red\n puts \" |- Primary: #{primary} Replica: #{replica}\".red\n # Add this index to the list of indices that need to be flushed.\n $to_sync.push(index)\n end\n end\n end\n end\n if $to_sync.any?\n puts \" |- Indices that need syncing:\".yellow\n puts \" |- #{$to_sync.uniq}\"\n end\nend",
"title": ""
},
{
"docid": "dfffbfc42add5d9fd875c88c96c6e08d",
"score": "0.46780574",
"text": "def possible_peers\n star_neighbors = []\n #Create an alternate universe\n new_universe = Universe.new\n #North \n star_neighbors << Star.new(new_universe,x,y+1)\n #Northeast \n star_neighbors << Star.new(new_universe,x+1,y+1)\n #Northwest \n star_neighbors << Star.new(new_universe,x-1, y+1)\n #South \n star_neighbors << Star.new(new_universe,x, y-1)\n #Southwest \n star_neighbors << Star.new(new_universe,x-1, y-1)\n #East \n star_neighbors << Star.new(new_universe,x+1, y) \n #Southeast \n star_neighbors << Star.new(new_universe,x+1, y-1)\n #West\n star_neighbors << Star.new(new_universe,x-1, y)\n star_neighbors\n end",
"title": ""
},
{
"docid": "d3650cda55de9f41b94b3a09793cadc1",
"score": "0.46777984",
"text": "def is_full?(row, col)\n site = @grid[row][col]\n @wqu.connected?(@virtual_top_id, site.index)\n end",
"title": ""
},
{
"docid": "1a54ab2b08fc230b2c2c3fc2e0f92bce",
"score": "0.46764192",
"text": "def test_get_node_fallback_to_first\n ring = ConsistentHashing::Ring.new [\"A\"], 1\n\n point = ring.point_for(@examples[\"not_found\"])\n\n assert_equal \"A\", point.node\n assert_not_equal 0, point.index\n end",
"title": ""
},
{
"docid": "92533fc0e0da152c295103872cd41c0d",
"score": "0.46760222",
"text": "def coordinates_available?(coords)\n return @board[coords[0]][coords[1]].nil?\n end",
"title": ""
},
{
"docid": "62e68c1d483e7cd3a5198cc743979a2a",
"score": "0.46724316",
"text": "def used_elsewhere?\n # check the changes table to see if this location is being used \n # for more than one change, so really this should be called\n # used_in_more_than_one_place?\n loc_changes = Change.find(:all, :conditions => {:new_value => self.id, :change_type => [Change::PERSON_LOCATION, Change::PERSON_MAIN_LOCATION]})\n if loc_changes.length >= 2\n retval = true\n else\n retval = false\n end\n retval\n end",
"title": ""
},
{
"docid": "8575cf9dbf4d3a260cfa7e80f77584f4",
"score": "0.4670529",
"text": "def spatial_search\n end",
"title": ""
},
{
"docid": "71883d2fc8465bdf877d80873aa61712",
"score": "0.4668843",
"text": "def existent; end",
"title": ""
},
{
"docid": "2c1d339ad14e8660852368a0fa7334f7",
"score": "0.4666292",
"text": "def available_point?(grid, y, x)\n grid[y][x].nil?\n end",
"title": ""
},
{
"docid": "1e5e3ee983d5ae9033fa5f706be0e8d6",
"score": "0.4660014",
"text": "def addrs; end",
"title": ""
},
{
"docid": "2540e39b4735e54db4e0c8a4ec74f679",
"score": "0.46576825",
"text": "def find(arg)\n key = arg.keys.first\n val = arg[key]\n\n clust = list.select {|cluster| cluster[\"#{key}\".to_sym] == val}.first\n\n if clust\n _clust = {}\n\n cluster = Cluster.new self.database\n clust.each_pair { |k,v| _clust[k] = v }\n\n return cluster.new _clust\n end\n nil\n end",
"title": ""
},
{
"docid": "929638ed27e602ff298db7978d7a3170",
"score": "0.46524218",
"text": "def same_entry\n # only if we found the ip in the first place\n # cause if we didn't then \n if @hosts_exists \n # we care about order here so if these things dont match force a rewrite/order\n # make sure we are comparing the same type\n return @entries.join(\" \") == cast_entries\n end \n false\nend",
"title": ""
},
{
"docid": "3c28003f2cd2b8f8c88c98310cdeca44",
"score": "0.46523172",
"text": "def check_if_has_primary\n unless topology.replica_set?\n raise ArgumentError, \"check_if_has_primary should only be called when topology is replica set, but it is #{topology.class.name.sub(/.*::/, '')}\"\n end\n\n primary = servers_list.detect do |server|\n # A primary with the wrong set name is not a primary\n server.primary? && server.description.replica_set_name == topology.replica_set_name\n end\n unless primary\n @topology = Topology::ReplicaSetNoPrimary.new(\n topology.options, topology.monitoring, self)\n end\n end",
"title": ""
},
{
"docid": "e70bf7cfd380a75639c39a37b38076fa",
"score": "0.46493432",
"text": "def used_by?(face_or_edge)\n end",
"title": ""
},
{
"docid": "4a709104e1e5095c0d33c3a7817b7ebc",
"score": "0.464788",
"text": "def other_offense_in_same_range?(node); end",
"title": ""
},
{
"docid": "557735e23d90225b0a029c2158878f3d",
"score": "0.46473753",
"text": "def force_discovery?\n @force_discovery\n end",
"title": ""
}
] |
e3d316a1a69e3ffa60e5240cc97af8d2
|
Find the entity attributes by name.
|
[
{
"docid": "6da2bdab3783ed2dc03f3ddca0848104",
"score": "0.0",
"text": "def find(name)\n storage.fetch(name) { not_found(name) }\n end",
"title": ""
}
] |
[
{
"docid": "f90652970ef1173a87ac30e749b77dc9",
"score": "0.7571359",
"text": "def find_attribute_named(name)\n @attributes.find { |m| m.name == name }\n end",
"title": ""
},
{
"docid": "37ff88e49aba9f5bc1a3c4013c598446",
"score": "0.6999628",
"text": "def with(name)\r\n @attributes.find { |attr| attr.name == name }\r\n end",
"title": ""
},
{
"docid": "1f42a48559b8b6bda502aa7828da3b40",
"score": "0.6973181",
"text": "def find_attribute_named(name)\n case name\n when /\\A#/ then\n find_attribute name[1..-1], false\n when /\\A::/ then\n find_attribute name[2..-1], true\n else\n @attributes.find { |a| a.name == name }\n end\n end",
"title": ""
},
{
"docid": "b55225826148e262a845ba0c7ec58335",
"score": "0.6756149",
"text": "def find_attributes(name)\n\t\t\tr=[]\n\t\t\tp=self\n\t\t\twhile(p)\n\t\t\t\tif(p.respond_to?(name))\n\t\t\t\t\tv=p.send(name)\n\t\t\t\t\tr << v if(v)\n\t\t\t\tend\n\t\t\t\tbreak if(!p.respond_to?(\"container\"))\n\t\t\t\tp=p.container\n\t\t\tend\n\t\t\tr\n\t\tend",
"title": ""
},
{
"docid": "20c4cf468f7ab57976799595c27a4e2b",
"score": "0.6682044",
"text": "def attribute(name)\n attributes[name]\n end",
"title": ""
},
{
"docid": "6bebb18ea20b677717f28fa1ba6166cc",
"score": "0.66458553",
"text": "def attribute(name)\n @attributes ||= {}\n @attributes[name]\n end",
"title": ""
},
{
"docid": "36f0b4718316dbd3176a41cb3c29b051",
"score": "0.65681416",
"text": "def attribute(name)\n return attributes[name]\n end",
"title": ""
},
{
"docid": "9fcd83d0ae582572e54381d0cab1916b",
"score": "0.65462446",
"text": "def get_attribute(name)\n @attributes[name.to_s]\n end",
"title": ""
},
{
"docid": "af212cbea97473b5804e4fa4c0a8ca59",
"score": "0.65429217",
"text": "def get_attribute(name)\n @attributes[name]\n end",
"title": ""
},
{
"docid": "6b861695cc8a8109b624f1441733f4c5",
"score": "0.64959",
"text": "def find_attributes_starting_with(name)\n @attributes.select { |key| key.to_s.start_with?(name) }\n end",
"title": ""
},
{
"docid": "c8a33d26e7f18fa51f61d9f959296ff8",
"score": "0.6472512",
"text": "def attribute(name)\n attributes.each { |a| return a if a.property.id == name }\n nil\n end",
"title": ""
},
{
"docid": "1307a15219a446b0c14f7a9f2ce2e687",
"score": "0.6432236",
"text": "def attribute(name)\n @attributes[name.to_sym]\n end",
"title": ""
},
{
"docid": "210e59e34caed8a07af3284f9f6a8f2a",
"score": "0.64276236",
"text": "def find_attribute(name)\n NetCDF::Attribute.new(@netcdf_elmt.findAttribute(name))\n end",
"title": ""
},
{
"docid": "5c38f11c2513117a65f38a4e818184d4",
"score": "0.64098126",
"text": "def get_attribute(name)\n return @attrs[name] if attrs.key?(name)\n end",
"title": ""
},
{
"docid": "ceeaf11c97b54665c665ddc6a21e7049",
"score": "0.63489014",
"text": "def [](name)\n attributes.fetch(name)\n end",
"title": ""
},
{
"docid": "24e68ab5a8b3899c8fa9d8d06e1c0dd3",
"score": "0.631553",
"text": "def [](name)\n attributes[canonical_name(name)]\n end",
"title": ""
},
{
"docid": "24e68ab5a8b3899c8fa9d8d06e1c0dd3",
"score": "0.631553",
"text": "def [](name)\n attributes[canonical_name(name)]\n end",
"title": ""
},
{
"docid": "b1f15f314c0ac3592a6413a188eac490",
"score": "0.6256683",
"text": "def find_team_attribute_definition(name, params={}, headers=default_headers)\n @logger.info(\"Finding the \\\"#{name}\\\" Team Attribute Definition\")\n get(\"#{@api_url}/teamAttributeDefinitions/#{encode(name)}\", params, headers)\n end",
"title": ""
},
{
"docid": "9af8679538fa9567b8a6fce539e45db2",
"score": "0.6210601",
"text": "def attributes\n query[ model_name ]\n end",
"title": ""
},
{
"docid": "2a3fcefb9d8e09eedc8c87c40f0be020",
"score": "0.62007403",
"text": "def read_attribute name\n @attributes[name.to_s]\n end",
"title": ""
},
{
"docid": "37bae572e9a9d8242a6dd5d071e8eef2",
"score": "0.6169347",
"text": "def read_attribute(name)\n fields[name].get(@attributes[name])\n end",
"title": ""
},
{
"docid": "3d51b166413d33f3ebddd1ec743a36fc",
"score": "0.6149715",
"text": "def get_attribute(name); end",
"title": ""
},
{
"docid": "3d51b166413d33f3ebddd1ec743a36fc",
"score": "0.6149715",
"text": "def get_attribute(name); end",
"title": ""
},
{
"docid": "17baef886e1de33e8d913523d1ae18e2",
"score": "0.6144518",
"text": "def find_datastore_form_attribute_definition(name, params={}, headers=default_headers)\n @logger.info(\"Finding the \\\"#{name}\\\" Datastore Form Attribute Definition\")\n get(\"#{@api_url}/datastoreFormAttributeDefinitions/#{encode(name)}\", params, headers)\n end",
"title": ""
},
{
"docid": "41c1c71c33ca55b44046f6088c12b43f",
"score": "0.60935503",
"text": "def find_space_attribute_definition(name, params={}, headers=default_headers)\n @logger.info(\"Finding the \\\"#{name}\\\" Space Attribute Definition\")\n get(\"#{@api_url}/spaceAttributeDefinitions/#{encode(name)}\", params, headers)\n end",
"title": ""
},
{
"docid": "3a1a659414e4b74dc10edbad13d7613c",
"score": "0.60651344",
"text": "def find_user_attribute_definition(name, params={}, headers=default_headers)\n @logger.info(\"Finding the \\\"#{name}\\\" User Attribute Definition\")\n get(\"#{@api_url}/userAttributeDefinitions/#{encode(name)}\", params, headers)\n end",
"title": ""
},
{
"docid": "99dddd3e7737323d1af080ded4612032",
"score": "0.60646886",
"text": "def find_attribute(name, singleton)\n name = $1 if name =~ /^(.*)=$/\n @attributes.find { |a| a.name == name && a.singleton == singleton }\n end",
"title": ""
},
{
"docid": "0648e2248d5ddaaed609db2fa0b990f5",
"score": "0.60595584",
"text": "def a(name)\n self.attributes[name]\n end",
"title": ""
},
{
"docid": "df58a4cf17b0ad49f569b176288ffd1a",
"score": "0.60122055",
"text": "def find_attribute(qualified_name, namespace, name)\n if qname = @qualified_attributes[qualified_name]\n return qname\n end\n names = []\n plural = collection?(qualified_name)\n if plural\n if namespace\n names << \"#{ namespace }_#{ name.pluralize }\"\n end\n names << name.pluralize\n end\n if namespace\n names << \"#{ namespace }_#{ name }\"\n end\n names << name\n names.map { |n| n.underscore }.find do |n|\n @attributes.include? n.underscore\n end\n end",
"title": ""
},
{
"docid": "b4dc6178caeb10ee96e0c9ebdbe27197",
"score": "0.5938833",
"text": "def [](name)\n @attributes[name]\n end",
"title": ""
},
{
"docid": "b4dc6178caeb10ee96e0c9ebdbe27197",
"score": "0.5938833",
"text": "def [](name)\n @attributes[name]\n end",
"title": ""
},
{
"docid": "c2b47efb2a8087404fb06aceb54d7fdf",
"score": "0.5923518",
"text": "def attributes_by_name(name)\n\t\treturn xpath('//@' + name)\n\tend",
"title": ""
},
{
"docid": "13d46b31b790ab608aa66ff7b82426c6",
"score": "0.5915728",
"text": "def attribute(name)\n @allowed_attributes[name]\n end",
"title": ""
},
{
"docid": "83e95328465284939cc33981677b4f6b",
"score": "0.59106857",
"text": "def [](name)\n @attributes[name]\n end",
"title": ""
},
{
"docid": "4b817d63208a0704ca350720b5475c21",
"score": "0.5906926",
"text": "def attribute(name)\n read_attribute(name)\n end",
"title": ""
},
{
"docid": "a414d24ed5bf920be0fdadbbdd87cbd0",
"score": "0.58937925",
"text": "def attribute(name)\n current_attributes[name]\n end",
"title": ""
},
{
"docid": "10aac54dc8743a56a43ea568e4419ca9",
"score": "0.5891469",
"text": "def get_attribute(name)\n str = name.to_s\n \n # try fetching an instance variable first\n value = instance_variable_get(\"@#{str}\")\n return value unless value.nil?\n \n # not an instance variable -- try fetching from @metadata\n load_metadata unless @metadata_loaded\n value = @metadata[str]\n return value unless value.nil?\n \n # not in metadata under that name -- is there another variant?\n alternate_name = nil\n self.class.md_key_map.each do |md_name, var_name|\n if str == md_name.to_s\n alternate_name = var_name.to_s\n break\n end\n end\n \n # if we couldn't find anything, return nil\n return nil if alternate_name.nil?\n \n # otherwise, try looking in metadata using the alternate name\n # if this doesn't work, we'll just let the method return nil\n @metadata[alternate_name]\n end",
"title": ""
},
{
"docid": "b3cefd15cf5e22beffe687bc636b728a",
"score": "0.5887091",
"text": "def attribute(name)\n attributes << name\n\n if !method_defined?(name) || name == :id\n attr_accessor name\n end\n end",
"title": ""
},
{
"docid": "12f1205670550382b8c0e1916c75f89c",
"score": "0.5860319",
"text": "def method_missing(name, *args, &block)\n @attributes[name]\n end",
"title": ""
},
{
"docid": "59458e6b9d1f4f2bb1aedcef9d96262d",
"score": "0.5785635",
"text": "def attribute_get(name)\n \n name = name.to_sym\n \n if properties.has_key?(name)\n properties[name].get(self)\n else\n nil\n end\n \n end",
"title": ""
},
{
"docid": "01910baf813fa183b0081e7ac3739d7f",
"score": "0.57830226",
"text": "def find_in_extended_attr( m_name )\n schema = find_attr_in_schema( m_name )\n self.extended_attributes.find_by_extended_attributes_schema_id( schema.id ) unless schema.blank?\n end",
"title": ""
},
{
"docid": "6495c9bc7ab98d7cd27e0444d1564809",
"score": "0.5762586",
"text": "def [](attr_name)\n @attributes.fetch_value(attr_name.to_s)\n end",
"title": ""
},
{
"docid": "6ff55ebbf5c5cbee4d0ddae98a22468e",
"score": "0.5758499",
"text": "def [](name)\n key = name.to_s\n if attributes.key?(key)\n attributes[key]\n elsif index = underscored_column_names.index(key)\n attributes[@columns[index].name]\n end\n end",
"title": ""
},
{
"docid": "8fd0f120f67f7d4b84980ab2d5b6ded1",
"score": "0.5754576",
"text": "def find_kapp_attribute_definition(kapp_slug, name, params={}, headers=default_headers)\n @logger.info(\"Finding the \\\"#{name}\\\" Kapp attribute definition in the \\\"#{kapp_slug}\\\" kapp.\")\n get(\"#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions/#{encode(name)}\", params, headers)\n end",
"title": ""
},
{
"docid": "b02950f24972058ec1888caa9e11c6df",
"score": "0.5752469",
"text": "def attribute_with_param(attr_name, param_name)\n attributes = self.attributes[attr_name.downcase]\n found_attributes = attributes.select { |attribute| attribute.params[param_name.downcase] }\n found_attributes.first\n end",
"title": ""
},
{
"docid": "9452b6bf2be5040ff705e0e011d42a14",
"score": "0.57411045",
"text": "def attribute_lookup(attribute_name)\n a = nil\n @current_relation.attributes.each do |attribute|\n return attribute if attribute.name == attribute_name\n end\n a\n end",
"title": ""
},
{
"docid": "f9c3f24b49c6ca189d8b2b8ceee45321",
"score": "0.5726466",
"text": "def attr(name, params = {})\n defaults = {\n :columns => [],\n :associations => [],\n :default => false,\n :include => false,\n :order => nil,\n :proc => nil\n }\n if self.columns.include? name\n defaults[:columns] = [name]\n end\n\n params = defaults.merge params\n\n setup_attrs\n\n # Make sure columns are absolutely qualified, in case we do wacky\n # joins\n params[:columns].map! do |column|\n \"#{self.table_name}__#{column}\".to_sym\n end\n\n @attrs << name unless @attrs.include? name\n @attr_strings << name.to_s unless @attr_strings.include? name.to_s\n @attr_columns[name.to_s] = params[:columns]\n @attr_associations[name.to_s] = params[:associations]\n @default_attrs << name if params[:default] unless @default_attrs.include? name\n @include_attrs << name if params[:include] unless @include_attrs.include? name\n @procs[name] = params[:proc] if params[:proc]\n \n if params[:order]\n @attr_orders << name\n end\n end",
"title": ""
},
{
"docid": "e37c49b581ffdd5f8be9d3af296a9458",
"score": "0.568935",
"text": "def attribute?(name)\n @attrs.has_key(name)\n end",
"title": ""
},
{
"docid": "8a3ea3cba69026aeb98b7d44a4d8e5d5",
"score": "0.568843",
"text": "def get_attribute(attr_name)\n return nil unless @attributes.key? attr_name\n\n @attributes[attr_name]\n end",
"title": ""
},
{
"docid": "e1d1a92eefe398bc39c7f4b18bce88e3",
"score": "0.56826353",
"text": "def attributes_for(klass)\n @attributes ||= begin\n YAML.load_file(File.expand_path('../data/attributes.json', __dir__)).freeze\n end\n\n name = unify klass.name.snakecase\n @attributes[name]\n end",
"title": ""
},
{
"docid": "95b1af9b7c2ebb3271bcde2cc28b6996",
"score": "0.5680353",
"text": "def find_category_attribute_definition(kapp_slug, name, params={}, headers=default_headers)\n @logger.info(\"Finding the \\\"#{name}\\\" Category attribute definition in the \\\"#{kapp_slug}\\\" kapp.\")\n get(\"#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions/#{encode(name)}\", params, headers)\n end",
"title": ""
},
{
"docid": "f4ca8dbc6591115f6b4a9fe47bbbeb63",
"score": "0.5666285",
"text": "def find(product_attribute_name)\n path = \"/product-attribute-definitions/#{product_attribute_name}\"\n\n response, status = BeyondApi::Request.get(@session,\n path)\n\n handle_response(response, status)\n end",
"title": ""
},
{
"docid": "92e1ff14fcd8feaad849c853324a4b4a",
"score": "0.56549096",
"text": "def [](attr_name)\n @attributes[attr_name.to_s]\n end",
"title": ""
},
{
"docid": "b3d71e32dcf7d4b532925249d5eb3921",
"score": "0.5653518",
"text": "def attribute(name)\n attr = nc.att(name)\n get(attr)\n end",
"title": ""
},
{
"docid": "a0a4857710c23f25a8777b809fcfd33b",
"score": "0.56481385",
"text": "def find_attributes(node, &block); end",
"title": ""
},
{
"docid": "a53a02c36762f32fda03aa6b42cf0bcb",
"score": "0.5644757",
"text": "def attribute_methods(name)\n attribute_method_matchers.map { |matcher| matcher.method_name name }\n end",
"title": ""
},
{
"docid": "67438648ccaee223257d3d20bd5df90e",
"score": "0.56296504",
"text": "def get_attribute( name )\n @attr_nodes.each do |attr|\n if attr.name == name then\n #//////////////////////////\n # 変更する\n #//////////////////////////\n return attr.value\n end\n end\n return \"\"\n end",
"title": ""
},
{
"docid": "dc0b3b7b25ac9e1a49694c6dc73f7856",
"score": "0.5625923",
"text": "def [](name) \n self.attributes[name]\n end",
"title": ""
},
{
"docid": "34611c4a84d11fc7096391da1d30d266",
"score": "0.56248987",
"text": "def find_user_profile_attribute_definition(name, params={}, headers=default_headers)\n @logger.info(\"Finding the \\\"#{name}\\\" User Profile Attribute Definition\")\n get(\"#{@api_url}/userProfileAttributeDefinitions/#{encode(name)}\", params, headers)\n end",
"title": ""
},
{
"docid": "375fcb46907ee80ab535a19352eb8678",
"score": "0.5619854",
"text": "def [](name, options = {})\n attributes.get(name, options)\n end",
"title": ""
},
{
"docid": "76fe73e7c4cd9e5d8d87cb701f3149ec",
"score": "0.55983067",
"text": "def [](name)\n name = name.to_sym\n super(name)\n rescue MissingAttributeError\n raise unless self.class.attribute_names.include?(name)\n end",
"title": ""
},
{
"docid": "5e671c009f5451f70dda9be4498abd5c",
"score": "0.55917126",
"text": "def attributes\n hash = HashWithIndifferentAccess.new\n\n self.class.attribute_names.each_with_object(hash) do |name, attrs|\n attrs[name] = read_attribute(name)\n end\n end",
"title": ""
},
{
"docid": "daa613b8b5c7e7e7c98a2824e64cdd43",
"score": "0.55908084",
"text": "def attributes(*names)\n names.each { |n| attribute n }\n @attributes + @qualified_attributes.keys\n end",
"title": ""
},
{
"docid": "54c15aba29002307311b0f4a237de03c",
"score": "0.55898124",
"text": "def method_missing(name, *args, &block)\n return attributes[name.to_sym] if attributes.include?(name.to_sym)\n return super\n end",
"title": ""
},
{
"docid": "b98fd7aada92e32d968a09b9fb5d129c",
"score": "0.5589036",
"text": "def read_attribute(attr_name)\n return unless attr_name\n\n attr_name = attr_name.to_s\n methods = self.class.generated_external_attribute_methods\n\n if methods.method_defined?(attr_name)\n if @attributes.has_key?(attr_name) || attr_name == 'id'\n methods.send(attr_name, @attributes[attr_name], @attributes, @attributes_cache, attr_name)\n end\n elsif !self.class.attribute_methods_generated?\n # If we haven't generated the caster methods yet, do that and\n # then try again\n self.class.define_attribute_methods\n read_attribute(attr_name)\n else\n # If we get here, the attribute has no associated DB column, so\n # just return it verbatim.\n @attributes[attr_name]\n end\n end",
"title": ""
},
{
"docid": "7aefa0bdb134489247e2e84c0ab56445",
"score": "0.5583518",
"text": "def attribute?(name)\n self.attribute_names.include?(name.to_sym)\n end",
"title": ""
},
{
"docid": "16944b2ea99a018e63d438856ccfbea3",
"score": "0.5581571",
"text": "def find_form_attribute_definition(kapp_slug, name, params={}, headers=default_headers)\n @logger.info(\"Finding the \\\"#{name}\\\" Form attribute definition in the \\\"#{kapp_slug}\\\" kapp.\")\n get(\"#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions/#{encode(name)}\", params, headers)\n end",
"title": ""
},
{
"docid": "2d6ec015d9f15d57367079c3eca82392",
"score": "0.5575725",
"text": "def has_attribute?(name)\n attribute_names.include?(name.to_str)\n end",
"title": ""
},
{
"docid": "9d1144c76b6b9bdca9aad3508a3a1184",
"score": "0.55682945",
"text": "def read_attribute(attr_name)\n attr_name = attr_name.to_sym\n\n @attributes_cache[attr_name] || @attributes_cache.fetch(attr_name) do\n data = @attributes.fetch(attr_name) do\n # This statement overrides id to return the primary key\n # if it is set to something other than :id\n if attr_name == :id && self.class.primary_key != attr_name\n return read_attribute(self.class.primary_key)\n end\n\n # For some reason hashes return false for key? if the value\n # at that key is nil. It also executes this block for fetch\n # when it really shouldn't. Detect that error here and give\n # back nil for data\n if @attributes.keys.include?(attr_name)\n nil\n else\n # In this case the attribute was truly not found, if we're\n # given a block execute that otherwise return nil\n return block_given? ? yield(attr_name) : nil\n end\n end\n # This sets and returns the typecasted value\n @attributes_cache[attr_name] = self.typecast_attribute_for_read(\n attr_name,\n data\n )\n end\n end",
"title": ""
},
{
"docid": "ad7ba7197fa15fdf5159007dbb01f0a3",
"score": "0.5557326",
"text": "def attribute_present?(name)\n @ldap_entry.attribute_names.include?(name)\n end",
"title": ""
},
{
"docid": "b4360bbd036c984bac795f2b7e510e17",
"score": "0.5546307",
"text": "def read_attribute(name)\n inflect! self[name]\n end",
"title": ""
},
{
"docid": "2480c6b7f522515c81c5b1a5da21bc32",
"score": "0.55443436",
"text": "def attr_info_for(attribute_name)\n @tracked_attrs[attribute_name.to_sym]\n end",
"title": ""
},
{
"docid": "3e141c225afda104df925813d7cb0dab",
"score": "0.55432975",
"text": "def [](attr_name)\n attr_name = attr_name.to_sym\n unless @attributes.key?(attr_name)\n raise NameError, \"undefined attribute #{attr_name.inspect}\"\n end\n @attributes[attr_name]\n end",
"title": ""
},
{
"docid": "78933e3787c2a6b16fd4f9ff36f1d996",
"score": "0.5543019",
"text": "def attribute(name)\n @attribute_names << name\n attr_reader(name)\n end",
"title": ""
},
{
"docid": "71b7174a752a83d0b04f195cec560e41",
"score": "0.5537633",
"text": "def find_attribute_of_model_in_hash(hash, model_name, attribute_name)\n\n if model_hash = hash[\"models\"] && hash[\"models\"][model_name]\n\n result = (model_hash[\"attributes\"] || []).find { |name, type| name.reject{ |key, _| key == \"options\"}.to_a.flatten.first == attribute_name } # TODO this will change because the attribute list will become an hash again\n return result.reject{ |key, _| key == \"options\"}.to_a.flatten if result # Remove the options part of the attribute, this will be unnecessary when the yaml structure is changed\n \n elsif namespaces = hash[\"namespaces\"]\n namespaces.each do |namespace, namespace_hash|\n result = find_attribute_of_model_in_hash(namespace_hash, model_name, attribute_name)\n return result unless result.nil?\n end\n end\n \n # Nothing found\n nil\n end",
"title": ""
},
{
"docid": "28b1eae71bd0eedcd3a44b9528519e7f",
"score": "0.5531583",
"text": "def [](attr_name)\n if self.attribute_names.include?(attr_name)\n read_attribute(attr_name)\n else\n get_custom_attribute(attr_name)\n end\n end",
"title": ""
},
{
"docid": "5c0f2f6afe9a0251267d1975c30b202f",
"score": "0.5527817",
"text": "def name\n attributes.fetch(:name)\n end",
"title": ""
},
{
"docid": "fe68176ceb8d31cd969b0e45fa4fa2db",
"score": "0.5497891",
"text": "def _pick_attribute(names)\n [names].flatten.each do |name|\n return self.send(name) if self.respond_to?(name)\n end\n return nil\n end",
"title": ""
},
{
"docid": "496abfeeec26e25fde855cee43b01057",
"score": "0.54903275",
"text": "def has_attribute?(name)\n @attributes.key?(name.to_s)\n end",
"title": ""
},
{
"docid": "51d318eb57e054955e569a05a445c5e4",
"score": "0.54847586",
"text": "def _read_attribute(attr_name, &block) # :nodoc:\n @attributes.fetch_value(attr_name, &block)\n end",
"title": ""
},
{
"docid": "16d20ba640b02d42c7ede34a10c8168c",
"score": "0.548119",
"text": "def attribute(name); end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.54753965",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.54753965",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.54753965",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.54753965",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "8f856171bbff58f4ee7b77875b96dab3",
"score": "0.5470935",
"text": "def get(name)\n @all.find { |e| e.name == name.to_s || e.name == \"#{name}_engine\" }\n end",
"title": ""
},
{
"docid": "c1dd2f1300491a2de31622c76cdcaacb",
"score": "0.5470838",
"text": "def get_virtual_attributes(attribute_names, cols, field_to_match = :display_name)\n sp_hash = {\n model_name: :attribute,\n filter: [:oneof, field_to_match, attribute_names],\n cols: Aux.array_add?(cols, field_to_match)\n }\n get_children_from_sp_hash(:attribute, sp_hash)\n end",
"title": ""
},
{
"docid": "3ae6fede15284a6a9bed896d9e635fe1",
"score": "0.54539484",
"text": "def find_by_name(name)\n find_by('name', name)\n end",
"title": ""
},
{
"docid": "42e8544ba10b89a875affbf04f2bcd0f",
"score": "0.5449491",
"text": "def has_attribute?(name)\n attributes.has_key?(name)\n end",
"title": ""
},
{
"docid": "a6e6a7849dd252b4d4a5b534942d9707",
"score": "0.5446368",
"text": "def attribute_get(name)\n @attributes[:current][name]\n end",
"title": ""
},
{
"docid": "c3e9a35b8d943fea50acea2d0e48705c",
"score": "0.54265594",
"text": "def _search_attributes\n _attrs.hmap do |name, settings|\n opts = settings[:options]\n next unless opts[:net_miner_search_path]\n [name, opts[:net_miner_search_path]]\n end\n end",
"title": ""
},
{
"docid": "3813ae3e50891ace23d9eca93b2b59db",
"score": "0.54158276",
"text": "def special_attribute(name)\n @special_attributes[name]\n end",
"title": ""
},
{
"docid": "95c50073cf4ecc54ca9ca04f2eabf586",
"score": "0.540552",
"text": "def each\n getAttributeNames.each { |name| yield(name, getAttribute(name)) }\n end",
"title": ""
},
{
"docid": "95c50073cf4ecc54ca9ca04f2eabf586",
"score": "0.540552",
"text": "def each\n getAttributeNames.each { |name| yield(name, getAttribute(name)) }\n end",
"title": ""
},
{
"docid": "95c50073cf4ecc54ca9ca04f2eabf586",
"score": "0.540552",
"text": "def each\n getAttributeNames.each { |name| yield(name, getAttribute(name)) }\n end",
"title": ""
},
{
"docid": "ef4764ee992b3d8c17baab9a8b0a3bf0",
"score": "0.5401569",
"text": "def find_identities_by_attribute_name(operation_name)\n# o = Attribute.find_by_content(operation_name)\n# o = Attribute.where(:content => operation_name)\n ret = []\n# unless o.nil?\n ret = self.identities.reject {|i| not i.attributes.include? i.attributes.find_by_content(operation_name)}\n# end\n return ret\n end",
"title": ""
},
{
"docid": "c460538d1d7b48e5ffe39994ab8f1062",
"score": "0.53950876",
"text": "def [](name)\n read_attribute(name)\n end",
"title": ""
},
{
"docid": "ade6c17435b79c6b8d3bfc4be0a73792",
"score": "0.539358",
"text": "def has_attribute?( name )\n accessories.each do |acc|\n return true if acc.name == name\n end\n false\n end",
"title": ""
},
{
"docid": "fe6c2ef0d133fcaa23b1480e8bb99fce",
"score": "0.53592455",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "57a96eea514df90d156d3d226705e59d",
"score": "0.5350128",
"text": "def attribute?(attribute_name)\n query_attribute(attribute_name)\n end",
"title": ""
},
{
"docid": "d103dae805fb5f39f7c1fe97051ac54c",
"score": "0.5345169",
"text": "def attr(name); end",
"title": ""
}
] |
36e9731d094e0acb0ceb5175b737ca7c
|
Transmit the quote to registered listeners.
|
[
{
"docid": "41662abe56430b3598ff4aed64de680b",
"score": "0.6076859",
"text": "def transmitQuote(sym, ob)\n transmit(:quote, sym.to_sym, ob)\n end",
"title": ""
}
] |
[
{
"docid": "9f66b330d4632b7d3f98c0a7791fc3c7",
"score": "0.6196423",
"text": "def quote_received(quote)\n @quote = quote\n\n mail to: quote.email, :subject => \"Your Quote Received\"\n end",
"title": ""
},
{
"docid": "e6d23cb292cc9fc2a52439f676111a6e",
"score": "0.6081592",
"text": "def send_price_quote(price_quote)\n @price_quote = price_quote\n mail to: @price_quote.request.user.email, subject: 'New price quote on Stabstr'\n end",
"title": ""
},
{
"docid": "a821a170458570ff0c2be69050ccea94",
"score": "0.5622751",
"text": "def transmit\n @transmitter.transmit @propeller_data\n end",
"title": ""
},
{
"docid": "0cace7484a82b31c82844d62659c4aba",
"score": "0.5618846",
"text": "def quote_request(quote)\n @quote = quote\n mail( to: TO, subject: \"Quote Request by #{@quote.name.camelcase} #{Time.current.strftime('%b %d, %Y %H:%M %p')}\")\n end",
"title": ""
},
{
"docid": "3e73afb145e5c8d4eb67dcadf131e402",
"score": "0.55836076",
"text": "def send\n Chain.send_transaction(hex)\n end",
"title": ""
},
{
"docid": "d47085c50948bdb5f4529bdfbffa5ec5",
"score": "0.5583138",
"text": "def accept_quote\n # When the button is clicked, the params contain the quote ID of the accepted quote\n quote = Quote.find(params[:quote_id][:quote_id])\n # get the company of the accepted quote\n company_name = User.find(quote.user_id).company_name\n # get the amount of the accepted quote. This value is used in the flash message below\n quote_amount = number_to_currency(quote.amount)\n\n # Update the quote to status \"Accepted\"\n quote.update(quote_params)\n # Update the quote to status \"Accepted\"\n @service_request.update(service_request_params)\n\n # Send email to the company to inform them that the quote has been accepted.\n UserNotifier.new_quote_notification(User.find(quote.user_id)).deliver\n\n flash[:success] = \"You have accepted #{company_name}'s quote for #{quote_amount}\"\n redirect_to user_service_request_path(quote.service_request.user_id, quote.service_request.id)\n end",
"title": ""
},
{
"docid": "4e13adb4bf516d27b57e2fb3708af7bc",
"score": "0.5554993",
"text": "def quote\n fetch('cowboy_bebop.quote')\n end",
"title": ""
},
{
"docid": "ec2646607e58810b3207e7a3c3f6b5a7",
"score": "0.5489212",
"text": "def send_quote(operator, trip)\n @trip = trip\n @operator = operator\n @emails = Organisation.get_all_emails(trip.organisation)\n mail(\n to: @emails,\n subject: 'JetSetGo - quote created'\n )\n end",
"title": ""
},
{
"docid": "b8ba360434035074f7097b698d47337f",
"score": "0.54704297",
"text": "def quote(params)\n request(Resources::RESOURCE_QUOTE, HTTP_METHOD_POST, params)\n end",
"title": ""
},
{
"docid": "a361a75c4ce2273903f6c579e75e55ea",
"score": "0.5378231",
"text": "def new_quote_notice(quote)\n @quote = quote\n mail(subject: \"[team] New Enquiry Received\")\n end",
"title": ""
},
{
"docid": "aa039be14c265d66bf5094a9e46d8136",
"score": "0.53777385",
"text": "def send\n @sent_at = Time.now\n sender.publish(data, meta)\n self\n end",
"title": ""
},
{
"docid": "b18bce72149435ea4630becade7a7964",
"score": "0.5374911",
"text": "def notify_parties\n buyer.add_transaction self\n seller.add_transaction self if seller\n end",
"title": ""
},
{
"docid": "a00ff9a841e90b55c9beba225dafcfd8",
"score": "0.5352129",
"text": "def quote\n fetch('v_for_vendetta.quotes')\n end",
"title": ""
},
{
"docid": "21efbb2db5e3d88b94ba3272f069524e",
"score": "0.52698386",
"text": "def quote\n fetch('hey_arnold.quotes')\n end",
"title": ""
},
{
"docid": "79b5d63a43140dccc11c129c3c02c71f",
"score": "0.52685434",
"text": "def save!\n raise Glueby::Contract::Errors::TxAlreadyBroadcasted if @txid\n\n @tx = create_tx(@wallet, @prefix, Tapyrus.sha256(@content), @fee_provider)\n @txid = @wallet.internal_wallet.broadcast(@tx)\n end",
"title": ""
},
{
"docid": "6eb5688a48fc6c52ab5cf21fe623d135",
"score": "0.5248264",
"text": "def send_data\n @propeller.transmit\n end",
"title": ""
},
{
"docid": "c1d9175ce949f73a73f28d1f4aafb193",
"score": "0.52461725",
"text": "def perform(quote_id)\n quote = Agents::Branches::AssignedAgents::Quote.where(id: quote_id.to_i).last\n property_id = quote.property_id\n details = PropertyDetails.details(property_id)[:_source]\n agent_id = quote.agent_id\n vendor_first_name = details[:vendor_first_name]\n vendor_email = details[:vendor_email]\n address = details[:address]\n\n assigned_agent = Agents::Branches::AssignedAgent.where(id: agent_id).last\n agent_first_name = assigned_agent.first_name\n agent_last_name = assigned_agent.last_name\n agent_branch_name = assigned_agent.branch.name\n\n if quote\n template_data = { vendor_first_name: vendor_first_name, vendor_property_address: address, agent_first_name: agent_first_name,\n agent_last_name: agent_last_name, agent_branch_name: agent_branch_name }\n self.class.send_email(vendor_email, 'vendor_quote_notify', self.class.to_s, template_data)\n end\n\n end",
"title": ""
},
{
"docid": "216598c6b20de614a504e70260c56b3d",
"score": "0.5235718",
"text": "def quote\n fetch('harry_potter.quotes')\n end",
"title": ""
},
{
"docid": "d63aa1e7c3a1db939d90ab1eacd156d9",
"score": "0.5229767",
"text": "def request_quote\n @title = \"Request a Quote\"\n end",
"title": ""
},
{
"docid": "dfad9ffe3f80fef10821e1ad8ea02a77",
"score": "0.5194808",
"text": "def transmit(command, options={})\n client.connection.transmit(command, **options)\n end",
"title": ""
},
{
"docid": "73d52d48811e6879c607b3f7683511bd",
"score": "0.51729524",
"text": "def quote\n fetch('simpsons.quotes')\n end",
"title": ""
},
{
"docid": "ea0b38db7c28345611ad5619a7f047a2",
"score": "0.5170803",
"text": "def send_to_acx\n @result[:sent] = @transaction_class.with_status(:new).with_result(:unreconciled).inject(0) do |count, transaction|\n response = {\"command\"=> \"reconcile_#{transaction_name}\", transaction_name => transaction}\n AMQPQueue.enqueue(response)\n transaction.status = :sent\n transaction.send_times += 1\n transaction.save\n count += 1\n end\n end",
"title": ""
},
{
"docid": "c4d323ae0fc1217c66fadf6709d5ebd1",
"score": "0.5166868",
"text": "def quotes(opts={})\n set_opts(opts)\n connection.url = self.route\n\n connection.add_plugin :result_parser unless connection.plugin?(:result_parser)\n connection.add_plugin Parsers::Quote unless connection.plugin?(Parsers::Quote)\n\n connection.perform\n end",
"title": ""
},
{
"docid": "8c901cdab4beb7fba8da8b286e703768",
"score": "0.5157942",
"text": "def send_order(_trade_type, _price, _quantity)\n raise 'self subclass responsibility'\n end",
"title": ""
},
{
"docid": "8d8d41f461d83227838c7fca7ae3b53a",
"score": "0.50732607",
"text": "def quote(options = {})\n post(\"customers/#{customer_id}/delivery_quotes\", options)\n end",
"title": ""
},
{
"docid": "9b183530779ed29bf7ab5b7a13decd58",
"score": "0.5069194",
"text": "def transmit(command, headers = {}, body = '')\n # The transmit may fail so we may need to retry.\n while true\n begin\n used_socket = socket()\n _transmit(used_socket, command, headers, body)\n return\n rescue Stomp::Error::MaxReconnectAttempts => e\n _ = e\n raise\n rescue\n @failure = $!\n raise unless @reliable\n errstr = \"transmit to #{@host} failed: #{$!}\\n\"\n unless slog(:on_miscerr, log_params, \"es_trans: \" + errstr)\n $stderr.print errstr\n end\n # !!! This loop initiates a re-connect !!!\n _reconn_prep()\n end\n end\n end",
"title": ""
},
{
"docid": "26a25e796a534a30ac7d0e67c06634fd",
"score": "0.5067241",
"text": "def send_transaction_finished_event\n agent.events.notify(:transaction_finished, payload)\n end",
"title": ""
},
{
"docid": "74811567434cb6715abe1f69079b03d0",
"score": "0.5054077",
"text": "def create\n @quote = Quote.new(quote_params)\n\n respond_to do |format|\n if @quote.valid?\n Quoter.quote_email(@quote).deliver_now\n Quoter.confirm_email(@quote).deliver_now\n format.html { redirect_to root_url, notice: 'Cotización enviada' }\n\n else\n format.html { redirect_to root_url(@quote), notice: 'No se pudo enviar tu cotización'}\n\n end\n end\n end",
"title": ""
},
{
"docid": "8cd7cb8d8ef9667a8d41819ba3565607",
"score": "0.5023464",
"text": "def on_tx(tx)\n log.debug { \">> tx: #{tx.hash} (#{tx.payload.size} bytes)\" }\n @node.queue.push([:tx, tx])\n end",
"title": ""
},
{
"docid": "ce41591eb2afc34ab66739513377ff15",
"score": "0.50216925",
"text": "def quote\n fetch('new_girl.quotes')\n end",
"title": ""
},
{
"docid": "2fd0af13fdc74395af5d4143a40317dd",
"score": "0.50198174",
"text": "def quote\n fetch('dumb_and_dumber.quotes')\n end",
"title": ""
},
{
"docid": "3d5180b7116cc17df3d332fbc42a1035",
"score": "0.5019053",
"text": "def quote(*args)\n if args[0].kind_of?(Hash)\n post({:type => \"quote\"}.update(args[0]))\n else\n text, source, dummy = args\n post(:type => \"quote\", :quote => text, :source => source)\n end\n end",
"title": ""
},
{
"docid": "f42e44eccaea16739519e331fa60e854",
"score": "0.50183606",
"text": "def on_trade(trade)\r\n warn \"Trade \" + trade.to_s\r\n end",
"title": ""
},
{
"docid": "a6ade7da71c94d2b97a96c89876cb396",
"score": "0.5016116",
"text": "def transmission; end",
"title": ""
},
{
"docid": "a37b6d48eeac6918c220bf834922f58a",
"score": "0.50001097",
"text": "def quote\n fetch('stargate.quotes')\n end",
"title": ""
},
{
"docid": "f815b304df993704548df83a5145c812",
"score": "0.49996835",
"text": "def enq(*args)\r\n app.enq(self, args)\r\n end",
"title": ""
},
{
"docid": "851d0fa29d0061429563cc850a9b0f5c",
"score": "0.49912053",
"text": "def buy(instrument, quantity, options = {}, &blk)\n params = { instrument: instrument, quantity: quantity, price: options[:price] }\n if block_given?\n websocket.subscribe :buy, params: params.merge(auth: true), &blk\n else\n http.post :buy, params\n end\n end",
"title": ""
},
{
"docid": "7a39c2092cb05645781a9e381be49de0",
"score": "0.49882603",
"text": "def ask_price_quote\n if @order.is_reorder?\n AdministrativeMailer.delay.printer_quote(current_user, @order.number_of_books, @order.order_bw_pages, @order.order_color_pages, @order.ship_zip, @cookbook.book_binding)\n else\n AdministrativeMailer.delay.printer_quote(current_user, @order.number_of_books, @cookbook.num_bw_pages, @cookbook.num_color_pages, @order.ship_zip, @cookbook.book_binding)\n end\n end",
"title": ""
},
{
"docid": "2aff4f561e391d1225c1db2e2408cf1e",
"score": "0.49843642",
"text": "def send_transaction(tx)\n sendrawtransaction(tx)\n end",
"title": ""
},
{
"docid": "e679260533a643484f8048f369261d15",
"score": "0.49708194",
"text": "def send!\n @_sended = true\n self\n end",
"title": ""
},
{
"docid": "b3baa259365c54e67a28b5054eb58f7e",
"score": "0.49680305",
"text": "def set_quot\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "631dcf874aedcac63fd842f5536120d8",
"score": "0.495378",
"text": "def quote(params)\n Ciirus::Commands::QuoteFetcher.new(credentials).call(params)\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49499455",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "c176cf735db29f1ef30cdd2d17553b91",
"score": "0.49489585",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
},
{
"docid": "a4c60fc6a7a7e02c7a878bdd5a753d57",
"score": "0.494695",
"text": "def notify_email\n begin\n QuoteMailer.send_email(self).deliver\n rescue => e\n Rails.logger.error(\"Unable to send quote email notification. #{e.message}\")\n end\n end",
"title": ""
},
{
"docid": "dfcc5e741831cc96267ac55755f8e883",
"score": "0.4938675",
"text": "def send(a)\n\t\t@connection.puts a\n\tend",
"title": ""
},
{
"docid": "b21a5b5b5c8fcf3007f4d695cb63a606",
"score": "0.49235287",
"text": "def quote_params\n params.require(:quote).permit(:text, :quoted, :user_id)\n end",
"title": ""
},
{
"docid": "f88eb4b9d1d21ee3f50fa6e176bec417",
"score": "0.49222875",
"text": "def send_pending; end",
"title": ""
},
{
"docid": "14ec66a358d263747b4f9e8419fa8d52",
"score": "0.492082",
"text": "def sync_send\n sync_write.putc(\"!\")\n sync_write.flush\n end",
"title": ""
},
{
"docid": "7873f7c71c62ad8c2475536647b51712",
"score": "0.49162853",
"text": "def quote\n fetch('princess_bride.quotes')\n end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.49089348",
"text": "def quote; end",
"title": ""
}
] |
974d283a826ac1ca127999076f0b2697
|
Returns a deep copy of the given options object.
|
[
{
"docid": "d61bff04c7581975a4002f8e1b62ee32",
"score": "0.0",
"text": "def dup_opts map\n newmap = map.dup\n for key, elem in newmap\n newmap[key] = elem.dup\n end\n return newmap\n end",
"title": ""
}
] |
[
{
"docid": "2fd1432ccb7a9b804e5510e2422f7fb4",
"score": "0.8204661",
"text": "def clone_options\n dup\n end",
"title": ""
},
{
"docid": "5b39967f2f5c971a4c4f1f8adbd656a6",
"score": "0.78909737",
"text": "def options\n @options.dup\n end",
"title": ""
},
{
"docid": "5b39967f2f5c971a4c4f1f8adbd656a6",
"score": "0.78909737",
"text": "def options\n @options.dup\n end",
"title": ""
},
{
"docid": "29795adbff8a25278198ef401a120817",
"score": "0.7513342",
"text": "def to_a\n options.dup\n end",
"title": ""
},
{
"docid": "584122cb1be3915036584636f679b4e2",
"score": "0.74625593",
"text": "def copy_options(_options)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "00aeccc83cf096ed193888a583cf4b2c",
"score": "0.7454749",
"text": "def copy(options = {})\n copy_object(options)\n end",
"title": ""
},
{
"docid": "b5626454e393bee9564460767de6d8af",
"score": "0.7367355",
"text": "def original_options\n @options\n end",
"title": ""
},
{
"docid": "d820271088aa6dfa61a5ce894bd3c5e9",
"score": "0.729811",
"text": "def mutable_options\n if @options.respond_to?(:[]=)\n then @options.clone\n else @options.names.reduce({}) do |new_options, name|\n new_options[name.to_sym] = @options[name]\n new_options\n end\n end\n end",
"title": ""
},
{
"docid": "810c8eda907e400b656e69cce7997e16",
"score": "0.7249186",
"text": "def make_copy\n obj = dup\n obj.local_options = Marshal.load(Marshal.dump(local_options))\n obj.hooks = @hooks\n\n obj\n end",
"title": ""
},
{
"docid": "aa06dddf23739a7c7228441172952e3a",
"score": "0.71819127",
"text": "def with_options(**options)\n dup.copy_properties(self, options: self.options.merge(options))\n end",
"title": ""
},
{
"docid": "7f27d6cf6c1324c0b3699bb43a4d25ba",
"score": "0.711657",
"text": "def initialize_copy( orig )\n @options = @options.map( &:dup ) # assumes each option can be duplicated\n # @bld is a symbol so no need to clone\n end",
"title": ""
},
{
"docid": "af16d2d872a85cb6b9e28cd41b1801c4",
"score": "0.70799786",
"text": "def copy(_options)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "fe73986b5fbcc5d53f6cf47aaa6ff133",
"score": "0.7028772",
"text": "def to_h\n @options.dup\n end",
"title": ""
},
{
"docid": "4e3968c3d90fbf454e94188b4046393b",
"score": "0.70208293",
"text": "def get_options copy = true\n super @opt_type, copy\n end",
"title": ""
},
{
"docid": "bfd3036f7f918c50049300751e61f683",
"score": "0.69724286",
"text": "def deep_copy(**options)\n copy = dup\n copy.question_id = options.fetch(:question_id, nil)\n copy.save!(validate: false) if options.fetch(:save, false)\n options[:question_option_id] = copy.id\n copy\n end",
"title": ""
},
{
"docid": "e9447a0f5880c423420482ef9273897a",
"score": "0.69587547",
"text": "def initialize_copy( orig )\n # these assume each option can be duplicated properly\n @options = @options.map( &:dup )\n @options_post = @options_post.map( &:dup )\n # @bld is a symbol so no need to clone\n end",
"title": ""
},
{
"docid": "5e96c5e0ea300d70a42ab0b6571cbd49",
"score": "0.6924225",
"text": "def clone(opts = {})\n c = super()\n c.set_options @opts.merge(opts)\n c\n end",
"title": ""
},
{
"docid": "de9c0b4fd081a63fbbb37a3bac4b4d30",
"score": "0.6864404",
"text": "def get_modified_options\n unless @modified_options\n if options\n opts = options.inject({}) do |sum,h|\n sum.merge!({h[0].to_sym => ((h[1].nil?) ? self.send(h[0].to_sym) : h[1]) })\n end\n else\n opts = {}\n end\n @full_allowed_options ||= allowed_options.reject {|ele| disallowed_options.include?(ele) }\n @modified_options = opts.reject do |k,v|\n !@full_allowed_options.include?(k) || \n @parent && @parent.respond_to?(:options) && @parent != self && @parent.options.has_key?(k) && @parent.options[k] == options[k]\n end\n end\n @modified_options\n end",
"title": ""
},
{
"docid": "5ef1724b0cd19ff82329327233dfd736",
"score": "0.6847761",
"text": "def initialize_copy(orig)\n super\n @options = {}\n orig.options.each_pair do |name, setting|\n @options[name] = if setting.is_a?(Hash) || setting.is_a?(Array)\n setting.dup\n else\n setting\n end\n end\n end",
"title": ""
},
{
"docid": "dd487739b98e711043d986a2f767a1e8",
"score": "0.68386686",
"text": "def clone(opts = nil)\n @opts.merge!(opts)\n self\n end",
"title": ""
},
{
"docid": "bedbaa9b011602c1f69dd54a06a9e4ea",
"score": "0.6784394",
"text": "def get_modified_options\n unless @modified_options\n if options\n opts = options.inject({}) do |sum,h| \n sum.merge!({h[0].to_sym => ((h[1].nil?) ? self.send(h[0].to_sym) : h[1]) })\n end\n else\n opts = {}\n end\n @modified_options = opts.reject {|k,v| disallowed_options.include?(k) }\n end\n @modified_options\n end",
"title": ""
},
{
"docid": "51584dc478b7488e2f2187d8211343f2",
"score": "0.6776643",
"text": "def options\n Marshal.load(Marshal.dump(@options))\n end",
"title": ""
},
{
"docid": "c99db64bf7f9e549f7c2c570cb232e3c",
"score": "0.67380553",
"text": "def dup_options(html_opt)\n # noinspection RubyMismatchedReturnType\n html_opt.presence ? deep_dup_options(html_opt) : {}\n end",
"title": ""
},
{
"docid": "ebc79c1651badb7acdfd5d1c34e53b54",
"score": "0.6725457",
"text": "def options\n hash = super\n if hash\n OpenStruct.new(hash)\n else\n OpenStruct.new(available_options)\n end\n end",
"title": ""
},
{
"docid": "1d47f8720aa63fd28e9df9f1c1075cb1",
"score": "0.6717976",
"text": "def options(options = nil)\n @options.merge!(options) unless options.nil?\n @options\n end",
"title": ""
},
{
"docid": "1a94a5b7131a56df82a4f1aed83fb7c8",
"score": "0.6706017",
"text": "def opts\n OpenStruct.new(options)\n end",
"title": ""
},
{
"docid": "0c0de31b797b092d09214ff86b515b12",
"score": "0.6698306",
"text": "def get_options type, copy = true\n return @options if defined? @options\n opt = build.options.options[ type ]\n return copy ? opt.dup : opt\n end",
"title": ""
},
{
"docid": "106b403e1c6b7875d1a6eba9c91e57ca",
"score": "0.6635975",
"text": "def initialize(options)\n @options = options.dup\n end",
"title": ""
},
{
"docid": "31056345df9bca01797fb31e4a056c7d",
"score": "0.6632249",
"text": "def options\n @options ||= OpenStruct.new\n end",
"title": ""
},
{
"docid": "31056345df9bca01797fb31e4a056c7d",
"score": "0.6632249",
"text": "def options\n @options ||= OpenStruct.new\n end",
"title": ""
},
{
"docid": "31056345df9bca01797fb31e4a056c7d",
"score": "0.6632249",
"text": "def options\n @options ||= OpenStruct.new\n end",
"title": ""
},
{
"docid": "31056345df9bca01797fb31e4a056c7d",
"score": "0.6632249",
"text": "def options\n @options ||= OpenStruct.new\n end",
"title": ""
},
{
"docid": "31056345df9bca01797fb31e4a056c7d",
"score": "0.6632249",
"text": "def options\n @options ||= OpenStruct.new\n end",
"title": ""
},
{
"docid": "6b9ea8ff85824155b27d8f0e10a58603",
"score": "0.66137207",
"text": "def options= opts\n @options = opts.is_a?(Hash) ? OpenStruct.new(opts) : opts.dup\n end",
"title": ""
},
{
"docid": "6bc6a990ab1ac770c84274a4cdf0d854",
"score": "0.6598471",
"text": "def get_modified_options\n if options\n opts = options.inject({}) do |sum,h| \n sum.merge!({h[0].to_sym => ((h[1].nil?) ? self.send(h[0].to_sym) : h[1]) })\n end\n else\n opts = {}\n end\n opts.reject {|k,v| disallowed_options.include?(k) }\n end",
"title": ""
},
{
"docid": "9610fe95bcf2a9a4f601bf80448affb8",
"score": "0.659183",
"text": "def merge_options!(options)\n @options.merge! options\n end",
"title": ""
},
{
"docid": "193b2d37bee4c61a0d4b4f7a6bdba565",
"score": "0.6546903",
"text": "def deep_copy(**options)\n copy = self.dup\n copy.modifiable = options.fetch(:modifiable, self.modifiable)\n copy.section_id = options.fetch(:section_id, nil)\n copy.save!(validate: false) if options.fetch(:save, false)\n options[:question_id] = copy.id\n self.question_options.each do |question_option|\n copy.question_options << question_option.deep_copy(options)\n end\n self.annotations.each do |annotation|\n copy.annotations << annotation.deep_copy(options)\n end\n self.themes.each { |theme| copy.themes << theme }\n copy\n end",
"title": ""
},
{
"docid": "c94eafb23c40831a5d30ff6876721b1a",
"score": "0.652009",
"text": "def merge(options)\n Options.new(@options.merge(options.to_h))\n end",
"title": ""
},
{
"docid": "92a8052675db91099ccb44cae752fc48",
"score": "0.6474359",
"text": "def initialize(options = {})\n @options = options.dup\n end",
"title": ""
},
{
"docid": "51a5e6191eeb25ca32ba90198b224ced",
"score": "0.6464043",
"text": "def extract_options\n # TODO: deprecate\n dup.extract_options!\n end",
"title": ""
},
{
"docid": "e3b0da1ca9b043829d8e4291fd904e53",
"score": "0.6455991",
"text": "def deep_manage_options!(merge_with: {})\n opts = self.extract_options!.deep_symbolize_keys_and_compact!\n opts.deep_merge!(merge_with) if merge_with && merge_with.is_a?(::Hash)\n end",
"title": ""
},
{
"docid": "16ec7f0dfb72d53b9fe0940db20f706e",
"score": "0.64485216",
"text": "def deep_clone!(options = {})\n dictionary = options[:dictionary] ||= {}\n\n processed_options = Para::Cloneable::IncludeTreeBuilder.new(self).build\n options = options.reverse_merge(processed_options)\n callback = build_clone_callback(options.delete(:prepare))\n\n deep_clone(options) do |original, clone|\n Para::Cloneable::AttachmentsCloner.new(original, clone, dictionary).clone!\n callback&.call(original, clone)\n end\n end",
"title": ""
},
{
"docid": "a565eaaebf986a6b51a7e519529c24f0",
"score": "0.64439464",
"text": "def get_modified_options\n unless @modified_options\n if dsl_options\n opts = dsl_options.inject({}) do |sum,h|\n sum.merge!({h[0].to_sym => ((h[1].nil?) ? self.send(h[0].to_sym) : h[1]) })\n end\n else\n opts = {}\n end\n @full_allowed_options ||= allowed_options.reject {|ele| disallowed_options.include?(ele) }\n @modified_options = opts.reject do |k,v|\n !@full_allowed_options.include?(k) || \n @parent && @parent.respond_to?(:dsl_options) && @parent != self && @parent.dsl_options.has_key?(k) && @parent.dsl_options[k] == dsl_options[k]\n end\n end\n @modified_options\n end",
"title": ""
},
{
"docid": "f363cbb8f3191dfc43ab2cca048469c6",
"score": "0.64431536",
"text": "def to_options!; end",
"title": ""
},
{
"docid": "f363cbb8f3191dfc43ab2cca048469c6",
"score": "0.64431536",
"text": "def to_options!; end",
"title": ""
},
{
"docid": "3cfa58dd41ac301348c60fb966559dd8",
"score": "0.64258575",
"text": "def convert_options(options)\n\t\tHashWithIndifferentAccess.new(options)\n\tend",
"title": ""
},
{
"docid": "35ea7f13024a22cedafcd692a8683457",
"score": "0.64223915",
"text": "def proxy_option_struct\n (global_options + proxy_options).each_with_object(Options.new) do |(option, value), options|\n # options that are present will evaluate to true\n value = true if value.nil?\n options.__send__ :\"#{option}=\", value\n options\n end\n end",
"title": ""
},
{
"docid": "55126bd88c8c9f8b04abe62480d73bc6",
"score": "0.64120376",
"text": "def options(options = {})\n @options.merge!(options)\n end",
"title": ""
},
{
"docid": "68093a25aa180be3e7b9816c8eaa71dd",
"score": "0.6407409",
"text": "def options\n self.class.options.merge(@options)\n end",
"title": ""
},
{
"docid": "25b8bc6190f576321dfd8b3875174831",
"score": "0.63999426",
"text": "def as_options\n mode = if copy_on_replace? then :copy\n else\n :drop\n end\n\n { on_replace: mode, once: once? }\n end",
"title": ""
},
{
"docid": "abbd1e77c85855f00c2393d4940d6c09",
"score": "0.6378126",
"text": "def to_mutable_data\n @mutable_options\n end",
"title": ""
},
{
"docid": "abbd1e77c85855f00c2393d4940d6c09",
"score": "0.6378126",
"text": "def to_mutable_data\n @mutable_options\n end",
"title": ""
},
{
"docid": "0187764cfa2c2e2020be1e457225aa15",
"score": "0.6376078",
"text": "def initialize(options)\n options = {} if options.nil?\n @options = options.clone\n end",
"title": ""
},
{
"docid": "eada7f89e8cf3de40565a3b23cc2491e",
"score": "0.6372175",
"text": "def deep_copy(**options)\n copy = dup\n copy.modifiable = options.fetch(:modifiable, modifiable)\n copy.section_id = options.fetch(:section_id, nil)\n copy.save!(validate: false) if options.fetch(:save, false)\n options[:question_id] = copy.id\n question_options.each { |qo| copy.question_options << qo.deep_copy(**options) }\n annotations.each do |annotation|\n copy.annotations << annotation.deep_copy(**options)\n end\n themes.each { |theme| copy.themes << theme }\n conditions.each { |condition| copy.conditions << condition.deep_copy(**options) }\n copy.conditions = copy.conditions.sort_by(&:number)\n copy\n end",
"title": ""
},
{
"docid": "46e94575a66b1a8dead45d5aee91aaa9",
"score": "0.63618314",
"text": "def as_options\n mode = if copy_on_replace? then :copy\n else :drop\n end\n\n { :on_replace => mode, :once => once? }\n end",
"title": ""
},
{
"docid": "e73fee8fff10bd55b5702816c69f7bc5",
"score": "0.63576347",
"text": "def options\n @options ||= current_options\n end",
"title": ""
},
{
"docid": "d3218c8ecb53e78f5477a14c8803dcdd",
"score": "0.6351202",
"text": "def get_options copy = true\n super :as, copy\n end",
"title": ""
},
{
"docid": "49c6629f4958f998e0856e589006bb86",
"score": "0.63477254",
"text": "def convert_options(options)\n converted_options = options.dup\n converted_options.delete(:verbose)\n converted_options.delete(:minimum_coverage_percentage_for_changed_files)\n converted_options.delete(:ignore_list_of_minimum_coverage_percentage_for_changed_files)\n converted_options.delete(:display_only_average_coverage)\n converted_options.delete(:average_coverage_target_diplay_name)\n converted_options\n end",
"title": ""
},
{
"docid": "df74f331f20f6863a9812877081f0977",
"score": "0.634458",
"text": "def dup_for(new_options = {})\n self.class.new(options.merge(new_options))\n end",
"title": ""
},
{
"docid": "adb6a9d97e666a2f4cc8f68c60c73958",
"score": "0.6330374",
"text": "def clone(opts = {})\n self.class.new(locals.merge(opts))\n end",
"title": ""
},
{
"docid": "eac9487e03525a5300b101742d4a2489",
"score": "0.6310826",
"text": "def merge_options\n options = default_options.marshal_dump\n self.configuration_file_options.each_pair do |key,value|\n options[key] = value\n end\n\n @parsed_options.marshal_dump.each_pair do |key,value|\n options[key] = value\n end\n\n @options = OpenStruct.new(options)\n end",
"title": ""
},
{
"docid": "9062c6cf6c9f4ef177942d1c369f3a75",
"score": "0.6306427",
"text": "def initialize(options = {})\n @hash = options.dup\n end",
"title": ""
},
{
"docid": "6ed74dba296959aab9f4c8db61819588",
"score": "0.63061494",
"text": "def options\n @options ||= Options.new\n end",
"title": ""
},
{
"docid": "419686a3f64d2fbdfe1a50fbba0b72a0",
"score": "0.6294964",
"text": "def deep_copy(obj); end",
"title": ""
},
{
"docid": "bdb51cb088f6af5f0face0e058729b02",
"score": "0.62949383",
"text": "def normalize_options(options)\n # here, we could also filter out local options e.g. like options[:band].\n return options unless options.any?\n\n propagated_options = options.dup\n propagated_options.delete(:wrap) # FIXME.\n propagated_options.delete(:_private)\n\n private_options = {}\n private_options[:include] = propagated_options.delete(:include) if options[:include]\n private_options[:exclude] = propagated_options.delete(:exclude) if options[:exclude]\n\n propagated_options[:_private] = private_options if private_options.any?\n\n propagated_options\n end",
"title": ""
},
{
"docid": "282566d9c34b7bcc99fd256f9526b3bf",
"score": "0.6283653",
"text": "def initialize(options = nil)\n @options = options ? options.dup : {}\n end",
"title": ""
},
{
"docid": "282566d9c34b7bcc99fd256f9526b3bf",
"score": "0.6283653",
"text": "def initialize(options = nil)\n @options = options ? options.dup : {}\n end",
"title": ""
},
{
"docid": "c0a6de5251c7a7084eff5bfecad3ce51",
"score": "0.6276408",
"text": "def clone(opts=nil)\n c = super(opts)\n c.clear_cache_keys!\n c\n end",
"title": ""
},
{
"docid": "d255df1a06e82e3155412a9ac494a9f2",
"score": "0.6271145",
"text": "def options=(options)\n @options ||= {}\n @options = @options.merge! options\n end",
"title": ""
},
{
"docid": "32f1e325dd316e76cb65574309bf53b3",
"score": "0.6264009",
"text": "def merge(new_options)\n dup.merge!(new_options)\n end",
"title": ""
},
{
"docid": "4bb6e31579056fe2f22503a8d8575b41",
"score": "0.62499285",
"text": "def deep_clone\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "101eca1cf54030ccef1ab96b3add359b",
"score": "0.6246455",
"text": "def preserve(options)\n @preserved_options ||= Hash.new\n @preserved_options.reverse_merge! options\n end",
"title": ""
},
{
"docid": "eb8f41ccb4116e19be9c091cc9cd461e",
"score": "0.6245493",
"text": "def update_options!( options )\n options.merge!(@options)\n options = @extra_options.merge( options)\n end",
"title": ""
},
{
"docid": "baa42dc56915c40122b36dbe4db7e9d8",
"score": "0.62334764",
"text": "def to_hash\n @options\n end",
"title": ""
},
{
"docid": "344e1fc396ebcb5a5f571c910dabb2b1",
"score": "0.6226998",
"text": "def options\n @options ||= HashList.new\n end",
"title": ""
},
{
"docid": "9b0c652cf4488ba19f1a17802785b035",
"score": "0.6218559",
"text": "def initialize _options={}\n self.options = self.class.default_options.deep_merge _options\n end",
"title": ""
},
{
"docid": "293ded283cf318e98305c825bce4a2d4",
"score": "0.62066203",
"text": "def deep_clone\n Marshal.load( Marshal.dump( self ) )\n end",
"title": ""
},
{
"docid": "293ded283cf318e98305c825bce4a2d4",
"score": "0.62066203",
"text": "def deep_clone\n Marshal.load( Marshal.dump( self ) )\n end",
"title": ""
},
{
"docid": "08c3a956d466113c4440227081ca3545",
"score": "0.6205402",
"text": "def deep_dup_options(item)\n case item\n when *NO_DUP then item\n when String then item.dup\n when Array then item.map { |v| deep_dup_options(v) }\n when Hash then item.transform_values { |v| deep_dup_options(v) }\n else duplicable_option?(item) ? item.dup : item\n end\n end",
"title": ""
},
{
"docid": "3a9679f6c21f8a6d0fbbe7daacdb4f61",
"score": "0.6204625",
"text": "def options\n @options ||= OpenStruct.new\nend",
"title": ""
},
{
"docid": "1634647196344ab0fb4fb5a203000c19",
"score": "0.6202407",
"text": "def options\n read_attribute(:options) || write_attribute(:options, {})\n end",
"title": ""
},
{
"docid": "fc14e195f42175e6ea8f50cf06b6a6f3",
"score": "0.6201398",
"text": "def extract_options(args)\n options = args.last\n\n if options.kind_of?(Hash)\n options.dup\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "ac626cd2747e07ed02d11421a3589cca",
"score": "0.6196266",
"text": "def deep_clone\n if RUBY_PLATFORM == 'opal'\n Volt::EJSON.parse(Volt::EJSON.stringify(self))\n else\n Marshal.load(Marshal.dump(self))\n end\n end",
"title": ""
},
{
"docid": "1fb6453b462b6e2135c99ed1e6a06470",
"score": "0.61955076",
"text": "def deep_copy\n copy = dup\n copy.selectors = @selectors.inject({}) do |result, (k, v)|\n result.update(k => v.deep_copy)\n end\n copy.keyframes = @keyframes.inject({}) do |result, (k, v)|\n result.update(k => v.deep_copy)\n end\n copy.pages = @supports.inject({}) do |result, (k, v)|\n result.update(k => v.deep_copy)\n end\n copy.supports = @supports.inject({}) do |result, (k, v)|\n result.update(k => v.deep_copy)\n end\n copy.engine = {\n :selectors => copy.selectors,\n :keyframes => copy.keyframes,\n :namespaces => copy.namespaces,\n :pages => copy.pages,\n :supports => copy.supports\n }\n copy\n end",
"title": ""
},
{
"docid": "f193fe09970660637e8ddd329b61517d",
"score": "0.6190409",
"text": "def deep_copy\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "1b4e8abb8f227f3bf4b9f1f0e2416563",
"score": "0.6183892",
"text": "def decompose\n [@wrapped_options, @mutable_options]\n end",
"title": ""
},
{
"docid": "0f08fe35bab001cf9af4267935bcfc53",
"score": "0.61742866",
"text": "def options\n @options ||= self.class.options\n end",
"title": ""
},
{
"docid": "0f08fe35bab001cf9af4267935bcfc53",
"score": "0.61742866",
"text": "def options\n @options ||= self.class.options\n end",
"title": ""
},
{
"docid": "0f08fe35bab001cf9af4267935bcfc53",
"score": "0.61742866",
"text": "def options\n @options ||= self.class.options\n end",
"title": ""
},
{
"docid": "6474bb0e4e0b6da54da85aeba2a0f51a",
"score": "0.6159076",
"text": "def initialize(options = {})\r\n @copy_base = options.delete(:copy_base)\r\n @options = options\r\n end",
"title": ""
},
{
"docid": "1062f37c51c41eaab79d7e8aa7993827",
"score": "0.615825",
"text": "def decompose\n [ @wrapped_options, @mutable_options ]\n end",
"title": ""
},
{
"docid": "d4c200a98f49868e3e86e48c0ab46028",
"score": "0.6153997",
"text": "def deep_copy\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "6978c4871c6f10dd5e9ee898a2f40dd5",
"score": "0.6153355",
"text": "def option(new_options = {})\r\n @options.merge!(new_options)\r\n end",
"title": ""
},
{
"docid": "452253a42abfec69f901c730b2ccfcca",
"score": "0.6150077",
"text": "def deep_copy( obj )\n\n\t\t\t# Handle mocks during testing\n\t\t\treturn obj if obj.class.name == 'RSpec::Mocks::Mock'\n\n\t\t\treturn case obj\n\t\t\t\twhen NilClass, Numeric, TrueClass, FalseClass, Symbol,\n\t\t\t\t Module, Encoding, IO, Tempfile\n\t\t\t\t\tobj\n\n\t\t\t\twhen Array\n\t\t\t\t\tobj.map {|o| deep_copy(o) }\n\n\t\t\t\twhen Hash\n\t\t\t\t\tnewhash = {}\n\t\t\t\t\tnewhash.default_proc = obj.default_proc if obj.default_proc\n\t\t\t\t\tobj.each do |k,v|\n\t\t\t\t\t\tnewhash[ deep_copy(k) ] = deep_copy( v )\n\t\t\t\t\tend\n\t\t\t\t\tnewhash\n\n\t\t\t\telse\n\t\t\t\t\tobj.clone\n\t\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "452253a42abfec69f901c730b2ccfcca",
"score": "0.6150077",
"text": "def deep_copy( obj )\n\n\t\t\t# Handle mocks during testing\n\t\t\treturn obj if obj.class.name == 'RSpec::Mocks::Mock'\n\n\t\t\treturn case obj\n\t\t\t\twhen NilClass, Numeric, TrueClass, FalseClass, Symbol,\n\t\t\t\t Module, Encoding, IO, Tempfile\n\t\t\t\t\tobj\n\n\t\t\t\twhen Array\n\t\t\t\t\tobj.map {|o| deep_copy(o) }\n\n\t\t\t\twhen Hash\n\t\t\t\t\tnewhash = {}\n\t\t\t\t\tnewhash.default_proc = obj.default_proc if obj.default_proc\n\t\t\t\t\tobj.each do |k,v|\n\t\t\t\t\t\tnewhash[ deep_copy(k) ] = deep_copy( v )\n\t\t\t\t\tend\n\t\t\t\t\tnewhash\n\n\t\t\t\telse\n\t\t\t\t\tobj.clone\n\t\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "57a77dd4cbe246864e27e0c82474dd12",
"score": "0.6144601",
"text": "def deep_clone\n Marshal::load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "513096b2b0aaffcf11e8b68a9eaeb9fa",
"score": "0.6141439",
"text": "def options\n @options ||= {}\n @options\n end",
"title": ""
},
{
"docid": "513096b2b0aaffcf11e8b68a9eaeb9fa",
"score": "0.6141439",
"text": "def options\n @options ||= {}\n @options\n end",
"title": ""
},
{
"docid": "b65c2573f09ba74ba2986f534edd4eee",
"score": "0.61321944",
"text": "def deep_clone\n Marshal.load( Marshal.dump(self) )\n end",
"title": ""
},
{
"docid": "bfc6cd40d1b7b3c00688c094c649206c",
"score": "0.61194646",
"text": "def merge_options(new_options)\n @options = @defaults.clone\n new_options.each do |k,v| @options[k] = v end\n end",
"title": ""
},
{
"docid": "dc59530b4e1d6e8a3bc94babfa01d1a4",
"score": "0.61189574",
"text": "def parse_options!\n self.options = (parsed_options_from_args || {}).merge(self.options)\n end",
"title": ""
}
] |
5f1149fdac3bc886dbb10975f0cfa2cb
|
GET /businesses/1 GET /businesses/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "8c43d3faa277b2f216892828997a347a",
"score": "0.7620147",
"text": "def index\n @businesses = Business.all\n render json: @businesses\n end",
"title": ""
},
{
"docid": "a7627a831205add50fbdd8ab2a57efa9",
"score": "0.74124056",
"text": "def index\n @businesses = Business.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @businesses }\n end\n end",
"title": ""
},
{
"docid": "5d23e6ba44c948134c618e3d28f4c341",
"score": "0.70633626",
"text": "def index\n @buses = Bus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @buses }\n end\n end",
"title": ""
},
{
"docid": "65301a9ec24bc6545b293fc39b4ee9e2",
"score": "0.69523615",
"text": "def index\n @businesses = @treasury.businesses.all\n return if needs_deeply_concerned(@treasury)\n\n @page_title = '/businesses'\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @businesses }\n end\n end",
"title": ""
},
{
"docid": "0b9509746d4693bceaf6a79779da0d57",
"score": "0.6856755",
"text": "def index\n @businesses = Business.all\n end",
"title": ""
},
{
"docid": "0b9509746d4693bceaf6a79779da0d57",
"score": "0.6856755",
"text": "def index\n @businesses = Business.all\n end",
"title": ""
},
{
"docid": "0b9509746d4693bceaf6a79779da0d57",
"score": "0.6856755",
"text": "def index\n @businesses = Business.all\n end",
"title": ""
},
{
"docid": "0b9509746d4693bceaf6a79779da0d57",
"score": "0.6856755",
"text": "def index\n @businesses = Business.all\n end",
"title": ""
},
{
"docid": "0b9509746d4693bceaf6a79779da0d57",
"score": "0.6856755",
"text": "def index\n @businesses = Business.all\n end",
"title": ""
},
{
"docid": "0b9509746d4693bceaf6a79779da0d57",
"score": "0.6856755",
"text": "def index\n @businesses = Business.all\n end",
"title": ""
},
{
"docid": "0b9509746d4693bceaf6a79779da0d57",
"score": "0.6856755",
"text": "def index\n @businesses = Business.all\n end",
"title": ""
},
{
"docid": "0b9509746d4693bceaf6a79779da0d57",
"score": "0.6856755",
"text": "def index\n @businesses = Business.all\n end",
"title": ""
},
{
"docid": "0b9509746d4693bceaf6a79779da0d57",
"score": "0.6856755",
"text": "def index\n @businesses = Business.all\n end",
"title": ""
},
{
"docid": "36797e8fda777be953f28f13491cbe9b",
"score": "0.68521255",
"text": "def index\n @businesses_all = current_user.businesses.paginate(page: params[:page]).order('name ASC')\n\n respond_to do |format|\n format.html { render @businesses }\n format.json { render json: @businesses }\n end\n end",
"title": ""
},
{
"docid": "0127734c3405fdb8e9f9fa2d5f415653",
"score": "0.6728654",
"text": "def index\n @businesses = Business.all\n \n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"title": ""
},
{
"docid": "0c670bf78bcd62db1d37520f1d506c19",
"score": "0.6642804",
"text": "def show\n @businesses = Business.all\n end",
"title": ""
},
{
"docid": "54f09474d9f5eab271d98d0fa3d727fd",
"score": "0.66392064",
"text": "def bus_retrieve\n stpid = params[:stpid]\n route = params[:rt]\n apiResults_JSON = bus_api(stpid, route).to_json\n\n render :json => apiResults_JSON\n end",
"title": ""
},
{
"docid": "982c67cb5f790f3cff86dc983058a328",
"score": "0.6582313",
"text": "def show\n @businesses_in_category = BusinessesInCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @businesses_in_category }\n end\n end",
"title": ""
},
{
"docid": "91209280bfbf168685967e13e250ce0a",
"score": "0.6547199",
"text": "def index\n @businesses = Business.search params[:q]\n end",
"title": ""
},
{
"docid": "3293cce369487976251ac57fa9f18daf",
"score": "0.65295273",
"text": "def graph_buses_by_number_stops\n hash = Ridership.bus_hash_by_stop_count\n bus_array = Ridership.order_by_stops(hash)\n respond_to do |format|\n format.json {\n render :json => [bus_array, bus_array.map{|d| d[1] }]\n }\n end\n end",
"title": ""
},
{
"docid": "23a96cf136d3498241a73bd62d8b7f13",
"score": "0.65294164",
"text": "def index\n raise 'Must have a scheme id to view businesses' if params['scheme_id'].nil?\n @businesses = current_user.schemes.find(params['scheme_id']).businesses.order(:name)\n @scheme = Scheme.find(params['scheme_id'].to_i)\n end",
"title": ""
},
{
"docid": "42f701ee7b52fe65f3249ed5469144b7",
"score": "0.65038174",
"text": "def show\n @bus = Bus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bus }\n end\n end",
"title": ""
},
{
"docid": "d11334be98fe3fe90b456bb85dcf1b43",
"score": "0.64903694",
"text": "def index\n @businesses = Business.page(business_params[:page])\n\n if business_params[:page].to_i <= @businesses.total_pages.to_i\n render json: { businesses: serialized_businesses, \n meta: { pagination: { \n per_page: Business.default_per_page, \n total_pages: @businesses.total_pages, \n total_businesses: @businesses.total_count,\n current_page: @businesses.current_page } } }, \n status: 200\n else\n render json: { errors: t(\"api.errors.pagination.pagination_exceeded\") }, status: 404\n end\n end",
"title": ""
},
{
"docid": "6280a9932910905c183409bd5520a83d",
"score": "0.6404381",
"text": "def index\n @businesses = current_user.businesses\n end",
"title": ""
},
{
"docid": "24e0b8feed9fc620d42d2f5e82289bcf",
"score": "0.6374717",
"text": "def show\n @business = Business.find(params[:id])\n render json: @business, root: 'data'\n end",
"title": ""
},
{
"docid": "370d6d4b4f09810b102491b98adc2ff2",
"score": "0.63634205",
"text": "def fetch_breakfast_and_brunch\n resp = Faraday.get ('https://api.yelp.com/v3/businesses/search?categories=breakfast_brunch&sort_by=rating&location=newburgh&radius=40000&limit=10') do |req|\n req.headers['Authorization'] = \"Bearer GX_Sex34bJpD58wcxXMLluz0wksabbmzFQ2Tk1TGfPY3TmUJRsMMyW3gd7b0pLQoHs5X1ffG4HyCQXlVcCPtuIWez4AetJZsLDebPv4JJK0YPD2ou-litu4smbSjW3Yx\"\n end\n body = JSON.parse(resp.body)\n restaurants = body['businesses']\n render json: restaurants, status: 200\n end",
"title": ""
},
{
"docid": "1b0f6c5ceb1d858b2a51ef0c9669386d",
"score": "0.63610834",
"text": "def index\n #Project.hit 35\n if params[:bus]\n @bus_stop = BusStop.find_by_naptan_code(params[:bus])\n @buses = get_buses(@bus_stop.naptan_code) unless @bus_stop.nil?\n end\n\n respond_to do |format|\n format.html\n format.json { render json: @buses, callback: params[:callback] }\n format.xml { render xml: @buses }\n end\n end",
"title": ""
},
{
"docid": "70a4552d6127103ae34f6d65235eac76",
"score": "0.63464344",
"text": "def index\n # @buses = Bus.all\n end",
"title": ""
},
{
"docid": "4e3ef8428f68918f9216edd55ae2f5d1",
"score": "0.6344951",
"text": "def getBeacons\n\t\t@room = Room.where(:name => params[:name]).take\n\t\t@beacons = @room.beacon.all\n\t\trender json: @beacons\n\tend",
"title": ""
},
{
"docid": "1d1bbec49df50e6cf7e756f609bebcca",
"score": "0.6334827",
"text": "def index\n @buses = Bus.all\n end",
"title": ""
},
{
"docid": "1d1bbec49df50e6cf7e756f609bebcca",
"score": "0.6334827",
"text": "def index\n @buses = Bus.all\n end",
"title": ""
},
{
"docid": "1d1bbec49df50e6cf7e756f609bebcca",
"score": "0.6334827",
"text": "def index\n @buses = Bus.all\n end",
"title": ""
},
{
"docid": "1d1bbec49df50e6cf7e756f609bebcca",
"score": "0.6334827",
"text": "def index\n @buses = Bus.all\n end",
"title": ""
},
{
"docid": "1d1bbec49df50e6cf7e756f609bebcca",
"score": "0.6334827",
"text": "def index\n @buses = Bus.all\n end",
"title": ""
},
{
"docid": "eca434911d5a41019acc5a64f7f44eb4",
"score": "0.63245237",
"text": "def index\n @businesses = Business.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @businesses }\n end\n end",
"title": ""
},
{
"docid": "6a6beae11ae8ced40e957ce922cef4a3",
"score": "0.6315939",
"text": "def request_bus_api \n\t\t@response = HTTParty.get('http://api.umd.io/v0/bus/routes/115/arrivals/laplat')\n\tend",
"title": ""
},
{
"docid": "02cfebf346b2a5dbfe084cff852e33a4",
"score": "0.6277766",
"text": "def index\n @service_call = ServiceCall.find(params[:service_call_id])\n @boms = @service_call.boms\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boms }\n end\n end",
"title": ""
},
{
"docid": "f28a7f7102dc2d90e0e2a9ece533ae75",
"score": "0.6263688",
"text": "def index\r\n @businesses = Business.search(params[:search], params[:page]) #.find(:all)\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @businesses }\r\n end\r\n end",
"title": ""
},
{
"docid": "25088a8326b9e78c74e84290348ba28b",
"score": "0.6239191",
"text": "def show\n @bus_entry = BusEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bus_entry }\n end\n end",
"title": ""
},
{
"docid": "ee053fd3c3d1d984b61fc8e273f37565",
"score": "0.6235607",
"text": "def index\n @business_lines = BusinessLine.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @business_lines }\n end\n end",
"title": ""
},
{
"docid": "35002c9dd1dd2f098a05261320d3427a",
"score": "0.6213003",
"text": "def getbattery\r\n\r\n if params[:building].present?\r\n\r\n @batteries = Building.find(params[:building]).batteries\r\n else\r\n @batteries = Battery.all\r\n end\r\n\r\n render json: @batteries\r\n end",
"title": ""
},
{
"docid": "a6d030ef40b6f472874260d2a87db7ca",
"score": "0.62113374",
"text": "def show\n @business = Business.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business }\n end\n end",
"title": ""
},
{
"docid": "a6d030ef40b6f472874260d2a87db7ca",
"score": "0.62113374",
"text": "def show\n @business = Business.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business }\n end\n end",
"title": ""
},
{
"docid": "a6d030ef40b6f472874260d2a87db7ca",
"score": "0.62113374",
"text": "def show\n @business = Business.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business }\n end\n end",
"title": ""
},
{
"docid": "a6d030ef40b6f472874260d2a87db7ca",
"score": "0.62113374",
"text": "def show\n @business = Business.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business }\n end\n end",
"title": ""
},
{
"docid": "a6d030ef40b6f472874260d2a87db7ca",
"score": "0.62113374",
"text": "def show\n @business = Business.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business }\n end\n end",
"title": ""
},
{
"docid": "544a4496f7b750ab41dd39a7e6eb63c1",
"score": "0.61986893",
"text": "def show\n render json: @business\n end",
"title": ""
},
{
"docid": "eddf894a468fc4ef6032f6331165a441",
"score": "0.61966705",
"text": "def index\n @station = Station.find(params[:station_id])\n @batteries = @station.batteries\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @batteries }\n end\n end",
"title": ""
},
{
"docid": "0310f9c8dc4fb2f7e20be2ad9ca5b5fc",
"score": "0.6173867",
"text": "def get_battery_by_building\n puts \"get battery by building\"\n @battery = Battery.where(building_id: params[:building_id])\n respond_to do |format|\n format.json { render :json => @battery }\n end\n end",
"title": ""
},
{
"docid": "d4bf2d13aab5902e99173e13cd7f81da",
"score": "0.61630493",
"text": "def index\n @businesses = Business.all\n @pending_businesses = Business.where(status: 0)\n @validated_businesses = Business.where(status: 1)\n @rejected_businesses = Business.where(status: 2)\n\n end",
"title": ""
},
{
"docid": "57e16091eeef53233d7d6c5a0144bf89",
"score": "0.61623347",
"text": "def index\n @burger_places = BurgerPlace.all\n\n render json: @burger_places\n end",
"title": ""
},
{
"docid": "674b572127b1855ef3252684646bc7f9",
"score": "0.6157952",
"text": "def get_blasts()\n exec_get(\"#{@base_path}/api/v2/customers/blasts.json?api_key=#{@api_key}\")\n end",
"title": ""
},
{
"docid": "68afce0d0ddc430e06ece08e53377350",
"score": "0.61493564",
"text": "def ping\n value = get_bus_stops_from_bus(Bus.find(params[:bus_id]), BusStop.find(params[:bus_stop_id]))\n respond_to do |format|\n format.json { render json: value }\n end\n end",
"title": ""
},
{
"docid": "2099ea4faca4cdf94b910e8de3655385",
"score": "0.61481744",
"text": "def index\n @machine_businesses = MachineBusiness.all\n end",
"title": ""
},
{
"docid": "806d8432865a3ca9e53c85311ad27b9f",
"score": "0.61434966",
"text": "def index\n @contracts = Contract.all\n @location = Location.find(params[:location_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contracts }\n end\n end",
"title": ""
},
{
"docid": "596f550d920d87dddcb2fe4113b927be",
"score": "0.613615",
"text": "def show\n @business = Business.find_by(id: business_params[:id])\n if @business\n render json: @business, status: 200\n else\n render json: { errors: t(\"api.errors.business.does_not_exist\") }, status: 404\n end\n end",
"title": ""
},
{
"docid": "da0696ac6c4525d39a006ae063b76ae1",
"score": "0.61234725",
"text": "def index\n @bus_routes = BusRoute.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json{ render json: @bus_routes.each{|x| x.name } }\n\t\t\tformat.xml { render xml: @bus_routes.each{|x| x.name } }\n\t\tend\n end",
"title": ""
},
{
"docid": "d9d76b43b52c8c34034b1c036d0a7380",
"score": "0.61174715",
"text": "def show\n @businesses = Business.all.to_a\n end",
"title": ""
},
{
"docid": "89dc3b117bc719b8f695fa52670150f2",
"score": "0.61141205",
"text": "def index\n @budgets = Budget.all\n render json: @budgets\n end",
"title": ""
},
{
"docid": "7bcce86619bf2e1be00013b70c7fc6b1",
"score": "0.61107254",
"text": "def new\n @bus = Bus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bus }\n end\n end",
"title": ""
},
{
"docid": "7bcce86619bf2e1be00013b70c7fc6b1",
"score": "0.61107254",
"text": "def new\n @bus = Bus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bus }\n end\n end",
"title": ""
},
{
"docid": "e155f5f6820898afff536ddcf4fb32f6",
"score": "0.6102716",
"text": "def show\n @business = current_user.businesses.find(params[:id])\n end",
"title": ""
},
{
"docid": "8f52aed90c6c7e2608d5419cbf8a9be7",
"score": "0.60983515",
"text": "def home\n # @results = JSON.parse(open(\"http://developer.itsmarta.com/BRDRestService/BRDRestService.svc/GetAllBus\").read)\n end",
"title": ""
},
{
"docid": "9c2c2969e0d58d305345c8216b6d2aa5",
"score": "0.6094719",
"text": "def index\n @businesses = Business.all\n if params[:search]\n @businesses = Business.search(params[:search]).order(\"name ASC\")\n else\n @businesses = Business.all.order('name ASC')\n end\n end",
"title": ""
},
{
"docid": "12771960a0a2b8351daf475ceef894fc",
"score": "0.6092952",
"text": "def index\n @business_units = BusinessUnit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @business_units }\n end\n end",
"title": ""
},
{
"docid": "95b9c87355f3dc29c993be8b1dd0fe90",
"score": "0.6086382",
"text": "def get_carriers_by_country(args = {}) \n get(\"/mobile.json/countries\", args)\nend",
"title": ""
},
{
"docid": "95b9c87355f3dc29c993be8b1dd0fe90",
"score": "0.6086382",
"text": "def get_carriers_by_country(args = {}) \n get(\"/mobile.json/countries\", args)\nend",
"title": ""
},
{
"docid": "e27729d4ea768b422214fdf952e2065f",
"score": "0.6083805",
"text": "def get_brandings\n request :get,\n '/v3/brandings.json'\n end",
"title": ""
},
{
"docid": "f7f8d2c8859a8e08d00f8c345c8c4234",
"score": "0.60700303",
"text": "def index\n @baosong_bs = BaosongB.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baosong_bs }\n end\n end",
"title": ""
},
{
"docid": "aa01fa471b0748f06bf9ae7d2bc0eba5",
"score": "0.6069321",
"text": "def show\n @bus_stop = BusStop.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bus_stop }\n end\n end",
"title": ""
},
{
"docid": "b26f84bc5762ed36466d5b40debdbc18",
"score": "0.6051663",
"text": "def index\n @busroutes = Busroute.all\n end",
"title": ""
},
{
"docid": "a34d64933fded93ee46f942f6c357421",
"score": "0.6045047",
"text": "def searchById\n \trender json: $yelpClient.business(params[:id])\n end",
"title": ""
},
{
"docid": "be5f554a7873cb7e3fbc8bdcb8207dfa",
"score": "0.6044089",
"text": "def business\n # logic to query third party api for the correct business\n # get back object or hash of business data\n response = HTTP.auth(\"#{Rails.application.credentials.my_api_key}\").get(\"https://api.yelp.com/v3/businesses/#{yelp_business_id}\")\n business = response.parse(:json)\n # return business\n display_address = business[\"location\"][\"display_address\"] || nil\n lat = business[\"coordinates\"][\"latitude\"]\n lng = business[\"coordinates\"][\"longitude\"]\n return {\n id: business[\"id\"],\n name: business[\"name\"],\n image_url: business[\"image_url\"],\n open: !business[\"hours\"],\n phone: business[\"phone\"],\n location: display_address,\n coordinates: [lat, lng,],\n rating: business[\"rating\"],\n review_count: business[\"review_count\"],\n cost: business[\"price\"],\n business_link: business[\"url\"]\n\n }\n end",
"title": ""
},
{
"docid": "839f1b0b708ec6a562506362ef1f9b6b",
"score": "0.60350084",
"text": "def index\n @buses = Bus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @buses }\n end\n end",
"title": ""
},
{
"docid": "94fcb76df42abdbd4f1a629ef9ed6c81",
"score": "0.60331434",
"text": "def new\n @businesses_in_category = BusinessesInCategory.new\n @categories = Category.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @businesses_in_category }\n end\n end",
"title": ""
},
{
"docid": "d4149f59c6c070b533411419ff06cf43",
"score": "0.6021276",
"text": "def show\n @business_line = BusinessLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business_line }\n end\n end",
"title": ""
},
{
"docid": "acd5ec59d2d504411fb8606fcb2df00a",
"score": "0.6014253",
"text": "def index\n @bus_requests = BusRequest.all\n end",
"title": ""
},
{
"docid": "3ec3188c0afb24f8a4dbb7d582d3e0f1",
"score": "0.5984705",
"text": "def show\n @bios = Bios.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bios }\n end\n end",
"title": ""
},
{
"docid": "37aa287e810e7a0d75c229bdaf7d7fc2",
"score": "0.59797233",
"text": "def index\n @businesses = Business.all\n @hash = Gmaps4rails.build_markers(@businesses) do |business, marker|\n marker.lat business.latitude\n marker.lng business.longitude\n marker.infowindow business.name\n end\n end",
"title": ""
},
{
"docid": "cdb5c328f7a941301e0e7f5bbeffcf02",
"score": "0.597645",
"text": "def index\n @title = \"You are viewing the businesses listing\"\n @businesses = Business.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @businesses }\n end\n end",
"title": ""
},
{
"docid": "803f6e6b9340c340a30ed87aa12469cc",
"score": "0.597264",
"text": "def index\n @bus_reservations = BusReservation.all\n end",
"title": ""
},
{
"docid": "dec01e5b2933d34f1c0cbcb2975339ee",
"score": "0.5958873",
"text": "def show\n @bus_stop = BusStop.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bus_stop }\n end\n end",
"title": ""
},
{
"docid": "7ae694065e5d2b6f1c2453ff507bbeab",
"score": "0.59480554",
"text": "def fishing_ground_businesses\n read_models[:fishing_ground_businesses].records_for(@fishing_ground_uuid)\n end",
"title": ""
},
{
"docid": "e7b7795f288f0fffb529c451507db256",
"score": "0.59377086",
"text": "def show\n @business_info = BusinessInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business_info }\n end\n end",
"title": ""
},
{
"docid": "da0b746588db7c0948bd1c8a45827370",
"score": "0.5933811",
"text": "def index\n @wuserbusinesses = Wuserbusiness.all\n end",
"title": ""
},
{
"docid": "09f11cd7d6c0c7a916ca45bae8df4560",
"score": "0.59245056",
"text": "def show\n @businesses = package_results(search(@search.term, @search.location))\n if @businesses.nil?\n #format.json { redirect_to new_search_path, notice: 'No options available with particular request' }\n\n redirect_to home_url, notice: 'Plan Cannot Be Made with Given Information'\n else\n @businesses\n #@search = Search.new\n end\n end",
"title": ""
},
{
"docid": "8db06dbb3455ce6c4ef6ebd595f9f686",
"score": "0.59223795",
"text": "def new\n @bus_entry = BusEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bus_entry }\n end\n end",
"title": ""
},
{
"docid": "9c0bcdcd24347197c4b9909e5bef6953",
"score": "0.59210485",
"text": "def show\n @business_item = BusinessItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business_item }\n end\n end",
"title": ""
},
{
"docid": "ad258db1f7cff061cdd669074c476b4f",
"score": "0.5920719",
"text": "def all_routes\n render json: RouteDelay.bus_routes, status: 200\n end",
"title": ""
},
{
"docid": "0f22ed521d60016c134be589a4a39545",
"score": "0.5911355",
"text": "def index\n @costs_of_bitcoins = CostsOfBitcoin.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @costs_of_bitcoins }\n end\n end",
"title": ""
},
{
"docid": "aadeae2626a7e71ee85d652f75c6520b",
"score": "0.5901536",
"text": "def index\n @boats = Boat.all\n render :json => @boats.as_json\n end",
"title": ""
},
{
"docid": "5bb7d6c8916bc1af5fec8d8d5e22c9a7",
"score": "0.58902055",
"text": "def index\n @suburbs = Suburb.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @suburbs }\n end\n end",
"title": ""
},
{
"docid": "15504d217eb372847f7231cf132095a7",
"score": "0.5889959",
"text": "def index\n render json: @bowties\n end",
"title": ""
},
{
"docid": "1a3c02aca268ad9014ff97199634107c",
"score": "0.5886864",
"text": "def show\n\n @client = Yelp::Client.new\n\n @request = Location.new(\n :term => @yelp_search.term,\n :city => \"San Francisco\",\n :limit => @yelp_search.limit,\n :offset => @yelp_search.offset,\n :sort => @yelp_search.sort,\n :category_filter => @yelp_search.category_filter,\n :radius_filter => @yelp_search.radius_filter,\n :deals_filter => @yelp_search.deals_filter\n )\n\n @response = @client.search(@request)\n @businesses = @response.to_h[\"businesses\"]\n \n\n end",
"title": ""
},
{
"docid": "38f086a9ec89fcdfdfc9a88fa18fe709",
"score": "0.5885384",
"text": "def index\n\t\tcuisines = Cuisine.all\n\t render json: cuisines\n\tend",
"title": ""
},
{
"docid": "fd877f91353ad71310dbc4c9b534a8dc",
"score": "0.5883265",
"text": "def show\n id = params[:id]\n cl = params[:cl] # código identificador único da linha\n @name = params[:name]\n # get info from endpoint\n @bus_info = get(url: \"buses\", params: { id: id })\n @bus_info = JSON.parse @bus_info.body\n @bus_info = @bus_info\n\n #get info from sptrans\n @bus_sptrans = BusStopsController.search_for_line(cl, id)\n # TODO\n # plotar localização do bus no ônibus\n # exibir lotação\n @bus = nil\n end",
"title": ""
},
{
"docid": "c2b3dc47880fd337f1d4303284946422",
"score": "0.58825177",
"text": "def index\n @billings = Billing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @billings }\n end\n end",
"title": ""
},
{
"docid": "f4464ddcf54104b21f56a65a60b8ca5c",
"score": "0.5879848",
"text": "def show\n @business_area = BusinessArea.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business_area }\n end\n end",
"title": ""
},
{
"docid": "69ea656f8d35436c71302d8864dc831c",
"score": "0.58773786",
"text": "def buscar(id)\n @client.get(Route.new([ROTA_COMPOSTO, id.to_s]))\n end",
"title": ""
},
{
"docid": "2bca2d90e372ae0900d84d94b3d8289e",
"score": "0.5865502",
"text": "def index\n @lat = -33.9 \n @lng = 18.9\n @businesses = Business.where('latitude is not null').near([@lat,@lng]).paginate(:page => params[:page]).per_page(10)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @businesses }\n end\n end",
"title": ""
},
{
"docid": "7e5a933f203b11971e54977da4fc3d85",
"score": "0.5863415",
"text": "def graph_stops_by_number_of_buses\n hash = Ridership.hash_stop_with_bus_count\n stop_array = Ridership.order_by_stops(hash)\n respond_to do |format|\n format.json {\n render :json => [stop_array, stop_array.map{|d| d[1] }]\n }\n end\n end",
"title": ""
}
] |
9f2d2126216577af1aaa11ae26b3820d
|
metodo que adiciona um caso de teste, recebe um parametro do usuario, e colcoa no array
|
[
{
"docid": "4e50acd0b651fbf95a895ce97fbcefea",
"score": "0.0",
"text": "def adiciona_ct\n system('clear')\n puts 'Informe um cenário de teste:'\n nome = STDIN.gets\n @cts.push(nome)\nend",
"title": ""
}
] |
[
{
"docid": "7a0f8dd278be398df1045dc267e92429",
"score": "0.6288612",
"text": "def teste_sets_e_gets_user\n\t\tuser = Usuario.new(1,\"09309261960\",\"Carlos Eduardo Cuzik\")\n\t\tuser.cpf = \"09209361970\"\n\t\tuser.nome = \"Carlos E. Cuzik\"\n\t\tassert_equal(\"09209361970\",user.cpf)\n\t\tassert_equal(\"Carlos E. Cuzik\",user.nome)\n\t\tassert_equal(1,user.cod_user)\n\tend",
"title": ""
},
{
"docid": "10e05449eccdf63d97fcb6a85ab698e4",
"score": "0.62344533",
"text": "def is_valid_usuario relacion_row, tipo_usuario, modificador_usuario\n errores = []\n # Modificamos el modificador de modo que funcione el metodo\n if modificador_usuario.length > 0\n modificador_usuario += \" \"\n end\n if Persona.where({tipo_documento_id: relacion_row[\"#{modificador_usuario}tipo documento\"], documento: relacion_row[\"#{modificador_usuario}documento\"]}).count > 0\n errores.push(\"documento_repetido\") #jeyson se habilita por que se repiten usuarios\n \n end\n\n if TipoDocumento.where(:id => relacion_row[\"#{modificador_usuario}tipo documento\"]).count ==0\n errores.push(\"tipo_documento_invalido\")\n end\n if !EmailValidator.valid?(relacion_row[\"#{modificador_usuario}email\"])\n errores.push(\"email_invalido\")\n end\n if Persona.where(:email => relacion_row[\"#{modificador_usuario}email\"]).count > 0\n errores.push(\"email_repetido\")\n end\n case tipo_usuario\n #when \"profesores\"\n #if SeccionesEducativa.where(:id => relacion_row[\"#{modificador_usuario}seccion\"]).count == 0\n # errores.push(\"seccion_educativa_invalida\")\n # end\n #if SecretariasEducacion.where(:id => relacion_row[\"#{modificador_usuario}secretaria educacion\"]).count == 0\n # errores.push(\"secretaria_educacion_invalida\")\n #end\n #puts 'se comentare porque en la carga de profesor vs camarografo no va'\n when \"observadores\"\n if CanalRegional.where(:id => relacion_row[\"#{modificador_usuario}canal regional\"]).count == 0\n errores.push(\"canal_regional_invalido\")\n end\n end\n errores\n end",
"title": ""
},
{
"docid": "4f570d761ac0079433fca6c818b275c6",
"score": "0.6190847",
"text": "def seguir(otro_usuaria)\n\t\tsiguiendo << otro_usuaria\n\tend",
"title": ""
},
{
"docid": "2d58313bb8d7a0da98d1fa9e8f848f81",
"score": "0.61548245",
"text": "def test_usuario\n\t\tget \"/?choice=piedra\"\n\t\tassert last_response.body.include?(\"Usuario: piedra\") \n\tend",
"title": ""
},
{
"docid": "f9d2576178ac5cdcaac2d594713f718d",
"score": "0.6095129",
"text": "def test_login\n assert_not_nil Usuario.login('teste','teste')\n assert_not_nil Usuario.usuario_logado\n end",
"title": ""
},
{
"docid": "ef02fbad0e76a2345051633af543bdc8",
"score": "0.5852462",
"text": "def SetDatosIngreso(usu, pass)\n\t\t@Usuario = usu\n\t\t@Contrasenia = pass\n\tend",
"title": ""
},
{
"docid": "ef02fbad0e76a2345051633af543bdc8",
"score": "0.5852462",
"text": "def SetDatosIngreso(usu, pass)\n\t\t@Usuario = usu\n\t\t@Contrasenia = pass\n\tend",
"title": ""
},
{
"docid": "ba8bad61dde11dbd2f666bd66213a6da",
"score": "0.5833356",
"text": "def accionIdentify(comando,usuariosLista,socketUsuario)\n orden=comando.split(\" \")\n username=orden[1]\n if(username==nil)\n socketUsuario.puts \"Necesitas ingresar un nombre\"\n elsif (nombreExiste?(username,usuariosLista))\n socketUsuario.puts \"Este usuario ya esta ocupado\"\n else\n status=\"ACTIVE\"\n usuario=Usuario.new(username,socketUsuario,status)\n usuariosLista.push(usuario)\n socketUsuario.puts \"Ahora esta identificado como #{username}\"\n s=\"_ Se a conectado\"\n accionPublicMessage(s,usuariosLista,socketUsuario)\n end\n end",
"title": ""
},
{
"docid": "c4ad761bb22532fdc400a8f9be1c6650",
"score": "0.5811392",
"text": "def set_usuario\n\t end",
"title": ""
},
{
"docid": "6ffc7c75a074cfd82c777006ebdf7435",
"score": "0.57567245",
"text": "def set_usuario_buscar\n campo = params[:campo]\n valor = params[:valor]\n if @campo == 'id'\n @usuario = Usuario.find(valor)\n else\n @usuario = Usuario.where(\"#{campo} LIKE '%#{valor}%'\")\n end\n @usuario = [*@usuario]\n end",
"title": ""
},
{
"docid": "4d631e389a08fd081667784bc751e176",
"score": "0.5732514",
"text": "def testa_e_testado_params\n params.require(:testa_e_testado).permit(:id_usuario_j, :id_templo, :cod_padawan, :resultado, :data_teste)\n end",
"title": ""
},
{
"docid": "0b01d3fb89737620c4f592eeb722f4e7",
"score": "0.57309705",
"text": "def usuario_validator\n params.require(:usuario).permit(:nombre,:apellido,:informacion)\n #Yo creo que aquí se ejecutaría la validación, del contenido, si es un umero\n #de telefono que sean sólo números... etc\n end",
"title": ""
},
{
"docid": "f8f5ec15b00a52be31f42ac916ee574f",
"score": "0.5660671",
"text": "def comparation_user(array_data)\n #guarda el array de las personas en la base de datos\n persons = @store.show_people\n #Dar status en false para que posteriormente cambie el valor\n status = false\n #Recorrer en el array\n persons.each do |person|\n #si los valores que da la persona existe en el csv\n if person.email == array_data[0] && person.pass == array_data[1] \n #revisa de que tipo es\n if person.type == \"1\"\n #si es 1 muestra el menu de admin\n request = \"yes\" \n #correra hasta que el usuario no quiera hacer nada mas\n while request != \"no\"\n res = admin(@view.admin_menu)\n if res == \"1\"\n login\n request = \"no\"\n break\n end\n #pregunta si quiere hacer algo si dice que no se sale\n request = @view.ask\n end\n #si el usuario es de tipo 2\n elsif person.type == \"2\"\n #hace un ciclo y pregunta si quiere hacer otra accion y rompe el ciclo \n request = \"yes\"\n while request != \"no\"\n res = user(@view.user_menu)\n if res == \"1\"\n #rompe si el usuario presiona logout\n login\n request = \"no\"\n break\n end\n request = @view.ask\n end\n #si el usuario es de tipo 3\n elsif person.type == \"3\"\n #hace un ciclo y pregunta si quiere hacer otra accion, y rompe cuando no se quiera hacer una accion\n request = \"yes\"\n while request != \"no\"\n res = seller(@view.seller_menu)\n if res == \"1\"\n #rompe si el usuario presiona logout\n login\n request = \"no\"\n break\n end\n request = @view.ask\n end\n end\n #cambia el status a true\n status = true\n else\n #deja el estatus en false porque no encontro al usuario\n status == false\n end\n end\n #si el status es false muestra mensaje y pide que se logee de nuevo\n if status == false\n @view.unvalid\n login\n end\n end",
"title": ""
},
{
"docid": "33e48f2df2fe187a114ae3319fbd8b90",
"score": "0.5644637",
"text": "def create \n @adm_usuario = Adm::Usuario.new(params[:adm_usuario])\n if params[:permissao_item]\n str = String.new\n params[:permissao_item].each {|p| str = str + p[1] + \";\"}\n @adm_usuario.permissao = str\n else\n @adm_usuario.permissao = '0'\n end\n if @adm_usuario.save \n logUsuario(request.remote_ip, session[:usuario].id, \"Novo funcionário criado (ID \" + @adm_usuario.id.to_s + \")\") \n redirect_to(adm_usuarios_path, :notice => 'Novo funcionário adicionado com sucesso.') \n else \n logUsuario(request.remote_ip, session[:usuario].id, \"Problemas ao criar um novo funcionário\") \n redirect_to :back, :notice => 'Os dados não foram salvos. Revise-os e tente novamente.'\n end \n end",
"title": ""
},
{
"docid": "b06f840bc9ada1db01264b14ebb7b4f5",
"score": "0.5632546",
"text": "def set_user_buscar\n @campo = params[:campo]\n @valor = params[:valor]\n if @campo == 'codigo'\n @user = User.find(params[:valor])\n elsif @campo == 'login'\n @user = User.limit(10).where(\"login LIKE '%#{@valor}%'\")\n else\n @user = User.limit(10).where(\"nombre LIKE '%#{@valor}%'\")\n end\n end",
"title": ""
},
{
"docid": "0eea1d8c2f7d8d8462cc40263fd63e9d",
"score": "0.56087285",
"text": "def guardar_usuario\n\t\tActiveRecord::Base.transaction do\n\t\t\tbegin\n\n\t\t\t\tuser = User.create!(\n\t\t\t\t\t:email => params[:email],\n\t\t\t\t\t:password => params[:password] ,\n\t\t\t\t\t:var_usuario_nombre => params[:nombre],\n\t\t\t\t\t:var_usuario_apellido => params[:apellido],\n\t\t\t\t\t:var_usuario_documento => params[:num_doc]\n\t\t\t\t)\n\n\t\t\t\tif params[:persona].nil? == false\n\t\t\t\t\tpersona = UsuarioMenu.create!(\n\t\t\t\t\t\t:user => user,\n\t\t\t\t\t\t:menu => Menu.find_by(var_menu_nombre: \"persona\")\n\t\t\t\t\t\t)\n\t\t\t\tend\n\n\t\t\t\tif params[:diezmo].nil? == false\n\t\t\t\t\tdiezmo = UsuarioMenu.create!(\n\t\t\t\t\t\t:user => user,\n\t\t\t\t\t\t:menu => Menu.find_by(var_menu_nombre: \"diezmo\")\n\t\t\t\t\t\t)\n\t\t\t\tend\n\n\t\t\t\tif params[:ofrenda].nil? == false \n\t\t\t\t\tofrenda = UsuarioMenu.create!(\n\t\t\t\t\t\t:user => user,\n\t\t\t\t\t\t:menu => Menu.find_by(var_menu_nombre: \"ofrenda\")\n\t\t\t\t\t\t)\n\t\t\t\tend\n\n\t\t\t\tif params[:asistencia].nil? == false \n\t\t\t\t\tasistencia = UsuarioMenu.create!(\n\t\t\t\t\t\t:user => user,\n\t\t\t\t\t\t:menu => Menu.find_by(var_menu_nombre: \"asistencia\")\n\t\t\t\t\t\t)\n\t\t\t\tend\n\n\t\t\t\tif params[:informacion].nil? == false\n\t\t\t\t\tinformacion = UsuarioMenu.create!(\n\t\t\t\t\t\t:user => user,\n\t\t\t\t\t\t:menu => Menu.find_by(var_menu_nombre: \"informacion\")\n\t\t\t\t\t\t)\n\t\t\t\tend\n\n\t\t\t\tif params[:configuracion].nil? == false\n\t\t\t\t\tconfiguracion = UsuarioMenu.create!(\n\t\t\t\t\t\t:user => user,\n\t\t\t\t\t\t:menu => Menu.find_by(var_menu_nombre: \"configuracion\")\n\t\t\t\t\t\t)\n\t\t\t\tend\n\t\t\t\t\t\n\t\t\trescue\n\t\t\t\traise ActiveRecord::Rollback\n\t\t\tend\n\t\tend\n\t\trender :json => {:resp => params }, :status => :ok\n\tend",
"title": ""
},
{
"docid": "4e3ae377be1dfb79af74564908a61589",
"score": "0.5604612",
"text": "def utilisateur\n\n end",
"title": ""
},
{
"docid": "cd25a0bd4cd510d39e22ef683e888d73",
"score": "0.5576039",
"text": "def usuario_params\n params.require(:usuario).permit(:login, :senha)\n end",
"title": ""
},
{
"docid": "d653e7d33674e9acdce2242055f8155c",
"score": "0.5567594",
"text": "def usuario_params\n params.require(:usuario).permit(:email, :senha, :cadastro_id, :datainclusao, :dataultimologin, :flagativo, :descconfirmasenha)\n end",
"title": ""
},
{
"docid": "01a02292a22c2a28a5eb76b0c2d93637",
"score": "0.5567323",
"text": "def filtra_usuario_responsable(lista_usuarios)\n if Rails.configuration.x.cor1440_permisos_por_oficina &&\n current_usuario.oficina_id\n lista_usuarios = lista_usuarios\n .where(oficina_id: current_usuario.oficina_id)\n end\n lista_usuarios\n end",
"title": ""
},
{
"docid": "a44557c7a8b9acc8799d955173ac2a3c",
"score": "0.55462873",
"text": "def usuariocompleto_params\n params.require(:usuariocompleto).permit(:email)\n end",
"title": ""
},
{
"docid": "14af1c890a27dab6a1b54aacb9433ca7",
"score": "0.554225",
"text": "def test_creation\n up = UsuarioPerfil.new\n up.usuario = Usuario.find :first\n up.perfil = Perfil.find :first\n assert up.save\n end",
"title": ""
},
{
"docid": "4e1bb05a8e0454de68ba958489fca394",
"score": "0.55276173",
"text": "def initialize(usuario)\n @usuario = usuario\n end",
"title": ""
},
{
"docid": "e3d4be8aa3fed49a81a7dccb8141a07f",
"score": "0.5516285",
"text": "def set_usuariocompleto\n @usuariocompleto = Usuario.find(params[:id])\n end",
"title": ""
},
{
"docid": "b3c0e206b316ae8ba4f3e65c4454a9cd",
"score": "0.5507522",
"text": "def verifica_usuarios\n# @user_pages, @usuarios = paginate :users, :per_page => 10\n @usuarios = User.find(:all, :order => 'nombre')\n @rol = Rol.find(params[:id])\n @usuarios = @rol.users\n end",
"title": ""
},
{
"docid": "99ee7b6d4dc420c1be27a370f97302f3",
"score": "0.54983884",
"text": "def usuario_a_params\n params.require(:usuario_a).permit(:nombre, :email, :telefono, :clave)\n end",
"title": ""
},
{
"docid": "baa619cef2bacfe3a33197c038ceda91",
"score": "0.54979044",
"text": "def create\n @user = Usuario.new(params[:usuario])\n @orgaos=Orgao.order(:sigla).collect{|o|[o.sigla,o.id]}\n respond_to do |format|\n if @user.save\n format.html { redirect_to(usuarios_url, :notice => 'Usuario criado com sucesso.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "309c97b5837f42a185b5f9c6c8f2a004",
"score": "0.545022",
"text": "def crear_usuario(usuario, clave)\n\t\t@manejador.agregar_usuario(usuario, clave)\n\tend",
"title": ""
},
{
"docid": "713785defc457f6378acfeeb32b3329e",
"score": "0.5437375",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :email, :password, :password_confirmation, :ativo)\n end",
"title": ""
},
{
"docid": "6d44fdc2f2e11e7cd99cfb7b1148680d",
"score": "0.54339737",
"text": "def verify_users(test_data)\n test_users = test_data[CoreUseOfCollectionsData::USER_GRP.name]\n test_users = [{CoreUseOfCollectionsData::USER.name => '', CoreUseOfCollectionsData::USER_TYPE.name => ''}] unless test_users\n test_users.each_with_index do |user, index|\n verify_values_match(user[CoreUseOfCollectionsData::USER.name], element_value(user_name_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_TYPE.name], element_value(user_type_input index))\n end\n end",
"title": ""
},
{
"docid": "1200b455f5a85a6b3a24f0ec2f8b5d2d",
"score": "0.54320014",
"text": "def create_test_user(login = \"test\")\n User.create(:login => login, :password => 'test', :nom => 'test', :prenom => 'test')\nend",
"title": ""
},
{
"docid": "5a5166ab3cb4aa12fc08241832351c8a",
"score": "0.541518",
"text": "def usuario_params\n params.require(:usuario).permit(:login, :email, :password, :password_confirmation, :acesso)\n end",
"title": ""
},
{
"docid": "7e5928560564e652f239125919c73760",
"score": "0.54102427",
"text": "def testedefinicao_params\n params.require(:testedefinicao).permit(:versao, :texto, :checkvalor, :checkexists, :objeto_id, :criterio_id, :usuario_id)\n end",
"title": ""
},
{
"docid": "a01f55593d45a0716ff53842d702b285",
"score": "0.54094213",
"text": "def identificarse(email = responsables(:franco).email, clave = '123')\n temp_controller, @controller = @controller, SesionesController.new\n\n post :create, { responsable: { email: email, clave: clave } }, {}\n assert_redirected_to tareas_url\n assert_not_nil session[:responsable_id]\n\n @controller = temp_controller\n end",
"title": ""
},
{
"docid": "3a13b4e2dc633824fc9f666fcf9bcdf7",
"score": "0.54074574",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :email, :senha)\n end",
"title": ""
},
{
"docid": "730f8a07abd4f4f4d668f01fa716d2e6",
"score": "0.5407241",
"text": "def verifica_usuario(user_id)\n if self.user_id == 0 or self.user_id == nil\n r = 'SOLICITANTE'\n else\n r= self.user.name\n end\n end",
"title": ""
},
{
"docid": "9ac15615956511c18545d04d06188996",
"score": "0.5406738",
"text": "def usuario_params\n params.require(:usuario).permit(:nombre, :calle, :numero, :telefono, :email, :id)\n end",
"title": ""
},
{
"docid": "6575d2081abb7a7724f39a1d00a531b5",
"score": "0.54055345",
"text": "def test_login_exists()\n puts \"[INFO] Testing the login_exists? function\"\n user_name = 'dummy_login_wont_work'\n\n ff_uac = FSAC_usersvc.new(user_name, @@prox_ip, @@prox_port, @@prox_login, @@prox_pwd)\n \n puts \"[INFO] Testing login_exists? without parameters\"\n # Should take provided username as defaut\n assert(!(ff_uac.login_exists?))\n\n puts \"[INFO] Testing login_exists? with a custom login\"\n assert(ff_uac.login_exists?(@@user_login))\n end",
"title": ""
},
{
"docid": "e15010f091e2a8e362ef35e13c909112",
"score": "0.54048246",
"text": "def usuariopregao_params\n params.require(:usuariopregao).permit(:usuario, :pregoestitulo_id, :indicadorsetup_id, :checkpoint, :resultado, :flagfinalizado)\n end",
"title": ""
},
{
"docid": "8f3d735bc848982210f1042acfc08862",
"score": "0.5400036",
"text": "def user_params\n params.require(:usuario).permit(:login, :senha)\n end",
"title": ""
},
{
"docid": "ffef349dcb17c08d02faaa7c4967f759",
"score": "0.5395432",
"text": "def usuario_registro\n if params[:nombre].blank?\n showError(\"Denegado - Falta nombre\") and return\n elsif params[:apellidos].blank?\n showError(\"Denegado - Falta apellidos\") and return\n elsif params[:telefono].blank?\n showError(\"Denegado - Falta telefono\") and return\n elsif params[:ciudad].blank?\n showError(\"Denegado - Falta ciudad\") and return\n elsif params[:email].blank?\n showError(\"Denegado - Falta email\") and return\n elsif params[:password].blank?\n showError(\"Denegado - Falta password\") and return\n elsif RestaurantesUsuario.where(:email => params[:email])\n showError(\"Denegado - Usuario ya existe\") and return\n end\n\n @restauranteUsuario = RestaurantesUsuario.create(:fecha => Time.zone.now.strftime(\"%F\"), :hora => Time.zone.now.strftime(\"%T\"), :nombre => params[:nombre], :apellidos => params[:apellidos], :telefono => params[:telefono], :ciudad => params[:ciudad], :medio => params[:medio], :email => params[:email], :password => OpenSSL::HMAC.hexdigest('sha256', 'colombia', params[:password]) )\n\n if @restauranteUsuario.exists?\n respond_to do |format|\n format.json { render json: @restaurantesReservas }\n format.xml { render '/app/views/api_mesafijas/usuario_registro.xml.builder' }\n end\n else\n showError(\"Error - No se ha podido registrar el usuario\") and return\n end\n end",
"title": ""
},
{
"docid": "18e6715f91799b2ac1de51a62eebfc4c",
"score": "0.5395345",
"text": "def test_username\n ok = %w{ edmond essau edmond}\n id = 1\n pid = 1\n ctr = 1\n ok.each do |name|\n u = User.new( :system_id => 'admin',\n :creator => ctr,\n :date_created => Time.now,\n :person_id => pid,\n :username =>name, \n :password => 'try')\n pid += 1\n ctr += 1 \n \n puts \"****The name is: #{name}****\"\n p '&&& Your name is: ' + u.username\n assert u.valid?, u.errors.full_messages\n \n end\n end",
"title": ""
},
{
"docid": "856c41421b34972032ff43804c666fb2",
"score": "0.53829116",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :email, :senha, :redir, :senha_confirmation)\n end",
"title": ""
},
{
"docid": "d45b1b1e3b9d7444e213a6a5e56beed6",
"score": "0.5381327",
"text": "def usuario_params\n params.permit(:login, :nombre, :password, :password_confirmation,\n :nivel, :estado_id, :tipoImpresora, :usuariocre)\n end",
"title": ""
},
{
"docid": "8b4fa6a1ac04c493ebb46bfbf74f782f",
"score": "0.537984",
"text": "def nuevo_usuario nombre: \"Nombre\", apellido: \"Apellido\"\n puts \"Bienvenido a nuestro sitio, #{nombre} #{apellido}!\"\n end",
"title": ""
},
{
"docid": "860da2dd40cc15e3193fcfa298d6d755",
"score": "0.5377597",
"text": "def entrada_usuario_params\n params.permit(:code, :user_id, :evento_id, :token, :id_creator)\n end",
"title": ""
},
{
"docid": "cb440cd965f5678cd780c949ce4f681e",
"score": "0.5377509",
"text": "def usuario_params\n params.require(:usuario).permit(:nombre, :email, :password, :password_confirmation, :status)\n end",
"title": ""
},
{
"docid": "8b497d631c1f4596d4587b8ce3b170ce",
"score": "0.53748703",
"text": "def set_usuario\n @usuario_completo = Usuario.join_userRolEspeciesCategoriasContenido.where(\"usuarios.id = #{params[:id]}\")\n @usuario = @usuario_completo.first\n end",
"title": ""
},
{
"docid": "f491c8d13a4eff81576b673d8c6ec520",
"score": "0.5374413",
"text": "def test_espias_corona\n espia2 = EspiaDeLaCorona.new(\n nivelEbriedad: 50000\n )\n refute espia2.pasadoDeGrog\n refute @saqueoAlBarquito.esUtil(espia2)\n end",
"title": ""
},
{
"docid": "2c43bff2abe1f3fb85a89b55c4fbf62d",
"score": "0.5373326",
"text": "def set_cliente\n @usuarios = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "4f4f787b31951e7770f6ddd8936f2b1c",
"score": "0.5365551",
"text": "def post_criar_usuario\r\n self.class.post(\"/usuario/novo\", :body => @dados_header)\r\n \t#json_criar_usuario.to_json) \r\n end",
"title": ""
},
{
"docid": "c6d8280e6abc40186d205377b7374f88",
"score": "0.53540623",
"text": "def usuario_params\n params.require(:usuario).permit(:documento, :nome, :email, :senha, :senha_confirmation, :cidade_id, :isPJ, :isInstituicao)\n end",
"title": ""
},
{
"docid": "9e207957d929da38305be879c56dfef6",
"score": "0.53493965",
"text": "def cadastrar(login, senha, nome, perfil)\n if existe_usuario?(login)\n puts 'Usuario ja existente.'\n return false\n else\n disciplinas = []\n num_usuarios = gerarID \n File.open('usuarios.txt', 'a+') do |file|\n file.write(\"#{num_usuarios}\\t#{login}\\t#{senha}\\t#{nome}\\t\"\\\n \"#{perfil}\\t#{disciplinas}\\n\")\n end \n return true\n end\n end",
"title": ""
},
{
"docid": "cfa577c8dedc25e3e05504c024405ac0",
"score": "0.5348318",
"text": "def usuario_params\n params.require(:user).permit(:permissao, :nome, :empresa_id, :ativo, :mudar_senha, :email, \n :password, :password_confirmation,\n :sign_in_count, :current_sign_in_at, :last_sign_in_at, :current_sign_in_ip,\n :current_password, :last_sign_in_ip, :plano_ids => [])\n end",
"title": ""
},
{
"docid": "ebfc2234720eb9ec03cac183ade2f20c",
"score": "0.53476",
"text": "def usuario_params\n params.require(:usuario).permit(:username, :email, :password, :password_confirmation, :primeiro_nome, :ultimo_nome, :sexo, :dt_aniversario, :info, :max_rec_colaborativa, :max_rec_conteudo, :email_publico)\n end",
"title": ""
},
{
"docid": "2a1766caac363f7fa845668a3f55e278",
"score": "0.5342273",
"text": "def set_usuario_especie\n @usuario_especie = UsuarioEspecie.join_user_especies.find(params[:id])\n end",
"title": ""
},
{
"docid": "e8e1893d39f81aa632e5405d7becc2b1",
"score": "0.53390455",
"text": "def login(usuario:,password:password)\n puts usuario\n puts password\nend",
"title": ""
},
{
"docid": "dc432da8c476dab980dc402c18060ab3",
"score": "0.5336617",
"text": "def usuario_params\n params.require(:usuario).permit(:documento, :nome, :email, :senha, :cidade_id, :isPJ, :isInstituicao)\n end",
"title": ""
},
{
"docid": "7c051aa9274eeae4607e99564d38f8f7",
"score": "0.53336996",
"text": "def usuario_params\n params.require(:usuario).permit(:nombres, :apellidos, :email, :RFC, :empresa, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "5ffb3c711c185b04aa69a4914c1bf4f3",
"score": "0.5327633",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :password, :password_confirmation, :email, :cpf, :dataNascimento, :cep, :telefone, :ativo, :admin)\n end",
"title": ""
},
{
"docid": "09cadc8e04bda66bdacede3f4d04a2aa",
"score": "0.5327416",
"text": "def test_Unit_Trilha\r\n\r\n trilha = Trilha.new\r\n\r\n trilha.sessao_Manha.push Palestra.new \"aaaaaa 10min\"\r\n trilha.sessao_Manha.push Palestra.new \"bbbbbb 20min\"\r\n trilha.sessao_Manha.push Palestra.new \"cccccc 30min\"\r\n\r\n trilha.sessao_Tarde.push Palestra.new \"dddddd 10min\"\r\n trilha.sessao_Tarde.push Palestra.new \"eeeeee 20min\"\r\n trilha.sessao_Tarde.push Palestra.new \"ffffff 30min\"\r\n trilha.sessao_Tarde.push Palestra.new \"gggggg 30min\"\r\n\r\n\r\n assert_equal 3, trilha.sessao_Manha.length\r\n assert_equal 4, trilha.sessao_Tarde.length\r\n\r\n end",
"title": ""
},
{
"docid": "c74618ec02ef3a060c07a5abfa082e66",
"score": "0.5324934",
"text": "def usuario_params\n params.require(:usuario).permit(:login, :email, :nome, :cpf, :idade, :profissao)\n end",
"title": ""
},
{
"docid": "88f6b38faef7b5fbf33bb24de2de03b5",
"score": "0.53240806",
"text": "def register\n data = []\n puts \"What's your email?\"\n email = gets.chomp\n data << email\n puts \"Introduce the password\"\n pass = gets.chomp\n data << pass\n puts \"¿What kind of user are you?\\n1. Admin\\n2. Client\\n3. Seller\"\n type = gets.chomp.to_i\n #pregunta los datos a el usuario los guarda en un array y regresa el array con los datos\n data << type\n end",
"title": ""
},
{
"docid": "941500b0a9ba4bb4f0180a253565c097",
"score": "0.5323309",
"text": "def usuario_params\n params.require(:usuario).permit(:email, :password, :password_confirmation, :tipo_actor)\n end",
"title": ""
},
{
"docid": "14b507ed535ccc36ccf4fac15f9a9970",
"score": "0.5322967",
"text": "def test_save\n ue = UsuarioEmpresa.new\n ue.usuario = Usuario.find :first\n ue.empresa = Empresa.find :first\n assert ue.save\n end",
"title": ""
},
{
"docid": "724a798b8d184f4a985e2a317157f921",
"score": "0.5319748",
"text": "def usuario_params\n params.require(:usuario).permit(:nombre, :apellido, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "fd650b3a21f0ab8df1166a0f3b1bf710",
"score": "0.5319524",
"text": "def usuario_params\n params.require(:usuario).permit(:nombre, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "509228ca34ff566e0192277eca3e3dd7",
"score": "0.5316389",
"text": "def loginEmpresa \n if User.exists?(:email=>params[:txtUser],:id=>params[:txtPassword])\n user = User.select('id_perfi,id').where(:email=>params[:txtUser],:id=>params[:txtPassword]).first\n \n user_session = User.select('nombre').where(:email=>params[:txtUser],:id=>params[:txtPassword]).first\n user_sessionA = User.select('apellido').where(:email=>params[:txtUser],:id=>params[:txtPassword]).first\n userContra = User.select('contrasena').where(:email=>params[:txtUser],:id=>params[:txtPassword]).first\n \n session[:nombre] = user_session.nombre \n session[:apellido] = user_sessionA.apellido\n session[:usercontra] = userContra\n\n \n\n \n session[:datos] = User.select('U.id, U.nombre, U.apellido, C.salario, C.cargo, C.tipo_contrato, C.fecha_ingreso, C.fecha_retiro, E.id as \"nit\", E.nombre').joins(' U JOIN \"Web\".\"tbContratos\" C ON C.id = U.id_contrato JOIN \"Web\".\"tbEmpresa\" E ON E.id = U.id_empresa JOIN \"Web\".\"tbUsuarios\"\n ON U.id =' << user.id.to_s).first\n \n session[:datosNomina] = Paysheet.select('N.dias_laborados, N.neto_pagado, N.id, N.comisiones, N.auxilio_trasporte, N.recargos,N.prima, N.prestamos, N.salud, N.pension').joins(' N JOIN \"Web\".\"tbUsuarios\" U ON U.id =' << user.id.to_s)\n\n\n \n if user.id.eql?(params[:txtPassword].to_i)\n render 'cambiocontr'\n else\n if user.id_perfi.eql?(1)\n render 'company', layout: 'homeEmpresa'\n else\n render 'employee', layout: 'home'\n end\n end\n else \n @mensaje = 'usuario y contraseña incorrecta'\n @tipo ='error'\n render 'indexcompany'\n end\n end",
"title": ""
},
{
"docid": "f37615c24fe3ca677d7239877207cf5a",
"score": "0.53128827",
"text": "def create\n @login = params[:viewUser]\n @pass = params[:viewSenha]\n\n @usuario = Usuario.new\n\n if @usuario.existe_usuario(@login, @pass) then\n redirect_to '/usuarios'\n else\n redirect_to '/'\n end\n\n end",
"title": ""
},
{
"docid": "ebe7b3157db2f3945d9836be63e92c43",
"score": "0.5312044",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :email, :password, :password_confirmation, :tipo, :ativo, :telefone, :departamento_id, departamento_ids:[])\n end",
"title": ""
},
{
"docid": "e4ad80e1cc844e444f806c9c28544b20",
"score": "0.5308371",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "eb82770f94cffe3e4145be111fbe8c18",
"score": "0.5307947",
"text": "def asignar_userc\n \n @fcomite = Fcomite.find(params[:fcomite_id])\n @comite_id = params[:comite_id]\n @nombres = params[:names]\n @emails = params[:emails]\n Usercomite.create(:nombre => @nombres, :emails => @emails,:comite_id => @comite_id)\n @comites = Comite.all\n redirect_to fcomite_comites_path(@fcomite.id)\n end",
"title": ""
},
{
"docid": "943f5a804bc5f04c59505e1c66e8fe78",
"score": "0.5305104",
"text": "def sucesso\n end",
"title": ""
},
{
"docid": "c6443083777eaa05c0aa88b3c107fd12",
"score": "0.53043425",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :senha, :email)\n end",
"title": ""
},
{
"docid": "1c0deb24fd81af270cba9d98b53ef24b",
"score": "0.5303463",
"text": "def encuestado_actual(*args)\n session_id = request.session_options[:id]\n if args.size > 0\n encuestado = Encuestado.find_by_login(args[0])\n encuestado = Encuestado.new(:session_id => session_id, :login => args[0], :email => args[0] + \"@uach.mx\") if encuestado.nil?\n else \n encuestado = Encuestado.find_by_session_id(session_id) || Encuestado.new(:session_id => session_id)\n end\n encuestado\n end",
"title": ""
},
{
"docid": "53b88e04890effa6c481703815f42ad4",
"score": "0.52979505",
"text": "def usuario_params\n params.require(:usuario).permit(:nombre, :apellido, :correo) \n end",
"title": ""
},
{
"docid": "6237f5de083441721d1b3b400387cb1c",
"score": "0.5297065",
"text": "def preenchimento \n first.set 'Gustavo'\n last.set 'Rocha'\n password.set 'abc@2020'\n email.set 'gustavo.rocha@gmail.com'\n text.set 'Teste esta validado'\n end",
"title": ""
},
{
"docid": "79f4f3b610f90afe0d528aaad0dceac0",
"score": "0.52966297",
"text": "def create\n @user= current_user\n @pessoa = Pessoa.new(pessoa_params)\n respond_to do |format|\n if Pessoa.search(@user.id)== []\n\n @pessoa.user=@user\n @pessoa.email=@user.email\n\n if @pessoa.save\n @user.pessoa=@pessoa\n @user.save\n format.html { redirect_to @pessoa, notice: 'Pessoa was successfully created.' }\n format.json { render :show, status: :created, location: @pessoa }\n else\n format.html { render :new }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n \n elsif @pessoa.opcao == 1\n\n if @pessoa.save\n @user = User.new(:email => @pessoa.email,\n :password => '1234',\n :password_confirmation => '1234',:role => @pessoa.role,:pessoa_id => @pessoa.id)\n\n sign_in @user\n\n\n sign_in current_user, :bypass => true \n @pessoa.user=@user\n @pessoa.save\n format.html { redirect_to @pessoa, notice: 'Pessoa was successfully created.' }\n format.json { render :show, status: :created, location: @pessoa }\n else\n format.html { render :new }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n \n end\n\n elsif @pessoa.opcao == 0\n\n\n if @pessoa.save\n format.html { redirect_to @pessoa, notice: 'Pessoa was successfully created.' }\n format.json { render :show, status: :created, location: @pessoa }\n else\n format.html { render :new }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n \n else\n format.html { redirect_to root_path, notice: 'Desculpe mas,você não disse se queria criar um usuario.' }\n\n end\n end\n end",
"title": ""
},
{
"docid": "d4f0b2c5965272217196aab99414a9c2",
"score": "0.52949643",
"text": "def usuario_login\n showError(\"Correo electronico o contraseña vacio\") and return if params[:email].blank? || params[:password].blank?\n\n @user = RestaurantesUsuario.where(:email => params[:email], :password => OpenSSL::HMAC.hexdigest('sha256', 'colombia', params[:password]) )\n\n if @user.exists?\n respond_to do |format|\n format.json { render json: @restaurantesReservas }\n format.xml { render '/app/views/api_mesafijas/usuario_login.xml.builder' }\n end\n else\n showError(\"Correo electronico o contraseña incorrecto\") and return\n end\n\n # 6c4ad053e5c9b1a678e34c3d0bbfa82fd5b477f54e6a0fdba8595025c620e671 == 70887088\n end",
"title": ""
},
{
"docid": "61f0e76c1e568af391bfc99e21b0ffba",
"score": "0.5293633",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :email, :status, :perfil_id, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d7cfa1b3e56274abcf6cf76bc36e3c67",
"score": "0.52903634",
"text": "def create\n if params[:admin] == 'admin'\n @usuario = Administrador.new(params[:usuario])\n else\n @usuario = Cooperativa.new(params[:usuario])\n end\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to [:admin, @usuario], :notice => 'Exemplo was successfully created.' }\n format.json { render :json => @usuario, :status => :created, :location => @usuario }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c810d6beed7a9005a39c854beebad888",
"score": "0.5284331",
"text": "def login\n #guarda el valor de lo que el usuario inserte\n election = @view.welcome_store\n case election[0]\n #si es 1\n when \"1\"\n #muestra la pantalla de login y compara en el array para ver si el usuario existe\n data_login = @view.login\n comparation_user(data_login)\n #Si es 2 corre el metodo para registrase \n when \"2\"\n #muestra la pantalla para registrarse y guarda al usuario en el csv y muestra la pantalla de logeo\n data = @view.register\n @view.login\n @store.index_people(User.new(data[0], data[1], data[2]))\n comparation_user(data)\n #si es 3\n when \"3\"\n #muestra mensaje de salida\n @view.exit\n #De lo contrario\n else\n #muestra mensaje de error y vuelve a llamar al metodo login\n @view.error_write\n login\n end\n end",
"title": ""
},
{
"docid": "c08e0b803c9d3e186197023f26f50726",
"score": "0.52820486",
"text": "def test_new_user_creation\n\t\tUser.create(@@user_details['name'], @@user_details['email'], @@user_details['credit_limit'])\n\t\tquery = \"select email, credit_limit from user where name=\\\"#{@@user_details['name']}\\\";\"\n\t\tresult = EntityHelper.execute_command(query)\n\t\tassert_equal(result[0][1], 400)\n\t\tassert_equal(result[0][0], 'rakesh@example.com')\n\tend",
"title": ""
},
{
"docid": "1a584400bb3a8ef18600bf08410ac43e",
"score": "0.52820414",
"text": "def usuario_params\n params.require(:usuario).permit(:usuar_run, :usuar_ap_pat, :usuar_ap_mat, :usuar_nom_usuario, :usuar_contrasegna, :usuar_correo, :usuar_tipo_cod)\n end",
"title": ""
},
{
"docid": "a9b81ce86585103e8fd0a8298c297142",
"score": "0.5281897",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :email, :password, :admin, :password_confirmation, :aut_token, :senha_reset_token, :senha_reset_sent_at, :cpf, :telfixo, :telcelular, :ddfixo, :ddcel)\n end",
"title": ""
},
{
"docid": "0585f801696890a6185b3b2a8466d74a",
"score": "0.5281862",
"text": "def set_usuario\n\n if usuario_logado && user.cadastro_id == 1\n @usuario = Usuario.find(params[:id])\n else\n params[:id] = user.id\n @usuario = Usuario.find(params[:id])\n end\n \n end",
"title": ""
},
{
"docid": "55a844b4485bdb96ca33be536cebd30c",
"score": "0.52789897",
"text": "def buscaUsuarioPorNombre(arreglo,nombre)\n arreglo.each do |usr|\n if(usr.name== nombre)\n return usr\n else\n next\n end\n end\n return nil\n end",
"title": ""
},
{
"docid": "beb950bb3dae8ad5c22d27992af72189",
"score": "0.5271156",
"text": "def user_index\n\t\tputs \"#{params[:user]} - #{params[:tent]} - #{params[:admin]}!!!!!!!!!!!!!!!!!!!!!!!!!!\"\n\t\t# Filtro para seleccion un rol especifico de usuarios\n\t\tif params[:user].present?\n\t\t @users = User.where(role: 0)\n\t\telsif params[:tent].present?\n\t\t @users = User.where(role: 1)\n\t\telsif params[:admin].present?\n\t\t @users = User.where(role: 2)\n\t\telse\n\t\t\t#Bandera para mostrar lista vacia\n\t\t\t@vacio = true\n\t\tend\n\tend",
"title": ""
},
{
"docid": "eb7a922ae0b510898c886d712a0f389d",
"score": "0.5270717",
"text": "def user_parames\n params.require(:user).permit(:email, :privilegio, :nombre, :meta, :password, :password_confirmation,:firma)\n end",
"title": ""
},
{
"docid": "3f12e952ca60fac90256a1ce4c65ca0d",
"score": "0.5268641",
"text": "def usuario_params\n params.require(:usuario).permit(:email, :password, :password_confirmation, :admin, :current_password, :functions_id, :permissao_id, :pessoa_id)\n # params.require(:usuario).permit(:nome, :email, :password, :password_confirmation, :admin, :current_password, :area_id, :functions_id, :permissao_id, :cargo, :pessoa_id)\n end",
"title": ""
},
{
"docid": "2584e9ffc6031fe7d43b04176edb287b",
"score": "0.52681977",
"text": "def create\n @usuario = Usuario.new(params[:usuario])\n @usuario.codigo = (@usuario.Nombre[0,1] + @usuario.Apellido[0,3]).upcase\n @codigos = Usuario.count(:all, :conditions => [\"codigo LIKE ?\" ,@usuario.codigo] )\n \n \n \n if @codigos > 0\n @usuario.codigo = @usuario.codigo + Usuario.codigoHelper(@codigos)\n end\n \n \n if @codigos > 26\n flash[:notice] = \"Demasiados usuarios con este codigo, por favor contactese con el administrador del sistema.\" \n redirect_to :action => \"index\", :controller => \"usuarios\" \n return \n end\n tempPassword = @usuario.Password\n @usuario.Password = Digest::SHA1.hexdigest(@usuario.Password)\n respond_to do |format|\n if @usuario.save\n @usuario.Password = tempPassword\n UsuarioMailer.welcome_email(@usuario).deliver\n #Se quito ya que los usuarios no se registran, admin los crea\n #session[:Usuario_id] = @usuario.id\n format.html { redirect_to usuarios_path, notice: 'Usuario fue creado exitosamente.' }\n format.json { render json: @usuario, status: :created, location: @usuario }\n else\n case @usuario.idTipoUsuario.to_s\n when \"2\"\n format.html { render action: \"nuevo_gerente\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n when \"3\"\n format.html { render action: \"nuevo_cajero\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n when \"4\"\n format.html { render action: \"nuevo_cliente\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f1b810b3955f8b692d7c5cb525ae99ad",
"score": "0.52600145",
"text": "def datos_usuario_params\n params.require(:datos_usuario).permit(:nombres, :apellidos, :direccion, :telefono, :ci)\n end",
"title": ""
},
{
"docid": "d616fa06e330ad61a222209b3b9dee46",
"score": "0.525942",
"text": "def usuario_params\n params.require(:usuario).permit(:email, :idpush, :nome, :senha, :ausente, :codigoRecuperacaoSenha, :categoria, :codigo_de_barras, :quantidade, :valor)\n end",
"title": ""
},
{
"docid": "67ea9c2e9f05ee7e7911ca3ab8a18f8b",
"score": "0.52569896",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :cpf, :email, :telefone, :login, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "176b523c20873e71cbbef1ffcfcd5de6",
"score": "0.52559996",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :sobrenome, :email, :admin, :avaliacao, :destinacao_residuos_solidos, :saneamento_basico, :unidades_conservacao, :pmma, :ccq, :agua, :agricultura, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "239315fde7cc4560fd0d15ce903df1e4",
"score": "0.52556086",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :senha, :tipo, :faixa_etaria, :area_id)\n end",
"title": ""
},
{
"docid": "4e14ce2999bd808356334ff0c91cde6b",
"score": "0.5255153",
"text": "def usuario_params\n\t params.require(:usuario).permit(:id, :email, :password)\n\t end",
"title": ""
},
{
"docid": "fe998ecb855e6619a251e0d7ccbe304c",
"score": "0.5251044",
"text": "def usuarioss_params\n params.require(:usuarioss).permit(:nombre, :email, :contrasena)\n end",
"title": ""
},
{
"docid": "2a7a3f7799eceb3d9e3ab42ea2bdc75a",
"score": "0.52495456",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n if (current_user) #Quien lo está creando es un admin? -> el usuario que va a crear también lo es.\n @usuario.usuar_tipo_cod = 'A'\n end\n respond_to do |format|\n if @usuario.save\n if (current_user) #Ya esta dentro del sistema?\n else\n session[:usuarios_id] = @usuario.id #si no lo esta ingresarlo. \n end\n \n format.html { redirect_to @usuario, notice: 'Usuario creado con exito.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de4171b1907e1083b1d788571e6221f9",
"score": "0.5247655",
"text": "def validate\n @usuario = User.find_by_apelido(params[:apelido])\n \n success = false\n if @usuario.senha == params[:senha] then\n success = true\n end\n respond_to do |format|\n format.json { render :json => { :success => success, :id => @usuario.id } }\n # format.html { redirect_to usuarios_url }\n format.html { render :json => { :success => success, :id => @usuario.id } }\n end\n end",
"title": ""
},
{
"docid": "d15cf24aecf36a9d10317ef274e67197",
"score": "0.5247389",
"text": "def set_usuariopregao\n @usuariopregao = Usuariopregao.find(params[:id])\n end",
"title": ""
}
] |
65e2ea2f9a7a353573e760974ee33567
|
TODO Active and upcoming reviews
|
[
{
"docid": "9d94b15236789515731f1d7e6e774295",
"score": "0.6411878",
"text": "def list\n @reviews = current_user.organization.reviews\n end",
"title": ""
}
] |
[
{
"docid": "346bced07b4e691edf83f4ebac356016",
"score": "0.7176862",
"text": "def get_initial_reviews\n\n\t\t# return api call for just one review\n\tend",
"title": ""
},
{
"docid": "a50cab5351863d3cda1f4f41d5672671",
"score": "0.714941",
"text": "def review\n end",
"title": ""
},
{
"docid": "2e1660eb495fe3e7c3e08cba5b66b12b",
"score": "0.71143824",
"text": "def review; end",
"title": ""
},
{
"docid": "1b3bec9bedaa586733e8e127139968be",
"score": "0.7019156",
"text": "def review\n @review\n end",
"title": ""
},
{
"docid": "4f0b3fc41c1ce599db931fdab8f529ba",
"score": "0.6915059",
"text": "def set_reviews\n @reviews = Review.where(restaurant_id: @restaurant.id).order(\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "a608a32aeca06c69d4584d22a1257834",
"score": "0.68916094",
"text": "def reviews\n @reviews\n end",
"title": ""
},
{
"docid": "f84b64c3ac3a34f757b7abf322f37356",
"score": "0.6839228",
"text": "def review\n fetch('restaurant.review')\n end",
"title": ""
},
{
"docid": "abd3bf3d1e665b1ed02055758fef625c",
"score": "0.67606616",
"text": "def openstruct_reviews\r\n @shop.reviews\r\n end",
"title": ""
},
{
"docid": "24e5e1ccdc4a59ce70253e29087907cb",
"score": "0.6727387",
"text": "def reviews\n self.reviews\n end",
"title": ""
},
{
"docid": "8eb19b9be40bf381e880df60f7c13f0e",
"score": "0.67245364",
"text": "def reviewed?\n @status == :reviewed\n end",
"title": ""
},
{
"docid": "ed90d36a31bebdaff853262e0fc13cc3",
"score": "0.67238694",
"text": "def get_active_reviews\n\n design_reviews = []\n Design.find(:all,\n :conditions => \"phase_id!=#{Design::COMPLETE}\",\n :include => :design_reviews).each do |design|\n\n next if design.phase_id == 0 \n design_review = design.design_reviews.detect { |dr| dr.review_type_id == design.phase_id }\n\n\n begin\n priority_name = design_review.priority.name\n rescue\n priority_name = 'Unset'\n end\n \n reviewers = 0\n approvals = 0\n if design.phase.name != \"Planning\"\n results = design_review.design_review_results.collect { |r| r.result }\n reviewers = results.size\n approvals = results.find_all { |r| \n (r == DesignReviewResult::APPROVED ||\n r == DesignReviewResult::WAIVED) }.size\n end \n design_reviews << { :review => design_review, :priority_name => priority_name, \n :reviewers => reviewers, :approvals => approvals } \n \n end\n \n lists = { :active => [], :inactive => [] }\n design_reviews.each do |design_review|\n if design_review[:review].review_status.name != 'Not Started'\n lists[:active] << design_review\n else\n lists[:inactive] << design_review\n end\n end\n\n return lists\n \n end",
"title": ""
},
{
"docid": "266ea79c099eee5dab05ca84518112bc",
"score": "0.66770726",
"text": "def review(rating)\n user = User.new\n user.read_creddentials\n user.login\n response = user.review rating\n if response\n puts 'Last food reviewed!'\n else\n puts 'Nothing to review'\n end\n end",
"title": ""
},
{
"docid": "2fee5a41c038298d50e656903e23c080",
"score": "0.66626316",
"text": "def get_reviews(reviews)\n all_revs = reviews.map do |r|\n {\n status: r.state,\n reviewer: r.author.login,\n date: get_yyyymmdd_hhnnss(r.updated_at),\n age: age(r.updated_at)\n }\n end\n revs_by_person = all_revs.group_by { |r| r[:reviewer] }.values\n latest_revs = revs_by_person.map do |persons_reviews|\n persons_reviews.sort { |a, b| a[:date] <=> b[:date] }[-1]\n end\n \n # if (latest_revs.size() != all_revs.size) then\n # puts '------- CONDENSING to latest -------'\n # puts \"ALL:\\n#{all_revs}\"\n # puts \"LATEST:\\n#{latest_revs}\"\n # end\n \n latest_revs\n end",
"title": ""
},
{
"docid": "5df1f3b345b9fced049ba001d02c3613",
"score": "0.6657145",
"text": "def review_feedback\n @reviews = Feedback.where(:expert_id => params[:expert_id]).order(\"id DESC\")\n @review_list = []\n @reviews.each do |review|\n @review_list << {:consumer_id => review.user_id, :consumer_name=> review.user.username,\n :exp_id => review.expert_id, :exp_name => review.expert.first_name,\n :job_id => review.job_id, :issue_name => review.job.issue_name,\n :rating => review.rating, :feedback => review.description, :comp_date => review.job.complete_date, \n :status => review.job.status, :current_status => review.job.current_status}\n end \n end",
"title": ""
},
{
"docid": "09c0da3bc19542dff7aceddd89075666",
"score": "0.6603551",
"text": "def get_reviews\n @comment_reviews = CommentReview.where('comment_id = ?', params[:comment_id])\n end",
"title": ""
},
{
"docid": "ae59affb8a47a358d2bd70a51ff1af48",
"score": "0.65671057",
"text": "def reviews\n reviews = []\n katas = Kata.all\n katas.each { |k| reviews += k.reviews.where(user_id: self.id) }\n return reviews\n end",
"title": ""
},
{
"docid": "1c736ea2f04b9ef194b6dc4c322dd43c",
"score": "0.6560426",
"text": "def reviews\n ([host_review] + [guest_review]).compact\n end",
"title": ""
},
{
"docid": "86e051d6db65306f2b0ae2856ccb7203",
"score": "0.65552247",
"text": "def reviews\n @reviews ||= (@doc/\"ProductReview\").collect { |it| Element.new(it) }\n end",
"title": ""
},
{
"docid": "f08925c626e610ed2942292e5aad8284",
"score": "0.6550144",
"text": "def recent_reviews\n\t\tself.reviews_as_reviewee.sort_by{|review| review.created_at}.reverse[0..4]\n\tend",
"title": ""
},
{
"docid": "66c2da4b37eb41dfaadc8f83bff03daa",
"score": "0.6543655",
"text": "def index\n @reviews = current_user.reviews\n end",
"title": ""
},
{
"docid": "5aa8104d558f35155dfdc53cebf637fb",
"score": "0.65247214",
"text": "def recentreview\n return 'No reviews yet!' if self.reviews.length == 0\n self.reviews.reverse.each {|review| return review.body if review.rating >= 4}\n self.reviews.reverse.each {|review| return review.body if review.rating >= 3}\n self.reviews.reverse.each {|review| return review.body if review.rating >= 2}\n self.reviews.reverse.each {|review| return review.body if review.rating >= 1}\n end",
"title": ""
},
{
"docid": "36a02ced2094b29c69189f1487b057a2",
"score": "0.64924896",
"text": "def review\n @users = User.all\n @review = Review.new\n end",
"title": ""
},
{
"docid": "f88b8c83c0db1d5fc43c4328674dde95",
"score": "0.64798903",
"text": "def index\n\t\t@reviews = @movie.reviews\n\tend",
"title": ""
},
{
"docid": "bb48cfef937f9c95aa4dfcc58052aa95",
"score": "0.6475699",
"text": "def page_reviews(doc)\n # reviews = doc.css(\"table#productReviews tr td > div\")\n reviews = doc.css('.review')\n puts \"THERE ARE #{reviews.count} REVIEWS ON THIS PAGE\"\n reviews\n end",
"title": ""
},
{
"docid": "13cc09459046429aec8ab3d18f05d3a6",
"score": "0.6472754",
"text": "def rating\n review.rating if review\n end",
"title": ""
},
{
"docid": "6de6f734fe1eb187c8c687206f6cd912",
"score": "0.64480245",
"text": "def critics(reviews)\n @criticreview = reviews\n end",
"title": ""
},
{
"docid": "882dc84cad20d70a87160f26f0276055",
"score": "0.64397234",
"text": "def review_count\n reviews.count\n end",
"title": ""
},
{
"docid": "93620910384c373e2a01464296df8ab7",
"score": "0.6435255",
"text": "def reviews\n download_reviews\n @reviews.flatten!\n end",
"title": ""
},
{
"docid": "185ff7a0232d0d90c5139dcd143ee50b",
"score": "0.6432522",
"text": "def count_reviews_of\n @count_reviews_of ||= Review.of(editor).posted_within(self).count\n end",
"title": ""
},
{
"docid": "9c62f35300db5343f1ac4c9bf7786a9c",
"score": "0.64293087",
"text": "def under_review_status\n 'Under Review'\n end",
"title": ""
},
{
"docid": "48956331e8da6e31c3d035431be640de",
"score": "0.6425249",
"text": "def show\n @reviews = Review.select { |review| review.item_id == @item.id }\n @review = Review.new(item_id: @item.id)\n @ratingSum = 0.0\n @reviews.each do |review|\n @ratingSum = @ratingSum + review.rating\n end\n @avgRating = (@ratingSum/@reviews.count).round(1)\n if logged_in?\n @isPrevRented = Rental.find_by(user_id: current_user.id, history: true, item_id: params[:id])\n @isPrevReviewed = Review.find_by(user_id: current_user, item_id: params[:id])\n end\n @rentals = Rental.where(item_id: params[:id], history: true)\n end",
"title": ""
},
{
"docid": "a79d08e470e05091b07fba3f52a5c851",
"score": "0.64126116",
"text": "def view_reviews\n @submission = Submission.find(params[:id])\n @questions = @submission.assignment.questions.sort_by {|obj| obj.created_at }\n evaluation = @evaluations.where(:user_id => current_user.id)[0]\n @responses = @evaluations[0].responses.sort_by {|obj| obj.created_at }\n\n respond_to do |format|\n format.html { render view, :layout => 'no_sidebar' } # show.html.erb\n format.json { render json: @submission }\n end\n end",
"title": ""
},
{
"docid": "02f7b319ebe0119c770ffc62db240a7d",
"score": "0.6377844",
"text": "def in_review?\n self.review_status_id == ReviewStatus.find(:first,\n :conditions => \"name='In Review'\").id\n end",
"title": ""
},
{
"docid": "fb9c54e1c100d8e40e6fcc846366d2fa",
"score": "0.63703626",
"text": "def active?\n name = self.review_status.name\n name == 'In Review' || name == 'Pending Repost' || name == 'Review On-Hold'\n end",
"title": ""
},
{
"docid": "0fd8d3dcc71d329816c45c7041925e11",
"score": "0.63389015",
"text": "def update_reviewed_at\n self.reviewed_at = Time.zone.now if just_reviewed?\n end",
"title": ""
},
{
"docid": "a36d7e00cdaaa70e0e7ae0122be83ef7",
"score": "0.6336889",
"text": "def just_reviewed?\n reviewed? and reviewed_changed?\n end",
"title": ""
},
{
"docid": "4d89f8b9ee7053833700c4d6a9eefa30",
"score": "0.6331027",
"text": "def rating\n # review = Review.where(user_id: user.id, video_id: video.id).first\n #review = Review.find_by(user_id: user.id, video_id: video.id)\n review.rating if review\n end",
"title": ""
},
{
"docid": "3b72c2ae296cf7fba5f1176ae30198d4",
"score": "0.6309907",
"text": "def reviews( params={} )\n reviews = get_connections(\"reviews\", params)\n return map_connections reviews, :to => Facebook::Graph::Review\n end",
"title": ""
},
{
"docid": "32c45695f1c5085cc5fbd167b6dcf9b8",
"score": "0.6304572",
"text": "def review\n learnables =\n current_user\n .rated_learnables\n .for_review\n .limit(MAX_NUMBER_OF_RATINGS_PER_REQUEST)\n\n @status = status\n @learnables_serializer =\n ActiveModel::Serializer::CollectionSerializer.new(learnables, {})\n end",
"title": ""
},
{
"docid": "33aab9044eec0447e2f6d0d694634e4c",
"score": "0.6303013",
"text": "def get_positive_reviews\n all_reviews = Review.where(user_id: self.id)\n all_reviews.select{|review|review.rating > Review.rating_range.max/2 }\n return all_reviews\n end",
"title": ""
},
{
"docid": "0d6f6522b809882be54bd950c60852c9",
"score": "0.6299362",
"text": "def load_reviews (movie)\n\t\tmovie[\"reviews\"] = Review.by_movie_quick(movie[\"id\"])\n\t\tif Review.by_movie(movie[\"id\"]).size <= 7\n\t\t\tmovie[\"more_reviews\"] = false\n\t\telse \n\t\t\tmovie[\"more_reviews\"] = true\n\t\tend\n\tend",
"title": ""
},
{
"docid": "748eab55fbfe66a210b0e2198e7704c8",
"score": "0.62967783",
"text": "def user_reviews\n list_of_reviews = self.reviews\n list_of_reviews.map{|review| \"User: #{review.user.name}, Rating: #{review.rating}, Review: #{review.description}\"}\n end",
"title": ""
},
{
"docid": "66ed4085ddc6fff34f88cfd81fec2e1d",
"score": "0.6287578",
"text": "def index\n\t\t@reviews = @share.reviews.order(priority: :asc)\n\t\t@reviewToAlter = @share.reviews.new\n\tend",
"title": ""
},
{
"docid": "771f27a8913cfadbe97941077801ea12",
"score": "0.6282094",
"text": "def reviews_count\n\t\treviews.size\n\tend",
"title": ""
},
{
"docid": "5cb5e3e954f1380b577709f23e7d339c",
"score": "0.6281861",
"text": "def scorable_reviews\n self.select { |review| review.is_scorable_review? == true }\n end",
"title": ""
},
{
"docid": "b51ab4234d101174435040cf54f36c34",
"score": "0.62742925",
"text": "def index\n @reviews = Review.all\n @latest_reviews = Review.latest\n @highest_score_reviews = Review.highest_score\n @lowest_score_reviews = Review.lowest_score\n end",
"title": ""
},
{
"docid": "80f986c988c11325c3acb74a396d99ca",
"score": "0.6257925",
"text": "def number_of_reviews\n self.reviews.count\n end",
"title": ""
},
{
"docid": "49466e1e46bb879608ce89bdf69a92b3",
"score": "0.6256351",
"text": "def review_count\n self.reviews.count\n end",
"title": ""
},
{
"docid": "49466e1e46bb879608ce89bdf69a92b3",
"score": "0.6256351",
"text": "def review_count\n self.reviews.count\n end",
"title": ""
},
{
"docid": "49466e1e46bb879608ce89bdf69a92b3",
"score": "0.6256351",
"text": "def review_count\n self.reviews.count\n end",
"title": ""
},
{
"docid": "28c72a0df045dcae98b9dcad2fd9e18c",
"score": "0.6238272",
"text": "def create\n @review = Review.new(review_params)\n @review.memberid = current_account.id\n @state = false\n if @review.save\n @paper = @review.paper\n @rate = 0.0\n @top = 0.0\n @bottem = 0.0\n @paper.reviews.each do |review| \n @top += review.score * review.confidence\n @bottem += review.confidence\n end\n @rate = @top / @bottem\n @paper.committee.tracks.each do |track| \n if( track.userid == current_account.id && track.role == \"PC Member\" )\n @state = true\n end\n end\n if(@state)\n respond_to do |format|\n @paper.update_attribute(:rating, @paper.rating = @rate)\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n end\n else\n @review.destroy\n redirect_to @paper.committee.conference, notice: \"You are not an PC member of that committee. Review not created.\"\n end\n else\n respond_to do |format|\n format.html { render :new}\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6053f901873edb2793af6c0c77b075ad",
"score": "0.623612",
"text": "def reviews\n Review.all.select do |r|\n r.user == self\n end\n end",
"title": ""
},
{
"docid": "1633376cbdbfd217237b60c735541485",
"score": "0.6235101",
"text": "def news_and_reviews\n (self.current_news + self.product_reviews).sort!{|a,b| b.created_at <=> a.created_at}\n end",
"title": ""
},
{
"docid": "51fc693db0d4c85cd0f33d9aa8d3f148",
"score": "0.6231437",
"text": "def reviews_count\n \tobject.reviews.count\n end",
"title": ""
},
{
"docid": "d856ff15fe65bc637bf324b5b28bee5d",
"score": "0.6229551",
"text": "def show\n session[:acting] = true\n session[:cinema] = true\n session[:writing] = true\n session[:score] = true\n session[:sfx] = true\n session[:movie_id] = @movie.id\n @reviews = @movie.reviews.sort_by { |review| review.score * -1 }\n end",
"title": ""
},
{
"docid": "054d1e8841a66fe981017e31bed51b52",
"score": "0.6227279",
"text": "def reviewer_home_setup\n\n @my_processed_reviews = DesignReview.my_processed_reviews(@logged_in_user)\n @my_unprocessed_reviews = DesignReview.my_unprocessed_reviews(@logged_in_user)\n @reviews_assigned_to_peers = DesignReview.reviews_assigned_to_peers(@logged_in_user)\n\n end",
"title": ""
},
{
"docid": "cd066fb2d0865c854e3987ef422964e0",
"score": "0.62238324",
"text": "def show\n @resource = Resource.find(params[:id])\n @reviews = Review.where(:resource_id => @resource.id).order('created_at DESC').all\n @new_review = Review.new(:resource_id => @resource.id) unless !user_signed_in? or Review.exists?(:resource_id => @resource.id, :reviewer_id => current_user.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"title": ""
},
{
"docid": "aed920b0ff2ad5c01909930a840b9164",
"score": "0.62171984",
"text": "def recent_reviews\n # 5 most recent reviews of this restaurant\n\n self.reviews.order(:date).limit(5)\n end",
"title": ""
},
{
"docid": "5b6c5459c3102dd7d0f129323b10d155",
"score": "0.61990285",
"text": "def reviews\n Review.all.select {|review| review.customer == self}\n end",
"title": ""
},
{
"docid": "b31ca4d7bfce738708ea3cecedd1d9a3",
"score": "0.6193034",
"text": "def has_reviewed?(advocate)\n !!Review.find(:first, :conditions => [\"reviews.reviewer_id = ? AND reviews.reviewee_id = ?\", self.id, advocate.id])\n end",
"title": ""
},
{
"docid": "a63cd68ffb42f508a0be968f19cbae47",
"score": "0.61840844",
"text": "def show\n @reviews = Review.where(project_id: @project.id).order(\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "9c4c224291fc2d7f8b8535cd6537dfb9",
"score": "0.618047",
"text": "def show_review_action(movie, status)\n\tcheck = user_already_reviewed(movie)\n\tif check == -1\n\t @show_review_action = true \n\telsif (check == 0 && status == true) || (check == 1 && status == false) || check == 2\n\t @show_review_action = false \n\telse\n\t @show_review_action = true\n\tend\n\nend",
"title": ""
},
{
"docid": "7e2473cc344dc9df3a38267316242742",
"score": "0.61695355",
"text": "def user_already_reviewed(movie)\n \t@user_already_reviewed = -1\n \tif user_signed_in? \n\n\t reviewFound = movie.reviews.where('user_id' => current_user.id).first\n\t if reviewFound && reviewFound.status == true\n\t @user_already_reviewed = 0\n\t elsif reviewFound && reviewFound.status == false\n\t @user_already_reviewed = 1\n\t elsif movie.user_id == current_user.id\n\t @user_already_reviewed = 2\n\t end\n\tend\n \treturn @user_already_reviewed\nend",
"title": ""
},
{
"docid": "fc3083c84c1a4383200b3a44ca49a5ab",
"score": "0.6169285",
"text": "def count_ratings\n self.reviews.all.count\n end",
"title": ""
},
{
"docid": "0b86a57f983b9866b84202a5d133dfd7",
"score": "0.61691016",
"text": "def show\n @reviews = Review.where(videogame_id: @videogame.id).order(\"created_at DESC\")\n \n if @reviews.blank?\n @avg_rating = 0\n else\n @avg_rating = @reviews.average(:rating).round(2)\n end\n end",
"title": ""
},
{
"docid": "a7aceb98c583e22a1304e8517ae891a6",
"score": "0.6165938",
"text": "def start_review!\n @saving_review = true\n end",
"title": ""
},
{
"docid": "a7aceb98c583e22a1304e8517ae891a6",
"score": "0.6165938",
"text": "def start_review!\n @saving_review = true\n end",
"title": ""
},
{
"docid": "c1706e277ab48ff328f04481445ce397",
"score": "0.61621326",
"text": "def set_reviews_and_rating\n @reviews_and_rating = ReviewsAndRating.find(params[:id])\n end",
"title": ""
},
{
"docid": "a6129cbcbbb8d28d976bbe307385fc0b",
"score": "0.61387944",
"text": "def score_of_review_comments\n votes = 0\n self.reviews.each do |review|\n review.comments.each { |comment| votes += comment.vote_count }\n end\n votes\n end",
"title": ""
},
{
"docid": "f16b32c3f7e8d5e6718b6f26fb8258fc",
"score": "0.6132035",
"text": "def show\n @reviews = @movie.reviews.page params[:page]\n @reported_reviews = current_user.reported_reviews.where(movie: @movie).pluck(:review_id)\n end",
"title": ""
},
{
"docid": "a3c1bc14ea1d924e544bdc427c2b74a9",
"score": "0.612863",
"text": "def read_review\n index = 0\n puts \"Here are the reviews and ratings for: #{@title}\"\n @ratings.each {|rating_num|\n puts \"Rating: #{rating_num}\"\n puts \"Review: #{@reviews[index]}\"\n index += 1\n }\n end",
"title": ""
},
{
"docid": "fa395ba44fff4dfa5f91d57031ed2b72",
"score": "0.61266893",
"text": "def detect_review\r\n return render :nothing => true unless logged_in?\r\n if @review = session_user.reviews.for_product(params[:id]).editable.first\r\n # RIC moderation\r\n if @review.content_documents.any?\r\n @review = @review.content_documents.last.copy_content_fields_forward\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "8c319384ca4dfb02bab61870c63d82ee",
"score": "0.61242104",
"text": "def show\n @reviews = Review.where(site_id: @site.id).order(\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "23800e74772df2b2bc38c5a915c05eb2",
"score": "0.6123826",
"text": "def index\n @reviews_and_ratings = ReviewsAndRating.all\n end",
"title": ""
},
{
"docid": "81b4b2700d9279ff7d33af1dfdb380f0",
"score": "0.6122907",
"text": "def index\n @reviews = @story.reviews\n end",
"title": ""
},
{
"docid": "9c2cb4b044aabae408c14c5faaaad94a",
"score": "0.61169416",
"text": "def has_reviews?\n\t\t!self.reviews.empty? \n\tend",
"title": ""
},
{
"docid": "4b2e6c80d7538f51015eed8510103651",
"score": "0.6109429",
"text": "def index\n @reviews = Review.all\n \n end",
"title": ""
},
{
"docid": "571e1b1eba205cf37abb390087933770",
"score": "0.6105119",
"text": "def review\n # unapproved post viewer\n # MAKE ADMIN ONLY\n @posts = Post.order(\"approved, created_at desc\")\n .paginate(per_page: 7, page: params[:page])\n end",
"title": ""
},
{
"docid": "ce25b2af1d41547b5ab1b0e4580d7878",
"score": "0.61039275",
"text": "def set_review\n @agency_review = Review.find(params[:review_id])\n end",
"title": ""
},
{
"docid": "0e773f9ed7bf1fa976ef5185851ff6ca",
"score": "0.60979414",
"text": "def reviews\n # output = []\n # Review.all.each do |review|\n # if review.user == self\n # output << review\n # end\n # end\n # output\n Review.all.select { |review| review.user == self }\n end",
"title": ""
},
{
"docid": "a0cec42622b6272f5640067cd8dc930e",
"score": "0.6095504",
"text": "def get_Reviews(clean_isbn)\n\t\t# amazon_reviews = Amazon.new\n\t\t# amazon_reviews.get_amazon_review(clean_isbn)\n\t\tgreads_reviews = Getting_Goodreads_Reviews::Greads.new\n\t\tgreads_reviews.all_greads_reviews(clean_isbn)\nend",
"title": ""
},
{
"docid": "2ae83f8f6f26f05077b1164591ca377b",
"score": "0.6094071",
"text": "def determine_active_critics\n \tresult = Critic.all\n \tresult.each do | critic |\n \t\treviews_1_year_ago = critic.critic_movies.where(\"date > ?\", 2.year.ago)\n \t\tif reviews_1_year_ago.any?\n \t\t\tcritic.active = true\n \t\t\tputs critic.first_name + critic.last_name + \" is active\"\n \t\telse\n \t\t\tcritic.active = false\n \t\t\tputs critic.first_name + critic.last_name + \" is not active\"\n\n \t\tend\n \t\tcritic.save\n \tend\n end",
"title": ""
},
{
"docid": "a489a4a253fac4334ad935af89530dfa",
"score": "0.6092203",
"text": "def reviewed?(profile)\n self.reviews.find_by_profile_id(profile.id)\n end",
"title": ""
},
{
"docid": "4fb2dfefa7b4ceb96e0b6d536325ed5c",
"score": "0.60848105",
"text": "def set_reviews\n @book = Book.find(params[:book_id])\n end",
"title": ""
},
{
"docid": "8ab4e08e0c8390bce601056e799df05a",
"score": "0.608078",
"text": "def schedule_next_review\n self.next.save! if just_reviewed?\n end",
"title": ""
},
{
"docid": "3259d413acae254af612e79c75967b71",
"score": "0.60789835",
"text": "def review_complete?\n self.review_status_id == ReviewStatus.find(:first,\n :conditions => \"name='Review Completed'\").id\n end",
"title": ""
},
{
"docid": "5495d0346f6c626156c601df2f4c5096",
"score": "0.6077867",
"text": "def update_review(movie, status)\n\tcheck = user_already_reviewed(movie)\n\t#if none returns 0\n\tif check == -1\n\t @update_review = 0\n\t#else returns the review id \n\telse\n\t reviewFound = movie.reviews.where('user_id' => current_user.id).first\n\t @update_review = reviewFound.id\n\tend\nend",
"title": ""
},
{
"docid": "3ce6f7b149b91357f8bde6b9d227d6a2",
"score": "0.60751814",
"text": "def index\n\t\t\t\t# @reviews = Driver.find_by!(id: params[:driver_id]).driver_reviews#.order('created_at DESC').to_a\n\t\t\t\t@reviews = DriverReview.where(driver_id: params[:driver_id])\n\t\t\tend",
"title": ""
},
{
"docid": "b6d4d4bf3ba38eafe5aa5341da8097b7",
"score": "0.6074372",
"text": "def count_scorable_city_reviews \n # Below - Collects all the scorable reviews to count for the city\n city_reviews = self.city_reviews.select do |review| \n review.is_scorable_review? == true\n end \n return city_reviews.count\n end",
"title": ""
},
{
"docid": "9102f2eb8f54b8e8872721db486cb281",
"score": "0.60727525",
"text": "def create\n @review = Review.new(review_params)\n @review.exceptional ||= 0\n if @review.save\n @apn.update_attribute(:reviewed, true)\n link = reviews_path\n name = @apn.profile.first_name.capitalize + \" \".to_s + @apn.profile.last_name.capitalize\n redirect_to new_review_path, notice: (\"#{name} successfully reviewed.\" +\n \" New application loaded. If you're feeling lazy, <a href='#{link}'>\" +\n \"go to the Dashboard</a>\").html_safe\n else\n render action: \"new\", alert: \"something went wrong with submitting the review\"\n end\n end",
"title": ""
},
{
"docid": "78eb8f95547a34de76f5d1b84c06683d",
"score": "0.6072118",
"text": "def reviewed?(restaurant, options = {})\n self.reviews.of_restaurant(restaurant, options).first\n end",
"title": ""
},
{
"docid": "6b999fbee7723c90a988b4066eb1daa7",
"score": "0.6069241",
"text": "def fetch_reviews(software_id, store, pageNumber=0, *previous)\n reviews = []\n\n # If passed a list of reviews then use that an add any new ones to it\n if previous.length > 0\n reviews = previous[0]\n end\n\n # TODO: parameterize type=Purple+Software\n # TODO: parameterize sortOrdering\n # Valid sortOrdering options are:\n # 0/1 = Most Helpful\n # 2 = Most Favorable\n # 3 = Most Critical\n # 4 = Most Recent\n cmd = sprintf(%{curl -s -A \"iTunes/9.2 (Macintosh; U; Mac OS X 10.6\" -H \"X-Apple-Store-Front: %s-1\" } <<\n %{'https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?} <<\n %{sortOrdering=1&type=Purple+Software&mt=8&id=%s&pageNumber=%s' | xmllint --format --recover - 2>/dev/null},\n store[:id],\n software_id,\n pageNumber)\n\n rawxml = `#{cmd}`\n\n\n if defined?(DEBUG) && DEBUG_SAVE_SOURCE_XML == true\n open(\"appreview.#{software_id}.#{store[:id]}.#{pageNumber}.xml\", 'w') { |f| f.write(rawxml) }\n end\n\n doc = Hpricot.XML(rawxml)\n\n # Get current page nr\n currentPage = getCurrentPage(doc)\n # Get total number of pages\n numberOfPages = getNumberOfPages(doc)\n\n doc.search(\"Document > View > ScrollView > VBoxView > View > MatrixView > VBoxView:nth(0) > VBoxView > VBoxView\").each do |e|\n review = {}\n\n strings = (e/:SetFontStyle)\n meta = strings[2].inner_text.split(/\\n/).map { |x| x.strip }\n\n # Note: Translate is sensitive to spaces around punctuation, so we make sure br's connote space.\n review[:rating] = e.inner_html.match(/alt=\"(\\d+) star(s?)\"/)[1].to_i\n review[:author] = meta[3]\n review[:version] = meta[7][/Version (.*)/, 1] unless meta[7].nil?\n review[:date] = meta[10]\n review[:subject] = strings[0].inner_text.strip\n review[:body] = strings[3].inner_html.gsub(\"<br />\", \"\\n\").strip\n\n reviews << review\n end\n\n # If there are more review pages to go, then go fetch and parse the next one, if not then return the list\n if (pageNumber + 1) < numberOfPages\n fetch_reviews(software_id, store, pageNumber + 1, reviews)\n else\n return reviews\n end\nend",
"title": ""
},
{
"docid": "e73f65ef48228ecfdd4198bb0b872365",
"score": "0.6068235",
"text": "def pending_review\n reviews = Review.where(\"stage != ?\", \"approved\")\n all_cps_under_review = []\n user_cps_under_review = []\n\n reviews.each do |review|\n all_cps_under_review << review.critical_process\n end\n\n all_cps_under_review.each do |cp|\n if self.cps_as_reviewer.include?(cp)\n user_cps_under_review << cp\n end\n end\n\n return user_cps_under_review\n end",
"title": ""
},
{
"docid": "3bfcce3b4944400fcaa36d1d9077087d",
"score": "0.6061596",
"text": "def reviewoftheday\n @review = Rails.env.development? ? Review.first : Review.where(review_of_the_day: Date.today).first\n if params[:number_of_clicks]\n \tif params[:tipo] == \"iframe\"\n \t\t@review.number_of_iframe_clicks += params[:number_of_clicks].to_i\n\t \t@review.save!\n\t elsif params[:tipo] == \"home\"\n\t \t@review.number_of_home_clicks += params[:number_of_clicks].to_i\n\t \t@review.save!\n \tend\n end\n\n expires_in 6.hours\n fresh_when @review\n\n end",
"title": ""
},
{
"docid": "ecd9f57f5686dc44f4494dec15f90c12",
"score": "0.60609305",
"text": "def ratings(number_of_reviews)\n\t\treturn true if number_of_reviews > 0\n\tend",
"title": ""
},
{
"docid": "0286395b0c6a5fe9abdeda34a6d664fb",
"score": "0.6059721",
"text": "def do_quick_approx_propagation\n story = @review.story\n if story.reviews_count < 2\n story.rating = @review.rating\n story.save(false)\n end\n end",
"title": ""
},
{
"docid": "13a3f7f89b24f9ff8af2516fdc049e76",
"score": "0.605971",
"text": "def reviews(id, review_type='top_critic', page_limit='20', page='1', country='us')\n results = self.class.get(\"/movies/#{id}/reviews.json\", :query => {:review_type => review_type, :page_limit => page_limit, :page => page, :country => country}).parsed_response\n return results\n end",
"title": ""
},
{
"docid": "5ec0d303ee66cc475ab4f7acd9de6b4b",
"score": "0.6058734",
"text": "def find_reviews(brewery)\n brewery.reviews\n end",
"title": ""
},
{
"docid": "0fac931c224fe6dc5b215cd218457c49",
"score": "0.605584",
"text": "def reviewed_books\n self.reviews.map{|r| r.book}\n end",
"title": ""
},
{
"docid": "890c342b06ce40ed50ab2463b1a88e13",
"score": "0.6052753",
"text": "def reviews\n @items = ProductComment.includes(:account).where({product: @product}).all\n end",
"title": ""
}
] |
47f55e957b6b50bb3a0663b669017f47
|
Sorting behavior for studies
|
[
{
"docid": "ecbab82736a7bf1eb0d1b57f37e0f301",
"score": "0.700002",
"text": "def order\n order = sortable_column_order do |column, direction|\n case column\n when \"name\"\n \"LOWER(studies.name) #{direction}\"\n when \"active\", \"public\", \"promoted\"\n \"studies.#{column} #{direction}\"\n else\n 'LOWER(studies.name) ASC'\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "3a19ceba7cdcb752bb2cba11e625d9c2",
"score": "0.7074818",
"text": "def sort_by\n end",
"title": ""
},
{
"docid": "77f7d0e9c0de6dc934c0adc52864a665",
"score": "0.704429",
"text": "def secondary_sort\n # This function is empty as it's a placeholder for custom code...\n end",
"title": ""
},
{
"docid": "b22b3546c20a91573ef3c2c8c18b3a0f",
"score": "0.6941152",
"text": "def main_sort_running_order; end",
"title": ""
},
{
"docid": "8f26dd2635c1eb29aca80bc1bd5bd467",
"score": "0.68739474",
"text": "def sort_method; end",
"title": ""
},
{
"docid": "b66eefef3423b43e3a85240c573376d9",
"score": "0.6859614",
"text": "def sort_entries; end",
"title": ""
},
{
"docid": "b0b212c1d5230a9b8d9562c050ef7d4f",
"score": "0.68054044",
"text": "def sort!\n # no op\n end",
"title": ""
},
{
"docid": "2363161df98d01a39ea8d448d0d94311",
"score": "0.67840976",
"text": "def sort!\n # define sorting heuristics in a subclass\n end",
"title": ""
},
{
"docid": "5b571f9e893bc72af853010c8811b2b9",
"score": "0.6771348",
"text": "def sort_cohort\n\t@students.sort_by! { |student| [student[:cohort], student[:name], student[:nationality]] }\n\tremove_false_students(@students)\nend",
"title": ""
},
{
"docid": "7cf7ee9455e9abb3b0b46e91ea294c0b",
"score": "0.6741028",
"text": "def sort_parts!; end",
"title": ""
},
{
"docid": "d2e34790a5f00c7b936666332829e97b",
"score": "0.6690748",
"text": "def main_sort_copy; end",
"title": ""
},
{
"docid": "bd91c5144eb45e67a1a3648de1e5f34e",
"score": "0.6689343",
"text": "def insertion_sort\n end",
"title": ""
},
{
"docid": "e7b663fbb8195f18a964090afd1c04a0",
"score": "0.6655022",
"text": "def sort_params; end",
"title": ""
},
{
"docid": "e7b663fbb8195f18a964090afd1c04a0",
"score": "0.6655022",
"text": "def sort_params; end",
"title": ""
},
{
"docid": "5c710d6e77021b12e2316e692a119128",
"score": "0.66416526",
"text": "def sort\n super.defer\n end",
"title": ""
},
{
"docid": "f34ec40c5e4e0ce18b05d0646906f027",
"score": "0.664099",
"text": "def sort_it\n array_to_sort = []\n @students.collect.with_index { |stud, index| array_to_sort << [\"#{index}\", \"#{stud[:cohort]}\"] }\n array_to_sort = array_to_sort.sort_by { |a| a[1] }\n sorted_array = []\n array_to_sort.each do |x|\n sorted_array << @students[x[0].to_i]\n end\n @students = sorted_array\nend",
"title": ""
},
{
"docid": "c9d3e8a8160f8fcce42ae61c54ad66af",
"score": "0.655228",
"text": "def sort_direction\n end",
"title": ""
},
{
"docid": "78da83e8634ac479900e28b2cf01e360",
"score": "0.6549788",
"text": "def scenarios_sort\n @test = @semester.test_sets.find(params[:id])\n @test.scenarios.each do |scenario|\n scenario.position = params['sortable'].index(scenario.id.to_s) +1\n scenario.save\n end\n render :nothing => true\n end",
"title": ""
},
{
"docid": "f97ab9efaa75a0ae827aa4e4dbd99cd8",
"score": "0.6527782",
"text": "def sort_summaries\n if type_set == 'categorical'\n # the categorical group should be sorted by option set name, then rank\n @summaries.sort_by!{|s| [s.questioning.option_set.name, s.questioning.rank]}\n\n else\n # else just sort by rank\n @summaries.sort_by!{|s| s.questioning.rank}\n end\n end",
"title": ""
},
{
"docid": "288975bb654deeb64ce92cc3b5996244",
"score": "0.65246177",
"text": "def match_when_sorted?; end",
"title": ""
},
{
"docid": "7ca6076ee6789723409405dbca44168a",
"score": "0.651883",
"text": "def sort_data\n store.sort_data!\n end",
"title": ""
},
{
"docid": "632f5faa62878d160e609e76c4bbc685",
"score": "0.6488241",
"text": "def sort_by_cohort\n\n @students.sort_by! {|student| student[:cohort]}\nend",
"title": ""
},
{
"docid": "5d3ee80ec89eab84837b19d0ec2f2025",
"score": "0.64630306",
"text": "def sort_cohort(students)\n\tstudents.sort_by! { |student| [student[:cohort], student[:name], student[:nationality]] }\n\tprint_students(students)\nend",
"title": ""
},
{
"docid": "80d6855b536dd3bf55889293d1001830",
"score": "0.6448197",
"text": "def apply_sorting\n if spec = criteria.options[:sort]\n in_place_sort(spec)\n end\n end",
"title": ""
},
{
"docid": "80d6855b536dd3bf55889293d1001830",
"score": "0.6448197",
"text": "def apply_sorting\n if spec = criteria.options[:sort]\n in_place_sort(spec)\n end\n end",
"title": ""
},
{
"docid": "05e2aaa2190c0b5e9a3f21486d1c26dc",
"score": "0.6446059",
"text": "def sean_sort(numbers)\n\n\nend",
"title": ""
},
{
"docid": "396f2144345bfbcf4f56904d1134de76",
"score": "0.6444527",
"text": "def sort_text; end",
"title": ""
},
{
"docid": "3d479906fbbd6c9b818a7686fb72ab55",
"score": "0.6437402",
"text": "def sort(spec = nil)\n configure(:sort, spec)\n end",
"title": ""
},
{
"docid": "dbf1e24852d227965390964deb65470c",
"score": "0.64185965",
"text": "def sort_by\n super.defer\n end",
"title": ""
},
{
"docid": "67f4018b090981168fe1919b682d6d53",
"score": "0.6413871",
"text": "def merge_sort\nend",
"title": ""
},
{
"docid": "db6a83b9efb5b1a780654b7cf529275b",
"score": "0.6388514",
"text": "def display_sorted\nend",
"title": ""
},
{
"docid": "65c3d885fcb4124af98b6d79f5d76ef8",
"score": "0.6354409",
"text": "def merge_sort()\nend",
"title": ""
},
{
"docid": "243cbff41af2e8b70a22edd3981bc149",
"score": "0.63461506",
"text": "def sort(a)\n case a[0]\n when PATTERNS['ant']; sort_ants(a)\n when PATTERNS['antpol']; sort_antpols(a)\n when PATTERNS['sta']; sort_stas(a)\n when PATTERNS['stapol']; sort_stapols(a)\n else\n a.sort\n end\n end",
"title": ""
},
{
"docid": "5b69602a57ab57141b4443056d95e582",
"score": "0.6341378",
"text": "def sort_entries=(_arg0); end",
"title": ""
},
{
"docid": "52158fd77045600ffe1195bf0d215a4c",
"score": "0.63225704",
"text": "def model_sortings\n fail 'unimplemented method model_sortings'\n end",
"title": ""
},
{
"docid": "dd6fd6570270e54dc72555ada9dfc1e6",
"score": "0.6304315",
"text": "def main_sort_big_done; end",
"title": ""
},
{
"docid": "f6a37dee8dabfd55036df47bb21a51a9",
"score": "0.630386",
"text": "def sort_by_major\n sort_by 'Major'\n end",
"title": ""
},
{
"docid": "054a2fbd551f12c08b59c5d04240c6fd",
"score": "0.62942034",
"text": "def sort!\n collection.sort_by!(&:name)\n end",
"title": ""
},
{
"docid": "054a2fbd551f12c08b59c5d04240c6fd",
"score": "0.62942034",
"text": "def sort!\n collection.sort_by!(&:name)\n end",
"title": ""
},
{
"docid": "df8ebbc1c591323cd85c50328186462e",
"score": "0.6289359",
"text": "def sort_array",
"title": ""
},
{
"docid": "42d2566d1dfd7495fd9395612660e386",
"score": "0.62847304",
"text": "def resort\r\n @ls.set_sort_column_id(0)\r\n @ls.set_sort_func(0, &lambda{|iter1, iter2|\r\n item_id_1 = iter1[1].to_i\r\n item_id_2 = iter2[1].to_i\r\n \r\n item_name_1 = iter1[0].to_s.downcase\r\n item_name_2 = iter2[0].to_s.downcase\r\n \r\n if item_id_1 == 0\r\n return -1\r\n elsif item_id_2 == 0\r\n return 1\r\n else\r\n return item_name_1 <=> item_name_2\r\n end\r\n })\r\n end",
"title": ""
},
{
"docid": "bf6d26bfcd1a77b88c143e8d03a675cc",
"score": "0.62672174",
"text": "def sort_params=(_arg0); end",
"title": ""
},
{
"docid": "bf6d26bfcd1a77b88c143e8d03a675cc",
"score": "0.62672174",
"text": "def sort_params=(_arg0); end",
"title": ""
},
{
"docid": "c310e6276707c6ac97655ef3661ebcb0",
"score": "0.62621427",
"text": "def sortData\n @movies.each { |movie| movie.filtered_subtitles.sortUsingDescriptors(@outline.sortDescriptors) }\n @movies.sortUsingDescriptors(@outline.sortDescriptors)\n end",
"title": ""
},
{
"docid": "854634415dc67e9a225f6f9148de1742",
"score": "0.6256064",
"text": "def ordered_topologically\n PostSort.new(self)\n end",
"title": ""
},
{
"docid": "efa05fe98f51acc1d01e56ff223f3306",
"score": "0.62507516",
"text": "def default_sort\n facet_tags? ? 'revised_at' : '_score'\n end",
"title": ""
},
{
"docid": "792d02126ea22d06bff1b94be247fcdd",
"score": "0.62428725",
"text": "def apply_default_sort(campaign, influencers)\n # Sort option by influencers' influential\n if ((campaign.sports ? 1 : 0 )+ (campaign.travel ? 1 : 0 ) +\n (campaign.luxury ? 1 : 0 )+ (campaign.technology ? 1 : 0) +\n (campaign.politics ? 1 : 0 )+ (campaign.fashion ? 1 : 0 ) +\n (campaign.music ? 1 : 0 )+ (campaign.movies ? 1 : 0 ) == 1)\n influencers = influencers.order(\"sports_influential desc\") if campaign.sports\n influencers = influencers.order(\"travel_influential desc\") if campaign.travel\n influencers = influencers.order(\"technology_influential desc\") if campaign.technology\n influencers = influencers.order(\"politics_influential desc\") if campaign.politics\n influencers = influencers.order(\"fashion_influential desc\") if campaign.fashion\n influencers = influencers.order(\"luxury_influential desc\") if campaign.luxury\n influencers = influencers.order(\"music_influential desc\") if campaign.music\n influencers = influencers.order(\"movies_influential desc\") if campaign.movies\n end\n if ((campaign.moms ? 1 : 0 )+ (campaign.teens ? 1 : 0 ) +\n (campaign.college_students ? 1 : 0 )+ (campaign.young_men ? 1 : 0 ) +\n (campaign.young_women ? 1 : 0 )+ (campaign.adult_men ? 1 : 0 ) +\n (campaign.adult_women ? 1 : 0 ) == 1)\n influencers = influencers.order(\"moms_influential desc\") if campaign.moms\n influencers = influencers.order(\"teens_influential desc\") if campaign.teens\n influencers = influencers.order(\"college_influential desc\") if campaign.college_students\n influencers = influencers.order(\"young_men_influential desc\") if campaign.young_men\n influencers = influencers.order(\"young_women_influential desc\") if campaign.young_women\n influencers = influencers.order(\"adult_men_influential desc\") if campaign.adult_men\n influencers = influencers.order(\"adult_women_influential desc\") if campaign.adult_women\n end\n\n # Sort option for sex\n if campaign.males && !campaign.females\n influencers = influencers.order(\"males_count desc\")\n elsif campaign.females && !campaign.males\n influencers = influencers.order(\"females_count desc\")\n end\n\n # Sort options for age\n columns = []\n columns << \"audiences.moms_count\" if campaign.moms\n columns << \"audiences.teens_count\" if campaign.teens\n columns << \"audiences.college_students_count\" if campaign.college_students\n columns << \"audiences.young_women_count\" if campaign.young_women\n columns << \"audiences.young_men_count\" if campaign.young_men\n columns << \"audiences.adult_women_count\" if campaign.adult_women\n columns << \"audiences.adult_men_count\" if campaign.adult_men\n if columns.size > 0\n influencers = influencers.select(\"(#{columns.join(' + ')}) as sum_age\").order('sum_age desc')\n end\n\n # Sort options for hobbies\n columns = []\n columns << \"audiences.sports_count\" if campaign.sports\n columns << \"audiences.fashion_count\" if campaign.fashion\n columns << \"audiences.music_count\" if campaign.music\n columns << \"audiences.movies_count\" if campaign.movies\n columns << \"audiences.politics_count\" if campaign.politics\n columns << \"audiences.technology_count\" if campaign.technology\n columns << \"audiences.travel_count\" if campaign.travel\n columns << \"audiences.luxury_count\" if campaign.luxury\n if columns.size > 0\n influencers = influencers.select(\"(#{columns.join(' + ')}) as sum_hobbies\").order('sum_hobbies desc')\n end\n\n influencers.order('audiences.followers desc')\n end",
"title": ""
},
{
"docid": "d23010460776cc5ebc822d42588292c4",
"score": "0.6242635",
"text": "def sort_articles\n\t\tpercentile_dates\n\t\tpercentile_popularity\n\t\tcheck_trending_spike\n\t\t@articles = @articles.sort_by{|a| (a.days_percentile+a.pop_percentile)*a.trending_month_factor}.reverse\n\tend",
"title": ""
},
{
"docid": "39e9940b95395c2926f315c654a0e88d",
"score": "0.6242149",
"text": "def savesortby()\n merge(vtlsavesortby: 'true')\n end",
"title": ""
},
{
"docid": "14c63d64b4adc674a7c2dae67e6eea47",
"score": "0.6241511",
"text": "def apply_common_sorting\r\n\t\tsorting_options = self.search_options[:sorting]\r\n\r\n\t\tsort_direction = sorting_options[:sort_direction] ? sorting_options[:sort_direction].upcase : ''\r\n\t\tsort_name = sorting_options[:sort_name] ? sorting_options[:sort_name].upcase : ''\r\n\r\n\t\tcase sort_direction\r\n\t\twhen \"DESC\"\r\n\t\t\tsort_direction = \"DESC\"\r\n\t\twhen \"ASC\"\r\n\t\t\tsort_direction = \"ASC\"\r\n\t\telse\r\n\t\t\tif sorting_options[:default_sort_direction]\r\n\t\t\t\tsort_direction = sorting_options[:default_sort_direction]\r\n\t\t\telse\r\n\t\t\t\tsort_direction = \"ASC\"\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\tcase sort_name.upcase\r\n\t\twhen \"SOCIAL\"\r\n\t\t\tsort_name = \"social_score\"\r\n\t\twhen \"PARTICIPATION\"\r\n\t\t\tsort_name = \"participation_rate\"\r\n\t\twhen \"PROFIT\"\r\n\t\t\tsort_name = \"profit\"\r\n\t\twhen \"REVENUE\"\r\n\t\t\tsort_name = \"revenue\"\r\n\t\twhen \"VOTEDATE\"\r\n\t\t\tif(sorting_options[:vote_date_column])\r\n\t\t\t\tsort_name = sorting_options[:vote_date_column]\r\n\t\t\telse\r\n\t\t\t\tsort_name = \"updated_at\"\r\n\t\t\tend\r\n\t\twhen \"NAME\"\r\n\t\t\tif(sorting_options[:name_column])\r\n\t\t\t\tsort_name = sorting_options[:name_column]\r\n\t\t\telse\r\n\t\t\t\tsort_name = \"name\"\r\n\t\t\tend\r\n\t\telse\r\n\t\t\tif(sorting_options[:default_sort_order])\r\n\t\t\t\tsort_name = sorting_options[:default_sort_order]\r\n\t\t\telse\r\n\t\t\t\tsort_name =\"name\"\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\tself.search_object = self.search_object.order(\"#{sort_name} #{sort_direction}\")\r\n\tend",
"title": ""
},
{
"docid": "780f6c8c05ce30054634c90b4e0f1f9d",
"score": "0.62357324",
"text": "def set_sorting!\n return unless faceted || collected || options[:sort_column].present?\n \n unless sort_values.include?(options[:sort_column])\n options[:sort_column] = 'revised_at'\n end\n \n options[:sort_direction] ||= sort_direction(options[:sort_column]).downcase\n options[:sort_direction] = \"desc\" unless options[:sort_direction] == \"asc\"\n end",
"title": ""
},
{
"docid": "97fabb34d8be5c362a20ffa437531a24",
"score": "0.62357223",
"text": "def sort(snippets)\n snippets.sort_by { |s| [s.tab_trigger.to_s.downcase, s.name.to_s.downcase] }\n end",
"title": ""
},
{
"docid": "53d7cdede1cab271d29598b34028f65f",
"score": "0.62260175",
"text": "def sort_cats(suitable_cats)\r\n suitable_cats.sort_by! {|cat| cat.criteria_matches}\r\n suitable_cats.reverse\r\nend",
"title": ""
},
{
"docid": "4eaa77efa62bbc02a86f4a6baa54bba3",
"score": "0.62183857",
"text": "def index\n @studies = Study.order(:priority)\n end",
"title": ""
},
{
"docid": "ace49f28f3a55ba16435962358f33038",
"score": "0.62136465",
"text": "def sort\n build(ast.sort)\n end",
"title": ""
},
{
"docid": "ca6c4c1adf18638ebbcfa503a8d244e0",
"score": "0.6208232",
"text": "def sort_order\n lft\n end",
"title": ""
},
{
"docid": "136fd0a003469b22195537209f3625c4",
"score": "0.6203734",
"text": "def default_sort(results)\n results\n end",
"title": ""
},
{
"docid": "243202806e47be67ecc5671dcdadac10",
"score": "0.62002033",
"text": "def ascending(metadata); end",
"title": ""
},
{
"docid": "59fa6ae44979577590c84ddc71bacaea",
"score": "0.6195575",
"text": "def sort\n return @sort\n end",
"title": ""
},
{
"docid": "23cf9cb4a6d6b057cdbaf2c3699d61e4",
"score": "0.61955726",
"text": "def sort\n fold_subtasks\n if @options[:reverse]\n @data.sort! { |a,b| a[1] <=> b[1] }\n else\n @data.sort! { |a,b| b[1] <=> a[1] }\n end\n unfold_subtasks\n end",
"title": ""
},
{
"docid": "5094a47523245dca82bc2367476d2cc9",
"score": "0.6191151",
"text": "def apply_sorting(arel, sort)\n case sort\n when \"created_asc\" then arel.oldest\n when \"created_desc\" then arel.newest\n when \"updated_asc\" then arel.stagnant\n when \"updated_desc\" then arel.lively\n else\n arel.lively\n end\n end",
"title": ""
},
{
"docid": "1b78ae3f09f1e5be0b001e735463f2f6",
"score": "0.6191123",
"text": "def sort\n search_state.sort_field&.sort\n end",
"title": ""
},
{
"docid": "40019c71a1502074570847f3e3ff397e",
"score": "0.6179706",
"text": "def get_comparison_entries\n return Comparison.where(:study_id=>self.id).order(\"outcome_id ASC\",\"subgroup_id ASC, section ASC, group_id ASC\")\n end",
"title": ""
},
{
"docid": "da589cdd3388a6152c03c4ba40b6b0d7",
"score": "0.61765736",
"text": "def default_sort_criteria\n [['spent_on', 'desc']]\n end",
"title": ""
},
{
"docid": "2e61563b109ba33f965447442d685f61",
"score": "0.61727625",
"text": "def sorting_hat\n @list_three = @list_three.sort_by { |song|\n [song.impression,\n -song.info_seen,\n -song.positive_feedback,\n song.skip] }\n\n @list_two = @list_two.sort_by { |song|\n [song.impression,\n -song.info_seen,\n -song.positive_feedback,\n song.skip] }\n\n @list_one = @list_one.sort_by { |song|\n [song.impression,\n -song.info_seen,\n -song.positive_feedback,\n song.skip] }\n end",
"title": ""
},
{
"docid": "422a6fd578b771db28e5bc8f194175fd",
"score": "0.6168843",
"text": "def kw_sort\n self.sort do |a, b|\n KW_ORDER_CACHE.fetch(a, a) <=> KW_ORDER_CACHE.fetch(b, b)\n end\n end",
"title": ""
},
{
"docid": "2ac911425461c30973923764dc2a3480",
"score": "0.6162369",
"text": "def sort_by\n @config.sort_by\n end",
"title": ""
},
{
"docid": "99d6fa8c282ac576b1775a8f63b78d19",
"score": "0.6136247",
"text": "def sort\n shifter = :datapoints\n sorted = super\n sorted[shifter] = sorted.delete(shifter)\n sorted\n end",
"title": ""
},
{
"docid": "e784ae7ed6295429093164e7ac2150c4",
"score": "0.61342555",
"text": "def kw_sort\n self.sort do |a, b|\n a = \"@#{KW_ORDER.index(a)}\" if KW_ORDER.include?(a)\n b = \"@#{KW_ORDER.index(b)}\" if KW_ORDER.include?(b)\n a <=> b\n end\n end",
"title": ""
},
{
"docid": "e784ae7ed6295429093164e7ac2150c4",
"score": "0.61342555",
"text": "def kw_sort\n self.sort do |a, b|\n a = \"@#{KW_ORDER.index(a)}\" if KW_ORDER.include?(a)\n b = \"@#{KW_ORDER.index(b)}\" if KW_ORDER.include?(b)\n a <=> b\n end\n end",
"title": ""
},
{
"docid": "861d5cdb0311b68ece41e5c5048aed05",
"score": "0.6121046",
"text": "def add_hierarchy_sort(solr_params)\n solr_params[:sort] = 'sort_ii asc' if %w[online_contents collection_context child_components].include? blacklight_params[:view]\n solr_params\n end",
"title": ""
},
{
"docid": "909cb596527036a10c2f58bba9c33eed",
"score": "0.61171895",
"text": "def sort_using_rank\n score.arranged_hand\n end",
"title": ""
},
{
"docid": "65ce1b9e12b3bc914fc5bfdc32b5298e",
"score": "0.6111782",
"text": "def sort_sanatize(sort)\n\n\t\tsort = sort.to_s.strip.upcase\n\n\t\t#if it matches DESC or DSC\n\t\tif sort =~ /\\ADE?SC\\Z/\n\t\t\treturn 'DESC'\n\t\telse\n\t\t\treturn 'ASC'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1ac02f1c271955fccc4a01c96b311548",
"score": "0.61053807",
"text": "def sort_by_share_asc\n logger.info 'Sorting by \"Share\" ascending'\n wait_for_update_and_click_js sort_by_share_element\n sort_by_share unless sort_asc?\n end",
"title": ""
},
{
"docid": "418e4910e7fb50db64342d6cb197f20f",
"score": "0.61052054",
"text": "def sort_by_qualifications(candidates)\n # sort by years_of_experience\n # then sort by github_points\nend",
"title": ""
},
{
"docid": "dc2bea2276023f9c5224835f0786cca1",
"score": "0.6100986",
"text": "def word_sort\n result = nil\n result = self.seperate.sort\n result\n end",
"title": ""
},
{
"docid": "7706e905e0e8f254d7ab1d85ae3a3d8c",
"score": "0.6096726",
"text": "def sort_by_team\n sort_by 'Team'\n end",
"title": ""
},
{
"docid": "cc0accdc9e282bf968492121f70dca45",
"score": "0.6096578",
"text": "def sorted_sage_utilities\n sage_utilities.sort_by { |h| h[:title] }\n end",
"title": ""
},
{
"docid": "22c8465692ffc05afac5a37421261a66",
"score": "0.6095207",
"text": "def natural_sort\n NaturalSort::Engine.sort(self)\n end",
"title": ""
},
{
"docid": "2bc1a300c6f4b81e74f88525aba1e9da",
"score": "0.6080838",
"text": "def sort_column\n end",
"title": ""
},
{
"docid": "2bc1a300c6f4b81e74f88525aba1e9da",
"score": "0.6080838",
"text": "def sort_column\n end",
"title": ""
},
{
"docid": "e288764cf5325036a34ae0af2a87f699",
"score": "0.60796726",
"text": "def sort\n @individuals.sort!{|a,b| a.score <=> b.score}\n end",
"title": ""
},
{
"docid": "72aa19f2a646297928936bd2475ed9de",
"score": "0.60769504",
"text": "def my_array_sorting_method(source)\n \nend",
"title": ""
},
{
"docid": "57761d2d30268877d589dd4533dba44b",
"score": "0.6067442",
"text": "def sorted_results\n if @config[\"sort_method\"] == \"alphabetical\"\n @results.sort_by { |c| c[0] }\n elsif @config[\"sort_method\"] == \"expiration\"\n @results.sort_by { |c| c[1] }\n else # default to alphabetical\n @results.sort_by { |c| c[0] }\n end\n end",
"title": ""
},
{
"docid": "032540e9e27ee4e91817f48fa48f3c70",
"score": "0.60605717",
"text": "def sort_students\n self.students.sort_by{|student| student.name.downcase}\n end",
"title": ""
},
{
"docid": "6b25d1d3121cf2cc2c82214b8504ca57",
"score": "0.6059647",
"text": "def ext_sort\n partition_file\n Merger.merge\n end",
"title": ""
},
{
"docid": "6714e46e52fb72fdef03ef853b92655a",
"score": "0.6058388",
"text": "def sort\n dup.sort!\n end",
"title": ""
},
{
"docid": "4aa38032bfce2ff0e549d9b9102783c8",
"score": "0.6043382",
"text": "def sort_tours(params, alg)\n @filters = Tour::FILTERS\n if params[:sort] && @filters.collect{|f| f[:scope]}.include?(params[:sort])\n @tours = Tour.unscoped{ Tour.where(alg).send(params[:sort]) }\n else\n @tours = Tour.where(alg)\n end\n end",
"title": ""
},
{
"docid": "bafd43988b4bc699f1271f4444f1d5a3",
"score": "0.6041795",
"text": "def add_hierarchy_sort(solr_params)\n solr_params[:sort] = 'sort_ii asc' if %w[hierarchy online_contents].include? blacklight_params[:view]\n solr_params\n end",
"title": ""
},
{
"docid": "8411b84f1bdc782720a7328314b41cad",
"score": "0.60408044",
"text": "def sort_criteria\n Stylist.column_names.include?(params[:sort]) ? params[:sort] : \"overall_rating\"\n end",
"title": ""
},
{
"docid": "af3b54be23a0f8a711e52558a94bb7a2",
"score": "0.60323834",
"text": "def sort!\n unless sorted?\n remove_replaced_files!\n self.sources = topsort\n @sorted = true\n end\n self\n end",
"title": ""
},
{
"docid": "520be8bdcb5ce91023dcd3b5619197a0",
"score": "0.6031059",
"text": "def sort!\n @events.sort!\n\n self\n end",
"title": ""
},
{
"docid": "d834ef0e37d7e8604eb131c56c1256cf",
"score": "0.60288626",
"text": "def mergeSort\n\nend",
"title": ""
},
{
"docid": "d458f2422408b9066fd1cdd032ecf13e",
"score": "0.6020619",
"text": "def _sort!\n unless @sorted\n @a.sort! do | a, b |\n x = a.name <=> b.name\n if x == 0\n x = b.version <=> a.version\n end\n x\n end\n @sorted = true\n end\n @a\n end",
"title": ""
},
{
"docid": "53bb1ec84030c6690c05b8fce64fed31",
"score": "0.6016414",
"text": "def sort_order\n -100\n end",
"title": ""
},
{
"docid": "b283ff9b329cabdcbb99cc9898e5d307",
"score": "0.60146797",
"text": "def sort_order\n if ministry_or_title == 'Prime Minister'\n 'AAAAA' # force first\n else\n ministry_or_title\n end\n end",
"title": ""
},
{
"docid": "c1e5bc574576c1b1f45f7d11a7358fe3",
"score": "0.60110825",
"text": "def sort_norm_data\n store.sort_norm_data!\n end",
"title": ""
},
{
"docid": "7f16cf45c7d88e51613d6afbcd0e1740",
"score": "0.6011042",
"text": "def my_array_sorting_method(source)\nend",
"title": ""
},
{
"docid": "6f9f7a2b467b9ea8d5dafc83a305d299",
"score": "0.600847",
"text": "def sort_table\n case @sort\n when :asc\n @table.sort\n when :desc\n @table.sort.reverse\n else\n @table\n end\n end",
"title": ""
},
{
"docid": "1f92f0a4d3179ef78462d94d9b135b15",
"score": "0.6005377",
"text": "def sort_collections_desc\n @orignal_pages = @orignal_pages.sort_by { |_key, value| -value }\n @no_id_pages = @no_id_pages.sort_by { |_key, value| -value }\n end",
"title": ""
},
{
"docid": "64395beadaf564e9e733431c8f631a47",
"score": "0.6003564",
"text": "def sort\n # Ist bereits sortiert!\n return self\n end",
"title": ""
}
] |
edc08f5f4d9217f22a0fc38f57df4480
|
GET /destinies/1 GET /destinies/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "c2cfae39aeffde72d2dae8f9fb1e633d",
"score": "0.6759688",
"text": "def index\n @destinies = Destiny.all\n end",
"title": ""
},
{
"docid": "b18a6f50cde8014128df56d75fac9a48",
"score": "0.64029735",
"text": "def index\n @destinations = Destination.all\n render json: @destinations.map(&:to_h)\n end",
"title": ""
},
{
"docid": "493743ef808b803a15d5fde958679dd3",
"score": "0.6377666",
"text": "def show\n @destination = Destination.find(params[:id])\n\n render json: @destination\n end",
"title": ""
},
{
"docid": "142761e34acb93c6e947f4c2d9ee6795",
"score": "0.62596667",
"text": "def index\n @destinations = @destineable.destinations\n @title = \"Tour routes and destinations\"\n end",
"title": ""
},
{
"docid": "ae1c14c9fba2dcfcff642a8a80525df3",
"score": "0.6231674",
"text": "def index\n @destinations = Destination.all\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @destinations}\n end\n end",
"title": ""
},
{
"docid": "210e8618071779ad8d15f5337c6be67f",
"score": "0.61971426",
"text": "def show\n user = User.find(params[:id])\n render json: user, include: :destinations\n end",
"title": ""
},
{
"docid": "587785bbadf3c74cf399a5a856455e60",
"score": "0.6056804",
"text": "def index\n\t @destinations = Destination.all\n\n\t respond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @destinations }\n\t end\n\tend",
"title": ""
},
{
"docid": "d3d6809e1421070d0c6e0e83cea412ba",
"score": "0.59964406",
"text": "def index\n @destinos = Destino.all\n end",
"title": ""
},
{
"docid": "d56775df559984ded7c15c7de90e1ab9",
"score": "0.59910005",
"text": "def index\n @destinations = Destination.all\n end",
"title": ""
},
{
"docid": "f69432907c2a745859264ee89618f5b8",
"score": "0.59903824",
"text": "def index\n @destinations = @agent.destinations\n respond_to do |format|\n format.html {render 'index.html', :layout => false}\n format.js {render 'index.js', :layout => false}\n format.json {render json: @destinations}\n end\n end",
"title": ""
},
{
"docid": "e3f6df60d45633400eae86b5d6463702",
"score": "0.5985486",
"text": "def show\n @destination = Destination.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @destination }\n end\n end",
"title": ""
},
{
"docid": "05cf9be8cd052e3ca6784e03721ea899",
"score": "0.5984041",
"text": "def show\n @trip = Trip.find(params[:trip_id])\n @destination = Destination.find(params[:id])\n \n respond_to do |format|\n format.html #show.html.erb\n format.json { render json: @destination}\n end\n end",
"title": ""
},
{
"docid": "abef64f7b10ba1e8b86a626ac0fb2b93",
"score": "0.59356606",
"text": "def index\n @destinations = Destination.order('id desc').paginate(:page => params[:page])\n end",
"title": ""
},
{
"docid": "7af5f92ef01d166202b8b7edbd5c4365",
"score": "0.5920687",
"text": "def index\n @prod_destinations = ProdDestination.all\n end",
"title": ""
},
{
"docid": "1795dea83b74c65f27e581c40135e893",
"score": "0.5880911",
"text": "def index\n @destaques = Destaque.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @destaques }\n end\n end",
"title": ""
},
{
"docid": "230fd388b12b72349678071966b92b90",
"score": "0.58735144",
"text": "def index\n @destinations = Destination.all\n end",
"title": ""
},
{
"docid": "2897e512697e6d9624c861528ba5f8de",
"score": "0.5857726",
"text": "def show\n @destination = @destineable.destinations.find(params[:id])\n @title = \"#{@destination.title} route\"\n # @destination = Destination.find(params[:id])\n end",
"title": ""
},
{
"docid": "9e764903f75bad5e9b002f872ab74d66",
"score": "0.5854671",
"text": "def show\n @destination = Destination.find(params[:id])\n respond_to do |format|\n format.html {render :show}\n format.json {render json: @destination}\n end\n end",
"title": ""
},
{
"docid": "d55348a9c394a85c471b4920bd429520",
"score": "0.5848754",
"text": "def detail \n \n @src_wine = Wine.find(params[:src_id]) \n @dst_wine = Wine.find(params[:dst_id]) \n \n \n respond_to do |format|\n format.html # dtail.html.erb\n format.json { render json: @wine }\n end \n end",
"title": ""
},
{
"docid": "e59d51cc0c255056dcd2b630ac29610d",
"score": "0.5832598",
"text": "def index\n @destinations = Destination.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "30ad4001c6f9c718aef50b8064088466",
"score": "0.58274704",
"text": "def show\n @destination = HTTParty.get('http://localhost:3000/destinations/'+params[:id])\n # binding.pry\n :show\n end",
"title": ""
},
{
"docid": "20a7816db8541f2eb2f5d484b2b6d065",
"score": "0.5807536",
"text": "def show\n @ship = Ship.find(params[:id])\n\t locations = Location.find :all\n\t @destinations = locations.reject { |l| l == @ship.location }\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship }\n end\n end",
"title": ""
},
{
"docid": "6b3aab7a3c1e064f30bddb706fc1fffb",
"score": "0.58039606",
"text": "def index\n @dest_locations = DestLocation.all\n end",
"title": ""
},
{
"docid": "9176d979802dfc37f303ccc4d0d471ac",
"score": "0.57704115",
"text": "def index\n @destinies = Destiny.accessible_by(current_ability)\n end",
"title": ""
},
{
"docid": "14bff886647c4fa13303affd538850c2",
"score": "0.5746808",
"text": "def show\n\t @destination = Destination.find(params[:id])\n\n\t respond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render json: @destination }\n\t end\n\tend",
"title": ""
},
{
"docid": "bf93da1671d73763a68be436f209dc2c",
"score": "0.57393956",
"text": "def index\n @request = Request.find(params[:request_id])\n if current_user.requisitante_transporte?\n if @request.status != \"EM ABERTO\"\n flash[:info] = \"Você não pode adicionar destinos a requisição atual.\"\n redirect_to requests_url\n end\n end\n @request_destinies = @request.request_destinies\n @request_destiny = @request.request_destinies.new\n end",
"title": ""
},
{
"docid": "88050f3d7d6cc8db034f6cef1a241d1c",
"score": "0.56740314",
"text": "def index\n @dresses = Dress.all\n\n render json: @dresses \n end",
"title": ""
},
{
"docid": "2088fd48ddcb2e18d1f2c32a8239802b",
"score": "0.5643521",
"text": "def index\n @tourist_destinations = TouristDestination.all\n end",
"title": ""
},
{
"docid": "7bc4a068fac6408d6684c16c5ff9be44",
"score": "0.5634183",
"text": "def destroy\n @destination = @organism.destinations.find(params[:id])\n @destination.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_organism_destinations_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d9224432796978157ecb106fed9b7d6b",
"score": "0.56305856",
"text": "def show\n @dress = Dress.find(params[:id])\n\n render json: @dress \n end",
"title": ""
},
{
"docid": "fad229aa691225fef6cbe80f7553e3c0",
"score": "0.5591014",
"text": "def index\n @destinations = Destination.all.sort { |a, b| a[:name] <=> b[:name] }\n end",
"title": ""
},
{
"docid": "b82c180671f731a560850f540f25a968",
"score": "0.5578242",
"text": "def index\n @destinations = Destination.all.order('created_at DESC')\n end",
"title": ""
},
{
"docid": "34de7cce9ccf8b9d6981d6e463f00ce6",
"score": "0.5571352",
"text": "def index\n @destinations = Destination.order(\"ancestry ASC\").page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @destinations }\n end\n end",
"title": ""
},
{
"docid": "47df83d8ac767ca15bf85603c0aaaae0",
"score": "0.55574733",
"text": "def destinations; end",
"title": ""
},
{
"docid": "fc09c69a758c21065b941c9d7fc71ee2",
"score": "0.5555805",
"text": "def index\n @dest_specials = DestSpecial.all\n end",
"title": ""
},
{
"docid": "b97ddf6d1de3a55bfaab998e314dd136",
"score": "0.5552729",
"text": "def show\n @trip_destination = TripDestination.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip_destination }\n end\n end",
"title": ""
},
{
"docid": "b45727ce9fa78b6090681128c3534234",
"score": "0.5544608",
"text": "def show\n @shipping_destination = ShippingDestination.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shipping_destination }\n end\n end",
"title": ""
},
{
"docid": "40881ab61dfda0476ee2f135b4e8ab4d",
"score": "0.5523145",
"text": "def find_destineable\n params.each do |name, value|\n if name =~ /(.+)_id$/\n @destineable = $1.classify.constantize.find(value)\n return @destineable\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "cbb19e64455d21dc8fb7f453689d2ea3",
"score": "0.55072826",
"text": "def show\n @destination = Destination.find(@trip[\"destination_id\"])\n end",
"title": ""
},
{
"docid": "913eec488bf2e431fb95191b1cb7f04a",
"score": "0.54913396",
"text": "def destiny\n respond_with InvDestiny.filtered_list(params[:q]).limit(5)\n end",
"title": ""
},
{
"docid": "1c5516d307b9ffdf84d215a0d88ad54a",
"score": "0.5488109",
"text": "def new\n @destination = @organism.destinations.new\n @destination.sector_id = @organism.sectors.first.id\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @destination }\n end\n end",
"title": ""
},
{
"docid": "21a7aca570c9d71ef2724c861ea5bd92",
"score": "0.54862165",
"text": "def index\n @destinatarios = apply_scopes(Destinatario).all\n end",
"title": ""
},
{
"docid": "3d06b24dd3a522b7c8ddf46cb4dfe9c8",
"score": "0.54733765",
"text": "def show\n\t@lake_dests = LakeDest.all\n end",
"title": ""
},
{
"docid": "7c83b2f1a6a8362e35ee9f4f28094f86",
"score": "0.54443574",
"text": "def get_destinations_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DispatchApi.get_destinations ...'\n end\n # resource path\n local_var_path = '/dispatch/destinations'\n\n # query parameters\n query_params = {}\n query_params[:'courseId'] = opts[:'course_id'] if !opts[:'course_id'].nil?\n query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?\n query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?\n query_params[:'datetimeFilter'] = opts[:'datetime_filter'] if !opts[:'datetime_filter'].nil?\n query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :csv) if !opts[:'tags'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil?\n query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'more'] = opts[:'more'] if !opts[:'more'].nil?\n query_params[:'includeTotalCount'] = opts[:'include_total_count'] if !opts[:'include_total_count'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['APP_NORMAL', '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 => 'DestinationListSchema')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DispatchApi#get_destinations\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e06b4841cae420d31cabdf8dadbac622",
"score": "0.54400194",
"text": "def destroy\n @destination = Destination.find(params[:id])\n @destination.destroy\n \n respond_to do |format|\n format.html { redirect_to @destineable }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b003a9eb2bd3970b9cd3bf9f79ea3da8",
"score": "0.5429415",
"text": "def update\n itinerary = Itinerary.find(params[:id])\n\n respond_to do |format|\n if itinerary.update_attributes(params[:itinerary])\n itinerary.destinations.delete_all\n params[:destinations].each { |address| itinerary.destinations << Destination.create( :address => address ) }\n format.json { render :json => [itinerary.as_json(:include => :destinations)] }\n else\n format.json { render json: itinerary.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6292a8c3025e6452e164c31752c5a990",
"score": "0.54209554",
"text": "def destroy\n @destination.destroy\n respond_to do |format|\n format.html { redirect_to destinations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6292a8c3025e6452e164c31752c5a990",
"score": "0.54209554",
"text": "def destroy\n @destination.destroy\n respond_to do |format|\n format.html { redirect_to destinations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6292a8c3025e6452e164c31752c5a990",
"score": "0.54209554",
"text": "def destroy\n @destination.destroy\n respond_to do |format|\n format.html { redirect_to destinations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9b86239626f786d9ab58716a0c0a704b",
"score": "0.5396099",
"text": "def destroy\n @destiny.destroy\n respond_to do |format|\n format.html { redirect_to destinies_url, notice: 'Destiny was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4975a510b8b956cebf742205e0453735",
"score": "0.539272",
"text": "def destinations\n @attributes['destinations']\n end",
"title": ""
},
{
"docid": "8d9960bcd9ec0c61f1093b42656a9920",
"score": "0.5377792",
"text": "def destroy\n @destination = Destination.find(params[:id])\n @destination.destroy\n\n respond_to do |format|\n format.html { redirect_to destinations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "88f73e7dcc83fd30e08ecc5c96df22b3",
"score": "0.5371113",
"text": "def show\n @destination_port = DestinationPort.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @destination_port }\n end\n end",
"title": ""
},
{
"docid": "fa86741db5f744c747716a6438c49ef5",
"score": "0.5359767",
"text": "def index\n @ais_vessal_destinations = AisVessalDestination.all\n end",
"title": ""
},
{
"docid": "8714f13830b7703d3e5f1b5815511601",
"score": "0.53509647",
"text": "def show\n @destlocs = []\n\n @destlocs.push(DestLocation.find_by(:destination_id => params[:id]))\n if @destlocs != []\n\n @locs = []\n @destlocs.each do |loc|\n \n @locs.push(Location.find_by(:id => loc[:location_id]))\n end\n end\n \n @destspecials = DestSpecial.where(destination_id: params[:id]).to_a\n \n if @destspecials != []\n @specials = []\n @destspecials.each do |s|\n \n @specials.push(Special.find_by(:id => s[:special_id]))\n end\n end\n\n \n @destnotes = DestNote.where(destination_id: params[:id]).to_a\n \n if @destnotes != []\n @notes = []\n @destnotes.each do |n|\n @notes.push(Note.find_by(:id => n[:note_id]))\n end\n end\n\n \n @destrecs = DestRecommendation.where(destination_id: params[:id]).to_a\n \n if @destrecs != []\n @recs = []\n @destrecs.each do |r|\n @recs.push(Recommendation.find_by(:id => r[:recommendation_id]))\n end\n end\n\n \n @destlikes = DestLike.where(destination_id: params[:id]).to_a\n \n if @destlikes != []\n @likes = []\n @destlikes.each do |l|\n @likes.push(Like.find_by(:id => l[:like_id]))\n end\n end\n\n end",
"title": ""
},
{
"docid": "1bb600869255f2caa5cd840c43f42731",
"score": "0.5348949",
"text": "def get_deliveries\n deliveries = ActiveRecord::Base.connection.exec_query(\n \"SELECT *,\n (SELECT name FROM Restaurants WHERE id = (SELECT restaurant_id FROM Orders O WHERE O.oid = D.oid))\n AS restaurant_name,\n (SELECT address FROM Restaurants WHERE id = (SELECT restaurant_id FROM Orders O WHERE O.oid = D.oid))\n AS restaurant_address\n FROM Delivers D\n WHERE rider_id = #{current_user[\"id\"]}\"\n ).to_a\n render json: deliveries\n end",
"title": ""
},
{
"docid": "2a7ccc52cfe9731112be865df0a7d181",
"score": "0.53422153",
"text": "def show\n @destination_packing = DestinationPacking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @destination_packing }\n end\n end",
"title": ""
},
{
"docid": "cb43eeb3889b01078b49b2ce92e2989b",
"score": "0.53419703",
"text": "def detail\n out = ShelfListing.includes(:interventions).includes(:barcodes).find_by(internal_id: params[:id])\n json = out.as_json(except: [\"created_at\", \"updated_at\", \"who_checked\", \"id\"])\n json[:barcodes] = out.barcodes.where(active:1).pluck(\"barcode\")\n json[:interventions] = []\n out.interventions.each do |i|\n inv = i.as_json(except: [\"who_found\", \"created_at\", \"updated_at\", \"id\"])\n inv[:details] = []\n i.details.each do |d|\n inv[:details] << \"#{d.category}: #{d.name}\"\n end\n json[:interventions] << inv\n end\n dest = out.destinations.first\n if !dest.nil?\n json[:preservation] = { date_sent_out: dest.date_sent_out, destination: dest.destination_name.name, bookplate: dest.bookplate}\n end\n render json: json\n end",
"title": ""
},
{
"docid": "c7c0a015184b66e35144701a799f0d1e",
"score": "0.53329504",
"text": "def index\n @discapacity_origins = DiscapacityOrigin.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @discapacity_origins }\n end\n end",
"title": ""
},
{
"docid": "91a0a724416c8c55f630fe49470baa67",
"score": "0.53245264",
"text": "def dest_index\n @dest\n end",
"title": ""
},
{
"docid": "f2b251b2a089390202075cf471e28306",
"score": "0.5319797",
"text": "def index\n trips = current_user.trips.as_json(:include => [:destination_address])\n api_response(true, :trips => trips)\n end",
"title": ""
},
{
"docid": "04518c3b06cac4661ab416e47af949da",
"score": "0.5317745",
"text": "def show\n @destination_specific_activity = DestinationSpecificActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @destination_specific_activity }\n end\n end",
"title": ""
},
{
"docid": "e0961e159a5dc14f8bccffc3c59a9975",
"score": "0.5313541",
"text": "def show\n @destination = Destination.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @destination }\n end\n end",
"title": ""
},
{
"docid": "e0961e159a5dc14f8bccffc3c59a9975",
"score": "0.5313541",
"text": "def show\n @destination = Destination.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @destination }\n end\n end",
"title": ""
},
{
"docid": "d30776ca045a1c062da1a87b4015a9ff",
"score": "0.5287962",
"text": "def get_destinations(opts = {})\n data, _status_code, _headers = get_destinations_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "d30776ca045a1c062da1a87b4015a9ff",
"score": "0.5287962",
"text": "def get_destinations(opts = {})\n data, _status_code, _headers = get_destinations_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "deb7e47bb484bb4c93713b1c246b1b81",
"score": "0.52878845",
"text": "def index\n @deliveries = Delivery.all\n render json: @deliveries, status: :ok\n end",
"title": ""
},
{
"docid": "fd1774d34a7cb5ba42ab1422a730db94",
"score": "0.5280684",
"text": "def index\n @dresses = Dress.all\n end",
"title": ""
},
{
"docid": "73fe2bfa2d343040ce0e3b357d544ff2",
"score": "0.52632713",
"text": "def index\n @progresses = @task.progresses\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @progresses }\n end\n end",
"title": ""
},
{
"docid": "8731eafc53040ebcb2edf7218bfbd8c6",
"score": "0.525314",
"text": "def index\n @tipo_destilados = TipoDestilado.all\n end",
"title": ""
},
{
"docid": "97684caa975f71377335275af263797f",
"score": "0.52530336",
"text": "def destination(destination, options = {})\n get(\"destinations/#{destination}\", options).pop\n end",
"title": ""
},
{
"docid": "bcdc7a4c8b448e86bd06ee0077ba2a50",
"score": "0.52478135",
"text": "def new\n @destination = Destination.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @destination }\n end\n end",
"title": ""
},
{
"docid": "18302e5a4e21e61bbc229bc6a59dff4e",
"score": "0.5240356",
"text": "def index\n @casein_page_title = 'Destinos'\n @destinations = Destination.order(sort_order(:nombre)).paginate :page => params[:page]\n end",
"title": ""
},
{
"docid": "8479711b791b200a3ddfc4dc54960b6c",
"score": "0.523359",
"text": "def destroy\n @dest_special.destroy\n respond_to do |format|\n format.html { redirect_to dest_specials_url, notice: \"Dest special was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b01405a32abbb8ea6e567b439e5bb5a6",
"score": "0.52163297",
"text": "def destination\n return @destination if @destination\n\n resolve_addresses\n\n @destination\n end",
"title": ""
},
{
"docid": "0dc29b62a188fd825bc7d73204bc4d63",
"score": "0.5202479",
"text": "def destroy\n itinerary = Itinerary.find(params[:id])\n itinerary.destinations.each do |x|\n x.delete\n end\n itinerary.destroy\n render :nothing => true\n end",
"title": ""
},
{
"docid": "a350ba98b667f52c7fb61ebddd2794df",
"score": "0.5199402",
"text": "def show\n @outsource = Outsource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @outsource }\n end\n end",
"title": ""
},
{
"docid": "234cbccc7e1ea81e8721442470f82b5c",
"score": "0.51906204",
"text": "def get_destinations_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DispatchApi.get_destinations ...'\n end\n if @api_client.config.client_side_validation && opts[:'datetime_filter'] && !['created', 'updated'].include?(opts[:'datetime_filter'])\n fail ArgumentError, 'invalid value for \"datetime_filter\", must be one of created, updated'\n end\n if @api_client.config.client_side_validation && opts[:'order_by'] && !['updated_asc', 'updated_desc', 'created_asc', 'created_desc'].include?(opts[:'order_by'])\n fail ArgumentError, 'invalid value for \"order_by\", must be one of updated_asc, updated_desc, created_asc, created_desc'\n end\n # resource path\n local_var_path = '/dispatch/destinations'\n\n # query parameters\n query_params = {}\n query_params[:'courseId'] = opts[:'course_id'] if !opts[:'course_id'].nil?\n query_params[:'more'] = opts[:'more'] if !opts[:'more'].nil?\n query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?\n query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?\n query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :csv) if !opts[:'tags'].nil?\n query_params[:'datetimeFilter'] = opts[:'datetime_filter'] if !opts[:'datetime_filter'].nil?\n query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['APP_NORMAL', '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 => 'DestinationListSchema')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DispatchApi#get_destinations\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "de3fd57ceb54dea52712cb9edcf59246",
"score": "0.51805454",
"text": "def destroy\n @tourist_destination.destroy\n respond_to do |format|\n format.html { redirect_to tourist_destinations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e8a8e9c779ab1f83ce42e714b60ad83e",
"score": "0.517718",
"text": "def show\n @source = Source.find(params[:id])\n\n render json: @source\n end",
"title": ""
},
{
"docid": "3adc70a9aeb99622ac16ac22590c1e72",
"score": "0.5171273",
"text": "def show\n @url = Url.find(params[:id])\n\n render json: @url\n end",
"title": ""
},
{
"docid": "a4860ddad7f4eeda2f22e3384c8bd5de",
"score": "0.5169549",
"text": "def show\n show = Merge.new(params[:location], params[:filter]= \"\").all_deals\n render json: show[0]\n end",
"title": ""
},
{
"docid": "7f41fd3fa116df8ca2c217f5f5a76399",
"score": "0.5165798",
"text": "def destination\n\t\t\"Person to give back!(find me in item.rb)\"\n\tend",
"title": ""
},
{
"docid": "06c7b38c5ac795c58cd6a0d80739601c",
"score": "0.5161071",
"text": "def show\n @source = Source.find(params[:id])\n\n respond_to do |format|\n format.json\n end\n end",
"title": ""
},
{
"docid": "d765b12db15ae4641f3254c22f090b86",
"score": "0.51592433",
"text": "def index\n @tasks = Task.all\n render json: @tasks.to_json(include: :elder)\n # trying to get the /tasks index route.\n\n # ************ THIS IS TOO SPECIFIC, AND I THINK IT IS IN THE SET TASK **********\n # elder_id = params[:elder_id]\n # @tasks = Elder.find(elder_id).tasks\n # render json: @tasks\n # **************************************\n\n end",
"title": ""
},
{
"docid": "e4f4209f959f1046cfbc98435200451a",
"score": "0.5155786",
"text": "def show\n respond_to do |format|\n format.html { redirect_to :index}\n format.json { render json: Disclosure.find(params[:id]) }\n end\n end",
"title": ""
},
{
"docid": "5a674147bdead271689681b0a646ac98",
"score": "0.5155505",
"text": "def destroy\n @dress = Dress.find(params[:id])\n @dress.destroy\n\n respond_to do |format|\n format.html { redirect_to dresses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "54e9af817eaa540c8365b1c34a1c6ef6",
"score": "0.51508194",
"text": "def index\n @directions = Direction.all\n\n render json: @directions\n end",
"title": ""
},
{
"docid": "a9f7fdacfa2ee3b1b52820546180c632",
"score": "0.51449436",
"text": "def show\n @referrer = Referrer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @referrer }\n end\n end",
"title": ""
},
{
"docid": "9e963dd3e8feb9b231d271d12218e04e",
"score": "0.514275",
"text": "def set_dest_special\n @dest_special = DestSpecial.find(params[:id])\n end",
"title": ""
},
{
"docid": "4f49ff8101d24bfa943cd61b859d99ea",
"score": "0.5142578",
"text": "def set_request_destiny\n @request = Request.find(params[:request_id])\n @request_destinies = @request.request_destinies\n @request_destiny = @request.request_destinies.find(params[:id])\n\n end",
"title": ""
},
{
"docid": "b890a5a53103fe30198cd3974c6daa34",
"score": "0.513945",
"text": "def index\n @destacados = Destacado.page(params[:page]).per(10) \n end",
"title": ""
},
{
"docid": "e8c19a02c77d7499702c9ea1b974469c",
"score": "0.5137242",
"text": "def index\n @distritos = Distrito.all\n\n render json: @distritos\n end",
"title": ""
},
{
"docid": "0d1f8e9052d692d06c13f94915a9619f",
"score": "0.51333666",
"text": "def index\n @diretorios = Diretorio.where(pessoa_id: params[:usuario]).first\n render json: @diretorios\n end",
"title": ""
},
{
"docid": "58a157194d796595df0d823424c7a5ac",
"score": "0.512738",
"text": "def show\n @internship = Internship.find(params[:id])\n @tasks = @internship.tasks.find_all\n @users = @internship.users\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @internship }\n end\n end",
"title": ""
},
{
"docid": "58a157194d796595df0d823424c7a5ac",
"score": "0.512738",
"text": "def show\n @internship = Internship.find(params[:id])\n @tasks = @internship.tasks.find_all\n @users = @internship.users\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @internship }\n end\n end",
"title": ""
},
{
"docid": "8f23a9fa841f618a8e6b16be925f805c",
"score": "0.5122688",
"text": "def index\n @dept = Dept.find((params[:dept_id]))\n @dept_addresses = DeptAddress.where(\"dept_id = ?\", params[:dept_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @dept_addresses }\n end\n end",
"title": ""
},
{
"docid": "de7dbc8f9c70552096a723cf6680144d",
"score": "0.511716",
"text": "def index\n @destinatii_turistices = DestinatiiTuristice.all\n end",
"title": ""
},
{
"docid": "3f33d2a06215ea8bf39b9ab4c1dfb744",
"score": "0.51160514",
"text": "def initialize\n @destinations = JSON.parse(read_destination)\n new_destinations\n end",
"title": ""
},
{
"docid": "17ecd6c772c3faa9c2391d61e1ec8057",
"score": "0.51139843",
"text": "def index\n @committee = Committee.find(params[:committee_id])\n @instalments = @committee.instalments.reverse\n respond_to do |format|\n \tformat.json { render :json => @instalments.to_json }\n end\n end",
"title": ""
},
{
"docid": "012730f13b1f19223de42b56aa26cdf1",
"score": "0.51093715",
"text": "def destroy\n @dress = Dress.find(params[:id])\n @dress.destroy\n\n respond_to do |format|\n format.html { redirect_to dresses_url }\n format.json { head :ok }\n end\n end",
"title": ""
}
] |
e7006eb6cf16c8e2cf0a9433ffa0f20e
|
GET /ncaa_players GET /ncaa_players.xml
|
[
{
"docid": "1fb69505c74f12a87083e4709da39255",
"score": "0.65547407",
"text": "def index\n @ncaa_players = NcaaPlayer.joins('join ncaa_teams nt on nt.id = ncaa_players.ncaa_team_id').order('nt.school asc, ncaa_players.position desc') \n \n respond_to do |format|\n \tformat.html # index.html.erb\n \tformat.xml { render :xml => @ncaa_players }\n end\n end",
"title": ""
}
] |
[
{
"docid": "a3f62fc49fa4dbb7cffe6b5539eb79d9",
"score": "0.7176937",
"text": "def show\n @ncaa_player = NcaaPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ncaa_player }\n end\n end",
"title": ""
},
{
"docid": "9d9f56bd7e0d7c69d870df77987ca01b",
"score": "0.68254584",
"text": "def index\n @team = Team.find(params[:team_id])\n @players = @team.players\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @players }\n end\n end",
"title": ""
},
{
"docid": "2a79c03524d4aaac063fd08bbf9d3b63",
"score": "0.67607176",
"text": "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @players }\n end\n end",
"title": ""
},
{
"docid": "2a79c03524d4aaac063fd08bbf9d3b63",
"score": "0.67607176",
"text": "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @players }\n end\n end",
"title": ""
},
{
"docid": "2bfaec9dea7ab162fd8ac0d71076c19c",
"score": "0.66146004",
"text": "def show\n # @players = ::Services::PlayerService.show_players(params[:page])\n end",
"title": ""
},
{
"docid": "18f007d40e8e1d96141b8c2b14789497",
"score": "0.6543653",
"text": "def players(*args) \n team_id = args.first \n player_type = args.last\n response = get('?Txml=5&ID='+team_id.to_s()+'&Tpo='+player_type.to_s(), {}).Elementos.Elemento\n end",
"title": ""
},
{
"docid": "366df4faebae61de9ac176684305075e",
"score": "0.6509194",
"text": "def view_players\n @players = Player.get_all_players\n end",
"title": ""
},
{
"docid": "3a90ae158f7ecd1b1c51ed2ec3f31214",
"score": "0.6273754",
"text": "def index\n @nfl_players = NflPlayer.all\n end",
"title": ""
},
{
"docid": "e03133803a64241c13a60023fdb2839f",
"score": "0.6268875",
"text": "def new\n @ncaa_player = NcaaPlayer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ncaa_player }\n end\n end",
"title": ""
},
{
"docid": "9c31a8d71c473175148d4999f228fd1e",
"score": "0.62651944",
"text": "def index\n @players = Player.all.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "a6b2ecebc0f20b7386d70b284bda2948",
"score": "0.62640184",
"text": "def index\n @players = Player.all\n respond_with @players\n end",
"title": ""
},
{
"docid": "86dd12e5e09c381071cee2e1e4bce653",
"score": "0.62584406",
"text": "def index\n @program_players = ProgramPlayer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @program_players }\n end\n end",
"title": ""
},
{
"docid": "b60bd83c7753d5ce5c325bd4b7ad901a",
"score": "0.6243816",
"text": "def index\n @players = PlayerQuery.new.result(player_params).all\n render json: @players\n end",
"title": ""
},
{
"docid": "28d578361527432ee81e388628b3e9f1",
"score": "0.62275743",
"text": "def index\n I18n.locale = params[:locale] if params[:locale]\n if params[:login].present?\n @player = Player.find_by_login(params[:login])\n end\n\n respond_to do |format|\n format.html\n format.xml { render :xml => [@player] }\n end\n end",
"title": ""
},
{
"docid": "f1057be8546dc7c0191e735eddc6383d",
"score": "0.6216202",
"text": "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end",
"title": ""
},
{
"docid": "319e7a5a4da03604fc898ab086897465",
"score": "0.6207972",
"text": "def index\n @players = Player.all\n respond_with @players \n end",
"title": ""
},
{
"docid": "96382a9278a5cb69e830eb492dff1ac2",
"score": "0.6190677",
"text": "def show\n @team_player = TeamPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @team_player }\n end\n end",
"title": ""
},
{
"docid": "1e53a09a446e7dfe21fbf62eee79d1e7",
"score": "0.61603886",
"text": "def index\n @players = Player.find(club_id: params[:id])\n render json: @players\n end",
"title": ""
},
{
"docid": "05c947bb4938a56bc87ddd70b1d12051",
"score": "0.61578685",
"text": "def get_high_scores\n RESTful.get(\"#{URL_MICROSERVICE_PLAYER}/players\")\n end",
"title": ""
},
{
"docid": "f34b93e183ff74adcfb9bb390853c681",
"score": "0.611815",
"text": "def show\n @game_player = GamePlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @game_player }\n end\n end",
"title": ""
},
{
"docid": "d43d6949b4b1744f311bef648c015d12",
"score": "0.6103336",
"text": "def index\n #TODO user_team_players.json only request\n @user_team_players = UserTeamPlayer.where user_team_id: params[:user_team_id]\n end",
"title": ""
},
{
"docid": "8eb134daa10ab36bbdcef99330eeb6e7",
"score": "0.6100283",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "8eb134daa10ab36bbdcef99330eeb6e7",
"score": "0.6100283",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "8eb134daa10ab36bbdcef99330eeb6e7",
"score": "0.6100283",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "8eb134daa10ab36bbdcef99330eeb6e7",
"score": "0.6100283",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "8eb134daa10ab36bbdcef99330eeb6e7",
"score": "0.6100283",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "8eb134daa10ab36bbdcef99330eeb6e7",
"score": "0.6100283",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "cadbad1bd5c55b55661d60d91c9f5009",
"score": "0.60960966",
"text": "def show\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end",
"title": ""
},
{
"docid": "cddaa4f8e403d9394c486bb7fd0302b8",
"score": "0.60868746",
"text": "def players\n getPlayers\n end",
"title": ""
},
{
"docid": "ebe7eefa52cbedfc1c0fa6a9ae5f737a",
"score": "0.6085566",
"text": "def show\n #@player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "c45af95182b66892a0479cde8d3e9326",
"score": "0.60802174",
"text": "def index\n @players = Player.all\n render json: @players, root: :players, meta: {message: 'Successfully fetched player list'}, meta_key: \"meta\", status: 200\n end",
"title": ""
},
{
"docid": "843b3a481f33febc6570e48a4cce48c8",
"score": "0.6070737",
"text": "def index\n #@players = Player.all\n @players = Player.paginate(page: params[:page], per_page:5)\n end",
"title": ""
},
{
"docid": "feadc5e3d190a9bd11d3fc3820ef5e1e",
"score": "0.60685474",
"text": "def get_roster(version = SportsDataApi::Nhl::DEFAULT_VERSION)\n base_url = SportsDataApi::Nhl::BASE_URL % { access_level: SportsDataApi.access_level(SPORT), version: version }\n url = \"/teams/#{@id}/profile.xml\"\n response = SportsDataApi.generic_request(\"#{base_url}#{url}\", SportsDataApi::Nhl::SPORT)\n xml = Nokogiri::XML(response.to_s).remove_namespaces!\n xml.xpath('team/players/player').map { |player| Player.new(player) }\n end",
"title": ""
},
{
"docid": "501cb61b1bd269ff860452112de7d99b",
"score": "0.60660684",
"text": "def get_all_players\n\t$client.query(\"Players\").tap do |q|\n\t\tq.limit = 1000\n\tend.get\nend",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "0771bcccda45b0bc2e2f56c6ed358f94",
"score": "0.6064251",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "e3271693ad5ca19721ada6561be2435c",
"score": "0.605759",
"text": "def getPlayer(id)\n queryAPI(\"https://www.blaseball.com/database/players?ids=#{id}\")\nend",
"title": ""
},
{
"docid": "b3d39abe49b1a177296efdf3c02a28ee",
"score": "0.60513556",
"text": "def players(parameters = {}, options = {})\n request(Resource.league/'players'+parameters + 'ownership', options) do |result|\n result.players.map {|player| Payload::Player.new(player)}\n end\n end",
"title": ""
},
{
"docid": "e15615434bb6a2259563137fece66a00",
"score": "0.60510904",
"text": "def show\n @ncaa_team = NcaaTeam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ncaa_team }\n end\n end",
"title": ""
},
{
"docid": "e6f2fd2b193bea816895b376924a49d7",
"score": "0.604107",
"text": "def show\n @players_list = PlayersList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @players_list }\n end\n end",
"title": ""
},
{
"docid": "84a2e2d9ccff230ef98f309ab6697b5b",
"score": "0.60288656",
"text": "def get_info\n KAG.get \"/player/#@nick/info\"\n end",
"title": ""
},
{
"docid": "a8270f7d9cc3caf00e7aa82df44d4e0b",
"score": "0.602075",
"text": "def index\n # Get page number from paginate plugin used in view\n page = params[:page].nil? ? 1 : params[:page]\n \n @players = Player.order_by([[ :player_id, :asc ]]).paginate(page: page, per_page: PAGE_COUNT)\n end",
"title": ""
},
{
"docid": "4c832775b9124dbf3a6c1e7a3aa47090",
"score": "0.6016705",
"text": "def players\n @players = Game.find_by_id(params[:id]).players\n render template: \"players/players.json.jbuilder\"\n end",
"title": ""
},
{
"docid": "8a9ff2a69d290a3e4ee390047d723bcc",
"score": "0.6007337",
"text": "def index\n\t\t@players = Player.all\n\tend",
"title": ""
},
{
"docid": "7341b79650ca2234eff10a19529a4fdc",
"score": "0.60054517",
"text": "def list_players\n puts \"---------------------------------------------------------------------\"\n puts \" Welcome to Liverpool Football Club Premier League Team of the season\"\n puts \"---------------------------------------------------------------------\"\n LiverpoolSquad::Player.scrape_players\n LiverpoolSquad::Player.all.each.with_index(1) do |player, i|\n puts \" #{i}. #{player.name}\"\n end\nend",
"title": ""
},
{
"docid": "f1da87ad0801c22093430bc91b65c78b",
"score": "0.5993946",
"text": "def show\n @player = Player.find(params[:id])\n @usga_scores = @player.usga_scores.sort_by { |sc| sc.score }\n @usga_score_count = @player.usga_scores_to_use(@usga_scores.collect { |sc| sc.score }.size)\n @gms = ([0] << @player.unopposed_games).flatten.compact\n @player.scores.excluding_games(@gms).week_ending(1000000).last_few(4)\n\n @pearson_scores = @player.scores.all_by_week.last_few(4+(@gms.size-1))\n\n respond_to do |format|\n format.xml { render :xml => {:usga_scores => @usga_scores, :gms => @gms, :player => @player, :all_scores => @player.scores.all_by_week, :pearson_scores => @pearson_scores}, :root => 'player-card', :skip_types => true }\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end",
"title": ""
},
{
"docid": "f1cd8edbd07f0dbb6e7be17daf50c35a",
"score": "0.5992077",
"text": "def index\n @games = @user.games\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @games}\n end\n end",
"title": ""
},
{
"docid": "af1103ce2b7098577c03a8447ba3ed40",
"score": "0.59877867",
"text": "def index\n @userplayers = Userplayer.all\n end",
"title": ""
},
{
"docid": "9931baedd241ed6b41432c2c2ca95b4a",
"score": "0.5979104",
"text": "def index\n @players = Player.all\n render json: @players\n end",
"title": ""
},
{
"docid": "feb9ef7c75e019d388a3b9562c534fb6",
"score": "0.59787863",
"text": "def index\n @users = User.players\n end",
"title": ""
},
{
"docid": "0269b11204fe83541f81be90c82d45d2",
"score": "0.5976517",
"text": "def index\n @players = Player.all\n end",
"title": ""
},
{
"docid": "12f5b8518061aeabb3c1c774412228e6",
"score": "0.5972947",
"text": "def find_PlayerID(playerId)\n request_api(\"https://api-nba-v1.p.rapidapi.com/players/playerId/#{playerId}\") \n end",
"title": ""
},
{
"docid": "b47d25a95d5c59fc53fa053713c2540c",
"score": "0.5972796",
"text": "def player_stats\n urls = [\n \"http://espn.go.com/nba/team/roster/_/name/atl/atlanta-hawks\",\n \"http://espn.go.com/nba/team/roster/_/name/bos/boston-celtics\",\n \"http://espn.go.com/nba/team/roster/_/name/bkn/brooklyn-nets\",\n \"http://espn.go.com/nba/team/roster/_/name/cha/charlotte-hornets\",\n \"http://espn.go.com/nba/team/roster/_/name/chi/chicago-bulls\",\n \"http://espn.go.com/nba/team/roster/_/name/cle/cleveland-cavaliers\",\n \"http://espn.go.com/nba/team/roster/_/name/dal/dallas-mavericks\",\n \"http://espn.go.com/nba/team/roster/_/name/den/denver-nuggets\",\n \"http://espn.go.com/nba/team/roster/_/name/det/detroit-pistons\",\n \"http://espn.go.com/nba/team/roster/_/name/gs/golden-state-warriors\",\n \"http://espn.go.com/nba/team/roster/_/name/hou/houston-rockets\",\n \"http://espn.go.com/nba/team/roster/_/name/ind/indiana-pacers\",\n \"http://espn.go.com/nba/team/roster/_/name/lac/los-angeles-clippers\",\n \"http://espn.go.com/nba/team/roster/_/name/lal/los-angeles-lakers\",\n \"http://espn.go.com/nba/team/roster/_/name/mem/memphis-grizzlies\",\n \"http://espn.go.com/nba/team/roster/_/name/mia/miami-heat\",\n \"http://espn.go.com/nba/team/roster/_/name/mil/milwaukee-bucks\",\n \"http://espn.go.com/nba/team/roster/_/name/min/minnesota-timberwolves\",\n \"http://espn.go.com/nba/team/roster/_/name/no/new-orleans-pelicans\",\n \"http://espn.go.com/nba/team/roster/_/name/ny/new-york-knicks\",\n \"http://espn.go.com/nba/team/roster/_/name/okc/oklahoma-city-thunder\",\n \"http://espn.go.com/nba/team/roster/_/name/orl/orlando-magic\",\n \"http://espn.go.com/nba/team/roster/_/name/phi/philadelphia-76ers\",\n \"http://espn.go.com/nba/team/roster/_/name/phx/phoenix-suns\",\n \"http://espn.go.com/nba/team/roster/_/name/por/portland-trail-blazers\",\n \"http://espn.go.com/nba/team/roster/_/name/sac/sacramento-kings\",\n \"http://espn.go.com/nba/team/roster/_/name/sa/san-antonio-spurs\",\n \"http://espn.go.com/nba/team/roster/_/name/tor/toronto-raptors\",\n \"http://espn.go.com/nba/team/roster/_/name/utah/utah-jazz\",\n \"http://espn.go.com/nba/team/roster/_/name/wsh/washington-wizards\"\n ]\n urls.each do |u|\n url = u\n page = Nokogiri::HTML(open(url))\n page.search('//tr').each do |row|\n row.search('td').each do |cell|\n #binding.pry\n print '@',cell.text\n end\n print \"\\n\"\n end\n end\nend",
"title": ""
},
{
"docid": "5b6eb31997d1cb47f432f442c3eab9b4",
"score": "0.59464407",
"text": "def show\n @players = Player.all\n end",
"title": ""
},
{
"docid": "e0f1eaf14c3ccb19f83c3895167182be",
"score": "0.5946417",
"text": "def find_player(team_id)\n # query = URI.encode(\"#{team_id}\")\n request_api(\"https://api-nba-v1.p.rapidapi.com/players/teamId/#{team_id}\") \n end",
"title": ""
},
{
"docid": "d5020b1255e538b9168c113f59306a3e",
"score": "0.5946027",
"text": "def index\n @players = @room.players\n end",
"title": ""
},
{
"docid": "f0c6dd0aac97f3eddc6d3a379be30ef3",
"score": "0.59335816",
"text": "def index\n if Player.all.empty?\n get_players\n end\n # @players = Player.sorted.paginate(page: params[:page], per_page: 20)\n @players = Player.sorted \n end",
"title": ""
},
{
"docid": "acd6043a62d0a9a8ef7701631bac31de",
"score": "0.59273773",
"text": "def show\n @peer = @player.peers.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @peer }\n end\n end",
"title": ""
},
{
"docid": "882d54b7a99062b772ace6f3d1e870c5",
"score": "0.5921361",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n format.json { render :json => @player }\n end\n end",
"title": ""
},
{
"docid": "49e8384fa3e5b3cb3801c21a68cfd93d",
"score": "0.59148973",
"text": "def index\n #@players = Player.order(:created_at).limit(10)\n @players = Player.search(params[:search]).order(\"name\").paginate(:per_page => 10, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end",
"title": ""
},
{
"docid": "4c006935aa9c44dcef4263e712433722",
"score": "0.5894516",
"text": "def player\n fetch('basketball.players')\n end",
"title": ""
},
{
"docid": "4782148b6426c98602943bb5fffd0841",
"score": "0.589363",
"text": "def index\n @players = Game.leaderboard.limit(10)\n end",
"title": ""
},
{
"docid": "54502229119c27b231be6366127e93ae",
"score": "0.5892075",
"text": "def index\n @inscription_players = InscriptionPlayer.includes(:inscription).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @inscription_players }\n end\n end",
"title": ""
},
{
"docid": "7196f423a1a52deee08391dad22f7f77",
"score": "0.5887319",
"text": "def show\n @team = Team.find(params[:id])\n @players = @team.players\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end",
"title": ""
},
{
"docid": "df5acb4a0a2e9ea8f4cc140f1085a548",
"score": "0.5878272",
"text": "def index\n @playeraccomplishments = Playeraccomplishment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playeraccomplishments }\n end\n end",
"title": ""
},
{
"docid": "9e774f85598f47c1241fef44477496ba",
"score": "0.5875349",
"text": "def index\n @search = ::Player.ransack(params[:q])\n @players = @search.result.page(params[:page])\n end",
"title": ""
},
{
"docid": "4a5f4887a51138c762c6db2d9032d05f",
"score": "0.5873453",
"text": "def index\n @game_players = GamePlayer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @game_players }\n end\n end",
"title": ""
},
{
"docid": "0af234832c951d7343af95061fdc5225",
"score": "0.5862741",
"text": "def show\n @nflplayer = Nflplayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @nflplayer }\n end\n end",
"title": ""
},
{
"docid": "8e9326e3f9ecbb05e5ab854339520003",
"score": "0.58619064",
"text": "def index\n players = Player.all\n render json: players\n end",
"title": ""
},
{
"docid": "7a075bd28c3066d3cdbd9a181b9a555b",
"score": "0.5860435",
"text": "def index\n @wattball_players = WattballPlayer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wattball_players }\n end\n end",
"title": ""
},
{
"docid": "73c7d7ccbe50d36251fa6671c021e7c7",
"score": "0.5856637",
"text": "def show\n @nfl_player = NflPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { \n render json: @nfl_player.to_json }\n end\n end",
"title": ""
},
{
"docid": "98b52516b3662929c4d02a91c4904f19",
"score": "0.58445466",
"text": "def show\n @players_profile = PlayersProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @players_profile }\n end\n end",
"title": ""
},
{
"docid": "81f820aba49ac09ba424a3c44ecb4bf8",
"score": "0.5844128",
"text": "def account_users \n make_request(:get,\"#{account_url}/users.xml\")\n end",
"title": ""
},
{
"docid": "b072637923135d43d07646835dd0e84e",
"score": "0.5838618",
"text": "def show\r\n @player = Player.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @player }\r\n format.json { render :json => @player }\r\n end\r\n end",
"title": ""
},
{
"docid": "d7e1ce3b1b285e6a2caee2a5af2bce0a",
"score": "0.58346826",
"text": "def index\n @cr_players = CrPlayer.all\n end",
"title": ""
},
{
"docid": "fa8256f736adf6bf64520a9736082847",
"score": "0.5834032",
"text": "def index\n @roster_players = RosterPlayer.all\n end",
"title": ""
},
{
"docid": "bbb5c081b754b6abadefeebf6f44c418",
"score": "0.5824209",
"text": "def show\n @game = Game.find(params[:id])\n @players = @game.players\n end",
"title": ""
}
] |
b6c8e6078b8084a395a278b69e8c9be6
|
Returns the currently logged in admin or nil if there isn't one
|
[
{
"docid": "c4b04f45b338432706d0329534a2c739",
"score": "0.8499397",
"text": "def current_admin\n return unless session[:admin_id]\n @current_admin ||= AdminLogin.find_by_id(session[:adminr_id]) \n end",
"title": ""
}
] |
[
{
"docid": "c95fd2044907c82e3e333cc05d32b944",
"score": "0.85741174",
"text": "def current_admin\n @current_admin ||= Admin.where(id: session[:login_id]).first if session[:login_id]\n end",
"title": ""
},
{
"docid": "31149002066b22b71af30494ff64b097",
"score": "0.8461552",
"text": "def current_admin\n return unless session[:admin_id]\n @current_admin ||= Admin.find_by_id(session[:admin_id])\n end",
"title": ""
},
{
"docid": "9d77b82275b0d24d5ea8e269836d6d6e",
"score": "0.8461223",
"text": "def current_admin\n if session[:admin_id]\n @current_admin ||= Admin.find_by(id: session[:admin_id])\n end\n end",
"title": ""
},
{
"docid": "9d77b82275b0d24d5ea8e269836d6d6e",
"score": "0.8461223",
"text": "def current_admin\n if session[:admin_id]\n @current_admin ||= Admin.find_by(id: session[:admin_id])\n end\n end",
"title": ""
},
{
"docid": "9d77b82275b0d24d5ea8e269836d6d6e",
"score": "0.84610885",
"text": "def current_admin\n if session[:admin_id]\n @current_admin ||= Admin.find_by(id: session[:admin_id])\n end\n end",
"title": ""
},
{
"docid": "1ad38b6e7d2598d789c08242463f522a",
"score": "0.83523273",
"text": "def current_admin_user\n return nil if user_signed_in? && !current_user.admin?\n current_user\n end",
"title": ""
},
{
"docid": "8f214b3b20d5795cb430998fe083b41a",
"score": "0.8345659",
"text": "def current_admin\n @current_admin ||= (login_admin_from_session || login_admin_from_basic_auth || login_admin_from_cookie || :false)\n end",
"title": ""
},
{
"docid": "9670db5675700ae747b55acd88ac0a08",
"score": "0.8260666",
"text": "def current_admin\n if (admin_id = session[:admin_id])\n @current_admin ||= Admin.find_by(id: admin_id)\n elsif (admin_id = cookies.signed[:admin_id])\n admin = Admin.find_by(id: admin_id)\n if admin && admin.authenticated?(cookies[:remember_token])\n log_in admin\n @current_admin = admin\n end\n end\n end",
"title": ""
},
{
"docid": "9670db5675700ae747b55acd88ac0a08",
"score": "0.8260666",
"text": "def current_admin\n if (admin_id = session[:admin_id])\n @current_admin ||= Admin.find_by(id: admin_id)\n elsif (admin_id = cookies.signed[:admin_id])\n admin = Admin.find_by(id: admin_id)\n if admin && admin.authenticated?(cookies[:remember_token])\n log_in admin\n @current_admin = admin\n end\n end\n end",
"title": ""
},
{
"docid": "07bfa1388c55539df083cc97168d41b6",
"score": "0.8226602",
"text": "def current_admin\n if (admin_id = session[:admin_id])\n @current_admin ||= Admin.find_by(id: admin_id)\n elsif (admin_id = cookies.signed[:admin_id])\n admin = Admin.find_by(id: admin_id)\n if admin && admin.authenticated_remember?(cookies[:remember_token])\n log_in admin\n @current_admin = admin\n end\n end\n end",
"title": ""
},
{
"docid": "49e128090ac2d7744f56768f1618a443",
"score": "0.8176662",
"text": "def find_admin_user\n @current_user = find_current_user\n\n if @curent_user.present? and @current_user.is_admin\n @current_user\n else\n nil\n end\n\n end",
"title": ""
},
{
"docid": "5d072f96aa612b9d5f552c286ebade1e",
"score": "0.81496906",
"text": "def current_admin\n current_user.try(:admin?) && current_user\n end",
"title": ""
},
{
"docid": "238be6fcf6b43a2d3a9bfc317e9216a0",
"score": "0.8086457",
"text": "def current_admin\n @current_admin ||= super || Admin.find(@current_admin_id)\n end",
"title": ""
},
{
"docid": "3e201e0db60ba8a35021f1a3989517ac",
"score": "0.8052808",
"text": "def admin_current_user\n @admin_current_user ||= Admin.find_by(id: session[:user_id])\n end",
"title": ""
},
{
"docid": "3e201e0db60ba8a35021f1a3989517ac",
"score": "0.8052267",
"text": "def admin_current_user\n @admin_current_user ||= Admin.find_by(id: session[:user_id])\n end",
"title": ""
},
{
"docid": "8d9d9a880837dca806173755d65e3ac8",
"score": "0.8031765",
"text": "def current_admin\n @current_admin ||= Admin.find_by_remember_token(cookies[:remember_token])\n end",
"title": ""
},
{
"docid": "fab6fa004baa6c35beb81fc320c3959a",
"score": "0.79690903",
"text": "def current_admin_user\n @current_admin_user ||= AdminUser.find(find('#current_user a')[:href].split('/').last)\n end",
"title": ""
},
{
"docid": "741affcbc07ca42f80e698388591478d",
"score": "0.79324734",
"text": "def admin_current_user\n @admin_current_user ||= begin\n return unless admin_user_session.user_id.present?\n\n ::AdminUser.find_by(resource_id: session[:admin_user_id])\n end\n end",
"title": ""
},
{
"docid": "4d319a9edd0cebf5f7717d83b9737338",
"score": "0.7901669",
"text": "def admin\n user = session[:user_id] && User.find(session[:user_id])\n @current_user = user ? user.admin : false\n end",
"title": ""
},
{
"docid": "b83520e3a35c326bdb35187aca7196ea",
"score": "0.7890067",
"text": "def current_admin_user\n admin_user\n end",
"title": ""
},
{
"docid": "0f134b6936ff9dd14ff4a574d1a129bf",
"score": "0.7870778",
"text": "def admin\n if(session[:user_id])\n current_user.admin?\n end\n end",
"title": ""
},
{
"docid": "4c470ed41be38872588b1f8453a02819",
"score": "0.78498554",
"text": "def current_user\n Admin.find_by(id: session[:admin_id])\n end",
"title": ""
},
{
"docid": "7fe7fc8484c9d00c44cc6c742b5c33c1",
"score": "0.7833969",
"text": "def current_admin\n owner.current_admin\n end",
"title": ""
},
{
"docid": "4ae8750efcbec9c6bcd8851729dce874",
"score": "0.7832229",
"text": "def current_user\n if session[:admin_id]\n @current_user ||= Admin.find_by(id: session[:admin_id])\n end\n end",
"title": ""
},
{
"docid": "2119395d9fb4ff44203e99f77129408e",
"score": "0.78096336",
"text": "def current_user\n if session[:current_user]\n Admin.find(session[:current_user])\n else\n nil\n end\nend",
"title": ""
},
{
"docid": "43405a2e2fb4a009d58c678e1ea4ef83",
"score": "0.7797273",
"text": "def admin?\n u = current_user\n if u.nil? or u == false\n return nil\n else\n return u.admin?\n end\n end",
"title": ""
},
{
"docid": "55052b3eb71b6ad4070efef76492ae8f",
"score": "0.77477217",
"text": "def current_user\n current_admin\n end",
"title": ""
},
{
"docid": "54351455b1aec870ac7741831ec356d2",
"score": "0.77279836",
"text": "def current_user\n return @current_admin if defined?(@current_admin)\n @current_admin = current_user_session && current_user_session.record\n end",
"title": ""
},
{
"docid": "8cd8884928161ec5b8a5ba015641b271",
"score": "0.7704907",
"text": "def current_admin_account\n return if session[:current_admin_account_id].blank?\n @current_admin_account ||= Account.find(session[:current_admin_account_id])\n end",
"title": ""
},
{
"docid": "1b8cf2c9ebddbe11284c52f4f15cf3df",
"score": "0.7685098",
"text": "def current_user\n @current_user ||= Admin.find_by(id: session[:admin_id])\n end",
"title": ""
},
{
"docid": "b33e9234bd59ad8dd6ded8e578560574",
"score": "0.76730204",
"text": "def current_admin_user \n AdminUser.find_by(id: session[:admin_user_id]) \n end",
"title": ""
},
{
"docid": "683ad240f6318187ae958f2656522988",
"score": "0.76353806",
"text": "def admin?\n if current_user\n current_user.admin\n end\n end",
"title": ""
},
{
"docid": "1788c98b8f9da4b034bac5e32edd0916",
"score": "0.7609719",
"text": "def current_user\n if (admin_admin_id = session[:admin_admin_id])\n @current_user ||= Admin::Admin.find_by(id: admin_admin_id)\n elsif (admin_admin_id = cookies.signed[:admin_admin_id])\n admin_admin = Admin::Admin.find_by(id: admin_admin_id)\n if admin_admin && admin_admin.authenticated?(:remember, cookies[:remember_token])\n log_in admin_admin\n @current_user = admin_admin\n end\n end\n end",
"title": ""
},
{
"docid": "29efb20378d102b03bb7b9ec9e4c6f99",
"score": "0.7600525",
"text": "def admin?\n current_user.try :admin?\n end",
"title": ""
},
{
"docid": "369fe8256af5833c40d8f593cf2fe025",
"score": "0.75959",
"text": "def admin?\n user = current_user\n if logged_in?\n return user.is_admin\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "255df9b063018cf992cbf3ddfde96ff7",
"score": "0.75950974",
"text": "def admin\n @admin ||= self.find_by_name('Administrator')\n end",
"title": ""
},
{
"docid": "71a1ef754369ce4e58de63ef206f3964",
"score": "0.75917965",
"text": "def admin?\n result = false\n if current_user != nil && ADMIN_ID == current_user.id.to_s\n result = true\n end\n result\n end",
"title": ""
},
{
"docid": "718bd23c33c422f4257e1976ad20e86d",
"score": "0.75695264",
"text": "def current_user_admin\n current_user.admin?\n end",
"title": ""
},
{
"docid": "783658f4d3aaf7b69af803d757660127",
"score": "0.7562723",
"text": "def admin?\n if session[:user_id]\n User.find(session[:user_id]).admin\n else\n false\n end\n end",
"title": ""
},
{
"docid": "cb1b025855f691c7af6c4049a1941199",
"score": "0.75375956",
"text": "def current_admin\n @current_admin = @current_admin || Group.find_by(email: session[:group_email])\n end",
"title": ""
},
{
"docid": "b0cb21ea62c6f9cc0b5a14b4544bed5e",
"score": "0.75308096",
"text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n if @current_user != nil\n if @current_user.admin == true\n session[:admin] = true\n end\n end\n @current_user\n end",
"title": ""
},
{
"docid": "0a8b157fc41a05572d98b884696ff60e",
"score": "0.7495693",
"text": "def is_admin?\n current_user ? current_user.login == \"admin\" : false\n end",
"title": ""
},
{
"docid": "ac92f9033089e025bee44111aaa91b23",
"score": "0.74865526",
"text": "def find_admin_user\n@current_user= find_current_user\nif @current_user.present? and @current_user.is_admin?\n @current_user\nelse\n nil\nend\n\nend",
"title": ""
},
{
"docid": "fcdebf74a53a168efae5b772d66979b2",
"score": "0.74807316",
"text": "def get_admin_id\n (self.logged_admin_id || self.try(:last_acted_by)).to_i\n end",
"title": ""
},
{
"docid": "d008209653755e4cc091cbbc6faec820",
"score": "0.74752617",
"text": "def admin\n return get_profile('admin')\n end",
"title": ""
},
{
"docid": "b1a41867322764fd322746c32fc32202",
"score": "0.7471547",
"text": "def get_admin_user\n get_users.find { |u| u.role == UserRole::ADMIN }\n end",
"title": ""
},
{
"docid": "c9c39e6fc3692462736928f8b1f19c8d",
"score": "0.7460445",
"text": "def admin_logged_in?\n current_admin != :false\n end",
"title": ""
},
{
"docid": "bc4cb5405353eb8ebb50d73c19e652c0",
"score": "0.7458965",
"text": "def admin\n self.memberships.find_by(admin: true).user\n end",
"title": ""
},
{
"docid": "9a5e086502e2f1d59149db8c1b95e230",
"score": "0.7451826",
"text": "def get_session_user\n @admin = Admin.first\n end",
"title": ""
},
{
"docid": "2e96b2e8b9aab4d0cd14044ba12e415f",
"score": "0.744731",
"text": "def admin?\n\t\t\tcurrent_user && current_user.username == \"admin\"\n\t\tend",
"title": ""
},
{
"docid": "f49ab0439df6bd1d9664ab442054b812",
"score": "0.7445611",
"text": "def admin?\n # if there is no logged in user, there is no admin\n unless current_user\n @admin = false\n return\n end\n # check config to see if the user is an admin (true/false)\n @admin = current_user.is_admin?\n end",
"title": ""
},
{
"docid": "234f04e6dede7b7138e512cd5932ef07",
"score": "0.74433136",
"text": "def admin?\n current_user.is_admin? if !current_user.nil?\n end",
"title": ""
},
{
"docid": "e4967ddb8dd0202c3f1e22bb333ca363",
"score": "0.7442165",
"text": "def admin?\n current_user.nil? ? false : current_user.admin?\n end",
"title": ""
},
{
"docid": "fc472c378475047e1cf558c428241098",
"score": "0.74294776",
"text": "def admin_signed_in?\n current_user.try(:administrator?)\n end",
"title": ""
},
{
"docid": "11a3a0b409490b10b7ce559ec3d32bf0",
"score": "0.74029756",
"text": "def admin\n admins.first\n end",
"title": ""
},
{
"docid": "1e658bb6153a2e6ac07c40ff7b8b70b7",
"score": "0.73825145",
"text": "def admin\n has_admins.first\n end",
"title": ""
},
{
"docid": "096aa1a6af2b730487e744388c01bbf2",
"score": "0.73809695",
"text": "def admin?\n\t\tu = User.get(session[:uid])\n\t\treturn false if u.org == 0\n\t\treturn false if !u.active\n\n\t\treturn u.admin\n\tend",
"title": ""
},
{
"docid": "03f6536104c8f5874af79f1eca60bd37",
"score": "0.7379596",
"text": "def is_admin?\n current_user.try(:admin?)\n end",
"title": ""
},
{
"docid": "4982038bf5172086496ead21925980d4",
"score": "0.7379527",
"text": "def admin?\n logged_in? && current_user.admin == 1\n end",
"title": ""
},
{
"docid": "46c5101762d987031fbaf367f5e31741",
"score": "0.73781544",
"text": "def is_admin\n current_login_type == \"Administrator\"\n end",
"title": ""
},
{
"docid": "3ac5c7bf17f92ab8616d12443c9410a8",
"score": "0.73741907",
"text": "def admin?\n\t\t\tif logged_in?\n\t\t\t\tUser.find_by(id: session[:user_id]).role == 'admin'\n\t\t\tend\n\n\tend",
"title": ""
},
{
"docid": "7cdc79e368a6fe27a24018b7de811aff",
"score": "0.73627037",
"text": "def admin?\n current_user && (current_user.login==MDSL_SUPER_USER) \n end",
"title": ""
},
{
"docid": "c581c4c7def4e4bb7bfccac89933d00a",
"score": "0.73522186",
"text": "def admin?\n User.admin_logged_in?\n end",
"title": ""
},
{
"docid": "ba3ea33500ccb3deb89b5c0a60986548",
"score": "0.7352076",
"text": "def find_admin\n\n puts cookies.signed[\"user.token\"] #SI FUNCIONA!!\n token = cookies.signed[\"user.token\"]\n\n current_admin = Admin.find_by_token(token) #find_by => si no encuentra un usuario retorna nulo en lugar de marcar error\n\n if current_admin\n return current_admin\n else\n #reject_unauthorized_connection\n return nil\n end\n \n end",
"title": ""
},
{
"docid": "4134c80b5b72b55af1c0bab454869d91",
"score": "0.73404795",
"text": "def admin?\n return false\n # return (session[:user_id] && User.find(session[:user_id])[:login] == \"\") ? true : false\n end",
"title": ""
},
{
"docid": "28b9da6f69a7d93238308414224b1c6b",
"score": "0.7335065",
"text": "def admin_logged_in?\n !current_admin.nil? # An admin is logged in if current_admin is not nil\n end",
"title": ""
},
{
"docid": "7e249839dce59e061ca1c80086d582a8",
"score": "0.7327121",
"text": "def admin #i think I should get rid of this, and add this to the current_user as an if \n puts current_user, 'is the current user ###############################################'\n if current_user.name = 'admin'\n @admin = current_user\n end\n end",
"title": ""
},
{
"docid": "73fbf3c84c2b6c250eda742723e81c47",
"score": "0.7317305",
"text": "def current_user_admin?\n current_user && current_user.read_attribute(\"admin\")\n end",
"title": ""
},
{
"docid": "e5910f778fefb2d1c41caae95ce917e2",
"score": "0.7316912",
"text": "def site_admin\n User.find_by_email(APP_CONFIG[:default_admin_user][:email])\n end",
"title": ""
},
{
"docid": "e5910f778fefb2d1c41caae95ce917e2",
"score": "0.7316912",
"text": "def site_admin\n User.find_by_email(APP_CONFIG[:default_admin_user][:email])\n end",
"title": ""
},
{
"docid": "16ba8fb3ae187df25a76bd1d53e556c2",
"score": "0.7316071",
"text": "def admin_user\n @admin_user ||= repo_memberships.joins(:user).includes(:user).find_by(admin: true).try(:user)\n end",
"title": ""
},
{
"docid": "2b1bb6abaac47c7999145e4693a32464",
"score": "0.7315993",
"text": "def admin_logged_in?\n !current_admin_user.nil? \n end",
"title": ""
},
{
"docid": "7b05f4eea49101bbdba9d259df2843c5",
"score": "0.7300514",
"text": "def current_user\n @current_user ||= Struct.new(:admin?).new(true)\n end",
"title": ""
},
{
"docid": "0af174e481aceb2f4847317ddb55b18a",
"score": "0.729446",
"text": "def admin_loggedin?\r\n @logged_in_user and @logged_in_user.admin?\r\n end",
"title": ""
},
{
"docid": "e1beaee849339000486a053d30518e47",
"score": "0.729429",
"text": "def admin_login?\n\t !!current_admin\n\tend",
"title": ""
},
{
"docid": "dfee6897897538ce58993d4341922463",
"score": "0.72862905",
"text": "def current_administrator\n @current_administrator ||= Administrator.find_by_authentication_token!(session[:authentication_token]) if session[:authentication_token]\n end",
"title": ""
},
{
"docid": "37c61a9360f5b568266ff545cd05bd58",
"score": "0.7283194",
"text": "def getAdminId\n session[:adm_id]\n end",
"title": ""
},
{
"docid": "383eecb84d8914653993434222d25149",
"score": "0.7280444",
"text": "def admin?\n\t\tcurrent_user.admin\t\n\tend",
"title": ""
},
{
"docid": "97b2f1f0fdec04644d2e0f97d435aa7d",
"score": "0.7279201",
"text": "def admin?\n logged_in? && current_user.admin?\n end",
"title": ""
},
{
"docid": "97b2f1f0fdec04644d2e0f97d435aa7d",
"score": "0.7279201",
"text": "def admin?\n logged_in? && current_user.admin?\n end",
"title": ""
},
{
"docid": "16690eb77b2fca7c80fc986610425fa8",
"score": "0.72756225",
"text": "def logged_in_admin?\n !current_admin.nil?\n end",
"title": ""
},
{
"docid": "851ee2f81cb445bda3de103834338373",
"score": "0.7272665",
"text": "def current_user\n @_current_user ||= session[:current_user_id] &&\n AdminedLogin.find_by_id(session[:current_user_id])\n end",
"title": ""
},
{
"docid": "69f44a4961f4ad92b3c73c42d05cb3a9",
"score": "0.7271516",
"text": "def is_admin?\n # current_user.admin \n current_user.try(:admin?)\n end",
"title": ""
},
{
"docid": "89d9f4249922dc910be594617fc2fa25",
"score": "0.7269339",
"text": "def current_admin?(admin)\n admin == current_admin\n end",
"title": ""
},
{
"docid": "89d9f4249922dc910be594617fc2fa25",
"score": "0.7269339",
"text": "def current_admin?(admin)\n admin == current_admin\n end",
"title": ""
},
{
"docid": "89d9f4249922dc910be594617fc2fa25",
"score": "0.7269339",
"text": "def current_admin?(admin)\n admin == current_admin\n end",
"title": ""
},
{
"docid": "af11a2bd39019471b6ec890bb833183f",
"score": "0.7265199",
"text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n\n if @current_user.nil?\n false\n else\n @current_user.admin ||= 0 # just a safety precaution\n @current_user\n end\n end",
"title": ""
},
{
"docid": "62c3a6c8c55e6d394d7fdb8bef7e3b6d",
"score": "0.72572803",
"text": "def admin_is_present?\n return true if current_admin\n end",
"title": ""
},
{
"docid": "884998ba740186823c61e7b4c2f73972",
"score": "0.72517216",
"text": "def admin_user\n \tif current_user.nil?\n \tredirect_to(login_path)\n else\n \tredirect_to(login_path) unless current_user.admin?\n end\n end",
"title": ""
},
{
"docid": "884998ba740186823c61e7b4c2f73972",
"score": "0.72517216",
"text": "def admin_user\n \tif current_user.nil?\n \tredirect_to(login_path)\n else\n \tredirect_to(login_path) unless current_user.admin?\n end\n end",
"title": ""
},
{
"docid": "4cf158787b6487cdb78b67c9e31816e3",
"score": "0.7249589",
"text": "def current_user_admin\n #if \"admin\".casecmp(current_user.user_class)\n if current_user.user_class == \"admin\"\n return true\n end\n end",
"title": ""
},
{
"docid": "5926a1a29b704fcdd09150237a1f9c93",
"score": "0.72458917",
"text": "def admin?\n if (User.find_by_login(session[:login]).is_admin rescue nil)\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "4eaab514e9075b79c2222e9026d2dc94",
"score": "0.7243975",
"text": "def admin?\n session[:admin]\n end",
"title": ""
},
{
"docid": "fbdf9b5775acd266a8c9d3ad962813b7",
"score": "0.7235689",
"text": "def admin?\n logger.debug(\"in admin?\")\n application_user.admin\n end",
"title": ""
},
{
"docid": "24d721635710418a7250da4b5798c9a7",
"score": "0.72090226",
"text": "def admin_user\n\t \tif current_user.nil?\n\t \t\tredirect_to(login_path)\n\t \telse\n\t \t\tredirect_to(current_user) unless current_user.admin?\n\t \tend\n\t end",
"title": ""
},
{
"docid": "848fc2a589a96f204fe63cee51cabe49",
"score": "0.72061425",
"text": "def admin_role\n @admin ||= Role.where(name: 'Admin').first\n end",
"title": ""
},
{
"docid": "b09e3eaeaf01b12b933d16c7c770bfce",
"score": "0.7193731",
"text": "def admin?\n login == \"admin\"\n end",
"title": ""
},
{
"docid": "72ad2ac9147c2eecc3bac8e7d2bbce6b",
"score": "0.71922994",
"text": "def admin?\n\t\tcurrent_user.admin == true\n\tend",
"title": ""
},
{
"docid": "145da3fc17db0dee9bfa30bfabba8e5c",
"score": "0.71859163",
"text": "def admin_user?\r\n logged_in? and current_user.admin?\r\n end",
"title": ""
},
{
"docid": "1f557b7c4d248ade0861af1d8b49aea7",
"score": "0.7173929",
"text": "def admin_user?\n current_user.admin != 0\n end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.