repo
stringlengths
5
58
path
stringlengths
9
168
func_name
stringlengths
9
130
original_string
stringlengths
66
10.5k
language
stringclasses
1 value
code
stringlengths
66
10.5k
code_tokens
list
docstring
stringlengths
8
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
94
266
partition
stringclasses
1 value
ruby-x/rubyx
lib/risc/position/position_listener.rb
Risc.PositionListener.position_changed
def position_changed(previous) add = previous.object ? previous.object.padded_length : 0 next_at = previous.at + add next_pos = Position.get(@object) next_pos.set(next_at) end
ruby
def position_changed(previous) add = previous.object ? previous.object.padded_length : 0 next_at = previous.at + add next_pos = Position.get(@object) next_pos.set(next_at) end
[ "def", "position_changed", "(", "previous", ")", "add", "=", "previous", ".", "object", "?", "previous", ".", "object", ".", "padded_length", ":", "0", "next_at", "=", "previous", ".", "at", "+", "add", "next_pos", "=", "Position", ".", "get", "(", "@obj...
when the argument changes position, we update the next objects position to reflect that change
[ "when", "the", "argument", "changes", "position", "we", "update", "the", "next", "objects", "position", "to", "reflect", "that", "change" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/risc/position/position_listener.rb#L25-L30
train
ruby-x/rubyx
lib/risc/register_value.rb
Risc.RegisterValue.resolve_and_add
def resolve_and_add(slot , compiler) index = resolve_index( slot ) new_left = get_new_left( slot , compiler ) compiler.add_code Risc::SlotToReg.new( "SlotLoad #{type}[#{slot}]" , self ,index, new_left) new_left end
ruby
def resolve_and_add(slot , compiler) index = resolve_index( slot ) new_left = get_new_left( slot , compiler ) compiler.add_code Risc::SlotToReg.new( "SlotLoad #{type}[#{slot}]" , self ,index, new_left) new_left end
[ "def", "resolve_and_add", "(", "slot", ",", "compiler", ")", "index", "=", "resolve_index", "(", "slot", ")", "new_left", "=", "get_new_left", "(", "slot", ",", "compiler", ")", "compiler", ".", "add_code", "Risc", "::", "SlotToReg", ".", "new", "(", "\"Sl...
using the registers type, resolve the slot to an index Using the index and the register, add a SlotToReg to the instruction
[ "using", "the", "registers", "type", "resolve", "the", "slot", "to", "an", "index", "Using", "the", "index", "and", "the", "register", "add", "a", "SlotToReg", "to", "the", "instruction" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/risc/register_value.rb#L48-L53
train
ruby-x/rubyx
lib/risc/register_value.rb
Risc.RegisterValue.reduce_int
def reduce_int reduce = Risc.slot_to_reg( "int -> fix" , self , Parfait::Integer.integer_index , self) builder.add_code(reduce) if builder reduce end
ruby
def reduce_int reduce = Risc.slot_to_reg( "int -> fix" , self , Parfait::Integer.integer_index , self) builder.add_code(reduce) if builder reduce end
[ "def", "reduce_int", "reduce", "=", "Risc", ".", "slot_to_reg", "(", "\"int -> fix\"", ",", "self", ",", "Parfait", "::", "Integer", ".", "integer_index", ",", "self", ")", "builder", ".", "add_code", "(", "reduce", ")", "if", "builder", "reduce", "end" ]
reduce integer to fixnum and add instruction if builder is used
[ "reduce", "integer", "to", "fixnum", "and", "add", "instruction", "if", "builder", "is", "used" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/risc/register_value.rb#L65-L69
train
ruby-x/rubyx
lib/risc/register_value.rb
Risc.RegisterValue.next_reg_use
def next_reg_use( type , extra = {} ) int = @symbol[1,3].to_i raise "No more registers #{self}" if int > 11 sym = "r#{int + 1}".to_sym RegisterValue.new( sym , type, extra) end
ruby
def next_reg_use( type , extra = {} ) int = @symbol[1,3].to_i raise "No more registers #{self}" if int > 11 sym = "r#{int + 1}".to_sym RegisterValue.new( sym , type, extra) end
[ "def", "next_reg_use", "(", "type", ",", "extra", "=", "{", "}", ")", "int", "=", "@symbol", "[", "1", ",", "3", "]", ".", "to_i", "raise", "\"No more registers #{self}\"", "if", "int", ">", "11", "sym", "=", "\"r#{int + 1}\"", ".", "to_sym", "RegisterVa...
helper method to calculate with register symbols
[ "helper", "method", "to", "calculate", "with", "register", "symbols" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/risc/register_value.rb#L118-L123
train
ruby-x/rubyx
lib/risc/register_value.rb
Risc.RegisterValue.op
def op( operator , right) ret = Risc.op( "operator #{operator}" , operator , self , right) builder.add_code(ret) if builder ret end
ruby
def op( operator , right) ret = Risc.op( "operator #{operator}" , operator , self , right) builder.add_code(ret) if builder ret end
[ "def", "op", "(", "operator", ",", "right", ")", "ret", "=", "Risc", ".", "op", "(", "\"operator #{operator}\"", ",", "operator", ",", "self", ",", "right", ")", "builder", ".", "add_code", "(", "ret", ")", "if", "builder", "ret", "end" ]
create operator instruction for self and add doesn't read quite as smoothly as one would like, but better than the compiler version
[ "create", "operator", "instruction", "for", "self", "and", "add", "doesn", "t", "read", "quite", "as", "smoothly", "as", "one", "would", "like", "but", "better", "than", "the", "compiler", "version" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/risc/register_value.rb#L184-L188
train
ruby-x/rubyx
lib/vool/statements.rb
Vool.Statements.to_mom
def to_mom( compiler ) raise "Empty list ? #{statements.length}" if empty? stats = @statements.dup first = stats.shift.to_mom(compiler) while( nekst = stats.shift ) first.append nekst.to_mom(compiler) end first end
ruby
def to_mom( compiler ) raise "Empty list ? #{statements.length}" if empty? stats = @statements.dup first = stats.shift.to_mom(compiler) while( nekst = stats.shift ) first.append nekst.to_mom(compiler) end first end
[ "def", "to_mom", "(", "compiler", ")", "raise", "\"Empty list ? #{statements.length}\"", "if", "empty?", "stats", "=", "@statements", ".", "dup", "first", "=", "stats", ".", "shift", ".", "to_mom", "(", "compiler", ")", "while", "(", "nekst", "=", "stats", "...
to_mom all the statements. Append subsequent ones to the first, and return the first. For ClassStatements this creates and returns a MomCompiler
[ "to_mom", "all", "the", "statements", ".", "Append", "subsequent", "ones", "to", "the", "first", "and", "return", "the", "first", "." ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/vool/statements.rb#L39-L47
train
ruby-x/rubyx
lib/parfait/type.rb
Parfait.Type.init_lists
def init_lists(hash) self.methods = nil self.names = List.new self.types = List.new raise "No type Type in #{hash}" unless hash[:type] private_add_instance_variable(:type , hash[:type]) #first hash.each do |name , type| private_add_instance_variable(name , type) unless name =...
ruby
def init_lists(hash) self.methods = nil self.names = List.new self.types = List.new raise "No type Type in #{hash}" unless hash[:type] private_add_instance_variable(:type , hash[:type]) #first hash.each do |name , type| private_add_instance_variable(name , type) unless name =...
[ "def", "init_lists", "(", "hash", ")", "self", ".", "methods", "=", "nil", "self", ".", "names", "=", "List", ".", "new", "self", ".", "types", "=", "List", ".", "new", "raise", "\"No type Type in #{hash}\"", "unless", "hash", "[", ":type", "]", "private...
this part of the init is seperate because at boot time we can not use normal new new is overloaded to grab the type from space, and before boot, that is not set up
[ "this", "part", "of", "the", "init", "is", "seperate", "because", "at", "boot", "time", "we", "can", "not", "use", "normal", "new", "new", "is", "overloaded", "to", "grab", "the", "type", "from", "space", "and", "before", "boot", "that", "is", "not", "...
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/parfait/type.rb#L59-L68
train
ruby-x/rubyx
lib/parfait/type.rb
Parfait.Type.add_instance_variable
def add_instance_variable( name , type ) raise "No nil name" unless name raise "No nil type" unless type hash = to_hash hash[name] = type return Type.for_hash( object_class , hash) end
ruby
def add_instance_variable( name , type ) raise "No nil name" unless name raise "No nil type" unless type hash = to_hash hash[name] = type return Type.for_hash( object_class , hash) end
[ "def", "add_instance_variable", "(", "name", ",", "type", ")", "raise", "\"No nil name\"", "unless", "name", "raise", "\"No nil type\"", "unless", "type", "hash", "=", "to_hash", "hash", "[", "name", "]", "=", "type", "return", "Type", ".", "for_hash", "(", ...
add the name of an instance variable Type objects are immutable, so a new object is returned As types are also unique, two same adds will result in identical results
[ "add", "the", "name", "of", "an", "instance", "variable", "Type", "objects", "are", "immutable", "so", "a", "new", "object", "is", "returned", "As", "types", "are", "also", "unique", "two", "same", "adds", "will", "result", "in", "identical", "results" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/parfait/type.rb#L183-L189
train
ruby-x/rubyx
lib/arm/instructions/logic_instruction.rb
Arm.LogicInstruction.determine_operands
def determine_operands if( @left.is_a?(Parfait::Object) or @left.is_a?(Risc::Label) or (@left.is_a?(Symbol) and !Risc::RegisterValue.look_like_reg(@left))) left = @left left = left.address if left.is_a?(Risc::Label) # do pc relative addressing with the difference to the instuction ...
ruby
def determine_operands if( @left.is_a?(Parfait::Object) or @left.is_a?(Risc::Label) or (@left.is_a?(Symbol) and !Risc::RegisterValue.look_like_reg(@left))) left = @left left = left.address if left.is_a?(Risc::Label) # do pc relative addressing with the difference to the instuction ...
[ "def", "determine_operands", "if", "(", "@left", ".", "is_a?", "(", "Parfait", "::", "Object", ")", "or", "@left", ".", "is_a?", "(", "Risc", "::", "Label", ")", "or", "(", "@left", ".", "is_a?", "(", "Symbol", ")", "and", "!", "Risc", "::", "Registe...
don't overwrite instance variables, to make assembly repeatable this also loads constants, which are issued as pc relative adds
[ "don", "t", "overwrite", "instance", "variables", "to", "make", "assembly", "repeatable", "this", "also", "loads", "constants", "which", "are", "issued", "as", "pc", "relative", "adds" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/arm/instructions/logic_instruction.rb#L94-L112
train
feedreader/pluto
pluto-merge/lib/pluto/merge/manifest_helpers.rb
Pluto.ManifestHelper.installed_template_manifest_patterns
def installed_template_manifest_patterns # 1) search . # that is, working/current dir # 2) search <config_dir> # 3) search <gem>/templates ### # Note # -- for now - no longer ship w/ builtin template packs # - download on demand if needed builtin_patterns = [ ## "#{Pluto.root}/templates/*.txt...
ruby
def installed_template_manifest_patterns # 1) search . # that is, working/current dir # 2) search <config_dir> # 3) search <gem>/templates ### # Note # -- for now - no longer ship w/ builtin template packs # - download on demand if needed builtin_patterns = [ ## "#{Pluto.root}/templates/*.txt...
[ "def", "installed_template_manifest_patterns", "builtin_patterns", "=", "[", "]", "config_patterns", "=", "[", "\"#{File.expand_path(opts.config_path)}/*/*.txt\"", "]", "current_patterns", "=", "[", "\"*/*.txt\"", ",", "\"node_modules/*/*.txt\"", ",", "]", "patterns", "=", ...
shared methods for handling manifest lookups note: required attribs (in host class) include: - opts.config_path
[ "shared", "methods", "for", "handling", "manifest", "lookups" ]
d2e304441f8df42e2e1c296476f2a40c56a6f316
https://github.com/feedreader/pluto/blob/d2e304441f8df42e2e1c296476f2a40c56a6f316/pluto-merge/lib/pluto/merge/manifest_helpers.rb#L17-L45
train
ruby-x/rubyx
lib/risc/text_writer.rb
Risc.TextWriter.write_as_string
def write_as_string @stream = StringIO.new write_init(@linker.cpu_init) write_debug write_objects write_code log.debug "Assembled 0x#{stream_position.to_s(16)} bytes" return @stream.string end
ruby
def write_as_string @stream = StringIO.new write_init(@linker.cpu_init) write_debug write_objects write_code log.debug "Assembled 0x#{stream_position.to_s(16)} bytes" return @stream.string end
[ "def", "write_as_string", "@stream", "=", "StringIO", ".", "new", "write_init", "(", "@linker", ".", "cpu_init", ")", "write_debug", "write_objects", "write_code", "log", ".", "debug", "\"Assembled 0x#{stream_position.to_s(16)} bytes\"", "return", "@stream", ".", "strin...
objects must be written in same order as positioned by the linker, namely - intial jump - all objects - all BinaryCode
[ "objects", "must", "be", "written", "in", "same", "order", "as", "positioned", "by", "the", "linker", "namely", "-", "intial", "jump", "-", "all", "objects", "-", "all", "BinaryCode" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/risc/text_writer.rb#L28-L36
train
ruby-x/rubyx
lib/risc/text_writer.rb
Risc.TextWriter.write_code
def write_code @linker.assemblers.each do |asm| asm.callable.each_binary do |code| write_any(code) end end end
ruby
def write_code @linker.assemblers.each do |asm| asm.callable.each_binary do |code| write_any(code) end end end
[ "def", "write_code", "@linker", ".", "assemblers", ".", "each", "do", "|", "asm", "|", "asm", ".", "callable", ".", "each_binary", "do", "|", "code", "|", "write_any", "(", "code", ")", "end", "end", "end" ]
Write the BinaryCode objects of all methods to stream. Really like any other object, it's just about the ordering
[ "Write", "the", "BinaryCode", "objects", "of", "all", "methods", "to", "stream", ".", "Really", "like", "any", "other", "object", "it", "s", "just", "about", "the", "ordering" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/risc/text_writer.rb#L61-L67
train
ruby-x/rubyx
lib/risc/text_writer.rb
Risc.TextWriter.write_any
def write_any( obj ) write_any_log( obj , "Write") if stream_position != Position.get(obj).at raise "Write #{obj.class}:0x#{obj.object_id.to_s(16)} at 0x#{stream_position.to_s(16)} not #{Position.get(obj)}" end write_any_out(obj) write_any_log( obj , "Wrote") Position.get(o...
ruby
def write_any( obj ) write_any_log( obj , "Write") if stream_position != Position.get(obj).at raise "Write #{obj.class}:0x#{obj.object_id.to_s(16)} at 0x#{stream_position.to_s(16)} not #{Position.get(obj)}" end write_any_out(obj) write_any_log( obj , "Wrote") Position.get(o...
[ "def", "write_any", "(", "obj", ")", "write_any_log", "(", "obj", ",", "\"Write\"", ")", "if", "stream_position", "!=", "Position", ".", "get", "(", "obj", ")", ".", "at", "raise", "\"Write #{obj.class}:0x#{obj.object_id.to_s(16)} at 0x#{stream_position.to_s(16)} not #{...
Write any object just logs a bit and passes to write_any_out
[ "Write", "any", "object", "just", "logs", "a", "bit", "and", "passes", "to", "write_any_out" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/risc/text_writer.rb#L70-L78
train
ruby-x/rubyx
lib/risc/text_writer.rb
Risc.TextWriter.write_object
def write_object( object ) obj_written = write_object_variables(object) log.debug "instances=#{object.get_instance_variables.inspect} mem_len=0x#{object.padded_length.to_s(16)}" indexed_written = write_object_indexed(object) log.debug "type #{obj_written} , total #{obj_written + indexed_written}...
ruby
def write_object( object ) obj_written = write_object_variables(object) log.debug "instances=#{object.get_instance_variables.inspect} mem_len=0x#{object.padded_length.to_s(16)}" indexed_written = write_object_indexed(object) log.debug "type #{obj_written} , total #{obj_written + indexed_written}...
[ "def", "write_object", "(", "object", ")", "obj_written", "=", "write_object_variables", "(", "object", ")", "log", ".", "debug", "\"instances=#{object.get_instance_variables.inspect} mem_len=0x#{object.padded_length.to_s(16)}\"", "indexed_written", "=", "write_object_indexed", "...
write type of the instance, and the variables that are passed variables ar values, ie int or refs. For refs the object needs to save the object first
[ "write", "type", "of", "the", "instance", "and", "the", "variables", "that", "are", "passed", "variables", "ar", "values", "ie", "int", "or", "refs", ".", "For", "refs", "the", "object", "needs", "to", "save", "the", "object", "first" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/risc/text_writer.rb#L105-L113
train
ruby-x/rubyx
lib/risc/text_writer.rb
Risc.TextWriter.write_ref_for
def write_ref_for object case object when nil @stream.write_signed_int_32(0) when ::Integer @stream.write_signed_int_32(object) else @stream.write_signed_int_32(Position.get(object) + @linker.platform.loaded_at) end end
ruby
def write_ref_for object case object when nil @stream.write_signed_int_32(0) when ::Integer @stream.write_signed_int_32(object) else @stream.write_signed_int_32(Position.get(object) + @linker.platform.loaded_at) end end
[ "def", "write_ref_for", "object", "case", "object", "when", "nil", "@stream", ".", "write_signed_int_32", "(", "0", ")", "when", "::", "Integer", "@stream", ".", "write_signed_int_32", "(", "object", ")", "else", "@stream", ".", "write_signed_int_32", "(", "Posi...
write means we write the resulting address straight into the assembler stream object means the object of which we write the address
[ "write", "means", "we", "write", "the", "resulting", "address", "straight", "into", "the", "assembler", "stream", "object", "means", "the", "object", "of", "which", "we", "write", "the", "address" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/risc/text_writer.rb#L205-L214
train
ruby-x/rubyx
lib/parfait/list.rb
Parfait.List.index_of
def index_of( item ) max = self.get_length #puts "length #{max} #{max.class}" counter = 0 while( counter < max ) if( get(counter) == item) return counter end counter = counter + 1 end return nil end
ruby
def index_of( item ) max = self.get_length #puts "length #{max} #{max.class}" counter = 0 while( counter < max ) if( get(counter) == item) return counter end counter = counter + 1 end return nil end
[ "def", "index_of", "(", "item", ")", "max", "=", "self", ".", "get_length", "counter", "=", "0", "while", "(", "counter", "<", "max", ")", "if", "(", "get", "(", "counter", ")", "==", "item", ")", "return", "counter", "end", "counter", "=", "counter"...
index of item return nil if no such item
[ "index", "of", "item", "return", "nil", "if", "no", "such", "item" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/parfait/list.rb#L94-L105
train
ruby-x/rubyx
lib/parfait/list.rb
Parfait.List.next_value
def next_value(val) index = index_of(val) return nil unless index return nil if index == (get_length - 1) return get(index + 1) end
ruby
def next_value(val) index = index_of(val) return nil unless index return nil if index == (get_length - 1) return get(index + 1) end
[ "def", "next_value", "(", "val", ")", "index", "=", "index_of", "(", "val", ")", "return", "nil", "unless", "index", "return", "nil", "if", "index", "==", "(", "get_length", "-", "1", ")", "return", "get", "(", "index", "+", "1", ")", "end" ]
return the next of given. Nil if item not in list or there is not next
[ "return", "the", "next", "of", "given", ".", "Nil", "if", "item", "not", "in", "list", "or", "there", "is", "not", "next" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/parfait/list.rb#L108-L113
train
RISCfuture/dropbox
lib/dropbox/api.rb
Dropbox.API.download
def download(path, options={}) path = path.sub(/^\//, '') rest = Dropbox.check_path(path).split('/') rest << { :ssl => @ssl } api_body :get, 'files', root(options), *rest #TODO streaming, range queries end
ruby
def download(path, options={}) path = path.sub(/^\//, '') rest = Dropbox.check_path(path).split('/') rest << { :ssl => @ssl } api_body :get, 'files', root(options), *rest #TODO streaming, range queries end
[ "def", "download", "(", "path", ",", "options", "=", "{", "}", ")", "path", "=", "path", ".", "sub", "(", "/", "\\/", "/", ",", "''", ")", "rest", "=", "Dropbox", ".", "check_path", "(", "path", ")", ".", "split", "(", "'/'", ")", "rest", "<<",...
Downloads the file at the given path relative to the configured mode's root. Returns the contents of the downloaded file as a +String+. Support for streaming downloads and range queries is available server-side, but not available in this API client due to limitations of the OAuth gem. Options: +mode+:: Tempora...
[ "Downloads", "the", "file", "at", "the", "given", "path", "relative", "to", "the", "configured", "mode", "s", "root", "." ]
702c0f99a25bb319b4a191f3dac2dbbd60427f9d
https://github.com/RISCfuture/dropbox/blob/702c0f99a25bb319b4a191f3dac2dbbd60427f9d/lib/dropbox/api.rb#L84-L90
train
RISCfuture/dropbox
lib/dropbox/api.rb
Dropbox.API.delete
def delete(path, options={}) path = path.sub(/^\//, '') path.sub! /\/$/, '' begin api_response(:post, 'fileops', 'delete', :path => Dropbox.check_path(path), :root => root(options), :ssl => @ssl) rescue UnsuccessfulResponseError => error raise FileNotFoundError.new(path) if error...
ruby
def delete(path, options={}) path = path.sub(/^\//, '') path.sub! /\/$/, '' begin api_response(:post, 'fileops', 'delete', :path => Dropbox.check_path(path), :root => root(options), :ssl => @ssl) rescue UnsuccessfulResponseError => error raise FileNotFoundError.new(path) if error...
[ "def", "delete", "(", "path", ",", "options", "=", "{", "}", ")", "path", "=", "path", ".", "sub", "(", "/", "\\/", "/", ",", "''", ")", "path", ".", "sub!", "/", "\\/", "/", ",", "''", "begin", "api_response", "(", ":post", ",", "'fileops'", "...
Deletes a file or folder at the given path. The path is assumed to be relative to the configured mode's root. Raises FileNotFoundError if the file or folder does not exist at +path+. Options: +mode+:: Temporarily changes the API mode. See the MODES array. TODO The API documentation says this method returns 404...
[ "Deletes", "a", "file", "or", "folder", "at", "the", "given", "path", ".", "The", "path", "is", "assumed", "to", "be", "relative", "to", "the", "configured", "mode", "s", "root", "." ]
702c0f99a25bb319b4a191f3dac2dbbd60427f9d
https://github.com/RISCfuture/dropbox/blob/702c0f99a25bb319b4a191f3dac2dbbd60427f9d/lib/dropbox/api.rb#L288-L298
train
RISCfuture/dropbox
lib/dropbox/api.rb
Dropbox.API.rename
def rename(path, new_name, options={}) raise ArgumentError, "Names cannot have slashes in them" if new_name.include?('/') path = path.sub(/\/$/, '') destination = path.split('/') destination[destination.size - 1] = new_name destination = destination.join('/') move path, destination, ...
ruby
def rename(path, new_name, options={}) raise ArgumentError, "Names cannot have slashes in them" if new_name.include?('/') path = path.sub(/\/$/, '') destination = path.split('/') destination[destination.size - 1] = new_name destination = destination.join('/') move path, destination, ...
[ "def", "rename", "(", "path", ",", "new_name", ",", "options", "=", "{", "}", ")", "raise", "ArgumentError", ",", "\"Names cannot have slashes in them\"", "if", "new_name", ".", "include?", "(", "'/'", ")", "path", "=", "path", ".", "sub", "(", "/", "\\/",...
Renames a file. Takes the same options and raises the same exceptions as the move method. Calling session.rename 'path/to/file', 'new_name' is equivalent to calling session.move 'path/to/file', 'path/to/new_name'
[ "Renames", "a", "file", ".", "Takes", "the", "same", "options", "and", "raises", "the", "same", "exceptions", "as", "the", "move", "method", "." ]
702c0f99a25bb319b4a191f3dac2dbbd60427f9d
https://github.com/RISCfuture/dropbox/blob/702c0f99a25bb319b4a191f3dac2dbbd60427f9d/lib/dropbox/api.rb#L343-L350
train
RISCfuture/dropbox
lib/dropbox/api.rb
Dropbox.API.link
def link(path, options={}) path = path.sub(/^\//, '') begin rest = Dropbox.check_path(path).split('/') rest << { :ssl => @ssl } api_response(:get, 'links', root(options), *rest) rescue UnsuccessfulResponseError => error return error.response['Location'] if error.respons...
ruby
def link(path, options={}) path = path.sub(/^\//, '') begin rest = Dropbox.check_path(path).split('/') rest << { :ssl => @ssl } api_response(:get, 'links', root(options), *rest) rescue UnsuccessfulResponseError => error return error.response['Location'] if error.respons...
[ "def", "link", "(", "path", ",", "options", "=", "{", "}", ")", "path", "=", "path", ".", "sub", "(", "/", "\\/", "/", ",", "''", ")", "begin", "rest", "=", "Dropbox", ".", "check_path", "(", "path", ")", ".", "split", "(", "'/'", ")", "rest", ...
Returns a cookie-protected URL that the authorized user can use to view the file at the given path. This URL requires an authorized user. The path is assumed to be relative to the configured mode's root. Options: +mode+:: Temporarily changes the API mode. See the MODES array.
[ "Returns", "a", "cookie", "-", "protected", "URL", "that", "the", "authorized", "user", "can", "use", "to", "view", "the", "file", "at", "the", "given", "path", ".", "This", "URL", "requires", "an", "authorized", "user", "." ]
702c0f99a25bb319b4a191f3dac2dbbd60427f9d
https://github.com/RISCfuture/dropbox/blob/702c0f99a25bb319b4a191f3dac2dbbd60427f9d/lib/dropbox/api.rb#L361-L372
train
RISCfuture/dropbox
lib/dropbox/api.rb
Dropbox.API.shares
def shares(path, options={}) path = path.sub(/^\//, '') rest = Dropbox.check_path(path).split('/') begin return JSON.parse( api_response(:post, 'shares', root(options), *rest).body ).symbolize_keys_recursively rescue UnsuccessfulResponseError => error return error.response...
ruby
def shares(path, options={}) path = path.sub(/^\//, '') rest = Dropbox.check_path(path).split('/') begin return JSON.parse( api_response(:post, 'shares', root(options), *rest).body ).symbolize_keys_recursively rescue UnsuccessfulResponseError => error return error.response...
[ "def", "shares", "(", "path", ",", "options", "=", "{", "}", ")", "path", "=", "path", ".", "sub", "(", "/", "\\/", "/", ",", "''", ")", "rest", "=", "Dropbox", ".", "check_path", "(", "path", ")", ".", "split", "(", "'/'", ")", "begin", "retur...
Creates and returns a shareable link to files or folders. The path is assumed to be relative to the configured mode's root. Options: +mode+:: Temporarily changes the API mode. See the MODES array.
[ "Creates", "and", "returns", "a", "shareable", "link", "to", "files", "or", "folders", "." ]
702c0f99a25bb319b4a191f3dac2dbbd60427f9d
https://github.com/RISCfuture/dropbox/blob/702c0f99a25bb319b4a191f3dac2dbbd60427f9d/lib/dropbox/api.rb#L383-L394
train
RISCfuture/dropbox
lib/dropbox/api.rb
Dropbox.API.metadata
def metadata(path, options={}) path = path.sub(/^\//, '') args = [ 'metadata', root(options) ] args += Dropbox.check_path(path).split('/') args << Hash.new args.last[:file_limit] = options[:limit] if options[:limit] args.last[:hash] = options...
ruby
def metadata(path, options={}) path = path.sub(/^\//, '') args = [ 'metadata', root(options) ] args += Dropbox.check_path(path).split('/') args << Hash.new args.last[:file_limit] = options[:limit] if options[:limit] args.last[:hash] = options...
[ "def", "metadata", "(", "path", ",", "options", "=", "{", "}", ")", "path", "=", "path", ".", "sub", "(", "/", "\\/", "/", ",", "''", ")", "args", "=", "[", "'metadata'", ",", "root", "(", "options", ")", "]", "args", "+=", "Dropbox", ".", "che...
Returns a +Struct+ containing metadata on a given file or folder. The path is assumed to be relative to the configured mode's root. If you pass a directory for +path+, the metadata will also contain a listing of the directory contents (unless the +suppress_list+ option is true). For information on the schema of ...
[ "Returns", "a", "+", "Struct", "+", "containing", "metadata", "on", "a", "given", "file", "or", "folder", ".", "The", "path", "is", "assumed", "to", "be", "relative", "to", "the", "configured", "mode", "s", "root", "." ]
702c0f99a25bb319b4a191f3dac2dbbd60427f9d
https://github.com/RISCfuture/dropbox/blob/702c0f99a25bb319b4a191f3dac2dbbd60427f9d/lib/dropbox/api.rb#L424-L445
train
ruby-x/rubyx
lib/risc/position/instruction_listener.rb
Risc.InstructionListener.position_changed
def position_changed(position) instruction = position.object return unless instruction.is_a?(Label) instruction.address.set_value(position.at) end
ruby
def position_changed(position) instruction = position.object return unless instruction.is_a?(Label) instruction.address.set_value(position.at) end
[ "def", "position_changed", "(", "position", ")", "instruction", "=", "position", ".", "object", "return", "unless", "instruction", ".", "is_a?", "(", "Label", ")", "instruction", ".", "address", ".", "set_value", "(", "position", ".", "at", ")", "end" ]
update label positions. All else done in position_changing
[ "update", "label", "positions", ".", "All", "else", "done", "in", "position_changing" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/risc/position/instruction_listener.rb#L57-L61
train
ruby-x/rubyx
lib/parfait/dictionary.rb
Parfait.Dictionary.set
def set(key , value) index = key_index(key) if( index ) i_values.set(index , value) else i_keys.push(key) i_values.push(value) end value end
ruby
def set(key , value) index = key_index(key) if( index ) i_values.set(index , value) else i_keys.push(key) i_values.push(value) end value end
[ "def", "set", "(", "key", ",", "value", ")", "index", "=", "key_index", "(", "key", ")", "if", "(", "index", ")", "i_values", ".", "set", "(", "index", ",", "value", ")", "else", "i_keys", ".", "push", "(", "key", ")", "i_values", ".", "push", "(...
set key with value, returns value
[ "set", "key", "with", "value", "returns", "value" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/parfait/dictionary.rb#L66-L75
train
ruby-x/rubyx
lib/parfait/dictionary.rb
Parfait.Dictionary.each
def each index = 0 while index < i_keys.get_length key = i_keys.get(index) value = i_values.get(index) yield key , value index = index + 1 end self end
ruby
def each index = 0 while index < i_keys.get_length key = i_keys.get(index) value = i_values.get(index) yield key , value index = index + 1 end self end
[ "def", "each", "index", "=", "0", "while", "index", "<", "i_keys", ".", "get_length", "key", "=", "i_keys", ".", "get", "(", "index", ")", "value", "=", "i_values", ".", "get", "(", "index", ")", "yield", "key", ",", "value", "index", "=", "index", ...
yield to each key value pair
[ "yield", "to", "each", "key", "value", "pair" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/parfait/dictionary.rb#L83-L92
train
ruby-x/rubyx
lib/ruby/ruby_compiler.rb
Ruby.RubyCompiler.on_array
def on_array expression ArrayStatement.new expression.children.collect{ |elem| process(elem) } end
ruby
def on_array expression ArrayStatement.new expression.children.collect{ |elem| process(elem) } end
[ "def", "on_array", "expression", "ArrayStatement", ".", "new", "expression", ".", "children", ".", "collect", "{", "|", "elem", "|", "process", "(", "elem", ")", "}", "end" ]
Array + Hashes
[ "Array", "+", "Hashes" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/ruby/ruby_compiler.rb#L143-L145
train
ruby-x/rubyx
lib/ruby/ruby_compiler.rb
Ruby.RubyCompiler.on_super
def on_super( statement ) arguments = process_all(statement.children) SendStatement.new( nil , SuperExpression.new , arguments) end
ruby
def on_super( statement ) arguments = process_all(statement.children) SendStatement.new( nil , SuperExpression.new , arguments) end
[ "def", "on_super", "(", "statement", ")", "arguments", "=", "process_all", "(", "statement", ".", "children", ")", "SendStatement", ".", "new", "(", "nil", ",", "SuperExpression", ".", "new", ",", "arguments", ")", "end" ]
this is a call to super with args and same name as current method, which is set later
[ "this", "is", "a", "call", "to", "super", "with", "args", "and", "same", "name", "as", "current", "method", "which", "is", "set", "later" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/ruby/ruby_compiler.rb#L240-L243
train
ruby-x/rubyx
lib/parfait/behaviour.rb
Parfait.Behaviour.resolve_method
def resolve_method( m_name ) raise "resolve_method #{m_name}.#{m_name.class}" unless m_name.is_a?(Symbol) method = get_instance_method(m_name) return method if method if( super_class_name && super_class_name != :Object ) method = self.super_class.resolve_method(m_name) end me...
ruby
def resolve_method( m_name ) raise "resolve_method #{m_name}.#{m_name.class}" unless m_name.is_a?(Symbol) method = get_instance_method(m_name) return method if method if( super_class_name && super_class_name != :Object ) method = self.super_class.resolve_method(m_name) end me...
[ "def", "resolve_method", "(", "m_name", ")", "raise", "\"resolve_method #{m_name}.#{m_name.class}\"", "unless", "m_name", ".", "is_a?", "(", "Symbol", ")", "method", "=", "get_instance_method", "(", "m_name", ")", "return", "method", "if", "method", "if", "(", "su...
get the method and if not found, try superclasses. raise error if not found
[ "get", "the", "method", "and", "if", "not", "found", "try", "superclasses", ".", "raise", "error", "if", "not", "found" ]
1391667f6cf16c8e132cbf85cc6a5171fb8c444e
https://github.com/ruby-x/rubyx/blob/1391667f6cf16c8e132cbf85cc6a5171fb8c444e/lib/parfait/behaviour.rb#L44-L52
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_albums
def create_albums(data=nil,generate_objects=false) uri = URI.parse(@uri + '/Albums') post(uri,data,generate_objects) end
ruby
def create_albums(data=nil,generate_objects=false) uri = URI.parse(@uri + '/Albums') post(uri,data,generate_objects) end
[ "def", "create_albums", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "'/Albums'", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create Albums. @param data [Single Albums Object, Array of Albums Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns an Albums objects array if gene...
[ "Create", "Albums", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L283-L286
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_albums
def update_albums(data=nil,generate_objects=false) uri = URI.parse(@uri + '/Albums') put(uri,data,generate_objects) end
ruby
def update_albums(data=nil,generate_objects=false) uri = URI.parse(@uri + '/Albums') put(uri,data,generate_objects) end
[ "def", "update_albums", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "'/Albums'", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify Albums. @param data [Single Albums Object, Array of Albums Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns an Albums objects array if gene...
[ "Modify", "Albums", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L301-L304
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_categories
def update_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Categories") put(uri,data,generate_objects) end
ruby
def update_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Categories") put(uri,data,generate_objects) end
[ "def", "update_categories", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Categories\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify system Categories. @param data [Single Categories Object, Array of Categories Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns a Categories...
[ "Modify", "system", "Categories", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L423-L426
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_copyright_holders
def create_copyright_holders(data=nil,generate_objects=false) uri = URI.parse(@uri + "/CopyrightHolders") post(uri,data,generate_objects) end
ruby
def create_copyright_holders(data=nil,generate_objects=false) uri = URI.parse(@uri + "/CopyrightHolders") post(uri,data,generate_objects) end
[ "def", "create_copyright_holders", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/CopyrightHolders\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create CopyrightHoloders. @param data [Single CopyrightPolicies Object, Array of CopyrightPolicies Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Return...
[ "Create", "CopyrightHoloders", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L465-L468
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_copyright_holders
def update_copyright_holders(data=nil,generate_objects=false) uri = URI.parse(@uri + "/CopyrightHolders") put(uri,data,generate_objects) end
ruby
def update_copyright_holders(data=nil,generate_objects=false) uri = URI.parse(@uri + "/CopyrightHolders") put(uri,data,generate_objects) end
[ "def", "update_copyright_holders", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/CopyrightHolders\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify CopyrightHolders. @param data [Single CopyrightHolders Object, Array of CopyrightHoloders Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns ...
[ "Modify", "CopyrightHolders", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L483-L486
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_copyright_policies
def create_copyright_policies(data=nil,generate_objects=false) uri = URI.parse(@uri + "/CopyrightPolicies") post(uri,data,generate_objects) end
ruby
def create_copyright_policies(data=nil,generate_objects=false) uri = URI.parse(@uri + "/CopyrightPolicies") post(uri,data,generate_objects) end
[ "def", "create_copyright_policies", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/CopyrightPolicies\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create CopyrightPolicies. @param data [Single CopyrightPolicies Object, Array of CopyrightPolicies Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Return...
[ "Create", "CopyrightPolicies", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L539-L542
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_copyright_policies
def update_copyright_policies(data=nil,generate_objects=false) uri = URI.parse(@uri + "/CopyrightPolicies") put(uri,data,generate_objects) end
ruby
def update_copyright_policies(data=nil,generate_objects=false) uri = URI.parse(@uri + "/CopyrightPolicies") put(uri,data,generate_objects) end
[ "def", "update_copyright_policies", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/CopyrightPolicies\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify CopyrightPolicies. @param data [Single CopyrightPolicies Object, Array of CopyrightPolicies Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Return...
[ "Modify", "CopyrightPolicies", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L557-L560
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_fields
def create_fields(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Fields") post(uri,data,generate_objects) end
ruby
def create_fields(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Fields") post(uri,data,generate_objects) end
[ "def", "create_fields", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Fields\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create fields. @param data [Single Fields Object, Array of Fields Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns a Fields objects array if gener...
[ "Create", "fields", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L656-L659
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_fields
def update_fields(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Fields") put(uri,data,generate_objects) end
ruby
def update_fields(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Fields") put(uri,data,generate_objects) end
[ "def", "update_fields", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Fields\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify fields. @param data [Single Fields Object, Array of Fields Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns a Fields objects array if gener...
[ "Modify", "fields", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L674-L677
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.get_field_lookup_strings
def get_field_lookup_strings(field=nil,query_obj=nil,with_nested_resources=false,use_http_query=false) id = Validator.validate_field_lookup_string_arg(field) uri = URI.parse(@uri + "/Fields" + "/#{id}" + "/FieldLookupStrings") handle_get_request(uri,query_obj,with_nested_resources,u...
ruby
def get_field_lookup_strings(field=nil,query_obj=nil,with_nested_resources=false,use_http_query=false) id = Validator.validate_field_lookup_string_arg(field) uri = URI.parse(@uri + "/Fields" + "/#{id}" + "/FieldLookupStrings") handle_get_request(uri,query_obj,with_nested_resources,u...
[ "def", "get_field_lookup_strings", "(", "field", "=", "nil", ",", "query_obj", "=", "nil", ",", "with_nested_resources", "=", "false", ",", "use_http_query", "=", "false", ")", "id", "=", "Validator", ".", "validate_field_lookup_string_arg", "(", "field", ")", "...
FIELD LOOKUP STRINGS Retrieves options for Fixed Suggestion, Suggestion, and Option field types. @param field [Fields Object, Hash, String, Integer] Argument must specify the field id (Required) @param query_obj[RestOptions Object] Takes a RestOptions object or a SQL WHERE clause (Optional)...
[ "FIELD", "LOOKUP", "STRINGS" ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L717-L722
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_field_lookup_strings
def create_field_lookup_strings(field=nil,data=nil,generate_objects=false) id = Validator.validate_field_lookup_string_arg(field) uri = URI.parse(@uri + "/Fields" + "/#{id}" + "/FieldLookupStrings") post(uri,data,generate_objects) end
ruby
def create_field_lookup_strings(field=nil,data=nil,generate_objects=false) id = Validator.validate_field_lookup_string_arg(field) uri = URI.parse(@uri + "/Fields" + "/#{id}" + "/FieldLookupStrings") post(uri,data,generate_objects) end
[ "def", "create_field_lookup_strings", "(", "field", "=", "nil", ",", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "id", "=", "Validator", ".", "validate_field_lookup_string_arg", "(", "field", ")", "uri", "=", "URI", ".", "parse", "(", "@u...
creates options for Fixed Suggestion, Suggestion, and Option field types. @param field [Fields Object, Hash, String, Integer] Argument must specify the field id (Required) @param data [Single FieldLookupString Object, Array of FieldLookupString Objects] @param generate_objects [Boolean] (Optional) Caution: ...
[ "creates", "options", "for", "Fixed", "Suggestion", "Suggestion", "and", "Option", "field", "types", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L738-L743
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_field_lookup_strings
def update_field_lookup_strings(field=nil,data=nil,generate_objects=false) id = Validator.validate_field_lookup_string_arg(field) uri = URI.parse(@uri + "/Fields" + "/#{id}" + "/FieldLookupStrings") put(uri,data,generate_objects) end
ruby
def update_field_lookup_strings(field=nil,data=nil,generate_objects=false) id = Validator.validate_field_lookup_string_arg(field) uri = URI.parse(@uri + "/Fields" + "/#{id}" + "/FieldLookupStrings") put(uri,data,generate_objects) end
[ "def", "update_field_lookup_strings", "(", "field", "=", "nil", ",", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "id", "=", "Validator", ".", "validate_field_lookup_string_arg", "(", "field", ")", "uri", "=", "URI", ".", "parse", "(", "@u...
Modifies options for Fixed Suggestion, Suggestion, and Option field types. @param field [Fields Object, Hash, String, Integer] Argument must specify the field id (Required) @param data [Single FieldLookupString Object, Array of FieldLookupString Objects] (Required) @param generate_objects [Boolean] (Optional) ...
[ "Modifies", "options", "for", "Fixed", "Suggestion", "Suggestion", "and", "Option", "field", "types", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L759-L764
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.upload_file
def upload_file(file=nil, category=nil, project=nil, generate_objects=false, read_timeout=600, low_priority_processing=false) __upload_file(file, category, ...
ruby
def upload_file(file=nil, category=nil, project=nil, generate_objects=false, read_timeout=600, low_priority_processing=false) __upload_file(file, category, ...
[ "def", "upload_file", "(", "file", "=", "nil", ",", "category", "=", "nil", ",", "project", "=", "nil", ",", "generate_objects", "=", "false", ",", "read_timeout", "=", "600", ",", "low_priority_processing", "=", "false", ")", "__upload_file", "(", "file", ...
Uploads a file to OpenAsset. @param file [String] the path to the file being uploaded @param category [Categories Object,String,Integer] containing Target Category ID in OpenAsset (Required) @param project [Projects Object, String, Integer] Project ID in OpenAsset (Specified only when Category is project based) @r...
[ "Uploads", "a", "file", "to", "OpenAsset", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L840-L852
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.replace_file
def replace_file(original_file_object=nil, replacement_file_path='', retain_original_filename_in_oa=false, generate_objects=false) __replace_file(original_file_object, replacement_file_path, ...
ruby
def replace_file(original_file_object=nil, replacement_file_path='', retain_original_filename_in_oa=false, generate_objects=false) __replace_file(original_file_object, replacement_file_path, ...
[ "def", "replace_file", "(", "original_file_object", "=", "nil", ",", "replacement_file_path", "=", "''", ",", "retain_original_filename_in_oa", "=", "false", ",", "generate_objects", "=", "false", ")", "__replace_file", "(", "original_file_object", ",", "replacement_fil...
Replace a file in OpenAsset. @param original_file_object [Single Files Object] (Required) File Object in OA @param replacement_file_path [String] (Required) @param retain_original_filename_in_oa [Boolean] (Optional, Default => false) @param generate_objects [Boolean] Return an array of Files or JSON objects in res...
[ "Replace", "a", "file", "in", "OpenAsset", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L868-L877
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.download_files
def download_files(files=nil,image_size='1',download_location='./Rest_Downloads') # Put single files objects in an array for easy downloading with # the Array class' DownloadHelper module files = [files] unless files.is_a?(Array) files.download(image_size,download_locat...
ruby
def download_files(files=nil,image_size='1',download_location='./Rest_Downloads') # Put single files objects in an array for easy downloading with # the Array class' DownloadHelper module files = [files] unless files.is_a?(Array) files.download(image_size,download_locat...
[ "def", "download_files", "(", "files", "=", "nil", ",", "image_size", "=", "'1'", ",", "download_location", "=", "'./Rest_Downloads'", ")", "files", "=", "[", "files", "]", "unless", "files", ".", "is_a?", "(", "Array", ")", "files", ".", "download", "(", ...
Download Files. @param files [Single Files Object, Array of Files Objects] (Required) @param image_size [Integer, String] (Accepts image size id or postfix string: Defaults to '1' => original image size id) @param download_location [String] (Default: Creates folder called Rest_Downloads in the ...
[ "Download", "Files", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L928-L934
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_files
def update_files(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Files") put(uri,data,generate_objects) end
ruby
def update_files(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Files") put(uri,data,generate_objects) end
[ "def", "update_files", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Files\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Update Files. @param data [Single Files Object, Array of Files Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns Files objects array if generate_ob...
[ "Update", "Files", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L949-L952
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_groups
def create_groups(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Groups") post(uri,data,generate_objects) end
ruby
def create_groups(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Groups") post(uri,data,generate_objects) end
[ "def", "create_groups", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Groups\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create Groups. @param data [Single Groups Object, Array of Groups Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns Groups objects array if generat...
[ "Create", "Groups", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1009-L1012
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_groups
def update_groups(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Groups") put(uri,data,generate_objects) end
ruby
def update_groups(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Groups") put(uri,data,generate_objects) end
[ "def", "update_groups", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Groups\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Update Groups. @param data [Single Groups Object, Array of Groups Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns Groups objects array if generat...
[ "Update", "Groups", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1027-L1030
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_keywords
def create_keywords(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Keywords") post(uri,data,generate_objects) end
ruby
def create_keywords(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Keywords") post(uri,data,generate_objects) end
[ "def", "create_keywords", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Keywords\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create new file Keywords in OpenAsset. @param data [Single Keywords Object, Array of Keywords Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns Key...
[ "Create", "new", "file", "Keywords", "in", "OpenAsset", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1087-L1090
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_keywords
def update_keywords(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Keywords") put(uri,data,generate_objects) end
ruby
def update_keywords(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Keywords") put(uri,data,generate_objects) end
[ "def", "update_keywords", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Keywords\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify file Keywords. @param data [Single Keywords Object, Array of Keywords Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns Keywords objects arr...
[ "Modify", "file", "Keywords", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1105-L1108
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.merge_keywords
def merge_keywords(target,source) uri = URI.parse(@uri + "/Keywords") merge(uri,target,source) end
ruby
def merge_keywords(target,source) uri = URI.parse(@uri + "/Keywords") merge(uri,target,source) end
[ "def", "merge_keywords", "(", "target", ",", "source", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Keywords\"", ")", "merge", "(", "uri", ",", "target", ",", "source", ")", "end" ]
Merge Keywords. @param target [ Keywords Object, id ](Required) @param source [ Array of Keywords objects or ids ](Required) @return [JSON object] HTTP response JSON object. @example rest_client.merge_keywords(keywords_obj,keywords_obj_array) rest_client.merge_keywords('1',['1','2','3'])
[ "Merge", "Keywords", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1138-L1141
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_keyword_categories
def create_keyword_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/KeywordCategories") post(uri,data,generate_objects) end
ruby
def create_keyword_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/KeywordCategories") post(uri,data,generate_objects) end
[ "def", "create_keyword_categories", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/KeywordCategories\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create file keyword categories. @param data [Single KeywordCategories Object, Array of KeywordCategories Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. ...
[ "Create", "file", "keyword", "categories", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1179-L1182
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_keyword_categories
def update_keyword_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/KeywordCategories") put(uri,data,generate_objects) end
ruby
def update_keyword_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/KeywordCategories") put(uri,data,generate_objects) end
[ "def", "update_keyword_categories", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/KeywordCategories\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify file keyword categories. @param data [Single KeywordCategories Object, Array of KeywordCategories Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object.....
[ "Modify", "file", "keyword", "categories", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1197-L1200
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.merge_keyword_categories
def merge_keyword_categories(target,source) uri = URI.parse(@uri + "/KeywordCategories") merge(uri,target,source) end
ruby
def merge_keyword_categories(target,source) uri = URI.parse(@uri + "/KeywordCategories") merge(uri,target,source) end
[ "def", "merge_keyword_categories", "(", "target", ",", "source", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/KeywordCategories\"", ")", "merge", "(", "uri", ",", "target", ",", "source", ")", "end" ]
Merge Keyword Categories. @param target [ Keyword Categories Object, id ](Required) @param source [ Array of Keyword Categories objects or ids ](Required) @return [JSON object] HTTP response JSON object. @example rest_client.merge_keyword_categories(keywords_categories_obj,keyword_categories_obj_array) ...
[ "Merge", "Keyword", "Categories", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1230-L1233
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_photographers
def create_photographers(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Photographers") post(uri,data,generate_objects) end
ruby
def create_photographers(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Photographers") post(uri,data,generate_objects) end
[ "def", "create_photographers", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Photographers\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create Photographers. @param data [Single Photographers Object, Array of Photographers Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns Photograph...
[ "Create", "Photographers", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1271-L1274
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_photographers
def update_photographers(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Photographers") put(uri,data,generate_objects) end
ruby
def update_photographers(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Photographers") put(uri,data,generate_objects) end
[ "def", "update_photographers", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Photographers\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify Photographers. @param data [Single Photographers Object, Array of Photographers Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns Photograph...
[ "Modify", "Photographers", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1289-L1292
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_projects
def create_projects(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Projects") post(uri,data,generate_objects) end
ruby
def create_projects(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Projects") post(uri,data,generate_objects) end
[ "def", "create_projects", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Projects\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create Projects. @param data [Single Projects Object, Array of Projects Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns Projects objects array if...
[ "Create", "Projects", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1345-L1348
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_projects
def update_projects(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Projects") put(uri,data,generate_objects) end
ruby
def update_projects(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Projects") put(uri,data,generate_objects) end
[ "def", "update_projects", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Projects\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify Projects. @param data [Single Projects Object, Array of Projects Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns Projects objects array if...
[ "Modify", "Projects", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1364-L1367
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_project_keywords
def create_project_keywords(data=nil,generate_objects=false) uri = URI.parse(@uri + "/ProjectKeywords") post(uri,data,generate_objects) end
ruby
def create_project_keywords(data=nil,generate_objects=false) uri = URI.parse(@uri + "/ProjectKeywords") post(uri,data,generate_objects) end
[ "def", "create_project_keywords", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/ProjectKeywords\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create Project Keywords. @param data [Single ProjectKeywords Object, Array of ProjectKeywords Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns Pro...
[ "Create", "Project", "Keywords", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1424-L1427
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_project_keywords
def update_project_keywords(data=nil,generate_objects=false) uri = URI.parse(@uri + "/ProjectKeywords") put(uri,data,generate_objects) end
ruby
def update_project_keywords(data=nil,generate_objects=false) uri = URI.parse(@uri + "/ProjectKeywords") put(uri,data,generate_objects) end
[ "def", "update_project_keywords", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/ProjectKeywords\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify Project Keywords. @param data [Single ProjectKeywords Object, Array of ProjectKeywords Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns Pro...
[ "Modify", "Project", "Keywords", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1442-L1445
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.merge_project_keywords
def merge_project_keywords(target,source) uri = URI.parse(@uri + "/ProjectKeywords") merge(uri,target,source) end
ruby
def merge_project_keywords(target,source) uri = URI.parse(@uri + "/ProjectKeywords") merge(uri,target,source) end
[ "def", "merge_project_keywords", "(", "target", ",", "source", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/ProjectKeywords\"", ")", "merge", "(", "uri", ",", "target", ",", "source", ")", "end" ]
Merge Project Keywords @param target [ Project Keywords Object, id ](Required) @param source [ Array of Project Keywords objects or ids ](Required) @return [JSON object] HTTP response JSON object. @example rest_client.merge_project_keywords(project_keywords_obj,project_keywords_obj_array) rest...
[ "Merge", "Project", "Keywords" ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1475-L1478
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_project_keyword_categories
def create_project_keyword_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/ProjectKeywordCategories") post(uri,data,generate_objects) end
ruby
def create_project_keyword_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/ProjectKeywordCategories") post(uri,data,generate_objects) end
[ "def", "create_project_keyword_categories", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/ProjectKeywordCategories\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ...
Create project keyword categories. @param data [Single ProjectKeywordCategories Object, Array of ProjectKeywordCategories Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP respo...
[ "Create", "project", "keyword", "categories", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1516-L1519
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_project_keyword_categories
def update_project_keyword_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/ProjectKeywordCategories") put(uri,data,generate_objects) end
ruby
def update_project_keyword_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/ProjectKeywordCategories") put(uri,data,generate_objects) end
[ "def", "update_project_keyword_categories", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/ProjectKeywordCategories\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", "...
Modify project keyword categories. @param data [Single ProjectKeywordCategories Object, Array of ProjectKeywordCategories Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP respo...
[ "Modify", "project", "keyword", "categories", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1534-L1537
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.merge_project_keyword_categories
def merge_project_keyword_categories(target,source) uri = URI.parse(@uri + "/ProjectKeywordCategories") merge(uri,target,source) end
ruby
def merge_project_keyword_categories(target,source) uri = URI.parse(@uri + "/ProjectKeywordCategories") merge(uri,target,source) end
[ "def", "merge_project_keyword_categories", "(", "target", ",", "source", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/ProjectKeywordCategories\"", ")", "merge", "(", "uri", ",", "target", ",", "source", ")", "end" ]
Merge Project Keyword Categories @param target [ Project Keyword Categories Object, id ](Required) @param source [ Array of Project Keyword Categories objects or ids ](Required) @return [JSON object] HTTP response JSON object. @example rest_client.merge_project_keyword_categories(project_keywords_obj,pr...
[ "Merge", "Project", "Keyword", "Categories" ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1567-L1570
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_employee_keywords
def create_employee_keywords(data=nil,generate_objects=false) uri = URI.parse(@uri + "/EmployeeKeywords") post(uri,data,generate_objects) end
ruby
def create_employee_keywords(data=nil,generate_objects=false) uri = URI.parse(@uri + "/EmployeeKeywords") post(uri,data,generate_objects) end
[ "def", "create_employee_keywords", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/EmployeeKeywords\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create Employee Keywords. @param data [Single EmployeeKeywords Object, Array of EmployeeKeywords Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns ...
[ "Create", "Employee", "Keywords", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1608-L1611
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_employee_keywords
def update_employee_keywords(data=nil,generate_objects=false) uri = URI.parse(@uri + "/EmployeeKeywords") put(uri,data,generate_objects) end
ruby
def update_employee_keywords(data=nil,generate_objects=false) uri = URI.parse(@uri + "/EmployeeKeywords") put(uri,data,generate_objects) end
[ "def", "update_employee_keywords", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/EmployeeKeywords\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify Employee Keywords. @param data [Single EmployeeKeywords Object, Array of EmployeeKeywords Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns ...
[ "Modify", "Employee", "Keywords", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1626-L1629
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.merge_employee_keywords
def merge_employee_keywords(target,source) uri = URI.parse(@uri + "/EmployeeKeywords") merge(uri,target,source) end
ruby
def merge_employee_keywords(target,source) uri = URI.parse(@uri + "/EmployeeKeywords") merge(uri,target,source) end
[ "def", "merge_employee_keywords", "(", "target", ",", "source", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/EmployeeKeywords\"", ")", "merge", "(", "uri", ",", "target", ",", "source", ")", "end" ]
Merge Employee Keywords @param target [ Employee Keywords Object, id ](Required) @param source [ Array of Employee Keywords objects or ids ](Required) @return [JSON object] HTTP response JSON object. @example rest_client.merge_employee_keywords(employee_keywords_obj,employee_keywords_obj_array) ...
[ "Merge", "Employee", "Keywords" ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1659-L1662
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_employee_keyword_categories
def create_employee_keyword_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/EmployeeKeywordCategories") post(uri,data,generate_objects) end
ruby
def create_employee_keyword_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/EmployeeKeywordCategories") post(uri,data,generate_objects) end
[ "def", "create_employee_keyword_categories", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/EmployeeKeywordCategories\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ...
Create employee keyword categories. @param data [Single EmployeeKeywordCategories Object, Array of EmployeeKeywordCategories Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP re...
[ "Create", "employee", "keyword", "categories", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1700-L1703
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_employee_keyword_categories
def update_employee_keyword_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/EmployeeKeywordCategories") put(uri,data,generate_objects) end
ruby
def update_employee_keyword_categories(data=nil,generate_objects=false) uri = URI.parse(@uri + "/EmployeeKeywordCategories") put(uri,data,generate_objects) end
[ "def", "update_employee_keyword_categories", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/EmployeeKeywordCategories\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ...
Modify employee keyword categories. @param data [Single EmployeeKeywordCategories Object, Array of EmployeeKeywordCategories Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP re...
[ "Modify", "employee", "keyword", "categories", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1718-L1721
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.merge_employee_keyword_categories
def merge_employee_keyword_categories(target,source) uri = URI.parse(@uri + "/EmployeeKeywordCategories") merge(uri,target,source) end
ruby
def merge_employee_keyword_categories(target,source) uri = URI.parse(@uri + "/EmployeeKeywordCategories") merge(uri,target,source) end
[ "def", "merge_employee_keyword_categories", "(", "target", ",", "source", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/EmployeeKeywordCategories\"", ")", "merge", "(", "uri", ",", "target", ",", "source", ")", "end" ]
Merge Employee Keyword Categories @param target [ Employee Keyword Categories Object, id ](Required) @param source [ Array of Employee Keyword Categories objects or ids ](Required) @return [JSON object] HTTP response JSON object. @example rest_client.merge_employee_keyword_categories(employee_keywords_o...
[ "Merge", "Employee", "Keyword", "Categories" ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1751-L1754
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_searches
def create_searches(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Searches") post(uri,data,generate_objects) end
ruby
def create_searches(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Searches") post(uri,data,generate_objects) end
[ "def", "create_searches", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Searches\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create Searches. @param data [Single Searches Object, Array of Searches Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns Searches objects array if...
[ "Create", "Searches", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1792-L1795
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_searches
def update_searches(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Searches") put(uri,data,generate_objects) end
ruby
def update_searches(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Searches") put(uri,data,generate_objects) end
[ "def", "update_searches", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Searches\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify Searches. @param data [Single Searches Object, Array of Searches Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns Searches objects array if...
[ "Modify", "Searches", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1810-L1813
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_image_sizes
def create_image_sizes(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Sizes") post(uri,data,generate_objects) end
ruby
def create_image_sizes(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Sizes") post(uri,data,generate_objects) end
[ "def", "create_image_sizes", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Sizes\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create image Sizes. @param data [Single Sizes Object, Array of Sizes Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns ImageSizes objects array if ...
[ "Create", "image", "Sizes", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1852-L1855
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_image_sizes
def update_image_sizes(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Sizes") put(uri,data,generate_objects) end
ruby
def update_image_sizes(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Sizes") put(uri,data,generate_objects) end
[ "def", "update_image_sizes", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Sizes\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Modify image Sizes. @param data [Single Sizes Object, Array of Sizes Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after updating object @return [JSON object] HTTP response JSON object. Returns ImageSizes objects array if ...
[ "Modify", "image", "Sizes", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1870-L1873
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_users
def create_users(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Users") post(uri,data,generate_objects) end
ruby
def create_users(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Users") post(uri,data,generate_objects) end
[ "def", "create_users", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Users\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create Users. @param data [Single Users Object, Array of Users Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns Users objects array if generate_ob...
[ "Create", "Users", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1954-L1957
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_users
def update_users(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Users") put(uri,data,generate_objects) end
ruby
def update_users(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Users") put(uri,data,generate_objects) end
[ "def", "update_users", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Users\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Update Users. @param data [Single Users Object, Array of Users Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns Users objects array if generate_ob...
[ "Update", "Users", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L1972-L1975
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.create_employees
def create_employees(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Employees") post(uri,data,generate_objects) end
ruby
def create_employees(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Employees") post(uri,data,generate_objects) end
[ "def", "create_employees", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Employees\"", ")", "post", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Create employees. @param data [Single employees Object, Array of employees Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns employees objects arra...
[ "Create", "employees", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L2032-L2035
train
axomic/openasset-rest-ruby
lib/openasset-rest-client.rb
OpenAsset.RestClient.update_employees
def update_employees(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Employees") put(uri,data,generate_objects) end
ruby
def update_employees(data=nil,generate_objects=false) uri = URI.parse(@uri + "/Employees") put(uri,data,generate_objects) end
[ "def", "update_employees", "(", "data", "=", "nil", ",", "generate_objects", "=", "false", ")", "uri", "=", "URI", ".", "parse", "(", "@uri", "+", "\"/Employees\"", ")", "put", "(", "uri", ",", "data", ",", "generate_objects", ")", "end" ]
Update Employees. @param data [Single Users Object, Array of Employees Objects] (Required) @param generate_objects [Boolean] (Optional) Caution: Hurts performance -> Only use if performing further edits after object creation @return [JSON object] HTTP response JSON object. Returns Employees objects array if...
[ "Update", "Employees", "." ]
74215403c8b06343b02fcbfb09f0dd550ef96eb2
https://github.com/axomic/openasset-rest-ruby/blob/74215403c8b06343b02fcbfb09f0dd550ef96eb2/lib/openasset-rest-client.rb#L2050-L2053
train
DigitPaint/roger
lib/roger/server.rb
Roger.Server.set_options
def set_options(options) self.port = options[:port].to_i if options.key?(:port) self.handler = options[:handler] if options.key?(:handler) self.host = options[:host] if options.key?(:host) self.auto_port = options[:auto_port] if options.key?(:auto_port) end
ruby
def set_options(options) self.port = options[:port].to_i if options.key?(:port) self.handler = options[:handler] if options.key?(:handler) self.host = options[:host] if options.key?(:host) self.auto_port = options[:auto_port] if options.key?(:auto_port) end
[ "def", "set_options", "(", "options", ")", "self", ".", "port", "=", "options", "[", ":port", "]", ".", "to_i", "if", "options", ".", "key?", "(", ":port", ")", "self", ".", "handler", "=", "options", "[", ":handler", "]", "if", "options", ".", "key?...
Sets the options, this is a separate method as we want to override certain things set in the rogerfile from the commandline
[ "Sets", "the", "options", "this", "is", "a", "separate", "method", "as", "we", "want", "to", "override", "certain", "things", "set", "in", "the", "rogerfile", "from", "the", "commandline" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/server.rb#L57-L62
train
DigitPaint/roger
lib/roger/server.rb
Roger.Server.free_port_for_host_above
def free_port_for_host_above(host, port) test_port = port test_port += 1 until port_free?(host, test_port) || port + 100 <= test_port test_port end
ruby
def free_port_for_host_above(host, port) test_port = port test_port += 1 until port_free?(host, test_port) || port + 100 <= test_port test_port end
[ "def", "free_port_for_host_above", "(", "host", ",", "port", ")", "test_port", "=", "port", "test_port", "+=", "1", "until", "port_free?", "(", "host", ",", "test_port", ")", "||", "port", "+", "100", "<=", "test_port", "test_port", "end" ]
Get the first free port for host above port Will only ever test 100 ports.
[ "Get", "the", "first", "free", "port", "for", "host", "above", "port", "Will", "only", "ever", "test", "100", "ports", "." ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/server.rb#L132-L136
train
DigitPaint/roger
lib/roger/server.rb
Roger.Server.port_free?
def port_free?(host, port) Addrinfo.tcp(host, port).listen.close true rescue SocketError, Errno::EADDRINUSE, Errno::EACCES false end
ruby
def port_free?(host, port) Addrinfo.tcp(host, port).listen.close true rescue SocketError, Errno::EADDRINUSE, Errno::EACCES false end
[ "def", "port_free?", "(", "host", ",", "port", ")", "Addrinfo", ".", "tcp", "(", "host", ",", "port", ")", ".", "listen", ".", "close", "true", "rescue", "SocketError", ",", "Errno", "::", "EADDRINUSE", ",", "Errno", "::", "EACCES", "false", "end" ]
See if a certain port is free on a certain host
[ "See", "if", "a", "certain", "port", "is", "free", "on", "a", "certain", "host" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/server.rb#L139-L145
train
DigitPaint/roger
lib/roger/server.rb
Roger.Server.detect_valid_handler
def detect_valid_handler(servers) handler = nil while (server_name = servers.shift) && handler.nil? begin handler = ::Rack::Handler.get(server_name) return [handler, server_name] rescue LoadError handler = nil rescue NameError handler = nil ...
ruby
def detect_valid_handler(servers) handler = nil while (server_name = servers.shift) && handler.nil? begin handler = ::Rack::Handler.get(server_name) return [handler, server_name] rescue LoadError handler = nil rescue NameError handler = nil ...
[ "def", "detect_valid_handler", "(", "servers", ")", "handler", "=", "nil", "while", "(", "server_name", "=", "servers", ".", "shift", ")", "&&", "handler", ".", "nil?", "begin", "handler", "=", "::", "Rack", "::", "Handler", ".", "get", "(", "server_name",...
See what handlers work
[ "See", "what", "handlers", "work" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/server.rb#L202-L214
train
DigitPaint/roger
lib/roger/template.rb
Roger.Template.render_with_tilt_template
def render_with_tilt_template(template_class, src, locals, &_block) @current_tilt_template = template_class template = template_class.new(source_path) { src } block_content = if block_given? yield else "" end ...
ruby
def render_with_tilt_template(template_class, src, locals, &_block) @current_tilt_template = template_class template = template_class.new(source_path) { src } block_content = if block_given? yield else "" end ...
[ "def", "render_with_tilt_template", "(", "template_class", ",", "src", ",", "locals", ",", "&", "_block", ")", "@current_tilt_template", "=", "template_class", "template", "=", "template_class", ".", "new", "(", "source_path", ")", "{", "src", "}", "block_content"...
Render source with a specific tilt template class
[ "Render", "source", "with", "a", "specific", "tilt", "template", "class" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/template.rb#L70-L87
train
DigitPaint/roger
lib/roger/template.rb
Roger.Template.extract_front_matter
def extract_front_matter(source) fm_regex = /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m return [{}, source] unless match = source.match(fm_regex) source = source.sub(fm_regex, "") begin data = (YAML.safe_load(match[1]) || {}).inject({}) do |memo, (k, v)| memo[k.to_sym] = v ...
ruby
def extract_front_matter(source) fm_regex = /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m return [{}, source] unless match = source.match(fm_regex) source = source.sub(fm_regex, "") begin data = (YAML.safe_load(match[1]) || {}).inject({}) do |memo, (k, v)| memo[k.to_sym] = v ...
[ "def", "extract_front_matter", "(", "source", ")", "fm_regex", "=", "/", "\\A", "\\s", "\\n", "\\n", "\\s", "\\n", "/m", "return", "[", "{", "}", ",", "source", "]", "unless", "match", "=", "source", ".", "match", "(", "fm_regex", ")", "source", "=", ...
Get the front matter portion of the file and extract it.
[ "Get", "the", "front", "matter", "portion", "of", "the", "file", "and", "extract", "it", "." ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/template.rb#L90-L110
train
DigitPaint/roger
lib/roger/release.rb
Roger.Release.use
def use(processor, options = {}) @stack << [self.class.get_callable(processor, Roger::Release::Processors.map), options] end
ruby
def use(processor, options = {}) @stack << [self.class.get_callable(processor, Roger::Release::Processors.map), options] end
[ "def", "use", "(", "processor", ",", "options", "=", "{", "}", ")", "@stack", "<<", "[", "self", ".", "class", ".", "get_callable", "(", "processor", ",", "Roger", "::", "Release", "::", "Processors", ".", "map", ")", ",", "options", "]", "end" ]
Use a certain pre-processor @examples release.use :sprockets, sprockets_config
[ "Use", "a", "certain", "pre", "-", "processor" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/release.rb#L112-L114
train
DigitPaint/roger
lib/roger/release.rb
Roger.Release.run!
def run! project.mode = :release # Validate paths validate_paths! # Extract mockup copy_source_path_to_build_path! validate_stack! # Run stack run_stack! # Cleanup cleanup! if config[:cleanup_build] ensure project.mode = nil end
ruby
def run! project.mode = :release # Validate paths validate_paths! # Extract mockup copy_source_path_to_build_path! validate_stack! # Run stack run_stack! # Cleanup cleanup! if config[:cleanup_build] ensure project.mode = nil end
[ "def", "run!", "project", ".", "mode", "=", ":release", "validate_paths!", "copy_source_path_to_build_path!", "validate_stack!", "run_stack!", "cleanup!", "if", "config", "[", ":cleanup_build", "]", "ensure", "project", ".", "mode", "=", "nil", "end" ]
Actually perform the release
[ "Actually", "perform", "the", "release" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/release.rb#L171-L189
train
DigitPaint/roger
lib/roger/cli/serve.rb
Roger.Cli::Serve.serve
def serve server_options = {} options.each { |k, v| server_options[k.to_sym] = v } server_options[:server] = {} [:port, :handler, :host].each do |k| server_options[:server][k] = server_options.delete(k) if server_options.key?(k) end @project.server.set_options(server_options...
ruby
def serve server_options = {} options.each { |k, v| server_options[k.to_sym] = v } server_options[:server] = {} [:port, :handler, :host].each do |k| server_options[:server][k] = server_options.delete(k) if server_options.key?(k) end @project.server.set_options(server_options...
[ "def", "serve", "server_options", "=", "{", "}", "options", ".", "each", "{", "|", "k", ",", "v", "|", "server_options", "[", "k", ".", "to_sym", "]", "=", "v", "}", "server_options", "[", ":server", "]", "=", "{", "}", "[", ":port", ",", ":handler...
The handler to use
[ "The", "handler", "to", "use" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/cli/serve.rb#L10-L19
train
DigitPaint/roger
lib/roger/rogerfile.rb
Roger.Rogerfile.load
def load return unless File.exist?(@path) && !loaded? @source = File.read(@path) context = Context.new(self) eval @source, context.binding, @path.to_s, 1 # rubocop:disable Lint/Eval @loaded = true end
ruby
def load return unless File.exist?(@path) && !loaded? @source = File.read(@path) context = Context.new(self) eval @source, context.binding, @path.to_s, 1 # rubocop:disable Lint/Eval @loaded = true end
[ "def", "load", "return", "unless", "File", ".", "exist?", "(", "@path", ")", "&&", "!", "loaded?", "@source", "=", "File", ".", "read", "(", "@path", ")", "context", "=", "Context", ".", "new", "(", "self", ")", "eval", "@source", ",", "context", "."...
Actually load the rogerfile
[ "Actually", "load", "the", "rogerfile" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/rogerfile.rb#L36-L43
train
DigitPaint/roger
lib/roger/renderer.rb
Roger.Renderer.render
def render(path, options = {}, &block) template, layout = template_and_layout_for_render(path, options) # Set new current template template_nesting.push(template) # Copy data to our data store. A bit clunky; as this should be inherited @data = {}.update(@data).update(template.data) ...
ruby
def render(path, options = {}, &block) template, layout = template_and_layout_for_render(path, options) # Set new current template template_nesting.push(template) # Copy data to our data store. A bit clunky; as this should be inherited @data = {}.update(@data).update(template.data) ...
[ "def", "render", "(", "path", ",", "options", "=", "{", "}", ",", "&", "block", ")", "template", ",", "layout", "=", "template_and_layout_for_render", "(", "path", ",", "options", ")", "template_nesting", ".", "push", "(", "template", ")", "@data", "=", ...
The render function The render function will take care of rendering the right thing in the right context. It will: - Wrap templates with layouts if it's defined in the frontmatter and load them from the right layout path. - Render only partials if called from within an existing template If you just want to r...
[ "The", "render", "function" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/renderer.rb#L122-L143
train
DigitPaint/roger
lib/roger/renderer.rb
Roger.Renderer.render_file
def render_file(path, options = {}) pn = absolute_path_from_current_template(path) template = template(pn.to_s, nil) # Track rendered file also on the rendered stack template_nesting.push(template) template.render(options[:locals] || {}) ensure # Only pop the template from the...
ruby
def render_file(path, options = {}) pn = absolute_path_from_current_template(path) template = template(pn.to_s, nil) # Track rendered file also on the rendered stack template_nesting.push(template) template.render(options[:locals] || {}) ensure # Only pop the template from the...
[ "def", "render_file", "(", "path", ",", "options", "=", "{", "}", ")", "pn", "=", "absolute_path_from_current_template", "(", "path", ")", "template", "=", "template", "(", "pn", ".", "to_s", ",", "nil", ")", "template_nesting", ".", "push", "(", "template...
Render any file on disk. No magic. Just rendering. A couple of things to keep in mind: - The file will be rendered in this rendering context - Does not have layouts or block style - When you pass a relative path and we are within another template it will be relative to that template. @options options [Hash] :...
[ "Render", "any", "file", "on", "disk", ".", "No", "magic", ".", "Just", "rendering", "." ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/renderer.rb#L154-L167
train
DigitPaint/roger
lib/roger/renderer.rb
Roger.Renderer.layout_for_template
def layout_for_template(template, options) layout_name = if template.data.key?(:layout) template.data[:layout] else get_default_layout(template, options) end # Only attempt to load layout when: # - Template is the top...
ruby
def layout_for_template(template, options) layout_name = if template.data.key?(:layout) template.data[:layout] else get_default_layout(template, options) end # Only attempt to load layout when: # - Template is the top...
[ "def", "layout_for_template", "(", "template", ",", "options", ")", "layout_name", "=", "if", "template", ".", "data", ".", "key?", "(", ":layout", ")", "template", ".", "data", "[", ":layout", "]", "else", "get_default_layout", "(", "template", ",", "option...
Gets the layout for a specific template
[ "Gets", "the", "layout", "for", "a", "specific", "template" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/renderer.rb#L211-L224
train
DigitPaint/roger
lib/roger/renderer.rb
Roger.Renderer.prevent_recursion!
def prevent_recursion!(template) # If this template is not a real file it cannot ever conflict. return unless template.real_source_path caller_templates = template_nesting.select do |t| t.real_source_path == template.real_source_path end # We're good, no deeper recursion then MAX...
ruby
def prevent_recursion!(template) # If this template is not a real file it cannot ever conflict. return unless template.real_source_path caller_templates = template_nesting.select do |t| t.real_source_path == template.real_source_path end # We're good, no deeper recursion then MAX...
[ "def", "prevent_recursion!", "(", "template", ")", "return", "unless", "template", ".", "real_source_path", "caller_templates", "=", "template_nesting", ".", "select", "do", "|", "t", "|", "t", ".", "real_source_path", "==", "template", ".", "real_source_path", "e...
Will check the template nesting if we haven't already rendered this path before. If it has we'll throw an argumenteerror
[ "Will", "check", "the", "template", "nesting", "if", "we", "haven", "t", "already", "rendered", "this", "path", "before", ".", "If", "it", "has", "we", "ll", "throw", "an", "argumenteerror" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/renderer.rb#L237-L252
train
DigitPaint/roger
lib/roger/renderer.rb
Roger.Renderer.template
def template(path, source, type = :template) if source template = Template.new(source, @context, source_path: path) else template_path = case type when :partial find_partial(path) when :layout ...
ruby
def template(path, source, type = :template) if source template = Template.new(source, @context, source_path: path) else template_path = case type when :partial find_partial(path) when :layout ...
[ "def", "template", "(", "path", ",", "source", ",", "type", "=", ":template", ")", "if", "source", "template", "=", "Template", ".", "new", "(", "source", ",", "@context", ",", "source_path", ":", "path", ")", "else", "template_path", "=", "case", "type"...
Will instantiate a Template or throw an ArgumentError if it could not find the template
[ "Will", "instantiate", "a", "Template", "or", "throw", "an", "ArgumentError", "if", "it", "could", "not", "find", "the", "template" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/renderer.rb#L256-L279
train
DigitPaint/roger
lib/roger/renderer.rb
Roger.Renderer.find_partial
def find_partial(name) current_path, current_ext = current_template_path_and_extension # Try to find _ named partials first. # This will alaso search for partials relative to the current path local_name = [File.dirname(name), "_" + File.basename(name)].join("/") resolver = Resolver.new([F...
ruby
def find_partial(name) current_path, current_ext = current_template_path_and_extension # Try to find _ named partials first. # This will alaso search for partials relative to the current path local_name = [File.dirname(name), "_" + File.basename(name)].join("/") resolver = Resolver.new([F...
[ "def", "find_partial", "(", "name", ")", "current_path", ",", "current_ext", "=", "current_template_path_and_extension", "local_name", "=", "[", "File", ".", "dirname", "(", "name", ")", ",", "\"_\"", "+", "File", ".", "basename", "(", "name", ")", "]", ".",...
Find a partial
[ "Find", "a", "partial" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/renderer.rb#L288-L302
train
DigitPaint/roger
lib/roger/renderer.rb
Roger.Renderer.prepare_context
def prepare_context(env) context = Roger::Template::TemplateContext.new(self, env) # Extend context with all helpers self.class.helpers.each do |mod| context.extend(mod) end context end
ruby
def prepare_context(env) context = Roger::Template::TemplateContext.new(self, env) # Extend context with all helpers self.class.helpers.each do |mod| context.extend(mod) end context end
[ "def", "prepare_context", "(", "env", ")", "context", "=", "Roger", "::", "Template", "::", "TemplateContext", ".", "new", "(", "self", ",", "env", ")", "self", ".", "class", ".", "helpers", ".", "each", "do", "|", "mod", "|", "context", ".", "extend",...
Will set up a new template context for this renderer
[ "Will", "set", "up", "a", "new", "template", "context", "for", "this", "renderer" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/renderer.rb#L325-L334
train
DigitPaint/roger
lib/roger/release/processors/mockup.rb
Roger::Release::Processors.Mockup.run_on_file
def run_on_file(file_path, env = {}) renderer = Roger::Renderer.new( env.dup, partials_path: project.partial_path, layouts_path: project.layouts_path ) renderer.render(file_path, project.options[:renderer] || {}) end
ruby
def run_on_file(file_path, env = {}) renderer = Roger::Renderer.new( env.dup, partials_path: project.partial_path, layouts_path: project.layouts_path ) renderer.render(file_path, project.options[:renderer] || {}) end
[ "def", "run_on_file", "(", "file_path", ",", "env", "=", "{", "}", ")", "renderer", "=", "Roger", "::", "Renderer", ".", "new", "(", "env", ".", "dup", ",", "partials_path", ":", "project", ".", "partial_path", ",", "layouts_path", ":", "project", ".", ...
Runs the template on a single file and return processed source.
[ "Runs", "the", "template", "on", "a", "single", "file", "and", "return", "processed", "source", "." ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/release/processors/mockup.rb#L59-L66
train
DigitPaint/roger
lib/roger/resolver.rb
Roger.Resolver.find_template_path
def find_template_path(name, options = {}) options = { prefer: "html", # Prefer a template with extension }.update(options) path = sanitize_name(name, options[:prefer]) # Exact match return Pathname.new(path) if File.exist?(path) # Split extension and path path_exten...
ruby
def find_template_path(name, options = {}) options = { prefer: "html", # Prefer a template with extension }.update(options) path = sanitize_name(name, options[:prefer]) # Exact match return Pathname.new(path) if File.exist?(path) # Split extension and path path_exten...
[ "def", "find_template_path", "(", "name", ",", "options", "=", "{", "}", ")", "options", "=", "{", "prefer", ":", "\"html\"", ",", "}", ".", "update", "(", "options", ")", "path", "=", "sanitize_name", "(", "name", ",", "options", "[", ":prefer", "]", ...
Finds the template path for "name"
[ "Finds", "the", "template", "path", "for", "name" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/resolver.rb#L117-L145
train
DigitPaint/roger
lib/roger/resolver.rb
Roger.Resolver.filter_files
def filter_files(files, path, path_without_extension, template_extensions) results = [] files.each do |file| match = if file.start_with?(path) path else path_without_extension end processable_extensions = file[(match.lengt...
ruby
def filter_files(files, path, path_without_extension, template_extensions) results = [] files.each do |file| match = if file.start_with?(path) path else path_without_extension end processable_extensions = file[(match.lengt...
[ "def", "filter_files", "(", "files", ",", "path", ",", "path_without_extension", ",", "template_extensions", ")", "results", "=", "[", "]", "files", ".", "each", "do", "|", "file", "|", "match", "=", "if", "file", ".", "start_with?", "(", "path", ")", "p...
Filter a list of files to see wether or not we can process them. Will take into account that the longest match with path will be the first result.
[ "Filter", "a", "list", "of", "files", "to", "see", "wether", "or", "not", "we", "can", "process", "them", ".", "Will", "take", "into", "account", "that", "the", "longest", "match", "with", "path", "will", "be", "the", "first", "result", "." ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/resolver.rb#L150-L176
train
DigitPaint/roger
lib/roger/resolver.rb
Roger.Resolver.sanitize_name
def sanitize_name(name, prefer = nil) path = name.to_s # Check if we haven't got an extension # we'll assume you're looking for prefer or "html" otherwise path += ".#{prefer || 'html'}" unless File.basename(path).include?(".") path end
ruby
def sanitize_name(name, prefer = nil) path = name.to_s # Check if we haven't got an extension # we'll assume you're looking for prefer or "html" otherwise path += ".#{prefer || 'html'}" unless File.basename(path).include?(".") path end
[ "def", "sanitize_name", "(", "name", ",", "prefer", "=", "nil", ")", "path", "=", "name", ".", "to_s", "path", "+=", "\".#{prefer || 'html'}\"", "unless", "File", ".", "basename", "(", "path", ")", ".", "include?", "(", "\".\"", ")", "path", "end" ]
Check if the name is a directory and append index Append preferred extension or html if it doesn't have one yet
[ "Check", "if", "the", "name", "is", "a", "directory", "and", "append", "index", "Append", "preferred", "extension", "or", "html", "if", "it", "doesn", "t", "have", "one", "yet" ]
1153119f170d1b0289b659a52fcbf054df2d9633
https://github.com/DigitPaint/roger/blob/1153119f170d1b0289b659a52fcbf054df2d9633/lib/roger/resolver.rb#L180-L188
train
para-cms/para
lib/para/cloneable.rb
Para.Cloneable.build_clone_callback
def build_clone_callback(callback) case callback when Proc callback when Symbol ->(original, clone) { original.send(callback, clone) if original.respond_to?(callback, true) } end end
ruby
def build_clone_callback(callback) case callback when Proc callback when Symbol ->(original, clone) { original.send(callback, clone) if original.respond_to?(callback, true) } end end
[ "def", "build_clone_callback", "(", "callback", ")", "case", "callback", "when", "Proc", "callback", "when", "Symbol", "->", "(", "original", ",", "clone", ")", "{", "original", ".", "send", "(", "callback", ",", "clone", ")", "if", "original", ".", "respo...
We ensure that the passed callback is actually callable on the object we're cloning. This is needed for associations because deep_cloneable calls the callback for every associated object.
[ "We", "ensure", "that", "the", "passed", "callback", "is", "actually", "callable", "on", "the", "object", "we", "re", "cloning", ".", "This", "is", "needed", "for", "associations", "because", "deep_cloneable", "calls", "the", "callback", "for", "every", "assoc...
97364cf5ec91225d7f1a7665c47cd65514f2b072
https://github.com/para-cms/para/blob/97364cf5ec91225d7f1a7665c47cd65514f2b072/lib/para/cloneable.rb#L36-L45
train
ManageIQ/more_core_extensions
lib/more_core_extensions/core_ext/benchmark/realtime_store.rb
MoreCoreExtensions.BenchmarkRealtimeStore.realtime_store
def realtime_store(hash, key) ret = nil r0 = Time.now begin ret = yield ensure r1 = Time.now hash[key] = (hash[key] || 0) + (r1.to_f - r0.to_f) end ret end
ruby
def realtime_store(hash, key) ret = nil r0 = Time.now begin ret = yield ensure r1 = Time.now hash[key] = (hash[key] || 0) + (r1.to_f - r0.to_f) end ret end
[ "def", "realtime_store", "(", "hash", ",", "key", ")", "ret", "=", "nil", "r0", "=", "Time", ".", "now", "begin", "ret", "=", "yield", "ensure", "r1", "=", "Time", ".", "now", "hash", "[", "key", "]", "=", "(", "hash", "[", "key", "]", "||", "0...
Stores the elapsed real time used to execute the given block in the given hash for the given key and returns the result from the block. If the hash already has a value for that key, the time is accumulated. timings = {} Benchmark.realtime_store(timings, :sleep) { sleep 2; "foo" } # => "foo" timings # => {...
[ "Stores", "the", "elapsed", "real", "time", "used", "to", "execute", "the", "given", "block", "in", "the", "given", "hash", "for", "the", "given", "key", "and", "returns", "the", "result", "from", "the", "block", ".", "If", "the", "hash", "already", "has...
13f97a2a07155354117ea638eb0892fad09d5e44
https://github.com/ManageIQ/more_core_extensions/blob/13f97a2a07155354117ea638eb0892fad09d5e44/lib/more_core_extensions/core_ext/benchmark/realtime_store.rb#L16-L26
train